emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: pinard@iro.umontreal.ca (François Pinard)
To: emacs-orgmode@gnu.org
Subject: Capture failure [7.7]
Date: Sun, 11 Dec 2011 23:24:28 -0500	[thread overview]
Message-ID: <8739cqo1s3.fsf@iro.umontreal.ca> (raw)

Hi, Org mode people.

I had some misery trying to debug a special personal machinery to
capture URLs from Chrome into Org.  Not worth detailing here.  And
moreover, as it works now, I'm happy with this.

However, I had to make the following modification to get it going.  I'm
not sure what are the meaning of "beg" and "end" in this function, so
someone knowledgeable should check if (point) is appropriate as a value.

One sure thing is that "beg" and "end" should be initialized, as they
get later consulted in the function, and whenever :exact-position got a
value, that initialization does not occur.

François

P.S. This is using a copy of the Git repository as updated yesterday.


diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 566fb96..783fe70 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)))

             reply	other threads:[~2011-12-12  4:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12  4:24 François Pinard [this message]
2011-12-18 19:39 ` Capture failure [7.7] David Maus
2011-12-19  5:59   ` François Pinard

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=8739cqo1s3.fsf@iro.umontreal.ca \
    --to=pinard@iro.umontreal.ca \
    --cc=emacs-orgmode@gnu.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).