mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-07 15:00:34 -08:00
Merge from origin/emacs-29
3965c65d5e; * lisp/subr.el (read-char-choice): Fix last change.c1eac5b658Improve documentation of 'read-choice' and related symbolsa8c9283e17Revert "Comp fix calls to redefined primtives with op-byt...8b66d8abd0Revert "* lisp/emacs-lisp/comp.el (comp-emit-set-call-sub...4ec4f614c7; Fix incompatibility in 'display-buffer-assq-regexp'ba3ade58f3Skip ruby-ts-imenu-index test if needed9133446db8Fix Eglot Tramp tests on EMBA5b351bc7fa* test/infra/Dockerfile.emba (emacs-gnustep): Instrument ...
This commit is contained in:
commit
f24aa0f46a
8 changed files with 68 additions and 72 deletions
|
|
@ -3215,15 +3215,24 @@ unspecified, the only fallback disabled is downcasing of the last
|
||||||
event.
|
event.
|
||||||
@end defun
|
@end defun
|
||||||
|
|
||||||
|
@vindex read-char-choice-use-read-key
|
||||||
@defun read-char-choice prompt chars &optional inhibit-quit
|
@defun read-char-choice prompt chars &optional inhibit-quit
|
||||||
This function uses @code{read-key} to read and return a single
|
This function uses @code{read-from-minibuffer} to read and return a
|
||||||
character. It ignores any input that is not a member of @var{chars},
|
single character that is a member of @var{chars}, which should be a
|
||||||
a list of accepted characters. Optionally, it will also ignore
|
list of single characters. It discards any input characters that are
|
||||||
keyboard-quit events while it is waiting for valid input. If you bind
|
not members of @var{chars}, and shows a message to that effect.
|
||||||
@code{help-form} (@pxref{Help Functions}) to a non-@code{nil} value
|
|
||||||
while calling @code{read-char-choice}, then pressing @code{help-char}
|
The optional argument @var{inhibit-quit} is by default ignored, but if
|
||||||
causes it to evaluate @code{help-form} and display the result. It
|
the variable @code{read-char-choice-use-read-key} is non-@code{nil},
|
||||||
then continues to wait for a valid input character, or keyboard-quit.
|
this function uses @code{read-key} instead of
|
||||||
|
@code{read-from-minibuffer}, and in that case @var{inhibit-quit}
|
||||||
|
non-@code{nil} means ignore keyboard-quit events while waiting for
|
||||||
|
valid input. In addition, if @code{read-char-choice-use-read-key} is
|
||||||
|
non-@code{nil}, binding @code{help-form} (@pxref{Help Functions}) to a
|
||||||
|
non-@code{nil} value while calling this function causes it to evaluate
|
||||||
|
@code{help-form} and display the result when the user presses
|
||||||
|
@code{help-char}; it then continues to wait for a valid input
|
||||||
|
character, or for keyboard-quit.
|
||||||
@end defun
|
@end defun
|
||||||
|
|
||||||
@defun read-multiple-choice prompt choices &optional help-string show-help long-form
|
@defun read-multiple-choice prompt choices &optional help-string show-help long-form
|
||||||
|
|
|
||||||
|
|
@ -1774,14 +1774,6 @@ SP-DELTA is the stack adjustment."
|
||||||
(maxarg (cdr arity)))
|
(maxarg (cdr arity)))
|
||||||
(when (eq maxarg 'unevalled)
|
(when (eq maxarg 'unevalled)
|
||||||
(signal 'native-ice (list "subr contains unevalled args" subr-name)))
|
(signal 'native-ice (list "subr contains unevalled args" subr-name)))
|
||||||
(if (not (subr-primitive-p subr-name))
|
|
||||||
;; The primitive got redefined before the compiler is
|
|
||||||
;; invoked! (bug#61917)
|
|
||||||
(comp-emit-set-call `(callref funcall
|
|
||||||
,(make-comp-mvar :constant subr-name)
|
|
||||||
,@(cl-loop repeat nargs
|
|
||||||
for sp from (comp-sp)
|
|
||||||
collect (comp-slot-n sp))))
|
|
||||||
(if (eq maxarg 'many)
|
(if (eq maxarg 'many)
|
||||||
;; callref case.
|
;; callref case.
|
||||||
(comp-emit-set-call (comp-callref subr-name nargs (comp-sp)))
|
(comp-emit-set-call (comp-callref subr-name nargs (comp-sp)))
|
||||||
|
|
@ -1792,7 +1784,7 @@ SP-DELTA is the stack adjustment."
|
||||||
(let* ((subr-name subr-name)
|
(let* ((subr-name subr-name)
|
||||||
(slots (cl-loop for i from 0 below maxarg
|
(slots (cl-loop for i from 0 below maxarg
|
||||||
collect (comp-slot-n (+ i (comp-sp))))))
|
collect (comp-slot-n (+ i (comp-sp))))))
|
||||||
(comp-emit-set-call (apply #'comp-call (cons subr-name slots)))))))))
|
(comp-emit-set-call (apply #'comp-call (cons subr-name slots))))))))
|
||||||
|
|
||||||
(eval-when-compile
|
(eval-when-compile
|
||||||
(defun comp-op-to-fun (x)
|
(defun comp-op-to-fun (x)
|
||||||
|
|
|
||||||
52
lisp/subr.el
52
lisp/subr.el
|
|
@ -3233,34 +3233,40 @@ This function is used by the `interactive' code letter \"n\"."
|
||||||
n))
|
n))
|
||||||
|
|
||||||
(defvar read-char-choice-use-read-key nil
|
(defvar read-char-choice-use-read-key nil
|
||||||
"Prefer `read-key' when reading a character by `read-char-choice'.
|
"If non-nil, use `read-key' when reading a character by `read-char-choice'.
|
||||||
Otherwise, use the minibuffer.
|
Otherwise, use the minibuffer (this is the default).
|
||||||
|
|
||||||
When using the minibuffer, the user is less constrained, and can
|
When reading via the minibuffer, you can use the normal commands
|
||||||
use the normal commands available in the minibuffer, and can, for
|
available in the minibuffer, and can, for instance, temporarily
|
||||||
instance, switch to another buffer, do things there, and then
|
switch to another buffer, do things there, and then switch back
|
||||||
switch back again to the minibuffer before entering the
|
to the minibuffer before entering the character. This is not
|
||||||
character. This is not possible when using `read-key', but using
|
possible when using `read-key', but using `read-key' may be less
|
||||||
`read-key' may be less confusing to some users.")
|
confusing to some users.")
|
||||||
|
|
||||||
(defun read-char-choice (prompt chars &optional inhibit-keyboard-quit)
|
(defun read-char-choice (prompt chars &optional inhibit-keyboard-quit)
|
||||||
"Read and return one of CHARS, prompting for PROMPT.
|
"Read and return one of the characters in CHARS, prompting with PROMPT.
|
||||||
Any input that is not one of CHARS is ignored.
|
CHARS should be a list of single characters.
|
||||||
|
The function discards any input character that is not one of CHARS,
|
||||||
|
and by default shows a message to the effect that it is not one of
|
||||||
|
the expected characters.
|
||||||
|
|
||||||
By default, the minibuffer is used to read the key
|
By default, this function uses the minibuffer to read the key
|
||||||
non-modally (see `read-char-from-minibuffer'). If
|
non-modally (see `read-char-from-minibuffer'), and the optional
|
||||||
|
argument INHIBIT-KEYBOARD-QUIT is ignored. However, if
|
||||||
`read-char-choice-use-read-key' is non-nil, the modal `read-key'
|
`read-char-choice-use-read-key' is non-nil, the modal `read-key'
|
||||||
function is used instead (see `read-char-choice-with-read-key')."
|
function is used instead (see `read-char-choice-with-read-key'),
|
||||||
|
and INHIBIT-KEYBOARD-QUIT is passed to it."
|
||||||
(if (not read-char-choice-use-read-key)
|
(if (not read-char-choice-use-read-key)
|
||||||
(read-char-from-minibuffer prompt chars)
|
(read-char-from-minibuffer prompt chars)
|
||||||
(read-char-choice-with-read-key prompt chars inhibit-keyboard-quit)))
|
(read-char-choice-with-read-key prompt chars inhibit-keyboard-quit)))
|
||||||
|
|
||||||
(defun read-char-choice-with-read-key (prompt chars &optional inhibit-keyboard-quit)
|
(defun read-char-choice-with-read-key (prompt chars &optional inhibit-keyboard-quit)
|
||||||
"Read and return one of CHARS, prompting for PROMPT.
|
"Read and return one of the characters in CHARS, prompting with PROMPT.
|
||||||
|
CHARS should be a list of single characters.
|
||||||
Any input that is not one of CHARS is ignored.
|
Any input that is not one of CHARS is ignored.
|
||||||
|
|
||||||
If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
|
If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
|
||||||
`keyboard-quit' events while waiting for a valid input.
|
`keyboard-quit' events while waiting for valid input.
|
||||||
|
|
||||||
If you bind the variable `help-form' to a non-nil value
|
If you bind the variable `help-form' to a non-nil value
|
||||||
while calling this function, then pressing `help-char'
|
while calling this function, then pressing `help-char'
|
||||||
|
|
@ -3556,15 +3562,15 @@ Also discard all previous input in the minibuffer."
|
||||||
(sit-for 2)))
|
(sit-for 2)))
|
||||||
|
|
||||||
(defvar y-or-n-p-use-read-key nil
|
(defvar y-or-n-p-use-read-key nil
|
||||||
"Prefer `read-key' when answering a \"y or n\" question by `y-or-n-p'.
|
"Use `read-key' when reading answers to \"y or n\" questions by `y-or-n-p'.
|
||||||
Otherwise, use the minibuffer.
|
Otherwise, use the `read-from-minibuffer' to read the answers.
|
||||||
|
|
||||||
When using the minibuffer, the user is less constrained, and can
|
When reading via the minibuffer, you can use the normal commands
|
||||||
use the normal commands available in the minibuffer, and can, for
|
available in the minibuffer, and can, for instance, temporarily
|
||||||
instance, switch to another buffer, do things there, and then
|
switch to another buffer, do things there, and then switch back
|
||||||
switch back again to the minibuffer before entering the
|
to the minibuffer before entering the character. This is not
|
||||||
character. This is not possible when using `read-key', but using
|
possible when using `read-key', but using `read-key' may be less
|
||||||
`read-key' may be less confusing to some users.")
|
confusing to some users.")
|
||||||
|
|
||||||
(defvar from--tty-menu-p nil
|
(defvar from--tty-menu-p nil
|
||||||
"Non-nil means the current command was invoked from a TTY menu.")
|
"Non-nil means the current command was invoked from a TTY menu.")
|
||||||
|
|
|
||||||
|
|
@ -7565,19 +7565,16 @@ all fail. It should never be set by programs or users. See
|
||||||
`display-buffer'.")
|
`display-buffer'.")
|
||||||
(put 'display-buffer-fallback-action 'risky-local-variable t)
|
(put 'display-buffer-fallback-action 'risky-local-variable t)
|
||||||
|
|
||||||
(defun display-buffer-assq-regexp (buffer-or-name alist action)
|
(defun display-buffer-assq-regexp (buffer-name alist action)
|
||||||
"Retrieve ALIST entry corresponding to buffer specified by BUFFER-OR-NAME.
|
"Retrieve ALIST entry corresponding to buffer whose name is BUFFER-NAME.
|
||||||
This returns the cdr of the alist entry ALIST if the entry's
|
This returns the cdr of the alist entry ALIST if the entry's
|
||||||
key (its car) and the name of the buffer designated by
|
key (its car) and the name of the buffer designated by
|
||||||
BUFFER-OR-NAME satisfy `buffer-match-p', using the key as
|
BUFFER-NAME satisfy `buffer-match-p', using the key as
|
||||||
CONDITION argument of `buffer-match-p'. ACTION should have the
|
CONDITION argument of `buffer-match-p'. ACTION should have the
|
||||||
form of the action argument passed to `display-buffer'."
|
form of the action argument passed to `display-buffer'."
|
||||||
(catch 'match
|
(catch 'match
|
||||||
(dolist (entry alist)
|
(dolist (entry alist)
|
||||||
(when (buffer-match-p (car entry) (if (stringp buffer-or-name)
|
(when (buffer-match-p (car entry) buffer-name action)
|
||||||
buffer-or-name
|
|
||||||
(buffer-name buffer-or-name))
|
|
||||||
action)
|
|
||||||
(throw 'match (cdr entry))))))
|
(throw 'match (cdr entry))))))
|
||||||
|
|
||||||
(defvar display-buffer--same-window-action
|
(defvar display-buffer--same-window-action
|
||||||
|
|
@ -7736,6 +7733,9 @@ specified by the ACTION argument."
|
||||||
(let ((buffer (if (bufferp buffer-or-name)
|
(let ((buffer (if (bufferp buffer-or-name)
|
||||||
buffer-or-name
|
buffer-or-name
|
||||||
(get-buffer buffer-or-name)))
|
(get-buffer buffer-or-name)))
|
||||||
|
(buf-name (if (bufferp buffer-or-name)
|
||||||
|
(buffer-name buffer-or-name)
|
||||||
|
buffer-or-name))
|
||||||
;; Make sure that when we split windows the old window keeps
|
;; Make sure that when we split windows the old window keeps
|
||||||
;; point, bug#14829.
|
;; point, bug#14829.
|
||||||
(split-window-keep-point t)
|
(split-window-keep-point t)
|
||||||
|
|
@ -7744,7 +7744,7 @@ specified by the ACTION argument."
|
||||||
(unless (listp action) (setq action nil))
|
(unless (listp action) (setq action nil))
|
||||||
(let* ((user-action
|
(let* ((user-action
|
||||||
(display-buffer-assq-regexp
|
(display-buffer-assq-regexp
|
||||||
buffer display-buffer-alist action))
|
buf-name display-buffer-alist action))
|
||||||
(special-action (display-buffer--special-action buffer))
|
(special-action (display-buffer--special-action buffer))
|
||||||
;; Extra actions from the arguments to this function:
|
;; Extra actions from the arguments to this function:
|
||||||
(extra-action
|
(extra-action
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ COPY . /checkout
|
||||||
WORKDIR /checkout
|
WORKDIR /checkout
|
||||||
RUN ./autogen.sh autoconf
|
RUN ./autogen.sh autoconf
|
||||||
RUN ./configure --with-ns
|
RUN ./configure --with-ns
|
||||||
RUN make bootstrap
|
RUN make V=1 bootstrap
|
||||||
|
|
||||||
FROM emacs-base as emacs-native-comp
|
FROM emacs-base as emacs-native-comp
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1284,6 +1284,7 @@ macro will assume it exists."
|
||||||
(let* ((tramp-remote-path (cons 'tramp-own-remote-path
|
(let* ((tramp-remote-path (cons 'tramp-own-remote-path
|
||||||
tramp-remote-path))
|
tramp-remote-path))
|
||||||
(tramp-histfile-override t)
|
(tramp-histfile-override t)
|
||||||
|
(tramp-allow-unsafe-temporary-files t)
|
||||||
(tramp-verbose 1)
|
(tramp-verbose 1)
|
||||||
(temporary-file-directory
|
(temporary-file-directory
|
||||||
(or (bound-and-true-p ert-remote-temporary-file-directory)
|
(or (bound-and-true-p ert-remote-temporary-file-directory)
|
||||||
|
|
|
||||||
|
|
@ -282,6 +282,7 @@ The whitespace before and including \"|\" on each line is removed."
|
||||||
(expand-file-name (format "ruby-mode-resources/%s" ,file))))))
|
(expand-file-name (format "ruby-mode-resources/%s" ,file))))))
|
||||||
|
|
||||||
(ert-deftest ruby-ts-imenu-index ()
|
(ert-deftest ruby-ts-imenu-index ()
|
||||||
|
(skip-unless (treesit-ready-p 'ruby t))
|
||||||
(ruby-ts-with-temp-buffer
|
(ruby-ts-with-temp-buffer
|
||||||
(ruby-ts-test-string
|
(ruby-ts-test-string
|
||||||
"module Foo
|
"module Foo
|
||||||
|
|
|
||||||
|
|
@ -532,19 +532,6 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
|
||||||
(should (subr-native-elisp-p
|
(should (subr-native-elisp-p
|
||||||
(symbol-function 'comp-test-48029-nonascii-žžž-f))))
|
(symbol-function 'comp-test-48029-nonascii-žžž-f))))
|
||||||
|
|
||||||
(comp-deftest 61917-1 ()
|
|
||||||
"Verify we can compile calls to redefined primitives with
|
|
||||||
dedicated byte-op code."
|
|
||||||
(let ((f (lambda (fn &rest args)
|
|
||||||
(apply fn args))))
|
|
||||||
(advice-add #'delete-region :around f)
|
|
||||||
(unwind-protect
|
|
||||||
(should (subr-native-elisp-p
|
|
||||||
(native-compile
|
|
||||||
'(lambda ()
|
|
||||||
(delete-region (point-min) (point-max))))))
|
|
||||||
(advice-remove #'delete-region f))))
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Tromey's tests. ;;
|
;; Tromey's tests. ;;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue