emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 64f9478: Merge from origin/emacs-26


From: Glenn Morris
Subject: [Emacs-diffs] master 64f9478: Merge from origin/emacs-26
Date: Tue, 24 Jul 2018 09:44:41 -0400 (EDT)

branch: master
commit 64f94785c7ef76de160649054ec970f62af49472
Merge: 8c6a502 f64c277
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    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 passwords
    5de4441 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.c
    671dc5a Fix calls to buffer modification hooks from replace-buffer-co...
    cc4ceed ; etc/NEWS: Remove unnecessary reference to a bug number.
    e0f33ea Fix Bug#32226
    7308fa0 Improve doc strings of several variables in keyboard.c
---
 etc/NEWS                                |  1 -
 lisp/bookmark.el                        |  4 +--
 lisp/emacs-lisp/lisp-mode.el            | 10 +++++--
 lisp/eshell/em-dirs.el                  |  3 ++
 lisp/eshell/em-ls.el                    |  1 +
 lisp/eshell/em-unix.el                  | 10 +++++++
 lisp/eshell/esh-cmd.el                  | 51 +++++++++++++++++++--------------
 lisp/eshell/esh-ext.el                  |  1 +
 lisp/files.el                           |  2 +-
 lisp/progmodes/subword.el               |  4 +--
 lisp/shadowfile.el                      |  4 +--
 lisp/term.el                            | 19 +++++++++---
 src/editfns.c                           |  2 +-
 src/keyboard.c                          | 28 +++++++++---------
 test/lisp/emacs-lisp/lisp-mode-tests.el | 12 ++++++++
 test/lisp/shadowfile-tests.el           |  8 ++++++
 16 files changed, 110 insertions(+), 50 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index fc2a5d4..83110a2 100644
--- a/etc/NEWS
+++ b/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
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 78f3e32..ea7fcb1 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -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
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 4e5b1a7..25b61a2 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -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)))
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index ec380e6..5180a07 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -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."
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index 900b289..2b568a9 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -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))
 
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index a18fb85..c912c15 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -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)
 
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 61c0ebc..92cac61 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -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)
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el
index ba5182d..244cc7f 100644
--- a/lisp/eshell/esh-ext.el
+++ b/lisp/eshell/esh-ext.el
@@ -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.
diff --git a/lisp/files.el b/lisp/files.el
index 468650d..6e4f6ca 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -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)
diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el
index ed71b86..685e171 100644
--- a/lisp/progmodes/subword.el
+++ b/lisp/progmodes/subword.el
@@ -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))
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el
index e1a9b8e..27d934d 100644
--- a/lisp/shadowfile.el
+++ b/lisp/shadowfile.el
@@ -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)
diff --git a/lisp/term.el b/lisp/term.el
index 121a22e..e90ff45 100644
--- a/lisp/term.el
+++ b/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))
diff --git a/src/editfns.c b/src/editfns.c
index 09f836c..1d6040d 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -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);
diff --git a/src/keyboard.c b/src/keyboard.c
index 01d7ce9..7ab9a60 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -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'.  */
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el 
b/test/lisp/emacs-lisp/lisp-mode-tests.el
index 8598d41..0b052e9 100644
--- a/test/lisp/emacs-lisp/lisp-mode-tests.el
+++ b/test/lisp/emacs-lisp/lisp-mode-tests.el
@@ -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
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index 5ded944..200fb4c 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]