emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Place Footnotes section before signature in all message-mode derived modes.
Date: Tue, 7 Dec 2010 19:40:22 +0100	[thread overview]
Message-ID: <87y681e7zh.fsf@member.fsf.org> (raw)

* 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---

                 reply	other threads:[~2010-12-07 18:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y681e7zh.fsf@member.fsf.org \
    --to=tassilo@member.fsf.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).