From a6fd6508c9f853df9f0a61079f2268cd88e3d5f7 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 16 Aug 2021 22:48:29 -0500 Subject: Break out functionality into other files --- lisp/acdw.el | 79 +++--------------------------------------------------------- 1 file changed, 3 insertions(+), 76 deletions(-) (limited to 'lisp/acdw.el') diff --git a/lisp/acdw.el b/lisp/acdw.el index 2aa6c1f..8cbe16d 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -318,7 +318,9 @@ With a prefix argument, run git pull on the repo first." (insert s) (let ((sentence-end-double-space nil)) (unfill-region (point-min) (point-max))) - (copy-region-as-kill (point-min) (point-max))))) + (copy-region-as-kill (point-min) (point-max)) + (when (called-interactively-p 'interactive) + (indicate-copied-region))))) (defun acdw/dir (&optional file make-directory) "Place Emacs files in one place. @@ -442,81 +444,6 @@ It's called 'require-private' for historical reasons." (load (expand-file-name "private.el" user-emacs-directory) :noerror :nomessage)) - -;;; URL regexp -;; really, I just want to add gemini:// protocol, but I'm going to do some -;; reverse-engineering here. - -(defvar acdw/button-protocols '("http" - "https" - "shttp" - "shttps" - "ftp" - "file" - "gopher" - "nntp" - "news" - "telnet" - "wais" - "mailto" - "info") - "The list of protocols to splice into `browse-url-button-regexp'.") - -(defun acdw/build-button-url-regexp () - "Build `browse-url-button-regexp' from `acdw/button-protocols'. -I used `xr' (not included in Emacs) to get the RX form of the -default, so I can easily splice the list into it. THIS IS -BRITTLE AF!!!" - (rx-to-string ; thanks wgreenhouse! - `(seq word-boundary - (group - (group - (or "www." - (seq - (group (or ,@acdw/button-protocols)) - ":"))) - (opt - (group "//" - (one-or-more - (any "0-9a-z" "._-")) - ":" - (zero-or-more - (any "0-9")))) - (or - (seq - (one-or-more - (any "0-9a-z" "!#$%&*+,./:;=?@\\_~-" word)) - "(" - (one-or-more - (any "0-9a-z" "!#$%&*+,./:;=?@\\_~-" word)) - (zero-or-more - (any "0-9a-z" "#$%&*+/=@\\_~-" word)) - ")" - (opt - (one-or-more - (any "0-9a-z" "!#$%&*+,./:;=?@\\_~-" word)) - (any "0-9a-z" "#$%&*+/=@\\_~-" word))) - (seq - (one-or-more - (any "0-9a-z" "!#$%&*+,./:;=?@\\_~-" word)) - (any "0-9a-z" "#$%&*+/=@\\_~-" word))))))) - -(defun acdw/add-button-url-regexp-protocol (proto) - "Add PROTO to `browse-url-button-regexp' -First, add PROTO to `acdw/button-protocols'. -Then, build `browse-url-button-regexp' with the new protocol." - (add-to-list 'acdw/button-protocols proto) - (setq-default browse-url-button-regexp (acdw/build-button-url-regexp))) - -;;; Browse-URL tweaks - -;; convert twitter.com to nitter -(defun acdw/eww-browse-twitter-url (url &rest args) - "Browse a Twitter.com URL using Nitter." - (let* ((nitter "nitter.snopyta.org") - (url (replace-regexp-in-string "twitter\\.com" nitter url))) - (eww-browse-url url args))) - ;;; Recentf renaming with dired ;; from ... somewhere. 'rjs', apparently? -- cgit 1.4.1-21-gabe81