Hi,
I am annoyed by edebug which still breaks pre,post-command-hook
in XEmacs 21.4 because the variable-binding-locus function is
absent. Normally, those hooks contain paren-nuke-extent and
paren-highlight in my environment because I am using paren.el by
the following:
(paren-set-mode 3 'quiet)
Once I used edebug, it sometimes breaks those hooks and paren
highlights will never disappear. For instance, it is easy to
reproduce it if you are using Gnus:
1. Put the following function in the *scratch* buffer and perform
``M-x edebug-defun'' on the hello-world function.
(defun hello-world ()
(interactive)
(let ((current (current-buffer))
(buffer (get-buffer-create "*testing*")))
(set-buffer buffer)
(message "Hello World")
(set-buffer current)))
2. Enter the Gnus summary buffer and type ``M-x hello-world''.
3. Type SPC several times until it reaches the "Hello World" line.
4. Quit the edebug using the q key.
The obstacle arose because pre-command-hook is made buffer-local
in the Gnus summary buffer. That local value is saved when
edebug starts, and then, restored at the *scratch* buffer.
Since the variable-binding-locus function is used for saving
pre-command-hook and post-command-hook only, cannot it be
replaced with `(current-buffer)' if it is not available? Here
is a patch which helps all the released XEmacsen:
2003-10-10 Katsumi Yamaoka <yamaoka(a)jpl.org>
* edebug.el (edebug-var-status): Use current-buffer unless the
variable-binding-locus function is available.
--- edebug.el~ 2003-09-10 22:04:29 +0000
+++ edebug.el 2003-10-10 00:33:07 +0000
@@ -2349,7 +2349,9 @@
has the form (LOCUS . VALUE), where LOCUS can be a buffer
\(for a buffer-local binding), a frame (for a frame-local binding),
or nil (if the default binding is current)."
- (cons (and (fboundp 'variable-binding-locus) (variable-binding-locus var))
+ (cons (if (fboundp 'variable-binding-locus)
+ (variable-binding-locus var)
+ (current-buffer))
(symbol-value var)))
(defun edebug-restore-status (var status)