ergoemacs-mode: running customization code after loading

37 views
Skip to first unread message

pdg

unread,
Aug 24, 2016, 5:27:30 PM8/24/16
to ErgoEmacs
Hello,

I am trying to straighten out my init file to work with ergoemacs-mode and have run into a problem. The Customizing your keys document suggests that you can define keys after loading ergoemacs-mode. However, this is difficult to achieve in an init file since ergoemacs-mode now runs itself after everything else (see code on GitHub). Is there a recommended way, like a hook or something, to run code after ergoemacs-mode has loaded?

I understand that I can use ergoemacs-fixed-key instead of global-set-key or use ergoemacs-ignore-prev-global to encourage Ergoemacs to respect my keybindings, but I am looking for a way to run this:

(define-key isearch-mode-map (kbd "M-;") 'isearch-repeat-forward)

As far as I can tell, ergoemacs-mode always resets the isearch mode map when loading, and I am not aware of any way to customize the keybindings there other than to run this code after it has fully loaded.

Please let me know if there is a solution or if I am misunderstanding something!

-Paul

pdg

unread,
Aug 24, 2016, 6:53:31 PM8/24/16
to ErgoEmacs
After looking into this more, it seems like part of the problem with isearch-mode-map is that ergoemacs-mode doesn't reset that map until the first search is performed, so running my code after everything else does not actually fix anything.

Any suggestions about how to get custom keyboard shortcuts in there would be appreciated!

Matthew Fidler

unread,
Aug 24, 2016, 9:35:58 PM8/24/16
to ErgoEmacs

Typically creating an ergoemacs component and then requiring it works.

An example is given in the icicles and ergoemacs-mode interaction page

http://ergoemacs.github.io/icy-mode.html

If you need additional help let me know.


On Wed, Aug 24, 2016, 5:53 PM pdg <paul.d....@gmail.com> wrote:
After looking into this more, it seems like part of the problem with isearch-mode-map is that ergoemacs-mode doesn't reset that map until the first search is performed, so running my code after everything else does not actually fix anything.

Any suggestions about how to get custom keyboard shortcuts in there would be appreciated!

--
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 https://groups.google.com/group/ergoemacs.
For more options, visit https://groups.google.com/d/optout.

pdg

unread,
Aug 25, 2016, 4:02:10 PM8/25/16
to ErgoEmacs
Thanks, that worked!

In fact, simply defining global keys for isearch-forward and isearch-backward, within a component, seems to automatically bind them to isearch-repeat-forward and isearch-repeat-backward as well.  Here's what I did:

(ergoemacs-component my-ergoemacs-keys ()                                                       
  "My ergoemacs keys"
  (global-set-key (kbd "M-;") #'isearch-forward)
  (global-set-key (kbd "M-:") #'isearch-backward)                                  
)                                                                                               
(ergoemacs-require 'my-ergoemacs-keys)

-Paul

Matthew Fidler

unread,
Aug 29, 2016, 7:51:05 PM8/29/16
to ErgoEmacs
Any keys defined on the global map that have corresponding keys in the local map will usually get mapped.  Hence this works.  You can also select a different ergoemacs versi9n to get the same behavior.   Xah changed this key because the search is called so often and the pinkie finger is not too strong compared with the pointer finger.  He noticed some problems with this key combination. 
Reply all
Reply to author
Forward
0 new messages