all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jeremy Bryant <jb@jeremybryant.net>
Cc: 67153@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#67153: [PATCH 2/2] Add 5 docstrings to abbrev.el
Date: Thu, 16 Nov 2023 08:47:18 +0200	[thread overview]
Message-ID: <83v8a2p53d.fsf@gnu.org> (raw)
In-Reply-To: <878r6yvbj5.fsf@jeremybryant.net> (bug-gnu-emacs@gnu.org)

> Cc: gerd@gnu.org, 67153@debbugs.gnu.org, rms@gnu.org
> Date: Wed, 15 Nov 2023 23:24:48 +0000
> From:  Jeremy Bryant via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
>  (defun prepare-abbrev-list-buffer (&optional local)
> +  "Return buffer listing abbreviations and expansions for each abbrev table.
> +
> +LOCAL is a flag, if non-nil display only local abbrevs."

Our style for expressing what you say in the last sentence is

  If LOCAL is non-nil, include in the buffer only the local abbrevs.

("Display" is not appropriate here, since this function doesn't
display the buffer.)

>  (defun add-abbrev (table type arg)
> +  "Define abbrev in TABLE, whose expansion is ARG words before point.
> +This command reads the abbreviation from the minibuffer, with prompt TYPE.
        ^^^^^^^
This is not a command.

> +ARG of zero means the entire region is the expansion.
> +If there's an active region, use that as the expansion.

Is the second sentence conditioned on the first, i.e., does the
function use the active region only when ARG is zero?  If so, the
second sentence should be removed.  If use of the active region is NOT
conditioned on ARG, I would reword the above:

  If there's an active region, use the region as the expansion.
  ARG of zero means the region is the expansion, even if it is
  inactive.

>  (defun inverse-add-abbrev (table type arg)
> +  "Define the word before point as an abbrev in TABLE.
> +This command reads the expansion from the minibuffer, using prompt TYPE,
> +defines the abbrev, and then expands the abbreviation in the current buffer.
> +
> +ARG means use the ARG-th word before point as the abbreviation.
> +Negative ARG means use the ARG-th word after point.
> +
> +TYPE is an arbitrary string used to prompt user for the kind of
> +abbrev, such as \"Global\", \"Mode\".  (This has no influence on the
> +choice of the actual TABLE).
> +
> +See also `add-abbrev', which performs the opposite task."

Same comments here.

>  (defun abbrev--possibly-save (query &optional arg)
> +  "Maybe save abbrevs: Hook function for use by `save-some-buffer-functions'.

I'd say here just

  Hook function for use by `save-some-buffer-functions'.

and add the "Maybe save" bit as a separate second sentence.

> +Associated meaning for QUERY and ARG."

I couldn't parse this sentence.

Thanks.





  reply	other threads:[~2023-11-16  6:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13 22:38 bug#67153: [PATCH 2/2] Add 5 docstrings to abbrev.el Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-14 14:17 ` Eli Zaretskii
2023-11-14 19:23 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-15 23:24   ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-16  6:47     ` Eli Zaretskii [this message]
2023-11-16 23:48       ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-17  8:17         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83v8a2p53d.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=67153@debbugs.gnu.org \
    --cc=jb@jeremybryant.net \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.