Emacs: Append to Register 1 ðŸ’
This command lets you append text to register 1.
To paste the collected text,
Alt+x
insert-register
put this in your Emacs Init File:
(defun xah-append-to-register-1 () "Append current line or selection to register 1. When no selection, append current line, with newline char. See also: `xah-copy-to-register-1' `xah-append-to-register-1' `xah-paste-from-register-1' `xah-clear-register-1' URL `http://xahlee.info/emacs/emacs/emacs_copy_append.html' Version: 2015-12-08 2020-09-08 2023-04-07" (interactive) (let (xp1 xp2) (if (region-active-p) (setq xp1 (region-beginning) xp2 (region-end)) (setq xp1 (line-beginning-position) xp2 (line-end-position))) (append-to-register ?1 xp1 xp2) (with-temp-buffer (insert "\n") (append-to-register ?1 (point-min) (point-max))) (message "Appended to register 1: [%s]." (buffer-substring-no-properties xp1 xp2))))
This command need to have a easy key to be useful. 〔see Emacs Keys: Define Key〕