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
| ;;; C-u <key> で現在のウィンドウを登録しておいて、<key> でそのウィンドウに | |
| ;;; 移動する。 | |
| ;;; ※プレフィックスキーは無視されちゃう([C-x 1] と [C-c 1] はどっちも [1] | |
| ;;; 扱いになる)。 | |
| (let ((table (make-hash-table))) | |
| (defun switch-to-registered-window (&optional arg) | |
| (interactive "P") | |
| (if arg | |
| (progn |
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
| #+xyzzy | |
| (defun print-structure-sharp-s-aligned (obj stream n) | |
| (assert (si:*structurep obj)) | |
| (let ((def (si:*structure-definition obj))) | |
| (format stream "#S(~S" (si:*structure-definition-name def)) | |
| (let ((indent (1+ (si:*stream-column stream)))) | |
| (dotimes (i (si:*structure-definition-nslots def)) | |
| (unless (= i 0) | |
| (terpri stream)) | |
| (format stream " ~VT~S ~S" |
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
| ;;; ref. http://practical-scheme.net/gauche/man/gauche-refj_16.html#SEC18 | |
| (defmacro debug-print (form stream) | |
| `(progn | |
| (format t "~&#?=~S:~S:~S~%" | |
| ,(or *load-pathname* | |
| (when (buffer-stream-p stream) | |
| (buffer-name (buffer-stream-buffer stream))) | |
| stream) | |
| ,(si:*stream-line-number stream) |
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
| (require "condition-restart") | |
| (define-condition breakpoint (condition) | |
| (name places) | |
| (:report (lambda (bp stream) | |
| (format stream "ぶれーく! ~S" (breakpoint-name bp))))) | |
| (defmacro bp (name &rest places) | |
| `(tagbody breakpoint |
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
| diff --git a/src/eval.cc b/src/eval.cc | |
| old mode 100644 | |
| new mode 100755 | |
| index 6dec67b..9fdacb8 | |
| --- a/src/eval.cc | |
| +++ b/src/eval.cc | |
| @@ -289,7 +289,7 @@ special_bind::~special_bind () | |
| } | |
| } | |
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
| ;;; generator っぽいものだとスッキリしそうなケースを思いついたので書いて | |
| ;;; みたけど、あまりスッキリしなかった | |
| (define-condition stop-iteration (condition) | |
| () | |
| (:report (lambda (c s) (format s "Stop Iteration")))) | |
| => t | |
| (defun plist-iterator (plist) | |
| "generato iterator from plist." |
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
| ;; xyzzy では structure の accessor で全く関係ない structure の slot に触れてしまう事に気づいた。 | |
| (defstruct foo | |
| bar baz) | |
| => #<structure-definition: foo> | |
| (defstruct hoge | |
| fuga piyo) | |
| => #<structure-definition: hoge> | |
| (hoge-fuga (make-foo :bar 3 :baz 4)) |
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
| ;; load するファイル | |
| (format t "loading: fred.lisp~%") | |
| (defun fred () :fred) |
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 command-loop (keymap) | |
| (let (*this-command* | |
| *last-command* | |
| *last-command-char* | |
| (keymap* keymap) | |
| prefixes) | |
| (loop | |
| (refresh-screen) | |
| (setf *last-command-char* (read-char *keyboard*) | |
| *this-command* (lookup-keymap keymap* *last-command-char*)) |
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
| ;;; repeat kbd-macro with just #\e (without #\C-x) | |
| (let ((repeating nil)) | |
| (labels ((check-repeating-kbd-macro () | |
| (unless (member *this-command* | |
| '(execute-last-kbd-macro | |
| repeat-kbd-macro-or-self-insert | |
| universal-argument | |
| digit-argument | |
| negative-argument)) | |
| (setf repeating nil) |