From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#33601: 26; Add macro `with-hook-added' Date: Mon, 3 Dec 2018 10:47:12 -0800 (PST) Message-ID: <6871371f-5c46-46f2-9a92-b1c154ec5a73@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1543862778 18014 195.159.176.226 (3 Dec 2018 18:46:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 3 Dec 2018 18:46:18 +0000 (UTC) To: 33601@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 03 19:46:14 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gTtET-0004ZO-FD for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Dec 2018 19:46:13 +0100 Original-Received: from localhost ([::1]:51399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTtGZ-00052n-Od for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Dec 2018 13:48:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTtGP-00052K-9m for bug-gnu-emacs@gnu.org; Mon, 03 Dec 2018 13:48:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTtGK-00048p-9S for bug-gnu-emacs@gnu.org; Mon, 03 Dec 2018 13:48:11 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55139) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gTtGE-00046s-Fg for bug-gnu-emacs@gnu.org; Mon, 03 Dec 2018 13:48:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gTtGE-0004Nv-DY for bug-gnu-emacs@gnu.org; Mon, 03 Dec 2018 13:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Dec 2018 18:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33601 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.154386285016809 (code B ref -1); Mon, 03 Dec 2018 18:48:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Dec 2018 18:47:30 +0000 Original-Received: from localhost ([127.0.0.1]:59397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gTtFh-0004N3-K0 for submit@debbugs.gnu.org; Mon, 03 Dec 2018 13:47:29 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gTtFe-0004Mo-G2 for submit@debbugs.gnu.org; Mon, 03 Dec 2018 13:47:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTtFY-0003qG-C7 for submit@debbugs.gnu.org; Mon, 03 Dec 2018 13:47:21 -0500 Original-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 ) id 1gTtFY-0003qB-8l for submit@debbugs.gnu.org; Mon, 03 Dec 2018 13:47:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTtFX-0004Mg-0y for bug-gnu-emacs@gnu.org; Mon, 03 Dec 2018 13:47:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTtFT-0003oA-RQ for bug-gnu-emacs@gnu.org; Mon, 03 Dec 2018 13:47:18 -0500 Original-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 ) id 1gTtFT-0003nb-I3 for bug-gnu-emacs@gnu.org; Mon, 03 Dec 2018 13:47:15 -0500 Original-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 ; 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== Original-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 ; Mon, 03 Dec 2018 18:47:13 +0000 Original-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 ; Mon, 3 Dec 2018 18:47:13 GMT Original-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 ; Mon, 3 Dec 2018 18:47:13 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4771.0 (x86)] 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153022 Archived-At: 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''