Merge from origin/emacs-30

7dbbd58d6c Locate password icon in global-mode-string
19049efd30 ; Fix last documentation change
2c640e63a8 Explain tty-color-mode frame parameter more.
e5d600006e ; * src/doc.c (Ftext_quoting_style): Make doc string agre...
90c6880a92 (track-changes--after): Fix problem found in bug#73041
This commit is contained in:
Michael Albinus
2024-10-18 17:56:15 +02:00
8 changed files with 64 additions and 39 deletions

View File

@@ -1027,7 +1027,21 @@ there is no mode that supports @var{num} colors, Emacs acts as if
@var{num} were 0, i.e., it uses the terminal's default color support
mode.
@end table
This option has no effect on MS-Windows and MS-DOS.
@cindex colors on character terminal, changing during session
@cindex character terminal, change color mode
@vindex tty-color-mode@r{, frame parameter}
If @var{mode} is omitted, it defaults to @var{ansi8}.
The color mode can be changed dynamically during a running Emacs
session: the current mode is available via the @code{tty-color-mode}
frame parameter, and it can be changed by modifying that frame
parameter.@footnote{
This does not work on MS-Windows and MS-DOS text-mode terminals.
} This means you can also specify the initial value via
@code{default-frame-alist} instead of the command-line option.
@end table
For example, to use a coral mouse cursor and a slate blue text cursor,

View File

@@ -986,8 +986,8 @@ password. You may type either @key{RET} or @key{ESC} to submit the
password. Any other self-inserting character key inserts the associated
character into the password, and all other input is ignored.
There is also an icon at the front of the mode line indicating the
password visibility. Clicking @kbd{mouse-1} on it toggles the password
There is also an icon in the mode line indicating the password
visibility. Clicking @kbd{mouse-1} on it toggles the password
visibility as well.
@node Yes or No Prompts

View File

@@ -2447,7 +2447,8 @@ off color support.
If the parameter's value is a symbol, it specifies a number through
the value of @code{tty-color-mode-alist}, and the associated number is
used instead.
used instead. This parameter supports dynamic changes during a running
Emacs session (but not on MS-Windows and MS-DOS).
@vindex screen-gamma@r{, a frame parameter}
@item screen-gamma

View File

@@ -2562,9 +2562,9 @@ This function uses @code{read-passwd-mode}, a minor mode. It binds two
keys in the minbuffer: @kbd{C-u} (@code{delete-minibuffer-contents})
deletes the password, and @kbd{TAB}
(@code{read-passwd--toggle-visibility}) toggles the visibility of the
password. There is also an additional icon in the mode-line. Clicking
on this icon with @key{mouse-1} toggles the visibility of the password
as well.
password. There is also an additional icon in the mode-line's
@code{global-mode-string}. Clicking on this icon with @key{mouse-1}
toggles the visibility of the password as well.
@end defun
@node Minibuffer Commands

View File

@@ -1880,6 +1880,26 @@ think that your terminal supports colors, but Emacs won't use them,
check the @code{termcap} entry for your display type for color-related
capabilities.
If by contrast you wish to @emph{disable} tty color support, either
start emacs with the @samp{--color=no} command-line option, or ensure
that the frame parameter @code{tty-color-mode} is @code{no}, e.g. by
putting the following in your init file:
@lisp
(push '(tty-color-mode . no) default-frame-alist)
@end lisp
@noindent
To disable tty color support in the @emph{current} frame you can
evaluate:
@lisp
(set-frame-parameter nil 'tty-color-mode 'no)
@end lisp
Note that this currently doesn't work on MS-Windows and MS-DOS, whose
text-mode terminals always use the fixed number of 16 text colors.
The command @kbd{M-x list-colors-display} pops up a window which
exhibits all the colors Emacs knows about on the current display.

View File

@@ -2467,14 +2467,11 @@ point is moved into the passwords (see `authinfo-hide-elements').
:version "30.1"
:help-echo "mouse-1: Toggle password visibility")
(defvar read-passwd--mode-line-buffer nil
"Buffer to modify `mode-line-format' for showing/hiding passwords.")
(defvar read-passwd--mode-line-icon nil
"Propertized mode line icon for showing/hiding passwords.")
(defvar read-passwd--hide-password t
"Toggle whether password should be hidden in minubuffer.")
"Toggle whether password should be hidden in minibuffer.")
(defun read-passwd--hide-password ()
"Make password in minibuffer hidden or visible."
@@ -2497,8 +2494,8 @@ Adapt also mode line."
;; FIXME: In case of a recursive minibuffer, this may select the wrong
;; mini-buffer.
(with-current-buffer (window-buffer win)
(setq read-passwd--hide-password (not read-passwd--hide-password))
(with-current-buffer read-passwd--mode-line-buffer
(when (memq 'read-passwd-mode local-minor-modes)
(setq read-passwd--hide-password (not read-passwd--hide-password))
(setq read-passwd--mode-line-icon
`(:propertize
,(if icon-preference
@@ -2514,8 +2511,8 @@ Adapt also mode line."
(define-key map [mode-line mouse-1]
#'read-passwd-toggle-visibility)
map))))
(force-mode-line-update))
(read-passwd--hide-password))))
(force-mode-line-update 'all)
(read-passwd--hide-password)))))
(defvar read-passwd-map
;; BEWARE: `defconst' would purecopy it, breaking the sharing with
@@ -2534,25 +2531,18 @@ Adapt also mode line."
:keymap read-passwd-map
:version "30.1"
(setq read-passwd--hide-password nil
;; Stolen from `eldoc-minibuffer-message'.
read-passwd--mode-line-buffer
(window-buffer
(or (window-in-direction 'above (minibuffer-window))
(minibuffer-selected-window)
(get-largest-window))))
(setq read-passwd--hide-password nil)
(or global-mode-string (setq global-mode-string '("")))
(if read-passwd-mode
(with-current-buffer read-passwd--mode-line-buffer
(let ((mode-string '(:eval read-passwd--mode-line-icon)))
(if read-passwd-mode
;; Add `read-passwd--mode-line-icon'.
(when (listp mode-line-format)
(setq mode-line-format
(cons '(:eval read-passwd--mode-line-icon)
mode-line-format))))
(with-current-buffer read-passwd--mode-line-buffer
(or (member mode-string global-mode-string)
(setq global-mode-string
(append global-mode-string (list mode-string))))
;; Remove `read-passwd--mode-line-icon'.
(when (listp mode-line-format)
(setq mode-line-format (cdr mode-line-format)))))
(setq global-mode-string
(delete mode-string global-mode-string))))
(when read-passwd-mode
(read-passwd-toggle-visibility)))

View File

@@ -591,16 +591,16 @@ Details logged to `track-changes--error-log'")
(defun track-changes--after (beg end len)
(track-changes--trace)
(cl-assert track-changes--state)
(and (eq track-changes--before-clean 'unset)
(not track-changes--before-no)
;; This can be a sign that a `before-change-functions' went missing,
;; or that we called `track-changes--clean-state' between
;; a `before-change-functions' and `after-change-functions'.
(track-changes--before beg end))
(setq track-changes--before-clean nil)
(let ((offset (- (- end beg) len)))
(cl-incf track-changes--before-end offset)
(cl-incf track-changes--buffer-size offset)
(if (and (eq track-changes--before-clean 'unset)
(not track-changes--before-no))
;; This can be a sign that a `before-change-functions' went missing,
;; or that we called `track-changes--clean-state' between
;; a `before-change-functions' and `after-change-functions'.
(track-changes--before beg end)
(cl-incf track-changes--before-end offset))
(setq track-changes--before-clean nil)
(if (not (or track-changes--before-no
(save-restriction
(widen)

View File

@@ -669,7 +669,7 @@ If the variable `text-quoting-style' is `grave', `straight' or
`curve', just return that value. If it is nil (the default), return
`grave' if curved quotes cannot be displayed (for instance, on a
terminal with no support for these characters), otherwise return
`quote'. Any other value is treated as `grave'.
`curve'. Any other value is treated as `curve'.
Note that in contrast to the variable `text-quoting-style', this
function will never return nil. */)