about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-04-14 18:40:08 -0500
committerCase Duckworth2021-04-14 18:40:08 -0500
commitbbfc7c8f1770389b177414b455b6fb8d31a94f5d (patch)
treee9384db3fa637b8ec687dd13945e07983ff7133d
parentRemove some modes from dumb-format (diff)
parentRemove `vertico' from `comp-deferred-compilation-deny-list' (diff)
downloademacs-bbfc7c8f1770389b177414b455b6fb8d31a94f5d.tar.gz
emacs-bbfc7c8f1770389b177414b455b6fb8d31a94f5d.zip
Merge branch 'main' of https://tildegit.org/acdw/emacs
-rw-r--r--init.el92
-rw-r--r--lisp/acdw-org.el14
2 files changed, 61 insertions, 45 deletions
diff --git a/init.el b/init.el index e7bdd37..554f7e4 100644 --- a/init.el +++ b/init.el
@@ -173,7 +173,10 @@
173 disabled-command-function nil 173 disabled-command-function nil
174 load-prefer-newer t 174 load-prefer-newer t
175 comp-async-report-warnings-errors nil 175 comp-async-report-warnings-errors nil
176 frame-title-format '("%b %+%* GNU Emacs" 176 frame-title-format '((:eval (if-let ((bn buffer-file-name))
177 (abbreviate-file-name bn)
178 "%b"))
179 " %+%* GNU Emacs"
177 (:eval (when (frame-parameter 180 (:eval (when (frame-parameter
178 nil 'client) 181 nil 'client)
179 " Client"))) 182 " Client")))
@@ -321,17 +324,23 @@
321 eldoc-echo-area-use-multiline-p nil)) 324 eldoc-echo-area-use-multiline-p nil))
322 325
323(setup flyspell 326(setup flyspell
324 (:option ispell-program-name "hunspell" 327 (setq-default ispell-program-name "hunspell"
325 ispell-dictionary "en_US" 328 ispell-dictionary "en_US"
326 ispell-personal-dictionary "~/.hunspell_personal") 329 ispell-personal-dictionary "~/.hunspell_personal")
327 (:needs ispell-program-name) ; don't proceed if not installed 330 (:needs ispell-program-name) ; don't proceed if not installed
328 331
329 (ispell-set-spellchecker-params)
330 (unless (file-exists-p ispell-personal-dictionary) 332 (unless (file-exists-p ispell-personal-dictionary)
331 (write-region "" nil ispell-personal-dictionary nil 0)) 333 (write-region "" nil ispell-personal-dictionary nil 0))
332 334
333 (add-hook 'text-mode-hook #'flyspell-mode) 335 (defun flyspell-start ()
334 (add-hook 'prog-mode-hook #'flyspell-prog-mode)) 336 "Start `flyspell-mode' or `flyspell-prog-mode', depending on current mode."
337 (interactive)
338 (cond ((derived-mode-p 'text-mode)
339 (flyspell-mode))
340 ((derived-mode-p 'prog-mode)
341 (flyspell-prog-mode))
342 (t (message "Non-text or -prog mode. Run `flyspell-mode'."))))
343 (:leader "s" flyspell-start))
335 344
336(setup scratch 345(setup scratch
337 (hook-defun immortal-scratch kill-buffer-query-functions 346 (hook-defun immortal-scratch kill-buffer-query-functions
@@ -394,13 +403,13 @@
394 ediff-split-window-function 'split-window-horizontally)) 403 ediff-split-window-function 'split-window-horizontally))
395 404
396(setup browse-url 405(setup browse-url
397 (:option browse-url-browser-function 'eww-browse-url 406 (setq-default browse-url-browser-function 'eww-browse-url
398 browse-url-secondary-browser-function 407 browse-url-secondary-browser-function
399 (if (executable-find "firefox") 408 (if (executable-find "firefox")
400 'browse-url-firefox 409 'browse-url-firefox
401 'browse-url-default-browser) 410 'browse-url-default-browser)
402 browse-url-new-window-flag t 411 browse-url-new-window-flag t
403 browse-url-firefox-new-window-is-tab t) 412 browse-url-firefox-new-window-is-tab t)
404 (when (eq acdw/system :work) 413 (when (eq acdw/system :work)
405 (add-to-list 'exec-path "C:/Program Files/Mozilla Firefox"))) 414 (add-to-list 'exec-path "C:/Program Files/Mozilla Firefox")))
406 415
@@ -439,17 +448,17 @@
439 (:mode "\\.\\(gemini\\|gmi\\)\\'")) 448 (:mode "\\.\\(gemini\\|gmi\\)\\'"))
440 449
441(setup dired 450(setup dired
442 (:option dired-recursive-copies 'always 451 (setq-default dired-recursive-copies 'always
443 dired-recursive-deletes 'always 452 dired-recursive-deletes 'always
444 delete-by-moving-to-trash t 453 delete-by-moving-to-trash t
445 dired-listing-switches "-Al" 454 dired-listing-switches "-Al"
446 ls-lisp-dirs-first t 455 ls-lisp-dirs-first t
447 dired-ls-F-marks-symlinks t 456 dired-ls-F-marks-symlinks t
448 dired-no-confirm '(byte-compile 457 dired-no-confirm '(byte-compile
449 chgrp chmod chown copy 458 chgrp chmod chown copy
450 hardlink load move 459 hardlink load move
451 shell touch symlink) 460 shell touch symlink)
452 dired-dwim-target t) 461 dired-dwim-target t)
453 (:also-load dired-x) 462 (:also-load dired-x)
454 (:hook dired-hide-details-mode 463 (:hook dired-hide-details-mode
455 hl-line-mode) 464 hl-line-mode)
@@ -466,7 +475,7 @@
466 (:hook-into dired-mode)) 475 (:hook-into dired-mode))
467 476
468 (setup (:straight trashed) 477 (setup (:straight trashed)
469 (:option trashed-action-confirmer 'y-or-n-p)))) 478 (setq-default trashed-action-confirmer 'y-or-n-p))))
470 479
471(setup (:straight magit) 480(setup (:straight magit)
472 (:leader "g" magit-status) 481 (:leader "g" magit-status)
@@ -558,16 +567,23 @@ call `zzz-to-char'."
558 567
559 (global-undo-fu-session-mode +1)) 568 (global-undo-fu-session-mode +1))
560 569
561(setup (:straight icomplete-vertical) 570;; (setup (:straight icomplete-vertical)
562 (:with-map icomplete-minibuffer-map 571;; (:with-map icomplete-minibuffer-map
563 (:bind "<down>" icomplete-forward-completions 572;; (:bind "<down>" icomplete-forward-completions
564 "C-n" icomplete-forward-completions 573;; "C-n" icomplete-forward-completions
565 "<up>" icomplete-backward-completions 574;; "<up>" icomplete-backward-completions
566 "C-p" icomplete-backward-completions 575;; "C-p" icomplete-backward-completions
567 "C-v" icomplete-vertical-toggle 576;; "C-v" icomplete-vertical-toggle
568 "RET" icomplete-force-complete-and-exit 577;; "RET" icomplete-force-complete-and-exit
569 "C-RET" minibuffer-complete-and-exit)) 578;; "C-RET" minibuffer-complete-and-exit))
570 (icomplete-vertical-mode +1)) 579;; (icomplete-vertical-mode +1))
580
581(setup (:straight vertico)
582 (if (bound-and-true-p comp-deferred-compilation-deny-list)
583 (add-to-list 'comp-deferred-compilation-deny-list 'vertico))
584 (icomplete-mode -1)
585 (icomplete-vertical-mode -1)
586 (vertico-mode +1))
571 587
572(setup (:straight orderless) 588(setup (:straight orderless)
573 (:option (prepend completion-styles) 'orderless)) 589 (:option (prepend completion-styles) 'orderless))
@@ -736,9 +752,7 @@ if ripgrep is installed, otherwise `consult-grep'."
736 752
737 (:global "M-/" company-complete) 753 (:global "M-/" company-complete)
738 (:with-map company-active-map 754 (:with-map company-active-map
739 (:bind "C-n" company-select-next 755 (:bind "C-d" company-show-doc-buffer
740 "C-p" company-select-previous
741 "C-d" company-show-doc-buffer
742 "M-." company-show-location))) 756 "M-." company-show-location)))
743 757
744;;; Lisps 758;;; Lisps
diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index 06803d3..c4431ab 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el
@@ -38,6 +38,12 @@ lists, insert a new item or end the list, with checkbox if
38appropriate. In tables, insert a new row or end the table." 38appropriate. In tables, insert a new row or end the table."
39 ;; Inspired by John Kitchin: http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/ 39 ;; Inspired by John Kitchin: http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/
40 (interactive "P") 40 (interactive "P")
41 ;; Auto-fill if enabled
42 (when auto-fill-function
43 (if (listp auto-fill-function)
44 (dolist (func auto-fill-function)
45 (funcall func))
46 (funcall auto-fill-function)))
41 (if default 47 (if default
42 (org-return) 48 (org-return)
43 (cond 49 (cond
@@ -87,10 +93,6 @@ appropriate. In tables, insert a new row or end the table."
87 (org-element-property :contents-end context))) 93 (org-element-property :contents-end context)))
88 (item-child-p 94 (item-child-p
89 (unpackaged/org-element-descendant-of 'item context))) 95 (unpackaged/org-element-descendant-of 'item context)))
90 (message "(or %S (and %S %S) %S)"
91 first-item-p
92 itemp (not emptyp)
93 item-child-p)
94 ;; The original function from unpackaged just tested the (or ...) test 96 ;; The original function from unpackaged just tested the (or ...) test
95 ;; in this cond, in an if. However, that doesn't auto-end nested 97 ;; in this cond, in an if. However, that doesn't auto-end nested
96 ;; lists. So I made this form a cond and added the (and...) test in 98 ;; lists. So I made this form a cond and added the (and...) test in
@@ -99,13 +101,13 @@ appropriate. In tables, insert a new row or end the table."
99 ;; for now, it works well enough. 101 ;; for now, it works well enough.
100 (cond ((and itemp emptyp) 102 (cond ((and itemp emptyp)
101 (delete-region (line-beginning-position) (line-end-position)) 103 (delete-region (line-beginning-position) (line-end-position))
102 (newline 2)) 104 (insert "\n\n"))
103 ((or first-item-p 105 ((or first-item-p
104 (and itemp (not emptyp)) 106 (and itemp (not emptyp))
105 item-child-p) 107 item-child-p)
106 (org-insert-item)) 108 (org-insert-item))
107 (t (delete-region (line-beginning-position) (line-end-position)) 109 (t (delete-region (line-beginning-position) (line-end-position))
108 (newline))))) 110 (insert "\n")))))
109 111
110 ((when (fboundp 'org-inlinetask-in-task-p) 112 ((when (fboundp 'org-inlinetask-in-task-p)
111 (org-inlinetask-in-task-p)) 113 (org-inlinetask-in-task-p))