unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41438: [PATCH] Allow windmove keys to be bound without prefix or modifiers
@ 2020-05-21 16:56 Philip K.
  2020-05-21 22:18 ` Juri Linkov
  2020-06-26 19:46 ` Philip K.
  0 siblings, 2 replies; 59+ messages in thread
From: Philip K. @ 2020-05-21 16:56 UTC (permalink / raw)
  To: 41438

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]


Hi,

I'm probably not the only one who tends to use C-{f,b,n,p} over the
arrow keys, but also sometimes gets annoyed by navigating windows. I
recently realised that the reason I didn't use windmove as much as I
would want to, was that I coudln't find a satisfying modifier-key. My
idea was then to try windmove without any modifier, and I quite like
it. The only "annoying" thing is that I have to bind all keys
manually, instead of using a function like
`windmove-default-keybindings', because `nil' is interpreted as a
default binding.

This patch adds a pseudo-modifier (`none') to allow bindings the
windmove functions without any real modifier or prefix key, depending on
the function.

--

Another question I'd like to ask before trying it out: Would there be
any interest in adding user options for the "default" modifiers that
windmove should use? If yes, one could add a :set function that
automatically calls the apropriate bindings function, when it's value
is non-nil. I have a very customize-centric configuration, where something
this would fit in very well.

-- 
	Philip K.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Allow-windmove-keys-to-be-bound-without-prefix-or-mo.patch --]
[-- Type: text/x-diff, Size: 3810 bytes --]

From 0fb951817fc11983498052f2a4fdb8815bc89b92 Mon Sep 17 00:00:00 2001
From: Philip K <philip@warpmail.net>
Date: Thu, 21 May 2020 18:44:10 +0200
Subject: [PATCH] Allow windmove keys to be bound without prefix or modifiers

---
 lisp/windmove.el | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/lisp/windmove.el b/lisp/windmove.el
index f96383197b..3d7f86b9af 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -431,9 +431,12 @@ windmove-default-keybindings
   "Set up keybindings for `windmove'.
 Keybindings are of the form MODIFIERS-{left,right,up,down},
 where MODIFIERS is either a list of modifiers or a single modifier.
+If MODIFIERS is `none', the keybindings will be directly bound to
+the arrow keys.
 Default value of MODIFIERS is `shift'."
   (interactive)
   (unless modifiers (setq modifiers 'shift))
+  (when (eq modifiers 'none) (setq modifiers nil))
   (unless (listp modifiers) (setq modifiers (list modifiers)))
   (global-set-key (vector (append modifiers '(left)))  'windmove-left)
   (global-set-key (vector (append modifiers '(right))) 'windmove-right)
@@ -568,9 +571,12 @@ windmove-display-default-keybindings
 Keys are bound to commands that display the next buffer in the specified
 direction.  Keybindings are of the form MODIFIERS-{left,right,up,down},
 where MODIFIERS is either a list of modifiers or a single modifier.
+If MODIFIERS is `none', the keybindings will be directly bound to
+the arrow keys.
 Default value of MODIFIERS is `shift-meta'."
   (interactive)
   (unless modifiers (setq modifiers '(shift meta)))
+  (when (eq modifiers 'none) (setq modifiers nil))
   (unless (listp modifiers) (setq modifiers (list modifiers)))
   (global-set-key (vector (append modifiers '(left)))  'windmove-display-left)
   (global-set-key (vector (append modifiers '(right))) 'windmove-display-right)
@@ -640,11 +646,16 @@ windmove-delete-default-keybindings
 Keys are bound to commands that delete windows in the specified
 direction.  Keybindings are of the form PREFIX MODIFIERS-{left,right,up,down},
 where PREFIX is a prefix key and MODIFIERS is either a list of modifiers or
-a single modifier.  Default value of PREFIX is `C-x' and MODIFIERS is `shift'."
+a single modifier.
+If PREFIX is `none', no prefix is used. If MODIFIERS is `none', the keybindings
+are directly bound to the arrow keys.
+Default value of PREFIX is `C-x' and MODIFIERS is `shift'."
   (interactive)
   (unless prefix (setq prefix '(?\C-x)))
+  (when (eq prefix 'none) (setq prefix nil))
   (unless (listp prefix) (setq prefix (list prefix)))
   (unless modifiers (setq modifiers '(shift)))
+  (when (eq modifiers 'none) (setq modifiers nil))
   (unless (listp modifiers) (setq modifiers (list modifiers)))
   (global-set-key (vector prefix (append modifiers '(left)))  'windmove-delete-left)
   (global-set-key (vector prefix (append modifiers '(right))) 'windmove-delete-right)
@@ -695,9 +706,13 @@ windmove-swap-states-default-keybindings
 Keys are bound to commands that swap the states of the selected window
 with the window in the specified direction.  Keybindings are of the form
 MODIFIERS-{left,right,up,down}, where MODIFIERS is either a list of modifiers
-or a single modifier.  Default value of MODIFIERS is `shift-super'."
+or a single modifier.
+If MODIFIERS is `none', the keybindings will be directly bound to the
+arrow keys.
+Default value of MODIFIERS is `shift-super'."
   (interactive)
   (unless modifiers (setq modifiers '(shift super)))
+  (when (eq modifiers 'none) (setq modifiers nil))
   (unless (listp modifiers) (setq modifiers (list modifiers)))
   (global-set-key (vector (append modifiers '(left)))  'windmove-swap-states-left)
   (global-set-key (vector (append modifiers '(right))) 'windmove-swap-states-right)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 59+ messages in thread
* bug#42611: 26.3; edit-abbrevs lets me type and commit, but doesn't store anywhere and abbrevs don't work
@ 2020-07-30  4:01 Brett Randall
       [not found] ` <handler.42611.B.159608273314264.ack@debbugs.gnu.org>
  2020-10-17  8:41 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 59+ messages in thread
From: Brett Randall @ 2020-07-30  4:01 UTC (permalink / raw)
  To: 42611

[-- Attachment #1: Type: text/plain, Size: 4444 bytes --]

Actions that triggered the bug:


M-x edit-abbrevs


Enter abbrevs in fundamental or global abbreviations at bottom of the list, e.g.:


"dfn" 0 "definition"


C-c C-c


Buffer appears committed (modified flag disappears). Close buffer, test the abbrev in "abbrev-mode" minor mode and nothing happens. M-x edit-abbrevs again. The definition I entered is no longer there. This is in the same session. Emacs was not closed/reopened. The definitions are not applying/temporarily saving.


In GNU Emacs 26.3 (build 1, x86_64-pc-cygwin)
of 2019-08-31 built on moufang2
Repository revision: 522486e90a3d9402d836c2186be9e73299423cd9
Windowing system distributor 'Microsoft Corp.', version 10.0.19041
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit
(New file)
Making completion list...
Abbrev mode enabled in current buffer
Saving all Org buffers... done


Configured using:
'configure
--srcdir=/home/kbrown/src/cygpackages/emacs/emacs-26.3-2.x86_64/src/emacs-26.3
--prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc
--docdir=/usr/share/doc/emacs --htmldir=/usr/share/doc/emacs/html -C
--with-w32 'CFLAGS=-ggdb -O2 -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong
--param=ssp-buffer-size=4
-fdebug-prefix-map=/home/kbrown/src/cygpackages/emacs/emacs-26.3-2.x86_64/build=/usr/src/debug/emacs-26.3-2
-fdebug-prefix-map=/home/kbrown/src/cygpackages/emacs/emacs-26.3-2.x86_64/src/emacs-26.3=/usr/src/debug/emacs-26.3-2'
CPPFLAGS= LDFLAGS='


Configured features:
XPM JPEG TIFF GIF PNG IMAGEMAGICK SOUND DBUS GLIB NOTIFY ACL GNUTLS
LIBXML2 ZLIB TOOLKIT_SCROLL_BARS XIM THREADS LCMS2


Important settings:
locale-coding-system: nil


Major mode: Info


Minor modes in effect:
global-auto-revert-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t


Load-path shadows:
None found.


Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils jka-compr info elec-pair org-element avl-tree generator org
org-macro org-footnote org-pcomplete pcomplete org-list org-faces
org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob
ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint comint
ansi-color ring ob-core ob-eval org-compat org-macs org-loaddefs
format-spec find-func cal-menu calendar cal-loaddefs edmacro kmacro
advice autorevert filenotify arjen-theme finder-inf package easymenu
epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel disp-table
term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind gfilenotify w32 lcms2 multi-tty
make-network-process emacs)


Memory information:
((conses 16 165726 13709)
(symbols 48 27132 1)
(miscs 40 72 220)
(strings 32 55598 1442)
(string-bytes 1 1610203)
(vectors 16 22900)
(vector-slots 8 589906 9136)
(floats 8 97 210)
(intervals 56 320 176)
(buffers 992 16))

Brett

[-- Attachment #2: Type: text/html, Size: 6111 bytes --]

^ permalink raw reply	[flat|nested] 59+ messages in thread
* bug#35367: 26.2; `dired-copy-how-to-fn' and HOW-TO arg of `dired-create-files'
@ 2019-04-21 19:30 Drew Adams
  2019-07-09 14:21 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 59+ messages in thread
From: Drew Adams @ 2019-04-21 19:30 UTC (permalink / raw)
  To: 35367

1. I believe `dired-copy-how-to-fn' was added to Emacs quite a while ago
   (1991[1]).  But it's not clear to me what it's really for, and there
   seem to be no uses of it in the distributed Emacs code, apart from
   `dired-do-copy', which just passes it on to `dired-create-files'.
   The variable's doc just says to "See HOW-TO argument for
   `dired-create-files'."

   So why was this variable created?

2. Apart from the variable, why was the HOW-TO arg of
   `dired-do-create-files' added?  I find no uses of it, apart from
   `dired-do-copy' (which just passes it along).

   Presumably someone thought that someone might want to pass such a
   thing to `dired-do-copy', but why?

   Half the doc of `dired-do-create-files' is for this parameter.  And
   its description, although probably correct and complete, reads like
   gobbledygook, to me.

   For one thing, the nil case should not be described under this
   parameter; it should be described as the function's default behavior,
   up above the parameter list.  (That's already 4 lines of its
   description.)

   Beyond that:

   * A value of `t' is unclear to me.  What does it mean to target a
     plain file - is this the same as using a `nil' value?  What happens
     with `t' if the target is a directory or if there are multiple
     marked files?  Is that where the difference lies somehow (how)?

   * A unary function value is the most confusing.  I can't follow it,
     I'm afraid.

   If HOW-TO is to stay (and I assume it is) then we really need some
   kind of motivating explanation - perhaps an example of why/when/how
   you would use a function here.  With no existing examples in the code
   this seems a bit
   maybe-someone-someday-might-need-this-thing-that-somebody-dreamed.

   It was apparently RMS who added this [1].  I'm surprised that it's
   not more clear what good it is.

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25075#20


In GNU Emacs 26.2 (build 1, x86_64-w64-mingw32)
 of 2019-04-13
Repository revision: fd1b34bfba8f3f6298df47c8e10b61530426f749
Windowing system distributor `Microsoft Corp.', version 10.0.17134
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





^ permalink raw reply	[flat|nested] 59+ messages in thread
[parent not found: <Your>]

end of thread, other threads:[~2022-01-22 14:43 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-21 16:56 bug#41438: [PATCH] Allow windmove keys to be bound without prefix or modifiers Philip K.
2020-05-21 22:18 ` Juri Linkov
2020-05-22 18:26   ` Philip K.
     [not found]   ` <(message>
     [not found]     ` <from>
     [not found]       ` <Juri>
     [not found]         ` <Linkov>
     [not found]           ` <on>
     [not found]             ` <Fri>
     [not found]               ` <22>
     [not found]                 ` <May>
     [not found]                   ` <2020>
     [not found]                     ` <04:01:05>
     [not found]                     ` <01:18:18>
     [not found]                       ` <+0300)>
     [not found]                         ` <87v9kn7rnk.fsf@bulbul>
2020-05-22 19:15                           ` Drew Adams
2020-05-23 22:12                           ` Juri Linkov
2020-06-26 19:46 ` Philip K.
2020-06-27 23:53   ` Juri Linkov
2020-06-28  8:30     ` Philip K.
2020-06-28 23:37       ` Juri Linkov
2020-08-05 18:05         ` Lars Ingebrigtsen
2020-08-05 23:40           ` Juri Linkov
2020-08-06  9:28             ` Philip K.
2020-08-06 23:43               ` Juri Linkov
2020-08-07 10:53                 ` Philip K.
2020-08-08 23:54                   ` Juri Linkov
2021-05-12 20:38                   ` Lars Ingebrigtsen
2021-05-12 21:27                     ` Philip Kaludercic
2021-05-22 20:29                     ` Philip Kaludercic
2021-05-22 21:09                       ` Philip Kaludercic
2021-05-23  6:49                         ` Eli Zaretskii
2021-05-23 12:36                           ` Philip Kaludercic
2021-05-25  5:12                       ` Lars Ingebrigtsen
2021-05-25  7:25                         ` Philip Kaludercic
2021-05-25  9:53                         ` Philip Kaludercic
2021-05-25 11:16                           ` Arthur Miller
2021-05-25 11:42                             ` Philip Kaludercic
2021-05-25 13:31                               ` Arthur Miller
2021-05-25 14:39                                 ` Philip Kaludercic
2021-05-25 11:36                           ` Arthur Miller
2021-05-25 11:46                             ` Philip Kaludercic
2021-05-25 13:58                               ` Arthur Miller
2021-05-25 19:13                             ` Lars Ingebrigtsen
2021-05-25 19:16                           ` Lars Ingebrigtsen
2021-05-25 19:25                             ` Philip Kaludercic
2021-05-25 20:18                           ` Juri Linkov
2021-05-25 21:45                             ` Philip Kaludercic
2021-05-26 21:35                               ` Juri Linkov
2021-05-27 11:09                                 ` Philip Kaludercic
2021-05-30 22:11                                   ` Juri Linkov
2021-05-31  8:50                                     ` Philip Kaludercic
2021-05-31 20:15                                       ` Juri Linkov
2021-05-31 21:27                                         ` Philip Kaludercic
2021-06-03 20:36                                           ` Juri Linkov
  -- strict thread matches above, loose matches on Subject: below --
2020-07-30  4:01 bug#42611: 26.3; edit-abbrevs lets me type and commit, but doesn't store anywhere and abbrevs don't work Brett Randall
     [not found] ` <handler.42611.B.159608273314264.ack@debbugs.gnu.org>
     [not found]   ` <(Brett>
2020-10-17  8:41 ` Lars Ingebrigtsen
2020-10-27 10:36   ` brett.randall
     [not found]     ` <(brett>
     [not found]       ` <randall's>
     [not found]         ` <"Tue,>
     [not found]           ` <27>
     [not found]             ` <Oct>
2020-10-27 10:43     ` Lars Ingebrigtsen
2020-10-27 10:49       ` Brett Randall
2020-10-27 11:08         ` Lars Ingebrigtsen
     [not found]           ` <(Lars>
     [not found]             ` <Ingebrigtsen's>
     [not found]               ` <12:08:50>
2020-10-27 11:19           ` bug#42611: (no subject) Lars Ingebrigtsen
     [not found]             ` <877drbhq6c.fsf@gnus.org>
     [not found]               ` <handler.42611.C.160379757411378.notifdonectrl.0@debbugs.gnu.org>
2020-10-27 22:22                 ` bug#42611: 26.3; edit-abbrevs lets me type and commit, but doesn't store anywhere and abbrevs don't work Brett Randall
2019-04-21 19:30 bug#35367: 26.2; `dired-copy-how-to-fn' and HOW-TO arg of `dired-create-files' Drew Adams
2019-07-09 14:21 ` Lars Ingebrigtsen
2019-07-11  5:51   ` Mike Kupfer
2019-07-11 14:04     ` Lars Ingebrigtsen
2019-07-11 14:18     ` Drew Adams
2019-07-12  3:20       ` Mike Kupfer
2019-07-12  3:33         ` Drew Adams
2022-01-22 14:43     ` Lars Ingebrigtsen
     [not found] <Your>
     [not found] ` <message>
     [not found]   ` <of>
     [not found]     ` <"Thu,>
     [not found]     ` <"Thu>
     [not found]     ` <"Tue>
     [not found]       ` <09>
     [not found]         ` <Jul>
     [not found]           ` <2019>
     [not found]             ` <16:21:24>
     [not found]             ` <07:18:26>

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).