* lisp/doc-view.el (doc-view--djvu-outline): Pass -u to djvused
to make it emit UTF-8 encoded text rather than using octal
escapes for non-ASCII string. (bug#73846)
* 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)
Do away with parsing the output of "mutool show FILE outline"
since the URI reported in its output may not include the page
number of the heading, and instead may contained "nameddest"
elements which cannot be resolved using "mutool". Instead, use
a MuPDF JS script to generate the PDF outline allowing to
resolve such URIs.
* lisp/doc-view.el (doc-view--outline-rx): Remove as no longer
needed.
(doc-view--outline): Reflect that outline can be generated for
non-PDF files too.
(doc-view--mutool-pdf-outline-script): Add new variable to hold
the JS script used to generate the outline.
(doc-view--pdf-outline): Use the script. (bug#73638)
* lisp/doc-view.el (doc-view-pdfdraw-program): Prefer mutool
over other names.
(doc-view-imenu-enabled): Tweak the default value to check for
'djvused', and make it obsolete.
(doc-view--djvu-outline, doc-view--parse-djvu-outline): Add new
functions to return imenu index for a Djvu file.
(doc-view--outline): Add new function to create the imenu index
depending on the file type.
(doc-view--outline): Document new possible variable value.
(doc-view-imenu-index): Use the above function instead.
(doc-view-imenu-setup): Try to create the imenu index
unconditionally.
* doc/emacs/misc.texi (DocView Navigation): Mention index
creation using 'djvused' too.
* etc/NEWS: Announce the change. (Bug#73530)
* lisp/doc-view.el (doc-view-register-alist): New defvar to keep
track of buffer-local register-alist.
(doc-view-page-to-register, doc-view-jump-to-register): Add new
commands to set and jump to buffer-local registers.
(register-val-insert, register-val-describe)
(register-val-jump-to): Register defmethod to save and restore
doc-view registers.
(doc-view-mode-map): Bind the new commands.
* doc/emacs/misc.texi (DocView Navigation): Document the new
commands. (Bug#73293)
* etc/NEWS: Announce the change.
* lisp/doc-view.el (doc-view-svg-face): Define black on white as
default value instead of using the current theme's values.
* etc/NEWS: Adjust entry for doc-view-svg-face.
* lisp/doc-view.el (doc-view-new-window-function): Prevent
creation of duplicate overlays for the same window after a
window configuration change occasions a call to i-m-r-winprops.
Here is an updated version of this patch. WDYT?
From 6e32534012cafeda1d7e67aab23a8206bc887c9f Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel@ledu-giraud.fr>
Date: Sun, 21 Jul 2024 18:52:52 +0200
Subject: [PATCH] Use a dedicated buffer for `doc-view-open-text'
* lisp/doc-view.el (doc-view-open-text): Create a new "text
contents" buffer and switch to it.
(doc-view-toggle-display): Switch back to the document buffer
and kill the "text contents" one.
* etc/NEWS: Mention the change.
c66bda1a19 Improve treesit-node-child-by-field-name docstring
85773ab977 Minor copyedits in tree-sitter starting guide
2dacec1609 Update tag for prebuilt tree-sitter grammars
68615a3866 Fix punctuation and doc style in treesit.c
00adee897a ; Fix punctuation in docs
ab29b28d4b Fix DocView with PostScript files
* doc/lispref/commands.texi (Touchscreen Events): Document means
of unconditionally enabling simple conversion.
* lisp/doc-view.el (doc-view-set-slice-using-mouse): Bind
touch-screen-simple-mouse-conversion to t, and read translated
mouse events with read-key rather than read-event.
* lisp/subr.el (read-key): Don't permit idle timer to interfere
with reporting of translated mouse events.
* lisp/touch-screen.el (touch-screen-simple-mouse-conversion):
New variable.
(touch-screen-handle-point-up, touch-screen-handle-touch):
Unconditionally enable `mouse-drag' translation if set. Decide
whether to send drag or mouse events by the values of the two
touchpoints' XY positions and point and double-click-fuzz, as in
make_lispy_event.
* lisp/doc-view.el (doc-view-set-doc-type): Fix CBZ file
detection. (Bug#67133)
This fix is almost identical to the previous fix for ODF file
detection in bug#54947 which resulted in commit
b3ff490538
* lisp/doc-view.el (doc-view-minor-mode-menu): Correct typo in
edit mode menu.
* lisp/net/dictionary.el (dictionary-mode-menu): New menu.
(dictionary-tool-bar-map): New variable; derive menu bar entries
from the dictionary-mode-menu.
(dictionary-mode): Set the tool bar map to
dictionary-tool-bar-map.
* lisp/doc-view.el (doc-view-mode): Detect if file name starts
with /content or /assets, and don't regard it as available to
subprocesses in that case.
* lisp/calendar/calendar.el (calendar-event-buffer): New
function.
(calendar-cursor-to-date, calendar-other-month):
* lisp/calendar/holidays.el (calendar-list-holidays)
(calendar-mark-holidays):
* lisp/calendar/lunar.el (calendar-lunar-phases): Use that
function to derive event windows, in case these commands are
being called from the menu bar.
* lisp/doc-view.el (doc-view-tool-bar-map): Fix typo in help
text.
* lisp/doc-view.el (doc-view-ghostscript-program)
(doc-view--revert-buffer, doc-view--pdf-outline): Compare
'shell-command' / 'call-process' return values with 'eql' instead of
'=' to cater for the situation where the process received a signal.
While 'mutool' supports many filetypes, 'mutool show' only
supports PDF files. This would lead to cryptic imenu errors
when opening other
file types (like EPUB) since we would parse the error output.
During my testing this caused 'imenu--index-alist' to have a
value of '(nil).
* lisp/doc-view.el (doc-view--pdf-outline): Error when 'mutool'
returns an error. Use 'call-process' to get the return value and
remove the call to 'shell-quote-argument' as 'call-process'
doesn't want any escapes.
(doc-view-mode): Handle possible error from 'doc-view-imenu-setup'.
(doc-view-imenu-enabled): Remove superfluous (and ... t).
(doc-view-imenu-setup): Remove check for mutool already ensured by
'doc-view-imenu-enabled' being non-nil.
(Bug#64516)
* etc/NEWS: Announce the new tool bar.
* etc/images/last-page.xpm:
* etc/images/last-page.pbm: New images. Mirrored from
next-page.xpm.
* lisp/doc-view.el (doc-view-menu): Use `doc-view-new-search'
instead of an anonymous function.
(doc-view-tool-bar-map): New keymap.
(doc-view-search): Update the tool bar after initiating a
search.
(doc-view-new-search): New command.
(doc-view-mode): Set the tool bar map appropriately.
* lisp/doc-view.el (doc-view-mupdf-use-svg): Disable by default.
* etc/NEWS: Document. Patch by Visuwesh <visuweshm@gmail.com>.
Do not merge to master.
* lisp/doc-view.el: (doc-view--pdf-outline):
(doc-view-imenu-index):
(doc-view-imenu-setup): Fix multiple empty index generation for
documents without an outline, caching the result (see discussion in
bug#58103).
(doc-view--imenu-subtree): Fix for nested imenus (bug introduced in
commit fe002cc8ce) (bug#58180).
* doc/emacs/misc.texi (DocView Navigation):
* lisp/doc-view.el (doc-view-imenu-title-format, doc-view-imenu-flatten):
(doc-view--imenu-subtree): customizable format for imenu entry titles,
and flag to disable nested submenus.
* lisp/doc-view.el (doc-view--pdf-outline): clean up whitespace
markers '\r' and '\t' in imenu item titles (bug#58131).
* lisp/doc-view.el (doc-view-imenu-enabled): user option to disable
imenu generation.
* lisp/doc-view.el (doc-view--outline-rx):
(doc-view--pdf-outline, doc-view--imenu-subtree, doc-view-imenu-index):
functions implementing the imenu index generation via mutool.
* lisp/doc-view.el (doc-view-imenu-setup, doc-view-mode): setup of the
new functionality in doc-view mode.
* lisp/imenu.el (imenu-submenus-on-top):
(imenu--split-menu): new local variable to optionally inhibit
grouping of entries with children at the top of imenu menus.
* doc/emacs/misc.texi: documentation for the new functionality
(bug#58103).
* lisp/doc-view.el (doc-view-mupdf-use-svg, doc-view-svg-background)
(doc-view-svg-foreground): New user options.
(doc-view-insert-image): Add :background and :foreground image
attributes when display svg images.
(doc-view-set-up-single-converter): Produce svg images when using
mupdf (bug#58041).