This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This gist licensed GPLv3 | |
(cl-defmacro condition-case+ (var form (&rest handlers/else/finally)) | |
"Like condition-case, only if the last handlers have matching | |
forms of :else or :finally. In that case, the body of an :else | |
handler is evaluated if no exception was thrown. The body of | |
a :finally clause is evaluated always as the last thing before | |
the form is exited whether normally or not. If both :else | |
and :finally appear among the handlers, :else must be second last | |
and :finally must be last." | |
(cl-flet ((maybe-split-last (symbol handlers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# You can use `git branch --edit-description` to write a description | |
# for a branch, but Git provides no simple command to display that | |
# description. The "easiest" way to see it is via `git config --get | |
# branch.BRANCH_NAME.description`. | |
# | |
# This script automates that process and is meant to be used as | |
# a Git alias to provide a shorter command for showing the | |
# description of the current branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Define a "defun" Emacs Evil text object | |
(defun jpl-line-before-end-of-defun (&optional arg) | |
(interactive) | |
(end-of-defun arg) | |
(previous-line)) | |
(defun jpl-line-after-beginning-of-defun (&optional arg) | |
(interactive) | |
(beginning-of-defun arg) | |
(next-line)) |