Mercurial > emacs
comparison lisp/progmodes/vhdl-mode.el @ 101013:dbe70c3aa01d
Replace last-input-char with last-input-event.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Fri, 09 Jan 2009 05:00:56 +0000 |
parents | 3b3c7e10cd97 |
children | b6273f409a73 |
comparison
equal
deleted
inserted
replaced
101012:eadf79f14b29 | 101013:dbe70c3aa01d |
---|---|
8156 (self-insert-command count))) | 8156 (self-insert-command count))) |
8157 | 8157 |
8158 (defun vhdl-electric-quote (count) "'' --> \"" | 8158 (defun vhdl-electric-quote (count) "'' --> \"" |
8159 (interactive "p") | 8159 (interactive "p") |
8160 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) | 8160 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) |
8161 (if (= (preceding-char) last-input-char) | 8161 (if (= (preceding-char) last-input-event) |
8162 (progn (delete-backward-char 1) (insert-char ?\" 1)) | 8162 (progn (delete-backward-char 1) (insert-char ?\" 1)) |
8163 (insert-char ?\' 1)) | 8163 (insert-char ?\' 1)) |
8164 (self-insert-command count))) | 8164 (self-insert-command count))) |
8165 | 8165 |
8166 (defun vhdl-electric-semicolon (count) "';;' --> ' : ', ': ;' --> ' := '" | 8166 (defun vhdl-electric-semicolon (count) "';;' --> ' : ', ': ;' --> ' := '" |
8167 (interactive "p") | 8167 (interactive "p") |
8168 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) | 8168 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) |
8169 (cond ((= (preceding-char) last-input-char) | 8169 (cond ((= (preceding-char) last-input-event) |
8170 (progn (delete-char -1) | 8170 (progn (delete-char -1) |
8171 (unless (eq (preceding-char) ? ) (insert " ")) | 8171 (unless (eq (preceding-char) ? ) (insert " ")) |
8172 (insert ": ") | 8172 (insert ": ") |
8173 (setq this-command 'vhdl-electric-colon))) | 8173 (setq this-command 'vhdl-electric-colon))) |
8174 ((and | 8174 ((and |
8178 (self-insert-command count))) | 8178 (self-insert-command count))) |
8179 | 8179 |
8180 (defun vhdl-electric-comma (count) "',,' --> ' <= '" | 8180 (defun vhdl-electric-comma (count) "',,' --> ' <= '" |
8181 (interactive "p") | 8181 (interactive "p") |
8182 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) | 8182 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) |
8183 (cond ((= (preceding-char) last-input-char) | 8183 (cond ((= (preceding-char) last-input-event) |
8184 (progn (delete-char -1) | 8184 (progn (delete-char -1) |
8185 (unless (eq (preceding-char) ? ) (insert " ")) | 8185 (unless (eq (preceding-char) ? ) (insert " ")) |
8186 (insert "<= "))) | 8186 (insert "<= "))) |
8187 (t (insert-char ?\, 1))) | 8187 (t (insert-char ?\, 1))) |
8188 (self-insert-command count))) | 8188 (self-insert-command count))) |
8189 | 8189 |
8190 (defun vhdl-electric-period (count) "'..' --> ' => '" | 8190 (defun vhdl-electric-period (count) "'..' --> ' => '" |
8191 (interactive "p") | 8191 (interactive "p") |
8192 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) | 8192 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) |
8193 (cond ((= (preceding-char) last-input-char) | 8193 (cond ((= (preceding-char) last-input-event) |
8194 (progn (delete-char -1) | 8194 (progn (delete-char -1) |
8195 (unless (eq (preceding-char) ? ) (insert " ")) | 8195 (unless (eq (preceding-char) ? ) (insert " ")) |
8196 (insert "=> "))) | 8196 (insert "=> "))) |
8197 (t (insert-char ?\. 1))) | 8197 (t (insert-char ?\. 1))) |
8198 (self-insert-command count))) | 8198 (self-insert-command count))) |
8199 | 8199 |
8200 (defun vhdl-electric-equal (count) "'==' --> ' == '" | 8200 (defun vhdl-electric-equal (count) "'==' --> ' == '" |
8201 (interactive "p") | 8201 (interactive "p") |
8202 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) | 8202 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) |
8203 (cond ((= (preceding-char) last-input-char) | 8203 (cond ((= (preceding-char) last-input-event) |
8204 (progn (delete-char -1) | 8204 (progn (delete-char -1) |
8205 (unless (eq (preceding-char) ? ) (insert " ")) | 8205 (unless (eq (preceding-char) ? ) (insert " ")) |
8206 (insert "== "))) | 8206 (insert "== "))) |
8207 (t (insert-char ?\= 1))) | 8207 (t (insert-char ?\= 1))) |
8208 (self-insert-command count))) | 8208 (self-insert-command count))) |