GNU bug report logs - #24540
25.1; doc of `abbrev-expand-function(s)', "wrapper hooks",...

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 25 Sep 2016 14:54:01 UTC

Severity: minor

Found in version 25.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24540 in the body.
You can then email your comments to 24540 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24540; Package emacs. (Sun, 25 Sep 2016 14:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 25 Sep 2016 14:54:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; doc of `abbrev-expand-function(s)', "wrapper hooks",...
Date: Sun, 25 Sep 2016 07:53:30 -0700 (PDT)
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."

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

So we look at `abbrev-expand-function', which tells us that the default
value is `abbrev--default-expand'.  (Why the default value of such a
presumably user-modifiable variable should be considered an "internal"
function is a mystery.)

So we look at `abbrev--default-expand', which tells us this:

"This respects the wrapper hook `abbrev-expand-functions'."

Hm.  So we look at `abbrev-expand-functions', to see what this "wrapper
hook" is all about.  It tells us this:

"Wrapper hook around ‘abbrev--default-expand’."

OK.  It's a "wrapper hook", whatever that is.  This doesn't tell us
anything more.

But `C-h v abbrev-expand-functions' also tells us this, which is
interesting:

"This variable is obsolete since 24.4; use ‘abbrev-expand-function’
instead."

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!
Round and round we go...

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 looks as though a new term ("wrapper hook") was introduced to the
Emacs vocabulary in Emacs 23, and then removed (deprecated?) soon
thereafter.  What is this all about?  What is a poor user to understand
about all of this?

One could forgive a user for being confused, or totally lost, in this
swamp.  Please consider clearing away some of the brambles.


In GNU Emacs 25.1.1 (x86_64-w64-mingw32)
 of 2016-09-17 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --without-dbus --without-compress-install CFLAGS=-static'


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."

So we look at `abbrev-expand-function', which tells us that the default
value is `abbrev--default-expand'.  (Why the default value of such a
user-modifiable variable should be considered an "internal" function is
a mystery.)

So we look at `abbrev--default-expand', which tells us this:

"This respects the wrapper hook `abbrev-expand-functions'."

Hm.  So we look at `abbrev-expand-functions', to see what this "wrapper
hook" is all about.  It tells us this:

"Wrapper hook around ‘abbrev--default-expand’."

OK.  It's a "wrapper hook", whatever that is.  This doesn't tell us
anything more.

But `C-h v abbrev--default-expand' also tells us this, which is
interesting:

"This variable is obsolete since 24.4; use ‘abbrev-expand-function’
instead."

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!
Round and round we go.

So 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 looks as though a new term ("wrapper hook") was introduced to the
Emacs vocabulary recently, and then removed (deprecated?) almost
immediately.  What is this all about?  What is a poor user to understand
about all of this?

One could forgive a user for being confused, or totally lost, in this
swamp.




In GNU Emacs 25.1.1 (x86_64-w64-mingw32)
 of 2016-09-17 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --without-dbus --without-compress-install CFLAGS=-static'


So we look at `abbrev-expand-function', which tells us that the default
value is `abbrev--default-expand'.  (Why the default value of such a
user-modifiable variable should be considered an "internal" function is
a mystery.)

So we look at `abbrev--default-expand', which tells us this:

"This respects the wrapper hook `abbrev-expand-functions'."

Hm.  So we look at `abbrev-expand-functions', to see what this "wrapper
hook" is all about.  It tells us this:

"Wrapper hook around ‘abbrev--default-expand’."

OK.  It's a "wrapper hook", whatever that is.  This doesn't tell us
anything more.

But `C-h v abbrev--default-expand' also tells us this, which is
interesting:

"This variable is obsolete since 24.4; use ‘abbrev-expand-function’
instead."

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!
Round and round we go.

So 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 looks as though a new term ("wrapper hook") was introduced to the
Emacs vocabulary recently, and then removed (deprecated?) almost
immediately.  What is this all about?  What is a poor user to understand
about all of this?

One could forgive a user for being confused, or totally lost, in this
swamp.


In GNU Emacs 25.1.1 (x86_64-w64-mingw32)
 of 2016-09-17 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --without-dbus --without-compress-install CFLAGS=-static'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24540; Package emacs. (Sun, 25 Sep 2016 15:27:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Cc: Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#24540: 25.1; doc of `abbrev-expand-function(s)', "wrapper
 hooks",...
Date: Sun, 25 Sep 2016 17:33:13 +0200

On 25.09.2016 16:53, Drew Adams wrote:
> Let's check the doc, starting with `expand-abbrev':
>
>

Hi Drew,

thanks. abbrev.el needs a reconsideration from the bottom. Discussed 
this several weeks ago at emacs-devel. A re-write IMHO must start with 
specifications, i.e. it must be known, what to expect.

Being in favor of accepting arbitrary, case-sensitive strings as abbrev, 
which seems not working at the moment.

Cheers,
Andreas





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24540; Package emacs. (Sun, 25 Sep 2016 19:40:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>,
 bug-gnu-emacs <at> gnu.org
Subject: RE: bug#24540: 25.1; doc of `abbrev-expand-function(s)', "wrapper
 hooks",...
Date: Sun, 25 Sep 2016 12:38:57 -0700 (PDT)
> Hi Drew,
> 
> thanks. abbrev.el needs a reconsideration from the bottom. Discussed
> this several weeks ago at emacs-devel. A re-write IMHO must start with
> specifications, i.e. it must be known, what to expect.
> 
> Being in favor of accepting arbitrary, case-sensitive strings as abbrev,
> which seems not working at the moment.

Hi Andreas,

OK, but maybe this doc could be cleared up a bit first,
as a minor improvement.

 - Drew




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24540; Package emacs. (Mon, 26 Sep 2016 06:09:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Cc: Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#24540: 25.1; doc of `abbrev-expand-function(s)', "wrapper
 hooks",...
Date: Mon, 26 Sep 2016 08:15:25 +0200

On 25.09.2016 16:53, Drew Adams wrote:
> 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."
>
> (It should say that it calls the _value of variable_
> `abbrev-expand-function'.)

Hmm, the explicit "-function" tells me, there is something uncommon: ah, 
that's not a function at this level.

OTOH a thing would be to name a function  "-function".
But these are conventions, which also apply to other parts.
Think it's worth to be brought to emacs-devel.





Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Mon, 26 Sep 2016 16:05:01 GMT) Full text and rfc822 format available.

Notification sent to Drew Adams <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Mon, 26 Sep 2016 16:05:01 GMT) Full text and rfc822 format available.

Message #19 received at 24540-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 24540-done <at> debbugs.gnu.org
Subject: Re: bug#24540: 25.1;
 doc of `abbrev-expand-function(s)', "wrapper hooks",...
Date: Mon, 26 Sep 2016 19:04:04 +0300
> Date: Sun, 25 Sep 2016 07:53:30 -0700 (PDT)
> From: Drew Adams <drew.adams <at> 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.)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 25 Oct 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.