Skip to content

Instantly share code, notes, and snippets.

@baron
baron / emacs ui intrusions
Created November 25, 2010 03:43
keep the ui from getting in your face (looks like a dedicated terminal window)
;; 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)
@baron
baron / twspell
Created November 26, 2010 05:39
spell check for twittering-mode tweets
(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)
(require 'gist)
(setq gist-use-curl t)
(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))
;; 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
(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))))
(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)))))
(defun ib ()
"indent whole buffer"
(interactive)
(delete-trailing-whitespace)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max)))
(require 'google)
(defalias 'g 'google-code)
@baron
baron / emacs-inline.patch
Created March 3, 2011 04:55
inline patch revised for cocoa emacs
diff -p -N -r -x '*.elc' ../emacs-23.1.95/lisp/term/ns-win.el lisp/term/ns-win.el
*** ../emacs-23.1.95/lisp/term/ns-win.el 2010-03-11 11:20:29.000000000 +0900
--- lisp/term/ns-win.el 2010-04-03 21:49:10.000000000 +0900
*************** The properties returned may include `top
*** 315,320 ****
--- 315,321 ----
(cons (logior (lsh 0 16) 12) 'ns-new-frame)
(cons (logior (lsh 0 16) 13) 'ns-toggle-toolbar)
(cons (logior (lsh 0 16) 14) 'ns-show-prefs)
+ (cons (logior (lsh 0 16) 15) 'mac-change-input-method)