aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2002-07-07 20:25:23 +0000
committerStefan Monnier2002-07-07 20:25:23 +0000
commit7473b6ad844fe58aaf359a9d90ef17181abe451c (patch)
tree3231544de04f424173d15e5e42af8ba9ab05ddbd
parent287360825e6a069702170e38ff64e33846ebdabf (diff)
downloademacs-7473b6ad844fe58aaf359a9d90ef17181abe451c.tar.gz
emacs-7473b6ad844fe58aaf359a9d90ef17181abe451c.zip
(debug-on-entry): Fix the wrapper used for
aliases to also work for interactive functions. Use the same wrapper for subroutines. (cancel-debug-on-entry): Get rid of the now-useless wrapper. (debug-on-entry-1): Correctly skip docstrings and interactive forms.
-rw-r--r--lisp/ChangeLog24
-rw-r--r--lisp/emacs-lisp/debug.el46
2 files changed, 52 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0dc4a1c65ee..4a38c33686d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12002-07-07 Stefan Monnier <monnier@cs.yale.edu>
2
3 * emacs-lisp/debug.el (debug-on-entry): Fix the wrapper used for
4 aliases to also work for interactive functions.
5 Use the same wrapper for subroutines.
6 (cancel-debug-on-entry): Get rid of the now-useless wrapper.
7 (debug-on-entry-1): Correctly skip docstrings and interactive forms.
8
9 * textmodes/texinfo.el (texinfo-font-lock-keywords): Disable the
10 automatic environment name update.
11 (texinfo-clone-environment): Fix it not to incorrectly match prefixes.
12
12002-07-07 Richard M. Stallman <rms@gnu.org> 132002-07-07 Richard M. Stallman <rms@gnu.org>
2 14
3 * emacs-lisp/easymenu.el (easy-menu-popup-menu): Function deleted. 15 * emacs-lisp/easymenu.el (easy-menu-popup-menu): Function deleted.
@@ -10,7 +22,7 @@
10 Also allow `safe-local-eval-function' property to be a function 22 Also allow `safe-local-eval-function' property to be a function
11 or a list of functions. 23 or a list of functions.
12 (c-add-style): Delete `safe-local-eval-function' property. 24 (c-add-style): Delete `safe-local-eval-function' property.
13 25
14 * files.el (after-find-file): Make buffer read-only if file is 26 * files.el (after-find-file): Make buffer read-only if file is
15 marked that way, even for root. 27 marked that way, even for root.
16 28
@@ -33,6 +45,16 @@
33 FCT if current column is outside rectangle. 45 FCT if current column is outside rectangle.
34 (cua--delete-rectangle): Do nothing if zero width or out of bounds. 46 (cua--delete-rectangle): Do nothing if zero width or out of bounds.
35 47
482002-07-04 Stefan Monnier <monnier@cs.yale.edu>
49
50 * net/ange-ftp.el: Use add-hook and find-file-hook.
51 (ange-ftp-parse-netrc): Use run-hooks and find-file-hook.
52 (ange-ftp-ls-parser): Make it into a function.
53 Ignore trailing @ in symlink targets.
54 (ange-ftp-file-entry-p): Ignore FTP errors.
55 (ange-ftp-insert-directory): Use ange-ftp-expand-symlink
56 to correctly expand "/flint:/bla -> ./etc" to /flint:/etc.
57
362002-07-04 Per Abrahamsen <abraham@dina.kvl.dk> 582002-07-04 Per Abrahamsen <abraham@dina.kvl.dk>
37 59
38 * simple.el (toggle-truncate-lines): New command. 60 * simple.el (toggle-truncate-lines): New command.
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index a0165a8d198..22607c7c42f 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -611,12 +611,16 @@ Redefining FUNCTION also cancels it."
611 (interactive "aDebug on entry (to function): ") 611 (interactive "aDebug on entry (to function): ")
612 (debugger-reenable) 612 (debugger-reenable)
613 ;; Handle a function that has been aliased to some other function. 613 ;; Handle a function that has been aliased to some other function.
614 (if (symbolp (symbol-function function)) 614 (if (and (subrp (symbol-function function))
615 (eq (cdr (subr-arity (symbol-function function))) 'unevalled))
616 (error "Function %s is a special form" function))
617 (if (or (symbolp (symbol-function function))
618 (subrp (symbol-function function)))
619 ;; Create a wrapper in which we can then add the necessary debug call.
615 (fset function `(lambda (&rest debug-on-entry-args) 620 (fset function `(lambda (&rest debug-on-entry-args)
621 ,(interactive-form (symbol-function function))
616 (apply ',(symbol-function function) 622 (apply ',(symbol-function function)
617 debug-on-entry-args)))) 623 debug-on-entry-args))))
618 (if (subrp (symbol-function function))
619 (error "Function %s is a primitive" function))
620 (or (consp (symbol-function function)) 624 (or (consp (symbol-function function))
621 (debug-convert-byte-code function)) 625 (debug-convert-byte-code function))
622 (or (consp (symbol-function function)) 626 (or (consp (symbol-function function))
@@ -639,8 +643,15 @@ If argument is nil or an empty string, cancel for all functions."
639 (debugger-reenable) 643 (debugger-reenable)
640 (if (and function (not (string= function ""))) 644 (if (and function (not (string= function "")))
641 (progn 645 (progn
642 (fset function 646 (let ((f (debug-on-entry-1 function (symbol-function function) nil)))
643 (debug-on-entry-1 function (symbol-function function) nil)) 647 (condition-case nil
648 (if (and (equal (nth 1 f) '(&rest debug-on-entry-args))
649 (eq (car (nth 3 f)) 'apply))
650 ;; `f' is a wrapper introduced in debug-on-entry.
651 ;; Get rid of it since we don't need it any more.
652 (setq f (nth 1 (nth 1 (nth 3 f)))))
653 (error nil))
654 (fset function f))
644 (setq debug-function-list (delq function debug-function-list)) 655 (setq debug-function-list (delq function debug-function-list))
645 function) 656 function)
646 (message "Cancelling debug-on-entry for all functions") 657 (message "Cancelling debug-on-entry for all functions")
@@ -670,18 +681,19 @@ If argument is nil or an empty string, cancel for all functions."
670 (debug-on-entry-1 function (cdr defn) flag) 681 (debug-on-entry-1 function (cdr defn) flag)
671 (or (eq (car defn) 'lambda) 682 (or (eq (car defn) 'lambda)
672 (error "%s not user-defined Lisp function" function)) 683 (error "%s not user-defined Lisp function" function))
673 (let (tail prec) 684 (let ((tail (cddr defn)))
674 (if (stringp (car (nthcdr 2 defn))) 685 ;; Skip the docstring.
675 (setq tail (nthcdr 3 defn) 686 (if (stringp (car tail)) (setq tail (cdr tail)))
676 prec (list (car defn) (car (cdr defn)) 687 ;; Skip the interactive form.
677 (car (cdr (cdr defn))))) 688 (if (eq 'interactive (car-safe (car tail))) (setq tail (cdr tail)))
678 (setq tail (nthcdr 2 defn) 689 (unless (eq flag (equal (car tail) '(debug 'debug)))
679 prec (list (car defn) (car (cdr defn))))) 690 ;; Add/remove debug statement as needed.
680 (if (eq flag (equal (car tail) '(debug 'debug))) 691 (if (not flag)
681 defn 692 (progn (setcar tail (cadr tail))
682 (if flag 693 (setcdr tail (cddr tail)))
683 (nconc prec (cons '(debug 'debug) tail)) 694 (setcdr tail (cons (car tail) (cdr tail)))
684 (nconc prec (cdr tail)))))))) 695 (setcar tail '(debug 'debug))))
696 defn))))
685 697
686(defun debugger-list-functions () 698(defun debugger-list-functions ()
687 "Display a list of all the functions now set to debug on entry." 699 "Display a list of all the functions now set to debug on entry."