From eb995adada353cb09910b5ae943d52afa4e127ff Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 29 Apr 2020 21:54:02 -0400 Subject: [PATCH] Minor refactors & comment revision --- core/core-ui.el | 67 +++++++++++++++++++++++++------------------------ core/core.el | 14 +++++------ 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/core/core-ui.el b/core/core-ui.el index 80c172265..fe9adad88 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -85,50 +85,51 @@ size.") (defvar doom--last-frame nil) (defun doom-run-switch-window-hooks-h () - (let ((gc-cons-threshold most-positive-fixnum)) - (unless (or doom-inhibit-switch-window-hooks - (eq doom--last-window (selected-window)) - (minibufferp)) - (let ((doom-inhibit-switch-window-hooks t) - (inhibit-redisplay t)) - (run-hooks 'doom-switch-window-hook) - (setq doom--last-window (selected-window)))))) + (unless (or doom-inhibit-switch-window-hooks + (eq doom--last-window (selected-window)) + (minibufferp)) + (let ((gc-cons-threshold most-positive-fixnum) + (doom-inhibit-switch-window-hooks t) + (inhibit-redisplay t)) + (run-hooks 'doom-switch-window-hook) + (setq doom--last-window (selected-window))))) (defun doom-run-switch-frame-hooks-h (&rest _) (unless (or doom-inhibit-switch-frame-hooks (eq doom--last-frame (selected-frame)) (frame-parameter nil 'parent-frame)) - (let ((doom-inhibit-switch-frame-hooks t)) + (let ((gc-cons-threshold most-positive-fixnum) + (doom-inhibit-switch-frame-hooks t)) (run-hooks 'doom-switch-frame-hook) (setq doom--last-frame (selected-frame))))) (defun doom-run-switch-buffer-hooks-a (orig-fn buffer-or-name &rest args) - (let ((gc-cons-threshold most-positive-fixnum)) - (if (or doom-inhibit-switch-buffer-hooks - (and buffer-or-name - (eq (current-buffer) - (get-buffer buffer-or-name))) - (and (eq orig-fn #'switch-to-buffer) (car args))) - (apply orig-fn buffer-or-name args) - (let ((doom-inhibit-switch-buffer-hooks t) - (inhibit-redisplay t)) - (when-let (buffer (apply orig-fn buffer-or-name args)) - (with-current-buffer (if (windowp buffer) - (window-buffer buffer) - buffer) - (run-hooks 'doom-switch-buffer-hook)) - buffer))))) + (if (or doom-inhibit-switch-buffer-hooks + (and buffer-or-name + (eq (current-buffer) + (get-buffer buffer-or-name))) + (and (eq orig-fn #'switch-to-buffer) (car args))) + (apply orig-fn buffer-or-name args) + (let ((gc-cons-threshold most-positive-fixnum) + (doom-inhibit-switch-buffer-hooks t) + (inhibit-redisplay t)) + (when-let (buffer (apply orig-fn buffer-or-name args)) + (with-current-buffer (if (windowp buffer) + (window-buffer buffer) + buffer) + (run-hooks 'doom-switch-buffer-hook)) + buffer)))) (defun doom-run-switch-to-next-prev-buffer-hooks-a (orig-fn &rest args) - (let ((gc-cons-threshold most-positive-fixnum)) - (if doom-inhibit-switch-buffer-hooks - (apply orig-fn args) - (let ((doom-inhibit-switch-buffer-hooks t) - (inhibit-redisplay t)) - (when-let (buffer (apply orig-fn args)) - (with-current-buffer buffer - (run-hooks 'doom-switch-buffer-hook)) - buffer))))) + (if doom-inhibit-switch-buffer-hooks + (apply orig-fn args) + (let ((gc-cons-threshold most-positive-fixnum) + (doom-inhibit-switch-buffer-hooks t) + (inhibit-redisplay t)) + (when-let (buffer (apply orig-fn args)) + (with-current-buffer buffer + (run-hooks 'doom-switch-buffer-hook)) + buffer)))) (defun doom-protect-fallback-buffer-h () "Don't kill the scratch buffer. Meant for `kill-buffer-query-functions'." diff --git a/core/core.el b/core/core.el index 493a71a4b..7d36dcbf7 100644 --- a/core/core.el +++ b/core/core.el @@ -209,20 +209,20 @@ users).") ;; https://www.keylength.com/en/4/ gnutls-min-prime-bits 3072 tls-checktrust gnutls-verify-error - ;; Emacs is built with `gnutls' by default, so `tls-program' would not - ;; be used in that case. Otherwiese, people have reasons to not go with - ;; `gnutls', we use `openssl' instead. - ;; For more details, see https://redd.it/8sykl1 + ;; Emacs is built with `gnutls' by default, so `tls-program' would not be + ;; used in that case. Otherwise, people have reasons to not go with + ;; `gnutls', we use `openssl' instead. For more details, see + ;; https://redd.it/8sykl1 tls-program '("openssl s_client -connect %h:%p -CAfile %t -nbio -no_ssl3 -no_tls1 -no_tls1_1 -ign_eof" "gnutls-cli -p %p --dh-bits=3072 --ocsp --x509cafile=%t \ --strict-tofu --priority='SECURE192:+SECURE128:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3' %h" ;; compatibility fallbacks "gnutls-cli -p %p %h")) -;; Emacs stores authinfo in $HOME and in plaintext. Let's not do that, mkay? +;; Emacs stores `authinfo' in $HOME and in plain-text. Let's not do that, mkay? ;; This file stores usernames, passwords, and other such treasures for the ;; aspiring malicious third party. -(setq auth-sources (list (expand-file-name "authinfo.gpg" doom-etc-dir) +(setq auth-sources (list (concat doom-etc-dir "authinfo.gpg") "~/.authinfo.gpg")) ;; Emacs on Windows frequently confuses HOME (C:\Users\) and %APPDATA%, @@ -285,7 +285,7 @@ users).") (setq ffap-machine-p-known 'reject) ;; Font compacting can be terribly expensive, especially for rendering icon -;; fonts on Windows. Whether it has a noteable affect on Linux and Mac hasn't +;; fonts on Windows. Whether it has a notable affect on Linux and Mac hasn't ;; been determined, but we inhibit it there anyway. (setq inhibit-compacting-font-caches t)