unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 24540-done@debbugs.gnu.org
Subject: bug#24540: 25.1; doc of `abbrev-expand-function(s)', "wrapper hooks",...
Date: Mon, 26 Sep 2016 19:04:04 +0300	[thread overview]
Message-ID: <83d1jqd4wb.fsf@gnu.org> (raw)
In-Reply-To: <39d1a887-a19f-40ba-9b00-84e27f2606ce@default> (message from Drew Adams on Sun, 25 Sep 2016 07:53:30 -0700 (PDT))

> Date: Sun, 25 Sep 2016 07:53:30 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> 
> Let's check the doc, starting with `expand-abbrev':
> 
> "Calls `abbrev-expand-function' with no argument to do the work, and
> returns whatever it does."

Actually, it says this:

    "Expand the abbrev before point, if there is an abbrev there.
  Effective when explicitly called even when `abbrev-mode' is nil.
  Before doing anything else, runs `pre-abbrev-expand-hook'.
  Calls `abbrev-expand-function' with no argument to do the work,
  and returns whatever it does.  (This should be the abbrev symbol
  if expansion occurred, else nil.)"

IOW, it (1) describes what the command does, (2) mentions the function
it calls to do the actual work, and (3) explains what "whatever"
means.  Quite a lot less mysterious than what the single sentence you
presented might convey, IMO.

> (It should say that it calls the _value of variable_
> `abbrev-expand-function'.)

Yes, fixed.

> So we look at `abbrev-expand-function', which tells us that the default
> value is `abbrev--default-expand'.

Given the above description, I see no reason for looking at
abbrev-expand-function at all, as no information is missing.  But
let's play along nonetheless.

> (Why the default value of such a presumably user-modifiable variable
> should be considered an "internal" function is a mystery.)

Why not?  It's just a value, right?  The user-modifiable part is not
the value, it's the variable abbrev-expand-function, which is not
internal.

> So we look at `abbrev--default-expand', which tells us this:
> 
> "This respects the wrapper hook `abbrev-expand-functions'."

No, it tells this:

    "Default function to use for `abbrev-expand-function'.
  This respects the wrapper hook `abbrev-expand-functions'.
  Calls `abbrev-insert' to insert any expansion, and returns what it does."

So it mentions the (non-obsolete) variable abbrev-expand-function, and
only then tells you that it _also_ respects the obsolete hook
abbrev-expand-functions.  Again, quite a different picture.

(I fixed the doc string to say "also" and "obsolete" explicitly.)

> So the doc tells us about a "wrapper hook", which is presumably
> something like a hook, which is something that users can use.  But the
> wrapper hook we are pointed to is "obsolete", and we are told to instead
> use a different variable (sans "s") - which was the one we started with!

Not quite accurate, to say the least.  In particular, the non-obsolete
variable was mentioned _before_ the obsolete one in the first place.

> Now what about the mysterious term "wrapper hook", apparently introduced
> fairly recently?  Searching for it in the Emacs manual shows nothing.
> 
> Searching for it in the Elisp manual shows only mentions of particular
> "obsolete" wrapper hooks - no explanation of what is meant by a "wrapper
> hook".

It isn't documented in the manuals because it's an obsolete feature.
I added references to with-wrapper-hook to the few doc strings that
were referencing wrapper hooks (there were just 4 of them in all of
Emacs).

(The text of your report was repeated 3 times for some reason.)





      parent reply	other threads:[~2016-09-26 16:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-25 14:53 bug#24540: 25.1; doc of `abbrev-expand-function(s)', "wrapper hooks", Drew Adams
2016-09-25 15:33 ` Andreas Röhler
2016-09-25 19:38   ` Drew Adams
2016-09-26  6:15 ` Andreas Röhler
2016-09-26 16:04 ` Eli Zaretskii [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83d1jqd4wb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24540-done@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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 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).