diff options
Diffstat (limited to 'emacs/.emacs.d/init')
-rw-r--r-- | emacs/.emacs.d/init/ycp-basic.el | 1 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-editing.el | 2 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-emms.el | 3 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-gnus.el | 4 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-markup.el | 26 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-org.el | 34 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-pdf.el | 1 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-prog.el | 11 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-web.el | 66 |
9 files changed, 129 insertions, 19 deletions
diff --git a/emacs/.emacs.d/init/ycp-basic.el b/emacs/.emacs.d/init/ycp-basic.el index 12c21d1..6baf1b8 100644 --- a/emacs/.emacs.d/init/ycp-basic.el +++ b/emacs/.emacs.d/init/ycp-basic.el @@ -57,6 +57,7 @@ (:delay 5) (my-setq-from-local my-audio-incoming-dir my-video-incoming-dir my-document-incoming-dir) + (my-setq-from-local my-copy-file-targets) (my-keybind global-map "C-c <f2>" #'my-rename-file-and-buffer "C-c <delete>" #'my-delete-file-and-kill-buffer diff --git a/emacs/.emacs.d/init/ycp-editing.el b/emacs/.emacs.d/init/ycp-editing.el index 907c80b..d497f42 100644 --- a/emacs/.emacs.d/init/ycp-editing.el +++ b/emacs/.emacs.d/init/ycp-editing.el @@ -30,6 +30,8 @@ ;; line wrap at window edge (setq-default truncate-lines nil) (setq kill-do-not-save-duplicates t) +(setq kill-transform-function + (lambda (s) (when (string-match-p "[^ \t\n]" s) s))) (setq bidi-inhibit-bpa t) (setq save-interprogram-paste-before-kill t) (setq kill-ring-max 200) diff --git a/emacs/.emacs.d/init/ycp-emms.el b/emacs/.emacs.d/init/ycp-emms.el index a3a4604..08c9d92 100644 --- a/emacs/.emacs.d/init/ycp-emms.el +++ b/emacs/.emacs.d/init/ycp-emms.el @@ -90,11 +90,14 @@ (my-override emms-mode-line-toggle) (add-hook 'emms-playlist-selection-changed-hook 'my-emms-output-current-track-to-i3bar-file) + (add-hook 'emms-player-finished-hook 'my-emms-score-up-playing) + (add-hook 'emms-player-started-hook 'my-emms-score-up-chosen-bonus) (setq emms-player-next-function 'my-emms-next-track-or-random-album) (setq emms-players-preference-f 'my-emms-players-preference) (my-keybind dired-mode-map "e" #'my-dired-add-to-emms) (my-override emms-track-simple-description) (my-emms-add-all) + (my-timer emms-save-scores-timer nil 900 'emms-score-save-hash) ) (provide 'ycp-emms) diff --git a/emacs/.emacs.d/init/ycp-gnus.el b/emacs/.emacs.d/init/ycp-gnus.el index f4886fd..9e89ee9 100644 --- a/emacs/.emacs.d/init/ycp-gnus.el +++ b/emacs/.emacs.d/init/ycp-gnus.el @@ -186,6 +186,10 @@ (setq gnus-summary-next-group-on-exit nil) ) +(my-package gnus-art + (my-keybind gnus-article-mode-map + "w" #'my-copy-url-at-point)) + (my-package nnrss (:delay 60) (setq nnrss-use-local t)) diff --git a/emacs/.emacs.d/init/ycp-markup.el b/emacs/.emacs.d/init/ycp-markup.el index e03fd86..5f21da7 100644 --- a/emacs/.emacs.d/init/ycp-markup.el +++ b/emacs/.emacs.d/init/ycp-markup.el @@ -72,7 +72,11 @@ (my-keybind wiki-mode-map "C-'" #'my-wiki-grok-wikipedia) (my-setq-from-local wiki-sites) - (wiki-define-site-commands)) + (wiki-define-site-commands) + (add-to-list 'browse-url-handlers + `(wiki-engine-entry-url-p + . ,(lambda (url &rest _) (wiki-open-url url)))) + ) (my-package ledger-mode (:install t) @@ -83,17 +87,33 @@ (setq-local completion-cycle-threshold t) (setq-local ledger-complete-in-steps t) (setq-local company-mode nil))) - (setq ledger-binary-path "hledger")) + (setq ledger-binary-path "hledger") + (require 'my-ledger) + (my-keybind ledger-mode-map + "M-<down>" #'my-ledger-move-xact-down + "M-<up>" #'my-ledger-move-xact-up + "C-c C-c" #'compile) + (add-to-list 'compilation-error-regexp-alist 'ledger) + (add-to-list 'compilation-error-regexp-alist-alist my-ledger-compilation-error-re) + (add-hook 'ledger-mode-hook 'my-ledger-set-compile-command) + ) ;;; todo: open epub in emacs client with nov (my-package nov (:delay 15) (add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode)) - (setq nov-text-width fill-column) + ;; No fill, so it requires visual line mode to look nice + (setq nov-text-width t) + (add-hook 'nov-mode-hook 'visual-line-mode) (add-hook 'nov-mode-hook 'follow-mode) + (add-hook 'nov-mode-hook (lambda () + (setq next-screen-context-lines 4))) + (add-hook 'nov-post-html-render-hook 'my-nov-set-margins) (require 'my-nov) (my-override nov-render-title) (my-override nov-scroll-up) + (my-keybind nov-mode-map + "Q" #'my-nov-copy-buffer-file-with-staging) ) ;;; json-mode diff --git a/emacs/.emacs.d/init/ycp-org.el b/emacs/.emacs.d/init/ycp-org.el index eb5a63d..6385a46 100644 --- a/emacs/.emacs.d/init/ycp-org.el +++ b/emacs/.emacs.d/init/ycp-org.el @@ -441,7 +441,11 @@ (add-to-list 'org-protocol-protocol-alist '("grok" :protocol "grok" - :function my-org-protocol-grok))) + :function my-org-protocol-grok)) + (add-to-list 'org-protocol-protocol-alist + '("browse-url" + :protocol "browse-url" + :function my-org-protocol-browse-url))) ;; org man links (my-package ol-man @@ -504,12 +508,12 @@ (my-package my-org (:delay 30) (require 'my-web) - (org-link-set-parameters "http" :follow (lambda (url arg) - (my-browse-url - (concat "http:" url) arg))) - (org-link-set-parameters "https" :follow (lambda (url arg) - (my-browse-url - (concat "https:" url) arg))) + (org-link-set-parameters "http" :follow + (lambda (url arg) + (browse-url (concat "http:" url) arg))) + (org-link-set-parameters "https" :follow + (lambda (url arg) + (browse-url (concat "http:" url) arg))) (require 'eww) (define-key eww-mode-map (kbd "C-'") 'my-eww-org-protocol-grok) ) @@ -518,5 +522,21 @@ (:delay 60) (require 'my-ox-jira)) +(my-package org-remark + (:install t) + (:delay 60) + (require 'my-org-remark) + (setq org-remark-notes-display-buffer-action + '(display-buffer-reuse-mode-window)) + (require 'nov) + (my-keybind nov-mode-map + "M-n" #'org-remark-next + "M-p" #'org-remark-prev + "M" #'my-org-remark-open-or-create + "o" #'org-remark-view + "d" #'org-remark-delete) + (with-eval-after-load 'nov + (org-remark-nov-mode +1))) + (provide 'ycp-org) ;;; ycp-org.el ends here diff --git a/emacs/.emacs.d/init/ycp-pdf.el b/emacs/.emacs.d/init/ycp-pdf.el index 9553f7a..8e47f1c 100644 --- a/emacs/.emacs.d/init/ycp-pdf.el +++ b/emacs/.emacs.d/init/ycp-pdf.el @@ -57,6 +57,7 @@ "," #'my-pdf-view-shrink-a-bit "Q" #'my-pdf-dptrp1-upload ) + (my-setq-from-local my-pdf-dptrp1-ip) ) (my-package pdf-misc diff --git a/emacs/.emacs.d/init/ycp-prog.el b/emacs/.emacs.d/init/ycp-prog.el index 9eff2f8..39427e8 100644 --- a/emacs/.emacs.d/init/ycp-prog.el +++ b/emacs/.emacs.d/init/ycp-prog.el @@ -106,7 +106,10 @@ "C-c C-n" 'comint-next-prompt "C-c C-u" 'gud-up "C-c C-d" 'gud-down - "C-c C-n" 'comint-next-prompt) + "C-c C-k" 'my-gud-insert-source-line + "C-c C-q" 'my-gud-insert-function-name + "C-," 'my-gud-insert-source-line-and-function-name + ) (add-hook 'gud-mode-hook 'my-gud-comint-set-prompt-regexp) (add-hook 'gud-mode-hook 'company-mode) ;; Don't make this a general comint-mode hook, as it will overwrite @@ -501,14 +504,16 @@ (setq comment-start "#")))) (add-to-list 'auto-mode-alist '("\\.cnf\\'" . conf-mode)) (require 'my-mariadb) + (add-hook 'sql-mode-hook 'my-mtr-set-compile-command) + (add-to-list 'compilation-error-regexp-alist 'mtr) + (add-to-list 'compilation-error-regexp-alist-alist + my-mtr-compilation-error-re) (define-key sql-mode-map (kbd "C-c C-c") 'my-sql-maybe-mtrr) (my-keybind global-map "C-c d m" 'my-gdb-maria "C-c d s" 'my-gdb-maria-spider ) (define-key gud-mode-map (kbd "C-c C-z") 'my-gdb-mysql-parse-frame) - (define-key gud-mode-map (kbd "C-c C-p") 'comint-previous-prompt) - (define-key gud-mode-map (kbd "C-c C-n") 'comint-next-prompt) (add-to-list 'grep-files-aliases '("mtr" . "*.inc *.test *.cnf *.result *.rdiff")) (add-to-list 'grep-files-aliases diff --git a/emacs/.emacs.d/init/ycp-web.el b/emacs/.emacs.d/init/ycp-web.el index b1e546c..9b0bf0d 100644 --- a/emacs/.emacs.d/init/ycp-web.el +++ b/emacs/.emacs.d/init/ycp-web.el @@ -184,7 +184,12 @@ (my-override hnreader--print-frontpage) (my-override hnreader--print-frontpage-item) (my-override hnreader--print-comments) - (my-override hnreader--get-title)) + (my-override hnreader--get-title) + (require 'my-web) + (add-to-list 'browse-url-handlers + `(my-hacker-news-url-p + . ,(lambda (url &rest _) (hnreader-comment url)))) + ) (add-to-list 'load-path (locate-user-emacs-file "lisp/lem.el/lisp")) (my-package lem-org @@ -203,6 +208,7 @@ org-jira-jira-status-to-org-keyword-alist org-jira-project-filename-alist org-jira-custom-jqls) + (org-link-set-parameters "jira" '((:follow . org-jira-open))) (require 'my-org-jira) (my-override org-jira--render-issue) (my-override org-jira-update-worklogs-from-org-clocks) @@ -215,8 +221,14 @@ 'turn-off-auto-fill) (add-hook 'org-jira-mode-hook 'turn-off-flyspell) + (add-to-list 'browse-url-handlers + `(my-org-jira-url-p + . ,(lambda (url &rest _) (my-org-jira-open-url url)))) ) +(my-package dnd + (setq dnd-open-remote-file-function 'browse-url)) + (my-package eww (:delay 60) (advice-add 'eww-browse-url :filter-args #'my-rewrite-url-advice) @@ -245,9 +257,23 @@ "T" #'my-eww-top-path "b" #'my-eww-switch-by-title) (my-keybind global-map "\C-c\C-o" #'my-browse-url-at-point) - (my-override browse-url) + (my-setq-from-local my-newscorp-au-amp-nk) + ) + +(my-package my-gitlab + (:delay 60) + (add-to-list 'browse-url-handlers + `(my-gitlab-project-url-p + . ,(lambda (url &rest _) (my-gitlab-project-infobox url)))) ) +(my-package my-ytdl + (:delay 60) + (add-to-list 'browse-url-handlers + `(my-ytdl-video-url-p + . ,(lambda (url &rest _) (my-ytdl-video-infobox url))))) + + (my-package my-semantic-scholar (:delay 60)) @@ -280,7 +306,12 @@ ;; sx: a stack exchange client (my-package sx (:delay 60) - (require 'sx-load)) + (require 'sx-load) + (require 'my-web) + (add-to-list 'browse-url-handlers + `(my-stack-overflow-url-p + . ,(lambda (url &rest _) (sx-open-link url)))) + ) ;; mastodon.el (add-to-list 'load-path (locate-user-emacs-file "lisp/mastodon.el/lisp")) @@ -291,7 +322,18 @@ (mastodon)) (my-package mastorg - (:delay 60)) + (:delay 60) + (require 'my-web) + (add-to-list 'browse-url-handlers + `(my-mastodon-url-p + . ,(lambda (url &rest _) (mastorg-open url)))) + (add-to-list 'browse-url-handlers + `(my-newscorp-au-url-p + . ,(lambda (url &rest _) (my-open-newscorp-au url)))) + (add-to-list 'browse-url-handlers + `("^https?://www.spectator.com.au\\>" . + ,(lambda (url &rest args) (my-open-spectator-au url)))) + ) (add-to-list 'load-path (locate-user-emacs-file "lisp/servall/lisp")) (my-package servall-wikipedia @@ -308,7 +350,8 @@ (my-setq-from-local my-libgen-hosts my-libgen-alt-hosts my-libgen-library-hosts my-libgen-onion-host ) - (setq my-libgen-download-dir my-document-incoming-dir) + (setq my-libgen-download-dir my-document-incoming-dir + my-libfic-download-dir my-document-incoming-dir) (my-libgen-set-random-hosts)) (my-package my-scihub @@ -334,7 +377,18 @@ exitter-oauth-consumer-key exitter-oauth-consumer-secret exitter-access-token exitter-username exitter-password exitter-email exitter-oauth-token exitter-oauth-token-secret exitter-oauth-token-ctime) - (setq exitter-debug t) + (setq exitter-debug nil) + (add-to-list 'browse-url-handlers + `(exitter-post-url-p + . ,(lambda (url &rest _) (exitter-open-post url)))) + + ) + +(my-package reddio + (:delay 60) + (add-to-list 'browse-url-handlers + `(reddio-reddit-url-p + . ,(lambda (url &rest _) (reddio-open-url url)))) ) (provide 'ycp-web) |