all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* url-mailto insert 'body' in the wrong place
@ 2007-05-28 18:27 Leo
  2007-05-28 18:32 ` David Kastrup
  0 siblings, 1 reply; 7+ messages in thread
From: Leo @ 2007-05-28 18:27 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

Dear all,

To see the issue:

  (url-mailto (url-generic-parse-url "mailto:nobd1@unl.edu?body=I should be inserted before the signature"))

If the mail buffer has a signature part, the 'body' text will be added
after the signature, which is clearly wrong.

I wonder if the following small patch is good:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: url-mailto.diff --]
[-- Type: text/x-patch, Size: 855 bytes --]

Index: url-mailto.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/url/url-mailto.el,v
retrieving revision 1.4.2.9
diff -u -r1.4.2.9 url-mailto.el
--- url-mailto.el	26 Jan 2007 06:15:30 -0000	1.4.2.9
+++ url-mailto.el	28 May 2007 18:13:20 -0000
@@ -60,6 +60,11 @@
 	(save-excursion
 	  (insert "\n"))))))
 
+(defun url-mail-goto-body ()
+  (goto-char (point-min))
+  (or (search-forward (concat "\n" mail-header-separator "\n") nil t)
+      (goto-char (point-max))))
+
 ;;;###autoload
 (defun url-mailto (url)
   "Handle the mailto: URL syntax."
@@ -100,7 +105,7 @@
     (while args
       (if (string= (caar args) "body")
 	  (progn
-	    (goto-char (point-max))
+	    (url-mail-goto-body)
 	    (insert (mapconcat 
 		     #'(lambda (string)
 			 (replace-regexp-in-string "\r\n" "\n" string))

[-- Attachment #3: Type: text/plain, Size: 84 bytes --]


Thanks,
-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-05-29 16:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-28 18:27 url-mailto insert 'body' in the wrong place Leo
2007-05-28 18:32 ` David Kastrup
2007-05-28 18:44   ` Leo
2007-05-29  4:11     ` Richard Stallman
2007-05-29 15:31       ` Chong Yidong
2007-05-29 16:16         ` Leo
2007-05-29 16:24           ` Chong Yidong

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.