Created
May 12, 2010 12:36
-
-
Save hchbaw/398528 to your computer and use it in GitHub Desktop.
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
;; http://repo.or.cz/w/emacs.git/blob/HEAD:/src/fileio.c#l5557 | |
;; (install-my-restore-message-function alcs-make-candidates) | |
(defmacro w/uniq (names &rest body) | |
(declare (indent 1)) | |
`(let ,(mapcar (lambda (s) `(,s (gensym ,(symbol-name s)))) | |
(if (consp names) names (list names))) | |
,@body)) | |
(defmacro with-my-restore-message (&rest body) | |
(w/uniq gm | |
`(let ((,gm (current-message))) | |
(unwind-protect ,@body | |
(when ,gm | |
(let (message-log-max) | |
(sit-for 1) | |
(message ,gm))))))) | |
(defmacro install-my-restore-message-function-1 (function) | |
`(defadvice ,function (around my-restore-message activate) | |
(with-my-restore-message ad-do-it))) | |
(defmacro install-my-restore-message-function (&rest funs) | |
`(progn | |
,@(mapcar (lambda (f) `(install-my-restore-message-function-1 ,f)) | |
(if (consp funs) funs (list funs))))) | |
(install-my-restore-message-function alcs-make-candidates) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment