]> git.eshelyaron.com Git - emacs.git/log
emacs.git
6 weeks ago; * lisp/progmodes/python.el (python-interpreter): Fix :version.
Eli Zaretskii [Fri, 27 Sep 2024 05:44:35 +0000 (08:44 +0300)]
; * lisp/progmodes/python.el (python-interpreter): Fix :version.

(cherry picked from commit 42eb2265e64c4615f4a6111afc80ee25c782ef1e)

6 weeks agoBind "J" to bookmark-jump in bookmark-bmenu-mode
Stefan Kangas [Fri, 27 Sep 2024 05:11:22 +0000 (07:11 +0200)]
Bind "J" to bookmark-jump in bookmark-bmenu-mode

* lisp/bookmark.el (bookmark-bmenu-mode-map): Bind "J" to bookmark-jump.

(cherry picked from commit bdfeb45bfcf1bf29a820d3086f007d07147b0598)

6 weeks agoPrefer python3 for python-interpreter
Stefan Kangas [Thu, 26 Sep 2024 15:11:56 +0000 (17:11 +0200)]
Prefer python3 for python-interpreter

* lisp/progmodes/python.el (python-interpreter): Prefer "python3" when
it exists, to be consistent with python-shell-interpreter.

(cherry picked from commit 7f0a252f2160dd4d168bc77e2f6e6c9901b67465)

6 weeks agoMove to start of current header in diff-{file,hunk}-prev
Spencer Baugh [Tue, 10 Sep 2024 18:18:39 +0000 (14:18 -0400)]
Move to start of current header in diff-{file,hunk}-prev

If point was after a file or hunk header, the diff-file-prev and
diff-hunk-prev commands would move to the start of that header.
But if point was *within* the header, they would not move, and
would report "No previous file" or "No previous hunk".  This
differs from the behavior of most other movement commands,
e.g. backward-sexp or backward-sentence.

This commit fixes diff-file-prev and diff-hunk-prev, as well as
other easy-mmode-define-navigation BASE-prev commands.  Now
these commands move to the start of the containing "thing" just
like other movement commands.

* lisp/emacs-lisp/easy-mmode.el (easy-mmode--prev):
Move to start of current match first. (bug#73172)
* etc/NEWS: Document the behavior change.

(cherry picked from commit e776903b31cf2b2d21d91cbc7d6b7dbc1e9d442f)

6 weeks agoMove easy-mmode-define-navigation logic to helper functions
Spencer Baugh [Tue, 10 Sep 2024 17:46:18 +0000 (13:46 -0400)]
Move easy-mmode-define-navigation logic to helper functions

The functions defined by easy-mmode-define-navigation are useful
even if the easy-mmode-define-navigation macro is not used.
Let's take a step towards exposing them by moving them out as
helpers.

This also makes the macro much easier to modify and work on.

* lisp/emacs-lisp/easy-mmode.el (easy-mmode--prev)
(easy-mmode--next): Add (bug#73172).
(easy-mmode-define-navigation): Use easy-mmode--prev and
easy-mmode--next.

(cherry picked from commit da1416fc6998718d1e36e32961b4415045949632)

6 weeks ago(pcase-tests-quote-optimization): Fix warning
Stefan Monnier [Thu, 26 Sep 2024 21:03:28 +0000 (17:03 -0400)]
(pcase-tests-quote-optimization): Fix warning

* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-quote-optimization):
Fix confusing code.

(cherry picked from commit c95620ffbf8c2caebdb6a7aba7dbe9cd223fa2f4)

6 weeks ago* lisp/emacs-lisp/pcase.el (pcase--expand-\`): Improve warning message
Stefan Monnier [Thu, 26 Sep 2024 20:40:54 +0000 (16:40 -0400)]
* lisp/emacs-lisp/pcase.el (pcase--expand-\`): Improve warning message

And also move the warning "out of the way" so it doesn't
confuse optimizations.

(cherry picked from commit 4591d93a8e5e79e7fea8a67c84c6adf0ea8add28)

6 weeks ago; * etc/NEWS: Don't say that C-c M-r can undo whole commits.
Sean Whitton [Thu, 26 Sep 2024 19:02:05 +0000 (20:02 +0100)]
; * etc/NEWS: Don't say that C-c M-r can undo whole commits.

(cherry picked from commit 37bed70f4c0a2e33de238eab90d7470d34366f13)

6 weeks ago; Fix build error with last change in python.el
Gerd Möllmann [Thu, 26 Sep 2024 15:35:38 +0000 (17:35 +0200)]
; Fix build error with last change in python.el

(cherry picked from commit b9d103c16e9299f2bd8f1f8a5b5cc75a1295c29f)

6 weeks agoAdd Python "*.pth" files to auto-mode-alist
Stefan Kangas [Thu, 26 Sep 2024 15:04:31 +0000 (17:04 +0200)]
Add Python "*.pth" files to auto-mode-alist

* lisp/progmodes/python.el (python--auto-mode-alist-regexp): New
variable.
(auto-mode-alist, python-ts-mode): Use above new variable.

(cherry picked from commit 2f485e68ff96cc66a17df2c0a58e272bbfc24765)

6 weeks ago* Clean-up unused condition-case
Andrea Corallo [Thu, 26 Sep 2024 14:15:04 +0000 (16:15 +0200)]
* Clean-up unused condition-case

* lisp/emacs-lisp/comp.el (comp--native-compile): Remove unused
condition-case.

(cherry picked from commit 4c567892e044ada0e09889ec520fefa07f52b20b)

6 weeks ago; Fix documentation of last change
Eli Zaretskii [Thu, 26 Sep 2024 11:24:18 +0000 (14:24 +0300)]
; Fix documentation of last change

* lisp/vc/diff-mode.el (diff-ask-before-revert-and-kill-hunk): Add
':version' tag.
(diff-revert-and-kill-hunk, diff-apply-buffer): Doc fixes.

* etc/NEWS:
* doc/emacs/files.texi (Diff Mode): Fix last change; add indexing.

(cherry picked from commit c86e7a29e78e75b487ea36f0711f327f66f93c10)

6 weeks agoNew command diff-revert-and-kill-hunk
Sean Whitton [Tue, 24 Sep 2024 08:38:43 +0000 (09:38 +0100)]
New command diff-revert-and-kill-hunk

* lisp/vc/diff-mode.el (diff-revert-and-kill-hunk): New
command (bug#73407).
(diff-ask-before-revert-and-kill-hunk): New user option.
(diff-apply-buffer): New optional BEG, END and REVERSE
arguments.  Return nil if buffers were saved, or the number of
failed applications.
(diff-mode-map): Bind the new command to C-c M-r.
(diff-mode-menu): New entry for the new command.
* doc/emacs/files.texi (Diff Mode):
* etc/NEWS: Document the change.

(cherry picked from commit f2e3e563d4909ff503bb2d3aeb6d2de9804e3047)

6 weeks agoRevert "; Recommend GNU Find for 'find-dired'"
Eli Zaretskii [Thu, 26 Sep 2024 07:30:15 +0000 (10:30 +0300)]
Revert "; Recommend GNU Find for 'find-dired'"

This reverts commit 5f8c2d5bf9638c38fdba7eb840d3bc7b252bb687.
It was committed by mistake on this branch.

(cherry picked from commit 8ffb680d09bc6b18d36941765e0f4ca881b565c9)

6 weeks ago; Recommend GNU Find for 'find-dired'
Eli Zaretskii [Thu, 26 Sep 2024 07:28:20 +0000 (10:28 +0300)]
; Recommend GNU Find for 'find-dired'

* lisp/find-dired.el (find-dired): Doc fix (bug#73455).

(cherry picked from commit 5f8c2d5bf9638c38fdba7eb840d3bc7b252bb687)

6 weeks agoDeprecate 'Homepage' header in favor of 'URL'
Stefan Kangas [Thu, 26 Sep 2024 00:04:03 +0000 (02:04 +0200)]
Deprecate 'Homepage' header in favor of 'URL'

* doc/lispref/tips.texi (Library Headers): Document the 'Homepage'
header as deprecated in favor of 'URL'.

(cherry picked from commit 89abbb843a01f799c320ad776d139835e80ecf61)

6 weeks ago; * src/cm.c (calccost): Fix typo. (Bug#73485)
Jeremy Bryant [Wed, 25 Sep 2024 21:04:23 +0000 (22:04 +0100)]
; * src/cm.c (calccost): Fix typo. (Bug#73485)

(cherry picked from commit 0c861b820b79d9bd8b3ed2c445c79ca806b1cb67)

6 weeks ago* etc/NEWS: Describe the change to enum handling in CC Mode
Alan Mackenzie [Wed, 25 Sep 2024 21:06:07 +0000 (21:06 +0000)]
* etc/NEWS: Describe the change to enum handling in CC Mode

(cherry picked from commit 3a0db55b5094686423b73b74ebdf9eba62d384f2)

6 weeks ago; Improve use of ngettext
Eli Zaretskii [Wed, 25 Sep 2024 19:33:30 +0000 (20:33 +0100)]
; Improve use of ngettext

(cherry picked from commit f28793822d86b9c4135c70498b4588629f0c6ea7)

6 weeks ago; Really disable 'button-mode' in 'emacs-news-mode'
Robert Pluim [Tue, 24 Sep 2024 08:52:35 +0000 (10:52 +0200)]
; Really disable 'button-mode' in 'emacs-news-mode'

* lisp/textmodes/emacs-news-mode.el (emacs-news-mode): Call
'button-mode' with -1 arg.

(cherry picked from commit a06a7209028363a1bb2f727ffaecdf4d02296b2e)

6 weeks agoTest 'network-lookup-address-info' argument type checking
Robert Pluim [Thu, 19 Sep 2024 08:06:20 +0000 (10:06 +0200)]
Test 'network-lookup-address-info' argument type checking

* test/src/process-tests.el (lookup-hints-values): Pass in
non-string values, which should result in type errors.

(cherry picked from commit 1b1b922992946f0d17f6a2a2d3515b36a955244e)

6 weeks ago; Tramp cosmetic change
Michael Albinus [Wed, 25 Sep 2024 09:36:28 +0000 (11:36 +0200)]
; Tramp cosmetic change

* lisp/net/tramp.el (tramp-file-name-handler):
Adapt `tramp-verbose' when completing host names.

(cherry picked from commit 29c610a83243c82aeb1bfefea26adad0b34ff011)

6 weeks ago; * Clean-up compilation warning in cc-vars.el
Andrea Corallo [Wed, 25 Sep 2024 08:19:12 +0000 (10:19 +0200)]
; * Clean-up compilation warning in cc-vars.el

* lisp/progmodes/cc-vars.el (c-offsets-alist): Move definition to
clean-up byte-compiler warning.

(cherry picked from commit 4b76af49281e5522dcabbf2fc6be8f1b8bc535ac)

6 weeks ago* lisp/hi-lock.el (hi-lock-revert-buffer-rehighlight): Fix lighter.
Juri Linkov [Wed, 25 Sep 2024 06:57:16 +0000 (09:57 +0300)]
* lisp/hi-lock.el (hi-lock-revert-buffer-rehighlight): Fix lighter.

Add '(car pattern)' as the LIGHTER argument of 'highlight-regexp'.
This fixes the case when in a file buffer with fundamental-mode:
`C-s M-s ' the M-s h r RET`, revert the buffer with 'C-x x g',
get the prompt for unhighlight with 'M-s h u'.  This showed
a raw regexp instead of the human-readable lighter (bug#57534).

(cherry picked from commit 0f424b16c37fce82a586014f32f8513f86786e4e)

6 weeks agoCC Mode: Separate indentation of enums from that of brace lists
Alan Mackenzie [Tue, 24 Sep 2024 20:45:29 +0000 (20:45 +0000)]
CC Mode: Separate indentation of enums from that of brace lists

This will allow enums to be indented as in the GNU coding
standards without affecting brace lists.

* lisp/progmodes/cc-align.el
(c-lineup-arglist-intro-after-paren)
(c-lineup-arglist-close-under-paren)
(c-lineup-whitesmith-in-block)
(c-lineup-after-whitesmith-blocks): Amend doc strings to
indicate they can be used for enum-* syntactic symbols too.

* lisp/progmodes/cc-engine.el (c-looking-at-decl-block)
(c-backward-typed-enum-colon, c-backward-over-enum-header):
Rename c-after-brace-list-key to c-after-enum-list-key and
c-brace-list-key to c-enum-list-key.
(c-at-enum-brace): New function.
(c-inside-bracelist-p): Don't check for enums any more.
(c-add-stmt-syntax): New cond arm for enums.
(c-guess-continued-construct CASE B.6) New code for enum-open.
(c-guess-basic-syntax CASE 5A.3, CASE 7B, CASE 9, CASE 9B)
(CASE 9C, CASE 9D): Use the new function c-at-enum-brace, and
use enum-* syntactic symbols rather than brace-list-* ones
where appropriate.
(c-used-syntactic-symbols): New dynamic variable.
(c-evaluate-offset): Add handling for a different syntactic
symbol as the cdr of a c-offsets-alist element.

* lisp/progmodes/cc-fonts.el (c-get-fontification-context):
Add a call to c-at-enum-brace since c-inside-bracelist-p no
longer handles enums.
(c-font-lock-enum-body, c-font-lock-enum-tail): Condense calls
to c-backward-over-enum-header to c-at-enum-brace.
(c-basic-matchers-after): Replace a c-brace-list-decl-kwds with
c-enum-list-kwds.

* lisp/progmodes/cc-langs.el (c-enum-list-kwds)
(c-enum-list-key): New names for c-brace-list-decl-kwds and
c-brace-list-key.
(c-after-enum-list-kwds, c-after-enum-list-key): New names for
c-after-brace-list-decl-kwds and c-after-brace-list-key.
(c-enum-list-key, c-after-enum-list-key): Add code to
use a value of an old name, should a derived mode still use
that.
(c-defun-type-name-decl-kwds, c-typedef-decl-kwds)
(c-typeless-decl-kwds, c-prefix-spec-kwds)
(c-brace-id-list-kwds, c-enum-clause-introduction-re): Use
c-enum-list-kwds rather than c-brace-list-decl-kwds.

* lisp/progmodes/cc-styles.el (c-read-offset): Add "a
syntactic symbol" into an error message text.

* lisp/progmodes/cc-vars.el (c-valid-offset): Allow for a
syntactic symbol as the parameter.
(c-offsets-alist): Add new syntactic symbols enum-open,
enum-close, enum-intro, and enum-entry.

* doc/misc/cc-mode.texi (Syntactic Symbols): Add a note that
anchor points are briefly documented in cc-vars.el.  Correct
the suffix "-block-intro" to "-intro".  Remove "an enum or"
from the descriptions of the brace-list-* syntactic symbols.
Add in new descriptions for the enum-* syntactic symbols.
(Brace List Symbols): Remove references to enums.  Add a note
that enums are no longer brace-lists.
(Enum Symbols): A new subsection documenting the new enum-*
syntactic symbols.
(c-offsets-alist): Document the new possibility, syntactic
symbol, for the cdr of an alist entry.
(Brace/Paren Line-Up, List Line-Up): Note that the new enum
syntactic symbols can be handled by these lineup functions.

(cherry picked from commit c2d6f191d489de8349847b5c18acec8462b66247)

6 weeks agoDeclare nested backquotes unsupported in Pcase patterns (bug#72328)
Stefan Monnier [Tue, 24 Sep 2024 18:01:26 +0000 (14:01 -0400)]
Declare nested backquotes unsupported in Pcase patterns (bug#72328)

The current behavior is inconsistent with that of the normal backquote
macro, so to avoid surprises, warn about the use of nested backquotes.

* lisp/emacs-lisp/pcase.el (pcase--expand-\`): Warn about nested backquotes.

* lisp/emacs-lisp/testcover.el (testcover-analyze-coverage)
(testcover-analyze-coverage-wrapped-form): Avoid nested backquotes

(cherry picked from commit e8f5df5175170d36f526e46b63b3d428bb9a8950)

6 weeks agodiff-apply-buffer: Improve failure message
Sean Whitton [Tue, 24 Sep 2024 15:17:17 +0000 (16:17 +0100)]
diff-apply-buffer: Improve failure message

* lisp/vc/diff-mode.el (diff-apply-buffer): Say "hunk", not
"hunks", when there was only one failed hunk.

(cherry picked from commit ce601de1cafa65d6e6f5ba52e9c794873d164fbd)

6 weeks ago; Fix shr-tests when Emacs was built without libxml2
Eli Zaretskii [Mon, 23 Sep 2024 15:30:00 +0000 (18:30 +0300)]
; Fix shr-tests when Emacs was built without libxml2

* test/lisp/net/shr-tests.el (shr-test/zoom-image): Skip if
libxml2 is not available.  (Bug#73440)

(cherry picked from commit e7260d4eb3ed1bebcaa9e2b934f162d4bb42e413)

6 weeks agoExtend tramp-otp-password-prompt-regexp
Michael Albinus [Mon, 23 Sep 2024 14:52:01 +0000 (16:52 +0200)]
Extend tramp-otp-password-prompt-regexp

* lisp/net/tramp.el (tramp-otp-password-prompt-regexp): Add TACC
HPC prompt.

(cherry picked from commit 40e0257b1084b0243b5fcc972068fbce41fd9629)

6 weeks agoWarn about unreachable code
Eshel Yaron [Fri, 27 Sep 2024 10:18:21 +0000 (12:18 +0200)]
Warn about unreachable code

7 weeks agoWarn about unreachable code
Eshel Yaron [Thu, 26 Sep 2024 12:03:42 +0000 (14:03 +0200)]
Warn about unreachable code

* lisp/emacs-lisp/byte-opt.el (byte-opt--every)
(byte-opt--return-p): New functions.
(byte-optimize-body): Emit warning for unreachable code.

7 weeks ago; Drop 'elisp--local-variables-completion-table'
Eshel Yaron [Thu, 26 Sep 2024 12:02:53 +0000 (14:02 +0200)]
; Drop 'elisp--local-variables-completion-table'

7 weeks ago; Move variable definition above its first use
Eshel Yaron [Thu, 26 Sep 2024 12:02:27 +0000 (14:02 +0200)]
; Move variable definition above its first use

7 weeks ago* doc/misc/tramp.texi (Frequently Asked Questions): Improve indices.
Michael Albinus [Mon, 23 Sep 2024 07:53:17 +0000 (09:53 +0200)]
* doc/misc/tramp.texi (Frequently Asked Questions): Improve indices.

(cherry picked from commit dda7abb177b8eec537b18abb978fcbcb61dd8af1)

7 weeks ago; Fix dnd-tests on MS-Windows
Eli Zaretskii [Sun, 22 Sep 2024 09:57:08 +0000 (12:57 +0300)]
; Fix dnd-tests on MS-Windows

* test/lisp/dnd-tests.el (dnd-tests-get-local-file-uri): Fix test
on MS-Windows.

(cherry picked from commit 3fb966dc6392e1908304a1b6fe481da9f670cfbb)

7 weeks agoFix multi-file drag-and-drop on MS-Windows
Cecilio Pardo [Sat, 21 Sep 2024 13:30:27 +0000 (15:30 +0200)]
Fix multi-file drag-and-drop on MS-Windows

Pass all dropped files to 'dnd-handle-multiple-urls' in
one call instead on doing multiple calls (Bug#73258).
* lisp/term/w32-win.el (w32-dropped-file-to-url): New function to
convert file name to a url for dnd.
(w32-handle-dropped-file): Changed to use 'w32-dropped-file-to-url'.
(w32-drag-n-drop): Changed to pass all files to
'dnd-handle-multiple-urls'/

(cherry picked from commit e8f0baf354b117837fd686e2bf6ca8df15bd1cd4)

7 weeks ago; Add test for deleting multiple pairs at once
Joseph Turner [Sat, 21 Sep 2024 17:23:07 +0000 (10:23 -0700)]
; Add test for deleting multiple pairs at once

* test/lisp/electric-tests.el (electric-pair-backspace-2):
New test.  (Bug#72437)

(cherry picked from commit 0f4c09d26782835a7e31bf29c92d72a6a27a3ff1)

7 weeks agoTeach Electric Pair mode about prefix arguments
Eshel Yaron [Sat, 21 Sep 2024 10:15:16 +0000 (12:15 +0200)]
Teach Electric Pair mode about prefix arguments

* lisp/elec-pair.el (electric-pair--insert): New arg TIMES.
(electric-pair-inhibit-if-helps-balance)
(electric-pair-post-self-insert-function)
(electric-pair-open-newline-between-pairs-psif)
(electric-pair-skip-if-helps-balance): Respect prefix arg.
(electric-pair-delete-pair): Delete ARG chars, not just 1.
* test/lisp/electric-tests.el (autowrapping-multi-1)
(autowrapping-multi-2): New tests.
* doc/emacs/programs.texi (Matching): Mention prefix arg
support in Electric Pair mode documentation.
* etc/NEWS: Announce it.  (Bug#72437)

(cherry picked from commit a7192fd7b7355f13ff3002dba14c6acdabad5b5e)

7 weeks ago; * lisp/midnight.el (midnight-mode): forward-declare midnight-delay
Mattias Engdegård [Sat, 21 Sep 2024 17:33:20 +0000 (19:33 +0200)]
; * lisp/midnight.el (midnight-mode): forward-declare midnight-delay

(cherry picked from commit f5bf007df122d3524b23725c5ddc2dd97d3577f8)

7 weeks agoCC Mode: fix minor errors in the fontification of enums.
Alan Mackenzie [Sat, 21 Sep 2024 16:46:32 +0000 (16:46 +0000)]
CC Mode: fix minor errors in the fontification of enums.

1: Fix the typing of a space on the { line in an enum
specification which is the first item in a buffer.  This
defontified the enum's identifiers.
2: Fix the typing of a space on the line of the enum's last
identifier.  This defontified that identifier for
jit-lock-context-time.

* lisp/progmodes/cc-engine.el (c-forward-declarator): Cease
rejecting the identifier if there are no further tokens before
LIMIT.

* lisp/progmodes/cc-mode.el (c-fl-decl-start): Accept a
backward search as succeeding if it hits point-min.

(cherry picked from commit 086cb1b590251ca353fec5a841ea882cdf9cbcb2)

7 weeks agoDon't activate midnight-mode when loading 'midnight'
Manuel Giraud [Sat, 21 Sep 2024 12:51:21 +0000 (14:51 +0200)]
Don't activate midnight-mode when loading 'midnight'

* lisp/midnight.el (midnight-mode): Call 'midnight-delay-set' again
when the mode is activated.
(midnight-delay-set): Only start the timer if the mode is turned
on.  (Bug#73291)
* etc/NEWS: Document the change in behaviour.

(cherry picked from commit 4745bafa6a1d6aeda5ad08e09541d076ee223382)

7 weeks agoDelete redundant declarations of 'electric' variables
Stefan Kangas [Sat, 21 Sep 2024 12:44:06 +0000 (14:44 +0200)]
Delete redundant declarations of 'electric' variables

* lisp/progmodes/js.el (electric-layout-rules):
* lisp/progmodes/octave.el (electric-layout-rules):
* lisp/progmodes/python.el (electric-indent-inhibit):
* lisp/textmodes/rst.el (electric-indent-inhibit): Delete redundant
declarations; 'electric' is preloaded since Emacs 24.4.

(cherry picked from commit dac1a48240a14c41e2d2792443eac62ea50e1f66)

7 weeks agoAdd Python keywords "aiter" and "anext"
Stefan Kangas [Sat, 21 Sep 2024 12:29:40 +0000 (14:29 +0200)]
Add Python keywords "aiter" and "anext"

* lisp/progmodes/python.el (python-font-lock-keywords-level-2)
(python--treesit-builtins): Add "aiter" and "anext" keywords,
introduced in Python 3.10.

(cherry picked from commit 3cad879c9dd1a7e97dbf28045761f3dfae851136)

7 weeks agoAdd all exceptions up to Python 3.13 as keywords
Stefan Kangas [Sat, 21 Sep 2024 12:13:47 +0000 (14:13 +0200)]
Add all exceptions up to Python 3.13 as keywords

* lisp/progmodes/python.el
(python-font-lock-keywords-maximum-decoration)
(python--treesit-exceptions): Add all built-in exceptions in Python 3.13
as keywords.  Missing from the list was "BaseExceptionGroup",
"EncodingWarning", "ModuleNotFoundError", and "PythonFinalizationError".

(cherry picked from commit 7aa5876cdf3df3ac0fa67a1dd06b49077dd0b8cf)

7 weeks agoAdd subword-mode toggle to python-mode menu
Stefan Kangas [Sat, 21 Sep 2024 12:07:29 +0000 (14:07 +0200)]
Add subword-mode toggle to python-mode menu

* lisp/progmodes/python.el (python-mode-map): Add subword-mode
toggle to menu.

(cherry picked from commit 29a760711731ce49965079e72d76b26ef3b7bcb4)

7 weeks agoSupport electric-layout-mode in python-base-mode
Stefan Kangas [Sat, 21 Sep 2024 02:41:46 +0000 (04:41 +0200)]
Support electric-layout-mode in python-base-mode

* lisp/progmodes/python.el (python-base-mode): Add support for
'electric-layout-mode'.

(cherry picked from commit dfecd6037d5ebe5778c40ff7b38bfcbaa3ef779e)

7 weeks ago; Skip commit 7a404e6d510830323381e5febbe61273f341dc20
Eshel Yaron [Sat, 21 Sep 2024 18:55:18 +0000 (20:55 +0200)]
; Skip commit 7a404e6d510830323381e5febbe61273f341dc20

7 weeks ago; Always set 'emoji--insert-buffer'
Scott Bell [Fri, 20 Sep 2024 21:16:52 +0000 (14:16 -0700)]
; Always set 'emoji--insert-buffer'

* lisp/international/emoji.el (emoji-list): Always set insert buffer.
(Bug#73390)

Copyright-paperwork-exempt: yes
(cherry picked from commit ecfebb5abb864d568a90ff4a1420c973781bbef9)

7 weeks agoFix font-lock of last character before EOB under 'whitespace-mode'
Stefan Monnier [Thu, 19 Sep 2024 15:50:26 +0000 (11:50 -0400)]
Fix font-lock of last character before EOB under 'whitespace-mode'

* lisp/whitespace.el (whitespace-color-on): Don't use OVERRIDE in
font-lock-keywords; instead, use 'prepend' in the call to
'font-lock-add-keywords'.  (Bug#73332)

(cherry picked from commit 35e356f958af69baad8a1a824c59993915fb6abe)

7 weeks agoFix 'whitespace-mode' with 'missing-newline-at-eof'
Eli Zaretskii [Sat, 21 Sep 2024 10:41:21 +0000 (13:41 +0300)]
Fix 'whitespace-mode' with 'missing-newline-at-eof'

* lisp/whitespace.el (whitespace-post-command-hook): Refontify
when point moves if 'missing-newline-at-eof' is in
'whitespace-active-style'.  (Bug#73332)

(cherry picked from commit 01ebe6de8954b2381bfba31038a0bd0669e33910)

7 weeks ago; * lisp/emacs-lisp/lisp.el (delete-pair-push-mark): Add :version.
Eli Zaretskii [Sat, 21 Sep 2024 10:23:50 +0000 (13:23 +0300)]
; * lisp/emacs-lisp/lisp.el (delete-pair-push-mark): Add :version.

(cherry picked from commit 4c5ab949fb15f89596705704bfb90a2ee1e0aa82)

7 weeks agoAdd option for delete-pair to mark end of region
Paul Nelson [Sun, 15 Sep 2024 20:29:46 +0000 (22:29 +0200)]
Add option for delete-pair to mark end of region

* lisp/emacs-lisp/lisp.el (delete-pair-push-mark): New user option.
(delete-pair): Use it.  (Bug#73284)

* etc/NEWS: Announce the new user option.

(cherry picked from commit a48672c6bbf8cf0adae33b13634f3945c24c61dd)

7 weeks ago; * etc/NEWS: Fix last change.
Eli Zaretskii [Sat, 21 Sep 2024 09:42:43 +0000 (12:42 +0300)]
; * etc/NEWS: Fix last change.

(cherry picked from commit 39d2cc36b2ffeb9a0d0053fa3b800334e98ef49e)

7 weeks agoAdd user option to enable Doxygen syntax highlighting (bug#72814)
Vincenzo Pupillo [Mon, 9 Sep 2024 07:20:42 +0000 (09:20 +0200)]
Add user option to enable Doxygen syntax highlighting (bug#72814)

Both 'c-ts-mode' and 'java-ts-mode' have a new user option,
'c-ts-mode-enable-doxygen' and 'java-ts-mode-enable-doxygen'
(defaults to nil) which allow to enable syntax highlighting
of comment blocks based on the Doxygen grammar.

* lisp/progmodes/c-ts-mode.el: Add the 'c-ts-mode-enable-doxygen'
user option variable to disable doxygen grammar.
Notifies the user if doxygen grammar is not available.
* lisp/progmodes/c-ts-mode.el (c-ts-mode, c++-ts-mode): Use the
new 'c-ts-mode-enable-doxygen' option.
* lisp/progmodes/java-ts-mode.el: Add the
'java-ts-mode-enable-doxygen' user option variable to disable
doxygen grammar.  Notifies the user if doxygen grammar is not
available.
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Use the new
'java-ts-mode-enable-doxygen' option.

* etc/NEWS: Document the change.

(cherry picked from commit b0523dffabbec8acd9c5c92711af849a11867884)

7 weeks agoFix 'regexp-replace' in WDired
Eli Zaretskii [Sat, 21 Sep 2024 09:30:49 +0000 (12:30 +0300)]
Fix 'regexp-replace' in WDired

* src/search.c (Freplace_match): Remove the test that
search_regs.num_regs != num_regs.  It is deemed unnecessary now,
and could produce false positives.  (Bug#73018)

(cherry picked from commit a513f2a4dd5a7f52abf48f06cf32fcfab765c373)

7 weeks ago; Skip commit eced1351200616eed626b56976d8ec98d12ebe61
Eshel Yaron [Sat, 21 Sep 2024 18:54:38 +0000 (20:54 +0200)]
; Skip commit eced1351200616eed626b56976d8ec98d12ebe61

7 weeks agoDisable xwidgets with recent webkitgtk versions (Bug#66068)
Peter Oliver [Wed, 4 Sep 2024 11:12:50 +0000 (12:12 +0100)]
Disable xwidgets with recent webkitgtk versions (Bug#66068)

* configure.ac: Accept only webkit2gtk-4.* versions less than 2.41.92.

(cherry picked from commit b7f6cde419f862dbbf25a8192f5f31ac557b60b5)

7 weeks ago* test/infra/gitlab-ci.yml (.tree-sitter-template): Add treesit.el.
Michael Albinus [Sat, 21 Sep 2024 08:22:41 +0000 (10:22 +0200)]
* test/infra/gitlab-ci.yml (.tree-sitter-template): Add treesit.el.

(cherry picked from commit 39ac8ddafd0482c0f3e1a0fd122168c90c962403)

7 weeks agoUse (sit-for 0) in Tramp
Michael Albinus [Sat, 21 Sep 2024 08:22:13 +0000 (10:22 +0200)]
Use (sit-for 0) in Tramp

* lisp/net/tramp.el (tramp-wait-for-regexp): Use (sit-for 0) in
order to avoid performace regression.

(cherry picked from commit 2f80e62e6e0ed2502fdf4be948c55f0b9ea72fb1)

7 weeks ago; * lisp/editorconfig.el (editorconfig-indentation-alist): Doc fix.
Eli Zaretskii [Sat, 21 Sep 2024 07:21:21 +0000 (10:21 +0300)]
; * lisp/editorconfig.el (editorconfig-indentation-alist): Doc fix.

(cherry picked from commit a6dafbc2bc559295485c72bdfc317dda8a0a9bf5)

7 weeks agoAdd accessors for treesit-font-lock-settings
Yuan Fu [Mon, 16 Sep 2024 06:32:51 +0000 (23:32 -0700)]
Add accessors for treesit-font-lock-settings

Since each SETTING in treesit-font-lock-settings is considered an opaque
object, provide accessor functions for each field.

* lisp/treesit.el:
(treesit-font-lock-settings): Update docstring.
(treesit-font-lock-setting-query):
(treesit-font-lock-setting-enable):
(treesit-font-lock-setting-feature):
(treesit-font-lock-setting-override): New functions.
(treesit--font-lock-setting-feature): Remove function.
(treesit--font-lock-setting-enable): Rename to
treesit--font-lock-setting-clone-enable to avoid confusion with
treesit-font-lock-setting-enable.
(treesit-add-font-lock-rules): Use renamed function.
(treesit-font-lock-fontify-region): Add a comment.
* doc/lispref/modes.texi (Parser-based Font Lock): Update manual.

(cherry picked from commit f9fa75c1ef31ee78b43509f15b50cf0603757181)

7 weeks ago; Skip commit 4c4e26be7c8da65c6c4d01d298ce8a35c920271b
Eshel Yaron [Sat, 21 Sep 2024 18:52:29 +0000 (20:52 +0200)]
; Skip commit 4c4e26be7c8da65c6c4d01d298ce8a35c920271b

7 weeks agoFix treesit--merge-ranges (bug#73324)
Yuan Fu [Sat, 21 Sep 2024 03:40:26 +0000 (20:40 -0700)]
Fix treesit--merge-ranges (bug#73324)

* lisp/treesit.el (treesit--merge-ranges): Make sure that old
ranges that intersects with START-END are actually discarded.
* test/src/treesit-tests.el (treesit-range-merge): New test.

(cherry picked from commit 0834106a6209833ab5f5c032cce857f39889d3d6)

7 weeks ago; Delete bug fix from etc/NEWS
Stefan Kangas [Sat, 21 Sep 2024 01:41:26 +0000 (03:41 +0200)]
; Delete bug fix from etc/NEWS

* etc/NEWS: Delete bug fix item.  No correct program will see a
difference in behavior; at worst, the error message when calling
`(error)` is now better.
Reported by Mattias Engdegård <mattias.engdegard@gmail.com>.

(cherry picked from commit 1103134a0e1edbd512891e64bad99de10da33ef4)

7 weeks agoFix regexps for TeX xref backend
David Fussner [Mon, 16 Sep 2024 13:05:01 +0000 (14:05 +0100)]
Fix regexps for TeX xref backend

* lisp/textmodes/tex-mode.el (tex-thingatpt-exclude-chars): Remove
variable.
(tex-thingatpt--beginning-of-symbol, tex-thingatpt--end-of-symbol):
Use hard-coded characters instead of variable.  (Bug#53749)

(cherry picked from commit 117d93a477079d9b051e2b764fc3cfa9402801b0)

7 weeks agoFix midnight-mode documentation
Stefan Kangas [Sat, 21 Sep 2024 00:19:53 +0000 (02:19 +0200)]
Fix midnight-mode documentation

* lisp/midnight.el (Commentary): Document that 'midnight-mode' should be
enabled using the function, instead of by merely loading the library.
In Emacs 31, doing the latter will no longer work.  (Bug#73291)

(cherry picked from commit 76c6b4d2799ab1396ba003d33e4a177519d7e53d)

7 weeks ago; Fix my email address
Stefan Kangas [Sat, 21 Sep 2024 00:16:40 +0000 (02:16 +0200)]
; Fix my email address

(cherry picked from commit f77825222077799b79a9f62cb8a3f0fa37373614)

7 weeks agoeditorconfig.el: Fix too naive sync from upstream
Stefan Monnier [Fri, 20 Sep 2024 18:58:45 +0000 (14:58 -0400)]
editorconfig.el: Fix too naive sync from upstream

* lisp/editorconfig.el (editorconfig--get-indentation-nxml-mode):
New function.
(editorconfig-indentation-alist): Use it to fix bug#73359.

(cherry picked from commit db22efca8d4fa14118563ae24b292871c7fa350a)

7 weeks ago; Skip commit 0f12d6dd23ce24dc880ec8981458fb369228262b
Eshel Yaron [Sat, 21 Sep 2024 18:51:06 +0000 (20:51 +0200)]
; Skip commit 0f12d6dd23ce24dc880ec8981458fb369228262b

7 weeks ago* lisp/progmodes/eglot.el (eglot--signal-textDocument/didOpen): Fix bug#72696
Stefan Monnier [Fri, 20 Sep 2024 18:42:22 +0000 (14:42 -0400)]
* lisp/progmodes/eglot.el (eglot--signal-textDocument/didOpen): Fix bug#72696

(cherry picked from commit 29d50e245f84d62a9cf4ce00593ea4c63fc4f44d)

7 weeks ago; Skip commit 7ef805d6a47ef12a40c18d1e449b326f787aa4ea
Eshel Yaron [Sat, 21 Sep 2024 18:50:36 +0000 (20:50 +0200)]
; Skip commit 7ef805d6a47ef12a40c18d1e449b326f787aa4ea

7 weeks agoRemove obsolete workaround
Po Lu [Fri, 20 Sep 2024 14:27:39 +0000 (22:27 +0800)]
Remove obsolete workaround

* src/fontset.c (fontset_find_font): Don't refuse to cache
font objects whose registries do not agree with the font
specs.  (bug#73363)

(cherry picked from commit 357cd83875a4dd0ec81d1af2b91270cb57973931)

7 weeks agoetags-regen-file-extensions: Add .pm
Sean Whitton [Fri, 20 Sep 2024 13:39:53 +0000 (14:39 +0100)]
etags-regen-file-extensions: Add .pm

* lisp/progmodes/etags-regen.el (etags-regen-file-extensions):
Add .pm.

(cherry picked from commit 4b9a8fd607423726aea390a5fe25fd2307c937b6)

7 weeks agoSpeed up tall rectangular selections (bug#72830)
Mattias Engdegård [Thu, 29 Aug 2024 12:14:22 +0000 (14:14 +0200)]
Speed up tall rectangular selections (bug#72830)

Instead of setting the highlight overlay on every line in the selection,
only do so on the window-height worth of lines closest to point because
the rest aren't likely to be visible.

This makes a massive difference for tall rectangular selections which
previously were so slow as to be unusable.

(Tall selections are still slow if `select-active-regions` is non-nil,
but that is something that users can actually do something about.)

* lisp/rect.el (rectangle--highlight-for-redisplay)
(rectangle--unhighlight-for-redisplay):
Replace call to `apply-on-rectangle`, which operates on every line,
with a loop over an approximate screenful.
Extend the `rectangle` overlay list structure with a value for point,
because `exchange-point-and-mark` must trigger a recomputation of
highlight overlays despite the selection not actually changing.

(cherry picked from commit 38c7516827902cdfb70bf68b2da4296a8d9349c0)

7 weeks ago; Skip commit cbaf7edbb467c7d6eedf44c055ecfc73b3bb3189
Eshel Yaron [Sat, 21 Sep 2024 18:49:04 +0000 (20:49 +0200)]
; Skip commit cbaf7edbb467c7d6eedf44c055ecfc73b3bb3189

7 weeks ago* src/treesit.c (treesit_debug_print_parser_list): Fix compiler warning.
Andrea Corallo [Thu, 19 Sep 2024 08:27:21 +0000 (10:27 +0200)]
* src/treesit.c (treesit_debug_print_parser_list): Fix compiler warning.

(cherry picked from commit 956f14ae5e999519e23a9a575b1d6616c744d802)

7 weeks agoType-check argument to network-lookup-address-info
Robert Pluim [Wed, 18 Sep 2024 15:19:28 +0000 (17:19 +0200)]
Type-check argument to network-lookup-address-info

* src/process.c (Fnetwork_lookup_address_info): Check that the
"name" argument is a string, and mention 'puny-encode-domain'.
(Bug#73337)

(cherry picked from commit 300d05ecb4cdd53eb8ae9c95f9db6909bb872e29)

7 weeks ago* lisp/dired-aux.el (dired-do-open): Optimize (bug#73004).
Juri Linkov [Thu, 19 Sep 2024 06:14:34 +0000 (09:14 +0300)]
* lisp/dired-aux.el (dired-do-open): Optimize (bug#73004).

Detect system-type only once, then iterate over files
for every system type separately.

(cherry picked from commit 8816b4f342983468d49f93decf216151e9c6ffbc)

7 weeks ago; Improve doc strings of options related to numbered backups
Eli Zaretskii [Thu, 19 Sep 2024 05:20:04 +0000 (08:20 +0300)]
; Improve doc strings of options related to numbered backups

* lisp/files.el (version-control, dired-kept-versions)
(delete-old-versions, kept-old-versions, kept-new-versions): Doc
fixes.

(cherry picked from commit 0f0f21b7f27265e7c9c3a47dc6c9042324f2b031)

7 weeks agoSupport numeric indexing in let-alist
Spencer Baugh [Thu, 12 Oct 2023 22:01:46 +0000 (18:01 -0400)]
Support numeric indexing in let-alist

let-alist is very useful.  But sometimes an alist contains a list in
the middle, which contains yet more alists.  Previously, this was
somewhat painful to deal with, and required something like:

(let-alist alist
  (let-alist (nth 0 .a)
    (let-alist (nth 3 .b)
       .c)))

Now, the following works:

(let-alist alist
  .a.0.b.3.c)

* lisp/emacs-lisp/let-alist.el (let-alist--access-sexp): Properly
parse numbers to handle lists.  (Bug#66509)
(let-alist--list-to-sexp): Use nth to handle numbers.
(let-alist): Update docs.

(cherry picked from commit ae4171efdc60dfa53aa404e5926f5165dbf98d59)

7 weeks ago; Use c-ctype.h in w32*.c
Eli Zaretskii [Wed, 18 Sep 2024 18:22:04 +0000 (21:22 +0300)]
; Use c-ctype.h in w32*.c

* src/w32.c:
* src/w32fns.c: Replace ctype.h functions by equivalent
c-ctype.h functions.

(cherry picked from commit 252ed22d62fc80e2af6f37cf55c62848f6bc8e29)

7 weeks ago; Skip commit 03a991931863486436193f3e8edd0fd7d7d271c3
Eshel Yaron [Sat, 21 Sep 2024 18:48:21 +0000 (20:48 +0200)]
; Skip commit 03a991931863486436193f3e8edd0fd7d7d271c3

7 weeks ago; Skip commit 9026bfb5716de7a6d8ea5df60da942204c32feff
Eshel Yaron [Sat, 21 Sep 2024 18:48:14 +0000 (20:48 +0200)]
; Skip commit 9026bfb5716de7a6d8ea5df60da942204c32feff

7 weeks ago; Small fix for 'grep-change-to-grep-edit-mode'
Juri Linkov [Wed, 18 Sep 2024 16:59:35 +0000 (19:59 +0300)]
; Small fix for 'grep-change-to-grep-edit-mode'

* lisp/progmodes/grep.el (grep-change-to-grep-edit-mode):
Use 'substitute-command-keys' like in 'occur-edit-mode'.

(cherry picked from commit 3924730200ccb79361ceac176e22731e862dbdd7)

7 weeks agoMake `dired-do-open' work on more *nix systems
Manuel Giraud [Fri, 6 Sep 2024 07:47:33 +0000 (09:47 +0200)]
Make `dired-do-open' work on more *nix systems

* lisp/dired-aux.el (dired-do-open): Make `dired-do-open' work
on more *nix systems (bug#73004).

(cherry picked from commit 5e377f4fcc0626065f930f68cff7a11f31c40ffe)

7 weeks agoyes-or-no-p now uses blankp rather than SYNTAX
Paul Eggert [Wed, 18 Sep 2024 16:18:29 +0000 (09:18 -0700)]
yes-or-no-p now uses blankp rather than SYNTAX

* src/fns.c: Do not include syntax.h; no longer needed.
(Fyes_or_no_p): Use blankp rather than SYNTAX to check whether the
prompt ends in nonspace.  That way, the test doesn’t depend on the
current buffer.

(cherry picked from commit 6d507d586a7ae2ab2caf32e32f2ae6134a90b1bd)

7 weeks agoConservative heuristic for tree-sitter parser ranges (bug#73324)
Yuan Fu [Wed, 18 Sep 2024 04:17:13 +0000 (21:17 -0700)]
Conservative heuristic for tree-sitter parser ranges (bug#73324)

* src/treesit.c (treesit_sync_visible_region): If the parser's original
ranges don't overlap with visible region, give it a zero range, rather
than don't set any range.
* test/src/treesit-tests.el (treesit-range-fixup-after-edit): Test new
behavior.

(cherry picked from commit f0daa2f2153a9d250d32ac1261a6fffb30860e31)

7 weeks ago; Fix treesit.c printing
Yuan Fu [Wed, 18 Sep 2024 03:53:36 +0000 (20:53 -0700)]
; Fix treesit.c printing

* src/treesit.c (treesit_debug_print_parser_list): Use PRIuPTR so 32bit
systems compile without warnings.

(cherry picked from commit 035024b4e5a8eb759e30ce72ed3b83036f35525e)

7 weeks ago; * admin/notes/unicode: Need to run textsec-tests (bug#73312).
Eli Zaretskii [Tue, 17 Sep 2024 13:18:08 +0000 (16:18 +0300)]
; * admin/notes/unicode: Need to run textsec-tests (bug#73312).

(cherry picked from commit 8771310a10d528e01e1ff853c6b180af39b60620)

7 weeks agoRe-enable GC mark trace buffer by default
Mattias Engdegård [Tue, 17 Sep 2024 11:07:01 +0000 (13:07 +0200)]
Re-enable GC mark trace buffer by default

Enable GC_REMEMBER_LAST_MARKED by default (it was disabled in Emacs 29)
to make it easier to debug difficult-to-reproduce GC problems
encountered by users.  This increases GC costs by about 5 %, which can
be avoided by turning the mark trace buffer back off using the new
--disable-gc-mark-trace option.

See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2024-09/msg00240.html

* configure.ac (--disable-gc-mark-trace): New config option.
* etc/NEWS: Mention it.
* src/alloc.c: Enable it by default and avoid a compiler warning.

(cherry picked from commit 4c6f45fa8eef1a15d5790c1f3d3e608b548015db)

7 weeks ago; * src/haiku_support.cc: Correct last change.
Po Lu [Sun, 15 Sep 2024 08:28:38 +0000 (16:28 +0800)]
; * src/haiku_support.cc: Correct last change.

(cherry picked from commit c6077015894dd89c5aa3811bf55d3124394874d0)

7 weeks ago; Add even more tests for previous commit
Yuan Fu [Sun, 15 Sep 2024 07:42:41 +0000 (00:42 -0700)]
; Add even more tests for previous commit

* test/src/treesit-tests.el:
(treesit-range-fixup-after-edit): Make the tests trickier.

(cherry picked from commit ae22ad7f624afa5e974059b8f2e78959402d8b3a)

7 weeks agoFix treesit_sync_visible_region's range fixup code (bug#73264)
Yuan Fu [Sun, 15 Sep 2024 07:24:03 +0000 (00:24 -0700)]
Fix treesit_sync_visible_region's range fixup code (bug#73264)

      new_ranges_head
      |
      v
( )->( )->( )->( )->( )
           ^    ^
           |    |
           |    lisp_ranges (loop head)
           |
           prev_cons -> set cdr to nil to cut of the rest

result:

     ( )->( )

* src/treesit.c (treesit_sync_visible_region): Cut off this cons and the
rest, not set the current range's end to nil.
* test/src/treesit-tests.el:
(treesit-range-fixup-after-edit): Add tests for all cases.

(cherry picked from commit 460b9d705ab482003fabe75b0fd1df223abe467c)

7 weeks ago; * etc/PROBLEMS: Fix last change (bug#73207).
Eli Zaretskii [Sun, 15 Sep 2024 04:55:20 +0000 (07:55 +0300)]
; * etc/PROBLEMS: Fix last change (bug#73207).

(cherry picked from commit 81347c1aaf25b27e78e8beee4bc818ad2c4e1b71)

7 weeks agoDocument unavailability of frame geometry on Wayland
Po Lu [Sun, 15 Sep 2024 01:01:25 +0000 (09:01 +0800)]
Document unavailability of frame geometry on Wayland

* etc/PROBLEMS (Runtime problems specific to PGTK build):
Document that frame-edges and company are liable not to return
valid coordinates.  (bug#73207)

(cherry picked from commit a82b7f3e8233905f924493180bcdaf29c42a39b9)

7 weeks ago(elisp-completion-at-point): Simplify
Eshel Yaron [Sat, 21 Sep 2024 18:44:33 +0000 (20:44 +0200)]
(elisp-completion-at-point): Simplify

8 weeks agoFix layout of preferences activity on Android 35
Po Lu [Wed, 18 Sep 2024 02:08:26 +0000 (10:08 +0800)]
Fix layout of preferences activity on Android 35

* java/org/gnu/emacs/EmacsPreferencesActivity.java (onCreate):
Align list view to system windows.

(cherry picked from commit eace68a325b96d12188ea8d673f30bad1354b916)

8 weeks agoOnly conditionally resolve hosts in nsm-should-check
F. Jason Park [Mon, 14 Feb 2022 10:36:57 +0000 (02:36 -0800)]
Only conditionally resolve hosts in nsm-should-check

Libraries like `socks' need to run `nsm-verify-connection' without
performing DNS lookups.  This change allows them to achieve this by
binding `nsm-trust-local-network' to nil around calls to that function.

* lisp/net/nsm.el (nsm-should-check): Rework in a functionally
equivalent way, except forgo calling both `network-lookup-address-info'
and `network-interface-list' unless the various conditions regarding
`nsm-trust-local-network' are first satisfied.  Replace `mapc' with
`dolist' to align with modern sensibilities.   (Bug#53941)

(cherry picked from commit 50deb59aaee2a8d773e95a53c91da7bdb2c5cabd)

8 weeks agoUse c-ctype.h in lib-src
Paul Eggert [Tue, 17 Sep 2024 23:54:17 +0000 (16:54 -0700)]
Use c-ctype.h in lib-src

This fixes some unlikely bugs and removes the temptation
of using ctype.h.  Although some uses were correct,
many weren't.
* lib-src/ebrowse.c: Include c-ctype.h, not ctype.h.
* lib-src/emacsclient.c: Include c-ctype.h, not ctype.h.
* lib-src/update-game-score.c: Include c-ctype.h, not ctype.h.
All uses changed.

(cherry picked from commit 865b54e2acea4fdaa3f302ed225f50281b371d6e)

8 weeks agoFix some #! misparsing in check_interpreter
Paul Eggert [Tue, 17 Sep 2024 23:38:53 +0000 (16:38 -0700)]
Fix some #! misparsing in check_interpreter

* exec/exec.c: Do not include ctype.h, as the kernel
does not care about the locale.
(check_interpreter): Treat only spaces and tabs as white space.
Do not inspect more bytes than were read.
Although the resulting code does not exactly match what
the Android kernel does, it’s closer than what it was before.

(cherry picked from commit e0b027d1215ed32fe0f3d0956d2d7a81552274f2)