summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/+consult.el2
-rw-r--r--lisp/+elfeed.el8
-rw-r--r--lisp/+modeline.el13
-rw-r--r--lisp/acdw.el12
-rw-r--r--lisp/user-save.el18
5 files changed, 45 insertions, 8 deletions
diff --git a/lisp/+consult.el b/lisp/+consult.el index 0f5bf45..dc06ad5 100644 --- a/lisp/+consult.el +++ b/lisp/+consult.el
@@ -12,7 +12,7 @@
12;;; Cribbed functions 12;;; Cribbed functions
13;; https://github.com/minad/consult/wiki 13;; https://github.com/minad/consult/wiki
14 14
15(defun consult--orderless-regexp-compiler (input type) 15(defun consult--orderless-regexp-compiler (input type &rest _)
16 (setq input (orderless-pattern-compiler input)) 16 (setq input (orderless-pattern-compiler input))
17 (cons 17 (cons
18 (mapcar (lambda (r) (consult--convert-regexp r type)) input) 18 (mapcar (lambda (r) (consult--convert-regexp r type)) input)
diff --git a/lisp/+elfeed.el b/lisp/+elfeed.el index 8f7f17a..7f9e193 100644 --- a/lisp/+elfeed.el +++ b/lisp/+elfeed.el
@@ -31,6 +31,14 @@
31 (interactive) 31 (interactive)
32 (elfeed-show-visit t)) 32 (elfeed-show-visit t))
33 33
34(defun +elfeed-show-mark-read-and-advance ()
35 "Mark an item as read and advance to the next item.
36If multiple items are selected, don't advance."
37 (interactive)
38 (call-interactively #'elfeed-search-untag-all-unread)
39 (unless (region-active-p)
40 (call-interactively #'next-line)))
41
34;;; Fetch feeds async 42;;; Fetch feeds async
35;; https://github.com/skeeto/elfeed/issues/367 43;; https://github.com/skeeto/elfeed/issues/367
36 44
diff --git a/lisp/+modeline.el b/lisp/+modeline.el index 7bef5c6..3cc8806 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el
@@ -93,12 +93,13 @@ This function makes a lambda, so you can throw it straight into
93(defun +modeline-major-mode (&optional spacer) 93(defun +modeline-major-mode (&optional spacer)
94 "Display the current `major-mode'." 94 "Display the current `major-mode'."
95 (concat (or spacer +modeline-default-spacer) 95 (concat (or spacer +modeline-default-spacer)
96 (propertize (+string-truncate (format-mode-line mode-name) 16) 96 (propertize ;; (+string-truncate (format-mode-line mode-name) 16)
97 'face 'bold 97 (format-mode-line mode-name)
98 'keymap mode-line-major-mode-keymap 98 'face 'font-lock-keyword-face
99 'help-echo (concat (format-mode-line mode-name) 99 'keymap mode-line-major-mode-keymap
100 " mode\nmouse-1: show menu.") 100 'help-echo (concat (format-mode-line mode-name)
101 'mouse-face 'mode-line-highlight))) 101 " mode\nmouse-1: show menu.")
102 'mouse-face 'mode-line-highlight)))
102 103
103(defcustom +modeline-modified-icon-alist '((ephemeral . "*") 104(defcustom +modeline-modified-icon-alist '((ephemeral . "*")
104 (readonly . "=") 105 (readonly . "=")
diff --git a/lisp/acdw.el b/lisp/acdw.el index de2b8e7..764a246 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -374,5 +374,17 @@ the `format' call in a list."
374 (prog1 (progn ,@body) 374 (prog1 (progn ,@body)
375 (progress-reporter-done ,reporter))))) 375 (progress-reporter-done ,reporter)))))
376 376
377(defmacro +with-eval-after-loads (features &rest body)
378 "Execute BODY after all FEATURES are loaded."
379 (declare (indent 1) (debug (form def-body)))
380 (unless (listp features)
381 (setq features (list features)))
382 (if (null features)
383 (macroexp-progn body)
384 (let* ((this (car features))
385 (rest (cdr features)))
386 `(with-eval-after-load ',this
387 (+with-eval-after-loads ,rest ,@body)))))
388
377(provide 'acdw) 389(provide 'acdw)
378;;; acdw.el ends here 390;;; acdw.el ends here
diff --git a/lisp/user-save.el b/lisp/user-save.el index 8e01af1..33b6f4c 100644 --- a/lisp/user-save.el +++ b/lisp/user-save.el
@@ -8,6 +8,8 @@
8 8
9;;; Code: 9;;; Code:
10 10
11(require 'cl-lib)
12
11(defgroup user-save nil 13(defgroup user-save nil
12 "Group for `user-save-mode' customizations." 14 "Group for `user-save-mode' customizations."
13 :group 'emacs 15 :group 'emacs
@@ -19,11 +21,16 @@ This option is only useful is `user-save-mode' is active when
19Emacs is killed." 21Emacs is killed."
20 :type 'boolean) 22 :type 'boolean)
21 23
24(defcustom user-save-inhibit '(special-mode)
25 "List of modes to inhibit `user-save-mode' from activation in."
26 :type '(repeat symbol))
27
22(defvar user-save-hook nil 28(defvar user-save-hook nil
23 "Hook to run when the user, not Emacs, saves the buffer.") 29 "Hook to run when the user, not Emacs, saves the buffer.")
24 30
25(defvar user-save-mode-map (let ((map (make-sparse-keymap))) 31(defvar user-save-mode-map (let ((map (make-sparse-keymap)))
26 (define-key map (kbd "C-x C-s") #'user-save-buffer) 32 (define-key map (kbd "C-x C-s") #'user-save-buffer)
33 (define-key map (kbd "C-x s") #'user-save-some-buffers)
27 map) 34 map)
28 "Keymap for `user-save-mode'. 35 "Keymap for `user-save-mode'.
29This map shadows the default map for `save-buffer'.") 36This map shadows the default map for `save-buffer'.")
@@ -81,7 +88,16 @@ whether the buffer needs to be saved."
81 (user-save-mode -1)) 88 (user-save-mode -1))
82 89
83;;;###autoload 90;;;###autoload
84(define-globalized-minor-mode user-save-global-mode user-save-mode user-save-mode 91(defun user-save-mode-in-some-buffers ()
92 "Enable `user-save-mode', but only in some buffers.
93The mode will not be enabled in buffers derived from modes in
94`user-save-inhibit', or in the minibuffer."
95 (unless (or (cl-some #'derived-mode-p user-save-inhibit)
96 (minibufferp))
97 (user-save-mode +1)))
98
99;;;###autoload
100(define-globalized-minor-mode user-save-global-mode user-save-mode user-save-mode-in-some-buffers
85 (if user-save-global-mode 101 (if user-save-global-mode
86 (when user-save-hook-into-kill-emacs 102 (when user-save-hook-into-kill-emacs
87 (add-hook 'kill-emacs-hook #'user-save-some-buffers)) 103 (add-hook 'kill-emacs-hook #'user-save-some-buffers))