Skip to content

Instantly share code, notes, and snippets.

View takaxp's full-sized avatar
🦄
Emacs Org Mode

Takaaki ISHIKAWA takaxp

🦄
Emacs Org Mode
View GitHub Profile
@takaxp
takaxp / update-cask.sh
Created September 3, 2016 10:59
update-cask.sh
#!/bin/sh
# exec cd ~/.emacs.d && cask upgrade-cask if you upgrade cask itself.
CASKPATH=~/.emacs.d/.cask
#VERSION=24.5.1
#VERSION=25.0.95.1
VERSION=25.1.1
SUBDIR=package
BACKUPDIR=~/Dropbox/backup
@takaxp
takaxp / emacs-25.1-inline.patch
Last active April 25, 2017 11:14
An inline-patch for emacs-25.1 (入力時のチラつきなしバージョン)
diff -crN emacs-25.1-orig/configure.ac emacs-25.1-new/configure.ac
*** emacs-25.1-orig/configure.ac 2016-07-24 23:56:46.000000000 +0900
--- emacs-25.1-new/configure.ac 2016-09-13 01:09:24.000000000 +0900
***************
*** 1916,1922 ****
INSTALL_ARCH_INDEP_EXTRA=
fi
! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o $ns_fontfile"
fi
@takaxp
takaxp / my-emacs-mac.patch
Last active September 15, 2016 14:50
my-emacs-mac.patch
*** src/lisp/term/mac-win.el 2016-09-15 23:40:56.000000000 +0900
--- dst/lisp/term/mac-win.el 2016-09-15 22:11:59.000000000 +0900
***************
*** 1542,1628 ****
(2 . mac-ts-selected-converted-text)) ; NSUnderlineStyleThick
"Alist of NSUnderlineStyle vs Emacs face in marked text.")
(defun mac-text-input-set-marked-text (event)
(interactive "e")
(let* ((ae (mac-event-ae event))
@takaxp
takaxp / emacs-mac-port-build.sh
Last active February 27, 2017 00:07
Build self-contained EMP with some custom variables (25.1 and RCs for 25.2)
#!/bin/sh
# The original script is here: https://gist.githubusercontent.com/railwaycat/10988446/raw/990dde69ea728b9ceff68dd649ad2112c5692ef0/build-emacs.app.sh
rootdir=$HOME/Desktop/emacs_mac_port
if [ ! -d $rootdir ]; then
mkdir $rootdir
fi
installprefix=$rootdir/build
app_dir=$installprefix/Emacs.app/Contents/Resources
source_url=ftp://alpha.gnu.org/gnu/emacs/pretest
@takaxp
takaxp / emacs-mac-custom.patch
Last active November 3, 2016 18:25
Additional EMP patch to enhance usability
*** src/lisp/term/mac-win.el 2016-09-18 14:57:55.000000000 +0900
--- dst/lisp/term/mac-win.el 2016-09-23 20:49:12.000000000 +0900
***************
*** 1543,1629 ****
(2 . mac-ts-selected-converted-text)) ; NSUnderlineStyleThick
"Alist of NSUnderlineStyle vs Emacs face in marked text.")
(defun mac-text-input-set-marked-text (event)
(interactive "e")
(let* ((ae (mac-event-ae event))
@takaxp
takaxp / restore-last-ime-setting.el
Last active September 25, 2016 16:32
restore last IME setting even if mac-auto-ascii-mode is ON
(defvar mac-win-last-ime-status 'off) ;; {'off|'on}
(defun mac-win-save-last-ime-status ()
(setq mac-win-last-ime-status
(if (string-match "\\.Roman$" (mac-input-source))
'off 'on)))
(defun advice:mac-auto-ascii-setup-input-source (&optional _prompt)
"Extension to store IME status"
(mac-win-save-last-ime-status))
(advice-add 'mac-auto-ascii-setup-input-source :before
#'advice:mac-auto-ascii-setup-input-source)
@takaxp
takaxp / mac-win-ime-toggle.el
Created September 25, 2016 06:16
Toggle Google IME by Shift-Space for Emacs Mac Port
(defun mac-win-ime-toggle ()
(interactive)
(mac-select-input-source
(concat "com.google.inputmethod.Japanese"
(if (string-match "\\.Roman$" (mac-input-source))
".base" ".Roman"))))
(global-set-key (kbd "S-SPC") 'mac-win-ime-toggle)
@takaxp
takaxp / hide-source-block-commands.el
Created October 3, 2016 02:24
hide source block header and footer
;; see https://github.com/takaxp/org-tree-slide/issues/13#issuecomment-251013783
(with-eval-after-load "org-tree-slide"
(when (require 'hide-lines nil t)
(defun my:hide-headers ()
(hide-lines-matching "#\\+BEGIN_SRC")
(hide-lines-matching "#\\+END_SRC"))
(add-hook 'org-tree-slide-play-hook 'my:hide-headers)
(add-hook 'org-tree-slide-stop-hook 'hide-lines-show-all)))
@takaxp
takaxp / my:yas-expand.el
Created October 10, 2016 03:20
Disable yas-expand if the cursor is in orgmode's source block
(defun my:yas-expand (&optional field)
"Disable `yas-expand' in src-block."
(interactive)
(if (and (equal major-mode 'org-mode)
(org-in-src-block-p t)
(not (and (fboundp 'org-src-edit-buffer-p)
(org-src-edit-buffer-p))))
(org-cycle)
(yas-expand field)))
(define-key yas-minor-mode-map (kbd "<tab>") 'my:yas-expand)))
@takaxp
takaxp / redmine_auto_due_date
Last active April 27, 2017 06:06
Set issue_due_date with default_period even if issue_start_date is updated
/*
チケット作成時のカスタマイズ
Path pattern: /issues/new$
Type: JavaScript
*/
/*
The original idea and code: http://qiita.com/wfigo7/items/f13a89e1d3522f4a73b6
and also see https://github.com/onozaty/redmine-view-customize-scripts
*/
$(function(){