Skip to content

Instantly share code, notes, and snippets.

(defun copy-whole-line2 (&optional arg)
"Copy current line."
(interactive "p")
(or arg (setq arg 1))
(if (and (> arg 0) (eobp) (save-excursion (forward-visible-line 0) (eobp)))
(signal 'end-of-buffer nil))
(if (and (< arg 0) (bobp) (save-excursion (end-of-visible-line) (bobp)))
(signal 'beginning-of-buffer nil))
(unless (eq last-command 'copy-region-as-kill)
(kill-new "")
(setq helm-grep-default-command "grep.pl %p %f")
(setq helm-grep-default-recurse-command
(concat "find %f "
"-type d \\( -name '.svn' -o -name '.git' \\) -prune"
" -o "
"-type f -name \"$(echo -n '%e'"
" | "
"sed -r 's/--include=([^ ]*) --exclude.*/\\1/'"
" | "
"sed 's/\\\\//g')\""
(cl-defun helm-moccur-action (candidate
&optional (method (quote buffer)) mark)
"Jump to CANDIDATE with METHOD.
arg METHOD can be one of buffer, buffer-other-window, buffer-other-frame."
(require 'helm-grep)
(let* ((split (helm-grep-split-line candidate))
(buf (car split))
(lineno (string-to-number (nth 1 split)))
(split-pat (if helm-occur-match-plugin-mode
(helm-mp-split-pattern helm-pattern)
@tam17aki
tam17aki / speech-synth-new-tweets.el
Last active December 26, 2015 03:38
Synthesize the number of unread tweets.
(eval-after-load "speech-synth"
'(progn
(defun speech-synth-new-tweets ()
(when (not (eq (length (twittering-current-timeline-data
twittering-new-tweets-spec))
twittering-new-tweets-count))
(let* ((buf-name (buffer-name (current-buffer)))
(num_new_tweets (+ (or (cadr (assq (get-buffer buf-name)
twittering-unread-status-info)) 0)
(length twittering-rendered-new-tweets))))
@tam17aki
tam17aki / softalk.el
Last active December 26, 2015 16:39
A wrapper for Softalk. This Emacs lisp can be used on only Windows.
(defvar softalk-command (concat (replace-regexp-in-string
"\\\\" "/" (getenv "INST_DIR"))
"/home/src/softalk/SofTalk.exe"))
(defvar softalk-speed 100)
(defvar softalk-volume 100)
(defun softalk-text (text)
(deferred:$
(deferred:process "sh" "-c"
(format "%s /X:1 /V:%s /S:%s /W: %s"
(defun ace-jump-from-isearch ()
(interactive)
(isearch-exit)
(let ((ace-jump-mode-scope 'window))
(ace-jump-do (regexp-quote isearch-string))))
(define-key isearch-mode-map (kbd "C-k") 'ace-jump-from-isearch)
(defun linum-update-window (win)
"Update line numbers for the portion visible in window WIN."
(goto-char (window-start win))
(let ((line (line-number-at-pos))
(limit (window-end win t))
(fmt (cond ((stringp linum-format) linum-format)
((eq linum-format 'dynamic)
(let ((w (length (number-to-string
(count-lines (point-min) (point-max))))))
(concat "%" (number-to-string w) "d")))))
;;; jaunte.el --- Emacs Hit a Hint
;; Version: 20130413.219
;; 参考
;; yafastnav.el
;; vimperator
;; 設定
;; (require 'jaunte)
;; (global-set-key (kbd "C-c C-j") 'jaunte)
;;; widen-window.el --- Widen selected window
;; Copyright (C) 1985, 1989, 1992, 1993, 1994, 2000, 2001, 2002, 2003,
;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
;; Copyright (C) 2008 Yuto Hayamizu
;; Copyright (C) 2014 Akira Tamamori
;; Author: Akira Tamamori
;; Keywords: convenience
;; Version: 0.1.2
(defun recentf-ido-find-files-and-dirs (arg)
"Find a recent file and a directory using Ido."
(interactive "P")
(let* ((show-full-path-p (cond (arg t) (t nil)))
(file-assoc-list ;表示する候補名とフルパス
(mapcar (lambda (x)
(cond ((equal (substring x (- (length x) 1) (length x)) "/") ;末尾がスラッシュ
(cons (file-name-directory x) x))
(t
(cond (show-full-path-p