Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block lawlist

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
lawlist / example.el
Last active Sep 4, 2019
Variation of org-todo with minibuffer prompt of choices.
View example.el
(defun my-basic-org-todo ()
"Doc-string ...."
(let* ((choice (read-char-exclusive "[t] TODO | [n] NEXT | [w] WAITING"))
(chosen-string (cond
((eq choice ?t)
((eq choice ?n)
((eq choice ?w)
lawlist / aspell_readme
Created Jul 17, 2019
A cheat-sheet to install aspell from source and configure Emacs.
View aspell_readme
* unpack aspell6-es-1.11-2.tar.bz2
* cd over to the root directory of the unpacked source
./configure --vars PATH=$PATH:/Users/HOME/
View aspell.conf
# /Users/HOME/ --lang=en dump config
# conf (string)
# main configuration file
# default: aspell.conf
# conf-dir (string)
# location of main configuration file
# default: <prefix:etc> = /Users/HOME/
lawlist / get-bounds.el
Last active Jul 17, 2019
Get the bounds of the selected frame using an applescript.
View get-bounds.el
Feature request 18283 was previously added to Emacs 25 and the master branch in
conjunction with feature request 21415. In a nutshell, it is now possible to act
upon Emacs (to some degree) using an applescript.
CAVEAT: Feature request 18283 was implemented primarily to facilitate debugging,
and not to control Emacs per se using applescripts.
(defun get-bounds ()
"Return the bounds of the selected frame."
(let* ((script (concat "tell front window of application \"Emacs\"\n"
lawlist / 36681_a
Created Jul 16, 2019
make -C src emacs
View 36681_a
make -C src emacs
make: Entering directory `/c/docume~1/admini~1/desktop/emacs/src'
make: Leaving directory `/c/docume~1/admini~1/desktop/emacs/src'
make: Entering directory `/c/docume~1/admini~1/desktop/emacs/src'
make -C ../lib/ all
make[1]: Entering directory `/c/docume~1/admini~1/desktop/emacs/lib'
GEN alloca.h
GEN byteswap.h
GEN errno.h
lawlist / redisplay_window
Created Jul 9, 2019
Feature request 16475.
View redisplay_window
/* *************************************************************************** */
/* BEGIN Feature Request # 16475: Automatically add/remove scroll bars. */
// ptrdiff_t bob_disregard_narrow = BUF_BEG (buffer);
ptrdiff_t eob_disregard_narrow = BUF_Z (buffer);
ptrdiff_t bob_respect_narrow = BUF_BEGV (buffer);
lawlist / example.el
Last active Jun 29, 2019
Call qlmanage and return focus to Emacs.
View example.el
(require 'dired)
(defun qlmanage-return-focus-to-emacs ()
(let* ((filename (dired-get-file-for-visit))
(emacs-executable (concat invocation-directory "Emacs"))
(emacs-script (concat "tell application \"" emacs-executable "\" to activate")))
(start-process "qlmanage" nil "/usr/bin/qlmanage" "-p" filename)
`(lambda (p e) (when (= 0 (process-exit-status p))
lawlist / org-archive-save-buffer
Last active Sep 4, 2018
Save an org-archive buffer.
View org-archive-save-buffer
(require 'org)
(setq org-archive-location "~/Dropbox/logs/")
(defun org-archive-save-buffer ()
(let ((afile (org-extract-archive-file (org-get-local-archive-location))))
(if (file-exists-p afile)
(let ((buffer (find-file-noselect afile)))
(if (y-or-n-p (format "Save (%s)" buffer))
(with-current-buffer buffer
lawlist / buffer-menu.el
Last active Jun 28, 2019
A port of the Xemacs buffers menu-bar feature that works with Emacs 26.
View buffer-menu.el
This gist has been superseded by the following repository:
View gist:8bc2c575ff709aee52faa893a8521bda
undo-tree: Create a separate copy of `buffer-undo-tree` in Emacs 26.0.50
Q: Using Emacs 26.0.50, how to copy the buffer-undo-tree preserving the structure and create a completely separate copy -- including the hash-table (aka object-pool)?
When using Emacs 25.2.1, setting the hash-table of the copy of buffer-undo-tree to a nil value does not alter the original buffer-undo-tree.
When using Emacs 26.0.50 (master branch), setting the hash-table of the copy of buffer-undo-tree to a nil value alters the original buffer-undo-tree -- setting it to nil.
You can’t perform that action at this time.