aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVisuwesh2024-10-09 19:36:18 +0530
committerTassilo Horn2024-10-10 12:33:06 +0200
commit9ddeeda8ce156201ea3c8cc8d6b388efb4d80bef (patch)
treed948706d4b34d540d85f01d34dcd29366cdf696e
parent58bcd1dbe0b70a331747ccfd2f9e5cf8790849a1 (diff)
downloademacs-9ddeeda8ce156201ea3c8cc8d6b388efb4d80bef.tar.gz
emacs-9ddeeda8ce156201ea3c8cc8d6b388efb4d80bef.zip
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)
-rw-r--r--doc/emacs/misc.texi15
-rw-r--r--etc/NEWS8
-rw-r--r--lisp/doc-view.el2
3 files changed, 16 insertions, 9 deletions
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 83b83ea7ae9..f618dadc0d6 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -586,12 +586,15 @@ default size for DocView, customize the variable
586@vindex doc-view-djvused-program 586@vindex doc-view-djvused-program
587 DocView can generate an outline menu for PDF and DjVu documents using 587 DocView can generate an outline menu for PDF and DjVu documents using
588the @command{mutool} and the @command{djvused} programs, respectively, 588the @command{mutool} and the @command{djvused} programs, respectively,
589when they are available. This uses the @code{imenu} facility 589when they are available. The outline for Open Document Format files as
590(@pxref{Imenu}). You can customize how the @code{imenu} items for this 590used by OpenOffice and LibreOffice are also generated using the
591outline are formatted and displayed using the variables 591@command{mutool} after they are converted to PDF. This uses the
592@code{doc-view-imenu-format} and @code{doc-view-imenu-flatten}. The 592@code{imenu} facility (@pxref{Imenu}). You can customize how the
593filename of the @command{djvused} program can be customized by changing 593@code{imenu} items for this outline are formatted and displayed using
594the @code{doc-view-djvused-program} user option. 594the variables @code{doc-view-imenu-format} and
595@code{doc-view-imenu-flatten}. The filename of the @command{djvused}
596program can be customized by changing the
597@code{doc-view-djvused-program} user option.
595 598
596@cindex registers, in DocView mode 599@cindex registers, in DocView mode
597@findex doc-view-page-to-register 600@findex doc-view-page-to-register
diff --git a/etc/NEWS b/etc/NEWS
index e57991901c5..e14efad8199 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -390,10 +390,12 @@ command 'doc-view-page-to-register' (bound to 'm'), and later the stored
390page can be restored with 'doc-view-jump-to-register' (bound to '''). 390page can be restored with 'doc-view-jump-to-register' (bound to ''').
391 391
392+++ 392+++
393*** Docview can generate imenu index for DjVu files. 393*** Docview can generate imenu index for DjVu and ODF documents.
394When the 'djvused' program is available, Docview can now generate imenu 394When the 'djvused' program is available, Docview can now generate imenu
395index for DjVu files from its outline. 395index for DjVu files from its outline. Index for Open Document Format
396The name of the 'djvused' program can be customized by changing the user 396(ODF) files as used by OpenOffice and LibreOffice are generated using
397the 'mutool' program after their initial conversion to PDF format. The
398name of the 'djvused' program can be customized by changing the user
397option 'doc-view-djvused-program'. 399option 'doc-view-djvused-program'.
398 400
399** Tramp 401** Tramp
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 57a24418616..bbfbbdec925 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -2103,6 +2103,8 @@ If FILE-NAME is nil, use the current file instead."
2103 ('djvu 2103 ('djvu
2104 (when doc-view-djvused-program 2104 (when doc-view-djvused-program
2105 (doc-view--djvu-outline file-name))) 2105 (doc-view--djvu-outline file-name)))
2106 ('odf
2107 (doc-view--pdf-outline (doc-view-current-cache-doc-pdf)))
2106 (_ 2108 (_
2107 (doc-view--pdf-outline file-name))))) 2109 (doc-view--pdf-outline file-name)))))
2108 (when outline (imenu-add-to-menubar "Outline")) 2110 (when outline (imenu-add-to-menubar "Outline"))