From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug] canonical context not work in 8.3 Date: Fri, 07 Aug 2015 10:45:59 +0200 Message-ID: <8737zvfpvc.fsf@nicolasgoaziou.fr> References: <87mvy4eywo.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNdGM-0002cM-44 for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 04:44:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNdGK-00044N-Vp for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 04:44:26 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:50860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNdGK-00043p-Ob for emacs-orgmode@gnu.org; Fri, 07 Aug 2015 04:44:24 -0400 In-Reply-To: (Samuel Wales's message of "Thu, 6 Aug 2015 18:38:55 -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: > thank you for fixing. > > canonical is always what i want, except for occur-tree. > > i did profiler-start then went to org file a few times to average out > the results. did i use the correct profiler? You did. > > command-execute 60148 99% > - call-interactively 60148 99% > - org-agenda-switch-to 59299 98% > - org-show-context 59299 98% > - org-show-set-visibility 59299 98% > - show-children 59170 97% > - outline-end-of-subtree 35938 59% > outline-next-heading 9399 15% > org-outline-level 4047 6% > - outline-map-region 23168 38% > + # 9558 15% > outline-next-heading 7399 12% > + org-up-heading-safe 117 0% > + org-show-entry 4 0% > + org-flag-heading 4 0% `show-children' is the culprit. Could you evaluate the following function and time it again? (defun show-children (&optional level) (save-excursion (org-back-to-heading t) (let* ((current-level (funcall outline-level)) (level (if level (+ (prefix-numeric-value level) current-level) (save-excursion (outline-next-heading) (if (eobp) current-level (funcall outline-level)))))) (org-map-region (lambda () (when (<= (funcall outline-level) level) (outline-flag-region (if (bobp) (point) (1- (point))) (line-end-position) nil))) (point) (org-end-of-subtree t t))))) Thank you. Regards,