From: Stefan Bund Date: Fri, 23 May 2014 10:15:00 +0000 (+0200) Subject: add develock-py.el X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=5d0b8238ad6fb712c8e744eb150b1ad793e412f9;p=emacs-init.git add develock-py.el --- diff --git a/lib/develock-py.el b/lib/develock-py.el new file mode 100644 index 0000000..c593eb0 --- /dev/null +++ b/lib/develock-py.el @@ -0,0 +1,58 @@ +;; +;; develock-py.el +;; +;; Made by Daniel Farina +;; Login +;; +;; Started on Sun Feb 14 09:21:21 2010 Daniel Farina +;; Last update Sun Feb 14 09:27:12 2010 Daniel Farina +;; + +(require 'develock) + +(defcustom develock-python-font-lock-keywords + '(;; a long line + (develock-find-long-lines + (1 'develock-long-line-1 t) + (2 'develock-long-line-2 t)) + ;; long spaces + (develock-find-tab-or-long-space + (1 'develock-whitespace-2) + (2 'develock-whitespace-3 nil t)) + ;; trailing whitespace + ("[^\t\n ]\\([\t ]+\\)$" + (1 'develock-whitespace-1 t)) + ;; spaces before tabs + ("\\( +\\)\\(\t+\\)" + (1 'develock-whitespace-1 t) + (2 'develock-whitespace-2 t)) + ;; tab space tab + ("\\(\t\\) \t" + (1 'develock-whitespace-2 append)) + ;; only tabs or spaces in the line + ("^[\t ]+$" + (0 'develock-whitespace-2 append)) + ;; reachable E-mail addresses + ("?" + (0 'develock-reachable-mail-address t)) + ;; things to be paid attention + ("\\<\\(?:[Ff][Ii][Xx][Mm][Ee]\\|[Tt][Oo][Dd][Oo]\\)\\(?::\\|\\>\\)" + (0 'develock-upper-case-tag-face t))) + "Extraordinary level highlighting for the Python mode." + :type develock-keywords-custom-type + :set 'develock-keywords-custom-set + :group 'develock + :group 'font-lock) + +(defvar python-font-lock-keywords-x nil + "Extraordinary level font-lock keywords for the Python mode.") + +(setq develock-keywords-alist + (cons '(python-mode + python-font-lock-keywords-x + develock-python-font-lock-keywords) + develock-keywords-alist)) + +(plist-put develock-max-column-plist 'python-mode 100) + +(provide 'develock-py) \ No newline at end of file diff --git a/setup/00init.el b/setup/00init.el index db08ade..896b284 100644 --- a/setup/00init.el +++ b/setup/00init.el @@ -1,3 +1,10 @@ -(add-to-list 'load-path "~/.emacs.d/auto-install") -(setq custom-file "~/.emacs.d/emacs-custom.el") +(let ((base (file-name-directory + (directory-file-name + (file-name-directory + (or load-file-name + (when (boundp 'bytecomp-filename) bytecomp-filename) buffer-file-name)))))) + + (add-to-list 'load-path (concat base "lib")) + (setq custom-file (concat base "emacs-custom.el"))) + (load custom-file) diff --git a/setup/bindings.el b/setup/bindings.el index ca4c344..660ff0c 100644 --- a/setup/bindings.el +++ b/setup/bindings.el @@ -10,6 +10,9 @@ (global-set-key "\C-c's" 'flyspell-mode) (global-set-key "\C-c'a" 'global-auto-revert-mode) +(require 'develock) +(require 'develock-py) + (defun toggle-whitespace-modes () (interactive) (if whitespace-mode @@ -19,4 +22,4 @@ (whitespace-mode 1) (develock-mode 1))) -(global-set-key "\C-c' " 'toggle-whitespace-modes) \ No newline at end of file +(global-set-key "\C-c' " 'toggle-whitespace-modes)