summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-browse-url.el9
-rw-r--r--lisp/acdw-org.el2
-rw-r--r--lisp/acdw.el13
3 files changed, 21 insertions, 3 deletions
diff --git a/lisp/acdw-browse-url.el b/lisp/acdw-browse-url.el index 93f470c..9f8e484 100644 --- a/lisp/acdw-browse-url.el +++ b/lisp/acdw-browse-url.el
@@ -6,7 +6,7 @@
6 "Arguments to pass to mpv in `browse-url-mpv'.") 6 "Arguments to pass to mpv in `browse-url-mpv'.")
7 7
8(defun browse-url-mpv (url &optional new-window) 8(defun browse-url-mpv (url &optional new-window)
9 "Play `URL' in mpv." 9 "Play URL in mpv."
10 (interactive (browse-url-interactive-arg "Video URL: ")) 10 (interactive (browse-url-interactive-arg "Video URL: "))
11 (ignore new-window) ;; mpv always opens a new window 11 (ignore new-window) ;; mpv always opens a new window
12 (let* ((url (browse-url-encode-url url)) 12 (let* ((url (browse-url-encode-url url))
@@ -112,6 +112,13 @@ Then, build `browse-url-button-regexp' with the new protocol."
112 112
113;;; Browse-URL tweaks 113;;; Browse-URL tweaks
114 114
115;; convert reddit.com to teddit
116(defun acdw/eww-browse-reddit-url (url &rest args)
117 "Browse a Reddit.com URL using Teddit."
118 (let* ((teddit "teddit.com")
119 (url (replace-regexp-in-string "reddit\\.com" teddit url)))
120 (eww-browse-url url args)))
121
115;; convert twitter.com to nitter 122;; convert twitter.com to nitter
116(defun acdw/eww-browse-twitter-url (url &rest args) 123(defun acdw/eww-browse-twitter-url (url &rest args)
117 "Browse a Twitter.com URL using Nitter." 124 "Browse a Twitter.com URL using Nitter."
diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index 89269ab..63f6516 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el
@@ -288,7 +288,7 @@ instead of the true count."
288 desc "\\W"))))))) 288 desc "\\W")))))))
289 (goto-char (match-end 0))) 289 (goto-char (match-end 0)))
290 ;; Ignore source blocks 290 ;; Ignore source blocks
291 ((org-in-src-block-p) (foreward-line)) 291 ((org-in-src-block-p) (forward-line))
292 ;; Count everything else 292 ;; Count everything else
293 (t 293 (t
294 ;; ... unless it's in a few weird contexts 294 ;; ... unless it's in a few weird contexts
diff --git a/lisp/acdw.el b/lisp/acdw.el index 1a7e7f2..cdd6cf9 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -461,7 +461,7 @@ Prompt only if there are unsaved changes."
461 (repeat 1 2 digit) 461 (repeat 1 2 digit)
462 (: (any ?a ?A ?p ?P) (any ?m ?M))) 462 (: (any ?a ?A ?p ?P) (any ?m ?M)))
463 (* nonl))) 463 (* nonl)))
464 (ss (sunrise-sunset)) 464 (ss (acdw/supress-messages #'sunrise-sunset))
465 (_m (string-match times-regex ss)) 465 (_m (string-match times-regex ss))
466 (sunrise-time (match-string 1 ss)) 466 (sunrise-time (match-string 1 ss))
467 (sunset-time (match-string 2 ss))) 467 (sunset-time (match-string 2 ss)))
@@ -469,6 +469,17 @@ Prompt only if there are unsaved changes."
469 (run-at-time sunset-time (* 60 60 24) sunset-command) 469 (run-at-time sunset-time (* 60 60 24) sunset-command)
470 (run-at-time "12:00am" (* 60 60 24) sunset-command))) 470 (run-at-time "12:00am" (* 60 60 24) sunset-command)))
471 471
472(defun acdw/supress-messages (oldfn &rest args) ; from pkal
473 "Advice wrapper for suppressing `message'.
474OLDFN is the wrapped function, that is passed the arguments
475ARGS."
476 (let ((msg (current-message)))
477 (prog1
478 (let ((inhibit-message t))
479 (apply oldfn args))
480 (when msg
481 (message "%s" msg)))))
482
472(defun acdw/setup-fringes () 483(defun acdw/setup-fringes ()
473 "Set up fringes how I likes 'em." 484 "Set up fringes how I likes 'em."
474 (define-fringe-bitmap 'left-curly-arrow 485 (define-fringe-bitmap 'left-curly-arrow