Commit 1d5963cc authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/progmodes/f90.el (f90-mode-syntax-table): Use symbol syntax for "_".

Change all regexps to use things like \_< and \_>.

* lisp/progmodes/ada-mode.el (ada-mode-abbrev-table): Consolidate declaration.
(ada-mode-syntax-table, ada-mode-symbol-syntax-table): Initialize in
the declaration.
(ada-create-syntax-table): Remove.
(ada-capitalize-word): Don't mess with the syntax of "_" since it
already has the right syntax nowadays.
(ada-goto-next-word): Don't change the syntax of "_".

* lisp/progmodes/autoconf.el (autoconf-definition-regexp)
(autoconf-font-lock-keywords, autoconf-current-defun-function):
Handle a _ with symbol syntax.
(autoconf-mode): Don't change the syntax-table for imenu and font-lock.

* lisp/progmodes/vera-mode.el (vera-underscore-is-part-of-word):
* lisp/progmodes/prolog.el (prolog-underscore-wordchar-flag)
(prolog-char-quote-workaround):
* lisp/progmodes/cperl-mode.el (cperl-under-as-char):
* lisp/progmodes/vhdl-mode.el (vhdl-underscore-is-part-of-word):
 Mark as obsolete.
 (vhdl-mode-syntax-table, vhdl-mode-ext-syntax-table): Initialize in
their declaration.
(vhdl-mode-syntax-table-init): Remove.

* lisp/progmodes/ld-script.el (ld-script-mode-syntax-table): Use symbol
syntax for "_".
(ld-script-font-lock-keywords):
Change regexps to use things like \_< and \_>.

* lisp/progmodes/m4-mode.el (m4-mode-syntax-table): Add comment on last change.

* lisp/font-lock.el (lisp-font-lock-keywords-2): Don't highlight obsolete
with-wrapper-hook.

* lisp/mh-e/mh-comp.el (mh-regexp-in-field-p): Minor simplification.
parent 86cec478
2013-05-08 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/vera-mode.el (vera-underscore-is-part-of-word):
* progmodes/prolog.el (prolog-underscore-wordchar-flag)
(prolog-char-quote-workaround):
* progmodes/cperl-mode.el (cperl-under-as-char):
* progmodes/vhdl-mode.el (vhdl-underscore-is-part-of-word):
Mark as obsolete.
(vhdl-mode-syntax-table, vhdl-mode-ext-syntax-table): Initialize in
their declaration.
(vhdl-mode-syntax-table-init): Remove.
* progmodes/m4-mode.el (m4-mode-syntax-table): Add comment on last change.
* progmodes/ld-script.el (ld-script-mode-syntax-table): Use symbol
syntax for "_".
(ld-script-font-lock-keywords):
Change regexps to use things like \_< and \_>.
* progmodes/f90.el (f90-mode-syntax-table): Use symbol syntax for "_".
Change all regexps to use things like \_< and \_>.
* progmodes/autoconf.el (autoconf-definition-regexp)
(autoconf-font-lock-keywords, autoconf-current-defun-function):
Handle a _ with symbol syntax.
(autoconf-mode): Don't change the syntax-table for imenu and font-lock.
* progmodes/ada-mode.el (ada-mode-abbrev-table): Consolidate declaration.
(ada-mode-syntax-table, ada-mode-symbol-syntax-table): Initialize in
the declaration.
(ada-create-syntax-table): Remove.
(ada-capitalize-word): Don't mess with the syntax of "_" since it
already has the right syntax nowadays.
(ada-goto-next-word): Don't change the syntax of "_".
* font-lock.el (lisp-font-lock-keywords-2): Don't highlight obsolete
with-wrapper-hook.
2013-05-08 Sam Steingold <sds@gnu.org>
 
* thingatpt.el (thing-at-point): Accept optional second argument
......
......@@ -2298,7 +2298,7 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
"with-selected-window" "with-selected-frame"
"with-silent-modifications" "with-syntax-table"
"with-temp-buffer" "with-temp-file" "with-temp-message"
"with-timeout" "with-timeout-handler" "with-wrapper-hook") t)
"with-timeout" "with-timeout-handler") t)
"\\_>")
. 1)
;; Control structures. Common Lisp forms.
......
2013-05-08 Stefan Monnier <monnier@iro.umontreal.ca>
* mh-comp.el (mh-regexp-in-field-p): Minor simplification.
2013-03-02 Bill Wohler <wohler@newt.com>
Release MH-E version 8.5.
......
......@@ -1205,17 +1205,17 @@ discarded."
(let ((search-result nil))
(while fields
(let ((field (car fields))
(syntax-table mh-regexp-in-field-syntax-table))
(if (null syntax-table)
(let ((case-fold-search t))
(cond
((string-match field "^To$\\|^[BD]?cc$\\|^From$")
(setq syntax-table mh-addr-syntax-table))
((string-match field "^Fcc$")
(setq syntax-table mh-fcc-syntax-table))
(t
(setq syntax-table (syntax-table)))
)))
(syntax-table
(or mh-regexp-in-field-syntax-table
(let ((case-fold-search t))
(cond
((string-match field "^To$\\|^[BD]?cc$\\|^From$")
mh-addr-syntax-table)
((string-match field "^Fcc$")
mh-fcc-syntax-table)
(t
(syntax-table)))
))))
(if (and (mh-goto-header-field field)
(set-syntax-table syntax-table)
(re-search-forward
......
......@@ -457,15 +457,8 @@ The extensions should include a `.' if needed.")
(defvar ada-mode-extra-prefix "\C-c\C-q"
"Prefix key to access `ada-mode-extra-map' functions.")
(defvar ada-mode-abbrev-table nil
(define-abbrev-table 'ada-mode-abbrev-table ()
"Local abbrev table for Ada mode.")
(define-abbrev-table 'ada-mode-abbrev-table ())
(defvar ada-mode-syntax-table nil
"Syntax table to be used for editing Ada source code.")
(defvar ada-mode-symbol-syntax-table nil
"Syntax table for Ada, where `_' is a word constituent.")
(eval-when-compile
;; These values are used in eval-when-compile expressions.
......@@ -845,61 +838,58 @@ the 4 file locations can be clicked on and jumped to."
;; better is available on XEmacs.
;;-------------------------------------------------------------------------
(defun ada-create-syntax-table ()
"Create the two syntax tables use in the Ada mode.
The standard table declares `_' as a symbol constituent, the second one
declares it as a word constituent."
(interactive)
(setq ada-mode-syntax-table (make-syntax-table))
;; define string brackets (`%' is alternative string bracket, but
;; almost never used as such and throws font-lock and indentation
;; off the track.)
(modify-syntax-entry ?% "$" ada-mode-syntax-table)
(modify-syntax-entry ?\" "\"" ada-mode-syntax-table)
(modify-syntax-entry ?: "." ada-mode-syntax-table)
(modify-syntax-entry ?\; "." ada-mode-syntax-table)
(modify-syntax-entry ?& "." ada-mode-syntax-table)
(modify-syntax-entry ?\| "." ada-mode-syntax-table)
(modify-syntax-entry ?+ "." ada-mode-syntax-table)
(modify-syntax-entry ?* "." ada-mode-syntax-table)
(modify-syntax-entry ?/ "." ada-mode-syntax-table)
(modify-syntax-entry ?= "." ada-mode-syntax-table)
(modify-syntax-entry ?< "." ada-mode-syntax-table)
(modify-syntax-entry ?> "." ada-mode-syntax-table)
(modify-syntax-entry ?$ "." ada-mode-syntax-table)
(modify-syntax-entry ?\[ "." ada-mode-syntax-table)
(modify-syntax-entry ?\] "." ada-mode-syntax-table)
(modify-syntax-entry ?\{ "." ada-mode-syntax-table)
(modify-syntax-entry ?\} "." ada-mode-syntax-table)
(modify-syntax-entry ?. "." ada-mode-syntax-table)
(modify-syntax-entry ?\\ "." ada-mode-syntax-table)
(modify-syntax-entry ?\' "." ada-mode-syntax-table)
;; a single hyphen is punctuation, but a double hyphen starts a comment
(modify-syntax-entry ?- ". 12" ada-mode-syntax-table)
;; See the comment above on grammar related function for the special
;; setup for '#'.
(if (featurep 'xemacs)
(modify-syntax-entry ?# "<" ada-mode-syntax-table)
(modify-syntax-entry ?# "$" ada-mode-syntax-table))
;; and \f and \n end a comment
(modify-syntax-entry ?\f "> " ada-mode-syntax-table)
(modify-syntax-entry ?\n "> " ada-mode-syntax-table)
;; define what belongs in Ada symbols
(modify-syntax-entry ?_ "_" ada-mode-syntax-table)
;; define parentheses to match
(modify-syntax-entry ?\( "()" ada-mode-syntax-table)
(modify-syntax-entry ?\) ")(" ada-mode-syntax-table)
(setq ada-mode-symbol-syntax-table (copy-syntax-table ada-mode-syntax-table))
(modify-syntax-entry ?_ "w" ada-mode-symbol-syntax-table)
)
(defvar ada-mode-syntax-table
(let ((st (make-syntax-table)))
;; Define string brackets (`%' is alternative string bracket, but
;; almost never used as such and throws font-lock and indentation
;; off the track.)
(modify-syntax-entry ?% "$" st)
(modify-syntax-entry ?\" "\"" st)
(modify-syntax-entry ?: "." st)
(modify-syntax-entry ?\; "." st)
(modify-syntax-entry ?& "." st)
(modify-syntax-entry ?\| "." st)
(modify-syntax-entry ?+ "." st)
(modify-syntax-entry ?* "." st)
(modify-syntax-entry ?/ "." st)
(modify-syntax-entry ?= "." st)
(modify-syntax-entry ?< "." st)
(modify-syntax-entry ?> "." st)
(modify-syntax-entry ?$ "." st)
(modify-syntax-entry ?\[ "." st)
(modify-syntax-entry ?\] "." st)
(modify-syntax-entry ?\{ "." st)
(modify-syntax-entry ?\} "." st)
(modify-syntax-entry ?. "." st)
(modify-syntax-entry ?\\ "." st)
(modify-syntax-entry ?\' "." st)
;; A single hyphen is punctuation, but a double hyphen starts a comment.
(modify-syntax-entry ?- ". 12" st)
;; See the comment above on grammar related function for the special
;; setup for '#'.
(modify-syntax-entry ?# (if (featurep 'xemacs) "<" "$") st)
;; And \f and \n end a comment.
(modify-syntax-entry ?\f "> " st)
(modify-syntax-entry ?\n "> " st)
;; Define what belongs in Ada symbols.
(modify-syntax-entry ?_ "_" st)
;; Define parentheses to match.
(modify-syntax-entry ?\( "()" st)
(modify-syntax-entry ?\) ")(" st)
st)
"Syntax table to be used for editing Ada source code.")
(defvar ada-mode-symbol-syntax-table
(let ((st (make-syntax-table ada-mode-syntax-table)))
(modify-syntax-entry ?_ "w" st)
st)
"Syntax table for Ada, where `_' is a word constituent.")
;; Support of special characters in XEmacs (see the comments at the beginning
;; of the section on Grammar related functions).
......@@ -1293,7 +1283,7 @@ the file name."
(if ada-popup-key
(define-key ada-mode-map ada-popup-key 'ada-popup-menu))
;; Support for Abbreviations (the user still need to "M-x abbrev-mode"
;; Support for Abbreviations (the user still needs to "M-x abbrev-mode").
(setq local-abbrev-table ada-mode-abbrev-table)
;; Support for which-function mode
......@@ -1625,9 +1615,8 @@ ARG is the prefix the user entered with \\[universal-argument]."
(let ((lastk last-command-event))
(with-syntax-table ada-mode-symbol-syntax-table
(cond ((or (eq lastk ?\n)
(eq lastk ?\r))
;; horrible kludge
(cond ((memq lastk '(?\n ?\r))
;; Horrible kludge.
(insert " ")
(ada-adjust-case)
;; horrible dekludge
......@@ -1706,9 +1695,7 @@ ARG is ignored, and is there for compatibility with `capitalize-word' only."
(interactive)
(let ((end (save-excursion (skip-syntax-forward "w") (point)))
(begin (save-excursion (skip-syntax-backward "w") (point))))
(modify-syntax-entry ?_ "_")
(capitalize-region begin end)
(modify-syntax-entry ?_ "w")))
(capitalize-region begin end)))
(defun ada-adjust-case-region (from to)
"Adjust the case of all words in the region between FROM and TO.
......@@ -2165,7 +2152,7 @@ and the offset."
(unwind-protect
(with-syntax-table ada-mode-symbol-syntax-table
;; This need to be done here so that the advice is not always
;; This needs to be done here so that the advice is not always
;; activated (this might interact badly with other modes)
(if (featurep 'xemacs)
(ad-activate 'parse-partial-sexp t))
......@@ -3419,27 +3406,23 @@ Stop the search at LIMIT."
If BACKWARD is non-nil, jump to the beginning of the previous word.
Return the new position of point or nil if not found."
(let ((match-cons nil)
(orgpoint (point))
(old-syntax (char-to-string (char-syntax ?_))))
(modify-syntax-entry ?_ "w")
(orgpoint (point)))
(unless backward
(skip-syntax-forward "w"))
(skip-syntax-forward "w_"))
(if (setq match-cons
(ada-search-ignore-string-comment "\\w" backward nil t))
(ada-search-ignore-string-comment "\\sw\\|\\s_" backward nil t))
;;
;; move to the beginning of the word found
;;
(progn
(goto-char (car match-cons))
(skip-syntax-backward "w")
(skip-syntax-backward "w_")
(point))
;;
;; if not found, restore old position of point
;;
(goto-char orgpoint)
'nil)
(modify-syntax-entry ?_ old-syntax))
)
'nil)))
(defun ada-check-matching-start (keyword)
......@@ -5431,9 +5414,6 @@ This function typically is to be hooked into `ff-file-created-hook'."
(ada-create-keymap)
(ada-create-menu)
;; Create the syntax tables, but do not activate them
(ada-create-syntax-table)
;; Add the default extensions (and set up speedbar)
(ada-add-extensions ".ads" ".adb")
;; This two files are generated by GNAT when running with -gnatD
......
......@@ -41,10 +41,10 @@
"Hook run by `autoconf-mode'.")
(defconst autoconf-definition-regexp
"A\\(?:H_TEMPLATE\\|C_\\(?:SUBST\\|DEFINE\\(?:_UNQUOTED\\)?\\)\\)(\\[*\\(\\sw+\\)\\]*")
"A\\(?:H_TEMPLATE\\|C_\\(?:SUBST\\|DEFINE\\(?:_UNQUOTED\\)?\\)\\)(\\[*\\(\\(?:\\sw\\|\\s_\\)+\\)\\]*")
(defvar autoconf-font-lock-keywords
`(("\\_<A[CHMS]_\\sw+" . font-lock-keyword-face)
`(("\\_<A[CHMS]_\\(?:\\sw\\|\\s_\\)+" . font-lock-keyword-face)
(,autoconf-definition-regexp
1 font-lock-function-name-face)
;; Are any other M4 keywords really appropriate for configure.ac,
......@@ -67,13 +67,11 @@
This version looks back for an AC_DEFINE or AC_SUBST. It will stop
searching backwards at another AC_... command."
(save-excursion
(with-syntax-table (copy-syntax-table autoconf-mode-syntax-table)
(modify-syntax-entry ?_ "w")
(skip-syntax-forward "w" (line-end-position))
(if (re-search-backward autoconf-definition-regexp
(save-excursion (beginning-of-defun) (point))
t)
(match-string-no-properties 1)))))
(skip-syntax-forward "w_" (line-end-position))
(if (re-search-backward autoconf-definition-regexp
(save-excursion (beginning-of-defun) (point))
t)
(match-string-no-properties 1))))
;;;###autoload
(define-derived-mode autoconf-mode prog-mode "Autoconf"
......@@ -85,9 +83,8 @@ searching backwards at another AC_... command."
(setq-local syntax-propertize-function
(syntax-propertize-rules ("\\<dnl\\>" (0 "<"))))
(setq-local font-lock-defaults
`(autoconf-font-lock-keywords nil nil (("_" . "w"))))
`(autoconf-font-lock-keywords nil nil))
(setq-local imenu-generic-expression autoconf-imenu-generic-expression)
(setq-local imenu-syntax-alist '(("_" . "w")))
(setq-local indent-line-function #'indent-relative)
(setq-local add-log-current-defun-function
#'autoconf-current-defun-function))
......
......@@ -565,6 +565,7 @@ If nil, the value of `cperl-indent-level' will be used."
"*Non-nil means that the _ (underline) should be treated as word char."
:type 'boolean
:group 'cperl)
(make-obsolete-variable 'cperl-under-as-char 'superword-mode "24.4")
(defcustom cperl-extra-perl-args ""
"*Extra arguments to use when starting Perl.
......
This diff is collapsed.
......@@ -48,7 +48,7 @@
(modify-syntax-entry ?\) ")(" st)
(modify-syntax-entry ?\[ "(]" st)
(modify-syntax-entry ?\] ")[" st)
(modify-syntax-entry ?_ "w" st)
(modify-syntax-entry ?_ "_" st)
(modify-syntax-entry ?. "_" st)
(modify-syntax-entry ?\\ "\\" st)
(modify-syntax-entry ?: "." st)
......@@ -154,10 +154,10 @@
(defvar ld-script-font-lock-keywords
(append
`((,(regexp-opt ld-script-keywords 'words)
1 font-lock-keyword-face)
(,(regexp-opt ld-script-builtins 'words)
1 font-lock-builtin-face)
`((,(concat "\\_<" (regexp-opt ld-script-keywords) "\\_>")
0 font-lock-keyword-face)
(,(concat "\\_<" (regexp-opt ld-script-builtins) "\\_>")
0 font-lock-builtin-face)
;; 3.6.7 Output Section Discarding
;; 3.6.4.1 Input Section Basics
;; 3.6.8.7 Output Section Phdr
......
......@@ -88,8 +88,12 @@ If m4 is not in your PATH, set this to an absolute file name."
(modify-syntax-entry ?\n ">#" table)
(modify-syntax-entry ?{ "_" table)
(modify-syntax-entry ?} "_" table)
(modify-syntax-entry ?* "w" table)
;; FIXME: This symbol syntax for underscore looks OK on its own, but it's
;; odd that it should have the same syntax as { and } are these really
;; valid in m4 symbols?
(modify-syntax-entry ?_ "_" table)
;; FIXME: These three chars with word syntax look wrong.
(modify-syntax-entry ?* "w" table)
(modify-syntax-entry ?\" "w" table)
(modify-syntax-entry ?\" "w" table)
table)
......
......@@ -794,6 +794,7 @@ The environment marked is the one that contains point or follows point."
(defvar meta-common-mode-syntax-table
(let ((st (make-syntax-table)))
;; FIXME: This goes against the convention!
;; underscores are word constituents
(modify-syntax-entry ?_ "w" st)
;; miscellaneous non-word symbols
......
......@@ -772,6 +772,8 @@ Relevant only when `prolog-imenu-flag' is non-nil."
:version "24.1"
:group 'prolog-other
:type 'boolean)
(make-obsolete-variable 'prolog-underscore-wordchar-flag
'superword-mode "24.4")
(defcustom prolog-use-sicstus-sd nil
"If non-nil, use the source level debugger of SICStus 3#7 and later."
......@@ -785,6 +787,7 @@ This is really kludgy, and unneeded (i.e. obsolete) in Emacs>=24."
:version "24.1"
:group 'prolog-other
:type 'boolean)
(make-obsolete-variable 'prolog-char-quote-workaround nil "24.1")
;;-------------------------------------------------------------------
......@@ -802,10 +805,7 @@ This is really kludgy, and unneeded (i.e. obsolete) in Emacs>=24."
;; - In atoms \x<hex> sometimes needs a terminating \ (ISO-style)
;; and sometimes not.
(let ((table (make-syntax-table)))
(if prolog-underscore-wordchar-flag
(modify-syntax-entry ?_ "w" table)
(modify-syntax-entry ?_ "_" table))
(modify-syntax-entry ?_ (if prolog-underscore-wordchar-flag "w" "_") table)
(modify-syntax-entry ?+ "." table)
(modify-syntax-entry ?- "." table)
(modify-syntax-entry ?= "." table)
......@@ -815,7 +815,8 @@ This is really kludgy, and unneeded (i.e. obsolete) in Emacs>=24."
(modify-syntax-entry ?\' "\"" table)
;; Any better way to handle the 0'<char> construct?!?
(when prolog-char-quote-workaround
(when (and prolog-char-quote-workaround
(not (fboundp 'syntax-propertize-rules)))
(modify-syntax-entry ?0 "\\" table))
(modify-syntax-entry ?% "<" table)
......
......@@ -101,6 +101,8 @@ select and move operations. All parts of an identifier separated by underscore
are treated as single words otherwise."
:type 'boolean
:group 'vera)
(make-obsolete-variable 'vera-underscore-is-part-of-word
'superword-mode "24.4")
(defcustom vera-intelligent-tab t
"Non-nil means `TAB' does indentation, word completion and tab insertion.
......
......@@ -2784,6 +2784,8 @@ find the errors."
(modify-syntax-entry ?> "." table)
(modify-syntax-entry ?& "." table)
(modify-syntax-entry ?| "." table)
;; FIXME: This goes against Emacs conventions. Use "_" syntax instead and
;; then use regexps with things like "\\_<...\\_>".
(modify-syntax-entry ?` "w" table)
(modify-syntax-entry ?_ "w" table)
(modify-syntax-entry ?\' "." table)
......
......@@ -1872,14 +1872,11 @@ NOTE: Activate the new setting by restarting Emacs."
"Non-nil means consider the underscore character `_' as part of word.
An identifier containing underscores is then treated as a single word in
select and move operations. All parts of an identifier separated by underscore
are treated as single words otherwise.
NOTE: Activate the new setting in a VHDL buffer by using the menu entry
\"Activate Options\"."
are treated as single words otherwise."
:type 'boolean
:set (lambda (variable value)
(vhdl-custom-set variable value 'vhdl-mode-syntax-table-init))
:group 'vhdl-misc)
(make-obsolete-variable 'vhdl-underscore-is-part-of-word
'superword-mode "24.4")
 
 
(defgroup vhdl-related nil
......@@ -2433,6 +2430,7 @@ old environment. Used for consistent searching."
(progn (set-buffer (create-file-buffer ,file-name))
(setq file-opened t)
(vhdl-insert-file-contents ,file-name)
;; FIXME: This modifies a global syntax-table!
(modify-syntax-entry ?\- ". 12" (syntax-table))
(modify-syntax-entry ?\n ">" (syntax-table))
(modify-syntax-entry ?\^M ">" (syntax-table))
......@@ -2864,56 +2862,51 @@ STRING are replaced by `-' and substrings are converted to lower case."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Syntax table
 
(defvar vhdl-mode-syntax-table nil
(defvar vhdl-mode-syntax-table
(let ((st (make-syntax-table)))
;; define punctuation
(modify-syntax-entry ?\# "." st)
(modify-syntax-entry ?\$ "." st)
(modify-syntax-entry ?\% "." st)
(modify-syntax-entry ?\& "." st)
(modify-syntax-entry ?\' "." st)
(modify-syntax-entry ?\* "." st)
(modify-syntax-entry ?\+ "." st)
(modify-syntax-entry ?\. "." st)
(modify-syntax-entry ?\/ "." st)
(modify-syntax-entry ?\: "." st)
(modify-syntax-entry ?\; "." st)
(modify-syntax-entry ?\< "." st)
(modify-syntax-entry ?\= "." st)
(modify-syntax-entry ?\> "." st)
(modify-syntax-entry ?\\ "." st)
(modify-syntax-entry ?\| "." st)
;; define string
(modify-syntax-entry ?\" "\"" st)
;; define underscore
(modify-syntax-entry ?\_ (if vhdl-underscore-is-part-of-word "w" "_") st)
;; a single hyphen is punctuation, but a double hyphen starts a comment
(modify-syntax-entry ?\- ". 12" st)
;; and \n and \^M end a comment
(modify-syntax-entry ?\n ">" st)
(modify-syntax-entry ?\^M ">" st)
;; define parentheses to match
(modify-syntax-entry ?\( "()" st)
(modify-syntax-entry ?\) ")(" st)
(modify-syntax-entry ?\[ "(]" st)
(modify-syntax-entry ?\] ")[" st)
(modify-syntax-entry ?\{ "(}" st)
(modify-syntax-entry ?\} "){" st)
st)
"Syntax table used in `vhdl-mode' buffers.")
 
(defvar vhdl-mode-ext-syntax-table nil
(defvar vhdl-mode-ext-syntax-table
;; Extended syntax table including '_' (for simpler search regexps).
(let ((st (copy-syntax-table vhdl-mode-syntax-table)))
(modify-syntax-entry ?_ "w" st)
st)
"Syntax table extended by `_' used in `vhdl-mode' buffers.")
 
(defun vhdl-mode-syntax-table-init ()
"Initialize `vhdl-mode-syntax-table'."
(setq vhdl-mode-syntax-table (make-syntax-table))
;; define punctuation
(modify-syntax-entry ?\# "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\$ "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\% "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\& "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\' "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\* "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\+ "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\. "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\/ "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\: "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\; "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\< "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\= "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\> "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\\ "." vhdl-mode-syntax-table)
(modify-syntax-entry ?\| "." vhdl-mode-syntax-table)
;; define string
(modify-syntax-entry ?\" "\"" vhdl-mode-syntax-table)
;; define underscore
(when vhdl-underscore-is-part-of-word
(modify-syntax-entry ?\_ "w" vhdl-mode-syntax-table))
;; a single hyphen is punctuation, but a double hyphen starts a comment
(modify-syntax-entry ?\- ". 12" vhdl-mode-syntax-table)
;; and \n and \^M end a comment
(modify-syntax-entry ?\n ">" vhdl-mode-syntax-table)
(modify-syntax-entry ?\^M ">" vhdl-mode-syntax-table)
;; define parentheses to match
(modify-syntax-entry ?\( "()" vhdl-mode-syntax-table)
(modify-syntax-entry ?\) ")(" vhdl-mode-syntax-table)
(modify-syntax-entry ?\[ "(]" vhdl-mode-syntax-table)
(modify-syntax-entry ?\] ")[" vhdl-mode-syntax-table)
(modify-syntax-entry ?\{ "(}" vhdl-mode-syntax-table)
(modify-syntax-entry ?\} "){" vhdl-mode-syntax-table)
;; extended syntax table including '_' (for simpler search regexps)
(setq vhdl-mode-ext-syntax-table (copy-syntax-table vhdl-mode-syntax-table))
(modify-syntax-entry ?_ "w" vhdl-mode-ext-syntax-table))
;; initialize syntax table for VHDL Mode
(vhdl-mode-syntax-table-init)
(defvar vhdl-syntactic-context nil
"Buffer local variable containing syntactic analysis list.")
(make-variable-buffer-local 'vhdl-syntactic-context)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment