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

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

Re: Problems with edebug-set-conditional-breakpoint.


From: Juri Linkov
Subject: Re: Problems with edebug-set-conditional-breakpoint.
Date: Thu, 25 Nov 2004 09:09:29 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Matt Hodges <address@hidden> writes:
> I've been reading through lispref/edebug.texi and have come across two
> related problems with edebug-set-conditional-breakpoint.

Thanks for your report.  The cause of both problem is unusual handling
of the history and default values (pushing the default value
temporarily to the history before reading an expression).

The standard way is to use either initial-contents or default-value
argument.  In this case initial-contents looks better, because if the
default-value was used then too many parens inside the top-level
parens of "(default ...)" would be too confusing, and secondly the
current break condition might be too long so the complete prompt
wouldn't fit to the screen.

Also I think a similar prompt (with read-expression-history) should be
used for the `X' command as well:

Index: lisp/emacs-lisp/edebug.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/edebug.el,v
retrieving revision 3.70
diff -u -r3.70 edebug.el
--- lisp/emacs-lisp/edebug.el   5 Nov 2004 19:07:07 -0000       3.70
+++ lisp/emacs-lisp/edebug.el   25 Nov 2004 06:42:03 -0000
@@ -3240,9 +3240,11 @@
 
 
 (defun edebug-set-global-break-condition (expression)
-  (interactive (list (read-minibuffer
-                     "Global Condition: "
-                     (format "%s" edebug-global-break-condition))))
+  (interactive (list
+               (read-from-minibuffer
+                "Global Condition: "
+                (format "%s" edebug-global-break-condition)
+                read-expression-map t 'read-expression-history)))
   (setq edebug-global-break-condition expression))
 
 
@@ -4335,18 +4337,12 @@
                 (edebug-data (get edebug-def-name 'edebug))
                 (edebug-breakpoints (car (cdr edebug-data)))
                 (edebug-break-data (assq index edebug-breakpoints))
-                (edebug-break-condition (car (cdr edebug-break-data)))
-                (edebug-expression-history
-                 ;; Prepend the current condition, if any.
-                 (if edebug-break-condition
-                     (cons edebug-break-condition read-expression-history)
-                   read-expression-history)))
-           (prog1
-               (read-from-minibuffer
-                "Condition: " nil read-expression-map t
-                'edebug-expression-history)
-             (setq read-expression-history edebug-expression-history)
-             ))))))
+                (edebug-break-condition (car (cdr edebug-break-data))))
+           (read-from-minibuffer
+            "Condition: "
+            (if edebug-break-condition
+                (format "%s" edebug-break-condition))
+            read-expression-map t 'read-expression-history))))))
   (edebug-modify-breakpoint t condition arg))
 
 ;;; The default for all above is Emacs.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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