From: Francois Fleuret Date: Wed, 26 Aug 2015 15:37:48 +0000 (+0200) Subject: Going on with some changes to accommodate the T450s, in particular the keyboard layout. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=7365475809e717d78377bf1c848b23d2681763ea;p=elisp.git Going on with some changes to accommodate the T450s, in particular the keyboard layout. --- diff --git a/emacs.el b/emacs.el index 0a8ca7d..eb01f9b 100644 --- a/emacs.el +++ b/emacs.el @@ -90,7 +90,8 @@ ) ;; 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")) @@ -581,6 +582,16 @@ load-warning buffer in case of failure." (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) @@ -840,7 +851,7 @@ printer." ) '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)))) @@ -848,8 +859,8 @@ printer." (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)) ) @@ -864,22 +875,22 @@ printer." (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")) ) @@ -1010,10 +1021,10 @@ printer." (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! @@ -2159,28 +2170,6 @@ This may be a useful alternative binding for \\[delete-other-windows] ;; 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)