From: michael@cadilhac.name (Michaël Cadilhac)
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: ad-remove-advice bug.
Date: Thu, 08 Mar 2007 19:07:33 +0100 [thread overview]
Message-ID: <87hcsv7gnu.fsf@lrde.org> (raw)
In-Reply-To: <E1HPMbU-0005jQ-Ep@fencepost.gnu.org> (Richard Stallman's message of "Thu\, 08 Mar 2007 12\:40\:36 -0500")
[-- Attachment #1.1.1: Type: text/plain, Size: 654 bytes --]
Richard Stallman <rms@gnu.org> writes:
> Now, use M-x ad-remove-advice RET RET RET RET (the default each time)
> There's two annoying things :
> 1. M-x describe-function RET forward-line RET says :
> | This subr is advised.
>
> That's not a bug; we need not do anything now.
>
> Your patch looks maybe ok for the future, but let's not do anything
> there now.
OK, so we'll see later.
> 2. M-x ad-remove-advice default values are impossible.
>
> I do not understand.
After the first call to `ad-remove-advice', the second call defaults
its arguments to `forward-line' which has no more advices.
Maybe we just want the following:
[-- Attachment #1.1.2: advice.patch --]
[-- Type: text/x-patch, Size: 1873 bytes --]
Index: lisp/emacs-lisp/advice.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/advice.el,v
retrieving revision 1.49
diff -B -w -c -r1.49 advice.el
*** lisp/emacs-lisp/advice.el 21 Jan 2007 02:44:24 -0000 1.49
--- lisp/emacs-lisp/advice.el 8 Mar 2007 18:04:43 -0000
***************
*** 2278,2284 ****
"Read a complete function/class/name specification from minibuffer.
The list of read symbols will be returned. The optional PROMPT will
be used to prompt for the function."
! (let* ((function (ad-read-advised-function prompt))
(class (ad-read-advice-class function))
(name (ad-read-advice-name function class)))
(list function class name)))
--- 2278,2288 ----
"Read a complete function/class/name specification from minibuffer.
The list of read symbols will be returned. The optional PROMPT will
be used to prompt for the function."
! (let* ((predicate (lambda (fun)
! (ad-dolist (class ad-advice-classes)
! (if (ad-get-advice-info-field fun class)
! (ad-do-return t)))))
! (function (ad-read-advised-function prompt predicate))
(class (ad-read-advice-class function))
(name (ad-read-advice-name function class)))
(list function class name)))
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.10783
diff -C0 -r1.10783 ChangeLog
*** lisp/ChangeLog 7 Mar 2007 12:50:23 -0000 1.10783
--- lisp/ChangeLog 8 Mar 2007 18:05:05 -0000
***************
*** 0 ****
--- 1,6 ----
+ 2007-03-08 Michaël Cadilhac <michael@cadilhac.name>
+
+ * emacs-lisp/advice.el (ad-read-advice-specification): Check that the
+ default value taken by `ad-read-advised-function' has non-empty
+ classes.
+
[-- Attachment #1.1.3: Type: text/plain, Size: 327 bytes --]
--
| Michaël `Micha' Cadilhac | ... KVim is cited in the talk. |
| http://michael.cadilhac.name | "I can't tell if I am more sorry |
| JID/MSN: | for vim or for KDE." |
`---- michael.cadilhac@gmail.com | -- RMS - --'
[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]
[-- Attachment #2: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2007-03-08 18:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-07 14:36 ad-remove-advice bug Michaël Cadilhac
2007-03-08 0:07 ` Johan Bockgård
2007-03-08 17:40 ` Richard Stallman
2007-03-08 18:07 ` Michaël Cadilhac [this message]
2007-03-09 16:19 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87hcsv7gnu.fsf@lrde.org \
--to=michael@cadilhac.name \
--cc=emacs-devel@gnu.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).