From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: doc patch: move footnote in external links
Date: Sat, 13 Dec 2014 10:43:22 +0100 [thread overview]
Message-ID: <m2iohf7umd.fsf@charm-wifi.irisa.fr> (raw)
In-Reply-To: <87egs4bwuu.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Fri, 12 Dec 2014 18:29:13 +0100")
[-- Attachment #1: Type: text/plain, Size: 2151 bytes --]
Hello,
On 2014-12-12 18:29, Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> Hello,
>
> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> I think the footnote in
>> http://orgmode.org/manual/External-links.html#fn-1 is in the wrong
>> place, it should be on the next line.
>>
>> Here is a patch to fix it. If you prefer I can push it directly
>> myself.
>
> I think the current documentation is correct. Only
>
> file:projects.org::some words
>
> can trigger a text search. OTOH
>
> file:projects.org::*Headline
>
> is always an exact match against headlines in the file.
I've re-read the code, and I think this is partially correct. The only
place the `org-link-search-must-match-exact-headline' is used is below,
in a big conditional in `org-link-search'. The clauses before are used
to check special cases.
#+begin_src emacs-lisp
((and (derived-mode-p 'org-mode) org-link-search-must-match-exact-headline)
(and (equal (string-to-char s) ?*) (setq s (substring s 1)))
(goto-char (point-min))
(cond
((let (case-fold-search)
(re-search-forward (format org-complex-heading-regexp-format
(regexp-quote s))
nil t))
;; OK, found a match
(setq type 'dedicated)
(goto-char (match-beginning 0)))
((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))
(t
(goto-char pos)
(error "No match"))))
#+end_src
So you are correct the footnote applies to the text search. However, I
think is also applies to the headline search (as suggested by the second
line of the snippet). In other words, if I search for
file:projects.org::*Headline
with `org-link-search-must-match-exact-headline' set to
'query-to-create, then I will be asked to create a headline.
Should I add a footnote to that effect?
Thanks,
Alan
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]
next prev parent reply other threads:[~2014-12-13 11:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-12 7:31 doc patch: move footnote in external links Alan Schmitt
2014-12-12 17:29 ` Nicolas Goaziou
2014-12-13 9:43 ` Alan Schmitt [this message]
2014-12-13 14:17 ` Nicolas Goaziou
2014-12-16 17:20 ` Alan Schmitt
2014-12-16 21:54 ` Nicolas Goaziou
2014-12-17 16:33 ` Alan Schmitt
2014-12-20 22:15 ` Nicolas Goaziou
2015-01-10 12:45 ` Alan Schmitt
2015-01-11 22:00 ` Nicolas Goaziou
2015-01-12 7:40 ` Alan Schmitt
2015-01-12 8:43 ` Nicolas Goaziou
2015-01-12 11:12 ` Alan Schmitt
2015-01-12 22:56 ` Nicolas Goaziou
2015-01-14 13:19 ` Alan Schmitt
2015-01-16 8:57 ` Nicolas Goaziou
2015-02-07 11:23 ` Alan Schmitt
2015-02-07 21:44 ` Nicolas Goaziou
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=m2iohf7umd.fsf@charm-wifi.irisa.fr \
--to=alan.schmitt@polytechnique.org \
--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).