emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Samuel Wales <samologist@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [bug] canonical context not work in 8.3
Date: Mon, 10 Aug 2015 23:39:58 +0200	[thread overview]
Message-ID: <87tws6ddqp.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAJcAo8srCE7cS-NJY9XkFL8vamWJQP4qTKiRQ09Yczn-L7X+jw@mail.gmail.com> (Samuel Wales's message of "Mon, 10 Aug 2015 11:31:13 -0700")

Samuel Wales <samologist@gmail.com> writes:

> On 8/10/15, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>> I pushed the new function to code base. However, due to the nature of
>> the change, it landed in master. So it will be available in Org 8.4.
>
> thank you.  will it work in 8.3 (maint) if i load it after loading
> org?

If you don't plan to use "outline.el", you can override `show-children'
with the following:

--8<---------------cut here---------------start------------->8---
(defun show-children (&optional level)
  "Show all direct subheadings of this heading.
Prefix arg LEVEL is how many levels below the current level should be shown.
Default is enough to cause the following heading to appear."
  (save-excursion
    (org-back-to-heading t)
    (let* ((current-level (funcall outline-level))
           (max-level (org-get-valid-level
                       current-level (if level (prefix-numeric-value level) 1)))
           (end (save-excursion (org-end-of-subtree t t)))
           (regexp-fmt "^\\*\\{%d,%s\\}\\(?: \\|$\\)")
           (past-first-child nil)
	   ;; Make sure to skip inlinetasks.
           (re (format regexp-fmt
		       current-level
		       (cond
			((not (featurep 'org-inlinetask)) "")
			(org-odd-levels-only (- (* 2 org-inlinetask-min-level)
						3))
			(t (1- org-inlinetask-min-level))))))
      ;; Display parent heading.
      (outline-flag-region (line-end-position 0) (line-end-position) nil)
      (forward-line)
      ;; Display children.  First child may be deeper than expected
      ;; MAX-LEVEL.  Since we want to display it anyway, adjust
      ;; MAX-LEVEL accordingly.
      (while (re-search-forward re end t)
        (unless past-first-child
          (setq re (format regexp-fmt
			   current-level
			   (max (funcall outline-level) max-level)))
          (setq past-first-child t))
        (outline-flag-region (line-end-position 0) (line-end-position) nil)))))
--8<---------------cut here---------------end--------------->8---

However, the patch that landed in master implements `org-show-children'
instead.


Regards,

      reply	other threads:[~2015-08-10 21:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 23:10 [bug] canonical context not work in 8.3 Samuel Wales
2015-08-07  0:16 ` Nicolas Goaziou
2015-08-07  1:38   ` Samuel Wales
2015-08-07  8:45     ` Nicolas Goaziou
2015-08-07 20:27       ` Samuel Wales
2015-08-08  8:07         ` Nicolas Goaziou
2015-08-08  9:19           ` Nicolas Goaziou
2015-08-09 18:53             ` Samuel Wales
2015-08-10 11:39               ` Nicolas Goaziou
2015-08-10 18:31                 ` Samuel Wales
2015-08-10 21:39                   ` Nicolas Goaziou [this message]

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=87tws6ddqp.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=samologist@gmail.com \
    /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).