Setting Emacs Variables in Hugo Markdown
If you want to set Emacs File Variables in your Hugo markdown files but not have the Emacs variables visible in your rendered content you have a couple of options: Option 1 – use an HTML comment Include the file variables in an HTML comment – that will be stripped out, at least if you are using the default Goldmark renderer. That looks like this: <!-- Local Variables: mode: markdown-mode whitespace-line-column: 100 End: --> This will be replaced with ‘<– Raw HTML omitted –>’ in the rendered HTML, but won’t produce any user-visible display artifacts.
read more...
Tags: emacs hugo markdown
Emacs Macros and Keybindings
Usually, for quick hacks, its easier to define a keyboard macro in Emacs than create a custom Emacs Lisp function. If you want that macro to persist and be easily usable via a key binding, the usual advice is to do something like: (defalias 'seach-and-replace (kmacro "M-x replace-string C-m misspeling C-m misspelling")) (global-set-key (kbd "C-c C-f") 'search-and-replace) That does work, but it can end up polluting your .emacs file with a bunch of extra lines and, given the global nature of Emacs Lisp variables, provides an opportunity for a name collision.
read more...
Tags: emacs emacs lisp