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 / clone_apfs_bootable_volume.txt
Last active March 17, 2021 01:13
Clone APFS bootable volume (from internal SSD to external HDD)
# see https://discussions.apple.com/thread/8384650
# disk2: main drive as source (SSD)
# disk2s1: Macintosh HD
# disk2s2: Preboot for disk2s1
# disk5: external drive as destination (HDD)
# disk5s1: Untitled
# disk5s2: Preboot for disk5s1
sudo vsdbutil -a /Volumes/Untitled
sudo rsync -xrlptgoEvHS --progress --delete / /Volumes/Untitled
diskutil list
@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 / portable-emacs.sh
Created May 16, 2020 03:55
Integrate GnuTLS into Emacs.app
#!/bin/sh
echo "Integrate GnuTLS and it's dependencies into Emacs.app"
cd ~/devel/emacs-head/emacs/nextstep/Emacs.app/Contents/MacOS
if [ -d "lib" ]; then
rm -rf lib
fi
mkdir lib
@takaxp
takaxp / my:init-loading-time.el
Last active March 30, 2020 00:46
my:init-loading-time
;; .emacs/init.el の先頭に記述
(defconst before-load-init-time (current-time))
(defun my:init-loading-time ()
"Loading time of user init files including time for `after-init-hook'."
(let ((time1 (float-time
(time-subtract after-init-time before-load-init-time)))
(time2 (float-time
(time-subtract (current-time) before-load-init-time))))
(message (concat "Loading init files: %.0f [msec], "
"of which %.f [msec] for `after-init-hook'.")
diff --exclude .git --exclude '*.o' --exclude .DS_Store --exclude '*TAGS' --exclude lib --exclude nextstep -crN emacs_orig/configure.ac emacs/configure.ac
*** emacs_orig/configure.ac 2019-12-26 23:01:31.000000000 +0900
--- emacs/configure.ac 2019-12-27 00:13:19.000000000 +0900
***************
*** 2073,2079 ****
INSTALL_ARCH_INDEP_EXTRA=
fi
! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o $ns_fontfile"
fi
@takaxp
takaxp / emacs-27.0-inline-googleime.patch
Last active December 26, 2019 23:24
An inline patch for Emacs 27 (googleime, locale=en) (see also https://qiita.com/takaxp/items/e07bb286d80fa9dd8e05)
diff --exclude .git --exclude '*.o' --exclude .DS_Store --exclude '*TAGS' --exclude lib --exclude nextstep -crN emacs_orig/configure.ac emacs/configure.ac
*** emacs_orig/configure.ac 2019-12-27 03:23:17.000000000 +0900
--- emacs/configure.ac 2019-12-27 03:24:01.000000000 +0900
***************
*** 2073,2079 ****
INSTALL_ARCH_INDEP_EXTRA=
fi
! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o $ns_fontfile"
fi
;;; iceberg256-theme.el --- Iceberg xterm256 color theme
(deftheme iceberg
"Iceberg256 - The iceberg256 theme.")
(defvar iceberg-colors-alist
(let* ((256color (eq (display-color-cells (selected-frame)) 256))
(colors `(("iceberg-accent" . "#91acd1")
("iceberg-fg" . (if ,256color "color-251" "#c6c8d1"))
("iceberg-bg" . (if ,256color "color-234" "#282C34"))
@takaxp
takaxp / ox-split-horizontal
Last active December 6, 2019 09:36
split window horizontally when showing org-export-dispatch
(with-eval-after-load "ox"
(defun my-org-export-dispatch-done ()
(when (eq this-command 'org-export-dispatch)
(delete-window))
(remove-hook 'post-command-hook #'my-org-export-dispatch-done))
(defun my-moom-org-export-dispatch-done ()
(when (eq this-command 'org-export-dispatch)
(moom-delete-windows))
(remove-hook 'post-command-hook #'my-moom-org-export-dispatch-done))
@takaxp
takaxp / ox.el
Created December 5, 2019 06:51
patch to suppress error when quit the export
diff --git a/lisp/ox.el b/lisp/ox.el
index 5b4134ecc..98846540d 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -6929,8 +6929,8 @@ options as CDR."
(org-export--dispatch-ui options first-key expertp))
;; q key at first level aborts export. At second level, cancel
;; first key instead.
- ((eq key ?q) (if (not first-key) (error "Export aborted")
- (org-export--dispatch-ui options nil expertp)))
@takaxp
takaxp / emacs-25.2-inline-googleime.patch
Last active December 1, 2019 00:25
An inline patch for Emacs 25.2 (especially, locale: en + google IME user)
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-26 14:45:40.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