emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

edebug breaks pre,post-command-hook


From: Katsumi Yamaoka
Subject: edebug breaks pre,post-command-hook
Date: Fri, 05 Sep 2003 16:14:12 +0900
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

I'm sorry if this message is duplicated.  Although I've sent it
to the emacs-devel list the day before yesterday, it doesn't
appear in the GMANE news site yet. :(

Hi,

This is a way to regenerate the bug:

1. Memorize the current value of pre-command-hook.

2. Copy the following two forms into the *scratch* buffer:

(defun hello-world ()
  (let ((cur (current-buffer))
        (buf (get-buffer-create " *temp2*")))
    (set-buffer buf)
    (message "Hello World")
    (set-buffer cur)))

(with-temp-buffer
  (add-hook 'pre-command-hook 'ignore nil t)
  (hello-world))

3. Perform the edebug-defun command on the hello-world function.

4. Evaluate the later form using the C-j key.

5. Type SPC several times until it reaches the "Hello World" line.

6. Quit the edebug using the q key.

7. Examine the value of pre-command-hook.  Then you will see
   the value has changed to (ignore t).

Here is a quick hack for fixing the bug:


2003-09-03  Katsumi Yamaoka  <address@hidden>

        * edebug.el (edebug-enter): Don't break the values of
        pre-command-hook and post-command-hook.

*** edebug.el~  Mon Sep  1 21:59:42 2003
--- edebug.el   Wed Sep  3 10:22:55 2003
***************
*** 2241,2248 ****
  
            ;; Save the outside value of executing macro.  (here??)
            (edebug-outside-executing-macro executing-kbd-macro)
!           (edebug-outside-pre-command-hook pre-command-hook)
!           (edebug-outside-post-command-hook post-command-hook))
        (unwind-protect
            (let (;; Don't keep reading from an executing kbd macro
                  ;; within edebug unless edebug-continue-kbd-macro is
--- 2241,2250 ----
  
            ;; Save the outside value of executing macro.  (here??)
            (edebug-outside-executing-macro executing-kbd-macro)
!           (edebug-outside-pre-command-hook
!            (cons (current-buffer) pre-command-hook))
!           (edebug-outside-post-command-hook
!            (cons (current-buffer) post-command-hook)))
        (unwind-protect
            (let (;; Don't keep reading from an executing kbd macro
                  ;; within edebug unless edebug-continue-kbd-macro is
***************
*** 2267,2276 ****
                    edebug-next-execution-mode nil)
              (edebug-enter edebug-function edebug-args edebug-body))
          ;; Reset global variables in case outside value was changed.
!         (setq executing-kbd-macro edebug-outside-executing-macro
!               pre-command-hook edebug-outside-pre-command-hook
!               post-command-hook edebug-outside-post-command-hook
!               )))
  
      (let* ((edebug-data (get edebug-function 'edebug))
           (edebug-def-mark (car edebug-data)) ; mark at def start
--- 2269,2291 ----
                    edebug-next-execution-mode nil)
              (edebug-enter edebug-function edebug-args edebug-body))
          ;; Reset global variables in case outside value was changed.
!         (setq executing-kbd-macro edebug-outside-executing-macro)
!         (let (buffer)
!           (if (memq t edebug-outside-pre-command-hook)
!               (when (buffer-live-p
!                      (setq buffer (car edebug-outside-pre-command-hook)))
!                 (with-current-buffer buffer
!                   (setq pre-command-hook
!                         (cdr edebug-outside-pre-command-hook))))
!             (setq pre-command-hook
!                   (cdr edebug-outside-pre-command-hook)))
!           (if (memq t edebug-outside-post-command-hook)
!               (when (buffer-live-p
!                      (setq buffer (car edebug-outside-post-command-hook)))
!                 (setq post-command-hook
!                       (cdr edebug-outside-post-command-hook)))
!             (setq post-command-hook
!                   (cdr edebug-outside-post-command-hook))))))
  
      (let* ((edebug-data (get edebug-function 'edebug))
           (edebug-def-mark (car edebug-data)) ; mark at def start
-- 
Katsumi Yamaoka <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]