From c07283b30d28e9e145c06480f2a7ae50958bc1a1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 19 Aug 2021 17:28:50 -0500 Subject: Totally comment out all flyspell stuff SOO ANNOOYYINNNGG --- init.el | 106 ++++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 39 deletions(-) diff --git a/init.el b/init.el index 1224930..99d9115 100644 --- a/init.el +++ b/init.el @@ -413,45 +413,73 @@ like a dumbass." (defun unfocused@save-buffers () (save-some-buffers t)))) -(setup flyspell - ;; follow the directions here: https://old.reddit.com/r/emacs/comments/dgj0ae - ;; in short: - ;; - download hunspell from GitHub and put in ~/usr/bin - ;; - download LibreOffice English dictionaries and put in - ;; ~/usr/share/hunspell - (setq-default - flyspell-issue-message-flag nil - ispell-program-name "hunspell" - ispell-dictionary "en_US" - ispell-personal-dictionary "~/.hunspell_personal" - ispell-local-dictionary-alist '(("en_US" - "[[:alpha:]]" "[^[:alpha:]]" - "[']" nil - ("-d" "en_US") nil utf-8))) - - (acdw/system - (:work (setenv "DICPATH" (expand-file-name "~/usr/share/hunspell")))) - - (when (boundp 'ispell-hunspell-dictionary-alist) - (setq-default - ispell-hunspell-dictionary-alist ispell-local-dictionary-alist)) - (:needs ispell-program-name) ; don't proceed if not installed - - (unless (file-exists-p ispell-personal-dictionary) - (write-region "" nil ispell-personal-dictionary nil 0)) - - (when (executable-find ispell-program-name) - (add-hook 'text-mode-hook #'flyspell-mode) - (add-hook 'prog-mode-hook #'flyspell-prog-mode)) - - (:when-loaded - (setup (:straight flyspell-correct) - (:with-map flyspell-mode-map - (:bind "C-;" flyspell-correct-wrapper - ;; Remove all other binds - "C-," nil - "C-." nil - "C-M-i" nil))))) +;; (setup flyspell +;; ;; follow the directions here: https://old.reddit.com/r/emacs/comments/dgj0ae +;; ;; in short: +;; ;; - download hunspell from GitHub and put in ~/usr/bin +;; ;; - download LibreOffice English dictionaries and put in +;; ;; ~/usr/share/hunspell +;; (setq-default +;; flyspell-issue-message-flag nil +;; ispell-program-name "hunspell" +;; ispell-dictionary "default" +;; ispell-personal-dictionary "~/.hunspell_personal" +;; ispell-local-dictionary-alist '(("default" +;; "[[:alpha:]]" "[^[:alpha:]]" +;; "[']" nil +;; ("-d" "en_US") nil utf-8))) + +;; (acdw/system +;; (:work (let ((dicpath (expand-file-name "~/usr/share/hunspell/"))) +;; (setenv "DICPATH" dicpath)))) + +;; ;; new variable `ispell-hunspell-dictionary-alist' is defined in Emacs +;; ;; If it's nil, Emacs tries to automatically set up the dictionaries. +;; (when (boundp 'ispell-hunspell-dictionary-alist) +;; (setq ispell-hunspell-dictionary-alist ispell-local-dictionary-alist)) + +;; (:needs ispell-program-name) ; don't proceed if not installed + +;; (unless (file-exists-p ispell-personal-dictionary) +;; (write-region "" nil ispell-personal-dictionary nil 0)) + +;; (when (executable-find ispell-program-name) +;; (add-hook 'text-mode-hook #'flyspell-mode) +;; (add-hook 'prog-mode-hook #'flyspell-prog-mode)) + +;; (:when-loaded +;; (setup (:straight flyspell-correct) +;; (:with-map flyspell-mode-map +;; (:bind "C-;" flyspell-correct-wrapper +;; ;; Remove all other binds +;; "C-," nil +;; "C-." nil +;; "C-M-i" nil))))) + +;; (setup flyspell +;; (:option +;; flyspell-issue-message-flag nil +;; ispell-program-name "aspell" +;; ispell-dictionary "en_US" +;; ispell-personal-dictionary "~/.dictionary" +;; ispell-extra-args '("--sug-mode=ultra" "--lang=en_US")) + +;; (:needs ispell-program-name) + +;; (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) + +;; (:when-loaded +;; (setup (:straight flyspell-correct) +;; (:with-map flyspell-mode-map +;; (:bind "C-;" flyspell-correct-wrapper +;; ;; Remove other binds +;; "C-," nil +;; "C-." nil +;; "C-M-i" nil))))) (setup frames (:option frame-title-format '("%b@" -- cgit 1.4.1-21-gabe81 From 0f905f1645c04f96593ad592a8d352c67d1714d9 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 19 Aug 2021 17:29:06 -0500 Subject: Update 0x0-default-host to new variable name --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index 99d9115..10f39c7 100644 --- a/init.el +++ b/init.el @@ -843,7 +843,7 @@ like a dumbass." (setup (:straight (0x0 :host gitlab :repo "willvaughn/emacs-0x0")) - (:option 0x0-default-host 'ttm)) + (:option 0x0-default-server 'ttm)) (setup (:straight (apheleia :host github :repo "raxod502/apheleia")) -- cgit 1.4.1-21-gabe81 From 8ac650fa1c3967ea06a001e3834364af21141193 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 19 Aug 2021 17:29:22 -0500 Subject: Make helpful-buffer work more sanely Ideally, I'd have something like "bury-buffer" and "kill-window" or ... whatever. But this isn't so bad, really. --- init.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 10f39c7..6cb9593 100644 --- a/init.el +++ b/init.el @@ -1140,11 +1140,21 @@ successive invocations." (add-to-list 'auto-mode-alist '("\\.fb\\'" . forth-block-mode)))) (setup (:straight helpful) + (:option helpful-max-buffers 5 + ;;helpful-switch-buffer-function #'pop-to-buffer + helpful-switch-buffer-function + (lambda (buf) + (pop-to-buffer buf + '((display-buffer-reuse-mode-window + display-buffer-pop-up-window) + (mode . helpful-mode)) + :norecord))) (:global " f" helpful-callable " v" helpful-variable " k" helpful-key " o" helpful-symbol - "C-c C-d" helpful-at-point)) + "C-c C-d" helpful-at-point) + (:bind "q" kill-buffer-and-window)) (setup (:straight iscroll) (:hook-into text-mode)) -- cgit 1.4.1-21-gabe81 From f7ff46cecc2f84dd1fd3f51477f7ce88f745486f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 19 Aug 2021 17:30:07 -0500 Subject: Update `acdw/copy-text-plain' Totally works great now :) --- lisp/acdw.el | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/lisp/acdw.el b/lisp/acdw.el index 2be0c4e..30cf8af 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -313,16 +313,38 @@ With a prefix argument, run git pull on the repo first." (defun acdw/copy-region-plain (start end) "Copy a region to clipboard, removing all Org formatting." (interactive "*r") - (let ((s (buffer-substring-no-properties start end))) + (let ((s (buffer-substring-no-properties start end)) + (extracted-heading (when (derived-mode-p 'org-mode) + (acdw/org-extract-heading-text)))) (with-temp-buffer (insert s) (let ((sentence-end-double-space nil)) - (unfill-region (point-min) (point-max))) - (copy-region-as-kill (point-min) (point-max))) - (when (called-interactively-p 'interactive) - (indicate-copied-region)) - (setq deactivate-mark t) - nil)) + ;; Remove org stuff + (when extracted-heading ; Replace org heading with plaintext + (goto-char (point-min)) + (kill-line) + (insert extracted-heading)) + (replace-regexp org-property-drawer-re "") ;Delete properties + (replace-regexp org-logbook-drawer-re "") ;Delete logbook + (replace-regexp org-list-full-item-re " +\4") + ;; Re-fill text for clipboard + (unfill-region (point-min) (point-max)) + (flush-lines "^$" (point-min) (point-max))) + ;; Copy buffer + (copy-region-as-kill (point-min) (point-max)))) + (when (called-interactively-p 'interactive) + (indicate-copied-region)) + (setq deactivate-mark t) + nil) + +(defun acdw/org-extract-heading-text () + (let ((heading (org-no-properties (org-get-heading t t t t)))) + (message + (replace-regexp-in-string org-link-bracket-re + (lambda (match) + (match-string-no-properties 2 match)) + heading)))) (defun acdw/dir (&optional file make-directory) "Place Emacs files in one place. -- cgit 1.4.1-21-gabe81