Browse Source

Add hook function (prefer it over lambda)

master
Riyyi 4 years ago
parent
commit
b1e97249af
  1. 29
      .emacs.d/config.org

29
.emacs.d/config.org

@ -292,7 +292,7 @@ Provides Emacs with a file tree.
(neo-mode-line-type 'none) (neo-mode-line-type 'none)
(neo-show-hidden-files t) (neo-show-hidden-files t)
(neo-vc-integration '(face)) (neo-vc-integration '(face))
:hook (neotree-mode . (lambda (&rest _) (display-line-numbers-mode 0)))) :hook (neotree-mode . dot/hook-disable-line-numbers))
#+END_SRC #+END_SRC
*** Centaur Tabs *** Centaur Tabs
@ -489,7 +489,7 @@ Irony requires M-x =irony-install-server=.
((c-mode ((c-mode
c++-mode) c++-mode)
. irony-mode) . irony-mode)
(irony-mode . irony-cdb-autosetup-compile-options) :hook (irony-mode . irony-cdb-autosetup-compile-options)
:init (setq irony-user-dir (concat dot-cache-dir "/irony/")) :init (setq irony-user-dir (concat dot-cache-dir "/irony/"))
:config :config
(push 'glsl-mode irony-supported-major-modes) (push 'glsl-mode irony-supported-major-modes)
@ -524,6 +524,7 @@ Irony requires M-x =irony-install-server=.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package dashboard (use-package dashboard
:demand
:custom :custom
(initial-buffer-choice (lambda () (get-buffer "*dashboard*"))) (initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
(dashboard-banner-logo-title "GNU Emacs master race!") (dashboard-banner-logo-title "GNU Emacs master race!")
@ -536,7 +537,7 @@ Irony requires M-x =irony-install-server=.
(dashboard-items '((projects . 10) (dashboard-items '((projects . 10)
(bookmarks . 5) (bookmarks . 5)
(recents . 5))) (recents . 5)))
:hook (dashboard-mode . (lambda (&rest _) (display-line-numbers-mode 0))) :hook (dashboard-mode . dot/hook-disable-line-numbers)
:config (dashboard-setup-startup-hook)) :config (dashboard-setup-startup-hook))
;; A better *help* buffer ;; A better *help* buffer
@ -589,9 +590,8 @@ https://github.com/laishulu/hl-fill-column
(elfeed-show-unique-buffers t) (elfeed-show-unique-buffers t)
:config :config
(load-file (concat dot-etc-dir "/elfeed-feeds.el")) (load-file (concat dot-etc-dir "/elfeed-feeds.el"))
:hook :hook (elfeed-search-mode . dot/hook-disable-line-numbers)
(elfeed-search-mode . (lambda (&rest _) (display-line-numbers-mode 0))) :hook (elfeed-show-mode . dot/hook-disable-line-numbers))
(elfeed-show-mode . (lambda (&rest _) (display-line-numbers-mode 0))))
#+END_SRC #+END_SRC
* General * General
@ -958,7 +958,19 @@ Functions that only use built-in Emacs functionality.
(set-visited-file-name new-name t t))))))) (set-visited-file-name new-name t t)))))))
#+END_SRC #+END_SRC
** Package Functions that are only used for hook calls.
#+BEGIN_SRC emacs-lisp
(defun dot/hook-disable-line-numbers ()
"Disable the line numbers."
(display-line-numbers-mode 0))
(defun dot/hook-disable-mode-line ()
"Disable the mode line."
(setq-local mode-line-format nil))
#+END_SRC
** Package Functions
Functions that use package functionality. Functions that use package functionality.
@ -1099,6 +1111,9 @@ Evil command aliases.
;; LaTeX, set correct tab mode ;; LaTeX, set correct tab mode
(add-hook 'latex-mode-hook (lambda () (setq indent-tabs-mode t))) (add-hook 'latex-mode-hook (lambda () (setq indent-tabs-mode t)))
;; Disable line numbers in terminal mode (breaks output otherwise)
(add-hook 'term-mode-hook 'dot/hook-disable-line-numbers)
;; Wrap lines in the middle of words, gives a \ indicator ;; Wrap lines in the middle of words, gives a \ indicator
(add-hook 'visual-line-mode-hook (lambda () (setq word-wrap nil))) (add-hook 'visual-line-mode-hook (lambda () (setq word-wrap nil)))
#+END_SRC #+END_SRC

Loading…
Cancel
Save