emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: emacs-orgmode@gnu.org
Subject: Re: How to do proper folding and semantic markup
Date: Tue, 5 Apr 2016 04:19:43 +0000 (UTC)	[thread overview]
Message-ID: <loom.20160405T061538-142@post.gmane.org> (raw)
In-Reply-To: 87pou5s9i9.fsf@mercovich.net

Eduardo Mercovich <eduardo <at> 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)

  reply	other threads:[~2016-04-05  4:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30 20:44 How to do proper folding and semantic markup Eduardo Mercovich
2016-03-30 21:52 ` Thomas S. Dye
2016-04-01  0:11   ` Eduardo Mercovich
2016-03-31  8:10 ` Christian Moe
2016-04-01  0:39   ` Eduardo Mercovich
2016-04-01  7:48     ` Eric S Fraga
2016-04-01 12:33       ` Eduardo Mercovich
2016-04-04  5:21 ` Adam Porter
2016-04-04 15:01   ` Eduardo Mercovich
2016-04-05  4:19     ` Adam Porter [this message]
2016-04-05 21:18       ` Eduardo Mercovich
2016-04-05 22:04         ` Nick Dokos
2016-04-06 12:59           ` Eduardo Mercovich
2016-04-05 23:56         ` Adam Porter
2016-04-06 12:58           ` Eduardo Mercovich

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=loom.20160405T061538-142@post.gmane.org \
    --to=adam@alphapapa.net \
    --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).