Skip to content

Instantly share code, notes, and snippets.

View ShingoFukuyama's full-sized avatar

Shingo Fukuyama ShingoFukuyama

  • Japan
View GitHub Profile
@ShingoFukuyama
ShingoFukuyama / tabbar-config.el
Last active March 30, 2018 14:14
Configuration file. tabbar.el github https://github.com/dholm/tabbar
;;;tabbar github https://github.com/dholm/tabbar
;;http://d.hatena.ne.jp/tequilasunset/20110103/p1
;;http://d.hatena.ne.jp/plasticster/20110825/1314271209
(require 'tabbar)
(tabbar-mode 1)
;;; Don't enable mouse wheel on tab bar
(tabbar-mwheel-mode nil)
;;; Don't use group tab
(require 'request) ;; https://github.com/tkf/emacs-request
(defvar ginger-rephrase-end-point
"http://ro.gingersoftware.com/rephrase/rephrase")
;;;###autoload
(defun ginger-rephrase (&optional $text $beg $end)
(interactive)
(lexical-let* (($text
(cond ($text $text)
@ShingoFukuyama
ShingoFukuyama / org-table-convert-on-the-spot
Created December 10, 2013 07:47
Convert Emacs org style table to csv/tsv/html/etc on the spot, instead of creating a new file.
(defun org-table-convert-on-the-spot (&optional format)
(interactive)
(unless (org-at-table-p) (user-error "No table at point"))
(org-table-align) ;; make sure we have everything we need
(let* ((beg (org-table-begin))
(end (org-table-end))
(txt (buffer-substring-no-properties beg end))
(formats '("orgtbl-to-tsv" "orgtbl-to-csv"
"orgtbl-to-latex" "orgtbl-to-html"
"orgtbl-to-generic" "orgtbl-to-texinfo"
@ShingoFukuyama
ShingoFukuyama / emacs mac osx say
Last active November 5, 2018 12:50
Utilizing `say' command which Mac OSX has for Emacs.Region lines and then `M-x osx-say' to make OSX speak.
;; Region lines and then `M-x osx-say' to make OSX speak.
;; Adjust speak speed
(setq osx-say-speed 180)
;; Change voice
;; Kathy, Vicki, Victoria, Alex, Bruce, Fred
(setq osx-say-voice "Alex")
(setq osx-say-buffer "*osx say*")
@ShingoFukuyama
ShingoFukuyama / emacs mykie.el sample1
Last active January 1, 2016 00:39
emacs mykie.el[https://github.com/yuutayamada/mykie-el] sample1 Wrap regioned area with parentheses, brackets, quote or whatever.
(require 'mykie)
(defun my-wrap-region (&optional $open $close)
(interactive)
(when mark-active
(let (($beg (region-beginning))
($end (region-end)))
(deactivate-mark)
(goto-char $end)
(insert $close)
@ShingoFukuyama
ShingoFukuyama / emacs mykie.el sample2
Last active January 1, 2016 04:28
Utilizing emacs mykie.el[https://github.com/yuutayamada/mykie-el] to temporarily remember text/buffer to each number. Past text or switch buffer from registered number.
(require 'mykie)
;;; Temporarily remember any text/buffer
;; Example.
;; Region an area -> Copy & Regist [M-5 w] -> Past [M-5 y]
;; Region an area -> Copy & Regist [M-3 w] -> Past [M-3 y]
;; Regist buffer [M-3 B] -> Switch buffer [M-3 b]
;; Regist buffer [M-8 3 B] -> Switch buffer [M-8 3 b]
;; Describe list
@ShingoFukuyama
ShingoFukuyama / my-get-overlay-property-cons-list-at
Created January 13, 2014 00:53
[Emacs] Get overlay property cons list at the argument $position pointed, or the cursor on.
;; On the overlay, do `M-: (my-get-overlay-property-list-at)`
;; Return cons list like below
;; ((edit-buffer . t) (face . helm-swoop-target-word-face))
(defun my-get-overlay-property-cons-list-at (&optional $position)
(interactive)
"Get overlay property cons list at the argument $position pointed,
or the cursor on. "
(or $position (setq $position (point)))
@ShingoFukuyama
ShingoFukuyama / emacs lock buffer to window with tabbar
Created February 4, 2014 03:32
Stick/Lock buffer to window, compatible with tabbar.el. Emacs
;; http://lists.gnu.org/archive/html/help-gnu-emacs/2007-05/msg00975.html
(defvar sticky-buffer-previous-header-line-format)
(define-minor-mode sticky-buffer-mode
"Make the current window always display this buffer."
nil " sticky" nil
(if sticky-buffer-mode
(progn
(set (make-local-variable 'sticky-buffer-previous-header-line-format)
@ShingoFukuyama
ShingoFukuyama / Samples of ht.el
Created February 7, 2014 05:02
Samples of ht.el Emacs Lisp hash table library.
;; Wilfred / ht.el
;; https://github.com/Wilfred/ht.el
(setq $h1 (ht (1 8888)
(2 "ABCDE")
(3 "Emacs Lisp")
(4 "Emacs")))
;; => #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data
;; (1 8888 2 "ABCDE" 3 "Emacs Lisp" 4 "Emacs"))
(defun baz1 (arg)
arg)
(defsubst baz2 (arg)
arg)
;; ----------------------------------------------------------------------
(defsubst foo1 (aaa)
(baz1 aaa)
(baz2 aaa))