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 | |
;; | |
;; 参考 | |
;; | |
;; * SLURP-FILE Performance Comparison | |
;; http://cybertiggyr.com/gene/sfpc/ | |
;; * Slurping a file in Common Lisp | The Lambda meme - all things Lisp, and more | |
;; http://www.ymeme.com/node/83 | |
(defun slurp-buffer (filename) |
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
;;; inao-mode.el --- major mode for writing inao manuscripts | |
;; Copyright (C) 2010 SAKURAI Masashi | |
;; Author: SAKURAI Masashi <m.sakurai at kiwanami.net> | |
;; Keywords: outlines, convenience | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or |
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
(autoload 'js-console "js-console" nil t) | |
(defun js-console-eval-region (start end) | |
"Execute region" | |
(interactive "r") | |
(let ((buf-name (buffer-name (current-buffer)))) | |
(copy-region-as-kill start end) | |
(switch-to-buffer-other-window "*js*") | |
(js-console-exec-input (car kill-ring)) | |
(switch-to-buffer-other-window buf-name))) | |
(defun run-js-console-and-split-window () |
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
;; for kansai_emacs #0x02 | |
(require 'deferred) | |
;; ■ 基本的使い方 | |
(deferred:$ | |
(deferred:next | |
(lambda (x) (message "deferred start"))) | |
(deferred:nextc 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
;; HTTP POST by url-retrieve | |
;; ref: http://www.emacswiki.org/emacs/UrlPackage | |
(defun deferred:url-retrieve-post (url args &optional cbargs) | |
(lexical-let ((nd (deferred:new)) | |
(url url) (args args) | |
(cbargs cbargs) | |
buf) | |
(deferred:next | |
(lambda (x) |
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 py-doc-exec () | |
(interactive) | |
(save-current-buffer | |
(let ((symbol | |
(with-syntax-table python-dotty-syntax-table (current-word))) | |
(tmpbuf (get-buffer-create "*py-doc-popup*")) | |
(enable-recursive-minibuffers t)) | |
(if (equal symbol "") (error "No symbol")) | |
(set-buffer "*py-doc-popup*") | |
(comint-redirect-send-command-to-process |
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
;;; eval-last-sexp-popup.el --- eval here | |
;; Copyright (C) 2010, 2011 SAKURAI Masashi | |
;; Author: SAKURAI Masashi <m.sakurai at kiwanami.net> | |
;; Keywords: convenience | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or |
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
;;; concurrent.el --- Concurrent utility functions (PLAN!) | |
;; Copyright (C) 2010 SAKURAI Masashi | |
;; Author: SAKURAI Masashi <sakurai@liza2> | |
;; Keywords: deferred, async, thread | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or |
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 | |
(setq fib-list nil) | |
(setq fib-gen | |
(lexical-let ((a1 0) (a2 1)) | |
(cc:generator | |
(lambda (x) (push x fib-list)) | |
(yield a1) | |
(yield a2) |
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://d.hatena.ne.jp/kiwanami/20101022/1287770278 | |
;; ■■再帰と非同期 | |
;; ■同期的に実行 | |
(defun fib (n) | |
(if (<= n 1) n | |
(+ (fib (- n 1)) | |
(fib (- n 2))))) |