From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Howard Melman Newsgroups: gmane.emacs.bugs Subject: bug#41198: 28.0.50; heading cycling command for outline Date: Thu, 10 Dec 2020 14:08:17 -0500 Message-ID: References: <452A6049-893A-4E7E-8349-541D276FAD19@gmail.com> <73ee5b37b78bdc410554aebbc7a4c31b@skeletons.cc> <87a6vhvu7g.fsf@gnus.org> <87ft4ze3xz.fsf@gnus.org> <87h7pdbgvd.fsf@mail.linkov.net> <87sg8wxw6p.fsf@gnus.org> <87k0u7kxrz.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="910"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) To: 41198@debbugs.gnu.org Cancel-Lock: sha1:n3eFvIVdNmQvzMMYn2gD2GPNyn4= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 10 20:11:05 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1knRLE-00009t-Os for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Dec 2020 20:11:04 +0100 Original-Received: from localhost ([::1]:35870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knRLD-0000xm-JQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Dec 2020 14:11:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knRJK-0000FU-8u for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 14:09:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1knRJJ-0004qz-AI for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 14:09:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1knRJG-0004Xa-4C for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 14:09:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <452A6049-893A-4E7E-8349-541D276FAD19@gmail.com> Resent-From: Howard Melman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Dec 2020 19:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160762731817422 (code B ref -1); Thu, 10 Dec 2020 19:09:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Dec 2020 19:08:38 +0000 Original-Received: from localhost ([127.0.0.1]:39295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1knRIs-0004Ww-Gv for submit@debbugs.gnu.org; Thu, 10 Dec 2020 14:08:38 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:56414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1knRIq-0004Wo-Nz for submit@debbugs.gnu.org; Thu, 10 Dec 2020 14:08:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knRIo-00004s-To for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 14:08:35 -0500 Original-Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:56864 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knRIn-0004jJ-3G for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 14:08:34 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1knRIe-0007lv-8e for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 20:08:24 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:195687 Archived-At: "Paul W. Rankin" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > On 2020-11-27 18:29, Juri Linkov wrote: >> I wonder why heading cycling implemented in this bug >> report supports only `outline-mode', but not >> `outline-minor-mode'? It would make sense in >> `outline-minor-mode' if TAB typed on a heading then cycle >> outline heading. If TAB is typed outside of a heading, >> then use the default TAB binding, e.g. in case of the >> Help buffer navigate to the next link. > > This is because it's not possible to know how the underlying major > mode implements TAB. > > For just one example, I maintain a major mode where TAB performs > outline cycling when at a heading, but calls completion-at-point when > at a heading but at eolp. The assumption of outline-on-heading-p is > insufficient to allow outline-minor-mode to hijack TAB. > > The correct way to implement what you're suggesting is for the major > mode to require outline as a library, then alias the cycling commands > prefixed as MODE-outline-cycle[-buffer] mapped them to TAB/S-TAB in > their own keymaps. I don't follow master so I'm not quite sure what's implemented, but my original suggestion for this was: (define-key outline-minor-mode-map (kbd "C-") 'outline-cycle) (define-key outline-minor-mode-map (kbd "S-") 'outline-global-cycle) It's definitely very useful in outline-minor-mode. I use this for code folding in prog-modes amongst other things and that's one of the reasons I used C-TAB for outline-cycle (since TAB often has other uses in prog-modes). AFAIR people commented that C-TAB wasn't always available in some terminals and said it should just be on TAB. Fine. Either way S-TAB should work. I'd argue that if you're enabling outline-minor-mode in a major mode that has a binding for TAB, you want it to be overridden. If not, don't enable the minor mode or change one keymap to not conflict. Maybe outline-minor-mode should support a variable option a major mode could set to change the TAB keybinding or at least not override it with a minor-mode binding? -- Howard