summaryrefslogtreecommitdiffstats
path: root/emacs.d/functions.el
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2011-07-15 19:08:07 +0200
committerGravatar Tom Willemsen2011-07-15 19:08:07 +0200
commit2e3c5df4d78e4c956b070efddea2b4405f717640 (patch)
treeb6cdb28338f66c64401f807d627d40238de9689d /emacs.d/functions.el
parentce4e353a70ed8425b0c60f4754e0cb4684bc381e (diff)
downloaddotfiles-2e3c5df4d78e4c956b070efddea2b4405f717640.tar.gz
dotfiles-2e3c5df4d78e4c956b070efddea2b4405f717640.zip
EMACS: lots of changes
* Extended ** emacs.d/functions.el - Added a optional ~else~ part to ~foreach~ in HTML keywords, since smarty *can* also use ~foreachelse~, and this was only fontifying the ~foreach~ part. - Only load (and modify) naquadah-theme when we're running in X. I'd prefer to know if we have 256 colors available, but I haven't found that yet. - Only try to go to fullscreen if X is running. - Show a lambda symbol when the word lambda is found in a prog-mode buffer. - Enable auto-fill-mode when prog-mode is started. - Don't set pear options, pi-php-mode does it. - Added function to show ~lambda~ as a lambda symbol - Added function to create or update gtags file. ** emacs.el - Add pi-php-mode. - Removed muttrc-mode. - Use pi-php-mode instead of php-mode-improved. - Use ~(getenv)~ to get the browser. - Don't care about ~org-babel-confirm-evaluate~ and ~org-ditaa-jar-path~. - Set ~org-return-follows-link~ to ~t~, enter follows a link in ~org-mode~. - Set ~mouse-autoselect-window~ to ~t~, moving the mouse changes buffer focus. - Set ~pop-up-windows~ to ~nil~, so that popup functions use an existing window. - Set ~org-log-into-drawer~ to ~t~, so that activities are put in a drawer in ~org-mode~. - Set ~mail-header-separator~ to an empty string for ~message-mode~. - Use ~message-mode~ instead of ~mail-mode~.
Diffstat (limited to 'emacs.d/functions.el')
-rw-r--r--emacs.d/functions.el51
1 files changed, 44 insertions, 7 deletions
diff --git a/emacs.d/functions.el b/emacs.d/functions.el
index 6d2a5e5..9c8f7da 100644
--- a/emacs.d/functions.el
+++ b/emacs.d/functions.el
@@ -74,7 +74,7 @@ Currently adds | & ! . + = - / % * , < > ? : ->"
(font-lock-add-keywords
'html-mode
'(("{\\(\\*.*\\*\\)}" 1 font-comment-face)
- ("{\\/?\\(extends\\|block\\|foreach\\|if\\)"
+ ("{\\/?\\(extends\\|block\\|foreach\\(else\\)?\\|if\\)"
1 font-lock-builtin-face)
("\\$\\(\\(?:\\sw\\|\\s_\\)+\\)\\(?:|\\(\\(?:\\sw\\|\\s_\\)+\\):\\)"
(1 font-lock-variable-name-face)
@@ -121,7 +121,24 @@ Currently adds | & ! . + = - / % * , < > ? : ->"
(insert-char ?\; width))
(defun x-init ()
- "Start ide-skel and set some keys")
+ "Initialization only for X"
+ (require 'naquadah-theme)
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;; THEME SETTINGS ;;
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ (naquadah-theme-set-faces
+ 'naquadah
+
+ ;; markdown-mode
+ '(markdown-link-face (:inherit 'link))
+ '(markdown-header-face-1 (:inherit 'org-level-1))
+ '(markdown-header-face-2 (:inherit 'org-level-2))
+ '(markdown-header-face-3 (:inherit 'org-level-3))
+ '(markdown-header-face-4 (:inherit 'org-level-4))
+ '(markdown-header-face-5 (:inherit 'org-level-5))
+ '(markdown-header-face-6 (:inherit 'org-level-6)))
+
+ (add-hook 'emacs-startup-hook 'fullscreen))
(defun cli-init ()
"Add a space to the linum column"
@@ -156,7 +173,9 @@ Currently adds | & ! . + = - / % * , < > ? : ->"
("\\b\\(\\.[0-9]+\\([eE][-+]?[0-9]+\\)?\\([lL]\\|[fF]\\|[dD]\\)?\\)\\b"
0 font-lock-constant-face)))
(set-column-marker)
- (rainbow-delimiters-mode))
+ (rainbow-delimiters-mode)
+ (pretty-lambdas)
+ (auto-fill-mode 1))
(defun on-c-mode ()
(local-set-key [f8] 'c-toggle-header-source)
@@ -178,10 +197,6 @@ Currently adds | & ! . + = - / % * , < > ? : ->"
(auto-fill-mode 1))
(defun on-php-mode ()
- (defvar php-warn-if-mumamo-off nil)
- (setq case-fold-search t)
- (c-set-offset 'arglist-intro '+)
- (c-set-offset 'arglist-close '0)
(column-marker-1 76)
(column-marker-2 81)
(local-set-key [f6] 'comment-line))
@@ -189,3 +204,25 @@ Currently adds | & ! . + = - / % * , < > ? : ->"
(defun on-mail-mode ()
(turn-on-auto-fill)
(search-forward "\n\n"))
+
+(defun pretty-lambdas ()
+ (font-lock-add-keywords
+ nil `(("(\\(lambda\\>\\)"
+ (0 (progn
+ (compose-region (match-beginning 1)
+ (match-end 1)
+ ?λ)))))))
+
+;; http://emacs-fu.blogspot.com/2009/01/navigating-through-source-code-using.html
+(defun djcb-gtags-create-or-update ()
+ "create or update the gnu global tag file"
+ (interactive)
+ (if (not (= 0 (call-process "global" nil nil nil " -p"))) ; tagfile
+ (let ((olddir default-directory) ; doesn't exist?
+ (topdir (read-directory-name
+ "gtags: top of source tree:" default-directory)))
+ (cd topdir)
+ (shell-command "gtags && echo 'created tagfile'")
+ (cd olddir)) ; restore
+ ;; tagfile already exists; update it
+ (shell-command "global -u && echo 'updated tagfile'")))