General refactors & appease byte-compiler

This commit is contained in:
Henrik Lissner 2020-02-02 02:05:20 -05:00
parent 7224f0870a
commit 4a5cf04761
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
7 changed files with 46 additions and 36 deletions

View file

@ -210,7 +210,8 @@ ones."
"Return an alist mapping package names (strings) to pinned commits (strings)." "Return an alist mapping package names (strings) to pinned commits (strings)."
(let (alist) (let (alist)
(dolist (package doom-packages alist) (dolist (package doom-packages alist)
(with-plist! (cdr package) (recipe modules disable ignore pin unpin) (cl-destructuring-bind (_ &key disable ignore pin unpin &allow-other-keys)
package
(when (and (not ignore) (when (and (not ignore)
(not disable) (not disable)
(or pin unpin)) (or pin unpin))
@ -223,7 +224,9 @@ ones."
"Return an alist mapping package names (strings) to pinned commits (strings)." "Return an alist mapping package names (strings) to pinned commits (strings)."
(let (alist) (let (alist)
(dolist (package doom-packages alist) (dolist (package doom-packages alist)
(with-plist! (cdr package) (recipe modules disable ignore pin unpin) (cl-destructuring-bind
(_ &key recipe disable ignore pin unpin &allow-other-keys)
package
(when (and (not ignore) (when (and (not ignore)
(not disable) (not disable)
(or unpin (or unpin

View file

@ -1,6 +1,8 @@
;;; core/autoload/projects.el -*- lexical-binding: t; -*- ;;; core/autoload/projects.el -*- lexical-binding: t; -*-
(defvar projectile-project-root nil) (defvar projectile-enable-caching)
(defvar projectile-project-root)
(defvar projectile-require-project-root)
;;;###autoload (autoload 'projectile-relevant-known-projects "projectile") ;;;###autoload (autoload 'projectile-relevant-known-projects "projectile")

View file

@ -96,6 +96,7 @@ following:
;; ;;
;;; Commands ;;; Commands
(defvar projectile-enable-caching)
;;;###autoload ;;;###autoload
(defun doom/open-scratch-buffer (&optional arg project-p) (defun doom/open-scratch-buffer (&optional arg project-p)
"Pop up a persistent scratch buffer. "Pop up a persistent scratch buffer.

View file

@ -117,34 +117,37 @@ in some cases."
;;; Commands ;;; Commands
(defun doom--bol-bot-eot-eol (&optional pos) (defun doom--bol-bot-eot-eol (&optional pos)
(let* ((bol (if visual-line-mode (save-excursion
(save-excursion (when pos
(beginning-of-visual-line) (goto-char pos))
(point)) (let* ((bol (if visual-line-mode
(line-beginning-position))) (save-excursion
(bot (save-excursion (beginning-of-visual-line)
(goto-char bol) (point))
(skip-chars-forward " \t\r") (line-beginning-position)))
(point))) (bot (save-excursion
(eol (if visual-line-mode (goto-char bol)
(save-excursion (end-of-visual-line) (point)) (skip-chars-forward " \t\r")
(line-end-position))) (point)))
(eot (or (save-excursion (eol (if visual-line-mode
(if (not comment-use-syntax) (save-excursion (end-of-visual-line) (point))
(progn (line-end-position)))
(goto-char bol) (eot (or (save-excursion
(when (re-search-forward comment-start-skip eol t) (if (not comment-use-syntax)
(or (match-end 1) (match-beginning 0)))) (progn
(goto-char eol) (goto-char bol)
(while (and (doom-point-in-comment-p) (when (re-search-forward comment-start-skip eol t)
(> (point) bol)) (or (match-end 1) (match-beginning 0))))
(backward-char)) (goto-char eol)
(skip-chars-backward " " bol) (while (and (doom-point-in-comment-p)
(unless (or (eq (char-after) 32) (eolp)) (> (point) bol))
(forward-char)) (backward-char))
(point))) (skip-chars-backward " " bol)
eol))) (unless (or (eq (char-after) 32) (eolp))
(list bol bot eot eol))) (forward-char))
(point)))
eol)))
(list bol bot eot eol))))
(defvar doom--last-backward-pt nil) (defvar doom--last-backward-pt nil)
;;;###autoload ;;;###autoload
@ -154,7 +157,7 @@ beginning of the line. The opposite of
`doom/forward-to-last-non-comment-or-eol'." `doom/forward-to-last-non-comment-or-eol'."
(interactive "d") (interactive "d")
(let ((pt (or point (point)))) (let ((pt (or point (point))))
(cl-destructuring-bind (bol bot _eot eol) (cl-destructuring-bind (bol bot _eot _eol)
(doom--bol-bot-eot-eol pt) (doom--bol-bot-eot-eol pt)
(cond ((> pt bot) (cond ((> pt bot)
(goto-char bot)) (goto-char bot))

View file

@ -3,9 +3,9 @@
(defvar +calendar--wconf nil) (defvar +calendar--wconf nil)
(defun +calendar--init () (defun +calendar--init ()
(if-let* ((win (cl-loop for win in (doom-visible-windows) (if-let (win (cl-find-if (lambda (b) (string-match-p "^\\*cfw:" (buffer-name b)))
if (string-match-p "^\\*cfw:" (buffer-name (window-buffer win))) (doom-visible-windows)
return win))) :key #'window-buffer))
(select-window win) (select-window win)
(call-interactively +calendar-open-function))) (call-interactively +calendar-open-function)))

View file

@ -126,7 +126,7 @@ directives. By default, this only recognizes C directives.")
(count-lines (point-min) (point-max)) (count-lines (point-min) (point-max))
(buffer-size))))) (buffer-size)))))
;; 'gq' moves the cursor to the beginning of selection. Disable this, since ;; '=' moves the cursor to the beginning of selection. Disable this, since
;; it's more disruptive than helpful. ;; it's more disruptive than helpful.
(defadvice! +evil--dont-move-cursor-a (orig-fn &rest args) (defadvice! +evil--dont-move-cursor-a (orig-fn &rest args)
:around #'evil-indent :around #'evil-indent

View file

@ -3,6 +3,7 @@
;; REVIEW Refactor me ;; REVIEW Refactor me
(defvar pcomplete-suffix-list)
(defvar company-pcomplete-available 'unknown) (defvar company-pcomplete-available 'unknown)
(defun company-pcomplete--prefix () (defun company-pcomplete--prefix ()