From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: [PATCH] Place Footnotes section before signature in all message-mode derived modes. Date: Tue, 7 Dec 2010 19:40:22 +0100 Message-ID: <87y681e7zh.fsf@member.fsf.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=44650 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQ2Z1-0000Ic-B8 for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 13:47:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQ2Z0-0008VQ-EJ for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 13:46:59 -0500 Received: from lo.gmane.org ([80.91.229.12]:57541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQ2Z0-0008VJ-3A for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 13:46:58 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PQ2Yx-0000ij-8l for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 19:46:55 +0100 Received: from 95-88-32-105-dynip.superkabel.de ([95.88.32.105]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Dec 2010 19:46:55 +0100 Received: from tassilo by 95-88-32-105-dynip.superkabel.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Dec 2010 19:46:55 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * org-footnote.el (org-footnote-create-definition): Place Footnotes section before message-signature-separator also in modes derived from message-mode. --- lisp/org-footnote.el | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index 2a97b54..8cb4bbc 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -303,7 +303,7 @@ or new, let the user edit the definition of the footnote." (t (setq re (concat "^" org-footnote-tag-for-non-org-mode-files "[ \t]*$")) (unless (re-search-forward re nil t) - (let ((max (if (and (eq major-mode 'message-mode) + (let ((max (if (and (derived-mode-p 'message-mode) (re-search-forward message-signature-separator nil t)) (progn (beginning-of-line) (point)) (goto-char (point-max))))) -- 1.7.3.2 This patch makes the "place Footnotes section before message signature separator" also work in modes that derive from message-mode. For example, I have a derived mode for editing mails from KMail with the usual message-mode magic. --8<---------------cut here---------------start------------->8--- (defvar th-kmail-tmp-file-regexp "\\(kontact\\|kmail\\).*\\.tmp$" "Regexp that matches the file names of kmail's temporary files.") (defun kmail-save-message-and-exit () (interactive) (goto-char 0) (forward-line 1) (delete-region 1 (point)) (save-buffer) (server-edit)) (define-derived-mode kmail-mode message-mode "KMail" "Major mode for mails from kmail. \\{kmail-mode-map}" (goto-char 0) (insert "--text follows this line--\n") (define-key kmail-mode-map (kbd "C-c C-c") 'kmail-save-message-and-exit) (define-key kmail-mode-map (kbd "C-c #") 'kmail-save-message-and-exit)) (add-to-list 'auto-mode-alist (cons th-kmail-tmp-file-regexp 'kmail-mode)) (add-to-list 'recentf-exclude th-kmail-tmp-file-regexp) --8<---------------cut here---------------end--------------->8---