From unknown Mon Jun 23 14:58:52 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#19324 <19324@debbugs.gnu.org> To: bug#19324 <19324@debbugs.gnu.org> Subject: Status: 25.0.50; add-function and nil Reply-To: bug#19324 <19324@debbugs.gnu.org> Date: Mon, 23 Jun 2025 21:58:52 +0000 retitle 19324 25.0.50; add-function and nil reassign 19324 emacs submitter 19324 Leo Liu severity 19324 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 08 23:56:00 2014 Received: (at submit) by debbugs.gnu.org; 9 Dec 2014 04:56:00 +0000 Received: from localhost ([127.0.0.1]:58457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XyCq8-00032L-BL for submit@debbugs.gnu.org; Mon, 08 Dec 2014 23:56:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59025) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XyCq6-00032B-8s for submit@debbugs.gnu.org; Mon, 08 Dec 2014 23:55:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyCpx-00029B-00 for submit@debbugs.gnu.org; Mon, 08 Dec 2014 23:55:57 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyCpw-000297-TR for submit@debbugs.gnu.org; Mon, 08 Dec 2014 23:55:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyCpn-0005eL-Kq for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2014 23:55:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyCpe-00027K-Jx for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2014 23:55:39 -0500 Received: from mail-pd0-x22e.google.com ([2607:f8b0:400e:c02::22e]:50172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyCpe-00027B-BQ for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2014 23:55:30 -0500 Received: by mail-pd0-f174.google.com with SMTP id fp1so6242317pdb.33 for ; Mon, 08 Dec 2014 20:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=4X53dGtOOZxqIoT/2+urvEyEaxL8HtBvfrnyP6ARykI=; b=Z9UeeHgiIRT2XNum0RnalgwUZO+Nk3vq0AH5eoVsCHNVs3DBRj/kpqMPcc9S2+7YiZ qWbjLdOt3dHF4a93P2wkLJLTKnGFmXTNgbmJK5mJMwaW2sGgJkEMAunXmQsW0ZVmA77c HZWqcnmvAxrphuT6FFIPY5DSOj8Y0EiOlAlqsElLkWHpjGf866J5XoO8xoptjbKbFUWS l/rAjCP9uMQaOj5pRZmuoO+4NLsgIkUBCcmZpcpTszeMGpafGkjScHmMDNMsaO6QVw2/ VNngOLH5Df13jvHKfNPDi0wiXw8i/rcx90ekt+ONlxANqY3esfTICqgbsLqpe8Phnm/C LJDA== X-Received: by 10.66.248.36 with SMTP id yj4mr1701717pac.51.1418100928818; Mon, 08 Dec 2014 20:55:28 -0800 (PST) Received: from fortuna ([221.222.145.182]) by mx.google.com with ESMTPSA id ni9sm140859pdb.36.2014.12.08.20.55.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Dec 2014 20:55:28 -0800 (PST) From: Leo Liu To: bug-gnu-emacs@gnu.org Subject: 25.0.50; add-function and nil X-Debbugs-CC: Stefan Monnier Date: Tue, 09 Dec 2014 12:55:22 +0800 Message-ID: <87vbllxw05.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 1. Goto a buffer (e.g. text-mode) with eldoc-documentation-function nil 2. (add-function :after-until (local 'eldoc-documentation-function) #'ignore) 3. Move around to trigger eldoc error: (void-function nil) Looks like the orig function is unconditionally called without checking it's a function object. Leo From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 10 14:54:48 2014 Received: (at 19324) by debbugs.gnu.org; 10 Dec 2014 19:54:48 +0000 Received: from localhost ([127.0.0.1]:41981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XynLT-0006Ej-Nt for submit@debbugs.gnu.org; Wed, 10 Dec 2014 14:54:48 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:33073) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XynLQ-0006EY-B8 for 19324@debbugs.gnu.org; Wed, 10 Dec 2014 14:54:45 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sBAJshoK005737; Wed, 10 Dec 2014 14:54:43 -0500 Received: by ceviche.home (Postfix, from userid 20848) id E7C616610C; Wed, 10 Dec 2014 14:54:42 -0500 (EST) From: Stefan Monnier To: Leo Liu Subject: Re: bug#19324: 25.0.50; add-function and nil Message-ID: References: <87vbllxw05.fsf@gmail.com> Date: Wed, 10 Dec 2014 14:54:42 -0500 In-Reply-To: <87vbllxw05.fsf@gmail.com> (Leo Liu's message of "Tue, 09 Dec 2014 12:55:22 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5151=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5151> : inlines <1621> : streams <1354805> : uri <1838052> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 19324 Cc: 19324@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > 1. Goto a buffer (e.g. text-mode) with eldoc-documentation-function nil > 2. (add-function :after-until (local 'eldoc-documentation-function) #'ignore) > 3. Move around to trigger eldoc error: (void-function nil) > Looks like the orig function is unconditionally called without checking > it's a function object. Indeed. But I don't think advice.el should handle this case. IOW the way I see it there are 2 ways to fix this problem: - Change the default value so it's always a function. - Make sure all the functions you add use either :override or :around and check that the orig is not nil before calling it. Obviously, the first option is much better, which is why I've been changing various foo-function variables so that their default value is not nil. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 10 19:57:54 2014 Received: (at 19324) by debbugs.gnu.org; 11 Dec 2014 00:57:54 +0000 Received: from localhost ([127.0.0.1]:42133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xys4n-000742-Rs for submit@debbugs.gnu.org; Wed, 10 Dec 2014 19:57:54 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:43809) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xys4l-00073m-Gc for 19324@debbugs.gnu.org; Wed, 10 Dec 2014 19:57:52 -0500 Received: by mail-pa0-f54.google.com with SMTP id fb1so3924482pad.27 for <19324@debbugs.gnu.org>; Wed, 10 Dec 2014 16:57:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=fcTSEdvophiMPTqAkM73r+de0LEH3Jhd+HrP/4Mq8So=; b=gdGOeusn4Jj9cd04vljawcnRdMORajKqNY+3kxgi+GjGoLrCXaa80uti6VVrRFsHsC kmn+EuOdFdzMry5l0hK1DVFZbpQGOfmYF4LkUUKpvHB2tA4LlLiD9SVrOX9HsFo2LEAX qu9/bwl1I/lJu5tOEwHT3k05kYudxmA5lABgzEtUBASrUVYQ/wEMckM+ma/CraJ+YynC M2rDDIqEPL+C85Azt3o5O1gKRbn64YvPTNA7cq31yZZiGD2Kray5IGbY+4FFe7hyGjVe gB/TM5E8LqzxwOuSDSdSsNWPYb4olfsHfi5ZbJ8pJNhZGC4PXH6wNMUtLQz/GXbbNbGl 0CcQ== X-Received: by 10.70.43.138 with SMTP id w10mr12127720pdl.50.1418259464148; Wed, 10 Dec 2014 16:57:44 -0800 (PST) Received: from fortuna ([114.248.243.62]) by mx.google.com with ESMTPSA id m4sm5278855pdm.60.2014.12.10.16.57.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Dec 2014 16:57:43 -0800 (PST) From: Leo Liu To: Stefan Monnier Subject: Re: bug#19324: 25.0.50; add-function and nil References: <87vbllxw05.fsf@gmail.com> Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoAgMAAADxkFD+AAAADFBMVEUvT09qWs3/pQD///+J kUVcAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cBBwMLOd3veKQA AACuSURBVBjTldE9CgIxEAXgB+lEyFUC2wo5ikdZ8DSypxhMY7H9VuIVwlqkGRgnm59VsHGafIQ3 CZlAtmKIRaHETgYa12lqvEsPYKf8wXHsPGfqPaUM0g9aJPKFXkmNQmSDqwzz4Fpgpz+6WAPY2z5o uPJJpu0uypcl4nyCibMLQ8lCiVjayLoQvw5LsVKQuHPRR958HZbOcVsKeepcLxpByjycGvnKmY+c MBvrtyjfe0vmuLvdq/kAAAAASUVORK5CYII= Date: Thu, 11 Dec 2014 08:57:33 +0800 In-Reply-To: (Stefan Monnier's message of "Wed, 10 Dec 2014 14:54:42 -0500") Message-ID: <87bnnbt342.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (CentOS Linux 7 (Core)) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19324 Cc: 19324@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2014-12-10 14:54 -0500, Stefan Monnier wrote: > - Make sure all the functions you add use either :override or :around > and check that the orig is not nil before calling it. Yes, I had expected this to work and obviously not so filed this bug. Otherwise it is not a bad workaround. Go to a buffer in text mode where the default eldoc-documentation-function is nil and eval (add-function :around (local 'eldoc-documentation-function) (lambda (orig) (or (and orig (funcall orig)) (ignore)))) Move around to get the error. Leo From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 10 21:48:54 2014 Received: (at 19324) by debbugs.gnu.org; 11 Dec 2014 02:48:54 +0000 Received: from localhost ([127.0.0.1]:42156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XytoE-0001PB-AJ for submit@debbugs.gnu.org; Wed, 10 Dec 2014 21:48:54 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:51738) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XytoD-0001P4-CJ for 19324@debbugs.gnu.org; Wed, 10 Dec 2014 21:48:53 -0500 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sBB2mpeT009455; Wed, 10 Dec 2014 21:48:51 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 5A4CE660F3; Wed, 10 Dec 2014 21:48:51 -0500 (EST) From: Stefan Monnier To: Leo Liu Subject: Re: bug#19324: 25.0.50; add-function and nil Message-ID: References: <87vbllxw05.fsf@gmail.com> <87bnnbt342.fsf@gmail.com> Date: Wed, 10 Dec 2014 21:48:51 -0500 In-Reply-To: <87bnnbt342.fsf@gmail.com> (Leo Liu's message of "Thu, 11 Dec 2014 08:57:33 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5151=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5151> : inlines <1625> : streams <1354959> : uri <1838085> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 19324 Cc: 19324@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Yes, I had expected this to work and obviously not so filed this bug. > Otherwise it is not a bad workaround. > Go to a buffer in text mode where the default > eldoc-documentation-function is nil and eval > (add-function :around (local 'eldoc-documentation-function) > (lambda (orig) (or (and orig (funcall orig)) (ignore)))) > Move around to get the error. Ah, right, damn: the (local ) causes the insertion of a "proxy function" which runs the global value, but that doesn't check if it's nil. IOW it only works for :override. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 10 22:55:38 2014 Received: (at submit) by debbugs.gnu.org; 11 Dec 2014 03:55:38 +0000 Received: from localhost ([127.0.0.1]:42209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xyuqn-00037Y-1g for submit@debbugs.gnu.org; Wed, 10 Dec 2014 22:55:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36064) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xyuqk-00037G-Lb for submit@debbugs.gnu.org; Wed, 10 Dec 2014 22:55:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyuqV-0008F3-As for submit@debbugs.gnu.org; Wed, 10 Dec 2014 22:55:29 -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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FSL_HELO_BARE_IP_2,RCVD_NUMERIC_HELO autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyuqV-0008Ez-8R for submit@debbugs.gnu.org; Wed, 10 Dec 2014 22:55:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyuqN-0003GV-Oe for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2014 22:55:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyuqG-0007y1-9k for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2014 22:55:11 -0500 Received: from plane.gmane.org ([80.91.229.3]:38731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyuqG-0007wp-3r for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2014 22:55:04 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XyuqE-0000Lk-3p for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2014 04:55:02 +0100 Received: from 114.248.243.62 ([114.248.243.62]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Dec 2014 04:55:02 +0100 Received: from sdl.web by 114.248.243.62 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Dec 2014 04:55:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Leo Liu Subject: Re: bug#19324: 25.0.50; add-function and nil Date: Thu, 11 Dec 2014 11:54:50 +0800 Lines: 8 Message-ID: <877fxyu9h1.fsf@gmail.com> References: <87vbllxw05.fsf@gmail.com> <87bnnbt342.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 114.248.243.62 Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAGFBMVEUKDAg1NjRWV1V9fnyg op/DxcLk5uP8/voi63ReAAAACXBIWXMAAAWJAAAFiQFtaJ36AAAAB3RJTUUH1goZAgAz00bgXgAA AeVJREFUKM9lk0Fz2jAQhQXJD3CCO70CmcC1YMtcWyTZ14Bl69xats4N9r6/3zWQBlodNKNPu/s0 b1cCQFuZGpfVVh3vAvBJolIXRkapSuoRUtIdFyo1Y5xSdlAj7OtvD1XnXxmWRi+eWgcxyCed1lVV B1CrKyujMoi+eLA5kU1SsjoHlW+nQjTtFxk4MXgrOxvIqzoTZR8XgPaLl419zgsMaSGFPiUOZCIh thsx5Xy9NsK8Kwf/JoQgMxcVJ301HKkcSWaT0O7FY056J4U9xcYfnmVXG4801lW6lqwu2nKFZoHC HuzvaTVndZ+LaRQgZdthXw1cpynEkLEwyFHXk/aIxNQ6QeooJuzPMB+wn+D7JJNsiCcVA13/A3h/ xE9J+WidpAwoYNmRFwyvSRhNVtsdaAewzZZP5uw82QL9+tyNfocyP0McAzICUr5Mk9RdIjWasUNx aIIt6NK4ZtXIMdfMQt3nuMAyWbLI4DqZ4xPq/ag8jPond4XU/cLuOgw6XCFX/YCUfcDAMMH58fD4 G9kDchwfqVefkBwup2uZM+Q4WhJt5jN3AxXCsaS2yXEDuWgS8VOzW0gFjhEPmLyFMKBFaLb1HRwc DiaKwx0EeTMRYnYPQRW3PP4HApvlMv0PttX5v/D6Aws3IOSEwzmLAAAAAElFTkSuQmCC User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (CentOS Linux 7 (Core)) Cancel-Lock: sha1:R72kuGNGVM0kfC+yt9lM2bSEKjA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 2014-12-10 21:48 -0500, Stefan Monnier wrote: > Ah, right, damn: the (local ) causes the insertion of a "proxy > function" which runs the global value, but that doesn't check if it's > nil. IOW it only works for :override. Sounds like a bug ;) Leo From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 11 12:01:39 2014 Received: (at 19324) by debbugs.gnu.org; 11 Dec 2014 17:01:39 +0000 Received: from localhost ([127.0.0.1]:42970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xz77T-0000E5-1A for submit@debbugs.gnu.org; Thu, 11 Dec 2014 12:01:39 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:13582) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xz77R-0000Dq-7A for 19324@debbugs.gnu.org; Thu, 11 Dec 2014 12:01:37 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflRFxIoH/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIxALDiYSFBgNJIhKCdZZAQEBAQEFAQEBAQEdkG8HhEgFiwGkLoF4hBkhgncBAQE X-IPAS-Result: Aj8PAOwQflRFxIoH/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIxALDiYSFBgNJIhKCdZZAQEBAQEFAQEBAQEdkG8HhEgFiwGkLoF4hBkhgncBAQE X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="100204262" Received: from 69-196-138-7.dsl.teksavvy.com (HELO pastel.home) ([69.196.138.7]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Dec 2014 12:01:31 -0500 Received: by pastel.home (Postfix, from userid 20848) id 63457262D; Thu, 11 Dec 2014 12:01:31 -0500 (EST) From: Stefan Monnier To: Leo Liu Subject: Re: bug#19324: 25.0.50; add-function and nil Message-ID: References: <87vbllxw05.fsf@gmail.com> <87bnnbt342.fsf@gmail.com> <877fxyu9h1.fsf@gmail.com> Date: Thu, 11 Dec 2014 12:01:31 -0500 In-Reply-To: <877fxyu9h1.fsf@gmail.com> (Leo Liu's message of "Thu, 11 Dec 2014 11:54:50 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19324 Cc: 19324@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> Ah, right, damn: the (local ) causes the insertion of a "proxy >> function" which runs the global value, but that doesn't check if it's >> nil. IOW it only works for :override. > Sounds like a bug ;) Indeed, I fixed the eldoc-documentation-function not to be nil. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 11 12:46:42 2014 Received: (at 19324) by debbugs.gnu.org; 11 Dec 2014 17:46:42 +0000 Received: from localhost ([127.0.0.1]:43030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xz7p3-0001QM-WC for submit@debbugs.gnu.org; Thu, 11 Dec 2014 12:46:42 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:49040) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xz7p2-0001Q1-1L for 19324@debbugs.gnu.org; Thu, 11 Dec 2014 12:46:40 -0500 Received: by mail-pa0-f44.google.com with SMTP id et14so5472121pad.31 for <19324@debbugs.gnu.org>; Thu, 11 Dec 2014 09:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=mJcYxZIn7PgE/9BT6HIDhnPeLeU7eHgaGYCTMmGP3gU=; b=S6JjZAQiJGv0zLAq68906VlVQgyWJbhWlAvzAKMi0o8XDWBajTxlWHWHmjthtC8cQ2 M+85znzD31XajQz3cDzYeY8C5DFDaTg/1sRnHv/WYkOYM7c2j2pjzfvzKaSOItnF8ndM p4WYge0sJoqozdhERvy3StOqxOUYZ+Hcc9nNZp14oIjOscmd/iN4g6be9UnGYfwUJo2z iAzKXBDyj9O2jM8wd//J2IzE9H1buqZaG8k2j/olmNt/r5ge8A56Da+bgKZdO9vVYe9T CRzm/DiAhx0fQw3Wkxhwa7TQJCrgutV267PB93Ob8IWg9Xb0Sjgq4Zu148pYFSCcl/HW PpFQ== X-Received: by 10.68.134.164 with SMTP id pl4mr18954912pbb.128.1418319993885; Thu, 11 Dec 2014 09:46:33 -0800 (PST) Received: from fortuna ([114.248.243.62]) by mx.google.com with ESMTPSA id w5sm1955413pds.25.2014.12.11.09.46.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Dec 2014 09:46:33 -0800 (PST) From: Leo Liu To: Stefan Monnier Subject: Re: bug#19324: 25.0.50; add-function and nil References: <87vbllxw05.fsf@gmail.com> <87bnnbt342.fsf@gmail.com> <877fxyu9h1.fsf@gmail.com> Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAG1BMVEUAAAA9Cgm3Hx1WWFWA gn+WmJWsrqv4+vcCAwCRl2MkAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAYoA AAGKATOXMFgAAAAHdElNRQfXAQwDNR+ZJmElAAABIklEQVQoz22SPW+DQAyGWUq65qasd9PNUSX4 AZHK2C1rJy5jpDS4IwRVup9dn7GNafpKIPPgzztXFSujqq1eM2n8h22oMkvxI/i9C97kRfMRUN55 dS3BrsAwBXUtMLAO4lryh8kTjOxKpQNniNxAgZOEe4bZwsDTFhKdqZRLNII4OQNHhEuq/RMkm6Cj TnnEA/fk0BorcYn5qA3oaeAxbaBOLrX+9G48NZ2Fzc2tzDM8Q+tMypEOqYHh8mAWaaK3U/cDMOT5 aMZMABgPXc7zPMs1A8DXO756GFJ/4fMEq47hTsAdn5avoxZ4ywl0c2w4Flu2Ybeyb3S+EqxX2DYA H8veJGEDTnHnrXvRaPyt+2kSfK6rfBZ2tUtfP/mR+pR6sX8BUZ/cDV7tvkoAAAAASUVORK5CYII= Date: Fri, 12 Dec 2014 01:46:27 +0800 In-Reply-To: (Stefan Monnier's message of "Thu, 11 Dec 2014 12:01:31 -0500") Message-ID: <87egs6uljg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (CentOS Linux 7 (Core)) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19324 Cc: 19324@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2014-12-11 12:01 -0500, Stefan Monnier wrote: > Indeed, I fixed the eldoc-documentation-function not to be nil. > > > Stefan But :around are still broken. It promises to pass on ORIG but instead passes a proxy. so the advice has no (public) way to tell missing function. Do you have a fix for this? Otherwise we have to check and set a dummy value to be safe, for example=B9. Leo Footnotes:=20 =B9 https://github.com/leoliu/ggtags/commit/115194cc27dd578b986aaaf0dc390b= b57e9838b2 From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 11 15:29:07 2014 Received: (at 19324) by debbugs.gnu.org; 11 Dec 2014 20:29:08 +0000 Received: from localhost ([127.0.0.1]:43216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XzAMF-0005m1-HI for submit@debbugs.gnu.org; Thu, 11 Dec 2014 15:29:07 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:22137) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XzAMC-0005lH-Fy for 19324@debbugs.gnu.org; Thu, 11 Dec 2014 15:29:05 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQcBAQEBHpA8MweESAWLAaQugXiEGSGCdwEBAQ X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQcBAQEBHpA8MweESAWLAaQugXiEGSGCdwEBAQ X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="100224224" Received: from 206-248-130-192.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Dec 2014 15:28:58 -0500 Received: by pastel.home (Postfix, from userid 20848) id 72F32262D; Thu, 11 Dec 2014 14:11:25 -0500 (EST) From: Stefan Monnier To: Leo Liu Subject: Re: bug#19324: 25.0.50; add-function and nil Message-ID: References: <87vbllxw05.fsf@gmail.com> <87bnnbt342.fsf@gmail.com> <877fxyu9h1.fsf@gmail.com> <87egs6uljg.fsf@gmail.com> Date: Thu, 11 Dec 2014 14:11:25 -0500 In-Reply-To: <87egs6uljg.fsf@gmail.com> (Leo Liu's message of "Fri, 12 Dec 2014 01:46:27 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19324 Cc: 19324@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > But :around are still broken. It promises to pass on ORIG but instead > passes a proxy. So the advice has no (public) way to tell missing > function. Do you have a fix for this? No I don't have a fix for this. `add-function' is designed to work on places that only hold functions, so any other value (such as nil) will create problems. IOW a variable that can hold "either nil or a function" is not something that add-function supports. I guess we could treat nil as an alias for `ignore' in the "proxy function", which would fix this particular issue. See patch below. But I don't intend to handle all the cases in which a "nil function" can show up. Many/most uses of `foo-function' actually give a special meaning to nil which is different from `ignore'. So I'm not sure we should cater to this particular case. > Otherwise we have to check and set a dummy value to be safe, for > example=B9. That looks like a good workaround. Stefan diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index a81d3e4..7e1c236 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -234,7 +234,7 @@ different, but `function-equal' will hopefully ignore t= hose differences.") (if (local-variable-p var) (symbol-value var) (setq advice--buffer-local-function-sample ;; This function acts like the t special value in buffer-local h= ooks. - (lambda (&rest args) (apply (default-value var) args))))) + (lambda (&rest args) (apply (or (default-value var) #'ignore) ar= gs))))) =20 (eval-and-compile (defun advice--normalize-place (place) From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 11 19:44:27 2014 Received: (at 19324-done) by debbugs.gnu.org; 12 Dec 2014 00:44:27 +0000 Received: from localhost ([127.0.0.1]:43343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XzELL-0003qE-41 for submit@debbugs.gnu.org; Thu, 11 Dec 2014 19:44:27 -0500 Received: from mail-pd0-f182.google.com ([209.85.192.182]:56413) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XzELI-0003pw-Si for 19324-done@debbugs.gnu.org; Thu, 11 Dec 2014 19:44:25 -0500 Received: by mail-pd0-f182.google.com with SMTP id p10so6064937pdj.27 for <19324-done@debbugs.gnu.org>; Thu, 11 Dec 2014 16:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=hvVr3AZ335UP7xfJkdxolvHaZ/kecta47HAX9CnEPCo=; b=KGP0fS/oC8G0I0f+2nEoCNzBFBPObr9jesA6QgvKgMOVUj8OUSlHU0YckVEMTVEqSY PZ5sTfHBd8HtdJB014Zm8By16dRcjhnMvDlpeflsfbMXfbkOSF+WjhpdVjfkbBhbEY8+ q0D3v+S6dVtt4G65t7XrsglRhuLipiwgjpQ/VVRtVSDOKS/jKgE1KRj643GvdUtMi5i2 L08pfyj2ZOOsb2hKzxBd1fWdzWaP19U9xUIlJCaxydP2wFNmr2/biTmvEQBS+vo04suV yBewL+fcLEOTXTT0YIgJS/VR6cYirBGnevJpxIXqlQioxBBunZpZZeZ6j/lK0qah6PNd 6KLg== X-Received: by 10.69.20.74 with SMTP id ha10mr21925781pbd.122.1418345058867; Thu, 11 Dec 2014 16:44:18 -0800 (PST) Received: from fortuna ([114.248.243.62]) by mx.google.com with ESMTPSA id a6sm2366293pbu.64.2014.12.11.16.44.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Dec 2014 16:44:18 -0800 (PST) From: Leo Liu To: Stefan Monnier Subject: Re: bug#19324: 25.0.50; add-function and nil References: <87vbllxw05.fsf@gmail.com> <87bnnbt342.fsf@gmail.com> <877fxyu9h1.fsf@gmail.com> <87egs6uljg.fsf@gmail.com> Face: iVBORw0KGgoAAAANSUhEUgAAACkAAAApAQAAAACAGz1bAAABKElEQVQYlWNg3NIt5FDPUPt7 4+X79Qyucz5/ugik+L2PBgKpyphaIK921q23QDnG0NBQoMr/vaWl9f8ZLL78uPv5PwN7RETfzXoG jhmFz27XM0RXmpuY/WfY+fv0Mc56BvFybfXA/wwL5t/wF61n2PU59axXPcOVzbmSW/8zrNt1benC /ww70hqUU/4zKCtrT9jwn8FhwynbufUMendE2aLqGRpdX9al1zM8eh17lKeeQcTMrdD5P8P3j/YT Q/8zXHSb7p1Qz/C4OM2JuZ7hgtI7K6AjqsMnf8j4z8C6xG1tw3+GqpqvsVn/GTzmpD9j/8/wP/oZ S/l/Bka+QO/g/wy15ueeFQL9N1O8mPU/g+umV3t1gdT0/1bTgHLqYVeXAlWKpMWt+w8Az82C9nHf X0cAAAAASUVORK5CYII= Date: Fri, 12 Dec 2014 08:44:11 +0800 In-Reply-To: (Stefan Monnier's message of "Thu, 11 Dec 2014 14:11:25 -0500") Message-ID: <87388lvgro.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (CentOS Linux 7 (Core)) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19324-done Cc: 19324-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2014-12-11 14:11 -0500, Stefan Monnier wrote: > No I don't have a fix for this. > `add-function' is designed to work on places that only hold functions, > so any other value (such as nil) will create problems. > > IOW a variable that can hold "either nil or a function" is not something > that add-function supports. > > I guess we could treat nil as an alias for `ignore' in the "proxy > function", which would fix this particular issue. See patch below. > But I don't intend to handle all the cases in which a "nil function" can > show up. Many/most uses of `foo-function' actually give a special > meaning to nil which is different from `ignore'. > So I'm not sure we should cater to this particular case. Thanks, Stefan, for the explanation. In that case maybe the workaround isn't needed because we still cannot tell if ORIG is missing. I consider the bug closed. Leo From unknown Mon Jun 23 14:58:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 09 Jan 2015 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator