Emacs: Comment config consistently

master
Pierre Neidhardt 2017-10-08 19:36:28 +01:00
parent 4a920898c8
commit fc972a32c9
29 changed files with 152 additions and 147 deletions

View File

@ -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.)

View File

@ -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.

View File

@ -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?

View File

@ -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.

View File

@ -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)

View File

@ -1,4 +1,4 @@
;; Evil+Eshell
;;; Evil+Eshell
(defun evil/eshell-next-prompt ()
(when (get-text-property (point) 'read-only)

View File

@ -1,7 +1,7 @@
;;; Evil+Helm
;; TODO: Make bindings completely evil: <esc> then hjkl should do what is intended.
;; Try out and see how convenient that is.
;;; TODO: Make bindings completely evil: <esc> then hjkl should do what is intended.
;;; Try out and see how convenient that is.
(global-set-key "\M-y" 'helm-show-kill-ring)

View File

@ -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)

View File

@ -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 "<SPC>")
(global-evil-leader-mode)
@ -37,7 +37,7 @@
(require 'evil-mu4e nil t)
(evil-leader/set-key "m" 'mu4e-headers-unread))
;; Since <SPC> is no longer available, as some replacements:
;;; Since <SPC> 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)

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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 <ESC> exits.
;;; Allow for evil states in minibuffer. Double <ESC> 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-<mouse-1>") '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))

View File

@ -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 "<print>") #'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" "^"))))

View File

@ -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

View File

@ -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."

View File

@ -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'.

View File

@ -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.")

View File

@ -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: "

View File

@ -1,4 +1,4 @@
;; Lua
;;; Lua
(defvaralias 'lua-indent-level 'tab-width)

View File

@ -1,4 +1,4 @@
;; Makefile
;;; Makefile
(define-keys makefile-mode-map
"C-c c" 'makefile-config

View File

@ -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

View File

@ -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)

View File

@ -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" @)

View File

@ -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

View File

@ -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)

View File

@ -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 <mode>: like -halt-on-error, you can set the way
;; the compilers behave on errors. Possible values for <mode> are
;; 'batchmode', 'errorstopmode', 'nonstopmode' and 'scrollmode'.
;; * -shell-escape: allow the use of \write18{<external command>}
;; 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 <mode>: like -halt-on-error, you can set the way
;;; the compilers behave on errors. Possible values for <mode> are
;;; 'batchmode', 'errorstopmode', 'nonstopmode' and 'scrollmode'.
;;; * -shell-escape: allow the use of \write18{<external command>}
;;; 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."

View File

@ -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))

View File

@ -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