summaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2020-07-02 18:31:23 -0400
committerAmin Bandali <bandali@gnu.org>2020-07-02 18:32:04 -0400
commit6b09fc8a2951778cd3ff9807d7132dcfb1f7de38 (patch)
tree74b10a97160d9616a1646308aae1ffc7460bb202 /lisp
parentff9cc25d59e324575e47e88bcccb3d4f291ff616 (diff)
downloadconfigs-6b09fc8a2951778cd3ff9807d7132dcfb1f7de38.tar.gz
configs-6b09fc8a2951778cd3ff9807d7132dcfb1f7de38.tar.xz
configs-6b09fc8a2951778cd3ff9807d7132dcfb1f7de38.zip
Update 17 drones and commit a bunch of changes
Update amx to v3.3-15-gccfc92c Update borg to v3.1.2-11-gbc6d869 Update dash to 2.17.0-5-g732d92e Update diff-hl to 1.8.7-17-g2281a89 Update ebdb to 0.6-130-g0b70386 Update ivy to 0.13.0-336-gd951004 Update libgit to 0ef8b13 Update magit to v2.90.1-1021-g485ee181 Update minions to v0.3.4 Update no-littering to v1.1.0-2-g93d66b1 Update org to release_9.3.7-662-g0c0d00b93 Update orgalist to 5b51845 Update transient to v0.2.0-28-g73694be Update use-package to 2.4-41-gbfc5ecd Update which-key to v3.4.0-25-g8f2427a Update with-editor to v2.9.3-3-g7c51288 Update yasnippet to 0.14.0-7-gd3d6d70
Diffstat (limited to '')
-rw-r--r--lisp/bandali-erc.el8
-rw-r--r--lisp/bandali-gnus.el12
-rw-r--r--lisp/bandali-message.el2
-rw-r--r--lisp/bandali-utils.el118
4 files changed, 132 insertions, 8 deletions
diff --git a/lisp/bandali-erc.el b/lisp/bandali-erc.el
index afdc949..624572a 100644
--- a/lisp/bandali-erc.el
+++ b/lisp/bandali-erc.el
@@ -99,10 +99,10 @@
((null auth) (error "Couldn't find znca's authinfo"))
(t (funcall (plist-get (car auth) :secret)))))))
(setq znc-servers
- `(("znc.shemshak.org" 1337 t
- ((freenode "amin/freenode" ,pwd)))
- ("znc.shemshak.org" 1337 t
- ((oftc "amin/oftc" ,pwd)))))))
+ `(("znc.emacsconf.org" 6697 t
+ ((freenode "bandali/freenode" ,pwd)))
+ ("znc.emacsconf.org" 6697 t
+ ((oftc "bandali/oftc" ,pwd)))))))
(provide 'bandali-erc)
;;; bandali-erc.el ends here
diff --git a/lisp/bandali-gnus.el b/lisp/bandali-gnus.el
index f85f694..2bfa816 100644
--- a/lisp/bandali-gnus.el
+++ b/lisp/bandali-gnus.el
@@ -92,7 +92,7 @@
;; legend: (u)nsubscribed | (d)ead
;; ----------------------------------
;; spam
- ("X-Spam-Flag" "YES" "Junk")
+ ("X-Spam_action" "reject" "Junk")
;; otherwise, leave mail in INBOX
"INBOX")))
(nnimap "uw"
@@ -271,6 +271,12 @@
'(list . "list-id\\|list-post\\|x-mailing-list\\|x-beenthere\\|x-loop")
t)))
+ ;; (require 'gnus-registry)
+ ;; (setq gnus-registry-max-entries 2500)
+ ;; (setq gnus-registry-ignored-groups
+ ;; (append gnus-registry-ignored-groups
+ ;; '(("^nnimap:gnu\\.l" t)
+ ;; ("webmasters$" t))))
;; (gnus-registry-initialize)
(with-eval-after-load 'recentf
@@ -301,8 +307,8 @@
"^Resent-From:"
"^User-Agent:"
"^X-detected-operating-system:"
- "^X-Spam-Flag:"
- "^X-Spam-Level:"
+ "^X-Spam_action:"
+ "^X-Spam_bar:"
"^Message-ID:"
;; "^References:"
"^List-Id:"
diff --git a/lisp/bandali-message.el b/lisp/bandali-message.el
index 4f3d551..c063bae 100644
--- a/lisp/bandali-message.el
+++ b/lisp/bandali-message.el
@@ -57,7 +57,7 @@
message-subscribed-address-functions
'(gnus-find-subscribed-addresses)
message-dont-reply-to-names
- "\\(\\(amin@shemshak\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(bandali\\|mab\\|aminb?\\)@gnu\\.org\\)\\|\\(a?bandali@\\(csclub\\.\\)?uwaterloo\\.ca\\)\\)")
+ "\\(\\(amin@shemshak\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(bandali\\|mab\\|aminb?\\)@gnu\\.org\\)\\|bandali@fsf\\.org\\|\\(a?bandali@\\(csclub\\.\\)?uwaterloo\\.ca\\)\\)")
;; (require 'company-ebdb)
:hook (;; (message-setup . mml-secure-message-sign-pgpmime)
(message-mode . flyspell-mode)
diff --git a/lisp/bandali-utils.el b/lisp/bandali-utils.el
new file mode 100644
index 0000000..7a2820d
--- /dev/null
+++ b/lisp/bandali-utils.el
@@ -0,0 +1,118 @@
+;;; bandali-utils.el --- useful utilities -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2020 Amin Bandali
+
+;; Author: Amin Bandali <bandali@gnu.org>
+;; Keywords: lisp, tools
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; A small collection of useful utilities used through my init files.
+
+;;; Code:
+
+(defmacro b/setq-every (value &rest vars)
+ "Set all the variables from VARS to value VALUE."
+ (declare (indent defun) (debug t))
+ `(progn ,@(mapcar (lambda (x) (list 'setq x value)) vars)))
+
+(defun b/start-process (program &rest args)
+ "Same as `start-process', but doesn't bother about name and buffer."
+ (let ((process-name (concat program "_process"))
+ (buffer-name (generate-new-buffer-name
+ (concat program "_output"))))
+ (apply #'start-process
+ process-name buffer-name program args)))
+
+(defun b/dired-start-process (program &optional args)
+ "Open current file with a PROGRAM."
+ ;; Shell command looks like this: "program [ARGS]... FILE" (ARGS can
+ ;; be nil, so remove it).
+ (declare-function dired-get-file-for-visit "dired")
+ (apply #'b/start-process
+ program
+ (remove nil (list args (dired-get-file-for-visit)))))
+
+(defun b/add-elisp-section ()
+ (interactive)
+ (insert "\n")
+ (forward-line -1)
+ (insert "\n \n;;; "))
+
+;; (defvar b/fill-column 47
+;; "My custom `fill-column'.")
+
+(defconst b/asterism "* * *")
+
+(defun b/insert-asterism ()
+ "Insert a centred asterism."
+ (interactive)
+ (insert
+ (concat
+ "\n\n"
+ (make-string (floor (/ (- fill-column (length b/asterism)) 2))
+ ?\s)
+ b/asterism
+ "\n\n")))
+
+(defun b/no-mouse-autoselect-window ()
+ "Conveniently disable `focus-follows-mouse'.
+For disabling the behaviour for certain buffers and/or modes."
+ (make-local-variable 'mouse-autoselect-window)
+ (setq mouse-autoselect-window nil))
+
+(defun b/kill-current-buffer ()
+ "Kill the current buffer."
+ ;; also see https://redd.it/64xb3q
+ (interactive)
+ (kill-buffer (current-buffer)))
+
+(defun b/move-indentation-or-beginning-of-line (arg)
+ "Move to the indentation or to the beginning of line."
+ (interactive "^p")
+ ;; (if (bolp)
+ ;; (back-to-indentation)
+ ;; (move-beginning-of-line arg))
+ (if (= (point)
+ (progn (back-to-indentation)
+ (point)))
+ (move-beginning-of-line arg)))
+
+(defun b/join-line-top ()
+ "Like `join-line', but join next line to the current line."
+ (interactive)
+ (join-line 1))
+
+(defun b/duplicate-line-or-region (&optional n)
+ "Duplicate the current line, or region (if active).
+Make N (default: 1) copies of the current line or region."
+ (interactive "*p")
+ (let ((u-r-p (use-region-p)) ; if region is active
+ (n1 (or n 1)))
+ (save-excursion
+ (let ((text
+ (if u-r-p
+ (buffer-substring (region-beginning) (region-end))
+ (prog1 (thing-at-point 'line)
+ (end-of-line)
+ (if (eobp)
+ (newline)
+ (forward-line 1))))))
+ (dotimes (_ (abs n1))
+ (insert text))))))
+
+(provide 'bandali-utils)
+;;; bandali-utils.el ends here