Discussion:
remapping 'S' in summary-mode-map does not stick
Eric S Fraga
2014-09-10 07:40:46 UTC
Permalink
Hello,
I remap several key bindings for gnus-summary-mode-map and most of them
work, with one exception: binding 'S'.
(define-key gnus-summary-mode-map (kbd "S") 'gnus-summary-next-article)
I could set that binding in gnus-summary-mode-hook, but it bothers me to
set is every time I enter summary mode and not once and for all.
The reality is that this is the only way to do it, as far as I
understand. I remap my keys in mode hooks for summary and article
modes. For instance:

#+begin_src emacs-lisp
(defun esf/alter-summary-map ()
(local-set-key "d" 'gnus-summary-delete-article)
(local-set-key "d" 'gnus-summary-expand-window)
(local-set-key "e" 'gnus-summary-mark-as-expirable)
(local-set-key "u" 'gnus-summary-put-mark-as-unread) ;-next-unread
(local-set-key "w" 'gnus-article-fill-long-lines)
)
(add-hook 'gnus-summary-mode-hook 'esf/alter-summary-map)
#+end_src
--
: Eric S Fraga, GnuPG: 0xFFFCF67D
: in Emacs 24.4.50.1 + Ma Gnus v0.12 + evil-git-7c4c180
: BBDB version 3.1.2 (2014-05-06 11:45:08 -0500)
Alan Schmitt
2014-09-10 12:21:10 UTC
Permalink
Post by Eric S Fraga
I could set that binding in gnus-summary-mode-hook, but it bothers me to
set is every time I enter summary mode and not once and for all.
The reality is that this is the only way to do it, as far as I
understand. I remap my keys in mode hooks for summary and article
#+begin_src emacs-lisp
(defun esf/alter-summary-map ()
(local-set-key "d" 'gnus-summary-delete-article)
(local-set-key "d" 'gnus-summary-expand-window)
(local-set-key "e" 'gnus-summary-mark-as-expirable)
(local-set-key "u" 'gnus-summary-put-mark-as-unread) ;-next-unread
(local-set-key "w" 'gnus-article-fill-long-lines)
)
(add-hook 'gnus-summary-mode-hook 'esf/alter-summary-map)
#+end_src
Thank you for this suggestion. I was using an anonymous function, but
it's much cleaner with a named one.

Alan
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
Loading...