unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Simple defadvice's stopped working (commit daa84a03, Thu Nov 8 23:10:16 2012 -0500)
@ 2012-11-09 23:47 Adam Sjøgren
  2012-11-10  1:55 ` Stefan Monnier
  2012-11-12 10:36 ` Ivan Kanis
  0 siblings, 2 replies; 24+ messages in thread
From: Adam Sjøgren @ 2012-11-09 23:47 UTC (permalink / raw)
  To: emacs-devel

  Hi.


I just installed a new emacs-snapshot package¹, and got an error on
startup, from these four lines in my .emacs.d/init.el:

  (defadvice gnus (before manual-fetch-before activate)
    (setq asjo-fetch-was-manual t))
  (defadvice gnus (after manual-fetch-after activate)
    (setq asjo-fetch-was-manual nil))

(which is part of a crude homebrewed mechanism to do different things
according to whether I manually fetch email/news in Gnus, or it is done
automatically by a gnus-demon.)

So I checked out the emacs repository and git bisect'ed the problem to:

  daa84a03e1a35c9d86865a39f7e2a768a1f43873 is the first bad commit
  commit daa84a03e1a35c9d86865a39f7e2a768a1f43873
  Author: Stefan Monnier <monnier@iro.umontreal.ca>
  Date:   Thu Nov 8 23:10:16 2012 -0500

      New property dynamic-docstring-function for docstrings.
      * src/doc.c (Fdocumentation): Handle new property
      dynamic-docstring-function to replace the old ad-advice-info.
      * lisp/emacs-lisp/advice.el: Use new dynamic docstrings.
      (ad-make-advised-definition-docstring, ad-advised-definition-p):
      Use dynamic-docstring-function instead of ad-advice-info.
      (ad--make-advised-docstring): New function extracted from
      ad-make-advised-docstring.
      (ad-make-advised-docstring): Use it.
      * lisp/progmodes/sql.el (sql--make-help-docstring): New function, extracted
      from sql-help.
      (sql-help): Use it with dynamic-docstring-function.

The error I get on startup when I run ./src/emacs built with that commit is:

  Warning (initialization): An error occurred while loading `/home/asjo/.emacs.d/init.el':

  Wrong type argument: symbolp, #[(&optional arg dont-connect slave) \305.\306.\307
  ^K^L#\211.)\207 [ad-return-value asjo-fetch-was-manual arg dont-connect slave nil t ad-Orig-gnus] 5 Advice doc string P]

If I run ./src/emacs --debug-init, I get this backtrace:

  Debugger entered--Lisp error: (wrong-type-argument symbolp #[(&optional arg dont-connect slave) "\305.\306.\307
  ^K^L#\211.)\207" [ad-return-value asjo-fetch-was-manual arg dont-connect slave nil t ad-Orig-gnus] 5 #("Advice doc string" 0 17 (dynamic-docstring-function ad--make-advised-docstring)) "P"])
    ad-real-orig-definition(#[(&optional arg dont-connect slave) "\305.\306.\307\n^K\f#\211.)\207" [ad-return-value asjo-fetch-was-manual arg dont-connect slave nil t ad-Orig-gnus] 5 #("Advice doc string" 0 17 (dynamic-docstring-function ad--make-advised-docstring)) "P"])
    ad--make-advised-docstring(#("Advice doc string" 0 17 (dynamic-docstring-function ad--make-advised-docstring)) #[(&optional arg dont-connect slave) "\305.\306.\307\n^K\f#\211.)\207" [ad-return-value asjo-fetch-was-manual arg dont-connect slave nil t ad-Orig-gnus] 5 #("Advice doc string" 0 17 (dynamic-docstring-function ad--make-advised-docstring)) "P"])
    ad-real-documentation(#[(&optional arg dont-connect slave) "\305.\306.\307\n^K\f#\211.)\207" [ad-return-value asjo-fetch-was-manual arg dont-connect slave nil t ad-Orig-gnus] 5 #("Advice doc string" 0 17 (dynamic-docstring-function ad--make-advised-docstring)) "P"] t)
    ad-docstring(#[(&optional arg dont-connect slave) "\305.\306.\307\n^K\f#\211.)\207" [ad-return-value asjo-fetch-was-manual arg dont-connect slave nil t ad-Orig-gnus] 5 #("Advice doc string" 0 17 (dynamic-docstring-function ad--make-advised-docstring)) "P"])
    ad-advised-definition-p(#[(&optional arg dont-connect slave) "\305.\306.\307\n^K\f#\211.)\207" [ad-return-value asjo-fetch-was-manual arg dont-connect slave nil t ad-Orig-gnus] 5 #("Advice doc string" 0 17 (dynamic-docstring-function ad--make-advised-docstring)) "P"])
    ad-handle-definition(gnus)
    ad-activate(gnus nil)
    (progn (ad-add-advice (quote gnus) (quote (manual-fetch-after nil t (advice lambda nil (setq asjo-fetch-was-manual nil)))) (quote after) (quote nil)) (ad-activate (quote gnus) nil) (quote gnus))
    eval-buffer(#<buffer  *load*> nil "/home/asjo/.emacs.d/init.el" nil t)  ; Reading at buffer position 2546
    load-with-code-conversion("/home/asjo/.emacs.d/init.el" "/home/asjo/.emacs.d/init.el" t t)
    load("/home/asjo/.emacs.d/init" t t)
    #[0 "^H\205\262.	\306=\203.^@\307^H\310Q\202;.	\311=\204.^@\307^H\312Q\202;.\313\307\314\315#\203*.\316\202;.\313\307\314\317#\203:.\320\nB.\321\202;.\316\322.\323.\322\211#\210^K\322=\203a.\324\325\326\307^H\327Q!\"\323.\322\211#\210^K\322=\203`.^A.\210^K\203\243.\330^K!\331\232\203\243.\332^K!\211\333P\334.!\203}.\211\202\210.\334.!\203\207.^A\202\210.\314\262.^A\203\241.\335.^K\"\203\237.\336\337.^K#\210\340\341!\210.^S\266.\f?\205\260.\314.\323\342\322\211#)\262.\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "`_emacs' init file is deprecated, please use `.emacs'") "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()
    command-line()
    normal-top-level()

It's probably something I'm doing wrong with the advice, as the scheme I
got going was added by trial-and-error, but I thought I'd report it
nonetheless.


  Best regards,

    Adam


¹ Graciously built by Julien Danjou at http://emacs.naquadah.org/

-- 
 "I threw myself out a 1000 times                             Adam Sjøgren
  To seperate body from mind                             asjo@koldfront.dk
  But you know I didn't give a damn
  I'm gonna be just who I am"




^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-11-19  2:36 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-09 23:47 Simple defadvice's stopped working (commit daa84a03, Thu Nov 8 23:10:16 2012 -0500) Adam Sjøgren
2012-11-10  1:55 ` Stefan Monnier
2012-11-11 21:24   ` Tim Cross
2012-11-12 10:36 ` Ivan Kanis
2012-11-13 11:09   ` Katsumi Yamaoka
2012-11-13 14:34     ` Stefan Monnier
2012-11-13 23:18       ` Katsumi Yamaoka
2012-11-14 16:19         ` Juanma Barranquero
2012-11-15  2:08           ` Katsumi Yamaoka
2012-11-15  3:30             ` Stefan Monnier
2012-11-15  9:00               ` Ivan Kanis
2012-11-15 10:55                 ` Katsumi Yamaoka
2012-11-15 14:39                   ` Stefan Monnier
2012-11-15 23:01                     ` Katsumi Yamaoka
2012-11-16 14:16                       ` Stefan Monnier
2012-11-16 16:33                         ` Juanma Barranquero
2012-11-16 17:25                           ` Stefan Monnier
2012-11-16 17:36                             ` Juanma Barranquero
2012-11-16 18:11                             ` Stefan Monnier
2012-11-16 18:17                               ` Juanma Barranquero
2012-11-16 20:11                                 ` Stefan Monnier
2012-11-16 23:52                                   ` Juanma Barranquero
2012-11-19  1:29                                     ` Stefan Monnier
2012-11-19  2:36                                       ` Juanma Barranquero

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).