~ubuntu-branches/ubuntu/wily/semi/wily

« back to all changes in this revision

Viewing changes to mime-edit.el

  • Committer: Bazaar Package Importer
  • Author(s): Tatsuya Kinoshita
  • Date: 2006-12-02 22:17:07 UTC
  • mfrom: (1.2.1 upstream) (3.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20061202221707-zc72qytibw6mmc0v
Tags: 1.14.6+0.20061202-1
* New upstream release. (CVS semi-1_14 branch on 2006-12-02)
* debian/copyright: Reformat copyright years.
* debian/copyright: Mention Debian packaging conditions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
;; You should have received a copy of the GNU General Public License
26
26
;; along with GNU Emacs; see the file COPYING.  If not, write to the
27
 
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28
 
;; Boston, MA 02111-1307, USA.
 
27
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
28
;; Boston, MA 02110-1301, USA.
29
29
 
30
30
;;; Commentary:
31
31
 
1733
1733
                    )
1734
1734
                (delete-region beg end)
1735
1735
                (or (looking-at mime-edit-beginning-tag-regexp)
 
1736
                    (looking-at mime-edit-multipart-end-regexp)
1736
1737
                    (eobp)
1737
1738
                    (insert (concat (mime-make-text-tag) "\n"))
1738
1739
                    )))
1792
1793
 
1793
1794
(defvar mime-edit-pgp-user-id nil)
1794
1795
 
 
1796
(defun mime-edit-delete-trailing-whitespace ()
 
1797
  (save-match-data
 
1798
    (save-excursion
 
1799
      (goto-char (point-min))
 
1800
      (while (re-search-forward "[ \t]+$" nil t)
 
1801
        (delete-region (match-beginning 0) (match-end 0))))))
 
1802
 
1795
1803
(defun mime-edit-sign-pgp-mime (beg end boundary)
1796
1804
  (save-excursion
1797
1805
    (save-restriction
1803
1811
             (encoding (nth 1 ret))
1804
1812
             (pgp-boundary (concat "pgp-sign-" boundary))
1805
1813
             micalg)
 
1814
        (mime-edit-delete-trailing-whitespace) ; RFC3156
1806
1815
        (goto-char beg)
1807
1816
        (insert (format "Content-Type: %s\n" ctype))
1808
1817
        (if encoding
1813
1822
                   (or mime-edit-pgp-user-id
1814
1823
                       (if from 
1815
1824
                           (nth 1 (std11-extract-address-components from))
1816
 
                         pgg-default-user-id))))
 
1825
                         pgg-default-user-id)))
 
1826
                  (pgg-text-mode t))
1817
1827
              (pgg-sign-region (point-min)(point-max)))
1818
1828
            (throw 'mime-edit-error 'pgp-error)
1819
1829
            )
1904
1914
                     (or mime-edit-pgp-user-id
1905
1915
                         (if from 
1906
1916
                             (nth 1 (std11-extract-address-components from))
1907
 
                           pgg-default-user-id))))                   
 
1917
                           pgg-default-user-id)))
 
1918
                    (pgg-text-mode t))
1908
1919
                (pgg-encrypt-region 
1909
1920
                 (point-min) (point-max) 
1910
1921
                 (mapcar (lambda (recipient)
2631
2642
            (or (cdr (assq major-mode mime-edit-message-max-lines-alist))
2632
2643
                mime-edit-message-default-max-lines))
2633
2644
      )
2634
 
  (let* ((separator mail-header-separator)
2635
 
         (id (concat "\""
2636
 
                     (replace-space-with-underline (current-time-string))
2637
 
                     "@" (system-name) "\"")))
 
2645
  (let ((separator mail-header-separator)
 
2646
        (id (concat "\""
 
2647
                    (replace-space-with-underline (current-time-string))
 
2648
                    "@" (system-name) "\"")))
2638
2649
    (run-hooks 'mime-edit-before-split-hook)
2639
2650
    (let ((the-buf (current-buffer))
2640
2651
          (copy-buf (get-buffer-create " *Original Message*"))
2733
2744
;;;
2734
2745
 
2735
2746
(defvar mime-edit-buffer nil) ; buffer local variable
 
2747
(defvar mime-edit-temp-message-buffer nil) ; buffer local variable
2736
2748
 
2737
2749
(defun mime-edit-preview-message ()
2738
2750
  "preview editing MIME message."