From 29e9ad67ca0fce87b92e6a865226c714727c6247 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 14 Apr 2021 10:03:47 -0500 Subject: Change frame-title-format --- init.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 2397eee..2c850c1 100644 --- a/init.el +++ b/init.el @@ -173,7 +173,10 @@ disabled-command-function nil load-prefer-newer t comp-async-report-warnings-errors nil - frame-title-format '("%b %+%* GNU Emacs" + frame-title-format '((:eval (if-let ((bn buffer-file-name)) + (abbreviate-file-name bn) + "%b")) + " %+%* GNU Emacs" (:eval (when (frame-parameter nil 'client) " Client"))) -- cgit 1.4.1-21-gabe81 From 272537bf842b4c8e14b1866b6f1d93a6d386437d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 14 Apr 2021 10:04:28 -0500 Subject: Change :option to setq-default for some setup forms :option loads the symbols with custom-load-symbol, but for some of the settings I don't care about that. --- init.el | 56 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/init.el b/init.el index 2c850c1..4e9525e 100644 --- a/init.el +++ b/init.el @@ -324,17 +324,23 @@ eldoc-echo-area-use-multiline-p nil)) (setup flyspell - (:option ispell-program-name "hunspell" - ispell-dictionary "en_US" - ispell-personal-dictionary "~/.hunspell_personal") + (setq-default ispell-program-name "hunspell" + ispell-dictionary "en_US" + ispell-personal-dictionary "~/.hunspell_personal") (:needs ispell-program-name) ; don't proceed if not installed - (ispell-set-spellchecker-params) (unless (file-exists-p ispell-personal-dictionary) (write-region "" nil ispell-personal-dictionary nil 0)) - (add-hook 'text-mode-hook #'flyspell-mode) - (add-hook 'prog-mode-hook #'flyspell-prog-mode)) + (defun flyspell-start () + "Start `flyspell-mode' or `flyspell-prog-mode', depending on current mode." + (interactive) + (cond ((derived-mode-p 'text-mode) + (flyspell-mode)) + ((derived-mode-p 'prog-mode) + (flyspell-prog-mode)) + (t (message "Non-text or -prog mode. Run `flyspell-mode'.")))) + (:leader "s" flyspell-start)) (setup scratch (hook-defun immortal-scratch kill-buffer-query-functions @@ -397,13 +403,13 @@ ediff-split-window-function 'split-window-horizontally)) (setup browse-url - (:option browse-url-browser-function 'eww-browse-url - browse-url-secondary-browser-function - (if (executable-find "firefox") - 'browse-url-firefox - 'browse-url-default-browser) - browse-url-new-window-flag t - browse-url-firefox-new-window-is-tab t) + (setq-default browse-url-browser-function 'eww-browse-url + browse-url-secondary-browser-function + (if (executable-find "firefox") + 'browse-url-firefox + 'browse-url-default-browser) + browse-url-new-window-flag t + browse-url-firefox-new-window-is-tab t) (when (eq acdw/system :work) (add-to-list 'exec-path "C:/Program Files/Mozilla Firefox"))) @@ -442,17 +448,17 @@ (:mode "\\.\\(gemini\\|gmi\\)\\'")) (setup dired - (:option dired-recursive-copies 'always - dired-recursive-deletes 'always - delete-by-moving-to-trash t - dired-listing-switches "-Al" - ls-lisp-dirs-first t - dired-ls-F-marks-symlinks t - dired-no-confirm '(byte-compile - chgrp chmod chown copy - hardlink load move - shell touch symlink) - dired-dwim-target t) + (setq-default dired-recursive-copies 'always + dired-recursive-deletes 'always + delete-by-moving-to-trash t + dired-listing-switches "-Al" + ls-lisp-dirs-first t + dired-ls-F-marks-symlinks t + dired-no-confirm '(byte-compile + chgrp chmod chown copy + hardlink load move + shell touch symlink) + dired-dwim-target t) (:also-load dired-x) (:hook dired-hide-details-mode hl-line-mode) @@ -469,7 +475,7 @@ (:hook-into dired-mode)) (setup (:straight trashed) - (:option trashed-action-confirmer 'y-or-n-p)))) + (setq-default trashed-action-confirmer 'y-or-n-p)))) (setup (:straight magit) (:leader "g" magit-status) -- cgit 1.4.1-21-gabe81 From 042e1cc5e20720429e97a2ec853e822327f86f63 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 14 Apr 2021 10:05:14 -0500 Subject: Remove company-active-map keys The ones removed aren't necessary with company-tng-mode. --- init.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/init.el b/init.el index 4e9525e..e7999cd 100644 --- a/init.el +++ b/init.el @@ -737,9 +737,7 @@ if ripgrep is installed, otherwise `consult-grep'." (:hook company-tng-mode) (:global "M-/" company-complete) (:with-map company-active-map - (:bind "C-n" company-select-next - "C-p" company-select-previous - "C-d" company-show-doc-buffer + (:bind "C-d" company-show-doc-buffer "M-." company-show-location))) ;;; Lisps -- cgit 1.4.1-21-gabe81 From e5795d6bf49cae67fb52fb65395d04b95296934f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 14 Apr 2021 17:06:59 -0500 Subject: Make `org-return-dwim' auto-fill-mode-aware Added a block at the top of the function to call `auto-fill-function' if it's enabled, and I changed the calls to `newline' to `insert "\n"`, due to ... something. It was having issues figuring out that the new lines were list items I think. I also removed the message part in the middle of the function that I forgot to remove before. --- lisp/acdw-org.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 appropriate. In tables, insert a new row or end the table." ;; Inspired by John Kitchin: http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/ (interactive "P") + ;; Auto-fill if enabled + (when auto-fill-function + (if (listp auto-fill-function) + (dolist (func auto-fill-function) + (funcall func)) + (funcall auto-fill-function))) (if default (org-return) (cond @@ -87,10 +93,6 @@ appropriate. In tables, insert a new row or end the table." (org-element-property :contents-end context))) (item-child-p (unpackaged/org-element-descendant-of 'item context))) - (message "(or %S (and %S %S) %S)" - first-item-p - itemp (not emptyp) - item-child-p) ;; The original function from unpackaged just tested the (or ...) test ;; in this cond, in an if. However, that doesn't auto-end nested ;; 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." ;; for now, it works well enough. (cond ((and itemp emptyp) (delete-region (line-beginning-position) (line-end-position)) - (newline 2)) + (insert "\n\n")) ((or first-item-p (and itemp (not emptyp)) item-child-p) (org-insert-item)) (t (delete-region (line-beginning-position) (line-end-position)) - (newline))))) + (insert "\n"))))) ((when (fboundp 'org-inlinetask-in-task-p) (org-inlinetask-in-task-p)) -- cgit 1.4.1-21-gabe81 From 99ec5c04f964acd663106b416b03b7c2644292c0 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 14 Apr 2021 17:10:53 -0500 Subject: icomplete->vertico... again this time, I just commented out icomplete, so it should be easier to test things. uff.... I guess I'm getting close to 1000 commits! so gotta do what i can, right? --- init.el | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/init.el b/init.el index bee4ca9..255b916 100644 --- a/init.el +++ b/init.el @@ -567,16 +567,21 @@ call `zzz-to-char'." (global-undo-fu-session-mode +1)) -(setup (:straight icomplete-vertical) - (:with-map icomplete-minibuffer-map - (:bind "" icomplete-forward-completions - "C-n" icomplete-forward-completions - "" icomplete-backward-completions - "C-p" icomplete-backward-completions - "C-v" icomplete-vertical-toggle - "RET" icomplete-force-complete-and-exit - "C-RET" minibuffer-complete-and-exit)) - (icomplete-vertical-mode +1)) +;; (setup (:straight icomplete-vertical) +;; (:with-map icomplete-minibuffer-map +;; (:bind "" icomplete-forward-completions +;; "C-n" icomplete-forward-completions +;; "" icomplete-backward-completions +;; "C-p" icomplete-backward-completions +;; "C-v" icomplete-vertical-toggle +;; "RET" icomplete-force-complete-and-exit +;; "C-RET" minibuffer-complete-and-exit)) +;; (icomplete-vertical-mode +1)) + +(setup (:straight vertico) + (icomplete-mode -1) + (icomplete-vertical-mode -1) + (vertico-mode +1)) (setup (:straight orderless) (:option (prepend completion-styles) 'orderless)) -- cgit 1.4.1-21-gabe81 From f691294a320cb49de3eaca3f7fee1149a9d17583 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 14 Apr 2021 17:46:43 -0500 Subject: Remove `vertico' from `comp-deferred-compilation-deny-list' See https://github.com/minad/vertico/issues/15 -- might not be necessary --- init.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.el b/init.el index 255b916..db9d9b4 100644 --- a/init.el +++ b/init.el @@ -579,6 +579,8 @@ call `zzz-to-char'." ;; (icomplete-vertical-mode +1)) (setup (:straight vertico) + (if (bound-and-true-p comp-deferred-compilation-deny-list) + (add-to-list 'comp-deferred-compilation-deny-list 'vertico)) (icomplete-mode -1) (icomplete-vertical-mode -1) (vertico-mode +1)) -- cgit 1.4.1-21-gabe81