From 379f4fb00a2f45aee74706f568c279e38030ff02 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Thu, 28 Nov 2019 13:55:57 +0100 Subject: [PATCH] Update. --- emacs.el | 67 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/emacs.el b/emacs.el index 759ee9c..85edc34 100644 --- a/emacs.el +++ b/emacs.el @@ -475,7 +475,7 @@ load-warning buffer in case of failure." ;; (fringe :background "black" :foreground "gray90") (fringe :background "gray80") (ff/date-info-face :foreground "white") - (ff/battery-info-face :foreground "black") + (ff/battery-info-face :foreground "blue") (ff/battery-info-alarm-face :foreground "red") ;; (ff/mail-alarm-face :foreground "white" :background "red2") ;; (alarm-vc-face :foreground "black" :background "yellow" :weight 'normal) @@ -667,7 +667,11 @@ load-warning buffer in case of failure." (defun ff/show-compilation-buffer-split-window () "Split the window vertically and show the compilation buffer in the newly created right one" (interactive) - (show-buffer (split-window-right) "*compilation*") + + (let ((b (get-buffer "*compilation*"))) + (if b (show-buffer (split-window-right) b) + (error "Cannot find a compilation buffer")) + ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -934,8 +938,9 @@ printer." ) ) - ;; (`unknown "✱") - (`unknown "F") + (`unknown (propertize "☼" 'face 'ff/battery-info-face)) + ;; (`unknown "☼") + ;; (`unknown "F") (_ "?")) (error nil)) ) @@ -1465,7 +1470,10 @@ universal argument starts xfig even if the .fig does not exist" (defun ff/save-window-configuration (universal) (interactive "P") (if universal - (setq ff/window-configuration (current-window-configuration)) + (progn + (setq ff/window-configuration (current-window-configuration)) + (message "Window configuration stored") + ) (set-window-configuration ff/window-configuration)) ) @@ -1602,32 +1610,26 @@ universal argument starts xfig even if the .fig does not exist" (goto-char (point-min)) (insert "%% -*- mode: latex; mode: reftex; mode: flyspell; coding: utf-8; tex-command: \"pdflatex.sh\" -*- -\\documentclass[12pt,a4paper,twoside]{article} +\\documentclass[11pt,a4paper,twoside]{article} \\usepackage[a4paper,top=2.5cm,bottom=2cm,left=2.5cm,right=2.5cm]{geometry} \\usepackage[utf8]{inputenc} \\usepackage{amsmath} \\usepackage{amssymb} \\usepackage[pdftex]{graphicx} -\\usepackage{microtype} \\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=blue]{hyperref} \\usepackage{tikz} +\\usepackage[round]{natbib} +\\usepackage{cmbright} \\setlength{\\parindent}{0cm} \\setlength{\\parskip}{12pt} -\\renewcommand{\\baselinestretch}{1.3} +%\\renewcommand{\\baselinestretch}{1.3} %\\setlength{\\tabcolsep}{0pt} %\\renewcommand{\\arraystretch}{1.0} \\def\\argmax{\\operatornamewithlimits{argmax}} \\def\\argmin{\\operatornamewithlimits{argmin}} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Open sans font -%%\\usepackage[default]{opensans} -%%\\usepackage{cmbright} -%%\\renewcommand{\\familydefault}{fos} -%%\\renewcommand{\\seriesdefault}{l} -%%\\renewcommand{\\bfdefault}{sb} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% The \\todo command \\newcounter{nbdrafts} @@ -1648,6 +1650,12 @@ universal argument starts xfig even if the .fig does not exist" (goto-char (point-max)) (insert " +\\bibliographystyle{abbrvnat} + +\\bibliography{dlc} + +\\checknbdrafts + \\end{document} ")) (latex-mode)) @@ -2190,6 +2198,17 @@ a file in /tmp" (define-key global-map [(shift f1)] 'compile) (define-key global-map [f2] 'next-error) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Horrible hack +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun dont-delay-compile-warnings (fun type &rest args) + (if (eq type 'bytecomp) + (let ((after-init-time t)) + (apply fun type args)) + (apply fun type args))) +(advice-add 'display-warning :around #'dont-delay-compile-warnings) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Related to mail ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -2972,15 +2991,15 @@ With argument ARG, do this that many times." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Runs in server mode, so that emacsclient works -(server-start) +;; ;;(server-start) -(defun ff/raise-frame-and-give-focus () - (when window-system - (raise-frame) - (x-focus-frame (selected-frame)) - (set-mouse-pixel-position (selected-frame) 4 4) - )) +;; (defun ff/raise-frame-and-give-focus () + ;; (when window-system + ;; (raise-frame) + ;; (x-focus-frame (selected-frame)) + ;; (set-mouse-pixel-position (selected-frame) 4 4) + ;; )) -;; Raises the window when the server is invoked +;; ;; Raises the window when the server is invoked -(add-hook 'server-switch-hook 'ff/raise-frame-and-give-focus) +;; (add-hook 'server-switch-hook 'ff/raise-frame-and-give-focus) -- 2.39.5