;;; ycp-web.el -- My config for web related -*- lexical-binding: t -*- ;; Copyright (C) 2023 Free Software Foundation. ;; Author: Yuchen Pei ;; Package-Requires: ((emacs "28.2")) ;; This file is part of dotfiles. ;; dotfiles 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. ;; dotfiles 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 dotfiles. If not, see . ;;; Commentary: ;; My config for web related. Covers cookies, web browsing, clients to ;; web services like osm and openlibrary ;;; Code: ;; disable cookies (setq url-cookie-untrusted-urls ".*") (ignore-errors (cancel-timer url-cookie-timer)) (setq shr-cookie-policy nil) (my-package luwak (:delay 10) (:install t) (require 'luwak-org) (require 'my-utils) (setq luwak-url-rewrite-function 'my-rewrite-url) (setq luwak-tor-switch nil) ) ;;; openlibrary (my-package my-openlibrary (:delay 15)) (my-package osm (:install t) (:delay 30) (require 'my-osm) (my-keybind osm-mode-map "C-" nil "C-" nil "C-" nil "C-" nil "c" #'my-osm-show-center) (require 'osm-ol) ) (my-package hnreader (:delay 30) (require 'my-hnreader) (my-override hnreader--print-frontpage) (my-override hnreader--print-frontpage-item) (my-override hnreader--print-comments) (my-override hnreader--get-title)) (add-to-list 'load-path (locate-user-emacs-file "lisp/lem.el/lisp")) (my-package lem-org (:delay 30)) (my-package buildbot (:delay 30) (setq buildbot-default-host "https://buildbot.mariadb.org") (setq buildbot-api-changes-direct-filter t) ) (my-package org-jira (:delay 30) (my-setq-from-local jiralib-url org-jira-priority-to-org-priority-alist org-jira-jira-status-to-org-keyword-alist org-jira-project-filename-alist org-jira-custom-jqls) (require 'my-org-jira) (my-override org-jira--render-issue) (my-override org-jira-update-worklogs-from-org-clocks) (my-keybind org-jira-entry-mode-map "C-c ig" 'org-jira-get-issue) ;; `org-jira-mode' displays many whitespace-only lines in comments ;; it pulls. (add-hook 'org-jira-mode-hook (lambda () (setq show-trailing-whitespace nil))) ) (my-package eww (:delay 60) (advice-add 'eww-browse-url :filter-args #'my-rewrite-url-advice) (advice-add 'eww :filter-args #'my-rewrite-url-advice) (setq eww-restore-desktop t) (require 'my-utils) (setq eww-download-directory my-incoming-dir) (setq eww-bookmarks-directory (locate-user-emacs-file "eww-bookmarks")) (setq eww-history-limit 150) (setq eww-use-external-browser-for-content-type "\\`\\(video/\\|audio\\)") ; On GNU/Linux check your mimeapps.list (setq eww-browse-url-new-window-is-tab nil) (my-keybind eww-link-keymap "v" nil) ; stop overriding `eww-view-source' (my-keybind eww-mode-map "L" #'eww-list-bookmarks) (my-keybind eww-bookmark-mode-map "d" #'eww-bookmark-kill) ) (my-package my-web (:delay 60) (my-keybind eww-mode-map "N" #'my-eww-next-path "P" #'my-eww-prev-path "U" #'my-eww-up-path "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-package my-semantic-scholar (:delay 60)) (my-package rt-liberation (:delay 60) (:install t) (my-setq-from-local rt-liber-username rt-liber-rest-url rt-liber-base-url) (require 'my-rtliber) (my-override rt-liber-viewer-visit-in-browser) ) (my-package rt-liberation-org (:delay 60)) (my-package rt-liberation-gnus (:delay 60) (my-setq-from-local rt-liber-gnus-address rt-liber-gnus-comment-address rt-liber-gnus-subject-name) (require 'my-rtliber) (my-keybind global-map "C-c t m" #'my-rt-liber-my-open-tickets "C-c t M" #'my-rt-liber-my-tickets "C-c t b" #'my-rt-liber-backlog "C-c t i" #'my-rt-liber-get-ticket-by-id "C-c t q" #'my-rt-liber-query-by-subject) ) ;; sx: a stack exchange client (my-package sx (:delay 60) (require 'sx-load)) ;; mastodon (add-to-list 'load-path (locate-user-emacs-file "lisp/mastodon.el/lisp")) (my-package mastodon (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)) (add-to-list 'load-path (locate-user-emacs-file "lisp/servall/lisp")) (my-package servall-wikipedia (:delay 60) (require 'servall-ytdl) (my-setq-from-local servall-endpoint) (require 'my-servall) (my-keybind servall-wikipedia-view-mode-map "C-'" 'my-servall-wikipedia-grok) ) (my-package my-libgen (:delay 60) (require 'my-utils) (my-setq-from-local my-libgen-hosts my-libgen-alt-hosts my-libgen-library-hosts ) (setq my-libgen-download-dir my-document-incoming-dir) (my-libgen-set-random-hosts)) (my-package my-scihub (:delay 60) (my-setq-from-local my-scihub-host)) (my-package w3m (:delay 60) (my-keybind w3m-mode-map "o" #'w3m-browse-url "n" #'scroll-up-line "p" #'scroll-down-line "w" #'w3m-print-this-url "l" #'w3m-view-previous-page "r" #'w3m-view-next-page "g" #'w3m-reload-this-page ) (require 'w3m-load)) (provide 'ycp-web)