Remove unused code, overhaul of file opening shortcuts section

Remove adding myself as a Bcc to emails, I don’t need that with mu4e

Shortcuts for opening files are now generated from org tables.
This commit is contained in:
Lucien Cartier-Tilet 2020-07-23 13:46:55 +02:00
parent 0f7c20e8c9
commit fc9cfd3a3c
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -2013,18 +2013,6 @@
mu4e-headers-visible-columns 140) mu4e-headers-visible-columns 140)
#+END_SRC #+END_SRC
I want to add myself as a hidden recipient to all of my messages so I can get
them in the email thread in my inbox and not just get a thread of messages
not sent by me the thread could kinda lack some context if the other people
do not insert my email in their answer. But unfortunately, for some obscure
reason, mu4e does not use the following variable for its email templates, so
I am keeping this as a reminder I should find how to fix that. It does work
when Im exporting an org file to and HTML buffer to be sent by email through
~, e m~.
#+BEGIN_SRC emacs-lisp
(setq message-default-headers "Bcc: Lucien Cartier-Tilet <lucien@phundrak.com>\n")
#+END_SRC
Finally but very importantly, this is the setup I have for my SMTP mail Finally but very importantly, this is the setup I have for my SMTP mail
server: I point Emacs SMTP services to my private mail server on its SMTP server: I point Emacs SMTP services to my private mail server on its SMTP
port, which should be used with a STARTTLS stream. And I tell Emacs this is port, which should be used with a STARTTLS stream. And I tell Emacs this is
@ -3283,60 +3271,86 @@
:CUSTOM_ID: User_Configuration-Shortcuts-Files-206c2126 :CUSTOM_ID: User_Configuration-Shortcuts-Files-206c2126
:END: :END:
This category is mainly used for opening configuration files, but it is also This category is mainly used for opening configuration files, but it is also
more generally for files-related commands. Lets declare the category: more generally for files-related commands. Lets declare shortcuts related
#+BEGIN_SRC emacs-lisp to my configuration files. Here is the list of them:
(spacemacs/declare-prefix "of" "files")
#+END_SRC
Now, Lets declare shortcuts related to my configuration files. Here is the
list of them:
- [[file:bin.org][bin.org]] :: contains the source code of my custom scripts in my ~$PATH~ - [[file:bin.org][bin.org]] :: contains the source code of my custom scripts in my ~$PATH~
- [[file:spacemacs.org][spacemacs.org]] :: this file, configuration of Emacs - [[file:spacemacs.org][spacemacs.org]] :: this file, configuration of Emacs
- [[file:fish.org][fish.org]] :: configuration of my fish shell - [[file:fish.org][fish.org]] :: configuration of my fish shell
- [[file:i3.org][i3.org]] :: configuration of my i3 installation - [[file:i3.org][i3.org]] :: configuration of my i3 installation
- [[file:index.org][index.org]] :: some various configuration files and index of this website - [[file:index.org][index.org]] :: some various configuration files and index of this website
- [[file:polybar.org][polybar.org]] :: configuration polybar - [[file:polybar.org][polybar.org]] :: configuration for polybar
- [[file:picom.org][picom.org]] :: configuration for picom
- [[https://labs.phundrak.com/phundrak/dotfiles][README.org]] :: README of the yadm repo - [[https://labs.phundrak.com/phundrak/dotfiles][README.org]] :: README of the yadm repo
I also have a shortcut for the following files:
- conlanging.org :: collection of ideas and references for conlanging
- elfeed.org :: where I store all the RSS sources for Elfeed
- journal.org :: my journal (which I dont really use often tbh)
- notes.org :: to, well, take notes
- worldbuilding.org :: same as ~conlanging.org~ above.
Each of these files are accessible through a simple shortcut, and each one Each of these files are accessible through a simple shortcut, and each one
of them has a description so the shortcut doesnt show up as ~lambda~ with of them has a description so the shortcut doesnt show up as ~lambda~ with
~which-keys~. ~which-keys~. So, a custom name for ~which-keys~ is specified in the Name
#+BEGIN_SRC emacs-lisp column. If a file is not specified, that means it is just a declaration for
(spacemacs/declare-prefix "of" "files") a shortcut prefix.
(spacemacs/declare-prefix "ofc" "config files")
(spacemacs/declare-prefix "ofe" "elfeed sources") First, here are my shortcuts for opening my private files described above:
(spacemacs/declare-prefix "ofca" "awesome.org") #+NAME: private-files-open-shortcuts
(spacemacs/declare-prefix "ofcb" "bin.org") | Shortcut | Name | File |
(spacemacs/declare-prefix "ofce" "spacemacs.org") |----------+-------------------+----------------------------|
(spacemacs/declare-prefix "ofcf" "fish.org") | of | files | |
(spacemacs/declare-prefix "ofci" "i3.org") | ofC | conlanging.org | ~/org/conlanging.org |
(spacemacs/declare-prefix "ofcI" "index.org") | ofe | elfeed.org | ~/org/elfeed.org |
(spacemacs/declare-prefix "ofcp" "polybar.org") | ofj | journal.org | ~/org/journal.org |
(spacemacs/declare-prefix "ofcP" "picom.org") | ofn | notes.org | ~/org/notes.org |
(spacemacs/declare-prefix "ofcr" "yadm README") | ofw | worldbuilding.org | ~/org/worldbuilding.org |
(spacemacs/set-leader-keys
"ofca" (lambda () (interactive) (find-file "~/org/config/awesome.org")) And here are my shortcuts for opening config files:
"ofcb" (lambda () (interactive) (find-file "~/org/config/bin.org")) #+NAME: config-files-open-shortcuts
"ofce" (lambda () (interactive) (find-file "~/org/config/spacemacs.org")) | Shortcut | Name | File |
"ofcf" (lambda () (interactive) (find-file "~/org/config/fish.org")) |----------+---------------+----------------------------|
"ofci" (lambda () (interactive) (find-file "~/org/config/i3.org")) | ofc | config files | |
"ofcI" (lambda () (interactive) (find-file "~/org/config/index.org")) | ofca | awesome.org | ~/org/config/awesome.org |
"ofcp" (lambda () (interactive) (find-file "~/org/config/polybar.org")) | ofcb | bin.org | ~/org/config/bin.org |
"ofcP" (lambda () (interactive) (find-file "~/org/config/picom.org")) | ofce | spacemacs.org | ~/org/config/spacemacs.org |
"ofcr" (lambda () (interactive) (find-file "~/README.org"))) | ofcf | fish.org | ~/org/config/fish.org |
| ofci | i3.org | ~/org/config/i3.org |
| ofcI | index.org | ~/org/config/index.org |
| ofcp | polybar.org | ~/org/config/polybar.org |
| ofcP | picom.org | ~/org/config/picom.org |
| ofcr | yadm README | ~/README.org |
*The following code is not tangled into my Spacemacs config.* However, it is
used to generate shortcuts and configuration code from the above table:
#+NAME: shortcuts-gen
#+BEGIN_SRC emacs-lisp :tangle no :noweb yes :var table=private-files-open-shortcuts :exports code :cache yes :results replace
(concat (mapconcat (lambda (x)
(let* ((shortcut (nth 0 x))
(name (nth 1 x)))
(if (string= "" name)
""
(format "(spacemacs/declare-prefix \"%s\"\t\"%s\")"
shortcut name))))
table
"\n")
"\n"
(format "(spacemacs/set-leader-keys\n%s)"
(mapconcat (lambda (x)
(let* ((shortcut (nth 0 x))
(name (nth 1 x))
(file (nth 2 x)))
(if (string= "" file)
(format "\t\;\; %s" name)
(format "\t%s (lambda () (interactive) (find-file \"%s\"))"
shortcut file))))
table
"\n")))
#+END_SRC #+END_SRC
I also want a quick access to my notes and my journal. Here is what the generated code — which will be actually tangled into my
#+BEGIN_SRC emacs-lisp Emacs config — looks like:
(spacemacs/declare-prefix "ofj" "journal.org") #+BEGIN_SRC emacs-lisp :noweb yes
(spacemacs/declare-prefix "ofC" "conlanging.org") <<shortcuts-gen(table=private-files-open-shortcuts)>>
(spacemacs/declare-prefix "ofn" "notes.org") <<shortcuts-gen(table=config-files-open-shortcuts)>>
(spacemacs/declare-prefix "ofw" "worldbuilding.org")
(spacemacs/set-leader-keys
"ofC" (lambda () (interactive) (find-file "~/org/conlanging.org"))
"ofe" (lambda () (interactive) (find-file "~/org/elfeed.org"))
"ofj" (lambda () (interactive) (find-file "~/org/journal.org"))
"ofn" (lambda () (interactive) (find-file "~/org/notes.org"))
"ofw" (lambda () (interactive) (find-file "~/org/worldbuilding.org")))
#+END_SRC #+END_SRC
*** Multiple cursors *** Multiple cursors