dev: updating pr7002 from pr

This commit is contained in:
Matt Nish-Lapidus 2024-01-27 09:23:57 -05:00
commit ae03012599
20 changed files with 167 additions and 148 deletions

View file

@ -13,7 +13,9 @@
:in PATH
Sets what directory to base the search out of. Defaults to the current project's root.
:recursive BOOL
Whether or not to search files recursively from the base directory."
Whether or not to search files recursively from the base directory.
:args LIST
Arguments to be appended to `consult-ripgrep-args'."
(declare (indent defun))
(unless (executable-find "rg")
(user-error "Couldn't find ripgrep in your PATH"))
@ -29,7 +31,7 @@
"--path-separator / --smart-case --no-heading "
"--with-filename --line-number --search-zip "
"--hidden -g !.git -g !.svn -g !.hg "
(mapconcat #'shell-quote-argument args " ")))
(mapconcat #'identity args " ")))
(prompt (if (stringp prompt) (string-trim prompt) "Search"))
(query (or query
(when (doom-region-active-p)

View file

@ -59,11 +59,16 @@
(after! woman
;; The woman-manpath default value does not necessarily match man. If we have
;; man available but aren't using it for performance reasons, we can extract
;; it's manpath.
(when (executable-find "man")
(setq woman-manpath
(split-string (cdr (doom-call-process "man" "--path"))
path-separator t))))
;; its manpath.
(let ((manpath (cond
((executable-find "manpath")
(split-string (cdr (doom-call-process "manpath"))
path-separator t))
((executable-find "man")
(split-string (cdr (doom-call-process "man" "--path"))
path-separator t)))))
(when manpath
(setq woman-manpath manpath))))
(use-package! drag-stuff

View file

@ -18,50 +18,9 @@
(t (recurse (1+ attempt))))))
(recurse 1))))
;;;###autoload
(defun +lisp/load-project-systems ()
"Load all systems of the current Lisp project into Sly."
(interactive)
(thread-last (+lisp--project-asd-file)
(+lisp--systems-from-asd)
(mapcar (lambda (s) (format ":%s" s)))
(funcall (lambda (ss) (string-join ss " ")))
(format "(ql:quickload '(%s))")
(sly-interactive-eval)))
(defun +lisp--project-asd-file ()
"Yield an absolute file path to the current project's `.asd' file."
(let* ((proot (doom-project-root))
(files (doom-files-in proot :depth 1 :match "[.]asd$")))
(pcase files
('() (error "No .asd file found in: %s" proot))
(`(,asdf) asdf)
(_ (error "Too many .asd files found in : %s" proot)))))
(defun +lisp--systems-from-asd (asdf)
"Given a path to an ASDF project definition, extract the names of
the systems defined therein."
(let ((file (doom-file-read asdf))
(patt "defsystem \"\\([a-z-/]+\\)"))
(when (not (string-match patt file))
(error "No systems defined in: %s" asdf))
(thread-last (s-match-strings-all patt file)
(mapcar #'cl-second))))
;; TODO Get this to run in a comint buffer?
;;;###autoload
(defun +lisp/test-system ()
"Run `asdf:test-system' on the selected system of the current project."
(interactive)
(thread-last (+lisp--project-asd-file)
(+lisp--systems-from-asd)
(completing-read "Test which Lisp system?")
(format "(asdf:test-system :%s)")
(sly-interactive-eval)))
;;;###autoload
(defun +lisp/reload-project ()
"Restart the Sly session and reload the current project."
"Restart the Sly session and reload a chosen system."
(interactive)
(sly-restart-inferior-lisp)
(cl-labels ((recurse (attempt)
@ -72,7 +31,7 @@ the systems defined therein."
(error "Failed to reload Lisp project in 5 attempts.")
(recurse (1+ attempt)))))))
(recurse 1)
(+lisp/load-project-systems)))
(sly-asdf-load-system)))
;;;###autoload
(defun +lisp/find-file-in-quicklisp ()

View file

@ -141,7 +141,7 @@
:desc "Who sets" "S" #'sly-who-sets)
(:prefix ("r" . "repl")
:desc "Clear REPL" "c" #'sly-mrepl-clear-repl
:desc "Load Project" "l" #'+lisp/load-project-systems
:desc "Load System" "l" #'sly-asdf-load-system
:desc "Quit connection" "q" #'sly-quit-lisp
:desc "Restart connection" "r" #'sly-restart-inferior-lisp
:desc "Reload Project" "R" #'+lisp/reload-project
@ -154,7 +154,7 @@
:desc "Replay stickers" "r" #'sly-stickers-replay
:desc "Add/remove sticker" "s" #'sly-stickers-dwim)
(:prefix ("t" . "test")
:desc "Test System" "s" #'+lisp/test-system)
:desc "Test System" "s" #'sly-asdf-test-system)
(:prefix ("T" . "trace")
:desc "Toggle" "t" #'sly-toggle-trace-fdefinition
:desc "Toggle (fancy)" "T" #'sly-toggle-fancy-trace
@ -168,3 +168,8 @@
:defer t
:init
(add-to-list 'sly-contribs 'sly-repl-ansi-color))
(use-package! sly-asdf
:defer t
:init
(add-to-list 'sly-contribs 'sly-asdf 'append))

View file

@ -1,6 +1,7 @@
;; -*- no-byte-compile: t; -*-
;;; lang/common-lisp/packages.el
(when (package! sly :pin "f34c22289a2b3ab10e607f9f8822d62bb5c98cf5")
(when (package! sly :pin "ed17d2c2bd7aead0fbb09c3d22861c80a522a097")
(package! sly-asdf :pin "6f9d751469bb82530db1673c22e7437ca6c95f45")
(package! sly-macrostep :pin "5113e4e926cd752b1d0bcc1508b3ebad5def5fad")
(package! sly-repl-ansi-color :pin "b9cd52d1cf927bf7e08582d46ab0bcf1d4fb5048"))

View file

@ -0,0 +1,5 @@
;;; lang/idris/doctor.el -*- lexical-binding: t; -*-
(when (require 'idris-mode nil t)
(unless (executable-find idris-interpreter-path)
(warn! "Cannot find the idris interpreter. Most features will not work.")))

View file

@ -182,19 +182,21 @@ Math faces should stay fixed by the mixed-pitch blacklist, this is mostly for
(dolist (env '("itemize" "enumerate" "description"))
(add-to-list 'LaTeX-indent-environment-list `(,env +latex-indent-item-fn)))
;; Fix #1849: allow fill-paragraph in itemize/enumerate.
(defadvice! +latex--re-indent-itemize-and-enumerate-a (fn &rest args)
;; Fix #1849: allow fill-paragraph in itemize/enumerate/description.
(defadvice! +latex--re-indent-itemize-and-enumerate-and-description-a (fn &rest args)
:around #'LaTeX-fill-region-as-para-do
(let ((LaTeX-indent-environment-list
(append LaTeX-indent-environment-list
'(("itemize" +latex-indent-item-fn)
("enumerate" +latex-indent-item-fn)))))
'(("itemize" +latex-indent-item-fn)
("enumerate" +latex-indent-item-fn)
("description" +latex-indent-item-fn)))))
(apply fn args)))
(defadvice! +latex--dont-indent-itemize-and-enumerate-a (fn &rest args)
(defadvice! +latex--dont-indent-itemize-and-enumerate-and-description-a (fn &rest args)
:around #'LaTeX-fill-region-as-paragraph
(let ((LaTeX-indent-environment-list LaTeX-indent-environment-list))
(delq! "itemize" LaTeX-indent-environment-list 'assoc)
(delq! "enumerate" LaTeX-indent-environment-list 'assoc)
(delq! "description" LaTeX-indent-environment-list 'assoc)
(apply fn args))))

View file

@ -852,6 +852,17 @@ can grow up to be fully-fledged org-mode buffers."
(add-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
nil 'local))))))
(defadvice! +org--restart-mode-before-indirect-buffer-a (base-buffer &rest _)
"Restart `org-mode' in buffers in which the mode has been deferred (see
`+org-defer-mode-in-agenda-buffers-h') before they become the base buffer for an
indirect buffer. This ensures that the buffer is fully functional not only when
the *user* visits it, but also when some code interacts with it via an indirect
buffer as done, e.g., by `org-capture'."
:before #'make-indirect-buffer
(with-current-buffer base-buffer
(when (memq #'+org--restart-mode-h doom-switch-buffer-hook)
(+org--restart-mode-h))))
(defvar recentf-exclude)
(defadvice! +org--optimize-backgrounded-agenda-buffers-a (fn file)
"Prevent temporarily opened agenda buffers from polluting recentf."

View file

@ -9,5 +9,5 @@
(package! eshell-syntax-highlighting :pin "4ac27eec6595ba116a6151dfaf0b0e0440101e10")
(unless IS-WINDOWS
(package! fish-completion :pin "df42e153082927536763bdf408184152a7c938c3")
(package! fish-completion :pin "d34d0b96fde63feedf13c4288183d8d4d4d748cf")
(package! bash-completion :pin "f1daac0386c24cbe8a244a62c7588cc6847b07ae"))

View file

@ -7,7 +7,7 @@
;; Example:
;; ((nil . ((ssh-deploy-root-local . "/local/path/to/project")
;; (ssh-deploy-root-remote . "/ssh:user@server:/remote/project/")
;; (ssh-deploy-on-explicit-save . t))))
;; (ssh-deploy-on-explicit-save . 1))))
;;
;; Note: `ssh-deploy-root-local' is optional, and will resort to
;; `doom-project-root' if unspecified.
@ -20,7 +20,7 @@
ssh-deploy-remote-changes-handler)
:init
(setq ssh-deploy-revision-folder (concat doom-cache-dir "ssh-revisions/")
ssh-deploy-on-explicit-save t
ssh-deploy-on-explicit-save 1
ssh-deploy-automatically-detect-remote-changes nil)
;; Make these safe as file-local variables

View file

@ -1,5 +1,5 @@
;; -*- no-byte-compile: t; -*-
;;; ui/doom/packages.el
(package! doom-themes :pin "4aee1f5a0e54552669f747aa7c25e6027e73d76d")
(package! doom-themes :pin "ff26f26ea3d761375f5fc4070438fbd0f3473d33")
(package! solaire-mode :pin "8af65fbdc50b25ed3214da949b8a484527c7cc14")

View file

@ -2,7 +2,9 @@
(use-package! highlight-indent-guides
:hook ((prog-mode text-mode conf-mode) . highlight-indent-guides-mode)
:init (setq highlight-indent-guides-method 'character)
:init
(setq highlight-indent-guides-method (if (display-graphic-p) 'bitmap 'character)
highlight-indent-guides-bitmap-function #'highlight-indent-guides--bitmap-line)
:config
;; HACK: If this package is loaded too early (by the user, and in terminal
;; Emacs), then `highlight-indent-guides-auto-set-faces' will have been

View file

@ -2,7 +2,7 @@
;;; ui/modeline/packages.el
(unless (modulep! +light)
(package! doom-modeline :pin "93f240f7a0bf35511cfc0a8dd75786744b4bcf77"))
(package! doom-modeline :pin "bf880ae56f3f6aab7bd334de9bd9b455c63a24c0"))
(package! anzu :pin "5abb37455ea44fa401d5f4c1bdc58adb2448db67")
(when (modulep! :editor evil)
(package! evil-anzu :pin "d1e98ee6976437164627542909a25c6946497899"))

View file

@ -505,11 +505,22 @@ Accepts the same arguments as `display-buffer-in-side-window'. You must set
((not (numberp vslot))
(error "Invalid vslot %s specified" vslot)))
(let* ((major (get-window-with-predicate
(let* ((live (get-window-with-predicate
(lambda (window)
(and (eq (window-parameter window 'window-side) side)
(eq (window-parameter window 'window-vslot) vslot)))
nil))
;; As opposed to the `window-side' property, the `window-vslot'
;; property is set only on a single live window and never on internal
;; windows. Moreover, as opposed to `window-with-parameter' (as used
;; by the original `display-buffer-in-side-window'),
;; `get-window-with-predicate' only returns live windows anyway. In
;; any case, we will have missed the major side window and got a
;; child instead if the major side window happens to be an internal
;; window. In that case, the major side window is the parent of the
;; live window.
(major (and live
(if (window-next-sibling live) (window-parent live) live)))
(reversed (window--sides-reverse-on-frame-p (selected-frame)))
(windows
(cond ((window-live-p major)

View file

@ -44,14 +44,14 @@
:to-contain '(size . 5)))))
(describe "popup rules"
:var (origin a b c d e f g)
:var (origin a b c d e f g h i)
(before-all (setq origin (current-buffer)))
(before-each
(dolist (name '(a b c d e f g))
(dolist (name '(a b c d e f g h i))
(set name (get-buffer-create (symbol-name name)))))
(after-each
(let (kill-buffer-query-functions kill-buffer-hook)
(dolist (x (list a b c d e f g))
(dolist (x (list a b c d e f g h i))
(ignore-errors (delete-window (get-buffer-window x)))
(kill-buffer x))))
@ -64,11 +64,13 @@
("d" :slot 2 :vslot 2)
("e" :slot 1 :vslot 3)
("f" :slot 1 :vslot 3)
("g"))))
("g" :slot 2 :vslot 3)
("h" :slot 2 :vslot 3)
("i"))))
(it "replaces popups with the same slots"
(mapc #'display-buffer (list e f))
(expect (length (+popup-windows)) :to-be 1))
(mapc #'display-buffer (list e f g h))
(expect (length (+popup-windows)) :to-be 2))
(it "replaces popups among multiple that have the same slots"
(let ((first (display-buffer a))
@ -92,7 +94,7 @@
(expect (window-in-direction 'right first t)
:to-equal second)))
(it "obeys default :slot"
(let ((window (display-buffer g)))
(let ((window (display-buffer i)))
(expect (window-parameter window 'window-slot) :to-be 1)
(expect (window-parameter window 'window-vslot) :to-be 1))))