Subject: bug#73308: [PATCH] Add file-to-register and buffer-to-register.

From: Barra Ó Catháin <[email-masked]>
Date: Wed, 18 Sep 2024 03:26:58 +0100

Thanks, Thierry. I'll look into how point-to-register does things and
see if I can improve things alongside. 

Thanks for your time!
-----
Barra

Thierry Volpiatto <[email-masked]> writes:

> One comment about buffer-to-register:
>
> More or less you can have the same with point-to-register, the advantage
> is that when you kill the buffer, the register-alist entry is turned in
> a file-query entry (when buffer is representing a file of course), for
> example from register.el buffer:
>
> C-x r <SPC> RET
>
> register-alist entry:
> (115 . #<marker at 27354 in register.el>)
>
> Now kill the the buffer, the register-alist entry is turned in:
> (115 file-query "/home/thierry/work/emacs/lisp/register.el" 27354)
>
> This is why I guess such functions where never added to register.el.
>
> OTOH they provide an alternative which is easier to find as most users
> don't know about this feature (buffer => file-qurey).
>
> BTW I suggest you use for buffer-to-register an entry something like
> (buffer-name . marker), this way register-swap-out will be able
> to transform it like point-to-register does. Need also to add a add-hook
> call like point-to-register does.