emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problem at capture time
@ 2012-01-07 16:52 François Pinard
  2012-01-07 17:25 ` François Pinard
  2012-01-09  9:59 ` Bastien
  0 siblings, 2 replies; 7+ messages in thread
From: François Pinard @ 2012-01-07 16:52 UTC (permalink / raw)
  To: emacs-orgmode

Hi, Org people.

On 2011-12-11 23:24, I reported a problem met while using the Org
capture facility, and a patch working around the problem.  David Maus
then requested for details, which I sent on 2011-12-19 00:59.  David's
mailer rejected my reply as being likely SPAM, but it made it to the
emacs-orgmode@gnu.org mailing list, so I presume David got it.  Here are
references I have for both messages:

- [[gnus:gmane.emacs.orgmode#8739cqo1s3.fsf@iro.umontreal.ca][Email from
François Pinard: Capture failure {7.7}]]
- [[gnus:gmane.emacs.orgmode#871us1f6fo.fsf@iro.umontreal.ca][Email from François Pinard: Re: Capture failure {7.7}]]

This morning, I removed my patch locally.  Using a fresh Git pull of Org
mode,  the problem is still there, showing as:

Debugger entered--Lisp error: (error "Capture template `d': integer-or-marker-p")
  signal(error ("Capture template `d': integer-or-marker-p"))
  error("Capture template `%s': %s" "d" integer-or-marker-p)
  byte-code("\301p!\203.\0\302\303\304 \"\203.\0\305p!\210\306\307\310!!\210\300\311\307\312!\bA@#\207" [error buffer-base-buffer string-match "\\`CAPTURE-" buffer-name kill-buffer set-window-configuration org-capture-get :return-to-wconf "Capture template `%s': %s" :key] 4)
  org-capture(nil)
  call-interactively(org-capture nil nil)

The problem, which I described two months ago, is that some variables in
org-capture.el (org-capture-place-item) do not get properly initialized
depending on the flow within the function.  The following patch solves
the problem for me:


diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 46202f8..508611d 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -913,7 +913,8 @@ it.  When it is a variable, retrieve the value.  Return whatever we get."
         beg end)
     (cond
      ((org-capture-get :exact-position)
-      (goto-char (org-capture-get :exact-position)))
+      (goto-char (org-capture-get :exact-position))
+      (setq beg (point) end (point)))
      ((not target-entry-p)
       ;; Insert as top-level entry, either at beginning or at end of file
       (setq beg (point-min) end (point-max)))


Could it be integrated in the main stream?  I'm not sure that "(point)"
is the best value to give for "beg" and "end" (I do not understand the
code enough), but surely, this is better than capture just crashing.

François

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

* Re: Problem at capture time
  2012-01-07 16:52 Problem at capture time François Pinard
@ 2012-01-07 17:25 ` François Pinard
  2012-01-09  9:59 ` Bastien
  1 sibling, 0 replies; 7+ messages in thread
From: François Pinard @ 2012-01-07 17:25 UTC (permalink / raw)
  To: emacs-orgmode

pinard@iro.umontreal.ca (François Pinard) writes:

> Hi, Org people.  [...] The problem, which I described two months ago,

Hmph!  My math is clearly wrong! One month ago! :-)  Sorry.

François

P.S. Who never had the the memory of times...

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

* Re: Problem at capture time
  2012-01-07 16:52 Problem at capture time François Pinard
  2012-01-07 17:25 ` François Pinard
@ 2012-01-09  9:59 ` Bastien
  2012-01-09 12:50   ` François Pinard
  1 sibling, 1 reply; 7+ messages in thread
From: Bastien @ 2012-01-09  9:59 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

Hi François,

please be patient -- your patches are under radar, resending
them does not help.

What helps is to send them using git format-patch, to include a
detailed and clean changelog entry, and to make it clear whether
the patch is okay or for testing purpose first.

When I read your message, I could not be sure you were yourself 
confident it was the right fix.

I will look into this later on.

Thanks,

-- 
 Bastien

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

* Re: Problem at capture time
  2012-01-09  9:59 ` Bastien
@ 2012-01-09 12:50   ` François Pinard
  2012-01-24  6:23     ` David Maus
  0 siblings, 1 reply; 7+ messages in thread
From: François Pinard @ 2012-01-09 12:50 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Bastien <bzg@altern.org> writes:

> Hi François, please be patient -- your patches are under radar,
> resending them does not help.

OK, sorry.  I do not know enough, yet, how Org works.  I sent a problem,
got a question, sent a reply which was rejected, then nothing.  A mere
short acknowledgement would have told me the message was not lost.

> What helps is to send them using git format-patch, to include a
> detailed and clean changelog entry, and to make it clear whether the
> patch is okay or for testing purpose first.  When I read your message,
> I could not be sure you were yourself confident it was the right fix.

I'm still not confident.  And I'm not pedant enough -- yet! :-) -- to
write formal patches when I'm not at least rather sure.

Besides the lack of confidence in a solution, however, the problem is
real.  The patch I sent was merely a trail for thinking.  But if nothing
else, it would do I presume.

> I will look into this later on.

Let me the one thanking you for supporting Org mode and its users, even
those like me! :-)

François

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

* Re: Problem at capture time
  2012-01-09 12:50   ` François Pinard
@ 2012-01-24  6:23     ` David Maus
  2012-01-24 16:13       ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: David Maus @ 2012-01-24  6:23 UTC (permalink / raw)
  To: François Pinard; +Cc: Bastien, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1733 bytes --]

Hi François,
Hi Bastien,

At Mon, 09 Jan 2012 07:50:54 -0500,
François Pinard wrote:
> 
> Bastien <bzg@altern.org> writes:
> 
> > Hi François, please be patient -- your patches are under radar,
> > resending them does not help.
> 
> OK, sorry.  I do not know enough, yet, how Org works.  I sent a problem,
> got a question, sent a reply which was rejected, then nothing.  A mere
> short acknowledgement would have told me the message was not lost.
> 
> > What helps is to send them using git format-patch, to include a
> > detailed and clean changelog entry, and to make it clear whether the
> > patch is okay or for testing purpose first.  When I read your message,
> > I could not be sure you were yourself confident it was the right fix.
> 
> I'm still not confident.  And I'm not pedant enough -- yet! :-) -- to
> write formal patches when I'm not at least rather sure.
> 
> Besides the lack of confidence in a solution, however, the problem is
> real.  The patch I sent was merely a trail for thinking.  But if nothing
> else, it would do I presume.
> 
> > I will look into this later on.
> 
> Let me the one thanking you for supporting Org mode and its users, even
> those like me! :-)

Sorry for my silence, haven't looked into the Orgmode mailing list for
a while. I just pushed a fix for this problem: If the :exact-position
for a list item is supplied we don't search for the position in an
existing list at all but insert the item whereever :exact-position
points to.

I'll mark the patch in patchwork as superseeded this evening as soon
as I recover my password.

Best,
  -- David
-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]

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

* Re: Problem at capture time
  2012-01-24  6:23     ` David Maus
@ 2012-01-24 16:13       ` Bastien
  2012-01-24 17:39         ` François Pinard
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2012-01-24 16:13 UTC (permalink / raw)
  To: David Maus; +Cc: François Pinard, emacs-orgmode

Hi David,

David Maus <dmaus@ictsoc.de> writes:

> Sorry for my silence, haven't looked into the Orgmode mailing list for
> a while. I just pushed a fix for this problem: If the :exact-position
> for a list item is supplied we don't search for the position in an
> existing list at all but insert the item whereever :exact-position
> points to.

Thanks a lot for the fix.

> I'll mark the patch in patchwork as superseeded this evening as soon
> as I recover my password.

I just did so -- hope you'll recover your password!  Otherwise John
might help.

Best,

-- 
 Bastien

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

* Re: Problem at capture time
  2012-01-24 16:13       ` Bastien
@ 2012-01-24 17:39         ` François Pinard
  0 siblings, 0 replies; 7+ messages in thread
From: François Pinard @ 2012-01-24 17:39 UTC (permalink / raw)
  To: Bastien; +Cc: David Maus, emacs-orgmode

Bastien <bzg@altern.org> writes:

> David Maus <dmaus@ictsoc.de> writes:

>> I just pushed a fix for this problem

> Thanks a lot for the fix.

After removing my patch and installing the official code here, things
continue to work nicely for the few tests I did.  Let me thank you as
well!

François

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

end of thread, other threads:[~2012-01-24 17:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-07 16:52 Problem at capture time François Pinard
2012-01-07 17:25 ` François Pinard
2012-01-09  9:59 ` Bastien
2012-01-09 12:50   ` François Pinard
2012-01-24  6:23     ` David Maus
2012-01-24 16:13       ` Bastien
2012-01-24 17:39         ` François Pinard

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).