summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-10-22 13:12:03 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-10-22 13:12:08 +0200
commit7f5d92e64326173b9d2d14567739390320403ec8 (patch)
treeb5a7aceb1857e131ae647f54eed1e4cb30012c56 /lisp/emacs-lisp
parent4a9d8bdca3e502c1e87c4c50df3926c629475d39 (diff)
downloademacs-7f5d92e64326173b9d2d14567739390320403ec8.tar.gz
emacs-7f5d92e64326173b9d2d14567739390320403ec8.tar.bz2
emacs-7f5d92e64326173b9d2d14567739390320403ec8.zip
Make edebug-eval-last-sexp interactively take a zero prefix
* lisp/emacs-lisp/edebug.el (edebug-eval-last-sexp): Make the zero prefix work analogously to in eval-last-sexp (bug#28895). (edebug-eval-print-last-sexp): Ditto.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/edebug.el39
1 files changed, 29 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 7a40ca36b8f..237d93922ff 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -3749,26 +3749,45 @@ Print result in minibuffer."
(concat (edebug-safe-prin1-to-string (car values))
(eval-expression-print-format (car values))))))
-(defun edebug-eval-last-sexp ()
+(defun edebug-eval-last-sexp (&optional no-truncate)
"Evaluate sexp before point in the outside environment.
-Print value in minibuffer."
- (interactive)
- (edebug-eval-expression (edebug-last-sexp)))
+Print value in minibuffer.
-(defun edebug-eval-print-last-sexp ()
+If NO-TRUNCATE is non-nil (or interactively with a prefix
+argument of zero), show the full length of the expression, not
+limited by `edebug-print-length' or `edebug-print-level'."
+ (interactive
+ (list (and current-prefix-arg
+ (zerop (prefix-numeric-value current-prefix-arg)))))
+ (if no-truncate
+ (let ((edebug-print-length nil)
+ (edebug-print-level nil))
+ (edebug-eval-expression (edebug-last-sexp)))
+ (edebug-eval-expression (edebug-last-sexp))))
+
+(defun edebug-eval-print-last-sexp (&optional no-truncate)
"Evaluate sexp before point in outside environment; insert value.
-This prints the value into current buffer."
- (interactive)
+This prints the value into current buffer.
+
+If NO-TRUNCATE is non-nil (or interactively with a prefix
+argument of zero), show the full length of the expression, not
+limited by `edebug-print-length' or `edebug-print-level'."
+ (interactive
+ (list (and current-prefix-arg
+ (zerop (prefix-numeric-value current-prefix-arg)))))
(let* ((form (edebug-last-sexp))
(result-string
(edebug-outside-excursion
- (edebug-safe-prin1-to-string (edebug-safe-eval form))))
+ (if no-truncate
+ (let ((edebug-print-length nil)
+ (edebug-print-level nil))
+ (edebug-safe-prin1-to-string (edebug-safe-eval form)))
+ (edebug-safe-prin1-to-string (edebug-safe-eval form)))))
(standard-output (current-buffer)))
(princ "\n")
;; princ the string to get rid of quotes.
(princ result-string)
- (princ "\n")
- ))
+ (princ "\n")))
;;; Edebug Minor Mode