1

Upon reading GNU Emacs Manual #rectangle register

When you are collecting text using append-to-register and prepend-to-register, you may want to separate individual collected pieces using a separator. In that case, configure a register-separator and store the separator text in to that register. For example, to get double newlines as text separator during the collection process, you can use the following setting.

   (setq register-separator ?+)
   (set-register register-separator "\n\n")

I assumed that only the first line is enough as

(setq register-separator "\n]n")

What does ?+ mean? and the extra (set-register register-separator "\n\n")

1

C-h v register-separator says this:

register-separator is a variable defined in register.el.

Its value is nil

Documentation:

Register containing the text to put between collected texts, or nil if none.

When collecting text with C-M-S-delete (or M-x prepend-to-register), contents of this register is added to the beginning (or end, respectively) of the marked text.

You can customize this variable.

A register is a character (which is a positive integer). ?+ is the notation for the character + (which in a string would be "+").

The parent node (Registers) of the manual page you cite tells you what registers are.

The variable's doc says that the variable's value is a register, that is, a character. Your code sets it to a string instead.

The manual example code (set-register register-separator "\n\n") sets the register that is the value of variable register-separator to have the string value "\n\n".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.