From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/74273 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C5=81ukasz?= Stelmach Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] message-goto-body after <#secure Date: Tue, 23 Nov 2010 21:55:35 +0100 Message-ID: <87fwurlpyw.fsf@kotik.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1290545784 29092 80.91.229.12 (23 Nov 2010 20:56:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 23 Nov 2010 20:56:24 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M22638@lists.math.uh.edu Tue Nov 23 21:56:20 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PKzuQ-0000rM-DG for ding-account@gmane.org; Tue, 23 Nov 2010 21:56:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1PKzuB-0002w4-RW; Tue, 23 Nov 2010 14:55:59 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PKzuA-0002vr-EE for ding@lists.math.uh.edu; Tue, 23 Nov 2010 14:55:58 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PKzu4-0000oI-SH for ding@lists.math.uh.edu; Tue, 23 Nov 2010 14:55:58 -0600 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1PKzu4-0001T9-00 for ; Tue, 23 Nov 2010 21:55:52 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PKzu3-0000Yx-1W for ding@gnus.org; Tue, 23 Nov 2010 21:55:51 +0100 Original-Received: from 213-238-67-164.adsl.inetia.pl ([213.238.67.164]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Nov 2010 21:55:51 +0100 Original-Received: from lukasz.stelmach by 213-238-67-164.adsl.inetia.pl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Nov 2010 21:55:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 213-238-67-164.adsl.inetia.pl User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:NoM45Wq2857BfHFtbbQTwMv8Ess= X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:74273 Archived-At: Hi. The following patch makes message-goto-body function put cursor after possible "<#secure" tag. This hits two birds with one stone: pressing C-c C-b moves me where I can start typing and any citations that get inserted into a new message buffer when replying (I have not tested resending or forwarding yet but I suppose it works the same way) leave the tag at the very begining of a message. Why I wrote this? I've set up mml-secure-message-sign-pgpmime as a part of message-setup-hook. I prefere this to putting it in message-send-hook because I can decide whether to sign a message or not. And it works well for a new message. However, it fails for replies because just before citations are inserted message-goto-body sets point *brefore* the <#secure tag that is there since message-setup-hook gets fired before citations. --8<---------------cut here---------------start------------->8--- diff --git a/lisp/message.el b/lisp/message.el index bff11b2..b3660c6 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -3099,7 +3099,8 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." (expand-abbrev)) (goto-char (point-min)) (or (search-forward (concat "\n" mail-header-separator "\n") nil t) - (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t))) + (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t)) + (while (looking-at "^<#secure") (forward-line 1))) (defun message-in-body-p () "Return t if point is in the message body." --8<---------------cut here---------------end--------------->8--- -- Miłego dnia, Łukasz Stelmach