From 6d2d31a40e4343e36a0ed7b7d91882cd1ae3e592 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 8 Feb 2022 14:14:34 -0600 Subject: Don't pass the buffer to PREDICATE in `+mapc-some-buffers' --- lisp/acdw.el | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'lisp/acdw.el') diff --git a/lisp/acdw.el b/lisp/acdw.el index 2f4e0fc..2b3cafc 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -97,15 +97,14 @@ If body executes without errors, MESSAGE...Done will be displayed." "Perform FUNC on all buffers satisfied by PREDICATE. By default, act on all buffers. -PREDICATE is a function called with one argument, the current -buffer. FUNC is called with no arguments. Both are called -within a `with-current-buffer' form." +Both PREDICATE and FUNC are called with no arguments, but within +a `with-current-buffer' form on the currently-active buffer." (let ((pred (or predicate t))) (dolist (buf (buffer-list)) (with-current-buffer buf (when (if (or (eq (car-safe pred) 'closure) (fboundp pred)) - (funcall pred buf) + (funcall pred) pred) (funcall func)))))) @@ -234,7 +233,9 @@ UNIT can be one of :kb, :mb, :gb, :tb, :pb, :eb, :zb, :yb; :kib, :mib, :gib, (defcustom font-lock-todo-keywords '("TODO" "XXX" "FIXME" "BUG") "Keywords to highlight with `font-lock-todo-face'.") -(defface font-lock-todo-face '((t :inherit font-lock-warning-face)) +(defface font-lock-todo-face '((t :inherit font-lock-comment-face + :background "yellow")) + ;; TODO: XXX: FIXME: BUG: testing :) "Face for TODO keywords.") (defun font-lock-todo-insinuate () @@ -277,9 +278,17 @@ always nil; this function is mostly intended for use in init." :group 'applications) ;; I can never remember all the damn chat things I run, so this just does all of em. -(defun chat () - "Initiate all chat functions." - (interactive) +(defun chat (&optional arg) + "Initiate all chat functions. +With optional ARG, kill all chat-related buffers first." + (interactive "P") + (when arg + (ignore-errors + (circe-command-GQUIT "Reconnecting") + (+mapc-some-buffers #'kill-buffer (lambda () (derived-mode-p 'lui-mode))) + (jabber-disconnect) + ;; XXX: Slack ? + )) (mapc #'call-interactively chat-functions)) (provide 'acdw) -- cgit 1.4.1-21-gabe81