My old Magit setup left a bunch of buffers around that I didn’t need anymore. Here is the posted solution to close them automatically:
(defun help/magit-kill-buffers ()
"Restore window configuration and kill all Magit buffers.
Attribution: URL `https://manuel-uberti.github.io/emacs/2018/02/17/magit-bury-buffer/'"
(let ((buffers (magit-mode-get-buffers)))
(mapc #'kill-buffer buffers)))
(bind-key "q" #'help/magit-kill-buffers magit-status-mode-map)
I can never remember what parameters I want for
ls so I made an alias for it. I still couldn’t remember them so I copy and pasted the documentation into a literate document and tangle that into a function to do what I want:
Continue reading “(Emacs+Org-Mode) A Literate LS”
When I can’t figure out how to write a function to do what I want then I record a macro of what I want to do and then “decompile” it to Elisp using elmacro. This is a super-power package if you want to figure out how something works.
You’ve got Unicode and Emacs so take advantage of the 3 kinds of dashes available to every writer. Here is how with a little detail you might find pretty useful totally unrelated to dashes!
Continue reading “(Emacs+Org-Mode) Don't Dash Your Hopes Of Utilizing Dashes”
After avoiding migrating from Ido to Ivy for years I put in the time today. Long story short it was simple, fast, and easy. Here is the micro version of what it took:
Continue reading “(Emacs+Org-Mode) Migrate From Ido To Ivy In One Quick Step”
Never had the want to export to a calendar from Org but here are what looks like three pretty nice ways to do it.
When you run
update_terminal_cwd is never defined and after every command you get the error message
bash: update_terminal_cwd: command not found making the shell unusable.
The simplest solution is to define
update_terminal_cwd when it isn’t defined.
Here is the code:
if [ -z “$(type -t update_terminal_cwd)” ] || [ “$(type -t update_terminal_cwd)” != “function” ]; then
Thanks to Jon and UnwashedMeme I’ve got the best shell-based Git IDE could have ever imaged! And it is based on Emacs 😄😮.
Continue reading “(Emacs+Org-Mode) Personal Magit From The Terminal”
The IBM AS/400 (aka iSeries) is a combined hardware application server platform. Instead of worrying about the next hot new framework, you have everything that you need to get business done. It is really quite nice in that regard.
Great news: Emacs runs on it.
I always forget a few grammar rules and can’t seem to get them remembered so I wrote an Elisp snippet to help me remember. Langtool catches this but it isn’t worth waiting. It seems silly to me to write a reminder, but, I bet hundreds of us Emacs users face this. The definition is my own, and includes my opinion about how not to use both words!
(defun affect-vs-effect-explanation ()
"Definition and example of the most frequent use of Affect vs. Effect."
(let* ((title "Affect Versus Effect")
(sep (make-string (length title) ?=))
(buf (get-buffer-create (concat "*" title "*"))))
(insert (concat title "\n"))
(insert (concat sep "\n\n"))
(insert "Affect is a verb. It means \"to have influence upon\". In the present tense
affect is followed by a noun in the form of \"X affects Y\". For example
\"Choosing between tabs or spaces for indentation affects our happiness.\"
In the past tense it is followed by a preposition before the noun.
For example \"Most people are deeply affected by the their choice between
using tabs or spaces for indentation.\"
Effect is a noun. It is an outcome or result of a verb. For example
\"Choosing spaces for indentation had a positive effect on her happiness.\"
There are other definitions for affect and effect and you probably
shouldn't use them.")
(setq buffer-read-only t)))