This file contains 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
hook.setHook('KeyBoardQuit', function (aEvent) { | |
if (key.currentKeySequence.length) { | |
return; | |
} | |
command.closeFindBar(); | |
var marked = command.marked(aEvent); | |
if (util.isCaretEnabled()) { | |
if (marked) { | |
command.resetMark(aEvent); | |
} else { |
This file contains 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 elscreen-get-screen-num-from-candidate (candidate) | |
(string-match "\\[\\([0-9]+\\)\\]" candidate) | |
(string-to-number (match-string 1 candidate)) | |
) | |
;; copied from anything-config.el | |
(setq anything-c-source-elscreen | |
'((name . "Elscreen") | |
(candidates . (lambda () | |
(if (cdr (elscreen-get-screen-to-name-alist)) | |
(sort |
This file contains 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 view-mode-hook0 () | |
(define-many-keys view-mode-map pager-keybind) | |
(hl-line-mode 1) | |
;; (column-highlight-mode 1) | |
;; is skk-mode loaded? | |
;; it is not be able to changed after startup. | |
(when (and (boundp 'skk-mode) skk-mode) | |
(skk-mode -1) | |
(setq skk-was-on t))) | |
(add-hook 'view-mode-hook 'view-mode-hook0) |
This file contains 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
(setq my-log-key-counter 0) | |
(defun my-log-key (&optional acmd) | |
(let | |
((cmd (symbol-name (or acmd this-command))) | |
(file "~/logging")) | |
(save-current-buffer | |
(set-buffer (get-buffer-create "logging")) | |
(when (= 0 my-log-key-counter) | |
(insert-file-contents-literally file)) | |
(goto-char (point-max)) |
This file contains 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
(defadvice get-free-disk-space (after get-free-disk-gb activate) | |
"Return free disk space with GByte order" | |
(let ((kb (string-to-number ad-return-value))) ; this is reserved variable | |
(if (> kb 1024) | |
(progn (setq kb (/ kb 1024)) | |
(if (> kb 1024) | |
(setq ad-return-value (format "%.0f GB" (/ kb 1024))) | |
(setq ad-return-value (format "%.0f MB" kb)))) | |
(setq ad-return-value (format "%.0f kB" kb)) | |
))) |
This file contains 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
;; use trash for remove files | |
(defun my-trash-file (FILENAME) | |
(call-process-shell-command (concat "trash " FILENAME) | |
nil 0)) | |
;; call-process-shell-command doesnt wait, with BUFFER 0 | |
(defalias 'delete-file 'my-trash-file) | |
(defalias 'delete-directory 'my-trash-file) |
This file contains 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 -Naur old/content/brief-overlay.xul new/content/brief-overlay.xul | |
--- old/content/brief-overlay.xul 2010-12-19 04:37:16.000000000 +0900 | |
+++ new/content/brief-overlay.xul 2011-02-23 22:38:31.000000000 +0900 | |
@@ -12,21 +12,21 @@ | |
<key id="Brief_open" key="d" modifiers="accel alt" | |
oncommand="Brief.open()"/> | |
- <key id="Brief_selectNextEntry" key="j" | |
- oncommand="Brief.doCommand('selectNextEntry')"/> | |
- <key id="Brief_selectPreviousEntry" key="k" |
This file contains 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
key.setViewKey(['C-c', 'C-d'], function () { | |
f='http://www.delicious.com/save?url='+encodeURIComponent(getBrowser().contentDocument.URL)+'&title='+encodeURIComponent(getBrowser().contentDocument.title)+'&v=5&'; | |
a=function(){ | |
if(!window.open(f+'noui=1&jump=doclose','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550')) | |
location.href=f+'jump=yes' | |
}; | |
if(/Firefox/.test(navigator.userAgent)){ | |
setTimeout(a,0) | |
} else { | |
a() |
This file contains 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
key.setViewKey(['C-c', 'C-p'], function(ev){ | |
var loc = getBrowser().contentDocument.URL; | |
var doc = frame = document.commandDispatcher.focusedWindow.document | |
|| gBrowser.contentWindow.document; | |
if(loc.match(/www\.amazon\./)){ | |
asin = loc.split("/")[5]; | |
r = doc.evaluate("//div[@class='buying']",doc,null,XPathResult.FIRST_ORDERED_NODE_TYPE, null); | |
list = r.singleNodeValue.textContent.split("\n"); | |
var info = Array(); | |
for(i=0; i<list.length; i++ ){ |
This file contains 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
key.setViewKey(['C-c', 'C-a'], function (ev) { | |
children = document.getElementById("nav-bar").children; | |
for(i=0; i<children.length; i++){ | |
children[i].style.backgroundColor = "pink"; | |
} | |
util.setBoolPref("accessibility.browsewithcaret", true); | |
}, "Start Caret-Browse Mode"); | |
key.setCaretKey(['C-c', 'C-a'], function (ev) { | |
children = document.getElementById("nav-bar").children; |
NewerOlder