diff options
Diffstat (limited to 'emacs')
| -rw-r--r-- | emacs/.emacs.d/init/ycp-emms.el | 3 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-gnus.el | 2 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-markup.el | 9 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-org.el | 3 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-reading.el | 2 | ||||
| -rw-r--r-- | emacs/.emacs.d/init/ycp-web.el | 1 | ||||
| -rw-r--r-- | emacs/.emacs.d/lisp/my/my-libgen.el | 25 | ||||
| -rw-r--r-- | emacs/.emacs.d/lisp/my/my-media-segment.el | 3 | ||||
| -rw-r--r-- | emacs/.emacs.d/lisp/my/my-web.el | 2 | ||||
| -rw-r--r-- | emacs/.emacs.d/lisp/my/my-wget.el | 17 |
10 files changed, 44 insertions, 23 deletions
diff --git a/emacs/.emacs.d/init/ycp-emms.el b/emacs/.emacs.d/init/ycp-emms.el index e49209f..65a121d 100644 --- a/emacs/.emacs.d/init/ycp-emms.el +++ b/emacs/.emacs.d/init/ycp-emms.el @@ -43,6 +43,7 @@ (my-keybind emms-playlist-mode-map "C-x C-f" #'emms-play-playlist) (setq emms-player-list '(emms-player-mpv emms-player-vlc)) (setq emms-player-vlc-parameters '("--intf=qt" "--extraintf=rc")) + (add-to-list 'emms-player-mpv-parameters "--audio-client-name=emms" t) (setq emms-playlist-buffer-name "*EMMS Playlist*") (setq emms-source-file-directory-tree-function 'emms-source-file-directory-tree-find) @@ -50,6 +51,8 @@ (setq emms-info-auto-update nil) (add-hook 'emms-playlist-mode-hook #'hl-line-mode) (add-hook 'emms-metaplaylist-mode-hook #'hl-line-mode) + (setq server-name "emms") + (server-start) ) (my-package my-emms diff --git a/emacs/.emacs.d/init/ycp-gnus.el b/emacs/.emacs.d/init/ycp-gnus.el index 7275363..2a3b64f 100644 --- a/emacs/.emacs.d/init/ycp-gnus.el +++ b/emacs/.emacs.d/init/ycp-gnus.el @@ -230,7 +230,7 @@ (setq bbdb-mail-user-agent 'gnus-user-agent) (setq bbdb-update-records-p 'create) (setq bbdb-message-clean-mail-function 'my-bbdb-clean-mail) - (my-setq-from-local bbdb-message-ignore-mail-re) + (setq bbdb-message-ignore-mail-re "not?[-_]?reply") (setq bbdb-add-name nil) (require 'my-bbdb) (my-keybind bbdb-mode-map "C-c C-c" #'my-bbdb-done) diff --git a/emacs/.emacs.d/init/ycp-markup.el b/emacs/.emacs.d/init/ycp-markup.el index a53d542..093e818 100644 --- a/emacs/.emacs.d/init/ycp-markup.el +++ b/emacs/.emacs.d/init/ycp-markup.el @@ -65,6 +65,7 @@ (my-keybind markdown-mode-map "C-c C-l" 'markdown-insert-link) (setq markdown-hide-urls t) (put 'markdown-translate-filename-function 'safe-local-variable 'functionp) + (add-hook 'markdown-mode-hook 'turn-off-auto-fill) (require 'my-markdown) (my-keybind markdown-mode-map "<ret>" 'my-markdown-maybe-follow-thing-at-point)) @@ -146,10 +147,10 @@ ;;; lilypond (add-to-list 'load-path "/usr/share/emacs/site-lisp") -(autoload 'LilyPond-mode "lilypond-mode" "LilyPond Editing Mode" t) -(add-to-list 'auto-mode-alist '("\\.ly\\'" . LilyPond-mode)) -(add-to-list 'auto-mode-alist '("\\.ily\\'" . LilyPond-mode)) -(add-hook 'LilyPond-mode-hook (lambda () (turn-on-font-lock))) +(autoload 'lilypond-mode "lilypond-mode" "LilyPond Editing Mode" t) +(add-to-list 'auto-mode-alist '("\\.ly\\'" . lilypond-mode)) +(add-to-list 'auto-mode-alist '("\\.ily\\'" . lilypond-mode)) +(add-hook 'lilypond-mode-hook (lambda () (turn-on-font-lock))) (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 140b54d..3774b35 100644 --- a/emacs/.emacs.d/init/ycp-org.el +++ b/emacs/.emacs.d/init/ycp-org.el @@ -30,6 +30,7 @@ ;;; the glorious org mode (my-package org + (calendar-set-date-style 'iso) (my-keybind global-map "M-u" #'org-store-link "C-c a" #'org-agenda @@ -191,7 +192,7 @@ (setq org-agenda-custom-commands `(("A" "Agenda and next" ((agenda "" - ((org-agenda-span 32) + ((org-agenda-span 63) ;; only works when `org-agenda-start-on-weekday' ;; is nil (org-agenda-start-day "-2d"))) diff --git a/emacs/.emacs.d/init/ycp-reading.el b/emacs/.emacs.d/init/ycp-reading.el index 5c0284e..e8575b9 100644 --- a/emacs/.emacs.d/init/ycp-reading.el +++ b/emacs/.emacs.d/init/ycp-reading.el @@ -26,6 +26,8 @@ ;;; Code: +(setq text-scale-mode-step 1.1) + (my-package belf (my-setq-from-local belf-dir belf-locate-dirs) (add-hook 'find-file-hook 'belf-recent-add-current) diff --git a/emacs/.emacs.d/init/ycp-web.el b/emacs/.emacs.d/init/ycp-web.el index 89099d9..407b2f6 100644 --- a/emacs/.emacs.d/init/ycp-web.el +++ b/emacs/.emacs.d/init/ycp-web.el @@ -53,6 +53,7 @@ (my-package osm (:install t) (:delay 30) + (setq osm-server 'de) (require 'my-osm) (my-keybind osm-mode-map "C-<left>" nil diff --git a/emacs/.emacs.d/lisp/my/my-libgen.el b/emacs/.emacs.d/lisp/my/my-libgen.el index a8e7dca..f1c4f7c 100644 --- a/emacs/.emacs.d/lisp/my/my-libgen.el +++ b/emacs/.emacs.d/lisp/my/my-libgen.el @@ -135,14 +135,22 @@ my-libgen-host (alist-get 'coverurl info))))) +(defvar my-libgen-max-filename-length 200) + (defun my-libgen-format-filename (info) - (my-make-doc-file-name (format - "%s - %s (%s) [%s].%s" - (alist-get 'author info) - (alist-get 'title info) - (alist-get 'year info) - (alist-get 'identifier info) - (alist-get 'extension info)))) + (let ((name (format + "%s - %s (%s) [%s]" + (alist-get 'author info) + (alist-get 'title info) + (alist-get 'year info) + (alist-get 'identifier info)))) + (my-make-doc-file-name + (format + "%s.%s" + (if (length> name my-libgen-max-filename-length) + (substring name 0 my-libgen-max-filename-length) + name) + (alist-get 'extension info))))) (defvar my-libgen-download-dir "~/Downloads") @@ -187,7 +195,8 @@ my-libgen-plus-host (dom-attr (dom-search - (my-wget-dom (alist-get 'ads (my-libgen-plus-urls info))) + (my-wget-dom (alist-get 'ads (my-libgen-plus-urls info)) nil + "--referer" my-libgen-plus-host) (lambda (n) (string-match (format "get\\.php\\?md5=%s" .md5) (or (dom-attr n 'href) "")))) diff --git a/emacs/.emacs.d/lisp/my/my-media-segment.el b/emacs/.emacs.d/lisp/my/my-media-segment.el index e8ee5cc..4fca988 100644 --- a/emacs/.emacs.d/lisp/my/my-media-segment.el +++ b/emacs/.emacs.d/lisp/my/my-media-segment.el @@ -110,7 +110,8 @@ Much faster than my-segment-media-file or my-segment-media-file-1." (when end `("-to" ,end)) `("-c" "copy" ,(format - (format "%%s/%%0%dd-%%s.%%s" pad) dir idx title + (format "%%s/%%0%dd-%%s.%%s" pad) dir idx + (substring title 0 (min (length title) 100)) (file-name-extension media-file-name))))) (message "Will cut %s-%s to %s (%d/%d)..." start (or end "") title idx total))) diff --git a/emacs/.emacs.d/lisp/my/my-web.el b/emacs/.emacs.d/lisp/my/my-web.el index 87c319f..7564a71 100644 --- a/emacs/.emacs.d/lisp/my/my-web.el +++ b/emacs/.emacs.d/lisp/my/my-web.el @@ -183,7 +183,7 @@ e.g. https://news.ycombinator.com/item?id=42505454" (browse-url-firefox (url-recreate-url urlobj)))) (defun my-newscorp-au-url-p (url) - (string-match-p "^\\(www\\.\\)?\\(heraldsun\\|theaustralian\\)\\.com\\.au$" + (string-match-p "^\\(www\\.\\)?\\(heraldsun\\|theaustralian\\|weeklytimesnow\\|thechronicle\\|couriermail\\)\\.com\\.au$" (url-host (url-generic-parse-url url)))) (defun my-stack-overflow-url-p (url) diff --git a/emacs/.emacs.d/lisp/my/my-wget.el b/emacs/.emacs.d/lisp/my/my-wget.el index f3f6771..0c3d447 100644 --- a/emacs/.emacs.d/lisp/my/my-wget.el +++ b/emacs/.emacs.d/lisp/my/my-wget.el @@ -86,19 +86,22 @@ no-tor move-if-video-or-large) (setq i (1+ i))))) -(defun my-wget-out-internal (url buffer-processor &optional no-tor) +(defun my-wget-out-internal (url buffer-processor &optional no-tor &rest args) "Run wget on url, dump the results in a temp buffer, then apply BUFFER-PROCESSOR" (with-temp-buffer - (my-call-process-with-torsocks no-tor "wget" nil '(t nil) nil "-O" "-" url) + (apply 'my-call-process-with-torsocks + `(,no-tor "wget" nil (t nil) nil "-O" "-" ,url ,@args)) (call-interactively 'delete-trailing-whitespace) (funcall buffer-processor) )) -(defun my-wget-dom (url &optional no-tor) - (my-wget-out-internal - url - (lambda () (libxml-parse-html-region (point-min) (point-max))) - no-tor)) +(defun my-wget-dom (url &optional no-tor &rest args) + (apply + 'my-wget-out-internal + `(,url + ,(lambda () (libxml-parse-html-region (point-min) (point-max))) + ,no-tor + ,@args))) (defun my-wget-raw (url &optional no-tor) (my-wget-out-internal url 'buffer-string no-tor)) |
