Minor reformatting & refactors across the board

This commit is contained in:
Henrik Lissner 2021-02-25 13:56:41 -05:00
parent 03fa2eafee
commit 1274de3d34
9 changed files with 24 additions and 15 deletions

View file

@ -31,7 +31,7 @@ shift $((OPTIND-1))
[ -t 0 ] && str="$*" || str=$(cat) [ -t 0 ] && str="$*" || str=$(cat)
# Fix incompatible terminals that cause odd 'not a valid terminal' errors # Fix incompatible terminals that cause odd 'not a valid terminal' errors
[ $TERM = "alacritty" ] && export TERM=xterm-256color [ "$TERM" = "alacritty" ] && export TERM=xterm-256color
if [ $daemon ]; then if [ $daemon ]; then
emacsclient -a "" \ emacsclient -a "" \

View file

@ -55,7 +55,7 @@ in."
emacs-version)) emacs-version))
((= emacs-major-version 26) ((= emacs-major-version 26)
(warn! (concat "Emacs %s detected. Doom is dropping Emacs 26.x support very soon. Consider " (warn! (concat "Emacs %s detected. Doom is dropping Emacs 26.x support very soon. Consider "
"upgrading to Emacs 27.x.") "upgrading to Emacs 27.1.")
emacs-version))) emacs-version)))
(print! (start "Checking for Emacs config conflicts...")) (print! (start "Checking for Emacs config conflicts..."))

View file

@ -28,6 +28,8 @@ and Emacs states, and for non-evil users.")
(cond (cond
(IS-MAC (IS-MAC
;; mac-* variables are used by the special emacs-mac build of Emacs by
;; Yamamoto Mitsuharu, while other builds use ns-*.
(setq mac-command-modifier 'super (setq mac-command-modifier 'super
ns-command-modifier 'super ns-command-modifier 'super
mac-option-modifier 'meta mac-option-modifier 'meta

View file

@ -420,7 +420,7 @@ intervals."
(let ((req (pop packages))) (let ((req (pop packages)))
(unless (featurep req) (unless (featurep req)
(doom-log "Incrementally loading %s" req) (doom-log "Incrementally loading %s" req)
(condition-case e (condition-case-unless-debug e
(or (while-no-input (or (while-no-input
;; If `default-directory' is a directory that doesn't exist ;; If `default-directory' is a directory that doesn't exist
;; or is unreadable, Emacs throws up file-missing errors, so ;; or is unreadable, Emacs throws up file-missing errors, so

View file

@ -24,12 +24,12 @@
(doom-modeline-def-modeline 'emacs-everywhere (doom-modeline-def-modeline 'emacs-everywhere
'(bar modals emacs-everywhere buffer-position word-count parrot selection-info) '(bar modals emacs-everywhere buffer-position word-count parrot selection-info)
'(input-method major-mode checker)) '(input-method major-mode checker))
(defun emacs-everywhere-set-modeline () (add-hook! 'emacs-everywhere-init-hooks
(doom-modeline-set-modeline 'emacs-everywhere)) (defun +everywhere-set-modeline ()
(add-hook 'emacs-everywhere-init-hooks #'emacs-everywhere-set-modeline)) (doom-modeline-set-modeline 'emacs-everywhere))))
(when (featurep! :ui workspaces) (add-hook! 'emacs-everywhere-init-hooks
(defun emacs-everywhere-clear-persp-info () (defun +everywhere-clear-persp-info-h ()
(setq persp-emacsclient-init-frame-behaviour-override nil)) (when (bound-and-true-p persp-mode)
(add-hook 'emacs-everywhere-init-hooks #'emacs-everywhere-clear-persp-info)) (setq persp-emacsclient-init-frame-behaviour-override nil))))
(after! solaire-mode (after! solaire-mode
(add-hook 'emacs-everywhere-init-hooks #'solaire-mode))) (add-hook 'emacs-everywhere-init-hooks #'solaire-mode)))

View file

@ -81,8 +81,10 @@ Examples:
;;;###autoload ;;;###autoload
(defun +company-has-completion-p () (defun +company-has-completion-p ()
"Return non-nil if a completion candidate exists at point." "Return non-nil if a completion candidate exists at point."
(and (company-manual-begin) (when company-mode
(= company-candidates-length 1))) (unless company-candidates-length
(company-manual-begin))
(= company-candidates-length 1)))
;;;###autoload ;;;###autoload
(defun +company/toggle-auto-completion () (defun +company/toggle-auto-completion ()

View file

@ -73,6 +73,7 @@
(after! eldoc (after! eldoc
(eldoc-add-command 'company-complete-selection (eldoc-add-command 'company-complete-selection
'company-complete-common 'company-complete-common
'company-capf
'company-abort))) 'company-abort)))

View file

@ -118,8 +118,8 @@
;;; :completion ;;; :completion
(map! (:when (featurep! :completion company) (map! (:when (featurep! :completion company)
:i "C-@" (cmds! (not (minibufferp)) #'+company/complete) :i "C-@" (cmds! (not (minibufferp)) #'company-complete-common)
:i "C-SPC" (cmds! (not (minibufferp)) #'+company/complete) :i "C-SPC" (cmds! (not (minibufferp)) #'company-complete-common)
(:after company (:after company
(:map company-active-map (:map company-active-map
"C-w" nil ; don't interfere with `evil-delete-backward-word' "C-w" nil ; don't interfere with `evil-delete-backward-word'

View file

@ -100,7 +100,11 @@
(dolist (brace '("(" "{" "[")) (dolist (brace '("(" "{" "["))
(sp-pair brace nil (sp-pair brace nil
:post-handlers '(("||\n[i]" "RET") ("| " "SPC")) :post-handlers '(("||\n[i]" "RET") ("| " "SPC"))
;; I likely don't want a new pair if adjacent to a word or opening brace ;; Don't autopair opening braces if before a word character or
;; other opening brace. The rationale: it interferes with manual
;; balancing of braces, and is odd form to have s-exps with no
;; whitespace in between, e.g. ()()(). Insert whitespace if
;; genuinely want to start a new form in the middle of a word.
:unless '(sp-point-before-word-p sp-point-before-same-p))) :unless '(sp-point-before-word-p sp-point-before-same-p)))
;; In lisps ( should open a new form if before another parenthesis ;; In lisps ( should open a new form if before another parenthesis