Jim Porter [Sat, 2 Sep 2023 21:44:33 +0000 (14:44 -0700)]
Be more precise about navigating forward/backward through Eshell prompts
* lisp/eshell/em-prompt.el (eshell-next-prompt): Make N optional.
When navigating, first move to the end of the prompt. This makes the
subsequent navigation more predictable.
(eshell-previous-prompt): Mane N optional.
* test/lisp/eshell/em-prompt-tests.el
(em-prompt-test--with-multiline): Move to "Code" section.
(em-prompt-test/next-previous-prompt-with): Rename to...
(em-prompt-test/next-previous-prompt-1): ... this, and add additional
test cases. Update callers.
(em-prompt-test/forward-backward-matching-input-with): Rename to...
(em-prompt-test/forward-backward-matching-input-1): ... this, and
improve existing test cases.
Stephen Berman [Sat, 2 Sep 2023 21:22:01 +0000 (23:22 +0200)]
Fix and extend applying substitution in widget-choose
* lisp/wid-edit.el (widget-choose): Iterate only over proper lists
when applying substitution (bug#64046, Message #53). With simple
item definitions, apply substitution only to the item text, not to
its value (bug#64046, Message #86). Apply substitution also to
the widget title (bug#64046, Message #92).
* lisp/progmodes/gdb-mi.el (gdb-active-process): Remove.
It went out of use in 2010 (691cf4a0a2), and was initialised to what
was clearly meant as a doc string.
Alan Mackenzie [Sat, 2 Sep 2023 13:50:03 +0000 (13:50 +0000)]
Output better error messages on certain edebug spec errors
This fixes bug#65620. The error thrown up to now was "Void
function edebug-after". This has been replaced by "Invalid
call to `edebug-before'. Is the edebug spec for `foo'
correct?".
* lisp/emacs-lisp/edebug.el (edebug-b/a-error): New function
which throws the new friendlier error message.
(edebug-before, edebug-after): Replace the defalias's to nil
with actual functions which just call edebug-b/a-error.
* doc/lispref/edebug.texi (Specification List): In the entry
for `sexp', warn against mistakenly using `form' for an
Eli Zaretskii [Sat, 2 Sep 2023 08:28:17 +0000 (04:28 -0400)]
Merge from origin/emacs-29
648a5e33e80 Update to Org 9.6.8-3-g21171d 458442fe78c Escape percent character in treesit--inspect-name (bug#65... bc0426ce8ed Don't add an extraneous slash in remote PATH list in Eshell 34f7a47c9ce Fix Tramp on MS Windows ea5fd6c96bc * Fix native disassemble on Windows platforms (bug#65455) 91d2d8439bb * Handle missing eln file when trying to disassble (bug#6... e7ac50a1539 * lisp/emacs-lisp/comp.el (comp--native-compile): Fix OUT... 45cf3a0cede Update to Transient v0.4.3 31d3808fb9d Adapt Eshell manual 0c50af054f9 Fix applying patches with Git on MS-Windows
Jens Schmidt [Wed, 16 Aug 2023 21:31:30 +0000 (23:31 +0200)]
Add documentation to plstore.el
* lisp/plstore.el: Add link to epa manual. Describe more
restrictions. Fix a typo in the examples. Fix terminology. Mark
FIXMEs as such.
* lisp/plstore.el (plstore-save): Describe edge case when no recipient
matches and mark as FIXME. (Bug#63627)
* 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 13:33:40 +0000 (16:33 +0300)]
; Improve documentation of 'char-table-range'
* doc/lispref/sequences.texi (Char-Tables):
* src/chartab.c (Fchar_table_range): Clarify what
'char-table-range' returns for an argument that is a cons cell.
Eli Zaretskii [Fri, 1 Sep 2023 13:08:36 +0000 (16:08 +0300)]
Fix minor bugs in vc-git and vc-hg on Windows uncovered by vc-tests
* lisp/vc/vc-hg.el (vc-hg-state-slow): Non-existing files emit a
different message on MS-Windows; support that.
* lisp/vc/vc-git.el (vc-git-checkin): Make sure
'default-directory' is not nil when calling
'make-nearby-temp-file' on MS-Windows.
* test/lisp/vc/vc-tests.el (vc-test--version-diff): Run
'default-directory' through 'file-truename', otherwise the
'vc-test-cvs06-version-diff' test might fail on MS-Windows.
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)
Yuan Fu [Thu, 31 Aug 2023 03:53:03 +0000 (20:53 -0700)]
Improve performance of treesit_cursor_helper_1
* src/treesit.c: (treesit_cursor_helper_1): Use
ts_tree_cursor_goto_first_child_for_byte to speed up traversing among
siblings. The "while (ts_node_end_byte (cursor_node) < end_pos)" can
be removed with the check added in the loop below.
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.