Re: [PATCH] emacs: Avoid deprecated function flet
authorAustin Clements <amdragon@MIT.EDU>
Mon, 20 May 2013 17:04:39 +0000 (13:04 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:54:52 +0000 (09:54 -0800)
98/6a582f6e5f00d52d93d6c0f1179208a49f07af [new file with mode: 0644]

diff --git a/98/6a582f6e5f00d52d93d6c0f1179208a49f07af b/98/6a582f6e5f00d52d93d6c0f1179208a49f07af
new file mode 100644 (file)
index 0000000..c137bfe
--- /dev/null
@@ -0,0 +1,118 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 0C6DE431FB6\r
+       for <notmuch@notmuchmail.org>; Mon, 20 May 2013 10:04:54 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id DNMNe6-yd7hm for <notmuch@notmuchmail.org>;\r
+       Mon, 20 May 2013 10:04:46 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU\r
+       [18.9.25.13])\r
+       by olra.theworths.org (Postfix) with ESMTP id 44CC0431FBC\r
+       for <notmuch@notmuchmail.org>; Mon, 20 May 2013 10:04:46 -0700 (PDT)\r
+X-AuditID: 1209190d-b7f716d000005557-73-519a57ab4694\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+       by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id A5.51.21847.BA75A915; Mon, 20 May 2013 13:04:43 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH-1.MIT.EDU [18.9.28.11])\r
+       by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id r4KH4fSM001529; \r
+       Mon, 20 May 2013 13:04:43 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r4KH4d7L010407\r
+       (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+       Mon, 20 May 2013 13:04:40 -0400\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+       (envelope-from <amdragon@MIT.EDU>)\r
+       id 1UeTVn-0007xY-85; Mon, 20 May 2013 13:04:39 -0400\r
+Date: Mon, 20 May 2013 13:04:39 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: David Bremner <david@tethera.net>\r
+Subject: Re: [PATCH] emacs: Avoid deprecated function flet\r
+Message-ID: <20130520170439.GG5999@mit.edu>\r
+References: <87vc6fjjdp.fsf@zancas.localnet>\r
+       <1368976447-5153-1-git-send-email-amdragon@mit.edu>\r
+       <8761ydr6xm.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <8761ydr6xm.fsf@zancas.localnet>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IR4hRV1l0dPivQ4P9TCYsbrd2MFtdvzmR2\r
+       YPJ4tuoWs8eWQ++ZA5iiuGxSUnMyy1KL9O0SuDKmfNnGUnCTt2LZ3V0sDYyTuLsYOTgkBEwk\r
+       dv826WLkBDLFJC7cW8/WxcjFISSwj1Fi0boj7BDORkaJJR8nQmVOM0k0rLoK5SxhlNh98wEb\r
+       SD+LgKrEzst/WEBsNgENiW37lzOC2CJA8avbJoPVMAtIS3z73cwEslpYwEqis40HJMwroC1x\r
+       fPp1ZoiZrYwS208dZIFICEqcnPmEBaJXS+LGv5dgvSBzlv/jAAlzCuhKbFy1kAnEFhVQkZhy\r
+       chvbBEahWUi6ZyHpnoXQvYCReRWjbEpulW5uYmZOcWqybnFyYl5eapGukV5uZoleakrpJkZw\r
+       WEvy7mB8d1DpEKMAB6MSD6+A4axAIdbEsuLK3EOMkhxMSqK8m8OAQnxJ+SmVGYnFGfFFpTmp\r
+       xYcYJTiYlUR4o3/PDBTiTUmsrEotyodJSXOwKInzXkm56S8kkJ5YkpqdmlqQWgSTleHgUJLg\r
+       PQIyVLAoNT21Ii0zpwQhzcTBCTKcB2j4OZAa3uKCxNzizHSI/ClGRSlx3lMgCQGQREZpHlwv\r
+       LO28YhQHekWY9wJIFQ8wZcF1vwIazAQ0eLslyNXFJYkIKakGxuiylTJL+P65JM0NnHrunoaz\r
+       pK7QpEWx/VpXr8n819tw77Drvfl6Zxu16l738PgIJ1SeM8jc5fI6uIObPblasXFLxHGRmy6/\r
+       r05Nt9F+1JMx6cl2Z3Xurmd/TXter5jRxxi0o+a5Jd92TuWjTtqVJy98aNJlWsfAV1kac2SX\r
+       6+bjh7IeJjRYKbEUZyQaajEXFScCAFPaWBMWAwAA\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 20 May 2013 17:04:54 -0000\r
+\r
+Quoth David Bremner on May 20 at 12:45 pm:\r
+> Austin Clements <amdragon@MIT.EDU> writes:\r
+> \r
+> > flet was deprecated in Emacs 24.3 and replaced with cl-flet.  However,\r
+> > cl-flet lexically binds the function symbol, while we depend on flet\r
+> > dynamically binding the function symbol.  Hence, this patch replaces\r
+> > the deprecated flet use with letf, which lets us dynamically bind the\r
+> > function symbol, while remaining compatible with both Emacs 23 and 24.\r
+> \r
+> The bad news: letf is also marked as obsolete, although there is no\r
+> yelling from the byte-compiler yet.\r
+\r
+>From what I understand, all non-cl-prefixed functions are now\r
+considered obsolete, but the non-prefixed aliases are going to have to\r
+stick around for a long time and we won't be able to use the prefixed\r
+ones until we drop support for pre-24.3 Emacs.\r
+\r
+flet is a more complicated story, since it was deprecated not just in\r
+name, but in semantics, which I think is why the compiler singles it\r
+out.\r
+\r
+> In my simple tests, it _seemed_ to work to replace letf with cl-letf,\r
+> although\r
+> \r
+> - that would require some kind of compatability alias\r
+> - the docstring for letf mutters something about "deprecated usage of\r
+>   `symbol-function' in place forms.\r
+> \r
+> On the third hand, \r
+> \r
+>    http://www.gnu.org/software/emacs/manual/html_node/elisp/Setting-Generalized-Variables.html#Setting-Generalized-Variables \r
+> \r
+> suggests using symbol-function with setf is legitimate.\r
+\r
+My concern would be that letf is a cl function, and cl's documentation\r
+does *not* list symbol-function as a supported generalized variable:\r
+\r
+  http://www.gnu.org/software/emacs/manual/html_mono/cl.html#Setf-Extensions\r
+\r
+We should probably just use fset in an unwind-protect.\r