From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anders Waldenborg Subject: Re: PATCH Make org-open-at-point only ask once Date: Mon, 29 Aug 2011 11:21:46 +0200 Message-ID: <20110829092146.GT5700@0x63.nu> References: <20110828200542.GS5700@0x63.nu> <87liuclmey.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qxy2S-0004Bl-CI for emacs-orgmode@gnu.org; Mon, 29 Aug 2011 05:21:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qxy2R-00037y-Df for emacs-orgmode@gnu.org; Mon, 29 Aug 2011 05:21:52 -0400 Received: from 0x63.nu ([193.26.17.18]:50894 helo=gagarin.0x63.nu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qxy2R-00036g-61 for emacs-orgmode@gnu.org; Mon, 29 Aug 2011 05:21:51 -0400 Content-Disposition: inline In-Reply-To: <87liuclmey.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org On Mon, Aug 29, 2011 at 09:14:13AM +0200, Nicolas Goaziou wrote: > 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. Yes, "local then global" search makes sense (I especially like how the infobrowser pops out to a global search with an extra ^S after failure). But for org links, I'm not 100% sure - consider this org-file: * Notes * Some topic [[Notes]] ** Notes If buffer is widen, the link goes to the toplevel header, but if I narrow to "Some topic" the link suddenly starts going to the subheader. So the links meaning changes depending on if the buffer is narrowed or not. I'm not sure it really is a problem, I just want to make sure it is taken into consideration. > > 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. Fails means that it throws error? Or any exception? > > 2. If the buffer has no narrowing in effect, just execute body. > > Also: Thanks for the review, I'll look into it soon. anders