unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67752: [PATCH] Fix (setopt register-separator "\n") non-matching type warning
@ 2023-12-10 17:37 gerard.vermeulen
  2023-12-16 12:06 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: gerard.vermeulen @ 2023-12-10 17:37 UTC (permalink / raw)
  To: 67752

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

Hi,

attached patch fixes "(setopt register-separator "\n") non-matching
type warnings" and makes the register-separator documentation
less confusing to me.

Regards -- Gerard

[-- Attachment #2: 0001-Fix-setopt-register-separator-n-non-matching-type-wa.patch --]
[-- Type: application/octet-stream, Size: 2006 bytes --]

From 0f7ba24acb3fde0a3627aab378ddd8d76a859dbc Mon Sep 17 00:00:00 2001
From: Gerard Vermeulen <gerard.vermeulen@posteo.net>
Date: Sun, 10 Dec 2023 18:18:42 +0100
Subject: [PATCH] Fix (setopt register-separator "\n") non-matching type
 warning

* lisp/register.el (register-separator): add string type to
choice options and clarify documentation.
* doc/emacs/regs.texi (Text Registers): fix example setting
'register-separator'.
---
 doc/emacs/regs.texi | 3 +--
 lisp/register.el    | 9 +++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi
index 5e5b7ae2b16..0fa9b5f24c3 100644
--- a/doc/emacs/regs.texi
+++ b/doc/emacs/regs.texi
@@ -146,8 +146,7 @@ register.  For example, to get double newlines as text separator
 during the collection process, you can use the following setting.
 
 @example
-(setq register-separator ?+)
-(set-register register-separator "\n\n")
+(setopt register-separator "\n\n")
 @end example
 
 @kindex C-x r i
diff --git a/lisp/register.el b/lisp/register.el
index fa4bbcf483f..758df9648a3 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -84,14 +84,15 @@ A list of the form (FRAME-CONFIGURATION POSITION)
   :version "24.3")
 
 (defcustom register-separator nil
-  "Register containing the text to put between collected texts, or nil if none.
+  "Separator between texts collected in registers, or nil if none.
 
 When collecting text with \\[append-to-register] (or \\[prepend-to-register]),
-contents of this register is added to the beginning (or end, respectively)
-of the marked text."
+the separator is added to the beginning (or end, respectively) of the marked
+text."
   :group 'register
   :type '(choice (const :tag "None" nil)
-		 (character :tag "Use register" :value ?+)))
+		 (character :tag "Use character" :value ?+)
+		 (string :tag "Use string" :value "")))
 
 (defcustom register-preview-delay 1
   "If non-nil, time to wait in seconds before popping up register preview window.
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#67752: [PATCH] Fix (setopt register-separator "\n") non-matching type warning
  2023-12-10 17:37 bug#67752: [PATCH] Fix (setopt register-separator "\n") non-matching type warning gerard.vermeulen
@ 2023-12-16 12:06 ` Eli Zaretskii
  2023-12-16 20:02   ` gerard.vermeulen
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2023-12-16 12:06 UTC (permalink / raw)
  To: gerard.vermeulen; +Cc: 67752

tags 67752 notabug
thanks

> Date: Sun, 10 Dec 2023 17:37:49 +0000
> From: gerard.vermeulen@posteo.net
> 
> attached patch fixes "(setopt register-separator "\n") non-matching
> type warnings" and makes the register-separator documentation
> less confusing to me.

I think register-separator is supposed to be a register, not a
separator string.  That's how it is documented.

So I don't think these changes should be installed.

Thanks.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#67752: [PATCH] Fix (setopt register-separator "\n") non-matching type warning
  2023-12-16 12:06 ` Eli Zaretskii
@ 2023-12-16 20:02   ` gerard.vermeulen
  2023-12-16 20:21     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: gerard.vermeulen @ 2023-12-16 20:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67752



On 16.12.2023 13:06, Eli Zaretskii wrote:
> tags 67752 notabug
[...]
> I think register-separator is supposed to be a register, not a
> separator string.  That's how it is documented.
> 
> So I don't think these changes should be installed.
> 
Indeed, I did not understand from the documentation that the
"+" register is special and that one can do directly:
(set-register ?+ "\n*REGISTER SEPARATOR*\n")

I am sorry for the noise and you can close the bug as far as it
concerns me.

Regards






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#67752: [PATCH] Fix (setopt register-separator "\n") non-matching type warning
  2023-12-16 20:02   ` gerard.vermeulen
@ 2023-12-16 20:21     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2023-12-16 20:21 UTC (permalink / raw)
  To: gerard.vermeulen; +Cc: 67752-done

> Date: Sat, 16 Dec 2023 20:02:43 +0000
> From: gerard.vermeulen@posteo.net
> Cc: 67752@debbugs.gnu.org
> 
> 
> 
> On 16.12.2023 13:06, Eli Zaretskii wrote:
> > tags 67752 notabug
> [...]
> > I think register-separator is supposed to be a register, not a
> > separator string.  That's how it is documented.
> > 
> > So I don't think these changes should be installed.
> > 
> Indeed, I did not understand from the documentation that the
> "+" register is special and that one can do directly:
> (set-register ?+ "\n*REGISTER SEPARATOR*\n")
> 
> I am sorry for the noise and you can close the bug as far as it
> concerns me.

No need to apologize.  I'm closing the bug.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-16 20:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-10 17:37 bug#67752: [PATCH] Fix (setopt register-separator "\n") non-matching type warning gerard.vermeulen
2023-12-16 12:06 ` Eli Zaretskii
2023-12-16 20:02   ` gerard.vermeulen
2023-12-16 20:21     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).