From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug] canonical context not work in 8.3 Date: Mon, 10 Aug 2015 23:39:58 +0200 Message-ID: <87tws6ddqp.fsf@nicolasgoaziou.fr> References: <87mvy4eywo.fsf@nicolasgoaziou.fr> <8737zvfpvc.fsf@nicolasgoaziou.fr> <87y4hmb3vb.fsf@nicolasgoaziou.fr> <87mvy2b0i5.fsf@nicolasgoaziou.fr> <87oaif8j9h.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOum0-00007x-3z for emacs-orgmode@gnu.org; Mon, 10 Aug 2015 17:38:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZOulz-0007sm-3Q for emacs-orgmode@gnu.org; Mon, 10 Aug 2015 17:38:24 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:42918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOuly-0007sT-SJ for emacs-orgmode@gnu.org; Mon, 10 Aug 2015 17:38:23 -0400 In-Reply-To: (Samuel Wales's message of "Mon, 10 Aug 2015 11:31:13 -0700") 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: Samuel Wales Cc: emacs-orgmode Samuel Wales writes: > On 8/10/15, Nicolas Goaziou 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,