From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: How to do proper folding and semantic markup Date: Tue, 5 Apr 2016 04:19:43 +0000 (UTC) Message-ID: References: <87vb438zm8.fsf@mercovich.net> <87pou5s9i9.fsf@mercovich.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anITB-0002et-9S for emacs-orgmode@gnu.org; Tue, 05 Apr 2016 00:20:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anIT7-00076l-To for emacs-orgmode@gnu.org; Tue, 05 Apr 2016 00:20:01 -0400 Received: from plane.gmane.org ([80.91.229.3]:45865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anIT7-00076X-NA for emacs-orgmode@gnu.org; Tue, 05 Apr 2016 00:19:57 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1anIT5-0002AC-UI for emacs-orgmode@gnu.org; Tue, 05 Apr 2016 06:19:56 +0200 Received: from 172-0-42-27.lightspeed.ltrkar.sbcglobal.net ([172.0.42.27]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Apr 2016 06:19:55 +0200 Received: from adam by 172-0-42-27.lightspeed.ltrkar.sbcglobal.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Apr 2016 06:19: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: emacs-orgmode@gnu.org Eduardo Mercovich mercovich.net> writes: > Also less known that it deserves, for focusing I do use narrowing a lot: Yeah, that's basically what tree-to-indirect does, it makes an indirect buffer and then narrows it. So you can widen the indirect buffer and get another view of the whole buffer. I also use this advice to rename the indirect buffer to the name of the heading, that way you don't end up with "file.org<1>"-style buffers: (defun ap/org-rename-tree-to-indirect-buffer (&rest args) "Rename the new buffer to the current org heading after using org-tree-to-indirect-buffer." (with-current-buffer (car (buffer-list (car (frame-list)))) (save-excursion (let* ((heading (nth 4 (org-heading-components))) (name (if (string-match org-bracket-link-regexp heading) ;; Heading is an org link; use link name ;; TODO: but what if only part of the heading is? (match-string 3 heading) ;; Not a link; use whole heading heading))) (rename-buffer name) t)))) (advice-add 'org-tree-to-indirect-buffer :after 'ap/org-rename-tree-to-indirect-buffer)