Use powershell for interactive shell buffers

Misc formatting
This commit is contained in:
Emma Turner
2026-10-29 12:27:45 -06:00
parent a34c3a8181
commit 04cf86563e
+36 -29
View File
@@ -79,6 +79,12 @@
;; ;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented. ;; they are implemented.
;; Use PowerShell for interactive shell buffers.
(setq explicit-shell-file-name "pwsh.exe")
(setq shell-file-name "pwsh.exe")
(setq shell-command-switch "-Command")
(after! (after!
org (setq org-hide-emphasis-markers t) (setq org-log-done 'time) org (setq org-hide-emphasis-markers t) (setq org-log-done 'time)
@@ -107,41 +113,42 @@
:commands (elisp-autofmt-mode elisp-autofmt-buffer) :commands (elisp-autofmt-mode elisp-autofmt-buffer)
:hook (emacs-lisp-mode . elisp-autofmt-mode)) :hook (emacs-lisp-mode . elisp-autofmt-mode))
;; Based off https://github.com/alphapapa/unpackaged.el#ensure-blank-lines-between-headings-and-before-contents ;; Based off https://github.com/alphapapa/unpackaged.el#ensure-blank-lines-between-headings-and-before-contents
;;;###autoload ;;;###autoload
(defun org-format (&optional prefix) (defun org-format (&optional prefix)
"Ensure that blank lines exist between headings and between headings and their contents. "Ensure that blank lines exist between headings and between headings and their contents.
With prefix, operate on whole buffer. Ensures that blank lines With prefix, operate on whole buffer. Ensures that blank lines
exist after each headings's drawers." exist after each headings's drawers."
(interactive "P") (interactive "P")
(org-map-entries (lambda () (org-map-entries
(org-with-wide-buffer (lambda ()
;; `org-map-entries' narrows the buffer, which prevents us from seeing (org-with-wide-buffer
;; newlines before the current heading, so we do this part widened. ;; `org-map-entries' narrows the buffer, which prevents us from seeing
(while (not (looking-back "\n\n" nil)) ;; newlines before the current heading, so we do this part widened.
;; Insert blank lines before heading. (while (not (looking-back "\n\n" nil))
(insert "\n"))) ;; Insert blank lines before heading.
(let ((end (org-entry-end-position))) (insert "\n")))
;; Insert blank lines before entry content (let ((end (org-entry-end-position)))
(forward-line) ;; Insert blank lines before entry content
(while (and (org-at-planning-p) (forward-line)
(< (point) (point-max))) (while (and (org-at-planning-p) (< (point) (point-max)))
;; Skip planning lines ;; Skip planning lines
(forward-line)) (forward-line))
(while (re-search-forward org-drawer-regexp end t) (while (re-search-forward org-drawer-regexp end t)
;; Skip drawers. You might think that `org-at-drawer-p' would suffice, but ;; Skip drawers. You might think that `org-at-drawer-p' would suffice, but
;; for some reason it doesn't work correctly when operating on hidden text. ;; for some reason it doesn't work correctly when operating on hidden text.
;; This works, taken from `org-agenda-get-some-entry-text'. ;; This works, taken from `org-agenda-get-some-entry-text'.
(re-search-forward "^[ \t]*:END:.*\n?" end t) (re-search-forward "^[ \t]*:END:.*\n?" end t)
(goto-char (match-end 0))) (goto-char (match-end 0)))
(unless (or (= (point) (point-max)) (unless (or (= (point) (point-max))
(org-at-heading-p) (org-at-heading-p)
(looking-at-p "\n")) (looking-at-p "\n"))
(insert "\n")))) (insert "\n"))))
t (if prefix t
nil (if prefix
'tree))) nil
'tree)))
;; For elisp-autofmt ;; For elisp-autofmt
;; Local variables: ;; Local variables: