mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-04 11:23:24 +00:00
Remove useless unwind-protect forms, or make them useful as intended
* lisp/imenu.el (imenu--generic-function): * lisp/mail/yenc.el (yenc-decode-region): * lisp/textmodes/table.el (table-recognize-region): * test/lisp/dired-tests.el (dired-test-directory-files): * test/lisp/hl-line-tests.el (hl-line-tests-sticky): Fix unwind-protect bracketing mistakes that caused the unwind code to be misplaced. * lisp/strokes.el (strokes-read-stroke): Fix a bracketing mistake that misplaced the unwind code, and another one that misplaced the else-clause of an `if` form. * test/lisp/gnus/mml-sec-tests.el (mml-secure-test-fixture): Fix a bracketing mistake that misplaced the unwind code, and remove superfluous condition-case. * lisp/mwheel.el (mouse-wheel-global-text-scale): * lisp/speedbar.el (speedbar-stealthy-updates) (speedbar-fetch-dynamic-etags): * lisp/emacs-lisp/edebug.el (edebug--recursive-edit): * lisp/emacs-lisp/package.el (package--read-pkg-desc): * lisp/cedet/semantic.el (semantic-refresh-tags-safe): * lisp/emulation/viper-cmd.el (viper-escape-to-state): * lisp/emulation/viper-cmd.el (viper-file-add-suffix): * lisp/gnus/mail-source.el (mail-source-movemail): * lisp/mail/feedmail.el (feedmail-send-it-immediately) (feedmail-deduce-address-list): * lisp/mail/mailclient.el (mailclient-send-it): * lisp/mail/smtpmail.el (smtpmail-deduce-address-list): * lisp/mh-e/mh-print.el (mh-ps-print-range): * lisp/textmodes/reftex-index.el (reftex-index-this-phrase): * test/lisp/emacs-lisp/ert-tests.el (ert-test-run-tests-batch): (ert-test-run-tests-batch-expensive): Remove unwind-protect forms that are apparently useless, some since a prior edit that removed their purpose, some since their first appearance. * test/lisp/subr-tests.el (subr-test--frames-2): Insert dummy unwind form in backtrace test code.
This commit is contained in:
parent
211618293d
commit
7c0c2b1bb5
21 changed files with 440 additions and 465 deletions
|
@ -2853,81 +2853,81 @@ See `edebug-behavior-alist' for implementations.")
|
|||
edebug-inside-windows
|
||||
)
|
||||
|
||||
(unwind-protect
|
||||
(let (
|
||||
;; Declare global values local but using the same global value.
|
||||
;; We could set these to the values for previous edebug call.
|
||||
(last-command last-command)
|
||||
(this-command this-command)
|
||||
(current-prefix-arg nil)
|
||||
|
||||
(last-input-event nil)
|
||||
(last-command-event nil)
|
||||
(last-event-frame nil)
|
||||
(last-nonmenu-event nil)
|
||||
(track-mouse nil)
|
||||
(let (
|
||||
;; Declare global values local but using the same global value.
|
||||
;; We could set these to the values for previous edebug call.
|
||||
(last-command last-command)
|
||||
(this-command this-command)
|
||||
(current-prefix-arg nil)
|
||||
|
||||
(standard-output t)
|
||||
(standard-input t)
|
||||
(last-input-event nil)
|
||||
(last-command-event nil)
|
||||
(last-event-frame nil)
|
||||
(last-nonmenu-event nil)
|
||||
(track-mouse nil)
|
||||
|
||||
;; Don't keep reading from an executing kbd macro
|
||||
;; within edebug unless edebug-continue-kbd-macro is
|
||||
;; non-nil. Again, local binding may not be best.
|
||||
(executing-kbd-macro
|
||||
(if edebug-continue-kbd-macro executing-kbd-macro))
|
||||
(standard-output t)
|
||||
(standard-input t)
|
||||
|
||||
;; Don't get confused by the user's keymap changes.
|
||||
(overriding-local-map nil)
|
||||
(overriding-terminal-local-map nil)
|
||||
;; Override other minor modes that may bind the keys
|
||||
;; edebug uses.
|
||||
(minor-mode-overriding-map-alist
|
||||
(list (cons 'edebug-mode edebug-mode-map)))
|
||||
;; Don't keep reading from an executing kbd macro
|
||||
;; within edebug unless edebug-continue-kbd-macro is
|
||||
;; non-nil. Again, local binding may not be best.
|
||||
(executing-kbd-macro
|
||||
(if edebug-continue-kbd-macro executing-kbd-macro))
|
||||
|
||||
;; Bind again to outside values.
|
||||
(debug-on-error edebug-outside-debug-on-error)
|
||||
(debug-on-quit edebug-outside-debug-on-quit)
|
||||
;; Don't get confused by the user's keymap changes.
|
||||
(overriding-local-map nil)
|
||||
(overriding-terminal-local-map nil)
|
||||
;; Override other minor modes that may bind the keys
|
||||
;; edebug uses.
|
||||
(minor-mode-overriding-map-alist
|
||||
(list (cons 'edebug-mode edebug-mode-map)))
|
||||
|
||||
;; Don't keep defining a kbd macro.
|
||||
(defining-kbd-macro
|
||||
(if edebug-continue-kbd-macro defining-kbd-macro))
|
||||
;; Bind again to outside values.
|
||||
(debug-on-error edebug-outside-debug-on-error)
|
||||
(debug-on-quit edebug-outside-debug-on-quit)
|
||||
|
||||
;; others??
|
||||
)
|
||||
;; Don't keep defining a kbd macro.
|
||||
(defining-kbd-macro
|
||||
(if edebug-continue-kbd-macro defining-kbd-macro))
|
||||
|
||||
(if (and (eq edebug-execution-mode 'go)
|
||||
(not (memq arg-mode '(after error))))
|
||||
(message "Break"))
|
||||
;; others??
|
||||
)
|
||||
|
||||
(setq signal-hook-function nil)
|
||||
(if (and (eq edebug-execution-mode 'go)
|
||||
(not (memq arg-mode '(after error))))
|
||||
(message "Break"))
|
||||
|
||||
(edebug-mode 1)
|
||||
(unwind-protect
|
||||
(recursive-edit) ; <<<<<<<<<< Recursive edit
|
||||
(setq signal-hook-function nil)
|
||||
|
||||
;; Do the following, even if quit occurs.
|
||||
(setq signal-hook-function #'edebug-signal)
|
||||
(if edebug-backtrace-buffer
|
||||
(kill-buffer edebug-backtrace-buffer))
|
||||
(edebug-mode 1)
|
||||
(unwind-protect
|
||||
(recursive-edit) ; <<<<<<<<<< Recursive edit
|
||||
|
||||
;; Remember selected-window after recursive-edit.
|
||||
;; (setq edebug-inside-window (selected-window))
|
||||
;; Do the following, even if quit occurs.
|
||||
(setq signal-hook-function #'edebug-signal)
|
||||
(if edebug-backtrace-buffer
|
||||
(kill-buffer edebug-backtrace-buffer))
|
||||
|
||||
(set-match-data edebug-outside-match-data)
|
||||
;; Remember selected-window after recursive-edit.
|
||||
;; (setq edebug-inside-window (selected-window))
|
||||
|
||||
;; Recursive edit may have changed buffers,
|
||||
;; so set it back before exiting let.
|
||||
(if (buffer-name edebug-buffer) ; if it still exists
|
||||
(progn
|
||||
(set-buffer edebug-buffer)
|
||||
(when (memq edebug-execution-mode '(go Go-nonstop))
|
||||
(edebug-overlay-arrow)
|
||||
(sit-for 0))
|
||||
(edebug-mode -1))
|
||||
;; gotta have a buffer to let its buffer local variables be set
|
||||
(get-buffer-create " bogus edebug buffer"))
|
||||
));; inner let
|
||||
)))
|
||||
(set-match-data edebug-outside-match-data)
|
||||
|
||||
;; Recursive edit may have changed buffers,
|
||||
;; so set it back before exiting let.
|
||||
(if (buffer-name edebug-buffer) ; if it still exists
|
||||
(progn
|
||||
(set-buffer edebug-buffer)
|
||||
(when (memq edebug-execution-mode '(go Go-nonstop))
|
||||
(edebug-overlay-arrow)
|
||||
(sit-for 0))
|
||||
(edebug-mode -1))
|
||||
;; gotta have a buffer to let its buffer local variables be set
|
||||
(get-buffer-create " bogus edebug buffer"))
|
||||
));; inner let
|
||||
))
|
||||
|
||||
|
||||
;;; Display related functions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue