summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Szarmanski2023-05-02 00:49:52 +0200
committerPiotr Szarmanski2023-05-02 00:49:52 +0200
commiteda34087b1d78d9dc2c561780234db9f3e1bbb87 (patch)
treef918a1b815f6f1641132a7c168d1d75a69ff5664
parent8ee57ceceef058d89f6e44a0f5fdbb99e676f262 (diff)
elfeed
-rw-r--r--config.org299
-rw-r--r--emacs-manifest.scm27
-rw-r--r--init.el8
3 files changed, 269 insertions, 65 deletions
diff --git a/config.org b/config.org
index 1b6debc..50e6063 100644
--- a/config.org
+++ b/config.org
@@ -221,8 +221,14 @@ rather than globally
#+END_SRC
** Set browser to link-handler
#+begin_src emacs-lisp
-(setq browse-url-browser-function 'browse-url-generic
- browse-url-generic-program "link-handler.scm")
+
+
+ (setq browse-url-browser-function 'browse-url-generic
+ browse-url-generic-program "chromium")
+
+ (setq browse-url-handlers
+ `(("youtube.com" . (lambda (url &rest args) (start-process "mpv-p" nil "mpv" url)))
+ ("wikipedia.org" . (lambda (url &rest args) (eww url)))))
#+end_src
** Set so-long mode and line settings for improved performance in long line files
#+begin_src emacs-lisp
@@ -464,12 +470,18 @@ without sensible and well-defined org-mode defaults
** Package
#+BEGIN_SRC emacs-lisp
+ (use-package flyspell
+ :demand t
+ :config
+ (setq flyspell-issue-message-flag nil))
+
(use-package org
:demand t
:config
(setq org-directory my-org-directory)
(add-hook 'org-mode-hook 'org-indent-mode)
(add-hook 'org-mode-hook #'auto-fill-mode)
+ (add-hook 'org-mode-hook #'flyspell-mode)
(add-hook 'org-mode-hook
'(lambda ()
(visual-line-mode 1)
@@ -477,6 +489,9 @@ without sensible and well-defined org-mode defaults
(org-display-inline-images))))
(use-package org-indent)
+
+ (use-package ox-rss
+ :demand t)
#+END_SRC
** Org-agenda
#+begin_src emacs-lisp
@@ -507,15 +522,14 @@ be refiled into a different tree. Really useful for TODOs.
"Praca do wykonania")
"* TODO %?\nDEADLINE: %^t\n"
:refile-targets `(((,(concat org-directory "agenda/mimuw.org")) . (:tag . "cat"))))
-
+
("l" "Link" item (file+headline ,(concat org-directory "links.org") "Links")
"+ %(call-interactively #'webarch-capture) :: %?"
:refile-targets `(((,(concat org-directory "links.org")) . (:level . 1))))
("L" "Link (not archived)" item (file+headline ,(concat org-directory "links.org") "Links")
"+ %^{Link} :: %?"
:refile-targets `(((,(concat org-directory "links.org")) . (:level . 1))))
- ("b" "Blog" entry (file+headline ,(concat org-directory "links.org") "Blogs")
- "* %?\n:PROPERTIES:\n:rss: %^{RSS URL}\n:END:\n")
+ ("j" "Journal" entry (file+olp+datetree "~/org/journal.org.gpg"))
("c" "Note" entry (file org-default-notes-file))))
(global-set-key (kbd "C-c c") #'org-capture)
@@ -527,63 +541,139 @@ Set up org exports.
(setq org-agenda-files (list "~/org/agenda/"))
(setq org-startup-with-inline-images t)
(setq org-html-validation-link nil)
+
+ (setq yk/org-website "~/org/website/")
+#+end_src
+** Org-RSS setup
+Based on the setup described [[https://writepermission.com/org-blogging-rss-feed.html][in this post.]]
+
+#+begin_src emacs-lisp
+ (defun rw/format-rss-feed (title list)
+ "Generate RSS feed, as a string.
+ TITLE is the title of the RSS feed. LIST is an internal
+ representation for the files to include, as returned by
+ `org-list-to-lisp'. PROJECT is the current project."
+ (concat "#+TITLE: " title "\n\n"
+ (org-list-to-subtree list 1 '(:icount "" :istart ""))))
+
+ (defun rw/org-rss-publish-to-rss (plist filename pub-dir)
+ "Publish RSS with PLIST, only when FILENAME is 'rss.org'.
+ PUB-DIR is when the output will be placed."
+ (if (equal "rss.org" (file-name-nondirectory filename))
+ (org-rss-publish-to-rss plist filename pub-dir)))
+
+ (defun rw/format-rss-feed-entry (entry style project)
+ "Format ENTRY for the RSS feed.
+ ENTRY is a file name. STYLE is either 'list' or 'tree'.
+ PROJECT is the current project."
+ (cond ((not (directory-name-p entry))
+ (let* ((file (org-publish--expand-file-name entry project))
+ (title (org-publish-find-title entry project))
+ (date (format-time-string "%Y-%m-%d" (org-publish-find-date entry project)))
+ (link (concat (file-name-sans-extension entry) ".html")))
+ (with-temp-buffer
+ (insert (format "* %s\n" title))
+ (org-set-property "RSS_PERMALINK" link)
+ (org-set-property "PUBDATE" date)
+ (buffer-string))))
+ ((eq style 'tree)
+ ;; Return only last subdir.
+ (file-name-nondirectory (directory-file-name entry)))
+ (t entry)))
+
+
+
#+end_src
** Org-publish
#+begin_src emacs-lisp
- (require 'ox-publish)
- (setq org-export-with-statistics-cookies nil
- org-html-head-include-default-style t)
+ (require 'ox-publish)
- (setq org-export-with-toc 2
- org-export-with-date nil
- org-export-with-author nil
- org-export-with-creator nil)
+ (setq org-export-with-statistics-cookies nil
+ org-html-head-include-default-style t)
- (setq http-dir
- "/ssh:root@ykonai.net:/srv/http/ykonai/")
+ (setq org-export-with-toc 2
+ org-export-with-date t
+ org-export-with-author nil
+ org-export-with-creator nil)
- (defun yk/org-sitemap (title list)
- (concat "#+TITLE: " title "\n\n"
- "Mail: mail [AT] ykonai [DOT] net
+ (setq http-dir "/ssh:root@ykonai.net:/srv/http/ykonai/")
- Public key: [[https://ykonai.net/key.asc][[11B2 E4AF 4833 D7A5 BEAF 3566 CC6D 0555 B66F 03AC]​]]
+ (defun yk/org-sitemap (title list)
+ (concat "#+TITLE: " title "\n\n"
+ "Mail: mail [AT] ykonai [DOT] net
- [[https://git.ykonai.net][Some projects]]\n"
- (org-list-to-org list)))
+ Public key: [[https://ykonai.net/key.asc][[11B2 E4AF 4833 D7A5 BEAF 3566 CC6D 0555 B66F 03AC]​]]
+
+ [[https://git.ykonai.net][Some projects]]
+
+ [[./blogs.html][Blog list]]\n\n"
+ (org-list-to-org list)))
+
+ (setq yk/rss-alist (list "blog-rss"
+ :base-directory "~/org/website"
+ :base-extension "org"
+ :recursive nil
+ :exclude (regexp-opt '("rss.org" "index.org"))
+ :publishing-function 'rw/org-rss-publish-to-rss
+ :publishing-directory http-dir
+ :rss-extension "xml"
+ :html-link-home "https://ykonai.net"
+ :html-link-use-abs-url t
+ :html-link-org-files-as-html t
+
+ :with-author "ykonai"
+ :with-email nil
+ :auto-sitemap t
+ :sitemap-filename "rss.org"
+ :sitemap-title "Ykonai RSS"
+ :sitemap-style 'tree
+ :sitemap-sort-files 'anti-chronologically
+ :sitemap-function 'rw/format-rss-feed
+ :sitemap-format-entry 'rw/format-rss-feed-entry))
(setq org-publish-project-alist
`(("er"
- :base-directory "~/org/fun/er"
- :publishing-directory ,(concat http-dir "er/")
- :auto-sitemap t
-
- :sitemap-style tree
- :sitemap-filename "index.org"
- :sitemap-sort-files anti-chronologically
- :sitemap-title "Index"
-
- :html-postamble nil
- :html-head "<link rel=\"stylesheet\" href=\"../style.css\">")
- ("css"
- :base-directory "~/org/website"
- :base-extension "css"
- :publishing-function org-publish-attachment
- :publishing-directory ,http-dir)
- ("blog"
- :base-directory "~/org/website/"
- :base-extension "org"
- :publishing-directory ,http-dir
- :auto-sitemap t
-
- :sitemap-style tree
- :sitemap-filename "index.org"
- :sitemap-sort-files anti-chronologically
- :sitemap-title "Index"
- :sitemap-function yk/org-sitemap
-
- :html-postamble nil
- :html-head "<link rel=\"stylesheet\" href=\"style.css\">")
- ("website" :components ("blog" "css" "er"))))
+ :base-directory "~/org/fun/er"
+ :publishing-directory ,(concat http-dir "er/")
+ :auto-sitemap t
+
+ :sitemap-style tree
+ :sitemap-filename "index.org"
+ :sitemap-sort-files anti-chronologically
+ :sitemap-title "Index"
+
+ :html-postamble nil
+ :html-head "<link rel=\"stylesheet\" href=\"../style.css\">")
+ ("css"
+ :base-directory "~/org/website"
+ :base-extension "css"
+ :publishing-function org-publish-attachment
+ :publishing-directory ,http-dir)
+ ("const"
+ :base-directory "~/org/website/const/"
+ :base-extension "org"
+ :publishing-directory ,http-dir
+
+ :html-postamble nil
+ :html-head "<link rel=\"stylesheet\" href=\"style.css\">")
+ ("blog"
+ :base-directory "~/org/website/"
+ :base-extension "org"
+ :publishing-directory ,http-dir
+ :auto-sitemap t
+ :exclude "rss.org"
+
+ :sitemap-style tree
+ :sitemap-filename "index.org"
+ :sitemap-sort-files anti-chronologically
+ :sitemap-title "Index"
+ :sitemap-function yk/org-sitemap
+ :sitemap-file-entry-format "%t -- %d"
+
+ :html-postamble nil
+ :html-head "<link rel=\"stylesheet\" href=\"style.css\">")
+ ,yk/rss-alist
+ ("website" :components ("blog" "css" "const" "er" "blog-rss"))))
#+end_src
** Org-babel
Literate programming settings.
@@ -925,8 +1015,15 @@ This is an OpenStreetMaps interface for Emacs. Just for fun.
(setq sly-lisp-implementations
`((sbcl ("sbcl" "--core" ,(expand-file-name "~/profiles/core")))))
(define-key sly-prefix-map (kbd "M-h") 'sly-describe-symbol)
+ (setq org-babel-lisp-eval-fn sly-eval)
:commands sly)
#+end_src
+** Package =slite=
+*** Code
+#+begin_src emacs-lisp
+ (use-package slite
+ :commands slite-run)
+#+end_src
** Package =geiser=
*** Code
#+begin_src emacs-lisp
@@ -977,10 +1074,9 @@ FIXME, STUB, in source files.
(add-hook 'lisp-mode-hook #'enable-paredit-mode)
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
(add-hook 'scheme-mode-hook #'enable-paredit-mode)
- (add-hook 'sly-mrepl-mode-hook #'enable-paredit-mode)
- ;;(define-key paredit-mode-map (kbd "M-n") #'paredit-forward)
- ;;(define-key paredit-mode-map (kbd "M-p") #'paredit-backward)
- )
+ ;;(add-hook 'sly--mode-hook #'enable-paredit-mode)
+ (define-key paredit-mode-map (kbd "RET") nil)
+ (define-key paredit-mode-map (kbd "C-j") nil))
#+end_src
** Package =webjump-ido=
#+begin_src emacs-lisp
@@ -1043,6 +1139,44 @@ theme seems very pretty on the other hand.
:demand t
:config (ef-themes-select 'ef-autumn))
#+end_src
+** Package =AucTex=
+#+begin_src emacs-lisp
+ (use-package auctex
+ :demand t
+ :config
+ (setq-default TeX-master nil)
+ (setq TeX-parse-self t)
+ (setq TeX-auto-save t))
+#+end_src
+** Package =elfeed=
+*** Description
+The RSS feed reader. I have decided to use it instead of a feed-to-mail bridge
+since it is more contained inside of Emacs.
+*** Code/Feed list
+#+begin_src emacs-lisp
+ (use-package elfeed
+ :config
+ (setq elfeed-feeds
+ '(("http://xahlee.org/wordy/lit/blog.xml" blog lit)
+ ("https://drewdevault.com/blog/index.xml" blog tech)
+ ("https://danluu.com/atom.xml" blog tech)
+ ("https://lars.ingebrigtsen.no/rss" blog tech)
+ ("https://anarc.at/blog/index.rss" blog tech)
+ ("https://nullprogram.com/feed/" blog tech)
+ ("https://blog.cr.yp.to/feed.application=xml" blog tech)
+ ("https://www.schneier.com/feed/atom" blog tech)
+ ("https://nullprogram.com/feed/" blog tech)
+ ;; Entertainment
+ ;; Veritasium
+ ("https://www.youtube.com/feeds/videos.xml?channel_id=UCHnyfMqiRRG1u-2MsSQLbXA" youtube sci)
+ ;; video games
+ ("https://www.youtube.com/feeds/videos.xml?channel_id=UCHSI8erNrN6hs3sUK6oONLA" youtube games)
+ ("https://www.youtube.com/feeds/videos.xml?channel_id=UCKtix2xNNXdcEfEFnoOnvMw" youtube games)
+ ))
+
+ :commands elfeed
+ :bind ("C-x f" . elfeed))
+#+end_src
** Built-in entry: =eldoc=
*** Code
#+BEGIN_SRC emacs-lisp
@@ -1290,8 +1424,8 @@ Remove group listing and add human readable sizes:
Omit dotfiles from the listing (but not the =.= and =..= files).
#+begin_src emacs-lisp
(require 'dired-x)
- (setq dired-omit-files (rx (seq line-start "." (not "."))))
- (add-hook 'dired-mode-hook (lambda () (dired-omit-mode)))
+ ;;(setq dired-omit-files (rx line-start (seq "." (not ".") (* any))))
+ ;;(add-hook 'dired-mode-hook (lambda () (dired-omit-mode)))
(setq dired-omit-verbose nil)
(define-key dired-mode-map (kbd "q")
@@ -1384,6 +1518,57 @@ Insert a simple defpackage form. Prompts for the package name.
> "(:use common-lisp" _ ")"
> "(:export))")
#+end_src
+** LaTeX article
+Basic LaTeX template.
+#+begin_src emacs-lisp
+ (define-skeleton insert/math-article
+ "Insert a simple LaTeX template."
+ "insert title"
+ "\\documentclass{article}" \n
+ "\\usepackage{polski}" \n
+ "\\usepackage{amsmath}" \n
+ "\\usepackage{amsfonts}" \n
+ "\\usepackage{graphics}" \n
+ "\\title{" str "}" \n
+ "\\author{Piotr Szarmański}" \n
+ "\\begin{document}" \n
+ "\\maketitle" \n \n
+ "\\end{document}")
+#+end_src
+** copyright template
+#+begin_src emacs-lisp
+ (define-skeleton insert/copyright-gpl
+ "Insert a GPLv3 copyright header."
+ "Project name: "
+ ";; This file is part of " str "." \n
+ ";; Copyright (C) " (format "%d" (decoded-time-year (decode-time))) " Piotr Szarmański" \n \n
+ ";; " str " is free software: you can redistribute it and/or modify it under the" \n
+ ";; terms of the GNU General Public License as published by the Free" \n
+ ";; Software Foundation, either version 3 of the License, or (at your option) any" \n
+ ";; later version." \n \n
+ ";; " str " is distributed in the hope that it will be useful, but WITHOUT ANY" \n
+ ";; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR" \n
+ ";; A PARTICULAR PURPOSE. See the GNU General Public License for more details." \n
+ \n
+ ";; You should have received a copy of the GNU General Public License along with" \n
+ ";; "str". If not, see <https://www.gnu.org/licenses/>." \n \n)
+
+ (define-skeleton insert/copyright-lgpl
+ "Insert a GPLv3 copyright header."
+ "Project name: "
+ ";; This file is part of " str "." \n
+ ";; Copyright (C) " (format "%d" (decoded-time-year (decode-time))) " Piotr Szarmański" \n \n
+ ";; " str " is free software: you can redistribute it and/or modify it under the" \n
+ ";; terms of the Lesser GNU General Public License as published by the Free" \n
+ ";; Software Foundation, either version 3 of the License, or (at your option) any" \n
+ ";; later version." \n \n
+ ";; " str " is distributed in the hope that it will be useful, but WITHOUT ANY" \n
+ ";; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR" \n
+ ";; A PARTICULAR PURPOSE. See the GNU General Public License for more details." \n
+ \n
+ ";; You should have received a copy of the GNU General Public License along with" \n
+ ";; "str". If not, see <https://www.gnu.org/licenses/>." \n \n)
+#+end_src
** insert-/skeleton [C-c s]
#+begin_src emacs-lisp
(defvar insert-/skeleton-list nil
diff --git a/emacs-manifest.scm b/emacs-manifest.scm
index 7280f45..6e385da 100644
--- a/emacs-manifest.scm
+++ b/emacs-manifest.scm
@@ -7,10 +7,7 @@
(guix transformations)
(guix packages))
-;; (define transform
-;; (options->transformation
-;; '((without-tests . "emacs-shx"))))
-(include "packages.scm")
+(load "../packages/slite.scm")
(define my/geiser-guile
(package
@@ -20,11 +17,22 @@
(define rewrite-with-my-geiser
(package-input-rewriting `((,emacs-geiser-guile . ,my/geiser-guile)) #:deep? #t))
+;; This compiles emacs packages ahead of time.
+(define aot-compile-packages
+ (package-input-rewriting `((,emacs-minimal . ,emacs)) #:deep? #t))
+
+(define without-ess-tests
+ (options->transformation
+ '((without-tests . "emacs-buttercup")
+ (without-tests . "emacs-clojure-mode"))))
+
(define emacs-extensions
- (map (compose rewrite-with-my-geiser)
+ (map (compose rewrite-with-my-geiser aot-compile-packages)
(list emacs
emacs-which-key
emacs-swiper
+ emacs-auctex
+ emacs-ox-rss
emacs-avy
emacs-switch-window
emacs-ido-vertical-mode
@@ -37,16 +45,18 @@
emacs-pinentry
emacs-pass
emacs-osm
-;; emacs-guix ;; broken
+ ;; emacs-guix ;; broken
emacs-sly
+ emacs-slite
my/geiser-guile
- emacs-ess
+
emacs-corfu
emacs-hl-todo
emacs-hyperbole
emacs-use-package
emacs-cider
emacs-paredit
+ emacs-elfeed
emacs-ef-themes)))
@@ -61,5 +71,6 @@
(packages->manifest
(append emacs-extensions
- additional-programs))
+ additional-programs
+ (list emacs-ess)))
diff --git a/init.el b/init.el
index d7171ec..341eac7 100644
--- a/init.el
+++ b/init.el
@@ -41,6 +41,14 @@
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
+ '(TeX-view-program-selection
+ '(((output-dvi has-no-display-manager)
+ "dvi2tty")
+ ((output-dvi style-pstricks)
+ "dvips and gv")
+ (output-dvi "xdvi")
+ (output-pdf "Atril")
+ (output-html "xdg-open")))
'(ansi-color-names-vector
["#262626" "#FF6666" "#A6E22E" "#FFFF66" "#6666FF" "#FD5FF0" "#99CCFF" "#F1EFEE"])
'(custom-safe-themes