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-mac-port-build.sh
Last active August 20, 2022 16:53
Build self-contained EMP with some custom variables (for 28.1)
#!/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
compver=x86_64-apple-darwin`uname -r`
@takaxp
takaxp / emacs-mac-custom.patch
Last active August 20, 2022 16:53
A custom patch for EMP build
*** emacs-28.1_origin/lisp/term/mac-win.el 2022-08-20 23:56:38.000000000 +0900
--- emacs-28.1/lisp/term/mac-win.el 2022-08-21 00:24:21.000000000 +0900
***************
*** 1362,1369 ****
--- 1362,1380 ----
(2 . mac-ts-selected-converted-text)) ; NSUnderlineStyleThick
"Alist of NSUnderlineStyle vs Emacs face in marked text.")
+ (defvar mac-win-debug-log nil)
+ (defvar mac-win-ime-cursor-type nil)
@takaxp
takaxp / org-html-template-md.el
Created July 10, 2021 18:41
org-html-template-md.el
(defun org-html-template (contents info)
"Return complete document string after HTML conversion.
CONTENTS is the transcoded contents string. INFO is a plist
holding export options."
(concat
(when (and (not (org-html-html5-p info)) (org-html-xhtml-p info))
(let* ((xml-declaration (plist-get info :html-xml-declaration))
(decl (or (and (stringp xml-declaration) xml-declaration)
(cdr (assoc (plist-get info :html-extension)
xml-declaration))
;;; icons-in-terminal-dired.el --- Shows icons for each file in dired mode -*- lexical-binding: t; -*-
;; Copyright (C) 2016 jtbm37
;; Author: jtbm37
;; Derived: Takaaki Ishikawa (takaxp)
;; Version: 1.0
;; Keywords: files icons dired
;; Package-Requires: ((emacs "24.4") (icons-in-terminal "0.1.0"))
;; URL: https://github.com/jtbm37/icons-in-terminal-dired
;;; icons-in-terminal-ivy.el --- Shows icons while using ivy and counsel -*- lexical-binding: t; -*-
;; Copyright (C) 2017 asok
;; Author: asok
;; Derived: Takaaki Ishikawa (takaxp)
;; Version: 0.1.0
;; Keywords: faces
;; Package-Requires: ((emacs "24.4") (icons-in-terminal "0.1.0") (ivy "0.8.0"))
(defun my-replace-punctuation-to-scientific ()
(interactive)
(my-replace-punctuation 'scientific))
(defun my-replace-punctuation-to-normal ()
(interactive)
(my-replace-punctuation 'normal))
(defun my-replace-punctuation (to)
(let ((pos (point))
@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
;;; 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.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 / 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))