emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/objed c0c6337 109/166: Improve mark-more command


From: Clemens Radermacher
Subject: [elpa] externals/objed c0c6337 109/166: Improve mark-more command
Date: Sun, 29 Dec 2019 08:21:10 -0500 (EST)

branch: externals/objed
commit c0c63379142cb574068e6163b183623bbdc0d268
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Improve mark-more command
---
 objed.el | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/objed.el b/objed.el
index 5bb2d9a..0a3ce37 100644
--- a/objed.el
+++ b/objed.el
@@ -1087,8 +1087,10 @@ Use `objed-define-dispatch' to define a dispatch 
command.")
                (goto-char (point-min))))
         ;; objed-mark-object
         (let ((n (objed--do-all 'objed--mark-object)))
-          (prog1 (and (> n 1) n)
-            (message "Marked %s %ss in %s." n objed--object name)))))))
+          (if (> n 1)
+              n
+            (prog1 nil
+              (objed-unmark-all))))))))
 
 (defun objed--ace-switch-object (name)
   "Switch to objed NAME using avy."
@@ -2450,10 +2452,20 @@ previous objects."
 First try to mark more in current defun after that mark more in
 current buffer."
   (interactive)
-  (cond ((eq last-command this-command)
-         (objed--mark-all-inside 'buffer))
-        (t
-         (objed--mark-all-inside 'defun))))
+  (let* ((n nil)
+         (msg (cond ((and (eq last-command this-command)
+                          (setq n (objed--mark-all-inside 'buffer)))
+                     (format "Marked %s %ss in %s." n objed--object 'buffer))
+                    ((setq n (objed--mark-all-inside 'defun))
+                     (format "Marked %s %ss in %s." n objed--object 'defun))
+                    ((setq n (objed--mark-all-inside 'buffer))
+                     (format "Marked %s %ss in %s." n objed--object 'buffer))
+                    (t
+                     "No other objects to mark."))))
+    ;; wait for redisplay
+    (run-at-time 0.1 nil
+                 #'message msg)))
+
 
 (defun objed-last ()
   "Resume to last state.
@@ -2609,7 +2621,8 @@ state is only restored correctly if the buffer was not 
modified."
           (when ovps
             (objed--mark-ovps ovps))))
     (prog1 nil
-      (when (called-interactively-p 'any)
+      (when (and (called-interactively-p 'any)
+                 (eq real-this-command 'objed-last))
         (message "No previous state to restore.")))))
 
 



reply via email to

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