unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 23.0.50; interactive-form on advised commands returns compiled advice
@ 2007-09-09 23:48 raman
  2007-09-10  2:55 ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: raman @ 2007-09-09 23:48 UTC (permalink / raw)
  To: emacs-pretest-bug


Presently, interactive-form   called on a command that has been
adviced returns the compiled advice -- rather than the original
interactive-form


In GNU Emacs 23.0.50.10 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
 of 2007-09-08 on labrador
configured using `configure  '--prefix=/usr/local' '--with-gtk' '--with-gpm' '--with-rsvg' '--with-png' '--with-jpeg' '--with-gif''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: nil

Major mode: C/l

Minor modes in effect:
  erc-track-minor-mode: t
  jabber-activity-mode: t
  dynamic-completion-mode: t
  dired-omit-mode: t
  shell-dirtrack-mode: t
  savehist-mode: t
  display-time-mode: t
  desktop-save-mode: t
  auto-insert-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  abbrev-mode: t

Recent input:
i TAB RET ESC r SPC RET - RET C-c C-c p ESC < ESC x 
ESC p RET ESC < ESC x r e p l TAB r e g TAB RET - [ 
0 DEL 1 - 9 ] \ . RET - 0 \ & . RET C-c C-c p g ESC 
[ [ D ! a m a C-c C-u c d SPC c i TAB RET ! a m a RET 
f RET C-e l q RET c d RET C-x k a n s RET C-x k a n 
s C-g C-g C-e m C-e t C-e m C-e ? / g l TAB C-g C-g 
C-e u g m TAB i TAB RET q C-e ? / g l TAB RET TAB g 
2 b u b b l e TAB RET C-e m q q C-e u g m TAB i TAB 
RET q C-e u g m TAB TAB C-g C-g C-x @ h s c d RET c 
d SPC e m TAB l i TAB e m TAB l i TAB RET C-x C-f u 
r l RET ESC > C-r g m a i l ESC m C-p ESC C-a C-n C-p 
C-p ESC C-b C-n C-p C-p ESC C-b C-n C-p C-p ESC C-b 
C-n C-p C-p ESC C-b C-n C-r g m a i ESC < ESC [ [ D 
C-e t C-e x m ESC m SPC k j ' d n j ' d n n n ESC c 
q C-e m C-h ESC f i n t e r a c t i v e SPC f TAB RET 
C-e m ESC m C-n C-n C-n C-n ESC x r e p o r t SPC e 
m TAB TAB b TAB RET

Recent messages:
Sorting for index file...
Stuffing index file...
Writing index file...
Wrote /home/raman/Mail/lists/.emacs-devel.idx
Writing index file... done
/home/raman/Mail/lists/emacs-devel removed
nil
Emacspeak pronunciation dictionaries are now active in this buffer
Making completion list...
Loading emacsbug...done

-- 
Best Regards,
--raman

      
Email:  raman@users.sf.net
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@gmail.com
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs

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

* Re: 23.0.50; interactive-form on advised commands returns compiled advice
  2007-09-09 23:48 23.0.50; interactive-form on advised commands returns compiled advice raman
@ 2007-09-10  2:55 ` Stefan Monnier
  2007-09-10 13:16   ` T. V. Raman
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2007-09-10  2:55 UTC (permalink / raw)
  To: raman; +Cc: emacs-pretest-bug

> Presently, interactive-form   called on a command that has been
> adviced returns the compiled advice -- rather than the original
> interactive-form

I don't understand what you mean by "returns the compiled advice".  Do you
mean it doesn't return an interactive form at all, but some piece of code
instead?  Can you give a recipe, or at least a more precise description
(e.g. sample session).


        Stefan

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

* Re: 23.0.50; interactive-form on advised commands returns compiled advice
  2007-09-10  2:55 ` Stefan Monnier
@ 2007-09-10 13:16   ` T. V. Raman
  2007-09-10 14:27     ` Stefan Monnier
  2007-09-10 23:55     ` Richard Stallman
  0 siblings, 2 replies; 7+ messages in thread
From: T. V. Raman @ 2007-09-10 13:16 UTC (permalink / raw)
  To: monnier; +Cc: emacs-pretest-bug, raman


Hi Stefane,

Here is a more accurate description of the problem.

If you define an advice on a  command, and in that advice you
provide an interactive form,
then calling interactive-form later on that function ends up
returning what was created through the advice, and that turns out
to be a piece of code.

I'm hitting this because of how I end up having to advice
commands like copy-to-register -- 
whose interactive forms wouldn't provide speech feedback
otherwise.

Just defining plain advice on commands does not cause
interactive-form to lose -- things work correctly in that case.

>>>>> "Stefan" == Stefan Monnier <monnier@iro.umontreal.ca> writes:
    >> Presently, interactive-form called on a command that has
    >> been adviced returns the compiled advice -- rather than
    >> the original interactive-form
    Stefan> 
    Stefan> I don't understand what you mean by "returns the
    Stefan> compiled advice".  Do you mean it doesn't return an
    Stefan> interactive form at all, but some piece of code
    Stefan> instead?  Can you give a recipe, or at least a more
    Stefan> precise description (e.g. sample session).
    Stefan> 
    Stefan> 
    Stefan>         Stefan
    Stefan> 
    Stefan> 
    Stefan> _______________________________________________
    Stefan> Emacs-devel mailing list Emacs-devel@gnu.org
    Stefan> http://lists.gnu.org/mailman/listinfo/emacs-devel

-- 
Best Regards,
--raman

      
Email:  raman@users.sf.net
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@gmail.com
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs

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

* Re: 23.0.50; interactive-form on advised commands returns compiled advice
  2007-09-10 13:16   ` T. V. Raman
@ 2007-09-10 14:27     ` Stefan Monnier
  2007-09-11  2:02       ` T. V. Raman
  2007-09-10 23:55     ` Richard Stallman
  1 sibling, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2007-09-10 14:27 UTC (permalink / raw)
  To: raman; +Cc: emacs-pretest-bug

> Here is a more accurate description of the problem.

> If you define an advice on a  command, and in that advice you
> provide an interactive form,
> then calling interactive-form later on that function ends up
> returning what was created through the advice, and that turns out
> to be a piece of code.

> I'm hitting this because of how I end up having to advice
> commands like copy-to-register -- 
> whose interactive forms wouldn't provide speech feedback
> otherwise.

Please give me more concrete data.  Here's what I tried:

   ELISP> (defadvice diff-refine-ignore-spaces-hunk (around sm-test activate)
            (interactive "")
            ad-do-it)
   diff-refine-ignore-spaces-hunk
   ELISP> (interactive-form 'diff-refine-ignore-spaces-hunk)
   (interactive "")
   
   ELISP> 

looks correct so far.


        Stefan

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

* Re: 23.0.50; interactive-form on advised commands returns compiled advice
  2007-09-10 13:16   ` T. V. Raman
  2007-09-10 14:27     ` Stefan Monnier
@ 2007-09-10 23:55     ` Richard Stallman
  1 sibling, 0 replies; 7+ messages in thread
From: Richard Stallman @ 2007-09-10 23:55 UTC (permalink / raw)
  To: raman; +Cc: emacs-pretest-bug, raman, monnier

    Here is a more accurate description of the problem.

    If you define an advice on a  command, and in that advice you
    provide an interactive form,

You're aiming for the wrong goal.  It isn't a matter of "a more
accurate description".  What we need is not a _description_ -- of any
kind.  What we need is a precise test case.

Please read the Bugs section in the Emacs manual, which provides
guidelines on how to write a bug report to give us the
necessary information so we can fix the bug.

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

* Re: 23.0.50; interactive-form on advised commands returns compiled advice
  2007-09-10 14:27     ` Stefan Monnier
@ 2007-09-11  2:02       ` T. V. Raman
  2007-09-11  3:04         ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: T. V. Raman @ 2007-09-11  2:02 UTC (permalink / raw)
  To: monnier; +Cc: emacs-pretest-bug, raman



Stefane,

Here is some sample code.

If you byte compile this, then calling interactive-form on foo
will return the byte-compiled code.
;;; Define a function that uses interactive 

(defun foo (c)
(interactive "cChar:")
c)

;;; replace the interactive form via advice 

(defadvice foo (before test pre act comp)
          "Advice the interactive form."
          (interactive
(list
(progn 
(message "hello")
(read-char "Char:")))))

           
;;; (interactive-form 'foo)
;;; returns the new interactive form.

Now byte-compile this code -- you get the compiled code when you
call interactive-form.
Strictly speaking it's unclear whether this is in fact a bug. But
it would be nice if interactive-form 
did not return compiled code.

-- 
Best Regards,
--raman

      
Email:  raman@users.sf.net
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@gmail.com
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs

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

* Re: 23.0.50; interactive-form on advised commands returns compiled advice
  2007-09-11  2:02       ` T. V. Raman
@ 2007-09-11  3:04         ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2007-09-11  3:04 UTC (permalink / raw)
  To: raman; +Cc: emacs-pretest-bug

> Here is some sample code.

> If you byte compile this, then calling interactive-form on foo
> will return the byte-compiled code.
> ;;; Define a function that uses interactive 

> (defun foo (c)
> (interactive "cChar:")
> c)

Huh?  I placed the above in a file foo.el then byte-compiled the file,
loaded it and called M-: (interactive-form 'foo) RET and got (interactive
"cChar:") in return.

Please re-read the DEBUG file explaining what is a proper way to report
a bug.  I.e. basically presume I'm a brainless idiot who barely knows what's
a keyboard and tell me *every single move* I need to do and what I'm
supposed to see after each such move.


        Stefan

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

end of thread, other threads:[~2007-09-11  3:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-09 23:48 23.0.50; interactive-form on advised commands returns compiled advice raman
2007-09-10  2:55 ` Stefan Monnier
2007-09-10 13:16   ` T. V. Raman
2007-09-10 14:27     ` Stefan Monnier
2007-09-11  2:02       ` T. V. Raman
2007-09-11  3:04         ` Stefan Monnier
2007-09-10 23:55     ` Richard Stallman

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