electric-align icon indicating copy to clipboard operation
electric-align copied to clipboard

if electric-align-mode is enabled, abbrevs don't work anymore

Open TLINDEN opened this issue 8 years ago • 2 comments

I've configured electric-align-mode like so:

(defun add-something-to-mode-hooks (mode-list something)
  "helper function to add a callback to multiple hooks"
  (dolist (mode mode-list)
    (add-hook (intern (concat (symbol-name mode) "-mode-hook")) something)))

(require 'electric-align)
(add-something-to-mode-hooks '(c c++  cperl vala emacs-lisp python) 'electric-align-mode)

I realized that abbrevs don't work anymore in cperl-mode today where I have cperl-electric-keywords enabled. Also, my own abbrevs don't work.

If I disable electric-align-mode, everything works as it should.

Otherwise thanks for this awesome mode, I love it!

  • Tom

TLINDEN avatar May 05 '16 12:05 TLINDEN

SPC is bound to self-insert-command by default, and electric-align-mode basically overrides the SPC key to electric-align-SPC command. I suspect that cperl-mode hooks some functions to self-insert-command so it does not work while electric-align-mode is turned on.

I think we can fix this by

  • make electric-align-mode not to override the default bindings

or

  • add a workaround to cperl-mode to hook the functions not only to self-insert-command but electric-align-SPC

but anyway we should look into cperl-mode more.

I cannot fix this soon but thank you for your report.

zk-phi avatar May 06 '16 03:05 zk-phi

I've got the same problem with python-mode, although SPC there is bound to electric-align-SPC. To be sure it's not a problem with my config, I started emacs with -Q and loaded python-mode and electric-align-mode in a python buffer.

TLINDEN avatar May 07 '16 17:05 TLINDEN