aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann1999-11-16 13:25:42 +0000
committerGerd Moellmann1999-11-16 13:25:42 +0000
commitd4a5b6443df42c2ab9c8ba6290f13ce341211d3c (patch)
tree46cc24d08484f39e8aa8fc0ecba6de0713eec12b
parent635b79049ef2a10895c0504772eeaf26333e3592 (diff)
downloademacs-d4a5b6443df42c2ab9c8ba6290f13ce341211d3c.tar.gz
emacs-d4a5b6443df42c2ab9c8ba6290f13ce341211d3c.zip
Use new backquote syntax.
-rw-r--r--lisp/progmodes/vhdl-mode.el131
1 files changed, 65 insertions, 66 deletions
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 309039f392b..9b61e23e9d1 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -1697,12 +1697,12 @@ STRING are replaced by `-' and substrings are converted to lower case."
1697 1697
1698(defmacro vhdl-ext-syntax-table (&rest body) 1698(defmacro vhdl-ext-syntax-table (&rest body)
1699 "Execute BODY with syntax table that includes `_' in word class." 1699 "Execute BODY with syntax table that includes `_' in word class."
1700 (` (let (result) 1700 `(let (result)
1701 (modify-syntax-entry ?_ "w" vhdl-mode-syntax-table) 1701 (modify-syntax-entry ?_ "w" vhdl-mode-syntax-table)
1702 (setq result (progn (,@ body))) 1702 (setq result (progn ,@body))
1703 (when (not vhdl-underscore-is-part-of-word) 1703 (when (not vhdl-underscore-is-part-of-word)
1704 (modify-syntax-entry ?_ "_" vhdl-mode-syntax-table)) 1704 (modify-syntax-entry ?_ "_" vhdl-mode-syntax-table))
1705 result))) 1705 result))
1706 1706
1707(defvar vhdl-syntactic-context nil 1707(defvar vhdl-syntactic-context nil
1708 "Buffer local variable containing syntactic analysis list.") 1708 "Buffer local variable containing syntactic analysis list.")
@@ -3253,48 +3253,48 @@ This function does not modify point or mark."
3253 (null (cdr (cdr position)))) 3253 (null (cdr (cdr position))))
3254 (error "Bad buffer position requested: %s" position)) 3254 (error "Bad buffer position requested: %s" position))
3255 (setq position (nth 1 position)) 3255 (setq position (nth 1 position))
3256 (` (let ((here (point))) 3256 `(let ((here (point)))
3257 (,@ (cond 3257 ,@(cond
3258 ((eq position 'bol) '((beginning-of-line))) 3258 ((eq position 'bol) '((beginning-of-line)))
3259 ((eq position 'eol) '((end-of-line))) 3259 ((eq position 'eol) '((end-of-line)))
3260 ((eq position 'bod) '((save-match-data 3260 ((eq position 'bod) '((save-match-data
3261 (vhdl-beginning-of-defun)))) 3261 (vhdl-beginning-of-defun))))
3262 ((eq position 'boi) '((back-to-indentation))) 3262 ((eq position 'boi) '((back-to-indentation)))
3263 ((eq position 'eoi) '((end-of-line)(skip-chars-backward " \t"))) 3263 ((eq position 'eoi) '((end-of-line)(skip-chars-backward " \t")))
3264 ((eq position 'bonl) '((forward-line 1))) 3264 ((eq position 'bonl) '((forward-line 1)))
3265 ((eq position 'bopl) '((forward-line -1))) 3265 ((eq position 'bopl) '((forward-line -1)))
3266 ((eq position 'iopl) 3266 ((eq position 'iopl)
3267 '((forward-line -1) 3267 '((forward-line -1)
3268 (back-to-indentation))) 3268 (back-to-indentation)))
3269 ((eq position 'ionl) 3269 ((eq position 'ionl)
3270 '((forward-line 1) 3270 '((forward-line 1)
3271 (back-to-indentation))) 3271 (back-to-indentation)))
3272 (t (error "Unknown buffer position requested: %s" position)) 3272 (t (error "Unknown buffer position requested: %s" position))
3273 )) 3273 )
3274 (prog1 3274 (prog1
3275 (point) 3275 (point)
3276 (goto-char here)) 3276 (goto-char here))
3277 ;; workaround for an Emacs18 bug -- blech! Well, at least it 3277 ;; workaround for an Emacs18 bug -- blech! Well, at least it
3278 ;; doesn't hurt for v19 3278 ;; doesn't hurt for v19
3279 (,@ nil) 3279 ,@nil
3280 ))) 3280 ))
3281 3281
3282(defmacro vhdl-safe (&rest body) 3282(defmacro vhdl-safe (&rest body)
3283 "Safely execute BODY, return nil if an error occurred." 3283 "Safely execute BODY, return nil if an error occurred."
3284 (` (condition-case nil 3284 `(condition-case nil
3285 (progn (,@ body)) 3285 (progn ,@body)
3286 (error nil)))) 3286 (error nil)))
3287 3287
3288(defmacro vhdl-add-syntax (symbol &optional relpos) 3288(defmacro vhdl-add-syntax (symbol &optional relpos)
3289 "A simple macro to append the syntax in SYMBOL to the syntax list. 3289 "A simple macro to append the syntax in SYMBOL to the syntax list.
3290Try to increase performance by using this macro." 3290Try to increase performance by using this macro."
3291 (` (setq vhdl-syntactic-context 3291 `(setq vhdl-syntactic-context
3292 (cons (cons (, symbol) (, relpos)) vhdl-syntactic-context)))) 3292 (cons (cons ,symbol ,relpos) vhdl-syntactic-context)))
3293 3293
3294(defmacro vhdl-has-syntax (symbol) 3294(defmacro vhdl-has-syntax (symbol)
3295 "A simple macro to return check the syntax list. 3295 "A simple macro to return check the syntax list.
3296Try to increase performance by using this macro." 3296Try to increase performance by using this macro."
3297 (` (assoc (, symbol) vhdl-syntactic-context))) 3297 `(assoc ,symbol vhdl-syntactic-context))
3298 3298
3299;; Syntactic element offset manipulation: 3299;; Syntactic element offset manipulation:
3300 3300
@@ -8212,18 +8212,18 @@ but not if inside a comment or quote)."
8212 ;; bindings and which themselves call `vhdl-model-insert' with the model 8212 ;; bindings and which themselves call `vhdl-model-insert' with the model
8213 ;; name as argument 8213 ;; name as argument
8214 (setq model-name (nth 0 (car model-alist))) 8214 (setq model-name (nth 0 (car model-alist)))
8215 (eval (` (defun (, (vhdl-function-name "vhdl-model" model-name)) () 8215 (eval `(defun ,(vhdl-function-name "vhdl-model" model-name) ()
8216 (, (concat "Insert model for \"" model-name "\".")) 8216 ,(concat "Insert model for \"" model-name "\".")
8217 (interactive) 8217 (interactive)
8218 (vhdl-model-insert (, model-name))))) 8218 (vhdl-model-insert ,model-name)))
8219 ;; define hooks for user models that are invoked from keyword abbrevs 8219 ;; define hooks for user models that are invoked from keyword abbrevs
8220 (setq model-keyword (nth 3 (car model-alist))) 8220 (setq model-keyword (nth 3 (car model-alist)))
8221 (unless (equal model-keyword "") 8221 (unless (equal model-keyword "")
8222 (eval (` (defun 8222 (eval `(defun
8223 (, (vhdl-function-name 8223 ,(vhdl-function-name
8224 "vhdl-model" model-name "hook")) () 8224 "vhdl-model" model-name "hook") ()
8225 (vhdl-hooked-abbrev 8225 (vhdl-hooked-abbrev
8226 '(, (vhdl-function-name "vhdl-model" model-name))))))) 8226 ',(vhdl-function-name "vhdl-model" model-name)))))
8227 (setq model-alist (cdr model-alist))))) 8227 (setq model-alist (cdr model-alist)))))
8228 8228
8229(vhdl-model-defun) 8229(vhdl-model-defun)
@@ -8356,7 +8356,7 @@ END is the point beyond which matching/searching should not go."
8356 (match-string 1)))) 8356 (match-string 1))))
8357 (vhdl-forward-syntactic-ws) 8357 (vhdl-forward-syntactic-ws)
8358 (setq end-of-list (vhdl-parse-string ")" t)) 8358 (setq end-of-list (vhdl-parse-string ")" t))
8359 (vhdl-parse-string "\\s-*;\\s-*") 8359 (vhdl-parse-string ";\\s-*")
8360 ;; parse inline comment 8360 ;; parse inline comment
8361 (unless comment 8361 (unless comment
8362 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t) 8362 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t)
@@ -8404,7 +8404,7 @@ END is the point beyond which matching/searching should not go."
8404 (setq type (substring type 0 (match-end 1))) 8404 (setq type (substring type 0 (match-end 1)))
8405 (vhdl-forward-syntactic-ws) 8405 (vhdl-forward-syntactic-ws)
8406 (setq end-of-list (vhdl-parse-string ")" t)) 8406 (setq end-of-list (vhdl-parse-string ")" t))
8407 (vhdl-parse-string "\\s-*;\\s-*") 8407 (vhdl-parse-string ";\\s-*")
8408 ;; parse inline comment 8408 ;; parse inline comment
8409 (unless comment 8409 (unless comment
8410 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t) 8410 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t)
@@ -8563,7 +8563,7 @@ END is the point beyond which matching/searching should not go."
8563 (setq generics-list (cdr generics-list)) 8563 (setq generics-list (cdr generics-list))
8564 (insert (if generics-list ", " ")"))) 8564 (insert (if generics-list ", " ")")))
8565 (unless vhdl-argument-list-indent 8565 (unless vhdl-argument-list-indent
8566 (insert "\n") (indent-to (+ margin vhdl-basic-offset))) 8566 (insert "\n") (indent-to (+ margin (* 2 vhdl-basic-offset))))
8567 (setq list-margin (current-column)) 8567 (setq list-margin (current-column))
8568 (while generics-list 8568 (while generics-list
8569 (setq generic (car generics-list)) 8569 (setq generic (car generics-list))
@@ -8598,7 +8598,7 @@ END is the point beyond which matching/searching should not go."
8598 (setq ports-list (cdr ports-list)) 8598 (setq ports-list (cdr ports-list))
8599 (insert (if ports-list ", " ");"))) 8599 (insert (if ports-list ", " ");")))
8600 (unless vhdl-argument-list-indent 8600 (unless vhdl-argument-list-indent
8601 (insert "\n") (indent-to (+ margin vhdl-basic-offset))) 8601 (insert "\n") (indent-to (+ margin (* 2 vhdl-basic-offset))))
8602 (setq list-margin (current-column)) 8602 (setq list-margin (current-column))
8603 (while ports-list 8603 (while ports-list
8604 (setq port (car ports-list)) 8604 (setq port (car ports-list))
@@ -9400,9 +9400,9 @@ This does background highlighting of translate-off regions.")
9400 (while syntax-alist 9400 (while syntax-alist
9401 (setq name (vhdl-function-name 9401 (setq name (vhdl-function-name
9402 "vhdl-font-lock" (nth 0 (car syntax-alist)) "face")) 9402 "vhdl-font-lock" (nth 0 (car syntax-alist)) "face"))
9403 (eval (` (defvar (, name) '(, name) 9403 (eval `(defvar ,name ',name
9404 (, (concat "Face name to use for " 9404 ,(concat "Face name to use for "
9405 (nth 0 (car syntax-alist)) "."))))) 9405 (nth 0 (car syntax-alist)) ".")))
9406 (setq syntax-alist (cdr syntax-alist)))) 9406 (setq syntax-alist (cdr syntax-alist))))
9407 9407
9408(defgroup vhdl-highlight-faces nil 9408(defgroup vhdl-highlight-faces nil
@@ -9482,17 +9482,17 @@ This does background highlighting of translate-off regions.")
9482;; font lock mode faces used to highlight words with special syntax. 9482;; font lock mode faces used to highlight words with special syntax.
9483(let ((syntax-alist vhdl-special-syntax-alist)) 9483(let ((syntax-alist vhdl-special-syntax-alist))
9484 (while syntax-alist 9484 (while syntax-alist
9485 (eval (` (defface (, (vhdl-function-name 9485 (eval `(defface ,(vhdl-function-name
9486 "vhdl-font-lock" (car (car syntax-alist)) "face")) 9486 "vhdl-font-lock" (car (car syntax-alist)) "face")
9487 '((((class color) (background light)) 9487 '((((class color) (background light))
9488 (:foreground (, (nth 2 (car syntax-alist))))) 9488 (:foreground ,(nth 2 (car syntax-alist))))
9489 (((class color) (background dark)) 9489 (((class color) (background dark))
9490 (:foreground (, (nth 3 (car syntax-alist))))) 9490 (:foreground ,(nth 3 (car syntax-alist))))
9491 (t ())) 9491 (t ()))
9492 (, (concat "Font lock mode face used to highlight " 9492 ,(concat "Font lock mode face used to highlight "
9493 (nth 0 (car syntax-alist)) ".")) 9493 (nth 0 (car syntax-alist)) ".")
9494 :group 'vhdl-highlight-faces 9494 :group 'vhdl-highlight-faces
9495 :group 'font-lock-highlighting-faces))) 9495 :group 'font-lock-highlighting-faces))
9496 (setq syntax-alist (cdr syntax-alist)))) 9496 (setq syntax-alist (cdr syntax-alist))))
9497 9497
9498;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 9498;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -9698,7 +9698,6 @@ specified."
9698 (set-buffer (find-buffer-visiting file-name)) 9698 (set-buffer (find-buffer-visiting file-name))
9699 (set-buffer (find-file-noselect file-name nil t)) 9699 (set-buffer (find-file-noselect file-name nil t))
9700 (setq opened t)) 9700 (setq opened t))
9701 (let ((case-fold-search t))
9702 (modify-syntax-entry ?_ "w" (syntax-table)) 9701 (modify-syntax-entry ?_ "w" (syntax-table))
9703 ;; scan for entities 9702 ;; scan for entities
9704 (goto-char (point-min)) 9703 (goto-char (point-min))
@@ -9785,7 +9784,7 @@ specified."
9785 (setq file-list (cdr file-list)) 9784 (setq file-list (cdr file-list))
9786 ;; add design units to variable `vhdl-file-alist' 9785 ;; add design units to variable `vhdl-file-alist'
9787 (aput 'vhdl-file-alist file-name 9786 (aput 'vhdl-file-alist file-name
9788 (list ent-list arch-list conf-list pack-list inst-list))) 9787 (list ent-list arch-list conf-list pack-list inst-list))
9789 ;; close file 9788 ;; close file
9790 (if opened 9789 (if opened
9791 (kill-buffer (current-buffer)) 9790 (kill-buffer (current-buffer))