Eli Zaretskii [Fri, 10 May 2024 12:56:30 +0000 (15:56 +0300)]
Fix 'dictionary-tooltip-mode'
* lisp/tooltip.el (tooltip-event-buffer): Make sure 'posn-window'
returns a window before calling 'window-buffer'.
* lisp/net/dictionary.el (dictionary-default-dictionary)
(dictionary-tooltip-dictionary): Doc fixes.
(dictionary-tooltip-dictionary): Change default value to t, which
means the same dictionary as 'dictionary-default-dictionary'.
(dictionary-do-search): If NOMATCHING is non-nil, do not insert
anything into the current buffer, as that is unexpected when
showing definitions in tooltips.
(dictionary-word-at-mouse-event): Be defensive about the values
returned by 'tooltip-event-buffer' and 'posn-point': they can be
unexpected when the mouse pointer is on the tool bar or mode line
etc.
(dictionary-display-tooltip): Ignore errors in this function.
(dictionary-tooltip-mode): Ignore mouse-movement events on tool
bar and tab-bar.
(dictionary-dictionaries): Decode the server response to present
dictionaries in human-readable form. Document in the doc string
the format of the return value.
Juri Linkov [Fri, 10 May 2024 06:52:09 +0000 (09:52 +0300)]
* lisp/imenu.el (imenu-flatten): New defcustom (bug#70846).
(imenu-level-separator): Adjust the docstring.
(imenu--flatten-index-alist): New function revived
from the initial implementation of this package.
(imenu-choose-buffer-index): Use imenu--flatten-index-alist
when imenu-flatten is non-nil.
(imenu-buffer-menubar): Remove obsolete variable.
Po Lu [Fri, 10 May 2024 03:01:29 +0000 (11:01 +0800)]
Fix bug#70856
* lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down)
(pixel-scroll-precision-scroll-up): Apply finer threshold for
the minimum unit of scrolling.
(pixel-scroll-precision-scroll-down-page): Document true
restrictions on DELTA. (bug#70856)
Andrew G Cohen [Sun, 7 Apr 2024 23:36:17 +0000 (07:36 +0800)]
Don't limit gnus thread searches to a single message
* lisp/gnus/gnus-search.el (gnus-search-single-p): Searches for a
single message id finish after finding this one message; thread searches
continue until all messages are found.
Paul Eggert [Thu, 9 May 2024 19:24:18 +0000 (12:24 -0700)]
Improve static checking when using upcoming GCC 13.3
* src/lisp.h: In GCC 13.3 and later, do not ignore
-Wanalyzer-allocation-size.
* src/marker.c: In GCC 13.3 and later, do not ignore
-Wanalyzer-deref-before-check.
The issue was that the function always returned nil because
the closing parentheses were in the wrong position. This
meant that the function couldn't give back the data it was
supposed to, making the whole srecode system not work
properly.
By moving the parentheses to the correct place, the function
now returns a hash table with all the templates it finds.
* lisp/cedet/srecode/find.el (srecode-all-template-hash):
Adjusted the position of closing parentheses so that the mhash
variable is returned correctly. (Bug#70765)
* src/xwidget.c (store_xwidget_download_callback_event)
(store_xwidget_js_callback_event, syms_of_xwidget): Define
symbols for symbols interned with `intern' from a constant
string, delete duplicate DEFSYM directives, and substitute them
for such calls to intern. This excludes only those symbols
which are interned and referenced only once during Emacs's
initialization, the timing of whose interning is
inconsequential, and symbols in w32.c, which would need to be
transferred to a new syms_of_w32 function that I cannot test.
At the beginning of the buffer call 'treesit-outline-search'
recursively with the `looking-at' argument set to t, since
`treesit-navigate-thing' can't find a thing at bobp (bug#70789).
john muhl [Fri, 3 May 2024 20:51:01 +0000 (15:51 -0500)]
Improve indentation in 'lua-ts-mode' (bug#70785)
* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
- Ignore comments when aligning arguments, parameters and fields.
- Apply simpler rules to simpler usage of anonymous functions.
- Better handling of table as a function argument.
(lua-ts--comment-first-sibling-matcher):
(lua-ts--first-real-sibling-anchor):
(lua-ts--last-arg-function-call-matcher):
(lua-ts--top-level-function-call-matcher): New function.
(lua-ts--g-parent):
(lua-ts--g-g-parent): New function.
(lua-ts--g-g-g-parent): Use it.
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts:
Add tests.
john muhl [Sat, 27 Apr 2024 23:52:41 +0000 (18:52 -0500)]
; Quietly skip 'lua-ts-mode' tests (bug#70786)
* test/lisp/align-tests.el (align-lua):
* test/lisp/progmodes/lua-ts-mode-tests.el
(lua-ts-test-indentation):
(lua-ts-test-movement):
(lua-ts-test-font-lock):
(lua-ts-test-which-function): Suppress warnings when the grammar is not
installed.
Dmitry Gutov [Thu, 9 May 2024 02:30:32 +0000 (05:30 +0300)]
choose-completion: Retain the suffix after completion boundary
* lisp/minibuffer.el (completion-base-suffix):
Remove as not optimal after all (bug#48356).
(completion--replace): Use insert-before-markers-and-inherit.
(minibuffer-completion-help): Don't set completion-base-affixes,
implement the same logic more optimally by local search and
querying for field boundaries. Also fix the problem with
completion table, predicate and extra-props being looked up in the
wrong buffer.
(minibuffer-next-completion, minibuffer-choose-completion):
Don't bind completion-use-base-affixes anymore.
* lisp/simple.el (completion-base-affixes)
(completion-use-base-affixes): Remove.
(completion-list-insert-choice-function):
Don't pass them through anymore.
F. Jason Park [Tue, 7 May 2024 04:59:48 +0000 (21:59 -0700)]
Prefer erc--skip property to erc-track--skipped-msgs
* lisp/erc/erc-stamp.el (erc-add-timestamp): Honor an overriding
`erc--ts' "msg prop".
(erc-stamp--defer-date-insertion-on-post-modify): Add `erc--skip'
for the `track' module.
* lisp/erc/erc-track.el (erc-track--skipped-msgs): Remove unused
variable. Originally added as part of bug#60936.
(erc-track-modified-channels): Rely on the `erc--skip' "msg prop"
instead of the now defunct `erc-track--skipped-msgs' variable for
detecting requests to omit `track' mode-line updates during
`erc-display-message'.
F. Jason Park [Wed, 8 May 2024 22:26:29 +0000 (15:26 -0700)]
Avoid shared-ref read syntax in ERC message catalogs
* lisp/erc/erc.el (erc--message-speaker-ctcp-action-input)
(erc--message-speaker-ctcp-action-statusmsg-input): Don't use
shared/circular references, like #1=foo ... #1#, in literal strings
because it triggers CI validation failures. These message-format
definitions were originally introduced as part of bug#67677.
This fixes cl-substitute, cl-substitute-if, cl-substitute-if-not,
cl-nsubstitute, cl-nsubstitute-if and cl-nsubstitute-if-not,
when called with a string sequence argument.
* lisp/emacs-lisp/cl-seq.el (cl-nsubstitute):
Avoid running in O(n^2) time and make future-safe.
Use clear-string instead of fillarray to clobber secret strings
* lisp/net/sasl-cram.el (sasl-cram-md5-response):
* lisp/net/sasl-digest.el (sasl-digest-md5-response-value):
* lisp/net/sasl.el (sasl-plain-response):
`fillarray` signals an error for strings that contain multibyte chars;
`clear-string` always works for this purpose.
Michael Albinus [Tue, 7 May 2024 07:56:05 +0000 (09:56 +0200)]
Add Tramp method "apptainer"
* doc/misc/tramp.texi (Top, Configuration): Add "Optional methods".
(Optional methods): New section.
(Inline methods) <androidsu, toolbox, flatpak>: These are optional
methods.
(Inline methods) <apptainer>: Add.
* etc/NEWS: New Tramp method "apptainer".
Some Tramp methods are optional.
Fix typos.
* lisp/net/tramp-androidsu.el (tramp-enable-androidsu-method):
New defun. Call it when `system-type' is `android'.
* lisp/net/tramp-container.el (tramp-apptainer-program): New defcustom.
(tramp-apptainer-method): New defconst.
(tramp-apptainer--completion-function)
(tramp-enable-toolbox-method, tramp-enable-flatpak-method)
(tramp-enable-apptainer-method): New defuns.
* lisp/net/tramp.el (tramp-enable-method): New defun.
Po Lu [Tue, 7 May 2024 01:02:00 +0000 (09:02 +0800)]
Disable text-conversion in map-ynp
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Bind
overriding-text-conversion-style to nil around read-event and
arrange that the input method be reset.
Alan Mackenzie [Mon, 6 May 2024 20:14:57 +0000 (20:14 +0000)]
`read': give fuller error message for errors following "#".
This solves bug#70702.
* src/lread.c (READ_AND_BUFFER, INVALID_SYNTAX_WITH_BUFFER):
New macros.
(read0): For errors in characters sequences beginning with "#",
output the entire character sequence rather than just "#".
* test/src/lread-tests.el (lread-test-bug70702): New test.
Juri Linkov [Mon, 6 May 2024 16:43:50 +0000 (19:43 +0300)]
* lisp/tab-bar.el: Support mouse clicks for multi-item 'global-mode-string'.
(tab-bar-format-global): Split elements of 'global-mode-string'
to separate items of the tab bar, so events for each item are
handled separately (bug#70086).
Po Lu [Mon, 6 May 2024 12:55:49 +0000 (20:55 +0800)]
Expressly disable large file APIs on Android 4.4 and earlier
* configure.ac (CFLAGS): Add -D_FILE_OFFSET_BITS=32 on SDK 20
and earlier that unserviceable functions may not be selected.
Problem reported by Ruth Elburn <ruth@noreply.invalid>.
Po Lu [Mon, 6 May 2024 04:09:21 +0000 (12:09 +0800)]
Optimize stipples on Android
* java/org/gnu/emacs/EmacsGC.java (EmacsGC) <tileObject>:
Change type to EmacsTileObject.
(markDirty): Create an EmacsTileObject rather than a
BitmapDrawable.
* java/org/gnu/emacs/EmacsTileObject.java: New file,
significantly leaner than BitmapDrawable.
Jim Porter [Sun, 5 May 2024 20:09:08 +0000 (13:09 -0700)]
Fix Eshell handling of remote files like "/ssh:remote:~/file.txt"
* lisp/eshell/em-glob.el (eshell-glob-convert): Use 'concat' instead of
'file-name-concat' to avoid extraneous slashes.
(eshell-extended-glob): Bail out if we didn't find a glob after all.
* test/lisp/eshell/em-glob-tests.el (tramp): Require.
(em-glob-test/convert/remote-start-directory): Use the mock remote
connection.
(em-glob-test/remote-user-directory): New test.
Juri Linkov [Sun, 5 May 2024 18:32:22 +0000 (21:32 +0300)]
* lisp/tab-line.el: Use defcustom for group sort variables (bug#59438).
(tab-line-tabs-buffer-group-sort-function)
(tab-line-tabs-buffer-groups-sort-function): Turn defvar into defcustom.
Suggested by Gabriel do Nascimento Ribeiro <gabriel376@hotmail.com>.
(tab-line-tabs-buffer-group-name): Fall back to
'tab-line-tabs-buffer-group-by-mode' when
'tab-line-tabs-buffer-group-function' is nil (its previous default value).
Dmitry Gutov [Sun, 5 May 2024 17:19:48 +0000 (20:19 +0300)]
project--vc-list-files: Use vc-git-command for better error reporting
* lisp/progmodes/project.el (project--vc-list-files):
Use 'vc-git-command' for better error reporting
(https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg00399.html).
Dmitry Gutov [Sun, 5 May 2024 16:42:05 +0000 (19:42 +0300)]
project-find-regexp: Fix test
* test/lisp/progmodes/project-tests.el (project-find-regexp):
Add binding for project-list-file, to fix the test when running
in the terminal (reported on the mailing list).
Stefan Monnier [Sun, 5 May 2024 14:43:37 +0000 (10:43 -0400)]
(read-passwd-toggle-visibility): Fix some loose ends
* lisp/auth-source.el (read-passwd-toggle-visibility): Make sure
we operate on the minibuffer even if some other window was
selected when the little icon was pressed. Don't hardcode the
keymap representation. Use the `keymap` property rather than
the `local-map` property so it can't be accidentally shadowed
by something like a minor-mode map.
On balance it seems likely that the warning would annoy more people than
it would help, so let them deal with any actual problems when the
default is changed instead. See discussion at:
https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg00250.html
* src/lread.c (string_suffix_p, warn_missing_cookie, Fload)
(Feval_buffer):
* lisp/international/mule.el (load-with-code-conversion):
* lisp/startup.el (command-line--load-script):
* etc/NEWS:
Revert all changes, except for the generalised
`lisp_file_lexical_cookie` which may prove useful in the future.
Alan Mackenzie [Sun, 5 May 2024 11:34:14 +0000 (11:34 +0000)]
Run c-unmark-<>-around-region in after-change-functions always.
This fixes bug#70435.
* lisp/progmodes/cc-engine.el (c-unmark-<>-around-region): Run
its contents in after-change-functions for a deletion, so that
c-new-BEG and c-new-END get set. Add a new test (> end beg)
in a check for unterminated string handling.
Dmitry Gutov [Sun, 5 May 2024 03:27:39 +0000 (06:27 +0300)]
New variable 'project-files-relative-names'
* lisp/progmodes/project.el (project-files-relative-names):
New variable (bug#69233).
(project--files-in-directory): Honor it.
(project--vc-list-files): Here too.
(project-find-regexp): Use it to improve performance.
(project-or-external-find-regexp): Add a TODO.
(project-find-file): Use it here too.
(project--read-file-cpd-relative, project--read-file-absolute):
Try to handle file lists with absolute and relative files names.
(project-find-file-in): Set default-directory, so relative names
are interpreted correctly.
* lisp/progmodes/xref.el (xref-matches-in-files):
Consider that the first in FILES can be a relative file name.
* test/lisp/progmodes/project-tests.el (project-find-regexp):
New test.
Po Lu [Sun, 5 May 2024 01:49:09 +0000 (09:49 +0800)]
Don't permit C-x 8 RET &c in isearch.el to contaminate search string
* lisp/isearch.el (isearch-char-by-name, isearch-emoji-by-name):
Concatenate new character to the query string saved by
with-isearch-suspended, not the current string, which might have
been modified by recursive I-search sessions within
completing-read.
shynur [Fri, 3 May 2024 11:40:23 +0000 (19:40 +0800)]
Locate error source of ExceptionGroup in Python shell
The Python shell recognizes the line containing a file path and
a line number when an exception is raised up to the top-level,
in order to locate the source of error. It's supposed to
recognize the built-in ExceptionGroup as well. (Bug#70653)
* lisp/progmodes/python.el (python-shell-compilation-regexp-alist):
Take the single leading vertical line into account.
* etc/NEWS: Announce this change.
Eli Zaretskii [Sat, 4 May 2024 10:12:21 +0000 (13:12 +0300)]
Fix implementation of the --terminal command-line switch
It sounds like this has been broken ever since multi-tty was
added to Emacs.
* src/keyboard.c (dev_tty): New global variable.
* src/keyboard.h: Declare 'dev_tty'.
* src/emacs.c (main): Initialize 'dev_tty'.
* src/term.c (Fcontrolling_tty_p, Fresume_tty, init_tty):
* src/process.c (dissociate_controlling_tty):
* src/keyboard.c (handle_interrupt_signal, handle_interrupt)
(Fset_quit_char): Use 'dev_tty' instead of 'DEV_TTY'. (Bug#70519)