home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit d79e2df1969bffb45901b1879f93c5f7a9e0fd4f
parent 3c23778f880eb95c0219112581cbb9515ec51b2f
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Fri, 12 Jun 2020 17:02:08 +0200

tools/emacs: update docs and org next file shortcut

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mdocs/emacs.org | 68+++++++++++++++++++++++++++++++++-----------------------------------
Mtools/emacs/config/config-org.el | 2+-
2 files changed, 34 insertions(+), 36 deletions(-)

diff --git a/docs/emacs.org b/docs/emacs.org @@ -234,26 +234,26 @@ - I never use the /menu-bar/, or the /tool-bar/ or even the /scroll-bar/, so we can safely disable those very very early. - #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "DisableUI" :range-end "-DisableUI" :lines "11-15" + #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "DisableUI" :range-end "-DisableUI" :lines "11-17" - Finally we can try to avoid garbage collection at startup. The garbage collector can easily double startup time, so we suppress it at startup by turning up ~gc-cons-threshold~ (and perhaps ~gc-cons-percentage~) temporarily. - #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "GarbageCollection" :range-end "-GarbageCollection" :lines "18-20" + #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "GarbageCollection" :range-end "-GarbageCollection" :lines "20-22" - Another small optimization concerns on =file-name-handler-alist= : on every .el and .elc file loaded during start up, it has to runs those regexps against the filename ; setting it to ~nil~ and after initialization finished put the value back make the initialization process quicker. - #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "FileNameHandler" :range-end "-FileNameHandler" :lines "23-25" + #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "FileNameHandler" :range-end "-FileNameHandler" :lines "25-27" However, it is important to reset it eventually. Not doing so will cause garbage collection freezes during long-term interactive use. Conversely, a ~gc-cons-threshold~ that is too small will cause stuttering. - #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "AfterInitHook" :range-end "-AfterInitHook" :lines "61-67" + #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "AfterInitHook" :range-end "-AfterInitHook" :lines "112-118" One thing though, I am currently not necessarily running Emacs 27, so I am going to need to have the same configuration in ~init.el~ for a little bit of time. @@ -365,19 +365,19 @@ Now, in order to load ~lisp~ and ~config~ files, it's just a matter of calling this function with the right argument. -#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "CfgLoad" :range-end "-CfgLoad" :lines "190-195" +#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "CfgLoad" :range-end "-CfgLoad" :lines "190-194" Finally, I want to be able to load files for a specific machine, in case I need it (not entirely sure why yet but…) -#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "CfgHostLoad" :range-end "-CfgHostLoad" :lines "198-200" +#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "CfgHostLoad" :range-end "-CfgHostLoad" :lines "197-199" *** Counting the time of loading :PROPERTIES: :CUSTOM_ID: h:2b645e95-6776-4f5b-a318-e5a915943881 :END: -#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "LastInit" :range-end "-LastInit" :lines "203-214" +#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "LastInit" :range-end "-LastInit" :lines "202-213" ** ~PATH~'s customization :PROPERTIES: @@ -680,7 +680,7 @@ First, let's define some basic constants, mainly on how my main =org= folder is organized. -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgConstants" :range-end "-OrgConstants" :lines "7-18" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgConstants" :range-end "-OrgConstants" :lines "7-17" In a nutshell, I am currently trying the following organization, with =~/desktop/org/= as the base of almost all =org-mode= things: @@ -711,7 +711,7 @@ =inbox.org=. For this, we can use the emacs [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Registers.html][registers]] and more accurately the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Registers.html#File-Registers][file registers]]. -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgRegisters" :range-end "-OrgRegisters" :lines "21-26" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgRegisters" :range-end "-OrgRegisters" :lines "20-24" With this, I can jump to the inbox with ~C-x r j i~, to the journal using ~C-x r j j~, … @@ -804,7 +804,7 @@ /The =ensure org-plus-contrib= is there to make sure I am loading the =org= module from my nix configuration and not the built-in =org= module (that might lag in terms of version)/ -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgMain" :range-end "-OrgMain" :lines "29-106" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgMain" :range-end "-OrgMain" :lines "27-104" I've set-up an =org-mode= hook to add few modes to the default setup. - I am really annoyed by trailing white-space so I want them to be shown @@ -813,15 +813,15 @@ + I turn on =auto-revert-mode= so that the buffer is always up-to-date. + I like to have header indented, so I'm enabling =org-indent-mode=. -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgHook" :range-end "-OrgHook" :lines "109-121" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgHook" :range-end "-OrgHook" :lines "107-119" Let's also use =org-id=… -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgId" :range-end "-OrgId" :lines "124-153" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgId" :range-end "-OrgId" :lines "122-151" … and =org-crypt= (for encrypted =org-mode= files). -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCrypt" :range-end "-OrgCrypt" :lines "156-161" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCrypt" :range-end "-OrgCrypt" :lines "154-159" **** TODO Refiling :PROPERTIES: @@ -856,11 +856,11 @@ agenda views. This allows to group things and overall set-up the agenda view I want. This agenda view uses the =n= key. -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgAgenda" :range-end "-OrgAgenda" :lines "164-213" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgAgenda" :range-end "-OrgAgenda" :lines "162-211" Let's try to get my work calendar entries in my agenda too. It is a little bit tricky 👼. -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgGcal" :range-end "-OrgGcal" :lines "216-230" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgGcal" :range-end "-OrgGcal" :lines "214-228" *** Habits :ATTACH: :PROPERTIES: @@ -892,14 +892,14 @@ [[./images/2020-02-29-14-41-59.png]] -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgHabit" :range-end "-OrgHabit" :lines "233-238" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgHabit" :range-end "-OrgHabit" :lines "231-236" *** TODO Sources :PROPERTIES: :CUSTOM_ID: h:82c3b800-9d80-408d-b3b6-54dc15b0590c :END: -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgSrc" :range-end "-OrgSrc" :lines "241-248" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgSrc" :range-end "-OrgSrc" :lines "239-246" *** TODO Capture :PROPERTIES: @@ -916,7 +916,7 @@ options. This is very interesting when you want to group some capture template together (like templates related to /work/, …). -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureStart" :range-end "-OrgCaptureStart" :lines "251-255" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureStart" :range-end "-OrgCaptureStart" :lines "249-253" Some of my capture template are big and hard to read if embedded in the =emacs-lisp= code. The good thing is that =org-mode= is able to load the template from files too 💃. @@ -924,44 +924,44 @@ Here is a list of my templates: - Default :: Store a link (mainly used with =org-protocol=) and take a random note - #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureOldTemplate" :range-end "-OrgCaptureOldTemplate" :lines "258-267" + #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureOldTemplate" :range-end "-OrgCaptureOldTemplate" :lines "256-261" - Tasks :: /work/ task, like reviewing a PR, or cleaning a folder. - #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureTask" :range-end "-OrgCaptureTask" :lines "270-282" + #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureTask" :range-end "-OrgCaptureTask" :lines "264-276" - journaling :: As I use =org-mode= for my /journal/ too, I need capture entry for it. I currently have two types of journal entry : - #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureJournalBase" :range-end "-OrgCaptureJournalBase" :lines "285-287" + #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureJournalBase" :range-end "-OrgCaptureJournalBase" :lines "279-281" + standard: one title and some text #+INCLUDE: "../tools/emacs/etc/orgmode/journal.org" src org - #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureJournalEntry" :range-end "-OrgCaptureJournalEntry" :lines "290-297" + #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureJournalEntry" :range-end "-OrgCaptureJournalEntry" :lines "284-291" + worklog: related to work, to be able to say what I did, what I wanted to do, problems, … during the daily #+INCLUDE: "../tools/emacs/etc/orgmode/worklog.org" src org - #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureWorklog" :range-end "-OrgCaptureWorklog" :lines "300-305" + #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureWorklog" :range-end "-OrgCaptureWorklog" :lines "294-299" - weekly review :: each and every week, I am going through this item to make my review of the week. #+INCLUDE: "../tools/emacs/etc/orgmode/weekly.org" src org - #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureWeekly" :range-end "-OrgCaptureWeekly" :lines "308-313" + #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureWeekly" :range-end "-OrgCaptureWeekly" :lines "302-307" - blog posts :: - #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureBlog" :range-end "-OrgCaptureBlog" :lines "323-325" + #+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureBlog" :range-end "-OrgCaptureBlog" :lines "317-319" -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureEnd" :range-end "-OrgCaptureEnd" :lines "328-329" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgCaptureEnd" :range-end "-OrgCaptureEnd" :lines "322-323" -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgProtocol" :range-end "-OrgProtocol" :lines "332-334" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgProtocol" :range-end "-OrgProtocol" :lines "326-328" *** Clocking :PROPERTIES: @@ -981,32 +981,30 @@ In addition to that workflow, I want to switch the state of the task to =STARTED= when I am clocking-in, if it's not already =STARTED=. -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgClock" :range-end "-OrgClock" :lines "337-430" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgClock" :range-end "-OrgClock" :lines "331-424" *** TODO Links :PROPERTIES: :CUSTOM_ID: h:afc81fbb-f7a0-401c-8b56-19f51edebd88 :END: -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgAttach" :range-end "-OrgAttach" :lines "433-437" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgAttach" :range-end "-OrgAttach" :lines "427-431" -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgLinks" :range-end "-OrgLinks" :lines "440-474" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgLinks" :range-end "-OrgLinks" :lines "434-468" *** TODO Litterate programming :PROPERTIES: :CUSTOM_ID: h:b5f6beba-6195-4ff0-a194-502ac2a9e3da :END: -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgBabel" :range-end "-OrgBabel" :lines "477-525" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgBabel" :range-end "-OrgBabel" :lines "471-519" *** TODO Exporting :PROPERTIES: :CUSTOM_ID: h:afad00e0-367c-4c7b-b191-e3ed72be754b :END: -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgExportConstants" :range-end "-OrgExportConstants" :lines "528-530" - -#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgExportCfg" :range-end "-OrgExportCfg" :lines "533-538" +#+INCLUDE: "../tools/emacs/config/config-org.el" src emacs-lisp :range-begin "OrgExportCfg" :range-end "-OrgExportCfg" :lines "522-527" ** TODO Email and newsgroup :PROPERTIES: @@ -1218,7 +1216,7 @@ "gnus" to see all the relevant key bindings and the functions they call. I only ever use =C-c C-m C-a= (=C-m= is the same as =RET=). -#+INCLUDE: "../tools/gnus/init.el" src emacs-lisp :range-begin "GnusDired" :range-end "-GnusDired" :lines "170-173" +#+INCLUDE: "../tools/gnus/init.el" src emacs-lisp :range-begin "GnusDired" :range-end "-GnusDired" :lines "188-191" **** TODO Searching mails :PROPERTIES: diff --git a/tools/emacs/config/config-org.el b/tools/emacs/config/config-org.el @@ -19,7 +19,7 @@ ;; OrgRegisters (set-register ?i `(file . ,org-inbox-file)) (set-register ?I `(file . ,org-incubate-file)) -(set-register ?N `(file . ,org-next-file)) +(set-register ?n `(file . ,org-next-file)) (set-register ?j `(file . ,org-journal-file)) ;; -OrgRegisters