From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs Subject: bug#23523: 25.0.93; Around advice miscontrued as alias, but not always Date: Thu, 12 May 2016 16:34:26 +0000 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1136e642d1e7570532a7bb85 X-Trace: ger.gmane.org 1463070931 9905 80.91.229.3 (12 May 2016 16:35:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 May 2016 16:35:31 +0000 (UTC) To: 23523@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 12 18:35:22 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b0ta3-0004Vb-GV for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 May 2016 18:35:19 +0200 Original-Received: from localhost ([::1]:58749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0tZx-0002ZQ-UJ for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 May 2016 12:35:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0tZs-0002XN-8Q for bug-gnu-emacs@gnu.org; Thu, 12 May 2016 12:35:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0tZm-0001iv-Pi for bug-gnu-emacs@gnu.org; Thu, 12 May 2016 12:35:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0tZm-0001iY-Mc for bug-gnu-emacs@gnu.org; Thu, 12 May 2016 12:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b0tZm-0001HB-Fu for bug-gnu-emacs@gnu.org; Thu, 12 May 2016 12:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 May 2016 16:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23523 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.14630708924886 (code B ref -1); Thu, 12 May 2016 16:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 May 2016 16:34:52 +0000 Original-Received: from localhost ([127.0.0.1]:49196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0tZc-0001Gi-BK for submit@debbugs.gnu.org; Thu, 12 May 2016 12:34:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0tZZ-0001GW-Vp for submit@debbugs.gnu.org; Thu, 12 May 2016 12:34:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0tZS-0001cZ-TJ for submit@debbugs.gnu.org; Thu, 12 May 2016 12:34:44 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0tZS-0001cM-PY for submit@debbugs.gnu.org; Thu, 12 May 2016 12:34:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0tZP-0002HE-LB for bug-gnu-emacs@gnu.org; Thu, 12 May 2016 12:34:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0tZM-0001at-Df for bug-gnu-emacs@gnu.org; Thu, 12 May 2016 12:34:38 -0400 Original-Received: from mail-oi0-x22f.google.com ([2607:f8b0:4003:c06::22f]:36341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0tZM-0001ap-68 for bug-gnu-emacs@gnu.org; Thu, 12 May 2016 12:34:36 -0400 Original-Received: by mail-oi0-x22f.google.com with SMTP id x201so128558971oif.3 for ; Thu, 12 May 2016 09:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=Xg31WyEQsLkNtE9Tms1Ty5H8Fe8nQVpO0QbHzI2kR54=; b=yuEWWaOowPHvUdwJv56cxE40QdA/S39+5/mJCP0Iv2iwtklbtmxOPOUygBSuBlyL/J PGGkuG+U8GPgw4b0AcBpsVG+iTqfEmDVKRpCWjERklAT2xY7uISvJEnRnd1YcgRUjagi 6RRUlQGuZP6xrbt3yyw8iwk7ze1dVdueqBz52zEGo4UsPSIBya20Ne/dL5xM4+KDIbeZ Jct+cBeSb7sJMjhLNc+IS8vQU3Po6ZynKNf66+MXmf8m3KFt3l2oOriGb93n8+kSrcyv HP3n5ugqiIpb2PdSccENJkPvp7aN2rZlA4jczRwotH+AJS2NtyGcgIz7tJOtSAqkTr19 w5LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Xg31WyEQsLkNtE9Tms1Ty5H8Fe8nQVpO0QbHzI2kR54=; b=hCsZtxswEztgsdWs9S/XtVWza5lW+7hCeokiWuK8tUdQCrX/e5PQrz6dYeDgB/wtQ0 3HqluEvqXOoFZwh9X9wG1K0zAc8JNqkPYb7yTMD9QQo2eZ7KB0Ivb0PSrLKETIIJ6bXu sKx2m5/G9rzVbGgGnn6QZfOMG9ywJLInUiM8IxXN/88KcE1AN5pCpgn794Z5SaTL7h8z Yh2tQ9ly1YSBLuF/J+hO/28VduVf0/Z8pN7VrNnGECdS8RY46kDBp8mLNJlsjR2QdqLv 4rxtrDTfs1QBPS3XSCH9PaIPGKHUlCv+/uHCcen36hkD1iNZqHoTz5J5ZFYaPVN4trnD kWqg== X-Gm-Message-State: AOPr4FUXTzUOEYcuGHuPHKWATuxpXfuJ65pwp9URO1CGqFti/Ms0M/U83CfGuQV273MN8vBSCFC6pw/GdIeItA== X-Received: by 10.157.5.184 with SMTP id 53mr6434913otd.60.1463070875566; Thu, 12 May 2016 09:34:35 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:118169 Archived-At: --001a1136e642d1e7570532a7bb85 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable --text follows this line-- Here's a short elisp snippet to try in an emacs -Q session: =3D=3D=3D=3D=3D (defun foo (orig-fun &rest args) (apply orig-fun args)) (advice-add 'report-emacs-bug :around #'foo) (advice-add 'pop-to-mark-command :around #'foo) =3D=3D=3D=3D=3D After evaluating the above, if I do C-h f report-emacs-bug, I get: =3D=3D=3D=3D=3D report-emacs-bug is an alias for =E2=80=98report-emacs-bug=E2=80=99 in =E2= =80=98emacsbug.el=E2=80=99. It is bound to . (report-emacs-bug TOPIC &optional UNUSED) Report a bug in GNU Emacs. Prompts for bug subject. Leaves you in a mail buffer. =3D=3D=3D=3D=3D But for C-h f pop-to-mark-command, I get: =3D=3D=3D=3D=3D pop-to-mark-command is an interactive compiled Lisp function in =E2=80=98simple.el=E2=80=99. (pop-to-mark-command) :around advice: =E2=80=98foo=E2=80=99 Jump to mark, and pop a new position for mark off the ring. (Does not affect global mark ring). =3D=3D=3D=3D=3D I picked pop-to-mark-command just randomly. I noticed the misinformation for report-emacs-bug (irony!) only. Then at random advised pop-to-mark-command too, but emacs does not misunderstand that advice as alias. And here comes the twist.. After above, in the same session, once I do M-x report-emacs-bug and then if I do C-h f report-emacs-bug, I then get: =3D=3D=3D=3D=3D report-emacs-bug is an interactive autoloaded compiled Lisp function in =E2=80=98emacsbug.el=E2=80=99. It is bound to . (report-emacs-bug TOPIC &optional UNUSED) :around advice: =E2=80=98foo=E2=80=99 Report a bug in GNU Emacs. Prompts for bug subject. Leaves you in a mail buffer. =3D=3D=3D=3D=3D So what's the mystery? Emacs cannot tell if a function is advised until it is evaluated and executed? In GNU Emacs 25.0.93.5 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23) of 2016-05-05 built on Repository revision: 5e814e02f0b0b85fa486975eced09e4a7ed8ce5c Windowing system distributor 'The X.Org Foundation', version 11.0.60900000 System Description: Red Hat Enterprise Linux Workstation release 6.6 (Santiago) Configured using: 'configure --with-modules --prefix=3D/home/kmodi/usr_local/apps/6/emacs/emacs-25 'CPPFLAGS=3D-fgnu89-inline -I/home/kmodi/usr_local/6/include -I/usr/include/freetype2 -I/usr/include' 'CFLAGS=3D-ggdb3 -O0' 'CXXFLAGS=3D-ggdb3 -O0' 'LDFLAGS=3D-L/home/kmodi/usr_local/6/lib -L/home/kmodi/usr_local/6/lib64 -ggdb3' PKG_CONFIG_PATH=3D/home/kmodi/usr_local/6/lib/pkgconfig:/home/kmodi/usr_lo= cal/6/lib64/pkgconfig:/cad/adi/apps/gnu/linux/x86_64/6/lib/pkgconfig:/cad/a= di/apps/gnu/linux/x86_64/6/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pk= gconfig:/usr/share/pkgconfig:/lib/pkgconfig:/lib64/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 MODULES Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dnone locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set foo nil [2 times] Type C-x 1 to delete the help window. Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra help-fns help-mode easymenu cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 88305 8121) (symbols 48 19775 0) (miscs 40 47 172) (strings 32 14598 4870) (string-bytes 1 436699) (vectors 16 12461) (vector-slots 8 434860 5020) (floats 8 168 71) (intervals 56 264 4) (buffers 976 12) (heap 1024 38706 719)) --=20 --=20 Kaushal Modi --001a1136e642d1e7570532a7bb85 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
--text follows this l= ine--

Here's a short elisp snippet = to try in an emacs -Q session:

=3D=3D=3D=3D=3D
(defun foo (orig-fun &rest args)
=C2=A0 (apply or= ig-fun args))
(advice-add 'report-emacs-bug :around #'foo= )
(advice-add 'pop-to-mark-command :around #'foo)
=3D=3D=3D=3D=3D

After evaluating the abov= e, if I do C-h f report-emacs-bug, I get:

=3D=3D= =3D=3D=3D
report-emacs-bug is an alias for =E2=80=98report-e= macs-bug=E2=80=99 in =E2=80=98emacsbug.el=E2=80=99.

It is bound to <menu-bar> <help-menu> <send-emacs-bug-repo= rt>.

(report-emacs-bug TOPIC &optional UNUS= ED)

Report a bug in GNU Emacs.
Prompts f= or bug subject.=C2=A0 Leaves you in a mail buffer.
=3D=3D= =3D=3D=3D

But for C-h f pop-to-mark-command, I get= :

=3D=3D=3D=3D=3D
pop-to-mark-comma= nd is an interactive compiled Lisp function in
=E2=80=98simple.el= =E2=80=99.

(pop-to-mark-command)

:around advice: =E2=80=98foo=E2=80=99

Jump= to mark, and pop a new position for mark off the ring.
(Does not= affect global mark ring).
=3D=3D=3D=3D=3D

I picked pop-to-mark-command just randomly. I noticed the misinfor= mation for report-emacs-bug (irony!) only. Then at random advised pop-to-ma= rk-command too, but emacs does not misunderstand that advice as alias.

And here comes the twist.. After above, in the same se= ssion, once I do M-x report-emacs-bug and then if I do C-h f report-emacs-b= ug, I then get:

=3D=3D=3D=3D=3D
rep= ort-emacs-bug is an interactive autoloaded compiled Lisp function
in =E2=80=98emacsbug.el=E2=80=99.

It is bound to = <menu-bar> <help-menu> <send-emacs-bug-report>.

(report-emacs-bug TOPIC &optional UNUSED)
:around advice: =E2=80=98foo=E2=80=99

= Report a bug in GNU Emacs.
Prompts for bug subject.=C2=A0 Leaves = you in a mail buffer.
=3D=3D=3D=3D=3D

<= div>So what's the mystery? Emacs cannot tell if a function is advised u= ntil it is evaluated and executed?


=
In GNU Emacs 25.0.93.5 (x86_64-unknown-linux-gnu, GTK+ Versi= on 2.24.23)
=C2=A0of 2016-05-05 built on=C2=A0
Reposito= ry revision: 5e814e02f0b0b85fa486975eced09e4a7ed8ce5c
Windowing s= ystem distributor 'The X.Org Foundation', version 11.0.60900000
System Description: Red Hat Enterprise Linux Workstation release 6.6 (Santiago)=

Configured using:
=C2=A0'configure = --with-modules
=C2=A0--prefix=3D/home/kmodi/usr_local/apps/6/emac= s/emacs-25
=C2=A0'CPPFLAGS=3D-fgnu89-inline -I/home/kmodi/usr= _local/6/include
=C2=A0-I/usr/include/freetype2 -I/usr/include= 9; 'CFLAGS=3D-ggdb3 -O0'
=C2=A0'CXXFLAGS=3D-ggdb3 -O0= ' 'LDFLAGS=3D-L/home/kmodi/usr_local/6/lib
=C2=A0-L/home/= kmodi/usr_local/6/lib64 -ggdb3'
=C2=A0PKG_CONFIG_PATH=3D/home= /kmodi/usr_local/6/lib/pkgconfig:/home/kmodi/usr_local/6/lib64/pkgconfig:/c= ad/adi/apps/gnu/linux/x86_64/6/lib/pkgconfig:/cad/adi/apps/gnu/linux/x86_64= /6/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgco= nfig:/lib/pkgconfig:/lib64/pkgconfig'

Configur= ed features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBU= S GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE L= IBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK2 X11 MODULES
Important settings:
=C2=A0 value of $LANG: en_US.UTF-= 8
=C2=A0 value of $XMODIFIERS: @im=3Dnone
=C2=A0 locale= -coding-system: utf-8-unix

Major mode: Lisp Intera= ction

Minor modes in effect:
=C2=A0 tool= tip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 electric= -indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-= bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-sh= adow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 fon= t-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-= composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2= =A0 auto-compression-mode: t
=C2=A0 line-number-mode: t
=C2=A0 transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
foo
nil [2 times]
Type C-x = 1 to delete the help window.


Load-p= ath shadows:
None found.

Features:
=
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodie= s
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader se= ndmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils c= l-extra
help-fns help-mode easymenu cl-loaddefs pcase cl-lib time= -date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hoo= ks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dn= d fontset image regexp-opt
fringe tabulated-list newcomment elisp= -mode lisp-mode prog-mode register
page menu-bar rfn-eshadow time= r select scroll-bar mouse jit-lock
font-lock syntax facemenu font= -core frame cl-generic cham georgian
utf-8-lang misc-lang vietnam= ese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 he= brew greek romanian slovak czech european
ethiopic indian cyrilli= c chinese charscript case-table epa-hook
jka-cmpr-hook help simpl= e abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cu= s-face macroexp files text-properties overlay
sha1 md5 base64 for= mat env code-pages mule custom widget
hashtable-print-readable ba= ckquote dbusbind inotify dynamic-setting
system-font-setting font= -render-setting move-toolbar gtk x-toolkit x
multi-tty make-netwo= rk-process emacs)

Memory information:
((= conses 16 88305 8121)
=C2=A0(symbols 48 19775 0)
=C2=A0= (miscs 40 47 172)
=C2=A0(strings 32 14598 4870)
=C2=A0(= string-bytes 1 436699)
=C2=A0(vectors 16 12461)
=C2=A0(= vector-slots 8 434860 5020)
=C2=A0(floats 8 168 71)
=C2= =A0(intervals 56 264 4)
=C2=A0(buffers 976 12)
=C2=A0(h= eap 1024 38706 719))

--

--
Kaushal Modi

--001a1136e642d1e7570532a7bb85--