Take the 2-minute tour ×

I'm having trouble getting rid of the space from the insertion key.

Here's the function for my .emacs file

(defun abbrev-backward-char ()
    (backward-char 1) t) ; return non-nil to inhibit insertion of the character
                         ; that triggered the expansion
(put 'abbrev-backward-char 'no-self-insert t)

Here's my abbrevs_defs table

(define-abbrev-table 'global-abbrev-table
       ("slv" "std_logic_vector" abbrev-backward-char 0)))

The problem I'm having is that when I type "slv" it's: first expanding the word, then backspacing, and THEN adding the insertion character. So I'm left with this: "std_logic_vecto r".

I want it to, instead: expand, add insertion character, and then LASTLY backspace. So I'm left with "std_logic_vector".

I hope I'm not asking for miracles here.

I've been going at this for hours, it seems so ridiculous that there's not an easier to get rid of then insertion char.

share|improve this question
add comment

1 Answer

The interface is cleaner is you don't overload space to do abbrev expansion. Instead overload dabbrev-expand M-/ with hippie-expand.

share|improve this answer
Hey thanks for the tip, I'll be using that in the future! I also found out that what I'm trying to do already exists in vhdl-mode. :P So if I type "s" then hit <tab>, it will already create "std_logic_vector", therefore saving me the trouble. :) Rookie mistake.. –  mrbean Feb 13 '13 at 2:41
add comment

Your Answer


