;; Xft.antialias: true
;; Xft.rgba: rgb
-(set-default-font "Inconsolata 15")
+;; (set-default-font "Inconsolata 15")
-;; (set-default-font "Bitstream vera sans mono-12")
+;; (package-initialize)
+
+(set-default-font "Bitstream vera sans mono-12")
;; (set-default-font "Liberation Mono-13")
;; (set-default-font "DejaVu sans mono 15")
;; (set-default-font "Droid sans mono 13")
(flyspell-mode))))
(add-hook 'c++-mode-hook 'flyspell-prog-mode)
+;; (add-hook 'lua-mode-hook 'flyspell-prog-mode)
(add-hook 'log-edit-mode-hook 'flyspell-mode)
;; I am a power-user
(fringe :background "gray80")
(ff/date-info-face :foreground "white")
(ff/battery-info-face :foreground "black")
+ (ff/battery-info-alarm-face :foreground "red")
;; (ff/mail-alarm-face :foreground "white" :background "red2")
;; (alarm-vc-face :foreground "black" :background "yellow" :weight 'normal)
(gui-button-face :background "green" :foreground "black")
(region :background "white" :foreground "black")
(ff/date-info-face :foreground "white" :weight 'bold)
(ff/battery-info-face :foreground "black")
+ (ff/battery-info-alarm-face :foreground "red")
;; (ff/mail-alarm-face :foreground "red" :weight 'bold)
(selector/selection :background "yellow")
(gui-button-face :background "green" :foreground "white")
;; (`charging (format "c%d%%" (ff/battery-percent)))
;; (`discharging (format "d%d%%" (ff/battery-percent)))
;; (`unknown "f")
- (`charging (format "↑%d%%" (ff/battery-percent)))
- (`discharging (format "↓%d%%" (ff/battery-percent)))
- (`unknown "✱")
+
+ (`charging
+ (let ((p (ff/battery-percent)))
+ (if (> p 10)
+ (propertize (format "↑%d%%" p) 'face 'ff/battery-info-face)
+ (propertize (format "↑%d%%" p) 'face 'ff/battery-info-alarm-face))
+ )
+ )
+
+ (`discharging
+ (let ((p (ff/battery-percent)))
+ (if (> p 10)
+ (propertize (format "↓%d%%" p) 'face 'ff/battery-info-face)
+ (propertize (format "↓%d%%" p) 'face 'ff/battery-info-alarm-face))
+ )
+ )
+
+ ;; (`unknown "✱")
+ (`unknown "F")
(_ "?"))
(error nil))
)
" "
- ,@(when (ff/battery-info-string)
+ ,@(when (ff/temp-info-string)
'((ff/temp-info-string)))
,@(when (ff/battery-info-string)
- '((propertize
- (ff/battery-info-string)
- 'face 'ff/battery-info-face)))
+ '((ff/battery-info-string)))
+
+ ;; '((propertize
+ ;; (ff/battery-info-string)
+ ;; 'face 'ff/battery-info-face)))
" "
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun ff/start-lua ()
+ "Adds all the stuff to start a new lua file"
+ (interactive)
+ (goto-char (point-min))
+ (insert "#!/usr/bin/env luajit
+
+require 'torch'
+require 'nn'
+require 'nnx'
+require 'optim'
+require 'image'
+require 'pl'
+require 'paths'
+require 'ffmpeg'
+
+")
+ (lua-mode)
+ )
+
+
(defun ff/start-html ()
"Adds all that stuff to start a new HTML file."
(interactive)
(ff/add-copyrights))
)
+ (when (string-match "\\.lua$" filename)
+ (lua-mode)
+ (ff/start-lua)
+ )
+
(when (string-match "\\.html$" filename)
(html-mode)
(ff/start-html)
compile-history '("make clean" "make DEBUG=yes -j -k" "make -j -k")
)
-(defun ff/universal-compile () (interactive)
+(defun ff/universal-compile (universal) (interactive "P")
(funcall (or (cdr (assoc major-mode
'(
(latex-mode . tex-file)
(while (re-search-forward "[0-9\.]+" nil t)
(let ((value (string-to-number (buffer-substring (match-beginning 0) (match-end 0)))))
(delete-region (match-beginning 0) (match-end 0))
- (insert (format "%0.2f" value)))))))
+ (insert (format "%0.1e" value)))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Keymaping
"svn-commit.tmp$" ".git/COMMIT_EDITMSG$"
"\.bbl$" "\.aux$" "\.toc$"
))
- recentf-max-saved-items 1000
+ recentf-max-saved-items 10000
recentf-save-file (concat ff/emacs-dir "/recentf")
)
media/duration-to-history 30
media/history-size 1000
media/playlist-file (concat ff/emacs-dir "/media-playlists")
+ media/continue-mode-hint (if window-system "⤸" "*")
media/mplayer/args '(
"-framedrop"
"-zoom"
)
media/mplayer/timing-request-period 1.0
)
+
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-key esc-map "`" ff/map)
+(defun ff/kill-downto-signature () (interactive)
+ (let ((s (point)))
+ (when (re-search-forward "^-- $")
+ (kill-region s (match-beginning 0))
+ (goto-char s))))
+
(defun ff/git-status (&optional dir) (interactive)
(if (buffer-file-name)
(git-status (file-name-directory (buffer-file-name)))
(bookmark-save)))
(define-key ff/map "f" 'ff/move-region-to-fridge)
(define-key ff/map [(control f)] 'ff/flyspell-mode)
+(define-key ff/map [(control k)] 'ff/kill-downto-signature)
(define-key ff/map [?\C-0] 'ff/delete-annoying-windows)
(define-key ff/map "1" 'delete-other-windows)