emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [PATCH] Make footnotes work correctly in message-mode
Date: Fri, 22 Oct 2010 14:11:35 +0200	[thread overview]
Message-ID: <80mxq6e8aw.fsf@mundaneum.com> (raw)
In-Reply-To: 87hbge7dv4.fsf_-_@thinkpad.tsdh.de

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 footnote."
>       (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, with `C-c C-c'.")))
>  
>  ;;;###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))
>  
>  (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
<stdin>:18: trailing whitespace.
        (let ((max (if (and (eq major-mode 'message-mode)
<stdin>:19: trailing whitespace.
                            (re-search-forward message-signature-separator nil t))
<stdin>:20: trailing whitespace.
                       (progn (beginning-of-line) (point))
<stdin>:21: trailing whitespace.
                     (goto-char (point-max)))))
<stdin>: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

-- 
Sébastien 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

  reply	other threads:[~2010-10-22 12:11 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20  5:37 A few questions about how you write e-mails Jeff Horn
2010-10-20  5:51 ` Glyn Millington
2010-10-20  5:57 ` Noorul Islam K M
2010-10-20  6:44 ` Samuel Wales
2010-10-20 11:36   ` Bernt Hansen
2010-10-20 17:20 ` Nick Dokos
2010-10-22  8:06   ` Sébastien Vauban
2010-10-22  8:47     ` Tassilo Horn
2010-10-20 20:10 ` Eric Schulte
2010-10-21  1:55 ` Matt Lundin
2010-10-21  2:47   ` suvayu ali
2010-10-21  3:40     ` Nick Dokos
2010-10-21  8:10       ` suvayu ali
2010-10-22 12:27         ` Matthias Danzl
2010-10-22 15:07           ` suvayu ali
2010-10-21  7:45     ` Tassilo Horn
2010-10-21  8:07       ` suvayu ali
2010-10-21  8:17         ` Difference between org-footnote.el and footnote.el (was: A few questions about how you write e-mails) Tassilo Horn
2010-10-21  9:10           ` [Orgmode] Difference between org-footnote.el and footnote.el Andreas Röhler
2010-10-21  9:38             ` Tassilo Horn
2010-10-21 10:17               ` Tassilo Horn
2010-10-21 15:05               ` Nick Dokos
2010-10-21 15:19                 ` Charles Philip Chan
2010-10-21 15:28                   ` Tassilo Horn
2010-10-21 19:11                     ` Eric S Fraga
2010-10-22  8:22                       ` Sébastien Vauban
2010-10-22  9:43                         ` Tassilo Horn
2010-10-22  9:53                           ` [PATCH] Make footnotes work correctly in message-mode (was: Difference between org-footnote.el and footnote.el) Tassilo Horn
2010-10-22 12:11                             ` Sébastien Vauban [this message]
2010-10-22 12:29                               ` [PATCH] Make footnotes work correctly in message-mode Tassilo Horn
2010-10-22 14:24                                 ` Sébastien Vauban
2010-10-22 13:00                               ` Dan Davison
2010-10-22 15:51                                 ` Sébastien Vauban
2010-10-22 15:43                             ` Sébastien Vauban
2010-10-22 16:23                               ` Tassilo Horn
2010-10-22 18:44                                 ` Sébastien Vauban
2010-10-24 16:20                             ` [PATCH] Make footnotes work correctly in message-mode (was: Difference between org-footnote.el and footnote.el) Carsten Dominik
2010-10-24 17:02                               ` Nick Dokos
2010-10-24 17:14                                 ` [PATCH] Make footnotes work correctly in message-mode Tassilo Horn
2010-10-21  6:16   ` A few questions about how you write e-mails Noorul Islam K M

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=80mxq6e8aw.fsf@mundaneum.com \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.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).