"Turn a LIST of strings into a single regular expression at compile-time."
(declare (indent nil)
(debug 0))
- `',(make-regexp list))
+ `',(make-regexp (sort (copy-list list) #'string<)))
(defun mdw-wrong ()
"This is not the key sequence you're looking for."
(let ((key (car item)) (value (cdr item)))
(if (let* ((key-name (symbol-name key))
(key-len (length key-name)))
- (and (>= key-len 5)
- (string= (subseq key-name (- key-len 5)) "-alist")))
+ (and (>= key-len 6)
+ (string= (subseq key-name (- key-len 6)) "-alist")))
(push (cons key
(mdw-merge-style-alists value
(cdr (assoc key second))))
;; And anything else is punctuation.
(list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
'(0 mdw-punct-face)))
- font-lock-syntactic-face-function . nil))
+ font-lock-syntactic-face-function nil))
;; Hack key bindings.
(local-set-key [?{] 'mdw-self-insert-and-indent)
(defun mdw-fontify-python ()
(mdw-fontify-pythonic
- (mdw-regexps "and" "as" "assert" "break" "class" "continue" "def"
- "del" "elif" "else" "except" "exec" "finally" "for"
- "from" "global" "if" "import" "in" "is" "lambda"
- "not" "or" "pass" "print" "raise" "return" "try"
- "while" "with" "yield")))
+ (mdw-regexps "and" "as" "assert"
+ "break"
+ "class" "continue"
+ "def" "del"
+ "elif" "else" "except" "exec"
+ "finally" "for" "from"
+ "global"
+ "if" "import" "in" "is"
+ "lambda"
+ "not"
+ "or"
+ "pass" "print"
+ "raise" "return"
+ "try"
+ "while" "with"
+ "yield")))
(defun mdw-fontify-pyrex ()
(mdw-fontify-pythonic