summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--eshell.el25
-rw-r--r--init.el80
-rw-r--r--lisp/acdw.el17
-rw-r--r--lisp/chd.el6
4 files changed, 76 insertions, 52 deletions
diff --git a/eshell.el b/eshell.el index 05f90bc..c6078c2 100644 --- a/eshell.el +++ b/eshell.el
@@ -3,20 +3,6 @@
3;; Copyright (C) 2021 Case Duckworth 3;; Copyright (C) 2021 Case Duckworth
4 4
5;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> 5;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")>
6;; Keywords:
7
8;; This program is free software; you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation, either version 3 of the License, or
11;; (at your option) any later version.
12
13;; This program is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;; GNU General Public License for more details.
17
18;; You should have received a copy of the GNU General Public License
19;; along with this program. If not, see <https://www.gnu.org/licenses/>.
20 6
21;;; Commentary: 7;;; Commentary:
22 8
@@ -26,6 +12,8 @@
26;;; Code: 12;;; Code:
27 13
28(require 'setup) 14(require 'setup)
15(require 'eshell)
16(require 'em-alias)
29 17
30;;; Environment 18;;; Environment
31(setenv "PAGER" "cat") 19(setenv "PAGER" "cat")
@@ -52,8 +40,8 @@
52(setup (:straight eshell-syntax-highlighting) 40(setup (:straight eshell-syntax-highlighting)
53 (eshell-syntax-highlighting-global-mode +1)) 41 (eshell-syntax-highlighting-global-mode +1))
54 42
55(setup (:straight-if fish-completion 43(setup (:straight-when fish-completion
56 (executable-find "fish")) 44 (executable-find "fish"))
57 (:autoload global-fish-completion-mode) 45 (:autoload global-fish-completion-mode)
58 (global-fish-completion-mode +1)) 46 (global-fish-completion-mode +1))
59 47
@@ -63,8 +51,5 @@
63(when (boundp 'simple-modeline--mode-line) 51(when (boundp 'simple-modeline--mode-line)
64 (setq mode-line-format '(:eval simple-modeline--mode-line))) 52 (setq mode-line-format '(:eval simple-modeline--mode-line)))
65 53
66;;; Tell Emacs our customizations are loaded. 54(provide 'eshellrc)
67(defvar eshell-customizations-loaded t
68 "Whether eshell's customizations have been loaded yet.")
69
70;;; eshell.el ends here 55;;; eshell.el ends here
diff --git a/init.el b/init.el index a598b16..22c06f8 100644 --- a/init.el +++ b/init.el
@@ -441,12 +441,10 @@
441 (:local-set outline-regexp eshell-prompt-regexp 441 (:local-set outline-regexp eshell-prompt-regexp
442 page-delimiter eshell-prompt-regexp) 442 page-delimiter eshell-prompt-regexp)
443 443
444 (:bind "C-d" #'eshell-quit-or-delete-char)
445
446 (:hook #'eshell-arg-hist-mode 444 (:hook #'eshell-arg-hist-mode
447 (defun eshell-mode@setup () 445 (defun eshell-mode@setup ()
448 (unless (bound-and-true-p eshell-customizations-loaded) 446 (require 'eshellrc (locate-user-emacs-file "eshell") :noerror)
449 (load (expand-file-name "eshell" user-emacs-directory)))))) 447 (:bind "C-d" #'eshell-quit-or-delete-char))))
450 448
451(setup eww 449(setup eww
452 (:also-load acdw-eww) 450 (:also-load acdw-eww)
@@ -675,9 +673,6 @@ specific to most general, they are these:
675 ;; <anything> -> mouse-1 /always/ follows link 673 ;; <anything> -> mouse-1 /always/ follows link
676 (:option mouse-1-click-follows-link t)) 674 (:option mouse-1-click-follows-link t))
677 675
678(setup mouse-avoidance
679 (mouse-avoidance-mode 'banish))
680
681(setup page 676(setup page
682 (:option page-delimiter 677 (:option page-delimiter
683 (rx bol (or "\f" ";;;") 678 (rx bol (or "\f" ";;;")
@@ -1067,8 +1062,9 @@ specific to most general, they are these:
1067 (with-eval-after-load 'circe 1062 (with-eval-after-load 'circe
1068 (:face circe-nick-highlight-face 1063 (:face circe-nick-highlight-face
1069 ((t (:inherit (modus-themes-hl-line modus-themes-bold)))) 1064 ((t (:inherit (modus-themes-hl-line modus-themes-bold))))
1070 circe-my-message-face 1065 ;; circe-my-message-face
1071 ((t (:inherit (modus-themes-slant)))))) 1066 ;; ((t (:inherit (modus-themes-slant))))
1067 ))
1072 1068
1073 (:bind "C-c C-p" #'circe-command-PART 1069 (:bind "C-c C-p" #'circe-command-PART
1074 "C-l" #'lui-track-jump-to-indicator 1070 "C-l" #'lui-track-jump-to-indicator
@@ -1219,7 +1215,7 @@ specific to most general, they are these:
1219 1215
1220(setup (:straight crux) 1216(setup (:straight crux)
1221 (:global "C-o" #'crux-smart-open-line 1217 (:global "C-o" #'crux-smart-open-line
1222 "M-o" #'crux-smart-open-line-above 1218 "M-o" #'open-paragraph
1223 "C-M-\\" #'crux-cleanup-buffer-or-region 1219 "C-M-\\" #'crux-cleanup-buffer-or-region
1224 "C-x 4 t" #'crux-transpose-windows) 1220 "C-x 4 t" #'crux-transpose-windows)
1225 1221
@@ -1917,7 +1913,7 @@ browser defined in `browse-url-secondary-browser-function'."
1917 org-clock-clocked-in-display 'mode-line 1913 org-clock-clocked-in-display 'mode-line
1918 org-clock-frame-title-format (cons '(t org-mode-line-string) 1914 org-clock-frame-title-format (cons '(t org-mode-line-string)
1919 (cons " --- " frame-title-format)) 1915 (cons " --- " frame-title-format))
1920 ;;org-clock-string-limit 7 ; gives time and not title 1916 org-clock-string-limit 25 ; gives enough information
1921 org-clock-persist t 1917 org-clock-persist t
1922 org-confirm-babel-evaluate nil 1918 org-confirm-babel-evaluate nil
1923 org-cycle-separator-lines 0 1919 org-cycle-separator-lines 0
@@ -1964,12 +1960,24 @@ browser defined in `browse-url-secondary-browser-function'."
1964 (:unbind "C-j" ; org-return-and-maybe-indent 1960 (:unbind "C-j" ; org-return-and-maybe-indent
1965 "M-j") 1961 "M-j")
1966 1962
1967 (:local-set unfill-fill-function #'org-fill-paragraph) 1963 (:local-set unfill-fill-function #'org-fill-paragraph
1964 wc-count-words-function
1965 (lambda (start end) "Count words stupidly with a limit."
1966 (acdw-org/count-words-stupidly start
1967 end
1968 999)))
1968 1969
1969 (with-eval-after-load 'org-export 1970 (with-eval-after-load 'org-export
1970 (:option (append org-export-filter-final-output-functions) 1971 (:option (append org-export-filter-final-output-functions)
1971 #'org-export-remove-zero-width-spaces)) 1972 #'org-export-remove-zero-width-spaces))
1972 1973
1974 (:local-hook before-save-hook
1975 (defun org/before-save@fix-blank-lines ()
1976 (acdw-org/fix-blank-lines t))
1977 before-save-hook
1978 (defun org/before-save@align-tags ()
1979 (org-align-tags :all)))
1980
1973 (:hook ;; #'variable-pitch-mode 1981 (:hook ;; #'variable-pitch-mode
1974 1982
1975 ;; (defun org-mode@before-save@fill-buffer () 1983 ;; (defun org-mode@before-save@fill-buffer ()
@@ -1981,22 +1989,23 @@ browser defined in `browse-url-secondary-browser-function'."
1981 ;; This is super ugly because I need to add a function to 1989 ;; This is super ugly because I need to add a function to
1982 ;; `before-save-hook', but only in org-mode buffers. So I make a hook 1990 ;; `before-save-hook', but only in org-mode buffers. So I make a hook
1983 ;; to make a hook. I'm sure there's a better way to do this. 1991 ;; to make a hook. I'm sure there's a better way to do this.
1984 (defun org-mode@fix-blank-lines-on-save () 1992 ;; (defun org-mode@fix-blank-lines-on-save ()
1985 (add-hook 'before-save-hook 1993 ;; (add-hook 'before-save-hook
1986 (defun acdw-org/fix-blank-lines-in-buffer () 1994 ;; (defun acdw-org/fix-blank-lines-in-buffer ()
1987 (acdw-org/fix-blank-lines t)) 1995 ;; (acdw-org/fix-blank-lines t))
1988 0 :local)) 1996 ;; 0 :local))
1989 1997
1990 (defun org-mode@wc-stupid () 1998 ;; (defun org-mode@wc-stupid ()
1991 (unless (and wc-mode 1999 ;; (unless (and wc-mode
1992 (> 0 (+ (or wc-orig-words 0) 2000 ;; (> 0 (+ (or wc-orig-words 0)
1993 (or wc-words-delta 0))))) 2001 ;; (or wc-words-delta 0)))))
1994 (setq-local 2002 ;; (setq-local
1995 wc-count-words-function 2003 ;; wc-count-words-function
1996 (lambda (start end) "Count words stupidly with a limit." 2004 ;; (lambda (start end) "Count words stupidly with a limit."
1997 (acdw-org/count-words-stupidly start 2005 ;; (acdw-org/count-words-stupidly start
1998 end 2006 ;; end
1999 999))))) 2007 ;; 999))))
2008 )
2000 2009
2001 (with-eval-after-load 'org 2010 (with-eval-after-load 'org
2002 (org-clock-persistence-insinuate)) 2011 (org-clock-persistence-insinuate))
@@ -2312,8 +2321,11 @@ the default is \"/\"."
2312 (list 2321 (list
2313 (propertize " " 2322 (propertize " "
2314 'display 2323 'display
2315 '((space :align-to 2324 '((space
2316 ,(unless visual-fill-column-mode 0)))) 2325 :align-to
2326 ,(unless
2327 (bound-and-true-p visual-fill-column-mode)
2328 0))))
2317 (funcall topsy-fn)))))) 2329 (funcall topsy-fn))))))
2318 2330
2319(setup (:straight trashed) 2331(setup (:straight trashed)
@@ -2409,7 +2421,15 @@ If used with a numeric prefix argument N, N backticks will be inserted."
2409 (setq-local indicate-empty-lines nil 2421 (setq-local indicate-empty-lines nil
2410 indicate-buffer-boundaries nil) 2422 indicate-buffer-boundaries nil)
2411 (acdw/setup-fringes)))) 2423 (acdw/setup-fringes))))
2412 (:advise text-scale-adjust :after #'visual-fill-column-adjust)) 2424 (:advise text-scale-adjust :after #'visual-fill-column-adjust)
2425 ;; Fix bindings
2426 (when (bound-and-true-p mouse-wheel-mode)
2427 (with-eval-after-load 'visual-fill-column
2428 (dolist (margin '(right-margin left-margin))
2429 (dolist (event '(wheel-down wheel-up))
2430 (define-key visual-fill-column-mode-map
2431 (vector margin event)
2432 #'mwheel-scroll))))))
2413 2433
2414(setup (:straight visual-regexp) 2434(setup (:straight visual-regexp)
2415 (:global "M-%" #'vr/query-replace)) 2435 (:global "M-%" #'vr/query-replace))
diff --git a/lisp/acdw.el b/lisp/acdw.el index 969b6c8..cc73071 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -862,6 +862,23 @@ When called with PREFIX, just kill Emacs without confirmation."
862 (let ((b (get-buffer (if (consp b) (car b) b)))) 862 (let ((b (get-buffer (if (consp b) (car b) b))))
863 (member (buffer-local-value 'major-mode b) modes))))) 863 (member (buffer-local-value 'major-mode b) modes)))))
864 (pop-to-buffer (read-buffer "Buffer: " nil t pred)))) 864 (pop-to-buffer (read-buffer "Buffer: " nil t pred))))
865
866;;; BLAH
867
868(defun open-paragraph ()
869 "Open a paragraph after point.
870A paragraph is defined as continguous non-empty lines of text
871surrounded by empty lines, so opening a paragraph means to make
872three blank lines, then place the point on the second one."
873 (interactive)
874 ;; Go to next blank line. This /isn't/ `end-of-paragraph-text' because
875 ;; that's weird with org, and I'm guessing other modes too.
876 (while (not (looking-at "^$"))
877 (forward-line 1))
878 (newline)
879 (delete-blank-lines)
880 (newline 2)
881 (previous-line))
865 882
866(provide 'acdw) 883(provide 'acdw)
867;;; acdw.el ends here 884;;; acdw.el ends here
diff --git a/lisp/chd.el b/lisp/chd.el index 697c134..f7b5dbb 100644 --- a/lisp/chd.el +++ b/lisp/chd.el
@@ -40,10 +40,12 @@
40 (org-back-to-heading) 40 (org-back-to-heading)
41 (org-open-at-point))) 41 (org-open-at-point)))
42 42
43(defun chd/click-bits (date)
44 "Create a new Click Bits org file, or edit the one for DATE."
45 (error "not implemented"))
46
43;;; NOTES 47;;; NOTES
44;; org-protocol: https://orgmode.org/worg/org-contrib/org-protocol.html 48;; org-protocol: https://orgmode.org/worg/org-contrib/org-protocol.html
45;; the bit i wanna pull from TaskIQ: 'document.getElementById("preview") 49;; the bit i wanna pull from TaskIQ: 'document.getElementById("preview")
46
47
48(provide 'chd) 50(provide 'chd)
49;;; chd.el ends here 51;;; chd.el ends here