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 / emacs-25.2-inline.patch
Created April 25, 2017 09:32
An inline-patch for Emacs-25.2
diff -crN emacs-25.2_orig/configure.ac emacs-25.2/configure.ac
*** emacs-25.2_orig/configure.ac 2017-02-03 23:34:30.000000000 +0900
--- emacs-25.2/configure.ac 2017-04-25 16:52:18.000000000 +0900
***************
*** 1915,1921 ****
INSTALL_ARCH_INDEP_EXTRA=
fi
! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o $ns_fontfile"
fi
@takaxp
takaxp / org-mac-papers-insert-front-most-paper-link.el
Last active November 17, 2020 15:52
Additional descriptor to grab a link to a paper stored in Papers.app
@takaxp
takaxp / buffer.el
Created December 2, 2016 01:57
major mode for fast boot
;;; buffer.el --- Temporal buffer for fast boot
(defun buffer-mode ()
"Buffer Mode"
(interactive)
(setq mode-name "Buffer")
(setq major-mode 'buffer-mode)
;; (setq buffer-mode-map (make-keymap))
;; (use-local-map buffer-mode-map)
(run-hooks 'buffer-mode-hook))
@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(){
@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 / 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 / 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 / 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 / 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 / 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