[Top][All Lists]

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

[elpa] externals/gpastel 184539c 2/9: Merge pull request #3 from clemera

From: Damien Cassou
Subject: [elpa] externals/gpastel 184539c 2/9: Merge pull request #3 from clemera/master
Date: Sat, 29 Dec 2018 09:09:13 -0500 (EST)

branch: externals/gpastel
commit 184539c5345135d2c3c23b0db3f78175bf163b4b
Merge: 6241ad0 c32e57f
Author: Damien Cassou <address@hidden>
Commit: GitHub <address@hidden>

    Merge pull request #3 from clemera/master
    Add `gpastel-update-hook`
 gpastel.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gpastel.el b/gpastel.el
index 97efd58..a2afb0a 100644
--- a/gpastel.el
+++ b/gpastel.el
@@ -57,6 +57,14 @@
   :type 'string
   :group 'gpastel)
+(defcustom gpastel-update-hook nil
+  "Hook which runs after gpastel added an element to `kill-ring'.
+Hook functions can retrieve the latest entry by accessing the
+`car' of `kill-ring'."
+  :type 'hook
+  :group 'gpastel)
 (defvar gpastel--dbus-object nil
   "D-Bus object remembering the return value of `dbus-register-signal'.
 This can be used to unregister from the signal.")
@@ -105,7 +113,8 @@ all text in the GPaste clipboard."
       ;; system clipboard with `interprogram-cut-function' to be
       ;; saved again to the `kill-ring':
       (unless (string= copied-text (car kill-ring))
-        (kill-new copied-text)))))
+        (kill-new copied-text)
+        (run-hooks 'gpastel-update-hook)))))
 (defun gpastel--start-gpaste-daemon ()
   "(Re)Start GPaste daemon and return non-nil upon success."

reply via email to

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