diff lisp/gnus/mm-util.el @ 62943:11d53dd5abd9

Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-345 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 77-78) - Update from CVS 2005-05-31 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/gnus-art.el (article-display-x-face): Replace process-kill-without-query by gnus-set-process-query-on-exit-flag. * lisp/gnus/gnus-group.el: Bind gnus-cache-active-hashtb when compiling. * lisp/gnus/gnus-util.el (gnus-set-process-query-on-exit-flag): Alias to set-process-query-on-exit-flag or process-kill-without-query. * lisp/gnus/html2text.el (html2text-fix-paragraphs): Use `while - re-search' loop instead of replace-regexp. * lisp/gnus/imap.el (imap-ssl-open): Use set-process-query-on-exit-flag instead of process-kill-without-query if it is available. * lisp/gnus/mm-util.el (mm-insert-file-contents): Bind find-file-hook instead of find-file-hooks if it is available. * lisp/gnus/mml1991.el: Bind pgg-default-user-id when compiling. * lisp/gnus/mml2015.el: Bind pgg-default-user-id when compiling. * lisp/gnus/nndraft.el (nndraft-request-associate-buffer): Use write-contents-functions instead of write-contents-hooks if it is available. * lisp/gnus/nnheader.el (nnheader-find-file-noselect): Bind find-file-hook instead of find-file-hooks if it is available. * lisp/gnus/nntp.el (nntp-open-connection): Replace process-kill-without-query by gnus-set-process-query-on-exit-flag. (nntp-open-ssl-stream): Ditto. (nntp-open-tls-stream): Ditto. * lisp/gnus/pgg.el: Don't bind itimer vars; don't autoload itimer functions. (pgg-run-at-time-1): New macro. (pgg-run-at-time): Use it. * lisp/gnus/starttls.el (starttls-set-process-query-on-exit-flag): Alias to set-process-query-on-exit-flag or process-kill-without-query. (starttls-open-stream-gnutls): Use it instead of process-kill-without-query. (starttls-open-stream): Ditto. 2005-05-31 Simon Josefsson <jas@extundo.com> * lisp/gnus/imap.el (imap-ssl-open): Use imap-process-connection-type, instead of hard coding to nil. 2005-05-31 Kevin Greiner <kgreiner@xpediantsolutions.com> * lisp/gnus/gnus-group.el (): Require gnus-sum and autoload functions to resolve warnings when gnus-group.el compiled alone.
author Miles Bader <miles@gnu.org>
date Wed, 01 Jun 2005 05:07:06 +0000
parents 6cf26dc690b2
children 18a818a2ee7c 01137c1fdbe9
line wrap: on
line diff
--- a/lisp/gnus/mm-util.el	Tue May 31 23:10:14 2005 +0000
+++ b/lisp/gnus/mm-util.el	Wed Jun 01 05:07:06 2005 +0000
@@ -889,22 +889,28 @@
 `find-file-hooks', etc.
 If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'.
   This function ensures that none of these modifications will take place."
-  (let ((format-alist nil)
-	(auto-mode-alist (if inhibit nil (mm-auto-mode-alist)))
-	(default-major-mode 'fundamental-mode)
-	(enable-local-variables nil)
-	(after-insert-file-functions nil)
-	(enable-local-eval nil)
-	(find-file-hooks nil)
-	(inhibit-file-name-operation (if inhibit
-					 'insert-file-contents
-				       inhibit-file-name-operation))
-	(inhibit-file-name-handlers
-	 (if inhibit
-	     (append mm-inhibit-file-name-handlers
-		     inhibit-file-name-handlers)
-	   inhibit-file-name-handlers)))
-    (insert-file-contents filename visit beg end replace)))
+  (let* ((format-alist nil)
+	 (auto-mode-alist (if inhibit nil (mm-auto-mode-alist)))
+	 (default-major-mode 'fundamental-mode)
+	 (enable-local-variables nil)
+	 (after-insert-file-functions nil)
+	 (enable-local-eval nil)
+	 (inhibit-file-name-operation (if inhibit
+					  'insert-file-contents
+					inhibit-file-name-operation))
+	 (inhibit-file-name-handlers
+	  (if inhibit
+	      (append mm-inhibit-file-name-handlers
+		      inhibit-file-name-handlers)
+	    inhibit-file-name-handlers))
+	 (ffh (if (boundp 'find-file-hook)
+		  'find-file-hook
+		'find-file-hooks))
+	 (val (symbol-value ffh)))
+    (set ffh nil)
+    (unwind-protect
+	(insert-file-contents filename visit beg end replace)
+      (set ffh val))))
 
 (defun mm-append-to-file (start end filename &optional codesys inhibit)
   "Append the contents of the region to the end of file FILENAME.