From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug] org-cycle changed behavior in orgstruct-mode Date: Sun, 30 Aug 2015 21:26:25 +0200 Message-ID: <87egik37dq.fsf@nicolasgoaziou.fr> References: <87fv3q2lxs.fsf@gmx.us> <878u9ic8sv.fsf@nicolasgoaziou.fr> <87zj1y0zst.fsf@gmx.us> <87614l95p7.fsf@nicolasgoaziou.fr> <877fodpzn0.fsf@gmx.us> <8737z145bo.fsf@nicolasgoaziou.fr> <87vbbwbpro.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW8Dh-0005yA-4L for emacs-orgmode@gnu.org; Sun, 30 Aug 2015 15:24:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZW8Dg-0004g4-5k for emacs-orgmode@gnu.org; Sun, 30 Aug 2015 15:24:49 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:40096) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW8Df-0004fe-Ui for emacs-orgmode@gnu.org; Sun, 30 Aug 2015 15:24:48 -0400 In-Reply-To: <87vbbwbpro.fsf@gmx.us> (rasmus@gmx.us's message of "Sun, 30 Aug 2015 20:22:03 +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: Rasmus Cc: emacs-orgmode@gnu.org Rasmus writes: > Do you mean to change org-cycle-internal-local as in this patch or to make > a hook around it? The former. However, a hook is OK too, but I couldn't find an acceptable candidate. Funnily, `org-end-of-subtree' does the exact opposite: it hard-codes behaviour and switch to the slow, outline.el, function when in a different mode. Other functions do not even have a fast path (e.g. `org-forward-heading-same-level'). We could make these functions faster, but we first need to decide how to proceed when it happens. After all, maybe the most simple path is good ole advice. Since `orgstruct-mode' already hijacks bindings, the next step would be to do the same for functions. WDYT? > Maybe the exception should be if orgstruct is detected rather than if > org is not detected. Not really, because you can have orgstruct on even in an Org buffer. > + (org-with-limited-levels > + ;; `orgstruct-mode' does not work well with > + ;; `org-show-children'. Thus, use `show-children' unless in > + ;; org-mode. Nitpick: "unless in Org mode" or "unless major mode is `org-mode'". Thank you for the patch. Regards,