all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] org-capture on file+regexp
@ 2010-06-25 14:37 Juan
  2010-06-25 18:53 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Juan @ 2010-06-25 14:37 UTC (permalink / raw)
  To: carsten.dominik; +Cc: emacs-orgmode

Hi,

Below is a patch for capturing on file+regexp (was using the file
name as regexp).

Regards,
.j.

P.S. Now I have to figure out why org-capture-place-entry inserts a
new level 1 if (not target-entry-p) instead of keeping the point where
it was (i.e. regexp match).

8<------------------------------------------------------------

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 879dd25..03387c0 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -556,7 +556,7 @@ already gone."
        ((eq (car target) 'file+regexp)
        (set-buffer (org-capture-target-buffer (nth 1 target)))
        (goto-char (point-min))
-       (if (re-search-forward (nth 1 target) nil t)
+       (if (re-search-forward (nth 2 target) nil t)
            (progn
              (goto-char (match-beginning 0))
              (setq target-entry-p (and (org-mode-p) (org-at-heading-p))))

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] org-capture on file+regexp
  2010-06-25 14:37 [PATCH] org-capture on file+regexp Juan
@ 2010-06-25 18:53 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2010-06-25 18:53 UTC (permalink / raw)
  To: Juan; +Cc: emacs-orgmode

Applied, thanks.

- Carsten

On Jun 25, 2010, at 4:37 PM, Juan wrote:

> Hi,
>
> Below is a patch for capturing on file+regexp (was using the file
> name as regexp).
>
> Regards,
> .j.
>
> P.S. Now I have to figure out why org-capture-place-entry inserts a
> new level 1 if (not target-entry-p) instead of keeping the point where
> it was (i.e. regexp match).
>
> 8<------------------------------------------------------------
>
> diff --git a/lisp/org-capture.el b/lisp/org-capture.el
> index 879dd25..03387c0 100644
> --- a/lisp/org-capture.el
> +++ b/lisp/org-capture.el
> @@ -556,7 +556,7 @@ already gone."
>        ((eq (car target) 'file+regexp)
>        (set-buffer (org-capture-target-buffer (nth 1 target)))
>        (goto-char (point-min))
> -       (if (re-search-forward (nth 1 target) nil t)
> +       (if (re-search-forward (nth 2 target) nil t)
>            (progn
>              (goto-char (match-beginning 0))
>              (setq target-entry-p (and (org-mode-p) (org-at-heading- 
> p))))

- Carsten

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-25 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-25 14:37 [PATCH] org-capture on file+regexp Juan
2010-06-25 18:53 ` Carsten Dominik

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.