]> git.eshelyaron.com Git - emacs.git/log
emacs.git
14 months agoUse slot names rather than their :initargs
Stefan Monnier [Wed, 7 Feb 2024 16:11:38 +0000 (11:11 -0500)]
Use slot names rather than their :initargs

* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
(eieio-test-39-clone-instance-inheritor-with-args):

* test/lisp/auth-source-tests.el (auth-source-ensure-ignored-backend)
(auth-source-backend-parse-macos-keychain)
(auth-source-backend-parse-macos-keychain-generic-string)
(auth-source-backend-parse-macos-keychain-internet-string)
(auth-source-backend-parse-macos-keychain-internet-symbol)
(auth-source-backend-parse-macos-keychain-generic-symbol)
(auth-source-backend-parse-macos-keychain-internet-default-string)
(auth-source-backend-parse-plstore, auth-source-backend-parse-netrc)
(auth-source-backend-parse-netrc-string)
(auth-source-backend-parse-secrets)
(auth-source-backend-parse-secrets-strings)
(auth-source-backend-parse-secrets-alias)
(auth-source-backend-parse-secrets-symbol)
(auth-source-backend-parse-secrets-no-alias):
Use slot names rather than their :initargs.

(cherry picked from commit b068725d40dd1ab918178b3cbca7b5672037210f)

14 months ago; Fix last changes in buffer-menu.el and NEWS
Mattias Engdegård [Wed, 7 Feb 2024 13:35:44 +0000 (14:35 +0100)]
; Fix last changes in buffer-menu.el and NEWS

* etc/NEWS: Remove superfluous mention of key binding.
* lisp/buff-menu.el (Buffer-menu--selection-message): Go back to
previous wording.  It's not about what is hidden but what is shown;
the message is displayed in response to different actions.

(cherry picked from commit ef3fed1a4898c3e3d6012ba01006d827a4aba0ef)

14 months agoDon't compile lib/copy-file-range.c on MS-Windows
Eli Zaretskii [Wed, 7 Feb 2024 13:33:51 +0000 (15:33 +0200)]
Don't compile lib/copy-file-range.c on MS-Windows

* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_copy-file-range): Set to
true to avoid compiling copy-file-range.c on MS-Windows.  The
function 'copy_file_range' is not used on MS-Windows, while
compiling the file triggers warnings because lib/unistd.h, where
its prototype is declared, is omitted in the MS-Windows build.

(cherry picked from commit d03f3a827d80e2a0962128216223bab21998cf0a)

14 months agoFix DEBUG_THREADS in the Android port
Po Lu [Wed, 7 Feb 2024 13:09:18 +0000 (21:09 +0800)]
Fix DEBUG_THREADS in the Android port

* java/org/gnu/emacs/EmacsService.java (EmacsService): New field
`mainThread'.
(onCreate): Set `mainThread' to the thread where the service's
looper executes.
(checkEmacsThread): Compare against SERVICE.mainThread.

(cherry picked from commit e5cb268b2cf612492dfaf39d28f43357710003a6)

14 months agoDeclare function properties in Tramp
Michael Albinus [Wed, 7 Feb 2024 12:19:27 +0000 (13:19 +0100)]
Declare function properties in Tramp

* lisp/net/tramp-message.el (tramp-backtrace, tramp-error)
(tramp-error-with-buffer, tramp-user-error):
Declare `tramp-suppress-trace' property.

(cherry picked from commit ccae58a425674c36cb6f17bcebc4416d34f23a37)

14 months ago; .dir-locals.el (log-edit-mode) <fill-column>: Set to 64.
Po Lu [Wed, 7 Feb 2024 02:48:27 +0000 (10:48 +0800)]
; .dir-locals.el (log-edit-mode) <fill-column>: Set to 64.

(cherry picked from commit 9ccaa09a63548770ca8902758985aeb2c609f5ad)

14 months agoelixir-ts-mode: Highlight more method definitions
Wilhelm Kirschbaum [Wed, 7 Feb 2024 02:18:30 +0000 (04:18 +0200)]
elixir-ts-mode: Highlight more method definitions

* lisp/progmodes/elixir-ts-mode.el (elixir-ts--font-lock-settings):
Also highlight method definitions where the arguments are literal
values, not identifiers (bug#67246).

(cherry picked from commit 8a39216ce920d82b86a40471429e30d75c6ee42d)

14 months agoelixir-ts-mode: Bring the faces' use closer to other ts modes
Dmitry Gutov [Wed, 7 Feb 2024 01:54:29 +0000 (03:54 +0200)]
elixir-ts-mode: Bring the faces' use closer to other ts modes

* lisp/progmodes/elixir-ts-mode.el (elixir-ts--font-lock-settings):
Rename feature 'elixir-function-name' to 'elixir-definition' and
update all deferences.  Add parameters' highlighting with
font-lock-variable-name-face.  Change variable references'
highlighting to use font-lock-variable-use-face.
Move the feature 'elixir-variable' from feature level 3 to level 4, to
match other ts modes (bug#67246).

(cherry picked from commit eb90fb52b08a16ae2bdc8bad6929492b9e693f72)

14 months agoAdd access_call fontification to elixir-ts-mode
Wilhelm Kirschbaum [Fri, 29 Dec 2023 15:09:00 +0000 (17:09 +0200)]
Add access_call fontification to elixir-ts-mode

* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--font-lock-settings):
Add access_call queries to the elixir-variable feature (bug#67246).

(cherry picked from commit c1cdbb987299f6878072fec539bd363e2c3ca015)

14 months ago; Fix typo in configure.ac
Po Lu [Wed, 7 Feb 2024 01:24:32 +0000 (09:24 +0800)]
; Fix typo in configure.ac

* configure.ac: Fix typo.  Reported by Juri Linkov
<juri@linkov.net>.

(cherry picked from commit a45e1237b290a9c04b416703825b105321139608)

14 months ago(loaddefs-generate--compute-prefixes): Fix thinko in last change
Stefan Monnier [Tue, 6 Feb 2024 20:36:18 +0000 (15:36 -0500)]
(loaddefs-generate--compute-prefixes): Fix thinko in last change

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--compute-prefixes):
 Fix thinko in last change.  Also,       reduce memory allocation.

(cherry picked from commit 77f240012f1e9a7cfee60adedebc8e6a230ce49b)

14 months ago; Fix last change in buffer-menu.el
Eli Zaretskii [Tue, 6 Feb 2024 19:55:57 +0000 (21:55 +0200)]
; Fix last change in buffer-menu.el

* etc/NEWS: Elaborate about the binding of the new command.

* lisp/buff-menu.el (Buffer-menu--selection-message): Fix wording
of new message.
(Buffer-menu-toggle-internal): Doc fix.  (Bug#68949)

(cherry picked from commit ab318cce1e97f4b9c78adc3290784105b78f0728)

14 months ago(loaddefs-generate--parse-file): Be a bit more defensive
Stefan Monnier [Tue, 6 Feb 2024 18:21:22 +0000 (13:21 -0500)]
(loaddefs-generate--parse-file): Be a bit more defensive

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
Don't fail in case of an error while generating the prefixes.
(loaddefs-generate--compute-prefixes): Don't burp when
`read-from-string` returns something else than a symbol.

(cherry picked from commit a2201a2034a86b4cc90132ab2d920456866c11e3)

14 months agoUse new variable Buffer-menu-show-internal in project-list-buffers.
Juri Linkov [Tue, 6 Feb 2024 17:55:41 +0000 (19:55 +0200)]
Use new variable Buffer-menu-show-internal in project-list-buffers.

* lisp/progmodes/project.el (project-list-buffers): Add the new variable
`Buffer-menu-show-internal' used to toggle internal buffers (bug#68949).

(cherry picked from commit ce7365b591852dd5556e0a4bf6a0ba63a8733802)

14 months agoRearrange and pack hash table fields to reduce space
Mattias Engdegård [Tue, 6 Feb 2024 14:23:53 +0000 (15:23 +0100)]
Rearrange and pack hash table fields to reduce space

* src/lisp.h (struct Lisp_Hash_Table): Move and reduce width of fields
where possible; this saves an entire word at no apparent cost.

(cherry picked from commit 05e3183ede3a08993a7d209fb14153abaed0c74e)

14 months agoChange hash range reduction from remainder to multiplication
Mattias Engdegård [Mon, 15 Jan 2024 08:25:02 +0000 (09:25 +0100)]
Change hash range reduction from remainder to multiplication

This makes both lookups and rehashing cheaper.  The index vector size
is now always a power of 2.  The first table size is reduced to
6 (from 8), because index vectors would become excessively big
otherwise.

* src/lisp.h (struct Lisp_Hash_Table): Replace index_size with
index_bits.  All references adapted.
(hash_table_index_size): New accessor; use it where applicable.
* src/fns.c (hash_index_size): Replace with...
(compute_hash_index_bits): ...this new function, returning the log2 of the
index size.  All callers adapted.
(hash_index_index): Knuth multiplicative hashing instead of remainder.
(maybe_resize_hash_table): Reduce first table size from 8 to 6.

(cherry picked from commit e66870400d45e3d08265df9f6acd4631a5712139)

14 months agoOptionally show internal buffers in Buffer Menu mode
Mattias Engdegård [Tue, 6 Feb 2024 11:39:11 +0000 (12:39 +0100)]
Optionally show internal buffers in Buffer Menu mode

Internal buffers were never shown before but they can be of interest
to Elisp developers, especially since there is no general mechanism to
remove unused buffers.

* lisp/buff-menu.el (Buffer-menu-show-internal)
(Buffer-menu--selection-message, Buffer-menu-toggle-internal): New.
(Buffer-menu-mode-map): Bind to `I`.
(Buffer-menu-mode-menu): Add menu entry.
(list-buffers--refresh): Extend filtering logic.
* etc/NEWS: Announce.

(cherry picked from commit f6225d125c07bbde8c828b40eb6e81333e051c2a)

14 months agoImplement Lisp threading on Android
Po Lu [Tue, 6 Feb 2024 09:52:33 +0000 (17:52 +0800)]
Implement Lisp threading on Android

Much like the NS port, only the main thread receives input from
the user interface, which is fortunately not a major problem for
packages such as lsp-mode that create Lisp threads.

* configure.ac: Enable with_threads under Android.

* src/android.c (android_init_events): Set `main_thread_id' to
the ID of the main thread.
(setEmacsParams): Set new global variable `android_jvm' to the
JVM object, for the purpose of attaching Lisp threads to the
JVM.
(android_select): [THREADS_ENABLED]: If the caller isn't the
main thread, resort to pselect.  Don't check query before select
returns.
(android_check_query): Export.

* src/android.h (_ANDROID_H_): Define new macro and update
prototypes.

* src/process.c (android_select_wrapper): New function.
(wait_reading_process_output): If THREADS_ENABLED, call
thread_select through the Android select wrapper.

* src/thread.c (post_acquire_global_lock): Call
android_check_query; replace android_java_env with the incoming
Lisp thread's.
(run_thread): Attach and detach the thread created to the JVM.
(init_threads): Set the main thread's JNI environment object.

* src/thread.h (struct thread_state) <java_env>: New field.

(cherry picked from commit 42db7292c3e05920bc9f2fa5c3478eb2ba835c5c)

14 months agoDon't forcibly display dialogs on Android if a keyboard is present
Po Lu [Tue, 6 Feb 2024 05:10:57 +0000 (13:10 +0800)]
Don't forcibly display dialogs on Android if a keyboard is present

* java/org/gnu/emacs/EmacsService.java (detectKeyboard): New
function.

* lisp/subr.el (use-dialog-box-p): Don't always return t if a
keyboard is present on Android.

* src/android.c (android_init_emacs_service): Link to new
function.
(android_detect_keyboard): New function.

* src/android.h: Update prototypes.

* src/androidfns.c (Fandroid_detect_keyboard)
(syms_of_androidfns): New function.

(cherry picked from commit 0d2b7120783255fbb0f8e98717573c35425f4df6)

14 months agoUse treesit-node-match-p in treesit-parent-while
Yuan Fu [Tue, 6 Feb 2024 07:12:36 +0000 (23:12 -0800)]
Use treesit-node-match-p in treesit-parent-while

The previous commit should've done this, but I missed it.

* lisp/treesit.el (treesit-parent-while): Use treesit-node-match-p.

(cherry picked from commit cebd26b2e16d75a939e2a9f91becc6ec702122a7)

14 months agoPrefer `ITREE_FOREACH` over `overlays_in`
Stefan Monnier [Mon, 5 Feb 2024 22:58:47 +0000 (17:58 -0500)]
Prefer `ITREE_FOREACH` over `overlays_in`

Use `ITREE_FOREACH` instead of `overlays_in` if that can save us from
allocating an array.

* src/buffer.c (overlays_in): Mark as static.
(mouse_face_overlay_overlaps): Use `ITREE_FOREACH` instead of `overlays_in`.
(disable_line_numbers_overlay_at_eob): Same, and also change return
value to a boolean.
* src/buffer.h (overlays_in): Don't declare.
* src/editfns.c (overlays_around): Delete function.
(Fget_pos_property): Use `ITREE_FOREACH` and keep the "best so far"
instead of using `overlays_in` and sorting the elements.

* src/lisp.h (disable_line_numbers_overlay_at_eob): Change return
type to a boolean.
* src/xdisp.c (should_produce_line_number): Adjust accordingly.

(cherry picked from commit 10faaa3c91045390755791c21349cd562546fdea)

14 months ago(gitmerge-mode-font-lock-keywords): Don't use font-lock-*-face vars
Stefan Monnier [Mon, 5 Feb 2024 19:50:45 +0000 (14:50 -0500)]
(gitmerge-mode-font-lock-keywords): Don't use font-lock-*-face vars

* admin/gitmerge.el (gitmerge-mode-font-lock-keywords): Refer to the
faces directly.

(cherry picked from commit aedfb4f04837ef7b6f50d6a9d833a3ec0f33b11d)

14 months agoGrudgingly accept function values in the function position
Mattias Engdegård [Mon, 5 Feb 2024 16:56:11 +0000 (17:56 +0100)]
Grudgingly accept function values in the function position

* lisp/emacs-lisp/cconv.el (cconv-convert):
Warn about (F ...) where F is a non-symbol function value (bytecode
object etc), but let it pass for compatibility's sake (bug#68931).
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--fun-value-as-head):
New test.

(cherry picked from commit 5e69376292994ffe69b7f8f52ae1ad85c60c2d29)

14 months ago(edebug-signal): Simplify
Stefan Monnier [Mon, 5 Feb 2024 15:13:56 +0000 (10:13 -0500)]
(edebug-signal): Simplify

Also, prefer #' to quote function names.

* lisp/emacs-lisp/edebug.el (edebug-signal): Instead of re-signaling
the error, let `signal_or_quit` continue processing it.

(cherry picked from commit 95c8bfb11ec82e67652e5903495c1fcb5c61ace2)

14 months ago; * etc/NEWS: Fix typos.
Michael Albinus [Mon, 5 Feb 2024 11:56:36 +0000 (12:56 +0100)]
; * etc/NEWS: Fix typos.

(cherry picked from commit 798310f0100e7819bc79fb7f9bdcf59b8f534b4b)

14 months ago* lisp/net/tramp.el (tramp-local-host-regexp): Adapt :version.
Michael Albinus [Mon, 5 Feb 2024 11:55:27 +0000 (12:55 +0100)]
* lisp/net/tramp.el (tramp-local-host-regexp): Adapt :version.

(cherry picked from commit dbc5fafa311823f3a78d4ad5a395e4d87d31d9bd)

14 months agoAdapt cache handling in Tramp
Michael Albinus [Mon, 5 Feb 2024 11:54:56 +0000 (12:54 +0100)]
Adapt cache handling in Tramp

* lisp/net/tramp-cache.el (with-tramp-saved-file-property)
(with-tramp-saved-file-properties)
(with-tramp-saved-connection-property)
(with-tramp-saved-connection-properties): Do not change KEY
destructively.

(cherry picked from commit edf61edfd6f04ab97785dca92fc68e8e5783586e)

14 months agoFix stale cache in Tramp
Michael Albinus [Mon, 5 Feb 2024 11:54:03 +0000 (12:54 +0100)]
Fix stale cache in Tramp

* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
Flush file properties in time.  (Bug#68805)

(cherry picked from commit c7539a363b8b109d24457aaeb60fb51bd0a03e4f)

14 months agoFix frame focus tracking under Android
Po Lu [Mon, 5 Feb 2024 10:34:22 +0000 (18:34 +0800)]
Fix frame focus tracking under Android

* java/org/gnu/emacs/EmacsActivity.java (invalidateFocus): New
argument WHENCE, a unique number identifying the circumstances
leading up to the call.  All callers changed.
(attachWindow): Call `invalidateFocus' from the UI thread.
(onWindowFocusChanged): Don't remove activity from
`focusedActivities' if it already exists should `hasWindowFocus'
return true.

(cherry picked from commit c1f8fe09e6641cc6c1195edcb8666ace1e6e8829)

14 months agoDon't respect ROUND_XY_TO_GRID when decomposing uninterpreted glyph
Po Lu [Mon, 5 Feb 2024 09:17:51 +0000 (17:17 +0800)]
Don't respect ROUND_XY_TO_GRID when decomposing uninterpreted glyph

* src/sfnt.c (sfnt_decompose_compound_glyph): Remove useless
code; don't pretend to round glyph coordinates.

(cherry picked from commit 98d62c5f7675b24ad66e010765ce3012046f2ff8)

14 months ago; Fix last change
Stefan Kangas [Mon, 5 Feb 2024 07:30:31 +0000 (08:30 +0100)]
; Fix last change

* lisp/filesets.el (filesets-quote): Resurrect as obsolete alias for
'shell-quote-argument'.

(cherry picked from commit ea53a26d03da8d03652696939431b3a7e63053d7)

14 months agofilesets: Safely invoke `shell-command*' functions
Xi Lu [Thu, 23 Feb 2023 12:58:00 +0000 (20:58 +0800)]
filesets: Safely invoke `shell-command*' functions

* lisp/filesets.el:
(filesets-select-command, filesets-quote): Remove unused functions.
(filesets-external-viewers): Remove old comments.
(filesets-which-command, filesets-get-quoted-selection)
(filesets-spawn-external-viewer): Use `shell-quote-argument'.  (Bug#61709)

(cherry picked from commit 7756e9c73611c25002a90194b4a32c23051cb234)

14 months agoDocument arguments to Eshell's built-in commands
Jim Porter [Wed, 16 Aug 2023 01:51:20 +0000 (18:51 -0700)]
Document arguments to Eshell's built-in commands

* lisp/eshell/em-unix.el (eshell/ln): LINK_NAME is required.

* lisp/eshell/esh-ext.el (eshell/addpath):
* lisp/eshell/esh-var.el (eshell/env): Improve help strings slightly.

* doc/misc/eshell.texi (Scripts): Explain $0, $1, etc.
(Dollars Expansion): Use "@dots{}" instead of "...".
(Built-ins, Tramp extensions, Extra built-in commands): Document
command-line arguments.

(cherry picked from commit 5c43ef86bf169a79b87bd082d2f884757f7c2efc)

14 months agoUse treesit-node-match-p in treesit-parent-until/while
Yuan Fu [Mon, 5 Feb 2024 03:26:42 +0000 (19:26 -0800)]
Use treesit-node-match-p in treesit-parent-until/while

* lisp/treesit.el (treesit-parent-until): Use treesit-node-match-p.
(treesit-parent-while): Update docstring.
* doc/lispref/parsing.texi (Retrieving Nodes): Update docstring.

(cherry picked from commit be6de56906f0d1c09a0fad4f5165d864dddbc3ee)

14 months agoImprove treesit-forward-sexp behavior for leaf nodes (bug#68899)
Yuan Fu [Sun, 4 Feb 2024 05:24:29 +0000 (21:24 -0800)]
Improve treesit-forward-sexp behavior for leaf nodes (bug#68899)

treesit-forward-sexp uses treesit--navigate-thing with 'restricted'
tactic.  In this tactic we don't move over the parent thing.  However,
this makes forward-sexp useless for symbols when point is in the
symbol rather than at the beginning of it: in that case, the symbol is
considered parent and treesit-forward-sexp won't move to the end of
it.

To solve that, we allow to move across the parent even in 'restricted'
mode if the parent is a leaf thing.

Here, "leaf thing" is defined as "doesn't have any child 'thing'
inside it".

* lisp/treesit.el (treesit--navigate-thing): Move over parent in
'restricted' tactic if the parent is a leaf thing.

(cherry picked from commit 9dbbf93a4a08f71cf5f2278ec2a22a722fe0e0f7)

14 months ago* lisp/emacs-lisp/comp.el (comp--native-compile): Use `error-message-string`
Stefan Monnier [Sun, 4 Feb 2024 19:39:02 +0000 (14:39 -0500)]
* lisp/emacs-lisp/comp.el (comp--native-compile): Use `error-message-string`

(cherry picked from commit b2d350cfc0bf8f0e3198bffcebe60a43341fb340)

14 months ago* src/lread.c (bytecode_from_rev_list): Fix assertion failure
Stefan Monnier [Sun, 4 Feb 2024 18:51:13 +0000 (13:51 -0500)]
* src/lread.c (bytecode_from_rev_list): Fix assertion failure

The assertion failure was raised at lread.c:411 during the
`lread-invalid-bytecodes` test in `test/src/lread-tests.el`.
I suspect we could remove the assertion instead.

(cherry picked from commit 7d3c3cad9392d3f8e59f85522053c249aff062e5)

14 months ago* src/lread.c (build_load_history): Be careful with in-place updates
Stefan Monnier [Sun, 4 Feb 2024 17:58:56 +0000 (12:58 -0500)]
* src/lread.c (build_load_history): Be careful with in-place updates

Don't leave a "broken" value in `Vcurrent_load_list`.

(cherry picked from commit 52abeaf1333427f156a23f0acf057e81bcc5e9e2)

14 months ago* src/window.c (set_window_buffer): Flush the `base_line_number` cache
Stefan Monnier [Sun, 4 Feb 2024 17:52:01 +0000 (12:52 -0500)]
* src/window.c (set_window_buffer): Flush the `base_line_number` cache

(cherry picked from commit a1aa9028f83e5d3da71bdb5877d8baa5d6c1e98a)

14 months ago(w->base_line_number): Rework the way we flush the cache
Stefan Monnier [Sun, 4 Feb 2024 17:50:55 +0000 (12:50 -0500)]
(w->base_line_number): Rework the way we flush the cache

* src/xdisp.c (BASE_LINE_NUMBER_VALID_P): New macro.
(try_scrolling): Use it.
(redisplay_window, Fformat_mode_line): Use it to flush the
base_line_number (if it's stale) once at the beginning.
(decode_mode_spec): Don't use (or set) `w->start` and
`w->base_line_number` when operating on another buffer!

(cherry picked from commit 57024e1e9314501b103a4d36b9b166761a2ad756)

14 months ago; Fix my last commit
Stefan Kangas [Sun, 4 Feb 2024 12:20:15 +0000 (13:20 +0100)]
; Fix my last commit

(cherry picked from commit a4587646fabf2b7f0cb19a7e0bee090f9106a73a)

14 months agoPrefer setq-local in more places
Stefan Kangas [Sun, 4 Feb 2024 12:16:59 +0000 (13:16 +0100)]
Prefer setq-local in more places

* lisp/erc/erc-compat.el (erc-set-write-file-functions):
* lisp/obsolete/iswitchb.el (iswitchb-minibuffer-setup-hook)
(iswitchb-minibuffer-setup):
* lisp/obsolete/longlines.el (longlines-mode):
* lisp/obsolete/rcompile.el (remote-compile):
* lisp/progmodes/cperl-mode.el (cperl-file-style):
* test/lisp/erc/erc-tests.el (erc-ring-previous-command):
Prefer setq-local.

(cherry picked from commit 70c10204f0025eac844a88b0ef85cfca44cff61c)

14 months agoPrevent cache of diff-mode buffers to grow without bounds
Mattias Engdegård [Sat, 3 Feb 2024 15:46:59 +0000 (16:46 +0100)]
Prevent cache of diff-mode buffers to grow without bounds

Previously, these " *diff-syntax:..." buffers were never removed.
Now we discard the least recently used half of them every hour.

* lisp/vc/diff-mode.el (diff--cached-revision-buffers)
(diff--cache-clean-interval, diff--cache-clean-timer, diff--cache-clean)
(diff--cache-schedule-clean, diff--get-revision-properties): New.
(diff-syntax-fontify-hunk): Use diff--get-revision-properties.

(cherry picked from commit 4d57187a248d3243dcc8b5da5d8365cb1b54a347)

14 months agoSupport bookmarking Xref results buffers
Eshel Yaron [Tue, 6 Feb 2024 19:33:53 +0000 (20:33 +0100)]
Support bookmarking Xref results buffers

* lisp/progmodes/xref.el (bookmark-make-record-default)
(bookmark-make-record, bookmark-prop-get)
(bookmark-handle-bookmark, bookmark-get-rear-context-string)
(bookmark-get-front-context-string): Declare functions.
(xref-backend-context, xref-backend-restore): New generic functions.
(xref--backend, xref--identifier, xref--kind)
(xref--original-buffer, xref--original-point): New local variables.
(xref--show-common-initialize): Set them in Xref results buffer.
(xref-default-bookmark-name-format): New user option.
(xref-bookmark-make-record, xref-bookmark-jump): New functions.
(xref--xref-buffer-mode): Set 'bookmark-make-record-function'.
(xref-fetcher-alist): New variable.
(xref--show-xref-buffer, xref-show-definitions-buffer)
(xref-show-definitions-buffer-at-bottom): Use it.
(xref--read-identifier): Improve error message.
(xref-make-fetcher): Extract from...
(xref--create-fetcher): ...here.

* doc/emacs/maintaining.texi (Xref Commands): Document new feature.

* etc/NEWS: Announce new feature and Xref generic functions.

14 months ago; * lisp/bookmark.el (bookmark-completing-read): Fix typo.
Eshel Yaron [Tue, 6 Feb 2024 07:50:06 +0000 (08:50 +0100)]
; * lisp/bookmark.el (bookmark-completing-read): Fix typo.

14 months ago; Fix quoting in 'xref-show-definitions-completing-read'
Eshel Yaron [Tue, 6 Feb 2024 07:47:57 +0000 (08:47 +0100)]
; Fix quoting in 'xref-show-definitions-completing-read'

* lisp/progmodes/xref.el (xref-show-definitions-buffer-at-bottom): Use
a backquote.

14 months ago; Fix remote shell file name selection
Eshel Yaron [Sun, 4 Feb 2024 12:57:06 +0000 (13:57 +0100)]
; Fix remote shell file name selection

* lisp/shell.el (shell): Cease providing 'file-remote-p' as completion
predicate when reading remote shell file name.  The completion predicate
in 'read-file-name' gets the non-directory part of the file name, which
in particular does not include the remote part, if any, so this
predicate always fail in these settings.  Moreover, this predicate
didn't make a lot of sense to begin with.

14 months ago; Sync missing TRAMP update from 'master'
Eshel Yaron [Sun, 4 Feb 2024 11:07:51 +0000 (12:07 +0100)]
; Sync missing TRAMP update from 'master'

* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
(tramp-maybe-open-connection): Sync with 'master'.

14 months ago* lisp/speedbar.el (imenu): Require unconditionally.
Stefan Kangas [Sun, 4 Feb 2024 10:26:43 +0000 (11:26 +0100)]
* lisp/speedbar.el (imenu): Require unconditionally.

(cherry picked from commit e44b9f35793d642d5155fde035e3bc92102d13a1)

14 months agoDelete compat code in `url` library
Stefan Kangas [Sun, 4 Feb 2024 09:28:40 +0000 (10:28 +0100)]
Delete compat code in `url` library

* lisp/url/url-cid.el (url-cid): Delete compat code for ancient Gnus.
* lisp/url/url-ldap.el (url-ldap-certificate-formatter): Delete compat
code; ssl.el has never been in Emacs.
* lisp/url/url-mailto.el (url-mail): Make into alias for 'message-mail',
since it is always fboundp.

(cherry picked from commit 9bbf8232dba746db90b90285e9e4ed6d299d251a)

14 months agoAdd alias progress-reporter-make
Stefan Kangas [Sun, 4 Feb 2024 09:28:18 +0000 (10:28 +0100)]
Add alias progress-reporter-make

* lisp/subr.el (progress-reporter-make): New alias for
'make-progress-reporter'.

(cherry picked from commit 56d0fbd99a87858717e08488df57db7fc08a2891)

14 months ago; Fix typos
Stefan Kangas [Sun, 4 Feb 2024 08:48:04 +0000 (09:48 +0100)]
; Fix typos

(cherry picked from commit fc8b09484a2fbe182a0351c47afc3bf71f3b2a1b)

14 months agoFix display of invisible text with opposite directionality
Eli Zaretskii [Sun, 4 Feb 2024 09:45:15 +0000 (11:45 +0200)]
Fix display of invisible text with opposite directionality

* src/xdisp.c (handle_invisible_prop): Skip invisible text
correctly when it starts at position whose resolved bidi level is
above the base paragraph level.  (Bug#68446)

(cherry picked from commit dd81e767b7782c275af4221fe258fa3d2948724a)

14 months agotramp: Tweak the ls-lisp declarations
Stefan Monnier [Sun, 4 Feb 2024 04:05:03 +0000 (23:05 -0500)]
tramp: Tweak the ls-lisp declarations

* lisp/net/tramp-sh.el (ls-lisp-use-insert-directory-program): Don't
declare its existence...
(tramp-sh-handle-insert-directory): ...test it instead.

* lisp/net/tramp.el (ls-lisp-dirs-first, ls-lisp-emulation)
(ls-lisp-ignore-case, ls-lisp-use-insert-directory-program)
(ls-lisp-verbosity): Move declaration...
(tramp-handle-insert-directory): ...to the point where we have a good
reason to think these variables exist.

(cherry picked from commit 45125e019c3698ff74ccb2183b789c25f9d3f574)

14 months ago* lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): Add comment
Stefan Monnier [Sat, 3 Feb 2024 23:22:41 +0000 (18:22 -0500)]
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): Add comment

(cherry picked from commit 4ebded3f5ee8617ac6b1debaa01706cd78206f39)

14 months ago* doc/emacs/buffers.texi (List Buffers): Update example
Stefan Monnier [Sat, 3 Feb 2024 23:22:05 +0000 (18:22 -0500)]
* doc/emacs/buffers.texi (List Buffers): Update example

(cherry picked from commit ecf3488477c6a4382737b97698443fdf26db8bd1)

14 months agobytecomp.el: Warn for `,' not within backquote construct
Richard M Stallman [Sat, 3 Feb 2024 22:47:02 +0000 (17:47 -0500)]
bytecomp.el: Warn for `,' not within backquote construct

(bytecomp--report-comma): New function with `compiler-macro' property.

(cherry picked from commit b0049c942b8fa4093a02a9bb4ffc9c5da2261765)

14 months agotextconv.c: Fix warnings with-wide-int
Stefan Monnier [Sat, 3 Feb 2024 21:07:24 +0000 (16:07 -0500)]
textconv.c: Fix warnings with-wide-int

* src/textconv.c (set_composing_region, textconv_set_point_and_mark):
Use `min/max`.

(cherry picked from commit d41cdceb133e30c71a95fe893d70645472b326e3)

14 months ago; * lisp/files.el (hack-local-variables--find-variables): Fix comment.
Eli Zaretskii [Sat, 3 Feb 2024 16:09:35 +0000 (18:09 +0200)]
; * lisp/files.el (hack-local-variables--find-variables): Fix comment.

(cherry picked from commit 8fc7e8c2b0cb33b0e8e9822f116e6dbb530ab1b6)

14 months ago; Fix a comment in loaddefs-gen.el
Eli Zaretskii [Sat, 3 Feb 2024 16:05:55 +0000 (18:05 +0200)]
; Fix a comment in loaddefs-gen.el

(cherry picked from commit ecb69c8bd8c3dba205187c6296c8cac9b6a65121)

14 months ago; Optimize shorthand insertion in loaddefs-generate--parse-file
Joseph Turner [Sat, 3 Feb 2024 14:32:37 +0000 (08:32 -0600)]
; Optimize shorthand insertion in loaddefs-generate--parse-file

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
Optimize.

(cherry picked from commit f266622cdb34044f364976796a4e7ac003d7a1b3)

14 months ago; Also consider shorthands in check-declare-scan (bug#67523)
João Távora [Sat, 3 Feb 2024 14:27:27 +0000 (08:27 -0600)]
; Also consider shorthands in check-declare-scan (bug#67523)

* lisp/emacs-lisp/check-declare.el (check-declare-scan): Also
consider shorthands here.

(cherry picked from commit 9a51fbb69fc9dc4aa415308889ae667ee65660d7)

14 months agoFix prefix discovery for files with read-symbol-shorthands (bug#67325)
João Távora [Thu, 30 Nov 2023 13:32:50 +0000 (07:32 -0600)]
Fix prefix discovery for files with read-symbol-shorthands (bug#67325)

In a previous commit, the local-variable read-symbol-shorthands is
already read into the temporary buffer used for the autoload parsing
aerobatics, so all we needed to do in 'l-g--compute-prefixes' is
use 'read' to give 'read-symbol-shorthands' a chance to kick in.

* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--compute-prefixes):

(cherry picked from commit 817140a852e79c5ef3cf7dc5e4c50aa710e8c4a2)

14 months agoAlso teach loaddefs-gen.el about shorthands (bug#63480)
João Távora [Thu, 30 Nov 2023 02:09:57 +0000 (20:09 -0600)]
Also teach loaddefs-gen.el about shorthands (bug#63480)

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
Make aware of read-symbol-shorthands.

(cherry picked from commit c52d17d91ade6c789d8672dbd1301ba86ba4d7d1)

14 months agoImprove shorthands-font-lock-shorthands (bug#67390)
João Távora [Wed, 29 Nov 2023 22:48:34 +0000 (16:48 -0600)]
Improve shorthands-font-lock-shorthands (bug#67390)

Add font locking to the shorthand prefix of a given printed symbol
name by checking if any of the shorthand prefixes in
read-symbol-shorthands are a prefix for that print name.  Although
this does more string comparisons, it didn't prove to be any slower
than the existing approach, and is more correct.

This version is more accurate when highlighting files with many
overlapping shorthands.   Given:

;; Local Variables:
;; read-symbol-shorthands: (("bc-" . "breadcrumb-")
;;                          ("aw-" . "ace-window-")
;;                          ("zorglub/" . "ace-window-")
;;                          ("he//" . "hyperdrive-entry--")
;;                          ("h//"  . "hyperdrive--")
;;                          ("he/"  . "hyperdrive-entry-")
;;                          ("h/"   . "hyperdrive-"))
;; End:

The following are correct highlights on print names

'(zorglub/blerh ; hilits "zorglub/" reads to 'ace-window-blerh'
  he/foo        ; hilits "he/"      reads to 'hyperdrive-entry-foo'
  he//bar       ; hilits "he//"     reads to 'hyperdrive-entry--bar'
  h/coiso       ; hilits "h/"       reads to 'hyperdrive-coiso'
  h//thingy     ; hilits "h//"      reads to 'hyperdrive--thingy'
  bc-yo         ; hilits "bc-"      reads to 'breadcrumb-yo'
  aw-thingy     ; hilits "aw-"      reads to 'ace-window-thingy'
  )

Co-authored-by: Jonas Bernoulli <jonas@bernoul.li>
Co-authored-by: Joseph Turner <joseph@ushin.org>
* lisp/emacs-lisp/shorthands.el (shorthands-font-lock-shorthands):

(cherry picked from commit 0f715f9c154a47de57a2f24f19b4a402604e6dc0)

14 months agoConsider read-symbol-shorthands in check-declare.el (bug#67523)
João Távora [Wed, 29 Nov 2023 12:21:29 +0000 (06:21 -0600)]
Consider read-symbol-shorthands in check-declare.el (bug#67523)

* lisp/emacs-lisp/check-declare.el (check-declare-verify):
Consider read-symbol-shorthands.

(cherry picked from commit 17c3610c56155dd5b1efd5b7e8d6a58112f43a59)

14 months agoProcess read-symbol-shorthands from longest to shortest (bug#67390)
João Távora [Thu, 30 Nov 2023 12:00:38 +0000 (06:00 -0600)]
Process read-symbol-shorthands from longest to shortest (bug#67390)

This ensures that overlapping shorthands are handled correctly and
consistently even if specified out-of-order by the user.

* doc/lispref/symbols.texi (Shorthands): Describe shorthand sort
order.

* lisp/files.el (hack-local-variables--find-variables): Specially
handle read-symbol-shorthands.

(cherry picked from commit c2aaa8f15aa8fb3415a6c9f421f539ee34b7f52c)

14 months agoMake sure read-symbol-shorthands is permanently local
João Távora [Thu, 30 Nov 2023 12:00:44 +0000 (06:00 -0600)]
Make sure read-symbol-shorthands is permanently local

bug#63480, bug#67390

* lisp/files.el (permanently-enabled-local-variables): Add
  read-symbol-shorthands.

(cherry picked from commit 5e4a0a29fa3562ce9b2b8e497c6e71e6bc169082)

14 months agoFix downcasing of mode-name in compile.el
Eli Zaretskii [Sat, 3 Feb 2024 11:00:15 +0000 (13:00 +0200)]
Fix downcasing of mode-name in compile.el

* lisp/progmodes/compile.el (compilation--downcase-mode-name): New
function.
(compilation-start, kill-compilation): Use it instead of calling
'downcase' on 'mode-name'.  (Bug#68795)

(cherry picked from commit 492e16f2ff33e7ff65ff965e9cd2ba658c9f9a45)

14 months ago; * lisp/eshell/em-unix.el (eshell/cp, eshell/ln): Delete extra space.
Eli Zaretskii [Sat, 3 Feb 2024 09:52:30 +0000 (11:52 +0200)]
; * lisp/eshell/em-unix.el (eshell/cp, eshell/ln): Delete extra space.

Bug#68862.

(cherry picked from commit 37efb63a3df969fb2eeed70dfe7fcf6c187e05be)

14 months ago; Fix last change
Eli Zaretskii [Sat, 3 Feb 2024 09:20:11 +0000 (11:20 +0200)]
; Fix last change

* lisp/progmodes/js.el
(js--treesit-font-lock-compatibility-definition-feature): Fix
comments.

(cherry picked from commit b91f0ee2fcc52b6ef2d747c5fc7f37573adc7ca5)

14 months agoFix incompatibility with tree-sitter-javascript >= 0.20.2
Vincenzo Pupillo [Thu, 1 Feb 2024 15:57:39 +0000 (16:57 +0100)]
Fix incompatibility with tree-sitter-javascript >= 0.20.2

Starting from version 0.20.2 the grammar's primary expression
"function" has been renamed to "function_expression".  A new
function checks if the new primary expression is available,
and if so, it returns the correct rules.
* lisp/progmodes/js.el
(js--treesit-font-lock-compatibility-definition-feature): New
function.
(js--treesit-font-lock-settings): Use it.  (Bug#68879)

(cherry picked from commit 2f69353e4a756cf53459c14c5618bd262331b568)

14 months agoAvoid signaling errors from 'pixel-fill-region'
Eli Zaretskii [Sat, 3 Feb 2024 09:09:36 +0000 (11:09 +0200)]
Avoid signaling errors from 'pixel-fill-region'

* lisp/textmodes/pixel-fill.el (pixel-fill-region): Make sure the
selected window displays the current buffer.  This is important
when this function is called inside 'with-current-buffer' or
similar forms which temporarily change the buffer displayed in the
selected window.  (Bug#67791)

(cherry picked from commit d49124fc14b0bb37617b34b5839f873cea3817c8)

14 months agoPacify gcc -Wpointer-sign
Paul Eggert [Sat, 3 Feb 2024 06:53:23 +0000 (22:53 -0800)]
Pacify gcc -Wpointer-sign

* src/print.c (print_object): SDATA → SSDATA.

(cherry picked from commit 138decdc9e68a5fc9dddd1a212ed5d63d77d5d22)

14 months agoReassociate erc-networks--id for orphaned queries
F. Jason Park [Wed, 31 Jan 2024 14:01:54 +0000 (06:01 -0800)]
Reassociate erc-networks--id for orphaned queries

* lisp/erc/erc-networks.el (erc-networks--examine-targets): Adopt the
server's network ID in query buffers created before MOTD's end.  Do
this to avoid a type error in the process filter when renaming
buffers.
* lisp/erc/erc-networks.el (erc-networks--examine-targets): New test.
* test/lisp/erc/erc-scenarios-base-upstream-recon-znc.el
(erc-scenarios-upstream-recon--znc/severed): New test.
* test/lisp/erc/erc-scenarios-misc.el
(erc-scenarios-base-mask-target-routing): Adjust timeout.
* test/lisp/erc/resources/base/upstream-reconnect/znc-severed.eld:
New file.
* test/lisp/erc/resources/erc-tests-common.el
(erc-tests-common-make-server-buf): Use NAME parameter for creating
ID.

(cherry picked from commit aa6315ee685185dd1b9b63ee94636e662d68106b)

14 months agoFix local variable persistence in erc-stamp
F. Jason Park [Wed, 31 Jan 2024 02:17:41 +0000 (18:17 -0800)]
Fix local variable persistence in erc-stamp

* etc/ERC-NEWS: Mention renaming of `erc-munge-invisible-property'.
* lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-disable): Remove
correct function from `erc-mode-hook'.
(erc-stamp--recover-on-reconnect): Revise doc string.
(erc-munge-invisibility-spec, erc-stamp--manage-local-options-state):
Mark former name as obsolete and rename to latter.  Don't use helper
macro meant only for local modules.  This bug originated from c68dc778
"Manage some text props for ERC insertion-hook members", which stemmed
from bug#60936.
(erc-stamp--setup, erc-hide-timestamps, erc-show-timestamps)
(erc-toggle-timestamps): Use new name for
`erc-munge-invisibility-spec'.
* lisp/erc/erc.el (erc--restore-initialize-priors): Raise error at
runtime if mode var doesn't belong to a local module.
* test/lisp/erc/erc-stamp-tests.el (erc-stamp-tests--insert-right)
(erc-timestamp-intangible--left): Use new name for
`erc-munge-invisibility-spec'.
* test/lisp/erc/erc-tests.el (erc--refresh-prompt): Shadow
`erc-last-input-time'.
(erc--restore-initialize-priors): Add error form to expected
expansion, and skip test on Emacs 27.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--make-bindings): Shadow `erc-last-input-time'.

(cherry picked from commit b7cdce097003a645ae396470cfab221bf789189e)

14 months agoTeach customize-option about erc-modules
F. Jason Park [Tue, 30 Jan 2024 03:04:58 +0000 (19:04 -0800)]
Teach customize-option about erc-modules

* lisp/erc/erc-goodies.el (erc-scrolltobottom-mode)
(erc-scrolltobottom-enable): Use `setq' instead of `setopt' because
the latter isn't defined in Emacs 27 and 28.  This fix is unrelated to
the main thrust of this commit.
* lisp/erc/erc.el (erc-modules): Make good on decades old language in
info node "(erc) Modules" by ensuring `customize-option' can find this
option before its containing library is loaded.  Like
`gnus-select-method', this option serves as an entry point for
configuring the application and is presented that way in tutorials and
library front matter.  Moreover, it can't be reasonably autoloaded in
the traditional way because of its many dependencies and large textual
footprint.
(erc-display-message): Revise doc string.

(cherry picked from commit bb894845ed6a06e8b301251d62f8b4a73a09d5ea)

14 months agocperl-mode.el: Don't use obsolete `special-display-popup-frame`
Stefan Monnier [Fri, 2 Feb 2024 23:59:21 +0000 (18:59 -0500)]
cperl-mode.el: Don't use obsolete `special-display-popup-frame`

* lisp/progmodes/cperl-mode.el (cperl-info-on-command): Simplify,
to let `pop-to-buffer` decide whether to create a new frame or not,
so it can be controlled by `display-buffer-alist`.

(cherry picked from commit 82e50a23fea8bc435bfae8390008702aa7d74bda)

14 months agobytecomp.el: Rewrite the way we print dynamic docstrings
Stefan Monnier [Wed, 31 Jan 2024 23:56:43 +0000 (18:56 -0500)]
bytecomp.el: Rewrite the way we print dynamic docstrings

We used to print dynamic docstrings "manually" for two reasons:

- References should look like `(#$ . POS)` but `prin1` was unable
  to print just `#$` for an sexp.
- `make-docfile` needed to find those docstrings and the object
  to which they belonged.

The second point is moot now that we don't use `make-docfile` on
`.elc` files.  So this patch lifts the first restriction,
using `print-number-table`.

The rest of the patch then simplifies and regularises the
bytecompiler's generation of dynamic docstrings, which can
now also easily be done for "inner" defvars and other places.

* src/print.c (print_preprocess, print_object): Handle strings in
`print-number-table`.
(Vprint_number_table): Improve docstring.

* lisp/emacs-lisp/bytecomp.el:
(byte-compile--list-with-n): New function.
(byte-compile--docstring-style-warn): Rename from
`byte-compile-docstring-style-warn` and change calling convention.
(byte-compile--\#$, byte-compile--docstrings): New vars.
(byte-compile-close-variables): Bind them.
(byte-compile--docstring): New function.
(byte-compile-from-buffer): Set `byte-compile--\#$`.
(byte-compile-output-file-form): Use `byte-compile--\#$` instead
of special casing specific forms.
(byte-compile--output-docform-recurse, byte-compile-output-docform):
Delete functions.
(byte-compile-file-form-autoload, byte-compile-file-form-defalias)
(byte-compile-file-form-defvar-function, byte-compile-lambda):
Use `byte-compile--docstring` and `byte-compile--list-with-n`.
(byte-compile--declare-var): Add optional `not-toplevel` arg.
(byte-compile-defvar): Add `toplevel` arg.  Use `byte-compile--docstring`.
(byte-compile-file-form-defvar): Delegate to `byte-compile-defvar`.
(byte-compile--custom-declare-face): New function.  Use it for
`custom-declare-face`.
(byte-compile-file-form-defmumble): Use `byte-compile-output-file-form`

* src/doc.c (Fdocumentation_stringp): New function.
(syms_of_doc): Defsubr it.
(store_function_docstring): Remove left-over code from when we
used DOC for the docstring of some Lisp files.

* lisp/cus-face.el (custom-declare-face): Accept dynamic docstrings.
* lisp/faces.el (face-documentation): Handle dynamic docstrings.
* lisp/help-fns.el (describe-face): Simplify accordingly.

(cherry picked from commit e9a668274e441645aed28e8c353187dfed35fcae)

14 months ago; * doc/lispref/sequences.texi (Sequence Functions): Fix typo.
Eli Zaretskii [Fri, 2 Feb 2024 16:33:54 +0000 (18:33 +0200)]
; * doc/lispref/sequences.texi (Sequence Functions): Fix typo.

(cherry picked from commit e2d1ac2f258a069f950d4df80c8096bfa34081fc)

14 months ago; And another fix...
Eli Zaretskii [Fri, 2 Feb 2024 15:48:28 +0000 (17:48 +0200)]
; And another fix...

(cherry picked from commit eb9bdb8948683e9870a3e52d085bf0c57d049130)

14 months ago; Another fix of last change.
Eli Zaretskii [Fri, 2 Feb 2024 15:46:19 +0000 (17:46 +0200)]
; Another fix of last change.

(cherry picked from commit 02bdb1e4c50153a1754b251538d705d7d81668f8)

14 months ago; Fix last change
Eli Zaretskii [Fri, 2 Feb 2024 15:39:23 +0000 (17:39 +0200)]
; Fix last change

* lisp/sort.el (sort-on): Doc fix.

* doc/lispref/sequences.texi (Sequence Functions): Fix description
of 'sort-on'.

(cherry picked from commit f9a15b8a1559999b8dd9895a5f5bb922c4e6730f)

14 months ago; Fix last change
Eli Zaretskii [Fri, 2 Feb 2024 13:27:25 +0000 (15:27 +0200)]
; Fix last change

* doc/lispref/sequences.texi (Sequence Functions): Improve
indexing of last change

(cherry picked from commit dcce1e07fe750df060ab3a7c6782dc5145710fa3)

14 months agoNew function 'sort-on'
Eli Zaretskii [Fri, 2 Feb 2024 13:24:55 +0000 (15:24 +0200)]
New function 'sort-on'

* lisp/sort.el (sort-on): New function.  Patch by John Wiegley
<jwiegley@gmail.com>.

* etc/NEWS:
* doc/lispref/sequences.texi (Sequence Functions): Document
'sort-on'.

(cherry picked from commit 4b79c80c999fe95654b7db196b12e0844473f6da)

14 months agoIncrease `emacs-lisp-docstring-fill-column` to 72
Stefan Kangas [Fri, 2 Feb 2024 11:28:54 +0000 (12:28 +0100)]
Increase `emacs-lisp-docstring-fill-column` to 72

Monitors are wider now than when these defaults were first set, and it
is useful to take better advantage of that, to fit text on fewer lines.
Yet, it has repeatedly been shown that overly long lines reduce
readability:
   "A reasonable guideline would be 55 to 75 characters per line."[1]

We also don't want to disfavor narrow displays, like mobile phones; a
more promising direction here might be to automatically word wrap
docstrings and make their maximum width customizable.  That might
require a new docstring format, however.

Bumping it by 7 characters, from 65 to 72, seems a reasonable compromise
for now.  Consideration was given to increasing it to 70 or 75, but 72
happens to be a commonly recommended maximum line width elsewhere (see
Fortran 66, Python docstrings, commit message recommendations, etc.),
and we might as well do the same.

This change was discussed in:
https://lists.gnu.org/r/emacs-devel/2022-07/msg00217.html

[1] "Optimal Line Length in Reading — A Literature Review", Nanavati and
    Bias, Visible Language, Vol. 39 No. 2 (2005).
    https://journals.uc.edu/index.php/vl/article/view/5765

* lisp/emacs-lisp/lisp-mode.el (emacs-lisp-docstring-fill-column):
* .dir-locals.el (fill-column, emacs-lisp-docstring-fill-column):
Bump default to 72.

(cherry picked from commit 72b1379f0795a5e2e9c57615c0b1d78c0b97cd1f)

14 months agoeglot: Add nushell language server
nibon7 [Wed, 17 Jan 2024 16:01:48 +0000 (00:01 +0800)]
eglot: Add nushell language server

* lisp/progmodes/eglot.el (eglot-server-programs): Add nushell
language server.  (Bug#68823)

(cherry picked from commit a3987127618b9fe49b88807f0268ec9abcc7396f)

14 months agoeglot: Add php-ts-mode to eglot-server-programs
Piotr Kwiecinski [Thu, 1 Feb 2024 13:02:20 +0000 (14:02 +0100)]
eglot: Add php-ts-mode to eglot-server-programs

* lisp/progmodes/eglot.el (eglot-server-programs): Add
php-ts-mode.  (Bug#68870)

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

14 months agoSupport kotlin-ts-mode in Eglot
dalu [Thu, 1 Feb 2024 03:45:13 +0000 (11:45 +0800)]
Support kotlin-ts-mode in Eglot

* lisp/progmodes/eglot.el (eglot-server-programs): Support
kotlin-ts-mode.  (Bug#68865)

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

14 months ago* lisp/simple.el (read-from-kill-ring): Ignore `read-only' text property.
Juri Linkov [Thu, 1 Feb 2024 17:16:37 +0000 (19:16 +0200)]
* lisp/simple.el (read-from-kill-ring): Ignore `read-only' text property.

Add `read-only' to the list of text properties removed from history items
(bug#68847).

(cherry picked from commit d89e427852a63dbeed3d5e03d9deb2ae9a8e3e1b)

14 months ago; Skip commit caecbf3e8db57d93715b8d20587b2ed54064cadb
Eshel Yaron [Sun, 4 Feb 2024 11:03:13 +0000 (12:03 +0100)]
; Skip commit caecbf3e8db57d93715b8d20587b2ed54064cadb

14 months ago* src/lread.c (bytecode_from_rev_list): Fix thinko
Stefan Monnier [Thu, 1 Feb 2024 16:08:56 +0000 (11:08 -0500)]
* src/lread.c (bytecode_from_rev_list): Fix thinko

(cherry picked from commit 8b92449b706e33da256142e190008bb1ead2e539)

14 months ago* src/lread.c (bytecode_from_rev_list): Re-group checks
Stefan Monnier [Thu, 1 Feb 2024 16:06:51 +0000 (11:06 -0500)]
* src/lread.c (bytecode_from_rev_list): Re-group checks

Bring together all the conditions for well-formedness of the resulting
bytecode object.

(cherry picked from commit 886f4207ab71b2a3367566d013cbcb27eec25639)

14 months ago* configure.ac: Include X11/Xlib.h for XOpenDisplay. (Bug#68842)
Ulrich Müller [Wed, 31 Jan 2024 07:49:36 +0000 (08:49 +0100)]
* configure.ac: Include X11/Xlib.h for XOpenDisplay.  (Bug#68842)

Do not merge to master.

(cherry picked from commit 5f3b46c61e23786295e8e532f7eadeee8cd4340b)

14 months agoFix search error in woman.el
Thierry Volpiatto [Wed, 31 Jan 2024 13:54:16 +0000 (13:54 +0000)]
Fix search error in woman.el

* lisp/woman.el (woman-if-body): Avoid signaling an error
if "el }" is not found.  (Bug#68852)

(cherry picked from commit d0766c0999e1e78b2f63e1d97881e926e5e6f905)

14 months agoFix 'fill-paragraph' in 'yaml-ts-mode'
Graham Marlow [Tue, 30 Jan 2024 01:16:04 +0000 (17:16 -0800)]
Fix 'fill-paragraph' in 'yaml-ts-mode'

* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode--fill-paragraph):
Avoid 'fill-paragraph' when outside of block_scalar or comment
nodes.  (Bug#68781)

(cherry picked from commit 4adb4b2ac507636a82373ed1323dabcb7ee9258d)

14 months agomacfont.m: Fix values for font widths and weights on macOS
Stanislav Yaglo [Mon, 12 Jun 2023 10:56:37 +0000 (11:56 +0100)]
macfont.m: Fix values for font widths and weights on macOS

* src/macfont.m (mac_font_get_glyphs_for_variants)
(macfont_variation_glyphs): Fix width values.  (Bug#64013)

(cherry picked from commit ff63da26b6b00fd0e2ba04239b56b385bd83b53a)

14 months agoshr: Correct SVG attribute case
Sacha Chua [Fri, 26 Jan 2024 13:54:03 +0000 (08:54 -0500)]
shr: Correct SVG attribute case

* lisp/net/shr.el (shr-correct-attribute-case): New constant.
(shr-correct-dom-case): New function to correct SVG attribute case.
(shr-tag-svg): Correct SVG attribute cases before using them.

(cherry picked from commit 169c704d74747d411a545eff9c497ddafb9c886c)

14 months agoImprove `desktop-save-mode` docstring
Stefan Kangas [Thu, 1 Feb 2024 08:08:19 +0000 (09:08 +0100)]
Improve `desktop-save-mode` docstring

* lisp/desktop.el (desktop-save-mode): Improve docstring.

(cherry picked from commit 5ce02c91bc128f390bcf0beb82e37a3fa7f251ba)

14 months ago; Fix doc strings of splash-screen data structures
Eli Zaretskii [Mon, 29 Jan 2024 12:56:40 +0000 (14:56 +0200)]
; Fix doc strings of splash-screen data structures

* lisp/startup.el (fancy-startup-text, fancy-about-text): Doc
fixes.  (Bug#68788)

(cherry picked from commit 2f98b13ed0522ef37c7bb2ca37f24b1be2f9fde5)