From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Anders Waldenborg <anders@0x63.nu>
Cc: emacs-orgmode@gnu.org
Subject: Re: PATCH Make org-open-at-point only ask once
Date: Mon, 29 Aug 2011 09:14:13 +0200 [thread overview]
Message-ID: <87liuclmey.fsf@gmail.com> (raw)
In-Reply-To: <20110828200542.GS5700@0x63.nu> (Anders Waldenborg's message of "Sun, 28 Aug 2011 22:05:42 +0200")
Hello,
Anders Waldenborg <anders@0x63.nu> writes:
> If an org buffer is narrowed, and one tries to do org-open-at-point on
> a link that points to outside of the restriction it asks: "No match -
> create this as a new heading?". When answering no the buffer is
> widened and the reseach is done, and if the link still can't be
> resolved the question is asked again.
>
> For nonexistant links this happens even if the buffer isn't narrowed -
> one needs to answer "n" twice.
>
> I also attached an alternate patch which (IMHO) simplifies the
> implementation by hiding the hard work in a macro, and as a bonus it
> only calls org-link-search once. But it is much more intrusive.
Yes, imposing widening to the user is intrusive. Moreover, I think you
cannot avoid to call org-link-search twice (once it has failed): the
point is to do a local search and then a global one.
Though, the macro idea is interesting, as I can see at least one other
place where it might be useful. So, what about changing the macro to:
1. If current buffer is narrowed, execute body with the current
restriction. If it fails (silently), re-execute body with a widened
buffer. Restore default narrowing.
2. If the buffer has no narrowing in effect, just execute body.
Also:
1. Doc-strings must refer to the arguments.
2. Don't forget to add: (def-edebug-spec macro-name (arguments)) just
after it.
3. You need to add a proper ChangeLog message in your commit.
Thank you for looking at this.
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2011-08-29 7:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-28 20:05 PATCH Make org-open-at-point only ask once Anders Waldenborg
2011-08-29 7:14 ` Nicolas Goaziou [this message]
2011-08-29 9:21 ` Anders Waldenborg
2011-08-29 9:36 ` Nicolas Goaziou
2011-08-29 10:53 ` Anders Waldenborg
2011-08-29 11:25 ` Nicolas Goaziou
2011-10-06 8:00 ` Carsten Dominik
2011-10-06 8:43 ` Anders Waldenborg
2011-10-06 8:54 ` Carsten Dominik
2011-10-06 9:51 ` Anders Waldenborg
2011-10-06 9:57 ` Carsten Dominik
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=87liuclmey.fsf@gmail.com \
--to=n.goaziou@gmail.com \
--cc=anders@0x63.nu \
--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).