Smartparens and ergoemacs

80 views
Skip to first unread message

Nikolay Kudryavtsev

unread,
May 21, 2015, 5:35:08 AM5/21/15
to ergo...@googlegroups.com
Hello. It's that time of the year again, where I add another layer of
crap to my init file.

So I decided to switch to smartparens. If there are any smartparens
users here, just want to know what keybindings do you use?

I also have a more direct ergoemacs question:
Is it possible to override M-u and M-o in a theme component? Smartparens
have this really cool sp-forward-symbol and sp-backward-symbol
functions. They fit perfectly as M-u and M-o. My theme component looks
like this:

(ergoemacs-theme-component smartparens ()
""
(when smartparens-mode-hook
(local-set-key (kbd "M-o") 'sp-forward-symbol)
(local-set-key (kbd "M-u") 'sp-backward-symbol)
)
(define-key smartparens-mode-map (kbd "M-o") 'sp-forward-symbol)
(define-key smartparens-mode-map (kbd "M-u") 'sp-backward-symbol)
)
(ergoemacs-require 'smartparens)


Neither the local key or the mode map key work.

My other question - how do I debug theme components? Because after the
first time a theme component is loaded there seems to be no way to
override it. What I do now is I load the same component under a
different name. Is there another way?

--
Best Regards,
Nikolay Kudryavtsev

Matthew Fidler

unread,
May 21, 2015, 12:27:58 PM5/21/15
to ergo...@googlegroups.com
I think that you should be able to fix it by 

(ergoemacs-theme-component smartparens ()
  ""
  (define-key sp-keymap [remap forward-word] 'sp-forward-symbol)
  (define-key sp-keymap [remap backward-word] 'sp-backward-symbol)
  )
(ergoemacs-require 'smartparens)

As far as the loading of the theme component, I'm not sure if ergoemacs-mode allows redefining of the theme components currently, but it would make sense to allow it...

ergoemacs-theme-debug debugs the current theme, and should debug each component within the theme.  Thes function may be going away, I'm not sure.  I have been completely rewriting ergoemacs-mode for speed and to be compatible with emacs 25 and I would have to re-implement it.

--
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.

Nikolay Kudryavtsev

unread,
May 24, 2015, 11:53:03 AM5/24/15
to ergo...@googlegroups.com
Hello Matt.

[remap forward-word] worked, but only with smartparens-mode-map, not sp-keymap. Help for smartparens says that sp-keymap is deprected variable.

Thanks for you help as always.

Matthew Fidler

unread,
May 25, 2015, 7:48:00 AM5/25/15
to ergo...@googlegroups.com

No problem.


--
Reply all
Reply to author
Forward
0 new messages