;; make emacs use the clipboard so that copy/paste works for other
;; x-programs. I have no clue how all that clipboard thing works.
+
;; (setq x-select-enable-clipboard t)
;; (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
+;; (setq x-select-enable-primary t)
+;; (setq x-select-enable-clipboard t)
+;; (global-set-key "\C-y" 'clipboard-yank)
(setq
;; What modes for what file extentions
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
+(require 'org-table)
+
(add-to-list 'auto-mode-alist '("\\.txt\\'" . (lambda()
(text-mode)
(orgtbl-mode)
(ff/battery-percent "energy"))))
((string= battery-status "Discharging")
- (format "B%d%%" (max (ff/battery-percent "charge")
- (ff/battery-percent "energy"))))
+ (let* ((c (max (ff/battery-percent "charge")
+ (ff/battery-percent "energy")))
+ (s (format "B%d%%" c)))
+ (if (>= c 20) s (propertize s 'face 'font-lock-warning-face))))
(t battery-status)
(insert "%% -*- mode: latex; mode: reftex; mode: flyspell; coding: utf-8; tex-command: \"pdflatex.sh\" -*-
\\documentclass[12pt]{article}
-\\usepackage[a4paper,top=2.5cm,bottom=2cm,left=1.5cm,right=1.5cm]{geometry}
+\\usepackage[a4paper,top=2.5cm,bottom=2cm,left=2.5cm,right=2.5cm]{geometry}
\\usepackage[utf8]{inputenc}
\\usepackage{amsmath}
\\usepackage{amssymb}
(when (string-match "\\.sh$" filename)
(sh-mode)
- (insert "#!/bin/bash\n\nset -e\n\n")
+ (insert "#!/bin/bash\n\nset -e\nset -o pipefail\n\n")
(save-excursion
(ff/add-copyrights))
)
(load "recentf")
-(setq recentf-exclude
- (append recentf-exclude
- '("enotes$" "secure-notes$" "media-playlists$"
- "bbdb$"
- "svn-commit.tmp$" ".git/COMMIT_EDITMSG$"
- "\.bbl$" "\.aux$" "\.toc$"))
+;; If we just check for file-symlink-p, everytime we start emacs it
+;; will check all the remote files listed in recentf-list, so we check
+;; that they are not remote first
+(defun ff/file-not-remote-but-symlink (filename)
+ (and (not (file-remote-p filename)) (file-symlink-p filename)))
+
+(setq recentf-exclude (append recentf-exclude
+ '(
+ ff/file-not-remote-but-symlink
+ "enotes$" "secure-notes$" "media-playlists$"
+ "bbdb$"
+ "svn-commit.tmp$" ".git/COMMIT_EDITMSG$"
+ "\.bbl$" "\.aux$" "\.toc$"
+ ))
recentf-max-saved-items 1000
recentf-save-file "~/private/emacs/recentf"
)
(when (boundp 'recentf-keep) (add-to-list 'recentf-keep 'file-remote-p))
-;; Removes the link if we add the file itself (I am fed up with
-;; duplicates because of vc-follow-symlinks)
-
-(defadvice recentf-add-file (before ff/remove-links (filename) activate)
- ;; If we are adding a filename corresponding to the last link we
- ;; have added, remove the latter
- (when (and recentf-list
- (file-symlink-p (car recentf-list))
- (string= filename (file-chase-links filename)))
- (setq recentf-list (cdr recentf-list))
- ))
-
(recentf-mode 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq ff/map (make-sparse-keymap))
(define-key global-map [(control \`)] ff/map)
+;;(define-key global-map [(control @)] ff/map)
+
(define-key esc-map "`" ff/map)
(defun ff/git-status (&optional dir) (interactive)