)
;; Activate the dynamic completion of buffer names
-(iswitchb-mode 1)
+;; (iswitchb-mode 1)
+;; (load "lcomplete")
;; Save the minibuffer history
(setq savehist-file (concat ff/emacs-dir "/savehist"))
(define-key global-map [(meta up)] 'ff/scroll-down)
(define-key global-map [(meta down)] 'ff/scroll-up)
+
+(define-key global-map [(meta shift up)]
+ (lambda () (interactive) (condition-case nil (scroll-down 10) (error nil))))
+
+(define-key global-map [(meta shift down)]
+ (lambda () (interactive) (condition-case nil (scroll-up 10) (error nil))))
+
+;; (define-key global-map [(meta shift up)] (lambda () (interactive) (ff/scroll-down 10)))
+;; (define-key global-map [(meta shift down)] 'ff/scroll-up)
+
(define-key global-map [(meta p)] 'ff/scroll-down)
(define-key global-map [(meta n)] 'ff/scroll-up)
(define-key global-map [(meta right)] 'ff/scroll-left)
)
'unknown))
-(defun ff/sum-numbers (list-files prefix)
+(defun ff/sum-values-from-files (list-files prefix)
(apply '+
(mapcar
(lambda (f) (string-to-number (ff/file-first-line (format "%s/%s" f prefix))))
(defun ff/battery-percent ()
(condition-case nil
- (/ (* 100 (ff/sum-numbers ff/battery-dirs "energy_now"))
- (ff/sum-numbers ff/battery-dirs "energy_full"))
+ (/ (* 100 (ff/sum-values-from-files ff/battery-dirs "energy_now"))
+ (ff/sum-values-from-files ff/battery-dirs "energy_full"))
(error -1))
)
(lambda (f) (string-to-number (ff/file-first-line f)))
ff/temperature-files))
1000)))
+
(if (> temp 50)
- (concat
- (let ((s (format "%dC " temp)))
- (if (> temp 70) (propertize s 'face
- 'font-lock-warning-face)
- s))
- )
+ (let ((s (format "%dC " temp)))
+ (if (> temp 70)
+ (propertize s 'face 'font-lock-warning-face)
+ s)
+ )
)
)
;; The battery
(pcase (ff/battery-state ff/battery-dirs)
- (`charging (format "L%d%%" (ff/battery-percent)))
- (`discharging (format "B%d%%" (ff/battery-percent)))
- (code "L"))
+ (`charging (format "c%d%%" (ff/battery-percent)))
+ (`discharging (format "d%d%%" (ff/battery-percent)))
+ (code "f"))
)
(setq list (cdr list)))
(switch-to-buffer found)))
-(define-key global-map [?\C-x right] 'ff/next-buffer)
-(define-key global-map [?\C-x left] 'ff/prev-buffer)
-(define-key global-map [?\C-'] 'ff/next-buffer)
-(define-key global-map [?\C-\;] 'ff/prev-buffer)
+;; (define-key global-map [?\C-x right] 'ff/next-buffer)
+;; (define-key global-map [?\C-x left] 'ff/prev-buffer)
+(define-key global-map [?\M-\]] 'ff/next-buffer)
+(define-key global-map [?\M-\[] 'ff/prev-buffer)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; There is actually a decent terminal emulator in emacs!
;; Closes the current \begin{}
-(when (ff/load-or-alert "longlines")
-
- (setq longlines-show-hard-newlines t
- longlines-auto-wrap t
- ;; longlines-show-effect #("|\n" 0 2 (face escape-glyph))
- ;; longlines-show-effect #("∴\n" 0 2 (face escape-glyph))
- longlines-show-effect #("•\n" 0 2 (face escape-glyph))
- ;; longlines-show-effect #("↵\n" 0 2 (face escape-glyph))
- )
-
- ;; (defun ff/auto-longlines ()
- ;; (when (save-excursion
- ;; (goto-char (point-min))
- ;; (re-search-forward "^.\\{81,\\}$" nil t))
- ;; (longlines-mode)
- ;; (message "Switched on the lonlines mode automatically")
- ;; ))
-
- ;; (add-hook 'latex-mode-hook 'ff/auto-longlines)
-
- )
-
;; Meta-/ remaped (completion)
(define-key global-map [(shift right)] 'dabbrev-expand)