Comments (8)
Jonas Bernoulli
[email protected]
writes:
Why is e.g.
helm-map
created by copyingminibuffer-local-map
instead of using the latter as a parent keymap?
This can maybe modified in future, but I have to be careful on this, as
helm keymap code is quite complex since I have introduced kind of local
map per source and commands.I have heavily modified the vanilla minibuffer-local maps
and this therefor means I have to duplicate all my customization.
So what is exactly the problem with your settings?
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
from helm.
uuh uhh. I already created a patch. I will push it to my fork but delay sending a pull request.
I doubt that properly using set-keymap-parent
would cause any problems though.
The problem is that copying a keymap instead of using it as a parent is almost always wrong. One doesn't even need to go crazy and heavily modify the builtin minibuffer maps. Currently if one makes a change in helm-map
this change does not propagate to any of the other maps. The only option is to restart Emacs. (Just loading helm-config.el
again does not work because defvar
does not change a variable which is already bound (which in turn is a good thing))
from helm.
Hi Jonas,
Jonas Bernoulli
[email protected]
writes:
uuh uhh. I already created a patch. I will push it to my fork but delay sending a pull request.
I doubt that properly using
set-keymap-parent
would cause any problems though.The problem is that copying a keymap instead of using it as a parent
is wrong in 99% of the time. One doesn't even need to go crazy and
heavily modify the builtin minibuffer maps. Currently if one makes a
change inhelm-map
this change does not propagate to any of the
other maps. The only option is to restart Emacs. (Just loading
helm-config.elagain does not work because
defvar` does not change a
variable which is already bound (which in turn is a good thing))
We don't want bindings in helm-map overhide bindings in
helm--map, but the contrary:
What is in helm--map should overhide what is in helm-map.
e.g
In helm-map ==> C-p' is bound to 'Dothis' In helm-<local>-map ==>
C-p' is bound to 'Dothat'
What I want when I use the source that use helm--map is `C-p'
bound to 'Dothat'.
With your patch, I think defining a key in the inherited keymap
helm--map that is already existing in parent helm-map doesn't
overhide it; It is not what is expected.
But maybe I am wrong, need to verify.
Thanks.
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
from helm.
set-keymap-parent
does what you want not what you think it does:
From elisp > 22.5 Inheritance and Keymaps
:
A keymap can inherit the bindings of another keymap, which we call the
"parent keymap". Such a keymap looks like this:
(keymap ELEMENTS... . PARENT-KEYMAP)
The effect is that this keymap inherits all the bindings of
PARENT-KEYMAP, whatever they may be at the time a key is looked up, but
can add to them or override them with ELEMENTS.
If you change the bindings in PARENT-KEYMAP using define-key
or
other key-binding functions, these changed bindings are visible in the
inheriting keymap, unless shadowed by the bindings made by ELEMENTS.
The converse is not true: if you use define-key
to change bindings in
the inheriting keymap, these changes are recorded in ELEMENTS, but have
no effect on PARENT-KEYMAP.
from helm.
Jonas Bernoulli
[email protected]
writes:
set-keymap-parent
does what you want not what you think it does:From
elisp > 22.5 Inheritance and Keymaps
:A keymap can inherit the bindings of another keymap, which we call the
"parent keymap". Such a keymap looks like this:(keymap ELEMENTS... . PARENT-KEYMAP)
The effect is that this keymap inherits all the bindings of
PARENT-KEYMAP, whatever they may be at the time a key is looked up, but
can add to them or override them with ELEMENTS.If you change the bindings in PARENT-KEYMAP using
define-key
or
other key-binding functions, these changed bindings are visible in the
inheriting keymap, unless shadowed by the bindings made by ELEMENTS.
The converse is not true: if you usedefine-key
to change bindings in
the inheriting keymap, these changes are recorded in ELEMENTS, but have
no effect on PARENT-KEYMAP.
Indeed, and that is the problem IMHO.
See inhelm-read-pattern-maybe' how local keymaps are modified. See e.g
helm-for-files' and see how the keymap is changed when you
change source.
Test your changes with two similar keys e.g C-n': Assign a Value in helm-map to
C-n' say helm-next-line' Assign a value in helm-find-files-map to
C-n' that is different from
the one you gave in help-map' say
helm-previous-line'.
Now when you use helm-find-files' what is
C-n' doing?
*next-line or *-previous-line?
This is what I want to verify before merging your changes.
Thanks.
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
from helm.
Okay I will look into it.
Anyways if it turns out that the existing code does not work as expected when using parent keymaps then it should be fixed (instead of not using parents). I will do that if it turns out that this is the case.
from helm.
Jonas Bernoulli
[email protected]
writes:
Okay I will look into it.
Anyways if it turns out that the existing code does not work as
expected when using parent keymaps then it should be fixed (instead of
not using parents). I will do that if it turns out that this is the
case.
After a quick test, your patch seems to work as expected.
I am going to merge it, we keep an eye on it, anyway we can revert the
changes later if some problem occur.
Thanks.
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
from helm.
This has been fixed. Closing.
from helm.
Related Issues (20)
- `helm--completing-read-default` seems to strip text properties HOT 3
- helm with a list of sources can only select candidates from the first source in the list HOT 2
- helm-echo-input-in-header-line UI bug. HOT 27
- Cannot pre-set 'follow attribute HOT 3
- Error with helm-core : Symbol’s function definition is void: def-edebug-elem-spec HOT 7
- follow-mode messes up Emacs' buffer-list, pseudo-randomized order of buffers on each Helm invocation. HOT 1
- :exit-function called with 'exact STATUS when completion-at-point called on already completed sole completion candidate HOT 9
- Emacs' "while-no-input" prevents discoverability/debugging of all Helm funcs invoked after "helm-update" HOT 7
- helm-source-in-buffer drops last entry when first pattern is negated HOT 3
- when annotation is used with completing-read, negating first pattern yields a "ghost" candidate at top HOT 7
- Endless loop in 'helm-fuzzy-default-highlight-match-1' HOT 4
- endless loop in 'helm-candidates-in-buffer-search-default-fn', re-search-forward HOT 1
- "helm-split-window-default-side 'other" and helm-always-two-windows HOT 3
- helm-find-files fails with invalid-function without-remote-files HOT 9
- helm-find-files-get-candidates is failing since helm-20240407.1400/ HOT 4
- helm-run-after-exit not passing the previous match keyword into next helm session, only if previous match is not result. HOT 9
- Helm buffers path format. Visual clutter. HOT 3
- helm-M-x-execute-command: Symbol’s function definition is void: \(setf\ set-buffer-modified-p\) HOT 4
- Extra space is inserted to helm completion in shell mode HOT 3
- Error msg "Key sequence M - m SPC h SPC d SPC m starts with non-prefix key" HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helm.