comparison lisp/gnus/message.el @ 169:15872534500d r20-3b11

Import from CVS: tag r20-3b11
author cvs
date Mon, 13 Aug 2007 09:46:53 +0200
parents 85ec50267440
children 8eaf7971accc
comparison
equal deleted inserted replaced
168:9851d5c6556e 169:15872534500d
1940 ;; gets full control (no gestapo'ish -f's, for instance). --sj 1940 ;; gets full control (no gestapo'ish -f's, for instance). --sj
1941 message-qmail-inject-args) 1941 message-qmail-inject-args)
1942 ;; qmail-inject doesn't say anything on it's stdout/stderr, 1942 ;; qmail-inject doesn't say anything on it's stdout/stderr,
1943 ;; we have to look at the retval instead 1943 ;; we have to look at the retval instead
1944 (0 nil) 1944 (0 nil)
1945 (1 (error "qmail-inject reported permanent failure.")) 1945 (1 (error "qmail-inject reported permanent failure"))
1946 (111 (error "qmail-inject reported transient failure.")) 1946 (111 (error "qmail-inject reported transient failure"))
1947 ;; should never happen 1947 ;; should never happen
1948 (t (error "qmail-inject reported unknown failure.")))) 1948 (t (error "qmail-inject reported unknown failure"))))
1949 1949
1950 (defun message-send-mail-with-mh () 1950 (defun message-send-mail-with-mh ()
1951 "Send the prepared message buffer with mh." 1951 "Send the prepared message buffer with mh."
1952 (let ((mh-previous-window-config nil) 1952 (let ((mh-previous-window-config nil)
1953 (name (make-temp-name 1953 (name (make-temp-name
2021 (run-hooks 'message-send-news-hook) 2021 (run-hooks 'message-send-news-hook)
2022 (require (car method)) 2022 (require (car method))
2023 (funcall (intern (format "%s-open-server" (car method))) 2023 (funcall (intern (format "%s-open-server" (car method)))
2024 (cadr method) (cddr method)) 2024 (cadr method) (cddr method))
2025 (setq result 2025 (setq result
2026 (funcall (intern (format "%s-request-post" (car method)))))) 2026 (funcall (intern (format "%s-request-post" (car method)))
2027 (cadr method))))
2027 (kill-buffer tembuf)) 2028 (kill-buffer tembuf))
2028 (set-buffer messbuf) 2029 (set-buffer messbuf)
2029 (if result 2030 (if result
2030 (push 'news message-sent-message-via) 2031 (push 'news message-sent-message-via)
2031 (message "Couldn't send message via news: %s" 2032 (message "Couldn't send message via news: %s"
3639 (defun message-generate-new-buffer-clone-locals (name &optional varstr) 3640 (defun message-generate-new-buffer-clone-locals (name &optional varstr)
3640 "Create and return a buffer with a name based on NAME using generate-new-buffer. 3641 "Create and return a buffer with a name based on NAME using generate-new-buffer.
3641 Then clone the local variables and values from the old buffer to the 3642 Then clone the local variables and values from the old buffer to the
3642 new one, cloning only the locals having a substring matching the 3643 new one, cloning only the locals having a substring matching the
3643 regexp varstr." 3644 regexp varstr."
3644 (let ((oldlocals (buffer-local-variables))) 3645 (let ((oldbuf (current-buffer)))
3645 (save-excursion 3646 (save-excursion
3646 (set-buffer (generate-new-buffer name)) 3647 (set-buffer (generate-new-buffer name))
3647 (mapcar (lambda (dude) 3648 (message-clone-locals oldbuf)
3648 (when (and (car dude)
3649 (or (not varstr)
3650 (string-match varstr (symbol-name (car dude)))))
3651 (ignore-errors
3652 (set (make-local-variable (car dude))
3653 (cdr dude)))))
3654 oldlocals)
3655 (current-buffer)))) 3649 (current-buffer))))
3656 3650
3651 (defun message-clone-locals (buffer)
3652 "Clone the local variables from BUFFER to the current buffer."
3653 (let ((locals (save-excursion
3654 (set-buffer buffer)
3655 (buffer-local-variables)))
3656 (regexp "^gnus\\|^nn\\|^message"))
3657 (mapcar
3658 (lambda (local)
3659 (when (and (car local)
3660 (string-match regexp (symbol-name (car local))))
3661 (ignore-errors
3662 (set (make-local-variable (car local))
3663 (cdr local)))))
3664 locals)))
3665
3657 (run-hooks 'message-load-hook) 3666 (run-hooks 'message-load-hook)
3658 3667
3659 (provide 'message) 3668 (provide 'message)
3660 3669
3661 ;;; message.el ends here 3670 ;;; message.el ends here