From f75a2fc9e3d5beb7d3c3ba97424db709b32f6573 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 1 Apr 2022 18:54:42 -0500 Subject: Fix arity of `consult--orderless-regex-compiler` I might want to combine this and the one for affe. --- lisp/+consult.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') 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 @@ ;;; Cribbed functions ;; https://github.com/minad/consult/wiki -(defun consult--orderless-regexp-compiler (input type) +(defun consult--orderless-regexp-compiler (input type &rest _) (setq input (orderless-pattern-compiler input)) (cons (mapcar (lambda (r) (consult--convert-regexp r type)) input) -- cgit 1.4.1-21-gabe81 From 9742b1a3c84e0e9df70353e281e39fbbea77e543 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 1 Apr 2022 18:55:19 -0500 Subject: Only load notmuch tab-bar if notmuch is in $PATH --- lisp/+tab-bar.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index e328146..f0c4f62 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el @@ -52,7 +52,8 @@ (defun +tab-bar-notmuch-count () "Display a notmuch count in the tab-bar." - (when (featurep 'notmuch) + (when (and (executable-find "notmuch") + (featurep 'notmuch)) (let* ((counts (notmuch-hello-query-counts notmuch-saved-searches)) (next (cl-find "inbox" counts :key (lambda (l) (plist-get l :name)) :test 'equal)) (next-count (plist-get next :count))) -- cgit 1.4.1-21-gabe81 From 548e9b8accb86d33658e5f27b59815ba71d81c7b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 2 Apr 2022 12:37:25 -0500 Subject: Add +scratch-buffer --- lisp/acdw.el | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'lisp') diff --git a/lisp/acdw.el b/lisp/acdw.el index 764a246..e47770b 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -386,5 +386,30 @@ the `format' call in a list." `(with-eval-after-load ',this (+with-eval-after-loads ,rest ,@body))))) +(defun +scratch-buffer (&optional nomode) + "Create a new scratch buffer and switch to it. +If the region is active, paste its contents into the scratch +buffer. The scratch buffer inherits the mode of the current +buffer unless NOMODE is non-nil. When called interactively, +NOMODE will be set when called with \\[universal-argument]." + (interactive "P") + (let* ((mode major-mode) + (bufname (generate-new-buffer-name (format "*scratch (%s)*" mode))) + (paste (and (region-active-p) + (prog1 + (buffer-substring (mark t) (point)) + (deactivate-mark))))) + (when (and (not nomode) + (bound-and-true-p ess-dialect)) ; Not sure what `ess-dialect' is + (setq mode (intern-soft (concat ess-dialect "-mode")))) + ;; Set up buffer + (switch-to-buffer (get-buffer-create bufname)) + (when (and (not nomode) mode) + (ignore-errors (funcall mode))) + (insert (format "%s Scratch buffer for %s%s\n\n" + comment-start mode comment-end)) + (when paste (insert paste)) + (get-buffer bufname))) + (provide 'acdw) ;;; acdw.el ends here -- cgit 1.4.1-21-gabe81