el/dot-emacs.el: Include a (completely trivial) mode for Sod.
[profile] / el / dot-emacs.el
index 93cec99..70caba7 100644 (file)
@@ -321,13 +321,13 @@ Interactively, prompt for the command if the variable
 the prefix argument.  Prompt for the directory, and run
 interactively, if requested through the prefix.
 
-Use a prefix of 4, 5, 6, or 7, or type C-u between one and three times, to
+Use a prefix of 4, 6, 12, or 14, or type C-u between one and three times, to
 force prompting for a directory.
 
-Use a prefix of 2, 3, 6, or 7, or type C-u three times, to force
+Use a prefix of 2, 6, 10, or 14, or type C-u three times, to force
 prompting for the command.
 
-Use a prefix of 1, 3, 5, or 7, or type C-u twoce or three times,
+Use a prefix of 8, 10, 12, or 14, or type C-u twice or three times,
 to force interactive compilation."
   (interactive
    (let* ((prefix (prefix-numeric-value current-prefix-arg))
@@ -339,7 +339,7 @@ to force interactive compilation."
               (compilation-read-command command)
             command)
           dir
-          (plusp (logand prefix #x51)))))
+          (plusp (logand prefix #x58)))))
   (let ((default-directory (or directory default-directory)))
     (compile command comint)))
 
@@ -1889,6 +1889,10 @@ name, as a symbol."
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
                 '(0 mdw-punct-face))))))
 
+(define-derived-mode sod-mode c-mode "Sod"
+  "Major mode for editing Sod code.")
+(push '("\\.sod$" . sod-mode) auto-mode-alist)
+
 ;;;--------------------------------------------------------------------------
 ;;; AP calc mode.
 
@@ -2427,13 +2431,13 @@ name, as a symbol."
          (list
 
           ;; Handle the keywords defined above.
-          (list (concat "\\<\\(" rust-keywords "\\)\\>")
+          (list (concat "\\_<\\(" rust-keywords "\\)\\_>")
                 '(0 font-lock-keyword-face))
-          (list (concat "\\<\\(" rust-builtins "\\)\\>")
+          (list (concat "\\_<\\(" rust-builtins "\\)\\_>")
                 '(0 font-lock-variable-name-face))
 
           ;; Handle numbers too.
-          (list (concat "\\<\\("
+          (list (concat "\\_<\\("
                               "[0-9][0-9_]*"
                               "\\(" "\\(\\.[0-9_]+\\)?[eE][-+]?[0-9_]+"
                               "\\|" "\\.[0-9_]+"
@@ -2445,7 +2449,7 @@ name, as a symbol."
                               "\\|" "0b[01_]+"
                               "\\)"
                               "\\([ui]\\(8\\|16\\|32\\|64\\|s\\|size\\)\\)?"
-                        "\\)\\>")
+                        "\\)\\_>")
                 '(0 mdw-number-face))
 
           ;; And anything else is punctuation.
@@ -3158,7 +3162,7 @@ strip numbers instead."
   (local-set-key [?$] 'self-insert-command)
 
   ;; Make `tab' be useful, given that tab stops in TeX don't work well.
-  (local-set-key "\C-i" 'indent-relative)
+  (local-set-key "\C-\M-i" 'indent-relative)
   (setq indent-tabs-mode nil)
 
   ;; Set fill prefix.
@@ -3677,6 +3681,9 @@ that character only to be normal punctuation.")
    "\\([ \t]*\\([>#|:] ?\\)*[ \t]*\\)" 3)
   (auto-fill-mode 1))
 
+(eval-after-load "flyspell"
+  '(define-key flyspell-mode-map "\C-\M-i" nil))
+
 ;;;--------------------------------------------------------------------------
 ;;; Outline and hide/show modes.
 
@@ -3879,6 +3886,18 @@ there is sadness."
 (mdw-define-mpc-wrapper mdw-mpc-prev () nil (mpc-prev))
 (mdw-define-mpc-wrapper mdw-mpc-stop () nil (mpc-stop))
 
+(defun mdw-mpc-louder (step)
+  (interactive (list (if current-prefix-arg
+                        (prefix-numeric-value current-prefix-arg)
+                      +10)))
+  (mpc-proc-cmd (format "volume %+d" step)))
+
+(defun mdw-mpc-quieter (step)
+  (interactive (list (if current-prefix-arg
+                        (prefix-numeric-value current-prefix-arg)
+                      +10)))
+  (mpc-proc-cmd (format "volume %+d" (- step))))
+
 (defun mdw-mpc-hack-lines (arg interactivep func)
   (if (and interactivep (use-region-p))
       (let ((from (region-beginning)) (to (region-end)))