]> git.eshelyaron.com Git - emacs.git/commitdiff
Add imenu support for ODF files in doc-view
authorVisuwesh <visuweshm@gmail.com>
Wed, 9 Oct 2024 14:06:18 +0000 (19:36 +0530)
committerEshel Yaron <me@eshelyaron.com>
Mon, 14 Oct 2024 17:38:08 +0000 (19:38 +0200)
* 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)

(cherry picked from commit 9ddeeda8ce156201ea3c8cc8d6b388efb4d80bef)

doc/emacs/misc.texi
etc/NEWS
lisp/doc-view.el

index d995d2e52970d0597ba9a05d7d7dc14a72cfc432..288beeaf50c53381525e08b2491e167968f6d423 100644 (file)
@@ -586,12 +586,15 @@ default size for DocView, customize the variable
 @vindex doc-view-djvused-program
   DocView can generate an outline menu for PDF and DjVu documents using
 the @command{mutool} and the @command{djvused} programs, respectively,
-when they are available.  This uses the @code{imenu} facility
-(@pxref{Imenu}).  You can customize how the @code{imenu} items for this
-outline are formatted and displayed using 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.
+when they are available.  The outline for Open Document Format files as
+used by OpenOffice and LibreOffice are also generated using the
+@command{mutool} after they are converted to PDF.  This uses the
+@code{imenu} facility (@pxref{Imenu}).  You can customize how the
+@code{imenu} items for this outline are formatted and displayed using
+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.
 
 @node DocView Searching
 @subsection DocView Searching
index 66d822eda2e78d28faaa8f471bc348feb94895b6..7bb4d60ac06935e0d26ae571efebc59bd8e3e74f 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -334,10 +334,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 ''').
 
 +++
-*** 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
-index for DjVu files from its outline.
-The name of the 'djvused' program can be customized by changing the user
+index for DjVu files from its outline.  Index for Open Document Format
+(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'.
 
 ** Tramp
index 392f4b5e506b0bff56d570d325858e538b210dc6..e56f4bc3f8ec64e54bb6ea087b97ee48e35f0b6e 100644 (file)
@@ -2100,6 +2100,8 @@ If FILE-NAME is nil, use the current file instead."
            ('djvu
             (when doc-view-djvused-program
               (doc-view--djvu-outline file-name)))
+           ('odf
+            (doc-view--pdf-outline (doc-view-current-cache-doc-pdf)))
            (_
             (doc-view--pdf-outline file-name)))))
     (when outline (imenu-add-to-menubar "Outline"))