Dmitry Gutov [Wed, 9 Oct 2024 23:08:53 +0000 (02:08 +0300)]
Make revision completion in vc-diff and vc-root-diff more predictable
* lisp/vc/vc.el (vc-root-version-diff):
Don't try calling 'vc-deduce-fileset', instead construct a fileset
suitable for the root directory right away. This way the revision
completion for the root diff doesn't depend on the current buffer,
or the file at point (bug#73232).
(vc-diff-build-argument-list-internal): No special case when
invoked on a directory, or when the current file is not "dirty".
Make REV1-DEFAULT a string value.
Eli Zaretskii [Wed, 9 Oct 2024 13:21:08 +0000 (16:21 +0300)]
Avoid segfaults in Rmail-MIME
Rmail-MIME decodes text of email, including removal of
CR characters, but that can segfault if the text of some
MIME part is empty.
* src/coding.c (decode_coding_raw_text):
* lisp/mail/rmailmm.el (rmail-mime-insert-decoded-text): Don't
attempt to decode empty text region.
Dmitry Gutov [Wed, 9 Oct 2024 01:03:51 +0000 (04:03 +0300)]
help-setup-xref: Fix the previous changes
* lisp/help-mode.el (help-setup-xref): Instead of killing all
local variables directly, call the current major mode function, to
preserve its own locals while dropping the rest (bug#73637).
Visuwesh [Sun, 6 Oct 2024 12:32:06 +0000 (18:02 +0530)]
Make imenu index generation for PDFs more reliable
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)
Implement drag-n-drop for w32 with support for files and text
Implement drag-n-drop with IDropTarget for MS-Windows. This
allows for dropping files or text.
* lisp/term/w32-win.el (w32-drag-n-drop): Change to handle
files or strings.
* src/w32fns.c (process_dropfiles): New function to convert
DROPFILES struct to array of strings.
(w32_process_dnd_data): New function to process drop data.
(w32_try_get_data): Extract data from IDataObject.
(w32_createwindow): Assign an IDropTarget to each new frame.
(w32_name_of_message): New message.
(w32_msg_pump): Changed CoInitialize to OleInitialize, needed
by the drag-n-drop functions.
(w32_wnd_proc): New struct w32_drop_target, and
w32_drop_target_* functions to implement the IDropTarget
interface.
* src/w32term.c (w32_read_socket): Handle WM_EMACS_DROP and
remove WM_EMACS_DROPFILES.
* src/w32term.h: New message WM_EMACS_DROP.
(Bug#3468)
Yuan Fu [Tue, 8 Oct 2024 00:24:32 +0000 (17:24 -0700)]
Set treesit-primary-parser for tree-sitter modes
I debated whether to do this, since technically speaking it's
not needed for single-language modes. But ultimately it's
better to be explicit and set a good example with builtin modes.
Dmitry Gutov [Mon, 7 Oct 2024 23:47:15 +0000 (02:47 +0300)]
poject--vc-list-files: Check that the current Emacs is 31+
* lisp/progmodes/project.el (project--vc-list-files):
Check that the current Emacs is 31+, to avoid breakage on remote
hosts with older Git (bug#73320).
Dmitry Gutov [Mon, 7 Oct 2024 23:42:39 +0000 (02:42 +0300)]
Detect Git version on remote hosts separately from the local one
* lisp/vc/vc-git.el (vc-git--program-version): Detect Git version
on remote hosts separately from the local one (buf#73320).
(vc-git-connection-default-profile): Set up collection-local
profile. And use it for the 'vc-git' :application.
(vc-git--program-version): Operate on the connection-local value
of 'vc-git--program-version'.
Dmitry Gutov [Mon, 7 Oct 2024 23:25:14 +0000 (02:25 +0300)]
Support file creation and deletion in diff-apply-hunk
* lisp/vc/diff-mode.el (diff-find-file-name): Allow entering
non-existing file name when the corresponding hunk is of type
"create file" (bug#62731). Default to file name with deleted
prefix if diff-buffer-type is Git or Hg. Make sure not to add
such input to diff-remembered-files-alist, it would be hard to
change otherwise in case of typo.
(diff-setup-buffer-type):
Match against the diff header common to 'hg diff' output.
(diff-find-source-location): Look at the other source when the
buffer is applied in reverse.
(diff-apply-hunk): Delect file deletion and pass a different
argument to 'diff-find-source-location' in such case. Bind
diff-vc-backend to nil to avoid older revision buffer being
returned. In the end, offer to delete the file if the hunk was of
corresponding type and matched the existing contents.
Dmitry Gutov [Mon, 7 Oct 2024 23:03:04 +0000 (02:03 +0300)]
Support calling 'project-current' with custom prompt
* lisp/progmodes/project.el (project-current): Treat being passed
a string in the MAYBE-CURRENT argument specially (bug#70833).
(project-prompt-project-dir, project-prompt-project-name):
Handle it.
Stefan Kangas [Sat, 5 Oct 2024 23:47:50 +0000 (01:47 +0200)]
Delete XIE X extension from TODO
According to Wikipedia, XIE "is no longer included in the X11 reference
distribution, having been removed with X11R6.7 in 2004."
Ref: https://en.wikipedia.org/wiki/X_Image_Extension
Alan Mackenzie [Sat, 5 Oct 2024 17:28:28 +0000 (17:28 +0000)]
CC Mode: Remove search limit to fontify first decl in xdisp.c
An unneeded 10,000 character search limit prevents the full
fontification of the first declaration of xdisp.c, since the
introductory commentary is longer than that.
* lisp/progmodes/cc-engine (c-find-decl-spots): Remove the
10,000 char limit.
Sean Whitton [Fri, 4 Oct 2024 00:19:40 +0000 (08:19 +0800)]
icomplete-completions: Revise computation of prospects-len
* lisp/icomplete.el (icomplete-completions): Revise computation of
prospects-len (i) to avoid calling string-width on the entire
buffer-string, which could be slow; and (ii) to better handle minibuffer
prompts with embedded newlines (bug#72826).
Eli Zaretskii [Fri, 4 Oct 2024 13:32:13 +0000 (16:32 +0300)]
Expand email abbrevs in X-Debbugs-Cc header.
* lisp/mail/mailabbrev.el (mail-abbrev-mode-regexp):
* lisp/mail/mailalias.el (mail-address-field-regexp)
(mail-complete-alist): Add "X-Debbugs-Cc" to headers where email
aliases should be expanded, for compatibility with emacsbug.el.
Eli Zaretskii [Fri, 4 Oct 2024 11:39:50 +0000 (14:39 +0300)]
Fix 'list-tags' when invoked from a non-file buffer
This use case was broken by the improvement that attempts to
offer the current buffer's file name as the default file whose
tags to list.
* lisp/progmodes/etags.el
(tags--get-current-buffer-name-in-tags-file): Doc fix. Return nil
if no file is associated with the current buffer, and avoid
signaling an error if 'buffer-file-name' returns nil. (Bug#37611)
(list-tags): Doc fix. Signal an error if the user specifies no
file name at the prompt.
* doc/emacs/maintaining.texi (List Identifiers): Fix wording of
the documentation of 'list-tags'.
Sean Whitton [Fri, 4 Oct 2024 09:28:38 +0000 (17:28 +0800)]
count-windows: Fix reference to walk-windows
* lisp/window.el (count-windows): Refer to walk-windows for the
precise meaning of both the MINIBUF and ALL-FRAMES arguments,
not just the ALL-FRAMES argument. In both functions, these
arguments are both passed through to window-list-1.
john muhl [Sat, 13 Jul 2024 23:36:38 +0000 (18:36 -0500)]
Tag interactive commands in 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el (lua-ts-send-buffer)
(lua-ts-send-file, lua-ts-send-region): Mark inferior interaction
commands that are only relevant in Lua buffers. (Bug#73586)
Stefan Kangas [Mon, 30 Sep 2024 22:15:08 +0000 (00:15 +0200)]
Change :group of 'eglot' defgroup to 'tools'
In 'M-x customize', Eglot fits in better in "Programming -> Tools", with
the likes of Flymake and Gud, than it does in "Applications", with ERC
and Newsticker.
* lisp/progmodes/eglot.el (eglot): Change :group of defgroup to 'tools'.
Stefan Kangas [Mon, 30 Sep 2024 18:37:27 +0000 (20:37 +0200)]
Remove out-of-date documentation from python.el
* lisp/progmodes/python.el: Remove out-of-date documentation about
automatic indentation; 'electric-indent-mode' is enabled by default in
Emacs 24.4 or later, so this is no longer an issue.
Visuwesh [Wed, 2 Oct 2024 08:18:25 +0000 (13:48 +0530)]
Add imenu index function for DjVu files in doc-view
* 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)
Dmitry Gutov [Thu, 3 Oct 2024 19:03:09 +0000 (22:03 +0300)]
xref-location-marker: Use find-file-noselect to ensure uptodateness
* lisp/progmodes/xref.el (xref-location-marker):
Always call 'find-file-noselect' rather than 'get-file-buffer' to
go through the visited-file-modtime verification every time.