el/dot-emacs.el: Treat the Python soft keywords more carefully.
[profile] / el / dot-emacs.el
index f3fffe9..cd648c1 100644 (file)
@@ -633,6 +633,17 @@ Evil key bindings are defined in `mdw-evil-keymap-keys'."
                                         :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)))
@@ -3439,7 +3450,7 @@ strip numbers instead."
              python-indent-offset 2
              python-fill-docstring-style 'symmetric)
 
-(defun mdw-fontify-pythonic (keywords builtins)
+(defun mdw-fontify-pythonic (keywords soft-keywords builtins)
 
   ;; Miscellaneous fiddling.
   (mdw-standard-fill-prefix "\\([ \t]*#+[ \t]*\\)")
@@ -3454,6 +3465,8 @@ strip numbers instead."
           ;; 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_+\\)+__\\)\\_>")
@@ -3475,14 +3488,13 @@ strip numbers instead."
   (mdw-fontify-pythonic
    (mdw-regexps "and" "as" "assert" "async" "await"
                "break"
-               "case" "class" "continue"
+               "class" "continue"
                "def" "del"
                "elif" "else" "except" ;"exec"
                "finally" "for" "from"
                "global"
                "if" "import" "in" "is"
                "lambda"
-               "match"
                "nonlocal"
                "not"
                "or"
@@ -3492,6 +3504,9 @@ strip numbers instead."
                "while" "with"
                "yield")
 
+   (mdw-regexps "case"
+               "match")
+
    (mdw-regexps "Ellipsis"
                "False"
                "None" "NotImplemented"
@@ -3604,6 +3619,7 @@ strip numbers instead."
                "import" "in" "is" "lambda" "not" "or" "pass" "print"
                "property" "raise" "return" "struct" "try" "while" "with"
                "yield")
+   ""
    ""))
 
 (define-derived-mode pyrex-mode python-mode "Pyrex"