From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#50679: 28.0.50; outline-minor-mode-cycle should be able to only cycle at the begining of a line Date: Tue, 21 Sep 2021 11:27:18 +0000 Message-ID: <87k0jatbhl.fsf@posteo.net> References: <87r1dkv8i2.fsf@posteo.net> <87mto8h5hk.fsf@mail.linkov.net> <87mto8uwnu.fsf@posteo.net> <87fstzn2zw.fsf@mail.linkov.net> <87y27rpi4q.fsf@mail.linkov.net> <87bl4nuuon.fsf@posteo.net> <87mto73xh5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8005"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50679@debbugs.gnu.org, Juri Linkov To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 21 13:28:15 2021 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 1mSdwd-0001hm-FM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Sep 2021 13:28:15 +0200 Original-Received: from localhost ([::1]:50198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSdwb-0003vC-Rl for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Sep 2021 07:28:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSdwQ-0003sB-RG for bug-gnu-emacs@gnu.org; Tue, 21 Sep 2021 07:28:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSdwQ-0004KZ-4y for bug-gnu-emacs@gnu.org; Tue, 21 Sep 2021 07:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mSdwQ-0001mZ-1w for bug-gnu-emacs@gnu.org; Tue, 21 Sep 2021 07:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Sep 2021 11:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50679 X-GNU-PR-Package: emacs Original-Received: via spool by 50679-submit@debbugs.gnu.org id=B50679.16322236496804 (code B ref 50679); Tue, 21 Sep 2021 11:28:02 +0000 Original-Received: (at 50679) by debbugs.gnu.org; 21 Sep 2021 11:27:29 +0000 Original-Received: from localhost ([127.0.0.1]:45088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSdvt-0001lg-EA for submit@debbugs.gnu.org; Tue, 21 Sep 2021 07:27:29 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:53873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSdvq-0001lO-9O for 50679@debbugs.gnu.org; Tue, 21 Sep 2021 07:27:27 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id BE75C240103 for <50679@debbugs.gnu.org>; Tue, 21 Sep 2021 13:27:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1632223639; bh=Fc0qGtgQihIECG9Ngrl1stF8br5M3gWcx+6efhh9hq4=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=qHc7ENgH4VndwJfwu+pd9LhQ0rKFmUqM2HqutrX0+TsZku70+7wSjWpuybtQgoJwc kCmSZrLxqC914o2FEmW3L8k2c+BDggOv9d3GHQJu1jl3Q1HqPmm5J8DH4NLj+q9Mv3 c1fauuIU7trQF/QvWqYtnLNCiRjqAkX8kkjbyZPIcnNytuMJCdv0lIUKzSztAhNKZg Z3dG9i9onTZMNcS7x9d3dgIyfzqqgKXgBt6CYDhtl63spHy+QIGS111Q/VzDOhnfkt z5qKoEzH1w+P8SucgKzD2vkSleOGJMTLdnrYDp4wyk5+32AZCyK0JlFjDbYDLspw+q d5tsDXEgvrX7Q== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HDK064w7wz9rxD; Tue, 21 Sep 2021 13:27:18 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: <87mto73xh5.fsf@gmail.com> (Augusto Stoffel's message of "Mon, 20 Sep 2021 20:36:54 +0200") 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:214953 Archived-At: Augusto Stoffel writes: > On Mon, 20 Sep 2021 at 15:35, Philip Kaludercic wrot= e: > >> Juri Linkov writes: >> >>>>> I didn't necessarily propose anything, it might only be able to solve >>>>> this using a option like >>>>> >>>>> (defcustom outline-minor-mode-cycle-predicate ...) >>>>> >>>>> as to allow for users to configure cycling as they see fit. Of course= if >>>>> some consistent behaviour could be found that respects other options = and >>>>> modes, then something automatic could also be used. >>>> >>>> Probably offloading the decision to the users with a customizable opti= on >>>> is all what we can do here, indeed. >>> >>> Maybe something like: >>> >>> (defvar outline-mode-cycle-map >>> (let ((map (make-sparse-keymap))) >>> (let ((tab-binding `(menu-item >>> "" outline-cycle >>> ;; Only takes effect if point is on a heading. >>> :filter ,(lambda (cmd) >>> - (when (outline-on-heading-p) cmd))= ))) >>> + (when (and (outline-on-heading-p) >>> + (or (not (functionp out= line-mode-cycle-filter)) >>> + (funcall outline-mo= de-cycle-filter))) >>> + cmd))))) >>> (define-key map (kbd "TAB") tab-binding) >>> (define-key map (kbd "") #'outline-cycle-buffer)) >>> map) >>> >>> Then you can customize it to 'bolp'. >> >> I just tried it out, and it looks good. The only thing I wonder is if >> this should apply to both outline-minor-mode and outline-mode? > > FWIW, I think it would be nice to provide a simple way to define other > =E2=80=9Cspeed keys=E2=80=9D in `outline-minor-mode [1], or even provide = some > pre-configured ones [2]. > > Looking at the code, it seems that adding bindings to > `outline-mode-cycle-map` would achieve precisely that, but the name > of the keymap doesn't reflect that. I would appreciate something like this too, but you are right that it sounds like a separate functionality. Compared to outline-mode-cycle-map, this would most certainly have to operate on the beginning of a line, otherwise apparently random keys would suddenly throw the user around without them expecting it. > [1]: Cf. https://orgmode.org/manual/Speed-Keys.html > > [2]: I personally use these speed keys in outline-minor-mode, which are > probably very similar to those from Org mode: > > "" 'outline-cycle > "" 'outline-cycle-buffer > "f" 'outline-forward-same-level > "b" 'outline-backward-same-level > "n" 'outline-next-visible-heading > "p" 'outline-previous-visible-heading > "u" 'outline-up-heading > "F" 'outline-move-subtree-down > "B" 'outline-move-subtree-up > "@" 'outline-mark-subtree --=20 Philip Kaludercic