mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-04 11:40:22 +00:00
Merge from origin/emacs-26
f64c277
(origin/emacs-26) Let bookmark-jump override window-point (Bu...1208aaa
Omit keymap from subword-mode docstring (Bug#32212)2b70b54
Prevent line-mode term from showing user passwords5de4441
Check for special filenames in eshell (Bug#30724)1b4b965
Fix indent-sexp of #s(...) (Bug#31984)59e8533
Add save-match-data to abbreviate-file-name (Bug#32201)47f75b1
Fix last change in editfns.c671dc5a
Fix calls to buffer modification hooks from replace-buffer-co...cc4ceed
; etc/NEWS: Remove unnecessary reference to a bug number.e0f33ea
Fix Bug#322267308fa0
Improve doc strings of several variables in keyboard.c
This commit is contained in:
commit
64f94785c7
1
etc/NEWS
1
etc/NEWS
@ -88,7 +88,6 @@ work right without some adjustment:
|
||||
** New variable 'xft-ignore-color-fonts'.
|
||||
Default t means don't try to load color fonts when using Xft, as they
|
||||
often cause crashes. Set it to nil if you really need those fonts.
|
||||
(Bug#30874)
|
||||
|
||||
---
|
||||
** The new option 'tooltip-resize-echo-area' avoids truncating tooltip text
|
||||
|
@ -1102,7 +1102,7 @@ BOOKMARK is usually a bookmark name (a string). It can also be a
|
||||
bookmark record, but this is usually only done by programmatic callers.
|
||||
|
||||
If DISPLAY-FUNC is non-nil, it is a function to invoke to display the
|
||||
bookmark. It defaults to `switch-to-buffer'. A typical value for
|
||||
bookmark. It defaults to `pop-to-buffer-same-window'. A typical value for
|
||||
DISPLAY-FUNC would be `switch-to-buffer-other-window'."
|
||||
(interactive
|
||||
(list (bookmark-completing-read "Jump to bookmark"
|
||||
@ -1110,7 +1110,7 @@ DISPLAY-FUNC would be `switch-to-buffer-other-window'."
|
||||
(unless bookmark
|
||||
(error "No bookmark specified"))
|
||||
(bookmark-maybe-historicize-string bookmark)
|
||||
(bookmark--jump-via bookmark (or display-func 'switch-to-buffer)))
|
||||
(bookmark--jump-via bookmark (or display-func 'pop-to-buffer-same-window)))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
|
@ -1195,8 +1195,14 @@ ENDPOS is encountered."
|
||||
(setq endpos (copy-marker
|
||||
(if endpos endpos
|
||||
;; Get error now if we don't have a complete sexp
|
||||
;; after point.
|
||||
(save-excursion (forward-sexp 1) (point)))))
|
||||
;; after point. We actually look for a sexp which
|
||||
;; ends after the current line so that we properly
|
||||
;; indent things like #s(...). This might not be
|
||||
;; needed if Bug#15998 is fixed.
|
||||
(let ((eol (line-end-position)))
|
||||
(save-excursion (while (and (< (point) eol) (not (eobp)))
|
||||
(forward-sexp 1))
|
||||
(point))))))
|
||||
(save-excursion
|
||||
(while (let ((indent (lisp-indent-calc-next parse-state))
|
||||
(ppss (lisp-indent-state-ppss parse-state)))
|
||||
|
@ -407,6 +407,7 @@ in the minibuffer:
|
||||
nil))))
|
||||
|
||||
(put 'eshell/cd 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/cd 'eshell-filename-arguments t)
|
||||
|
||||
(defun eshell-add-to-dir-ring (path)
|
||||
"Add PATH to the last-dir-ring, if applicable."
|
||||
@ -470,6 +471,7 @@ in the minibuffer:
|
||||
nil)
|
||||
|
||||
(put 'eshell/pushd 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/pushd 'eshell-filename-arguments t)
|
||||
|
||||
;;; popd [+n]
|
||||
(defun eshell/popd (&rest args)
|
||||
@ -500,6 +502,7 @@ in the minibuffer:
|
||||
nil)
|
||||
|
||||
(put 'eshell/popd 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/pop 'eshell-filename-arguments t)
|
||||
|
||||
(defun eshell/dirs (&optional if-verbose)
|
||||
"Implementation of dirs in Lisp."
|
||||
|
@ -334,6 +334,7 @@ instead."
|
||||
(apply 'eshell-do-ls args)))
|
||||
|
||||
(put 'eshell/ls 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/ls 'eshell-filename-arguments t)
|
||||
|
||||
(declare-function eshell-glob-regexp "em-glob" (pattern))
|
||||
|
||||
|
@ -307,6 +307,7 @@ Remove (unlink) the FILE(s).")
|
||||
nil))
|
||||
|
||||
(put 'eshell/rm 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/rm 'eshell-filename-arguments t)
|
||||
|
||||
(defun eshell/mkdir (&rest args)
|
||||
"Implementation of mkdir in Lisp."
|
||||
@ -324,6 +325,7 @@ Create the DIRECTORY(ies), if they do not already exist.")
|
||||
nil))
|
||||
|
||||
(put 'eshell/mkdir 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/mkdir 'eshell-filename-arguments t)
|
||||
|
||||
(defun eshell/rmdir (&rest args)
|
||||
"Implementation of rmdir in Lisp."
|
||||
@ -340,6 +342,7 @@ Remove the DIRECTORY(ies), if they are empty.")
|
||||
nil))
|
||||
|
||||
(put 'eshell/rmdir 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/rmdir 'eshell-filename-arguments t)
|
||||
|
||||
(defvar no-dereference)
|
||||
|
||||
@ -524,6 +527,7 @@ Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
|
||||
eshell-mv-overwrite-files))))
|
||||
|
||||
(put 'eshell/mv 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/mv 'eshell-filename-arguments t)
|
||||
|
||||
(defun eshell/cp (&rest args)
|
||||
"Implementation of cp in Lisp."
|
||||
@ -561,6 +565,7 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.")
|
||||
eshell-cp-overwrite-files preserve)))
|
||||
|
||||
(put 'eshell/cp 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/cp 'eshell-filename-arguments t)
|
||||
|
||||
(defun eshell/ln (&rest args)
|
||||
"Implementation of ln in Lisp."
|
||||
@ -593,6 +598,7 @@ with `--symbolic'. When creating hard links, each TARGET must exist.")
|
||||
eshell-ln-overwrite-files))))
|
||||
|
||||
(put 'eshell/ln 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/ln 'eshell-filename-arguments t)
|
||||
|
||||
(defun eshell/cat (&rest args)
|
||||
"Implementation of cat in Lisp.
|
||||
@ -645,6 +651,7 @@ Concatenate FILE(s), or standard input, to standard output.")
|
||||
(setq eshell-ensure-newline-p nil))))
|
||||
|
||||
(put 'eshell/cat 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/cat 'eshell-filename-arguments t)
|
||||
|
||||
;; special front-end functions for compilation-mode buffers
|
||||
|
||||
@ -927,6 +934,8 @@ Summarize disk usage of each FILE, recursively for directories.")
|
||||
(eshell-print (concat (eshell-du-size-string size)
|
||||
"total\n"))))))))
|
||||
|
||||
(put 'eshell/du 'eshell-filename-arguments t)
|
||||
|
||||
(defvar eshell-time-start nil)
|
||||
|
||||
(defun eshell-show-elapsed-time ()
|
||||
@ -1029,6 +1038,7 @@ Show wall-clock time elapsed during execution of COMMAND.")
|
||||
nil)
|
||||
|
||||
(put 'eshell/diff 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/diff 'eshell-filename-arguments t)
|
||||
|
||||
(defvar locate-history-list)
|
||||
|
||||
|
@ -1304,27 +1304,36 @@ messages, and errors."
|
||||
"Insert Lisp OBJECT, using ARGS if a function."
|
||||
(catch 'eshell-external ; deferred to an external command
|
||||
(let* ((eshell-ensure-newline-p (eshell-interactive-output-p))
|
||||
(result
|
||||
(if (functionp object)
|
||||
(progn
|
||||
(setq eshell-last-arguments args
|
||||
eshell-last-command-name
|
||||
(concat "#<function " (symbol-name object) ">"))
|
||||
;; if any of the arguments are flagged as numbers
|
||||
;; waiting for conversion, convert them now
|
||||
(unless (get object 'eshell-no-numeric-conversions)
|
||||
(while args
|
||||
(let ((arg (car args)))
|
||||
(if (and (stringp arg)
|
||||
(> (length arg) 0)
|
||||
(not (text-property-not-all
|
||||
0 (length arg) 'number t arg)))
|
||||
(setcar args (string-to-number arg))))
|
||||
(setq args (cdr args))))
|
||||
(eshell-apply object eshell-last-arguments))
|
||||
(setq eshell-last-arguments args
|
||||
eshell-last-command-name "#<Lisp object>")
|
||||
(eshell-eval object))))
|
||||
(result
|
||||
(if (functionp object)
|
||||
(progn
|
||||
(setq eshell-last-arguments args
|
||||
eshell-last-command-name
|
||||
(concat "#<function " (symbol-name object) ">"))
|
||||
(let ((numeric (not (get object
|
||||
'eshell-no-numeric-conversions)))
|
||||
(fname-args (get object 'eshell-filename-arguments)))
|
||||
(when (or numeric fname-args)
|
||||
(while args
|
||||
(let ((arg (car args)))
|
||||
(cond ((and numeric (stringp arg) (> (length arg) 0)
|
||||
(text-property-any 0 (length arg)
|
||||
'number t arg))
|
||||
;; If any of the arguments are
|
||||
;; flagged as numbers waiting for
|
||||
;; conversion, convert them now.
|
||||
(setcar args (string-to-number arg)))
|
||||
((and fname-args (stringp arg)
|
||||
(string-equal arg "~"))
|
||||
;; If any of the arguments match "~",
|
||||
;; prepend "./" to treat it as a
|
||||
;; regular file name.
|
||||
(setcar args (concat "./" arg)))))
|
||||
(setq args (cdr args)))))
|
||||
(eshell-apply object eshell-last-arguments))
|
||||
(setq eshell-last-arguments args
|
||||
eshell-last-command-name "#<Lisp object>")
|
||||
(eshell-eval object))))
|
||||
(if (and eshell-ensure-newline-p
|
||||
(save-excursion
|
||||
(goto-char eshell-last-output-end)
|
||||
|
@ -259,6 +259,7 @@ Adds the given PATH to $PATH.")
|
||||
(eshell-printn dir)))))
|
||||
|
||||
(put 'eshell/addpath 'eshell-no-numeric-conversions t)
|
||||
(put 'eshell/addpath 'eshell-filename-arguments t)
|
||||
|
||||
(defun eshell-script-interpreter (file)
|
||||
"Extract the script to run from FILE, if it has #!<interp> in it.
|
||||
|
@ -1954,7 +1954,7 @@ started Emacs, set `abbreviated-home-dir' to nil so it will be recalculated)."
|
||||
(save-match-data
|
||||
(string-match "^[a-zA-`]:/$" filename))))
|
||||
(equal (get 'abbreviated-home-dir 'home)
|
||||
(expand-file-name "~")))
|
||||
(save-match-data (expand-file-name "~"))))
|
||||
(setq filename
|
||||
(concat "~"
|
||||
(match-string 1 filename)
|
||||
|
@ -110,9 +110,7 @@ called a `subword'. Here are some examples:
|
||||
NSGraphicsContext => \"NS\", \"Graphics\" and \"Context\"
|
||||
|
||||
This mode changes the definition of a word so that word commands
|
||||
treat nomenclature boundaries as word boundaries.
|
||||
|
||||
\\{subword-mode-map}"
|
||||
treat nomenclature boundaries as word boundaries."
|
||||
:lighter " ,"
|
||||
(when subword-mode (superword-mode -1))
|
||||
(subword-setup-buffer))
|
||||
|
@ -231,12 +231,12 @@ information defining the cluster. For interactive use, call
|
||||
|
||||
(defun shadow-site-name (site)
|
||||
"Return name if SITE has the form \"/name:\", otherwise SITE."
|
||||
(if (string-match "\\`/\\(\\w+\\):\\'" site)
|
||||
(if (string-match "\\`/\\([-.[:word:]]+\\):\\'" site)
|
||||
(match-string 1 site) site))
|
||||
|
||||
(defun shadow-name-site (name)
|
||||
"Return \"/name:\" if NAME has word syntax, otherwise NAME."
|
||||
(if (string-match "\\`\\w+\\'" name)
|
||||
(if (string-match "\\`[-.[:word:]]+\\'" name)
|
||||
(format "/%s:"name) name))
|
||||
|
||||
(defun shadow-site-primary (site)
|
||||
|
19
lisp/term.el
19
lisp/term.el
@ -343,6 +343,7 @@
|
||||
(eval-when-compile (require 'cl-lib))
|
||||
(require 'ring)
|
||||
(require 'ehelp)
|
||||
(require 'comint) ; Password regexp.
|
||||
|
||||
(declare-function ring-empty-p "ring" (ring))
|
||||
(declare-function ring-ref "ring" (ring index))
|
||||
@ -2255,12 +2256,10 @@ applications."
|
||||
(defun term-send-invisible (str &optional proc)
|
||||
"Read a string without echoing.
|
||||
Then send it to the process running in the current buffer. A new-line
|
||||
is additionally sent. String is not saved on term input history list.
|
||||
Security bug: your string can still be temporarily recovered with
|
||||
\\[view-lossage]."
|
||||
is additionally sent. String is not saved on term input history list."
|
||||
(interactive "P") ; Defeat snooping via C-x esc
|
||||
(when (not (stringp str))
|
||||
(setq str (term-read-noecho "Non-echoed text: " t)))
|
||||
(setq str (read-passwd "Non-echoed text: ")))
|
||||
(when (not proc)
|
||||
(setq proc (get-buffer-process (current-buffer))))
|
||||
(if (not proc) (error "Current buffer has no process")
|
||||
@ -2269,6 +2268,16 @@ Security bug: your string can still be temporarily recovered with
|
||||
(term-send-string proc str)
|
||||
(term-send-string proc "\n")))
|
||||
|
||||
;; TODO: Maybe combine this with `comint-watch-for-password-prompt'.
|
||||
(defun term-watch-for-password-prompt (string)
|
||||
"Prompt in the minibuffer for password and send without echoing.
|
||||
Checks if STRING contains a password prompt as defined by
|
||||
`comint-password-prompt-regexp'."
|
||||
(when (term-in-line-mode)
|
||||
(when (let ((case-fold-search t))
|
||||
(string-match comint-password-prompt-regexp string))
|
||||
(term-send-invisible (read-passwd string)))))
|
||||
|
||||
|
||||
;;; Low-level process communication
|
||||
|
||||
@ -3054,6 +3063,8 @@ See `term-prompt-regexp'."
|
||||
(term-handle-deferred-scroll))
|
||||
|
||||
(set-marker (process-mark proc) (point))
|
||||
(when (stringp decoded-substring)
|
||||
(term-watch-for-password-prompt decoded-substring))
|
||||
(when save-point
|
||||
(goto-char save-point)
|
||||
(set-marker save-point nil))
|
||||
|
@ -3267,7 +3267,7 @@ differences between the two buffers. */)
|
||||
from = BEGV + k;
|
||||
|
||||
/* Find the last character position to be changed. */
|
||||
for (l = size_a; l > 0 && !bit_is_set (ctx.deletions, l - 1); l--)
|
||||
for (l = size_a; l > k && !bit_is_set (ctx.deletions, l - 1); l--)
|
||||
;
|
||||
to = BEGV + l;
|
||||
prepare_to_modify_buffer (from, to, NULL);
|
||||
|
@ -11820,10 +11820,10 @@ if the command is in this list, the selection is not updated. */);
|
||||
|
||||
DEFVAR_LISP ("debug-on-event",
|
||||
Vdebug_on_event,
|
||||
doc: /* Enter debugger on this event. When Emacs
|
||||
receives the special event specified by this variable, it will try to
|
||||
break into the debugger as soon as possible instead of processing the
|
||||
event normally through `special-event-map'.
|
||||
doc: /* Enter debugger on this event.
|
||||
When Emacs receives the special event specified by this variable,
|
||||
it will try to break into the debugger as soon as possible instead
|
||||
of processing the event normally through `special-event-map'.
|
||||
|
||||
Currently, the only supported values for this
|
||||
variable are `sigusr1' and `sigusr2'. */);
|
||||
@ -11831,21 +11831,23 @@ variable are `sigusr1' and `sigusr2'. */);
|
||||
|
||||
DEFVAR_BOOL ("attempt-stack-overflow-recovery",
|
||||
attempt_stack_overflow_recovery,
|
||||
doc: /* If non-nil, attempt to recover from C stack
|
||||
overflow. This recovery is unsafe and may lead to deadlocks or data
|
||||
doc: /* If non-nil, attempt to recover from C stack overflows.
|
||||
This recovery is potentially unsafe and may lead to deadlocks or data
|
||||
corruption, but it usually works and may preserve modified buffers
|
||||
that would otherwise be lost. If nil, treat stack overflow like any
|
||||
other kind of crash. */);
|
||||
other kind of crash or fatal error. */);
|
||||
attempt_stack_overflow_recovery = true;
|
||||
|
||||
DEFVAR_BOOL ("attempt-orderly-shutdown-on-fatal-signal",
|
||||
attempt_orderly_shutdown_on_fatal_signal,
|
||||
doc: /* If non-nil, attempt to perform an orderly
|
||||
shutdown when Emacs receives a fatal signal (e.g., a crash).
|
||||
This cleanup is unsafe and may lead to deadlocks or data corruption,
|
||||
but it usually works and may preserve modified buffers that would
|
||||
otherwise be lost. If nil, crash immediately in response to fatal
|
||||
signals. */);
|
||||
doc: /* If non-nil, attempt orderly shutdown on fatal signals.
|
||||
By default this variable is non-nil, and Emacs attempts to perform
|
||||
an orderly shutdown when it catches a fatal signal (e.g., a crash).
|
||||
The orderly shutdown includes an attempt to auto-save your unsaved edits
|
||||
and other useful cleanups. These cleanups are potentially unsafe and may
|
||||
lead to deadlocks or data corruption, but it usually works and may
|
||||
preserve data in modified buffers that would otherwise be lost.
|
||||
If nil, Emacs crashes immediately in response to fatal signals. */);
|
||||
attempt_orderly_shutdown_on_fatal_signal = true;
|
||||
|
||||
/* Create the initial keyboard. Qt means 'unset'. */
|
||||
|
@ -113,6 +113,18 @@ noindent\" 3
|
||||
;; we're indenting ends on the previous line.
|
||||
(should (equal (buffer-string) original)))))
|
||||
|
||||
(ert-deftest indent-sexp-go ()
|
||||
"Make sure `indent-sexp' doesn't stop after #s."
|
||||
;; See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31984.
|
||||
(with-temp-buffer
|
||||
(emacs-lisp-mode)
|
||||
(insert "#s(foo\nbar)\n")
|
||||
(goto-char (point-min))
|
||||
(indent-sexp)
|
||||
(should (equal (buffer-string) "\
|
||||
#s(foo
|
||||
bar)\n"))))
|
||||
|
||||
(ert-deftest lisp-indent-region ()
|
||||
"Test basics of `lisp-indent-region'."
|
||||
(with-temp-buffer
|
||||
|
@ -556,6 +556,8 @@ guaranteed by the originator of a cluster definition."
|
||||
|
||||
(ert-deftest shadow-test06-literal-groups ()
|
||||
"Check literal group definitions."
|
||||
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
|
||||
|
||||
(let ((shadow-info-file shadow-test-info-file)
|
||||
(shadow-todo-file shadow-test-todo-file)
|
||||
shadow-clusters shadow-literal-groups
|
||||
@ -618,6 +620,8 @@ guaranteed by the originator of a cluster definition."
|
||||
|
||||
(ert-deftest shadow-test07-regexp-groups ()
|
||||
"Check regexp group definitions."
|
||||
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
|
||||
|
||||
(let ((shadow-info-file shadow-test-info-file)
|
||||
(shadow-todo-file shadow-test-todo-file)
|
||||
shadow-clusters shadow-regexp-groups
|
||||
@ -682,6 +686,8 @@ guaranteed by the originator of a cluster definition."
|
||||
|
||||
(ert-deftest shadow-test08-shadow-todo ()
|
||||
"Check that needed shadows are added to todo."
|
||||
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
|
||||
|
||||
(let ((backup-inhibited t)
|
||||
(shadow-info-file shadow-test-info-file)
|
||||
(shadow-todo-file shadow-test-todo-file)
|
||||
@ -780,6 +786,8 @@ guaranteed by the originator of a cluster definition."
|
||||
|
||||
(ert-deftest shadow-test09-shadow-copy-files ()
|
||||
"Check that needed shadow files are copied."
|
||||
(skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
|
||||
|
||||
(let ((backup-inhibited t)
|
||||
(shadow-info-file shadow-test-info-file)
|
||||
(shadow-todo-file shadow-test-todo-file)
|
||||
|
Loading…
Reference in New Issue
Block a user