Function: vhdl-hooked-abbrev
vhdl-hooked-abbrev is a byte-compiled function defined in
vhdl-mode.el.gz.
Signature
(vhdl-hooked-abbrev FUNC)
Documentation
Do function, if syntax says abbrev is a keyword, invoked by hooked abbrev, but not if inside a comment or quote.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Abbrev hooks
(defun vhdl-hooked-abbrev (func)
"Do function, if syntax says abbrev is a keyword, invoked by hooked abbrev,
but not if inside a comment or quote."
(if (or (vhdl-in-literal)
(save-excursion
(forward-word-strictly -1)
(and (looking-at "\\<end\\>") (not (looking-at "\\<end;")))))
(progn
(insert " ")
(unexpand-abbrev)
(backward-word-strictly 1)
(vhdl-case-word 1)
(delete-char 1))
(if (not vhdl-electric-mode)
(progn
(insert " ")
(unexpand-abbrev)
(backward-word-strictly 1)
(vhdl-case-word 1)
(delete-char 1))
(let ((invoke-char vhdl-last-input-event)
(abbrev-mode -1)
(vhdl-template-invoked-by-hook t))
(let ((caught (catch 'abort
(funcall func))))
(when (stringp caught) (message "%s" caught)))
(when (= invoke-char ?-) (setq abbrev-start-location (point)))
;; delete CR which is still in event queue
(if (fboundp 'enqueue-eval-event)
(enqueue-eval-event 'delete-char -1)
(push (vhdl-character-to-event ?\177) ; push back a delete char
unread-command-events))))))