GNU bug report logs - #33601
26; Add macro `with-hook-added'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Drew Adams <drew.adams@HIDDEN>; dated Mon, 3 Dec 2018 18:48:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 33601 <at> debbugs.gnu.org:


Received: (at 33601) by debbugs.gnu.org; 4 Dec 2018 21:22:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 04 16:22:55 2018
Received: from localhost ([127.0.0.1]:32816 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gUI9e-000496-VP
	for submit <at> debbugs.gnu.org; Tue, 04 Dec 2018 16:22:55 -0500
Received: from aserp2130.oracle.com ([141.146.126.79]:48362)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1gUI9c-00048q-RQ
 for 33601 <at> debbugs.gnu.org; Tue, 04 Dec 2018 16:22:53 -0500
Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1])
 by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB4LJLlJ098940;
 Tue, 4 Dec 2018 21:22:46 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : cc : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02;
 bh=ne9TGVAp1ulEAZB04O/MdbNUxDZE3wbAt/mIKV8GjoU=;
 b=rygYEXy3ToAZdcHjUDErCnB+m2//yL1NhDVpHncgUYJmw8i0WTxO5Yc1yXXdEc/bQh4P
 ExBImvKjo6A8UnjmCQVZszpcs//T37yHxg2kUXNAxkpsHIgfty72zEVYqBSyzJhFCj7z
 dpUyDaA1wdTSdZ0mK764eh+cdpHv9K/G9xjQ0n1czFBTxcNLKX/rkVGzpDFa4JR1k9/L
 dmHq8+QTmhV3wBKIEzE2egTFgvxUzuuDobKwGZ7QRHNwJ88rhY8AKuhD2sz40ySLggyk
 zsVnfx0Y8sztVEVaDW91bj1R3ihYLYy69natCx5r2/UXgF68o80PrSVQd+zSvGrYLqzH XA== 
Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233])
 by aserp2130.oracle.com with ESMTP id 2p3ftf2wh4-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Tue, 04 Dec 2018 21:22:46 +0000
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
 by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wB4LMjWU028783
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Tue, 4 Dec 2018 21:22:46 GMT
Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25])
 by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wB4LMgAj027909;
 Tue, 4 Dec 2018 21:22:42 GMT
MIME-Version: 1.0
Message-ID: <af5ddf3e-5b54-4173-be48-a68da743d989@default>
Date: Tue, 4 Dec 2018 13:22:41 -0800 (PST)
From: Drew Adams <drew.adams@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: RE: bug#33601: 26; Add macro `with-hook-added'
References: <mailman.5097.1543862895.1284.bug-gnu-emacs@HIDDEN>
 <20181204184614.2049.qmail@HIDDEN>
 <bd0aa687-8e35-4c63-b4a4-abefdcda99e4@default> <20181204201048.GA13646@ACM>
In-Reply-To: <20181204201048.GA13646@ACM>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4771.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9097
 signatures=668686
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1810050000 definitions=main-1812040182
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33601
Cc: 33601 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> > > Just a big point: you need to test whether FUNCTION is already on
> > > HOOK at the start, and if so, not remove it at the end.
>=20
> > A big point?  Need to?
>=20
> I think so, yes.  The essence of the `with-...' macros is that they
> temporarily change something, then evaluate ,@body, and at the end, the
> something is restored to what it was.
>=20
> If with-hook-added didn't preserve the hook, it would
> be an anomaly, an outlier, and quite possibly a PITA.

If there's an unwritten rule that `with-*' macros
preserve and restore everything then clearly the
macro I proposed was not a `with-*' macro.  Another
name for it would be fine, if that's the rule. ;-)

> > That wasn't the behavior I had in mind for this, but it's
> > another possibility.  I intended to provide only for the
> > behavior of always removing at the end.
>=20
> Why?  What's the use case?

The kind of thing I showed (with two examples).

Yes, I would use them where I either know that the
function is not on the hook already or I don't
care - cases where I would want it removed at the
end in any case.

And yes, given your question, the doc of such a
macro would need to make clear that it always
removes FUNCTION from the hook afterward.

> > Choices:
> > 1. Provide a single macro for all such possibilities, with
> >    3 (mandatory) args for APPEND, LOCAL and whether to remove
> >    FUNCTION at the end if it was already present at the outset.
> > 2. Provide multiple macros, each specific for a given case.
> >
> > #2 would mean 8 macros, to cover all the combinations
> > (nil or t for each of the 3 args).
>=20
> How many of these would actually be of any use?

All of the behaviors are useful.  If you meant to ask
whether it is useful to have 8 individual macros, then
my answer is probably not.

> > Another possibility would be to accept a single arg for
> > the BODY code, instead of that being a &rest parameter,
> > and so be able to provide those 3 behavior-specifying
> > args as optional.  In that case, we'd want to decide on
> > the best order among those args, e.g., based on which we
> > expect to be used most often.
>=20
> > I'm not sure what the right approach is.  I think the
> > most common use case would be the one I wrote up (but
> > I don't know that):
> >
> > . Always remove FUNCTION at the end
> > . Prepend, not append.
> > . Global, not local.

I really have no problem with what you requested:
not removing FUNCTION at the end if it was present
beforehand.

However, now you've gone beyond that to suggest
that we should restore the original hook value:
"preserve the hook".

Should it preserve the hook?  Maybe, maybe not.

How strict is your unwritten `with-*' rule?  Does
it apply only to undoing the particular change _it_
makes, or does it also undo changes that might be
made by the BODY?  In this case, the BODY might
itself make changes to the hook.

If I had to choose only one macro, it would
probably be a general one.  I guess it would, as
you first requested, remove FUNCTION only if it
was not already present.  And it would accept
args for APPEND and LOCAL.  But it would not
restore the original hook value.

Whether it should require args APPEND and LOCAL
or it should instead make you wrap body sexps in
a progn is another choice.  Dunno which I'd prefer,
but probably the former (probably less error prone).

Other ideas are welcome.  What is your preference
(besides always restoring the original hook value)?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.

Message received at 33601 <at> debbugs.gnu.org:


Received: (at 33601) by debbugs.gnu.org; 4 Dec 2018 20:15:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 04 15:15:12 2018
Received: from localhost ([127.0.0.1]:60996 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gUH68-0000lx-LH
	for submit <at> debbugs.gnu.org; Tue, 04 Dec 2018 15:15:12 -0500
Received: from colin.muc.de ([193.149.48.1]:58470 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1gUH66-0000iJ-2L
 for 33601 <at> debbugs.gnu.org; Tue, 04 Dec 2018 15:15:10 -0500
Received: (qmail 27375 invoked by uid 3782); 4 Dec 2018 20:15:08 -0000
Received: from acm.muc.de (p2E5D5BD9.dip0.t-ipconnect.de [46.93.91.217]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 04 Dec 2018 21:15:07 +0100
Received: (qmail 14338 invoked by uid 1000); 4 Dec 2018 20:10:48 -0000
Date: Tue, 4 Dec 2018 20:10:48 +0000
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#33601: 26; Add macro `with-hook-added'
Message-ID: <20181204201048.GA13646@ACM>
References: <mailman.5097.1543862895.1284.bug-gnu-emacs@HIDDEN>
 <20181204184614.2049.qmail@HIDDEN>
 <bd0aa687-8e35-4c63-b4a4-abefdcda99e4@default>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <bd0aa687-8e35-4c63-b4a4-abefdcda99e4@default>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 33601
Cc: 33601 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Drew.

On Tue, Dec 04, 2018 at 11:18:29 -0800, Drew Adams wrote:
> > > Enhancement request: Please consider adding a macro such as this, to
> > > facilitate temporary use of a hook function.

> > > (defmacro with-hook-added (hook function &rest body)
> > >   "Evaluate forms in BODY with FUNCTION added to HOOK, then remove FUNCTION."
> > >   (declare (indent 1) (debug t))
> > >   `(unwind-protect (progn (add-hook ',hook ',function) ,@body)
> > >      (remove-hook ',hook ',function)))

> > Just a big point: you need to test whether FUNCTION is already on HOOK
> > at the start, and if so, not remove it at the end.

> Hi Alan,

> A big point?  Need to?

I think so, yes.  The essence of the `with-...' macros is that they
temporarily change something, then evaluate ,@body, and at the end, the
something is restored to what it was.

If with-hook-added didn't preserve the hook, it would be an anomaly, an
outlier, and quite possibly a PITA.

> That wasn't the behavior I had in mind for this, but it's
> another possibility.  I intended to provide only for the
> behavior of always removing at the end.

Why?  What's the use case?

> There are in fact several different possibilities for such
> a macro.  We could provide also for `add-hook' args APPEND
> and LOCAL.  I left that out as well.

> Choices:

> 1. Provide a single macro for all such possibilities, with
> 3 (mandatory) args for APPEND, LOCAL and whether to remove
> FUNCTION at the end if it was already present at the outset.

> 2. Provide multiple macros, each specific for a given case.

> #2 would mean 8 macros, to cover all the combinations
> (nil or t for each of the 3 args).

How many of these would actually be of any use?

> Another possibility would be to accept a single arg for
> the BODY code, instead of that being a &rest parameter,
> and so be able to provide those 3 behavior-specifying
> args as optional.  In that case, we'd want to decide on
> the best order among those args, e.g., based on which we
> expect to be used most often.

> I'm not sure what the right approach is.  I think the
> most common use case would be the one I wrote up (but
> I don't know that):

> . Always remove FUNCTION at the end
> . Prepend, not append.
> . Global, not local.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.

Message received at 33601 <at> debbugs.gnu.org:


Received: (at 33601) by debbugs.gnu.org; 4 Dec 2018 19:18:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 04 14:18:41 2018
Received: from localhost ([127.0.0.1]:60976 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gUGDR-0007cI-5F
	for submit <at> debbugs.gnu.org; Tue, 04 Dec 2018 14:18:41 -0500
Received: from aserp2130.oracle.com ([141.146.126.79]:51102)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1gUGDP-0007c3-2A
 for 33601 <at> debbugs.gnu.org; Tue, 04 Dec 2018 14:18:39 -0500
Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1])
 by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB4JED94000843;
 Tue, 4 Dec 2018 19:18:32 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : cc : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02;
 bh=IGi2qIEDlzn3tfYoKfxKan6rlXvYY81XMlMdIsZhE5o=;
 b=TJsosvUol1htlLaPk1FlZ42SHwyjRSHQk/1qvVWrXAQo+enK54FDvA3QS/PxFxFnZLrJ
 G8Ng4h5UDNMiRwJ1qb/uZuX5N84w+OAJE6BuCjk38l6Xxb2NADLdTjVI8ykgiFyYyZ4z
 lsX7V2y7W5/8MZyIk60ZiE8wFG+FqjVq8pY/3/F2c4+xq/Ps7l2Lo4SaF0oS5xv0haDg
 CMOmxpp1lmU+IYsHczmvJdMnCBnezPDCDF1maWBGuHElVSTfqPeT4rrINhgRqk9MaEx+
 M0mAEkfuBAZjiHN+o5j2kun4SvPd8K3+GdxPi3bcuaEfvHQuXOyF6Nvuq3UKw1j9qzRP eg== 
Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74])
 by aserp2130.oracle.com with ESMTP id 2p3ftf2ckk-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Tue, 04 Dec 2018 19:18:32 +0000
Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])
 by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wB4JIUrD020308
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Tue, 4 Dec 2018 19:18:31 GMT
Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7])
 by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wB4JIUM7030002;
 Tue, 4 Dec 2018 19:18:30 GMT
MIME-Version: 1.0
Message-ID: <bd0aa687-8e35-4c63-b4a4-abefdcda99e4@default>
Date: Tue, 4 Dec 2018 11:18:29 -0800 (PST)
From: Drew Adams <drew.adams@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>, Drew Adams <drew.adams@HIDDEN>
Subject: RE: bug#33601: 26; Add macro `with-hook-added'
References: <<mailman.5097.1543862895.1284.bug-gnu-emacs@HIDDEN>>
 <<20181204184614.2049.qmail@HIDDEN>>
In-Reply-To: <<20181204184614.2049.qmail@HIDDEN>>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4771.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9097
 signatures=668686
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1810050000 definitions=main-1812040164
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33601
Cc: 33601 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> > Enhancement request: Please consider adding a macro such as this, to
> > facilitate temporary use of a hook function.
>=20
> > (defmacro with-hook-added (hook function &rest body)
> >   "Evaluate forms in BODY with FUNCTION added to HOOK, then remove FUNC=
TION."
> >   (declare (indent 1) (debug t))
> >   `(unwind-protect (progn (add-hook ',hook ',function) ,@body)
> >      (remove-hook ',hook ',function)))
>=20
> Just a big point: you need to test whether FUNCTION is already on HOOK
> at the start, and if so, not remove it at the end.

Hi Alan,

A big point?  Need to?

That wasn't the behavior I had in mind for this, but it's
another possibility.  I intended to provide only for the
behavior of always removing at the end.

There are in fact several different possibilities for such
a macro.  We could provide also for `add-hook' args APPEND
and LOCAL.  I left that out as well.

Choices:

1. Provide a single macro for all such possibilities, with
3 (mandatory) args for APPEND, LOCAL and whether to remove
FUNCTION at the end if it was already present at the outset.

2. Provide multiple macros, each specific for a given case.

#2 would mean 8 macros, to cover all the combinations
(nil or t for each of the 3 args).

Another possibility would be to accept a single arg for
the BODY code, instead of that being a &rest parameter,
and so be able to provide those 3 behavior-specifying
args as optional.  In that case, we'd want to decide on
the best order among those args, e.g., based on which we
expect to be used most often.

I'm not sure what the right approach is.  I think the
most common use case would be the one I wrote up (but
I don't know that):

. Always remove FUNCTION at the end
. Prepend, not append.
. Global, not local.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.

Message received at 33601 <at> debbugs.gnu.org:


Received: (at 33601) by debbugs.gnu.org; 4 Dec 2018 18:46:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 04 13:46:17 2018
Received: from localhost ([127.0.0.1]:60948 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gUFi4-0006h6-SO
	for submit <at> debbugs.gnu.org; Tue, 04 Dec 2018 13:46:17 -0500
Received: from colin.muc.de ([193.149.48.1]:18749 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1gUFi3-0006gx-F9
 for 33601 <at> debbugs.gnu.org; Tue, 04 Dec 2018 13:46:16 -0500
Received: (qmail 2050 invoked by uid 3782); 4 Dec 2018 18:46:14 -0000
Date: 4 Dec 2018 18:46:14 -0000
Message-ID: <20181204184614.2049.qmail@HIDDEN>
From: Alan Mackenzie <acm@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#33601: 26; Add macro `with-hook-added'
Organization: muc.de e.V.
In-Reply-To: <mailman.5097.1543862895.1284.bug-gnu-emacs@HIDDEN>
X-Newsgroups: gnu.emacs.bug
User-Agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (FreeBSD/11.2-RELEASE-p4
 (amd64))
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 33601
Cc: 33601 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Drew.

In article <mailman.5097.1543862895.1284.bug-gnu-emacs@HIDDEN> you wrote:
> Enhancement request: Please consider adding a macro such as this, to
> facilitate temporary use of a hook function.

> (defmacro with-hook-added (hook function &rest body)
>   "Evaluate forms in BODY with FUNCTION added to HOOK, then remove FUNCTION."
>   (declare (indent 1) (debug t))
>   `(unwind-protect (progn (add-hook ',hook ',function) ,@body)
>      (remove-hook ',hook ',function)))

Just a big point: you need to test whether FUNCTION is already on HOOK
at the start, and if so, not remove it at the end.

Apologies if somebody else has already pointed this out.

> In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
>  of 2018-05-30
> Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
> Windowing system distributor `Microsoft Corp.', version 10.0.16299
> Configured using:
>  `configure --without-dbus --host=x86_64-w64-mingw32
>  --without-compress-install 'CFLAGS=-O2 -static -g3''

-- 
Alan Mackenzie (Nuremberg, Germany).





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.

Message received at 33601 <at> debbugs.gnu.org:


Received: (at 33601) by debbugs.gnu.org; 3 Dec 2018 23:51:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 03 18:51:57 2018
Received: from localhost ([127.0.0.1]:59579 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gTy0K-0004ND-Up
	for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 18:51:57 -0500
Received: from userp2120.oracle.com ([156.151.31.85]:46246)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1gTy0H-0004Mn-NL
 for 33601 <at> debbugs.gnu.org; Mon, 03 Dec 2018 18:51:54 -0500
Received: from pps.filterd (userp2120.oracle.com [127.0.0.1])
 by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB3NmVK0058975;
 Mon, 3 Dec 2018 23:51:47 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : cc : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02;
 bh=byWPQ6ZrYJLIizlxvz4QT2EYosfHWWu/9BxMEybhMKk=;
 b=Kn350vy85F22ZeIe2aBIoSXd3fshPvy7qHSpw2DrrpoLoCcnkVOjGd6eVd55Yumbki98
 oLEYHNSVb8c5+uC/WXoHyLHWfZ7QIqnopz+MKjHsOeOyLrZa9Ybl2Oy9xAq25a0tOgbz
 vtMhLtebH1ZJ5w+2jRMSDGYoEqZ1z+0xIWuWZdfIUXHRFr4MHvWq0DS+7UVo1LxTEER4
 X1XndkVlX8sYGD/eGdWb468WmqFbX79pPZi762G6GsrMIrGUoz2E0AXyo/ueyduaHtlU
 zQ1oXDHIDkojB+Arj/9V+tYwqzi/hSp50jTO+9fCS1xhMSntCy8O39rnWni+4Vq/+7N5 vg== 
Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233])
 by userp2120.oracle.com with ESMTP id 2p3jxr9bk7-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Mon, 03 Dec 2018 23:51:47 +0000
Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])
 by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wB3NpkOH029907
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Mon, 3 Dec 2018 23:51:46 GMT
Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26])
 by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wB3Npjx7028943;
 Mon, 3 Dec 2018 23:51:45 GMT
MIME-Version: 1.0
Message-ID: <108a3ae8-9959-4dc1-a7fe-bea4a31c8643@default>
Date: Mon, 3 Dec 2018 23:51:44 +0000 (UTC)
From: Drew Adams <drew.adams@HIDDEN>
To: Phil Sainty <psainty@HIDDEN>
Subject: RE: bug#33601: 26; Add macro `with-hook-added'
References: <6871371f-5c46-46f2-9a92-b1c154ec5a73@default>
 <0b15a9be-6f19-4569-93fd-1a09a6456b25@default>
 <06d76795115ae2a95f56694a904100ba@HIDDEN>
 <9bda9cb4-42bb-4e89-b73e-fb0b62443b6c@default>
 <1c26ed105b9c1262e1688018d32d4957@HIDDEN>
In-Reply-To: <1c26ed105b9c1262e1688018d32d4957@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4771.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9096
 signatures=668686
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1810050000 definitions=main-1812030211
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33601
Cc: 33601 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> > The real question is whether such a macro is useful.
> > I think it can be.  I gave a couple examples in bug
> > #33595.  It was those examples that made me think
> > such a macro might be useful.
>=20
> I certainly think it can be useful.
>=20
> On a couple of occasions I've used code which does a similar thing
> with advice -- adding temporary advice, running a body, and removing
> the advice again.
>=20
> In both cases one could argue for a more persistent hook or advice
> which performs its own check to see whether it should do things, but
> that might also entail writing a new wrapper to perform the test, so
> there's appeal in a with-* approach (particularly for things which are
> wanted only very occasionally).

Yes to all that.  A propos, I don't think advice (even
nadvice) replaces the special utility of a hook, for
reasons similar to those I gave in bug #33595 for why
a hook is handier for that use case than is using
`:exit-function' on `completion-extra-properties'.

Each such function behavior-modifying tool has a
purpose, even if sometimes they can substitute for
each other.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.

Message received at 33601 <at> debbugs.gnu.org:


Received: (at 33601) by debbugs.gnu.org; 3 Dec 2018 23:13:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 03 18:13:59 2018
Received: from localhost ([127.0.0.1]:59568 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gTxPb-0003GI-JJ
	for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 18:13:59 -0500
Received: from smtp-2.orcon.net.nz ([60.234.4.43]:52342)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1gTxPZ-0003G8-HQ
 for 33601 <at> debbugs.gnu.org; Mon, 03 Dec 2018 18:13:58 -0500
Received: from [10.253.37.70] (port=34272 helo=webmail.orcon.net.nz)
 by smtp-2.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>)
 id 1gTxPX-0006CM-9w; Tue, 04 Dec 2018 12:13:55 +1300
Received: from wlgwil-nat-office.catalyst.net.nz ([202.78.240.7])
 via [10.253.37.253] by webmail.orcon.net.nz
 with HTTP (HTTP/1.1 POST); Tue, 04 Dec 2018 12:13:55 +1300
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Tue, 04 Dec 2018 12:13:55 +1300
From: Phil Sainty <psainty@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#33601: 26; Add macro `with-hook-added'
In-Reply-To: <9bda9cb4-42bb-4e89-b73e-fb0b62443b6c@default>
References: <6871371f-5c46-46f2-9a92-b1c154ec5a73@default>
 <0b15a9be-6f19-4569-93fd-1a09a6456b25@default>
 <06d76795115ae2a95f56694a904100ba@HIDDEN>
 <9bda9cb4-42bb-4e89-b73e-fb0b62443b6c@default>
Message-ID: <1c26ed105b9c1262e1688018d32d4957@HIDDEN>
X-Sender: psainty@HIDDEN
User-Agent: Orcon Webmail
X-GeoIP: --
X-Spam_score: -2.9
X-Spam_score_int: -28
X-Spam_bar: --
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 33601
Cc: 33601 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 2018-12-04 11:50, Drew Adams wrote:
> The real question is whether such a macro is useful.
> I think it can be.  I gave a couple examples in bug
> #33595.  It was those examples that made me think
> such a macro might be useful.

I certainly think it can be useful.

On a couple of occasions I've used code which does a similar thing
with advice -- adding temporary advice, running a body, and removing
the advice again.

In both cases one could argue for a more persistent hook or advice
which performs its own check to see whether it should do things, but
that might also entail writing a new wrapper to perform the test, so
there's appeal in a with-* approach (particularly for things which are
wanted only very occasionally).


-Phil





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.

Message received at 33601 <at> debbugs.gnu.org:


Received: (at 33601) by debbugs.gnu.org; 3 Dec 2018 22:51:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 03 17:51:01 2018
Received: from localhost ([127.0.0.1]:59558 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gTx3N-0002c6-9j
	for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 17:51:01 -0500
Received: from userp2130.oracle.com ([156.151.31.86]:33256)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1gTx3J-0002bm-RC
 for 33601 <at> debbugs.gnu.org; Mon, 03 Dec 2018 17:50:58 -0500
Received: from pps.filterd (userp2130.oracle.com [127.0.0.1])
 by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB3MmmKq051412;
 Mon, 3 Dec 2018 22:50:51 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : cc : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02;
 bh=qZ2/E91RktHEdEY9lZtRh1qWqJ5k9Sf2NRdp9guK9rA=;
 b=fCYBxAriDbvvx2Ee1/SPAxgWNlpdJfxnAur32UAMMPA22NAwRGFsB4M4afpw6RI21aeJ
 3jCK8q74ylca7uxTzOLV28yQwkR62OxqAfAkJ4uB42YVpZcZ1TzxB2IJOT7CXQS7WKRt
 bO+EnrmJ6+D+0xsleZp4Q8gvGr16VI95ICOlQaSyUW7JRHT+/ZZDimwzx8EQr40NFWD6
 DtZdsDvwgvzOiz2KU7iRxd1nW/uqRW4Gme51ZG8Iv+tZJO66xIKZXDrcgHTSX4jJPOmw
 LAiksEAynobw4neRVtu9G1v55k3pgiIusqg9inYe5EL6gttAfjYY2ZV3UCSFj0z1TbGD 8w== 
Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])
 by userp2130.oracle.com with ESMTP id 2p3hqts8r5-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Mon, 03 Dec 2018 22:50:51 +0000
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
 by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wB3Monlc008176
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Mon, 3 Dec 2018 22:50:50 GMT
Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24])
 by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wB3Moneh007547;
 Mon, 3 Dec 2018 22:50:49 GMT
MIME-Version: 1.0
Message-ID: <9bda9cb4-42bb-4e89-b73e-fb0b62443b6c@default>
Date: Mon, 3 Dec 2018 14:50:48 -0800 (PST)
From: Drew Adams <drew.adams@HIDDEN>
To: Phil Sainty <psainty@HIDDEN>
Subject: RE: bug#33601: 26; Add macro `with-hook-added'
References: <6871371f-5c46-46f2-9a92-b1c154ec5a73@default>
 <0b15a9be-6f19-4569-93fd-1a09a6456b25@default>
 <06d76795115ae2a95f56694a904100ba@HIDDEN>
In-Reply-To: <06d76795115ae2a95f56694a904100ba@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4771.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9096
 signatures=668686
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1810050000 definitions=main-1812030204
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33601
Cc: 33601 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> > Maybe a better name would be `with-function-on-hook' or
> > `with-hook-function-added'.  It is the function, not the
> > hook, that is added (to the hook).
>=20
> True, but `with-hook-added' seems consistent with the name of
> `add-hook' itself (which likewise isn't for creating hooks).

Yeah, that's why I used that name.  I'm OK with any
of those names mentioned so far, and probably with
other alternatives too.

The real question is whether such a macro is useful.
I think it can be.  I gave a couple examples in bug
#33595.  It was those examples that made me think
such a macro might be useful.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.

Message received at 33601 <at> debbugs.gnu.org:


Received: (at 33601) by debbugs.gnu.org; 3 Dec 2018 22:38:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 03 17:38:02 2018
Received: from localhost ([127.0.0.1]:59553 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gTwqo-0002F1-3S
	for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 17:38:02 -0500
Received: from smtp-2.orcon.net.nz ([60.234.4.43]:44343)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1gTwql-0002Ej-Gq
 for 33601 <at> debbugs.gnu.org; Mon, 03 Dec 2018 17:38:00 -0500
Received: from [10.253.37.70] (port=31044 helo=webmail.orcon.net.nz)
 by smtp-2.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>)
 id 1gTwqU-0004Rf-Oc; Tue, 04 Dec 2018 11:37:57 +1300
Received: from wlgwil-nat-office.catalyst.net.nz ([202.78.240.7])
 via [10.253.37.253] by webmail.orcon.net.nz
 with HTTP (HTTP/1.1 POST); Tue, 04 Dec 2018 11:37:42 +1300
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Tue, 04 Dec 2018 11:37:42 +1300
From: Phil Sainty <psainty@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#33601: 26; Add macro `with-hook-added'
In-Reply-To: <0b15a9be-6f19-4569-93fd-1a09a6456b25@default>
References: <6871371f-5c46-46f2-9a92-b1c154ec5a73@default>
 <0b15a9be-6f19-4569-93fd-1a09a6456b25@default>
Message-ID: <06d76795115ae2a95f56694a904100ba@HIDDEN>
X-Sender: psainty@HIDDEN
User-Agent: Orcon Webmail
X-GeoIP: --
X-Spam_score: -2.9
X-Spam_score_int: -28
X-Spam_bar: --
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 33601
Cc: 33601 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 2018-12-04 08:03, Drew Adams wrote:
> Maybe a better name would be `with-function-on-hook' or
> `with-hook-function-added'.  It is the function, not the
> hook, that is added (to the hook).

True, but `with-hook-added' seems consistent with the name of
`add-hook' itself (which likewise isn't for creating hooks).






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.

Message received at 33601 <at> debbugs.gnu.org:


Received: (at 33601) by debbugs.gnu.org; 3 Dec 2018 20:58:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 03 15:58:44 2018
Received: from localhost ([127.0.0.1]:59519 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gTvIi-0007ty-8p
	for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 15:58:44 -0500
Received: from userp2120.oracle.com ([156.151.31.85]:35792)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1gTvIf-0007tg-6K
 for 33601 <at> debbugs.gnu.org; Mon, 03 Dec 2018 15:58:42 -0500
Received: from pps.filterd (userp2120.oracle.com [127.0.0.1])
 by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB3Ks2Eq122645;
 Mon, 3 Dec 2018 20:58:34 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : cc : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02;
 bh=s8z3F1IixAEpPO9XHzJAH+eJu7TotA7LIBVqaIPrsCQ=;
 b=Gr2R4wFucmyPT5AKf8hUtMgQ7fhDSkiFzVebaCMTKut8P9YLKheeCw/TCYevYgzm2dTy
 gj21SqLDmmAh5UVYS4T6SpgN0lWHBMgOzzou0JSlkfJ+Hco3Ah6/DI/qrj8GsplQ3VJC
 za1Fz02GVLU3YVHlDrkI5G3FyzTpJeRiylV0L34B1Q3dSpUsBAvf5487BV6QCrX69L06
 xQxNEoC51WNkVjrkLeudySD3Cbvh5XbQHmxUMaP6U8e4/pO1j3BmuRpU+NWBljPqfVUv
 qgi/mzxEJAv9L/spwCZv2xRc2IHViQUKlwM7Be7Z0oOWBxR1fv+bYCIQ9rtHHakPLYkh Zw== 
Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])
 by userp2120.oracle.com with ESMTP id 2p3jxr8qby-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Mon, 03 Dec 2018 20:58:34 +0000
Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])
 by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wB3KwX1C025604
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Mon, 3 Dec 2018 20:58:34 GMT
Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24])
 by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wB3KwXC2012308;
 Mon, 3 Dec 2018 20:58:33 GMT
MIME-Version: 1.0
Message-ID: <9ec21508-b387-4178-9701-e17b2501d7be@default>
Date: Mon, 3 Dec 2018 12:58:31 -0800 (PST)
From: Drew Adams <drew.adams@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Subject: RE: bug#33601: 26; Add macro `with-hook-added'
References: <6871371f-5c46-46f2-9a92-b1c154ec5a73@default>
 <fjsgzexwmy.fsf@HIDDEN>
In-Reply-To: <fjsgzexwmy.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4771.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9096
 signatures=668686
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=813
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1810050000 definitions=main-1812030190
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33601
Cc: 33601 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> FYI your customized bug reporting is (I assume) messing up the
> version number in the subject of your reports.

Thanks.  Yes, in Emacs 26 vanilla emacsbug.el changed the
way it reports the version number in the Subject line.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.

Message received at 33601 <at> debbugs.gnu.org:


Received: (at 33601) by debbugs.gnu.org; 3 Dec 2018 19:03:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 03 14:03:21 2018
Received: from localhost ([127.0.0.1]:59412 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gTtV2-0004nC-8A
	for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 14:03:21 -0500
Received: from aserp2120.oracle.com ([141.146.126.78]:58546)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1gTtUz-0004mu-IM
 for 33601 <at> debbugs.gnu.org; Mon, 03 Dec 2018 14:03:18 -0500
Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1])
 by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB3IwjWL036242
 for <33601 <at> debbugs.gnu.org>; Mon, 3 Dec 2018 19:03:10 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02;
 bh=IraldzJtr5IZGrNasUJrI1q9dZixGrr2F5fWaS9bFSU=;
 b=nYBHFlQ4g4+keuqS3TiGsFqBC1yu2mX05KAgJWfGRPpqt8VDSiBmBJPPcZ5XjOg2v5d3
 1CxrNxp7Srzvy6AALS3njWBTOBREOLj6Gd9Idd8AXuDEhI5jAYZActgAPKk3U3EnRnXq
 vxaUuOHdAezjk7Qcn9pSK47OkpnyWkATKjs40EiAwHKlgUJIq90E8BsFBlWzY5OW4FwP
 hgQMiHE5qZ7G9gi0ovYfUmAuC7txXnl6dhv17SwitOhEDc+dnIjAdabIGf5YAuNyqwGD
 vbJIymLJ0FJOwP3OPhZ+vXeRpQHFdvU/97e3ugFXYP4gPRBadEkAtZZ5UKNP/bQX7uUj dQ== 
Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])
 by aserp2120.oracle.com with ESMTP id 2p3j8q891h-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <33601 <at> debbugs.gnu.org>; Mon, 03 Dec 2018 19:03:10 +0000
Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])
 by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wB3J3Agf009499
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <33601 <at> debbugs.gnu.org>; Mon, 3 Dec 2018 19:03:10 GMT
Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24])
 by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wB3J39xO028987
 for <33601 <at> debbugs.gnu.org>; Mon, 3 Dec 2018 19:03:10 GMT
MIME-Version: 1.0
Message-ID: <0b15a9be-6f19-4569-93fd-1a09a6456b25@default>
Date: Mon, 3 Dec 2018 11:03:09 -0800 (PST)
From: Drew Adams <drew.adams@HIDDEN>
To: 33601 <at> debbugs.gnu.org
Subject: RE: bug#33601: 26; Add macro `with-hook-added'
References: <6871371f-5c46-46f2-9a92-b1c154ec5a73@default>
In-Reply-To: <6871371f-5c46-46f2-9a92-b1c154ec5a73@default>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4771.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9096
 signatures=668686
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=13
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=568
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1810050000 definitions=main-1812030175
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33601
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Maybe a better name would be `with-function-on-hook' or
`with-hook-function-added'.  It is the function, not the
hook, that is added (to the hook).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.

Message received at 33601 <at> debbugs.gnu.org:


Received: (at 33601) by debbugs.gnu.org; 3 Dec 2018 19:01:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 03 14:01:45 2018
Received: from localhost ([127.0.0.1]:59407 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gTtTU-0004kd-TO
	for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 14:01:45 -0500
Received: from eggs.gnu.org ([208.118.235.92]:53838)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rgm@HIDDEN>) id 1gTtTS-0004kL-U4
 for 33601 <at> debbugs.gnu.org; Mon, 03 Dec 2018 14:01:43 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rgm@HIDDEN>) id 1gTtTI-0001wL-Dt
 for 33601 <at> debbugs.gnu.org; Mon, 03 Dec 2018 14:01:37 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33228)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rgm@HIDDEN>)
 id 1gTtTE-0001ui-7B; Mon, 03 Dec 2018 14:01:28 -0500
Received: from rgm by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rgm@HIDDEN>)
 id 1gTtTD-0005E0-0a; Mon, 03 Dec 2018 14:01:27 -0500
From: Glenn Morris <rgm@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#33601: 26; Add macro `with-hook-added'
References: <6871371f-5c46-46f2-9a92-b1c154ec5a73@default>
X-Spook: Telecommunications Drug Administration Exposure USDOJ
X-Ran: l}Z\&,C!Kp~?*5`\iE`d-4OwV(i,TZLI^2wR9#$+"varGdX0r09vM/k?H*$yWk7MOJ)M/|
X-Hue: red
X-Attribution: GM
Date: Mon, 03 Dec 2018 14:01:25 -0500
In-Reply-To: <6871371f-5c46-46f2-9a92-b1c154ec5a73@default> (Drew Adams's
 message of "Mon, 3 Dec 2018 10:47:12 -0800 (PST)")
Message-ID: <fjsgzexwmy.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33601
Cc: 33601 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

Drew Adams wrote:

> Enhancement request:

Please write "Severity: wishlist" as the first line of the message body.

Also, FYI your customized bug reporting is (I assume) messing up the
version number in the subject of your reports.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Dec 2018 18:47:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 03 13:47:29 2018
Received: from localhost ([127.0.0.1]:59397 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gTtFh-0004N3-K0
	for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 13:47:29 -0500
Received: from eggs.gnu.org ([208.118.235.92]:50451)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1gTtFe-0004Mo-G2
 for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 13:47:27 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1gTtFY-0003qG-C7
 for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 13:47:21 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:34891)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <drew.adams@HIDDEN>)
 id 1gTtFY-0003qB-8l
 for submit <at> debbugs.gnu.org; Mon, 03 Dec 2018 13:47:20 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60043)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1gTtFX-0004Mg-0y
 for bug-gnu-emacs@HIDDEN; Mon, 03 Dec 2018 13:47:20 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1gTtFT-0003oA-RQ
 for bug-gnu-emacs@HIDDEN; Mon, 03 Dec 2018 13:47:18 -0500
Received: from userp2130.oracle.com ([156.151.31.86]:44254)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <drew.adams@HIDDEN>)
 id 1gTtFT-0003nb-I3
 for bug-gnu-emacs@HIDDEN; Mon, 03 Dec 2018 13:47:15 -0500
Received: from pps.filterd (userp2130.oracle.com [127.0.0.1])
 by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wB3IcWHI050474
 for <bug-gnu-emacs@HIDDEN>; Mon, 3 Dec 2018 18:47:13 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : subject : content-type :
 content-transfer-encoding; s=corp-2018-07-02;
 bh=GZ1v0b9JZpZqY7T1c2FvSx8EYSs70YXYIMf/R7oIj1A=;
 b=wolZhwBFzU6LdVloep0eup0Wyg0XT/TczJzFxXezdLc8SU8MYlw8tOQjYNOkh3JcrHjq
 lm8d2L7k/hwiU6Y+r56+3ka8UaldpG41rXL3kOwkYG371sZDNwfdtIhvf9hstvzd4mbz
 cX+9HZhamXTBBe7tPR/ePdIp+h6a/PMLPgrJ8HhivRnso9vpgwbanV1XuWdex0LbVeRh
 0GGK9scO3vrLhJnjrK9AcoWzOoFvzpecqvdnevt3aEEI7lAmfAkR0ngChz6RIybxvAvC
 ZDwY8beHOye8T4PBvxnGIf1NYc9HMnAJlYNJP1gsjEirP9wkzAXH8NcBxpsZroBqTs/v XQ== 
Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])
 by userp2130.oracle.com with ESMTP id 2p3hqtr6fd-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Mon, 03 Dec 2018 18:47:13 +0000
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
 by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wB3IlD2C005806
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Mon, 3 Dec 2018 18:47:13 GMT
Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24])
 by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wB3IlDCT018859
 for <bug-gnu-emacs@HIDDEN>; Mon, 3 Dec 2018 18:47:13 GMT
MIME-Version: 1.0
Message-ID: <6871371f-5c46-46f2-9a92-b1c154ec5a73@default>
Date: Mon, 3 Dec 2018 10:47:12 -0800 (PST)
From: Drew Adams <drew.adams@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 26; Add macro `with-hook-added'
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4771.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9096
 signatures=668686
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1810050000 definitions=main-1812030172
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Enhancement request: Please consider adding a macro such as this, to
facilitate temporary use of a hook function.

(defmacro with-hook-added (hook function &rest body)
  "Evaluate forms in BODY with FUNCTION added to HOOK, then remove FUNCTION=
."
  (declare (indent 1) (debug t))
  `(unwind-protect (progn (add-hook ',hook ',function) ,@body)
     (remove-hook ',hook ',function)))

In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-05-30
Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
Windowing system distributor `Microsoft Corp.', version 10.0.16299
Configured using:
 `configure --without-dbus --host=3Dx86_64-w64-mingw32
 --without-compress-install 'CFLAGS=3D-O2 -static -g3''




Acknowledgement sent to Drew Adams <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#33601; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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