guix-commits
[Top][All Lists]
Advanced

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

06/24: emacs: Add utils to copy guix command.


From: Alex Kost
Subject: 06/24: emacs: Add utils to copy guix command.
Date: Fri, 28 Aug 2015 20:06:32 +0000

alezost pushed a commit to branch wip-emacs-popup-ui
in repository guix.

commit 49772eea027aa0c030e8ff93e70eddef4d138012
Author: Alex Kost <address@hidden>
Date:   Sun Aug 16 11:11:37 2015 +0300

    emacs: Add utils to copy guix command.
    
    * emacs/guix-utils.el (guix-copy-as-kill, guix-copy-command-as-kill):
      New functions.
---
 emacs/guix-utils.el |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/emacs/guix-utils.el b/emacs/guix-utils.el
index dfcab4d..700eeec 100644
--- a/emacs/guix-utils.el
+++ b/emacs/guix-utils.el
@@ -152,6 +152,18 @@ add both to the end and to the beginning."
   "Return 'guix ARGS ...' string."
   (guix-concat-strings (cons "guix" args) " "))
 
+(defun guix-copy-as-kill (string &optional no-message?)
+  "Put STRING into `kill-ring'.
+If NO-MESSAGE? is non-nil, do not display a message about it."
+  (kill-new string)
+  (unless no-message?
+    (message "'%s' has been added to kill ring." string)))
+
+(defun guix-copy-command-as-kill (args &optional no-message?)
+  "Put 'guix ARGS ...' string into `kill-ring'.
+See also `guix-copy-as-kill'."
+  (guix-copy-as-kill (guix-command-string args) no-message?))
+
 (defun guix-completing-read-multiple (prompt table &optional predicate
                                       require-match initial-input
                                       hist def inherit-input-method)



reply via email to

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