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

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

[nongnu] elpa/sesman b16ba94386 097/100: Make sesman-unlink to take opti


From: ELPA Syncer
Subject: [nongnu] elpa/sesman b16ba94386 097/100: Make sesman-unlink to take optional LINKS argument (#22)
Date: Tue, 28 Dec 2021 14:06:06 -0500 (EST)

branch: elpa/sesman
commit b16ba94386cc1e1524224487ab0871c0c32aeb17
Author: Mark Dawson <markgdawson@gmail.com>
Commit: Vitalie Spinu <spinuvit@gmail.com>

    Make sesman-unlink to take optional LINKS argument (#22)
    
    Co-authored-by: Mark Dawson <mark.dawson@polecat.com>
---
 sesman.el | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/sesman.el b/sesman.el
index e0a16b372e..df5deca7ac 100644
--- a/sesman.el
+++ b/sesman.el
@@ -463,14 +463,18 @@ buffer."
   (sesman--link-session-interactively session nil nil))
 
 ;;;###autoload
-(defun sesman-unlink ()
-  "Break any of the previously created links."
+(defun sesman-unlink (&optional links)
+  "Break any of the previously created links or break LINKS if non-nil.
+
+Break all links with prefix argument."
   (interactive)
-  (let* ((system (sesman--system))
-         (links (or (sesman-current-links system)
-                    (user-error "No %s links found" system))))
-    (mapc #'sesman--unlink
-          (sesman--ask-for-link "Unlink: " links 'ask-all)))
+  (mapc #'sesman--unlink (or (when current-prefix-arg
+                               (sesman-current-links (sesman--system)))
+                             links
+                             (sesman--ask-for-link "Unlink: "
+                                                   (or (sesman-current-links 
(sesman--system))
+                                                       (user-error "No %s 
links found" (sesman--system)))
+                                                   'ask-all)))
   (run-hooks 'sesman-post-command-hook))
 
 (declare-function sesman-browser "sesman-browser")



reply via email to

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