~vm/vm/vmpc-prompt

« back to all changes in this revision

Viewing changes to lisp/vm-mime.el

  • Committer: Uday S Reddy
  • Date: 2011-10-14 23:47:30 UTC
  • Revision ID: u.s.reddy@cs.bham.ac.uk-20111014234730-6kemb1ikwwpwihrr
Ensure that postponed messages have all mime objects marked with attachment disposition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6833
6833
        (goto-char end)))))
6834
6834
 
6835
6835
;;;###autoload
6836
 
(defun vm-mime-encode-composition ()
 
6836
(defun vm-mime-encode-composition (&optional attachments-only)
6837
6837
 "MIME encode the current mail composition buffer.
6838
6838
 
6839
6839
This function chooses the MIME character set(s) to use, and transforms the
6872
6872
        (mybuffer (current-buffer)))
6873
6873
    (unwind-protect
6874
6874
        (progn
6875
 
          (vm-mime-encode-composition-internal)
 
6875
          (vm-mime-encode-composition-internal attachments-only)
6876
6876
          (setq unwind-needed nil))
6877
6877
      (and unwind-needed (consp buffer-undo-list)
6878
6878
           (eq mybuffer (current-buffer))
6883
6883
;; This function was originally XEmacs-specific.  It has now been
6884
6884
;; generalized to both XEmacs and GNU Emacs.  USR, 2011-03-27
6885
6885
 
6886
 
(defun vm-mime-encode-composition-internal ()
 
6886
(defun vm-mime-encode-composition-internal (&optional attachments-only)
6887
6887
  "MIME encode the message composition in the current buffer."
6888
6888
  (save-restriction
6889
6889
    (widen)
6975
6975
                        (car (vm-extent-property e 'vm-mime-forward-local-refs))
6976
6976
                    description (vm-extent-property e 'vm-mime-description)
6977
6977
                    disposition
6978
 
                    (if (not (equal
6979
 
                              (car (vm-extent-property e 'vm-mime-disposition))
6980
 
                              "unspecified"))
6981
 
                        (vm-extent-property e 'vm-mime-disposition)
6982
 
                      (vm-mm-layout-qdisposition layout)))
 
6978
                    (if (equal
 
6979
                         (car (vm-extent-property e 'vm-mime-disposition))
 
6980
                         "unspecified")
 
6981
                        (vm-mm-layout-qdisposition layout)
 
6982
                      (vm-extent-property e 'vm-mime-disposition)))
6983
6983
            (setq type (vm-extent-property e 'vm-mime-type)
6984
6984
                  params (vm-extent-property e 'vm-mime-parameters)
6985
6985
                  forward-local-refs
6986
6986
                      (car (vm-extent-property e 'vm-mime-forward-local-refs))
6987
6987
                  description (vm-extent-property e 'vm-mime-description)
6988
6988
                  disposition
6989
 
                  (if (not (equal
6990
 
                            (car (vm-extent-property e 'vm-mime-disposition))
6991
 
                            "unspecified"))
6992
 
                      (vm-extent-property e 'vm-mime-disposition)
6993
 
                    nil)))
 
6989
                  (if (equal
 
6990
                       (car (vm-extent-property e 'vm-mime-disposition))
 
6991
                       "unspecified")
 
6992
                      (if attachments-only '("attachment") nil)
 
6993
                    (if attachments-only
 
6994
                        (cons "attachment"
 
6995
                              (cdr (vm-extent-property e 'vm-mime-disposition)))
 
6996
                      (vm-extent-property e 'vm-mime-disposition)))))
6994
6997
          ;; 1e. Encode the object if necessary
6995
6998
          (cond ((vm-mime-types-match "text" type)
6996
6999
                 (setq encoding