all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: cedet-called-interactively-p hangs on emacs 24.3.50.1
       [not found]   ` <87623x1yv8.wl%andres.ramirez@kipuamutay.com>
@ 2012-12-20 14:06     ` Lluís
  2012-12-20 14:25       ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Lluís @ 2012-12-20 14:06 UTC (permalink / raw)
  To: emacs-devel; +Cc: Alex Ott, andres.ramirez, Lluís, CEDET Devel

[Adding emacs-devel]

Summary:

CEDET has a `cedet-called-interactively-p' that is translated into a macro or an
alias depending on the Emacs version on which it is being compiled [1].

When called, it looks like it gets stuck on an infinite loop. Manually replacing
that code with a defalias (from `cedet-called-interactively-p' to
`called-interactively-p') results in the same.

Manually replacing it with a function solves it, but AFAIU an alias or macro
should work:

#v+
(defun cedet-called-interactively-p (arg)
    (called-interactively-p arg))
#v-

Emacs 24.2.1 with the same CEDET version was working properly.

Any ideas why this might happen?


[1] http://cedet.bzr.sourceforge.net/bzr/cedet/code/trunk/annotate/head%3A/lisp/cedet/cedet-compat.el#L181

Thanks,
  Lluis


andres ramirez writes:

> Hi List.
> Adding more info to this. My Cedet verion is very recent.

> I have two version of emacs:



> 1. GNU Emacs 24.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.2) of
> 2012-11-18 on eric 
> 2. GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
>  of 2012-12-14 on paracas

> On 1 It works without problems. Problems just on 2.

> Regards
> At Wed, 19 Dec 2012 08:26:18 +0100,
> Alex Ott wrote:
>> 
>> I can confirm this, this happened since 15.11.2012 - at least this is
>> last version of emacs-snapshot at Debian that works for me. I'll try
>> to find time and debug this, but can't promise that this will be done
>> before holidays
>> 
>> On Mon, Dec 17, 2012 at 8:20 PM, Lluís <xscript@gmx.net> wrote:
>> > For some reason I don't understand I had to replace all the related trickery in
>> > cedet-compat with:
>> >
>> > #v+
>> > (defun cedet-called-interactively-p (arg)
>> >     (called-interactively-p arg))
>> > #v-
>> >
>> > Otherwise the system hangs every time `cedet-called-interactively-p' is called.
>> >
>> > Defining it as an alias to `called-interactively-p' also hangs.
>> >
>> > I'm not sure if this is related to CEDET or Emacs itself.
>> >
>> >
>> > Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth



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

* Re: cedet-called-interactively-p hangs on emacs 24.3.50.1
  2012-12-20 14:06     ` cedet-called-interactively-p hangs on emacs 24.3.50.1 Lluís
@ 2012-12-20 14:25       ` Stefan Monnier
  2012-12-20 14:47         ` joakim
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2012-12-20 14:25 UTC (permalink / raw)
  To: emacs-devel; +Cc: Alex Ott, andres.ramirez, Lluís, CEDET Devel

> Emacs 24.2.1 with the same CEDET version was working properly.

Please make it a bug-report, and include a backtrace (obtained with
"Options => Enter Debugger on Quit/C-g", assuming that works).


        Stefan



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

* Re: cedet-called-interactively-p hangs on emacs 24.3.50.1
  2012-12-20 14:25       ` Stefan Monnier
@ 2012-12-20 14:47         ` joakim
  2012-12-20 14:58           ` Lluís
  2012-12-20 16:03           ` Drew Adams
  0 siblings, 2 replies; 5+ messages in thread
From: joakim @ 2012-12-20 14:47 UTC (permalink / raw)
  To: Stefan Monnier
  Cc: Alex Ott, Lluís, andres.ramirez, CEDET Devel, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Emacs 24.2.1 with the same CEDET version was working properly.
>
> Please make it a bug-report, and include a backtrace (obtained with
> "Options => Enter Debugger on Quit/C-g", assuming that works).
>
>
>         Stefan
>

I tried to make this a bug report, but it doesnt seem to have shown up
yet, or somehing.

I have the exact same issue and I think I now understand the problem.

For an ugly fix, try this:

  (defmacro internal--called-interactively-p--get-frame (n)
    ;; `sym' will hold a global variable, which will be used kind of like C's
    ;; "static" variables.
    (let ((sym (make-symbol "base-index")))
      `(progn
         (defvar ,sym
           (let ((i 1))
             (while (not (or  (eq (nth 1 (backtrace-frame i))
                                  'called-interactively-p)
                              (eq (nth 1 (backtrace-frame i))
                                  'cedet-called-interactively-p)))
               (setq i (1+ i)))
             i))
         ;; (unless (eq (nth 1 (backtrace-frame ,sym)) 'called-interactively-p)
         ;;   (error "called-interactively-p: %s is out-of-sync!" ,sym))
         (backtrace-frame (+ ,sym ,n)))))


so, the problem seems to be a change in emacs core for
called-interactively-p. It wont complete if one alias  the definition of
called-interactively-p as Cedet does. So the ugly test fix is to check
for this particular alias. Obviously a correct fix needs to be made.


-- 
Joakim Verona



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

* Re: cedet-called-interactively-p hangs on emacs 24.3.50.1
  2012-12-20 14:47         ` joakim
@ 2012-12-20 14:58           ` Lluís
  2012-12-20 16:03           ` Drew Adams
  1 sibling, 0 replies; 5+ messages in thread
From: Lluís @ 2012-12-20 14:58 UTC (permalink / raw)
  To: joakim; +Cc: Alex Ott, andres.ramirez, Stefan Monnier, CEDET Devel,
	emacs-devel

joakim  writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> Emacs 24.2.1 with the same CEDET version was working properly.
>> 
>> Please make it a bug-report, and include a backtrace (obtained with
>> "Options => Enter Debugger on Quit/C-g", assuming that works).
>> 
>> 
>> Stefan
>> 

> I tried to make this a bug report, but it doesnt seem to have shown up
> yet, or somehing.

I just sent it as bug #13237:
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13237


Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth



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

* RE: cedet-called-interactively-p hangs on emacs 24.3.50.1
  2012-12-20 14:47         ` joakim
  2012-12-20 14:58           ` Lluís
@ 2012-12-20 16:03           ` Drew Adams
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2012-12-20 16:03 UTC (permalink / raw)
  To: joakim, 'Stefan Monnier'
  Cc: 'Alex Ott', emacs-devel, 'Lluís',
	'CEDET Devel', 'andres.ramirez'

> I have the exact same issue... 
> so, the problem seems to be a change in emacs core for
> called-interactively-p.

I haven't run into the problems mentioned (I don't use CEDET or advise
`called-interactively' or `interactive-p'). 

But FWIW I have noticed that the behavior has recently changed in the debugger.
Now you definitely want to hit `c' and not `d', to skip over the evaluation,
because it takes you on a little tour around Robinson's barn.

BTW, in the debugger I see this:
* advice--called-interactively-skip(4 (t #[...] ...

And in nadvice.el I see this:

;; When code is advised, called-interactively-p needs to be taught to skip
;; the advising frames.
;; FIXME: This Major Ugly Hack won't handle calls to called-interactively-p
;; done from the advised function if the deepest advice is an around advice!
;; In other cases (calls from an advice or calls from the advised function when
;; the deepest advice is not an around advice), it should hopefully get
;; it right.

It does indeed seem like we are making Emacs jump through hoops backward.  No
doubt there is some thorny problem that the code solves, but the comments don't
indicate what that might be.




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

end of thread, other threads:[~2012-12-20 16:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87obhsxz7s.fsf@fimbulvetr.bsc.es>
     [not found] ` <CALV1_=+T-2tJbyFQn-9o2LtoazQRk9p_5K5BY=4CRkXdULYFsA@mail.gmail.com>
     [not found]   ` <87623x1yv8.wl%andres.ramirez@kipuamutay.com>
2012-12-20 14:06     ` cedet-called-interactively-p hangs on emacs 24.3.50.1 Lluís
2012-12-20 14:25       ` Stefan Monnier
2012-12-20 14:47         ` joakim
2012-12-20 14:58           ` Lluís
2012-12-20 16:03           ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.