aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/gnus
diff options
context:
space:
mode:
authorMattias EngdegÄrd2023-04-07 16:29:32 +0200
committerMattias EngdegÄrd2023-04-07 19:08:33 +0200
commit7c0c2b1bb539424af1bb72bd9caefedd66cfd3da (patch)
treed17e18d4bf8407c818985e29f22c5bb8b3d1717a /test/lisp/gnus
parent211618293d9fd620f9f8971090e049d98c05f546 (diff)
downloademacs-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 'test/lisp/gnus')
-rw-r--r--test/lisp/gnus/mml-sec-tests.el51
1 files changed, 23 insertions, 28 deletions
diff --git a/test/lisp/gnus/mml-sec-tests.el b/test/lisp/gnus/mml-sec-tests.el
index 37e84c148af..a5dadf21c8c 100644
--- a/test/lisp/gnus/mml-sec-tests.el
+++ b/test/lisp/gnus/mml-sec-tests.el
@@ -66,34 +66,29 @@ This fixture temporarily unsets GPG_AGENT_INFO to enable passphrase tests,
66which will neither work with gpgsm nor GnuPG 2.1 any longer, I guess. 66which will neither work with gpgsm nor GnuPG 2.1 any longer, I guess.
67Actually, I'm not sure why people would want to cache passwords in Emacs 67Actually, I'm not sure why people would want to cache passwords in Emacs
68instead of gpg-agent." 68instead of gpg-agent."
69 (unwind-protect 69 (let ((agent-info (getenv "GPG_AGENT_INFO"))
70 (let ((agent-info (getenv "GPG_AGENT_INFO")) 70 (gpghome (getenv "GNUPGHOME")))
71 (gpghome (getenv "GNUPGHOME"))) 71 (unwind-protect
72 (condition-case error 72 (let ((epg-gpg-home-directory (ert-resource-directory))
73 (let ((epg-gpg-home-directory (ert-resource-directory)) 73 (mml-smime-use 'epg)
74 (mml-smime-use 'epg) 74 ;; Create debug output in empty epg-debug-buffer.
75 ;; Create debug output in empty epg-debug-buffer. 75 (epg-debug t)
76 (epg-debug t) 76 (epg-debug-buffer (get-buffer-create " *epg-test*"))
77 (epg-debug-buffer (get-buffer-create " *epg-test*")) 77 (mml-secure-fail-when-key-problem (not interactive)))
78 (mml-secure-fail-when-key-problem (not interactive))) 78 (with-current-buffer epg-debug-buffer
79 (with-current-buffer epg-debug-buffer 79 (erase-buffer))
80 (erase-buffer)) 80 ;; Unset GPG_AGENT_INFO to enable passphrase caching inside Emacs.
81 ;; Unset GPG_AGENT_INFO to enable passphrase caching inside Emacs. 81 ;; Just for testing. Jens does not recommend this for daily use.
82 ;; Just for testing. Jens does not recommend this for daily use. 82 (setenv "GPG_AGENT_INFO")
83 (setenv "GPG_AGENT_INFO") 83 ;; Set GNUPGHOME as gpg-agent started by gpgsm does
84 ;; Set GNUPGHOME as gpg-agent started by gpgsm does 84 ;; not look in the proper places otherwise, see:
85 ;; not look in the proper places otherwise, see: 85 ;; https://bugs.gnupg.org/gnupg/issue2126
86 ;; https://bugs.gnupg.org/gnupg/issue2126 86 (setenv "GNUPGHOME" epg-gpg-home-directory)
87 (setenv "GNUPGHOME" epg-gpg-home-directory) 87 (unwind-protect
88 (unwind-protect 88 (funcall body)
89 (funcall body) 89 (mml-sec-test--kill-gpg-agent)))
90 (mml-sec-test--kill-gpg-agent))) 90 (setenv "GPG_AGENT_INFO" agent-info)
91 (error 91 (setenv "GNUPGHOME" gpghome))))
92 (setenv "GPG_AGENT_INFO" agent-info)
93 (setenv "GNUPGHOME" gpghome)
94 (signal (car error) (cdr error))))
95 (setenv "GPG_AGENT_INFO" agent-info)
96 (setenv "GNUPGHOME" gpghome))))
97 92
98(defun mml-secure-test-message-setup (method to from &optional text bcc) 93(defun mml-secure-test-message-setup (method to from &optional text bcc)
99 "Setup a buffer with MML METHOD, TO, and FROM headers. 94 "Setup a buffer with MML METHOD, TO, and FROM headers.