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

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

[elpa] master 302d4b4 28/62: Added convenience method for adding populat


From: Ian Dunn
Subject: [elpa] master 302d4b4 28/62: Added convenience method for adding population commands
Date: Sat, 9 Dec 2017 14:34:00 -0500 (EST)

branch: master
commit 302d4b40e98025801a986270a080ed8279189053
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>

    Added convenience method for adding population commands
    
    * paced.el (paced-dictionary-add-population-command): New defmethod.
      (paced-add-buffer-file-to-dictionary): Use it.
---
 paced.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/paced.el b/paced.el
index ec997fb..6a85734 100644
--- a/paced.el
+++ b/paced.el
@@ -910,6 +910,11 @@ non-nil, confirmation will be requested before continuing."
               (y-or-n-p "Warning: Repopulating dictionary will reset it.  
Continue?"))
       (paced-dictionary-repopulate dict))))
 
+(cl-defmethod paced-dictionary-add-population-command ((dict paced-dictionary)
+                                                       (cmd 
paced-population-command))
+  "Add population command CMD to dictionary DICT."
+  (cl-pushnew cmd (oref dict population-commands) :test 'equal))
+
 (defun paced-add-buffer-file-to-dictionary (&optional buffer)
   "Populate the dictionary of BUFFER with BUFFER.
 
@@ -928,7 +933,7 @@ must be set with `paced-edit-named-dictionary' or
               (cmd (paced-file-population-command :file file-name)))
         (progn
           (paced-dictionary-populate-from-buffer dict buffer)
-          (cl-pushnew cmd (oref dict population-commands) :test 'equal))
+          (paced-dictionary-add-population-command dict cmd))
       (user-error "No dictionary found for current buffer"))))
 
 



reply via email to

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