Commit Graph

177517 Commits

Author SHA1 Message Date
Stefan Kangas
bad2cd198a Make turn-on-flyspell/turn-off-flyspell obsolete
* lisp/textmodes/flyspell.el (turn-on-flyspell): Make into obsolete
function alias for 'flyspell-mode'.
(turn-off-flyspell): Declare obsolete.
(text-mode-hook): Don't redundantly set :options here.
* lisp/textmodes/text-mode.el (text-mode-hook): Prefer 'flyspell-mode'
to 'turn-on-flyspell' in :options.  (Bug#76535)
2025-03-14 19:50:22 +01:00
Michael Albinus
24ffcbb3da Improve tramp-*-with-sudo commands
* doc/emacs/dired.texi (Dired Visiting):
Add tramp-dired-find-file-with-sudo.

* doc/emacs/files.texi (Reverting):
Add tramp-revert-buffer-with-sudo.

* doc/misc/tramp.texi (Ad-hoc multi-hops): Extend wrt
`tramp-*-with-sudo' commands.

* etc/NEWS: Add tramp-dired-find-file-with-sudo.
Fix typos.

* lisp/bindings.el (ctl-x-x-map):
* lisp/dired.el (dired-mode-map): Add "@" binding.  (Bug#76974)

* lisp/net/tramp-cmds.el (dired-get-file-for-visit): Declare.
(with-tramp-file-name-with-method): New macro.
(tramp-revert-buffer-with-sudo): Autoload.  Preserve position.
Use `with-tramp-file-name-with-method'.
(tramp-dired-find-file-with-sudo): New command.
2025-03-14 16:31:51 +01:00
Eli Zaretskii
21371aa106 ; * etc/NEWS: Announce the larger number of sub-processes on w32. 2025-03-14 15:22:24 +02:00
Eli Zaretskii
c87f0e8a19 ; * src/w32.h (free_wait_pool): Move prototype from w32.c. 2025-03-14 15:05:29 +02:00
Yue Yi
e02466a579 Increase FD_SETSIZE on Windows to support more subprocesses
Earlier versions of Emacs were limited to at most 32 subprocesses or
network connections on Windows due to the 64-object limit imposed by
WaitForMultipleObjects.  To overcome this, a simple waiting thread
pool is implemented, allowing Emacs to efficiently wait on up to
2048 objects.

Each thread in the pool can wait on up to 63 objects, and a total of
32 threads are used, together with the main thread, to expand the
waiting capability.  This enables Emacs to support approximately 1024
subprocesses, which is comparable to the 'pty' method on GNU/Linux
when using the default FD_SETSIZE of 1024.

To minimize overhead, the threads remain active instead of being
frequently created and destroyed, reducing unnecessary system
resource consumption.  Idle threads can be terminated after a
period of inactivity to free up memory.

* src/w32.h (FD_SETSIZE): Change from 64 to 2048.
* src/w32.c (term_ntproc): Call 'free_wait_pool' to free waiting
threads.
* src/w32proc.c (WFO_ABANDONED, WFO_TIMEOUT, WFO_FAILED)
(WFO_MAX_WAIT): New macros.
(wait_objects_context, wait_objects_pool, wait_objects_info):
New structures for managing the thread pool.
(wait_objects_pool, wait_objects_info): New static variables for
managing the thread pool.
(wait_objects_thread, start_wait_objects, stop_wait_objects)
(end_wait_and_return, shrink_wait_pool, free_wait_pool):
New functions for waiting and managing the thread pool.
(wait_for_objects, msg_wait_for_objects): New functions as
replacements for WaitForMultipleObjects and
MsgWaitForMultipleObjects.
(wait_pid): Use 'wait_for_objects' and new macros.
(sys_select): Make some variables static to avoid stack
allocation.  Use 'wait_for_objects', 'msg_wait_for_objects', and
the new macros.
2025-03-14 14:58:42 +02:00
Eli Zaretskii
5d4056c765 Fix a recent change in isearch.el
* lisp/isearch.el (isearch-yank-x-selection): Ignore errors
signaled by 'gui-get-primary-selection', to better emulate what
'gui-get-selection' was doing.  In particular,
'gui-get-primary-selection' can signal an error on MS-Windows.
2025-03-14 14:00:16 +02:00
Eli Zaretskii
0e93029353 ; * lisp/isearch.el (isearch-yank-x-selection): Doc fix. 2025-03-14 13:52:54 +02:00
Po Lu
1437fc2bca Enable yanking non-Latin-1 primary selections in I-Search
* lisp/isearch.el (isearch-yank-x-selection): Call
`gui-get-primary-selection', which accounts for non-Latin-1
encodings.
2025-03-14 15:54:01 +08:00
Ulrich Müller
5dc0981875 New configure option --with-systemduserunitdir
* configure.ac (systemduserunitdir): New variable and option.
* Makefile.in (systemduserunitdir): New, set by configure.
(install-etc, uninstall): Don't install emacs.service when
systemduserunitdir is unspecified.
* etc/NEWS: Announce the new configure option.  (Bug#76924)
2025-03-14 08:01:47 +01:00
Yuan Fu
f2f1fb7fe0 Merge from origin/emacs-30
defc55bb6f Fix treesit-parser-create behavior regarding indirect buf...
20ac26e675 ; Fix with-delayed-message docstring metavars.
04034cd9ce Fix 'dired-movement-style' in Dired when subdirs are shown
f8443dffc1 ; * lisp/register.el (register-use-preview): Doc fix (bug...
f729828bcf ; Add texinfo reference to GNU Coding Standards.
a6abb88fdc ; * lisp/files.el (executable-find): Doc fix.

# Conflicts:
#	src/treesit.c
2025-03-13 20:18:03 -07:00
Yuan Fu
defc55bb6f Fix treesit-parser-create behavior regarding indirect buffers
The previous fix fixed the problem that treesit-parser-create
always use the current buffer, but that introduce another subtle
problem: if an indirect buffer creates a parser, the parser
saves the base buffer rather than the indirect buffer.  In Emacs
29, if you create a parser in an indirect buffer, the parser
saves the indirect buffer.  This change of behavior breaks some
existing use-cases for people using indirect buffer with
tree-sitter.

In Emacs 31, indirect buffers and base buffer get their own
parser list, so this problem doesn't exist anymore.  The fix is
only for Emacs 30.

* src/treesit.c (Ftreesit_parser_create): Use the buffer that's
given to treesit-parser-create, even if it's an indirect buffer.
2025-03-13 20:09:03 -07:00
Eli Zaretskii
89441e12e2 Fix aborts and text corruption in 'replace-buffer-contents'
* src/insdel.c (replace_range): Fix a thinko.  Fix commentary.
(Bug#76997)
2025-03-13 22:19:14 +02:00
Juri Linkov
59a67dcde4 Handle narrowed buffers in treesit-forward-sentence (bug#76679)
* lisp/treesit.el (treesit-forward-sentence): When no more
sentences are found, move to the end of the buffer or to
the range boundary at the 'treesit-parser' overlay's end.
2025-03-13 20:44:54 +02:00
Juri Linkov
d1ce9fbf49 Support more embedded ranges in treesit-up-list and treesit-outline-level
* lisp/treesit.el (treesit-up-list, treesit-outline-level):
Add a loop to handle all nested parsers.
2025-03-13 20:29:50 +02:00
Juri Linkov
abeeb6eb74 * lisp/textmodes/css-mode.el (css-ts-mode--outline-predicate): Improve.
Set separate value that differs from 'css--treesit-simple-imenu-settings'
by adding new node "at_rule".
2025-03-13 20:25:29 +02:00
Mauro Aranda
8298bbada4 Fix error when trying to recommend setopt
* lisp/help-fns.el (help--recommend-setopt): Don't assume that
variable-documentation stores only strings.  (Bug#76994)
2025-03-13 15:19:05 -03:00
Basil L. Contovounesios
f9d805cef3 ; Fix recent defvar-local docstring metavars. 2025-03-13 13:51:01 +01:00
Basil L. Contovounesios
20ac26e675 ; Fix with-delayed-message docstring metavars. 2025-03-13 13:39:39 +01:00
Eli Zaretskii
cecaec20e7 Allow control of indicating empty rectangular selections
* lisp/rect.el (rectangle-indicate-zero-width-rectangle): New user
option.
(rectangle--highlight-for-redisplay): Use it to decide whether to
indicate empty rectangles on display.  (Bug#16403)

* etc/NEWS: Announce the feature.
2025-03-13 13:35:54 +02:00
Eli Zaretskii
04034cd9ce Fix 'dired-movement-style' in Dired when subdirs are shown
* lisp/dired.el (dired--move-to-next-line): Don't consider
sub-directory lines as empty.  (Bug#76596)
2025-03-13 12:34:23 +02:00
Eli Zaretskii
d29e0add71 ; Fix last change (bug#75543)
* lisp/textmodes/remember.el (remember-initial-major-mode)
(remember-data-files-regex): Fix :version and doc strings.

* etc/NEWS: Fix last added entries.
2025-03-13 12:21:28 +02:00
Matthias Meulien
e937167253 Turn 'remember-mode' into a minor mode
* lisp/textmodes/remember.el (remember-initial-major-mode):
Major mode for remember buffer.
(remember-data-files-regex): Regular expression to filter files.
(remember-append-in-data-directory): Handler to append data to
files.
(remember-mode): Change to a minor mode.
(remember-prefix-map): New.  (Bug#75543)
2025-03-13 12:04:46 +02:00
Mauro Aranda
32ff6c9db1 Recognize graphic as a type when customizing a face
* lisp/cus-edit.el (custom-display): Add checkbox for graphic.
(Bug#76975)
2025-03-13 06:48:39 -03:00
Eli Zaretskii
f8443dffc1 ; * lisp/register.el (register-use-preview): Doc fix (bug#76739). 2025-03-13 10:14:07 +02:00
john muhl
1528d31564 Simplify and improve indent rules in 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el (c-ts-common): Require it.
(lua-ts-mode): Set 'c-ts-common' variables.
(lua-ts--simple-indent-rules): Replace custom indent rules for
tables, arguments and parameters with
'c-ts-common-baseline-indent-rule'.
Improve consistency of indentation for IIFEs and nested functions.
(lua-ts--variable-declaration-continuation)
(lua-ts--variable-declaration-continuation-anchor): Reformat.
(lua-ts--comment-first-sibling-matcher)
(lua-ts--first-child-matcher, lua-ts--first-real-sibling-anchor)
(lua-ts--function-definition-p, lua-ts--g-g-g-parent)
(lua-ts--g-g-parent, lua-ts--nested-function-argument-matcher)
(lua-ts--nested-function-block-include-matcher)
(lua-ts--nested-function-block-matcher)
(lua-ts--nested-function-end-argument-matcher)
(lua-ts--nested-function-end-matcher)
(lua-ts--nested-function-last-function-matcher)
(lua-ts--top-level-function-call-matcher): Remove.
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts:
Update tests.  (Bug#76986)
2025-03-13 10:09:38 +02:00
Stefan Kangas
b51fb2e107 Fix loading follow.el
* lisp/follow.el (follow-mode-prefix-key): Avoid changing
follow-mode-map before it is defined.  (Bug#76977)
* test/lisp/follow-tests.el: New file.
2025-03-13 08:14:36 +01:00
Jeremy Bryant
f729828bcf ; Add texinfo reference to GNU Coding Standards.
* doc/emacs/trouble.texi (Coding Standards): Add texinfo reference to
GNU Coding Standards manual.  (Bug#76901)
2025-03-13 07:12:26 +01:00
Daniel Mendler
ae33aad7f5 window-tool-bar: Use `static-if' from Compat 30
* lisp/window-tool-bar.el (window-tool-bar--static-if): Remove macro.
(window-tool-bar--ignored-event-types): Use `static-if' from Compat
instead.  (Bug#76858)
2025-03-13 06:08:58 +01:00
Stefan Kangas
99d034cfd3 ; Fix mistake in defvar-keymap conversion
A mix of `keymap-set` and `define-key` confused the automated
conversion.  Problem reported by Juri Linkov <juri@linkov.net>.
2025-03-13 06:07:25 +01:00
Michael Albinus
13a043fec9 Tramp: Don't offer non-existing containers in completion
* doc/misc/tramp.texi (File name completion):
Explain "completion-use-cache" property.

* lisp/net/tramp-cache.el (tramp-get-method-parameter): Declare.
(tramp-get-hash-table): Mark connection properties.
(tramp-dump-connection-properties): Remove empty lists.
(tramp-parse-connection-properties): Take connection property
"completion-use-cache" into account.  (Bug#76950)

* lisp/net/tramp-container.el (tramp-methods) <docker, dockercp, podman>
<podmancp, kubernetes, toolbox, distrobox, flatpak, apptainer, nspawn>:
Add `tramp-completion-use-cache' argument.
2025-03-12 20:56:24 +01:00
Arash Esbati
85c00405b9 ; Improve `reftex-toc-help'
* lisp/textmodes/reftex-toc.el (reftex-toc-help): Remove
unnecessary spaces.  Use \` for key sequence.
2025-03-12 18:48:22 +01:00
Stephen Gildea
6ab65281c5 time-stamp: optimize resource use
* lisp/time-stamp.el (time-stamp-string-preprocess): Replace
n-squared string 'concat' with linear list 'push'.
2025-03-12 07:02:44 -07:00
Stephen Gildea
1bfbaacc05 time-stamp: refactor for readability
* lisp/time-stamp.el (time-stamp-string-preprocess): Move all of the
big 'while' loop to the end of the function, to better expose its
structure of iterating over the format string.
2025-03-12 06:51:52 -07:00
Eli Zaretskii
a6abb88fdc ; * lisp/files.el (executable-find): Doc fix. 2025-03-12 14:53:03 +02:00
Po Lu
26f5e6339b Don't warn about Xft >= 2.3.6
* configure.ac: Don't warn about Xft >= 2.3.6.  Clarify warning
message printed on old releases.
2025-03-12 17:28:37 +08:00
Sean Whitton
a5f2d6279e ; exchange-point-and-mark-highlight-region: Add more detail here too 2025-03-12 11:59:46 +08:00
Sean Whitton
cd1defc441 ; Add more detail to exchange-point-and-mark docstring
It didn't mention that exchange-point-and-mark-highlight-region
affects C-u C-x C-x too.
2025-03-12 11:57:04 +08:00
Sean Whitton
ad57fbc58f find-function-mode-lower-precedence: Also remove the global bindings
* lisp/emacs-lisp/find-func.el (find-function-mode): When
find-function-mode-lower-precedence is non-nil, apply the
bindings in such a way that we can also remove them when the
mode is deactivated.  Approach due to Stefan Monnier.
2025-03-12 11:00:16 +08:00
Sean Whitton
9838b88c2e ; Document recent change to diff-apply-buffer
* doc/emacs/files.texi (Diff Mode):
* etc/NEWS: Document diff-apply-buffer considering an active
region and its new prefix argument.
2025-03-12 10:33:55 +08:00
Sean Whitton
2aef2951c0 ; Replace "Elisp" with "Lisp" or "Emacs Lisp" in some places
* configure.ac (libgccjit_not_found_err)
(libgccjit_dev_not_found_err):
* doc/lispref/elisp.texi (Top):
* doc/lispref/functions.texi (What Is a Function):
* doc/lispref/parsing.texi (Parsing Program Source)
(Tree-sitter C API):
* doc/misc/gnus.texi (The Gnus Registry):
* etc/TODO:
* lisp/auth-source.el (auth-source-search):
* lisp/cedet/semantic/bovine/el.el (emacs-lisp-mode):
* lisp/editorconfig.el
(editorconfig-get-local-variables-functions):
* lisp/emacs-lisp/cconv.el (cconv-make-interpreted-closure):
* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper):
* lisp/net/tramp-message.el (tramp-debug-font-lock-keywords):
* src/frame.c (do_switch_frame):
* test/lisp/emacs-lisp/shortdoc-tests.el
(shortdoc-help-fns-examples-function-test): Say "Lisp"
not "Elisp".
* lisp/progmodes/peg.el (peg-translate-exp): Say "Emacs Lisp"
not "Elisp".
2025-03-12 10:24:22 +08:00
Sean Whitton
d01a391195 ; Touch up docs for exchange-point-and-mark-highlight-region 2025-03-12 10:13:07 +08:00
Sean Whitton
22db8a2c2a Merge from origin/emacs-30
2029104605 Correct some outdated docs for hack-local-variables
2025-03-12 10:09:45 +08:00
Sean Whitton
aa545fea2d ; Merge from origin/emacs-30
The following commit was skipped:

c877acc261 ; Backport ELisp->Elisp fix to etc/NEWS to ease merging
2025-03-12 10:09:45 +08:00
Sean Whitton
99852fb867 Merge from origin/emacs-30
894b0e3a2f ; Adapt comment in tramp.el
cc87717fa0 Add keyword placeholder to tramp.el
7d0d61d854 Rewrite ERT manual introduction
b2f124f2a8 ; cperl-mode.el: Don't misinterpret exec_fcn as keyword exec
59d1aac49d Document return values of the various read-* functions
2025-03-12 10:09:09 +08:00
Sean Whitton
2029104605 Correct some outdated docs for hack-local-variables
* doc/lispref/variables.texi (File Local Variables):
<hack-local-variables>: Say that it applies directory-local
variables too.  Add a cross-reference.
(Directory Local Variables): Document dir-local-variables-alist.
* lisp/files.el (hack-local-variables): Say that it always puts
into effect directory-local variables.
2025-03-12 10:05:32 +08:00
Sean Whitton
c877acc261 ; Backport ELisp->Elisp fix to etc/NEWS to ease merging
Do not merge to master.
2025-03-12 09:45:47 +08:00
Stefan Kangas
85b147d321 ; Fix :version tag
Reported by Campbell Barton <ideasman42@gmail.com>.
2025-03-12 02:44:10 +01:00
Sean Whitton
60c0524ad2 Fix capitalization ELisp -> Elisp
* configure.ac (libgccjit_not_found_err)
(libgccjit_dev_not_found_err):
* doc/emacs/buffers.texi (List Buffers):
* doc/lispref/elisp.texi (Tree-sitter C API):
* doc/lispref/functions.texi (What Is a Function):
* doc/lispref/parsing.texi (Parsing Program Source)
(Tree-sitter C API):
* doc/misc/gnus.texi (The Gnus Registry):
* etc/DEBUG:
* etc/NEWS:
* etc/NEWS.25:
* etc/NEWS.26:
* etc/NEWS.28:
* etc/NEWS.30:
* etc/TODO:
* lib-src/emacsclient.c (print_help_and_exit):
* lisp/auth-source.el (auth-source-search):
* lisp/cedet/semantic/bovine/el.el (emacs-lisp-mode):
* lisp/cedet/semantic/wisent/comp.el
(wisent-automaton-lisp-form):
* lisp/cedet/srecode/el.el (srecode-semantic-apply-tag-to-dict):
* lisp/editorconfig.el
(editorconfig-get-local-variables-functions):
* lisp/emacs-lisp/bindat.el (bindat-type):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
* lisp/emacs-lisp/cconv.el (cconv-make-interpreted-closure):
* lisp/emacs-lisp/cl-macs.el (cl--labels-convert):
* lisp/emacs-lisp/lisp-mode.el (lisp-fdefs)
(lisp-fill-paragraphs-as-doc-string):
* lisp/emacs-lisp/macroexp.el (macroexp--fgrep):
* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper):
* lisp/emacs-lisp/re-builder.el:
* lisp/erc/erc-button.el (erc-emacswiki-lisp-url):
* lisp/help-fns.el
(help-fns--describe-function-or-command-prompt):
* lisp/menu-bar.el (menu-bar-search-documentation-menu):
* lisp/net/tramp-message.el (tramp-debug-font-lock-keywords):
* lisp/org/org-capture.el (org-capture):
* lisp/org/org.el (org-category, org-todo):
* lisp/org/ox.el (org-export-async-start):
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode):
* lisp/progmodes/peg.el (peg-translate-exp):
* lisp/progmodes/ruby-ts-mode.el:
* lisp/woman.el (woman-mode, woman-parse-numeric-arg):
* src/chartab.c (map_char_table_for_charset):
* src/fns.c (extract_data_from_object):
* src/frame.c (do_switch_frame):
* src/keyboard.c (make_lispy_event):
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-&key-arguments):
* test/lisp/emacs-lisp/shortdoc-tests.el
(shortdoc-help-fns-examples-function-test):
* test/manual/etags/c-src/emacs/src/keyboard.c
(make_lispy_event): Fix capitalization ELisp -> Elisp.
2025-03-12 09:38:33 +08:00
F. Jason Park
dd1b11d34c Add erc-compat adapter for xml-escape-string
* lisp/erc/erc-compat.el (erc-compat--xml-escape-string): New macro to
call `xml-escape-string' sans the NO-ERROR argument on Emacs 27.
* lisp/erc/erc-desktop-notifications.el (erc-notifications-notify): Use
compat macro.
2025-03-11 18:28:38 -07:00
F. Jason Park
3db65ff5cb Suppress log module when inserting date stamps in ERC
* lisp/erc/erc-log.el (erc-truncate-buffer-on-save): Use
`make-obsolete-variable' because `erc-truncate-buffer-on-save' is an
option, not a function.  Already mentioned in etc/ERC-NEWS.
(erc-logging-enabled): Return nil if `log' appears in the `erc--skip'
msg prop.
* lisp/erc/erc-stamp.el (erc-stamp--defer-date-insertion-on-post-modify):
Add `log' to `erc--skip' msg prop.  This tells the log module to defer
advancing the `erc-last-saved-position' marker until after stamps have
been inserted, thus ensuring they're included in logs when
`erc-log-write-after-insert' is non-nil.
* test/lisp/erc/erc-scenarios-log.el
(erc-scenarios-log--save-buffer-in-logs/truncate-on-save): Suppress
warning for `erc-truncate-buffer-on-save'.
(erc-scenarios-log--write-after-insert): New test.  (Bug#76875)
2025-03-11 18:28:38 -07:00