unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: A Soare <alinsoar@voila.fr>
To: "Emacs   Dev  [emacs-devel]" <emacs-devel@gnu.org>
Subject: kill-buffer during *debugging*
Date: Thu, 15 Feb 2007 11:31:54 +0100 (CET)	[thread overview]
Message-ID: <14662106.236271171535514626.JavaMail.www@wwinf4103> (raw)

[-- Attachment #1: Type: text/plain, Size: 3971 bytes --]

Hello.

> If I kill the buffer where the lisp debugger was running, The *Debugging* mode is still active on the line mode, even I press C-j.

I reported a few days ago a bug on bug.emacs list (the upper line). I have been asked by a few persons to report it again , using the format of a bug-report from etc/ directory.

Here it is:

1. instrument with edebug a lisp function. For example, this very simple automaton:

(defun build-automaton (s alphabet-length first-char &optional start-pos)
  "this preprocessing state builds an automaton"
  (let* ((number-of-states (1+ (length s)))
         (matrix (make-vector number-of-states nil))
         (last-state 0))
    (dotimes (i number-of-states)
      (aset matrix i (make-vector alphabet-length 0))
      (dotimes (j alphabet-length)
        (aset (aref matrix i) j (if (and (/= i (1- number-of-states))
                                          (equal (aref s i) (+ j first-char)))
                                    (1+ i)
                                  (aref (aref matrix last-state) j))))
      (if (and (/= i (1- number-of-states))
               (not (zerop i)))
          (set 'last-state (aref (aref matrix last-state) (- (aref s i)
                                                             first-char)))))
    matrix))

2. Call this function, for example like this:

(build-automaton "emacs" 27 ?a)

3. WITHOUT STOPPING the debugger kill the buffer using C-x k.

Here is the bug. The *debugging* mode is still active. More, if I want to debug another instrumented function, impossible. We must run by hand M-: (top-level) to come back normally to command-loop.

---------------------------------

I tried first this code in lisp/emacs-lisp/edebug.el:

    (define-key map "\C-xk" (lambda ()
                              (interactive)
                              (unwind-protect (top-level)
                               (kill-buffer (current-buffer)))))

But this code does not work here. Can somebody explain me why, please? I do  not understant why:

Debugger entered: nil
  edebug-display()
  edebug(error (error "Selecting deleted buffer"))
  signal(error ("Selecting deleted buffer"))
  edebug-signal(error ("Selecting deleted buffer"))

----------------------

Quand j'ai eu essayé cette possibilité et vu que ça ne roule pas, il vallait le mieux que je demande sur help.emacs list. Il y a quelqu'un qui m'a repondu. Son code marche. Donc voici ci-dessous:

1. the output from cvs -d:pserver:anonymous@cvs.gnu.org:/sources/emacs diff -c emacs/lisp/emacs-lisp/edebug.el.
2. a Change-log-file attached.




###################################################################################################
Index: emacs/lisp/emacs-lisp/edebug.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/edebug.el,v
retrieving revision 3.94
diff -c -r3.94 edebug.el
*** emacs/lisp/emacs-lisp/edebug.el	21 Jan 2007 02:44:24 -0000	3.94
--- emacs/lisp/emacs-lisp/edebug.el	15 Feb 2007 10:23:13 -0000
***************
*** 3820,3825 ****
--- 3820,3833 ----
      (define-key map "Q" 'edebug-top-level-nonstop)
      (define-key map "a" 'abort-recursive-edit)
      (define-key map "S" 'edebug-stop)
+     (define-key map "\C-xk" (lambda ()
+                               (interactive)
+                               (run-with-idle-timer 0 nil
+                                                    (lambda()
+                                                      (kill-buffer
+                                                       (current-buffer))
+                                                      ))
+                               (top-level)))
  
      ;; breakpoints
      (define-key map "b" 'edebug-set-breakpoint)
########################################################################################################










[-- Attachment #2: /changelog --]
[-- Type: application/octet-stream, Size: 170 bytes --]

2007-02-15  Alin C. Soare  <alinsoar@voila.fr>  (tiny change)

	* lisp/emacs-lisp/edebug.el (edebug-mode-map): Added code for
	kill-buffer keybinding in *debugging* mode

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

             reply	other threads:[~2007-02-15 10:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-15 10:31 A Soare [this message]
2007-02-17 20:57 ` kill-buffer during *debugging* Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2007-02-18  8:56 A Soare
2007-02-20 18:07 ` Stuart D. Herring

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=14662106.236271171535514626.JavaMail.www@wwinf4103 \
    --to=alinsoar@voila.fr \
    --cc=emacs-devel@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).