From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel 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: Mon, 20 Sep 2021 20:36:54 +0200 Message-ID: <87mto73xh5.fsf@gmail.com> 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> 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="16156"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 50679@debbugs.gnu.org, Juri Linkov To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 20 20:38:24 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 1mSOBL-00040K-S1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Sep 2021 20:38:23 +0200 Original-Received: from localhost ([::1]:32822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSOBK-000736-1E for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Sep 2021 14:38:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSOB0-00072h-LG for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 14:38:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSOB0-0006zy-D3 for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 14:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mSOB0-000891-7k for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 14:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Sep 2021 18:38: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.163216302331211 (code B ref 50679); Mon, 20 Sep 2021 18:38:02 +0000 Original-Received: (at 50679) by debbugs.gnu.org; 20 Sep 2021 18:37:03 +0000 Original-Received: from localhost ([127.0.0.1]:44013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSOA3-00087L-Ff for submit@debbugs.gnu.org; Mon, 20 Sep 2021 14:37:03 -0400 Original-Received: from mail-wr1-f47.google.com ([209.85.221.47]:38594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSOA2-00086m-4U for 50679@debbugs.gnu.org; Mon, 20 Sep 2021 14:37:02 -0400 Original-Received: by mail-wr1-f47.google.com with SMTP id u18so30676554wrg.5 for <50679@debbugs.gnu.org>; Mon, 20 Sep 2021 11:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=YPbytUYo+GucrkEnWPAtgKj1fwMSqiPDRAuaqECNQUc=; b=QyAPQ3RKfTj6pbSB/rp/QmYzz2Fn6WLd/zzRmFq7eylrQKxnutsd/AbmnyVVIU4wM9 eMdpLl0XPRnZUI0ZmSBzlCOyCpyj5ryHPPZ38uWOA7rcG97MzjLiEhm2lGdhuweudEM+ +Na/b6ENtus5gWNaE3Tg/r9lY//Yyp8fAHhDpnRPAjIBOT9fqNdj4oJA/AX4E2ywHZWN Ffp2S0XHLgmX0tNU2LddMAbYMvHyzNWfVNiRqAwSGGzoff4KaiacIZUYkiDb6LlGxp2g 1A/s351TOazTH6XCWmp8/+BFMiQMYfyIpzsJL77Z6gvsETfJcwe4bhUagmzDaNTbK71C xYsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=YPbytUYo+GucrkEnWPAtgKj1fwMSqiPDRAuaqECNQUc=; b=vZafzlutcNVOcH64DzkmxMqPR4MZSggVVrfbddIutfUTOCRYHT82QT/x788T+aEYLy +p4huc9K5fGx8ihBzSvNwaIXIUVohQU2a+e5iNlq3AMUU18Le3MQRuDpC8wl08RYbCp3 fc0hV/KtGdUzdDMkrNPUvSt/F0A8dh/fKvXkP8SH+J6dtsDutZlXhQ245DkYg7rW2YU2 7aRDe0oZUwWhTxSA1/OTQ+PV3OXJQiHT/68A2vHnsuyRePMIP4g/FNudTWtS/8N0j9Pl CIefnyitWdJDmT1Z/ns4h+MlbhnDqpn8ce67i3mnb4E1udoZRyU068ze1Yhhl3Io1x0b 7jHw== X-Gm-Message-State: AOAM532RQ/7CAFkTKzNXc5D50nSg6A39FBlVLlZTLqw/OBgEGPaKTOaU uNObRZU1DFHAvXEYru6fOMLBNp17sro= X-Google-Smtp-Source: ABdhPJyQaGRCRoSRTnjsK1IHUGuExsG1zjt/gaXso7kkVQQ38yhex/tqhTVcwcS5QcKVS7OS2U4fWQ== X-Received: by 2002:a5d:43d2:: with SMTP id v18mr30288199wrr.98.1632163015816; Mon, 20 Sep 2021 11:36:55 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::2f72]) by smtp.gmail.com with ESMTPSA id v21sm11804185wrv.3.2021.09.20.11.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 11:36:55 -0700 (PDT) In-Reply-To: <87bl4nuuon.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 20 Sep 2021 15:35:04 +0000") 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:214880 Archived-At: On Mon, 20 Sep 2021 at 15:35, Philip Kaludercic wrote: > 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 a= nd >>>> modes, then something automatic could also be used. >>> >>> Probably offloading the decision to the users with a customizable option >>> 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 outl= ine-mode-cycle-filter)) >> + (funcall outline-mod= e-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 so= me 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. [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