Skip to content

Instantly share code, notes, and snippets.

@southly
southly / sync.rb
Created October 15, 2017 13:21
narou send の代わり
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
require 'fileutils'
require 'pathname'
require 'win32ole'
SYNC_PATH = "documents/web"
def get_kindle_path(volume_name = "Kindle")
;;;; -*- Mode: Lisp -*-
;; (get-window-handle :filer)
;; で、ファイラのウィンドウハンドルが取得できる必要がある。
;;
;; ttray.l を書き換えた方がいろいろ自然だけどサンプルということで。
(provide "ttray-addon")
(eval-when (:compile-toplevel :load-toplevel :execute)
(require "foreign")
@southly
southly / framework.l
Created February 28, 2012 05:18 — forked from bowbow99/framework.l
#xyzzy nanri-master から multiframe へ取り込んだ変更のテスト
;;; -*- mode: lisp; package: user -*-
#|
使い方(暫定):
1. どこかへ framework.l と nanri-master-change-tests.l をダウンロード
2. M-x load-file
load file: path/to/framework.l
3. M-x load-test-file
test file: path/to/nanri-master-change-tests.l
4. M-x change-tests
@southly
southly / gist:822436
Created February 11, 2011 14:40
cmigemo-1.3c-MIT.tar.bz2 からの差分
From 8816683b89f46640ec509cf54a7d0e927429a264 Mon Sep 17 00:00:00 2001
From: NANRI <southly@gmail.com>
Date: Sun, 30 Jan 2011 02:39:05 +0900
Subject: [PATCH] calling convention modified.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- migemo_setproc_char2int
- migemo_setproc_int2char
@southly
southly / gist:787808
Created January 20, 2011 12:14
#xyzzy
(defmacro define-tco-function (name (&rest lambda-list) &body body)
(let ((continue (gensym "continue"))
(vals (mapcar #'(lambda (x) (if (consp x) (car x) x))
(remove-if (lambda (x) (member x lambda-list-keywords))
lambda-list))))
`(defun ,name ,lambda-list
(macrolet ((,name (&rest args)
(list 'progn
(list 'multiple-value-setq ',vals (cons 'values args))
(list 'go ',continue))))
@southly
southly / gist:723371
Created December 1, 2010 11:32
fix macroexpand. #xyzzy
diff --git a/src/eval.cc b/src/eval.cc
index 6d5d1d3..9203741 100644
--- a/src/eval.cc
+++ b/src/eval.cc
@@ -1523,10 +1523,15 @@ lisp
Fmacroexpand (lisp arg, lisp env)
{
protect_gc gcpro (arg);
- do
- arg = Fmacroexpand_1 (arg, env);
@southly
southly / gist:716591
Created November 26, 2010 11:34
fix flet, labels, macrolet. #xyzzy
diff --git a/src/cons.h b/src/cons.h
index 82961bd..aeb9c86 100644
--- a/src/cons.h
+++ b/src/cons.h
@@ -10,6 +10,7 @@ public:
};
# define consp(X) typep ((X), Tcons)
+# define listp(X) ((X) == Qnil || consp (X))
;; xyzzy の epsilon 周りがおかしい
;;
;; http://twitter.com/TwilightClover/status/26251344464
;; http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/convar_short-_tive-epsilon.html
(defconstant my-short-float-epsilon
(do* ((fe 1.1s0 fl)
(fl 1.0s0 (/ fl 2.0s0)))
((not (and (/= (+ 1.0s0 fl) 1.0s0)
(> fe fl)))
From 02f18b9ed7f6fed148f75d601905d07ad1d23297 Mon Sep 17 00:00:00 2001
From: NANRI <southly@gmail.com>
Date: Thu, 23 Sep 2010 21:53:38 +0900
Subject: [PATCH 1/3] add generate_rss.
---
main.rb | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/main.rb b/main.rb
@southly
southly / gist:590252
Created September 21, 2010 18:39
#xyzzy recenter-toggle
(defun recenter (&optional arg)
(interactive "p")
(save-excursion
(scroll-window (- (get-window-line)
(cond (arg
(if (minusp arg)
(max (- (window-height) arg) 0)
(min arg (1- (window-height)))))
((eq *last-command* 'recenter)
(cond ((= (get-window-line) (truncate (window-height) 2))