General refactor & cleanup
+ refactor package management + core-editor: describe ediff + core-popups: alphabetized hack blocks + ui/doom-modeline: refactor buffer path fn + feature/version-control/+git: autoload magit-blame
This commit is contained in:
parent
af88423b35
commit
25fa4e019c
5 changed files with 21 additions and 21 deletions
|
@ -11,7 +11,7 @@
|
|||
(when last-refresh
|
||||
(setq doom--last-refresh last-refresh)))
|
||||
(when (or (not doom--last-refresh)
|
||||
(> (nth 1 (time-since doom--last-refresh)) 600))
|
||||
(> (nth 1 (time-since doom--last-refresh)) 900))
|
||||
(package-refresh-contents)
|
||||
(persistent-soft-store
|
||||
'last-pkg-refresh (setq doom--last-refresh (current-time))
|
||||
|
@ -22,15 +22,17 @@
|
|||
"Get which backend the package NAME was installed with. Can either be elpa,
|
||||
quelpa or nil (if not installed)."
|
||||
(doom-initialize)
|
||||
(unless (quelpa-setup-p)
|
||||
(error "Could not initialize quelpa"))
|
||||
(cond ((let ((plist (cdr (assq name doom-packages))))
|
||||
(and (not (plist-get plist :pin))
|
||||
(or (quelpa-setup-p)
|
||||
(error "Could not initialize quelpa"))
|
||||
(or (assq name quelpa-cache)
|
||||
(plist-get plist :recipe))))
|
||||
'quelpa)
|
||||
((assq name package-alist)
|
||||
'elpa)))
|
||||
'elpa)
|
||||
(t
|
||||
(error "%s package not installed" name))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-package-outdated-p (name)
|
||||
|
@ -46,7 +48,7 @@ list of the package."
|
|||
(let ((recipe (assq name quelpa-cache))
|
||||
(dir (expand-file-name (symbol-name name) quelpa-build-dir))
|
||||
(inhibit-message t))
|
||||
(if-let (ver (and (quelpa-setup-p) (quelpa-checkout recipe dir)))
|
||||
(if-let (ver (quelpa-checkout recipe dir))
|
||||
(version-to-list ver)
|
||||
old-version)))
|
||||
('elpa
|
||||
|
@ -70,8 +72,6 @@ the packages relevant to that backend.
|
|||
Warning: this function is expensive; it re-evaluates all of doom's config files.
|
||||
Be careful not to use it in a loop."
|
||||
(doom-initialize-packages t)
|
||||
(unless (quelpa-setup-p)
|
||||
(error "Could not initialize quelpa"))
|
||||
(delq nil
|
||||
(mapcar (lambda (pkgsym)
|
||||
(or (assq pkgsym doom-packages)
|
||||
|
|
|
@ -67,7 +67,7 @@ modes are active and the buffer is read-only.")
|
|||
recentf-filename-handlers '(abbreviate-file-name))
|
||||
(quiet! (recentf-mode 1))
|
||||
|
||||
;; Ediff
|
||||
;; Ediff: use existing frame instead of creating a new one
|
||||
(add-hook! ediff-load
|
||||
(setq ediff-diff-options "-w"
|
||||
ediff-split-window-function #'split-window-horizontally
|
||||
|
|
|
@ -392,6 +392,13 @@ the command buffer."
|
|||
(doom--switch-from-popup (find-function-search-for-symbol fun 'defface file)))))
|
||||
|
||||
|
||||
(after! mu4e
|
||||
(defun doom*mu4e-popup-window (buf height)
|
||||
(doom-popup-buffer buf :size 10 :noselect t)
|
||||
buf)
|
||||
(advice-add #'mu4e~temp-window :override #'doom*mu4e-popup-window))
|
||||
|
||||
|
||||
(after! neotree
|
||||
;; Neotree has its own window/popup management built-in, which is difficult to
|
||||
;; police. For example, switching perspectives will cause neotree to forget it
|
||||
|
@ -406,22 +413,15 @@ the command buffer."
|
|||
(doom-popup-buffer buf)))
|
||||
|
||||
|
||||
(after! mu4e
|
||||
(defun doom*mu4e-popup-window (buf height)
|
||||
(doom-popup-buffer buf :size 10 :noselect t)
|
||||
buf)
|
||||
(advice-add #'mu4e~temp-window :override #'doom*mu4e-popup-window))
|
||||
(after! quickrun
|
||||
;; don't auto-focus quickrun windows, shackle handles that
|
||||
(setq quickrun-focus-p nil))
|
||||
|
||||
|
||||
(after! twittering-mode
|
||||
(setq twittering-pop-to-buffer-function #'pop-to-buffer))
|
||||
|
||||
|
||||
(after! quickrun
|
||||
;; don't auto-focus quickrun windows, shackle handles that
|
||||
(setq quickrun-focus-p nil))
|
||||
|
||||
|
||||
(after! xref
|
||||
(defun doom*xref-follow-and-close (orig-fn &rest args)
|
||||
"Jump to the xref on the current line, select its window and close the popup
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
|
||||
|
||||
(def-package! magit
|
||||
:commands magit-status
|
||||
:commands (magit-status magit-blame)
|
||||
:config
|
||||
(set! :popup "^\\*magit" :regexp t)
|
||||
(map! :map magit-mode-map
|
||||
|
|
|
@ -259,8 +259,8 @@ project root). Excludes the file basename. See `doom-buffer-name' for that."
|
|||
(when (and path (equal "" (car path)))
|
||||
(setq path (cdr path)))
|
||||
(while (and path (<= (length output) (- max-length 4)))
|
||||
(setq output (concat (car path) "/" output))
|
||||
(setq path (cdr path)))
|
||||
(setq output (concat (car path) "/" output)
|
||||
path (cdr path)))
|
||||
(when path
|
||||
(setq output (concat "../" output)))
|
||||
(unless (string-suffix-p "/" output)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue