Replies: 2 comments 2 replies
-
Sorting by recency is currently not supported. I wonder if Emacs register write and read (!) commands should reorder the list, which would make such an LRU listing more useful. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I wrote a function to auto name (e.g. ABCABCA...) registers and list them by updating time: (defvar my/register/point-name ?A)
(defun my/register ()
(interactive)
(if (use-region-p)
(call-interactively 'consult-register-store)
(if (>= my/register/point-name (+ ?A 15))
(setq my/register/point-name ?A))
(assq-delete-all my/register/point-name register-alist)
(point-to-register my/register/point-name)
(message (format "Register %c" my/register/point-name))
(cl-incf my/register/point-name)))
(defun consult-register--alist (&optional noerror filter)
"Return register list, sorted and filtered with FILTER.
Raise an error if the list is empty and NOERROR is nil."
(or (cl-loop for reg in register-alist
;; Sometimes, registers are made without a `cdr' or with
;; invalid markers. Such registers don't do anything, and
;; can be ignored.
if (and (cdr reg)
(or (not (markerp (cdr reg))) (marker-buffer (cdr reg)))
(or (not filter) (funcall filter reg)))
collect reg)
(and (not noerror) (user-error "All registers are empty")))) but without |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
By default ,they are sorted by alphanumeric, while in
*Register Preview*
they're sorted by updating time.Context:
Beta Was this translation helpful? Give feedback.
All reactions