summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2022-05-06 10:23:02 -0500
committerCase Duckworth2022-05-06 10:23:02 -0500
commitfcd47a9c3a10b6028045773ff5b197a080ac345c (patch)
tree0c01200c1a80723467fb43b7a7f6b97560eec6f9 /lisp
parentAdd +sort-lines (diff)
downloademacs-fcd47a9c3a10b6028045773ff5b197a080ac345c.tar.gz
emacs-fcd47a9c3a10b6028045773ff5b197a080ac345c.zip
meh
Diffstat (limited to 'lisp')
-rw-r--r--lisp/+browse-url.el6
-rw-r--r--lisp/+consult.el2
-rw-r--r--lisp/+dired.el23
-rw-r--r--lisp/+init.el9
-rw-r--r--lisp/+jabber.el12
-rw-r--r--lisp/+key.el6
-rw-r--r--lisp/+org.el13
7 files changed, 34 insertions, 37 deletions
diff --git a/lisp/+browse-url.el b/lisp/+browse-url.el index dbbfef2..fc479e4 100644 --- a/lisp/+browse-url.el +++ b/lisp/+browse-url.el
@@ -120,9 +120,9 @@ ARGS are ignored here, but passed on for later processing."
120 ;; along with the rest of the args, in a list to the original caller (probably 120 ;; along with the rest of the args, in a list to the original caller (probably
121 ;; `browse-url'.) 121 ;; `browse-url'.)
122 (apply 'list 122 (apply 'list
123 (cl-loop with url = (substring-no-properties 123 (cl-loop with url = (substring-no-properties
124 (if (consp url) (car url) url)) 124 (if (consp url) (car url) url))
125 for (regex . transformation) in +browse-url-transformations 125 for (regex . transformation) in +browse-url-transformations
126 if (string-match regex url) 126 if (string-match regex url)
127 return (replace-match transformation nil nil url) 127 return (replace-match transformation nil nil url)
128 ;; else 128 ;; else
diff --git a/lisp/+consult.el b/lisp/+consult.el index dc06ad5..21c2565 100644 --- a/lisp/+consult.el +++ b/lisp/+consult.el
@@ -5,7 +5,7 @@
5(defun +consult-project-root () 5(defun +consult-project-root ()
6 "Return either the current project, or the VC root, of current file." 6 "Return either the current project, or the VC root, of current file."
7 (if (and (functionp 'project-current) 7 (if (and (functionp 'project-current)
8 (project-current)) 8 (project-current))
9 (car (project-roots (project-current))) 9 (car (project-roots (project-current)))
10 (vc-root-dir))) 10 (vc-root-dir)))
11 11
diff --git a/lisp/+dired.el b/lisp/+dired.el index 9a2e01a..2e42c19 100644 --- a/lisp/+dired.el +++ b/lisp/+dired.el
@@ -2,18 +2,17 @@
2 2
3;;; Code: 3;;; Code:
4 4
5(require 'vertico) 5(with-eval-after-load 'vertico
6 6 (defun +dired-goto-file (file)
7(defun +dired-goto-file (file) 7 "ADVICE for `dired-goto-file' to make RET call `vertico-exit'."
8 "ADVICE for `dired-goto-file' to make RET call `vertico-exit'." 8 (interactive ; stolen from `dired-goto-file'
9 (interactive ; stolen from `dired-goto-file' 9 (prog1
10 (prog1 10 (list (dlet ((vertico-map (copy-keymap vertico-map)))
11 (list (dlet ((vertico-map (copy-keymap vertico-map))) 11 (define-key vertico-map (kbd "RET") #'vertico-exit)
12 (define-key vertico-map (kbd "RET") #'vertico-exit) 12 (expand-file-name (read-file-name "Goto file: "
13 (expand-file-name (read-file-name "Goto file: " 13 (dired-current-directory)))))
14 (dired-current-directory))))) 14 (push-mark)))
15 (push-mark))) 15 (dired-goto-file file)))
16 (dired-goto-file file))
17 16
18;;; [[https://www.reddit.com/r/emacs/comments/u2lf9t/weekly_tips_tricks_c_thread/i4n9aoa/?context=3][Dim files in .gitignore]] 17;;; [[https://www.reddit.com/r/emacs/comments/u2lf9t/weekly_tips_tricks_c_thread/i4n9aoa/?context=3][Dim files in .gitignore]]
19 18
diff --git a/lisp/+init.el b/lisp/+init.el index 8f999f9..a3f680b 100644 --- a/lisp/+init.el +++ b/lisp/+init.el
@@ -72,11 +72,10 @@ are sorted lexigraphically."
72 ;; otherwise, sort lexigraphically 72 ;; otherwise, sort lexigraphically
73 (t (string< s1 s2))))))))) 73 (t (string< s1 s2)))))))))
74 ;; Return to original point relative to the defun we were in 74 ;; Return to original point relative to the defun we were in
75 (goto-char (point-min)) 75 (ignore-errors (goto-char (point-min))
76 (re-search-forward current-defun-re) 76 (re-search-forward current-defun-re)
77 (beginning-of-defun) 77 (beginning-of-defun)
78 (goto-char (+ (point) defun-point)) 78 (goto-char (+ (point) defun-point)))))
79 ))
80 79
81(defun +init-sort-then-save () 80(defun +init-sort-then-save ()
82 "Sort init.el, then save it." 81 "Sort init.el, then save it."
diff --git a/lisp/+jabber.el b/lisp/+jabber.el index c5d568c..e018b0c 100644 --- a/lisp/+jabber.el +++ b/lisp/+jabber.el
@@ -10,6 +10,18 @@
10(require 'jabber) 10(require 'jabber)
11(require 'tracking) 11(require 'tracking)
12 12
13(defgroup +jabber nil
14 "Extra jabber.el customizations."
15 :group 'jabber)
16
17(defcustom +jabber-ws-prefix 0
18 "Width to pad left side of chats."
19 :type 'string)
20
21(defcustom +jabber-pre-prompt " \n"
22 "String to put before the prompt."
23 :type 'string)
24
13(defvar +jabber-tracking-show-p #'jabber-activity-show-p-default 25(defvar +jabber-tracking-show-p #'jabber-activity-show-p-default
14 "Function that checks if the given JID should be shown in the mode line. 26 "Function that checks if the given JID should be shown in the mode line.
15This does the same as `jabber-activity-show-p', but for the 27This does the same as `jabber-activity-show-p', but for the
diff --git a/lisp/+key.el b/lisp/+key.el index ad3b215..a217dad 100644 --- a/lisp/+key.el +++ b/lisp/+key.el
@@ -19,9 +19,9 @@
19 19
20;; I need to define this map before the proper mode map. 20;; I need to define this map before the proper mode map.
21(defvar +key-leader-map (let ((map (make-sparse-keymap)) 21(defvar +key-leader-map (let ((map (make-sparse-keymap))
22 (c-z (global-key-binding "\C-z"))) 22 (c-z (global-key-binding "\C-z")))
23 (define-key map "\C-z" c-z) 23 ;;(define-key map "\C-z" c-z)
24 map) 24 map)
25 "A leader keymap under the \"C-z\" bind.") 25 "A leader keymap under the \"C-z\" bind.")
26 26
27;; http://xahlee.info/emacs/emacs/emacs_menu_app_keys.html and 27;; http://xahlee.info/emacs/emacs/emacs_menu_app_keys.html and
diff --git a/lisp/+org.el b/lisp/+org.el index 252ee55..6075b60 100644 --- a/lisp/+org.el +++ b/lisp/+org.el
@@ -588,19 +588,6 @@ and POST-PROCESS are passed to `org-export-to-file'."
588 ("—" "---")))) 588 ("—" "---"))))
589 (replace-match replace nil nil))))) 589 (replace-match replace nil nil)))))
590 590
591;;; Toggle org-hide-emphasis-markers
592
593(define-minor-mode +org-show-mode
594 "Show emphasis markers and full links in `org-mode'."
595 :lighter "/*/"
596 (setq org-hide-emphasis-markers (not +org-show-mode)
597 org-link-descriptive (not +org-show-mode))
598 (funcall (if +org-show-mode
599 #'remove-from-invisibility-spec
600 #'add-to-invisibility-spec)
601 '(org-link))
602 (font-lock-update))
603
604;;; go forward and backward in the tree, ~ cleanly ~ 591;;; go forward and backward in the tree, ~ cleanly ~
605;; https://stackoverflow.com/a/25201697/10756297 592;; https://stackoverflow.com/a/25201697/10756297
606 593