diff options
Diffstat (limited to 'emacs/.emacs.d/init')
| -rw-r--r-- | emacs/.emacs.d/init/ycp-basic.el | 11 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-buffer.el | 8 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-client.el | 3 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-complete.el | 36 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-editing.el | 26 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-emms.el | 19 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-gnus.el | 22 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-grep.el | 1 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-help.el | 5 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-markup.el | 50 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-org.el | 45 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-pdf.el | 2 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-prog.el | 24 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-reading.el | 34 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-theme.el | 1 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-time.el | 4 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-web.el | 108 | 
17 files changed, 349 insertions, 50 deletions
| diff --git a/emacs/.emacs.d/init/ycp-basic.el b/emacs/.emacs.d/init/ycp-basic.el index b03d0d4..313004f 100644 --- a/emacs/.emacs.d/init/ycp-basic.el +++ b/emacs/.emacs.d/init/ycp-basic.el @@ -27,6 +27,12 @@  ;;; Code: +;;; If started from systemd, emacs treats env variables inside env +;;; variables as literal. e.g. if we have +;;; Environment=PATH=$HOME/.local/bin:$HOME/bin +;;; emacs will set exec-path to be literally +;;; $HOME/.local/bin:$HOME/bin, without expanding $HOME. +(setq exec-path (seq-map 'substitute-in-file-name exec-path))  (my-configure    (my-keybind global-map @@ -49,12 +55,15 @@    (setq attempt-stack-overflow-recovery nil)    (setq confirm-kill-processes nil)    (setq attempt-orderly-shutdown-on-fatal-signal nil) +  ;; Use visible bell instead of beeping +  (setq visible-bell t)    )  (my-package my-utils    (:delay 5)    (my-setq-from-local my-audio-incoming-dir my-video-incoming-dir -                      my-document-incoming-dir) +                      my-music-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-buffer.el b/emacs/.emacs.d/init/ycp-buffer.el index 7e1128a..6a560ea 100644 --- a/emacs/.emacs.d/init/ycp-buffer.el +++ b/emacs/.emacs.d/init/ycp-buffer.el @@ -50,7 +50,7 @@  (my-configure    (:delay 15)    (my-keybind ctl-x-x-map -    "f" #'follow-mode                   ; override `font-lock-update' +    ;; "f" #'follow-mode                   ; override `font-lock-update'      "r" #'rename-uniquely      "l" #'visual-line-mode) @@ -98,6 +98,9 @@  (my-package follow    (:delay 15) +  (require 'my-buffer) +  ;; Disable follow mode +  (my-override follow-mode)    ;; TODO: update this to adapt to number of windows    (my-keybind follow-mode-map      "C-v" #'follow-scroll-up @@ -121,6 +124,7 @@      "r" #'next-buffer      "d" nil      "u" nil +    "." nil      "w" #'kill-ring-save      "i" #'view-mode)    (my-keybind global-map "C-`" #'view-mode)) @@ -225,7 +229,7 @@  (my-package my-buffer    (:delay 10)    (my-keybind global-map -    "<f1>" #'my-focus-write +    "<f1>" #'my-toggle-focus-write      "<insert>" #'my-cycle-windows      "C-M-<mouse-4>" #'my-increase-default-face-height      "C-M-<mouse-5>" #'my-decrease-default-face-height) diff --git a/emacs/.emacs.d/init/ycp-client.el b/emacs/.emacs.d/init/ycp-client.el index d35898c..16447fd 100644 --- a/emacs/.emacs.d/init/ycp-client.el +++ b/emacs/.emacs.d/init/ycp-client.el @@ -91,7 +91,8 @@    (:delay 60)    (require 'my-utils)    (setq my-ytdl-audio-download-dir my-audio-incoming-dir -        my-ytdl-video-download-dir my-video-incoming-dir)) +        my-ytdl-video-download-dir my-video-incoming-dir +        my-ytdl-music-download-dir my-music-incoming-dir))  (my-package my-media-segment    (:delay 60)) diff --git a/emacs/.emacs.d/init/ycp-complete.el b/emacs/.emacs.d/init/ycp-complete.el index bd3b3ca..2f2117d 100644 --- a/emacs/.emacs.d/init/ycp-complete.el +++ b/emacs/.emacs.d/init/ycp-complete.el @@ -155,7 +155,11 @@              #'my-corfu-enable-always-in-minibuffer 1)  ;;; corfu does not work well in gud as it "flushes" completion  ;;; suggestions to the buffer -  (setq corfu-exclude-modes '(gud-mode)) +  ;;; https://github.com/minad/corfu/issues/157 +  ;; Only company modes works with bbdb email completion in +  ;; message-mode, so we remove corfu from message-mode to avoid +  ;; overlapping multiple completion dropdowns +  (setq global-corfu-modes '((not gud-mode) (not message-mode) t))    )  ;;; We still need company mode because corfu does not work well in @@ -163,7 +167,16 @@  (my-package company    (:install t)    (:delay 5) +  ;; corfu does not complete email fields using bbdb    (add-hook 'message-mode-hook #'company-mode) +  ;; for some reason, having a t in the completion-at-point-functions +  ;; causes company to hang in message-mode +  (add-hook 'message-mode-hook +            (lambda () +              (setq-local completion-at-point-functions +                          (delq t +                                completion-at-point-functions)) +              ))    (setq company-idle-delay .1          company-minimum-prefix-length 3          company-selection-wrap-around t @@ -191,7 +204,14 @@            (message-mode ?' ?')))    (dolist (backend '(cape-elisp-symbol cape-keyword cape-file cape-history                                         cape-dabbrev)) -    (add-to-list 'completion-at-point-functions backend))) +    (add-to-list 'completion-at-point-functions backend)) +  ;; for some reason, cape-dabbrev causes message-mode to hang with +  ;; company mode as well +  ;; (add-hook 'message-mode-hook +  ;;           (lambda () +  ;;             (add-to-list 'completion-at-point-functions +  ;;                          'cape-dabbrev))) +  )  (my-package imenu    (:delay 5) @@ -271,6 +291,9 @@  (my-package consult-recoll    (:delay 30)    (:install t) +  (add-to-list 'consult-recoll-open-fns +               '("application/pdf" . my-consult-recoll-open-in-pdf-tools)) +  (setq consult-recoll-inline-snippets t)    )  (my-package hmm @@ -288,7 +311,14 @@            (:name qutebrowser :command my-browse-url-qutebrowser)            (:name download-and-open :command my-fetch-url)))    (setq hmm-external-handlers -        '((:name mpv +        '((:name feh +                 :external-command "feh %U" +                 :display-name "feh image viewer" +                 :description "Open url with feh" +                 :schemes +                 ("ftp" "http" "https" "mms" "rtmp" "rtsp" "sftp" "smb" "srt") +                 :handling :url) +          (:name mpv                   :external-command "mpv %U"                   :display-name "mpv player"                   :description "Play url with mpv" diff --git a/emacs/.emacs.d/init/ycp-editing.el b/emacs/.emacs.d/init/ycp-editing.el index 203b185..031ae31 100644 --- a/emacs/.emacs.d/init/ycp-editing.el +++ b/emacs/.emacs.d/init/ycp-editing.el @@ -30,6 +30,11 @@  ;; line wrap at window edge  (setq-default truncate-lines nil)  (setq kill-do-not-save-duplicates t) +(setq kill-transform-function +      (lambda (s) (when (or +                         (derived-mode-p 'pdf-view-mode) +                         (string-match-p "[^ \t\n]" s)) +                    s)))  (setq bidi-inhibit-bpa t)  (setq save-interprogram-paste-before-kill t)  (setq kill-ring-max 200) @@ -38,9 +43,10 @@  (setq window-divider-default-bottom-width 1)  (setq line-number-display-limit-width 9999)  (setq window-divider-default-places 'bottom-only) -;; don't interpret C-m as RET -(define-key input-decode-map [?\C-m] [C-m]) -(define-key input-decode-map [?\C-i] [C-i]) +;; If run in gui, don't interpret C-m as RET +(when (display-graphic-p) +  (define-key input-decode-map [?\C-m] [C-m]) +  (define-key input-decode-map [?\C-i] [C-i]))  ;; fixme: the line below does not work  ;; (define-key input-decode-map [?\C-M-m] [C-M-m])  (setq save-place-file (locate-user-emacs-file "saveplace")) @@ -93,6 +99,7 @@      "<C-M-backspace>" #'backward-kill-sexp      "C-M-/" #'my-mark-backward-up-list      "C-M-k" #'my-kill-sexp-or-comment +    "C-x C-w" #'my-write-file      )    (electric-pair-mode)    (my-add-hooks #'my-non-special-modes-setup '(text-mode-hook prog-mode-hook)) @@ -107,7 +114,8 @@  (setq viper-mode nil)  (my-package viper -  (:delay 60)) +  (:delay 60) +  (setq viper-syntax-preference 'extended))  (define-key global-map [f2] 'revert-buffer) @@ -124,6 +132,16 @@      "M-g M-g" #'avy-goto-line)    (setq avy-keys '(97 115 100 102 103 104 106 107 108))) +(my-package ispell +  ;; Use aspell: +  ;; https://battlepenguin.com/tech/aspell-and-hunspell-a-tale-of-two-spell-checkers/ +  ;; also, ispell seems to have problem finding hunspell aff files +  ;; using `ispell-find-hunspell-dictionaries', even though the files +  ;; are available. +  (setq ispell-program-name "aspell" +        ispell-dictionary "en_GB") +  ) +  (my-package flyspell    (my-keybind flyspell-mode-map      "C-." nil diff --git a/emacs/.emacs.d/init/ycp-emms.el b/emacs/.emacs.d/init/ycp-emms.el index d83b53b..e49209f 100644 --- a/emacs/.emacs.d/init/ycp-emms.el +++ b/emacs/.emacs.d/init/ycp-emms.el @@ -34,18 +34,20 @@    (emms-all)    (setq emms-playing-time-resume-from-last-played t)    (add-to-list 'emms-info-functions 'emms-info-ytdl) +  (add-to-list 'emms-info-functions 'my-emms-info-ffprobe)    ;; emms-info-native is not very useful    (delete 'emms-info-native emms-info-functions)    (setq emms-source-file-default-directory (locate-user-emacs-file "emms"))    (setq emms-source-playlist-default-format 'native)    (setq emms-repeat-playlist t)    (my-keybind emms-playlist-mode-map "C-x C-f" #'emms-play-playlist) -  (setq emms-player-list '(emms-player-mpv)) +  (setq emms-player-list '(emms-player-mpv emms-player-vlc))    (setq emms-player-vlc-parameters '("--intf=qt" "--extraintf=rc"))    (setq emms-playlist-buffer-name "*EMMS Playlist*")    (setq emms-source-file-directory-tree-function          'emms-source-file-directory-tree-find)    (setq emms-info-ytdl-using-torsocks t) +  (setq emms-info-auto-update nil)    (add-hook 'emms-playlist-mode-hook #'hl-line-mode)    (add-hook 'emms-metaplaylist-mode-hook #'hl-line-mode)    ) @@ -81,8 +83,8 @@      "C-<return>" #'my-emms-playlist-mode-make-current      "w" #'my-emms-playlist-kill-track-name-at-point      "D" #'my-emms-playlist-delete-at-point -    "R" #'my-emms-random-album -    "N" #'my-emms-next-track-or-random-album +    "R" #'my-emms-playlist-random-group +    "N" #'my-emms-next-track-or-random-group      )    (add-hook 'emms-player-started-hook 'my-emms-maybe-seek-to-last-played)    (my-override emms-mode-line-enable) @@ -90,10 +92,19 @@    (my-override emms-mode-line-toggle)    (add-hook 'emms-playlist-selection-changed-hook              'my-emms-output-current-track-to-i3bar-file) -  (setq emms-player-next-function 'my-emms-next-track-or-random-album) +  (add-hook 'emms-player-finished-hook 'my-emms-score-up-playing) +  (add-hook 'emms-player-started-hook 'my-emms-score-up-chosen-bonus) +  (add-hook 'emms-player-started-hook 'my-emms-playlist-maybe-mark-bounds) +  (add-hook 'emms-player-started-hook 'my-emms-maybe-get-duration-for-current-track) +  (setq emms-player-next-function 'my-emms-next-track-or-random-group) +  (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) +  (my-override emms-mode-line-playlist-current) +  (my-override emms-score-show-playing) +  ;; (my-override emms-playing-time-mode-line)    )  (provide 'ycp-emms) diff --git a/emacs/.emacs.d/init/ycp-gnus.el b/emacs/.emacs.d/init/ycp-gnus.el index 90a2c5a..7275363 100644 --- a/emacs/.emacs.d/init/ycp-gnus.el +++ b/emacs/.emacs.d/init/ycp-gnus.el @@ -94,9 +94,18 @@    (my-keybind global-map      "C-c n i" #'my-gnus-open-inbox      "C-c n n" #'my-gnus-start -    "C-c n u" #'gnus-group-get-new-news) +    "C-c n u" #'my-gnus-group-refresh)    (my-server-timer my-gnus-new-news-timer nil 300                     'my-gnus-group-get-new-news-quietly) +  ;; https://superuser.com/questions/519685/gnus-get-rid-of-mail-and-news-folders +  ;; this also fixes issues with presumably nonexisting +  ;; nndraft-directory causing +  ;; (wrong-type-argument stringp nndraft-directory) +  ;; which may require a restart of gnus to fix +  (setq message-directory "~/.emacs.d/mail/") +  (setq gnus-directory "~/.emacs.d/news/") +  (setq nnfolder-directory "~/.emacs.d/mail/archive") +  (setq nndraft-directory "~/.emacs.d/mail/drafts/")    )  (my-configure @@ -138,11 +147,14 @@  (my-package gnus-group    (require 'my-gnus)    (my-keybind gnus-group-mode-map +    "g" #'my-gnus-group-refresh +    "i" #'my-gnus-open-inbox      "n" #'next-line      "p" #'previous-line      "m" #'my-gnus-group-compose      "M-&" nil -    "<RET>" #'my-gnus-topic-select-group) +    "<RET>" #'my-gnus-topic-select-group +    "q" #'bury-buffer)    (add-hook 'gnus-group-mode-hook 'gnus-topic-mode)    ) @@ -173,8 +185,13 @@  ")    (setq gnus-thread-sort-functions          '(gnus-thread-sort-by-most-recent-date)) +  (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)) @@ -207,6 +224,7 @@    (setq bbdb-dedicated-window t)    (setq bbdb-message-all-addresses t)    (setq bbdb-mua-pop-up-window-size .15) +  (setq bbdb-mua-pop-up nil)    (setq bbdb-new-mails-primary nil)    (setq bbdb-ignore-redundant-mails t)    (setq bbdb-mail-user-agent 'gnus-user-agent) diff --git a/emacs/.emacs.d/init/ycp-grep.el b/emacs/.emacs.d/init/ycp-grep.el index 85f15cd..f0ef8ce 100644 --- a/emacs/.emacs.d/init/ycp-grep.el +++ b/emacs/.emacs.d/init/ycp-grep.el @@ -107,6 +107,7 @@  ;;; org-recoll  (my-package org-recoll    (:delay 60) +  (my-override org-recoll-format-results)    (my-keybind org-recoll-mode-map      "n" #'org-next-visible-heading      "p" #'org-previous-visible-heading diff --git a/emacs/.emacs.d/init/ycp-help.el b/emacs/.emacs.d/init/ycp-help.el index 3503a6d..98fa58c 100644 --- a/emacs/.emacs.d/init/ycp-help.el +++ b/emacs/.emacs.d/init/ycp-help.el @@ -44,7 +44,8 @@    )  (my-package info -  ;; TODO consider using `Info-additional-directory-list' instead +  ;; Can't `Info-additional-directory-list' - won't be used in +  ;; `info-display-manual' somehow    (add-to-list 'Info-directory-list (locate-user-emacs-file "info")))  (my-keybind global-map @@ -81,7 +82,7 @@  (my-package my-help    (:delay 10)    (my-keybind global-map -    "C-h M" #'my-woman-man +    "C-h M" #'man      "C-h i" #'my-info-display-manual      "C-h ." #'my-describe-symbol-at-point      "\C-h!" #'my-external-command-open-source) diff --git a/emacs/.emacs.d/init/ycp-markup.el b/emacs/.emacs.d/init/ycp-markup.el index e03fd86..68b5459 100644 --- a/emacs/.emacs.d/init/ycp-markup.el +++ b/emacs/.emacs.d/init/ycp-markup.el @@ -71,8 +71,12 @@  (my-package wiki    (my-keybind wiki-mode-map      "C-'" #'my-wiki-grok-wikipedia) -  (my-setq-from-local wiki-sites) -  (wiki-define-site-commands)) +  (my-setq-from-local wiki-sites wiki-local-dir) +  (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,44 @@                (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) -  (add-hook 'nov-mode-hook 'follow-mode) +  ;; No fill, so it requires visual line mode to look nice +  (setq nov-text-width t) +  (add-hook 'nov-mode-hook 'visual-line-mode) +  ;; interfering with dbus +  ;; (add-hook 'nov-mode-hook 'follow-mode) +  (add-hook 'nov-mode-hook (lambda () +                             (setq line-spacing .1))) +  (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 +    "i" #'imenu +    "f" #'nov-scroll-up +    "b" #'nov-scroll-down +    "F" #'my-nov-skim-forward +    "B" #'my-nov-skim-backward) +  (add-to-list 'nov-shr-rendering-functions '(span . my-nov-render-span)) +  (add-to-list 'nov-shr-rendering-functions '(ol . my-nov-render-ol)) +  (add-hook 'nov-mode-hook +            (lambda () +              (add-hook 'post-command-hook #'my-nov-update-mode-line nil t)))    )  ;;; json-mode @@ -104,5 +135,14 @@    (add-hook 'json-mode-hook 'my-json-setup-hook)    ) +(my-package mhtml-mode +  (my-keybind mhtml-mode-map +    "C-c C-v" #'my-html-render)) + +(my-package my-markup +  (:delay 15) +  (add-to-list 'auto-mode-alist '("\\.html\\'" . htmlv-mode)) +  ) +  (provide 'ycp-markup)  ;;; ycp-markup.el ends here diff --git a/emacs/.emacs.d/init/ycp-org.el b/emacs/.emacs.d/init/ycp-org.el index 2481cab..77f720d 100644 --- a/emacs/.emacs.d/init/ycp-org.el +++ b/emacs/.emacs.d/init/ycp-org.el @@ -58,6 +58,8 @@                        my-org-doc-dir)    ;; disable auto-indent on RET    (add-hook 'org-mode-hook (lambda () (electric-indent-local-mode -1))) +  ;; tab-width 8 is needed for newer versions of org-mode, which I am +  ;; not using due to performance issues    (add-hook 'org-mode-hook (lambda () (setq-local tab-width 2)))    ;; The world does not end by 2038 (hopefully) @@ -304,6 +306,7 @@    (setq org-clock-idle-time 15)    (setq org-clock-mode-line-total 'auto)    (setq org-clock-persist 'history) +  (setq org-clock-continuously t)    (org-clock-persistence-insinuate))  (my-package org-refile @@ -373,7 +376,7 @@  	        ("i" . my-org-append-subheading)  	        ("^" . org-sort)  	        ("w" . org-refile) -	        ("a" . org-archive-subtree-default-with-confirmation) +	        ("a" . org-archive-subtree-default)  	        ("@" . org-mark-subtree)  	        ("#" . org-toggle-comment)  	        ("Clock Commands") @@ -439,12 +442,16 @@    (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    (:delay 30) -  (setq org-man-command 'woman)) +  (setq org-man-command 'man))  (my-package ol    (:delay 10) @@ -496,17 +503,18 @@    (advice-add 'org-insert-structure-template :after 'my-org-edit-special)    (advice-add 'org-edit-src-exit :before 'my-org-edit-src-before-exit)    (advice-add 'org-edit-src-exit :after 'my-org-edit-src-after-exit) +  (advice-add 'org-edit-special :after 'my-org-edit-special-after)    (my-setq-from-local my-org-task-categories))  (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)    ) @@ -515,5 +523,24 @@    (: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)) +  (setq org-remark-notes-file-name +        (locate-user-emacs-file "margin.org")) +  (my-override org-remark-highlight-add-or-update-highlight-headline) +  (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 95b73bd..8e47f1c 100644 --- a/emacs/.emacs.d/init/ycp-pdf.el +++ b/emacs/.emacs.d/init/ycp-pdf.el @@ -55,7 +55,9 @@      "U" #'my-pdf-view-backward-node-lower-depth      "." #'my-pdf-view-enlarge-a-bit      "," #'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 e2d7451..f74e339 100644 --- a/emacs/.emacs.d/init/ycp-prog.el +++ b/emacs/.emacs.d/init/ycp-prog.el @@ -81,6 +81,7 @@    (setq gdb-many-windows t)    (setq gdb-default-window-configuration-file          (locate-user-emacs-file "gdb-window-conf")) +  (setq gdb-debuginfod-enable-setting t)    (require 'my-prog)    (my-keybind global-map      "C-c d q" 'my-gdb-quit @@ -105,9 +106,16 @@      "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 +  ;; bash history rather than append to it. +  (add-hook 'gud-mode-hook 'my-comint-add-write-history-hook) +  (my-override gdb-frame-handler)    )  (my-package my-prog @@ -183,6 +191,8 @@    (:delay 5)    (define-key c-mode-map (kbd "C-c C-c") 'compile)    (define-key c++-mode-map (kbd "C-c C-c") 'project-compile) +  (define-key c-mode-map (kbd "C-x C-e") 'my-gud-print-expr-region) +  (define-key c++-mode-map (kbd "C-x C-e") 'my-gud-print-expr-region)    (add-to-list 'auto-mode-alist '("\\.inl\\'" . c++-mode))    (setq c-default-style          '((java-mode . "java") @@ -200,10 +210,11 @@  (my-package my-prog    (:delay 10)    (my-keybind global-map "C-c 8" #'my-set-tab-width-to-8) +  (my-keybind prog-mode-map "C-c M-w" 'my-copy-with-func)    (add-hook 'c-mode-hook 'my-c-set-compile-command)    (define-key c-mode-map (kbd "C-c s") 'my-c-switch-between-header-and-source)    (define-key c++-mode-map (kbd "C-c s") -    'my-c-switch-between-header-and-source) +              'my-c-switch-between-header-and-source)    (my-override bookmark-make-record)    ) @@ -496,14 +507,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 @@ -538,7 +551,8 @@  ;;; nxml  (my-package nxml-mode    (:delay 60) -  (setq nxml-slash-auto-complete-flag t)) +  (setq nxml-slash-auto-complete-flag t) +  (add-to-list 'auto-mode-alist '("\\.opf\\'" . nxml-mode)))  (my-package etags    (:delay 60) diff --git a/emacs/.emacs.d/init/ycp-reading.el b/emacs/.emacs.d/init/ycp-reading.el new file mode 100644 index 0000000..5c0284e --- /dev/null +++ b/emacs/.emacs.d/init/ycp-reading.el @@ -0,0 +1,34 @@ +;;; ycp-reading.el -- Reading related customisation -*- lexical-binding: t -*- + +;; Copyright (C) 2025  Free Software Foundation, Inc. + +;; Author: Yuchen Pei <id@ypei.org> +;; Package-Requires: ((emacs "29.4")) + +;; This file is part of dotted. + +;; dotted is free software: you can redistribute it and/or modify it under +;; the terms of the GNU Affero General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; dotted is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General +;; Public License for more details. + +;; You should have received a copy of the GNU Affero General Public +;; License along with dotted.  If not, see <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; Reading related customisation. + +;;; Code: + +(my-package belf +  (my-setq-from-local belf-dir belf-locate-dirs) +  (add-hook 'find-file-hook 'belf-recent-add-current) +  (blink-cursor-mode 0)) + +(provide 'ycp-reading) diff --git a/emacs/.emacs.d/init/ycp-theme.el b/emacs/.emacs.d/init/ycp-theme.el index ee76311..c6721ed 100644 --- a/emacs/.emacs.d/init/ycp-theme.el +++ b/emacs/.emacs.d/init/ycp-theme.el @@ -41,6 +41,7 @@                      'normal :weight 'normal :height 150 :width 'normal)  (set-face-attribute 'fixed-pitch nil :family "Ubuntu Mono" :foundry "DAMA"                      :slant 'normal :weight 'normal :height 150 :width 'normal) +(set-face-attribute 'variable-pitch nil :family "Ubuntu" :foundry "DAMA")  (provide 'ycp-theme)  ;;; ycp-theme.el ends here diff --git a/emacs/.emacs.d/init/ycp-time.el b/emacs/.emacs.d/init/ycp-time.el index f98a9cd..f21061c 100644 --- a/emacs/.emacs.d/init/ycp-time.el +++ b/emacs/.emacs.d/init/ycp-time.el @@ -83,7 +83,7 @@  	        (holiday-fixed 1 26 "Australia Day (Vic holiday)")  	        (holiday-float 3 1 2 "Labour Day (Vic holiday)")  	        (holiday-fixed 4 25 "Anzac Day (Vic holiday)") -	        (holiday-float 6 1 2 "Monarch's Birthday (Vic oliday)") +	        (holiday-float 6 1 2 "Monarch's Birthday (Vic holiday)")  	        (holiday-fixed 6 30 "End of financial year")  	        (holiday-float 9 5 -1 "(Possibly) Friday before the AFL Grand Final (Vic holiday)")  	        (holiday-float 10 5 1 "(Possibly) Friday before the AFL Grand Final (Vic holiday)") @@ -123,7 +123,7 @@    (setq appt-display-interval 5)    ;; dbus notification of appt    (require 'my-time) -  (setq appt-disp-window-function #'my-app-display-window) +  (setq appt-disp-window-function #'my-appt-display-window)    ;; with org-agenda-to-appt    (require 'org-clock)    (require 'my-utils) diff --git a/emacs/.emacs.d/init/ycp-web.el b/emacs/.emacs.d/init/ycp-web.el index d188afd..fd16b10 100644 --- a/emacs/.emacs.d/init/ycp-web.el +++ b/emacs/.emacs.d/init/ycp-web.el @@ -34,6 +34,8 @@  (ignore-errors (cancel-timer url-cookie-timer))  (setq shr-cookie-policy nil) +(setq browse-url-handlers +      '((stringp . browse-url-firefox)))  (my-package luwak    (:delay 10) @@ -184,7 +186,13 @@    (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) +  (my-setq-from-local my-hnreader-save-dir) +  (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 +211,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) @@ -212,7 +221,16 @@    (add-hook 'org-jira-mode-hook              (lambda () (setq show-trailing-whitespace nil)))    (add-hook 'org-jira-mode-hook -            'turn-off-auto-fill)  ) +            '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) @@ -235,6 +253,7 @@  (my-package my-web    (:delay 60) +  (my-setq-from-local my-webpage-incoming-dir)    (my-keybind eww-mode-map      "N" #'my-eww-next-path      "P" #'my-eww-prev-path @@ -242,9 +261,37 @@      "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-setq-from-local my-tor-browser-bin) +  (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 _) (my-fetch-browse-as-googlebot url)))) +  (my-setq-from-local my-firefox-profile-dir)) + +(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-github +  (:delay 60) +  (add-to-list 'browse-url-handlers +               `(my-github-project-url-p +                 . ,(lambda (url &rest _) (my-github-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)) @@ -277,18 +324,29 @@  ;; 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 +;; mastodon.el +(add-to-list 'load-path (locate-user-emacs-file "lisp/mastodon.el/lisp"))  (my-package mastodon -  (:install t)    (my-setq-from-local mastodon-active-user mastodon-instance-url)    ;; auto fill is a bit glitchy when composing a toot    (add-hook 'mastodon-toot-mode-hook (lambda () (turn-off-auto-fill)))    (mastodon)) -(my-package mastorg -  (:delay 60)) +(my-package fediorg +  (:delay 60) +  (my-setq-from-local fediorg-dir) +  (require 'my-web) +  (add-to-list 'browse-url-handlers +               `(fediorg-post-url-p +                 . ,(lambda (url &rest _) (fediorg-open url)))) +  )  (add-to-list 'load-path (locate-user-emacs-file "lisp/servall/lisp"))  (my-package servall-wikipedia @@ -303,9 +361,11 @@    (:delay 60)    (require 'my-utils)    (my-setq-from-local my-libgen-hosts my-libgen-alt-hosts -                      my-libgen-library-hosts +                      my-libgen-library-hosts my-libgen-onion-host +                      my-libgen-plus-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 @@ -325,4 +385,32 @@      )    (require 'w3m-load)) +(my-package exitter +  (:delay 60) +  (my-setq-from-local +   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) +  (my-setq-from-local exitter-dir) +  (setq exitter-debug nil) +  (add-to-list 'browse-url-handlers +               `(exitter-post-url-p +                 . ,(lambda (url arg) (exitter-open-post url arg)))) + +  ) + +(my-package reddio +  (:delay 60) +  (my-setq-from-local reddio-dir) +  (add-to-list 'browse-url-handlers +               `(reddio-reddit-url-p +                 . ,(lambda (url &rest _) (reddio-open-url url)))) +  ) + +(my-package ttrss +  (:delay 60) +  (my-setq-from-local ttrss-address ttrss-user ttrss-password) +  (require 'my-ttrss) +  (my-setq-from-local my-ttrss-dir)) +  (provide 'ycp-web) | 
