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#47878: Mark outline commands as repeatable Date: Wed, 21 Apr 2021 20:50:59 +0000 Message-ID: <87k0ovuzt8.fsf@posteo.net> References: <87blabpge6.fsf@posteo.net> <87y2dej95u.fsf@mail.linkov.net> <87y2dbagmf.fsf@posteo.net> <87r1j3h37d.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21852"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47878@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 21 22:52:11 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 1lZJpS-0005Yt-J0 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Apr 2021 22:52:10 +0200 Original-Received: from localhost ([::1]:44344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZJpR-00007Q-MO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Apr 2021 16:52:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZJpJ-00007G-UK for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2021 16:52:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZJpJ-0007G9-Ml for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2021 16:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lZJpJ-0004Lc-LA for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2021 16:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Apr 2021 20:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47878 X-GNU-PR-Package: emacs Original-Received: via spool by 47878-submit@debbugs.gnu.org id=B47878.161903827416654 (code B ref 47878); Wed, 21 Apr 2021 20:52:01 +0000 Original-Received: (at 47878) by debbugs.gnu.org; 21 Apr 2021 20:51:14 +0000 Original-Received: from localhost ([127.0.0.1]:59926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZJoY-0004KY-2K for submit@debbugs.gnu.org; Wed, 21 Apr 2021 16:51:14 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:44349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZJoS-0004Jy-0H for 47878@debbugs.gnu.org; Wed, 21 Apr 2021 16:51:12 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id A9693240026 for <47878@debbugs.gnu.org>; Wed, 21 Apr 2021 22:51:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1619038260; bh=CN4wYFvevq01wTTKmIwRNjdMEJhgujMm/CQDLNrgqi0=; h=From:To:Cc:Subject:Date:From; b=h1sAx/BWah6degWZTATUZdVwhi7OXdAow8elD2TYzIlNX4azuyG4X051PZQsd6jb2 44HcJqdXT4Vp6tc+7oPU2S8qw/pPJhpN0KJBgLs1QzXrvhynSVRlg7+KcKP26hZNXM VyinRQQR9cD9E0ekqzlBLpM0WtJUv9zXMoyN1dxfebEPBik9FSdkNOHl5F1XzN2UiI F3hCL/kXAsiC3wPMLunxq551yaGBULRv1AF4slQijGcp7AXi3WWA4F0kHdXo+FR9EV /tHhpSkBhVOg2C0zE0jnCf/CyXxO4Pou6V+ZMeKPCcPpg8FZMIku4Iu+pgzUZrapVL T0zGulKVcabXA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FQXl76Pc3z9rxL; Wed, 21 Apr 2021 22:50:59 +0200 (CEST) In-Reply-To: <87r1j3h37d.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 21 Apr 2021 22:20:27 +0300") 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:204660 Archived-At: --=-=-= Content-Type: text/plain Juri Linkov writes: >> I am not sure if these two maps are necessarily detached. When I want to >> move a few subtrees, it might be natural for me to assume that I can >> also move between them without having to invoke C-x @ ... again. > > Ok, let's put navigation and editing keys into one repeatable keymap > (maybe without outline-insert-heading and outline-mark-subtree). > >> That makes sense, I just found out about outline-minor-mode-cycle and it >> probably does make these keys superfluous for most uses. Removing these >> keys seems to also open up a lot of key bindings that would otherwise >> maybe annoy users if they are bound in transient maps (especially C-a, >> C-e, C-k, C-s, C-c). > > Indeed, these are among the most frequently used keys. I've implemented your suggestions. Letting the editing map inherit from the navigation map doesn't seem like a good idea, as long as repeat-mode overwrites the repeat-map, because that makes commands disappear all of a sudden. The extra keys without control are convenient, but it does write a lot into the mini-buffer. -- Philip K. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Make-outline-commands-repeatable.patch >From df388bbf31f7970fe38190503b20eb60e944e131 Mon Sep 17 00:00:00 2001 From: Philip K Date: Wed, 21 Apr 2021 22:17:27 +0200 Subject: [PATCH] Make outline commands repeatable * outline.el (outline-navigation-repeat-map): Add new map (outline-editing-repeat-map): Add new map --- lisp/outline.el | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/lisp/outline.el b/lisp/outline.el index bce9c6b9e4..fa7c1a27d9 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1274,6 +1274,45 @@ outline-cycle-buffer (setq outline--cycle-buffer-state 'show-all) (message "Show all"))))) +(defvar outline-navigation-repeat-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-b") #'outline-backward-same-level) + (define-key map (kbd "b") #'outline-backward-same-level) + (define-key map (kbd "C-f") #'outline-forward-same-level) + (define-key map (kbd "f") #'outline-forward-same-level) + (define-key map (kbd "C-n") #'outline-next-visible-heading) + (define-key map (kbd "n") #'outline-next-visible-heading) + (define-key map (kbd "C-p") #'outline-previous-visible-heading) + (define-key map (kbd "p") #'outline-previous-visible-heading) + (define-key map (kbd "C-u") #'outline-up-heading) + (define-key map (kbd "u") #'outline-up-heading) + map)) + +(dolist (command '(outline-backward-same-level + outline-forward-same-level + outline-next-visible-heading + outline-previous-visible-heading + outline-up-heading)) + (put command 'repeat-map 'outline-navigation-repeat-map)) + +(defvar outline-editing-repeat-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-v") #'outline-move-subtree-down) + (define-key map (kbd "v") #'outline-move-subtree-down) + (define-key map (kbd "C-^") #'outline-move-subtree-up) + (define-key map (kbd "^") #'outline-move-subtree-up) + (define-key map (kbd "C->") #'outline-demote) + (define-key map (kbd ">") #'outline-demote) + (define-key map (kbd "C-<") #'outline-promote) + (define-key map (kbd "<") #'outline-promote) + map)) + +(dolist (command '(outline-move-subtree-down + outline-move-subtree-up + outline-demote + outline-promote)) + (put command 'repeat-map 'outline-editing-repeat-map)) + (provide 'outline) (provide 'noutline) -- 2.30.2 --=-=-=--