Skip to content

Instantly share code, notes, and snippets.

;; for widen-window.el
(defun ewm:fix-widen-window-pre-start ()
;; widen-window でエラーを起きないようする
(defadvice wlf:layout-internal (around disable-ww-mode activate)
(ad-deactivate-regexp "widen-window")
(unwind-protect
ad-do-it
(ad-activate-regexp "widen-window")))
;;; 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
;; for kansai_emacs #0x02
(require 'deferred)
;; ■ 基本的使い方
(deferred:$
(deferred:next
(lambda (x) (message "deferred start")))
(deferred:nextc it
;; 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)
@kiwanami
kiwanami / init.el
Created September 29, 2010 14:22 — forked from myuhe/init.el
(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
;;; 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
;;; 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
;; 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)
;; http://d.hatena.ne.jp/kiwanami/20101022/1287770278
;; ■■再帰と非同期
;; ■同期的に実行
(defun fib (n)
(if (<= n 1) n
(+ (fib (- n 1))
(fib (- n 2)))))
;; kill-region or backward-kill-word
(defun kill-region-or-backward-kill-word ()
(interactive)
(if (region-active-p)
(kill-region (point) (mark))
(backward-kill-word 1)))
;; swap quotes