diff options
| author | Mattias EngdegÄrd | 2023-04-07 16:29:32 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2023-04-07 19:08:33 +0200 |
| commit | 7c0c2b1bb539424af1bb72bd9caefedd66cfd3da (patch) | |
| tree | d17e18d4bf8407c818985e29f22c5bb8b3d1717a /lisp/emulation | |
| parent | 211618293d9fd620f9f8971090e049d98c05f546 (diff) | |
| download | emacs-7c0c2b1bb539424af1bb72bd9caefedd66cfd3da.tar.gz emacs-7c0c2b1bb539424af1bb72bd9caefedd66cfd3da.zip | |
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.
Diffstat (limited to 'lisp/emulation')
| -rw-r--r-- | lisp/emulation/viper-cmd.el | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 2a37c383f81..c0aa9dd7b46 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -722,16 +722,12 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to | |||
| 722 | (let (viper-vi-kbd-minor-mode | 722 | (let (viper-vi-kbd-minor-mode |
| 723 | viper-insert-kbd-minor-mode | 723 | viper-insert-kbd-minor-mode |
| 724 | viper-emacs-kbd-minor-mode) | 724 | viper-emacs-kbd-minor-mode) |
| 725 | (unwind-protect | 725 | (setq com (key-binding (setq key (read-key-sequence nil)))) |
| 726 | (progn | 726 | ;; In case of binding indirection--chase definitions. |
| 727 | (setq com | 727 | ;; Have to do it here because we execute this command under |
| 728 | (key-binding (setq key (read-key-sequence nil)))) | 728 | ;; different keymaps, so command-execute may not do the |
| 729 | ;; In case of binding indirection--chase definitions. | 729 | ;; right thing there |
| 730 | ;; Have to do it here because we execute this command under | 730 | (while (vectorp com) (setq com (key-binding com))) |
| 731 | ;; different keymaps, so command-execute may not do the | ||
| 732 | ;; right thing there | ||
| 733 | (while (vectorp com) (setq com (key-binding com)))) | ||
| 734 | nil) | ||
| 735 | ;; Execute command com in the original Viper state, not in state | 731 | ;; Execute command com in the original Viper state, not in state |
| 736 | ;; `state'. Otherwise, if we switch buffers while executing the | 732 | ;; `state'. Otherwise, if we switch buffers while executing the |
| 737 | ;; escaped to command, Viper's mode vars will remain those of | 733 | ;; escaped to command, Viper's mode vars will remain those of |
| @@ -1950,16 +1946,16 @@ To turn this feature off, set this variable to nil." | |||
| 1950 | (if found | 1946 | (if found |
| 1951 | () | 1947 | () |
| 1952 | (viper-tmp-insert-at-eob " [Please complete file name]") | 1948 | (viper-tmp-insert-at-eob " [Please complete file name]") |
| 1953 | (unwind-protect | 1949 | |
| 1954 | (while (not (memq cmd | 1950 | (while (not (memq cmd |
| 1955 | '(exit-minibuffer viper-exit-minibuffer))) | 1951 | '(exit-minibuffer viper-exit-minibuffer))) |
| 1956 | (setq cmd | 1952 | (setq cmd |
| 1957 | (key-binding (setq key (read-key-sequence nil)))) | 1953 | (key-binding (setq key (read-key-sequence nil)))) |
| 1958 | (cond ((eq cmd 'self-insert-command) | 1954 | (cond ((eq cmd 'self-insert-command) |
| 1959 | (insert key)) | 1955 | (insert key)) |
| 1960 | ((memq cmd '(exit-minibuffer viper-exit-minibuffer)) | 1956 | ((memq cmd '(exit-minibuffer viper-exit-minibuffer)) |
| 1961 | nil) | 1957 | nil) |
| 1962 | (t (command-execute cmd)))))))))) | 1958 | (t (command-execute cmd))))))))) |
| 1963 | 1959 | ||
| 1964 | 1960 | ||
| 1965 | (defun viper-minibuffer-trim-tail () | 1961 | (defun viper-minibuffer-trim-tail () |