Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

(defvar my-isearch-use-region-p nil
"Variable that indicates that a region exists when the user starts isearch."
)
(make-variable-buffer-local 'my-isearch-use-region-p)
(add-hook 'isearch-mode-hook
'(lambda ()
(setq my-isearch-use-region-p nil)
(when (or (use-region-p)
(and (marker-position (mark-marker))
@tkosaka
tkosaka / oborozuki_basic_google.txt
Created September 13, 2011 20:52
The basic Oborozuki layout for Google Japanese Input.
q つ
w 、
e と
r く
t け
u な
i た
o て
p お
a か
@tkosaka
tkosaka / shift-less-skk.el
Created February 6, 2011 01:59
SKK Without A Shift Modifier
;;; Use SKK without a Shift modifier.
;;;
;;; WARNING: You CANNOT use a shift modifer to set a conversion marker when you load this file in .skk.
;;;
;;; Note: I'm using the skk-tutcode. I do not assure that this setting works under other environments.
;;; Set the sticky-key here to load skk-sticky.el.
;;; This setting should be located before other sticky configurations,
;;; because functions must be defined before advising.
(setq skk-sticky-key ":")
@tkosaka
tkosaka / kill-buffer-and-frame.el
Created January 24, 2011 11:46
Kill the current buffer and its frame.
(defun kill-buffer-and-frame ()
"Kill the current buffer and its frame."
(interactive)
(call-interactively 'kill-buffer)
(call-interactively 'delete-frame)
)
(global-set-key "\C-xK" 'kill-buffer-and-frame)
# -*- Mode: python -*-
# -*- coding: utf-8 -*-
# Definition: Convert a html file of Aozora Bunko to be more readable in Kindle.
# Author: Tomohiko KOSAKA <tomohiko.kosaka@gmail.com>
# Version: 0.01
# Date: 2010/09/16 (Originally written in 2010/09/07)
# Requirements: KindleGen (http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000234621)
# Usage:
# 1. Convert an AOZORA BUNKO's HTML file.
#
@tkosaka
tkosaka / google-prompt.js
Created June 20, 2010 03:03
Google via the prompt
// ============================================================ //
// Inside of the PRESERVE Area
// ============================================================ //
//
var googlePrompt = (
function () {
var googleAPIUrl = "http://ajax.googleapis.com/ajax/services/search/";
var page_index = null;
@tkosaka
tkosaka / toggle-php-mode.el
Created May 8, 2010 12:02
Toggle php-mode and html mode dynamically
;;; toggle-php-mode.el
;;; Toggle php-mode and html-mode.
;;; Version: 0.02: 2010/11/24
;;; Version: 0.01: 2010/05/08
(defvar php-html-major-mode 'html-mode
"Major mode for editing html files with `php-mode'.")
(defvar php-activate-html-mode-command 'html-mode
"Command that activates a major-mode for html."
@tkosaka
tkosaka / autoSetMark.js
Created April 3, 2010 05:30
Automatically save marks.
// ============================================================ //
// Inside of the PRESERVE Area
// ============================================================ //
//
// * IMPORTANT
// You have to install _scrollet.ks.js in order to use this script.
//
var myMarkKeys = ["1", "2", "3", "4", "5"];
var autoMarkInterval = 5000;
(defun fib (n)
(let ((x-pre 0))
(loop repeat n
for x = 0 then y
for y = 1 then (+ x-pre y)
do
(setq x-pre x)
finally return y)))
// Post a tweet with a hash tag.
// Add this code to .keysnail.js.
hook.addToHook('PluginLoaded',
function () {
if (!plugins.twitterClient) {
return;
}
var tsuda_hash_tag = null;