* lisp/treesit.el (treesit-sexp-type-regexp)
(treesit-sentence-type-regexp): Mark obsolete.
(treesit-block-type-regexp): Remove.
* lisp/treesit.el (treesit-forward-sexp)
(treesit-transpose-sexps)
(treesit-beginning-of-defun)
(treesit-end-of-defun)
(treesit-forward-sentence)
(treesit-defun-at-point): Make use of treesit-thing-settings.
(treesit-thing-definition)
(treesit-thing-defined-p): New functions.
(treesit-major-mode-setup): Replace
treesit-sexp/sentence-type-regexp with treesit-thing-settings.
Po Lu [Sat, 2 Sep 2023 01:28:50 +0000 (09:28 +0800)]
Update Android port
* lisp/touch-screen.el (touch-screen-handle-point-up) <held>:
Treat `held' as `drag' as well.
* src/android.c (android_is_special_directory): Return bool
rather than a pointer to the remainder of the file name, given
that said pointer is never used.
Stefan Kangas [Sat, 2 Sep 2023 00:42:07 +0000 (02:42 +0200)]
Delete references to gnuserv
* doc/misc/mh-e.texi (Incorporating Mail):
* doc/misc/octave-mode.texi (Concept Index):
* lisp/net/browse-url.el (browse-url-w3-gnudoit): Delete
references to gnuserv; these days we use emacsclient.
Stefan Kangas [Fri, 9 Dec 2022 09:58:22 +0000 (10:58 +0100)]
Make checkdoc warn if not using lexical-binding
* lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine):
Warn if there is no lexical-binding cookie. (Bug#59920)
(checkdoc-lexical-binding-flag): New user option.
Avoid highlighting (parts of) the function name as arguments in the
output of 'describe-function' when the function has an argument with
the same name. To achieve this, refine the regular expression that
'help-do-arg-highlight' uses such that it doesn't match anything in
the function name.
Eli Zaretskii [Fri, 1 Sep 2023 11:31:35 +0000 (14:31 +0300)]
Fix VC mode-line indication for registerd but ignored files
* lisp/vc/vc-hooks.el (vc-ignored-state): New face.
(vc-default-mode-line-string): Add special indication and tooltip
for files that are registered, but also ignored. See
https://lists.gnu.org/archive/html/emacs-devel/2023-09/msg00006.html
for the details of the use case.
* doc/emacs/maintaining.texi (VC Mode Line): Mention the
additional meaning of '!' in the VC status mode-line display.
Po Lu [Fri, 1 Sep 2023 06:50:28 +0000 (14:50 +0800)]
Display the OSK after touch screen drag-to-select
* lisp/touch-screen.el (touch-screen-handle-point-up) <drag>:
New case. Activate the on screen keyboard should the window
where the first touch screen event landed have selected a
writable buffer in which the region is active.
* test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell): Add
'process' to 'eshell-debug-command'
(eshell-get-debug-logs): New function...
(eshell-match-command-output, eshell-command-result-equal): ... use
it.
Jim Porter [Wed, 30 Aug 2023 00:02:40 +0000 (17:02 -0700)]
Fix handling of Eshell debug modes
Previously, these were enabled/disabled at byte-compilation time, but
we want to control them at runtime.
* lisp/eshell/esh-cmd.el (eshell-eval-command): Call
'eshell-debug-command-start'.
(eshell-manipulate): Check 'eshell-debug-command' at runtime. Update
callers.
(eshell-debug-command): Move to "esh-util.el".
(eshell/eshell-debug, pcomplate/eshell-mode/eshell-debug): Move to
"em-basic.el".
(eshell-debug-show-parsed-args): Update implementation.
* lisp/eshell/esh-util.el (eshell-debug-command): Move from
"esh-cmd.el" and convert to a list.
(eshell-debug-command-buffer): New variable.
(eshell-condition-case): Check 'eshell-handle-errors' at runtime.
(eshell-debug-command-start): New function.
(eshell-debug-command): Move from "esh-cmd.el" and convert to a macro.
* lisp/eshell/em-basic.el (eshell/eshell-debug)
(pcomplete/eshell-mode/eshell-debug): Move from "esh-cmd.el" and
reimplement.
* lisp/eshell/eshell.el (eshell-command): Pass the original input to
'eshell-eval-command'.
* doc/misc/eshell.texi (Built-ins): Update documentation for
'eshell-debug'.
Po Lu [Fri, 1 Sep 2023 00:49:42 +0000 (00:49 +0000)]
Properly describe minor mode lighters while mode-line-compact
* lisp/help.el (describe-minor-mode-from-indicator): New arg
EVENT. If set to a mouse event and mode-line-compact, search
for a suitable lighter within the entire posn object.
João Távora [Thu, 31 Aug 2023 23:48:25 +0000 (00:48 +0100)]
Eglot: revamp confirmation model for server-proposed edits
bug#60338
The variable 'eglot-confirm-server-edits' replaces the obsolete
'eglot-confirm-server-initiated-edits' and brings about a new
confirmation model, making it possible to have only certain commands
require user confirmation. This was achieved careful usage of the
'this-command' and 'last-command' variables.
There are now two types of confirmation: the usual
minibuffer summary and a temporary 'diff-mode' buffer to display the
proposed changes, so the user can apply them one by one.
Thanks to Philip Kaludercic for the diff-mode idea and implementation.
Co-authored-by: Philip Kaludercic <philipk@posteo.net>
* doc/misc/eglot.texi (Eglot Variables): Describe
'eglot-confirm-server-edits'.
* etc/EGLOT-NEWS (latest): Mention change.
* lisp/progmodes/eglot.el (diff-mode): Require it.
(eglot-confirm-server-initiated-edits): Obsolete it.
(eglot-confirm-server-edits): New variable.
(eglot-handle-request workspace/applyEdit): Use 'last-command'
(eglot-execute t t): Use 'this-command'.
(eglot--apply-workspace-edit): Rework.
(eglot-rename): Use 'this-command'.
Handle directory values of scopeUri in workspace/configuration
Even though scopeUri is specified to be of documentUri type, some
servers (notably pyright) insist on passing the pathname of a
directory there. In pyright's case this is frequently useless, as the
directory is the project directory. Nevertheless we can be lenient to
those servers by detecting whether the value is a directory and doing
the right thing.
Note that we do not (yet) support per-file configuration storage.
Diancheng Wang [Wed, 9 Aug 2023 02:35:12 +0000 (10:35 +0800)]
Enable gdb-mi to set breakpoints when threads of debuggee are running
* lisp/progmodes/gdb-mi.el (gdb): Call 'gud-def' with 5th arg
non-nil for those commands that can be invoked asynchronously.
(gdb-starting): Set 'gud-async-running' non-nil for async commands.
* lisp/progmodes/gud.el (gud-async-running): New defvar.
(gud-menu-map): Enable some commands only if 'gud-async-running' is
non-nil.
(gud-def): Accept another optional argument ASYNC-OK. (Bug#65612)
Liu Hui [Tue, 22 Aug 2023 05:52:03 +0000 (13:52 +0800)]
strokes: Support running a function when no stroke matches
* lisp/strokes.el (strokes-no-match-function): New variable.
(strokes-no-match-default): New function.
(strokes-execute-stroke): Run `strokes-no-match-function' when no
stroke matches. (Bug#65449)
Po Lu [Thu, 31 Aug 2023 01:04:32 +0000 (09:04 +0800)]
Include installation date within asset files
* src/android.c (setEmacsParams): Set `emacs_installation_time'
to the mtime of the class path file, which happens to be the
time of Emacs's installation.
(emacs_installation_time): New variable.
* src/android.h (emacs_installation_time): Export new variable.
* src/androidvfs.c (android_afs_stat): If
emacs_installation_time is a valid timespec, set st_mtime to it.
Dmitry Gutov [Thu, 31 Aug 2023 00:21:11 +0000 (03:21 +0300)]
Add one more mouse-set-point call to functions xref-find-*-at-mouse
* lisp/progmodes/xref.el (xref-find-definitions-at-mouse)
(xref-find-references-at-mouse): Call mouse-set-point to ensure
that the search is initiated at the same place where
xref-backend-identifier-at-point was called (bug#65578).
Stefan Kangas [Wed, 30 Aug 2023 17:42:58 +0000 (19:42 +0200)]
Clean up some safe-local-variable predicates
* lisp/progmodes/project.el: Add comments with a reminder to simplify
'safe-local-variable' predicates when Emacs 28 support is dropped.
(project-vc-ignores): Mark only a list of strings as safe-local.
* lisp/textmodes/reftex-vars.el (reftex-guess-label-type): Use
booleanp for 'safe-local-variable' predicate. (Bug#65608)
Po Lu [Wed, 30 Aug 2023 02:07:49 +0000 (10:07 +0800)]
Facilitate typing `C-SPC' on Android
* doc/emacs/android.texi (Android Windowing): Mention C-SPC
interception and how it may be disabled.
* java/org/gnu/emacs/EmacsNative.java (shouldForwardCtrlSpace):
New function.
* java/org/gnu/emacs/EmacsView.java (onKeyPreIme): New function.
If the provided key code is SPC and the event's modifier key
mask contains ControlMask, relay it directly to onKeyDown.
* java/org/gnu/emacs/EmacsWindow.java (eventModifiers): Export
and make static.
* src/android.c (shouldForwardCtrlSpace): New function.
* src/androidfns.c (syms_of_androidfns)
<android_intercept_control_space>: New defvar.
Michael Albinus [Tue, 29 Aug 2023 09:30:20 +0000 (11:30 +0200)]
Adapt some changes of last Tramp commit
* lisp/net/tramp-container.el (tramp-container--completion-function):
Use METHOD as argument, instead of PROGRAM. Determine program
from METHOD entry in `tramp-methods'. Bind `non-essential' to
nil. Use a file property as cache.
(tramp-container--completion-function): Use adapted arguments when
setting for "docker" and "podman".
* lisp/net/tramp.el (tramp--last-hop-directory): Adapt docstring.
Move down.
(tramp-set-completion-function): Revert default case to
`file-exists-p', the workaround isn't needed anymore.
(tramp-get-completion-methods): Rename argument to MULTI-HOP.
(tramp-completion-remote-containers): Add :version.
(tramp-multi-hop-p): Bind `tramp-verbose' to nil.
Eshel Yaron [Sun, 20 Aug 2023 14:29:33 +0000 (16:29 +0200)]
Rename 'package-vc-allow-side-effects' to better fit its use
* lisp/emacs-lisp/package-vc.el (package-vc-allow-side-effects):
Rename to 'package-vc-allow-build-commands'.
(package-vc--unpack-1): Use new name.
* doc/emacs/package.texi (Fetching Package Sources): Use new name.
* etc/NEWS: Adapt accordingly. (Bug#65386)
Eshel Yaron [Sun, 20 Aug 2023 14:20:54 +0000 (16:20 +0200)]
; Refine 'defcustom' types in 'package-vc'
Only include VC backends that support cloning in the ':type' of
'package-vc-heuristic-alist' and 'package-vc-default-backend', and
compute the list of relevant on demand to keep it fresh.
* lisp/emacs-lisp/package-vc.el (package-vc--backend-type): New constant.
(package-vc-heuristic-alist, package-vc-default-backend): Use it. (Bug#65386)
Gene Goykhman [Tue, 29 Aug 2023 08:10:06 +0000 (10:10 +0200)]
Provide completion candidates for remote containers over a multi-hop
* lisp/net/tramp-container.el (tramp-container--completion-function):
Set default directory to last hop.
(tramp-set-completion-function): Don't use executable-find for
container program since it might not be running locally.
* lisp/net/tramp.el (tramp--last-hop-directory): Add new variable.
(tramp-completion-handle-file-name-all-completions): Use container
host directory to execute container program on remote host.
(tramp-set-completion-function): FIXME: for now, don't constrain
allowable completion methods to only those present on the local system.
(tramp-completion-remote-containers): Add customize option to
provide completion candidates for containers running on remote hosts.
Po Lu [Tue, 29 Aug 2023 01:05:04 +0000 (09:05 +0800)]
Reintroduce menus beneath chapters in the Transient manual
* doc/misc/transient.texi (Introduction)
(Modifying Existing Transients, Predicate Slots): Return the
menus to their proper location, so Texinfo 4.13 can infer up
pointers for nodes within.
(tab-bar-tab-name-format-truncated)
(tab-bar-tab-name-format-hints)
(tab-bar-tab-name-format-close-button)
(tab-bar-tab-name-format-face): New functions.
(tab-bar-tab-name-format-functions): New defcustom.
(tab-bar-tab-name-format-default): Rewrite to use
'tab-bar-tab-name-format-functions'.
Juri Linkov [Mon, 28 Aug 2023 06:52:36 +0000 (09:52 +0300)]
* lisp/tab-bar.el: Show full tab names on tooltips (bug#65554).
(tab-bar--format-tab): Use tab names for :help strings.
It's useful to see original tab names when the tab-bar displays names
truncated by tab-bar-auto-width, etc.
(tab-bar-format-menu-bar): Fix string case for consistency with other items.
* java/org/gnu/emacs/EmacsWindowAttachmentManager.java
(registerWindow, removeWindowConsumer, detachWindow)
(noticeIconified, noticeDeiconified): Remove superfluous
debugging code now that the Android port is stable.
* java/org/gnu/emacs/EmacsView.java (onLayout): Detect if the
IME is hidden while a toplevel window is focused, and clear
isCurrentlyTextEditor in that case.
(onApplyWindowInsets): New function.
(raise, lower, popupMenu, onCreateInputConnection): Delete
aforementioned debugging code.
Jim Porter [Sat, 10 Dec 2022 07:07:19 +0000 (23:07 -0800)]
Fix a race condition in Eshell's external process management
If a process is busy writing output when 'eshell-sentinel' is called,
it might take a bit of time to finish up. Don't call
'eshell-kill-process-function' until we're really finished
(bug#59103).
* lisp/eshell/esh-proc.el (eshell-sentinel): Call
'eshell-kill-process-function' in 'finish-io'.
Juri Linkov [Sun, 27 Aug 2023 17:27:35 +0000 (20:27 +0300)]
Use new SVG icons in tab-bar and tab-line (bug#62562)
* lisp/tab-bar.el (tab-bar--load-buttons):
Add "symbols/plus_16.svg" to tab-bar-new.
Add "symbols/cross_16.svg" to tab-bar-close.
Add "symbols/menu_16.svg" to tab-bar-menu-bar.
(tab-bar-tab-name-format-default): Use 'add-face-text-property'.
(tab-bar-history-mode):
Add "symbols/chevron_left_16.svg" to tab-bar-back.
Add "symbols/chevron_right_16.svg" to tab-bar-forward.
* lisp/tab-line.el (tab-line-new): New icon with "symbols/plus_16.svg".
(tab-line-new-button): Use it with nil rear-nonsticky.
(tab-line-close): New icon with "symbols/cross_16.svg".
(tab-line-close-button): Use it with nil rear-nonsticky.
(tab-line-left): New icon with "symbols/chevron_left_16.svg".
(tab-line-left-button): Use it with nil rear-nonsticky.
(tab-line-right): New icon with "symbols/chevron_right_16.svg".
(tab-line-right-button): Use it with nil rear-nonsticky.
(tab-line-tab-name-format-default): Use 'add-face-text-property'.
(tab-line-auto-hscroll): Append the face in 'add-face-text-property'.
* lisp/net/tramp-message.el (tramp-message, tramp-backtrace)
(tramp-error): Handle VEC being nil.
* lisp/net/tramp.el (tramp-null-hop): Add ;;;###tramp-autoload cookie.
Use pseudo method "local".
(tramp-file-name-unify): IF VEC is nil, set it to `tramp-null-hop'.
(tramp-set-completion-function): Support also functions with
METHOD as argument.
(tramp-get-completion-methods): Add argument HOP.
(tramp-completion-handle-file-name-all-completions): Use it.
(tramp-call-process-region): Set VEC if nil.
Po Lu [Sun, 27 Aug 2023 02:19:46 +0000 (02:19 +0000)]
Correct display of stretch glyphs within hscrolled windows
* src/haikuterm.c
(haiku_draw_glyphless_glyph_string_foreground): Make char2b
static, stifling a GCC warning.
(haiku_draw_stretch_glyph_string): Use computed X if s->x is
outside the confines of the text area.
Stefan Monnier [Sat, 26 Aug 2023 19:44:28 +0000 (15:44 -0400)]
(elisp--local-variables): Fix recent regression
While at it, make it work when completing code within `eval-when-compile`
and friends, where it failed in sometimes spectacular ways.
* lisp/progmodes/elisp-mode.el (elisp--local-macroenv): New var.
(elisp--local-variables): Use it. Also, advice `macroexpand-1` since
`macroexpand-all` doesn't use `macroexpand` any more.
(prin1-char): Remove redundant "" arg.
(elisp--eval-defun-1): Align the `eval` call to what's used in
`custom-initialize-set`.
Stefan Kangas [Sat, 26 Aug 2023 12:38:36 +0000 (14:38 +0200)]
Clean up image error reporting somewhat
* src/image.c (image_not_found_error, image_invalid_data_error):
New functions. All uses of image_error with "Invalid image data ..."
and "Cannot find image file ..." changed to use them.
(image_create_x_image_and_pixmap_1): Remove redundant Qnil arguments.
Joseph Turner [Tue, 15 Aug 2023 05:35:28 +0000 (22:35 -0700)]
Make ispell localwords safe local variable
* lisp/textmodes/ispell.el (ispell-buffer-session-localwords):
Make safe local variable to so that checkdoc can ignore words in a
project in batch mode.
Daniel Martín [Fri, 18 Aug 2023 13:03:21 +0000 (15:03 +0200)]
Do not raise a different frame when closing a frame
* src/frame.h: Declare an NS-only function to make a frame the
key window.
* src/nsfns.m (ns_make_frame_key_window): Implement it.
* src/frame.c (delete_frame): Call ns_make_frame_key_window
instead of Fraise_frame. (Bug#61525)
Eli Zaretskii [Sat, 26 Aug 2023 07:54:43 +0000 (10:54 +0300)]
; Fix last change
* lisp/cus-theme.el (describe-theme-from-file): Fix doc string
and arguments.
(describe-theme-1): Fix the call to 'describe-theme-from-file'.
(Bug#65468)
Paul Eggert [Sat, 26 Aug 2023 01:43:57 +0000 (18:43 -0700)]
Use float not double in webp_load alpha conversion
* src/image.c (webp_load): Pacify gcc -Wdouble-promotion
by using (1 - a), where the 1 is converted to 1.0f, rather
than (1.0 - a), which mistakenly converts a to double.
Also, reindent to use GNU style.
Po Lu [Sat, 26 Aug 2023 01:38:34 +0000 (09:38 +0800)]
Disable XkbLC_ControlFallback
* src/xterm.c (handle_one_xevent) <XI_KeyPress>: Fix typos within
the commentary.
(x_term_init) [HAVE_XKB]: Disable the ControlFallback library
control, lest Xlib map function keys with ControlMask set to
ASCII keysyms within inactive groups.
F. Jason Park [Wed, 16 Aug 2023 04:14:07 +0000 (21:14 -0700)]
Prevent unwanted recursion in erc-nickbar-disable
* lisp/erc/erc-speedbar.el (erc-status-sidebar-mode--unhook): Remove
forward declaration.
(erc-speedbar--toggle-nicknames-sidebar): Inline
`erc-speedbar-close-nicknames-window'. Don't call
`erc-speedbar-browser' and thus avoid adding excess timers.
(erc-speedbar--ensure): Inline `speedbar-enable-update' to avoid
unneeded call to `speedbar-set-timer', and ensure it only runs in
`speedbar-buffer'.
(erc-speedbar--shutting-down-p): New flag variable to avoid recursive
calls to `dframe-close-frame' and friends.
(erc-nickbar-mode, erc-nickbar-enable, erc-nickbar-disable): Move
logic formerly performed by `speedbar-disable-update' to
`erc-speedbar--toggle-nicknames-sidebar'. When disabling, guard
against recursive calls to `dframe-close-frame' and friends.
(erc-speedbar--get-timers): New utility function, also for use in
testing.
(erc-speedbar--dframe-controlled): Bind
`erc-speedbar--shutting-down-p' flag non-nil around call to
`erc-nickbar-mode'. Remove excess timer left behind due to
incompatible behavior from `dframe-close-frame'. Let caller kill
buffer.
(erc-speedbar-close-nicknames-window): Remove unused command, new in
ERC 5.6 and Emacs 30.
* test/lisp/erc/erc-scenarios-status-sidebar.el
(erc-speedbar-close-nicknames-window): Remove forward declaration.
(erc-speedbar--get-timers): Add forward declaration.
(erc-scenarios-status-sidebar--nickbar): Fix faulty expectations of
desired behavior when disabling module. Ensure timers canceled.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--make-bindings): Shadow `timer-idle-list' to
avoid polluting global test environment with stray timers.
(Bug#63595)
F. Jason Park [Fri, 18 Aug 2023 02:18:50 +0000 (19:18 -0700)]
Warn about implicit logging in erc-truncate-mode
* etc/ERC-NEWS: Add entry explaining that `erc-truncate-mode' no
longer quasi-activates `erc-log-mode' under certain conditions.
* lisp/erc/erc-log.el
(erc-log--call-when-logging-enabled-sans-module): Add helper for use
by the `truncate' module during initialization.
* lisp/erc/erc-truncate.el (erc-truncate-mode, erc-truncate-enable,
erc-truncate-disable): Warn on `erc-connect-pre-hook' when conditions
exist that would have seen logging transparently activated in older
ERC versions.
(erc-truncate--warn-about-logging): New function to warn about
implicit logging on pre-connect.
(erc-truncate-buffer-to-size): Clarify some comments and revise doc
string.
* test/lisp/erc/erc-scenarios-log.el (erc-scenarios-log--truncate):
Disable `erc-truncate-mode' even though `erc-modules' is shadowed so
that `erc-insert-done-hook' and friends are not contaminated.
`(Bug#60936)
F. Jason Park [Fri, 18 Aug 2023 02:18:50 +0000 (19:18 -0700)]
Ignore erc-response objects in error-notice helper
* lisp/erc/erc-button.el (erc-button--display-error-notice-with-keys):
Remove `parsed' `erc-response' positional parameter, and don't pass it
to `erc-display-message' because the latter adds text properties
derived from such an object. These properties can confuse other code
operating on an inserted error-notice message into thinking it
originated from the server.
* lisp/erc/erc-common.el (erc--with-dependent-type-match): Make macro
more readable.
* lisp/erc/erc-networks.el (erc-networks--set-name,
erc-networks--ensure-announced, erc-networks-on-MOTD-end): Remove
`erc-response' objects from inserted error-notices.
* test/lisp/erc/erc-button-tests.el
(erc-button--display-error-notice-with-keys): Add assertions for
overloaded first parameter.
* test/lisp/erc/erc-tests.el (erc--with-dependent-type-match): Update
expected expansion.
Stefan Kangas [Sat, 19 Aug 2023 09:48:58 +0000 (11:48 +0200)]
Assume that font-lock is preloaded
* lisp/org/ox-beamer.el (org-mode): Assume that font-lock is
preloaded, which it has been since Emacs 22.1.
* lisp/textmodes/reftex.el (reftex-use-fonts): Make function obsolete
in favor of variable. Update all callers.