summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKΓ©vin Le Gouguec <kevin.legouguec@gmail.com>2018-04-15 22:36:55 +0200
committerKΓ©vin Le Gouguec <kevin.legouguec@gmail.com>2018-04-15 22:36:55 +0200
commit104ff31203519e3303637346ac372eac68f31e05 (patch)
tree36fa03cd2e27aa5a6d82127564b6058321fc0cbb
parentee6ed90a8fb33743f5b6b987d2792d0c1752089f (diff)
downloaddotfiles-104ff31203519e3303637346ac372eac68f31e05.tar.xz
Clean up a few things
- use my/ prefix on every defun - delight whitespace-mode - remove leftover binding in C mode - enable all "confusing" commands
-rw-r--r--.emacs30
-rw-r--r--.emacs-custom.el7
2 files changed, 17 insertions, 20 deletions
diff --git a/.emacs b/.emacs
index 2142c31..b49f196 100644
--- a/.emacs
+++ b/.emacs
@@ -36,7 +36,7 @@
(global-set-key (kbd "C-x C-b") 'ibuffer)
-;; C-c [:alpha:] is reserved for users - let's make good use of it
+;; C-c [[:alpha:]] is reserved for users - let's make good use of it.
(global-set-key (kbd "C-c c") 'compile)
(global-set-key (kbd "C-c f") 'auto-fill-mode)
@@ -49,9 +49,9 @@
(global-set-key (kbd "C-c w c") 'whitespace-cleanup)
(global-set-key (kbd "C-c w f") 'page-break-lines-mode)
(global-set-key (kbd "C-c w m") 'whitespace-mode)
-(global-set-key (kbd "C-c w t") 'set-tab-width)
+(global-set-key (kbd "C-c w t") 'my/set-tab-width)
-(rg-enable-default-bindings)
+(rg-enable-default-bindings) ; Uses the C-c s prefix.
;; TODO: define my own input method, instead of overloading TeX
;; https://www.emacswiki.org/emacs/TeXInputMethod explains why the
@@ -72,6 +72,9 @@
("<--" ?←) ("</-" ?β†š) ("<==" ?⇐) ("</=" ?⇍)
("<->" ?↔) ("<=>" ?⇔))))
+;; What's life without a little risk?
+(setq disabled-command-function nil)
+
;; Window management
@@ -104,8 +107,9 @@
(delight 'page-break-lines-mode nil "page-break-lines")
(delight 'scroll-lock-mode "πŸ“œ" "scroll-lock")
(delight 'visual-line-mode "β€Έ" t)
+(delight 'whitespace-mode nil "whitespace")
(delight 'with-editor-mode "⸎" "with-editor")
-;; TODO: narrowing
+;; TODO: Narrow (βŒ–, β›Ά)
(defun my/magit-mode-hook ()
(when window-system
@@ -120,9 +124,7 @@
(defun my/c-modes-hook ()
(c-set-style "bsd")
- (c-set-offset 'arglist-close 0)
- ;; TODO: find why c-mode is not happy with mark-defun
- (local-set-key (kbd "C-c h") 'c-mark-function))
+ (c-set-offset 'arglist-close 0))
(add-hook 'c-mode-common-hook 'my/c-modes-hook)
@@ -143,8 +145,8 @@
(defun my/makefile-hook ()
;; I would rather align backslashes with spaces rather than tabs;
;; however, I would also like indent-tabs-mode to remain non-nil.
- (local-set-key (kbd "C-c C-\\") (make-tabless 'makefile-backslash-region))
- (local-set-key (kbd "M-q") (make-tabless 'fill-paragraph)))
+ (local-set-key (kbd "C-c C-\\") (my/make-tabless 'makefile-backslash-region))
+ (local-set-key (kbd "M-q") (my/make-tabless 'fill-paragraph)))
(add-hook 'makefile-mode-hook 'my/makefile-hook)
@@ -183,14 +185,14 @@
;; Helper functions and miscellaneous settings.
-;; TODO: copy documentation from F
-(defun make-tabless (f)
- "Make a function which will disable tabs while running F."
+(defun my/make-tabless (f)
+ "Make a function which will run F with indent-tabs-mode disabled."
(lambda () (interactive)
+ ;; TODO: copy documentation from F
(let ((indent-tabs-mode nil))
(call-interactively f))))
-(defun set-tab-width (&optional arg)
+(defun my/set-tab-width (&optional arg)
(interactive "P")
(let ((new-width (cond (arg (prefix-numeric-value arg))
((= tab-width 4) 8)
@@ -237,7 +239,7 @@
(my/unfroggify)
(my/froggify)))
-(defun buffer-justify-full ()
+(defun my/buffer-justify-full ()
(setq default-justification 'full))
;; Font stuff (🀷 🀦)
diff --git a/.emacs-custom.el b/.emacs-custom.el
index 734cdcc..81d2513 100644
--- a/.emacs-custom.el
+++ b/.emacs-custom.el
@@ -1,8 +1,3 @@
-(put 'dired-find-alternate-file 'disabled nil)
-(put 'downcase-region 'disabled nil)
-(put 'upcase-region 'disabled nil)
-(put 'narrow-to-region 'disabled nil)
-
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
@@ -29,7 +24,7 @@
'(gdb-many-windows t)
'(git-commit-setup-hook
(quote
- (git-commit-save-message git-commit-setup-changelog-support git-commit-turn-on-auto-fill git-commit-turn-on-flyspell git-commit-propertize-diff with-editor-usage-message buffer-justify-full)))
+ (git-commit-save-message git-commit-setup-changelog-support git-commit-turn-on-auto-fill git-commit-turn-on-flyspell git-commit-propertize-diff with-editor-usage-message my/buffer-justify-full)))
'(global-page-break-lines-mode t nil (page-break-lines))
'(hscroll-step 1)
'(icomplete-mode t)