emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH] Place Footnotes section before signature in all messag


From: Tassilo Horn
Subject: [Orgmode] [PATCH] Place Footnotes section before signature in all message-mode derived modes.
Date: Tue, 7 Dec 2010 19:40:22 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

* 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 via email to

[Prev in Thread] Current Thread [Next in Thread]