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)
# 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
emacsclient -a "" \

View File

@ -55,7 +55,7 @@ in."
emacs-version))
((= emacs-major-version 26)
(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)))
(print! (start "Checking for Emacs config conflicts..."))

View File

@ -28,6 +28,8 @@ and Emacs states, and for non-evil users.")
(cond
(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
ns-command-modifier 'super
mac-option-modifier 'meta

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -100,7 +100,11 @@
(dolist (brace '("(" "{" "["))
(sp-pair brace nil
: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)))
;; In lisps ( should open a new form if before another parenthesis