"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."
:key-type string
:value-type string))))
+(setq org-emphasis-regexp-components
+ '("- \t('\"{}" ; prematch
+ "- \t.,:!?;'\")}\\[" ; postmatch
+ " \t\r\n" ; /forbidden/ as border
+ "." ; body regexp
+ 1)) ; maximum newlines
+
+(setq org-entities-user
+ ;; NAME LATEX MATHP HTML ASCII LATIN1 UTF8
+ '(("relax" "" nil "" "" "" "")))
+
(eval-after-load "org-latex"
'(setq org-export-latex-classes
(append mdw-org-latex-defs org-export-latex-classes)))
("" "hyperref" nil)
"\\tolerance=1000")))
-
(setq org-export-docbook-xslt-proc-command "xsltproc --output %o %s %i"
org-export-docbook-xsl-fo-proc-command "fop %i.safe %o"
org-export-docbook-xslt-stylesheet
;; 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)
python-indent-offset 2
python-fill-docstring-style 'symmetric)
-(defun mdw-fontify-pythonic (keywords)
+(defun mdw-fontify-pythonic (keywords soft-keywords builtins)
;; Miscellaneous fiddling.
(mdw-standard-fill-prefix "\\([ \t]*#+[ \t]*\\)")
;; Set up the keywords defined above.
(list (concat "\\_<\\(" keywords "\\)\\_>")
'(0 font-lock-keyword-face))
+ (list (concat "\\(^\\|[^.]\\)\\_<\\(" soft-keywords "\\)\\_>")
+ '(2 font-lock-keyword-face))
+ (list (concat "\\(^\\|[^.]\\)\\_<\\(" builtins "\\)\\_>")
+ '(2 font-lock-variable-name-face))
+ (list (concat "\\_<\\(__\\(\\sw+\\|\\s_+\\)+__\\)\\_>")
+ '(0 font-lock-variable-name-face))
;; At least numbers are simpler than C.
(list (concat "\\_<0\\([xX][0-9a-fA-F]+\\|[oO]?[0-7]+\\|[bB][01]+\\)\\|"
(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" "async" "await"
+ "break"
+ "class" "continue"
+ "def" "del"
+ "elif" "else" "except" ;"exec"
+ "finally" "for" "from"
+ "global"
+ "if" "import" "in" "is"
+ "lambda"
+ "nonlocal"
+ "not"
+ "or"
+ "pass" ;"print"
+ "raise" "return"
+ "try" ;"type"
+ "while" "with"
+ "yield")
+
+ (mdw-regexps "case"
+ "match")
+
+ (mdw-regexps "Ellipsis"
+ "False"
+ "None" "NotImplemented"
+ "True"
+ "__debug__"
+
+ "BaseException"
+ "BaseExceptionGroup"
+ "Exception"
+ "StandardError"
+ "ArithmeticError"
+ "FloatingPointError"
+ "OverflowError"
+ "ZeroDivisionError"
+ "AssertionError"
+ "AttributeError"
+ "BufferError"
+ "EnvironmentError"
+ "IOError"
+ "OSError"
+ "BlockingIOError"
+ "ChildProcessError"
+ "ConnectionError"
+ "BrokenPipeError"
+ "ConnectionAbortedError"
+ "ConnectionRefusedError"
+ "ConnectionResetError"
+ "FileExistsError"
+ "FileNotFoundError"
+ "InterruptedError"
+ "IsADirectoryError"
+ "NotADirectoryError"
+ "PermissionError"
+ "TimeoutError"
+ "EOFError"
+ "ExceptionGroup"
+ "ImportError"
+ "ModuleNotFoundError"
+ "LookupError"
+ "IndexError"
+ "KeyError"
+ "MemoryError"
+ "NameError"
+ "UnboundLocalError"
+ "ReferenceError"
+ "RuntimeError"
+ "NotImplementedError"
+ "RecursionError"
+ "SyntaxError"
+ "IndentationError"
+ "TabError"
+ "SystemError"
+ "TypeError"
+ "ValueError"
+ "UnicodeError"
+ "UnicodeDecodeError"
+ "UnicodeEncodeError"
+ "UnicodeTranslateError"
+ "StopIteration"
+ "Warning"
+ "BytesWarning"
+ "DeprecationWarning"
+ "EncodingWarning"
+ "FutureWarning"
+ "ImportWarning"
+ "PendingDeprecationWarning"
+ "ResourceWarning"
+ "RuntimeWarning"
+ "SyntaxWarning"
+ "UnicodeWarning"
+ "UserWarning"
+ "GeneratorExit"
+ "KeyboardInterrupt"
+ "SystemExit"
+
+ "abs" "absolute_import" "aiter"
+ "all" "anext" "any" "apply" "ascii"
+ "basestring" "bin" "bool" "breakpoint"
+ "buffer" "bytearray" "bytes"
+ "callable" "coerce" "chr" "classmethod"
+ "cmp" "compile" "complex"
+ "delattr" "dict" "dir" "divmod"
+ "enumerate" "eval" "exec" "execfile"
+ "file" "filter" "float" "format" "frozenset"
+ "getattr" "globals"
+ "hasattr" "hash" "help" "hex"
+ "id" "input" "int" "intern"
+ "isinstance" "issubclass" "iter"
+ "len" "list" "locals" "long"
+ "map" "max" "memoryview" "min"
+ "next"
+ "object" "oct" "open" "ord"
+ "pow" "print" "property"
+ "range" "raw_input" "reduce" "reload"
+ "repr" "reversed" "round"
+ "set" "setattr" "slice" "sorted"
+ "staticmethod" "str" "sum" "super"
+ "tuple" "type"
+ "unichr" "unicode"
+ "vars"
+ "xrange"
+ "zip"
+ "__import__")))
(defun mdw-fontify-pyrex ()
(mdw-fontify-pythonic
"extern" "finally" "for" "from" "global" "if"
"import" "in" "is" "lambda" "not" "or" "pass" "print"
"property" "raise" "return" "struct" "try" "while" "with"
- "yield")))
+ "yield")
+ ""
+ ""))
(define-derived-mode pyrex-mode python-mode "Pyrex"
"Major mode for editing Pyrex source code")