Home
Submit fixes on github
Follow me on twitter


2023

(emacs, org mode, todo, move items up and down)

M-up
M-down

(emacs, org mode, sort todo list by todo status)

:: Highlight the list to sort using C-space and movement keys
C-c ^ o

(emacs, org mode, sort checklist by completion status)

:: Place the cursor anywhere in checklist
C-c ^ x

(emacs, org mode, add deadline to todo item)

C-c C-d

(emacs, read changed file from disk, reload buffer)

M-x revert-buffer

(emacs, org-mode todo, cheatsheet)

References:
https://orgmode.org/guide/Plain-Lists.html
https://orgmode.org/manual/TODO-Basics.html
https://orgmode.org/manual/Checkboxes.html

(emacs moves reminder)

(emacs, org-mode experiment ends for publishing these notes)

Reason for switching away from org-mode: Getting the html export styling that
I want requires too much markup in my text notes. I’m the primary user of the
notes and want to be able to cat and grep them without a bunch of markup
confusing the text content. Using markdown and pandoc instead.

(emacs key bindings)

Prefix bindings with C-c

Sequences consisting of C-c and a letter … are the only sequences reserved for users
https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html

Use global-set-key in ~/.emacs:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Commands.html

(emacs org-mode version, org version)

M-: (org-version)
or
M-x org-version

I’m using 9.5.5 on emacs-plus@28

(emacs undo, redo, tree, visualization, undo tree)

With evil disabled I rely on the undo-tree package, which is incredible.
I’m using undo-tree’s less ergonomic mapping, because something on my mac is
intercepting the more ergonomic mapping of C-/ in Term.

  In Aquamacs:
    undo: C-/
    redo: C-?

  In emacsplus:
    undo: C-_
    redo: M-_

  Visualize and navigate history: C-x u

(emacs cheat sheet)

https://www.utm.edu/staff/jguerin/resources/utilities/emacs.html

(emacs eval)

Eval on minibuffer: M-:
Eval in source: C-x C-e
Eval full buffer: M-x eval-buffer

(emacs redo, emacs enable redo, evil)

Add (evil-set-undo-system 'undo-redo) to ~/.emacs

(emacs get help)

  See what a key command is bound to
    C-h k

  Get a description of a variable
    M-x describe-variable
    > start typing a variable and hit tab for options
    > use term’s cmd-f to search through variable names

  Open the build in tutorial
    C-h t

(emacs org-mode, single line code block, more ergonomic than BEGIN_SRC)

Start a line with :

Install Ivy
Install Projectile
Add this to ~/.emacs

(require 'projectile)  
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)  
(setq projectile-completion-system 'ivy)  
(projectile-mode +1)  

Open fuzzy search with C-c p f
Open grep with C-c p s g
See other usage here: https://docs.projectile.mx/projectile/usage.html#basic-usage
Open file without fuzzy search with C-x C-f

(emacs anatomy, log statements, emacs console messages, console log)

https://web.physics.utah.edu/~detar/lessons/emacs/emacs/node2.html
Missing from this is the messages buffer, where error messages appear
Open the messages buffer with C-h e
Switch back to main buffer with C-x o
If messages buffer is highlighted, close it with C-x 0
If messages buffer is not highlighted, close it with C-x 1

(emacs, cycle folds, fold)

cycle all folds: S-TAB
open/close a single fold: TAB
^ this does not work with evil. A workaround is to create a key mapping for 'org-cycle

(emacs, org mode, indent text, visual indentation)

(emacs install, macos)

Install aquamacs
Install evil https://github.com/emacs-evil/evil

Also trying this version (I use a different color background to remind my fingers not to use vim bindings):

 brew tap d11frosted/emacs-plus  
 brew install emacs-plus --with-native-comp  
 emacs -nw <filename> -bg '#333388'  

Also trying spacemacs by following instructions for macos here:
https://github.com/syl20bnr/spacemacs#prerequisites
Move ~/.emacs and ~/.emacs.d to backup locations before attempting this

I returned to using vanilla emacs-plus after trying spacemacs.
I also returned to vanilla emacs without evil.
Evil was interfering with org-mode folding.

(emacs save)

C-x C-s

(emacs cancel command)

C-g

(emacs switch to scratch buffer)

C-x b *scratch*  
    ^ let go of control  

(emacs start org mode)

Three options:
1. Open a file with an .org extension
2. Open a file that contains # -*- mode: org -*- as the first line
3. Execute M-x org-mode

(emacs list available packages

M-x list-packages

(emacs list installed packages)

M-x list-packages
:: scroll to the very bottom (use the ‘end’ key)

(how to check if org mode is installed)

Look for the org package in the list of installed packages using method above

(emacs close popup windows)

q

C-s
search down with C-s
search up with C-r

(emacs org mode export html)

C-c C-e h o

(emacs org-mode formatting for html, export html)

Relevant sections of org docs:
https://orgmode.org/org.html#Org-Syntax
https://orgmode.org/org.html#Exporting
https://orgmode.org/manual/HTML-specific-export-settings.html

(emacs, org mode preserve line breaks in text file)

Prepend file with:
#+OPTIONS: \n:t

M-x org-toggle-link-display

(emacs, org mode, publishing, export html, tutorial)

Use this to publish a project:

(require 'ox-publish)  
(setq org-publish-project-alist  
 '(("org-notes"  
   :base-directory "~/notes/"  
   :include ("index.txt" "certbot.txt" "emacs.txt")  
   :base-extension "dummy"  
   :publishing-directory "~/notes/publish_html/"  
   :recursive t  
   :publishing-function org-html-publish-to-html  
   :headline-levels 4  
   :auto-preamble t  
   )))  
(org-publish "org-notes" t)  
:: Navigate to the final parentheses on each line and C-x C-e  
:: Or use `M-x eval-buffer` to evaluate all expressions  

References:
https://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html

(emacs, org-mode, youtube, tutorial)

https://www.youtube.com/watch?v=ZMEcb2rpauU