branch: master
commit 9dba3ce046f102af91153282002fb2ce20e37581
Author: Eric James Michael Ritz <[email protected]>
Commit: Eric James Michael Ritz <[email protected]>

    counsel.el (counsel-file-register): Fix typos and style errors
    
    The recent patch introducing `counsel-file-register' has a few typos
    and mistakes such as pointlessly repeated keywords.  This patch makes
    no changes to logic but fixes those types and removes duplicate
    keywords in `counsel-file-register'.  This patch also improves the
    docstring for `counsel-file-register` to mention how you *must* use
    `set-register' to create file registers.
    
    Signed-off-by: Eric James Michael Ritz <[email protected]>
---
 counsel.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/counsel.el b/counsel.el
index de8f7a4..75c3cc4 100644
--- a/counsel.el
+++ b/counsel.el
@@ -655,12 +655,17 @@ input corresponding to the chosen variable."
 
 ;;;###autoload
 (defun counsel-file-register ()
-  "Search file in register."
+  "Search file in register.
+
+You cannot use Emacs' normal register commands to create file
+registers.  Instead you must use the `set-register' function like
+so: `(set-register ?i \"/home/eric/.emacs.d/init.el\")'.  Now you
+can use `C-x r j i' to open that file."
   (interactive)
   (ivy-read "File Register: "
             ;; Use the `register-alist' variable to filter out file
             ;; registers.  Each entry for a file registar will have the
-            ;; following layout:initj
+            ;; following layout:
             ;;
             ;;     (NUMBER 'file . "string/path/to/file")
             ;;
@@ -676,9 +681,7 @@ input corresponding to the chosen variable."
             :history 'counsel-file-register
             :caller 'counsel-file-register
             :action (lambda (register-file)
-                      (with-ivy-window (find-file register-file)))
-            :history 'counsel-file-register
-            :caller 'counsel-file-register))
+                      (with-ivy-window (find-file register-file)))))
 
 (declare-function bookmark-all-names "bookmark")
 (declare-function bookmark-location "bookmark")

Reply via email to