1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Add imenu support for ODF files in doc-view

* lisp/doc-view.el (doc-view--outline): Pass the right file to
doc-view--pdf-outline.
* doc/emacs/misc.texi (DocView Navigation): Mention support for
Open Format Document (ODF) files too.
* etc/NEWS: Announce the change.  (bug#73719)
This commit is contained in:
Visuwesh 2024-10-09 19:36:18 +05:30 committed by Tassilo Horn
parent 58bcd1dbe0
commit 9ddeeda8ce
3 changed files with 16 additions and 9 deletions

View file

@ -586,12 +586,15 @@ default size for DocView, customize the variable
@vindex doc-view-djvused-program @vindex doc-view-djvused-program
DocView can generate an outline menu for PDF and DjVu documents using DocView can generate an outline menu for PDF and DjVu documents using
the @command{mutool} and the @command{djvused} programs, respectively, the @command{mutool} and the @command{djvused} programs, respectively,
when they are available. This uses the @code{imenu} facility when they are available. The outline for Open Document Format files as
(@pxref{Imenu}). You can customize how the @code{imenu} items for this used by OpenOffice and LibreOffice are also generated using the
outline are formatted and displayed using the variables @command{mutool} after they are converted to PDF. This uses the
@code{doc-view-imenu-format} and @code{doc-view-imenu-flatten}. The @code{imenu} facility (@pxref{Imenu}). You can customize how the
filename of the @command{djvused} program can be customized by changing @code{imenu} items for this outline are formatted and displayed using
the @code{doc-view-djvused-program} user option. the variables @code{doc-view-imenu-format} and
@code{doc-view-imenu-flatten}. The filename of the @command{djvused}
program can be customized by changing the
@code{doc-view-djvused-program} user option.
@cindex registers, in DocView mode @cindex registers, in DocView mode
@findex doc-view-page-to-register @findex doc-view-page-to-register

View file

@ -390,10 +390,12 @@ command 'doc-view-page-to-register' (bound to 'm'), and later the stored
page can be restored with 'doc-view-jump-to-register' (bound to '''). page can be restored with 'doc-view-jump-to-register' (bound to ''').
+++ +++
*** Docview can generate imenu index for DjVu files. *** Docview can generate imenu index for DjVu and ODF documents.
When the 'djvused' program is available, Docview can now generate imenu When the 'djvused' program is available, Docview can now generate imenu
index for DjVu files from its outline. index for DjVu files from its outline. Index for Open Document Format
The name of the 'djvused' program can be customized by changing the user (ODF) files as used by OpenOffice and LibreOffice are generated using
the 'mutool' program after their initial conversion to PDF format. The
name of the 'djvused' program can be customized by changing the user
option 'doc-view-djvused-program'. option 'doc-view-djvused-program'.
** Tramp ** Tramp

View file

@ -2103,6 +2103,8 @@ If FILE-NAME is nil, use the current file instead."
('djvu ('djvu
(when doc-view-djvused-program (when doc-view-djvused-program
(doc-view--djvu-outline file-name))) (doc-view--djvu-outline file-name)))
('odf
(doc-view--pdf-outline (doc-view-current-cache-doc-pdf)))
(_ (_
(doc-view--pdf-outline file-name))))) (doc-view--pdf-outline file-name)))))
(when outline (imenu-add-to-menubar "Outline")) (when outline (imenu-add-to-menubar "Outline"))