emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-link-search: Augment signature?
Date: Fri, 20 Aug 2010 15:18:04 +0530	[thread overview]
Message-ID: <8162z57gyz.fsf@gmail.com> (raw)
In-Reply-To: <2559B10D-71A8-46B9-9694-AE6332924768@gmail.com> (Carsten Dominik's message of "Fri, 20 Aug 2010 11:26:47 +0200")

    >> On a related note, how would I accomplish this - "Create the
    >> headline automagically everytime but suppress the prompt".
    >> 
    >> This is the code snippet as it is in git today -
    >> 
    >> ((and (not org-link-search-inhibit-query) (eq
    >> org-link-search-must-match-exact-headline 'query-to-create)
    >> (y-or-n-p "No match - create this as a new heading? "))
    >> (goto-char (point-max)) (or (bolp) (newline)) (insert "* " s
    >> "\n") (beginning-of-line 0))
    >> 
    >> 
    >> Shouldn't the above block should instead read thus
    >> 
    >> ((and (eq org-link-search-must-match-exact-headline
    >> 'query-to-create) (or org-link-search-inhibit-query (y-or-n-p "No
    >> match - create this as a new heading? ")) (goto-char (point-max))
    >> (or (bolp) (newline)) (insert "* " s "\n") (beginning-of-line 0))


    > Why???

    > The above code would stop at the first form that returns nil, for
    > example (insert ...) or even (newline)


Mistake on my part. (Not a native speaker of elisp here)

((and
  (eq org-link-search-must-match-exact-headline 'query-to-create)
  (or org-link-search-inhibit-query
      (y-or-n-p "No match - create this as a new heading? ")))
 (goto-char (point-max))
 (or (bolp) (newline))
 (insert "* " s "\n")
 (beginning-of-line 0))

My gut feeling is that there is some inconsistency in the way
org-link-search-must-match-exact-headline and
org-link-search-inhibit-query work together.

Jambunathan K.





    

      parent reply	other threads:[~2010-08-20 10:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-19 12:15 org-link-search: Augment signature? Jambunathan K
2010-08-20  6:44 ` Carsten Dominik
     [not found]   ` <81fwy97id5.fsf@gmail.com>
     [not found]     ` <2559B10D-71A8-46B9-9694-AE6332924768@gmail.com>
2010-08-20  9:48       ` Jambunathan K [this message]

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=8162z57gyz.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --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).