1. xemacs
  2. xemacs-devel


andreasj  committed d7217f1

Applied Christopf Wedler's patch from
with subject " trace.el: default arg for trace functions"

  • Participants
  • Parent commits 4480962
  • Branches default

Comments (0)

Files changed (2)

File ChangeLog

View file
+1998-09-28  Christoph Wedler  <wedler@fmi.uni-passau.de>
+	* trace.el (trace-function-read): New function.
+	(trace-function): Use it.
+	(trace-function-background): Use it.
 1999-05-28  Karl M. Hegbloom  <karlheg@debian.org>
 	* hide-copyleft.el: Get rid of `more-copylefts-to-hide', and just

File trace.el

View file
 (defun trace-is-traced (function)
   (ad-find-advice function 'around trace-advice-name))
+;; shamelessly stolen from find-func
+(defun trace-function-read (prompt)
+  "Read and return an interned function symbol.
+Default to the one near point."
+  (let* ((symb (function-at-point))
+	 (enable-recursive-minibuffers t)
+	 (val (completing-read
+	       (format prompt
+		       (if symb (format " (default %s)" symb) ""))
+	       obarray 'fboundp t nil 'function-history)))
+    (if (equal val "") symb (intern val))))
 (defun trace-function (function &optional buffer)
   "Traces FUNCTION with trace output going to BUFFER.
 display oriented stuff, use `trace-function-background' instead."
-    (intern (completing-read "Trace function: " obarray 'fboundp t))
+    (trace-function-read "Trace function%s: ")
     (read-buffer "Output to buffer: " trace-buffer)))
   (trace-function-internal function buffer nil))
 the window or buffer configuration at all."
-    (intern
-     (completing-read "Trace function in background: " obarray 'fboundp t))
+    (trace-function-read "Trace function in background%s: ")
     (read-buffer "Output to buffer: " trace-buffer)))
   (trace-function-internal function buffer t))