;;; Lexical analysis
;;
(defconst semantic-java-number-regexp
- (eval-when-compile
- (concat "\\("
- "\\<[0-9]+[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[.][eE][-+]?[0-9]+[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[.][fFdD]\\>"
- "\\|"
- "\\<[0-9]+[.]"
- "\\|"
- "[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
- "\\|"
- "\\<0[xX][[:xdigit:]]+[lL]?\\>"
- "\\|"
- "\\<[0-9]+[lLfFdD]?\\>"
- "\\)"
- ))
+ (concat "\\("
+ "\\<[0-9]+[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[.][eE][-+]?[0-9]+[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[.][fFdD]\\>"
+ "\\|"
+ "\\<[0-9]+[.]"
+ "\\|"
+ "[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
+ "\\|"
+ "\\<0[xX][[:xdigit:]]+[lL]?\\>"
+ "\\|"
+ "\\<[0-9]+[lLfFdD]?\\>"
+ "\\)"
+ )
"Lexer regexp to match Java number terminals.
Following is the specification of Java number literals.
(defvar-local semantic-lex-number-expression
;; This expression was written by David Ponce for Java, and copied
;; here for C and any other similar language.
- (eval-when-compile
- (concat "\\("
- "\\<[0-9]+[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[.][eE][-+]?[0-9]+[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[.][fFdD]\\>"
- "\\|"
- "\\<[0-9]+[.]"
- "\\|"
- "[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
- "\\|"
- "\\<0[xX][[:xdigit:]]+[lL]?\\>"
- "\\|"
- "\\<[0-9]+[lLfFdD]?\\>"
- "\\)"
- ))
+ (concat "\\("
+ "\\<[0-9]+[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[.][eE][-+]?[0-9]+[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[.][fFdD]\\>"
+ "\\|"
+ "\\<[0-9]+[.]"
+ "\\|"
+ "[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
+ "\\|"
+ "\\<0[xX][[:xdigit:]]+[lL]?\\>"
+ "\\|"
+ "\\<[0-9]+[lLfFdD]?\\>"
+ "\\)"
+ )
"Regular expression for matching a number.
If this value is nil, no number extraction is done during lex.
This expression tries to match C and Java like numbers.
function)
(setq tentative-defun t))
((string-match
- (eval-when-compile
- (concat "\\`\\("
- (regexp-opt '("with" "without" "do"))
- "\\)-"))
+ (concat "\\`\\("
+ (regexp-opt '("with" "without" "do"))
+ "\\)-")
function)
(setq method '(&lambda &body))))))
;; backwards compatibility. Bletch.
(list
(list nil
(purecopy (concat "^\\s-*("
- (eval-when-compile
- (regexp-opt
- '("defun" "defmacro"
- ;; Elisp.
- "defun*" "defsubst" "define-inline"
- "define-advice" "defadvice" "define-skeleton"
- "define-compilation-mode" "define-minor-mode"
- "define-global-minor-mode"
- "define-globalized-minor-mode"
- "define-derived-mode" "define-generic-mode"
- "ert-deftest"
- "cl-defun" "cl-defsubst" "cl-defmacro"
- "cl-define-compiler-macro" "cl-defgeneric"
- "cl-defmethod"
- ;; CL.
- "define-compiler-macro" "define-modify-macro"
- "defsetf" "define-setf-expander"
- "define-method-combination"
- ;; CLOS and EIEIO
- "defgeneric" "defmethod")
- t))
+ (regexp-opt
+ '("defun" "defmacro"
+ ;; Elisp.
+ "defun*" "defsubst" "define-inline"
+ "define-advice" "defadvice" "define-skeleton"
+ "define-compilation-mode" "define-minor-mode"
+ "define-global-minor-mode"
+ "define-globalized-minor-mode"
+ "define-derived-mode" "define-generic-mode"
+ "ert-deftest"
+ "cl-defun" "cl-defsubst" "cl-defmacro"
+ "cl-define-compiler-macro" "cl-defgeneric"
+ "cl-defmethod"
+ ;; CL.
+ "define-compiler-macro" "define-modify-macro"
+ "defsetf" "define-setf-expander"
+ "define-method-combination"
+ ;; CLOS and EIEIO
+ "defgeneric" "defmethod")
+ t)
"\\s-+\\(" (rx lisp-mode-symbol) "\\)"))
2)
;; Like the previous, but uses a quoted symbol as the name.
(list nil
(purecopy (concat "^\\s-*("
- (eval-when-compile
- (regexp-opt
- '("defalias" "define-obsolete-function-alias")
- t))
+ (regexp-opt
+ '("defalias" "define-obsolete-function-alias")
+ t)
"\\s-+'\\(" (rx lisp-mode-symbol) "\\)"))
2)
(list (purecopy "Variables")
(purecopy (concat "^\\s-*("
- (eval-when-compile
- (regexp-opt
- '(;; Elisp
- "defconst" "defcustom"
- ;; CL
- "defconstant"
- "defparameter" "define-symbol-macro")
- t))
+ (regexp-opt
+ '(;; Elisp
+ "defconst" "defcustom"
+ ;; CL
+ "defconstant"
+ "defparameter" "define-symbol-macro")
+ t)
"\\s-+\\(" (rx lisp-mode-symbol) "\\)"))
2)
;; For `defvar'/`defvar-local', we ignore (defvar FOO) constructs.
1)
(list (purecopy "Types")
(purecopy (concat "^\\s-*("
- (eval-when-compile
- (regexp-opt
- '(;; Elisp
- "defgroup" "deftheme"
- "define-widget" "define-error"
- "defface" "cl-deftype" "cl-defstruct"
- ;; CL
- "deftype" "defstruct"
- "define-condition" "defpackage"
- ;; CLOS and EIEIO
- "defclass")
- t))
+ (regexp-opt
+ '(;; Elisp
+ "defgroup" "deftheme"
+ "define-widget" "define-error"
+ "defface" "cl-deftype" "cl-defstruct"
+ ;; CL
+ "deftype" "defstruct"
+ "define-condition" "defpackage"
+ ;; CLOS and EIEIO
+ "defclass")
+ t)
"\\s-+'?\\(" (rx lisp-mode-symbol) "\\)"))
2))
;; FIXME: Move to elisp-mode.el.
(catch 'found
(while (re-search-forward
- (eval-when-compile
- (concat "(\\(" (rx lisp-mode-symbol) "\\)\\_>"))
+ (concat "(\\(" (rx lisp-mode-symbol) "\\)\\_>")
limit t)
(let ((sym (intern-soft (match-string 1))))
(when (and (or (special-form-p sym) (macrop sym))
"Gaudy highlighting from Emacs Lisp mode used in Backtrace mode.")
(defun lisp-string-in-doc-position-p (listbeg startpos)
- "Return non-nil if a doc string may occur at STARTPOS inside a list.
+ "Return non-nil if a doc string may occur at STARTPOS inside a list.
LISTBEG is the position of the start of the innermost list
containing STARTPOS."
(let* ((firstsym (and listbeg
(save-excursion
(goto-char listbeg)
(and (looking-at
- (eval-when-compile
- (concat "([ \t\n]*\\("
- (rx lisp-mode-symbol) "\\)")))
+ (concat "([ \t\n]*\\("
+ (rx lisp-mode-symbol) "\\)"))
(match-string 1)))))
(docelt (and firstsym
(function-get (intern-soft firstsym)
(defun shorthands-font-lock-shorthands (limit)
(when read-symbol-shorthands
(while (re-search-forward
- (eval-when-compile
- (concat "\\_<\\(" (rx lisp-mode-symbol) "\\)\\_>"))
+ (concat "\\_<\\(" (rx lisp-mode-symbol) "\\)\\_>")
limit t)
(let* ((existing (get-text-property (match-beginning 1) 'face))
(probe (and (not (memq existing '(font-lock-comment-face
(setq version (process-get proc 'socks-server-protocol))
(cond
((equal version 'http)
- (setq request (format (eval-when-compile
- (concat
- "CONNECT %s:%d HTTP/1.0\r\n"
- "User-Agent: Emacs/SOCKS v1.0\r\n"
- "\r\n"))
+ (setq request (format (concat
+ "CONNECT %s:%d HTTP/1.0\r\n"
+ "User-Agent: Emacs/SOCKS v1.0\r\n"
+ "\r\n")
(cond
((equal atype socks-address-type-name) address)
(t
(macro-keywords-2
"\\(primarydef\\|secondarydef\\|tertiarydef\\)")
(args-keywords
- (eval-when-compile
- (regexp-opt
- '("expr" "suffix" "text" "primary" "secondary" "tertiary")
- t)))
+ (regexp-opt
+ '("expr" "suffix" "text" "primary" "secondary" "tertiary")
+ t))
(type-keywords
- (eval-when-compile
- (regexp-opt
- '("boolean" "color" "numeric" "pair" "path" "pen" "picture"
- "string" "transform" "newinternal")
- t)))
+ (regexp-opt
+ '("boolean" "color" "numeric" "pair" "path" "pen" "picture"
+ "string" "transform" "newinternal")
+ t))
(syntactic-keywords
- (eval-when-compile
- (regexp-opt
- '("for" "forever" "forsuffixes" "endfor"
- "step" "until" "upto" "downto" "thru" "within"
- "iff" "if" "elseif" "else" "fi" "exitif" "exitunless"
- "let" "def" "vardef" "enddef" "mode_def"
- "true" "false" "known" "unknown" "and" "or" "not"
- "save" "interim" "inner" "outer" "relax"
- "begingroup" "endgroup" "expandafter" "scantokens"
- "generate" "input" "endinput" "end" "bye"
- "message" "errmessage" "errhelp" "special" "numspecial"
- "readstring" "readfrom" "write")
- t)))
+ (regexp-opt
+ '("for" "forever" "forsuffixes" "endfor"
+ "step" "until" "upto" "downto" "thru" "within"
+ "iff" "if" "elseif" "else" "fi" "exitif" "exitunless"
+ "let" "def" "vardef" "enddef" "mode_def"
+ "true" "false" "known" "unknown" "and" "or" "not"
+ "save" "interim" "inner" "outer" "relax"
+ "begingroup" "endgroup" "expandafter" "scantokens"
+ "generate" "input" "endinput" "end" "bye"
+ "message" "errmessage" "errhelp" "special" "numspecial"
+ "readstring" "readfrom" "write")
+ t))
)
(list
;; embedded TeX code in btex ... etex
(push (point) begins)
(let ((arg ()))
(while (looking-at
- (eval-when-compile
- (concat
- "\\(?:[^\s\t\n\\\"';]+"
- "\\|'\\([^']*\\)'?"
- "\\|\"\\(\\(?:[^\"\\]\\|\\\\.\\)*\\)\"?"
- "\\|\\\\\\(\\(?:.\\|\n\\)?\\)\\)")))
+ (concat
+ "\\(?:[^\s\t\n\\\"';]+"
+ "\\|'\\([^']*\\)'?"
+ "\\|\"\\(\\(?:[^\"\\]\\|\\\\.\\)*\\)\"?"
+ "\\|\\\\\\(\\(?:.\\|\n\\)?\\)\\)"))
(goto-char (match-end 0))
(cond
((match-beginning 3) ;Backslash escape.
(setq-local tildify-foreach-region-function
(apply-partially
'tildify-foreach-ignore-environments
- `((,(eval-when-compile
- (concat
- "<\\("
- (regexp-opt '("pre" "dfn" "code" "samp" "kbd" "var"
- "PRE" "DFN" "CODE" "SAMP" "KBD" "VAR"))
- "\\)\\>[^>]*>"))
+ `((,(concat
+ "<\\("
+ (regexp-opt '("pre" "dfn" "code" "samp" "kbd" "var"
+ "PRE" "DFN" "CODE" "SAMP" "KBD" "VAR"))
+ "\\)\\>[^>]*>")
. ("</" 1 ">"))
("<! *--" . "-- *>")
("<" . ">"))))
(when (and slash (not comment))
(setq mode
(if (looking-at
- (eval-when-compile
- (concat
- (regexp-opt '("documentstyle" "documentclass"
- "begin" "subsection" "section"
- "part" "chapter" "newcommand"
- "renewcommand" "RequirePackage")
- 'words)
- "\\|NeedsTeXFormat{LaTeX")))
+ (concat
+ (regexp-opt '("documentstyle" "documentclass"
+ "begin" "subsection" "section"
+ "part" "chapter" "newcommand"
+ "renewcommand" "RequirePackage")
+ 'words)
+ "\\|NeedsTeXFormat{LaTeX"))
(if (and (looking-at
"document\\(style\\|class\\)\\(\\[.*\\]\\)?{slides}")
;; SliTeX is almost never used any more nowadays.
(apply-partially
#'tildify-foreach-ignore-environments
`(("\\\\\\\\" . "") ; do not remove this
- (,(eval-when-compile
- (concat "\\\\begin{\\("
- (regexp-opt '("verbatim" "math" "displaymath"
- "equation" "eqnarray" "eqnarray*"))
- "\\)}"))
+ (,(concat "\\\\begin{\\("
+ (regexp-opt '("verbatim" "math" "displaymath"
+ "equation" "eqnarray" "eqnarray*"))
+ "\\)}")
. ("\\\\end{" 1 "}"))
("\\\\verb\\*?\\(.\\)" . (1))
("\\$\\$?" . (0))
(defvar tex-compile-history nil)
(defvar tex-input-files-re
- (eval-when-compile
- (concat "\\." (regexp-opt '("tex" "texi" "texinfo"
- "bbl" "ind" "sty" "cls") t)
- ;; Include files with no dots (for directories).
- "\\'\\|\\`[^.]+\\'")))
+ (concat "\\." (regexp-opt '("tex" "texi" "texinfo"
+ "bbl" "ind" "sty" "cls") t)
+ ;; Include files with no dots (for directories).
+ "\\'\\|\\`[^.]+\\'"))
(defcustom tex-use-reftex t
"If non-nil, use RefTeX's list of files to determine what command to use."
(if (not (string-equal " " (or space tildify-space-string)))
(when space
(setq tildify-space-string space))
- (message (eval-when-compile
- (concat "Hard space is a single space character, tildify-"
- "mode won't have any effect, disabling.")))
+ (message (concat "Hard space is a single space character, tildify-"
+ "mode won't have any effect, disabling."))
(setq tildify-mode nil))))
(if tildify-mode
(add-hook 'post-self-insert-hook #'tildify-space nil t)
;; https://www.freedesktop.org/wiki/Software/xdg-user-dirs/
(defconst xdg-line-regexp
- (eval-when-compile
- (rx "XDG_"
- (group-n 1 (or "DESKTOP" "DOWNLOAD" "TEMPLATES" "PUBLICSHARE"
- "DOCUMENTS" "MUSIC" "PICTURES" "VIDEOS"))
- "_DIR=\""
- (group-n 2 (or "/" "$HOME/") (*? (or (not (any "\"")) "\\\"")))
- "\""))
+ (rx "XDG_"
+ (group-n 1 (or "DESKTOP" "DOWNLOAD" "TEMPLATES" "PUBLICSHARE"
+ "DOCUMENTS" "MUSIC" "PICTURES" "VIDEOS"))
+ "_DIR=\""
+ (group-n 2 (or "/" "$HOME/") (*? (or (not (any "\"")) "\\\"")))
+ "\"")
"Regexp matching non-comment lines in `xdg-user-dirs' config files.")
(defvar xdg-user-dirs nil