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 write-revive-file () | |
(interactive) | |
(let ((file "~/.emacsresume")) | |
(with-temp-buffer | |
(insert (prin1-to-string (current-window-configuration-printable))) | |
(when (file-writable-p file) | |
(write-region (point-min) | |
(point-max) | |
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
(defun point-to-middle () | |
"Put cursor on middle line of window" | |
(interactive) | |
(let ((win-height (if (> (count-screen-lines) (window-height)) | |
(window-height) | |
(count-screen-lines)))) | |
(move-to-window-line (/ win-height 2)))) |
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
;; gist.el --- Emacs integration for gist.github.com | |
;; Author: Christian Neukirchen <purl.org/net/chneukirchen> | |
;; Maintainer: Chris Wanstrath <chris@ozmm.org> | |
;; Contributors: | |
;; Will Farrington <wcfarrington@gmail.com> | |
;; Michael Ivey | |
;; Phil Hagelberg | |
;; Dan McKinley | |
;; Version: 0.5 |
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
// Keysnail function that pulls up your entire session history | |
// Based on tips from: http://malblue.tumblr.com/post/349001250/tips-japanese-keysnail-github | |
ext.add("list-session-history", function () { | |
const fav = "chrome://mozapps/skin/places/defaultFavicon.png"; | |
var tabHistory = []; | |
var faviconService = Components.classes["@mozilla.org/browser/favicon-service;1"].getService(Components.interfaces.nsIFaviconService); | |
var historyService = Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsINavHistoryService); |
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 twittering-mode-exit () | |
"twittering-mode を終了する。" | |
(interactive) | |
(when (y-or-n-p "Really exit twittering-mode? ") | |
(if twittering-timer | |
(twittering-stop)) | |
(dolist (buf (twittering-get-active-buffer-list)) | |
(if (get-buffer buf) | |
(kill-buffer buf)))) | |
(garbage-collect)) |
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
(require 'gist) | |
(setq gist-use-curl t) |
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 twittering-spell-check () | |
(when (eq major-mode 'twittering-edit-mode) | |
(progn (ispell-minor-mode) | |
(flyspell-mode)))) | |
(add-hook 'text-mode-hook 'twittering-spell-check) |
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
;; just use y or n for confirmations | |
(defalias 'yes-or-no-p 'y-or-n-p) | |
;; don't use popups of any kind | |
(setq use-dialog-box nil) | |
(defalias 'message-box 'message) | |
;; just the frame thanks | |
(tool-bar-mode -1) |
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
;; gist.el --- Emacs integration for gist.github.com | |
;; Author: Christian Neukirchen <purl.org/net/chneukirchen> | |
;; Maintainer: Chris Wanstrath <chris@ozmm.org> | |
;; Contributors: | |
;; Will Farrington <wcfarrington@gmail.com> | |
;; Michael Ivey | |
;; Phil Hagelberg | |
;; Dan McKinley | |
;; Version: 0.5 |
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
;;;_ , my-remove-duplicates | |
; This little fellow is great. It removes duplicates from region i.e. | |
; transforms "foo baz foo bar baz" into "foo baz bar". | |
(defun my-remove-duplicates (start end) | |
(interactive "r") | |
(save-excursion | |
(goto-char start) | |
(narrow-to-region start end) |