From unknown Fri Sep 19 23:52:46 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#21683 <21683@debbugs.gnu.org> To: bug#21683 <21683@debbugs.gnu.org> Subject: Status: 25.0.50; `advice-add` doesn't work for compiled primitive functions Reply-To: bug#21683 <21683@debbugs.gnu.org> Date: Sat, 20 Sep 2025 06:52:46 +0000 retitle 21683 25.0.50; `advice-add` doesn't work for compiled primitive fun= ctions reassign 21683 emacs submitter 21683 Vitalie Spinu severity 21683 minor tag 21683 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 13 21:54:18 2015 Received: (at submit) by debbugs.gnu.org; 14 Oct 2015 01:54:19 +0000 Received: from localhost ([127.0.0.1]:39251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZmBGk-0002mp-IW for submit@debbugs.gnu.org; Tue, 13 Oct 2015 21:54:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37002) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZmBGj-0002mi-HC for submit@debbugs.gnu.org; Tue, 13 Oct 2015 21:54:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmBGY-0006K9-MY for submit@debbugs.gnu.org; Tue, 13 Oct 2015 21:54:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmBGY-0006K5-HN for submit@debbugs.gnu.org; Tue, 13 Oct 2015 21:54:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmBGF-0003rJ-TD for bug-gnu-emacs@gnu.org; Tue, 13 Oct 2015 21:54:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmBFL-00065j-Nx for bug-gnu-emacs@gnu.org; Tue, 13 Oct 2015 21:53:47 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:35001) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmBFL-00065R-Cw for bug-gnu-emacs@gnu.org; Tue, 13 Oct 2015 21:52:51 -0400 Received: by wicge5 with SMTP id ge5so216070424wic.0 for ; Tue, 13 Oct 2015 18:52:50 -0700 (PDT) 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=fYD3VbeqjvizOSrwlajhP1RdVLv15Vg4a7b1MGeKZxM=; b=BE3GS3syBML7yNn9YfJ2elBBEHLmRppwTF95kTue3b5TwVIbb8tMYWXIod70B18flG N6JHwDkr6oD2UqHsoHxr2WLk8Xky8qtF+1QhKxIVgGP9k6xaKS3vpZoMfhIkcb4yr9HI DtaU51kHVdC4IKtmCdGYD82f2Rk0WK7fc5d/cz46m3RulKoUCWavQMVPkrcphB8OdQtS gROP+iISdsWU5H6lDFEh1BVgCYpvScyF9+egpziqEbgIPXAhED/4IA6GOZ5C0kPLVG5J /y/Y5SvvDi5xth5EXmywdC5NuGNgCw+I/sO6cI7mQy+jdNiNj+7StMgJhxX8KF0rqa1S JbJg== X-Received: by 10.194.134.98 with SMTP id pj2mr726201wjb.30.1444787570240; Tue, 13 Oct 2015 18:52:50 -0700 (PDT) Received: from localhost ([143.176.214.220]) by smtp.gmail.com with ESMTPSA id lg1sm379139wic.17.2015.10.13.18.52.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2015 18:52:47 -0700 (PDT) From: Vitalie Spinu To: bug-gnu-emacs@gnu.org Subject: 25.0.50; `advice-add` doesn't work for compiled primitive functions Date: Wed, 14 Oct 2015 03:52:47 +0200 Message-ID: <87wpuqi5cg.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 (----) Hi, Put this function into a file, compile the file and then load the file: (defun foobar () (save-restriction (widen))) then: (defun restrict-widen (orig-widen) (message "here") (apply orig-widen nil)) (advice-add 'widen :around #restrict-widen) (foobar) The advice is not triggered. Eval the `foobar` definition interactively and the advice will start working. The problem occurs only for primitive c functions. Elisp functions are fine. It doesn't work with 24.4.1 either. Vitalie In GNU Emacs 25.0.50.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2) of 2015-09-26 Repository revision: 139e55a58466058a8c9ae54536cb790ac7b7cc64 Windowing system distributor 'The X.Org Foundation', version 11.0.11600000 System Description: Ubuntu 14.10 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 18 17:16:48 2015 Received: (at 21683) by debbugs.gnu.org; 18 Oct 2015 21:16:48 +0000 Received: from localhost ([127.0.0.1]:55455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZnvJw-00006L-2i for submit@debbugs.gnu.org; Sun, 18 Oct 2015 17:16:48 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:34003) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZnvJu-00006D-1G for 21683@debbugs.gnu.org; Sun, 18 Oct 2015 17:16:46 -0400 Received: by wikq8 with SMTP id q8so26695827wik.1 for <21683@debbugs.gnu.org>; Sun, 18 Oct 2015 14:16:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=BCYcXzOxdO7lQq8RVHSXFfKAo8+QBekAR3/TdjjdzrI=; b=yXxeLDXG80+d8NVpGp65nPAYY/cfCzdNr2hvU5IiNGxYTP0hZzoCK/ry4wT3uoChdY BT3YheYVHRiOPZAUmW3x8gkwFVp/dTMupLEcdKm5RfnQGUtXPXm4y4kBrE/t9bxi655e RVR82b9CSL3K3uG+0Zj4iQx9jcPTqqTeUinKUWZQXcdHaYQNGaL12DM4jcO04/tp3Qxt G/MW7xQCQ1W25Y898v9wXYIp4u2AVa0q3R1I6IPNku7VQgrupq0Ks4LF74E06GmJ/EJu gbHGqV9/aHbeDponOTOtXbOXQDRC4fQ7bpYorCzpBPRiiQgHlYPwnyYO5iHh/Isk84Tj boKg== X-Received: by 10.194.157.102 with SMTP id wl6mr32545810wjb.79.1445203005478; Sun, 18 Oct 2015 14:16:45 -0700 (PDT) MIME-Version: 1.0 References: <87wpuqi5cg.fsf@gmail.com> In-Reply-To: <87wpuqi5cg.fsf@gmail.com> From: Philipp Stephani Date: Sun, 18 Oct 2015 21:16:35 +0000 Message-ID: Subject: Re: bug#21683: 25.0.50; `advice-add` doesn't work for compiled primitive functions To: Vitalie Spinu , 21683@debbugs.gnu.org Content-Type: multipart/alternative; boundary=089e013c6abac51eb20522678b93 X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 21683 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.4 (/) --089e013c6abac51eb20522678b93 Content-Type: text/plain; charset=UTF-8 This is documented behavior: https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Named-Functions.html It is possible to advise a primitive (see What Is a Function ), but one should typically *not* do so, for two reasons. Firstly, some primitives are used by the advice mechanism, and advising them could cause an infinite recursion. Secondly, many primitives are called directly from C, and such calls ignore advice; hence, one ends up in a confusing situation where some calls (occurring from Lisp code) obey the advice and other calls (from C code) do not. Vitalie Spinu schrieb am Mi., 14. Okt. 2015 um 03:55 Uhr: > > Hi, > > Put this function into a file, compile the file and then load the file: > > > (defun foobar () > (save-restriction > (widen))) > > > then: > > > (defun restrict-widen (orig-widen) > (message "here") > (apply orig-widen nil)) > > (advice-add 'widen :around #restrict-widen) > > (foobar) > > > > The advice is not triggered. > > > Eval the `foobar` definition interactively and the advice will start > working. The problem occurs only for primitive c functions. Elisp > functions are fine. It doesn't work with 24.4.1 either. > > > Vitalie > > > > > In GNU Emacs 25.0.50.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2) > of 2015-09-26 > Repository revision: 139e55a58466058a8c9ae54536cb790ac7b7cc64 > Windowing system distributor 'The X.Org Foundation', version 11.0.11600000 > System Description: Ubuntu 14.10 > > > > --089e013c6abac51eb20522678b93 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This is documented behavior:
It is possible to advise a pr= imitive (see=C2=A0= What Is a Function), but one should typically=C2=A0not=C2=A0do so, for two reasons. Firstly= , some primitives are used by the advice mechanism, and advising them could= cause an infinite recursion. Secondly, many primitives are called directly= from C, and such calls ignore advice; hence, one ends up in a confusing si= tuation where some calls (occurring from Lisp code) obey the advice and oth= er calls (from C code) do not.

Vitalie Spinu <spinuvit@gmail.com> schrieb am Mi., 14. Okt. 2015 um 03:55=C2= =A0Uhr:

Hi,

Put this function into a file, compile the file and then load the file:


=C2=A0 (defun foobar ()
=C2=A0 =C2=A0(save-restriction
=C2=A0 =C2=A0 =C2=A0(widen)))


then:


=C2=A0 (defun restrict-widen (orig-widen)
=C2=A0 =C2=A0 (message "here")
=C2=A0 =C2=A0 (apply orig-widen nil))

=C2=A0 (advice-add 'widen :around #restrict-widen)

=C2=A0 (foobar)



The advice is not triggered.


Eval the `foobar` definition interactively and the advice will start
working. The problem occurs only for primitive c functions. Elisp
functions are fine. It doesn't work with 24.4.1 either.


=C2=A0 Vitalie




In GNU Emacs 25.0.50.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2)
=C2=A0of 2015-09-26
Repository revision: 139e55a58466058a8c9ae54536cb790ac7b7cc64
Windowing system distributor 'The X.Org Foundation', version 11.0.1= 1600000
System Description:=C2=A0 =C2=A0 =C2=A0Ubuntu 14.10



--089e013c6abac51eb20522678b93-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 18 17:25:51 2015 Received: (at 21683) by debbugs.gnu.org; 18 Oct 2015 21:25:51 +0000 Received: from localhost ([127.0.0.1]:55466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZnvSh-0000JI-3R for submit@debbugs.gnu.org; Sun, 18 Oct 2015 17:25:51 -0400 Received: from dancol.org ([96.126.100.184]:50089) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZnvSf-0000J9-3s for 21683@debbugs.gnu.org; Sun, 18 Oct 2015 17:25:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject; bh=o1clmhNPmVY8KRxXxHNWhJryFPpN5Y2caeFJjhb1lgM=; b=RGFkB2AInWpF8PW3HLidOvAmQIRIAI/Wx/zKzXU2D0jRW+eKoQ54cIrZihsnFM3j6KAgn7Rcx4iyRAq43CVJ1PN+3q8666g80grjAVWt0+8wuKImDuMXM1miVDV9Y67g9YUTvefZv4DEmkcfroYH/ibWCxoM/nKu73FTarWxeXCh+Ph1evoGxtRvx0vJ2kZ55c/Wx+ZgW4ZT+r4/4fdvuMMOXjUePG0mNYwG+NxdWCRm9BwtW0Y5fgHVtJItv6GoBhUjaoNLeiLXLgUwzdNe0o2hxepxASMwlKPB7Sdi77SqI4Gs9ZsfRA2bDQkrs74eqGt7NgKDxiCVzx+Y44eNEg==; Received: from [2620:10d:c090:180::1:c992] (helo=[IPv6:2620:10d:c081:1101:2ab2:bdff:fe1c:db58]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1ZnvSd-0002U2-Sv; Sun, 18 Oct 2015 14:25:47 -0700 Subject: Re: bug#21683: 25.0.50; `advice-add` doesn't work for compiled primitive functions To: Philipp Stephani , Vitalie Spinu , 21683@debbugs.gnu.org References: <87wpuqi5cg.fsf@gmail.com> From: Daniel Colascione Message-ID: <56240E56.3080504@dancol.org> Date: Sun, 18 Oct 2015 14:25:42 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="a5rsBCwE66PFlOnf9MiAlNgAsFDaBwUoP" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 21683 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.0 (/) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --a5rsBCwE66PFlOnf9MiAlNgAsFDaBwUoP Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/18/2015 02:16 PM, Philipp Stephani wrote: > This is documented behavior: > https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Name= d-Functions.html > It is possible to advise a primitive (see What Is a Function > ), > but one should typically /not/ do so, for two reasons. Firstly, some > primitives are used by the advice mechanism, and advising them could > cause an infinite recursion. Secondly, many primitives are called > directly from C, and such calls ignore advice; hence, one ends up in a > confusing situation where some calls (occurring from Lisp code) obey th= e > advice and other calls (from C code) do not. If we wanted to allow advising of primitives such that we also redirect direct calls from C, it wouldn't be that hard: the idea is to either 1) insert enough NOPs at the start of every function to encode an absolute jump[1], or 2) associate with every function a Lisp variable and rest it for nil-ness (which would be a very cheap and very predictable test against zero with Qnil being all zero bits) on entry. Option #1 is more clever and thus more fun to write, but option #2 probably suffices. I just haven't had a good reason to want to advise a primitive, but if someone wants to do this work, I wouldn't object to it. [1] You don't actually have to encode enough bytes for an absolute jump. You just need to be able to encode enough bytes for a backward jump to the region before the function; this region can then encode your absolute jump. If we align functions properly, we get this space for free half the time. See http://blogs.msdn.com/b/oldnewthing/archive/2011/09/21/10214405.aspx --a5rsBCwE66PFlOnf9MiAlNgAsFDaBwUoP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJWJA5WAAoJEN4WImmbpWBlxZ4P/03SZHYABFeEVs7xJPdSV25W 4jQF9oMIRogQRv2m1jIK1BaQPZLiLQkZ/OhPtLFpxCV5ULsyuEFSqt7Fo0MP0lVn Kfs9teQ1RnhrSz2Xxpofeif3OizFSDOcdxmLftGdXUGXW3ZeFleTawYZOGaSuEjS LO81si3pnMv4na3qJY4RIGs4oDCEosGTyfu5ICVsEvGZUgNoU8VUdconyARwanh6 MAhS4sNBBHJua6ZT1wndE2kAKPNgxntiBrAr7KspIIeqx9RZMA4rrr+DU+eGjcho U9qjuvk28PZaYjT7bCq0sfhVs1+YZB/ICrPTx8QY91rG1fZJwSOEip4RkWd5qPTw X9zsdIIyzFquX8fbv/gQAPuRys1qDqHovfuLur+Qf2/OxA7XqHkUgYy+tOpa2Cfp +Be61WzwiIVRxMw7o3OFsmV02Y1UHJZtQeQT8XGfD1LxF1/0pqxiL9ncVrsUpA7P JNFlz2/0pwfo2ZuQvrJolNj+gRHdqFoX+59jdMDkMKaIus0nwdbO6b51ZSDC5Uf0 wrz68UF5GRNhxTyMkwlpCJ0HolXsWu+Sqich2JdkeFzaK+EQGii9s4GEwpOm8uMh qB8ZvVEShO6/79uVS+FOqvEqsijAhvG9KQXh4FGCSdgbM9DUSYhaKwK30VVormlZ 5+r1y0YvkQzaCFkWWPQy =4Qn/ -----END PGP SIGNATURE----- --a5rsBCwE66PFlOnf9MiAlNgAsFDaBwUoP-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 19 11:51:51 2015 Received: (at 21683) by debbugs.gnu.org; 19 Oct 2015 15:51:51 +0000 Received: from localhost ([127.0.0.1]:56921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoCj0-0002Wi-Jq for submit@debbugs.gnu.org; Mon, 19 Oct 2015 11:51:50 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:37728) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoCiy-0002Wa-Ls for 21683@debbugs.gnu.org; Mon, 19 Oct 2015 11:51:49 -0400 Received: by wicfv8 with SMTP id fv8so12354448wic.0 for <21683@debbugs.gnu.org>; Mon, 19 Oct 2015 08:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=YcYXRHjysywex45QP593WpKIcDX2D1M2hTrmrlBgKIA=; b=H9zDVj7b8Y6pf9M54z7doz5MAbNyh85+sE4wMgRkia5xEfMIGQuQJZplPb3Mhd4YNx wff/g2Gf91H1/1xyJmBME4pVmL8CRAnM0fSvqRaAppt7L7geKQsGN8vcZUn3sOooGJYc C87v3TBOtNs0txZx33nZzjkFdGgtQUHaVi7X0EgBUdKAa94t4Rq519OFxxLhJFeL4+2m pwqfx85aMz1ShhWYuHRVq/SBszx9fM7wlKrbo40+uhyCT1Mtgv2g1yD5krt11GHOvU47 4cU1lJKF08wt3JJcO1aYoI5sRYnMDk0tbfVf6s/1tMBV2bB0nQOXAA+jVZ+25AWpVE07 jS4A== X-Received: by 10.180.87.194 with SMTP id ba2mr21388372wib.11.1445269907946; Mon, 19 Oct 2015 08:51:47 -0700 (PDT) Received: from localhost ([143.176.214.220]) by smtp.gmail.com with ESMTPSA id ld5sm40958560wjc.18.2015.10.19.08.51.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Oct 2015 08:51:46 -0700 (PDT) From: Vitalie Spinu To: Daniel Colascione Subject: Re: bug#21683: 25.0.50; `advice-add` doesn't work for compiled primitive functions References: <87wpuqi5cg.fsf@gmail.com> <56240E56.3080504@dancol.org> Date: Mon, 19 Oct 2015 17:51:46 +0200 In-Reply-To: <56240E56.3080504@dancol.org> (Daniel Colascione's message of "Sun, 18 Oct 2015 14:25:42 -0700") Message-ID: <874mhmrh4d.fsf@gmail.com> 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.7 (/) X-Debbugs-Envelope-To: 21683 Cc: Philipp Stephani , 21683@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 Sun, Oct 18 2015 14:25, Daniel Colascione wrote: > On 10/18/2015 02:16 PM, Philipp Stephani wrote: >> This is documented behavior: Well, conceptually the call is from elisp, even if it's a compiled code. What is technically happening in the compiled code shouldn't be the user's concern. I think that piece of documentation should be nuanced that advice doesn't work in compiled elisp calls. I took me 4 hours to figure out why my font-lock code was chaotically working here and not there. > I just haven't had a good reason to want to advise a primitive, but if someone > wants to do this work, I wouldn't object to it. I am trying hard to make polymode [1] functional for complex sub-modes like c-lang. For that I need to restrict `widen` and `parse-partial-sexp` in order for the sub-mode to have an illusion that a region of a buffer is a whole buffer. > If we wanted to allow advising of primitives such that we also redirect direct > calls from C, it wouldn't be that hard: That would be so great! Vitalie [1] https://github.com/vspinu/polymode/ From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 19 11:56:31 2015 Received: (at 21683) by debbugs.gnu.org; 19 Oct 2015 15:56:31 +0000 Received: from localhost ([127.0.0.1]:56929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoCnW-0002dv-Re for submit@debbugs.gnu.org; Mon, 19 Oct 2015 11:56:31 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:36420) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoCnV-0002do-Di for 21683@debbugs.gnu.org; Mon, 19 Oct 2015 11:56:29 -0400 Received: by wicfx6 with SMTP id fx6so12498112wic.1 for <21683@debbugs.gnu.org>; Mon, 19 Oct 2015 08:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=fi39Q3qxpoXXie7Xp/CzItHBlulJTVJjhcn+7aV1cZ8=; b=PIiy4XEJqnErlHyE1PP6oa+WSOIxJDm0aixZGrt5Rr0IYoZpLkU74rEfkoF1Zk4ERv kpJpgjEUX6Jm9mI1ZISuriy1pOqSPS6pXUX00Oum0ArVILH2HVYyJRSctkq9C7/i3jeL sirC+9CztQNN1yaji5hVUki8e08sq4v2zUblH6/O4+cjakx7pD94L3f8gesjSSOMk93d G6kY360aLZkw05J4HedmHBDKC0HFH0QBW9syrSIHD6DU3zDKbXiPyACqK0ULDTU7d9ls SN6kvsX6lTyXmvj253/Hc/hS4q7STaH9pSq0edmppamKzdnuLITqdV8OvMpopydpLJyf G8rQ== X-Received: by 10.181.13.101 with SMTP id ex5mr17646132wid.2.1445270188718; Mon, 19 Oct 2015 08:56:28 -0700 (PDT) Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by smtp.googlemail.com with ESMTPSA id lv4sm41010127wjb.43.2015.10.19.08.56.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Oct 2015 08:56:27 -0700 (PDT) Subject: Re: bug#21683: 25.0.50; `advice-add` doesn't work for compiled primitive functions To: Vitalie Spinu , Daniel Colascione References: <87wpuqi5cg.fsf@gmail.com> <56240E56.3080504@dancol.org> <874mhmrh4d.fsf@gmail.com> From: Dmitry Gutov Message-ID: <562512A9.60901@yandex.ru> Date: Mon, 19 Oct 2015 18:56:25 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 In-Reply-To: <874mhmrh4d.fsf@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21683 Cc: Philipp Stephani , 21683@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 10/19/2015 06:51 PM, Vitalie Spinu wrote: > I am trying hard to make polymode [1] functional for complex sub-modes like > c-lang. For that I need to restrict `widen` and `parse-partial-sexp` in order > for the sub-mode to have an illusion that a region of a buffer is a whole > buffer. Yesss. This has been discussed a few times already: you can't advice `widen', and hence you can't make a "perfect" multiple-major-modes solution. The current thinking on that subject is to use prog-indentation-context for indentation (it must be supported in the respective major modes as well), and introduce something similar for font-lock/syntax-ppss. Doing anything with parse-partial-sexp is dommed to fail. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 30 23:38:38 2016 Received: (at control) by debbugs.gnu.org; 1 Jul 2016 03:38:38 +0000 Received: from localhost ([127.0.0.1]:33010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIpHq-00071k-D9 for submit@debbugs.gnu.org; Thu, 30 Jun 2016 23:38:38 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:38775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIpHp-00071Y-9y for control@debbugs.gnu.org; Thu, 30 Jun 2016 23:38:37 -0400 Received: by mail-it0-f50.google.com with SMTP id h190so7928194ith.1 for ; Thu, 30 Jun 2016 20:38:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:in-reply-to:message-id:user-agent :mime-version; bh=+6/SBRDLc52Dqff5ArK8d3LeMLJGRi/uvrr7rrLH3Fs=; b=DhUvqyKzBrlLYjeEz+6/t4UVYZIAG9RHnsyNvEgisUI+Zg/9twyPQZwyP89Hu8EgsH 8svFm8XNa6DSzJLCWv1dANBd2T6WMO78dxQTrekrtbbcRCzI6U7sIteURdiH6jutApub 8M+NiXBFZwZL2pRwVfrmuJYwB+J1wwSDChr9zMdyRRV9wVhfuGASkgdGS5PFSGRAlSY4 zWJlyJXg1/F3VJmctreXyPq49JdSQQRhiQlNdr13V7nlEiPBP3Zlpdpqr80mnkGiSjDE m+RYP9AkzPF+AyvP301kdj73juno1xS52TqG4kzAh8PBJLlY8Be3HvBX+xbmvZvtSi5O iQiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:in-reply-to :message-id:user-agent:mime-version; bh=+6/SBRDLc52Dqff5ArK8d3LeMLJGRi/uvrr7rrLH3Fs=; b=hMty0VcjMzxDVNXtYnYQzyNUPxal3AbwX3LULr3xDS8ZlpJ+al/Cpo++mOitCGheYf I8G4uXa8reJilXPq0U27qsW+Pc7PjnXRjJetstrc9A3dnfK27Ri/TrDCvHmQwzM82PSS VahJmNp63HW3Dd5SV2JhJVn4SVssvBboYwnPagOhuoyb2XFOrq7oGAjF09xlseuAzjnz TpW+6qOQP6J8/ymZH3sOBQlniASUcqzSbXCEpGuooVXrmwg6scCtPNbgv2vIrlcknbVk 2KMr1MBsnZAcPr9K0ooLn/sCCIGcWa2kIt5ijWQxoyCqPTHaX1d4dyYfV67UMVZJ3hkk 4JWA== X-Gm-Message-State: ALyK8tLjTeWHeivQDhwMakZeZ7cMTBrqHeIxpQRECV7ArHPg//Zg47BMsD8u7ZC6OXkgVQ== X-Received: by 10.36.228.142 with SMTP id o136mr30948989ith.47.1467344311787; Thu, 30 Jun 2016 20:38:31 -0700 (PDT) Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id y73sm5326968iof.32.2016.06.30.20.38.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2016 20:38:31 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: Re: Status: 25.0.50; `advice-add` doesn't work for compiled primitive functions Date: Thu, 30 Jun 2016 23:38:39 -0400 In-Reply-To: bug's message of "Fri\, 01 Jul 2016 03\:36\:16 +0000" Message-ID: <87twgagh8g.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) forcemerge 5863 21683 quit From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 27 06:45:29 2020 Received: (at control) by debbugs.gnu.org; 27 Nov 2020 11:45:29 +0000 Received: from localhost ([127.0.0.1]:44172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kicBs-0002z4-Uz for submit@debbugs.gnu.org; Fri, 27 Nov 2020 06:45:29 -0500 Received: from mail-ej1-f53.google.com ([209.85.218.53]:35479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kicBq-0002yl-U2 for control@debbugs.gnu.org; Fri, 27 Nov 2020 06:45:27 -0500 Received: by mail-ej1-f53.google.com with SMTP id f23so7228908ejk.2 for ; Fri, 27 Nov 2020 03:45:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DxkCb/506c+vNiMpBHwQzwsubiwxMqVDVs3kNSuTpYI=; b=nJtYPBwkj9ZKFyTCtmr6IzojxXNLVpv3xtSo/e5qG395v+CzbjQ2b37323ij2ZVPdR 1kdh2U8v5OPYqmkGBKrWwOwOXk0TYQFSMDmNy3H81d/IQM6FAy025CflpLH90MyVapOs VpZojkzmycFerDRdgfpMwhtwn7kEmWOtFVN0L3PBlLgXrDUaBPQU/hnM+zF88sF9z1cc 6GcvuZcm1SmPVzyTp6wTBoo92ThEoPn9wYDZJGxXuCplb9hrcpWEVWFHW1Q+p1bqQovx RlAbe7XEbnqdnn3L++4iaYlySGvKK6wEPvZHbiuc/B4ZZ5rK2zTKYs6INSiqF2xymQ2Q eP9Q== X-Gm-Message-State: AOAM532vD90J+yEhmh8DJoMCIVzRHbLXvIqXOUFoi9BzRUJ7xt9ryYf6 mb9f4rxI29rI5OsypXMKOtIytj0ubVFJ/pmR+CM= X-Google-Smtp-Source: ABdhPJx0C+848tFtSFA2XyrqzroHLbKOg11QGUydoYIYXgo4gCdQ7bXRLO7teJG+D0nQdsQjJh4sRSH4K0Wvl7eAbJw= X-Received: by 2002:a17:906:2e16:: with SMTP id n22mr5791722eji.477.1606477521112; Fri, 27 Nov 2020 03:45:21 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Stefan Kangas Date: Fri, 27 Nov 2020 12:45:09 +0100 Message-ID: Subject: Re: bug#5863: defadvice in byte compiled file does not work To: Andrea Corallo , Stefan Monnier Content-Type: text/plain; charset="UTF-8" Bcc: control@debbugs.gnu.org X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: control Cc: 5863@debbugs.gnu.org, Andreas Schwab , Lennart Borgman X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.5 (/) tags 5863 + wontfix close 5863 thanks Stefan Kangas writes: > >> In any case, I think the story is still sufficiently complex that we're > >> better off saying that "it may work or not depending on your luck". > > > > thus agree. > > Agreed. Sound like this should be closed as wontfix? No further comments within a week, so let's assume yes. I'm therefore closing this bug now. From unknown Fri Sep 19 23:52:46 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, 25 Dec 2020 12:24:07 +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