Synch to No Gnus 200506270911.
[elisp/gnus.git-] / lisp / gnus-util.el
index 6d2f830..c5bd20a 100644 (file)
@@ -1034,10 +1034,11 @@ ARG is passed to the first function."
     (apply 'run-hooks funcs)))
 
 (defun gnus-run-mode-hooks (&rest funcs)
-  "Run `run-mode-hooks' if it is available.  Otherwise run `run-hooks'."
+  "Run `run-mode-hooks' if it is available, otherwise `run-hooks'.
+This function saves the current buffer."
   (if (fboundp 'run-mode-hooks)
-      (apply 'run-mode-hooks funcs)
-    (apply 'run-hooks funcs)))
+      (save-current-buffer (apply 'run-mode-hooks funcs))
+    (save-current-buffer (apply 'run-hooks funcs))))
 
 ;;; Various
 
@@ -1595,6 +1596,12 @@ empty directories from OLD-PATH."
   (ignore-errors
     (set-file-modes filename mode)))
 
+(if (fboundp 'set-process-query-on-exit-flag)
+    (defalias 'gnus-set-process-query-on-exit-flag
+      'set-process-query-on-exit-flag)
+  (defalias 'gnus-set-process-query-on-exit-flag
+    'process-kill-without-query))
+
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here