Function: message-clone-locals

message-clone-locals is a byte-compiled function defined in message.el.gz.

Signature

(message-clone-locals BUFFER &optional VARSTR)

Documentation

Clone the local variables from BUFFER to the current buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/message.el.gz
(defun message-clone-locals (buffer &optional varstr)
  "Clone the local variables from BUFFER to the current buffer."
  (let ((locals (with-current-buffer buffer (buffer-local-variables)))
	(regexp "^gnus\\|^nn\\|^message\\|^sendmail\\|^smtp\\|^user-mail-address"))
    (mapcar
     (lambda (local)
       (when (and (consp local)
		  (car local)
		  (string-match regexp (symbol-name (car local)))
		  (or (null varstr)
		      (string-match varstr (symbol-name (car local)))))
	 (ignore-errors
	   ;; Cloning message-default-charset could cause an already
	   ;; encoded text to be encoded again, yielding raw bytes
	   ;; instead of characters in the message.
	   (unless (eq 'message-default-charset (car local))
	     (set (make-local-variable (car local))
		  (cdr local))))))
     locals)))