Skip to content

Instantly share code, notes, and snippets.

@yveszoundi
Last active January 17, 2016 16:32
Show Gist options
  • Save yveszoundi/4ed6e60b4294472edd50 to your computer and use it in GitHub Desktop.
Save yveszoundi/4ed6e60b4294472edd50 to your computer and use it in GitHub Desktop.
ELISP-Jump easily to a file register using completing-read (default, IDO or Helm)
(defun jump-to-file-register ()
"Jump to a file register using completing-read"
(interactive)
(let* ((reg-list (cl-loop for ptr-reg in register-alist
when (eq 'file (first (last ptr-reg)))
collect (concat (char-to-string (car ptr-reg)) "|" (cdr (last ptr-reg)))))
(reg-data (completing-read "Pick file register: " reg-list))
(reg-location (string-to-char (car (split-string reg-data "|")))))
(jump-to-register reg-location)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment