about summary refs log tree commit diff stats
path: root/lisp/+circe.el
diff options
context:
space:
mode:
authorCase Duckworth2022-01-11 16:01:03 -0600
committerCase Duckworth2022-01-11 16:01:03 -0600
commite4f7ed9609d85f80f3f54dae7485f06a49fc4d3c (patch)
treef45f690e7c720177e359ad4a5d4f2f015f011103 /lisp/+circe.el
parentMerge branch 'main' of https://tildegit.org/acdw/emacs (diff)
downloademacs-e4f7ed9609d85f80f3f54dae7485f06a49fc4d3c.tar.gz
emacs-e4f7ed9609d85f80f3f54dae7485f06a49fc4d3c.zip
Lots o changes at work
I need to fix +circe-define-filter or something
Diffstat (limited to 'lisp/+circe.el')
-rw-r--r--lisp/+circe.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/+circe.el b/lisp/+circe.el index 3d6ea60..a8db1ec 100644 --- a/lisp/+circe.el +++ b/lisp/+circe.el
@@ -245,6 +245,14 @@ can easily remove elements.")
245 match)) 245 match))
246 text))) 246 text)))
247 247
248(defun +circe-shorten-urls-all ()
249 "Turn on `+circe-shorten-url-mode' in all chat buffers."
250 (interactive)
251 (+mapc-some-buffers
252 (lambda () (+circe-shorten-url-mode +1))
253 (lambda (buf)
254 (derived-mode-p 'circe-chat-mode))))
255
248;; Temperature conversion 256;; Temperature conversion
249 257
250(+circe-define-filter +circe-F/C-mode 258(+circe-define-filter +circe-F/C-mode
@@ -261,12 +269,13 @@ can easily remove elements.")
261 (round (+ 32 (* (/ 9.0 5.0) degc)))) 269 (round (+ 32 (* (/ 9.0 5.0) degc))))
262 270
263(defun str-F/C (text) 271(defun str-F/C (text)
264 (replace-regexp-in-string "[0-9.]+[Ff]" 272 (replace-regexp-in-string "[^.]\\([[:digit:]]+\\(?:\\.[[:digit:]]+\\)?[fF]\\)"
265 (lambda (match) 273 (lambda (match)
266 (format "%s/%dC" match 274 (format "%s/%dC" match
267 (fahrenheit-to-celsius 275 (fahrenheit-to-celsius
268 (string-to-number match)))) 276 (string-to-number match))))
269 text)) 277 text
278 nil 1))
270 279
271(provide '+circe) 280(provide '+circe)
272;;; +circe.el ends here 281;;; +circe.el ends here