This introduces the predicate frame-initial-p, which uses
struct frame.output_method or struct terminal.type to detect
initial_terminal without relying on its name (bug#80629).
For some prior discussion, see:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00480.htmlhttps://lists.gnu.org/r/emacs-devel/2020-01/msg00120.html
* doc/lispref/frames.texi (Frames): Document frame-initial-p.
(Finding All Frames): Fix grammar.
* etc/NEWS (Lisp Changes in Emacs 31.1): Announce frame-initial-p.
* lisp/desktop.el (desktop--check-dont-save):
* lisp/emacs-lisp/debug.el (debug):
* lisp/frameset.el (frameset-restore):
* lisp/menu-bar.el (menu-bar-update-buffers):
* lisp/xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal):
Use frame-initial-p instead of checking the "initial_terminal" name.
* lisp/emacs-lisp/byte-opt.el: Mark frame-initial-p as error-free.
* src/pgtkterm.c (pgtk_focus_changed): Use IS_DAEMON in place of
Fdaemonp, thus also accepting a named daemon session.
* src/terminal.c (decode_tty_terminal): Clarify commentary.
(Fframe_initial_p): New function.
(syms_of_terminal): Expose it.
(init_initial_terminal): Update commentary now that
menu-bar-update-buffers uses frame-initial-p (bug#53740).
* test/lisp/xt-mouse-tests.el (with-xterm-mouse-mode): Simulate the
lack of an initial terminal by overriding frame-initial-p now
that turn-on-xterm-mouse-tracking-on-terminal uses it.
* test/src/terminal-tests.el: New file.
* lisp/auth-source-pass.el (auth-source-pass-search): Remove
redundant expand-file-name.
* test/lisp/auth-source-pass-tests.el
(auth-source-pass--with-store): Bind auth-source-pass-filename to an
existing directory to satisfy the new guard in
auth-source-pass-search (bug#76323).
* lisp/auth-source-pass.el (auth-source-pass-search):
If auth-source-pass-filename is not a directory, just do nothing to
avoid repeated errors raised by directory-files-recursively in
auth-source-pass-entries which is called for each search pattern.
(Bug#76323)
Copyright-paperwork-exempt: yes
Move shortdoc group definitions from shortdoc.el to a separate file
shortdoc-doc.el. Document shortdoc group format in a future-proof way
and guide package authors on how to use shortdoc groups across past
Emacs versions.
* lisp/emacs-lisp/shortdoc-doc.el: New file.
* lisp/emacs-lisp/shortdoc.el: Document shortdoc group format in a
future-proof way. Require 'shortdoc-doc'.
(shortdoc--keyword-plist-p): New function.
(shortdoc--check): Update to check the documented shortdoc group format.
(shortdoc--groups, define-short-documentation-group): Pull out of
autoloaded 'progn'.
(define-short-documentation-group): Report errors in terms of byte
compiler warnings.
(alist, map, string, file-name, file, hash-table, list, symbol)
(comparison, vector, regexp, sequence, buffer, overlay, process, number)
(text-properties, keymaps): Move group to shortdoc-doc.el.
(shortdoc): Move alias to after function.
(shortdoc-add-function): Add argument checks.
* doc/lispref/tips.texi (Documentation Group Tips): New section.
* doc/lispref/elisp.texi (Top):
* doc/lispref/tips.texi (Tips): Add references to it.
* doc/lispref/help.texi (Documentation Groups): Ditto, and add some
concept index entries. (bug#80297)
Ensure that Dired does not treat the sequence "\\n" within a file
name as a newline (bug#80608).
* lisp/dired.el (dired--filename-with-newline-p): Rewrite using
'directory-files' with match for regexp "\n".
* test/lisp/dired-tests.el
(dired-test--filename-with-backslash-n): New function.
(dired-test-filename-with-backslash-n): New test.
Like the commit of 2022-07-31
"Fix further package.el loaddefs byte-compile warnings"
this pacifies the warning that compile-command fails to specify
a containing group when byte-compiling loaddefs.el (bug#80648).
* lisp/progmodes/compile.el (compile-command): Restore explicit
custom :group on autoloaded user option.
* lisp/dired.el (dired-from-menubar): New function.
* lisp/menu-bar.el (menu-bar-file-menu): Use it in the "Open
Directory" menu item, instead of calling Dired directly. This
ensures we show the correct GUI dialog even if some package remaps
'dired' to something else (like 'ffap-bindings' does).
(Bug#80545)
* test/lisp/erc/erc-track-tests.el
(erc-track-tests--modified-channels/baseline): Update assertion to
expect an unchanged mode line segment if `erc-track-faces-normal-list'
lacks a ranked face in the latest inserted message.
(erc-track-modified-channels/baseline/nonotice)
(erc-track-modified-channels/priority-only-all/baseline/nonotice): New
tests. (Bug#80659)
* lisp/erc/erc-track.el (erc-track--select-mode-line-face): Check
whether ranked faces in the message appear in the value of the option
`erc-track-faces-normal-list' rather than repeatedly checking if the
current nominee does, usually the highest ranked face in the message.
Failure to do so caused ERC to treat faces absent from the option's
value as being present and thus eligible to replace ranked faces in the
mode line segment. This bug was introduced in ERC 5.6 and is also part
of 5.6.1. (Bug#80659)
Copyright-paperwork-exempt: yes
* lisp/erc/erc.el (erc--warn-once-before-connect): Don't call
`erc-display-message' from insertion hooks because doing so places an
unnecessary burden on the caller to preserve the insertion marker and
"msg prop" environment.
* etc/NEWS
(Changes in Specialized Modes and Packages in Emacs 31.1):
Announce new user option whitespace-global-mode-buffers (bug#79230).
* lisp/whitespace.el (whitespace-global-modes): Improve docstring
grammar.
(whitespace-global-mode-buffers): Make default value match *scratch*
exactly for backward compatibility. Fix custom :type.
(whitespace-enable-predicate): Prefer any over seq-find.
* src/xterm.c [!USE_GTK] (x_update_frame_user_time_window): When
replacing _NET_WM_USER_TIME with a new _NET_WM_USER_TIME_WINDOW and
the frame has requested no-focus-on-map, ensure _NET_WM_USER_TIME is
zero also on the new _NET_WM_USER_TIME_WINDOW.
(x_make_frame_visible) [!USE_GTK]: Don't overwrite _NET_WM_USER_TIME
before mapping a frame that has requested no-focus-on-map, and whose
_NET_WM_USER_TIME should thus remain zero (bug#80525).
* lisp/tab-bar.el (find-file-read-only-other-tab): Pass the
function 'find-file-other-tab' directly to
'find-file--read-only' (Bug#80630).
Copyright-paperwork-exempt: yes
* lisp/dabbrev.el (dabbrev-capf): Return an empty table rather than
signaling an error when there are no completions.
The completion UI already takes care of emitting a message like
"No match".
The fields of the new struct are what the global variables
charset_table, charset_table_size, charset_table_used, and
charset_attributes_table used to be. The struct should make it clearer
that those fields must be kept in sync.
* src/charset.h (struct charset_table): New struct.
(charset_attributes_getter): Adjust accordingly.
* src/charset.c (charset_table): Change type to struct charset_table.
(charset_table_size, charset_table_used, charset_attributes_table):
Moved to the struct.
(Fdefine_charset_internal, Ffind_charset_region, Ffind_charset_string)
(shrink_charset_table, syms_of_charset): Adjust to struct charset_table.
* src/pdumper.c (dump_charset, dump_charset_table): Adjust to struct
charset_table.
Determining the best size for a static array seems difficult; so
allocate it dynamically.
* src/charset.c (CHARSET_TABLE_INIT_SIZE): New constant.
(syms_of_charset): Malloc charset_table here.
(charset_table_init): Removed.
(shrink_charset_table): New function.
(Fclear_charset_maps): Call it.
* src/charset.h (charset_table_init): Removed.
(charset_attributes_getter): Add an assertion.
* src/pdumper.c (dump_charset_table): Assert that charset_table_size ==
charset_table_used.
This simplifies the GC code, as this was the only field in the charset
struct that referenced the GC heap. Without it, we no longer need to
trace the charset_table.
* src/charset.h (struct charset.attributes): Removed.
(charset_attributes_getter): New helper.
(CHARSET_ATTRIBUTES): Use it.
* src/charset.c (charset_attributes_table): New.
(Fdefine_charset_internal): Place attrs in charset_attributes_table.
(syms_of_charset): Initialize charset_attributes_table.
(mark_charset): Deleted.
* src/pdumper.c (dump_charset): Skip attributes field.
* src/lisp.h (mark_charset): Deleted.
* src/alloc.c (garbage_collect): mark_charset no longer needed.