Gnus development mailing list
 help / color / mirror / Atom feed
From: Dave <gnu.org@niwas.net>
To: ding@gnus.org
Subject: Re: gnus & (windmove-default-keybindings)
Date: Thu, 10 Dec 2015 00:40:14 -0800	[thread overview]
Message-ID: <56693A6E.3080708@niwas.net> (raw)
In-Reply-To: <87vb8d3tid.fsf@ucl.ac.uk>

On 12/05/2015 05:38 AM, Eric S Fraga wrote:
> On Saturday,  5 Dec 2015 at 00:44, Dave wrote:
>>> I've turned on:
>>> (windmove-default-keybindings 'meta)
>>>
>>> which allows sane keys for moving between windows (M-<up>, M-<dn>,
>>> M-<rt>, M-<lft>).  All works well, except for the article summary buffer
>>> in Gnus, which treats M-<up> and M-<dn> as <up> and <dn>.  (Though
>>> M-<rt> and M-<lft> behave properly.)
>>
>> I should add that the command (windmove-down) works fine.  It's just the
>> bound key that fails.  Additionally, using global-set-key to
>> specifically set the binding also fails.
>>
>>> Can anyone give me some pointers of how to proceed?
> 
> You could set up a hook for the individual gnus views (group, summary)
> to bind M-<up> and M-<down> to the corresponding windmove commands,
> along the lines of
> 
> #+begin_src emacs-lisp
>   ;; From: pmlists@free.fr (Peter Münster)
>   ;; Newsgroups: gnu.emacs.gnus
>   ;; Message-ID: <87lj1wkv2q.fsf@micropit.couberia.bzh>
>   (defun esf/alter-summary-map ()
>     (local-set-key ":" 'bbdb-mua-display-records)
>     (local-set-key "d" 'gnus-summary-delete-article)
>     (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
> 
> HTH,
> eric

Much appreciated, Eric.  This works:

(defun windmove-summary-map ()
  (local-set-key [(meta up)] 'windmove-up)
  (local-set-key [(meta down)] 'windmove-down)
  )
(add-hook 'gnus-summary-mode-hook 'windmove-summary-map)

I guess there must be something in the local key map that was overriding
the global-set-key

Dave.




      reply	other threads:[~2015-12-10  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-05  8:31 Dave
2015-12-05  8:44 ` Dave
2015-12-05 13:38   ` Eric S Fraga
2015-12-10  8:40     ` Dave [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56693A6E.3080708@niwas.net \
    --to=gnu.org@niwas.net \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).