changeset 110439:c1e130042fa1

* lisp/mail/sendmail.el: Fix commenting convention. (sendmail-send-it): Use line-beginning-position.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 20 Sep 2010 13:20:38 +0200
parents 19f465048335
children e71c4e4a16d7
files lisp/ChangeLog lisp/mail/sendmail.el
diffstat 2 files changed, 66 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Sep 20 13:13:52 2010 +0200
+++ b/lisp/ChangeLog	Mon Sep 20 13:20:38 2010 +0200
@@ -1,5 +1,8 @@
 2010-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* mail/sendmail.el: Fix commenting convention.
+	(sendmail-send-it): Use line-beginning-position.
+
 	* help-fns.el (describe-variable): Add original value, if applicable.
 
 2010-09-20  Juanma Barranquero  <lekktu@gmail.com>
--- a/lisp/mail/sendmail.el	Mon Sep 20 13:13:52 2010 +0200
+++ b/lisp/mail/sendmail.el	Mon Sep 20 13:20:38 2010 +0200
@@ -1096,23 +1096,23 @@
 	      ;; Delete Resent-BCC ourselves
 	      (if (save-excursion (beginning-of-line)
 				  (looking-at "resent-bcc"))
-		  (delete-region (save-excursion (beginning-of-line) (point))
-				 (save-excursion (end-of-line) (1+ (point))))))
-;;;  Apparently this causes a duplicate Sender.
-;;; 	    ;; If the From is different than current user, insert Sender.
-;;; 	    (goto-char (point-min))
-;;; 	    (and (re-search-forward "^From:"  delimline t)
-;;; 		 (progn
-;;; 		   (require 'mail-utils)
-;;; 		   (not (string-equal
-;;; 			 (mail-strip-quoted-names
-;;; 			  (save-restriction
-;;; 			    (narrow-to-region (point-min) delimline)
-;;; 			    (mail-fetch-field "From")))
-;;; 			 (user-login-name))))
-;;; 		 (progn
-;;; 		   (forward-line 1)
-;;; 		   (insert "Sender: " (user-login-name) "\n")))
+		  (delete-region (line-beginning-position)
+				 (line-beginning-position 2))))
+            ;; Apparently this causes a duplicate Sender.
+	    ;; ;; If the From is different than current user, insert Sender.
+	    ;; (goto-char (point-min))
+	    ;; (and (re-search-forward "^From:"  delimline t)
+	    ;;      (progn
+	    ;;        (require 'mail-utils)
+	    ;;        (not (string-equal
+	    ;;     	 (mail-strip-quoted-names
+	    ;;     	  (save-restriction
+	    ;;     	    (narrow-to-region (point-min) delimline)
+	    ;;     	    (mail-fetch-field "From")))
+	    ;;     	 (user-login-name))))
+	    ;;      (progn
+	    ;;        (forward-line 1)
+	    ;;        (insert "Sender: " (user-login-name) "\n")))
 	    ;; Don't send out a blank subject line
 	    (goto-char (point-min))
 	    (if (re-search-forward "^Subject:\\([ \t]*\n\\)+\\b" delimline t)
@@ -1179,9 +1179,9 @@
 				    nil errbuf nil "-oi")
 			      (and envelope-from
 				   (list "-f" envelope-from))
-;;; 			      ;; Don't say "from root" if running under su.
-;;; 			      (and (equal (user-real-login-name) "root")
-;;; 				   (list "-f" (user-login-name)))
+			      ;; ;; Don't say "from root" if running under su.
+			      ;; (and (equal (user-real-login-name) "root")
+			      ;;      (list "-f" (user-login-name)))
 			      (and mail-alias-file
 				   (list (concat "-oA" mail-alias-file)))
 			      (if mail-interactive
@@ -1714,48 +1714,48 @@
  when the message is sent, we apply FUNCTION to ARGS.
  This is how Rmail arranges to mark messages `answered'."
   (interactive "P")
-;;;  This is commented out because I found it was confusing in practice.
-;;;  It is easy enough to rename *mail* by hand with rename-buffer
-;;;  if you want to have multiple mail buffers.
-;;;  And then you can control which messages to save. --rms.
-;;;  (let ((index 1)
-;;;	buffer)
-;;;    ;; If requested, look for a mail buffer that is modified and go to it.
-;;;    (if noerase
-;;;	(progn
-;;;	  (while (and (setq buffer
-;;;			    (get-buffer (if (= 1 index) "*mail*"
-;;;					  (format "*mail*<%d>" index))))
-;;;		      (not (buffer-modified-p buffer)))
-;;;	    (setq index (1+ index)))
-;;;	  (if buffer (switch-to-buffer buffer)
-;;;	    ;; If none exists, start a new message.
-;;;	    ;; This will never re-use an existing unmodified mail buffer
-;;;	    ;; (since index is not 1 anymore).  Perhaps it should.
-;;;	    (setq noerase nil))))
-;;;    ;; Unless we found a modified message and are happy, start a new message.
-;;;    (if (not noerase)
-;;;	(progn
-;;;	  ;; Look for existing unmodified mail buffer.
-;;;	  (while (and (setq buffer
-;;;			    (get-buffer (if (= 1 index) "*mail*"
-;;;					  (format "*mail*<%d>" index))))
-;;;		      (buffer-modified-p buffer))
-;;;	    (setq index (1+ index)))
-;;;	  ;; If none, make a new one.
-;;;	  (or buffer
-;;;	      (setq buffer (generate-new-buffer "*mail*")))
-;;;	  ;; Go there and initialize it.
-;;;	  (switch-to-buffer buffer)
-;;;	  (erase-buffer)
-;;;          (setq default-directory (expand-file-name "~/"))
-;;;          (auto-save-mode auto-save-default)
-;;;          (mail-mode)
-;;;          (mail-setup to subject in-reply-to cc replybuffer actions)
-;;;	  (if (and buffer-auto-save-file-name
-;;;		   (file-exists-p buffer-auto-save-file-name))
-;;;	      (message "Auto save file for draft message exists; consider M-x mail-recover"))
-;;;          t))
+ ;; This is commented out because I found it was confusing in practice.
+ ;; It is easy enough to rename *mail* by hand with rename-buffer
+ ;; if you want to have multiple mail buffers.
+ ;; And then you can control which messages to save. --rms.
+ ;; (let ((index 1)
+ ;;        buffer)
+ ;;   ;; If requested, look for a mail buffer that is modified and go to it.
+ ;;   (if noerase
+ ;;        (progn
+ ;;          (while (and (setq buffer
+ ;;        		    (get-buffer (if (= 1 index) "*mail*"
+ ;;        				  (format "*mail*<%d>" index))))
+ ;;        	      (not (buffer-modified-p buffer)))
+ ;;            (setq index (1+ index)))
+ ;;          (if buffer (switch-to-buffer buffer)
+ ;;            ;; If none exists, start a new message.
+ ;;            ;; This will never re-use an existing unmodified mail buffer
+ ;;            ;; (since index is not 1 anymore).  Perhaps it should.
+ ;;            (setq noerase nil))))
+ ;;   ;; Unless we found a modified message and are happy, start a new message.
+ ;;   (if (not noerase)
+ ;;        (progn
+ ;;          ;; Look for existing unmodified mail buffer.
+ ;;          (while (and (setq buffer
+ ;;        		    (get-buffer (if (= 1 index) "*mail*"
+ ;;        				  (format "*mail*<%d>" index))))
+ ;;        	      (buffer-modified-p buffer))
+ ;;            (setq index (1+ index)))
+ ;;          ;; If none, make a new one.
+ ;;          (or buffer
+ ;;              (setq buffer (generate-new-buffer "*mail*")))
+ ;;          ;; Go there and initialize it.
+ ;;          (switch-to-buffer buffer)
+ ;;          (erase-buffer)
+ ;;         (setq default-directory (expand-file-name "~/"))
+ ;;         (auto-save-mode auto-save-default)
+ ;;         (mail-mode)
+ ;;         (mail-setup to subject in-reply-to cc replybuffer actions)
+ ;;          (if (and buffer-auto-save-file-name
+ ;;        	   (file-exists-p buffer-auto-save-file-name))
+ ;;              (message "Auto save file for draft message exists; consider M-x mail-recover"))
+ ;;         t))
 
   (if (eq noerase 'new)
       (pop-to-buffer (generate-new-buffer "*mail*"))
@@ -1776,7 +1776,7 @@
   (mail-mode)
   ;; Disconnect the buffer from its visited file
   ;; (in case the user has actually visited a file *mail*).
-;;;  (set-visited-file-name nil)
+  ;; (set-visited-file-name nil)
   (let (initialized)
     (and (not (and noerase
 		   (not (eq noerase 'new))))