summaryrefslogtreecommitdiff
path: root/helm-imenu.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2019-07-12 18:53:59 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2019-07-12 18:53:59 +0200
commit60466004daf894fb390b07f9ff8d4d9283a395ef (patch)
treedfb97086e10591c75e5ef587da5ecf31619b8dbd /helm-imenu.el
parentb17339db4fe3b8c81dfb2faae8f71fa523929fb7 (diff)
Change default bindings for right and left
* helm-files.el (helm-ff-lynx-style-map): Do it. * helm-imenu.el (helm-imenu-lynx-style-map): Do it. * helm-semantic.el (helm-semantic-lynx-style-map): Do it. * helm.el (helm-map): Do it.
Diffstat (limited to 'helm-imenu.el')
-rw-r--r--helm-imenu.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/helm-imenu.el b/helm-imenu.el
index daacfb04..5d41caf3 100644
--- a/helm-imenu.el
+++ b/helm-imenu.el
@@ -40,11 +40,6 @@
:group 'helm-imenu
:type 'function)
-(defcustom helm-imenu-lynx-style-map t
- "Use Arrow keys to jump to occurences."
- :group 'helm-imenu
- :type 'boolean)
-
(defcustom helm-imenu-all-buffer-assoc nil
"Major mode association alist for `helm-imenu-in-all-buffers'.
Allow `helm-imenu-in-all-buffers' searching in these associated buffers
@@ -92,12 +87,20 @@ Each car is a regexp match pattern of the imenu type string."
(set-keymap-parent map helm-map)
(define-key map (kbd "M-<down>") 'helm-imenu-next-section)
(define-key map (kbd "M-<up>") 'helm-imenu-previous-section)
- (when helm-imenu-lynx-style-map
- (define-key map (kbd "<left>") 'helm-maybe-exit-minibuffer)
- (define-key map (kbd "<right>") 'helm-execute-persistent-action)
- (define-key map (kbd "M-<left>") 'helm-previous-source)
- (define-key map (kbd "M-<right>") 'helm-next-source))
- (delq nil map)))
+ map))
+
+(defcustom helm-imenu-lynx-style-map nil
+ "Use Arrow keys to jump to occurences."
+ :group 'helm-imenu
+ :type 'boolean
+ :set (lambda (var val)
+ (set var val)
+ (if val
+ (progn
+ (define-key helm-imenu-map (kbd "<right>") 'helm-execute-persistent-action)
+ (define-key helm-imenu-map (kbd "<left>") 'helm-maybe-exit-minibuffer))
+ (define-key helm-imenu-map (kbd "<right>") nil)
+ (define-key helm-imenu-map (kbd "<left>") nil))))
(defun helm-imenu-next-or-previous-section (n)
(with-helm-buffer