Skip to content

Commit 68d4339

Browse files
committed
Merge from origin/emacs-27
09eed01 Wrap some set-auto-mode calls with delay-mode-hooks (bug#3... 4a0a114 Support ido-vertical-mode better ef5fba9 Fix faces tab-bar and tab-line. 8315084 Cater for 3-argument version of pthread_setname_np f27187f Clarify lexvar restrictions for add-to-ordered-list, add-t... 32763da Replace add-to-list to lexical variable with push (bug#39373) d07f177 Clarify add-to-list documentation (bug#39373) d3d2ea9 MH-E: alter content in mh-display-msg, not mh-show-mode db7fa25 Update documentation for mh-show-mode-hook d10be6b Example goto-addr hook: MH-E already uses goto-address # Conflicts: # etc/NEWS
2 parents cf14fa0 + 09eed01 commit 68d4339

File tree

24 files changed

+94
-52
lines changed

24 files changed

+94
-52
lines changed

configure.ac

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4192,6 +4192,21 @@ if test "$ac_cv_func_pthread_setname_np" = "yes"; then
41924192
AC_DEFINE(
41934193
HAVE_PTHREAD_SETNAME_NP_1ARG, 1,
41944194
[Define to 1 if pthread_setname_np takes a single argument.])
4195+
else
4196+
AC_CACHE_CHECK(
4197+
[whether pthread_setname_np takes three arguments],
4198+
[emacs_cv_pthread_setname_np_3arg],
4199+
[AC_COMPILE_IFELSE(
4200+
[AC_LANG_PROGRAM(
4201+
[[#include <pthread.h>]],
4202+
[[pthread_setname_np (0, "%s", "a");]])],
4203+
[emacs_cv_pthread_setname_np_3arg=yes],
4204+
[emacs_cv_pthread_setname_np_3arg=no])])
4205+
if test "$emacs_cv_pthread_setname_np_3arg" = "yes"; then
4206+
AC_DEFINE(
4207+
HAVE_PTHREAD_SETNAME_NP_3ARG, 1,
4208+
[Define to 1 if pthread_setname_np takes three arguments.])
4209+
fi
41954210
fi
41964211
fi
41974212

doc/emacs/misc.texi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,9 +2939,8 @@ done by calling @code{browse-url} as a subroutine
29392939

29402940
It can be useful to add @code{goto-address-mode} to mode hooks and
29412941
hooks for displaying an incoming message
2942-
(e.g., @code{rmail-show-message-hook} for Rmail, and
2943-
@code{mh-show-mode-hook} for MH-E). This is not needed for Gnus,
2944-
which has a similar feature of its own.
2942+
(e.g., @code{rmail-show-message-hook} for Rmail). This is not needed
2943+
for Gnus or MH-E, which have similar features of their own.
29452944

29462945
@node FFAP
29472946
@subsection Finding Files and URLs at Point

doc/lispref/lists.texi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,9 @@ non-@code{nil}, it is added at the end.
777777
The argument @var{symbol} is not implicitly quoted; @code{add-to-list}
778778
is an ordinary function, like @code{set} and unlike @code{setq}. Quote
779779
the argument yourself if that is what you want.
780+
781+
Do not use this function when @var{symbol} refers to a lexical
782+
variable.
780783
@end defun
781784

782785
Here's a scenario showing how to use @code{add-to-list}:
@@ -799,8 +802,9 @@ foo ;; @r{@code{foo} was changed.}
799802
@var{value})} is this:
800803

801804
@example
802-
(or (member @var{value} @var{var})
803-
(setq @var{var} (cons @var{value} @var{var})))
805+
(if (member @var{value} @var{var})
806+
@var{var}
807+
(setq @var{var} (cons @var{value} @var{var})))
804808
@end example
805809

806810
@defun add-to-ordered-list symbol element &optional order
@@ -828,6 +832,7 @@ and unlike @code{setq}. Quote the argument yourself if necessary.
828832

829833
The ordering information is stored in a hash table on @var{symbol}'s
830834
@code{list-order} property.
835+
@var{symbol} cannot refer to a lexical variable.
831836
@end defun
832837

833838
Here's a scenario showing how to use @code{add-to-ordered-list}:

doc/lispref/minibuf.texi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ and returns the updated history list. It limits the list length to
572572
the value of @var{maxelt} (if non-@code{nil}) or @code{history-length}
573573
(described below). The possible values of @var{maxelt} have the same
574574
meaning as the values of @code{history-length}.
575+
@var{history-var} cannot refer to a lexical variable.
575576

576577
Normally, @code{add-to-history} removes duplicate members from the
577578
history list if @code{history-delete-duplicates} is non-@code{nil}.

doc/misc/mh-e.texi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,10 +2256,10 @@ signature block is more to your liking.
22562256
Two hooks can be used to control how messages are displayed. The first
22572257
hook, @code{mh-show-mode-hook}, is called early on in the process of
22582258
the message display. It is usually used to perform some action on the
2259-
message's content. The second hook, @code{mh-show-hook}, is the last
2259+
message's buffer. The second hook, @code{mh-show-hook}, is the last
22602260
thing called after messages are displayed. It's used to affect the
2261-
behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2262-
early.
2261+
message's content, the behavior of MH-E in general, or when
2262+
@code{mh-show-mode-hook} is too early.
22632263

22642264
@cindex MH-Show mode
22652265
@cindex modes, MH-Show

etc/NEWS.27

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2630,6 +2630,14 @@ will be chosen even if you have an entry for "image/*" in your
26302630
overrides all system and Emacs-provided defaults. To get the old
26312631
method back, set 'mailcap-prefer-mailcap-viewers' to nil.
26322632

2633+
** MH-E
2634+
+++
2635+
*** The hook 'mh-show-mode-hook' is now called before the message is inserted.
2636+
Functions that want to affect the message text (for example, to change
2637+
highlighting) can no longer use 'mh-show-mode-hook', because the
2638+
message contents will not yet have been inserted when the hook is
2639+
called. Such functions should now be attached to 'mh-show-hook'.
2640+
26332641
** URL
26342642

26352643
---

lisp/autoinsert.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ If this contains a %s, that will be replaced by the matching rule."
171171
(mapatoms (lambda (mode)
172172
(let ((name (symbol-name mode)))
173173
(when (string-match "-mode$" name)
174-
(add-to-list 'modes name)))))
174+
(push name modes)))))
175175
(sort modes 'string<)))
176176
(completing-read "Local variables for mode: " v1 nil t)
177177
" . (("

lisp/cedet/mode-local.el

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -819,14 +819,12 @@ META-NAME is a cons (OVERLOADABLE-SYMBOL . MAJOR-MODE)."
819819
)
820820
;; Order symbols by type
821821
(mapatoms
822-
#'(lambda (s)
823-
(add-to-list (cond
824-
((get s 'mode-variable-flag)
825-
(if (get s 'constant-flag) 'mc 'mv))
826-
((get s 'override-flag)
827-
(if (get s 'constant-flag) 'fo 'ov))
828-
('us))
829-
s))
822+
(lambda (s) (push s (cond
823+
((get s 'mode-variable-flag)
824+
(if (get s 'constant-flag) mc mv))
825+
((get s 'override-flag)
826+
(if (get s 'constant-flag) fo ov))
827+
(t us))))
830828
table)
831829
;; Print symbols by type
832830
(when us

lisp/gnus/mm-view.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,9 @@ If MODE is not set, try to find mode automatically."
497497
(let ((auto-mode-alist
498498
(delq (rassq 'doc-view-mode-maybe auto-mode-alist)
499499
(copy-sequence auto-mode-alist))))
500-
(set-auto-mode)
500+
;; Don't run hooks that might assume buffer-file-name
501+
;; really associates buffer with a file (bug#39190).
502+
(delay-mode-hooks (set-auto-mode))
501503
(setq mode major-mode)))
502504
;; Do not fontify if the guess mode is fundamental.
503505
(unless (eq major-mode 'fundamental-mode)

lisp/ido.el

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4732,6 +4732,9 @@ For details of keybindings, see `ido-find-file'."
47324732
(delete-overlay ido--overlay))
47334733
(let ((o (make-overlay (point-max) (point-max) nil t t)))
47344734
(when (> (length inf) 0)
4735+
;; For hacks that redefine ido-completions function (bug#39379)
4736+
(when (eq (aref inf 0) ?\n)
4737+
(setq inf (concat " " inf)))
47354738
(put-text-property 0 1 'cursor t inf))
47364739
(overlay-put o 'after-string inf)
47374740
(setq ido--overlay o)))

0 commit comments

Comments
 (0)