=== Emacs Config Tasks === * Emacs Config Inbox ** Emacs: modern minibuffer packages (Vertico, Consult, etc.) - Emacs - System Crafters [[https://forum.systemcrafters.net/t/emacs-modern-minibuffer-packages-vertico-consult-etc/294][Emacs: modern minibuffer packages (Vertico, Consult, etc.) - Emacs - System Crafters]] Captured On: [2024-04-19 Fri 05:46] ** Using auto-fill-mode vs. visual-line-mode - Emacs - System Crafters [[https://forum.systemcrafters.net/t/using-auto-fill-mode-vs-visual-line-mode/275/3][Using auto-fill-mode vs. visual-line-mode - Emacs - System Crafters]] Captured On: [2024-04-19 Fri 05:46] ** Check which version of the refile advice-add you have #+BEGIN_QUOTE I had this bit of code I got from one of Dave’s streams to save all buffers after refiling so you wouldn’t have to save each buffer by hand. (advice-add 'org-refile :after 'org-save-all-org-buffers) Unfortunately, with org-ql, it gives an error. (It still refiles though). So, I found the solution here: emacs.stackexchange.com Org-mode: Getting errors when auto-saving after refiling 2 org-mode asked by wiuah on 09:50PM - 07 Sep 16 UTC Which is this: (advice-add 'org-refile :after (lambda (&rest _) (org-save-all-org-buffers))) I tested it with org-ql refiling and it does work perfectly. So any of you who were using that previous code and have issues with org-ql refiling, you can replace it with this and it should work. #+END_QUOTE [[https://forum.systemcrafters.net/t/save-all-buffers-on-org-refile/292][Save all buffers on org refile - Emacs - System Crafters]] Captured On: [2024-04-19 Fri 05:45] ** Thread: Close all refile targets in ibuffer after refiling - Emacs - System Crafters #+BEGIN_QUOTE Close all refile targets in ibuffer after refiling Emacs Feb 15 1 / 3 Feb 15 Feb 15 ​ summeremacs 1 Feb 15 Hi everyone Okay, so I have this problem where I always had a few hundred buffers open in ibuffer, and I couldn’t figure out what was doing it - since YEARS. Well, I finally figured it out the other day! Org refiling was the culprit. See, I didn’t know this but whenever you refile, when it says getting all targets, it’s opening them up (at least it did in my ibuffer behind the scenes). To counter this, I asked an AI to help me, and it did. It wrote the code but it couldn’t get the last part right about not opening ibuffer to kill everything. I fixed that up myself. So this is a collaboration between an AI and me, but the code works. The only “issue” now is that if you have a lot of targets, it will take a few seconds each time to do the gathering part. For me, that’s not a big deal, but maybe it is for you. And if you’re on here, there is a high likelihood of you being able to fix it so this becomes even better and faster. So here is my code. Please use it as you want. And if you can make it better, or faster somehow for repeated steps, then let me know (the closing part isn’t an issue - that takes a second on my machine, or less). (Note that the comment says that it’s bound to C-z o r but that isn’t shown in the code. It’s at the bottom of my config in custom key binds). ;; This function uses C-z o r (listed at the end of config) to refile. It opens all the refile targets, and then closes them after refiling, so it keeps ibuffer clean. (defun my/org-refile-and-close-buffers () "Refile using org-refile and close related buffers in ibuffer." (interactive) ;; Get the list of open buffers before the refile (let ((before-buffers (buffer-list)) (org-refile-use-outline-path nil)) ; Disable outline path (call-interactively 'org-refile) ; Call org-refile interactively ;; Get the list of open buffers after the refile (let ((after-buffers (buffer-list))) ;; Close only the buffers opened during the refile (dolist (buffer before-buffers) (setq after-buffers (delete buffer after-buffers))) (mapc 'kill-buffer after-buffers)))) I hope this helps! Now you can keep your ibuffer clean when you refile! #+END_QUOTE [[https://forum.systemcrafters.net/t/close-all-refile-targets-in-ibuffer-after-refiling/280][Close all refile targets in ibuffer after refiling - Emacs - System Crafters]] Captured On: [2024-04-19 Fri 05:40] ** armindarvish/consult-mu: Consult Mu4e asynchronously in GNU Emacs [[https://github.com/armindarvish/consult-mu][armindarvish/consult-mu: Consult Mu4e asynchronously in GNU Emacs]] Captured On: [2024-04-19 Fri 05:33] ** Comment on Why Emacs will NEVER be popular! - Emacs - System Crafters #+BEGIN_QUOTE Emacs has a vibrant and active community that engages its entire member base. Furthermore, new mediums for outreach (such as Systemcrafters) are attracting newer, younger members, so it’s a base that is replenishing. What is the appeal to moving beyond that? Ease-of-use oriented distros could be double-edged. If we have a distro that’s intuitive and easy to use for the causal notepad/word processor user, that’s almost certain to widen the appeal of Emacs, and consequently increase its user-base. On the other hand, these people are going to be coming to Emacs for very different reasons than current Emacs users. Even if at first the new crowd is limited to a distro, if they influence the popularity of Emacs to the degree that it’s noticeable I don’t see how it won’t eventually influence the main editor itself. Outreach, concerted inclusion, and continued appeal to these folks will likely change the future trajectory that the editor takes. I’m not sure that’s a good thing. The things I like about Emacs are all distinctive from the alternatives out there, but I’m not sure those things would matter as much to the new crowd. After all, that’s not why they’re here. I do think distros have their place. Doom and Spacemacs (and Rational? Haven’t tried it in a while) strike a happy medium – they make it appealing to folks who want to give it a go, but they don’t change it to such a degree that those folks who try it and stick around have an alien perspective on what Emacs should be. #+END_QUOTE [[https://forum.systemcrafters.net/t/why-emacs-will-never-be-popular/432/7][Why Emacs will NEVER be popular! - Emacs - System Crafters]] Captured On: [2024-04-19 Fri 05:32] ** alphapapa/listen.el: Audio/music player for Emacs [[https://github.com/alphapapa/listen.el][alphapapa/listen.el: Audio/music player for Emacs]] Captured On: [2024-04-19 Fri 05:28] ** alphapapa's flyspell setup #+BEGIN_QUOTE (use-package flyspell :hook (org-mode . flyspell-mode) :config (define-advice flyspell-goto-next-error (:around (oldfun &optional previous) ap/flyspell-goto-next-error) "Go to next or previous misspelled word, or to previous position. When no misspellings remain, goes to the position before `flyspell-goto-next-error' was called." (cl-labels ((next-error-pos (&optional previous) (save-excursion (pcase (funcall oldfun previous) ("No more miss-spelled words" nil) (_ (point)))))) (if-let ((pos (or (next-error-pos) (next-error-pos 'previous)))) (progn (pcase last-command ((or 'flyspell-auto-correct-word 'flyspell-goto-next-error) nil) (_ (push-mark))) (goto-char pos)) (goto-char (mark-marker)) (pop-mark))))) #+END_QUOTE [[https://forum.systemcrafters.net/t/emacs-config-request-for-feedback/425/4][Emacs config, request for feedback - Emacs - System Crafters]] Captured On: [2024-04-19 Fri 05:23] ** Tips to investigate #+BEGIN_QUOTE For Org, I recommend installing org-ql and using org-ql-find as your primary way to find things in Org files. I recommend using my new activities package. It makes it much easier to switch to and resume tasks that you do repeatedly in Emacs. #+END_QUOTE [[https://forum.systemcrafters.net/t/emacs-config-request-for-feedback/425][Emacs config, request for feedback - Emacs - System Crafters]] Captured On: [2024-04-19 Fri 05:23] ** mhayashi1120/Emacs-wgrep: Writable grep buffer and apply the changes to files [[https://github.com/mhayashi1120/Emacs-wgrep][mhayashi1120/Emacs-wgrep: Writable grep buffer and apply the changes to files]] Captured On: [2024-04-19 Fri 05:08] ** Wilfred/deadgrep: fast, friendly searching with ripgrep and Emacs [[https://github.com/Wilfred/deadgrep][Wilfred/deadgrep: fast, friendly searching with ripgrep and Emacs]] Captured On: [2024-04-19 Fri 05:08] ** check this versus google this #+BEGIN_QUOTE (use-package search-web :general (bmj-leader-keys "sw" '(:ignore t :which-key "web") "sww" '(search-web :which-key "search") "swd" '(search-web-dwim :which-key "dwim") "swr" '(search-web-region :which-key "region"))) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-search.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-search.el - sourcehut git]] Captured On: [2024-04-19 Fri 05:07] ** idle highlight mode instead of your hl setup? #+BEGIN_QUOTE (use-package idle-highlight-mode :hook (prog-mode . idle-highlight-mode) :config (setopt idle-highlight-idle-time 0.5) (defface idle-highlight '((t :inherit highlight :underline t)) "Face used to highlight other occurrences of the word at point.")) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-lang.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-lang.el - sourcehut git]] Captured On: [2024-04-19 Fri 05:05] ** beniot's flycheck setup note that he's putting the display-buffer-alist in the init section #+BEGIN_QUOTE (use-package flycheck :init (add-to-list 'display-buffer-alist `(,(rx bos "*Flycheck errors*" eos) (display-buffer-reuse-window display-buffer-in-side-window) (side . bottom) (reusable-frames . visible) (window-height . 0.15))) :config (global-flycheck-mode) (evil-set-initial-state 'flycheck 'emacs)) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-lang.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-lang.el - sourcehut git]] Captured On: [2024-04-19 Fri 05:04] ** beniot's org-download config #+BEGIN_QUOTE (use-package org-download :after org :general (bmj-local-leader-keys :states '(normal insert) :keymaps 'org-mode-map "i" '(:ignore t :which-key "insert") "id" '(:ignore t :which-key "download") "idu" '(org-download-yank :which-key "url") "idd" '(org-download-clipboard :which-key "clipboard")) :config (customize-set-variable 'org-download-method 'attach) ;; (customize-set-variable 'org-download-backend "curl") (add-hook 'dired-mode-hook 'org-download-enable)) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-lang-org.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-lang-org.el - sourcehut git]] Captured On: [2024-04-19 Fri 05:02] ** abo-abo/org-download: Drag and drop images to Emacs org-mode [[https://github.com/abo-abo/org-download][abo-abo/org-download: Drag and drop images to Emacs org-mode]] Captured On: [2024-04-19 Fri 05:01] ** awth13/org-appear: Toggle visibility of hidden Org mode element parts upon entering and leaving an element [[https://github.com/awth13/org-appear][awth13/org-appear: Toggle visibility of hidden Org mode element parts upon entering and leaving an element]] Captured On: [2024-04-19 Fri 04:59] ** beniot's lsp and dap setup #+BEGIN_QUOTE (use-package lsp-mode :commands (lsp lsp-deferred) :hook ((lsp-mode . lsp-enable-which-key-integration) (lsp-mode . lsp-lens-mode)) :bind (:map lsp-mode-map (("M-RET" . lsp-execute-code-action))) :general (bmj-leader-keys "cl" '(:keymap lsp-command-map :which-key "lsp")) :custom (lsp-highlight-symbol-at-point nil) ; delegated to idle-highlight (lsp-eldoc-render-all nil) :init (setq lsp-keymap-prefix "C-c l")) (use-package lsp-ui :commands lsp-ui-mode :custom (lsp-ui-doc-delay 5.0) (lsp-ui-sideline-enable t) (lsp-ui-sideline-show-symbol nil)) (use-package lsp-treemacs :commands lsp-treemacs-errors-list) (use-package dap-mode :after lsp-mode ;; :custom ;; (dap-java-terminal 'integratedTerminal) ;; (dap-internal-terminal #'dap-internal-terminal-vterm) :config (dap-auto-configure-mode)) (use-package consult-lsp :general (general-define-key :keymaps 'lsp-mode-map [remap xref-find-apropos] #'consult-lsp-symbols)) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-lang-lsp.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-lang-lsp.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:56] ** ~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-lang-js-ts.el - sourcehut git [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-lang-js-ts.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-lang-js-ts.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:54] ** beniot setting up editor configuration for a language #+BEGIN_QUOTE (defun bmj-default-java-code-style-hook () "My default editor configuration for java." (setq c-basic-offset 2 c-label-offset 0 tab-width 2 indent-tabs-mode nil compile-command "mvn -q -o verify" require-final-newline nil)) (add-hook 'java-mode-hook 'bmj-default-java-code-style-hook) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-lang-java.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-lang-java.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:53] ** setup devdocs context when coding #+BEGIN_QUOTE (add-hook 'emacs-lisp-mode-hook (lambda () (setq-local devdocs-current-docs '("elisp")))) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-lang-el.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-lang-el.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:51] ** look into new shortdoc feature Version 28 of emacs introduced a new feature called shortdoc. It gives an overview over available elisp functions in a few select categories. Use the command M-x shortdoc-display-group and then type in which category you want to view and a buffer pops up giving you a brief overview. #+BEGIN_QUOTE ;; TODO we can generate our own cheatsheet with this ;; see https://www.masteringemacs.org/article/emacs-builtin-elisp-cheat-sheet (use-package shortdoc :ensure nil :straight nil :config (evil-set-initial-state 'shortdoc 'emacs)) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-help.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-help.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:49] ** does explain pause mode even work? beniot has it in his config #+BEGIN_QUOTE (use-package explain-pause-mode :general (bmj-leader-keys "ze" '(:ignore t :which-key "profile") "zet" '(explain-pause-mode :which-key "toggle") "zee" '(explain-pause-top :which-key "top")) :config (evil-set-initial-state 'explain-pause 'emacs)) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-help.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-help.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:47] ** example of putting emacs files in the ~/.cache #+BEGIN_QUOTE (use-package undo-tree ;; TODO: find a better way to defer it :diminish undo-tree-mode :demand t :custom (undo-tree-history-directory-alist '(("." . "~/.cache/emacs/undo"))) :config (global-undo-tree-mode)) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-editor.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-editor.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:46] ** setup autoinsert for .el files for header/footer #+BEGIN_QUOTE (use-package autoinsert :straight nil :ensure nil :demand t :config (setq auto-insert-directory (expand-file-name "~/.config/emacs/auto-insert/")) (add-to-list 'auto-insert-alist '("shell\\.nix" . "shell.nix")) (auto-insert-mode 1)) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-editor.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-editor.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:43] ** beniot's selection framework setup #+BEGIN_QUOTE (use-package vertico :demand t :config (evil-set-initial-state 'vertico 'emacs) (setopt vertico-cycle t) (vertico-mode 1)) ;; this works also for CAP (use-package orderless :demand t :config ;; Define orderless style with initialism by default (orderless-define-completion-style +orderless-with-initialism (orderless-matching-styles '(orderless-initialism orderless-literal orderless-regexp))) (setq completion-styles '(orderless basic) completion-category-overrides '((file (styles basic partial-completion)) ;; enable initialism by default for symbols ; (command (styles +orderless-with-initialism)) ; (variable (styles +orderless-with-initialism)) ; (symbol (styles +orderless-with-initialism)) ) orderless-matching-styles '(orderless-literal orderless-initialism orderless-regexp ;; orderless-flex ) orderless-component-separator #'orderless-escapable-split-on-space ;; allow escaping space with backslash! )) (use-package marginalia :hook (minibuffer-mode . marginalia-mode) :custom (marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil)) :config (add-to-list 'marginalia-annotator-registry '(symbol-help marginalia-annotate-variable) '(buffer marginalia-annotate-buffer)) (add-to-list 'marginalia-prompt-categories '("Buffer: " . buffer)) (marginalia-mode 1)) (use-package consult :general (general-define-key [remap recentf-open-files] #'consult-recent-file [remap bookmark-jump] #'consult-bookmark [remap evil-show-marks] #'consult-mark [remap evil-show-jumps] #'+vertico/jump-list [remap goto-line] #'consult-goto-line [remap imenu] #'consult-imenu [remap locate] #'consult-locate [remap load-theme] #'consult-theme ;; TODO consult-man does not work [remap man] #'consult-man [remap switch-to-buffer-other-window] #'consult-buffer-other-window [remap switch-to-buffer-other-frame] #'consult-buffer-other-frame [remap yank-pop] #'consult-yank-pop [remap isearch-forward] #'consult-line ;; [remap evil-redo] ;; #'consult-history ) (bmj-leader-keys "ss" '(consult-ripgrep :which-key "ripgrep")) :config (setq completion-in-region-function #'consult-completion-in-region consult-async-min-input 1) (evil-set-initial-state 'consult 'emacs)) ;; TODO: https://karthinks.com/software/fifteen-ways-to-use-embark/ (use-package embark :general (general-define-key [remap describe-bindings] #'embark-bindings) :bind (("C-." . embark-act) ("C-," . embark-export)) ;; TODO conflict with iedit ;("C-;" . embark-dwim)) :config (evil-set-initial-state 'embark 'emacs) (evil-set-initial-state 'vertico 'emacs) ;; Hide the mode line of the Embark live/completions buffers (add-to-list 'display-buffer-alist '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" nil (window-parameters (mode-line-format . none))))) ;; allow to export grep results into a occur like buffer (use-package embark-consult :hook ((embark-collect-mode . consult-preview-at-point-mode) (minibuffer-mode . (lambda () nil)))) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-completion.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-completion.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:39] ** alphapapa/hammy.el: Programmable, interactive interval timers (e.g. for working/resting) [[https://github.com/alphapapa/hammy.el][alphapapa/hammy.el: Programmable, interactive interval timers (e.g. for working/resting)]] Captured On: [2024-04-19 Fri 04:36] ** SqrtMinusOne/pomm.el: Implementation of Pomodoro and Third Time techniques for Emacs [[https://github.com/SqrtMinusOne/pomm.el][SqrtMinusOne/pomm.el: Implementation of Pomodoro and Third Time techniques for Emacs]] Captured On: [2024-04-19 Fri 04:34] ** wbolster/emacs-direnv: direnv integration for emacs [[https://github.com/wbolster/emacs-direnv][wbolster/emacs-direnv: direnv integration for emacs]] Captured On: [2024-04-19 Fri 04:31] ** emacsmirror/0x0: Upload sharing to 0x0.st Easily share images on erc, etc. [[https://github.com/emacsmirror/0x0][emacsmirror/0x0: Upload sharing to 0x0.st]] Captured On: [2024-04-19 Fri 04:28] ** walseb/blimp: A complete wrapper around all imagemagick commands with autocompletion, descriptions and hints displayed in prompt [[https://github.com/walseb/blimp][walseb/blimp: A complete wrapper around all imagemagick commands with autocompletion, descriptions and hints displayed in prompt]] Captured On: [2024-04-19 Fri 04:27] ** simple music setup to consider #+BEGIN_QUOTE (use-package mpc :commands (mpc)) (use-package mpdel :general (bmj-leader-keys "aM" '(mpdel-browser-open :which-key "mpdel"))) (use-package simple-mpc) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-app-media.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-app-media.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:25] ** Investigate disk-usage and trashed #+BEGIN_QUOTE (use-package disk-usage :general (bmj-leader-keys "fu" '(:ignore t :which-key "disk usage") "fuu" '(disk-usage :which-key "somewhere") "fu." '(disk-usage :which-key "here") "fup" '((lambda () disk-usage (project-root (project-current))) :which-key "project")) :config (evil-set-initial-state 'disk-usage 'emacs) ) (use-package trashed :general (bmj-leader-keys "ft" '(trashed :which-key "trashed")) :config (evil-set-initial-state 'trashed 'emacs)) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-app-file-mgmt.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-app-file-mgmt.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:23] ** rest client config from beniot #+BEGIN_QUOTE (eval-when-compile (require 'cl)) (use-package restclient :straight (restclient :type git :host github :repo "pashky/restclient.el" :files ("restclient.el" "restclient-jq.el")) :mode (("\\.rest\\'" . restclient-mode)) :config (require 'restclient-jq) (evil-set-initial-state 'restclient 'emacs)) (use-package restclient-test :hook (restclient-mode . restclient-test-mode) :general (bmj-local-leader-keys :states '(normal insert) :keymaps 'restclient-mode-map "t" '(:ignore t :which-key "test") "tt" '(restclient-test-buffer :which-key "buffer") "tc" '(restclient-test-current :which-key "current"))) (use-package plz) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-app-http.el][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-app-http.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:22] ** 10sr/git-walktree-el: Browse Git Tree and Blob Objects [[https://github.com/10sr/git-walktree-el][10sr/git-walktree-el: Browse Git Tree and Blob Objects]] Captured On: [2024-04-19 Fri 04:20] ** Mastodon Packages and setup from benoit #+BEGIN_QUOTE (use-package mastodon :commands (mastodon) :general (bmj-leader-keys "ax" '(mastodon :which-key "mastodon")) :config (setopt mastodon-instance-url "https://fosstodon.org") (setopt mastodon-active-user "@benoitj") (setopt mastodon-auth-source-file "~/.authinfo.gpg") (setopt mastodon-tl--show-avatars t) (setopt mastodon-media--avatar-height 50) (mastodon-alt-tl-activate) (mastodon-async-mode)) (use-package mastodon-alt :demand t :after (mastodon) :straight (mastodon-alt :host github :repo "rougier/mastodon-alt") :commands (mastodon-alt-tl-activate mastodon-alt-tl-deactivate)) #+END_QUOTE [[https://git.sr.ht/~benoit/dotfiles/tree/main/item/home/dotfiles/config/emacs/modules/config-app-social.el#L84][~benoit/dotfiles (main): home/dotfiles/config/emacs/modules/config-app-social.el - sourcehut git]] Captured On: [2024-04-19 Fri 04:09] ** Tiny Tiny RSS [[https://tt-rss.org/][Tiny Tiny RSS]] Captured On: [2024-04-19 Fri 04:04] ** fasheng/elfeed-protocol: make standalone RSS aggregators work with elfeed [[https://github.com/fasheng/elfeed-protocol?tab=readme-ov-file][fasheng/elfeed-protocol: Provide extra protocols to make like Fever, NewsBlur, Nextcloud/ownCloud News and Tiny Tiny RSS work with elfeed]] Captured On: [2024-04-19 Fri 04:03] ** TODO Create a fontaine set for more Serif fonts. - Georgia - Garamond ** sprig/org-capture-extension: A Chrome and firefox extension facilitating org-capture in emacs ** TODO Add this grep to org-drill #+BEGIN_QUOTE how would I use grep to search recursively for any instance of "epdfinfo" in files called todo.org where the filename could also be TODO.org (case insensitive)? You can use =grep= with the =-r= (or =--recursive=) option to search recursively, and the =-i= (or =--ignore-case=) option to ignore case. The =-E= option allows you to use extended regular expressions, which is especially helpful when searching case-insensitive extension. Here's how you can do it: #+begin_src bash grep -ri --include=\*.[Tt][Oo][Dd][Oo].[Oo][Rr][Gg] 'epdfinfo' . #+end_src This will search for the term "epdfinfo" in all files named =todo.org= or =TODO.org= (or any other case variations like =Todo.org=, =tOdO.org=, etc.) in the current directory (denoted by =.=) and its subdirectories. Please note that =-i= is case-insensitive for the searched term, not for the file extension. We use =[Tt][Oo][Dd][Oo].[Oo][Rr][Gg]= to manually handle case-insensitive file extensions. #+END_QUOTE [[][]] Captured On: [2024-04-18 Thu 06:15] ** mpdel/mpdel: Emacs user interface for MPD [[https://github.com/mpdel/mpdel][mpdel/mpdel: Emacs user interface for MPD]] Captured On: [2024-04-21 Sun 18:02] ** Consult-web: A package to get web and omni search results directly in emacs minibuffer! - Emacs / Emacs Lisp - System Crafters #+BEGIN_QUOTE armindarvish 4d My new package, consult-web 4 allows you to get search results from both online sources (google, bing, brave, wikipedia, …) and local sources (buffers, org notes, elfeed feeds, gptel ai chatbots, …) directly in minibuffer. It provides similar functionality to consult-buffer but on steroid! It uses consult, url-retrieve and API services form online sources. GitHub Repo: https://github.com/armindarvish/consult-web 4 For detailed demonstration of features, comparison with other packages, and usage examples see the YouTube video and the blog post below. YouTube Video: https://www.youtube.com/watch?v=7pDfyqBZwvo Blog Post: https://www.armindarvish.com/post/web_omni_search_in_emacs_with_consult-web/ 1 #+END_QUOTE [[https://forum.systemcrafters.net/t/consult-web-a-package-to-get-web-and-omni-search-results-directly-in-emacs-minibuffer/603][Consult-web: A package to get web and omni search results directly in emacs minibuffer! - Emacs / Emacs Lisp - System Crafters]] Captured On: [2024-04-22 Mon 22:06] ** Tell Org-Alerts to ignore all day events ** emake.el: Test Elisp without the hoops https://github.com/vermiculus/emake.el #+BEGIN_QUOTE emake.el: Test Elisp without the hoops Test Elisp with services like Travis CI without the fuss of Cask – just you, your project, and (Emacs-)Make. Things EMake does: parses, installs, and runs tests for your package provides all the power of Elisp to extend its capabilities on-demand Things EMake will never do (or ‘reasons you may still need Cask’): manage your development environment or provide tools to do so provide ’bundler-like’ exec abilities (this includes Cask’s emacs and eval commands) #+END_QUOTE [[https://github.com/alphapapa/emacs-package-dev-handbook?tab=readme-ov-file#good-style-in-modern-emacs-packages][alphapapa/emacs-package-dev-handbook: An Emacs package development handbook. Built with Emacs, by Emacs package developers, for Emacs package developers.]] Captured On: [2024-04-21 Sun 17:43] ** Wilfred/suggest.el: discover elisp functions that do what you want [[https://github.com/Wilfred/suggest.el][Wilfred/suggest.el: discover elisp functions that do what you want]] Captured On: [2024-04-21 Sun 16:42] ** Emacs function: Byte Compile and Load Directory #+BEGIN_QUOTE Byte-compile and load directory Byte-compile and load all elisp files in DIRECTORY. Interactively, directory defaults to default-directory and asks for confirmation. ;;;###autoload (defun epdh/byte-compile-and-load-directory (directory) "Byte-compile and load all elisp files in DIRECTORY. Interactively, directory defaults to `default-directory' and asks for confirmation." (interactive (list default-directory)) (if (or (not (called-interactively-p)) (yes-or-no-p (format "Compile and load all files in %s?" directory))) ;; Not sure if binding `load-path' is necessary. (let* ((load-path (cons directory load-path)) (files (directory-files directory 't (rx ".el" eos)))) (dolist (file files) (byte-compile-file file 'load))))) #+END_QUOTE [[https://github.com/alphapapa/emacs-package-dev-handbook?tab=readme-ov-file#byte-compile-and-load-directory][alphapapa/emacs-package-dev-handbook: An Emacs package development handbook. Built with Emacs, by Emacs package developers, for Emacs package developers.]] Captured On: [2024-04-21 Sun 16:40] ** emacs-package-checker https://github.com/akirak/emacs-package-checker #+BEGIN_QUOTE emacs-package-checker: Check Emacs Lisp packages in a clean environment Emacs Package Checker lets you quickly configure typical linters (i.e. package-lint, byte-compile, and checkdoc) for your Emacs package. There are existing solutions in this field like emake.el and makel. Emacs Package Checker is not any more capable than those existing solutions, but it is based on Nix package manager and runs tests in a pure, sandboxed environment. This is useful for testing Emacs packages on local machines. #+END_QUOTE [[https://github.com/alphapapa/emacs-package-dev-handbook?tab=readme-ov-file#good-style-in-modern-emacs-packages][alphapapa/emacs-package-dev-handbook: An Emacs package development handbook. Built with Emacs, by Emacs package developers, for Emacs package developers.]] Captured On: [2024-04-21 Sun 17:41] ** emacs-refactor: language-specific refactoring #+BEGIN_QUOTE https://github.com/Wilfred/emacs-refactor emacs-refactor: language-specific refactoring Emacs Refactor (EMR) is a framework for providing language-specific refactoring in Emacs. It includes refactoring commands for a variety of languages, including elisp itself! #+END_QUOTE [[https://github.com/alphapapa/emacs-package-dev-handbook?tab=readme-ov-file#refactoring][alphapapa/emacs-package-dev-handbook: An Emacs package development handbook. Built with Emacs, by Emacs package developers, for Emacs package developers.]] Captured On: [2024-04-21 Sun 17:45] * DOING Emacs Config v0.7 [2/4] ** DONE Supplement Existing Functionality [9/9] *** DONE [#B] Make sure eshell has same path as other shells CLOSED: [2024-03-27 Wed 14:02] it couldn't find build.emacs.src.sh in the path for instance *** DONE [#B] Create Topic Org-Roam Template in Capture Templates CLOSED: [2023-12-03 Sun 14:59] *** DONE [#C] Put Eshell on F12 and Vterm on C-F12 CLOSED: [2024-03-04 Mon 14:54] *** DONE [#C] Save Destination Buffer Post Refile CLOSED: [2024-04-03 Wed 16:27] **** 2024-04-03 Wed @ 16:11:32 -0500 Saving All Org Buffers Instead It appears there are several ways that refile occurs. One is through org-capture, and another directly (i.e., interactively). There may be more. After some searching, I found a way to save only the target file after an org-capture; https://emacs.stackexchange.com/questions/19292/org-refile-locks-up-file-when-used-from-org-capture #+begin_src emacs-lisp (defun save-after-capture-refile () (with-current-buffer (marker-buffer org-capture-last-stored-marker) (save-buffer))) (advice-add 'org-capture-refile :after 'save-after-capture-refile) #+end_src This uses org-capture-last-stored-marker, which wouldn't work calling org-refile interactively. The only other way that looked safe, was to simply save all org buffers after a refile. This isn't as desirable, but I will need to use it before I know of any negative impacts. https://github.com/rougier/emacs-gtd/issues/9 and a discussion https://emacs.stackexchange.com/questions/26923/org-mode-getting-errors-when-auto-saving-after-refiling **** Goal I've had Emacs lock up and as a result of killing it, I lost data in the refile in the unsaved buffer. Like cj/bookmark-set-and-save, I think a refile should save the target file it's refiling to. https://github.com/rougier/emacs-gtd/issues/9 *** DONE [#B] Change the Name of an Elfeed Feed CLOSED: [2024-04-03 Wed 15:01] **** 2024-04-03 Wed @ 15:02:41 -0500 Done With Elfeed-org Learned you can do that with elfeed-org and adopted it **** Goal: #+BEGIN_QUOTE For others looking to change the name of a feed - it seems that this is now possible by using M-x elfeed-search-set-feed-title, as described here. #+END_QUOTE [[https://emacs.stackexchange.com/questions/38718/how-do-i-set-a-custom-name-for-a-feed-in-elfeed][How do I set a custom name for a feed in elfeed? - Emacs Stack Exchange]] Captured On: [2023-10-30 Mon 10:49] *** CANCELLED [#A] Move from Dired-Sidebar to Treemacs CLOSED: [2024-03-14 Thu 06:21] Treemacs doesn't give me the functionality I wanted. I actually wanted to be able to navigate the methods within a source code file. *** CANCELLED [#B] Warn when leaving dirty repository This doesn't appear to work when tested. Installed according to README CLOSED: [2024-03-15 Fri 14:01] https://github.com/thisirs/vc-check-status#vc-check-status *** CANCELLED [#C] Investigate Yeetube CLOSED: [2024-04-03 Wed 15:06] Decided I wasn't going to use Yeetube [[https://michal.sapka.me/emacs/watching-youtube-with-emacs/][[Michał Sapka's website] Emacs: watching YouTube with Yeetube and mpv]] Captured On: [2024-03-15 Fri 17:02] *** CANCELLED [#C] Look Into Github Elpa CLOSED: [2024-04-03 Wed 15:08] Not needed with local elpa-mirror setup [[https://github.com/10sr/github-elpa][10sr/github-elpa: Build and Publish Your Own ELPA Repositories with GitHub Pages]] Captured On: [2023-10-20 Fri 13:28] ** DONE Stabilize Existing Functionality [9/9] *** DONE [#A] Error When Attempting to Launch Dirvish Go Menu CLOSED: [2024-04-02 Tue 00:06] *** DONE [#A] Move All Bugs and Todos in Code Into Project Todo.org CLOSED: [2024-04-03 Wed 16:52] *** DONE [#B] Bug: Scan Project Directories for Refiling Candidates Fails! Fixed as of today! CLOSED: [2024-03-30 Sat 19:10] *** DONE [#B] Eshell Should Pick Up Aliases and Environment Variables CLOSED: [2024-03-27 Wed 14:31] *** DONE [#B] Side Arrows No Longer Change Todo State CLOSED: [2024-04-04 Thu 10:29] error: Command not allowed on this line functions are: org-todo-nextset and org-todo-previouset *** DONE [#B] Split Windows Should Show Buffer List and Not Show Current Buffer Twice CLOSED: [2024-03-27 Wed 14:35] Note: this was completed much earlier than the timestamp #+BEGIN_QUOTE Split functions which open the previous buffer in the new window instead of showing the current buffer twice. (defun ph/vsplit-last-buffer () (interactive) (split-window-vertically) (other-window 1 nil) (switch-to-next-buffer)) (defun ph/hsplit-last-buffer () (interactive) (split-window-horizontally) (other-window 1 nil) (switch-to-next-buffer)) #+END_QUOTE [[https://github.com/pascal-huber/emacs.d#packages][pascal-huber/emacs.d: My emacs setup]] Captured On: [2023-10-22 Sun 02:16] *** DONE [#C] Check Eshell-visual-commands for Common Apps CLOSED: [2024-03-04 Mon 14:53] - [X] gotop - [X] ncmpcpp - [X] nmtui *** DONE Regression: 'C-x k' Immediately Kills Current Buffer CLOSED: [2024-04-04 Thu 10:35] Emacs -Q behavior displays a completing read containing all buffers with the current buffer selected. This is the result of overriding that function in cj/invincible-buffers in system-utils. **** 2024-04-04 Thu @ 10:35:09 -0500 Solution #+begin_src emacs-lisp ;; ----------------------------- Invincible Buffers ---------------------------- ;; buries buffers on the 'invincible-buffer' list rather than killing them. ;; The keybinding for kill-buffer is remapped to this function. (defvar cj/invincible-buffers '("*scratch*" "*Messages*") "Buffers that should not be killed, but buried instead.") (defun cj/kill-buffer () "Bury buffers on invincible-buffers list rather than killing them." (interactive) (let ((target-buffer (completing-read "Kill buffer: " (mapcar 'buffer-name (buffer-list))))) (with-current-buffer target-buffer (if (member (buffer-name (current-buffer)) cj/invincible-buffers) (bury-buffer) (kill-buffer (current-buffer)))))) (global-set-key [remap kill-buffer] #'cj/kill-buffer) #+end_src *** DONE [#C] Bookmark-save-flag Replaces Bookmark-set-and-save CLOSED: [2024-04-03 Wed 15:00] remove cj/bookmark-set-and-save if setting bookmark-save-flat to 1 saves when adding/modifying a bookmark ** DOING Open v0.7 Fit and Finish (ends 2024.04.20) [0/1] *** TODO [#B] Get queued email working for both mail accounts **** using sendmail for gmail #+BEGIN_QUOTE Queuing mails for sending it later Mu4e supports a very nice feature which is mail queueing from smtpmail emacs client. To enable it, it requires two easy steps: In ~/.emacs: (setq smtpmail-queue-mail t smtpmail-queue-dir "~/Mail/queue/cur") In your shell: $ mu mkdir ~/Mail/queue $ touch ~/Mail/queue/.noindex Then, mu4e will be aware of the queueing, in the home screen of mu4e, you will be able to switch from queuing to direct sending by pressing m and flushing the queue by pressing f. Note: there is a bug (not sure it’s really a bug). When sending a mail into the queue, if your mail contains special characters, you will be asked to send it raw or to add a header containing the encoding. #+END_QUOTE [[https://dataswamp.org/~solene/2018-05-22-mu4esmtp.html][Solene'% : Sending mail with mu4e]] Captured On: [2024-04-13 Sat 05:23] **** with msmtp for cmail on archwiki: https://wiki.archlinux.org/title/msmtp#Using_msmtp_offline (read the whole page anyway) also here: https://www.reddit.com/r/emacs/comments/q2gl5h/queuing_emails_and_sending_them_autmatically/ #+BEGIN_QUOTE Using msmtp offline Although msmtp is great, it requires that you be online to use it. This is not ideal for people on laptops with intermittent connections to the Internet or dialup users. Several scripts have been written to remedy this fact, collectively called msmtpqueue. The scripts are installed under /usr/share/doc/msmtp/msmtpqueue. You might want to copy the scripts to a convenient location on your computer, (/usr/local/bin is a good choice). Finally, change your MUA to use msmtp-enqueue.sh instead of msmtp when sending e-mail. By default, queued messages will be stored in ~/.msmtpqueue. To change this location, change the QUEUEDIR=$HOME/.msmtpqueue line in the scripts (or delete the line, and export the QUEUEDIR variable in .bash_profile like so: export QUEUEDIR="$XDG_DATA_HOME/msmtpqueue"). When you want to send any mail that you have created and queued up run: $ /usr/local/bin/msmtp-runqueue.sh Adding /usr/local/bin to your PATH can save you some keystrokes if you are doing it manually. The README file that comes with the scripts has some handy information, reading it is recommended. #+END_QUOTE [[https://wiki.archlinux.org/title/msmtp#Using_msmtp_offline][msmtp - ArchWiki]] Captured On: [2024-04-13 Sat 09:35] *** [#D] Resolved v0.7 Fit and Finish Work [25/25] **** DONE [#C] Theme Doesn't Fallback on Wombat Correctly if No Theme Persist File **** DONE [#A] Remove Keys CLOSED: [2024-04-07 Sun 13:46] ***** Remove OpenAPI Key From ai-config.el ****** 2024-04-07 Sun @ 13:21:22 -0500 Issue in ai-config.el ;; BUG: .authinfo.gpg not accessed for this key ***** Purge History to Remove Historical Issues Do this after other secrets are removed ****** Google OAuth file in assets ******* 2024-04-07 Sun @ 13:23:51 -0500 This One's in History. Fix by Purging History ****** OpenAPI Key in help-utils.el ******* 2024-04-07 Sun @ 13:19:10 -0500 Need to Erase History Originally, I thought this was a duplicate use-package declaration. Now it appears this is in history. I can simply: - force delete the .git file - recommit everything - force push back to github and git.cjennings.net - check the security section again to ensure it's gone. ****** Google OAuth Client ID and Client Secret in org-agenda-config.el **** DONE [#A] S- is Undefined Error in Org Mode CLOSED: [2024-04-08 Mon 21:30] (should be org-agenda-todo-nextset) ***** 2024-04-07 Sun @ 11:48:44 -0500 it's simply undefined in org-mode Looks like I just added it to org-agenda-mode? **** DONE [#A] Error When Starting org-drill in cj/org-drill-start CLOSED: [2024-04-10 Wed 16:50] let: Symbol’s function definition is void: org-drill **** DONE [#B] Saving an Event for Today and Today's Calendar Doesn't Show the Event Fix was to include schedule-file alongside inbox in cj/build-org-agenda-list () ***** 2024-04-11 Thu @ 01:48:07 -0500 Observation Relaunching Emacs doesn't matter. Is the schedule file included in the agenda targets? ***** 2024-04-11 Thu @ 01:28:15 -0500 Reproduction - C-c c to bring up the capture templates - Select 'e' for event - Enter an event for the same day, then choose some time in the future (11:00pm) - Once completed, select f8 Actual Behavior: Agenda shows and event isn't listed. Expected Behavior: Agenda shows with no events. I checked the schedule file and the event was properly entered. Tested on a fresh archsetup, but replicates on current laptop. **** DONE [#B] Rename cj/kill-buffers CLOSED: [2024-04-04 Thu 19:17] **** DONE [#B] cj/kill-buffers Doesn't Select Current Buffer in Completing Read by Default CLOSED: [2024-04-04 Thu 19:17] **** DONE [#B] cj/kill-buffers Should Allow Adding to Invincible-buffers With C-u Prefix CLOSED: [2024-04-04 Thu 19:33] **** DONE [#B] Mu4e Reply All Should Be Default CLOSED: [2024-04-04 Thu 20:45] make 'r' reply-all (or wide reply) and 'R' reply no need to remove 'W' (for wide reply) ***** 2024-04-04 Thu @ 20:36:56 -0500 Solution Tested to Be Working Need to adjust 'mu4e-view-mode'. Within that mode: - the reply method is named "mu4e-compose-reply" - the reply-all method is named "mu4e-compose-wide-reply" There doesn't seem to be anything already mapped to "R", so adding the following should enable these changes. #+begin_src emacs-lisp (:map mu4e-view-mode-map ("r" . mu4e-compose-wide-reply) ("R" . mu4e-compose-reply)) #+end_src Tested both keys on a mail that had many recipients and it behaved in the way I expected. **** DONE [#B] Hyphenating Whitespace Should Leave Point Where It Started CLOSED: [2024-04-04 Thu 22:07] **** DONE [#B] Kill All Windows Also Kills Invisible Buffers CLOSED: [2024-04-08 Mon 16:14] **** DONE [#B] Dictionary Doesn't Work Via C-h d CLOSED: [2024-04-08 Mon 20:00] ***** 2024-04-08 Mon @ 19:23:13 -0500 There's a Package on Melpa https://melpa.org/#/sdcv Also, it mentioned I needed stardict. I installed it, but it didn't change the error ***** 2024-04-08 Mon @ 19:23:01 -0500 Issue Tried to look up agency and the dictionary failed. Found 1 items, similar to agency. -->Webster's Revised Unabridged Dictionary (1913) === Above this section the text is displayed. When copying and pasting the text, the rest of the text is displayed below === Found 1 items, similar to agency. -->Webster's Revised Unabridged Dictionary (1913) -->Agency Agency \A"gen*cy\, n.; pl. {Agencies}. [agentia, fr. L. agens, agentis: cf. F. agence. See {Agent}.] 1. The faculty of acting or of exerting power; the state of being in action; action; instrumentality. The superintendence and agency of Providence in the natural world. --Woodward. 2. The office of an agent, or factor; the relation between a principal and his agent; business of one intrusted with the concerns of another. 3. The place of business of am agent. Syn: Action; operation; efficiency; management. This was from cut and paste, the actual text didn't show. **** DONE [#B] Fresh Install: Error When No Macros File Found CLOSED: [2024-04-11 Thu 01:11] default location: ~/sync/org/macros.el **** DONE [#B] Mu4e Doesn't Launch Properly on Fresh Archinstall CLOSED: [2024-04-11 Thu 01:18] Error was something about the mu server exiting. ***** DONE Setup Virtualbox Testing CLOSED: [2024-04-11 Thu 01:18] ****** DONE Create ArchBase and AqrchSetup Images CLOSED: [2024-04-07 Sun 13:48] ****** DONE Run Archsetup in ArchSetup Image CLOSED: [2024-04-10 Wed 19:11] ****** DONE Run Mu4e Install Found in ~/.emacs.d/scripts/ CLOSED: [2024-04-11 Thu 01:17] ****** DONE Snapshot the Image CLOSED: [2024-04-11 Thu 01:18] **** DONE [#C] Move Non Init Visible Files in Emacs Config Root to Assets CLOSED: [2024-04-07 Sun 14:21] ***** 2024-04-07 Sun @ 14:07:56 -0500 files to move abbrev_defs elfeed-dashboard **** DONE [#C] Ripgrep Should Finish with Point on Results Buffer CLOSED: [2024-04-08 Mon 16:14] **** DONE [#C] Dashboard Icons Aren't Correct or Sized Correctly on Fractal CLOSED: [2024-04-10 Wed 17:16] **** DONE [#A] Fix Incorrect Refile Targets After Launch CLOSED: [2024-04-11 Thu 03:21] **** DONE [#B] Emacs fails to open .scratch file CLOSED: [2024-04-11 Thu 09:15] I don't like peristent scratch as it defeats the purpose and has failed several times so far. I should remove it. **** CANCELLED [#B] Neither Feebleline nor Moodline Displays on Archsetup Fresh Install Looks like this has been resolved. I see moodline appearing after an archlinux install. CLOSED: [2024-04-16 Tue 10:18] **** DONE [#B] Get alerts working in Emacs CLOSED: [2024-04-16 Tue 11:46] ***** 2024-04-16 Tue @ 10:31:07 -0500 Origin It's a bit crazy that I spend time each morning organizing and scheduling my day, then when the time comes, no notification happens. This is a bug fix, only insofar as it's fixing essentially broken in the Emacs workflow, but it's additional functionality. I'm hoping this is straightforward and I can spend a day on it to get this working, then move on to other bug fixes. **** DONE [#B] Show kill ring no longer works CLOSED: [2024-04-18 Thu 05:39] **** DONE [#B] Move org-todo items into org-config use-package statement CLOSED: [2024-04-18 Thu 06:01] **** DONE [#C] Fix company error message CLOSED: [2024-04-18 Thu 06:03] This is because I removed the shut-up function earlier but failed to remove this particular use of it. Now removed, so closing ***** What's the Issue? Company: An error occurred in auto-begin Company: backend company-capf error "Symbol’s function definition is void: shut-up" with args (prefix) **** DONE [#B] Rework org agenda CLOSED: [2024-04-18 Thu 20:26] :LOGBOOK: - State "DONE" from "PROJECT" [2024-04-18 Thu 20:26] - State "TODO" from [2024-04-18 Thu 12:35] :END: ***** DONE [#B] Create All Tasks List CLOSED: [2024-04-18 Thu 20:25] :LOGBOOK: - State "DONE" from "TODO" [2024-04-18 Thu 20:25] - State "TODO" from [2024-04-18 Thu 16:42] :END: ***** DONE [#B] Create All Tasks Current Buffer List CLOSED: [2024-04-18 Thu 20:25] :LOGBOOK: - State "DONE" from "TODO" [2024-04-18 Thu 20:25] - State "TODO" from [2024-04-18 Thu 16:43] :END: ***** DONE [#B] Remove Org-Super-Agenda Code and Test CLOSED: [2024-04-18 Thu 20:26] :LOGBOOK: - State "DONE" from "TODO" [2024-04-18 Thu 20:26] - State "TODO" from [2024-04-18 Thu 17:02] :END: To do after all other tasks have been created - [X] Quick search for super agenda methods that need removing - [X] Remove org-super-agenda - [X] Test all various f8 functions work - [X] Remove org-super-agenda from elpa Reboot to ensure it's not reinstalled - [X] Regenerate localrepo after restarting This ensures any dependencies are gone ***** DONE [#B] Reword Commentary for Accuracy CLOSED: [2024-04-18 Thu 20:26] :LOGBOOK: - State "DONE" from "TODO" [2024-04-18 Thu 20:26] - State "TODO" from [2024-04-18 Thu 18:06] :END: ***** DONE [#B] Create Main Agenda CLOSED: [2024-04-18 Thu 17:02] :LOGBOOK: - State "DONE" from "DOING" [2024-04-18 Thu 17:02] - State "DOING" from "TODO" [2024-04-18 Thu 16:41] - State "TODO" from [2024-04-18 Thu 16:40] :END: Bind it and test all custom functions used. ***** 2024-04-18 Thu @ 12:42:31 -0500 Project Scope This is with an eye to remove org-super-agenda. I really just need: - an agenda with all pri A tasks, the week's schedule, all B & C tasks this should be bound to f8 - all tasks and projects bound to C-f8 - all tasks and projects for this buffer bound to M-f8 **** DONE [#C] Fix Simple Task Capture CLOSED: [2024-04-18 Thu 22:14] :LOGBOOK: - State "DONE" from "TODO" [2024-04-18 Thu 22:14] :END: Now mapped to C-S-t at the bottom of org-capture-config.el ***** 2024-04-18 Thu @ 20:31:44 -0500 Issue It's now failing with org-roam-capture--fill-template: Wrong type argument: char-or-string-p, (expand-file-name (concat roam-dir "/inbox.org")) **** DONE [#B] Modularize all org-mode config files into use-package statements [10/10] CLOSED: [2024-04-25 Thu 14:15] :LOGBOOK: - State "DONE" from "DOING" [2024-04-25 Thu 14:15] :END: - [X] org-config - [X] org-agenda - [X] org-roam - [X] org-appearance - [X] org-babel - [X] org-capture - [X] org-refile - [X] org-contacts - [X] org-drill - [X] org-export **** DONE [#C] Remove all unnecessarily hardcoded filenames and paths [6/6] CLOSED: [2024-04-25 Thu 16:53] :LOGBOOK: - State "DONE" from "DOING" [2024-04-25 Thu 16:53] :END: ***** DONE mu4e mail directory constant CLOSED: [2024-04-25 Thu 16:53] :LOGBOOK: - State "DONE" from "TODO" [2024-04-25 Thu 16:53] :END: ./modules/mail-config.el:43: (setq mu4e-root-maildir "~/.mail") ;; root directory for all email accounts ./modules/mail-config.el:207:;; (setq smtpmail-queue-dir "~/.mail/queued-mail/")) ***** DONE create videos constant CLOSED: [2024-04-25 Thu 16:28] :LOGBOOK: - State "DONE" from "TODO" [2024-04-25 Thu 16:28] :END: ./modules/elfeed-config.el:129: (let ((default-directory "~/videos")) ***** DONE Create constant for ~/.authinfo.gpg CLOSED: [2024-04-25 Thu 15:59] :LOGBOOK: - State "DONE" from "TODO" [2024-04-25 Thu 15:59] :END: ./modules/ai-config.el:52: (setq auth-sources '((:source "~/.authinfo.gpg"))) ./modules/epa-config.el:15: (setq auth-sources '("~/.authinfo.gpg") ***** DONE Fix hardcoded in org-roam (defconst roam-dir (concat sync-dir "roam/") "The location of org-roam files.") ./modules/org-roam-config.el:16: (org-roam-directory "~/sync/org/roam/") ./modules/org-roam-config.el:27: ("v" "v2mom" plain (file "~/sync/org/roam/templates/v2mom.org") ./modules/org-roam-config.el:30: ("r" "recipe" plain (file "~/sync/org/roam/templates/recipe.org") ./modules/org-roam-config.el:33: ("p" "project" plain (file "~/sync/org/roam/templates/project.org") ./modules/org-roam-config.el:36: ("t" "topic" plain (file "~/sync/org/roam/templates/topic.org") ./modules/org-roam-config.el:116: (cj/org-roam-find-node "Topic" "t" "~/sync/org/roam/templates/topic.org")) ./modules/org-roam-config.el:121: (cj/org-roam-find-node "Recipe" "r" "~/sync/org/roam/templates/recipe.org")) ./modules/org-roam-config.el:126: (cj/org-roam-find-node "Project" "p" "~/sync/org/roam/templates/project.org")) ./modules/org-roam-config.el:146: :if-new (file+head+olp "~/sync/org/roam/inbox.org" ***** DONE Make initial go menu locations the constants CLOSED: [2024-04-25 Thu 15:52] :LOGBOOK: - State "DONE" from "TODO" [2024-04-25 Thu 15:52] :END: ./modules/dirvish-config.el:55: '(("h" "~/" "home") ./modules/dirvish-config.el:58: ("co" "~/code" "code") ./modules/dirvish-config.el:59: ("df" "~/.dotfiles/" "dotfiles") ./modules/dirvish-config.el:60: ("dn" "~/downloads/" "downloads") ./modules/dirvish-config.el:61: ("dr" "~/sync/org/drill/" "org drill files") ./modules/dirvish-config.el:62: ("dt" "~/downloads/torrents/complete/" "torrents") ./modules/dirvish-config.el:63: ("dx" "~/documents/" "documents") ./modules/dirvish-config.el:64: ("gc" "~/code/golangcourse" "golang course") ./modules/dirvish-config.el:65: ("lt" "~/.local/share/Trash" "trash") ./modules/dirvish-config.el:66: ("mp" "~/sync/playlists/" "playlists") ./modules/dirvish-config.el:67: ("mv" "~/magic/video/" "magic/video") ./modules/dirvish-config.el:68: ("mx" "~/music/" "music") ./modules/dirvish-config.el:69: ("my" "~/magic/youtube/" "magic/youtube") ./modules/dirvish-config.el:70: ("or" "~/sync/org/" "sync") ./modules/dirvish-config.el:71: ("pl" "~/sync/playlists" "playlists") ./modules/dirvish-config.el:72: ("pr" "~/projects/" "projects") ./modules/dirvish-config.el:73: ("ps" "~/pictures/screenshots/" "screenshots") ./modules/dirvish-config.el:74: ("pw" "~/pictures/wallpaper" "wallpaper") ./modules/dirvish-config.el:75: ("px" "~/pictures/" "pictures") ./modules/dirvish-config.el:76: ("tg" "~/sync/org/text.games" "text games") ./modules/dirvish-config.el:77: ("vx" "~/videos/" "videos"))) ***** DONE Use constants for search path in prog-general CLOSED: [2024-04-25 Thu 14:44] :LOGBOOK: - State "DONE" from "TODO" [2024-04-25 Thu 14:44] :END: ./modules/prog-general.el:84: (projectile-project-search-path '("~/code" ./modules/prog-general.el:85: "~/projects")) ***** full ripgrep results searching for "~/" ./modules/org-roam-config.el:16: (org-roam-directory "~/sync/org/roam/") ./modules/org-roam-config.el:27: ("v" "v2mom" plain (file "~/sync/org/roam/templates/v2mom.org") ./modules/org-roam-config.el:30: ("r" "recipe" plain (file "~/sync/org/roam/templates/recipe.org") ./modules/org-roam-config.el:33: ("p" "project" plain (file "~/sync/org/roam/templates/project.org") ./modules/org-roam-config.el:36: ("t" "topic" plain (file "~/sync/org/roam/templates/topic.org") ./modules/org-roam-config.el:116: (cj/org-roam-find-node "Topic" "t" "~/sync/org/roam/templates/topic.org")) ./modules/org-roam-config.el:121: (cj/org-roam-find-node "Recipe" "r" "~/sync/org/roam/templates/recipe.org")) ./modules/org-roam-config.el:126: (cj/org-roam-find-node "Project" "p" "~/sync/org/roam/templates/project.org")) ./modules/org-roam-config.el:146: :if-new (file+head+olp "~/sync/org/roam/inbox.org" ./modules/modeline-config.el:14:(defvar feebleline-working-directory "~/code/feebleline" ./modules/epa-config.el:15: (setq auth-sources '("~/.authinfo.gpg")) ./modules/prog-general.el:84: (projectile-project-search-path '("~/code" ./modules/prog-general.el:85: "~/projects")) ./modules/prog-go.el:35: (add-to-list 'exec-path "~/go/bin") ./modules/dirvish-config.el:55: '(("h" "~/" "home") ./modules/dirvish-config.el:58: ("co" "~/code" "code") ./modules/dirvish-config.el:59: ("df" "~/.dotfiles/" "dotfiles") ./modules/dirvish-config.el:60: ("dn" "~/downloads/" "downloads") ./modules/dirvish-config.el:61: ("dr" "~/sync/org/drill/" "org drill files") ./modules/dirvish-config.el:62: ("dt" "~/downloads/torrents/complete/" "torrents") ./modules/dirvish-config.el:63: ("dx" "~/documents/" "documents") ./modules/dirvish-config.el:64: ("gc" "~/code/golangcourse" "golang course") ./modules/dirvish-config.el:65: ("lt" "~/.local/share/Trash" "trash") ./modules/dirvish-config.el:66: ("mp" "~/sync/playlists/" "playlists") ./modules/dirvish-config.el:67: ("mv" "~/magic/video/" "magic/video") ./modules/dirvish-config.el:68: ("mx" "~/music/" "music") ./modules/dirvish-config.el:69: ("my" "~/magic/youtube/" "magic/youtube") ./modules/dirvish-config.el:70: ("or" "~/sync/org/" "sync") ./modules/dirvish-config.el:71: ("pl" "~/sync/playlists" "playlists") ./modules/dirvish-config.el:72: ("pr" "~/projects/" "projects") ./modules/dirvish-config.el:73: ("ps" "~/pictures/screenshots/" "screenshots") ./modules/dirvish-config.el:74: ("pw" "~/pictures/wallpaper" "wallpaper") ./modules/dirvish-config.el:75: ("px" "~/pictures/" "pictures") ./modules/dirvish-config.el:76: ("tg" "~/sync/org/text.games" "text games") ./modules/dirvish-config.el:77: ("vx" "~/videos/" "videos"))) ./modules/ai-config.el:52: (setq auth-sources '((:source "~/.authinfo.gpg"))) ./modules/eww-config.el:24: (setq url-cookie-file "~/.local/share/cookies.txt") ./modules/prog-training.el:25: (setq leetcode-directory "~/code/leetcode") ./modules/games-config.el:27: (setq malyon-stories-directory "~/sync/org/text.games/")) ./modules/prog-lisp.el:24:;; (load (expand-file-name "~/quicklisp/slime-helper.el")) ./modules/mail-config.el:43: (setq mu4e-root-maildir "~/.mail") ;; root directory for all email accounts ./modules/mail-config.el:195: ;; (setq smtpmail-auth-credentials (expand-file-name "~/.authinfo.gpg")) ./modules/mail-config.el:207:;; (setq smtpmail-queue-dir "~/.mail/queued-mail/")) ./modules/calibredb-epub-config.el:27: (setq calibredb-root-dir "~/sync/books/") ./modules/calibredb-epub-config.el:28: (setq calibredb-library-alist '(("~/sync/books/"))) ./modules/elfeed-config.el:129: (let ((default-directory "~/videos")) **** DONE [#C] Save articles under inbox.org TO READ Heading CLOSED: [2024-04-26 Fri 12:41] :LOGBOOK: - State "DONE" from "TODO" [2024-04-26 Fri 12:41] :END: ***** 2024-04-16 Tue @ 10:28:17 -0500 Notes This involves changing webclipper. Webclipper as it is now doesn't return the content, it actually yanks it into the article-file. What I want is something to return the content in the way that a template would expect it. This way, I can create templates that would work with org-roam as well, such as creating a separate org-roam node just by clicking an org-protocol bookmarklet. This might be too large to fit as a bug fix for v0.7. I began doing some research (below) yesterday to help me size the work. **** DONE [#B] Save All Attachments Working in Mu4e CLOSED: [2024-04-26 Fri 17:04] :LOGBOOK: - State "DONE" from "DOING" [2024-04-26 Fri 17:04] :END: ***** 2024-04-18 Thu @ 05:55:32 -0500 The Documentation Suggests A Path Forward This suggests that if I'm writing another function, I should - first query the user to select/create the directory - make sure mu4e-view-completion-minor-mode is on - call mu4e-view-complete-all to get all the files - within the context of mu4e-view-save-attachments #+BEGIN_QUOTE E-mail messages can be though as a series of “MIME-parts”, which are sections of the message. The most prominent is the ’body’, that is the main message your are reading. Many e-mail messages also contains attachments, which MIME-parts that contain files10. To save such attachments as files on your file systems, the mu4e message-view offers the command mu4e-view-save-attachments; default keybinding is e (think extract). After invoking the command, you can enter the file names to save, comma-separated, and using the completion support. Press RET to save the chosen files to your file-system. With a prefix argument, you get to choose the target-directory, otherwise, mu4e determines it following the variable mu4e-attachment-dir (which can be file-system path or a function; see its docstring for details. While completing, mu4e-view-completion-minor-mode is active, which offers mu4e-view-complete-all (bound to C-c C-a to complete all files11. #+END_QUOTE [[https://www.djcbsoftware.nl/code/mu/mu4e/MSGV-Attachments-and-MIME_002dparts.html][MSGV Attachments and MIME-parts (Mu4e 1.12.3 user manual)]] ***** 2024-04-18 Thu @ 05:05:03 -0500 Etienne's config failed It relies on this line to find all the mime-parts: (let ((parts (mu4e--view-gather-mime-parts)) and that doesn't exist any longer. ***** Test Etienne's Configuration https://etienne.depar.is/emacs.d/mu4e.html (defun ed/mu4e-view-save-all-attachments (&optional arg) "Save all attachments of a given message. If ARG is nil, all attachments will be saved in `mu4e-attachment-dir'. When non-nil, user will be prompted to choose a specific directory where to save all the files." (interactive "P") (when (and (eq major-mode 'mu4e-view-mode) (derived-mode-p 'gnus-article-mode)) (let ((parts (mu4e--view-gather-mime-parts)) (handles '()) (files '()) (directory (if arg (read-directory-name "Save to directory: ") mu4e-attachment-dir))) (dolist (part parts) (let ((fname (or (cdr (assoc 'filename (assoc "attachment" (cdr part)))) (cl-loop for item in part for name = (and (listp item) (assoc-default 'name item)) thereis (and (stringp name) name))))) (when fname (push `(,fname . ,(cdr part)) handles) (push fname files)))) (if files (cl-loop for (f . h) in handles when (member f files) do (mm-save-part-to-file h (let ((file (expand-file-name f directory))) (if (file-exists-p file) (let (newname (count 1)) (while (and (setq newname (format "%s-%s%s" (file-name-sans-extension file) count (file-name-extension file t))) (file-exists-p newname)) (cl-incf count)) newname) file)))) (mu4e-message "No attached files found"))))) (define-key mu4e-view-mode-map "X" #'ed/mu4e-view-save-all-attachments) ** DOING Complete v0.7 Release Checklist [8/11] *** DOING Fit and Finish Period *** TODO Clean Launch from Archsetup *** TODO Close Release and Create Tag on Repo *** DONE No Open Work *** DONE WIP Code Empty/Disabled *** DONE Emacs Config Inbox Zero *** DONE Perf Testing: Sub-Second Launch Time *** DONE Security Check for Keys *** DONE Clean Launch from Git Clone *** DONE Merged Cleanly Into Main Branch *** DONE Main Branch Pushed to github and git.cjennings.net * PROJECT Emacs Config v0.8 ** TODO Hugo Blogging Workflow *** 2024-04-04 Thu @ 16:44:40 -0500 Thoughts on Functionality The whole blogging workflow should happen in Emacs. - Capturing ideas for what to post - Working on multiple drafts at once - Listing all drafts - Checking into main should update website - Checking into any other branch name should not update website ** TODO Mu4e Mail Improvements *** TODO Mail Attachment Adding and Saving All **** 2024-04-04 Thu @ 21:32:28 -0500 Reminder to Tie Save All With Save In order to make the mu4e save attachment feel natural, save and save all shouldn't be so separate. Currently (e) for extract saves an attachment, but just gives you a prompt and colon in the minibuffer. When choosing save an attachment: - if mail contains more than one attachment, select one in completing read - choose the directory When choosing to save all attachments: - choose the directory with a prefix to the method, you would be opening the directory in dired or dirvish. **** 2024-04-04 Thu @ 13:31:08 -0500 Research ***** Save All Attachments With Vertico and Embark https://www.reddit.com/r/emacs/comments/p7gvf9/mu4e_how_best_to_save_large_numbers_of/ It's pretty easy if you use vertico+embark. After running mu4e-view-save-attachments, invoke embark-act-all in the completion menu followed by RET (mu4e-view-save-attachments) to save all attachments, or TAB (vertico-insert) followed by , (comma) next to each file you want to save, then RET (vertico-exit), to save selected attachments. ***** Adding Multiple Attachments Using Dired https://www.reddit.com/r/emacs/comments/nqhyos/how_to_do_mu4e_attachments/ Hi, thanks for responding. I am in a situation similar to : https://emacs.stackexchange.com/questions/14652/attach-multiple-files-from-the-same-directory-to-an-email-message . I would love the possibility of marking multiple files in multiple folders and attaching them all at once. - xenodium An option here is to open a dired buffer, mark the files you want, and invoke gnus-dired-attach (I use it with mu4e). It should ask you if you want to attach them all to your mail composition buffer. - [deleted] Brilliant! Now I just have to define two keybindings. First one to a lambda which can open a dired buffer with turn-on-gnus-dired-mode, and then another one within the keymap to this mode to run gnus-dired-attach. All this, to avoid a couple of M-x commands, because I feel smart when I use keybindings... =.=" - xenodium First one to a lambda which can open a dired buffer with turn-on-gnus-dired-mode If you don't mind keeping the mode on for all dired buffers, this should be enough: (use-package gnus-dired :hook (dired-mode . turn-on-gnus-dired-mode)) You have the benefit of launching dired the same way you launch it for any other purpose (ie. easier to remember). No special binding. ***** Deprecated Save All Function https://gist.github.com/philjackson/aecfab1706f05079aec7000e328fd183 ***** [#B] djcbsoftware.dl on attaching via dired https://www.djcbsoftware.nl/code/mu/mu4e/Dired.html 13.9 Dired It is possible to attach files to mu4e messages using dired (emacs), using the following steps (based on a post on the mu-discuss mailing list by Stephen Eglen). (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode) Then, mark the file(s) in dired you would like to attach and press C-c RET C-a, and you’ll be asked whether to attach them to an existing message, or create a new one. ***** [#B] djcbsoftware.dl on saving and comleting-all attachments Note: on hitting "e", then C-c C-a, it currently saves all attachments to the home directory. There's likely some directory setting I can use to choose a directory first (creating it if necessary). https://www.djcbsoftware.nl/code/mu/mu4e/MSGV-Attachments-and-MIME_002dparts.html 5.4 Attachments and MIME-parts E-mail messages can be though as a series of “MIME-parts”, which are sections of the message. The most prominent is the ’body’, that is the main message your are reading. Many e-mail messages also contains attachments, which MIME-parts that contain files10. To save such attachments as files on your file systems, the mu4e message-view offers the command mu4e-view-save-attachments; default keybinding is e (think extract). After invoking the command, you can enter the file names to save, comma-separated, and using the completion support. Press RET to save the chosen files to your file-system. With a prefix argument, you get to choose the target-directory, otherwise, mu4e determines it following the variable mu4e-attachment-dir (which can be file-system path or a function; see its docstring for details. While completing, mu4e-view-completion-minor-mode is active, which offers mu4e-view-complete-all (bound to C-c C-a to complete all files11. *** TODO Org Contacts Integrated with Mu4e *** TODO Visit and Cancel Messages Not-yet-sent *** TODO Mail Queueing On By Default *** TODO Periodic Mail Fetch When Online *** TODO GPG Signed Emails *** 2024-04-04 Thu @ 16:47:12 -0500 Goals Not all email workflows are working (attachments, for instance). There are also some major longstanding bugs (not-yet-sent messages location) ** TODO Calendaring Solution *** TODO [#B] Get Org Gcal Working *** 2024-04-04 Thu @ 16:51:25 -0500 Current Requirements I'm starting from scratch, but here are my (currently simple) requirements - Download events from online calendar and include them in my agenda. - CRUD events in Emacs easy w/ propagation to online calendar Agenda should be starting point, but it doesn't have to work from the Agenda pages. And yes, this means I also need to find and host an online calendar that sync's with an Android app. ** TODO Ledger Workflow ** TODO Miscellaneous Work *** TODO Fix Show Kill Ring *** TODO Consider the Flyspell Correct Ivy Interface for spelling #+BEGIN_QUOTE flyspell-correct-ivy interface In order to use flyspell-correct-ivy interface you have to install flyspell-correct-ivy package in any preferred way and then add following snippet to relevant part of your init.el file. (require 'flyspell-correct-ivy) (define-key flyspell-mode-map (kbd "C-;") 'flyspell-correct-wrapper) Or via use-package. (use-package flyspell-correct :after flyspell :bind (:map flyspell-mode-map ("C-;" . flyspell-correct-wrapper))) (use-package flyspell-correct-ivy :after flyspell-correct) If you do not want any binding, just replace :bind (:map flyspell-mode-map ("C-;" . flyspell-correct-wrapper)) with :defer t to use lazy loading. Note that in order to access actions in ivy interface you need to press M-o. More on ivy mini buffer key bindings you can read in official documentation. #+END_QUOTE [[https://github.com/d12frosted/flyspell-correct?tab=readme-ov-file#screenshots][d12frosted/flyspell-correct: Distraction-free words correction with flyspell via selected interface.]] Captured On: [2024-04-05 Fri 13:49] *** TODO Consider Actively Developed Awesome Tray Instead of Unsupported Feebleline [[https://github.com/manateelazycat/awesome-tray?tab=readme-ov-file][manateelazycat/awesome-tray: Hide mode-line, display necessary information at right of minibuffer.]] Captured On: [2024-04-06 Sat 11:09] ** TODO Emacs Config v0.8 Bug Fixes *** TODO [#C] Check if Including Dired Buffers in Autorevert-mode Slows Tramp *** TODO [#B] Test Emacs in a Terminal The number and complexity of bugs will tell me whether terminal Emacs is supported in this tag. ** TODO Emacs Config v0.8 Release Checklist (add latest release checklist here) * PROJECT Emacs Config v0.9 ** TODO VC Installs from Github ** TODO Prog Go Workflow ** TODO Prog Python Workflow ** TODO Emacs Config v0.9 Release Checklist [0/9] - [ ] No Open Work - [ ] WIP Code Empty/Disabled - [ ] Empty Emacs Config Inbox of Issues - [ ] Keep Sub-Second Launch Time - [ ] Successful Launch from Git Clone - [ ] Merged cleanly into main branch - [ ] Main Branch Pushed to github and git.cjennings.net - [ ] 2 Weeks of Use and Bug Fixing - [ ] Mark Release as DONE and Create Tag on Repo * PROJECT Emacs Config v0.10 ** TODO Complete "Localrepo" Functionality *** 2024-04-04 Thu @ 21:11:04 -0500 Considering Renaming "Localrepo" I worry that "localrepo" will be confused with elpa-mirrors, both local and remote. Also, I've named it what it is (it's local and a repo), not after its purpose. Naming it something like "last-known-good-packages" or "failsafe-packages" would: - avoid the confusion with elpa mirrors - avoid the confusion with version control repositories - make users hesitate before deleting the directory - make users understand it's purpose (and therefore it's importance) Candidate Names: - Last Known Good Pkgs - Failsafe Pkgs - Fallback Pkgs ChatGPT 4 came up with these names: - SafetyNetPkgs - StableVaultPkgs - TrustedBackupPkgs - SecureStandbyPkgs - BestCasePkgs - BufferZonePkgs - RevertReadyPkgs - SafeHarborPkgs - PackagePreserve - PkgSafeguard - StableShieldPkgs - PreparedPkgs - PkgLifeboat - BackupStashPkgs - AssuredAssetsPkgs - PkgPantry - RobustRepoPkgs - SafeSettlePkgs - ArchiveAnchorage - PkgFortress - DependableDepotPkgs - ReliableReservePkgs - HealthyHavenPkgs - PkgBunker - SolidStorePkgs - BulletproofBackupPkgs - PkgPlaza - SafeStoragePkgs - PkgCitadel - RescueRepoPkgs - ImmutableInstallPkgs - FortifiedFilesPkgs - ReviveReadyPkgs - PackagePillar - PlatinumPkgs The word "trusted" resonates with me, of course. *** 2024-04-04 Thu @ 20:59:43 -0500 Thoughts on Feature Set Functionality worth considering: **** update an installed package and update localrepo (package-and-localrepo-upgrade) though this one may not be desirable since the idea is to test packages by installing and using them first. **** update all installed packages and update localrepo (package-and-localrepo-upgrade-all) though this one may not be desirable since the idea is to test packages by installing and using them first. **** diff localrepo packages from the packages currently installed **** revert package to localrepo version this would amount to: - narrowing the package archives to localrepo - diffing localrepo and elpa to identify upgraded packages - showing all upgrading packages in completing read - uninstalling the selected package - reinstalling the selected package from localrepo - restarting emacs **** revert all packages to localrepo version this would amount to: - narrowing the package archives to localrepo - diffing localrepo and elpa to identify upgraded packages - showing all upgraded packages to confirm - uninstalling the upgraded packages - reinstalling the upgraded packages from localrepo - restarting emacs **** can you use git to save versions of these packages? ** TODO Prog C Workflow ** TODO Emacs Config v0.10 Release Checklist [0/9] - [ ] No Open Work - [ ] WIP Code Empty/Disabled - [ ] Empty Emacs Config Inbox of Issues - [ ] Keep Sub-Second Launch Time - [ ] Successful Launch from Git Clone - [ ] Merged cleanly into main branch - [ ] Main Branch Pushed to github and git.cjennings.net - [ ] 2 Weeks of Use and Bug Fixing - [ ] Mark Release as DONE and Create Tag on Repo * Emacs Config Backlog Categories ** Emacs AI Backlog *** TODO GPT Discussion on package compilation and first run #+BEGIN_QUOTE is there a way to tell using emacs-lisp whether Emacs has been launched for the first time (i.e., it's installed new packages)? There's no direct method to detect if Emacs has been launched for the first time using Emacs Lisp. However, you can use a workaround: create a sentinel file when you first launch Emacs, then check for the existence of this file when Emacs starts. Here is an example that writes a file =.firstrun= in the =user-emacs-directory= the first time Emacs is run: #+begin_src elisp (let ((sentinel (expand-file-name ".firstrun" user-emacs-directory))) (if (file-exists-p sentinel) (message "Not the first run of Emacs.") (message "First run of Emacs.") (with-temp-buffer (write-file sentinel)))) #+end_src Then based on the message, you can make decisions (like installing new packages).Note that this only works if Emacs can write to =user-emacs-directory=, and it considers "first run" to be "first run since the sentinel file was created". You might want to put such code in your init file so it's run every time Emacs starts. ***** Is there a way to tell using emacs-lisp whether packages are done compiling? Emacs does not offer a built-in functionality to directly detect when package compilation is complete. However, you can create a workaround where you use a hook that gets triggered when Emacs is idle, meaning that it's done with all immediate tasks (including potentially compiling packages). Here is an example how to use =idle-timer=: #+begin_src elisp (run-with-idle-timer 5 ;; idle time in seconds nil ;; repeat? (t or nil) (lambda () ;; your code to be executed when Emacs is idle (message "Emacs is now idle (finished compiling packages)."))) #+end_src #+END_QUOTE [[][]] Captured On: [2024-04-08 Mon 12:29] ** Emacs Browser Config Backlog [0/3] *** TODO Toggle Opening Links between External or Internal Browser Emacs-Wide **** 2023-07-29 @ 10:46:04 -0500 Code that seemed to work (defun my-eww-open-in-external-browser () "Open the link at point in an external browser." (interactive) (let* ((url (eww-current-url)) (browse-url-browser-function 'browse-url-default-browser)) (when url (browse-url url)))) (define-key eww-link-keymap (kbd "RET") 'my-eww-open-in-external-browser) ``` This revised code sets the `browse-url-browser-function` to `browse-url-default-browser`, which ensures that the URL is opened in the system's default external browser. It then opens the URL at point using `browse-url`. By binding the `RET` key to `my-eww-open-in-external-browser` in the `eww-link-keymap`, you should be able to open the link in an external browser. ================== To toggle the ability to open links in an external browser in EWW, you can use the following Emacs Lisp code: ```emacs-lisp (defvar my-eww-open-in-external-browser t "Toggle variable for opening links in an external browser in EWW.") (defun my-eww-toggle-open-in-external-browser () "Toggle opening links in an external browser in EWW." (interactive) (setq my-eww-open-in-external-browser (not my-eww-open-in-external-browser)) (if my-eww-open-in-external-browser (message "Links will now open in an external browser.") (message "Links will no longer open in an external browser."))) (defun my-eww-open-in-external-browser () "Open the link at point in an external browser." (interactive) (when my-eww-open-in-external-browser (let* ((url (eww-current-url)) (browse-url-browser-function 'browse-url-default-browser)) (when url (browse-url url))))) (define-key eww-link-keymap (kbd "RET") 'my-eww-open-in-external-browser) ``` **** 2023-07-28 @ 10:06:17 -0500 playing with some ideas first attempts are in (user-emacs-directory)/modules/browser-toggle.el *** STALLED Working with the XWidget Webkit Browser **** 2024-04-03 Wed @ 15:23:54 -0500 XWidget Webkit no longer able to be built **** Original Goal [[https://emacsnotes.wordpress.com/2018/08/18/why-a-minimal-browser-when-there-is-a-full-featured-one-introducingxwidget-webkit-a-state-of-the-art-browser-for-your-modern-emacs/][Why a minimal browser, when there is a full-featured one? Introducing`XWidget Webkit`: A state-of-the-art browser for your modern Emacs – Emacs Notes]] Captured On: [2023-11-02 Thu 11:44] *** TODO Investigage shrface [[https://github.com/chenyanming/shrface][chenyanming/shrface: Extend eww/nov with org-mode features, archive web pages to org files with shr.]] Captured On: [2024-04-05 Fri 16:14] *** TODO Mu4e Open a Url in a Firefox Private Window #+BEGIN_QUOTE Open an URL in a Firefox private window Sometime, I want to open an external link in a private window of Firefox. I will reuse here my function ed/cleanup-url (defun ed/mu4e-view-go-to-private-url (&optional multi) "Offer to go to url(s) in a private window of Firefox. If MULTI (prefix-argument) is nil, go to a single one, otherwise, offer to go to a range of urls." (interactive "P") (mu4e~view-handle-urls "URL to visit" multi (lambda (url) (start-process "private-firefox" nil "firefox" "--private-window" (ed/cleanup-url url))))) (define-key mu4e-view-mode-map "G" #'ed/mu4e-view-go-to-private-url) #+END_QUOTE [[https://etienne.depar.is/emacs.d/mu4e.html][Mu4e customization]] Captured On: [2024-04-13 Sat 04:55] *** TODO Consider uses for shrface Emacs web browsing package [[https://github.com/chenyanming/shrface][chenyanming/shrface: Extend eww/nov with org-mode features, archive web pages to org files with shr.]] Captured On: [2024-04-11 Thu 15:57] ** Emacs Calibre / Epub Backlog [0/3] *** TODO Investigate Visual Fill Column for Ebooks [[https://melpa.org/#/visual-fill-column][visual-fill-column - MELPA]] Captured On: [2023-07-31 Mon 17:32] *** TODO Maybe Virtual Auto Fill for Ebooks? [[https://github.com/luisgerhorst/virtual-auto-fill/tree/a3991ce02d9a6a1624a3f04da80f4ac966a44092][luisgerhorst/virtual-auto-fill at a3991ce02d9a6a1624a3f04da80f4ac966a44092]] Captured On: [2023-07-31 Mon 17:36] *** TODO Pocket Reader to Epub Via Emacs [[https://blog.dornea.nu/2021/08/15/howto-convert-pocket-reader-links-to-epub-and-upload-to-dropbox/][HowTo: Convert pocket reader links to Epub and upload to Dropbox - blog.dornea.nu]] Captured On: [2023-10-21 Sat 08:43] ** Emacs Config Utilities Backlog [0/1] *** TODO Test Emacs Config After Save #+BEGIN_QUOTE the Emacs Elements channel demonstrated emacs batch mode for checking your initialization. You can run something like emacs -batch -l ~/.emacs.d/init.el from a shell to start emacs, using the above initialization, and just immediately exit. If your configuration is bad, you'll see error messages about. And because it happens outside your existing emacs session, you can fix the errors inside emacs. But naturally we want to try that right from within emacs: (defun my-check-init-batch-mode () "Use batch mode to check my emacs initialization. Inspired by https://www.youtube.com/watch?v=5Vume2SETNM." (interactive) (shell-command "emacs -batch -l ~/.emacs.d/init.el")) That's nice because, for me at least, I get lots of warnings, and it's nice to have the shell output buffer to look through and fix things up. I can confirm this works -- I added the above function to my config, ran it, then made a change from one of the warnings -- and made a typo in my lisp code, and fixed it right away. 🙂 #+END_QUOTE [[https://emacs.stackexchange.com/questions/78945/run-check-parens-or-similar-when-saving-or-tangling-literate-configuration][org mode - run check-parens or similar when saving or tangling literate configuration? - Emacs Stack Exchange]] Captured On: [2023-11-18 Sat 08:10] ** Emacs Dashboard Backlog [0/1] *** TODO Cookie 1 for Fortune Like Emacs Tips #+BEGIN_QUOTE It looks like cookie1.el is what I want: just point it to your file with (setq cookie-file "~/.emacs.d/emacs_tips.txt") or by customizing the variable. The format of the file is pretty simple -- it seems that the tips/quotes/fortunes are separated by lines with just % or %%: % Fortune cookie / emacs tip #1. Somehow this never shows up. *shrug* % Try M-r for moving point around the window without moving the text. % M-@ marks a word, use it repeatedly to mark more words. With a negative prefix arg, go backwards. Nice when combined with C-x C-x. % A numeric prefix argument X with M-< will move point to X% in the buffer. (Same thing with M-> moves to X% from the end.) % (Somehow the first entry is ignored; I tried some variations but it never showed up.) Then show one of those entries with M-x cookie. Above are the first few things I have. I plan to troll through the weekly tips and tricks threads and see what I find. #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/17nvwnd/comment/k7xny8r/?utm_source=share&utm_medium=web2x&context=3][(2) emacs package or command to show a "tip/trick of the day"? : emacs]] Captured On: [2023-11-18 Sat 07:28] ** Emacs Dirvish Backlog [0/3] *** TODO Add Find-dired (or Fd-dired) to Emacs [[https://www.masteringemacs.org/article/working-multiple-files-dired][Working with multiple files in dired - Mastering Emacs]] Captured On: [2023-07-31 Mon 16:36] *** TODO Enable/Disable Highlight Changes Mode When Entering/Exiting Wdired-mode #+BEGIN_QUOTE Excellent idea, here's how you enable and disable highlight-changes-mode automatically when entering and exiting wdired-mode: (defvar my/wdired-before-finish-editing-hook nil) (defun my/wdired-before-finish-editing-run-hook (&rest _) (run-hooks 'my/wdired-before-finish-editing-hook)) (advice-add #'wdired-finish-edit :before #'my/wdired-before-finish-editing-run-hook) (advice-add #'wdired-abort-changes :before #'my/wdired-before-finish-editing-run-hook) (add-hook 'wdired-mode-hook (defun my/lambda-1693716265 () (highlight-changes-mode 1))) (add-hook 'my/wdired-before-finish-editing-hook (defun my/lambda-1693716255 () (highlight-changes-mode -1))) #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/1658md9/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 08:06] *** TODO Dired Config with Sorting #+BEGIN_QUOTE (use-package dired :bind ( :map dired-mode-map ("C-a" . my/dired-move-beginning-of-line) ("k" . dired-do-delete) ("D" . nil) ("s" . cc/dired-sort-by)) :hook (dired-mode . dired-hide-details-mode) :init (progn (setq dired-auto-revert-buffer t) (setq dired-dwim-target t) (setq dired-listing-switches "-alh") (setq dired-recursive-deletes 'always) (setq dired-mouse-drag-files t) (defun my/dired-move-beginning-of-line () (interactive) (let ((point (point))) (dired-move-to-filename) (when (= point (point)) (move-beginning-of-line nil))))) :config (progn ;; http://yummymelon.com/devnull/enhancing-dired-sorting-with-transient.html (defun cc/--dired-sort-by (criteria &optional prefix-args) "Sort current Dired buffer according to CRITERIA and PREFIX-ARGS. This function will invoke `dired-sort-other' with arguments built from CRITERIA and PREFIX-ARGS. CRITERIA is a keyword of which the following are supported: :name :date-added :version :kind :date-metadata-changed :size :date-last-opened :date-modified PREFIX-ARGS is a list of GNU ls arguments. If nil, then it will use the value of `cc-dired-listing-switches'. Otherwise this is typically populated by the Transient menu `cc/dired-sort-by'. This function requires GNU ls from coreutils installed. See the man page `ls(1)' for details." (let ((arg-list (list "-l"))) (if prefix-args (nconc arg-list prefix-args) (nconc arg-list cc-dired-listing-switches)) (cond ((eq criteria :name) (message "Sorted by name")) ((eq criteria :kind) (message "Sorted by kind") (push "--sort=extension" arg-list)) ((eq criteria :date-last-opened) (message "Sorted by date last opened") (push "--sort=time" arg-list) (push "--time=access" arg-list)) ((eq criteria :date-added) (message "Sorted by date added") (push "--sort=time" arg-list) (push "--time=creation" arg-list)) ((eq criteria :date-modified) (message "Sorted by date modified") (push "--sort=time" arg-list) (push "--time=modification" arg-list)) ((eq criteria :date-metadata-changed) (message "Sorted by date metadata changed") (push "--sort=time" arg-list) (push "--time=status" arg-list)) ((eq criteria :version) (message "Sorted by version") (push "--sort=version" arg-list)) ((eq criteria :size) (message "Sorted by size") (push "-S" arg-list)) (t (message "Default sorted by name"))) (dired-sort-other (mapconcat 'identity arg-list " ")))) (require 'transient) (transient-define-prefix cc/dired-sort-by () "Transient menu to sort Dired buffer by different criteria. This function requires GNU ls from coreutils installed." :value '("--human-readable" "--group-directories-first" "--time-style=long-iso") ; TODO: support cc-dired-listing-switches [["Arguments" ("-a" "all" "--all") ("g" "group directories first" "--group-directories-first") ("-r" "reverse" "--reverse") ("-h" "human readable" "--human-readable") ("t" "time style" "--time-style=" :choices ("full-iso" "long-iso" "iso" "locale"))] ["Sort By" ("n" "Name" (lambda () (interactive) (cc/--dired-sort-by :name (transient-args transient-current-command))) :transient nil) ("k" "Kind" (lambda () (interactive) (cc/--dired-sort-by :kind (transient-args transient-current-command))) :transient nil) ("l" "Date Last Opened" (lambda () (interactive) (cc/--dired-sort-by :date-last-opened (transient-args transient-current-command))) :transient nil) ("a" "Date Added" (lambda () (interactive) (cc/--dired-sort-by :date-added (transient-args transient-current-command))) :transient nil) ("m" "Date Modified" (lambda () (interactive) (cc/--dired-sort-by :date-modified (transient-args transient-current-command))) :transient nil) ("M" "Date Metadata Changed" (lambda () (interactive) (cc/--dired-sort-by :date-metadata-changed (transient-args transient-current-command))) :transient nil) ("v" "Version" (lambda () (interactive) (cc/--dired-sort-by :version (transient-args transient-current-command))) :transient nil) ("s" "Size" (lambda () (interactive) (cc/--dired-sort-by :size (transient-args transient-current-command))) :transient nil)]]))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 15:15] *** Use Dired as the Default Desktop File Manager #2 #+BEGIN_QUOTE This is how to make emacs as default file manager in ubuntu. First we have to write a script which will act as our file manager. #!/usr/bin/env python import os import sys def main(): if len(sys.argv) > 1: dirname = sys.argv[1] else: dirname = '~' os.system('emacs --eval \'(dired "{}")\'%'.format(dirname)) # you can use emacsclient if you are running emacs server if __name__ == "__main__": main() Save this as emacsfm in /usr/bin/. Now in terminal instead of using nautilus or nautilus /foo/bar, we can use emacsfm or emacsfm /foo/bar. Now we need to set this as default file manager. Install exo-utils using sudo apt-get install exo-utils and run it exo-preferred-applications It opens a new window. Go to Utilities -> File manager -> Other and enter /usr/bin/emacsfm "%s" in it. You can goto chrome downloads and if click show in folder it will open emacs dired :-) #+END_QUOTE [[https://emacs.stackexchange.com/questions/13927/how-to-set-emacs-as-the-default-file-manager][dired - How to set emacs as the default file manager? - Emacs Stack Exchange]] Captured On: [2024-04-12 Fri 10:53] *** Use Dired as the Default Desktop File Manager #+BEGIN_QUOTE Dependent on your desktop environment the method to set a default application may differ. That said, many desktop environments respect the associations in ~/.local/share/applications/mimeapps.list, where you can set up an association for the application/x-directory and/or inode/directory types. My mimeapps.list looks like this now: [Default Applications] application/x-directory=emacs-dired.desktop inode/directory=emacs-dired.desktop In the same directory I have a file called emacs-dired.desktop with the following contents: [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application NoDisplay=true Exec=emacsclient --eval '(dired "%f")' Name=Dired Comment=Emacs Dired When my long-lived instance of Emacs runs a server (M-x server-start) and I click on, say, the folder icon in the list of Downloads in Icecat a new dired buffer is opened. This actually works for me now. Thanks for asking the question --- otherwise I would not have set this up. #+END_QUOTE [[https://emacs.stackexchange.com/questions/13927/how-to-set-emacs-as-the-default-file-manager][dired - How to set emacs as the default file manager? - Emacs Stack Exchange]] Captured On: [2024-04-12 Fri 10:51] *** TODO Read Good Reddit Thread on Dired Figure out how to do 2 pane and different layouts [[https://www.reddit.com/r/emacs/comments/je9oha/do_you_use_emacs_as_a_file_manager/][(1) Do you use Emacs as a file manager? : emacs]] Captured On: [2024-04-12 Fri 11:46] *** TODO Read Through Dired as Default File Manager and Implement Tips [[https://truongtx.me/2013/04/24/dired-as-default-file-manager-1-introduction][Dired as Default File Manager - Introduction - TruongTX Blog]] Captured On: [2024-04-12 Fri 10:56] *** Recent History in Dired #+BEGIN_QUOTE (defun my-recent-directory (&optional n) "Goto recent directories. If N is not nil, only list directories in current project." (interactive "P") (unless recentf-mode (recentf-mode 1)) (let* ((cands (delete-dups (append my-dired-directory-history (mapcar 'file-name-directory recentf-list) ;; fasd history (and (executable-find "fasd") (nonempty-lines (shell-command-to-string "fasd -ld")))))) (root-dir (if (ffip-project-root) (file-truename (ffip-project-root))))) (when (and n root-dir) (setq cands (delq nil (mapcar (lambda (f) (path-in-directory-p f root-dir)) cands)))) (dired (completing-read "Directories: " cands)))) #+END_QUOTE [[https://github.com/redguardtoo/emacs.d/blob/02a5680d082375e6ef4c7c93bac2e19d2b2e66a8/lisp/init-ivy.el#L149][emacs.d/lisp/init-ivy.el at 02a5680d082375e6ef4c7c93bac2e19d2b2e66a8 · redguardtoo/emacs.d]] Captured On: [2024-04-12 Fri 10:55] ** Emacs Ediff Backlog [0/2] *** TODO Improve Ediff Configuration #+BEGIN_QUOTE I also found that ediff has numerous hooks over its functions and I try to make ediff a little handy over window operations. What I want is a window-configuration restore after ediff exits, so I will have window layout just as before ediff, also I want easily to restore ediff window layout after I break it (for example switch to other buffer in one of diffed window). So we get: ;; Some custom configuration to ediff (defvar my-ediff-bwin-config nil "Window configuration before ediff.") (defcustom my-ediff-bwin-reg ?b "*Register to be set up to hold `my-ediff-bwin-config' configuration.") (defvar my-ediff-awin-config nil "Window configuration after ediff.") (defcustom my-ediff-awin-reg ?e "*Register to be used to hold `my-ediff-awin-config' window configuration.") (defun my-ediff-bsh () "Function to be called before any buffers or window setup for ediff." (setq my-ediff-bwin-config (current-window-configuration)) (when (characterp my-ediff-bwin-reg) (set-register my-ediff-bwin-reg (list my-ediff-bwin-config (point-marker))))) (defun my-ediff-ash () "Function to be called after buffers and window setup for ediff." (setq my-ediff-awin-config (current-window-configuration)) (when (characterp my-ediff-awin-reg) (set-register my-ediff-awin-reg (list my-ediff-awin-config (point-marker))))) (defun my-ediff-qh () "Function to be called when ediff quits." (when my-ediff-bwin-config (set-window-configuration my-ediff-bwin-config))) (add-hook 'ediff-before-setup-hook 'my-ediff-bsh) (add-hook 'ediff-after-setup-windows-hook 'my-ediff-ash 'append) (add-hook 'ediff-quit-hook 'my-ediff-qh) This kind of configuration will do the following. WindowConfiguration before any ediff operations will be saved to a register defined in my-ediff-bwin-reg and window configuration after ediff complete on window layout will be saved to my-ediff-awin-reg, so in ediff mode you may restore the old window configuration by jumping to my-ediff-bwin-reg and jump back to ediff window configuration by jumping to my-ediff-awin-reg (see WindowConfiguration). After ediff quits, the old (before ediff) window configuration will be restored. #+END_QUOTE [[https://www.emacswiki.org/emacs/EdiffMode][EmacsWiki: Ediff Mode]] Captured On: [2023-10-22 Sun 02:34] *** TODO Ediff From the Command Line #+BEGIN_QUOTE From The Command Line bojohan wrote on gnu.emacs.help: (defun command-line-diff (switch) (let ((file1 (pop command-line-args-left)) (file2 (pop command-line-args-left))) (ediff file1 file2))) (add-to-list 'command-switch-alist '("diff" . command-line-diff)) ;; Usage: emacs -diff file1 file2 That version is nice, but it opens a new Emacs for every diff. If you do not want that then there were other suggestions on the list that instead uses GnuClient. With GNU Emacs 23.1.1 on Ubuntu 10.04, I was obliged to add a dash like below: (add-to-list 'command-switch-alist '("-diff" . command-line-diff)) #+END_QUOTE [[https://www.emacswiki.org/emacs/EdiffMode][EmacsWiki: Ediff Mode]] Captured On: [2023-10-22 Sun 02:38] ** Emacs Elfeed Backlog [0/6] *** TODO Document Elfeed Workflow in Comments *** TODO Elfeed Login to Site Suggestion From Skeeto #+BEGIN_QUOTE - SKEETO Assuming you're using the curl backend (you really should), you can rely on whatever features curl has for this, like netrc. For example, put your credentials in .netrc, then add "--netrc" to elfeed-curl-extra-arguments. - ALRABAN Thanks for the suggestion. I am using the curl backend. Does that work correctly with an encrypted .netrc? Last time I tried that with curl it didn't work, but that was (admittedly) years ago. It works fine with plaintext, but that's what I'm trying to avoid. In any case I'll give it a shot. #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/8mcpd9/elegant_way_to_provide_encrypted_credentials_to/][(3) Elegant way to provide encrypted credentials to elfeed or elfeed-protocol? : emacs]] Captured On: [2023-10-30 Mon 10:49] *** TODO Make Your Rss Enjoyable in Elfeed [[https://tsdh.org/posts/2021-08-12-make-your-rss-enjoyable-in-feed-readers-such-as-elfeed.html][Make Your RSS Enjoyable in Feed Readers Such as Elfeed]] Note: This has article shows how to alter key **** Article Article Link: https://tsdh.org/posts/2021-08-12-make-your-rss-enjoyable-in-feed-readers-such-as-elfeed.html Captured On: [2022-09-07 Wed 15:06] Make your RSS enjoyable in feed readers such as elfeed published: 2021-08-12 Yesterday Michael Eliachevitch (check out [[https://meliache.srht.site/][his blog]]) made me aware of the fact that [[https://www.tsdh.org/rss.xml][my RSS feed]] didn't contain the full postings but only excerpts, i.e., the first paragraph of each post. That means that if you read it with a feed reader such as [[https://github.com/skeeto/elfeed][elfeed]] (which I highly recommend!), you only can read that excerpt and have to visit the web page in order to read the complete post. (That might make sense if you have advertising on your page but I'm just happy if someone reads and likes one or another of my posts no matter how they consume it.) As it turns out, putting just an excerpt in the feed seems to be pretty much standard behavior. So better check your feed! In order to put your complete post content in the feed, you have to change {{ .Summary | html }} to {{ .Content | html }} in your RSS template in case you are using [[https://gohugo.io/][Hugo]]. If you are using [[https://cobalt-org.github.io/][cobalt]] like me, add default: # default value is "\n\n" excerpt_separator: "" to your _cobalt.yml. Make Elfeed use the secondary browser While we're at it: I read feeds using [[https://github.com/skeeto/elfeed][elfeed]] and don't want to leave emacs for reading complete posts in case the feed has only an excerpts. At least, there's [[https://www.gnu.org/software/emacs/manual/html_node/eww/index.html#Top][EWW, the Emacs Web Wowser]]. To read the rss contents, you just hit RET. In order to browse the post's web page, you hit b (elfeed-search-browse-url) which opens the page with browse-url-browser-function. If hit with prefix arg (C-u), it'll instead invoke the function bound to browse-url-generic. Normally, clicking an URL in emacs should call browse-url-button-open-url which usually calls browse-url-browser-function (browse-url-firefox for me), or, if a prefix arg is given, calls browse-url-secondary-browser-function (which I've set to eww). That's a convention used in vanilla emacs and other packages and I wish that elfeed conforms! So here's the .emacs snippet for doing so: #+begin_src emacs-lisp (defun th/elfeed-search-browse-url-maybe-with-scndry-browser (orig-fn &rest args) (cl-letf (((symbol-function 'browse-url-generic) #'browse-url-button-open-url)) (apply orig-fn args))) (advice-add 'elfeed-search-browse-url :around #'th/elfeed-search-browse-url-maybe-with-scndry-browser '((name "Make browse-url-generic call browse-url-button-open-url"))) #+end_src What doas that do? Well, it makes browse-url-button-open-url the function in the function slot of the symbol browse-url-generic during calls of elfeed-search-browse-url, i.e., when elfeed-search-browse-url calls browse-url-generic it'll actually call browse-url-button-open-url. So now I can hit b in elfeed to open a posting in firefox and C-u b will open it in EWW. Ah, what a relief! EDIT: 2021-08-13: Michael Eliachevitch just made me aware that this advice should also be added to elfeed-show-visit which gets called with b from inside an elfeed buffer that already shows the RSS description of a posting. So that would be: #+begin_src emacs-lisp (advice-add 'elfeed-show-visit :around #'th/elfeed-search-browse-url-maybe-with-scndry-browser '((name "Make browse-url-generic call browse-url-button-open-url"))) #+end_src Works like a charm. Thanks Michael! *** TODO More Elfeed Ideas [[https://blog.dornea.nu/2022/06/29/rss/atom-emacs-and-elfeed/][RSS/Atom, Emacs and elfeed - blog.dornea.nu]] Captured On: [2023-10-21 Sat 08:50] *** TODO RSS and Emacs [[https://blog.dornea.nu/2022/06/13/rss-and-atom-for-digital-minimalists/][RSS and Atom for digital minimalists - blog.dornea.nu]] Captured On: [2023-10-21 Sat 08:47] *** TODO Web-clip an Elfeed Entry Via a Single Keybinding also consider an immediate refile also consider moving the contents to an org-roam entry, asking for the title. *** TODO Elfeed doesn't appear to update properly. Needs testing. ** Emacs ERC Backlog [0/1] *** TODO Fix Gist Creation on Paste > 5 Lines in ERC ** Emacs Eshell / Vterm / EAT Backlog [0/11] *** TODO Check Into Multi-vterm [[https://github.com/suonlight/multi-vterm][suonlight/multi-vterm: Managing multiple vterm buffers in Emacs]] Captured On: [2023-07-16 Sun 07:46] *** TODO Get Remote Connections Working From Eshell The following two servers should work without error and with tolerable speed. Currently, they will hang/freeze Emacs in an apparent loop (reentrant Tramp issues) - cd /sshx:cjennings@obelisk.usbx.me:/home/cjennings - cd /sshx:cjennings@cjennings.net:/var/cjennings *** TODO Look Into Eat.el for Terminal Usage [[https://codeberg.org/akib/emacs-eat/][akib/emacs-eat: Emulate A Terminal, in a region, in a buffer and in Eshell - Codeberg.org]] Captured On: [2024-03-17 Sun 00:43] *** TODO Look Into Eat With Eshell https://www.reddit.com/r/emacs/comments/17a628r/using_eat_eshell/ Eat-eshell-mode turns the eshell buffer itself into an eat terminal. Since top is in eshell-visual-commands list, it gets run in a separate term mode buffer. To switch this out for an eat buffer, use eat-eshell-visual-command-mode. (use-package eat :custom (eat-term-name "xterm") :custom-face (ansi-color-bright-blue ((t (:foreground "#00afff" :background "#00afff")))) :config (evil-set-initial-state 'eat-mode 'emacs) (eat-eshell-mode) (eat-eshell-visual-command-mode)) also... you can set eat-term-name to xterm-256color and don't worry about the colors [[https://codeberg.org/akib/emacs-eat][akib/emacs-eat: Emulate A Terminal, in a region, in a buffer and in Eshell - Codeberg.org]] Captured On: [2024-03-27 Wed 14:15] *** TODO Look Into This Vterm Workflow #+BEGIN_QUOTE My configs are not public currently, but I'm a migrant from vim so I have a "leader" key which all of my keybindings are under. Currently this is implemented through Transient. I have it bound to ,, and then all hotkeys build off that kinda like spacemacs or doom. , n will toggle the last vterm window with vterm-toggle, , i is a new transient for my work stuff, , i s is a second new transient for my work server, and finally , i s s will launch the work server. All of my other keybindings are like that too. I have a few helper functions to run a command in a new vterm buffer, and then I bind those commands to the transient. You can also get fancy with passing arguments, which I do for my work server. Apologies, but I'd rather not share that setup, but I did learn it mostly from reading the magit code. I can share some of the other helper functions. (defun jg/new-or-existing-vterm (buffer-name) "Open an existing buffer or create one with the BUFFER-NAME given." (or (get-buffer buffer-name) (vterm buffer-name))) (defun jg/vterm-send-command (command) "Sends COMMAND to a REPL running in vterm." (vterm-send-string command) (vterm-send-return)) I would then use this like so: (defun jg/tuple () (interactive) (with-current-buffer (jg/new-or-existing-vterm "*tuple*") (jg/vterm-send-command "flatpak run app.tuple.app"))) Then I bind this jg/tuple function to the transient, and now I have it as a hotkey. #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/104ud8k/how_do_you_use_the_terminal_during_a_coding/][(1) How do you use the terminal during a coding session? : emacs]] Captured On: [2024-03-27 Wed 14:29] *** TODO Make Eshell Command Open New Eshell Instead of Reusing Existing (defun buffer-exists (bufname) (not (eq nil (get-buffer bufname)))) (defun make-shell (name) "Create a shell buffer named NAME." (interactive "sName: ") (if (buffer-exists "*eshell*") (setq eshell-buffer-name name) (message "eshell doesn't exist; using the default name: *eshell*")) (eshell)) or (defun make-shell (name) "Create a shell buffer named NAME." (interactive "sName: ") (setq name (concat "$" name)) (eshell) (rename-buffer name)) https://stackoverflow.com/questions/2540997/create-more-than-one-eshell-instance-in-emacs *** TODO Verify Ability to Call Dired From Tramp / Eshell on Remote Server could happen either in minibuffer or eshell *** TODO Workflow Test: Use Elisp Function on Files in Directory https://www.masteringemacs.org/article/complete-guide-mastering-eshell https://www.reddit.com/r/emacs/comments/k5zrlb/somehow_eshell_is_working_perfectly/ https://github.com/dieggsy/esh-autosuggest#esh-autosuggest https://emacs.stackexchange.com/questions/59862/unable-to-find-files-with-ssh-and-environment-variables https://github.com/emacs-jupyter/jupyter/issues/172 *** TODO Look into eshell prompt extras to help your eshell prompt [[https://github.com/zwild/eshell-prompt-extras][zwild/eshell-prompt-extras: Display extra information and color for your eshell prompt.]] Captured On: [2024-04-05 Fri 07:15] *** TODO Look into implementing function to jump to directories in Emacs + Eshell [[https://karthinks.com/software/jumping-directories-in-eshell/][Jumping directories in eshell | Karthinks]] Captured On: [2024-04-02 Tue 09:28] *** TODO Review Mastering Eshell again for tips [[https://www.masteringemacs.org/article/complete-guide-mastering-eshell][Mastering Eshell - Mastering Emacs]] Captured On: [2024-04-05 Fri 07:22] ** Emacs Flycheck Config Backlog [0/3] *** TODO Flycheck Hydra #+BEGIN_QUOTE Hydra / Flycheck Group Flycheck commands. (pretty-hydra-define hydra-flycheck (:hint nil :color teal :quit-key "q" :title (with-faicon "plane" "Flycheck" 1 -0.05)) ("Checker" (("?" flycheck-describe-checker "describe") ("d" flycheck-disable-checker "disable") ("m" flycheck-mode "mode") ("s" flycheck-select-checker "select")) "Errors" (("<" flycheck-previous-error "previous" :color pink) (">" flycheck-next-error "next" :color pink) ("f" flycheck-buffer "check") ("l" flycheck-list-errors "list")) "Other" (("M" flycheck-manual "manual") ("v" flycheck-verify-setup "verify setup")))) #+END_QUOTE [[https://github.com/rememberYou/.emacs.d/blob/master/config.org][.emacs.d/config.org at master · rememberYou/.emacs.d]] Captured On: [2023-11-19 Sun 17:24] *** TODO Flycheck Show Diagnostics Tip #+BEGIN_QUOTE with the latest flycheck (elpa): (setq flymake-show-diagnostics-at-end-of-line 'short) #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/17vp0o1/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 07:19] *** TODO Make proselinting more visible to user when needed (org, text, md modes) in flycheck-config ** Emacs Flyspell Config Backlog [0/3] *** TODO Nice Emacs Abbrevs Table #+BEGIN_QUOTE hellwolf_rt · 5 mo. ago I had fun generating abbrev_defs using chatgpt4: https://chat.openai.com/share/441c339e-1032-463d-afcb-9ca65f38d5e8 (result at https://github.com/hellwolf/.emacs.d/blob/master/abbrev_defs) #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/14l3jn8/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 08:59] *** TODO Fix Flyspell keybindings *** TODO removing flyspell keybindings should be placed with personal keymap definition ** Emacs Font Config Backlog [0/10] *** TODO Emacs Emoji Tips #+BEGIN_QUOTE Step 2 is to ensure you have a font which supports emoji, and that font is used for emoji by your fontset. I did this with an Emacs lisp function: (defun init-my-font () (set-face-font 'default (font-spec :family "" :size 10.3 :weight 'normal :width 'normal :slant 'normal)) (set-face-attribute 'default nil :height 103) ;; emoji font (set-fontset-font t 'symbol (font-spec :family "Noto Color Emoji" :size 10.3 :weight 'normal :width 'normal :slant 'normal)) ;; fallback font (set-fontset-font t nil (font-spec :family "DejaVu Sans Mono" :size 10.3 :weight 'normal :width 'normal :slant 'normal))) If you use Emacs without a daemon, I think it is sufficient to call this function in your init file by writing (init-my-font). But I use a daemon and it seems to require that you wait until you have a gui frame before setting up the fonts. I have this hook for that: (add-hook 'server-after-make-frame-hook (let (done) (lambda () (unless done ;; still set done to true even if we hit a bug (otherwise we ;; can never open a frame to see the problem) (setq done t) (init-my-font))))) Note that this snippet requires lexical scoping in your init file. #+END_QUOTE [[https://emacs.stackexchange.com/questions/62219/how-do-i-get-colour-emoji-to-display-in-emacs][fonts - How do I get colour emoji to display in Emacs - Emacs Stack Exchange]] Captured On: [2023-11-04 Sat 17:55] *** TODO Examine Textsize Package [[https://github.com/WJCFerguson/textsize/tree/master][WJCFerguson/textsize: Emacs package textsize.el to automatically choose a font point size for the Emacs default face.]] Captured On: [2023-11-04 Sat 17:17] *** TODO Font Discussion [[https://emacs.stackexchange.com/questions/5689/force-a-single-font-for-all-unicode-glyphs][Force a single font for all unicode glyphs - Emacs Stack Exchange]] Captured On: [2023-11-04 Sat 17:27] *** TODO How to Use Bold on Some Font-lock Keywords #+BEGIN_QUOTE I liked the light version of JetBrainsMono and I like to use bold on some font-lock (keywords for example). (set-face-attribute 'default nil :font "JetBrainsMono Nerd Font Mono" :height 170 :weight 'light) (set-face-attribute 'fixed-pitch nil :font "JetBrainsMono Nerd Font Mono" :height 170 :weight 'light) (set-face-attribute 'variable-pitch nil :font "Iosevka Aile" :height 170 :weight 'light) (custom-set-faces '(font-lock-comment-face ((t (:font "Iosevka Aile" :italic t :height 1.0))))) #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/13q0841/what_font_config_do_you_use_on_emacs/][(2) What font config do you use on emacs? : emacs]] Captured On: [2023-11-04 Sat 17:21] *** TODO Interesting Early-init.el Regarding Emacs Fonts [[https://github.com/Eason0210/.emacs.d/blob/master/early-init.el#L33-L82][.emacs.d/early-init.el at master · Eason0210/.emacs.d]] Captured On: [2023-11-04 Sat 17:22] *** TODO Look at Default-font-presets [[https://codeberg.org/ideasman42/emacs-default-font-presets][ideasman42/emacs-default-font-presets: Switch between a user defined list of fonts as well as scaling functionality. - emacs-default-font-presets - Codeberg.org]] Captured On: [2023-11-04 Sat 17:15] *** TODO New Emoji Support in Emacs 29 #+BEGIN_QUOTE Nice. Maybe worth a mention is that Emacs 29 includes now it's own package to select (and preview) emojis. From the NEWS file: **** Emoji +++ ***** Emacs now has several new methods for inserting Emojis. The Emoji commands are under the new 'C-x 8 e' prefix. +++ ***** New command 'emoji-insert' (bound to 'C-x 8 e e' and 'C-x 8 e i'). This command guides you through various Emoji categories and combinations in a graphical menu system. +++ ***** New command 'emoji-search' (bound to 'C-x 8 e s'). This command lets you search for Emojis based on names. +++ ***** New command 'emoji-list' (bound to 'C-x 8 e l'). This command lists all Emojis (categorized by themes) in a special buffer and lets you choose one of them. --- ***** New command 'emoji-recent' (bound to 'C-x 8 e r'). This command lets you choose among the Emojis you have recently inserted. +++ ***** New command 'emoji-describe' (bound to 'C-x 8 e d'). This command will tell you the name of the Emoji at point. (This command also works for non-Emoji characters.) ***** New input method 'emoji'. #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/sufy5z/native_emojis_in_emacs/][(2) Native Emojis in Emacs : emacs]] Captured On: [2023-11-04 Sat 18:04] *** TODO Testing Unicode Tips #+BEGIN_QUOTE Step 1 is to make sure that you have Cairo and Harfbuzz enabled. You can run this elisp and check the results to test this: (featurep 'cairo) ; should evaluate to t (frame-parameter (selected-frame) 'font-backend) ; should be a list starting with ftcrhb #+END_QUOTE [[https://emacs.stackexchange.com/questions/62219/how-do-i-get-colour-emoji-to-display-in-emacs][fonts - How do I get colour emoji to display in Emacs - Emacs Stack Exchange]] Captured On: [2023-11-04 Sat 17:54] *** TODO Various Font-related Config [[https://www.reddit.com/r/emacs/comments/ll8mlz/share_your_fontrelated_config/][(2) Share your font-related config : emacs]] Captured On: [2023-11-04 Sat 17:24] *** TODO Review Interesting Modus Themes Settings for Ideas #+BEGIN_QUOTE (use-package modus-themes :demand t :init (progn (setq modus-themes-bold-constructs t) (setq modus-themes-org-blocks 'greyscale) (setq modus-themes-italic-constructs t) (setq modus-themes-headings '((1 . (1.6)) (2 . (background 1.5)) (3 . (background bold 1.2)) (4 . (1.1)) (t . ()))) (load-theme 'modus-operandi)) :config (progn (with-eval-after-load 'pdf-tools ;; Configure PDF page colors. The code below comes from Modus ;; Info manual (Backdrop for pdf-tools (DIY)). (defun my/pdf-tools-backdrop () "Change background to be different from standard background." (face-remap-add-relative 'default `(:background ,(modus-themes-color 'bg-alt)))) (defun my/pdf-tools-midnight-mode-toggle () "Change background of pdf-view-mode to adapt to current Modus theme." (when (eq major-mode 'pdf-view-mode) (if (eq (car custom-enabled-themes) 'modus-vivendi) (pdf-view-midnight-minor-mode 1) (pdf-view-midnight-minor-mode -1)) (my/pdf-tools-backdrop))) (add-hook 'pdf-tools-enabled-hook #'my/pdf-tools-midnight-mode-toggle) (add-hook 'modus-themes-after-load-theme-hook #'my/pdf-tools-midnight-mode-toggle)))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:30] ** Emacs Games Backlog [0/5] *** TODO Convert Alternate Chess Pieces Into Proper Format *** TODO Eradio Channels Should Leverage ~/music/*.m3u and *.pls Files should pull in m3u files in ~/music directory *** TODO Investigate Chess instability *** TODO Make Chess Display Colors Configurable ;; map the following ;; chess-display-retract ;; LICHESS ;; light squares: #F0D9B5 ;; dark squares: #B58863 ;; CHESS.COM ;; light squares: #779556 ;; dark squares: #EBECD0 *** TODO Make Chess Engine Selectable ; do a completing-read with gnuchess, fruit, crafty, stockfish, etc. ;; (ideally based on what's found on the system's path) ** Emacs General Backlog [0/31 *** TODO Consider Collapsing Code and Project Directories Into One List You don't actually treat them any differently. Ideally, code-dir is where cloning repositories would go to, but even then, the user should choose as there are non-code git repositories. Having a list would also make the setup more flexible in case you wanted to use another directory in your agenda or as a refile target. *** TODO Add Current Directory Into Load-path in Emacs #+BEGIN_QUOTE Add current directory into load-path in Emacs 10 years ago   |   Source Tags :  elisp emacs en programming Useful when developing emacs plugin: (defun add-pwd-into-load-path () "add current directory into load-path, useful for elisp developers" (interactive) (let ((dir (expand-file-name default-directory))) (if (not (memq dir load-path)) (add-to-list 'load-path dir) ) (message "Directory added into load-path:%s" dir) ) ) #+END_QUOTE [[https://blog.binchen.org/posts/add-current-directory-into-load-path-in-emacs/][Add current directory into load-path in Emacs | Chen's blog]] Captured On: [2024-01-09 Tue 16:09] *** TODO Check Out This Replace Workflow Using Ripgrep, Consult, Embark and Wgrep #+BEGIN_QUOTE I love the combination of consult, ripgrep, embark, and wgrep: recursive grep-as-you-type with consult-ripgrep then save that to a buffer with embark export then make that buffer writable with C-x C-q (wgrep) then edit the output of ripgrep then save those edits with C-c C-c For example, if I have a url http://example.com/ in a bunch of note files, I can ripgrep to find them all, then put that in a buffer, query-replace to change them all to http://anothersite.com/, then save them. It will go out to all the files where it was found and change the url. #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/1benj4g/things_you_do_in_emacs_that_will_make_nonemacs/][(1) Things you do in Emacs that will make non-Emacs users go WOW? : emacs]] Captured On: [2024-03-24 Sun 16:47] *** TODO Consider Changing Emacs Kill Buffer to 'Kill Buffer and Delete Its Windows' #+BEGIN_QUOTE Kill Buffer and Delete Its Windows Command ‘kill-buffer-and-its-windows’, available in library Lisp:misc-cmds.el, kills the buffer and deletes all of its windows. The default buffer to kill is ‘current-buffer’. The argument to the command may be either a buffer or its name (a string). This command is especially useful as a replacement for command ‘kill-buffer’ when using Emacs Frames – see OneOnOneEmacs. Used with other frame-oriented functions, it also deletes the frame if the buffer is alone in the frame. Motivation: Command ‘kill-buffer’ displays a different buffer in the window, in place of one you’ve killed. With frames this is more annoying than useful. Command ‘kill-buffer-and-window’ just complains if you try to delete the sole window in a frame. Note: You can use ‘substitute-key-definition’ to replace all key bindings for ‘kill-buffer’ with bindings to ‘kill-buffer-and-its-windows’: (substitute-key-definition 'kill-buffer 'kill-buffer-and-its-windows global-map) #+END_QUOTE [[https://www.emacswiki.org/emacs/KillingBuffers#h5o-12][EmacsWiki: Killing Buffers]] Captured On: [2023-10-22 Sun 02:25] *** TODO Consider Literate DevOps [[https://howardism.org/Technical/Emacs/literate-devops.html][Literate DevOps]] Captured On: [2023-10-02 Mon 00:58] *** TODO Emacs Startup Tips #+BEGIN_QUOTE Tiny bootup speed tip: if you are on linux and use the gtk build of emacs, but you don't actually use any gtk stuff (menu, toolbar, scrollbar, etc. are hidden), then try the lucid build (or even, the "no" toolkit, --with-x-toolkit=no), emacs may boot up faster with it. On my pc, lucid build starts up ~150 msec faster than the gtk build. Another tip related to this: on my pc, non-gtk builds have an unnecessary wait during bootup. It turned out, emacs waits for some event from the X server, with the timeout of 0.1 sec. On my machine this makes bootup time 0.1 sec longer than it should be. I fixed this with (only one of these two is needed) (setq x-lax-frame-positioning t) (setq x-wait-for-event-timeout nil) in my early-init.el. Now, my fully configured emacs starts in 200 msec, which less than the stock gtk-build (emacs -Q). #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/14377k9/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 08:41] *** TODO Fix Blocking Error "Key Sequence C-c M-g Starts With Non-prefix Key C-c Esc" **** TODO Grep source for keybinding for emacs C-c M-g boot error **** 2023-07-18 @ 15:05:01 -0500 Problem description and the fix that wasn't. I believe I may have fixed a longstanding issue with this emacs config where invoking projectile before the init had finished would cause it to produce this error: Error running timer ‘require’: (error "Key sequence C-c M-g starts with non-prefix key C-c ESC") I believe this was caused by a :bind statement in use-package where the bind statement had double-parenthesis, e.g., :bind (("C-x g" . magit-status)) became :bind ("C-x g" . magit-status) After making the statement single-parenthesis, I can't reproduce the issue casually, so it's time to see if I can reproduce it intentionally/methodically. *** TODO Interesting Emacs Functions in Bashrc #+BEGIN_QUOTE emacs -nw is old, these days better to run emacs as deamon and connect through emacsclient, here is what I add to my .bashrc: # Emacs please if type emacs >/dev/null 2>/dev/null; then export ALTERNATE_EDITOR="" export VISUAL="emacsclient -c -a ''" # $VISUAL opens in GUI and waits export EDITOR="$VISUAL" function e() { emacsclient -c -a '' --eval "(progn (select-frame-set-input-focus (selected-frame)) (find-file \"$1\"))"; } function et() { emacsclient -t -a '' --eval "(progn (find-file \"$1\"))"; } function ediff() { emacsclient -c -a '' --eval "(progn (select-frame-set-input-focus (selected-frame)) (ediff-files \"$1\" \"$2\"))"; } function edired() { emacsclient -c -a '' --eval "(progn (select-frame-set-input-focus (selected-frame)) (dired \"$1\"))"; } function emagit() { emacsclient -c -a '' --eval "(progn (select-frame-set-input-focus (selected-frame)) (magit-status \"$1\"))"; } function ekill() { emacsclient --eval '(save-buffers-kill-emacs)'; } #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/16w9bvh/using_emacs_as_editor/][(2) Using Emacs as $EDITOR : emacs]] Captured On: [2023-12-03 Sun 15:26] *** TODO Investigate Nand2tetris Emacs Mode [[https://github.com/CestDiego/nand2tetris.el/tree/master][CestDiego/nand2tetris.el: Major Mode for HDL files in nand2tetris.]] Captured On: [2023-10-02 Mon 00:31] *** TODO Look into Emacs Collaborative Editing Environment [[https://github.com/zaeph/crdt.el][zaeph/crdt.el]] Captured On: [2023-10-02 Mon 00:06] *** TODO Look into Philip Lord's Emacs Packages [[http://homepages.cs.ncl.ac.uk/phillip.lord/emacs.html][Emacs Packages]] Captured On: [2023-11-23 Thu 12:33] *** TODO Look Into Vmtouch for Emacs Speed https://blog.binchen.org/posts/emacs-speed-up-1000/ [[https://github.com/hoytech/vmtouch/blob/master/vmtouch.pod][vmtouch/vmtouch.pod at master · hoytech/vmtouch]] Captured On: [2024-01-09 Tue 16:16] *** TODO Toggle full view of window in Emacs #+BEGIN_QUOTE Toggle full view of window in Emacs 10 years ago   |   Source Tags :  emacs en Add below code into your ~/.emacs: (defun toggle-full-window() "Toggle the full view of selected window" (interactive) ;; @see http://www.gnu.org/software/emacs/manual/html_node/elisp/Splitting-Windows.html (if (window-parent) (delete-other-windows) (winner-undo) )) #+END_QUOTE [[https://blog.binchen.org/posts/toggle-full-view-of-window-in-emacs/][Toggle full view of window in Emacs | Chen's blog]] Captured On: [2024-01-09 Tue 16:12] *** TODO Update and Create File Headers in Emacs Lisp [[https://www.emacswiki.org/emacs/header2.el][EmacsWiki: header2.el]] Captured On: [2023-10-02 Mon 00:35] *** TODO Using Emacs as $EDITOR #+BEGIN_QUOTE 30 Sep 2023 Using Emacs as $EDITOR Continuing on from my experiment with using Emacs as for scrollback in my terminal multiplexer I thought I'd try to use it as my $EDITOR as well. The two main cases where I use $EDITOR is 1 The occasional use of git on the command line, rebasing or writing a commit message, and 2 Use of ZSH's edit-command-line functionality. To make sure Emacs is starting up quickly enough I'm using the same small setup I created for the scrollback editing, so I'm now setting EDITOR like this export EDITOR="emacs -nw --init-directory ~/.se.d" Now that I want to use the same setup for editing I can't really jump into view-mode every time Emacs starts so I have to be a bit more clever. The following bit won't do (add-hook 'find-file-hook #'view-mode) I need to somehow find out what starts Emacs and then only modify the hook when needed. Unfortunately I haven't found anything that reveals that Emacs is started by zellij. Creating a separate little script that zellij uses would be an option, of course, but for now I've opted to make it the default and instead refrain from adding the hook in the other two use cases. ZSH doesn't make it easy to find out that it's edit-command-line either, but as I've observed that the command line sometimes doesn't look right after leaving the editor I wanted to call redisplay to fix it up. That means I need to have a function anyway, so using an environment variable becomes an easy way to check if Emacs is being used to edit the command line. function se-edit-command-line() { export SE_SKIP_VIEW=y zle edit-command-line unset SE_SKIP_VIEW zle redisplay } zle -N se-edit-command-line bindkey -M vicmd '^V' se-edit-command-line bindkey -M viins '^V' se-edit-command-line Unfortunately is seems zle edit-command-line doesn't pass on non-exported environment variables, hence the explicit export and unset. When git starts an editor it sets a few environment variables so it was easy to just pick one that is set in both cases I care about. I picked GIT_EXEC_PATH. With these things in place I changed the slim setup to only add the hook when neither of the environment variables are present (unless (or (getenv "SE_SKIP_VIEW") (getenv "GIT_EXEC_PATH")) (add-hook 'find-file-hook #'view-mode)) Hopefully this works out well enough that I won't feel a need to go back to using Neovim as my $EDITOR. Tags: emacs zsh Comment here. #+END_QUOTE [[https://magnus.therning.org/2023-09-30-using-emacs-as-$editor.html][Using Emacs as $EDITOR]] Captured On: [2023-10-11 Wed 21:42] *** TODO Look into MPDel for Music and Playlist Management [[https://github.com/mpdel/mpdel][mpdel/mpdel: Emacs user interface for MPD]] Captured On: [2024-04-05 Fri 14:05] *** TODO Research X-apply-session-resources Setting for Early Init #+BEGIN_QUOTE ;; Ignore X resources; its settings would be redundant with the other settings ;; in this file and can conflict with later config (particularly where the ;; cursor color is concerned). (advice-add #'x-apply-session-resources :override #'ignore) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/early-init.el][emacs.d/early-init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:12] *** TODO Deactivate Beeping in system-defaults.el #+BEGIN_QUOTE ;; Deactivate beeping (setq ring-bell-function (lambda ())) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:14] *** TODO Investigate face-near-same-color-threshold setting for init.el #+BEGIN_QUOTE ;; Apply recommendation from modus Info manual: (setq face-near-same-color-threshold 45000) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:14] *** TODO Consider this setting for more readable stacktraces #+BEGIN_QUOTE User Option: debugger-stack-frame-as-list ¶ If this variable is non-nil, every stack frame of the backtrace is displayed as a list. This aims at improving the backtrace readability at the cost of special forms no longer being visually different from regular function calls. With debugger-stack-frame-as-list non-nil, the above example would look as follows: ----------- Buffer: backtrace-output ------------ (backtrace) (list 'testing (backtrace)) (progn ...) (eval (progn (1+ var) (list 'testing (backtrace)))) (setq ...) (save-excursion ...) (let ...) (with-output-to-temp-buffer ...) (eval (with-output-to-temp-buffer ...)) (eval-last-sexp-1 nil) (eval-last-sexp nil) (call-interactively eval-last-sexp) ----------- Buffer: backtrace-output ------------ #+END_QUOTE [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Internals-of-Debugger.html][Internals of Debugger (GNU Emacs Lisp Reference Manual)]] Captured On: [2024-04-05 Fri 14:20] *** TODO Print larger lists before abbreviating in edebug #+BEGIN_QUOTE (use-package edebug :init (setq edebug-print-length 5000)) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:24] *** TODO Unify the Way Emacs Opens Files Across Packages [[https://github.com/DamienCassou/unify-opening][DamienCassou/unify-opening: Emacs package to make everything use the same mechanism to open files]] Captured On: [2024-04-05 Fri 15:28] *** TODO Evaluate saveplace mode for Emacs #+BEGIN_QUOTE (use-package saveplace :demand t :config (progn (save-place-mode))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:33] *** TODO Avy config for issuing other commands #+BEGIN_QUOTE (use-package avy :bind* (("C-," . avy-goto-char-timer) :map isearch-mode-map ("C-," . avy-isearch)) :bind (("M-g g" . avy-goto-line)) :init (progn ;; home row on a Colemak keyboard: (setq avy-keys '(?a ?r ?s ?t ?d ?h ?n ?e ?i ?o)) ;; Let me easily use actions beyond jump: (setq avy-single-candidate-jump nil) (setq avy-flyspell-correct-function #'ispell-word) (setq avy-timeout-seconds 0.4)) :config (progn (defmacro my/avy-without-moving-point (point &rest body) "Move point to POINT than execute BODY and restore previous location." (declare (indent 1)) `(unwind-protect (save-excursion (goto-char point) ,@body) (select-window (cdr (ring-ref avy-ring 0))))) (defun my/avy-action-help (point) "Show the Emacs help for thing at POINT." (my/avy-without-moving-point point (helpful-at-point))) (defun my/avy-action-kill-whole-line (point) "Kill the whole line at POINT." (my/avy-without-moving-point point (kill-whole-line))) (defun my/avy-action-embark (point) "Start `embark-act' at POINT." (my/avy-without-moving-point point (embark-act))) (setq avy-dispatch-alist '( ;; (?a) in avy-keys ;; (?b) ;; (?c) ;; (?d) in avy-keys ;; (?e) in avy-keys ;; (?f) ;; (?g) ;; (?h) in avy-keys ;; (?i) in avy-keys ;; (?j) ;; (?k) ;; (?l) ;; (?m) ;; (?n) in avy-keys ;; (?o) in avy-keys ;; (?p) ;; (?q) ;; (?r) in avy-keys ;; (?s) in avy-keys ;; (?t) in avy-keys ;; (?u) ;; (?v) ;; (?w) ;; (?x) ;; (?y) ;; (?z) ;; (?A) ;; (?B) ;; (?C) ;; (?D) ;; (?E) ;; (?F) ;; (?G) ;; (?H) ;; (?I) ;; (?J) ;; (?K) ;; (?L) ;; (?M) ;; (?N) ;; (?O) ;; (?P) ;; (?Q) ;; (?R) ;; (?S) ;; (?T) ;; (?U) ;; (?V) ;; (?W) ;; (?X) ;; (?Y) ;; (?Z) (?$ . avy-action-ispell) (?? . my/avy-action-help) (?\C-w . avy-action-kill-stay) (?\C-k . my/avy-action-kill-whole-line) (?\M-w . avy-action-copy) (?\C-\S-a . my/avy-action-embark))))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 16:04] *** TODO Investigate auto-compile package #+BEGIN_QUOTE (use-package auto-compile :demand t :init (progn (setq auto-compile-display-buffer nil) (setq auto-compile-source-recreate-deletes-dest t) (setq auto-compile-toggle-deletes-nonlib-dest t) (setq auto-compile-update-autoloads t)) :hook (auto-compile-inhibit-compile . auto-compile-inhibit-compile-detached-git-head) :config (progn (auto-compile-on-load-mode) (auto-compile-on-save-mode) (auto-compile-use-mode-line-set nil nil))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:16] *** TODO Investigate make executable if script Looks like it makes scripts executable on save #+BEGIN_QUOTE (use-package executable :hook (after-save . executable-make-buffer-file-executable-if-script-p)) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:25] *** TODO Investigate Drag-stuff to Replace Moving Regions Up/Down perhaps you can also move it across to a specific column? #+BEGIN_QUOTE (use-package drag-stuff :demand t :config (progn (drag-stuff-global-mode) (drag-stuff-define-keys) (dolist (mode '(org-mode rebase-mode emacs-lisp-mode mpdel-playlist-current-playlist-mode)) (add-to-list 'drag-stuff-except-modes mode)))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 15:26] *** TODO Goggles eye-candy for modified region [[https://github.com/minad/goggles][minad/goggles: goggles.el - Pulse modified region]] Captured On: [2024-04-05 Fri 15:23] *** TODO Investigate runner for issuing common commands in dired [[https://github.com/thamer/runner][thamer/runner: Improved "open with" suggestions for dired mode in Emacs]] (use-package runner :demand t :after dired :init (progn (setq runner-run-in-background t))) Captured On: [2024-04-05 Fri 15:16] *** TODO Investigate lin package for hl-highlighting #+BEGIN_QUOTE Package lin is available. Status: Available from gnu-local -- Install Archive: gnu-local Version: 1.0.0 Commit: 09cf249c78385502a2ead30c4fa1468cf96939f7 Summary: Make `hl-line-mode' more suitable for selection UIs Requires: emacs-27.1 Website: https://git.sr.ht/~protesilaos/lin Keywords: convenience faces theme Maintainer: Lin Development <~protesilaos/lin@lists.sr.ht> Author: Protesilaos Stavrou Other versions: 1.0.0 (gnu). ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ LIN IS NOTICEABLE (LIN.EL) Protesilaos Stavrou info@protesilaos.com ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ This manual, written by Protesilaos Stavrou, describes the specifics of `lin.el'. The documentation furnished herein corresponds to stable version 1.0.0, released on 2022-09-08. Any reference to a newer feature which does not yet form part of the latest tagged commit, is explicitly marked as such. Current development target is 1.1.0-dev. ⁃ Package name (GNU ELPA): `lin' ⁃ Official manual: ⁃ Change log: ⁃ Git repo on SourceHut: • Mirrors: ⁃ GitHub: ⁃ GitLab: ⁃ Mailing list: Table of Contents ───────────────── 1. COPYING 2. Overview LIN 3. Installation .. 1. GNU ELPA package .. 2. Manual installation 4. Sample configuration 5. Acknowledgements 6. GNU Free Documentation License 7. Indices .. 1. Function index .. 2. Variable index .. 3. Concept index 1 COPYING ═════════ Copyright (C) 2021-2022 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being “A GNU Manual,” and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled “GNU Free Documentation License.” (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and modify this GNU manual.” 2 Overview LIN ══════════════ Lin is a stylistic enhancement for Emacs’ built-in `hl-line-mode'. It remaps the `hl-line' face (or equivalent) buffer-locally to a style that is optimal for major modes where line selection is the primary mode of interaction. The idea is that `hl-line-mode' cannot work equally well for contexts with competing priorities: (i) line selection, or (ii) simple line highlight. In the former case, the current line needs to be made prominent because it carries a specific meaning of some significance in the given context: the user has to select a line. Whereas in the latter case, the primary mode of interaction does not revolve around the line highlight itself: it may be because the focus is on editing text or reading through the buffer’s contents, so the current line highlight is more of a reminder of the point’s location on the vertical axis. `lin-mode' enables `hl-line-mode' in the current buffer and remaps the appropriate face to the `lin-face'. The `lin-global-mode' follows the same principle, though it applies to all hooks specified in the user option `lin-mode-hooks'. Users can select their preferred style by customizing the user option `lin-face'. Options include the faces `lin-red', `lin-green', `lin-yellow', `lin-blue' (default), `lin-magenta', `lin-cyan', `lin-mac', `lin-red-override-fg', `lin-green-override-fg', `lin-yellow-override-fg', `lin-blue-override-fg', `lin-magenta-override-fg', `lin-cyan-override-fg', `lin-mac-override-fg', or any other face that preferably has a background attribute. The Lin faces with the `-override-fg' suffix set a foreground value which replaces that of the underlying text. Whereas the others only specify a background attribute. 3 Installation ══════════════ 3.1 GNU ELPA package ──────────────────── The package is available as `lin'. Simply do: ┌──── │ M-x package-refresh-contents │ M-x package-install └──── And search for it. GNU ELPA provides the latest stable release. Those who prefer to follow the development process in order to report bugs or suggest changes, can use the version of the package from the GNU-devel ELPA archive. Read: . 3.2 Manual installation ─────────────────────── Assuming your Emacs files are found in `~/.emacs.d/', execute the following commands in a shell prompt: ┌──── │ cd ~/.emacs.d │ │ # Create a directory for manually-installed packages │ mkdir manual-packages │ │ # Go to the new directory │ cd manual-packages │ │ # Clone this repo, naming it "lin" │ git clone https://git.sr.ht/~protesilaos/lin lin └──── Finally, in your `init.el' (or equivalent) evaluate this: ┌──── │ ;; Make Elisp files in that directory available to the user. │ (add-to-list 'load-path "~/.emacs.d/manual-packages/lin") └──── Everything is in place to set up the package. 4 Sample configuration ══════════════════════ ┌──── │ (require 'lin) │ │ (setq lin-face 'lin-blue) ; check doc string for alternative styles │ │ ;; You can use this to live update the face: │ ;; │ ;; (customize-set-variable 'lin-face 'lin-green) │ │ (setq lin-mode-hooks │ '(bongo-mode-hook │ dired-mode-hook │ elfeed-search-mode-hook │ git-rebase-mode-hook │ grep-mode-hook │ ibuffer-mode-hook │ ilist-mode-hook │ ledger-report-mode-hook │ log-view-mode-hook │ magit-log-mode-hook │ mu4e-headers-mode │ notmuch-search-mode-hook │ notmuch-tree-mode-hook │ occur-mode-hook │ org-agenda-mode-hook │ pdf-outline-buffer-mode-hook │ proced-mode-hook │ tabulated-list-mode-hook)) │ │ (lin-global-mode 1) └──── Check out Christian Tietze’s blog post on integrating Lin with Neotree: . 5 Acknowledgements ══════════════════ Lin is meant to be a collective effort. Every bit of help matters. Author/maintainer Protesilaos Stavrou. Contributions to code or documentation Christian Tietze, Damien Cassou, Federico Stilman, Gautier Ponsinet, Kai von Fintel, Nicolas De Jaeghere. #+END_QUOTE [[help:Package][]] Captured On: [2024-04-05 Fri 14:43] *** TODO Check into spacious padding mode Sample Config from Damien Cassou's Emacs Config #+BEGIN_QUOTE (use-package spacious-padding :demand t :hook (server-after-make-frame . spacious-padding-mode) :config (progn (setq spacious-padding-subtle-mode-line '(:mode-line-active error :mode-line-inactive shadow)))) #+END_QUOTE [[https://raw.githubusercontent.com/DamienCassou/emacs.d/master/init.el][]] Captured On: [2024-04-06 Sat 10:54] *** TODO [#D] Google-this Warning Issues to Fix https://github.com/Malabarba/emacs-google-this/issues/31 Warning (comp): google-this.el:105:1: Warning: custom-declare-variable `google-this-suspend-after-search' docstring wider than 80 characters Disable showing Disable logging Warning (comp): google-this.el:137:8: Warning: docstring wider than 80 characters Disable showing Disable logging Warning (comp): google-this.el:472:11: Warning: Use keywords rather than deprecated positional arguments to `define-minor-mode' Disable showing Disable logging Warning (comp): google-this.el:133:43: Warning: the function ‘google-maps’ is not known to be defined. Disable showing Disable logging Warning (comp): google-this.el:131:43: Warning: the function ‘google-this-maps’ is not known to be defined. Disable showing Disable logging ** Emacs Help Config Backlog [0/1] *** TODO Remap keys from regular help to these instead of overwriting them in help-config ** Emacs Host Environment Backlog [0/1] *** TODO Checking on Emacs Lisp to Identify Trackpoint [[https://emacs.stackexchange.com/questions/41349/use-mouse-buttons-as-modifiers][key bindings - Use mouse buttons as modifiers - Emacs Stack Exchange]] Captured On: [2023-12-02 Sat 23:21] ** Emacs Hugo Config Backlog [0/3] *** TODO Good Read on Org-roam and Hugo / Ox-Hugo [[https://blog.dornea.nu/2022/10/04/migrate-tiddlywiki-to-org-roam-part-2-org-roam-and-hugo/][Migrate Tiddlywiki to org-roam - Part 2: org-roam and hugo - blog.dornea.nu]] Captured On: [2023-10-21 Sat 08:42] *** TODO Is Org-page Better Than Ox-hugo for Blogging? [[https://github.com/emacsorphanage/org-page][GitHub - emacsorphanage/org-page: [INACTIVE] A static site generator based on Emacs and org mode.]] Captured On: [2023-11-10 Fri 17:26] *** TODO Read the Ox Hugo Manual [[https://ox-hugo.scripter.co/][ox-hugo - Org to Hugo exporter]] Captured On: [2024-03-22 Fri 16:59] ** Emacs Keybinding / Hydra / Transient Config Backlog [0/4] *** TODO Look at Pretty Hydra and Major Mode Hydra [[https://github.com/jerrypnz/major-mode-hydra.el/tree/5181a31631589ffd870f70293aeee00b7b773b58][GitHub - jerrypnz/major-mode-hydra.el at Pu5181a31631589ffd870f70293aeee00b7b773b58]] Captured On: [2023-12-06 Wed 13:27] *** TODO More Hydra Examples for Review [[https://github.com/abo-abo/hydra/blob/master/hydra-examples.el][hydra/hydra-examples.el at master · abo-abo/hydra]] Captured On: [2023-11-19 Sun 17:21] *** TODO Speedrect Quick key bindings and other tools for Emacs' rectangle-mark-mode. [[https://github.com/jdtsmith/speedrect][jdtsmith/speedrect: Quick key bindings and other tools for rectangle-mark-mode]] Captured On: [2023-10-27 Fri 11:09] *** TODO Using keyfreq to optimize keybindings [[https://blog.binchen.org/posts/how-to-be-extremely-efficient-in-emacs/][How to be extremely efficient in Emacs | Chen's blog]] Captured On: [2024-01-09 Tue 15:57] ** Emacs Latex Config Backlog [0/3] *** TODO Good Latex Emacs Config [[https://michaelneuper.com/posts/efficient-latex-editing-with-emacs/][Efficient LaTeX Editing With Emacs - Michael]] Captured On: [2023-11-18 Sat 08:04] *** TODO Collapse graphviz config into the LaTeX Config or other suitable module *** TODO latex config [[https://gist.github.com/karthink/7d89df35ee9b7ac0c93d0177b862dadb][Configuration for super-fast Latex input using AucTeX, CDLatex and a bit of YaSnippet. See https://karthinks.com/software/latex-input-for-impatient-scholars]] Captured On: [2024-04-04 Thu 23:18] ** Emacs Ledger Config Backlog [0/6] *** TODO Hydra for Ledger #+BEGIN_QUOTE Hydra / Ledger Group Ledger commands. (pretty-hydra-define hydra-ledger (:hint nil :color teal :quit-key "q" :title (with-faicon "usd" "Ledger" 1 -0.05)) ("Action" (("b" leadger-add-transaction "add") ("c" ledger-mode-clean-buffer "clear") ("i" ledger-copy-transaction-at-point "copy") ("s" ledger-delete-current-transaction "delete") ("r" ledger-report "report")))) #+END_QUOTE [[https://github.com/rememberYou/.emacs.d/blob/master/config.org][.emacs.d/config.org at master · rememberYou/.emacs.d]] Captured On: [2023-11-19 Sun 17:25] *** TODO Ledger-Mode Config to Review #+BEGIN_QUOTE Money Management Good money management is a skill to be acquired as soon as possible. Fortunately for us, Ledger allows you to have a double-entry accounting system directly from the UNIX command line. To use Ledger with GNU Emacs, you need to the ledger-mode package. However, do not forget to install the ledger package with your system package manager. I discovered Ledger as a student and learning how to manage time and expenses at the same time was too much. I decided for the time being to briefly learn Ledger and focus more on time management. One issue I had with Ledger was the lack of support from my bank to export my transactions into a file type that Ledger could understand. Unfortunately, since I often made bank transfers, encoding each payment by hand was a pain. For the curious people, alternatives to Ledger exist, some of which are open-source and proprietary (e.g., YNAB). NOTE: by default, Ledger uses the ISO 8601 format to write dates, which is the recommended format. (use-package ledger-mode :mode ("\\.\\(dat\\|ledger\\)\\'") :preface (defun my/ledger-save () "Clean the ledger buffer at each save." (interactive) (ledger-mode-clean-buffer) (save-buffer)) :bind (:map ledger-mode-map ("C-x C-s" . my/ledger-save)) :hook (ledger-mode . ledger-flymake-enable) :custom (ledger-clear-whole-transactions t) (ledger-reconcile-default-commodity "EUR") (ledger-reports '(("account statement" "%(binary) reg --real [[ledger-mode-flags]] -f %(ledger-file) ^%(account)") ("balance sheet" "%(binary) --real [[ledger-mode-flags]] -f %(ledger-file) bal ^assets ^liabilities ^equity") ("budget" "%(binary) --empty -S -T [[ledger-mode-flags]] -f %(ledger-file) bal ^assets:bank ^assets:receivables ^assets:cash ^assets:budget") ("budget goals" "%(binary) --empty -S -T [[ledger-mode-flags]] -f %(ledger-file) bal ^assets:bank ^assets:receivables ^assets:cash ^assets:'budget goals'") ("budget obligations" "%(binary) --empty -S -T [[ledger-mode-flags]] -f %(ledger-file) bal ^assets:bank ^assets:receivables ^assets:cash ^assets:'budget obligations'") ("budget debts" "%(binary) --empty -S -T [[ledger-mode-flags]] -f %(ledger-file) bal ^assets:bank ^assets:receivables ^assets:cash ^assets:'budget debts'") ("cleared" "%(binary) cleared [[ledger-mode-flags]] -f %(ledger-file)") ("equity" "%(binary) --real [[ledger-mode-flags]] -f %(ledger-file) equity") ("income statement" "%(binary) --invert --real -S -T [[ledger-mode-flags]] -f %(ledger-file) bal ^income ^expenses -p \"this month\"")) (ledger-report-use-header-line nil))) Finally, to provides a flychecker checker for Ledger files, you can use flycheck-ledger. (use-package flycheck-ledger :after ledger-mode) #+END_QUOTE [[https://github.com/rememberYou/.emacs.d/blob/master/config.org][.emacs.d/config.org at master · rememberYou/.emacs.d]] Captured On: [2023-11-19 Sun 17:29] *** TODO Recording Ledger Entries With Org-capture-templates #+BEGIN_QUOTE Emacs: Recording ledger entries with org-capture-templates Posted: Nov 23, 2010 - Modified: May 27, 2014| emacs Updated 2014-05-26: Thanks to Greg for the updated link to https://github.com/ledger/ledger/wiki ! I use John Wiegley's ledger program to keep track of my personal finances. It's quick, it's light, and it lets me slice-and-dice my data however I want. I enjoy opening my ledger file and adding transactions to it. (Particularly if it involves income!) Yes, I'm that kind of weird. I wanted to make it even easier to add entries. Instead of using C-x C-f to find the file, using ESC > to go to the end of the buffer, and typing in the transactions, I decided to add some of my common transactions to org-capture-templates. Here's the relevant snippet: (setq org-capture-templates (append '(("l" "Ledger entries") ("lm" "MBNA" plain (file "~/personal/ledger") "%(org-read-date) %^{Payee} Liabilities:MBNA Expenses:%^{Account} %^{Amount} ") ("lc" "Cash" plain (file "~/personal/ledger") "%(org-read-date) * %^{Payee} Expenses:Cash Expenses:%^{Account} %^{Amount} ")) org-capture-templates)) I've bound org-capture to C-c r using (global-set-key (kbd "C-c r") 'org-capture), so now I can use C-c r l m to create an entry for my MBNA Mastercard. This keyboard shortcut might not seem short to you, but if you think about it as C-c remember ledger Mastercard, it makes perfect sense. =) (Besides, org-capture prompts me just in case I forget.) Hooray for org-capture! #+END_QUOTE [[https://sachachua.com/blog/tag/ledger/][tag - ledger :: Sacha Chua]] Captured On: [2023-11-18 Sat 07:11] *** TODO Using Flymake With Ledger #+BEGIN_QUOTE To use flymake with ledger in Emacs 26.1 or higher, just do: (add-hook 'ledger-mode-hook #'ledger-flymake-enable) #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/8x4xtt/tip_how_i_use_ledger_to_track_my_money/][(2) TIP: How I use ledger to track my money : emacs]] Captured On: [2023-11-18 Sat 07:16] *** TODO Large Ledger Configuration #+BEGIN_QUOTE (use-package ledger-mode :hook (ledger-mode . my/configure-ledger-mode) :mode "\\.hledger\\'" :bind ( :map ledger-mode-map ("C-c C-r" . ledger-report) ("C-c C-c" . my/ledger-lint) ;; To get outline-minor-mode in ledger buffers: ("TAB" . org-cycle) :map ledger-report-mode-map ("C-c C-r" . ledger-report)) :init (progn (setq ledger-reports (mapcar (lambda (pair) (list (car pair) (format "%s %s" "%(binary) -f %(ledger-file)" (cdr pair)))) '(("Account statement" . "register --ignore-assertions --auto ^%(account)") ("Income statement" . "balance --ignore-assertions --auto --tree --period %(month) --invert ^income ^expense") ("Balance sheet" . "balance --ignore-assertions --auto --tree ^asset ^debt \"^equity:\"") ("Budget" . "balance --ignore-assertions --auto --tree --empty ^budget not:unbudgeted")))) ;; For hledger (progn (setq ledger-mode-should-check-version nil) (setq ledger-binary-path (executable-find "hledger")) (setq ledger-report-links-in-register nil) (setq ledger-report-native-highlighting-arguments '("--color=always")) (setq ledger-report-auto-width nil)) (setq ledger-reconcile-default-commodity "EUR") (setq ledger-report-use-header-line t) (setq ledger-report-use-native-highlighting t) (setq ledger-report-auto-refresh-sticky-cursor t) (setq ledger-report-use-strict t) (setq ledger-highlight-xact-under-point nil) (setq ledger-copy-transaction-insert-blank-line-after t) (defun my/ledger-configure-outline-minor-mode () "Configure a ledger buffer when `outline-minor-mode' is active." (font-lock-add-keywords 'ledger-mode outline-font-lock-keywords) (setq-local ;; copied from outline-mode major mode: imenu-generic-expression (list (list nil (concat "^\\(?:" outline-regexp "\\).*$") 0)))) (defun my/configure-ledger-mode () "Configure the current Ledger buffer." ;; use TAB to complete: (setq-local tab-always-indent 'complete) (add-hook 'outline-minor-mode-hook #'my/ledger-configure-outline-minor-mode nil t))) :config (progn (let ((date-format "%A, %B %-e")) (defun my/ledger-position-at-date (moment) "Move point in current buffer to insert new transaction at MOMENT. MOMENT is an encoded date." (let ((heading (format "*** %s" (format-time-string date-format moment)))) (goto-char (point-min)) (search-forward heading) (forward-line) (re-search-forward "; \\*\\*\\*" nil t) (goto-char (line-beginning-position))))) (advice-add #'ledger-xact-find-slot :override #'my/ledger-position-at-date) (defun my/ledger-lint () "Lint my ledger file." (interactive) (require 'autoclose-shell) (save-buffer) (autoclose-shell-start "lint-system" '("lint-system"))) (defun my/ledger-insert-mortgage-transaction () "Read accounting data for MORTGAGE and write the ledger entry." (interactive) (ensure-empty-lines 1) (let* ((description (read-string "Description: ")) (date (ledger-read-date "Date: ")) (begining (point))) (insert (format "%s %s\n" date description)) (insert (format " asset:current:couple 0\n")) (insert (format " expense:misc 0\n")) (save-excursion (goto-char begining) (my/ledger-mortgage-rewrite)))) (defun my/ledger-mortgage-read-numbers () "Returns the numbers of the current mortgage reimbursement transaction. The returned value is of the form (:capital CAPITAL :insurance INSURANCE :interest INTEREST)." (cl-labels ((parse-number (string) (string-to-number (string-replace "," "." string)))) (let* ((number-regexp (rx (1+ (any digit)) ?, (1+ (any digit)))) (regexp (rx "ECHEANCE PRET" (? " -") " DONT CAP " (group-n 1 (regexp number-regexp)) " ASS. " (group-n 2 (regexp number-regexp)) "E" (? " -") " INT. " (group-n 3 (regexp number-regexp)) (? " COM. 0,00E")))) (save-match-data (save-excursion (ledger-navigate-beginning-of-xact) (when-let* (((re-search-forward regexp (line-end-position))) (capital (parse-number (match-string 1))) (insurance (parse-number (match-string 2))) (interest (parse-number (match-string 3)))) (list :capital capital :insurance insurance :interest interest))))))) (defun my/ledger-mortgage-guess-type (numbers) "Return the type of the transaction with NUMBERS. The type is either 'ecoptz, 'immo1 or 'immo2. NUMBERS is of the form (:capital CAPITAL :insurance INSURANCE :interest INTEREST)." (cond ((and (>= (map-elt numbers :insurance) 0.1) (= (map-elt numbers :interest) 0)) 'ecoptz) ((or (>= (map-elt numbers :insurance) 0.1) (= (map-elt numbers :interest) 0)) (user-error "Invalid numbers: %S" numbers)) ((>= (map-elt numbers :capital) 700) 'immo1) (t 'immo2))) (defun my/ledger-mortgage-rewrite () "Rewrite the mortgage transaction at point." (interactive) (when-let* ((numbers (my/ledger-mortgage-read-numbers)) (total (seq-reduce #'+ (map-values (my/ledger-mortgage-read-numbers)) 0)) (mortgage-type (my/ledger-mortgage-guess-type numbers))) (save-match-data (save-excursion (ledger-navigate-beginning-of-xact) (when (re-search-forward " .*$" (line-end-position)) ; skip date (replace-match " banque populaire prêt" t) (next-line) (delete-region (line-beginning-position) (line-end-position)) (insert (format " asset:current:couple %.2f" (- total))) (ledger-navigate-end-of-xact) (delete-region (line-beginning-position) (line-end-position)) (map-do (lambda (number-type number) (when (> number 0) (let ((account (if (eq number-type :insurance) "expense:util:insurance" (format "expense:mortgage:%s%s" mortgage-type number-type)))) (insert " " account " " (number-to-string number) "\n")))) numbers) (delete-backward-char 1) ; remove additional newline (ledger-post-align-dwim)))))))) (use-package flymake-hledger :config (progn (setq flymake-hledger-command '("hledger" "--auto")) ;; Enable 4 optional checks. See URL ;; https://hledger.org/1.30/hledger.html#check for the meaning of ;; each check and a list of all of them. (dolist (check '("ordereddates" "payees" "recentassertions" "tags")) (add-to-list 'flymake-hledger-checks check)))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 15:21] *** TODO Ledger Import Config #+BEGIN_QUOTE (use-package ledger-complete :init (progn (setq ledger-complete-in-steps nil))) (use-package ledger-import :hook ((ledger-import-finished . my/ledger-import-finish)) :config (progn (setq ledger-import-boobank-import-from-date "2023-07-29") (setq ledger-import-autosync-command '("hledger-autosync" "--assertions" "--payee-format" "{payee}")) (defun my/ledger-import-alert () "Notify the user that import is finished." (alert "Finished" :title "Ledger-autosync" :buffer (current-buffer))) (defun my/ledger-import-remove-EUR () "Remove the EUR commodity in the current buffer." (goto-char (point-min)) (while (search-forward " EUR" nil t) (replace-match "")) (ledger-mode-clean-buffer)) (defun my/ledger-import-merge-autosync-transactions () "Merge all autosync transactions into just one." (goto-char (point-min)) (search-forward "Autosync Balance Assertion") (delete-matching-lines "Autosync Balance Assertion") (delete-matching-lines "^$")) (defun my/ledger-import-add-today-date-as-outline () "Add today's date as `outline-mode' markup." (goto-char (point-min)) (search-forward "Autosync Balance Assertion") (goto-char (line-beginning-position)) (insert (format "*** %s\n\n" (format-time-string "%B %-d")))) (defun my/ledger-import-finish () "Some actions to do when ledger-import finishes." (interactive) (my/ledger-import-remove-EUR) (my/ledger-import-merge-autosync-transactions) (my/ledger-import-add-today-date-as-outline) (my/ledger-import-alert)) ;; Fill `ledger-import-accounts' and `ledger-import-ofx-rewrite-rules': (let ((file (expand-file-name "~/.password-store/Secure_Notes/ledger-accounts.gpg"))) (when (file-exists-p file) (load file t))))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 15:21] ** Emacs Local Repository Backlog [0/1] *** TODO Finish Writing Local Repository as a Package ;; - if first run or packages have been upgraded, ;; - check constant on next action. options are: ;; - notify user and update local repository ;; - updtate local repository without asking ;; - notify user and ask to update local repository ;; - do nothing ;; - function to update local repository with keybinding ** Emacs Mail Backlog [0/20] *** TODO Allow for Mail Queueing in Both the Script and Emacs Config **** 2023-10-28 Sat @ 15:25:01 -0500 Direction - This should really be a toggled function, with the default always to be on at launch This way if the user forgets that they're in queue mode, the user will automatically send all emails next time they launch. - Also, I'd prefer for an icon to appear in the modeline when mail is being queued. If I create a simple custom modeline, or the user is using a default modeline, this is likely more straightforward than trying to write an extention to doom-modeline and spaceline for instance. **** Reference in Manual https://www.djcbsoftware.nl/code/mu/mu4e/Queuing-mail.html **** Reference From Stackexchange https://emacs.stackexchange.com/questions/37344/how-to-queue-mail-to-send The mu4e manual node on queuing mail explains how to do this. Quoting the manual: If you cannot send mail right now, for example because you are currently offline, you can queue the mail, and send it when you have restored your internet connection. You can control this from the Main view. To allow for queuing, you need to tell smtpmail where you want to store the queued messages. For example: (setq smtpmail-queue-mail t ;; start in queuing mode smtpmail-queue-dir "~/Maildir/queue/cur") For convenience, we put the queue directory somewhere in our normal maildir. If you want to use queued mail, you should create this directory > before starting mu4e. The mu mkdir command may be useful here, so for example: $ mu mkdir ~/Maildir/queue $ touch ~/Maildir/queue/.noindex The file created by the touch command tells mu to ignore this directory for indexing, which makes sense since it contains smtpmail meta-data rather than normal messages; see the mu-mkdir and mu-index man-pages for details. Warning: when you switch on queued-mode, your messages won’t reach their > destination until you switch it off again; so, be careful not to do this accidentally! *** TODO Figure Out How to Filter/Categorize Mails Using Mu4e https://www.reddit.com/r/emacs/comments/202fon/email_filters_in_mu4e/ *** TODO Figure Out Your Mail Attachments Workflow **** TODO [#C] The Mu4e Save Attachment Function to the Actions List Doesn't Work removed this from mu4e configuration ;; (add-to-list 'mu4e-view-actions ;; '("download attachments" . cj/mu4e-view-save-attachments)) *** TODO Fix Org Capture Template for Contacts *** TODO GPG Signatures Working With Mu4e *** TODO Investigate this Mu4e and Emacs config [[https://200ok.ch/posts/2020-05-27_using_emacs_and_mu4e_for_emails_even_with_html.html][Using Emacs and mu4e for emails - even with HTML]] Captured On: [2023-10-22 Sun 01:28] *** TODO Set Incoming Emails as Read in Emacs Mu4e [[https://ag91.github.io/blog/2022/02/28/set-all-incoming-emails-as-read-with-mu4e/][Set all incoming emails as read with Mu4e - Where parallels cross]] Captured On: [2023-11-10 Fri 17:27] *** TODO Simple Keybinding to Display Attachments Leveraging Xdg-mime *** TODO Test Org-contacts Integration *** TODO Test This Mu4e Setting for HTML Emails #+BEGIN_QUOTE Disable MU4E 'HTML over plain text' heuristic 2018-10-25 - 272 WORDS - 2 MIN READ Alain M. Lafon By default, the great Mail User Agent MU4E prefers Plain Text mails over HTML. This configuration can be overridden via mu4e-view-prefer-html, but there's probably few of us who would do that. However, you might still see a whole lot of HTML emails. And when you check if they have a plain text version, they might have one! There's a reason for that. MU4E has a 'HTML over plain text' heuristic with this official rationale: Ratio between the length of the html and the plain text part below which mu4e will consider the plain text part to be 'This messages requires html' text bodies. You can neutralize it (always show the text version) by using `most-positive-fixnum'. This heuristic overwrites the default setting (and configuration) that Plain text should be preferred over HTML! In my experience, HTML Emails are WAY longer than only 5x the Plain text (Doodle, Airbnb, Meetup, etc), so this will yield me a lot of false positives whereas I have never seen a "This message requires HTML" body. Since I realized that MU4E has this heuristic, I overrode it just like the doc string told me to and am an even happier MU4E user. (setq mu4e-view-html-plaintext-ratio-heuristic most-positive-fixnum) NB, if you want to be able to read HTML emails, that's totally and 100% supported within MU4E! You can render them as: Text within a regular Emacs buffer PDF within a regular Emacs buffer - complete with styles and all Open the email in a browser through a shortcut #+END_QUOTE [[https://200ok.ch/posts/2018-10-25_disable_mu4e_html_over_plain_text_heuristic.html][Disable MU4E 'HTML over plain text' heuristic]] Captured On: [2023-10-22 Sun 01:27] *** TODO Ability to Download All Attachments to a Specified Directory *** TODO Download Attachment Plus Open Directory in Dired *** TODO Consider implementing https://github.com/lordpretzel/mu4e-views *** TODO Make a hydra for mu4e shortcuts #+BEGIN_QUOTE Hydra People sometimes ask about having multi-character shortcuts for bookmarks; an easy way to achieve this, is by using an emacs package Hydra. With Hydra installed, we can add multi-character shortcuts, for instance: (defhydra my-mu4e-bookmarks-work (:color blue) "work bookmarks" ("b" (mu4e-search "banana AND maildir:/work") "banana") ("u" (mu4e-search "flag:unread AND maildir:/work") "unread")) (defhydra my-mu4e-bookmarks-personal (:color blue) "personal bookmarks" ("c" (mu4e-search "capybara AND maildir:/personal") "capybara") ("u" (mu4e-search "flag:unread AND maildir:/personal") "unread")) (defhydra my-mu4e-bookmarks (:color blue) "mu4e bookmarks" ("p" (my-mu4e-bookmarks-personal/body) "Personal") ("w" (my-mu4e-bookmarks-work/body) "Work")) Now, you can bind a convenient key to my-mu4e-bookmarks/body. #+END_QUOTE [[https://www.djcbsoftware.nl/code/mu/mu4e/Hydra.html][Hydra (Mu4e 1.12.0 user manual)]] Captured On: [2024-04-05 Fri 15:02] *** TODO Ensure Mu4e is Your Default Emacs Mail Client #+BEGIN_QUOTE Emacs allows you to select an e-mail program as the default program it uses when you press C-x m (compose-mail), call report-emacs-bug and so on; see (emacs)Mail Methods. If you want to use mu4e for this, you can do so by adding the following to your configuration: (setq mail-user-agent 'mu4e-user-agent) Similarly, to specify mu4e as your preferred method for reading mail, customize the variable read-mail-command. (set-variable 'read-mail-command 'mu4e) #+END_QUOTE [[https://www.djcbsoftware.nl/code/mu/mu4e/Default-email-client.html][Default email client (Mu4e 1.12.0 user manual)]] Captured On: [2024-04-05 Fri 15:06] *** TODO Information About the Current Mu4e Header in Echo Area #+BEGIN_QUOTE It is possible to get information about the current header in the echo-area. You can enable this by setting mu4e-eldoc-support to non-nil. #+END_QUOTE [[https://www.djcbsoftware.nl/code/mu/mu4e/Eldoc.html][Eldoc (Mu4e 1.12.0 user manual)]] Captured On: [2024-04-05 Fri 15:05] *** TODO Attach Files to Mu4e Messages Using Dired #+BEGIN_QUOTE It is possible to attach files to mu4e messages using dired (emacs), using the following steps (based on a post on the mu-discuss mailing list by Stephen Eglen). (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode) Then, mark the file(s) in dired you would like to attach and press C-c RET C-a, and you’ll be asked whether to attach them to an existing message, or create a new one. #+END_QUOTE [[https://www.djcbsoftware.nl/code/mu/mu4e/Dired.html][Dired (Mu4e 1.12.0 user manual)]] Captured On: [2024-04-05 Fri 15:03] *** TODO Mail Settings for (Email) Address-at-point #+BEGIN_QUOTE (use-package goto-addr :bind ( :map goto-address-highlight-keymap ("C-c C-o" . goto-address-at-point)) :hook (((prog-mode magit-process-mode) . goto-address-mode)) :config (progn ;; Recommended by modus-themes (2.7.0 release notes): (setq goto-address-mail-face 'link) (setq goto-address-mail-mouse-face 'highlight))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:35] *** TODO Interesting Package Mu4easy Setup Mu4e [[https://github.com/danielfleischer/mu4easy][danielfleischer/mu4easy: mu4e + mbsync configuration for multiple email accounts.]] Captured On: [2024-04-13 Sat 05:32] *** Reference: Sending Email Via Smtp Through Ssh (With Mu4e) #+BEGIN_QUOTE SMTP through SSH One setup I like and I use is to relay the mails directly to the outgoing SMTP server, this requires no authentication except a SSH access to the remote server. It requires the following emacs configuration in ~/.emacs: (setq message-send-mail-function 'smtpmail-send-it smtpmail-smtp-server "localhost" smtpmail-smtp-service 2525) The configuration tells emacs to connect to the SMTP server on localhost port 2525 to send the mails. Of course, no mail daemon runs on this port on the local machine, it requires the following ssh command to be able to send mails. $ ssh -N -L 127.0.0.1:2525:127.0.0.1:25 remoteserver This will bind the port 127.0.0.1:25 from the remote server point of view on your address 127.0.0.1:2525 from your computer point of view. Your mail server should accept deliveries from local users of course. #+END_QUOTE [[https://dataswamp.org/~solene/2018-05-22-mu4esmtp.html][Solene'% : Sending mail with mu4e]] Captured On: [2024-04-13 Sat 05:25] *** TODO How to Use Email Lists in Mu4e [[https://pragmaticemacs.wordpress.com/2017/04/24/using-email-address-lists-in-mu4e/][Using email address lists in mu4e | Pragmatic Emacs]] Captured On: [2024-04-13 Sat 05:21] *** TODO Good Reddit Post on Mu4e Tips [[https://www.reddit.com/r/emacs/comments/8q84dl/tip_how_to_easily_manage_your_emails_with_mu4e/][(2) TIP: How to easily manage your emails with mu4e : emacs]] Captured On: [2024-04-13 Sat 05:15] *** TODO Review this mu4e configuration [[https://github.com/iqbalansari/dotEmacs/blob/master/config/mail.org][dotEmacs/config/mail.org at master · iqbalansari/dotEmacs]] Captured On: [2024-04-13 Sat 05:06] *** TODO Setup Emacs as a Mail Client #+BEGIN_QUOTE he following function setup Emacs as a possible email client. (defun ed/setup-emacs-mailto-target-desktop-file () "Write xdg desktop file allowing emacs to be used as mailto target." (interactive) (with-temp-file (expand-file-name "~/.local/share/applications/emacs-mail.desktop") (insert "[Desktop Entry] Name=Emacs (Mail with mu4e) Comment=Compose a new message with Mu4e in GNU Emacs MimeType=x-scheme-handler/mailto; Exec=emacs -l /usr/share/emacs/site-lisp/mu4e/mu4e.elc -f ed/compose-new-mail %u Icon=emacs Type=Application NoDisplay=true Terminal=false Categories=Network;Email; ")) (with-temp-buffer (call-process "update-desktop-database" nil (current-buffer) nil (expand-file-name "~/.local/share/applications/")) (buffer-string))) #+END_QUOTE [[https://etienne.depar.is/emacs.d/mu4e.html][Mu4e customization]] Captured On: [2024-04-13 Sat 04:57] *** TODO Mu4e and Gpg Functions #+BEGIN_QUOTE GPG related functions All the following functions interact with an email headers to expose or find out more about cryptography settings in use. (defun ed/get-openpgp-header (msg) (let ((path (or (mu4e-message-field msg :path) ""))) (if (or (equal path "") (not (file-readable-p path))) "Mail file is not accessible" (ed/get-mail-header "openpgp" path)))) (defcustom ed/gpg-pub-keys '() "List of GnuPG public keys used to sign or encrypt my email." :type '(alist :key-type (string :tag "mu4e context name") :value-type (string :tag "gpg mail header content")) :group 'mu4e-crypto) (defun ed/insert-gpg-headers (sign-or-encrypt) (save-excursion (goto-char (point-min)) (let ((pgp-info (cdr (assoc (mu4e-context-name (mu4e-context-current)) ed/gpg-pub-keys)))) (when pgp-info (insert "Openpgp: " pgp-info) (if (equal sign-or-encrypt "encrypt") (mml-secure-message-sign-encrypt) (mml-secure-message-sign)))))) (defun ed/sign-this-message () "Insert mml gpg command and gnupg header" (interactive) (ed/insert-gpg-headers "sign")) (defun ed/encrypt-this-message () "Insert mml gpg command and gnupg header" (interactive) (ed/insert-gpg-headers "encrypt")) #+END_QUOTE [[https://etienne.depar.is/emacs.d/mu4e.html][Mu4e customization]] Captured On: [2024-04-13 Sat 04:56] *** TODO Ensure you can attach items to an email message using dired #+BEGIN_QUOTE It is possible to attach files to mu4e messages using dired (emacs), using the following steps (based on a post on the mu-discuss mailing list by Stephen Eglen). (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode) Then, mark the file(s) in dired you would like to attach and press C-c RET C-a, and you’ll be asked whether to attach them to an existing message, or create a new one. #+END_QUOTE [[https://www.djcbsoftware.nl/code/mu/mu4e/Dired.html][Dired (Mu4e 1.12.3 user manual)]] Captured On: [2024-04-18 Thu 05:52] ** Emacs Markdown Config Backlog [0/1] *** TODO Finish Markdown Preview Functionality ** Emacs Modeline Backlog [0/3] *** TODO Consider Mini-modeline for Emacs [[https://github.com/kiennq/emacs-mini-modeline][kiennq/emacs-mini-modeline: Display emacs mode line in minibuffer]] Captured On: [2023-11-18 Sat 07:44] *** TODO Investigate Feebleline's Window-divider-mode I have no idea what that is. And I should by now, shouldn't I? #+BEGIN_QUOTE feebleline (use-package feebleline :bind (("M-o m" . feebleline-mode)) :config (window-divider-mode t)) #+END_QUOTE [[https://github.com/jwiegley/dot-emacs/blob/master/init.org][dot-emacs/init.org at master · jwiegley/dot-emacs]] Captured On: [2023-07-31 Mon 16:34] *** TODO Investigate Org-upcoming-modeline https://github.com/unhammer/org-upcoming-modeline there we go :) found on this reddit post [[https://www.reddit.com/r/emacs/comments/k1e4eu/show_next_orgappointment_in_modeline/][(4) Show next (org-)appointment in modeline? : emacs]] Captured On: [2023-10-10 Tue 09:55] ** Emacs Org Agenda / Calendar Backlog [0/6] *** TODO Add Todo Searching to Emacs With Rg Package #+BEGIN_QUOTE I'm not sure about todo modes, but using the rg (ripgrep) package, it is easy to add custom commands. For example, to define a command that searches for 'TODO' or 'FIXME' in the current project, (rg-define-search my-rg-todo :query "(TODO|FIXME)" :format regexp :dir project :files current) There are a lot of other similar solutions, like builtin rgrep, ag or another ripgrep/ag library. #+END_QUOTE [[https://stackoverflow.com/questions/76391866/how-to-show-a-list-of-all-my-todos-across-all-the-files-of-my-project][emacs - How to show a list of all my todos across all the files of my project? - Stack Overflow]] Captured On: [2024-02-24 Sat 18:13] *** TODO Agenda Schedule Should List All DOING and Priority #A Tasks *** TODO Consider Implementing Agendas in Org QL https://github.com/alphapapa/org-ql *** TODO Consider Org Fancy Priorities Package [[https://github.com/harrybournis/org-fancy-priorities][harrybournis/org-fancy-priorities: Display Org Mode priorities as custom strings]] Captured On: [2023-11-01 Wed 12:05] *** TODO Org Crypt and Logbook Work Together for Secure Agenda [[https://ag91.github.io/blog/2020/08/28/org-crypt-and-logbook-how-they-can-work-together-for-a-secure-agenda/][Org crypt and LOGBOOK: how they can work together for a secure agenda. - Where parallels cross]] Captured On: [2023-11-10 Fri 17:37] *** TODO Slack Links in Org Agenda [[https://ag91.github.io/blog/2020/09/24/composition-update-add-slack-links-to-org-agenda/][Composition Update: Slack links in your Org Agenda - Where parallels cross]] Captured On: [2023-11-10 Fri 17:39] *** TODO Fix Org-contacts and Birthdays Birthdays aren't showing up in the agenda from org-contacts *** TODO Investigate Org Caldav to Integrate Calendar With Agenda #+BEGIN_QUOTE (use-package org-caldav :bind (("C-. o S" . org-caldav-sync)) :config (progn (setq org-caldav-url "https://licorne.ninja/remote.php/dav/calendars/DamienCassou" org-caldav-calendar-id "personal" org-caldav-inbox org-default-calendar-file org-caldav-files '() org-icalendar-timezone "Europe/Berlin" org-caldav-sync-changes-to-org 'all) (defun my/org-caldav-archive-year () "Archive a given year in my calendar." (interactive) (while (re-search-forward "^ *<2021-.*>$" nil t) (org-archive-subtree))))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 15:24] *** TODO This org-gcal appears to be more recent [[https://github.com/kidd/org-gcal.el][kidd/org-gcal.el: Org sync with Google Calendar. (active maintained project as of 2019-11-06)]] Captured On: [2024-04-18 Thu 08:27] ** Emacs Org Babel Backlog [0/3] *** TODO Add Org Babel Support for PGN [[https://gist.github.com/larrasket/4188cac7d0d034eda6ea99160e94dc57][Add org babel support for Portable Game Notation]] Captured On: [2024-01-16 Tue 08:38] *** TODO Change File Permissions on Your Emacs Tangle Output #+BEGIN_QUOTE The following worked. I'm not sure why the original did not, though. #+BEGIN_SRC bash :tangle ~/.local/bin/tsa-ss :tangle-mode (identity #o700) #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/159zj0v/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 09:07] *** TODO Ox Pandoc Org Mode Exporter [[https://github.com/emacsorphanage/ox-pandoc][emacsorphanage/ox-pandoc: Another org-mode exporter via pandoc.]] Captured On: [2023-11-01 Wed 12:25] ** Emacs Org Capture Backlog [0/2] *** TODO Look Into Org-pdftools to See if This Simplifies the PDF Capture Templates [[https://github.com/fuxialexander/org-pdftools][fuxialexander/org-pdftools: A custom org link type for pdf-tools]] Captured On: [2023-11-01 Wed 12:34] *** TODO Rename Org Webclipper Article Files - 'article-archive' should be 'saved-articles' - 'article-file' should be 'article-inbox' or something else *** TODO Put a generic org capture on Capture Templates This is for use when it's not a TODO item and you want to capture it via the browser. Captured On: [2024-04-16 Tue 20:03] ** Emacs Org Drill Backlog [0/6] *** TODO Create Emacs Drill Questions From This Post About Adding to Lists #+BEGIN_QUOTE There are many different ways. Not sure if there's a particularly "proper" way. There are considerations you should take depending on how you want to add it (destructively, non-destructively) or if you care a lot about efficiency. original list (1) things you want to add (2 3 4) There are many different ways of adding. Things can be added destructively, meaning the original set of numbers is modified or non-destructively, just generating a new list. To see more look at list modification. This is non-destructive. (append '(1) '(2 3 4)) ;=> '(1 2 3 4) This is destructive and more indirect (more of a replacement than addition), here it replaces the last element of the list 2 with 2 3 4. Which has the net effect of adding to the list. If your list is in a variable: (setq my-list '(1 2)) (setcdr my-list '(2 3 4)) ;=> '(2 3 4) my-list ;=> '(1 2 3 4). You could also just do a loop with add-to-list or cons. Note I'm assuming you don't care about order. (dolist (thing things) (add-to-list 'list-var thing)) (dolist (thing things) (cons thing list-var)) I usually use the append as it is short to write and more direct. It also is probably among the fastest because it is written in C code whereas add-to-list is in elisp. Share Improve this answer Follow answered Jan 10, 2018 at 15:56 Piglet 14644 bronze badges append is only efficient if all additional elements are already contained in a list and that list is added. It is inefficient for adding many elements sequentially or in small hunks at the tail since in this case its cost grows quadratically with the number of list entries. Note that I have confirmed that fact by timing. – Tobias Jan 10, 2018 at 16:54 Add a comment 3 The proper way to add many items to a list is consing in a loop. If l is the list variable you add an item i by (setq l (cons i l)) for which you can use the shorthand (push i l) The computational cost of this operation is independent of the length of the list l. After collecting the items in this way they are in reverse order. If it is important to retain the order you can call (setq l (nreverse l)) as the last action or just return (nreverse l). The cost of nreverse grows just linearly with the length of the list. The costs of adding all elements with add-to-list grow quadratically with the length of the list (even without append set to t). If you want to add an item to a list only if it is not already present. You have to search for that item. In that case you could consider using a hashmap (search the elisp info files for make-hash-table) or a sorted list to reduce the computational costs. Note that a single hash access is costly but the read/write access time is essentially independent on the number of elements in the hash. Share Improve this answer Follow edited Jan 17, 2018 at 13:23 Stefan 26.2k33 gold badges4848 silver badges8585 bronze badges answered Jan 10, 2018 at 15:05 Tobias 32.7k11 gold badge3434 silver badges7575 bronze badges Add a comment 3 I figured this question lacks an actual practical example that a person can copy-paste into their config, so here it is: (defun merge-list-to-list (dst src) "Merges content of the 2nd list with the 1st one" (set dst (append (eval dst) src))) It combines the non-destructive append function that merges two lists, and a destructive set. Now, let's say your config had this code: (add-to-list 'company-dabbrev-code-modes 'c++-mode) (add-to-list 'company-dabbrev-code-modes 'c-mode) (add-to-list 'company-dabbrev-code-modes 'php-mode) (add-to-list 'auto-mode-alist '("\\.mzn\\'" . minizinc-mode)) (add-to-list 'auto-mode-alist '("\\.glade$\\'" . xml-mode)) (add-to-list 'auto-mode-alist '("\\PKGBUILD\\'" . sh-mode)) (add-to-list 'auto-mode-alist '("\\.service\\'" . conf-mode)) (add-to-list 'auto-mode-alist '("\\.m$" . octave-mode)) You replace it with this: (merge-list-to-list 'company-dabbrev-code-modes '(c++-mode c-mode php-mode)) (merge-list-to-list 'auto-mode-alist '(("\\.mzn\\'" . minizinc-mode) ("\\.glade$\\'" . xml-mode) ("\\PKGBUILD\\'" . sh-mode) ("\\.service\\'" . conf-mode) ("\\.m$" . octave-mode))) Share Improve this answer Follow edited Jun 10 at 2:58 answered Aug 10, 2021 at 17:23 Hi-Angel 54466 silver badges1818 bronze badges The purported analogy to add-to-list is misleading, as the most notable feature of add-to-list is that it doesn't add an item which already exists in the list. If you want append you should just use append, rather than wrapping that with a name that doesn't behave the way one would expect. – phils Jun 9 at 9:12 1 @phils append doesn't mutate original list though. Regarding the analogy: I honestly didn't even know add-to-list checks for duplicates. I would disagree calling it a "notable feature", because you would only know that from the docs or someone else. It is actually misleading, because the name of the function says nothing at all about removing dups. So in this case it's add-to-list that is misnamed and not the add-list-to-list. With that said, I can rename it if you think it would confuse old-timers. Perhaps, add-list-to-list-allow-dups…? – Hi-Angel Jun 9 at 12:53 "you would only know that from the docs" -- I don't think that's much of a problem unless you're in the habit of using unfamiliar elisp functions without even reading their docstrings (which I would consider fairly inexplicable). If I was to write such a function I would probably put append somewhere in the name. – phils Jun 9 at 13:08 @phils problem with append tho is this name does not imply the lists are merged. That is, upon executing (setq lhs '(1 2)) (append-list-to-list lhs '(3 4)) I would expect lhs to become (1 2 (3 4)) rather than (1 2 3 4). And yes, I don't necessarily read documentation if the name of the method is self-explanatory, such as print or while or goto-line. This ain't "inexplicable", in huge codebases you can't expect every function have docs, especially so given they have tendency to become outdated. The purpose of the function should be clear from its name and type-definition. – Hi-Angel Jun 10 at 2:49 So, I think merge-list-to-list might be a better naming, changed to it for now. – Hi-Angel Jun 10 at #+END_QUOTE [[https://emacs.stackexchange.com/questions/38008/adding-many-items-to-a-list/68048#68048][Adding many items to a list - Emacs Stack Exchange]] Captured On: [2023-10-22 Sun 00:48] *** TODO Find Good Drill Questions in the Elisp Cookbook [[https://www.emacswiki.org/emacs/ElispCookbook][EmacsWiki: Elisp Cookbook]] Captured On: [2023-10-22 Sun 02:43] *** TODO Move Vocabulary List to Org-Drill Where I Left Off in the Vocabulary List for Org-Drill #+BEGIN_QUOTE compunction a feeling of deep regret, usually for some misdeed #+END_QUOTE [[https://www.vocabulary.com/lists/191545][300 Most Difficult "SAT" Words - Vocabulary List | Vocabulary.com]] Captured On: [2023-10-27 Fri 03:13] *** TODO Use constants instead of hardcoding files/paths in org-drill-config *** TODO Emacs Org Drill Flashcard [[https://github.com/pdelfino/emacs-flashcards/blob/main/emacs.org][emacs-flashcards/emacs.org at main · pdelfino/emacs-flashcards]] Captured On: [2024-04-05 Fri 16:20] *** TODO Good blog on Anki and Emacs [[https://yiufung.net/post/anki-org/][Power up Anki with Emacs, Org mode, anki-editor and more]] Captured On: [2024-04-05 Fri 16:26] ** Emacs Org Export Backlog [0/1] *** TODO Add simple keybinding for org to beamer presentations in org-export-config ** Emacs Org General Backlog [0/10] *** TODO Add Company-org-block to Org Mode Config [[https://github.com/xenodium/company-org-block/tree/aee601a2bfcc86d26e762eeb84e5e42573f8c5ca][xenodium/company-org-block at aee601a2bfcc86d26e762eeb84e5e42573f8c5ca]] Captured On: [2023-11-01 Wed 12:51] *** TODO Copy Formatted Content From Org Mode jkitchin/ox-clip: Copy formatted content from org-mode]] Captured On: [2023-11-01 Wed 12:27] *** TODO Emacs Config Should Work Without Personal Org Files *** TODO Interesting Org Mode Navigation Hydra #+BEGIN_QUOTE Org Mode Navigation I use Org Mode constantly, and so here is a hydra I use to navigate such files: (defhydra hydra-org (:color red :columns 3) "Org Mode Movements" ("n" outline-next-visible-heading "next heading") ("p" outline-previous-visible-heading "prev heading") ("N" org-forward-heading-same-level "next heading at same level") ("P" org-backward-heading-same-level "prev heading at same level") ("u" outline-up-heading "up heading") ("g" org-goto "goto" :exit t)) This demonstrates the :columns feature of Hydra, which is a nice and quick way to neatly format the display of hydras in the minibuffer without resorting to the amazing things you can do with fancy formatting strings. #+END_QUOTE [[https://ericjmritz.wordpress.com/2015/10/14/some-personal-hydras-for-gnu-emacs/][Some Personal Hydras for GNU Emacs – One More Game-Dev and Programming Blog]] Captured On: [2023-11-19 Sun 16:49] *** TODO Monospace Fonts in Org Tables [[https://github.com/alphapapa/unpackaged.el?tab=readme-ov-file#force-monospace-face-in-tables][alphapapa/unpackaged.el: A collection of useful Emacs Lisp code that isn't substantial enough to be packaged]] Captured On: [2024-03-11 Mon 10:07] *** TODO Org Mode Links for Emacs Slack [[https://ag91.github.io/blog/2020/09/12/org-mode-links-for-emacs-slack/][Org mode links for Emacs Slack - Where parallels cross]] Captured On: [2023-11-10 Fri 17:38] *** TODO Org Mode Useful Anchors [[https://github.com/alphapapa/unpackaged.el?tab=readme-ov-file#export-to-html-with-useful-anchors][alphapapa/unpackaged.el: A collection of useful Emacs Lisp code that isn't substantial enough to be packaged]] Captured On: [2024-03-11 Mon 10:06] *** TODO Org-Tidy Hides Property Drawers [[https://github.com/jxq0/org-tidy][jxq0/org-tidy: 🧹 An Emacs minor mode to automatically tidy org-mode property drawers]] Captured On: [2023-11-01 Wed 12:28] *** TODO Subtasks Inherit Deadline From Parent Task in Emacs Org-mode Org-mode has the capability to inherit tags like deadlines, but by default org-entry-get does not do so. Here's advice to ensure that DEADLINE is always inherited. #+BEGIN_QUOTE (defun org-entry-properties-inherit-deadline (orig-fun &optional pom which) "Call ORIG-FUN with POM, but if WHICH is `DEADLINE' do it recursively." (if (string= which "DEADLINE") (org-with-point-at pom (let (value) (while (not (or (setq value (funcall orig-fun (point) which)) (not (org-up-heading-safe))))) value) (funcall orig-fun pom which)))) (advice-add 'org-entry-properties :around #'org-entry-properties-inherit-deadline) #+END_QUOTE Also see: https://github.com/vedang/emacs-up/commit/1cb6c774a991d50853134d8085ca61dd12585993 [[https://stackoverflow.com/questions/4872088/is-there-any-way-for-subtasks-to-inherit-deadlines-in-org-mode][emacs - Is there any way for subtasks to inherit deadlines in org-mode? - Stack Overflow]] Captured On: [2023-11-01 Wed 11:38] *** TODO Consider Getting an Emacs-buddy Per This Site [[https://github.com/ag91/emacs-buddy][GitHub - ag91/emacs-buddy: Emacs Buddy initiative to help new Emacs users with their struggles]] Captured On: [2023-11-10 Fri 17:15] *** TODO Org Web Tools and a use for the package https://blog.nawaz.org/posts/2023/Mar/solving-a-scraping-problem-with-emacs-and-org-mode/ [[https://github.com/alphapapa/org-web-tools][alphapapa/org-web-tools: View, capture, and archive Web pages in Org-mode]] Captured On: [2024-04-11 Thu 18:02] ** Emacs Org Refile Backlog [0/2] *** TODO Consider Using Hydras for Refile Targets [[https://mollermara.com/blog/Fast-refiling-in-org-mode-with-hydras/][Fast refiling in org-mode with hydras | Josh Moller-Mara]] Captured On: [2023-10-23 Mon 14:27] *** TODO Look into this setup for Emacs and Org-Protocol #+BEGIN_QUOTE his is what I did: **** Create handler for org-protocol urls We want a small emacs window centred on the screen. #+BEGIN_SRC sh :tangle ~/scripts/emacs-capture :shebang "#!/bin/sh" emacsclient -c -F "((name . \"emacs-capture\") (height . 10) (width . 80) (left . 632) (top . 452) (user-position . t) (menu-bar-lines . 0))" "$@" #+END_SRC The =left= and =top= cells do the centering for a 1920x1080 display. For other sizes, =xwininfo= is yr friend: left = (x-screen - x-window)/2 and so on. **** Register handler for org-protocol #+BEGIN_SRC sh :tangle ~/.local/share/applications/emacs-capture.desktop [Desktop Entry] Name=Org Capture Exec=/home/fran/scripts/emacs-capture %u Comment=Capture the web into org Icon=/usr/share/icons/hicolor/scalable/apps/emacs24.svg Type=Application Terminal=false MimeType=x-scheme-handler/org-protocol; #+END_SRC After installing this, you need to evaluate (with =C-c C-c=) the following to register the mime-type with the OS: #+NAME: update-block #+BEGIN_SRC sh update-desktop-database ~/.local/share/applications #+END_SRC #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/fvlcqg/anyone_using_orgprotocol_with_only_a_window/][(3) Anyone using org-protocol with only a window manager but no desktop environment? : emacs]] Captured On: [2024-04-02 Tue 16:54] *** TODO Add refile mode to the right mu4e mail view mode [[][]] Captured On: [2024-04-16 Tue 20:04] ** Emacs Org Roam Backlog [0/5] *** TODO Compare Orgrr versus Org-Roam [[https://github.com/rtrppl/orgrr][GitHub - rtrppl/orgrr: Orgrr is a minimalist but complete note-taking system for Emacs. Its intended purpose is the creation and management of a Zettelkasten-like system.]] Captured On: [2023-11-18 Sat 11:01] *** TODO Describe Org-roam Types in Org-roam-config.el Commentary *** TODO Finish Org Roam Hydra **** TODO Example Org Roam Hydra 1 ;; (org-roam-hydra (:color blue :hint nil) ;; "== Org Roam Menu == [ Note: invoke Org-Roam's completion-at-point with 'C-M-i' ] ;; " ;; ("f" org-roam-node-find "Find/Add Node (C-c n f)" :column "Node") ;; ("p" cj/org-roam-find-project "Find/Add Project (C-c n p)" :column "Node") ;; ("r" cj/org-roam-find-recipe "Find/Add Recipe (C-c n r)" :column "Node") ;; ("t" cj/org-roam-find-topic "Find/Add Topic (C-c n t)" :column "Node") ;; ("i" org-roam-node-insert "Insert Link to Node (C-c n i)" :column "Node") ;; ("I" cj/org-roam-node-insert-immediately "Insert Link to Node Immediately (C-c n I)" :column "Node") ;; ("n" org-roam-dailies-capture-today "Add Entry for Today (C-c n d n)" :column "Journal") ;; ("d" org-roam-dailies-goto-today "Goto Today's Entry (C-c n d d)" :column "Journal") ;; ("T" org-roam-dailies-capture-tomorrow "Add Entry for Tomorrow (C-c n d T)" :column "Journal") ;; ("Y" org-roam-dailies-capture-yesterday "Add Entry for Yesterday (C-c n d Y)" :column "Journal") ;; ("v" org-roam-dailies-capture-date "Add Entry for Specific Date (C-c n d v)" :column "Journal") ;; ("c" org-roam-dailies-goto-date "Goto Entry for Specific Date (C-c n d c)" :column "Journal") ;; (">" org-roam-dailies-goto-next-note "Goto Next Entry (C-c n d f)" :column "Journal") ;; ("<" org-roam-dailies-goto-previous-note "Goto Previous Entry (C-c n d b)" :column "Journal") ;; ) ;; :hydra ;; (org-roam-hydra (:color blue :hint nil) ;; "== Org Roam Menu == [ Note: invoke Org-Roam's completion-at-point with 'C-M-i' ] ;; " ;; ("f" org-roam-node-find "Find/Add Node (C-c n f)" :column "Node") ;; ("p" cj/org-roam-find-project "Find/Add Project (C-c n p)" :column "Node") ;; ("r" cj/org-roam-find-recipe "Find/Add Recipe (C-c n r)" :column "Node") ;; ("t" cj/org-roam-find-topic "Find/Add Topic (C-c n t)" :column "Node") ;; ("i" org-roam-node-insert "Insert Link to Node (C-c n i)" :column "Node") ;; ("I" cj/org-roam-node-insert-immediately "Insert Link to Node Immediately (C-c n I)" :column "Node") ;; ("n" org-roam-dailies-capture-today "Add Entry for Today (C-c n d n)" :column "Journal") ;; ("d" org-roam-dailies-goto-today "Goto Today's Entry (C-c n d d)" :column "Journal") ;; ("T" org-roam-dailies-capture-tomorrow "Add Entry for Tomorrow (C-c n d T)" :column "Journal") ;; ("Y" org-roam-dailies-capture-yesterday "Add Entry for Yesterday (C-c n d Y)" :column "Journal") ;; ("v" org-roam-dailies-capture-date "Add Entry for Specific Date (C-c n d v)" :column "Journal") ;; ("c" org-roam-dailies-goto-date "Goto Entry for Specific Date (C-c n d c)" :column "Journal") ;; (">" org-roam-dailies-goto-next-note "Goto Next Entry (C-c n d f)" :column "Journal") ;; ("<" org-roam-dailies-goto-previous-note "Goto Previous Entry (C-c n d b)" :column "Journal") ;; ) **** TODO Example Org Roam Hydra 2 - What's the key binding for this? #+BEGIN_QUOTE Hydra / Roam Group org-roam commands. (pretty-hydra-define hydra-notes (:hint nil :color teal :quit-key "q" :title (with-octicon "pencil" "Notes" 1 -0.05)) ("Notes" (("c" org-roam-dailies-capture-today "capture") ("C" org-roam-dailies-capture-tomorrow "capture tomorrow") ("g" org-roam-graph "graph") ("f" org-roam-node-find "find") ("i" org-roam-node-insert "insert")) "Go To" ((">" org-roam-dailies-goto-next-note "next note") ("<" org-roam-dailies-goto-previous-note "previous note") ("d" org-roam-dailies-goto-date "date") ("t" org-roam-dailies-goto-today "today") ("T" org-roam-dailies-goto-tomorrow "tomorrow") ("y" org-roam-dailies-goto-yesterday "yesterday")))) #+END_QUOTE [[https://github.com/rememberYou/.emacs.d/blob/master/config.org][.emacs.d/config.org at master · rememberYou/.emacs.d]] Captured On: [2023-11-19 Sun 17:26] *** TODO Good Read on Org-Roam [[https://blog.dornea.nu/2022/09/03/migrate-tiddlywiki-to-org-roam-part-1-export-tiddlers/][Migrate Tiddlywiki to org-roam - Part 1: Export Tiddlers - blog.dornea.nu]] Captured On: [2023-10-21 Sat 08:41] *** TODO Look into Delve for Org-Roam [[https://github.com/publicimageltd/delve][publicimageltd/delve: Delve into your org-roam zettelkasten]] Captured On: [2024-04-05 Fri 13:57] *** TODO Can't export from recipes due to formatting Org mode needs a single all-encompassing header, otherwise it will just export that particular section on it's own. If you can't find an easy workaround, you will need to: - change all the current recipes - set a property at the top of the buffer telling org to expand the top node so the buffer doesn't appear empty. - change the template, including adding the property ** Emacs PDF Backlog [0/2] *** TODO Double Check PDF-tools Settings Across All Emacs Functionality [[https://emacs.stackexchange.com/questions/19686/how-to-use-pdf-tools-pdf-view-mode-in-emacs][gnus - How to use pdf-tools (pdf-view-mode) in emacs? - Emacs Stack Exchange]] Captured On: [2023-10-20 Fri 10:44] *** TODO Consider Using Org-Noter for PDF Annotations [[https://github.com/weirdNox/org-noter][weirdNox/org-noter: Emacs document annotator, using Org-mode]] Captured On: [2023-10-20 Fri 12:07] ** Emacs Prog Comments Backlog [0/1] *** TODO Emacs Comments Related **** TODO Add Elisp Quote to Comments #+BEGIN_QUOTE ;; ---------------------------------- ;; ;; External function decls ;; ---------------------------------- ;; #+END_QUOTE [[][]] Captured On: [2023-10-30 Mon 10:24] ** Emacs Prog General Backlog [0/28] *** VERIFY Reuse Constants for Projectile Searching in prog-general.el #+BEGIN_QUOTE (setq projectile-project-search-path '("~/code" "~/projects" "~/.emacs.d" "~/.dotfiles")) #+END_QUOTE Captured On: [2023-08-28 Mon 03:07] *** TODO Add Consult-todos, Magit-todos, or a Way to Search for Todo Comments in Code. *** TODO Add Copilot.el https://github.com/copilot-emacs/copilot.el *** TODO An Emacs Refactoring Package [[https://github.com/Wilfred/emacs-refactor#user-content-general][Wilfred/emacs-refactor: language-specific refactoring in Emacs]] Captured On: [2023-08-12 Sat 11:41] *** TODO Check on Shellcheck and Emacs #+BEGIN_QUOTE Julia Evans had a great talk called Making Hard Things Easy. One of the takeaways for me was that I should be using tools for parts of a system I find hard to remember. In particular, when writing bash scripts I should be using shellcheck. It turns out Emacs 29 has support for shellcheck, and older versions of Emacs can use the flymake-shellcheck page. To set it up in Emacs 29: (use-package flymake :bind (("H-e" . flymake-show-project-diagnostics)) (use-package sh-script :hook (sh-mode . flymake-mode)) I use consult for navigating my errors, and I want to make errors more noticable in the mode line, so my flymake configuration is: (use-package flymake :bind (("H-e" . my/consult-flymake-project)) :preface (defun my/consult-flymake-project () (interactive) (consult-flymake t)) :custom (flymake-suppress-zero-counters t) :config (defface my/flymake-modeline-error-echo '((t :inherit 'flymake-error-echo :background "red")) "Mode line flymake errors") (put 'flymake-error 'mode-line-face 'my/flymake-modeline-error-echo) (defface my/flymake-modeline-warning-echo '((t :inherit 'flymake-warning-echo :background "orange")) "Mode line flymake warnings") (put 'flymake-warning 'mode-line-face 'my/flymake-modeline-warning-echo)) It's too early to know what other tweaks I might want, but so far it's alerted me to several errors in my shell scripts. Update: [2023-10-07] Comments on HN pointed to bash-language-server which works with emacs lsp or eglot. #+END_QUOTE Source: [[https://amitp.blogspot.com/2023/10/emacs-and-shellcheck.html][*eww*]] Captured On: [2023-10-09 Mon 13:42] *** TODO Check Out Project.el Against Projectile [[https://www.reddit.com/r/emacs/comments/176vrhs/projectel_vs_projectile_what_things_can_one_do/][(3) Project.el vs. Projectile: What things can one do that the other cannot? : emacs]] Captured On: [2023-10-13 Fri 15:53] *** TODO Consider Adding Back Emacs-format-all-the-code https://github.com/lassik/emacs-format-all-the-code *** TODO Decide Whether You Need Global Ligature Mode or if It Should Be a Hook *** TODO Great Projectile Hydra to Consider [[https://github.com/abo-abo/hydra/wiki/Projectile][Projectile · abo-abo/hydra Wiki]] Captured On: [2023-11-19 Sun 17:15] *** TODO Highlight Numeric Literals #+BEGIN_QUOTE (use-package highlight-numbers :hook (prog-mode . highlight-numbers-mode)) #+END_QUOTE [[https://github.com/jwiegley/dot-emacs/blob/master/init.org][dot-emacs/init.org at master · jwiegley/dot-emacs]] Captured On: [2023-07-31 Mon 16:47] *** TODO Investigate Goto-last-change goto-last-change.el was written in response to the following: From: Dan Jacobson Newsgroups: gnu.emacs.bug Subject: function to go to spot of last change Date: Sun, 15 Jun 2003 00:15:08 +0000 (UTC) Sender: news Message-ID: NNTP-Posting-Host: monty-python.gnu.org Why of course, a function to get the user to the spot of last changes in the current buffer(s?), that's what emacs must lack. How many times have you found yourself mosying [<-not in spell checker!?] thru a file when you wonder, where the heck was I just editing? Well, the best you can do is hit undo, ^F, and undo again, to get back. Hence the "burning need" for the additional function, which you might name the-jacobson-memorial-function, due to its brilliance. -- http://jidanni.org/ Taiwan(04)25854780 #+BEGIN_QUOTE goto-last-change (use-package goto-last-change :bind ("C-x C-/" . goto-last-change)) #+END_QUOTE [[https://github.com/jwiegley/dot-emacs/blob/master/init.org][dot-emacs/init.org at master · jwiegley/dot-emacs]] Captured On: [2023-07-31 Mon 16:40] *** TODO Investigate Hideshow #+BEGIN_QUOTE hideshow (use-package hideshow :diminish hs-minor-mode :hook (prog-mode . hs-minor-mode) :bind (:map prog-mode-map ("C-c h" . hs-toggle-hiding))) #+END_QUOTE [[https://github.com/jwiegley/dot-emacs/blob/master/init.org][dot-emacs/init.org at master · jwiegley/dot-emacs]] Captured On: [2023-07-31 Mon 16:46] *** TODO Investigate Realgud - External Debugger Interface #+BEGIN_QUOTE An extensible, modular GNU Emacs front-end for interacting with external debuggers, #+END_QUOTE [[https://github.com/realgud/realgud/tree/2c77776a4797805d8633636fd68148dfb32fab65][realgud/realgud at 2c77776a4797805d8633636fd68148dfb32fab65]] Captured On: [2023-07-31 Mon 16:43] *** TODO Investigate Tmux + Emacs + Projectile-test https://www.reddit.com/r/emacs/comments/xyo2fo/orgmode_vterm_tmux/ *** TODO Investigate Vagrant Emacs Integration #+BEGIN_QUOTE vagrant (use-package vagrant :commands (vagrant-up vagrant-ssh vagrant-halt vagrant-status) :functions (vagrant-tramp-enable) :config (vagrant-tramp-enable)) vagrant-tramp (use-package vagrant-tramp :after tramp) #+END_QUOTE [[https://github.com/jwiegley/dot-emacs/blob/master/init.org][dot-emacs/init.org at master · jwiegley/dot-emacs]] Captured On: [2023-07-31 Mon 17:28] *** TODO Investigate Vimish Fold #+BEGIN_QUOTE vimish-fold (use-package vimish-fold :bind (("C-c V f" . vimish-fold) ("C-c V d" . vimish-fold-delete) ("C-c V D" . vimish-fold-delete-all))) #+END_QUOTE [[https://github.com/jwiegley/dot-emacs/blob/master/init.org][dot-emacs/init.org at master · jwiegley/dot-emacs]] Captured On: [2023-07-31 Mon 17:31] *** TODO Learn How Project.el Works in Emacs *** TODO Look Into Reformatter Emacs Package [[https://elpa.nongnu.org/nongnu/reformatter.html][NonGNU ELPA - reformatter]] Captured On: [2023-10-13 Fri 14:07] *** TODO Look into Regex Tool [[https://melpa.org/#/regex-tool][regex-tool - MELPA]] Captured On: [2023-07-31 Mon 17:19] *** TODO Look into REPL Driven Development Emacs Package [[https://github.com/alhassy/repl-driven-development/tree/05bd1cee8f298173010ed17a98ba2b94cb08d830][GitHub - alhassy/repl-driven-development at 05bd1cee8f298173010ed17a98ba2b94cb08d830]] Captured On: [2023-12-06 Wed 13:34] *** TODO Managing Todo Tasks in Project [[https://www.reddit.com/r/emacs/comments/fs7tk3/how_to_manage_todo_tasks_in_my_project/][(2) How to manage TODO tasks in my project? : emacs]] Captured On: [2024-02-26 Mon 11:01] *** TODO Read Emacs Package Dev Handbook [[https://github.com/alphapapa/emacs-package-dev-handbook][alphapapa/emacs-package-dev-handbook: An Emacs package development handbook. Built with Emacs, by Emacs package developers, for Emacs package developers.]] Captured On: [2023-10-29 Sun 13:03] *** TODO Real-time Collaborative Editing Environment for Emacs [[https://github.com/zaeph/crdt.el][zaeph/crdt.el]] Captured On: [2023-07-31 Mon 15:59] *** TODO Review Refactorings in Emacs #+BEGIN_QUOTE Look right at the second example here: https://joaotavora.github.io/yasnippet/snippet-development.html#orgcde188c for ($1;$2;$3) { `yas-selected-text`$0 } Note that you have some text selected, and the snippet expands around the text. This is the simplest way to create refactorings, say you want to put some text into a function: def ${1:fun_name}(${2:arg}) = $0`yas-selected-text` Note also that you can use yasnippet to trigger as a command and it will interpret the body as lisp code, too. Then bind the whole thing to a custom key binding, and you have some nice refactoring that will create a function for you from the selected text. I usually just kill it and yank it where needed, but since you can embed elisp you can probably also automate that to get it in scope using up/down-list. I just never take the time since expand selection and kill are like 3 keystrokes for me. Yasnippets can get really complex, especially with mirroring and transformations and things that move text around. #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/o1o7w6/refactoring_support/][(2) Refactoring support : emacs]] Captured On: [2023-08-12 Sat 11:33] *** TODO Rework Prog-shell to Make Shell Script Ide https://www.reddit.com/r/emacs/comments/onpv90/emacs_as_shell_script_ide/ *** TODO Save Just the Project Buffers in Emacs #+BEGIN_QUOTE (defun project-save-buffers (&optional arg) "Save modified file-visiting buffers of current project, if any. Based on `save-some-buffers', refer to its documentation about interactive behavior and the optional argument ARG." (interactive "P") (save-excursion (when-let* ((project (project-current)) (buffers (project-buffers project))) (save-some-buffers arg (lambda () (memq (current-buffer) buffers)))))) #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/159zj0v/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 09:09] *** TODO Check the languages you code in have DAP interfaces *** TODO Investigate Dap Move for Prog General **** Github Repo [[https://github.com/emacs-lsp/dap-mode?tab=readme-ov-file][emacs-lsp/dap-mode: Emacs Debug Adapter Protocol]] Captured On: [2024-04-05 Fri 14:02] ** Emacs Prog Go Backlog [0/5] *** VERIFY Emacs Not Displaying Ligatures in Go-mode *** TODO Add Ob-go to Org Configuration [[https://github.com/pope/ob-go/tree/2067ed55f4c1d33a43cb3f6948609d240a8915f5][pope/ob-go at 2067ed55f4c1d33a43cb3f6948609d240a8915f5]] Captured On: [2023-11-01 Wed 12:46] *** TODO Go Environment Variables in Emacs #+BEGIN_QUOTE I was trying to figure out how to get emacs to update my go version based on what I've set via goenv. Using the exec-path-from-shell package I was able to come up with this, hoping someone else will find this useful: (defun go-update-env () "sets go related environment variables to match the project's version specified by goenv" (interactive) (if (directory-files (projectile-project-root) :MATCH "\.go-version") (progn (dolist (var '("GOMODCACHE" "GOPATH" "GOROOT" "GOTOOLDIR" "GOVERSION")) (add-to-list 'exec-path-from-shell-variables var)) (exec-path-from-shell-initialize)) (message "warning: no .go-version file found in project root")) (go-mode) ) #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/14377k9/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 08:42] *** TODO Consider Go Resources Here https://github.com/emacs-tw/awesome-emacs#go perhaps especially https://github.com/dominikh/go-mode.el https://github.com/nlamirault/gotest.el *** TODO Prog-go uses project.el and I shouldn't need it ** Emacs Prog Lisps Backlog [0/4] *** TODO Lint and Test Emacs Lisp? [[https://github.com/alphapapa/makem.sh][alphapapa/makem.sh: Makefile-like script for linting and testing Emacs Lisp packages]] Captured On: [2023-10-02 Mon 00:34] *** TODO Look Into Rainbow Blocks for Highlighting Scope and Depth, Not Syntax [[https://github.com/istib/rainbow-blocks][istib/rainbow-blocks: block syntax highlighting in emacs]] Captured On: [2024-03-28 Thu 15:04] *** TODO Slime Emacs Config #+BEGIN_QUOTE slime (use-package slime :commands slime :custom (slime-kill-without-query-p t) (slime-repl-history-file (user-data "slime-history.eld")) (slime-startup-animation nil) :init (setq inferior-lisp-program "sbcl" slime-contribs '(slime-fancy))) #+END_QUOTE [[https://github.com/jwiegley/dot-emacs/blob/master/init.org][dot-emacs/init.org at master · jwiegley/dot-emacs]] Captured On: [2023-08-01 Tue 07:48] *** TODO Review Interesting Elisp Settings #+BEGIN_QUOTE (use-package elisp-mode :hook ((emacs-lisp-mode . my/elisp-mode-reduce-mode-name) (emacs-lisp-mode . my/eldoc-shows-more-information)) :config (progn (defun my/elisp-mode-reduce-mode-name () (setq-local mode-name "Elisp")) (defun my/eldoc-shows-more-information () (remove-hook 'eldoc-documentation-functions #'elisp-eldoc-var-docstring t) (add-hook 'eldoc-documentation-functions #'elisp-eldoc-var-docstring-with-value nil t)))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:31] ** Emacs Prog LSP Backlog [0/1] *** TODO [#C] Article on Making LSP and Eglot Faster in Emacs [[https://www.reddit.com/r/emacs/comments/16vixg6/how_to_make_lsp_and_eglot_way_faster_like_neovim/][how to make lsp and eglot way faster like neovim? : emacs]] Captured On: [2023-10-02 Mon 00:52] ** Emacs Prog Python Backlog [0/2] *** TODO Emacs ABL Mode for Python Programming [[https://github.com/afroisalreadyinu/abl-mode][afroisalreadyinu/abl-mode: Emacs minor mode to simplify test-driven development using virtual environments]] Captured On: [2023-11-24 Fri 12:00] *** TODO Python Multi-Line Shells for REPL based Python Programming [[https://github.com/jdtsmith/python-mls][jdtsmith/python-mls: Multi-line Shell Commands for Python REPLs in Emacs]] Captured On: [2023-10-27 Fri 11:14] ** Emacs Prog Testing Backlog [0/4] *** TODO Look into Cask and assess for ERT testing #+BEGIN_QUOTE I am a Cask (http://github.com/cask/cask/) junkie which provides really nice command line invocation of tests, supports multiple versions of Emacs, and runs in a headless environment. I normally run it inside M-x compile. Testing, I use ert.el. The framework is nice, but the reporting can be poor, and keeping tests independent is hard work (that's Emacs' fault rather than ert, I feel). So if I may be excused the plug, I've written assess (https://github.com/phillord/assess) which adds better reporting, macros for keeping Emacs tests free of side-effects, and adds some nice predicates (for roundtripping indentation, testing font-lock and so on). Probably, assess will go into core for Emacs-26 as ert-assess. ecukes and buttercup, I cannot really vouch for one way or the other. The whole BDD doesn't entirely make sense to me. #+END_QUOTE [[https://help-gnu-emacs.gnu.narkive.com/DIgoBtwP/tdd-and-bdd-for-emacs-lisp][TDD and BDD for emacs-lisp]] Captured On: [2023-10-30 Mon 16:58] *** TODO Discussion on running Emacs tests [[https://github.com/jorgenschaefer/emacs-buttercup/issues/174][Running tests with an interactive terminal (noninteractive: nil) · Issue #174 · jorgenschaefer/emacs-buttercup]] Captured On: [2023-10-29 Sun 14:41] *** TODO Restclient API Testing **** TODO Restclient.el [[https://github.com/pashky/restclient.el][pashky/restclient.el: HTTP REST client tool for emacs]] Captured On: [2023-11-01 Wed 15:28] **** TODO Ob-Restclient Integrated API Testing Via Org-Babel [[https://github.com/alf/ob-restclient.el][alf/ob-restclient.el: An org-mode extension to restclient.el]] Captured On: [2023-11-01 Wed 15:28] *** TODO TDD Package emacs-tdd/tdd.el at master · jorgenschaefer/emacs-tdd]] Captured On: [2023-10-30 Mon 17:09] ** Emacs Prog Webdev Backlog [0/0] ** Emacs Selection Framework Backlog [0/1] *** TODO Create Another Selection Framework Config With Updated Selection Frameworks Instead of company with ivy/swiper/counsel, try corfu with selectrum, marginalia, orderless, consult, embark You can use orderless for filtering and prescient for sorting. They aren't mutually exclusive. ** Emacs Snippet Backlog [0/4] *** TODO Consider Ivy-Yasnippet Integration https://github.com/mkcms/ivy-yasnippet *** TODO Integrate YASnippet + Yankpad with Org Capture https://ag91.github.io/blog/2020/07/28/how-to-integrate-yasnippet-and-yankpad-with-org-capture Captured On: [2023-11-10 Fri 17:35] *** TODO Yasnippets With New -ts- Major Modes in Emacs #+BEGIN_QUOTE Advising yasnippet so that existing snippets can work with the new "treesit" -ts- major modes: ;;;###autoload (defun my-treesit-language-or-major-mode-to-legacy-modes (lang-or-mode) (-let* ((lang (replace-regexp-in-string "\\(-ts\\)?-mode$" "" (format "%s" lang-or-mode)))) (pcase lang ("bash" '(sh-mode)) ("json" '(json-mode js-json-mode)) ("rust" '(rust-mode rustic-mode)) (_ (list (intern (format "%s-mode" lang))))))) ;;;###autoload (defun my-yas--modes-to-activate--treesit-modes-a (func &optional mode &rest args) (cond (mode (apply func mode args)) (t (-let* ((non-ts-modes (my-treesit-language-or-major-mode-to-legacy-modes major-mode))) (--> `(,@(apply func mode args) ,@(--mapcat (apply func it args) non-ts-modes)) (delete-dups it)))))) (advice-add #'yas--modes-to-activate :around #'my-yas--modes-to-activate--treesit-modes-a) 2 Reply Share level 2 tryptych · 3 mo. ago Alternatively, you can add a .yas-parents file to a snippets directory, containing the name of the mode(s) it should "inherit". Eg, if your python-ts-mode snippets directory has a .yas-parents file containing "python-mode", then yasnippets for python-ts-mode will automatically include everything defined for python-mode. 3 Reply Share level 3 takutekato · 3 mo. ago Thank you, I didn't know about that. It appears that https://github.com/AndreaCrotti/yasnippet-snippets has already done it. I will only keep this until https://github.com/doomemacs/snippets is updated, then. #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/15g2u1t/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 09:12] *** TODO eshell for loop #+BEGIN_QUOTE #name : Eshell for loop #key : for # -- for f in ${1:*} { ${2:echo} "$f"; $3} $0 #+END_QUOTE [[https://github.com/karthink/yasnippets/blob/master/eshell-mode/for][yasnippets/eshell-mode/for at master · karthink/yasnippets]] Captured On: [2024-04-04 Thu 22:58] ** Emacs Spellcheck Backlog [0/2] *** VERIFY Fix Emacs Spellcheck Functionality Make it work like Malabarba's post again -- even if it's ugly! https://www.reddit.com/r/emacs/comments/8rxm7h/tip_how_to_better_manage_your_spelling_mistakes/ *** TODO Review Flyspell Config **** TODO Review Flyspell Key Bindings It should be obvious which key to hit when the cursor is over a mistake to have flyspell provide a list of corrections using completing-read. **** TODO Review Flyspell Execution There are situations where invoking cj/flyspell-then-abbrev doesn't work. Identify those situations and fix. ** Emacs System Defaults Backlog [0/2] *** TODO replacement current yes-or-no replacement in Emacs Config? #+BEGIN_QUOTE (progn ; `map-ynp' ;; Make all "yes or no" prompts show "y or n" instead (setq read-answer-short t) (setq use-short-answers t)) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:17] *** TODO Don't allow the user to switch out of answering y/n questions in minibuffer #+BEGIN_QUOTE (progn ; `subr' ;; recommended by ;; (info "(embark) How does Embark call the actions?") (setq y-or-n-p-use-read-key t)) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:21] ** Emacs System Utils Backlog [0/15] *** TODO Add Mode-minder to Config Work Show All Major and Minor Modes Available in Emacs [[https://github.com/jdtsmith/mode-minder][jdtsmith/mode-minder: Show all modes available in Emacs]] Captured On: [2023-10-27 Fri 11:10] *** TODO Another Hydra for Timers/Alarms #+BEGIN_QUOTE Hydra / Clock Group clock commands. (pretty-hydra-define hydra-clock (:hint nil :color teal :quit-key "q" :title (with-faicon "clock-o" "Clock" 1 -0.05)) ("Action" (("c" org-clock-cancel "cancel") ("d" org-clock-display "display") ("e" org-clock-modify-effort-estimate "effort") ("i" org-clock-in "in") ("j" org-clock-goto "jump") ("o" org-clock-out "out") ("p" org-pomodoro "pomodoro") ("r" org-clock-report "report")))) #+END_QUOTE [[https://github.com/rememberYou/.emacs.d/blob/master/config.org][.emacs.d/config.org at master · rememberYou/.emacs.d]] Captured On: [2023-11-19 Sun 17:23] *** TODO Change Narrow to Fancy Narrow #+BEGIN_QUOTE fancy-narrow (use-package fancy-narrow :bind (("C-c N N" . fancy-narrow-to-region) ("C-c N W" . fancy-widen)) :commands (fancy-narrow-to-region fancy-widen)) #+END_QUOTE [[https://github.com/jwiegley/dot-emacs/blob/master/init.org][dot-emacs/init.org at master · jwiegley/dot-emacs]] Captured On: [2023-07-31 Mon 16:33] *** TODO Check into Engine Mode for Searching Sites #+BEGIN_QUOTE (use-package engine-mode :config (defengine my-blog "https://www.google.ca/search?q=site:sachachua.com+%s" :keybinding "b") (defengine mail "https://mail.google.com/mail/u/0/#search/%s" :keybinding "m") (defengine google "https://google.com/search?q=%s" :keybinding "g") (defengine emacswiki "https://google.com/search?q=site:emacswiki.org+%s" :keybinding "e") (engine-mode) :hydra (my-engine-mode-hydra (:color blue) "Engine mode" ("b" engine/search-my-blog "blog") ("m" engine/search-mail "mail") ("g" engine/search-google "google") ("e" engine/search-emacswiki "emacswiki"))) #+END_QUOTE [[https://sachachua.com/dotemacs/index.html#org0d11d0e][Sacha Chua's Emacs configuration]] Captured On: [2023-07-31 Mon 15:55] *** TODO Check Out Emacs Vundo Package [[https://github.com/casouri/vundo][casouri/vundo: Visualize the undo tree.]] Captured On: [2024-03-24 Sun 16:46] *** TODO Custom Elisp: Copy Full Link to This Page to the Kill Ring - file - and full path to the file the buffer refers to. - http - works on web pages as well *** TODO Good Org-Pomodoro Config #+BEGIN_QUOTE As a person with a short attention span, the Pomodoro technique allows me to maximize my concentration throughout the day. Personally, I do sessions of 25 minutes of concentrated work and 5 minutes of break. Finally, every two hours, I take a 30 minute break. To use the Pomodoro technique with GNU Emacs, the org-pomodoro package is suggested. (use-package org-pomodoro :after org :custom (alert-user-configuration (quote ((((:category . "org-pomodoro")) libnotify nil)))) (org-pomodoro-audio-player "/usr/bin/mpv") (org-pomodoro-finished-sound "~/audio/pomodoro_finished.mp3") (org-pomodoro-format " %s") (org-pomodoro-killed-sound "~/audio/pomodoro_killed.mp3") (org-pomodoro-long-break-sound "~/audio/pomodoro_long.mp3") (org-pomodoro-overtime-sound "~/audio/pomodoro_overtime.mp3") (org-pomodoro-short-break-sound "~/audio/pomodoro_short.mp3") (org-pomodoro-start-sound "~/audio/pomodoro_start.mp3") (org-pomodoro-start-sound-p t)) #+END_QUOTE [[https://github.com/rememberYou/.emacs.d/blob/master/config.org][.emacs.d/config.org at master · rememberYou/.emacs.d]] Captured On: [2023-11-19 Sun 17:51] *** TODO Implement Org Timer Hydra #+BEGIN_QUOTE Timers, work clocking, and capturing from anywhere (I use this hydra multiple times each hour). (defhydra hydra-global-org (:color blue) "Org" ("t" org-timer-start "Start Timer") ("s" org-timer-stop "Stop Timer") ("r" org-timer-set-timer "Set Timer") ; This one requires you be in an orgmode doc, as it sets the timer for the header ("p" org-timer "Print Timer") ; output timer value to buffer ("w" (org-clock-in '(4)) "Clock-In") ; used with (org-clock-persistence-insinuate) (setq org-clock-persist t) ("o" org-clock-out "Clock-Out") ; you might also want (setq org-log-note-clock-out t) ("j" org-clock-goto "Clock Goto") ; global visit the clocked task ("c" org-capture "Capture") ; Don't forget to define the captures you want http://orgmode.org/manual/Capture.html ("l" org-capture-goto-last-stored "Last Capture")) #+END_QUOTE [[https://github.com/abo-abo/hydra/wiki/orgmode][Orgmode · abo-abo/hydra Wiki]] Captured On: [2023-11-19 Sun 17:18] *** TODO Look Into Emacs-run-command for Any Common Commands [[https://bard.github.io/emacs-run-command/demo][Demo – emacs-run-command]] Captured On: [2024-03-17 Sun 00:45] *** TODO Look Into Ibuffer Sidebar [[https://github.com/jojojames/ibuffer-sidebar][jojojames/ibuffer-sidebar: A sidebar for IBuffer]] Captured On: [2024-03-02 Sat 16:33] *** TODO Look Into Smarter Home/End Keys for Emacs [[https://www.emacswiki.org/emacs/download/pc-keys.el][]] Captured On: [2023-11-23 Thu 12:22] *** TODO Manage External Services Within Emacs With Prodigy https://www.jds.work/emacs-prodigy/ [[https://github.com/rejeep/prodigy.el][rejeep/prodigy.el: Manage external services from within Emacs]] Captured On: [2024-03-24 Sun 17:04] *** TODO Maybe Just This for Notifications in Emacs? #+BEGIN_QUOTE Finally, I use org-wild-notifier to get notifications about TODO items in org-agenda. (use-package org-wild-notifier :after org :custom (alert-default-style 'libnotify) (org-wild-notifier-notification-title "Agenda Reminder") :config (org-wild-notifier-mode)) #+END_QUOTE [[https://github.com/rememberYou/.emacs.d/blob/master/config.org][.emacs.d/config.org at master · rememberYou/.emacs.d]] Captured On: [2023-11-19 Sun 17:49] *** TODO Pasting From Clipboard This is typically used for inserting copied text from the clipboard. Emacs seems to capture this, if so, I need to diassociate ctrl+shift+v from scroll-up-command **** 2023-07-18 @ 14:59:44 -0500 What Emacs Help Text Says scroll-up-command is an interactive and byte-compiled function defined in window.el.gz. Signature (scroll-up-command &optional ARG) Documentation Scroll text of selected window upward ARG lines; or near full screen if no ARG. *** TODO Consider implementing vundo package #+BEGIN_QUOTE (use-package vundo :bind ("C-x u" . vundo) :hook ((vundo-mode . my/vundo-setup)) :init (progn (setq vundo-window-max-height 5)) :config (progn (setq vundo-glyph-alist vundo-unicode-symbols) (defun my/vundo-setup () "Remove mode-line and header-line." (setq mode-line-format nil) (setq header-line-format nil)))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 15:14] ** Emacs Telegram Backlog [0/2] *** TODO Consider Making a Hydra for Telegram *** TODO Review Telega Configuration Snippets https://github.com/zevlg/telega.el/wiki/Configuration-snippets ** Emacs Term and Shell Backlog [0/0] ** Emacs Text Config Backlog [0/8] *** TODO Consider Olivetti Settings #+BEGIN_QUOTE (use-package olivetti :hook (((Info-mode help-mode helpful-mode eww-mode) . olivetti-mode)) :init (progn (setq olivetti-body-width 84))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 14:35] *** TODO Another (Perhaps Better) Emacs Insert Pair #+BEGIN_QUOTE Instead of having insert-pair bindings for a fixed list of opening delimiters, I like to have an entire prefix key dedicated to insert-pair. I've chosen C-S-w for the prefix, so C-S-w followed by any opening delimiter will insert the pair, so you can use C-S-w (, C-S-w [, C-S-w {, etc. What I like about this approach is that the paired delimiters can vary by major mode, and I don't need to add key bindings to handle them. (defvar insert-pair-map (let ((map (make-sparse-keymap))) (define-key map [t] #'insert-pair) map)) (global-set-key (kbd "C-S-w") insert-pair-map) #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/14r48b8/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 09:03] *** TODO Check Search Region Functionality in Emacs #+BEGIN_QUOTE You can search region or user input in duckduckgo using default eww and M-s M-w. If you prefer google and default OS browser you can implement (or grab existing packages): (defun web-search () "Search the web for the text in the region. If region is active, search the web for the text between region beginning and end. Else, prompt the user for a search string." (interactive) (let ((query (if (use-region-p) (buffer-substring (region-beginning) (region-end)) (read-string "Search web for: ")))) (browse-url (format "https://google.com/search?q=%s" (url-hexify-string query))))) ... bind it somewhere, for example: (global-set-key (kbd "M-s M-w") 'web-search) 4 Reply Share level 2 github-alphapapa · 17 days ago See options eww-use-browse-url and M-x customize-group RET browse-url RET. #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/17l7bg8/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 07:26] *** TODO Check That Your Up/Down/Capitalize Case Functions Are All Tied to Good Keybindings #+BEGIN_QUOTE The default commands to upcase/downcase/capitalize words are not convenient, for the following reasons: There are three different commands for upcaseing, for example. The user needs to remember the three commands, their key bindings, and when to use each of them. There should be one command per action: one for upcasing, one for downcasing, and one for capitalizing. The commands on regions don't have dedicated key bindings and are disabled by default. The commands like upcase-word depend on the position of pointer inside of the word, so that the result of upcasing "fo^o"is "foO". This packages assumes that you want "FOO". One needs to use arguments for commands like upcase-word to make them correct the words that one has just written and only one word can be adjusted in this way. Here are the commands that try to fix these flaws: fix-word-upcase fix-word-downcase fix-word-capitalize I propose replacing of the built-ins with these new commands: (global-set-key (kbd "M-u") #'fix-word-upcase) (global-set-key (kbd "M-l") #'fix-word-downcase) (global-set-key (kbd "M-c") #'fix-word-capitalize) #+END_QUOTE [[https://github.com/mrkkrp/fix-word][mrkkrp/fix-word: Transform words in Emacs (upcase, downcase, capitalize, etc.)]] Captured On: [2023-11-18 Sat 07:24] *** TODO Emacs Insert Pair #+BEGIN_QUOTE 28 For parens you can do M-(. For brackets/braces/quotes you could do: (global-set-key (kbd "M-[") 'insert-pair) (global-set-key (kbd "M-{") 'insert-pair) (global-set-key (kbd "M-\"") 'insert-pair) Note that if you don't have a region highlighted, it will just insert the pair of whatevers and put the cursor in between them. Also handy for deleting matching whatevers is (global-set-key (kbd "M-)") 'delete-pair) EDIT: Good point in the comments about overriding backward-paragraph. You could bind it to C-{, which might interfere with something in a major mode. insert-pair takes the last key and does a lookup to see what pair to insert, so if you don't want to bind it to something-{ you could bind to this function instead: (defun my-insert-braces () (interactive) (if (region-active-p) (insert-pair 1 ?{ ?}) (insert "{}") (backward-char))) Share Improve this answer Follow #+END_QUOTE [[https://stackoverflow.com/questions/2951797/wrapping-selecting-text-in-enclosing-characters-in-emacs][Wrapping selecting text in enclosing characters in Emacs - Stack Overflow]] Captured On: [2023-11-18 Sat 09:02] *** TODO Emacs Narrow to Region and Clone Indirect #+BEGIN_QUOTE I have enjoyed my own dwim version of a narrow-to-region + clone-buffer-indirect command I found online for quite some time now. Earlier this week I realized most times I select the current function or paragraph before using the command, so I could make that the default case when there's no region. I came up with this: ;; Inspired by https://demonastery.org/2013/04/emacs-narrow-to-region-indirect/ ;; and modified to DWIM. Also use `pop-to-buffer' instead of `switch-to-buffer' (defun hoagie-clone-indirect-dwim (&optional arg) "Create an indirect buffer, narrow it to defun or active region. If ARG, don't narrow." (interactive "P") (unless (or (use-region-p) arg) (mark-defun)) (let ((start (use-region-beginning)) (end (use-region-end)) ;; we'll pop the buffer manually ;; to clear the region (buf (clone-indirect-buffer nil nil))) (deactivate-mark) (with-current-buffer buf (when (and start end) (narrow-to-region start end) (deactivate-mark)) (pop-to-buffer buf)))) And it covers the same cases as before (thanks to the prefix arg). I bound it in one of my custom keymaps to c (for "clone"). #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/16tes2a/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 08:21] *** TODO Investigate Ialign for a visual align-regexp #+BEGIN_QUOTE ialign (use-package ialign :bind ("C-c {" . ialign)) #+END_QUOTE [[https://github.com/jwiegley/dot-emacs/blob/master/init.org][dot-emacs/init.org at master · jwiegley/dot-emacs]] Captured On: [2023-07-31 Mon 16:57] *** TODO Open Line Above/Below in Emacs #+BEGIN_QUOTE Open line below/above line in VIM, stolen and slighty modified from here https://www.emacswiki.org/emacs/OpenNextLine I use electric-indent-mode so I had no use for indent-according-to-mode. (defun my/open-line-above () "Insert an empty line above the current line." (interactive) (beginning-of-line) (open-line 1)) (defun my/open-line-below (arg) "Insert an empty line below the current line. With a prefix ARG insert line above the current line." (interactive "P") (if arg (my/open-line-above) (end-of-line) (open-line 1) (forward-line 1))) ;; open line (above/below) (global-set-key (kbd "C-o") 'my/open-line-below) (global-set-key (kbd "M-o") 'my/open-line-above) #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/14r48b8/weekly_tips_tricks_c_thread/][(2) Weekly Tips, Tricks, &c. Thread : emacs]] Captured On: [2023-11-18 Sat 09:05] ** Emacs Tramp Backlog [0/1] *** TODO [#C] Review Emacs Wiki and Gnu Documentation on Tramp Mode [[https://www.emacswiki.org/emacs/TrampMode#toc12][EmacsWiki: Tramp Mode]] https://www.gnu.org/software/tramp/ ** Emacs UI Config Backlog [0/2] *** TODO Dedicated Buffers (Emacs won't overwrite/load buffers here) [[https://github.com/emacsorphanage/dedicated/tree/f47b504c0c56fa5ab9d1028417ca1f65a713a2f0][emacsorphanage/dedicated at f47b504c0c56fa5ab9d1028417ca1f65a713a2f0]] Captured On: [2023-07-31 Mon 16:23] *** TODO Rotate Layout in Emacs [[https://github.com/daichirata/emacs-rotate/blob/master/rotate.el][emacs-rotate/rotate.el at master · daichirata/emacs-rotate]] Captured On: [2023-11-23 Thu 12:27] ** Emacs UI Navigation Backlog [0/3] *** TODO Avy Hydra #+BEGIN_QUOTE Avy Avy is a damned fast way to jump to characters, (sub-)words, and lines. In this hydra I combine it with link-hint, a package based on Avy used to jump-to and open URLs: (use-package avy :config (use-package link-hint) (global-set-key (kbd "M-g g") #'avy-goto-line) (defhydra hydra-avy (global-map "M-g" :color blue) "avy-goto" ("c" avy-goto-char "char") ("C" avy-goto-char-2 "char-2") ("w" avy-goto-word-1 "word") ("s" avy-goto-subword-1 "subword") ("u" link-hint-open-link "open-URI") ("U" link-hint-copy-link "copy-URI"))) #+END_QUOTE [[https://ericjmritz.wordpress.com/2015/10/14/some-personal-hydras-for-gnu-emacs/][Some Personal Hydras for GNU Emacs – One More Game-Dev and Programming Blog]] Captured On: [2023-11-19 Sun 16:52] *** TODO Emacs Zoom to Window [[https://github.com/emacsorphanage/zoom-window][emacsorphanage/zoom-window: Zoom and Unzoom window]] Captured On: [2023-11-18 Sat 08:46] *** TODO Window Moving Hydra To Implement in Emacs #+BEGIN_QUOTE Deluxe Window-moving Includes window resizing, winner undo/reset, follow mode, vertical help (defhydra hydra-window () " Movement^^ ^Split^ ^Switch^ ^Resize^ ---------------------------------------------------------------- _h_ ← _v_ertical _b_uffer _q_ X← _j_ ↓ _x_ horizontal _f_ind files _w_ X↓ _k_ ↑ _z_ undo _a_ce 1 _e_ X↑ _l_ → _Z_ reset _s_wap _r_ X→ _F_ollow _D_lt Other _S_ave max_i_mize _SPC_ cancel _o_nly this _d_elete " ("h" windmove-left ) ("j" windmove-down ) ("k" windmove-up ) ("l" windmove-right ) ("q" hydra-move-splitter-left) ("w" hydra-move-splitter-down) ("e" hydra-move-splitter-up) ("r" hydra-move-splitter-right) ("b" helm-mini) ("f" helm-find-files) ("F" follow-mode) ("a" (lambda () (interactive) (ace-window 1) (add-hook 'ace-window-end-once-hook 'hydra-window/body)) ) ("v" (lambda () (interactive) (split-window-right) (windmove-right)) ) ("x" (lambda () (interactive) (split-window-below) (windmove-down)) ) ("s" (lambda () (interactive) (ace-window 4) (add-hook 'ace-window-end-once-hook 'hydra-window/body))) ("S" save-buffer) ("d" delete-window) ("D" (lambda () (interactive) (ace-window 16) (add-hook 'ace-window-end-once-hook 'hydra-window/body)) ) ("o" delete-other-windows) ("i" ace-maximize-window) ("z" (progn (winner-undo) (setq this-command 'winner-undo)) ) ("Z" winner-redo) ("SPC" nil) ) #+END_QUOTE [[https://github.com/abo-abo/hydra/wiki/Window-Management][Window Management · abo-abo/hydra Wiki]] Captured On: [2023-11-19 Sun 17:16] ** Emacs UI-Theme Backlog [0/2] *** TODO Recreate Distinguished-theme. Call it Dupre or something if you like. *** TODO Theming for Emacs #+BEGIN_QUOTE ;;; ;; Modus-themes are just excellent, easy to read and work really well ;; with code as well as text (org-mode, markdown). (use-package modus-themes :ensure t :config (setq modus-themes-org-blocks 'gray-background modus-themes-fringes 'subtle modus-themes-italic-constructs t modus-themes-bold-constructs t modus-themes-syntax '(alt-syntax) modus-themes-hl-line '(intense) modus-themes-paren-match '(intense) modus-themes-mode-line '(borderless)) (setq modus-themes-headings (quote ((1 . (background overline variable-pitch 1.4)) (2 . (overline rainbow variable-pitch 1.25)) (3 . (overline 1.1)) (t . (monochrome)))))) ;; Running modus-themes depending on the time of the day. ;; You need to set the longitude and latitude to your city's for this ;; to be accurate. (use-package solar :ensure nil :custom ;; Brussels ;) (calendar-latitude 50.85) (calendar-longitude 4.35)) (use-package circadian :ensure t :after solar :config (setq circadian-themes '((:sunrise . modus-operandi) (:sunset . modus-vivendi))) (circadian-setup)) #+END_QUOTE [[https://gist.github.com/Nathan-Furnal/b327f14e861f009c014af36c1790ec49][Trimmed down python setup for Emacs. This is a basic `init.el` file for Python, you can pick the bits you like.]] Captured On: [2023-10-16 Mon 14:20] ** Emacs VC Config Backlog [0/9] *** TODO Abridge-Diff for Long Magit Diff Hunks [[https://github.com/jdtsmith/abridge-diff][jdtsmith/abridge-diff: Emacs package for refining diff hunks with very long lines (as in LaTeX files)]] Captured On: [2023-10-27 Fri 11:08] *** TODO [#A] Figure Out VC Installs and Add Snippet **** TODO Investigate Vc-install Failure With Wttrin Config **** TODO Look Into Package-vc-install [[https://tony-zorman.com/posts/package-vc-install.html][Exploring package-vc-install · Tony Zorman]] Captured On: [2023-10-20 Fri 13:29] **** TODO Look Into Vc-use-package [[https://github.com/slotThe/vc-use-package][slotThe/vc-use-package: Primitive package-vc integration for use-package]] Captured On: [2023-10-20 Fri 13:30] **** TODO Reddit Discussion on Package-vc-install [[https://www.reddit.com/r/emacs/comments/z9i4ce/exploring_packagevcinstall_as_an_alternative_to/][(4) Exploring package-vc-install as an alternative to Quelpa : emacs]] Captured On: [2023-10-20 Fri 13:32] **** TODO Video on Vc-install Package [[https://www.youtube.com/watch?v=uaXgvQCcEl0][(1) Emacs 29 package-vc-install install packages from github - YouTube]] Captured On: [2023-10-20 Fri 13:31] *** TODO Git Gutter Hydra Example #+BEGIN_QUOTE This one for git-gutter is very handy (defhydra hydra-git-gutter (:body-pre (git-gutter-mode 1) :hint nil) ("n" git-gutter:next-hunk "next hunk") ("p" git-gutter:previous-hunk "previous hunk") ("h" (progn (goto-char (point-min)) (git-gutter:next-hunk 1)) "first hunk") ("l" (progn (goto-char (point-min)) (git-gutter:previous-hunk 1)) "last hunk") ("" git-gutter:popup-hunk "popup hunk") ("s" git-gutter:stage-hunk "stage hunk") ("r" git-gutter:revert-hunk "revert hunk") ("q" nil "quit")) #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/gr2zaj/what_are_your_useful_hydras/][(2) What are your useful hydras? : emacs]] Captured On: [2024-03-09 Sat 13:36] *** TODO Investigate git-walktree for browsing your git repos [[https://github.com/10sr/git-walktree-el/tree/a1a5490b89d193724ec637818baf2d8edf97c638][10sr/git-walktree-el at a1a5490b89d193724ec637818baf2d8edf97c638]] Captured On: [2023-07-31 Mon 17:07] *** TODO Investigate Vdiff and Magit-vdiff packages #+BEGIN_QUOTE vdiff (use-package vdiff :commands (vdiff-files vdiff-files3 vdiff-buffers vdiff-buffers3)) #+END_QUOTE [[https://github.com/jwiegley/dot-emacs/blob/master/init.org][dot-emacs/init.org at master · jwiegley/dot-emacs]] Captured On: [2023-07-31 Mon 17:29] *** TODO Understand Git Rebase and Squash Workflow in Magit #+BEGIN_QUOTE This process can be streamlined significantly — I thought that was what I was about to read — with the magit-commit-fixup/squash commands (c f and c s). I use those all the time. When you have staged your fixup changes, do c f and then it offers you the log to select which commit you're fixing up (with .). Then, e.g. for original commit title "original commit", it'll make your new commit with title "fixup! original commit". Subsequently when you interactive rebase, git will reorder and flag the fixups (and squashes) automatically, providing you have the rebase.autosquash config setting set to true. i.e. in ~/.gitconfig: [rebase] autosquash = true (Edited: case typos) level 2 · 9 yr. ago You mean c f and c s, lowercase c. The difference here is that this only modifies the latest commit with the currently staged changes. Very handy, but if you want to rewrite history (reword, fixup, reorder commits, edit commits), you will need interactive rebase. level 3 · 9 yr. ago Oh right, sorry I screwed up the case thing (edited) However, I don't know what you mean about the latest commit. This isn't for amending the latest commit (c a), c f and c s is for adding fixup or squash commits for any existing commit. It's not a replacement for interactive rebasing, it's just a more streamlined way to do it. #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/2q7ohw/til_how_to_squash_commits_using_magit/][(4) TIL How to Squash Commits using Magit : emacs]] Captured On: [2023-10-23 Mon 06:15] *** TODO Warn When Leaving Dirty Repository [[https://github.com/thisirs/vc-check-status#vc-check-status][thisirs/vc-check-status: Package that warns you when quitting emacs and leaving a repository dirty.]] Captured On: [2024-02-29 Thu 10:12] *** TODO Forge Config #+BEGIN_QUOTE (use-package forge :demand t :after magit :hook (forge-post-submit-callback . my/forge-start-timer-for-draft-pullreq) :config (progn (setq-default forge-buffer-draft-p t) (defun my/forge-start-timer-for-draft-pullreq (pullreq &rest _) "Start a `tmr' timer if PULLREQ is draft." (when (map-elt pullreq 'draft) (when-let* ((url (map-elt pullreq 'url)) (minutes (cond ((string-match-p "foretagsplatsen/monitor" url) 15) (t 10)))) (require 'tmr) (tmr minutes (format "Check draft %s" url) t)))))) (use-package forge-topic :init (progn (setq forge-topic-list-limit '(60 . -1)))) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 15:18] *** TODO Magit Config to Review #+BEGIN_QUOTE (use-package magit :bind (( :map magit-mode-map ("M-w" . magit-copy-section-value))) :init (progn (setq magit-diff-refine-hunk t) (setq magit-process-find-password-functions '(magit-process-password-auth-source)) (setq magit-branch-prefer-remote-upstream '("master")) (setq magit-branch-adjust-remote-upstream-alist '(("origin/master" "master") ("origin/main" "main"))) (setq magit-module-sections-nested nil) (setq magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1) (setq magit-no-confirm '(amend-published trash)) (setq magit-revision-insert-related-refs nil) (setq magit-revision-show-gravatars t) (setq magit-clone-set-remote.pushDefault t)) :config (progn ;; Enable magit-clean (put 'magit-clean 'disabled nil) ;; Add modules in magit status buffer: (magit-add-section-hook 'magit-status-sections-hook 'magit-insert-modules 'magit-insert-unpulled-from-upstream) ;; Only show the module sections I'm interested in (with-eval-after-load "magit-submodule" (remove-hook 'magit-module-sections-hook 'magit-insert-modules-overview) (remove-hook 'magit-module-sections-hook 'magit-insert-modules-unpulled-from-pushremote) (remove-hook 'magit-module-sections-hook 'magit-insert-modules-unpushed-to-upstream) (remove-hook 'magit-module-sections-hook 'magit-insert-modules-unpushed-to-pushremote)) (transient-replace-suffix 'magit-commit 'magit-commit-autofixup '("x" "Absorb changes" magit-commit-absorb)) (dir-locals-set-class-variables 'my/magit-huge-git-repository '((magit-status-mode . ((eval . (magit-disable-section-inserter 'magit-insert-tags-header)) (eval . (magit-disable-section-inserter 'magit-insert-untracked-files)) (eval . (magit-disable-section-inserter 'magit-insert-modules)))))) (let ((huge-repos '("~/Documents/projects/nix/nixpkgs-master" "~/Documents/projects/nix-system/nixpkgs/"))) (dolist (repo huge-repos) (dir-locals-set-directory-class (expand-file-name repo) 'my/magit-huge-git-repository))))) (use-package magit-diff :bind ( :map magit-diff-section-map ;; disable binding that I use for begining of buffer ("C-x a" . nil))) (use-package magit-extras :demand (project magit)) (use-package magit-tbdiff :demand t :after magit) #+END_QUOTE [[https://github.com/DamienCassou/emacs.d/blob/master/init.el#L352][emacs.d/init.el at master · DamienCassou/emacs.d]] Captured On: [2024-04-05 Fri 15:19] ** Emacs Window/Buffer Config Backlog [0/1] *** TODO Investigate Using Popper for Window Management Demo: https://www.youtube.com/watch?v=E-xUNlZi3rI Repo: https://github.com/karthink/popper * Emacs Config Notes ** 2023-11-03 Fri @ 18:28:36 -0500 Break Code Into Divisions CLOSED: [2023-11-03 Fri 18:28] ** 2023-11-01 Wed @ 10:33:34 -0500 Decision: no need for specific order in init.el Question: Is there any reason to keep associated functionality adjacent in the init.el list? Answer: No. In fact, I should prevent the need for ordering. Ordering constraints should be considered a bug. *** Functionality related to interdependent workflows together: No Example: Org-agenda leverages org-roam project files in building its agenda. Does that mean they should be adjacent? I can adjust this anyway I want. It's best to have these loosely coupled. Since this is the target, I'm going to say I should not specify an order, but when I discover a hard dependency, I should indicate that in the code with the use-package :after clause. *** Most frequently used functionality: No I believe this org-reorg project may take time and I will want to use org functionality to take notes without having to launch another version of Emacs from the main branch. Given this, I should probably do the work in the order I use it, but that doesn't mean it must be ordered that way in init.el. ** 2023-11-01 Wed @ 09:59:35 -0500 General Strategy All changes will happen in the 'org-reorg' branch, allowing use of Emacs without breakages from changes. Here's are the major divisions, in priority order. org-config ;; general settings, keybindings, org-contrib org-appearance-config ;; bullets, faces, etc. org-agenda-config ;; org-agenda, org-superagenda, org-todo org-babel-config ;; org-babel languages/settings, org-tempo org-capture-config ;; capture templates, refiling, org-web-clipper org-drill-config ;; org-drill (already broken out) org-export-config ;; org-export org-roam-config ;; org-roam (already broken out) Note: org-mode will be loaded via use-package with a delay of .5 seconds. All other org-* modules will be wrapped in the (with-eval-after-load) function so the code is guaranteed to load after org-mode itself. This avoids some current errors of trying to add a binding to a keymap before it's been created, or similar. * Emacs Config Testing Notes ** Release Resting Checklist updated Sunday, April 07, 2024 at 12:44:55 PM CDT *** TODO No Open Work *** TODO WIP Code Empty/Disabled *** TODO Emacs Config Inbox Zero *** TODO Check for Listed Keys *** TODO Run all ERT Tests *** TODO Perf Testing: Sub-Second Launch Time *** TODO Successful Hands-Off Launch from Git Clone *** TODO Successful Hands-Off Launch from Archsetup *** TODO Develop Branch Cleanly Merged Into Main *** TODO Main Branch Pushed to Github and git.cjennings.net *** TODO 2 Week Scenario Testing / Bug Fixing *** TODO Mark Release as DONE and version Create Tag on Repositories * Emacs Config Examples ** Bodhizar Batsov's Emacs Configuration [[https://github.com/bbatsov/emacs.d][bbatsov/emacs.d: My personal Emacs configuration]] Captured On: [2023-11-04 Sat 23:30] ** Brett Lempereur's Emacs Config [[https://github.com/brett-lempereur/.emacs.d][brett-lempereur/.emacs.d: Portable Emacs configuration]] Captured On: [2023-11-04 Sat 19:24] ** Damien Cassou's Emacs Config https://github.com/DamienCassou/emacs.d https://raw.githubusercontent.com/DamienCassou/emacs.d/master/init.el ** Howard Abrams Dotfiles [[https://github.com/howardabrams/dot-files/blob/master/emacs-org.org][dot-files/emacs-org.org at master · howardabrams/dot-files]] Captured On: [2024-04-15 Mon 22:45] ** Jon Wiegley's Emacs Config [[https://github.com/jwiegley/dot-emacs/blob/master/init.org][dot-emacs/init.org at master · jwiegley/dot-emacs]] Captured On: [2023-11-01 Wed 12:01] ** Protesilaos Stavrou's Emacs Config [[https://git.sr.ht/~protesilaos/dotfiles/tree/master/item/emacs/.emacs.d][~protesilaos/dotfiles: emacs/.emacs.d/ - sourcehut git]] Captured On: [2023-11-04 Sat 18:51] ** Rememberyou's Emacs Config [[https://github.com/rememberYou/.emacs.d/blob/master/config.org][.emacs.d/config.org at master · rememberYou/.emacs.d]] Captured On: [2023-11-18 Sat 07:07] ** Snosov1's Emacs Config [[https://github.com/snosov1/dot-emacs][snosov1/dot-emacs: Emacs configuration]] Captured On: [2023-07-16 Sun 09:21] ** Steve Purcell's Emacs Config [[https://github.com/purcell/emacs.d][purcell/emacs.d: An Emacs configuration bundle with batteries included]] Captured On: [2023-11-04 Sat 18:48] ** ThoughtBot's dotfiles [[https://github.com/thoughtbot/dotfiles][thoughtbot/dotfiles: A set of vim, zsh, git, and tmux configuration files.]] Captured On: [2024-03-14 Thu 04:36] ** Zzamboni's Emacs Config [[https://zzamboni.org/post/my-emacs-configuration-with-commentary/][zzamboni.org | My Emacs Configuration, With Commentary]] Captured On: [2024-04-15 Mon 22:54] * Emacs FAQ/Reference ** Testing REST API with Emacs [[https://emacs.stackexchange.com/questions/2427/how-to-test-rest-api-with-emacs][package - How to test REST API with Emacs? - Emacs Stack Exchange]] Captured On: [2023-11-01 Wed 15:58] ** Emacs Keybinding to Lambda #+BEGIN_QUOTE Emacs Lisp: Keybinding to Lambda # The Problem if you simply bind a key to a lambda with ‘define-key’, the key will be reported by describe-bindings with a ?? For instance #+begin_src emacs-lisp :tangle no (define-key global-map [pause] '(lambda () "say foo" (interactive) (message "foo"))) #+end_src results in ?? # The Solution A solution is to give the lambda a name describing its function. This wrapper can be used to turn the documentation string into a name … #+begin_src emacs-lisp :tangle no (defun lambda-key (keymap key def) "Wrap`define-key' to provide documentation." (set 'sym (make-symbol (documentation def))) (fset sym def) (define-key keymap key sym)) #+end_src Then after … #+begin_src emacs-lisp :tangle no (lambda-key global-map [pause] '(lambda () "say foo" (interactive) (message "foo"))) #+end_src … the key binding will be described like this: say foo Since ‘lambda-key’ has the same signature as ‘define-key’, you can quickly switch between them. (Tested with Emacs 25.2) [[https://www.emacswiki.org/emacs?search=%22DocumentingKeyBindingToLambda%22][DocumentingKeyBindingToLambda]] #+END_QUOTE [[][]] Captured On: [2023-11-27 Mon 18:15] ** How do I rebind some keys to another keybinding? This rebinding intends to shorten a longer keybinding sequence to a shorter one. Note: this leaves the original longer keybinding in place #+begin_src emacs-lisp ;; disabled, but leaving for reference on how to rebind keys to another binding ;; (define-key global-map (kbd "C-c g") (kbd "C-c c g")) #+end_src ** How to set fonts for specific ranges of Unicode codepoints #+BEGIN_QUOTE (when (display-graphic-p) (set-fontset-font "fontset-default" '(#xe000 . #xe07d) "FreeMonoTengwar")) #+END_QUOTE [[https://github.com/chrisbouchard/dotfiles/blob/9bfbe4566520d9e5d8ca998901e120564982d5eb/home/.spacemacs#L606][dotfiles/home/.spacemacs at 9bfbe4566520d9e5d8ca998901e120564982d5eb · chrisbouchard/dotfiles]] Captured On: [2023-11-04 Sat 17:08] ** WebKit Downgrade Instructions for Emacs #+BEGIN_QUOTE Hi! I'm using Arch Linux and I've finally managed to downgrade webkit2gtk and recompile emacs 29. This is what I've done: I've installed downgrade using yay from AUR I've downgraded webkit2gtk to 2.40 $ sudo pacman -Qi webkit2gtk Name : webkit2gtk Version : 2.40.5-2 Description : Web content engine for GTK Architecture : x86_64 URL : https://webkitgtk.org Licenses : custom Groups : None Provides : libjavascriptcoregtk-4.0.so=18-64 libwebkit2gtk-4.0.so=37-64 ... 3) I've recompiled emacs using: $ ./configure -C --prefix=$HOME/.local/opt/emacs-29 --with-json --with-xwidgets --with-mailutils --with-tree-sitter --with-native-compilation --with-imagemagick --with-gif --with-jpeg --with-png --with-xml2 --with-tiff --with-libsystemd --with-modules $ make -j 4 install 4) Check if emacs binary loads the right shared object: $ ldd ~/.local/opt/emacs-29/bin/emacs | grep webkit libwebkit2gtk-4.0.so.37 => /usr/lib/libwebkit2gtk-4.0.so.37 (0x00007fa2d9400000) 5) Started emacs: ~/.local/opt/emacs-29/bin/emacs --with-profile doom Now I can use xwebkit again. I hope this is useful. #+END_QUOTE [[https://www.reddit.com/r/emacs/comments/17g6npv/xwidgetwebkit_has_started_crashing_emacs_sessions/][(1) `xwidget-webkit` has started crashing Emacs sessions : emacs]] Captured On: [2024-03-20 Wed 09:11] ** Getting Emacs webkit to work on Arch Linux TLDR: add #+begin_src sh -xrm "emacs.synchronous: true" #+end_src to the end of the emacs startup command *** from https://bbs.archlinux.org/viewtopic.php?id=294283 While I was reading through this thread (https://lists.gnu.org/archive/html/bug- … 00651.html) I saw this CLI arguments: -xrm "emacs.synchronous: true" When I run Emacs (with xwidget-webkit support enabled) like this: ~/.local/opt/emacs/bin/emacs --init-directory ~/.config/emacs -xrm "emacs.synchronous: true" xwidget-webkit works! ** Set up Emacs to work with gpg files for authentication Article Link: http://prodissues.com/2016/02/emacs-gpg-for-dummies.html Captured On: [2024-04-13 Sat 05:29] [[http://prodissues.com/][prodissues]] • [[http://prodissues.com/about/][about]] • [[http://prodissues.com/about/#contact][contact]] • [[https://twitter.com/prodissues][twitter]] • [[http://prodissues.com/feeds/all.atom.xml][feed]] Emacs GPG For Dummies Tue 16 February 2016 by yaniv I've [[https://prodissues.com/2016/02/adding-mu4e-support-to-emacs.html][set up mu4e]], and have my Gmail credentials stored in two files: 1 .offlineimaprc - this file is used by Offlineimap to connect to my Gmail and sync my inbox with mu4e. 2 .authinfo - that file stores my Gmail credential, and used by Emacs to send emails. Unfortunately, both of those files are plain text, and though I’m not a security freak, I’m uncomfortable storing my passwords out in the open. So, I went ahead to find out how to encrypt them. Most of the tutorials I read were too technical, and covered much more than my simple usecase. It’s not that I couldn’t follow theme, but I know I wouldn’t have retained the information, and able to retract my steps if I needed to in the future. My goal with this post was to create a simple guide on how to install gpg, generate a key, and use it in mu4e. I failed... I thought I will be able to it non-technical for the most part, but once getting to configure Emacs and mu4e to work with gpg, I had to delve into some heavy configuration, which included the creation of a python script to work along Offlineimap... The good thing is that this guide will help you get Emacs and mu4e work with an encrypted version of a .authinfo file, and your credentials will remain secret. Now that our expectations are set, and assuming you're up for the ride, lets start this journey. Installing GPG ~ $ brew install gpg Let's make sure gpg was installed: ~ $ gpg --version gpg--version.png Figure 1: gpg version information along with the list of supported algorithms Now really, the most informative source of information is gpg's help. Go ahead and skim it: ~ $ gpg -h Create a key ~ $ gpg --gen-key There’s a simple wizard that lets you set the encryption type, and asks for your name, email address and other comments. Those details will be associated with your key. Next, you’ll be asked to create a passphrase. This is like the password to your secret key. If you lose it, you’ll have no access to any of the information encrypted with this key. So don’t ever lose it… Here’s how this flow looks like: ~ $ gpg --gen-key gpg (GnuPG) 1.4.19; Copyright (C) 2015 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 1 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire = key expires in n days w = key expires in n weeks m = key expires in n months y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) " Real name: Jane Roe Email address: jane@example.com Comment: lorem ipsum You selected this USER-ID: "Jane Roe (lorem ipsum) " Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. ..........+++++ .+++++ We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. ..........+++++ ...+++++ gpg: key 86B62C98 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u pub 2048R/86B62C98 2016-02-17 Key fingerprint = 42FD C031 BD51 4CC8 7C02 EA14 35D4 80A2 86B6 2C98 uid Jane Roe (lorem ipsum) sub 2048R/8C0D5E5D 2016-02-17 ~ $ Now that you've created a key, you can go ahead and sign the .authinfo file. Sign and encrypt the .authinfo file[[http://prodissues.com/2016/02/emacs-gpg-for-dummies.html#fn-1][1]] ~ $ gpg -se .authinfo You'll be asked for your passphrase. Enter it, and the .authinfo will be signed, and renamed to . authinfo.gpg [[https://www.emacswiki.org/emacs/GnusAuthinfo][EmacsWiki]] suggests to limit permission to this file. I find it important: ~ $ chmod 600 .authinfo.gpg Back in Emacs, there are couple of changes we need to make in order for mu4e to start working with the , authinfo.gpg file. I wish I read [[https://gist.github.com/areina/3879626][this gist]] before, because it covers those changes succinctly, but here is a summary of those modifications: Changes to .offlineimaprc Two additions: 1 A reference to a python file where you'll store a function to fetch your credentials from the . authinfo.gpg file 2 Under the [Repository Remote] section add the call to the get_password_emac function Here's how your .offlineimaprc file will look like afterwards: [general] accounts = Gmail maxsyncaccounts = 3 pythonfile = ~/.offlineimap.py [Account Gmail] localrepository = Local remoterepository = Remote [Repository Local] type = Maildir localfolders = ~/Maildir [Repository Remote] type = IMAP remoteuser = yanivdll@gmail.com remotehost = imap.gmail.com remotepasseval = get_password_emacs("imap.gmail.com", "yanivdll@gmail.com", "993") ssl = yes sslcacertfile = /usr/local/etc/openssl/certs/ca-bundle.crt maxconnections = 1 realdelete = no Add a .offlineimap.py file This file will define the get_password_emac function: #!/usr/bin/python import re, os def get_password_emacs(machine, login, port): s = "machine %s login %s port %s password ([^ ]*)\n" % (machine, login, port) p = re.compile(s) authinfo = os.popen("gpg -q --no-tty -d ~/.authinfo.gpg").read() return p.search(authinfo).group(1) Changes to mu4e config ------------------------------------------------------------------------------------------------------------------------- Lastly, in your Emacs config, under the mu4e smtp settings, add a reference to the encrypted auth file: ... (setq message-send-mail-function 'smtpmail-send-it starttls-use-gnutls t smtpmail-starttls-credentials '(("smtp.gmail.com" 465 nil nil)) smtpmail-auth-credentials (expand-file-name "~/.authinfo.gpg") smtpmail-default-smtp-server "smtp.gmail.com" smtpmail-smtp-server "smtp.gmail.com" smtpmail-smtp-service 465 smtpmail-debug-info t) ... Now, you're emails should be sent using the .authinfo.gpg file. Go on and try it[[http://prodissues.com/2016/02/emacs-gpg-for-dummies.html#fn-2][2]]. Note that before actually sending the email, Emacs will ask for your pass-phrase[[http://prodissues.com/2016/02/emacs-gpg-for-dummies.html#fn-3][3]] Extras Backup private key I stored all the information related to my gpg key, as well as a backup file in my [[https://agilebits.com/onepassword][1password]]. Here's how I created the key backup: ~ $ gpg --export-secret-keys --armor jane@example.com > jroe-privkey.asc Important: Make sure to store the output file in a secure place; it contains your private key in plain text. Encrypt text in Emacs 1 Mark the text you would like to encrypt 2 Run M-x epa-encrypt-region 3 Mark the key you would like to use for encryption Now the encrypted text will replace the original, plain, text: encrypted-text.png Figure 2: M-x epa-encrypt-region will encrypt a region of text in Emacs Decrypt text To decrypt a message, or a file you've encrypted: 1 Mark the text you would like to decrypt (you'll have to mark also the header and footer of the message) 2 Run M-x epa-decrypt-region decrypt-text.png Figure 3: M-x epa-decrypt-region will decrypt a region of text in Emacs 3 Enter your pass-phrase 4 Emacs will ask if you want the decrypted text to replace the original text. If you choose "No", it will open the text in a second window. decrypted-text-2.png Figure 4: The decrypted text in a second window That's it. If you're interested in more than the basics that I went through above, try the links bellow. Reference • [[https://www.gnupg.org/documentation/howtos.html][Gnupg - documentation]] • Using gpg in emacs - [[https://www.gnu.org/software/emacs/manual/html_mono/epa.html#Quick-start][EasyPG Assistant user’s manual]] • [[https://fedoraproject.org/wiki/Creating_GPG_Keys#ExportCLI][Fedora Wiki pages]] - GPG essentials • [[https://www.emacswiki.org/emacs/GnusAuthinfo][EmacsWiki - GnusAuthinfo]] • [[http://danzorx.tumblr.com/post/11976550618/easypg-for-emacs-on-os-x-or-sometimes-emacs][Tricotism - EasyPG for Emacs on OS X, or sometimes Emacs doesn’t load the env paths you might expect]] • [[http://ubuntuforums.org/showthread.php?t=2155060][ubuntu forums]] Encrypting and decrypting a message ------------------------------------------------------------------------------------------------------------------------- 1 Made an edit here (initially, I only signed the file, without encrypting it). Thanks [[https://www.reddit.com/user/aminb][/u/aminab]] for [[https://www.reddit.com/r/emacs/comments/46fi6f/adding_mu4e_support_to_emacs_part_two_configuring/d04szm3][the correction]]. [[http://prodissues.com/2016/02/emacs-gpg-for-dummies.html#fnref-1][↩]] 2 If you still have the .authinfo file, rename it. Once we see that mu4e sends emails using the encrypted version of the auth file, we can dispose this, decrypted, version of it. [[http://prodissues.com/2016/02/emacs-gpg-for-dummies.html#fnref-2][↩]] 3 If Emacs asks for your passphrase too often, you might find this [[https://www.reddit.com/r/emacs/comments/45lx1s/adding_mu4e_support_to_emacs_the_hard_way/d01b1hu][comment in Reddit]], by [[https://www.reddit.com/user/aminb][/u/aminb]], helpful. [[http://prodissues.com/2016/02/emacs-gpg-for-dummies.html#fnref-3][↩]] Powered by [[http://getpelican.com/][Pelican]]. Written in [[http://python.org][Python]]. Codebase on [[https://github.com/yanivdll/prodissues][Github]] ** [[https://xenodium.com/emacs-chaining-org-babel-blocks/][Emacs: chaining org babel blocks]] Article Link: https://xenodium.com/emacs-chaining-org-babel-blocks/ Captured On: [2024-04-13 Sat 04:11] Álvaro Ramírez 27 October 2020 Emacs: chaining org babel blocks Recently wanted to chain org babel blocks. That is, aggregate separate source blocks and execute as one combined block. chain.gif I wanted the chaining primarily driven through header arguments as follows: #+name: block-0 #+begin_src swift print("hello 0") #+end_src #+name: block-1 #+begin_src swift :include block-0 print("hello 1") #+end_src #+RESULTS: block-1 : hello 0 : hello 1 I didn't find the above syntax and behaviour supported out of the box (or didn't search hard enough?). Fortunately, this is our beloved and malleable editor, so we can always bend it our way! Wasn't quite sure how to go about it, so I looked at other babel packages for inspiration. [[https://github.com/astahlman/ob-async][ob-async]] was great for that. Turns out, advicing org-babel-execute-src-block did the job: (defun adviced:org-babel-execute-src-block (&optional orig-fun arg info params) (let ((body (nth 1 info)) (include (assoc :include (nth 2 info))) (named-blocks (org-element-map (org-element-parse-buffer) 'src-block (lambda (item) (when (org-element-property :name item) (cons (org-element-property :name item) item)))))) (while include (unless (cdr include) (user-error ":include without value" (cdr include))) (unless (assoc (cdr include) named-blocks) (user-error "source block \"%s\" not found" (cdr include))) (setq body (concat (org-element-property :value (cdr (assoc (cdr include) named-blocks))) body)) (setf (nth 1 info) body) (setq include (assoc :include (org-babel-parse-header-arguments (org-element-property :parameters (cdr (assoc (cdr include) named-blocks))))))) (funcall orig-fun arg info params))) (advice-add 'org-babel-execute-src-block :around 'adviced:org-babel-execute-src-block) Before I built my own support, I did find that [[https://orgmode.org/manual/Noweb-Reference-Syntax.html][noweb]] got me most of what I needed, but required sprinkling blocks with placeholder references. noweb.gif Combining [[https://orgmode.org/manual/Noweb-Reference-Syntax.html][:noweb]] and [[https://org-babel.readthedocs.io/en/latest/header-args/#prologue][:prologue]] would have been a great match, if only prologue did expand the noweb reference. I'm sure there's an alternative I'm missing. Either way, it was fun to poke at babel blocks and build my own chaining support. ** [[https://xenodium.com/emacs-password-protect-current-pdf-revisited/][Emacs: Password-protect current pdf (revisited)]] Article Link: https://xenodium.com/emacs-password-protect-current-pdf-revisited/ Captured On: [2024-04-13 Sat 04:18] Álvaro Ramírez 09 July 2022 Emacs: Password-protect current pdf (revisited) UPDATE: [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is now available on [[https://melpa.org/#/dwim-shell-command][melpa]]. passprotect.gif With a recent look at writing [[https://xenodium.com/emacs-dwim-shell-command/][DWIM shell commands]], I've been revisiting my custom Emacs functions invoking command line utilities. Take this [[https://xenodium.com/emacs-password-protect-current-pdf/][post]], for example, where I invoke [[https://github.com/qpdf/qpdf][qpdf]] via a elisp. Using the new dwim-shell-command--on-marked-files in [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-command.el][dwim-shell-command.el]], the code is stripped down to a bare minimum: (defun dwim-shell-commands-pdf-password-protect () "Password protect pdf." (interactive) (dwim-shell-command-on-marked-files "Password protect pdf" (format "qpdf --verbose --encrypt '%s' '%s' 256 -- '<>' '<>_enc.<>'" (read-passwd "user-password: ") (read-passwd "owner-password: ")) :utils "qpdf" :extensions "pdf")) Compare the above dwim-shell-command--on-marked-files usage to my [[https://xenodium.com/emacs-password-protect-current-pdf/][previous implementation]]: (defun pdf-password-protect () "Password protect current pdf in buffer or `dired' file." (interactive) (unless (executable-find "qpdf") (user-error "qpdf not installed")) (unless (equal "pdf" (or (when (buffer-file-name) (downcase (file-name-extension (buffer-file-name)))) (when (dired-get-filename nil t) (downcase (file-name-extension (dired-get-filename nil t)))))) (user-error "no pdf to act on")) (let* ((user-password (read-passwd "user-password: ")) (owner-password (read-passwd "owner-password: ")) (input (or (buffer-file-name) (dired-get-filename nil t))) (output (concat (file-name-sans-extension input) "_enc.pdf"))) (message (string-trim (shell-command-to-string (format "qpdf --verbose --encrypt '%s' '%s' 256 -- '%s' '%s'" user-password owner-password input output)))))) This really changes things for me. I'll be more inclined to add more of these tiny integrations to lots of great command line utilities. Take this recent [[https://news.ycombinator.com/item?id=32028752][Hacker News post]] on [[https://github.com/ocrmypdf/OCRmyPDF][ocrmypdf]] as an example. Their [[https://ocrmypdf.readthedocs.io/en/latest/cookbook.html][cookbook]] has lots of examples that can be easily used via dwim-shell-command--on-marked-files. What command line utils would you use? ** [[https://xenodium.com/emacs-dwim-shell-command-multi-language/][Emacs: DWIM shell command (multi-language)]] Article Link: https://xenodium.com/emacs-dwim-shell-command-multi-language/ Captured On: [2024-04-13 Sat 04:19] Álvaro Ramírez 10 July 2022 Emacs: DWIM shell command (multi-language) UPDATE: [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] is now available on [[https://melpa.org/#/dwim-shell-command][melpa]]. csv.gif I keep on [[https://xenodium.com/png-to-icns-emacs-dwim-style/][goofying around]] with [[https://github.com/xenodium/dwim-shell-command][dwim-shell-command]] and it's sibling dwim-shell-command-on-marked-files from [[https://github.com/xenodium/dwim-shell-command/blob/main/dwim-shell-command.el][dwim-shell-command.el]]. In addition to defaulting to [[https://en.wikipedia.org/wiki/Z_shell][zsh]], dwim-shell-command-on-marked-files now support other shells and languages. This comes in handy if you have snippets in different languages and would like to easily invoke them from Emacs. Multi-language support enables "using the best tool for the job" kinda thing. Or maybe you just happen to know how to solve a particular problem in a specific language. Let's assume you have an existing Python snippet to convert files from csv to json. With dwim-shell-command-on-marked-files, you can invoke the Python snippet to operate on either [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html][dired]] or buffer files. (defun dwim-shell-command-csv-to-json-via-python () "Convert csv file to json (via Python)." (interactive) (dwim-shell-command-on-marked-files "Convert csv file to json (via Python)." " import csv import json text = json.dumps({ \"values\": list(csv.reader(open('<>')))}) fpath = '<>.json' with open(fpath , 'w') as f: f.write(text)" :shell-util "python" :shell-args "-c")) Or, maybe you prefer Swift and already had a snippet for the same thing? (defun dwim-shell-command-csv-to-json-via-swift () "Convert csv file to json (via Swift)." (interactive) (dwim-shell-command-on-marked-files "Convert csv file to json (via Swift)." " import Foundation import TabularData let filePath = \"<>\" print(\"reading \\(filePath)\") let content = try String(contentsOfFile: filePath).trimmingCharacters(in: .whitespacesAndNewlines) let parsedCSV = content.components(separatedBy: CSVWritingOptions().newline).map{ $0.components(separatedBy: \",\") } let jsonEncoder = JSONEncoder() let jsonData = try jsonEncoder.encode([\"value\": parsedCSV]) let json = String(data: jsonData, encoding: String.Encoding.utf8) let outURL = URL(fileURLWithPath:\"<>.json\") try json!.write(to: outURL, atomically: true, encoding: String.Encoding.utf8) print(\"wrote \\(outURL)\")" :shell-pipe "swift -")) You can surely solve the same problem in elisp, but hey it's nice to have options and flexibility.