From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Bug: [PATCH] Make org-narrow-to-subtree usable out of Org mode [8.2.7b (release_8.2.7b-6-g07d470 @ /home/youngfrog/sourcetrees/org-mode/lisp/)] Date: Mon, 28 Jul 2014 16:18:10 +0200 Message-ID: <87mwbtxuob.fsf@bzg.ath.cx> References: <87fvht9tdo.fsf@yahoo.fr> <87bnsfrycn.fsf@nicolasgoaziou.fr> <878uni7unf.fsf@geodiff-mac3.ulb.ac.be> <87tx66lur9.fsf@nicolasgoaziou.fr> <87r41a6dfw.fsf@geodiff-mac3.ulb.ac.be> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBofx-0007kb-Bp for emacs-orgmode@gnu.org; Mon, 28 Jul 2014 13:25:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBoff-0005wA-94 for emacs-orgmode@gnu.org; Mon, 28 Jul 2014 13:25:29 -0400 Received: from mail-s76.mailgun.info ([184.173.153.204]:46713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBoff-0005nv-6Y for emacs-orgmode@gnu.org; Mon, 28 Jul 2014 13:25:11 -0400 In-Reply-To: <87r41a6dfw.fsf@geodiff-mac3.ulb.ac.be> (Nicolas Richard's message of "Thu, 24 Jul 2014 16:25:55 +0200") 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 Richard Cc: emacs-orgmode@gnu.org Hi Nicolas, Nicolas Richard writes: > But now that I think about it, org mode simply should avoid narrow-map > completely : users (me included) won't randomly try to run > org-narrow-to-subtree outside of org buffers (and those who do deserve a > bad error message) but they might want to give "C-x n s" a try if it is > available. > > While writing a patch for changing that, I see that the code is: > (if (boundp 'narrow-map) > (org-defkey narrow-map "s" 'org-narrow-to-subtree) > (org-defkey org-mode-map "\C-xns" 'org-narrow-to-subtree)) > (if (boundp 'narrow-map) > (org-defkey narrow-map "b" 'org-narrow-to-block) > (org-defkey org-mode-map "\C-xnb" 'org-narrow-to-block)) > (if (boundp 'narrow-map) > (org-defkey narrow-map "e" 'org-narrow-to-element) > (org-defkey org-mode-map "\C-xne" 'org-narrow-to-element)) > > IOW, org.el purposely binds in narrow-map ! So now I don't get it : > either it's in narrow-map and should be usable widely, or it's in > org-mode-map only for org-mode files. I think it's fine to bind `org-narrow-to-subtree' in narrow-map. It's basically to enjoy the `C-x n prefix', which is natural here. I applied your patch, but a good continuation would be to have C-h n s bound to `outline-narrow-to-subtree' in outline-mode and to `org-narrow-to-subtree' in org-mode, instead of just relying on one single function. This requires simplifying `org-narrow-to-subtree' and creating `outline-narrow-to-subtree' in emacs. What do you think? -- Bastien