From: Eshel Yaron Date: Sat, 9 Apr 2022 08:32:21 +0000 (+0300) Subject: Integrate Gnus and the calendar X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2100153868578e2e54c83b3f03e3ad792304b930;p=dotfiles.git Integrate Gnus and the calendar --- diff --git a/.emacs.d/checkouts/flymake-swi-prolog b/.emacs.d/checkouts/flymake-swi-prolog deleted file mode 160000 index 9407a57..0000000 --- a/.emacs.d/checkouts/flymake-swi-prolog +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9407a57779933c4745fbace18a64be12a120a547 diff --git a/.emacs.d/etc/custom.el b/.emacs.d/etc/custom.el index 24535b5..649e2a7 100644 --- a/.emacs.d/etc/custom.el +++ b/.emacs.d/etc/custom.el @@ -9,6 +9,7 @@ '(dap-print-io t) '(dap-ui-repl-prompt "?- ") '(enable-recursive-minibuffers t) + '(eww-auto-rename-buffer 'title) '(flymake-proc-allowed-file-name-masks '(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-proc-simple-make-init nil flymake-proc-real-file-name-considering-includes) ("\\.xml\\'" flymake-proc-xml-init nil nil) @@ -20,15 +21,35 @@ ("[0-9]+\\.tex\\'" flymake-proc-master-tex-init flymake-proc-master-cleanup nil) ("\\.tex\\'" flymake-proc-simple-tex-init nil nil) ("\\.idl\\'" flymake-proc-simple-make-init nil nil))) + '(manual-program "gman") '(max-specpdl-size 10000) '(mct-apply-completion-stripes t) '(mct-hide-completion-mode-line t) '(mct-live-update-delay 0.6) + '(mm-text-html-renderer 'shr) '(org-agenda-files '("~/inbox.org")) '(org-agenda-start-on-weekday 0) '(org-default-notes-file "~/inbox.org") + '(org-modules + '(ol-bbdb ol-bibtex ol-docview ol-doi ol-eww ol-gnus org-habit ol-info ol-irc ol-mhe ol-rmail ol-w3m)) + '(org-src-lang-modes + '(("C" . c) + ("C++" . c++) + ("asymptote" . asy) + ("bash" . sh) + ("beamer" . latex) + ("calc" . fundamental) + ("cpp" . c++) + ("ditaa" . artist) + ("dot" . fundamental) + ("elisp" . emacs-lisp) + ("ocaml" . tuareg) + ("screen" . shell-script) + ("shell" . sh) + ("sqlite" . sql))) + '(osm-home '(32.08 34.78 15)) '(package-selected-packages - '(cov cape corfu speed-type json-mode json-navigator flymake-swi-prolog package-lint package-lint-flymake all-the-icons-completion mct dap-ui auto-package-update zenburn-theme yasnippet-snippets yaml-mode yagist windswap whole-line-or-region whitespace-cleanup-mode which-key w3m vterm vlf vertico use-package unfill tramp terraform-mode terraform-doc symbol-overlay switch-window smartparens sketch-mode semi rustic rg reformatter rainbow-delimiters protobuf-mode proof-general pdf-tools page-break-lines org-superstar orderless ob-prolog ns-auto-titlebar no-littering multiple-cursors move-dup mode-line-bell markdown-toc markdown-changelog marginalia magit-todos lsp-ui lsp-java lsp-haskell lorem-ipsum list-unicode-display keyfreq keycast iedit idris-mode ibuffer-vc ibuffer-projectile ialign htmlize highlight-escape-sequences helpful graphviz-dot-mode go-mode gnu-elpa-keyring-update gitignore-mode github-review github-clone gitconfig-mode git-timemachine git-blamed ggtags fullframe forge flycheck-golangci-lint expand-region exec-path-from-shell esup erlang epresent embark-consult emacsql-sqlite3 elixir-mode ediprolog dtache dockerfile-mode disable-mouse diminish diff-hl define-word default-text-scale consult-flycheck company-quickhelp company-coq company-auctex command-log-mode bug-reference-github browse-kill-ring browse-at-remote beacon auctex-latexmk anzu all-the-icons alert affe ace-jump-mode academic-phrases)) + '(bnf-mode olivetti logos osm cov cape corfu speed-type json-mode json-navigator flymake-swi-prolog package-lint package-lint-flymake all-the-icons-completion mct dap-ui auto-package-update zenburn-theme yasnippet-snippets yaml-mode yagist windswap whole-line-or-region whitespace-cleanup-mode which-key w3m vterm vlf vertico use-package unfill tramp terraform-mode terraform-doc symbol-overlay switch-window smartparens sketch-mode semi rustic rg reformatter rainbow-delimiters protobuf-mode proof-general pdf-tools page-break-lines org-superstar orderless ob-prolog ns-auto-titlebar no-littering multiple-cursors move-dup mode-line-bell markdown-toc markdown-changelog marginalia magit-todos lsp-ui lsp-java lsp-haskell lorem-ipsum list-unicode-display keyfreq keycast iedit idris-mode ibuffer-vc ibuffer-projectile ialign htmlize highlight-escape-sequences helpful graphviz-dot-mode go-mode gnu-elpa-keyring-update gitignore-mode github-review github-clone gitconfig-mode git-timemachine git-blamed ggtags fullframe forge flycheck-golangci-lint expand-region exec-path-from-shell esup erlang epresent embark-consult emacsql-sqlite3 elixir-mode ediprolog dtache dockerfile-mode disable-mouse diminish diff-hl define-word default-text-scale consult-flycheck company-quickhelp company-coq company-auctex command-log-mode bug-reference-github browse-kill-ring browse-at-remote beacon auctex-latexmk anzu all-the-icons alert affe ace-jump-mode academic-phrases)) '(savehist-additional-variables '(esy/org-capture-to-project-heading-history-list)) '(send-mail-function 'smtpmail-send-it) '(speed-type-max-chars 1024) diff --git a/.emacs.d/etc/gnus/init.el b/.emacs.d/etc/gnus/init.el index 4aaaaf9..26489aa 100644 --- a/.emacs.d/etc/gnus/init.el +++ b/.emacs.d/etc/gnus/init.el @@ -10,3 +10,19 @@ (setq smtpmail-smtp-server "smtp.gmail.com" smtpmail-smtp-service 587 gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]") + +(setq gnus-article-treat-types + (list "text/plain" + "text/x-verbatim" + "text/x-patch" + "text/html" + "text/calendar")) + +(add-hook 'gnus-group-mode-hook 'gnus-topic-mode) + +(require 'gnus-icalendar) +(gnus-icalendar-setup) + +(setq gnus-icalendar-org-capture-file "~/inbox.org") +(setq gnus-icalendar-org-capture-headline '("Calendar")) +(gnus-icalendar-org-setup) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index b62e6ef..8059503 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -4,8 +4,7 @@ ;;; Code: ;; Produce backtraces when errors occur: can be helpful to diagnose startup issues -;;(setq debug-on-error t) - +;; (setq debug-on-error t) (let ((normal-gc-cons-threshold (* 20 1024 1024)) (init-gc-cons-threshold (* 128 1024 1024))) @@ -27,10 +26,15 @@ (require 'use-package) +(setq native-comp-async-report-warnings-errors 'silent) + (setq use-package-always-ensure t) (setq-default indent-tabs-mode nil) +(load-theme 'modus-vivendi) +(modus-themes-load-vivendi) + (use-package auto-package-update :custom (auto-package-update-interval 7) @@ -53,8 +57,6 @@ (convert-standard-filename (expand-file-name "var/eln-cache/" user-emacs-directory)))) -(load-theme 'modus-vivendi) -(modus-themes-load-vivendi) (add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory)) @@ -71,6 +73,7 @@ (setq use-dialog-box nil) (setq inhibit-startup-screen t) + (menu-bar-mode -1) (tool-bar-mode -1) (set-scroll-bar-mode nil) @@ -125,7 +128,15 @@ (require 'forge) (require 'pdf-tools) -(add-hook 'pdf-view-mode-hook 'pdf-tools-install) +(require 'pdf-view) + +(defun esy/pdf-tools-install () + "Install PDF-Tools without prompting." + (pdf-tools-install t)) + +(esy/pdf-tools-install) + +(add-hook 'pdf-view-mode-hook #'pdf-view-midnight-minor-mode) (require 'ialign) @@ -308,6 +319,20 @@ Root Directory defined by 'esy/projects-root-path'." :CapturedAs: New Project :SCM: file:%(esy/read-project-directory) :END: +" + :prepend t + :empty-lines 1 + :immediate-finish t) + ("c" "New Calendar Event" entry + (file+headline esy/inbox-path "Calendar") + "** %^{Title} %^g +:PROPERTIES: +:CreatedAt: %t +:CapturedAt: %a +:CapturedAs: Calendar Event +:END: +%(format-time-string \"<%Y-%m-%d %H:%M\" (org-read-date t t))-%(format-time-string \"%H:%M>\" (org-read-date t t)) +%i " :prepend t :empty-lines 1 @@ -355,6 +380,7 @@ Root Directory defined by 'esy/projects-root-path'." '(("P" (list project-current)))) (setq org-log-into-drawer t) +(setq org-log-done 'time) (setq org-todo-keywords '((sequence "TODO(t)" "BLOCKED(b@/!)" "INPROGRESS(i!)" "|" "DONE(d!)" "CANCELED(c@)"))) @@ -366,17 +392,37 @@ Root Directory defined by 'esy/projects-root-path'." (setq org-babel-load-languages '((emacs-lisp . t) (shell . t) - (prolog . t))) + (bnf . t) + (prolog . t))) (setq org-confirm-babel-evaluate nil) (global-set-key (kbd "C-c c") 'org-capture) (global-set-key (kbd "C-c a") 'org-agenda) +(require 'calendar) +(setq calendar-date-style 'iso) + +(require 'icalendar) + +(require 'ox-icalendar) +(setq org-icalendar-combined-agenda-file (locate-user-emacs-file "var/icalendar.ics")) + +(add-to-list 'Info-default-directory-list (locate-user-emacs-file "info/")) +;; (defun esy/diary-icalendar-sync () +;; "Sync the Emacs Diary with the Org exported ICalendar." +;; (interactive) +;; (org-icalendar-combine-agenda-files t) +;; (delete-file diary-file) +;; (with-current-buffer (find-file org-icalendar-combined-agenda-file) +;; (icalendar-import-buffer diary-file t) +;; (kill-buffer))) (use-package org-superstar) (add-hook 'org-mode-hook #'org-superstar-mode) +(setq org-ellipsis "…") + (use-package embark :bind (("C-." . embark-act)) @@ -428,17 +474,53 @@ Root Directory defined by 'esy/projects-root-path'." (add-hook 'prolog-mode-hook #'flymake-swi-prolog-setup-backend) (add-to-list 'auto-mode-alist '("\\.json\\'" . json-mode)) +(defun esy/kill-dwim () + "When region is active, kill region, otherwise kill last word. +Arguments BEG and END are the borders of the region." + (interactive) + (if (region-active-p) + (let ((beg (region-beginning)) + (end (region-end))) + (kill-region beg end)) + (let ((end (point))) + (backward-word) + (kill-region (point) end)))) + -(global-set-key [remap transpose-chars] #'backward-kill-word) +(global-set-key [remap kill-region] #'esy/kill-dwim) (minibuffer-depth-indicate-mode) +(setq display-time-mail-function + (lambda () + nil)) + (display-time-mode) + +;; (require 'typing) + (require 'eww) (setq eww-auto-rename-buffer 'title) +(setq browse-url-browser-function #'eww-browse-url) + +(require 'shr) +(setq shr-use-colors nil) + +(pixel-scroll-precision-mode) + +(require 'avy) + +(global-set-key (kbd "C-:") 'avy-goto-char) +(global-set-key (kbd "C-'") 'avy-goto-char-timer) + +(require 'osm) +(require 'osm-ol) + +(require 'bookmark) +(setq bookmark-save-flag 1) ;; (require 'cov) ;; (defun cov--swiplcov-parse (&optional buffer) @@ -460,5 +542,41 @@ Root Directory defined by 'esy/projects-root-path'." ;; (and (file-exists-p try) ;; (cons (file-truename try) 'swiplcov)))))) +(setq gnus-inhibit-startup-message t) + +(add-hook 'after-init-hook + (lambda () + (org-agenda-list 1) + (delete-other-windows) + (toggle-frame-fullscreen))) + +(require 'page-break-lines) +(global-page-break-lines-mode) + +(require 'olivetti) +(require 'logos) + +(setq-default logos-hide-mode-line t + logos-scroll-lock t + logos-variable-pitch t + logos-indicate-buffer-boundaries t + logos-buffer-read-only t + logos-olivetti t) + + +(let ((map global-map)) + (define-key map [remap narrow-to-region] #'logos-narrow-dwim) + (define-key map [remap forward-page] #'logos-forward-page-dwim) + (define-key map [remap backward-page] #'logos-backward-page-dwim)) + +(define-key narrow-map (kbd "f") #'logos-focus-mode) + +(put 'narrow-to-region 'disabled nil) +(put 'suspend-frame 'disabled t) + +(define-key global-map [remap suspend-frame] #'zap-up-to-char) + +(use-package bnf-mode) + (provide 'init) ;;; init.el ends here diff --git a/.gitmodules b/.gitmodules index 94d18c9..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule ".emacs.d/checkouts/flymake-swi-prolog"] - path = .emacs.d/checkouts/flymake-swi-prolog - url = https://git.sr.ht/~eshel/flymake-swi-prolog