[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 624416a2aed: Merge commit '1bc9dfc5bee'
From: |
Stefan Monnier |
Subject: |
master 624416a2aed: Merge commit '1bc9dfc5bee' |
Date: |
Mon, 27 Mar 2023 17:14:40 -0400 (EDT) |
branch: master
commit 624416a2aedad6392b1c5c27d322bf26730d6a03
Merge: afbb9b426ce 1bc9dfc5bee
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Merge commit '1bc9dfc5bee'
---
doc/lispref/modes.texi | 36 ++++++++++++++++++++++--------------
doc/misc/eglot.texi | 28 ++++++++++++++--------------
etc/NEWS.29 | 8 +++++---
etc/PROBLEMS | 27 +++++++++++++++++++++++++++
lisp/emacs-lisp/easy-mmode.el | 28 ++++++++++++++++++----------
lisp/help.el | 7 +++++++
src/nsterm.m | 4 ++++
7 files changed, 97 insertions(+), 41 deletions(-)
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 18d5da5c7d1..fd497d14f63 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -1775,6 +1775,8 @@ it's used to say which major modes this minor mode is
useful in.
Any other keyword arguments are passed directly to the
@code{defcustom} generated for the variable @var{mode}.
+@xref{Variable Definitions}, for the description of those keywords and
+their values.
The command named @var{mode} first performs the standard actions such as
setting the variable named @var{mode} and then executes the @var{body}
@@ -1860,9 +1862,10 @@ by visiting files, and buffers that use a major mode
other than
Fundamental mode; but it does not detect the creation of a new buffer
in Fundamental mode.
-This defines the customization option @var{global-mode}
(@pxref{Customization}),
-which can be toggled in the Customize interface to turn the minor mode on
-and off. As with @code{define-minor-mode}, you should ensure that the
+This macro defines the customization option @var{global-mode}
+(@pxref{Customization}), which can be toggled via the Customize
+interface to turn the minor mode on and off. As with
+@code{define-minor-mode}, you should ensure that the
@code{define-globalized-minor-mode} form is evaluated each time Emacs
starts, for example by providing a @code{:require} keyword.
@@ -1875,24 +1878,27 @@ Use @code{:variable @var{variable}} if that's not the
case--some minor
modes use a different variable to store this state information.
Generally speaking, when you define a globalized minor mode, you should
-also define a non-globalized version, so that people can use (or
-disable) it in individual buffers. This also allows them to disable a
+also define a non-globalized version, so that people could use it (or
+disable it) in individual buffers. This also allows them to disable a
globally enabled minor mode in a specific major mode, by using that
mode's hook.
-If given a @code{:predicate} keyword, a user option called the same as
-the global mode variable, but with @code{-modes} instead of
-@code{-mode} at the end will be created. The variable is used as a
-predicate that specifies which major modes the minor mode should be
-activated in. Valid values include @code{t} (use in all major modes,
-@code{nil} (use in no major modes), or a list of mode names (or
-@code{(not mode-name ...)}) elements (as well as @code{t} and
-@code{nil}).
+If the macro is given a @code{:predicate} keyword, it will create a
+user option called the same as the global mode variable, but with
+@code{-modes} instead of @code{-mode} at the end, i.e.@:
+@code{@var{global-mode}s}. This variable will be used in a predicate
+function that determines whether the minor mode should be activated in
+a particular major mode. Valid values of @code{:predicate} include
+@code{t} (use in all major modes), @code{nil} (don't use in any major
+modes), or a list of mode names, optionally preceded with @code{not}
+(as in @w{@code{(not @var{mode-name} @dots{})}}). These elements can
+be mixed, as shown in the following examples.
@example
(c-mode (not mail-mode message-mode) text-mode)
@end example
+@noindent
This means ``use in modes derived from @code{c-mode}, and not in
modes derived from @code{message-mode} or @code{mail-mode}, but do use
in modes derived from @code{text-mode}, and otherwise no other
@@ -1902,13 +1908,15 @@ modes''.
((not c-mode) t)
@end example
-This means ``don't use modes derived from @code{c-mode}, but use
+@noindent
+This means ``don't use in modes derived from @code{c-mode}, but do use
everywhere else''.
@example
(text-mode)
@end example
+@noindent
This means ``use in modes derived from @code{text-mode}, but nowhere
else''. (There's an implicit @code{nil} element at the end.)
@end defmac
diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi
index defdf59e865..fc5449b0e8d 100644
--- a/doc/misc/eglot.texi
+++ b/doc/misc/eglot.texi
@@ -1298,9 +1298,9 @@ user.
To report an Eglot bug, send e-mail to @email{bug-gnu-emacs@@gnu.org}.
-Get acquainted with Emacs's bug reporting guidelines (@pxref{Bugs,,,
-emacs, GNU Emacs Manual}). Then, follow this checklist specific to
-Eglot bug rerpots.
+To understand how to write this email, get acquainted with Emacs's bug
+reporting guidelines (@pxref{Bugs,,, emacs, GNU Emacs Manual}). Then,
+follow this Eglot-specific checklist:
@enumerate
@item
@@ -1341,18 +1341,18 @@ since they are usually implicitly loaded when visiting
a file in that
language.
ELPA packages usually live in @code{~/.emacs.d/elpa} (or what is in
-@code{package-user-dir}). Please show the listing of files in that
-directory as well.
+@code{package-user-dir}). Including a listing of files in that
+directory is a way to tell the maintainers about ELPA package
+versions.
@item
Include a recipe to replicate the problem with @emph{a clean Emacs
-run}. This means @kbd{emacs -Q -f package-initialize} invocation
-which starts Emacs with no configuration and initializes the ELPA
-packages. A very minimal (no more that 10 lines) @file{.emacs}
-initialization file is also acceptable and good means to describe
-changes to variables.
+run}. The invocation @code{emacs -Q -f package-initialize} starts
+Emacs with no configuration and initializes the ELPA packages. A very
+minimal @file{.emacs} initialization file (10 lines or less) is also
+acceptable and good means to describe changes to variables.
-There is usually no need to include @kbd{require} statements in the
+There is usually no need to include @code{require} statements in the
recipe, as Eglot's functionality uses autoloads.
Likewise, there is rarely the need to use things like
@@ -1364,9 +1364,9 @@ adding to hooks with @code{add-hook}. Prefer starting
Eglot with
@item
Make sure to double check all the above elements and re-run the recipe
to see that the problem is reproducible. Following the recipe should
-produce event transcript and error backtraces that are exactly the
-same or very similar to the ones you included. If the problem only
-happens sometimes, include this information in your bug report.
+produce event transcript and error backtraces that are very similar to
+the ones you included. If the problem only happens sometimes, mention
+this in your report.
@end enumerate
Please keep in mind that some problems reported against Eglot may
diff --git a/etc/NEWS.29 b/etc/NEWS.29
index 0b651f7a519..d7a6cf7986d 100644
--- a/etc/NEWS.29
+++ b/etc/NEWS.29
@@ -3565,11 +3565,13 @@ font spec. In these cases, replacing ":weight 'normal"
with ":weight
'medium" should fix the issue.
---
-** Keymap descriptions have changed.
+** Keymap descriptions by Help commands have changed.
'help--describe-command', 'C-h b' and associated functions that output
keymap descriptions have changed. In particular, prefix commands are
-not output at all, and instead of "??" for closures/functions,
-"[closure]"/"[lambda]" is output.
+not output at all, and instead of "??" for closures/functions, these
+functions output "[closure]"/"[lambda]". You can get back the old
+behavior of including prefix commands by customizing the new option
+'describe-bindings-show-prefix-commands' to a non-nil value.
---
** 'downcase' details have changed slightly.
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 9ef231d4b16..928870c42f6 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -2313,6 +2313,33 @@ recommended way of turning on Font-lock is by typing "M-x
global-font-lock-mode RET" or by customizing the variable
'global-font-lock-mode'.
+** Colors are not available or messed up on TTY frames inside 'screen'.
+
+This can happen if you have COLORTERM=truecolor defined in the
+environment when Emacs starts, but your version of 'screen' doesn't
+actually support 24-bit true colors.
+
+The COLORTERM environment variable is supposed to be set to the value
+"truecolor" only if the terminal used by Emacs actually supports true
+color. Emacs does not have any means of verifying that this support
+is available, it takes the fact that the variable is defined to this
+value as an indication that true color support is, in fact, available,
+and uses color setting commands that COLORTERM=truecolor presumes,
+bypassing the usual Terminfo capabilities related to colors.
+
+Some text-mode terminals, such as GNOME Terminal, are known to set
+this environment variable, supposedly to announce their own support
+for true color; however the setting is then inherited by any other
+terminal emulators started from such a terminal, even though those
+other terminal emulators might not themselves support true color using
+the same commands as Emacs uses when it sees COLORTERM=truecolor.
+
+The solution is to either upgrade to a newer version of 'screen'
+(version 5.x or later reportedly supports true color), or to unset the
+COLORTERM variable before starting 'screen', and let Emacs use the
+color support provided by the terminal emulator as defined in the
+Terminfo database.
+
** Unexpected characters inserted into the buffer when you start Emacs.
See e.g. <URL:https://debbugs.gnu.org/11129>
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 77f4b26d9bb..84e131147cd 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -452,15 +452,23 @@ No problems result if this variable is not bound.
TURN-ON is a function that will be called with no args in every buffer
and that should try to turn MODE on if applicable for that buffer.
-Each of KEY VALUE is a pair of CL-style keyword arguments. :predicate
-specifies which major modes the globalized minor mode should be switched on
-in. As the minor mode defined by this function is always global, any
-:global keyword is ignored. Other keywords have the same meaning as in
-`define-minor-mode', which see. In particular, :group specifies the custom
-group. The most useful keywords are those that are passed on to the
-`defcustom'. It normally makes no sense to pass the :lighter or :keymap
-keywords to `define-globalized-minor-mode', since these are usually passed
-to the buffer-local version of the minor mode.
+Each of KEY VALUE is a pair of CL-style keyword arguments.
+The :predicate argument specifies in which major modes should the
+globalized minor mode be switched on. The value should be t (meaning
+switch on the minor mode in all major modes), nil (meaning don't
+switch on in any major mode), a list of modes (meaning switch on only
+in those modes and their descendants), or a list (not MODES...),
+meaning switch on in any major mode except MODES. The value can also
+mix all of these forms, see the info node `Defining Minor Modes' for
+details.
+As the minor mode defined by this function is always global, any
+:global keyword is ignored.
+Other keywords have the same meaning as in `define-minor-mode',
+which see. In particular, :group specifies the custom group.
+The most useful keywords are those that are passed on to the `defcustom'.
+It normally makes no sense to pass the :lighter or :keymap keywords
+to `define-globalized-minor-mode', since these are usually passed to
+the buffer-local version of the minor mode.
BODY contains code to execute each time the mode is enabled or disabled.
It is executed after toggling the mode, and before running
@@ -512,7 +520,7 @@ on if the hook has explicitly disabled it.
(setq turn-on-function
`(lambda ()
(require 'easy-mmode)
- (when (easy-mmode--globalized-predicate-p ,(car predicate))
+ (when (easy-mmode--globalized-predicate-p ,MODE-predicate)
(funcall ,turn-on-function)))))
(_ (push keyw extra-keywords) (push (pop body) extra-keywords))))
diff --git a/lisp/help.el b/lisp/help.el
index 83be85b1ee4..3e94b5046e5 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -717,6 +717,12 @@ Return nil if KEYS is nil."
:group 'help
:version "29.1")
+(defcustom describe-bindings-show-prefix-commands nil
+ "Non-nil means show prefix commands in the output of `describe-bindings'."
+ :type 'boolean
+ :group 'help
+ :version "29.1")
+
(declare-function outline-hide-subtree "outline")
(defun describe-bindings (&optional prefix buffer)
@@ -1699,6 +1705,7 @@ in `describe-map-tree'."
(setq vect (cdr vect))
(setq end (caar vect))))
(when (or (not (eq start end))
+ describe-bindings-show-prefix-commands
;; Don't output keymap prefixes.
(not (keymapp definition)))
(when first
diff --git a/src/nsterm.m b/src/nsterm.m
index 0e75cbf3f0f..46007ec4fcb 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -8573,6 +8573,10 @@ ns_in_echo_area (void)
return self;
}
+- (BOOL) validateToolbarItem: (NSToolbarItem *) toolbarItem
+{
+ return [toolbarItem isEnabled];
+}
- (instancetype)toggleToolbar: (id)sender
{