Use more idiomatic lisp

Replace multiple calls to setq with a single call
master
Jacopo De Simoi 7 years ago
parent 7c688a675f
commit a002b15f52
  1. 108
      global.org

@ -108,10 +108,10 @@
** Mouseless ** Mouseless
Disable mouse interaction with emacs Disable mouse interaction with emacs
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq mouse-autoselect-window nil)
(mouse-wheel-mode -1) (mouse-wheel-mode -1)
(setq mouse-yank-at-point nil) (setq mouse-autoselect-window nil
(setq focus-follows-mouse nil) mouse-yank-at-point nil
focus-follows-mouse nil)
#+END_SRC #+END_SRC
*** TODO Find out what of the above is necessary given the disable-mouse mode below *** TODO Find out what of the above is necessary given the disable-mouse mode below
Use the ~disable-mouse~ package by Steve Purcell available at Use the ~disable-mouse~ package by Steve Purcell available at
@ -147,11 +147,10 @@
** Modeline ** Modeline
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq-default mode-line-modified '(:eval (if (buffer-modified-p) "●" "·"))) ;still needs some improvements, (setq-default mode-line-modified '(:eval (if (buffer-modified-p) "●" "·")) ;Still needs some improvements, does not report Readonly state
;does not report Readonly state mode-line-remote '(:eval (let ((s (format-mode-line "%@")))
(setq-default mode-line-remote '(:eval (let ((s (format-mode-line "%@"))) (cond
(cond ((equal s "-") "·") ((equal s "@") "@") (t s)))))
((equal s "-") "·") ((equal s "@") "@") (t s)))))
(defvar wilder-buffer-vc-mode-line (defvar wilder-buffer-vc-mode-line
'("%b" (vc-mode (:propertize '("%b" (vc-mode (:propertize
@ -162,25 +161,42 @@
(status (cond ((equal s "-") "") ((equal s ":") "!") (t s)))) (status (cond ((equal s "-") "") ((equal s ":") "!") (t s))))
(concat "·" branch status))) (concat "·" branch status)))
face magit-branch-local)))) face magit-branch-local))))
(put 'wilder-buffer-vc-mode-line 'risky-local-variable t)
(defvar wilder-position (defvar wilder-position
'("[%p·%I] " )) '("[%p·%I] " ))
(put 'wilder-buffer-vc-mode-line 'risky-local-variable t)
(put 'wilder-position 'risky-local-variable t) (put 'wilder-position 'risky-local-variable t)
(setq-default mode-line-format (defvar wilder/mode-line-modes
'("%e" (let ((recursive-edit-help-echo "Recursive edit, type C-M-c to get out"))
mode-line-front-space (list (propertize "%[" 'help-echo recursive-edit-help-echo)
mode-line-mule-info '("" mode-name)
mode-line-modified '("" mode-line-process)
mode-line-remote " "
mode-line-frame-identification '("" minor-mode-alist)
wilder-buffer-vc-mode-line " " (propertize "%n" 'help-echo "mouse-2: Remove narrowing from buffer"
wilder-position " " 'mouse-face 'mode-line-highlight
mode-line-modes 'local-map (make-mode-line-mouse-map
mode-line-misc-info 'mouse-2 #'mode-line-widen))
mode-line-end-spaces)) (propertize "%]" 'help-echo recursive-edit-help-echo)
" "))
"Mode line construct for displaying major and minor modes.")
(put 'wilder/mode-line-modes 'risky-local-variable t)
(setq-default mode-line-format
'("%e"
mode-line-front-space
mode-line-mule-info
mode-line-modified
mode-line-remote
mode-line-frame-identification
wilder-buffer-vc-mode-line " "
wilder-position
" "
wilder/mode-line-modes
mode-line-misc-info
mode-line-end-spaces))
#+END_SRC #+END_SRC
The following has been found in [[https://www.masteringemacs.org/article/hiding-replacing-modeline-strings][here]] to clean up the modeline The following has been found in [[https://www.masteringemacs.org/article/hiding-replacing-modeline-strings][here]] to clean up the modeline
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -323,8 +339,8 @@
Tabs are evil; get rid of them Tabs are evil; get rid of them
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq c-basic-offset 4) (setq c-basic-offset 4)
(setq-default tab-width 4) (setq-default tab-width 4
(setq-default indent-tabs-mode nil) indent-tabs-mode nil)
#+END_SRC #+END_SRC
*** TODO Have a look at ws-trim.el *** TODO Have a look at ws-trim.el
It is conf'ble to avoid removing whitespace from lines that were not It is conf'ble to avoid removing whitespace from lines that were not
@ -450,14 +466,14 @@
#+END_SRC #+END_SRC
** Calendar ** Calendar
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(add-hook 'calendar-load-hook (add-hook 'calendar-load-hook
(lambda () (lambda ()
(calendar-set-date-style 'european))) (calendar-set-date-style 'european)))
;; first day of the week is monday instead of sunday: ;; first day of the week is monday instead of sunday:
(setq calendar-week-start-day 1) (setq calendar-week-start-day 1
(setq calendar-location-name "Toronto, ON Canada") calendar-location-name "Toronto, ON Canada"
(setq calendar-latitude 43.7) calendar-latitude 43.7
(setq calendar-longitude -79.4) calendar-longitude -79.4)
#+END_SRC #+END_SRC
** Use system proxy ** Use system proxy
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -764,17 +780,17 @@
*** TODO split --- Setup ~reftex~ *** TODO split --- Setup ~reftex~
Unbind "C-c [" Unbind "C-c ["
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(eval-after-load "reftex" (eval-after-load "reftex"
'(progn '(progn
(define-key reftex-mode-map (kbd "C-c [") nil) (setq reftex-cite-format "~\\cite{%l}"
(setq reftex-plug-into-AUCTeX (quote (t t nil t t))) reftex-plug-into-AUCTeX (quote (t t nil t t))
(setq reftex-insert-label-flags '(t t)) reftex-insert-label-flags '(t t)
(setq reftex-label-alist reftex-label-alist
'(("thm" ?t "thm:" "~\\ref{%s}" thm (regexp "theorems?")) '(("thm" ?t "thm:" "~\\ref{%s}" thm (regexp "theorems?"))
("lem" ?l "lem:" "~\\ref{%s}" lem (regexp "lemma{ta}?")) ("lem" ?l "lem:" "~\\ref{%s}" lem (regexp "lemma{ta}?"))
("prop" ?p "prp:" "~\\ref{%s}" prp (regexp "propositions?")) ("prop" ?p "prp:" "~\\ref{%s}" prp (regexp "propositions?"))
("cor" ?c "cor:" "~\\ref{%s}" cor (regexp "corollary")) ("cor" ?c "cor:" "~\\ref{%s}" cor (regexp "corollary"))
("def" ?d "def:" "~\\ref{%s}" cor (regexp "defintions?")))))) ("def" ?d "def:" "~\\ref{%s}" cor (regexp "defintions?"))))))
#+END_SRC #+END_SRC
*** Setup ~latex-mode~ *** Setup ~latex-mode~
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -869,10 +885,10 @@
#+END_SRC #+END_SRC
*** Set default TeX options *** Set default TeX options
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq-default TeX-master nil) (setq-default TeX-master nil)
(setq TeX-auto-save t (setq TeX-auto-save t
TeX-parse-self t TeX-parse-self t
TeX-insert-braces nil) TeX-insert-braces nil)
#+END_SRC #+END_SRC
*** Appearance *** Appearance
No fontification for sub and superscripts No fontification for sub and superscripts

Loading…
Cancel
Save