summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2020-09-15 13:23:57 -0500
committerCase Duckworth2020-09-15 13:23:57 -0500
commit36f8b22f5ff640a0ce83adfdbcd157cffabb6b18 (patch)
tree2dc0c38843d2c13284600ee589e88f0f40088fdc
parentfix linebreaks (diff)
downloademacs-36f8b22f5ff640a0ce83adfdbcd157cffabb6b18.tar.gz
emacs-36f8b22f5ff640a0ce83adfdbcd157cffabb6b18.zip
Add post-to-gemlog-blue
-rw-r--r--init.el46
1 files changed, 42 insertions, 4 deletions
diff --git a/init.el b/init.el index 0d90141..23ac83d 100644 --- a/init.el +++ b/init.el
@@ -170,11 +170,8 @@
170 ("C-c L" . counsel-git-log) 170 ("C-c L" . counsel-git-log)
171 ("C-c k" . counsel-rg) 171 ("C-c k" . counsel-rg)
172 ("C-c m" . counsel-linux-app) 172 ("C-c m" . counsel-linux-app)
173 ("C-c n" . counsel-fzf)
174 ("C-x l" . counsel-locate) 173 ("C-x l" . counsel-locate)
175 ("C-c J" . counsel-file-jump) 174 ("C-c J" . counsel-file-jump)
176 ("C-S-o" . counsel-rhythmbox)
177 ("C-c w" . counsel-wmctrl)
178 ("C-c b" . counsel-bookmark) 175 ("C-c b" . counsel-bookmark)
179 ("C-c d" . counsel-descbinds) 176 ("C-c d" . counsel-descbinds)
180 ("C-c g" . counsel-git) 177 ("C-c g" . counsel-git)
@@ -334,6 +331,41 @@
334 :straight (gemini-write 331 :straight (gemini-write
335 :repo "https://alexschroeder.ch/cgit/gemini-write")) 332 :repo "https://alexschroeder.ch/cgit/gemini-write"))
336 333
334(defun post-to-gemlog-blue (post-title user pass)
335 "Post current buffer to gemlog.blue."
336 (interactive
337 (let* ((title-maybe (progn ;; TODO this is ... clunky
338 (goto-char (point-min))
339 (if (re-search-forward "^# \\(.*\\)" nil t)
340 (concat " ("
341 (buffer-substring-no-properties
342 (match-beginning 1)
343 (match-end 1))
344 ")")
345 "")))
346 (title (read-string
347 (format "Title%s: " title-maybe)
348 nil nil title-maybe))
349 (user (read-string "User: " nil))
350 (pass (read-passwd "Pass: " nil)))
351 (list title user pass)))
352
353 (require 'mm-url)
354 (let ((url-request-method "POST")
355 (url-request-extra-headers
356 '(("Content-Type" . "application/x-www-form-urlencoded")))
357 (url-request-data
358 (mm-url-encode-www-form-urlencoded
359 `(("title" . ,post-title)
360 ("gemloguser" . ,user)
361 ("pw" . ,pass)
362 ("post" . ,(buffer-string))))))
363 (with-current-buffer
364 (url-retrieve-synchronously "https://gemlog.blue/post.php")
365 (goto-char (point-min))
366 (re-search-forward "\\(gemini://.*\\.gmi\\)")
367 (elpher-go (match-string 1)))))
368
337;;; exwm ~ Emacs X Window Manager 369;;; exwm ~ Emacs X Window Manager
338(when acdw/at-larry 370(when acdw/at-larry
339 (use-package exwm 371 (use-package exwm
@@ -346,6 +378,8 @@
346 (exwm-workspace-number 4) 378 (exwm-workspace-number 4)
347 (exwm-input-global-keys 379 (exwm-input-global-keys
348 `( 380 `(
381 ([remap split-window-below] . split-and-follow-below)
382 ([remap split-window-right] . split-and-follow-right)
349 ([?\s-r] . exwm-reset) 383 ([?\s-r] . exwm-reset)
350 ([?\s-w] . exwm-workspace-switch) 384 ([?\s-w] . exwm-workspace-switch)
351 ([?\s-&] . (lambda (command) 385 ([?\s-&] . (lambda (command)
@@ -421,4 +455,8 @@
421 :after exwm 455 :after exwm
422 :hook 456 :hook
423 (exwm-init-hook . exwm-mff-mode)) 457 (exwm-init-hook . exwm-mff-mode))
424 ) ;; end of acdw/at-larry block 458
459 (use-package exwm-edit)
460
461 )
462;; end of acdw/at-larry block for exwm