Juri Linkov [Thu, 29 Feb 2024 17:50:04 +0000 (19:50 +0200)]
Add tabulated-list-groups and Buffer-menu-group-by (bug#69305)
* doc/lispref/modes.texi (Tabulated List Mode):
Add defvar tabulated-list-groups.
* lisp/buff-menu.el (Buffer-menu-group-by): New defcustom.
(Buffer-menu-unmark-all-buffers): Use tabulated-list-get-entry
to check whether the current line contains an entry.
(list-buffers-noselect): Enable outline-minor-mode
for tabulated-list-groups.
(list-buffers--refresh): When Buffer-menu-group-by is non-nil,
set tabulated-list-groups.
(Buffer-menu-group-by-mode, Buffer-menu-group-by-root):
New functions.
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups):
New buffer-local variable.
(tabulated-list-print-fake-header): Add distinct overlay
property 'fake-header'.
(tabulated-list-header-overlay-p): Filter out overlays that
don't have the property 'fake-header'.
(tabulated-list-print): Use the variable 'tabulated-list-groups'
to sort entries in groups separately.
(tabulated-list-print-entries): New function factored out from
'tabulated-list-print'.
* test/lisp/emacs-lisp/tabulated-list-tests.el (tabulated-list-groups):
New test.
Eli Zaretskii [Thu, 29 Feb 2024 13:37:19 +0000 (15:37 +0200)]
Improve documentation of recent changes in comp-run.el
* lisp/emacs-lisp/comp-run.el
(native-comp-async-warnings-errors-kind): Rename from
'native-comp-async-report-warnings-errors-kind', and rename
'importants' to 'important'; all users changed. Doc fix.
Po Lu [Thu, 29 Feb 2024 02:59:09 +0000 (10:59 +0800)]
Fix subprocess creation in directories managed by tramp-androidsu
* lisp/net/tramp-androidsu.el
(tramp-androidsu-maybe-open-connection): Set connection property
remote-namespace to t or nil subject to whether su runs in the
global mount namespace.
(tramp-androidsu-adb-handle-make-process): Delete function.
(tramp-androidsu-make-process): New function.
(tramp-androidsu-file-name-handler-alist): Switch to
tramp-androidsu-make-process.
Andrea Corallo [Mon, 19 Feb 2024 16:40:04 +0000 (17:40 +0100)]
Make type hierarchy textual representation a table
* etc/syncdoc-type-hierarchy.el (syncdoc-make-type-table): New function.
(syncdoc-update-type-hierarchy): Make use of.
* doc/lispref/type_hierarchy.txt: Regenerate.
Liu Hui [Wed, 21 Feb 2024 04:40:06 +0000 (12:40 +0800)]
Fix Python shell completion test failures
* test/lisp/progmodes/python-tests.el
(python-tests-with-temp-buffer-with-shell): Set XDG_CACHE_HOME
to a temporary directory.
(python-tests--pythonstartup-file): New function.
(python-shell-completion-at-point-jedi-completer)
(python-shell-completion-at-point-ipython): Use Jedi as the
native completion backend when possible. (bug#68559)
Po Lu [Wed, 28 Feb 2024 04:23:32 +0000 (12:23 +0800)]
; Fix last change
* lisp/net/tramp-androidsu.el
(tramp-androidsu-handle-write-region): Delete function.
(tramp-androidsu-sh-handle-write-region): New function.
(tramp-androidsu-file-name-handler-alist): Avoid infinite
recursion by replacing handle-write-region with the tramp-sh
implementation.
Po Lu [Wed, 28 Feb 2024 04:05:59 +0000 (12:05 +0800)]
Lift restrictions on `tramp-androidsu's app data access
* lisp/net/tramp-adb.el (tramp-adb-handle-copy-file): Remove
code now unnecessary.
* lisp/net/tramp-androidsu.el
(tramp-androidsu-mount-global-namespace): New user option.
(tramp-androidsu-su-mm-supported): New variable.
(tramp-androidsu-maybe-open-connection): Detect whether su
supports the -mm option, and provide it if so.
(tramp-androidsu-adb-handle-copy-file)
(tramp-androidsu-adb-handle-rename-file): Delete functions.
(tramp-androidsu-sh-handle-copy-file)
(tramp-androidsu-sh-handle-rename-file): New functions.
(tramp-androidsu-file-name-handler-alist): Switch to tramp-sh's
copy and rename handlers.
Stefan Monnier [Tue, 27 Feb 2024 13:24:45 +0000 (08:24 -0500)]
vhdl-mode.el: Reduce use of `eval`
* lisp/progmodes/vhdl-mode.el (vhdl--re2-region): New function.
(vhdl--signal-regions-functions): New constant, extracted from
`vhdl-update-sensitivity-list`.
(vhdl-update-sensitivity-list): Use it.
Po Lu [Tue, 27 Feb 2024 02:05:56 +0000 (10:05 +0800)]
Disable process tracing before launching /system/bin/su
* lisp/net/tramp-androidsu.el
(tramp-androidsu-maybe-open-connection): Disable process tracing
around start-process, that the setuid su binary may be started
regardless of its status.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-trivial-backquote):
Don't use obsolete `edebug-eval-defun`.
(edebug-tests-trivial-comma): Use `inhibit-read-only`; don't use
obsolete `edebug-eval-defun`; and fix bug#69406 by binding
`eval-expression-debug-on-error`.
Eli Zaretskii [Mon, 26 Feb 2024 17:26:04 +0000 (19:26 +0200)]
Fix display of reordered Arabic text
* src/xdisp.c (compute_stop_pos): Fix a year-old thinko in
handling auto-composed characters. It was introduced as part
of solving bug#62780, which optimized the search for composable
characters. (Bug#69384)
Po Lu [Mon, 26 Feb 2024 06:13:14 +0000 (14:13 +0800)]
Introduce a new TRAMP method `androidsu'
* doc/misc/tramp.texi (Quick Start Guide): Document the new
method.
* etc/NEWS (Tramp): Announce new method.
* lisp/net/tramp-adb.el (tramp-adb-handle-file-attributes)
(tramp-adb-handle-directory-files-and-attributes)
(tramp-adb-handle-file-name-all-completions): Properly print
ls's exit status in the presence of a pipe.
(tramp-adb-handle-copy-file): If the androidsu backend is in
use, call cp rather than adb push.
(tramp-adb-send-command): Disable ADB-specific code under
androidsu.
(tramp-adb-send-command-and-check): New argument
COMMAND-AUGMENTED-P.
Michael Albinus [Sun, 25 Feb 2024 09:06:09 +0000 (10:06 +0100)]
'read-passwd' can toggle the visibility of passwords
* doc/lispref/minibuf.texi (Reading a Password):
* etc/NEWS: 'read-passwd' can toggle the visibility of passwords.
* etc/images/README: Mention the new images below.
* etc/images/conceal.pbm:
* etc/images/conceal.svg:
* etc/images/reveal.pbm:
* etc/images/reveal.svg: New images.
* lisp/simple.el (read-passwd--mode-line-buffer)
(read-passwd--mode-line-icon): New defvars.
(read-passwd--toggle-visibility, read-passwd-mode): New defuns.
* lisp/subr.el (read-passwd-map): Add 'TAB' binding.
(read-passwd--hide-password): New defvar.
(read-passwd--hide-password): Rename function from
`read-password--hide-password'. Adapt callees. Implement both
hiding and showing the password. (Bug#69237)
(read-passwd): Call `read-passwd-mode'.
Spencer Baugh [Tue, 13 Feb 2024 17:20:39 +0000 (12:20 -0500)]
Check daemon is initialized before suppressing its init errors
Previously, the default error handler would correctly suppress
unhandled errors raised when IS_DAEMON and the initial frame
was current, since this is the normal state of operation for a
daemon-mode Emacs. However, this also incorrectly suppressed
errors raised while a daemon-mode Emacs was starting up.
Now, errors raised while a daemon-mode Emacs is starting up will be
handled just like errors when a non-daemon Emacs is starting up.
This was previously the case before changes for bug#1310 and
bug#1836, which added the suppression of errors when IS_DAEMON.
DAEMON_RUNNING didn't exist at the time of those changes, but now
it does, so we can do better.
* src/keyboard.c (Fcommand_error_default_function): Check
!DAEMON_RUNNING in addition to IS_DAEMON. (Bug#68799)
* src/lisp.h (DAEMON_RUNNING): Add a clarifying comment about
what this #define means.
Spencer Baugh [Wed, 14 Feb 2024 16:09:33 +0000 (11:09 -0500)]
Add context to errors thrown by server-start during startup
When server-start errors during startup, the error is printed to
the terminal without context. To help the user understand
better what went wrong, that printed error now mentions that the
error came from starting up the daemon.
* lisp/startup.el (command-line): Catch and annotate errors
thrown by server-start. (bug#68799)
Emanuel Berg [Tue, 23 Jan 2024 13:21:49 +0000 (14:21 +0100)]
Make erc-cmd-AMSG session local; add /GMSG, /AME and /GME
* etc/ERC-NEWS: Mention new slash commands.
* lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc
string by only affecting the current connection.
(erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): New IRC slash commands.
* test/lisp/erc/erc-scenarios-misc-commands.el
(erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test.
* test/lisp/erc/resources/commands/amsg-barnet.eld: New file.
* test/lisp/erc/resources/commands/amsg-foonet.eld: New file.
(Bug#68401)
F. Jason Park [Thu, 22 Feb 2024 04:08:37 +0000 (20:08 -0800)]
; Don't mention erc-branded Compat macros in ERC-NEWS
* doc/misc/erc.texi: Change fancy SASL example to also demonstrate
`let'-binding a local module.
* etc/ERC-NEWS: Don't mention `erc-compat-call' and
`erc-compat-function' because Emacs now ships with a compat.el stub
library.
* lisp/erc/erc-backend.el (erc-decode-parsed-server-response): Add
comments.
* lisp/erc/erc.el (erc): Mention return value.
Stefan Monnier [Fri, 23 Feb 2024 22:03:10 +0000 (17:03 -0500)]
diff-mode.el (diff-refine-nonmodified): New option
* lisp/vc/diff-mode.el (diff-font-lock-keywords): Refer directly to
font-lock faces.
(diff-apply-hunk): Use `user-error` for errors usually not due to bugs.
(diff--refine-propertize): New function.
(diff-refine-nonmodified): New custom var (bug#61396).
(diff--refine-hunk): Use them.
Stefan Monnier [Fri, 23 Feb 2024 21:46:01 +0000 (16:46 -0500)]
elisp-mode.el: Use `handler-bind` instead of `debug-on-error`
* lisp/progmodes/elisp-mode.el (elisp-enable-lexical-binding):
Don't get fooled by a global binding of `lexical-binding` to t.
(elisp--eval-last-sexp-fake-value): Delete var.
(elisp--eval-defun): Don't let-bind `debug-on-error` since it's
already arranged by the only caller.
(eval-last-sexp, eval-defun): Use `handler-bind` instead of
`debug-on-error`.
Robert A. Burks [Fri, 16 Feb 2024 23:17:52 +0000 (18:17 -0500)]
Fix Flymake lighter tool-tip from generating errors
Flymake tool-tip was generating errors on mouse over of
mode-line lighter on inactive windows and on the minor mode
indicator in the describe-mode Help page.
* lisp/progmodes/flymake.el (flymake--mode-line-title):
'help-echo' now uses buffer local state and makes null
check. (Bug#69248)
* doc/lispref/abbrevs.texi (Abbrev Tables):
* doc/lispref/symbols.texi (Creating Symbols):
* doc/lispref/objects.texi (Type Predicates): Update text for obarray
now being an opaque type.
* etc/NEWS: Announce.
The new opaque type replaces the previous use of vectors for obarrays.
`obarray-make` now returns objects of this type. Functions that take
obarrays continue to accept vectors for compatibility, now just using
their first slot to store an actual obarray object.
obarray-size and obarray-default-size now obsolete.
* lisp/obarray.el (obarray-clear): New.
* lisp/abbrev.el (clear-abbrev-table):
* lisp/vc/vc.el (vc-clear-context): Use it instead of assuming the
obarray is a vector that can be 0-filled.
* test/lisp/obarray-tests.el (obarray-clear): New test.
Tone down python-mode warning to a simple message (bug#68559)
* lisp/progmodes/python.el
(python-shell-completion-native-turn-on-maybe):
There is no need for an alarming warning when using an inferior Python
without GNU readline; a calm message will do.
Juri Linkov [Thu, 22 Feb 2024 17:38:17 +0000 (19:38 +0200)]
* lisp/help-fns.el (describe-mode-outline): New user option (bug#64684).
(describe-mode, describe-mode--minor-modes): Use 'describe-mode-outline'.
* lisp/help-mode.el (help-setup-xref): After disabling outline-minor-mode
also kill all outline-related local variables. So that they won't affect
the output of other help commands in the same help buffer.
Jörg Bornemann [Sat, 17 Feb 2024 20:18:02 +0000 (21:18 +0100)]
Recognize functions and macros as defuns in 'cmake-ts-mode'
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--function-name):
Renamed to 'cmake-ts-mode--defun-name' since the function handles
now functions and macros.
(cmake-ts-mode--defun-name): Return text of the first 'argument'
node below 'function_def' and 'macro_def' nodes.
(cmake-ts-mode): Set up treesit-defun-type-regexp and
'treesit-defun-name-function'. Change the imenu setup to
recognize macros too. Since we have set up
'treesit-defun-name-function', we don't have to
pass 'cmake-ts-mode--function-name' anymore. (Bug#69186)
To make `treesit-defun-at-point' work properly, we have to recognize
function_def/macro_def nodes, not the lower-level *_command nodes.