From fc972a32c99e6b94359cea9451f5b3ced19447e9 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sun, 8 Oct 2017 19:36:28 +0100 Subject: [PATCH] Emacs: Comment config consistently --- .emacs.d/init.el | 10 ++-- .emacs.d/lisp/functions.el | 4 +- .emacs.d/lisp/init-emms.el | 2 +- .emacs.d/lisp/init-eshell.el | 2 +- .emacs.d/lisp/init-evil-emms.el | 4 +- .emacs.d/lisp/init-evil-eshell.el | 2 +- .emacs.d/lisp/init-evil-helm.el | 4 +- .emacs.d/lisp/init-evil-image.el | 2 +- .emacs.d/lisp/init-evil-leader.el | 4 +- .emacs.d/lisp/init-evil-package.el | 1 + .emacs.d/lisp/init-evil-pdf.el | 2 +- .emacs.d/lisp/init-evil-term.el | 16 +++--- .emacs.d/lisp/init-evil.el | 88 ++++++++++++++++-------------- .emacs.d/lisp/init-exwm.el | 2 +- .emacs.d/lisp/init-go.el | 6 +- .emacs.d/lisp/init-gud.el | 6 +- .emacs.d/lisp/init-helm.el | 28 +++++----- .emacs.d/lisp/init-itranslate.el | 2 +- .emacs.d/lisp/init-latex.el | 14 ++--- .emacs.d/lisp/init-lua.el | 2 +- .emacs.d/lisp/init-makefile.el | 2 +- .emacs.d/lisp/init-mediawiki.el | 10 ++-- .emacs.d/lisp/init-mu4e.el | 10 ++-- .emacs.d/lisp/init-nroff.el | 4 +- .emacs.d/lisp/init-page.el | 4 +- .emacs.d/lisp/init-python.el | 6 +- .emacs.d/lisp/init-tex.el | 48 ++++++++-------- .emacs.d/lisp/init-texinfo.el | 6 +- .emacs.d/lisp/main.el | 8 +-- 29 files changed, 152 insertions(+), 147 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index ea0fcfff..1d689a71 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -98,9 +98,9 @@ ;;; Dired ;;; Dired is loaded after init.el, so configure it only then. -;; TODO: Improve dired-du: -;; - Hangs when the `ls` time format is changed. -;; - Cache recursive results. +;;; TODO: Improve dired-du: +;;; - Hangs when the `ls` time format is changed. +;;; - Cache recursive results. (nconc package-selected-packages '(dired-du)) (with-eval-after-load 'dired (require 'init-dired)) @@ -132,8 +132,8 @@ (with-eval-after-load 'go-mode (require 'init-go)) ;;; Graphviz dot -;; The view command is broken but the preview command works (it displays the PNG -;; in a new window), which is enough and probably not worth a fix. +;;; The view command is broken but the preview command works (it displays the PNG +;;; in a new window), which is enough and probably not worth a fix. (nconc package-selected-packages '(graphviz-dot-mode)) ;;; GUD (GDB, etc.) diff --git a/.emacs.d/lisp/functions.el b/.emacs.d/lisp/functions.el index 0b2f10fb..779d7dfa 100644 --- a/.emacs.d/lisp/functions.el +++ b/.emacs.d/lisp/functions.el @@ -377,8 +377,8 @@ Works on whole buffer if region is unactive." (tabify start end)) (setq tabify-regexp tabify-regexp-old)))) -;; TODO: Store window configurations in a buffer-name-indexed alist? Not -;; sure that would ever be useful. +;;; TODO: Store window configurations in a buffer-name-indexed alist? Not +;;; sure that would ever be useful. (defvar single-window--last-configuration nil "Last window configuration before calling `delete-other-windows'.") (defun toggle-single-window () "Un-maximize current window. diff --git a/.emacs.d/lisp/init-emms.el b/.emacs.d/lisp/init-emms.el index da1eff79..bf47ebcd 100644 --- a/.emacs.d/lisp/init-emms.el +++ b/.emacs.d/lisp/init-emms.el @@ -146,7 +146,7 @@ will always use the same cover per folder." ;;; TODO: Delete entry from cache? See `emms-cache-del'. ;;; TODO: Browse by album-artist? libtag has the field. -;; https://emacs.stackexchange.com/questions/10412/sort-by-artist-in-emms-with-compilation-albums/10435 +;;; https://emacs.stackexchange.com/questions/10412/sort-by-artist-in-emms-with-compilation-albums/10435 ;;; TODO: Change face from purple to white? diff --git a/.emacs.d/lisp/init-eshell.el b/.emacs.d/lisp/init-eshell.el index aea1b8c2..b867bbd3 100644 --- a/.emacs.d/lisp/init-eshell.el +++ b/.emacs.d/lisp/init-eshell.el @@ -55,7 +55,7 @@ eshell-hist-ignoredups t eshell-destroy-buffer-when-process-dies t) -;; TODO: Hour is printed twice. We don't need to set this? +;;; TODO: Hour is printed twice. We don't need to set this? ;; (setq eshell-ls-date-format (replace-regexp-in-string "^\\+*" "" (getenv "TIME_STYLE"))) ;;; TODO: ls: Sort using locale. diff --git a/.emacs.d/lisp/init-evil-emms.el b/.emacs.d/lisp/init-evil-emms.el index 051efdf5..98523ce6 100644 --- a/.emacs.d/lisp/init-evil-emms.el +++ b/.emacs.d/lisp/init-evil-emms.el @@ -1,7 +1,7 @@ ;;; Evil+EMMS -;; emms-browser does not run any mode hook. As such the default state is 'normal. -;; TODO: Report upstream. +;;; emms-browser does not run any mode hook. As such the default state is 'normal. +;;; TODO: Report upstream. (defun evil/emms-browser () (evil-motion-state)) (advice-add 'emms-browser :after 'evil/emms-browser) diff --git a/.emacs.d/lisp/init-evil-eshell.el b/.emacs.d/lisp/init-evil-eshell.el index 4a44e3f9..f3265bb3 100644 --- a/.emacs.d/lisp/init-evil-eshell.el +++ b/.emacs.d/lisp/init-evil-eshell.el @@ -1,4 +1,4 @@ -;; Evil+Eshell +;;; Evil+Eshell (defun evil/eshell-next-prompt () (when (get-text-property (point) 'read-only) diff --git a/.emacs.d/lisp/init-evil-helm.el b/.emacs.d/lisp/init-evil-helm.el index 843534c7..1b713ae4 100644 --- a/.emacs.d/lisp/init-evil-helm.el +++ b/.emacs.d/lisp/init-evil-helm.el @@ -1,7 +1,7 @@ ;;; Evil+Helm -;; TODO: Make bindings completely evil: then hjkl should do what is intended. -;; Try out and see how convenient that is. +;;; TODO: Make bindings completely evil: then hjkl should do what is intended. +;;; Try out and see how convenient that is. (global-set-key "\M-y" 'helm-show-kill-ring) diff --git a/.emacs.d/lisp/init-evil-image.el b/.emacs.d/lisp/init-evil-image.el index f81209ef..d4f5859c 100644 --- a/.emacs.d/lisp/init-evil-image.el +++ b/.emacs.d/lisp/init-evil-image.el @@ -1,6 +1,6 @@ ;;; Evil+Image -;; TODO: Why can't I set image-mode default state to 'motion? +;;; TODO: Why can't I set image-mode default state to 'motion? (evil-initial-state 'image-mode 'motion) (add-to-list 'evil-motion-state-modes 'image-mode) diff --git a/.emacs.d/lisp/init-evil-leader.el b/.emacs.d/lisp/init-evil-leader.el index bd456016..2056ba94 100644 --- a/.emacs.d/lisp/init-evil-leader.el +++ b/.emacs.d/lisp/init-evil-leader.el @@ -1,6 +1,6 @@ ;;; Evil leader -;; Leader mode and its key must be set before evil-mode. +;;; Leader mode and its key must be set before evil-mode. (evil-leader/set-leader "") (global-evil-leader-mode) @@ -37,7 +37,7 @@ (require 'evil-mu4e nil t) (evil-leader/set-key "m" 'mu4e-headers-unread)) -;; Since is no longer available, as some replacements: +;;; Since is no longer available, as some replacements: (evil-define-key 'motion Info-mode-map (kbd "C-SPC") 'Info-scroll-up) (evil-define-key 'motion help-mode-map (kbd "C-SPC") 'scroll-up-command) (evil-define-key 'motion pdf-view-mode-map (kbd "C-SPC") 'pdf-view-scroll-up-or-next-page) diff --git a/.emacs.d/lisp/init-evil-package.el b/.emacs.d/lisp/init-evil-package.el index 34927ab3..de26a9d4 100644 --- a/.emacs.d/lisp/init-evil-package.el +++ b/.emacs.d/lisp/init-evil-package.el @@ -1,4 +1,5 @@ ;;; Evil+Package-menu-mode + (evil-set-initial-state 'package-menu-mode 'motion) (evil-define-key 'motion package-menu-mode-map "q" 'quit-window) (evil-define-key 'motion package-menu-mode-map "i" 'package-menu-mark-install) diff --git a/.emacs.d/lisp/init-evil-pdf.el b/.emacs.d/lisp/init-evil-pdf.el index e046c366..61dbe4a3 100644 --- a/.emacs.d/lisp/init-evil-pdf.el +++ b/.emacs.d/lisp/init-evil-pdf.el @@ -1,6 +1,6 @@ ;;; Evil+pdftools -;; TODO: Add other modes? Looks like it's not needed. +;;; TODO: Add other modes? Looks like it's not needed. (evil-set-initial-state 'pdf-view-mode 'motion) (evil-define-key 'motion pdf-view-mode-map diff --git a/.emacs.d/lisp/init-evil-term.el b/.emacs.d/lisp/init-evil-term.el index 23d37a4d..de4070cb 100644 --- a/.emacs.d/lisp/init-evil-term.el +++ b/.emacs.d/lisp/init-evil-term.el @@ -2,14 +2,14 @@ (evil-set-initial-state 'term-mode 'insert) -;; TODO: Set prompt regexp. Test next/previous prompt functions, term-bol, etc. -;; Probably needs the same fix as Eshell. -;; TODO: Can the prompt be read-only? +;;; TODO: Set prompt regexp. Test next/previous prompt functions, term-bol, etc. +;;; Probably needs the same fix as Eshell. +;;; TODO: Can the prompt be read-only? -;; TODO: Rebinding ESC has the drawback that programs like vi cannot use it anymore. -;; Workaround: switch to Emacs mode and double-press ESC. -;; Otherwise leave ESC to C-cC-j. -;; Or bind char-mode ESC to C-cC-x? +;;; TODO: Rebinding ESC has the drawback that programs like vi cannot use it anymore. +;;; Workaround: switch to Emacs mode and double-press ESC. +;;; Otherwise leave ESC to C-cC-j. +;;; Or bind char-mode ESC to C-cC-x? (defun evil-term-char-mode-insert () (interactive) @@ -68,7 +68,7 @@ Each character you type is sent directly to the inferior without intervention from Emacs, except for the escape character (usually C-c)." (interactive) - ;; FIXME: Emit message? Cfr ilisp-raw-message + ;; FIXME: Emit message? Cf. elisp-raw-message (when (term-in-line-mode) (setq term-old-mode-map (current-local-map)) (use-local-map term-raw-map) diff --git a/.emacs.d/lisp/init-evil.el b/.emacs.d/lisp/init-evil.el index e6fa31ba..11d47d0f 100644 --- a/.emacs.d/lisp/init-evil.el +++ b/.emacs.d/lisp/init-evil.el @@ -1,23 +1,23 @@ -;; Evil +;;; Evil -;; TODO: helm-show-yank-ring behaves like Emacs when pasting whole lines, not like Vim. +;;; TODO: helm-show-yank-ring behaves like Emacs when pasting whole lines, not like Vim. -;; TODO: helm-mark-ring seems to have issues with Evil: -;; - The first entry is not the last position but the current one. -;; - Navigating through the marks randomly produces a "Marker points into wrong buffer" error. -;; https://github.com/emacs-evil/evil/issues/845#issuecomment-306050231 +;;; TODO: helm-mark-ring seems to have issues with Evil: +;;; - The first entry is not the last position but the current one. +;;; - Navigating through the marks randomly produces a "Marker points into wrong buffer" error. +;;; https://github.com/emacs-evil/evil/issues/845#issuecomment-306050231 -;; TODO: Make Evil commands react more dynamically with read-only text, like eshell, wdired. -;; Add support for I, C, D, S, s, c*, d*, R, r. -;; See https://github.com/emacs-evil/evil/issues/852. +;;; TODO: Make Evil commands react more dynamically with read-only text, like eshell, wdired. +;;; Add support for I, C, D, S, s, c*, d*, R, r. +;;; See https://github.com/emacs-evil/evil/issues/852. -;; REVIEW: 'cw' fails on the last character of the line when \n does not terminate it. -;; See https://github.com/emacs-evil/evil/issues/863. +;;; REVIEW: 'cw' fails on the last character of the line when \n does not terminate it. +;;; See https://github.com/emacs-evil/evil/issues/863. -;; Several packages handle relative line numbering: -;; - nlinum-relative: Seems slow as of May 2017. -;; - linum-relative: integrates well but not with fringe string, must be a function. -;; - relative-line-number: linum must be disabled before running this. +;;; Several packages handle relative line numbering: +;;; - nlinum-relative: Seems slow as of May 2017. +;;; - linum-relative: integrates well but not with fringe string, must be a function. +;;; - relative-line-number: linum must be disabled before running this. (when (require 'linum-relative nil t) ;; REVIEW: Current symbol is displayed on all lines when we run `occur', `set-variables', ;; `helm-occur', etc: https://github.com/coldnew/linum-relative/issues/40. @@ -35,17 +35,17 @@ evil-want-fine-undo t evil-symbol-word-search nil) -;; The evil-leader package has that over regular bindings that it centralizes -;; the leader key configuration and automatically makes it available in relevant -;; states. It is not really needed with EXWM however. +;;; The evil-leader package has that over regular bindings that it centralizes +;;; the leader key configuration and automatically makes it available in relevant +;;; states. It is not really needed with EXWM however. (when (require 'evil-leader nil t) (require 'init-evil-leader)) -;; Commenting. -;; M-; comments next line in VISUAL. This is because of a different newline -;; definition between Emacs and Vim. -;; https://github.com/redguardtoo/evil-nerd-commenter: does not work well with -;; motions and text objects, e.g. it cannot comment up without M--. -;; `evil-commentary' is the way to go. We don't need an additional minor-mode though. +;;; Commenting. +;;; M-; comments next line in VISUAL. This is because of a different newline +;;; definition between Emacs and Vim. +;;; https://github.com/redguardtoo/evil-nerd-commenter: does not work well with +;;; motions and text objects, e.g. it cannot comment up without M--. +;;; `evil-commentary' is the way to go. We don't need an additional minor-mode though. (when (require 'evil-commentary nil t) (evil-global-set-key 'normal "gc" 'evil-commentary) (evil-global-set-key 'normal "gy" 'evil-commentary-yank)) @@ -55,13 +55,13 @@ ;;; https://github.com/emacs-evil/evil/issues/854#issuecomment-309085267 (evil-set-initial-state 'term-mode 'emacs) -;; For git commit, web edits and others. -;; Since `with-editor-mode' is not a major mode, `evil-set-initial-state' cannot -;; be used. +;;; For git commit, web edits and others. +;;; Since `with-editor-mode' is not a major mode, `evil-set-initial-state' cannot +;;; be used. (when (require 'with-editor nil t) (add-hook 'with-editor-mode-hook 'evil-insert-state)) -;; Allow for evil states in minibuffer. Double exits. +;;; Allow for evil states in minibuffer. Double exits. (dolist (keymap ;; https://www.gnu.org/software/emacs/manual/html_node/elisp/ @@ -82,29 +82,29 @@ ;; then it may conflict with other packages' if they do the same. (evil-insert 1)) (add-hook 'minibuffer-setup-hook 'evil-minibuffer-setup) -;; Because of the above minibuffer-setup-hook, some bindings need be reset. +;;; Because of the above minibuffer-setup-hook, some bindings need be reset. (evil-define-key 'normal evil-ex-completion-map [escape] 'abort-recursive-edit) (evil-define-key 'insert evil-ex-completion-map "\M-p" 'previous-complete-history-element) (evil-define-key 'insert evil-ex-completion-map "\M-n" 'next-complete-history-element) -;; TODO: evil-ex history binding in normal mode do not work. +;;; TODO: evil-ex history binding in normal mode do not work. (evil-define-key 'normal evil-ex-completion-map "\M-p" 'previous-history-element) (evil-define-key 'normal evil-ex-completion-map "\M-n" 'next-history-element) (define-keys evil-ex-completion-map "M-p" 'previous-history-element "M-n" 'next-history-element) -;; Go-to-definition. -;; From https://emacs.stackexchange.com/questions/608/evil-map-keybindings-the-vim-way. +;;; Go-to-definition. +;;; From https://emacs.stackexchange.com/questions/608/evil-map-keybindings-the-vim-way. (evil-global-set-key 'normal "gd" (lambda () (interactive) (evil-execute-in-emacs-state) (call-interactively (key-binding (kbd "M-."))))) -;; Multiple cursors. -;; This shadows evil-magit's "gr", but we can use "?g" for that instead. -;; It shadows C-n/p (`evil-paste-pop'), but we use `helm-show-kill-ring' on -;; another binding. +;;; Multiple cursors. +;;; This shadows evil-magit's "gr", but we can use "?g" for that instead. +;;; It shadows C-n/p (`evil-paste-pop'), but we use `helm-show-kill-ring' on +;;; another binding. (when (require 'evil-mc nil t) (global-evil-mc-mode 1) (define-key evil-mc-key-map (kbd "C-") 'evil-mc-toggle-cursor-on-click) @@ -112,7 +112,7 @@ (when (require 'evil-mc-extras nil t) (global-evil-mc-extras-mode 1))) -;; Change mode-line color by Evil state. +;;; Change mode-line color by Evil state. (setq evil-default-modeline-color (cons (face-background 'mode-line) (or (face-foreground 'mode-line) "black"))) (defun evil-color-modeline () (let ((color (cond ((minibufferp) evil-default-modeline-color) @@ -124,8 +124,8 @@ (add-hook 'post-command-hook 'evil-color-modeline) (setq evil-mode-line-format nil) -;; Add defun text-object. TODO: Does not work for "around". -;; https://github.com/emacs-evil/evil/issues/874 +;;; Add defun text-object. TODO: Does not work for "around". +;;; https://github.com/emacs-evil/evil/issues/874 (evil-define-text-object evil-a-defun (count &optional beg end type) "Select a defun." (evil-select-an-object 'evil-defun beg end type count)) @@ -135,10 +135,11 @@ (define-key evil-outer-text-objects-map "d" 'evil-a-defun) (define-key evil-inner-text-objects-map "d" 'evil-inner-defun) -;; Without the hook, the Edebug keys (f, n, i, etc.) would get mixed up on initialization. +;;; Without the hook, the Edebug keys (f, n, i, etc.) would get mixed up on initialization. (add-hook 'edebug-mode-hook 'evil-normalize-keymaps) - +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Mode specific bindings. (require 'init-evil-info) (require 'init-evil-help) @@ -178,7 +179,7 @@ (with-eval-after-load 'calendar (require 'init-evil-calendar)) -;; nXML +;;; nXML (evil-define-key 'normal nxml-mode-map "<" 'nxml-backward-up-element) (with-eval-after-load 'magit @@ -191,6 +192,9 @@ (require 'evil-ediff nil t) (with-eval-after-load 'org (require 'init-evil-org)) +;; (when (require 'evil-org nil t) +;; (add-hook 'org-mode-hook 'evil-org-mode) +;; (evil-org-set-key-theme '(textobjects insert navigation additional shift todo heading))) (with-eval-after-load 'package (require 'init-evil-package)) diff --git a/.emacs.d/lisp/init-exwm.el b/.emacs.d/lisp/init-exwm.el index 637b076d..a9428a82 100644 --- a/.emacs.d/lisp/init-exwm.el +++ b/.emacs.d/lisp/init-exwm.el @@ -111,7 +111,7 @@ If there is none, fire it up." (defun exwm-start-screenshot () (interactive) (start-process-shell-command "scrot" nil "scrot ~/temp/screen-%F-%T.png")) (exwm-input-set-key (kbd "") #'exwm-start-screenshot) -;; TODO: Check out the 'volume' package. +;;; TODO: Check out the 'volume' package. (defun exwm-volume (&optional up-or-down) (let ((controllers '(("amixer" "set Master" "5%-" "5%+" "toggle") ("mixer" "vol" "-5" "+5" "^")))) diff --git a/.emacs.d/lisp/init-go.el b/.emacs.d/lisp/init-go.el index e31ceaad..e06aef8c 100644 --- a/.emacs.d/lisp/init-go.el +++ b/.emacs.d/lisp/init-go.el @@ -1,7 +1,7 @@ -;; Go +;;; Go -;; REVIEW: We should not need to use `use-local-map' here. -;; Reported at https://github.com/dominikh/go-mode.el/issues/191. +;;; REVIEW: We should not need to use `use-local-map' here. +;;; Reported at https://github.com/dominikh/go-mode.el/issues/191. (use-local-map go-mode-map) (local-set-keys diff --git a/.emacs.d/lisp/init-gud.el b/.emacs.d/lisp/init-gud.el index 8b67a654..44c15492 100644 --- a/.emacs.d/lisp/init-gud.el +++ b/.emacs.d/lisp/init-gud.el @@ -1,9 +1,9 @@ -;; GUD +;;; GUD -;; Set GUD to display many windows by default. +;;; Set GUD to display many windows by default. (setq gdb-many-windows t) -;; Change GUD many-windows layout. +;;; Change GUD many-windows layout. (defun gdb-setup-windows () "Layout the window pattern for `gdb-many-windows'. Do not set `gdb-show-main' to true as we handle it manually here." diff --git a/.emacs.d/lisp/init-helm.el b/.emacs.d/lisp/init-helm.el index 32458cf9..4e036cec 100644 --- a/.emacs.d/lisp/init-helm.el +++ b/.emacs.d/lisp/init-helm.el @@ -1,18 +1,18 @@ ;;; Helm -;; TODO: helm-ff should allow opening several marks externally, e.g. sxiv for -;; pics. See -;; https://github.com/emacs-helm/helm/wiki/Find-Files#open-files-externally -;; What about the default program? It currently defaults to ~/.mailcap, which is -;; not so customizable. Would ranger's rifle be useful here? See -;; https://github.com/emacs-helm/helm/issues/1796. -;; TODO: Batch-open torrent files automatically. Add to mailcap? Them as -;; above, C-c C-x does not allow for opening several files at once. +;;; TODO: helm-ff should allow opening several marks externally, e.g. sxiv for +;;; pics. See +;;; https://github.com/emacs-helm/helm/wiki/Find-Files#open-files-externally +;;; What about the default program? It currently defaults to ~/.mailcap, which is +;;; not so customizable. Would ranger's rifle be useful here? See +;;; https://github.com/emacs-helm/helm/issues/1796. +;;; TODO: Batch-open torrent files automatically. Add to mailcap? Them as +;;; above, C-c C-x does not allow for opening several files at once. -;; TODO: helm-find in big folders sometimes leads bad results, like exact match -;; not appearing first. Better sorting? -;; TODO: Implement alternating-color multiline lists. See open issue. -;; TODO: Fix typos and formatting in documentation. +;;; TODO: helm-find in big folders sometimes leads bad results, like exact match +;;; not appearing first. Better sorting? +;;; TODO: Implement alternating-color multiline lists. See open issue. +;;; TODO: Fix typos and formatting in documentation. (when (require 'helm-descbinds nil t) (helm-descbinds-mode)) @@ -96,8 +96,8 @@ (define-key eshell-mode-map (kbd "M-p") 'helm-eshell-history)) (add-hook 'eshell-mode-hook 'helm/eshell-set-keys) -;; TODO: Use helm-ff history in helm file completion. -;; https://github.com/emacs-helm/helm/issues/1118 +;;; TODO: Use helm-ff history in helm file completion. +;;; https://github.com/emacs-helm/helm/issues/1118 ;; (define-key helm-read-file-map (kbd "M-p") 'helm-ff-run-switch-to-history) ;;; Do not exclude any files from 'git grep'. diff --git a/.emacs.d/lisp/init-itranslate.el b/.emacs.d/lisp/init-itranslate.el index 7d8a9148..1aafec0e 100644 --- a/.emacs.d/lisp/init-itranslate.el +++ b/.emacs.d/lisp/init-itranslate.el @@ -1,5 +1,5 @@ ;;; Itranslate -;; Translate text from Internet services +;;; Translate text from Internet services (defvar itranslate-program "translate" "The translation program installed on the system.") diff --git a/.emacs.d/lisp/init-latex.el b/.emacs.d/lisp/init-latex.el index 9556ba39..cb654ab3 100644 --- a/.emacs.d/lisp/init-latex.el +++ b/.emacs.d/lisp/init-latex.el @@ -21,8 +21,8 @@ "C-c u" 'latex-package "M-RET" 'latex-itemize) -;; Needs dvipng. -;; With TeXlive, the following packages are needed: psnfss, symbol, zapfding +;;; Needs dvipng. +;;; With TeXlive, the following packages are needed: psnfss, symbol, zapfding (when (and (executable-find "dvipng") (require 'latex-math-preview nil t)) (setq latex-math-preview-cache-directory-for-insertion (concat emacs-cache-folder "latex-math-preview-cache")) @@ -33,7 +33,7 @@ (add-to-list 'latex-math-preview-usepackage-filter-alist '("color"))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Functions +;;; Functions (defun latex-itemize () "Itemize current line or lines in region. @@ -66,7 +66,7 @@ by an {itemize} environment." (newline-and-indent))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; LaTeX setup +;;; LaTeX setup (setq latex-block-default "itemize") (setq latex-block-names '("listing" "align" "align*" "Bmatrix" "Vmatrix" "bmatrix" "matrix" "pmatrix" "smallmatrix" "vmatrix")) @@ -81,7 +81,7 @@ by an {itemize} environment." ;; Need to reset the compiler because we changed tex-command, order matters. (tex-set-compiler)) -;; For some unknown reasons, `skeleton-end-hook' is set to nil in tex-mode. +;;; For some unknown reasons, `skeleton-end-hook' is set to nil in tex-mode. (dolist (fun '(latex-set-compiler turn-on-orgtbl turn-on-skeleton-markers)) ;; Since this file is loaded from `latex-mode-hook', these functions will not ;; be applied to the current buffer. We do it manually. @@ -89,7 +89,7 @@ by an {itemize} environment." (add-hook 'latex-mode-hook fun)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Skeletons +;;; Skeletons (define-skeleton latex-emph "Insert emph." nil "\\emph{" @ _ "}" @) (define-skeleton latex-slanted "Insert slanted text." nil "\\textsl{" @ _ "}" @) @@ -146,7 +146,7 @@ The table type is any value found in `latex-table-names'." "\\end{" str "}" > \n "\\end{center}" > \n @) -;; TODO: implement orgtbl directly with latex tables and remove this skel. +;;; TODO: implement orgtbl directly with latex tables and remove this skel. (define-skeleton latex-orgtbl "Insert orgtbl skel." "Table name: " diff --git a/.emacs.d/lisp/init-lua.el b/.emacs.d/lisp/init-lua.el index ca74b84e..a211ed63 100644 --- a/.emacs.d/lisp/init-lua.el +++ b/.emacs.d/lisp/init-lua.el @@ -1,4 +1,4 @@ -;; Lua +;;; Lua (defvaralias 'lua-indent-level 'tab-width) diff --git a/.emacs.d/lisp/init-makefile.el b/.emacs.d/lisp/init-makefile.el index f69e0aed..8dc2b239 100644 --- a/.emacs.d/lisp/init-makefile.el +++ b/.emacs.d/lisp/init-makefile.el @@ -1,4 +1,4 @@ -;; Makefile +;;; Makefile (define-keys makefile-mode-map "C-c c" 'makefile-config diff --git a/.emacs.d/lisp/init-mediawiki.el b/.emacs.d/lisp/init-mediawiki.el index c2d634ed..d78785d9 100644 --- a/.emacs.d/lisp/init-mediawiki.el +++ b/.emacs.d/lisp/init-mediawiki.el @@ -1,9 +1,9 @@ -;; MediaWiki +;;; MediaWiki -;; This mode has numerous issue with network queries: -;; https://github.com/hexmode/mediawiki-el/issues/ -;; Besides you can try extending `url-cookie-save-interval'. -;; Nonetheless is mode is helpfull for syntax awareness. +;;; This mode has numerous issue with network queries: +;;; https://github.com/hexmode/mediawiki-el/issues/ +;;; Besides you can try extending `url-cookie-save-interval'. +;;; Nonetheless is mode is helpfull for syntax awareness. (define-keys mediawiki-mode-map "C-c o" 'mediawiki-browse diff --git a/.emacs.d/lisp/init-mu4e.el b/.emacs.d/lisp/init-mu4e.el index ceace4e1..b01465d1 100644 --- a/.emacs.d/lisp/init-mu4e.el +++ b/.emacs.d/lisp/init-mu4e.el @@ -67,12 +67,12 @@ Default to unread messages if no" ;; Because default completion can be extended (e.g. Helm, Ivy). mu4e-completing-read-function 'completing-read) -;; Press "aV" to view in browser. +;;; Press "aV" to view in browser. (add-to-list 'mu4e-view-actions '("ViewInBrowser" . mu4e-action-view-in-browser) t) -;; Unicode chars for decoration might cause issues with some fonts or in terminals. -;; https://github.com/djcb/mu/issues/733 -;; https://github.com/djcb/mu/issues/1062 +;;; Unicode chars for decoration might cause issues with some fonts or in terminals. +;;; https://github.com/djcb/mu/issues/733 +;;; https://github.com/djcb/mu/issues/1062 ;; (setq mu4e-use-fancy-chars t) ;;; REVIEW: Sorting in ascending order is impeded by `mu4e-search-results-limit': the 500 oldest e-mails will be displayed first. @@ -89,7 +89,7 @@ Default to unread messages if no" (call-process-to-string "fortune" "-s")))) (add-hook 'mu4e-compose-pre-hook 'mu4e-add-fortune-signature) -;; Make unread e-mails stand out a bit. +;;; Make unread e-mails stand out a bit. (set-face-foreground 'mu4e-unread-face "yellow") (set-face-attribute 'mu4e-flagged-face nil :inherit 'font-lock-warning-face) diff --git a/.emacs.d/lisp/init-nroff.el b/.emacs.d/lisp/init-nroff.el index 25c1e7ba..77119b0c 100644 --- a/.emacs.d/lisp/init-nroff.el +++ b/.emacs.d/lisp/init-nroff.el @@ -1,10 +1,10 @@ -;; Nroff +;;; Nroff (define-keys nroff-mode-map "C-c C-b" 'nroff-bold "C-c C-i" 'nroff-italic) -;; Skeletons +;;; Skeletons (define-skeleton nroff-bold "Bold text." nil "\\fB" @ _ "\\fR" @) (define-skeleton nroff-italic "Italic text." nil "\\fI" @ _ "\\fR" @) diff --git a/.emacs.d/lisp/init-page.el b/.emacs.d/lisp/init-page.el index 01f9555a..1163eebf 100644 --- a/.emacs.d/lisp/init-page.el +++ b/.emacs.d/lisp/init-page.el @@ -1,4 +1,4 @@ -;; page-number-mode +;;; page-number-mode (defvar page-number--mode-line-position-without-page nil) @@ -25,7 +25,7 @@ mouse-1: Display Line and Column Mode Menu"))))) 'help-echo "Column number\n\ mouse-1: Display Line and Column Mode Menu"))))))) -;; This is different from `what-page' that returns a descriptive string. +;;; This is different from `what-page' that returns a descriptive string. (defun page-count () "Return page count." (save-restriction diff --git a/.emacs.d/lisp/init-python.el b/.emacs.d/lisp/init-python.el index af424d90..bc438a1f 100644 --- a/.emacs.d/lisp/init-python.el +++ b/.emacs.d/lisp/init-python.el @@ -1,4 +1,4 @@ -;; Python +;;; Python (defun python-set-compiler () "Returns the value of the shebang if any, `python-shell-interpreter' otherwise." @@ -14,8 +14,8 @@ (add-hook 'python-mode-hook 'python-set-compiler) -;; Doc lookup. Requires the python.info file to be installed. See -;; https://bitbucket.org/jonwaltman/pydoc-info/. +;;; Doc lookup. Requires the python.info file to be installed. See +;;; https://bitbucket.org/jonwaltman/pydoc-info/. ;; (add-to-list 'load-path "~/path/to/pydoc-info") ;; (require 'pydoc-info nil t) diff --git a/.emacs.d/lisp/init-tex.el b/.emacs.d/lisp/init-tex.el index e2a8c16a..98f5dfce 100644 --- a/.emacs.d/lisp/init-tex.el +++ b/.emacs.d/lisp/init-tex.el @@ -1,22 +1,22 @@ -;; TeX +;;; TeX -;; The default tex-mode and AucTeX may seem quite disappointing. Let's use -;; custom KISS functions for everything. +;;; The default tex-mode and AucTeX may seem quite disappointing. Let's use +;;; custom KISS functions for everything. -;; Interesting options for the tex compiler: -;; * -file-line-error-style: change the style of error report to -;; display file name and line first. -;; * -halt-on-error: default. -;; * -interaction : like -halt-on-error, you can set the way -;; the compilers behave on errors. Possible values for are -;; 'batchmode', 'errorstopmode', 'nonstopmode' and 'scrollmode'. -;; * -shell-escape: allow the use of \write18{} -;; from within TeX documents. This is a potential security issue. -;; * -synctex=1: enable SyncTeX support. -;; You may use file local variable for convenience: -;; % -*- tex-start-options: \"-shell-escape\" -;; Note that -shell-escape can also be toggled with universal -;; argument. +;;; Interesting options for the tex compiler: +;;; * -file-line-error-style: change the style of error report to +;;; display file name and line first. +;;; * -halt-on-error: default. +;;; * -interaction : like -halt-on-error, you can set the way +;;; the compilers behave on errors. Possible values for are +;;; 'batchmode', 'errorstopmode', 'nonstopmode' and 'scrollmode'. +;;; * -shell-escape: allow the use of \write18{} +;;; from within TeX documents. This is a potential security issue. +;;; * -synctex=1: enable SyncTeX support. +;;; You may use file local variable for convenience: +;;; % -*- tex-start-options: \"-shell-escape\" +;;; Note that -shell-escape can also be toggled with universal +;;; argument. (define-keys tex-mode-map "C-c C-f" nil @@ -45,7 +45,7 @@ :group 'tex) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Functions +;;; Functions (defun tex-set-compiler () "Set `compile-command' for TeX-based document." @@ -111,7 +111,7 @@ This does not interfere with `subword-mode'." (delete-windows-on "*compilation*")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; TeX setup +;;; TeX setup (setq-default tex-run-command "pdftex" @@ -120,9 +120,9 @@ This does not interfere with `subword-mode'." ;; default options. tex-start-commands nil) -;; `tex-mode' sets `indent-tabs-mode' to nil, invoking the following -;; argument: "TABs in verbatim environments don't do what you think." Not -;; sure how relevant this bad comment is. We revert it. +;;; `tex-mode' sets `indent-tabs-mode' to nil, invoking the following +;;; argument: "TABs in verbatim environments don't do what you think." Not +;;; sure how relevant this bad comment is. We revert it. (dolist (fun '(turn-on-indent-tabs turn-on-newline-paragraph turn-on-newline-paragraph @@ -130,11 +130,11 @@ This does not interfere with `subword-mode'." tex-set-compiler)) (add-hook 'tex-mode-hook fun)) -;; Not sure how useful that is: +;;; Not sure how useful that is: ;; (set (make-local-variable 'use-hard-newlines) t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Skeletons +;;; Skeletons (define-skeleton tex-array "Insert array." diff --git a/.emacs.d/lisp/init-texinfo.el b/.emacs.d/lisp/init-texinfo.el index 4883b9db..7f262c36 100644 --- a/.emacs.d/lisp/init-texinfo.el +++ b/.emacs.d/lisp/init-texinfo.el @@ -1,6 +1,6 @@ -;; Texinfo +;;; Texinfo -;; We use the TeX setup. +;;; We use the TeX setup. (require 'tex-mode) (require 'mode-tex) @@ -19,7 +19,7 @@ (set (make-local-variable 'tex-command) "texi2pdf -b") (tex-set-compiler)) -;; For some reason, Texinfo-mode forces the fill-column to 70... +;;; For some reason, Texinfo-mode forces the fill-column to 70... (dolist (fun '(texinfo-set-compiler reset-fill-column)) (add-hook 'texinfo-mode-hook fun)) diff --git a/.emacs.d/lisp/main.el b/.emacs.d/lisp/main.el index 4eec497f..1c480c5d 100644 --- a/.emacs.d/lisp/main.el +++ b/.emacs.d/lisp/main.el @@ -143,9 +143,9 @@ split-width-threshold 140) ;;; Windmove mode -;; By default, it allows easy window switching with Shift+arrows. I like to -;; stick to the home-row, but to avoid shadowing other binding I exceptionaly use -;; 'super' (normally reserved to the WM). +;;; By default, it allows easy window switching with Shift+arrows. I like to +;;; stick to the home-row, but to avoid shadowing other binding I exceptionaly use +;;; 'super' (normally reserved to the WM). (when (fboundp 'windmove-default-keybindings) (global-set-keys "s-h" 'windmove-left @@ -346,7 +346,7 @@ ;;; Frame title (setq frame-title-format (concat "%b" (unless (daemonp) " [serverless]"))) -;; Initial scratch buffer message. +;;; Initial scratch buffer message. (require 'functions) ; For `fortune-scratch-message'. (let ((fortune (fortune-scratch-message))) (when fortune