EMACS: Integers and setq

Added hightlighting for integers in prog-mode, switched from single to
multiple setqs again.
This commit is contained in:
Tom Willemsen 2011-06-22 21:46:22 +02:00
parent 81e47c5806
commit d46b304e0f

120
emacs.el
View file

@ -150,7 +150,7 @@ Currently adds | & ! . + = - / % * , < > ? : ->"
(defun list-functions () (defun list-functions ()
(interactive) (interactive)
(occur (occur
"\(?:\(?:private\|protected\|public\) \)?function \(?:\sw\)+(\sw*)")) "\\(?:\\(?:private\\|protected\\|public\\) \\)?function \\(?:\\sw\\)+(\\sw*)"))
(defun insert-init-title (title width) (defun insert-init-title (title width)
(interactive "stitle: \nnwidth: ") (interactive "stitle: \nnwidth: ")
@ -191,6 +191,12 @@ Currently adds | & ! . + = - / % * , < > ? : ->"
(byte-compile-file fname))))) (byte-compile-file fname)))))
(defun on-prog-mode () (defun on-prog-mode ()
(font-lock-add-keywords
nil
'(("\\b\\(0[xX][0-9a-fA-F]+[lL]?\\|[0-9]+\\.?[0-9]*\\([eE][-+]?[0-9]+\\)?\\([lL]\\|[fF]\\|[dD]\\)?\\)\\b"
0 font-lock-constant-face)
("\\b\\(\\.[0-9]+\\([eE][-+]?[0-9]+\\)?\\([lL]\\|[fF]\\|[dD]\\)?\\)\\b"
0 font-lock-constant-face)))
(set-column-marker) (set-column-marker)
(rainbow-delimiters-mode)) (rainbow-delimiters-mode))
@ -288,92 +294,82 @@ Currently adds | & ! . + = - / % * , < > ? : ->"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SETTINGS ;; ;; SETTINGS ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq-default indent-tabs-mode nil) ; spaces, no tabs (setq-default indent-tabs-mode nil) ; spaces, no tabs
(setq-default truncate-lines t) ; don't wrap
(setq-default php-warn-if-mumamo-off nil) ; don't warn me about this
(setq (setq inhibit-startup-message t) ; Don't show welcome screen
inhibit-startup-message t (setq require-final-newline t) ; Always put final newline
require-final-newline t (setq inhibit-default-init t) ; Don't load default library
inhibit-default-init t (setq scroll-conservatively 101) ; scroll only one line
scroll-conservatively 101 ; scroll only one line (setq browse-url-browser-function 'browse-url-generic)
browse-url-browser-function 'browse-url-generic (setq browse-url-generic-program "$BROWSER")
browse-url-generic-program "conkeror" (setq whitespace-style '(face trailing)) ; For use with markdown mode
whitespace-style '(face trailing) (setq uniquify-buffer-name-style 'reverse)
uniquify-buffer-name-style 'reverse (setq org-confirm-babel-evaluate nil)
org-confirm-babel-evaluate nil (setq org-tags-exclude-from-inheritance '("crypt"))
org-tags-exclude-from-inheritance '("crypt") (setq org-crypt-key "33E8CC1CC4")
org-crypt-key "33E8CC1CC4" (setq org-use-fast-todo-selection t)
org-use-fast-todo-selection t (setq org-default-notes-file (concat org-directory "/notes.org"))
org-default-notes-file (concat org-directory "/notes.org") (setq org-ditaa-jar-path "/usr/share/java/ditaa/ditaa-0_9.jar")
org-ditaa-jar-path "/usr/share/java/ditaa/ditaa-0_9.jar" (setq jit-lock-defer-time 0.2) ; Don't fontlock immediately
jit-lock-defer-time 0.2 (setq htmlize-output-type 'inline-css)
htmlize-output-type 'inline-css (setq ido-save-directory-list-file nil)
ido-save-directory-list-file nil (setq ido-auto-merge-delay-time 2) ; Wait before fixing names
(setq org-outline-path-complete-in-steps t)
frame-title-format (setq frame-title-format ; I don't like emacs@cloud, must have file
'(:eval '(:eval ; name
(concat "emacs: " (buffer-name))) (concat "emacs: " (buffer-name))))
backup-directory-alist ; backup file location (setq backup-directory-alist ; backup file location
`((".*" . ,temporary-file-directory)) `((".*" . ,temporary-file-directory)))
auto-save-file-name-transforms ; autosave file location (setq auto-save-file-name-transforms ; autosave file location
`((".*" ,temporary-file-directory t)) `((".*" ,temporary-file-directory t)))
default-frame-alist ; default frame settings (setq default-frame-alist ; default frame settings
(append '((font . "DejaVu Sans Mono-10:antialias=true"))) (append '((font . "DejaVu Sans Mono-10:antialias=true"))))
org-todo-keywords (setq org-todo-keywords
'((sequence "TODO(t)" '((sequence "TODO(t)"
"IN PROGRESS(p)" "IN PROGRESS(p)"
"WAITING(w@/!)" "WAITING(w@/!)"
"|" "|"
"DONE(d!/!)" "DONE(d!/!)"
"CANCELLED(c@/!)")) "CANCELLED(c@/!)")))
org-babel-load-languages (setq org-babel-load-languages
'((ditaa . t)) '((ditaa . t)))
org-refile-targets (setq org-refile-targets
'((org-agenda-files :maxlevel . 5) '((org-agenda-files :maxlevel . 5)
(nil :maxlevel . 5)) (nil :maxlevel . 5)))
org-outline-path-complete-in-steps t
org-todo-keyword-faces (setq org-todo-keyword-faces
'(("TODO" :foreground "red" :weight bold) '(("TODO" :foreground "red" :weight bold)
("IN PROGRESS" :foreground "yellow" :weight bold) ("IN PROGRESS" :foreground "yellow" :weight bold)
("DONE" :foreground "forest green" :weight bold) ("DONE" :foreground "forest green" :weight bold)
("WAITING" :foreground "orange" :weight bold) ("WAITING" :foreground "orange" :weight bold)
("CANCELLED" :foreground "orangered" :weight bold)) ("CANCELLED" :foreground "orangered" :weight bold)))
org-publish-project-alist (if window-system
'(("lxcoding-docs" (x-init)
:base-directory "~/devel/lxcoding-docs/" (cli-init))
:base-extension "org"
:publishing-directory "~/lxcoding-docs-test/"
:recursive t
:publishing-function org-publish-org-to-html
:headline-levels
:auto-preamble t
:auto-sitemap t
:sitemap-filename "sitemap.org"
:sitemap-title "docs sitemap")))
(if window-system (x-init) (cli-init))
(fset 'yes-or-no-p 'y-or-n-p) ; switch yes or no to y or n (fset 'yes-or-no-p 'y-or-n-p) ; switch yes or no to y or n
(tool-bar-mode -1) ; no toolbar (tool-bar-mode -1) ; no toolbar
(menu-bar-mode -1) ; no menubar (menu-bar-mode -1) ; no menubar
(scroll-bar-mode -1) ; no scrollbars (scroll-bar-mode -1) ; no scrollbars
(line-number-mode -1) ; don't show line number in splitter (line-number-mode -1) ; don't show line number in splitter
(global-linum-mode t) ; Show line numbers in gutter (global-linum-mode t) ; Show line numbers in gutter
(column-number-mode t) ; show column number in splitter (column-number-mode t) ; show column number in splitter
(global-font-lock-mode t) ; show syntax highlighting, old (global-font-lock-mode t) ; show syntax highlighting, old
(delete-selection-mode t) ; delete selection upon typing (delete-selection-mode t) ; delete selection upon typing
(show-paren-mode t) ; show the opposite paren (show-paren-mode t) ; show the opposite paren
(ido-mode t) (ido-mode t)
(autopair-global-mode) ; automatically add the other (autopair-global-mode) ; automatically add the other delimiter
; delimiter
(add-to-list 'compilation-finish-functions 'my-comp-finish-function) (add-to-list 'compilation-finish-functions 'my-comp-finish-function)