all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: emacs-29 a5bd9fb8c4a: ; Improve doc strings in register.el
       [not found] ` <20230630114714.E4455C19262@vcs2.savannah.gnu.org>
@ 2023-07-02  2:28   ` Michael Heerdegen
  2023-07-02  5:28     ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Heerdegen @ 2023-07-02  2:28 UTC (permalink / raw)
  To: emacs-devel; +Cc: Eli Zaretskii

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

Hello Eli,

thanks for improving the documentation of registers and text property
search.  All fine, only:

>  (cl-defgeneric register-val-describe (val verbose)
> -  "Print description of register value VAL to `standard-output'."
> +  "Print description of register value VAL to `standard-output'.
> +Second argument VERBOSE is ignored, unless VAL is not one of the
> +supported kinds of register contents, in which case it is displayed
> +using `prin1'."
>    (princ "Garbage:\n")
>    (if verbose (prin1 val)))

I would remove that sentence you added: the body is only the generic
(fallback) definition; method implementations are free to use the
VERBOSE argument (some actually do).

And here are two typos (please install if it looks ok):


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-two-typos-in-recent-changes-in-the-manual.patch --]
[-- Type: text/x-diff, Size: 1737 bytes --]

From b426979d46f4823b3ddd850902a73aff970b5a24 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@web.de>
Date: Sun, 2 Jul 2023 03:35:34 +0200
Subject: [PATCH] ; Fix two typos in recent changes in the manual

* doc/lispref/text.texi (Property Search):
* lisp/register.el (register-preview-function): Fix typos.
---
 doc/lispref/text.texi | 2 +-
 lisp/register.el      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index a61889fc508..bfd81662292 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -3424,7 +3424,7 @@ Property Search
 region where we have a property match, skip past that region and find
 the next region instead.

-The @code{prop-match} structure has the following accessor functionss:
+The @code{prop-match} structure has the following accessor functions:
 @code{prop-match-beginning} (the start of the match),
 @code{prop-match-end} (the end of the match), and
 @code{prop-match-value} (the value of @var{property} at the start of
diff --git a/lisp/register.el b/lisp/register.el
index 56ab089efb7..06a52a3850e 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -126,7 +126,7 @@ register-preview-default
 (defvar register-preview-function #'register-preview-default
   "Function to format a register for previewing.
 Called with one argument, a cons (NAME . CONTENTS) as found in `register-alist'.
-The function should return a string, the description of teh argument.")
+The function should return a string, the description of the argument.")

 (defun register-preview (buffer &optional show-empty)
   "Pop up a window showing the registers preview in BUFFER.
--
2.30.2


[-- Attachment #3: Type: text/plain, Size: 20 bytes --]



Thanks,

Michael.

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

* Re: emacs-29 a5bd9fb8c4a: ; Improve doc strings in register.el
  2023-07-02  2:28   ` emacs-29 a5bd9fb8c4a: ; Improve doc strings in register.el Michael Heerdegen
@ 2023-07-02  5:28     ` Eli Zaretskii
  2023-07-03  3:07       ` Michael Heerdegen
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2023-07-02  5:28 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: emacs-devel

> From: Michael Heerdegen <michael_heerdegen@web.de>
> Cc: Eli Zaretskii <eliz@gnu.org>
> Date: Sun, 02 Jul 2023 04:28:10 +0200
> 
> >  (cl-defgeneric register-val-describe (val verbose)
> > -  "Print description of register value VAL to `standard-output'."
> > +  "Print description of register value VAL to `standard-output'.
> > +Second argument VERBOSE is ignored, unless VAL is not one of the
> > +supported kinds of register contents, in which case it is displayed
> > +using `prin1'."
> >    (princ "Garbage:\n")
> >    (if verbose (prin1 val)))
> 
> I would remove that sentence you added: the body is only the generic
> (fallback) definition; method implementations are free to use the
> VERBOSE argument (some actually do).

I see no need to remove it.  I added it on purpose: a mandatory
argument deserves to be documented, and the fact that it's a generic
doesn't matter because the doc string should describe all the concrete
methods.  But I changed it to be more in line with its usage by the
methods which do use this argument.

> And here are two typos (please install if it looks ok):

Thanks, installed.



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

* Re: emacs-29 a5bd9fb8c4a: ; Improve doc strings in register.el
  2023-07-02  5:28     ` Eli Zaretskii
@ 2023-07-03  3:07       ` Michael Heerdegen
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Heerdegen @ 2023-07-03  3:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> > From: Michael Heerdegen <michael_heerdegen@web.de>
> > Cc: Eli Zaretskii <eliz@gnu.org>
> > Date: Sun, 02 Jul 2023 04:28:10 +0200
> >
> > >  (cl-defgeneric register-val-describe (val verbose)
> > > -  "Print description of register value VAL to `standard-output'."
> > > +  "Print description of register value VAL to `standard-output'.
> > > +Second argument VERBOSE is ignored, unless VAL is not one of the
> > > +supported kinds of register contents, in which case it is displayed
> > > +using `prin1'."
> > >    (princ "Garbage:\n")
> > >    (if verbose (prin1 val)))
> >
> > I would remove that sentence you added: the body is only the generic
> > (fallback) definition; method implementations are free to use the
> > VERBOSE argument (some actually do).
>
> I see no need to remove it.  I added it on purpose: a mandatory
> argument deserves to be documented, and the fact that it's a generic
> doesn't matter because the doc string should describe all the concrete
> methods.

Sure.  IMO the optimum would be to describe first what the generic
function generally does (the common part of all implementations, what
the arguments mean, etc.)  and then (optionally) describe the default
implementation but in a way that says that explicitly ("The default
implementation ...").  I also wondered why you had described the `princ'
behavior but not the (also interesting) "Garbage: " part.

>  But I changed it to be more in line with its usage by the
> methods which do use this argument.

Thanks, I think that's better.

Michael.



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

end of thread, other threads:[~2023-07-03  3:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <168812563462.9425.14996973696916426928@vcs2.savannah.gnu.org>
     [not found] ` <20230630114714.E4455C19262@vcs2.savannah.gnu.org>
2023-07-02  2:28   ` emacs-29 a5bd9fb8c4a: ; Improve doc strings in register.el Michael Heerdegen
2023-07-02  5:28     ` Eli Zaretskii
2023-07-03  3:07       ` Michael Heerdegen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.