From 7b0e2f853fcd88c58715fd159923d50dfdeb9cba Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Sun, 24 Mar 2013 14:42:25 +0800 Subject: * lisp/files.el (kill-buffer-hook): Doc fix. * lisp/emacs-lisp/edebug.el (edebug-mode): Make sure edebug-kill-buffer is the last entry in kill-buffer-hook. * lisp/nxml/rng-valid.el (rng-validate-while-idle) (rng-validate-quick-while-idle): Guard against deleted buffer. Fixes: debbugs:13999 --- lisp/emacs-lisp/edebug.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/edebug.el') diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 52e12013fd3..5a6fd4a0a22 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -3810,7 +3810,10 @@ Options: ;; If the user kills the buffer in which edebug is currently active, ;; exit to top level, because the edebug command loop can't usefully ;; continue running in such a case. - (add-hook 'kill-buffer-hook 'edebug-kill-buffer nil t) + ;; + ;; Append `edebug-kill-buffer' to the hook to avoid interfering with + ;; other entries that are ungarded against deleted buffer. + (add-hook 'kill-buffer-hook 'edebug-kill-buffer t t) (use-local-map edebug-mode-map)) (defun edebug-kill-buffer () -- cgit v1.2.3 From 17c781d1e6703ec32e459dc09547d8d1c7a3a534 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 28 Mar 2013 12:33:06 -0400 Subject: * lisp/emacs-lisp/edebug.el (edebug-mode): Make it a minor mode. (edebug--recursive-edit): Use it. (edebug-kill-buffer): Don't let-bind kill-buffer-hook. (edebug-temp-display-freq-count): Don't let-bind buffer-read-only. --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/edebug.el | 51 +++++++++++++++++++++++++---------------------- 2 files changed, 34 insertions(+), 24 deletions(-) (limited to 'lisp/emacs-lisp/edebug.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6ba1ace546a..a3ef9b2ae6d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-03-28 Stefan Monnier + + * emacs-lisp/edebug.el (edebug-mode): Make it a minor mode. + (edebug--recursive-edit): Use it. + (edebug-kill-buffer): Don't let-bind kill-buffer-hook. + (edebug-temp-display-freq-count): Don't let-bind buffer-read-only. + 2013-03-28 Leo Liu * vc/vc-bzr.el (vc-bzr-revert): Don't backup. (Bug#14066) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 5a6fd4a0a22..4ecd244ebf2 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -54,6 +54,7 @@ (require 'macroexp) (eval-when-compile (require 'cl-lib)) +(eval-when-compile (require 'pcase)) ;;; Options @@ -2072,11 +2073,6 @@ expressions; a `progn' form will be returned enclosing these forms." (defvar edebug-active nil) ;; Non-nil when edebug is active -;;; add minor-mode-alist entry -(or (assq 'edebug-active minor-mode-alist) - (setq minor-mode-alist (cons (list 'edebug-active " *Debugging*") - minor-mode-alist))) - (defvar edebug-stack nil) ;; Stack of active functions evaluated via edebug. ;; Should be nil at the top level. @@ -2715,8 +2711,7 @@ MSG is printed after `::::} '." ;; Start up a recursive edit inside of edebug. ;; The current buffer is the edebug-buffer, which is put into edebug-mode. ;; Assume that none of the variables below are buffer-local. - (let ((edebug-buffer-read-only buffer-read-only) - ;; match-data must be done in the outside buffer + (let (;; match-data must be done in the outside buffer (edebug-outside-match-data (with-current-buffer edebug-outside-buffer ; in case match buffer different (match-data))) @@ -2730,8 +2725,6 @@ MSG is printed after `::::} '." ;; during a recursive-edit edebug-inside-windows - (edebug-outside-map (current-local-map)) - ;; Save the outside value of executing macro. (here??) (edebug-outside-executing-macro executing-kbd-macro) (edebug-outside-pre-command-hook @@ -2804,10 +2797,9 @@ MSG is printed after `::::} '." (not (memq arg-mode '(after error)))) (message "Break")) - (setq buffer-read-only t) (setq signal-hook-function nil) - (edebug-mode) + (edebug-mode 1) (unwind-protect (recursive-edit) ; <<<<<<<<<< Recursive edit @@ -2828,10 +2820,7 @@ MSG is printed after `::::} '." (set-buffer edebug-buffer) (if (memq edebug-execution-mode '(go Go-nonstop)) (edebug-overlay-arrow)) - (setq buffer-read-only edebug-buffer-read-only) - (use-local-map edebug-outside-map) - (remove-hook 'kill-buffer-hook 'edebug-kill-buffer t) - ) + (edebug-mode -1)) ;; gotta have a buffer to let its buffer local variables be set (get-buffer-create " bogus edebug buffer")) ));; inner let @@ -3773,7 +3762,9 @@ be installed in `emacs-lisp-mode-map'.") (interactive) (describe-function 'edebug-mode)) -(defun edebug-mode () +(defvar edebug--mode-saved-vars nil) + +(define-minor-mode edebug-mode "Mode for Emacs Lisp buffers while in Edebug. In addition to all Emacs Lisp commands (except those that modify the @@ -3807,20 +3798,32 @@ Options: `edebug-on-signal' `edebug-unwrap-results' `edebug-global-break-condition'" + :lighter " *Debugging*" + :keymap edebug-mode-map ;; If the user kills the buffer in which edebug is currently active, ;; exit to top level, because the edebug command loop can't usefully ;; continue running in such a case. ;; - ;; Append `edebug-kill-buffer' to the hook to avoid interfering with - ;; other entries that are ungarded against deleted buffer. - (add-hook 'kill-buffer-hook 'edebug-kill-buffer t t) - (use-local-map edebug-mode-map)) + (if (not edebug-mode) + (progn + (while edebug--mode-saved-vars + (let ((setting (pop edebug--mode-saved-vars))) + (if (consp setting) + (set (car setting) (cdr setting)) + (kill-local-variable setting)))) + (remove-hook 'kill-buffer-hook 'edebug-kill-buffer t)) + (pcase-dolist (`(,var . ,val) '((buffer-read-only . t))) + (push + (if (local-variable-p var) var (cons var (symbol-value var))) + edebug--mode-saved-vars) + (set (make-local-variable var) val)) + ;; Append `edebug-kill-buffer' to the hook to avoid interfering with + ;; other entries that are ungarded against deleted buffer. + (add-hook 'kill-buffer-hook 'edebug-kill-buffer t t))) (defun edebug-kill-buffer () "Used on `kill-buffer-hook' when Edebug is operating in a buffer of Lisp code." - (let (kill-buffer-hook) - (kill-buffer (current-buffer))) - (top-level)) + (run-with-timer 0 nil #'top-level)) ;;; edebug eval list mode @@ -4143,7 +4146,7 @@ reinstrument it." It is removed when you hit any char." ;; This seems not to work with Emacs 18.59. It undoes too far. (interactive) - (let ((buffer-read-only nil)) + (let ((inhibit-read-only t)) (undo-boundary) (edebug-display-freq-count) (setq unread-command-events -- cgit v1.2.3 From b9edfa5c63fda7166d7523038c74742822279939 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 1 Apr 2013 00:58:04 -0700 Subject: Spelling fixes. --- lib-src/ChangeLog | 2 +- lisp/ChangeLog | 2 +- lisp/ChangeLog.10 | 2 +- lisp/cedet/ede/cpp-root.el | 4 ++-- lisp/cedet/semantic/tag-ls.el | 2 +- lisp/emacs-lisp/edebug.el | 2 +- lisp/gnus/ChangeLog | 2 +- lisp/org/ChangeLog | 2 +- src/ChangeLog.10 | 2 +- src/nsmenu.m | 2 +- src/w32term.c | 2 +- test/automated/python-tests.el | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) (limited to 'lisp/emacs-lisp/edebug.el') diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 10758d80872..5606ae569b6 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -3728,7 +3728,7 @@ 2002-03-05 Francesco Potortì - * etags.c: Honour #line directives. + * etags.c: Honor #line directives. (no_line_directive): New global var; set it for old behavior. (main): Remove some #ifdef in the getopt switch. (add_node, put_entries): Code added to merge different chunks of diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0067dfe305b..1f7c2e4de83 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -5508,7 +5508,7 @@ * term/ns-win.el (ns-read-file-name): Update declaration to match nsfns.m. - (ns-respond-to-change-font): Change fontsize separatly so we are sure + (ns-respond-to-change-font): Change fontsize separately so we are sure it is set when font is acted upon. 2012-10-07 Fabián Ezequiel Gallina diff --git a/lisp/ChangeLog.10 b/lisp/ChangeLog.10 index 641ab617043..2d331a2819d 100644 --- a/lisp/ChangeLog.10 +++ b/lisp/ChangeLog.10 @@ -19493,7 +19493,7 @@ * menu-bar.el (menu-bar-showhide-scroll-bar-menu): Quote `window-system'. - * tmm.el (tmm-get-keymap): Honour :visible in `menu-item'. + * tmm.el (tmm-get-keymap): Honor :visible in `menu-item'. Add Keywords header. Update Commentary section. Update copyright notice. diff --git a/lisp/cedet/ede/cpp-root.el b/lisp/cedet/ede/cpp-root.el index cf2009ced30..47ba16ade7f 100644 --- a/lisp/cedet/ede/cpp-root.el +++ b/lisp/cedet/ede/cpp-root.el @@ -347,7 +347,7 @@ exist, it should return nil." :documentation "Compilation command that will be used for this project. It could be string or function that will accept proj argument and should return string. -The string will be passed to 'compuile' function that will be issued in root +The string will be passed to 'compile' function that will be issued in root directory of project." ) ) @@ -509,7 +509,7 @@ This is for project include paths and spp source files." (table (when expfile (semanticdb-file-table-object expfile))) ) - (cond + (cond ((not (file-exists-p expfile)) (message "Cannot find file %s in project." F)) ((string= expfile (buffer-file-name)) diff --git a/lisp/cedet/semantic/tag-ls.el b/lisp/cedet/semantic/tag-ls.el index 53da7b65661..bc7be980998 100644 --- a/lisp/cedet/semantic/tag-ls.el +++ b/lisp/cedet/semantic/tag-ls.el @@ -151,7 +151,7 @@ See `semantic-tag-similar-p' for details." ;; Added for performance when testing a relatively common case in some uses ;; of this code. (eq tag1 tag2) - ;; More complex similarness test. + ;; More complex similarity test. (let* ((ignore (append ignorable-attributes semantic-tag-similar-ignorable-attributes)) (A1 (and (semantic--tag-similar-names-p tag1 tag2 (memq :name ignore)) (semantic--tag-similar-types-p tag1 tag2) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 4ecd244ebf2..5929ea7a856 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -3818,7 +3818,7 @@ Options: edebug--mode-saved-vars) (set (make-local-variable var) val)) ;; Append `edebug-kill-buffer' to the hook to avoid interfering with - ;; other entries that are ungarded against deleted buffer. + ;; other entries that are unguarded against deleted buffer. (add-hook 'kill-buffer-hook 'edebug-kill-buffer t t))) (defun edebug-kill-buffer () diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index a400caca905..9bfcaad94f3 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -109,7 +109,7 @@ 2013-01-30 Christopher Schmidt * gnus-int.el (gnus-backend-trace-elapsed): New variable. - (gnus-backend-trace): Honour gnus-backend-trace. + (gnus-backend-trace): Honor gnus-backend-trace. * mml.el (mml-insert-part): Insert closing tag. diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index 1bf6fe315c1..895e009e619 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog @@ -5577,7 +5577,7 @@ 2012-04-01 Bernt Hansen - * org.el: Honour existing restrictions when regenerating the agenda. + * org.el: Honor existing restrictions when regenerating the agenda. 2012-04-01 Bastien Guerry diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 index 508a2a9dd4c..57c1cbf1299 100644 --- a/src/ChangeLog.10 +++ b/src/ChangeLog.10 @@ -1865,7 +1865,7 @@ 2006-10-07 Ralf Angeli - * w32fns.c (w32_createwindow): Honour left and top positions if + * w32fns.c (w32_createwindow): Honor left and top positions if supplied explicitly. 2006-10-06 Kim F. Storm diff --git a/src/nsmenu.m b/src/nsmenu.m index 4e26a994b59..15878dc74d7 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -508,7 +508,7 @@ void x_activate_menubar (struct frame *f) { NSArray *a = [[NSApp mainMenu] itemArray]; - /* Update each submenu separatly so ns_update_menubar don't reset + /* Update each submenu separately so ns_update_menubar doesn't reset the delegate. */ int i = 0; while (i < [a count]) diff --git a/src/w32term.c b/src/w32term.c index 5f7952c2ec2..d249d6e3252 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5694,7 +5694,7 @@ w32fullscreen_hook (FRAME_PTR f) /* Need to send SC_RESTORE to the window, in case we are resizing from FULLSCREEN_MAXIMIZED. Otherwise, the mouse resize hints will not be shown by the window manager when the - mouse pointer hovers over the window edges, becaise the WM + mouse pointer hovers over the window edges, because the WM will still think the window is maximized. */ if (f->want_fullscreen != FULLSCREEN_BOTH) SendMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_RESTORE, 0); diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index d0a7ab57250..1a741b45d81 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -445,7 +445,7 @@ objects = Thing.objects.all() \\\\ (should (= (python-indent-calculate-indentation) 0)))) (ert-deftest python-indent-block-enders () - "Test `python-indent-block-enders' value honouring." + "Test `python-indent-block-enders' value honoring." (python-tests-with-temp-buffer " Class foo(object): -- cgit v1.2.3