ergoemacs and w3m

36 views
Skip to first unread message

omni.ar...@gmail.com

unread,
Dec 8, 2014, 6:28:32 PM12/8/14
to ergo...@googlegroups.com
greetings.  I'm attempting to remap keys used in w3m but all my attempts are unsuccessful.  after some experimentation I tracked down the problem to ergoemacs: if i disable it all my remaps work just fine.  I googled a bit and found some very similar complaints from 2010 with regards to other modes while ergoemacs is active, and in the conversation the responders, Xah Lee and David, suggested some new patch solved the issue.  However I'm having this same issue, and the links they provide to the patches are no longer functioning.  I asked on #emacs and someone suggested I look at ergoemacs-theme-component, but after looking at that source I can't figure out how to use that to solve my problem.

Can someone help me figure out how to remap w3m keybindings without having to toss ergoemacs?

As an aside, I thought I saw in the source that ergoemacs attempts to rebind M-i and M-k to previous and next line, respectively, while in w3m-mode.  However this is not the case, those two keys invoke w3m-previous/next-anchor respectively, so there may be a bug in how ergoemacs interacts with w3m that you guys are unaware of.

here's a reference to the older threads I mentioned:
https://groups.google.com/forum/#!topic/ergoemacs/ZVtiEv1hgDc

and here's the relevant portion from my .emacs that does not work while ergoemacs is active:
(add-hook 'w3m-mode-hook
 (lambda()
  (define-key w3m-mode-map (kbd "M-i") 'w3m-scroll-down)
  (define-key w3m-mode-map (kbd "M-k") 'w3m-scroll-up)
))


any help is appreciated.

-Chandler

Nikolay Kudryavtsev

unread,
Dec 8, 2014, 6:56:26 PM12/8/14
to ergo...@googlegroups.com
Hello.

I remember suggesting this to you on #emacs, but have you tried using
ergoemacs-theme-component? Something like this:

(ergoemacs-theme-component ergoemacs-w3m ()
"w3m ergoemacs-mode theme component"
(when w3m-mode-hook
(define-key w3m-mode-map (kbd "M-i") 'w3m-scroll-down)
(define-key w3m-mode-map (kbd "M-k") 'w3m-scroll-up)))

(ergoemacs-require 'ergoemacs-w3m)

--
Best Regards,
Nikolay Kudryavtsev

Nikolay Kudryavtsev

unread,
Dec 8, 2014, 7:47:06 PM12/8/14
to ergo...@googlegroups.com
Decided to test that stuff. That theme component I've sent you works.
You can also remove when clause from it.

Just make sure you restart w3m after evaluating it.

omni.ar...@gmail.com

unread,
Dec 8, 2014, 9:09:23 PM12/8/14
to ergo...@googlegroups.com
that works perfectly!  I would have never figured this out on my own.  thanks for your help.

-Chandler

Matthew Fidler

unread,
Dec 9, 2014, 9:08:50 AM12/9/14
to ergo...@googlegroups.com
Thanks Nikolay

I don't use w3m Chandler, but I'm assuming that w3m uses w3m-previous/next-anchor for C-n and C-p, which are emacs' default keys for next and previous line.  ergoemacs-mode mirrors this for previous and next line.  In theory it makes many packages more compatible with ergoemacs-mode.


Matt


On Mon, Dec 8, 2014 at 8:09 PM, <omni.ar...@gmail.com> wrote:
that works perfectly!  I would have never figured this out on my own.  thanks for your help.

-Chandler

--
You received this message because you are subscribed to the Google Groups "ErgoEmacs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ergoemacs+...@googlegroups.com.
To post to this group, send email to ergo...@googlegroups.com.
Visit this group at http://groups.google.com/group/ergoemacs.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages