This file contains hidden or 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
-- make all unbound vars of the form rNN resolve to level.rings[NN] | |
mt={} | |
mt.__index=function (t, k) | |
local r, rindex = string.find(k, "r%d", 0) | |
rindex = rindex and tonumber(string.sub(k, rindex)) | |
if rindex then | |
return level.rings[rindex] | |
else | |
return nil |
This file contains hidden or 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
;; Just an idea for Boscop. When (eq display-buffer-reuse-frames t) | |
;; display-buffer will raise the frame showing the compilation | |
;; buffer. This advice raises the original frame so focus is not in | |
;; the compilation buffer frame. | |
(defadvice compile (around avoid-compile-switching-frames activate) | |
(let ((cf (selected-frame))) | |
ad-do-it | |
(raise-frame cf))) |
This file contains hidden or 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
;; Just an idea for Boscop. When (eq display-buffer-reuse-frames t) | |
;; display-buffer will raise the frame showing the compilation | |
;; buffer. This advice raises the original frame so focus is not in | |
;; the compilation buffer frame. | |
(defadvice compile (around avoid-compile-switching-frames activate) | |
(let ((cf (selected-frame))) | |
ad-do-it | |
(raise-frame cf))) |
This file contains hidden or 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
(defadvice narrow-to-region (around clone-when-narrowing-already-visible-buffer activate) | |
"Clone an indirect buffer when attempting to narrow the | |
contents of buffer visible in more than one window." | |
(save-excursion | |
(when (> (length (get-buffer-window-list (current-buffer) nil nil)) 1) | |
(let ((cloned-buffer (clone-indirect-buffer nil t) )) | |
(switch-to-buffer cloned-buffer t))) | |
ad-do-it)) |
This file contains hidden or 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
;; pretty print a json region using python | |
;; | |
;; M-| python -m json.tool |
This file contains hidden or 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
;; github-friendly commit messages as per: | |
;; https://github.com/blog/926-shiny-new-commit-styles | |
(add-hook 'magit-log-edit-mode-hook | |
(lambda () | |
;; highlight too-long commit summary | |
(set (make-local-variable 'whitespace-line-column) 50) | |
(set (make-local-variable 'whitespace-style) '(face lines-tail)) | |
(whitespace-mode 1) | |
;; autofill longer explanatory text | |
(setq fill-column 72) |
This file contains hidden or 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
commit 37da0aed0b33973893ac909fc707d84ce7c3f170 | |
Author: John Foerch <[email protected]> | |
Date: Sun Jan 29 21:27:19 2012 -0500 | |
remove in_module mechanism | |
The procedure in_module was a central concept to the "new module system" | |
of 2010-03-19 that was to have made modules possible within the framework | |
of Conkeror's 'load' and 'require' mechanism. However, there was a fatal | |
flaw in the design, and it really doesn't work after all. The flaw was |
This file contains hidden or 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
(defun erc-highlight-nicknames () | |
"Searches for nicknames and highlights them. Uses the first | |
twelve digits of the MD5 message digest of the nickname as | |
color (#rrrrggggbbbb)." | |
(with-syntax-table erc-button-syntax-table | |
(let (bounds word color new-nick-face) | |
(goto-char (point-min)) | |
(while (re-search-forward "\\w+" nil t) | |
(setq bounds (bounds-of-thing-at-point 'word)) | |
(setq word (buffer-substring-no-properties |
This file contains hidden or 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
(defun rrnic-diff (cmd1 cmd2) | |
(interactive | |
(list | |
(read-shell-command "Shell command (1): " nil nil) | |
(read-shell-command "Shell command (2): " nil nil))) | |
(let ((b1 (get-buffer-create "*1*")) (b2 (get-buffer-create "*2*"))) | |
(shell-command cmd1 b1) | |
(shell-command cmd2 b2) | |
(ediff-buffers b1 b2))) |
This file contains hidden or 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
(defun rrnic-diff (cmd1 cmd2) | |
(interactive | |
(list | |
(read-shell-command "Shell command (1): " nil nil) | |
(read-shell-command "Shell command (2): " nil nil))) | |
(let ((b1 (get-buffer-create "*1*")) (b2 (get-buffer-create "*2*"))) | |
(shell-command cmd1 b1) | |
(shell-command cmd2 b2) | |
(ediff-buffers b1 b2))) |