Emacs

Posts about using GNU Emacs, the venerable kitchen sink text editor environment. I default to Vim for editing, but always longed to better understand this beast.

I added this note from org mode

Trying an experiment with setting up a capture template so ox-hugo can add short notes to the site.

I built up the ox-hugo capture sample to get my preferred SECTION/YEAR/MONTH/STUB folder layout.

(defun org-hugo-note-capture-template ()
  "Returns `org-capture' template string for new site note."
  (let* ((title (read-from-minibuffer "Title: "))
         (fname (org-hugo-slug title))
         (year (format-time-string "%Y"))
         (month (format-time-string "%m")))
    (mapconcat #'identity
               `(
                 ,(concat "* TODO " title)
                 ":properties:"
                 ,(concat ":export_hugo_bundle: "
                          (mapconcat #'identity (list year month fname) "/"))
                 ":export_file_name: index"
                 ":end:"
                 "%?\n")
               "\n")))

Then the important bits of my capture template…

(use-package org
  :custom
  (org-capture-templates
   (quote ("s" "Site")
          ("sn" "Note" entry
           (file+olp+datetree bmw/org-site "Notes")
           (function org-hugo-note-capture-template)))))

Eventually I got it right, and C-c c s n brought me to this buffer, where I’m editing a note that’s already longer than I usually intend these to be.

* Notes
:properties:
:export_hugo_section: note
:end:
** 2020
*** 2020-10 October
**** 2020-10-24 Saturday
***** TODO I added this note from org mode                        :emacs:
:properties:
:export_hugo_bundle: 2020/10/i-added-this-note-from-org-mode
:export_file_name: index
:end:

Trying an experiment: setting up a [[https://orgmode.org/manual/Capture-templates.html][capture template]] so [[https://ox-hugo.scripter.co/][ox-hugo]] can add short notes to the site.

Still loads to figure out — for example, how will I get cover images working? But at least I proved to myself that it works.

Back to fixing the broken IndieWeb mentions, which is why I opened my editor a couple of hours ago.

so chemacs is kinda cool

so chemacs is kinda cool

Not saying this is a good idea

Not saying this is a good idea

One big window for VcXsrv. awesomewm for a window manager. Mainly to manage maximized Emacs. There are easier ways to edit files in Windows and WSL. But it renders prettier fonts than VcXsrv with floating windows, so I think I’ll keep it. After I fix all the hotkeys, of course.

I used this post from Paul Silisteanu as a general guide, except apt install awesome awesome-extra for the awesomewm stuff.

Made an Emacs Binding for Config Quick Edit

I hit F5, Emacs opens my config.org for editing. It might not be much but it feels good to scratch such a specific itch. Feeling pretty good about myself.

(global-set-key (kbd "<f5>")
                (lambda ()
                  (interactive)
                  (find-file "~/.dotfiles/config.org")))
From Dotfiles to Org File

From Dotfiles to Org File

at 1:30am they’re all good ideas

Read on…

Emacs refresh-package-contents

Tried adding Evil with use-package. Didn’t work.

Didn’t write the error message down, of course. Something about MELPA looking for a package version from two months ago and deciding the package was “Not Found”.

Eventually figured out I need to run package-refresh-contents, which grabs the latest package listings. Might be overkill to run that automatically in every Emacs session, so I won’t add it to my .emacs.

I will add a comment though.

;; Package not installing?
;;  Try 'M-x package-refresh-contents'

(require 'package)

Hopefully I remember to read my own comments.

Or the documentation.

Goto Address Mode Opens Links in Emacs

Goto Address Mode Opens Links in Emacs

Use goto-address-mode to make links in Emacs buffers clickable

Read on…

Quick Zoom Text in Emacs

Quick Zoom Text in Emacs

Read on…

Installing Emacs Documentation on POP!_os

Installing Emacs Documentation on POP!_os

Apt spells “emacs core docs” as “emacs-common-non-dfsg”.

Read on…

Having fun with Emacs

Having fun with Emacs

I kind of understand what folks say about Emacs being their operating system.

BTW the theme is the poet package, more or less.