From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: [PATCH] Make footnotes work correctly in message-mode Date: Fri, 22 Oct 2010 14:11:35 +0200 Message-ID: <80mxq6e8aw.fsf@mundaneum.com> References: <87tykgxqbb.fsf@fastmail.fm> <878w1s7zw8.fsf@thinkpad.tsdh.de> <871v7k7ydt.fsf_-_@thinkpad.tsdh.de> <4CC00391.6050608@easy-emacs.de> <87wrpb7unc.fsf@thinkpad.tsdh.de> <15036.1287673547@gamaville.dokosmarshall.org> <87k4lbfu95.fsf@MagnumOpus.khem> <87mxq75zvv.fsf@thinkpad.tsdh.de> <87bp6nicn7.wl%ucecesf@ucl.ac.uk> <80zku63adu.fsf@mundaneum.com> <87lj5q7ebq.fsf@thinkpad.tsdh.de> <87hbge7dv4.fsf_-_@thinkpad.tsdh.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Tassilo, Tassilo Horn wrote: > * repos/el/org-mode/lisp/org-footnote.el > (org-footnote-create-definition) > (org-footnote-goto-local-insertion-point): Add footnotes before > signature when in message-mode. > --- > lisp/org-footnote.el | 25 +++++++++++++++---------- > 1 files changed, 15 insertions(+), 10 deletions(-) > > diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el > index 36fcfb2..ac1305f 100644 > --- a/lisp/org-footnote.el > +++ b/lisp/org-footnote.el > @@ -302,15 +302,19 @@ or new, let the user edit the definition of the foo= tnote." > (t > (setq re (concat "^" org-footnote-tag-for-non-org-mode-files "[ \t= ]*$")) > (unless (re-search-forward re nil t) > - (goto-char (point-max)) > - (skip-chars-backward " \t\r\n") > - (insert "\n\n") > - (delete-region (point) (point-max)) > - (insert org-footnote-tag-for-non-org-mode-files "\n")) > - (goto-char (point-max)) > - (skip-chars-backward " \t\r\n"))) > - (insert "\n\n") > - (insert "[" label "] ") > + (let ((max (if (and (eq major-mode 'message-mode) > + (re-search-forward message-signature-separator nil t)) > + (progn (beginning-of-line) (point)) > + (goto-char (point-max))))) > + (skip-chars-backward " \t\r\n") > + (delete-region (point) max) > + (insert "\n\n") > + (insert org-footnote-tag-for-non-org-mode-files "\n"))))) > + ;; Skip existing footnotes > + (while (re-search-forward "^[[:space:]]*\\[[^]]+\\] " nil t) > + (forward-line)) > + (insert "[" label "] \n") > + (goto-char (1- (point))) > (message "Edit definition and go back with `C-c &' or, if unique, wi= th `C-c C-c'."))) >=20=20 > ;;;###autoload > @@ -506,7 +510,8 @@ ENTRY is (fn-label num-mark definition)." > (beginning-of-line 0)) > (if (looking-at "[ \t]*#\\+TBLFM:") (beginning-of-line 2)) > (end-of-line 1) > - (skip-chars-backward "\n\r\t ")) > + (skip-chars-backward "\n\r\t ") > + (forward-line)) >=20=20 > (defun org-footnote-delete (&optional label) > "Delete the footnote at point. I tried to use this patch, but failed doing so: --8<---------------cut here---------------start------------->8--- [sva@MEDIACENTER] ~/src/org-mode>git apply patch patch:18: trailing whitespace. (let ((max (if (and (eq major-mode 'message-mode) patch:19: trailing whitespace. (re-search-forward message-signature-separator = nil t)) patch:20: trailing whitespace. (progn (beginning-of-line) (point)) patch:21: trailing whitespace. (goto-char (point-max))))) patch:22: trailing whitespace. (skip-chars-backward " \t\r\n") error: patch failed: lisp/org-footnote.el:302 error: lisp/org-footnote.el: patch does not apply [sva@MEDIACENTER] ~/src/org-mode>patch < patch diff: unknown option -- git diff: Try `diff --help' for more information. ./patch: line 2: index: command not found ./patch: line 3: ---: command not found ./patch: line 4: +++: command not found ./patch: line 31: unexpected EOF while looking for matching `'' ./patch: line 44: syntax error: unexpected end of file [sva@MEDIACENTER] ~/src/org-mode>git apply < patch :18: trailing whitespace. (let ((max (if (and (eq major-mode 'message-mode) :19: trailing whitespace. (re-search-forward message-signature-separator = nil t)) :20: trailing whitespace. (progn (beginning-of-line) (point)) :21: trailing whitespace. (goto-char (point-max))))) :22: trailing whitespace. (skip-chars-backward " \t\r\n") error: patch failed: lisp/org-footnote.el:302 error: lisp/org-footnote.el: patch does not apply --8<---------------cut here---------------end--------------->8--- Any help? (I don't know "anything" of git) FYI, before this, I have pulled Org's latest dev version -- lots of change, BTW (all Babel files or so) -- as last time was a few days ago. Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode