[Top][All Lists]

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

master a13d1f9 3/3: Merge from origin/emacs-27

From: Glenn Morris
Subject: master a13d1f9 3/3: Merge from origin/emacs-27
Date: Thu, 13 Feb 2020 10:55:25 -0500 (EST)

branch: master
commit a13d1f953980b516470d03ab23250760c581c05b
Merge: 70d62e0 0304f53
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    Merge from origin/emacs-27
    0304f53076 (origin/emacs-27) doc/misc/org.texi: Fix @dircategory
    027da652a4 Fix display of minibuffer prompt in ido.el
    5a21aaff46 rx: Use longest match for all-string 'or' forms (bug#37659)
    2b12c2b6f2 Make sure not to mark directories
    ff4ed4a0ff ; Add a TODO
    3a5129a1c9 vc-hg-dir-status-files: Fix when DIR is not repository root
    # Conflicts:
    #   etc/NEWS
 doc/lispref/display.texi         |  9 ++++++---
 doc/lispref/searching.texi       |  5 ++++-
 doc/lispref/text.texi            | 10 ++++++++++
 doc/misc/org.texi                |  2 +-
 etc/NEWS.27                      |  6 ++++++
 lisp/emacs-lisp/rx.el            |  2 +-
 lisp/ido.el                      | 19 +++++++------------
 lisp/minibuffer.el               | 18 ++++++++++++++++--
 lisp/vc/vc-dir.el                |  5 +++--
 lisp/vc/vc-hg.el                 | 15 +++++++++------
 test/lisp/emacs-lisp/rx-tests.el |  2 +-
 11 files changed, 64 insertions(+), 29 deletions(-)

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index e4980fe..2b25d60 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -319,7 +319,10 @@ the echo area.  See also @code{clear-message-function} 
that can be
 used to clear the message displayed by this function.
 The default value is the function that displays the message at the end
-of the minibuffer when the minibuffer is active.
+of the minibuffer when the minibuffer is active.  However, if the text
+shown in the active minibuffer has the @code{minibuffer-message} text
+property (@pxref{Special Properties}) on some character, the message
+will be displayed before the first character having that property.
 @end defvar
 @defvar clear-message-function
@@ -332,8 +335,8 @@ after displaying an echo-area message.  The function is 
expected to
 clear the message displayed by its counterpart function specified by
-The default value is the function that clears the message displayed at
-the end of the minibuffer when the minibuffer is active.
+The default value is the function that clears the message displayed in
+an active minibuffer.
 @end defvar
 @defvar inhibit-message
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 3d7ea93..5f4509a 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -1080,7 +1080,10 @@ Corresponding string regexp: @samp{@var{A}@var{B}@dots{}}
 @cindex @code{or} in rx
 @itemx @code{(| @var{rx}@dots{})}
 @cindex @code{|} in rx
-Match exactly one of the @var{rx}s, trying from left to right.
+Match exactly one of the @var{rx}s.
+If all arguments are string literals, the longest possible match
+will always be used.  Otherwise, either the longest match or the
+first (in left-to-right order) will be used.
 Without arguments, the expression will not match anything at all.@*
 Corresponding string regexp: @samp{@var{A}\|@var{B}\|@dots{}}.
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 527057e..f027cdf 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -3741,6 +3741,16 @@ single glyph composed from components.  But the value of 
the property
 itself is completely internal to Emacs and should not be manipulated
 directly by, for instance, @code{put-text-property}.
+@item minibuffer-message
+@kindex minibuffer-message @r{(text property)}
+This text property tells where to display temporary messages in an
+active minibuffer.  Specifically, the first character of the
+minibuffer text which has this property will have the temporary
+message displayed before it.  The default is to display temporary
+messages at the end of the minibuffer text.  This text property is
+used by the function that is the default value of
+@code{set-message-function} (@pxref{Displaying Messages}).
 @end table
 @defvar inhibit-point-motion-hooks
diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index 8979796..495d562 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -31,7 +31,7 @@ modify this GNU manual.''
 @end quotation
 @end copying
-@dircategory Emacs
+@dircategory Emacs editing modes
 * Org Mode: (org).      Outline-based notes management and organizer.
 @end direntry
diff --git a/etc/NEWS.27 b/etc/NEWS.27
index 54a71c9..312869f 100644
--- a/etc/NEWS.27
+++ b/etc/NEWS.27
@@ -3591,6 +3591,12 @@ Setting this on the first character of a help string 
 conversions via 'substitute-command-keys'.
+** New text property 'minibuffer-message'.
+Setting this on a character of the minibuffer text will display the
+temporary echo messages before that character, when messages need to
+be displayed while minibuffer is active.
 ** 'undo' can be made to ignore the active region for a command
 by setting 'undo-inhibit-region' symbol property of that command to
 non-nil.  This is used by 'mouse-drag-region' to make the effect
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 03af053..b4cab57 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -290,7 +290,7 @@ Return (REGEXP . PRECEDENCE)."
    ((null (cdr body))              ; Single item.
     (rx--translate (car body)))
    ((rx--every #'stringp body)     ; All strings.
-    (cons (list (regexp-opt body nil t))
+    (cons (list (regexp-opt body nil))
    ((rx--every #'rx--charset-p body)  ; All charsets.
     (rx--translate-union nil body))
diff --git a/lisp/ido.el b/lisp/ido.el
index 6707d81..7198649 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -4492,8 +4492,6 @@ For details of keybindings, see `ido-find-file'."
       (throw 'ido contents))))
-(defvar ido--overlay nil)
 (defun ido-exhibit ()
   "Post command hook for Ido."
   ;; Find matching files and display a list in the minibuffer.
@@ -4728,16 +4726,13 @@ For details of keybindings, see `ido-find-file'."
        (let ((inf (ido-completions contents)))
          (setq ido-show-confirm-message nil)
          (ido-trace "inf" inf)
-          (when ido--overlay
-            (delete-overlay ido--overlay))
-          (let ((o (make-overlay (point-max) (point-max) nil t t)))
-            (when (> (length inf) 0)
-              ;; For hacks that redefine ido-completions function (bug#39379)
-              (when (eq (aref inf 0) ?\n)
-                (setq inf (concat " " inf)))
-              (put-text-property 0 1 'cursor t inf))
-            (overlay-put o 'after-string inf)
-            (setq ido--overlay o)))
+          (let ((pos (point)))
+            (insert inf)
+            (if (< pos (point-max))
+                ;; Tell set-minibuffer-message where to display the
+                ;; overlay with temporary messages.
+                (put-text-property pos (1+ pos) 'minibuffer-message t)))
+          )
 (defun ido-completions (name)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 0589211..49daabc 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -763,8 +763,21 @@ and `clear-minibuffer-message' called automatically via
 (defvar minibuffer-message-timer nil)
 (defvar minibuffer-message-overlay nil)
+(defun minibuffer--message-overlay-pos ()
+  "Return position where `set-minibuffer-message' shall put message overlay."
+  ;; Starting from point, look for non-nil 'minibuffer-message'
+  ;; property, and return its position.  If none found, return the EOB
+  ;; position.
+  (let* ((pt (point))
+         (propval (get-text-property pt 'minibuffer-message)))
+    (if propval pt
+      (next-single-property-change pt 'minibuffer-message nil (point-max)))))
 (defun set-minibuffer-message (message)
   "Temporarily display MESSAGE at the end of the minibuffer.
+If some part of the minibuffer text has the `minibuffer-message' property,
+the message will be displayed before the first such character, instead of
+at the end of the minibuffer.
 The text is displayed for `minibuffer-message-clear-timeout' seconds
 \(if the value is a number), or until the next input event arrives,
 whichever comes first.
@@ -784,8 +797,9 @@ via `set-message-function'."
-      (setq minibuffer-message-overlay
-            (make-overlay (point-max) (point-max) nil t t))
+      (let ((ovpos (minibuffer--message-overlay-pos)))
+        (setq minibuffer-message-overlay
+              (make-overlay ovpos ovpos nil t t)))
       (unless (zerop (length message))
         ;; The current C cursor code doesn't know to use the overlay's
         ;; marker's stickiness to figure out whether to place the cursor
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 0c29352..033cb27 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -649,7 +649,7 @@ line."
 (defun vc-dir-mark-all-files (arg)
   "Mark all files with the same state as the current one.
-With a prefix argument mark all files.
+With a prefix argument mark all files (not directories).
 If the current entry is a directory, mark all child files.
 The commands operate on files that are on the same state.
@@ -670,7 +670,8 @@ share the same state."
         (lambda (filearg)
-          (unless (vc-dir-fileinfo->marked filearg)
+          (unless (or (vc-dir-fileinfo->directory filearg)
+                       (vc-dir-fileinfo->marked filearg))
             (setf (vc-dir-fileinfo->marked filearg) t)
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index eac9a6f..40d7573 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -1352,14 +1352,17 @@ REV is the revision to check out into WORKFILE."
 ;; Follows vc-exec-after.
 (declare-function vc-set-async-update "vc-dispatcher" (process-buffer))
-(defun vc-hg-dir-status-files (_dir files update-function)
+(defun vc-hg-dir-status-files (dir files update-function)
   ;; XXX: We can't pass DIR directly to 'hg status' because that
   ;; returns all ignored files if FILES is non-nil (bug#22481).
-  ;; If honoring DIR ever becomes important, try using '-I DIR/'.
-  (vc-hg-command (current-buffer) 'async files
-                 "status"
-                 (concat "-mardu" (if files "i"))
-                 "-C")
+  (let ((default-directory dir))
+    ;; TODO: Use "--config 'status.relative=1'" instead of "re:"
+    ;; when we're allowed to depend on Mercurial 4.2+
+    ;; (it's a bit faster).
+    (vc-hg-command (current-buffer) 'async files
+                   "status" "re:" "-I" "."
+                   (concat "-mardu" (if files "i"))
+                   "-C"))
     (vc-hg-after-dir-status update-function)))
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index e19e626..a6c172a 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -43,7 +43,7 @@
   (should (equal (rx (or "ab" (| "c" nonl) "de"))
   (should (equal (rx (or "ab" "abc" "a"))
-                 "\\(?:ab\\|abc\\|a\\)"))
+                 "\\(?:a\\(?:bc?\\)?\\)"))
   (should (equal (rx (| nonl "a") (| "b" blank))
   (should (equal (rx (|))

reply via email to

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