chiark / gitweb /
Merge branch 'master' of us:etc/profile
authorMark Wooding <mdw@distorted.org.uk>
Mon, 28 Dec 2015 14:25:35 +0000 (14:25 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 28 Dec 2015 14:25:35 +0000 (14:25 +0000)
* 'master' of us:etc/profile:
  el/dot-emacs.el: Set indent quantum for plain `perl-mode'.

1  2 
el/dot-emacs.el

diff --combined el/dot-emacs.el
index 0967471a783a105d9cef5036fcbc04185a80ec0f,316b9e050266b8bfe6d5062f6520a684c0db5182..2fb1520d6fd390ce7299018b939ae9f3155a6674
@@@ -810,8 -810,6 +810,8 @@@ case.
        (whitespace-mode arg))
      (setq show-trailing-whitespace whitespace-mode)))
  
 +(defvar mdw-do-misc-mode-hacking nil)
 +
  (defun mdw-misc-mode-config ()
    (and mdw-auto-indent
         (cond ((eq major-mode 'lisp-mode)
              nil)
             (t
              (local-set-key "\C-m" 'newline-and-indent))))
 +  (set (make-local-variable 'mdw-do-misc-mode-hacking) t)
    (local-set-key [C-return] 'newline)
    (make-local-variable 'page-delimiter)
    (setq page-delimiter "\f\\|^.*-\\{6\\}.*$")
    (setq comment-column 40)
    (auto-fill-mode 1)
    (setq fill-column 77)
 -  (setq show-trailing-whitespace t)
 -  (mdw-whitespace-mode 1)
    (and (fboundp 'gtags-mode)
         (gtags-mode))
    (if (fboundp 'hs-minor-mode)
    (reveal-mode t)
    (trap (turn-on-font-lock)))
  
 -(defun mdw-post-config-mode-hack ()
 -  (mdw-whitespace-mode 1))
 +(defun mdw-post-local-vars-misc-mode-config ()
 +  (when (and mdw-do-misc-mode-hacking
 +           (not buffer-read-only))
 +    (setq show-trailing-whitespace t)
 +    (mdw-whitespace-mode 1)))
 +(add-hook 'hack-local-variables-hook 'mdw-post-local-vars-misc-mode-config)
 +
 +(defadvice toggle-read-only (after mdw-angry-fruit-salad activate)
 +  (when mdw-do-misc-mode-hacking
 +    (setq show-trailing-whitespace (not buffer-read-only))
 +    (mdw-whitespace-mode (if buffer-read-only 0 1))))
  
  (eval-after-load 'gtags
    '(progn
@@@ -1236,7 -1226,7 +1236,7 @@@ doesn't match any of the regular expres
  (mdw-define-face mdw-ellipsis-face
    (((type tty)) :foreground "blue") (t :foreground "grey60"))
  (let ((dollar (make-glyph-code ?$ 'mdw-ellipsis-face))
 -      (backslash (make-glyph-code ?\ 'mdw-ellipsis-face))
 +      (backslash (make-glyph-code ?\\ 'mdw-ellipsis-face))
        (dot (make-glyph-code ?. 'mdw-ellipsis-face))
        (bar (make-glyph-code ?| mdw-ellipsis-face)))
    (set-display-table-slot standard-display-table 0 dollar)
  
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face))))
 -
 -    (mdw-post-config-mode-hack)))
 +               '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; AP calc mode.
  
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Java programming configuration.
  
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Javascript programming configuration.
  
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Scala programming configuration.
                         "\\|" "\\\\" "." "\\)"
                         "\\('\\)")
                 '(1 "\"")
 -               '(4 "\"")))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(4 "\""))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; C# programming configuration.
  
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  (define-derived-mode csharp-mode java-mode "C#"
    "Major mode for editing C# code.")
                      '(0 mdw-number-face))
  
                (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -                    '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +                    '(0 mdw-punct-face))))))
  
  (defun mdw-fontify-inferior-fsharp ()
    (mdw-fontify-fsharp)
  
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Rust programming configuration.
  
    ;; Hack key bindings.
    (local-set-key [?{] 'mdw-self-insert-and-indent)
 -  (local-set-key [?}] 'mdw-self-insert-and-indent)
 -
 -  ;; Final hacking.
 -  (mdw-post-config-mode-hack))
 +  (local-set-key [?}] 'mdw-self-insert-and-indent))
  
  ;;;--------------------------------------------------------------------------
  ;;; Awk programming configuration.
  
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Perl programming style.
  
  ;; Perl indentation style.
  
+ (setq perl-indent-level 2)
  (setq cperl-indent-level 2)
  (setq cperl-continued-statement-offset 2)
  (setq cperl-continued-brace-offset 0)
  
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  (defun perl-number-tests (&optional arg)
    "Assign consecutive numbers to lines containing `#t'.  With ARG,
@@@ -2212,7 -2227,9 +2214,7 @@@ strip numbers instead.
  
         ;; And anything else is punctuation.
         (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -             '(0 mdw-punct-face))))
 -
 -  (mdw-post-config-mode-hack))
 +             '(0 mdw-punct-face)))))
  
  ;; Define Python fontification styles.
  
  
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Assembler mode.
                       "\\([eE]\\([-+]\\|\\)[0-9_]+\\|\\)")
               '(0 mdw-number-face))
         (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -             '(0 mdw-punct-face))))
 -  (mdw-post-config-mode-hack))
 +             '(0 mdw-punct-face)))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Dylan programming configuration.
                              "\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\|"
                              "\\_<[-+*/=<>:&|]+\\_>"
                              "\\)")
 -                    '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +                    '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Algol 68 configuration.
                              "\\>")
                      '(0 mdw-number-face))
                (list "\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/"
 -                    '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +                    '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; REXX configuration.
  
           ;; And everything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Standard ML programming style.
  
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Haskell configuration.
                         "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)")
                 '(0 mdw-number-face))
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Erlang configuration.
           (list "\\<[0-9]+\\(\\|#[0-9a-zA-Z]+\\|[eE][+-]?[0-9]+\\)\\>"
                 '(0 mdw-number-face))
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -               '(0 mdw-punct-face)))))
 -
 -  (mdw-post-config-mode-hack))
 +               '(0 mdw-punct-face))))))
  
  ;;;--------------------------------------------------------------------------
  ;;; Texinfo configuration.
  
         ;; Fontify TeX special characters as punctuation.
         (list "[{}]+"
 -             '(0 mdw-punct-face))))
 -
 -  (mdw-post-config-mode-hack))
 +             '(0 mdw-punct-face)))))
  
  ;;;--------------------------------------------------------------------------
  ;;; TeX and LaTeX configuration.
  
         ;; Fontify TeX special characters as punctuation.
         (list "[$^_{}#&]"
 -             '(0 mdw-punct-face))))
 -
 -  (mdw-post-config-mode-hack))
 +             '(0 mdw-punct-face)))))
  
  ;;;--------------------------------------------------------------------------
  ;;; SGML hacking.
@@@ -3122,7 -3158,8 +3124,7 @@@ that character only to be normal punctu
                       "\\([eE]\\([-+]\\|\\)[0-9_]+\\|\\)")
               '(0 mdw-number-face))
         (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -             '(0 mdw-punct-face))))
 -  (mdw-post-config-mode-hack))
 +             '(0 mdw-punct-face)))))
  
  ;; Lispy languages.
  
                            "\\)\\_>")
                    '(0 mdw-number-face))
              (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
 -                  '(0 mdw-punct-face))))
 -
 -  (mdw-post-config-mode-hack))
 +                  '(0 mdw-punct-face)))))
  
  (defun comint-send-and-indent ()
    (interactive)