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 / example-setting-org-tempo.el
Created May 19, 2018 08:04
An example setting for org-tempo.el
(when (version< "9.1.4" (org-version))
(add-to-list 'org-modules 'org-tempo))
(add-to-list 'org-structure-template-alist
(if (version< "9.1.4" (org-version))
'(?S . "src emacs-lisp")
'("S" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC" "<src lang=\"emacs-lisp\">\n\n</src>")))
@takaxp
takaxp / ad:org-clock-report.el
Last active May 25, 2023 06:46
org-clock-report in reversed order
(with-eval-after-load "org-clock"
(defvar org-clocktable-steps-reverse-p nil)
(defun ad:org-clocktable-steps (params)
"Create one or more clock tables, according to PARAMS.
Step through the range specifications in plist PARAMS to make
a number of clock tables."
(let* ((ignore-empty-tables (plist-get params :stepskip0))
(step (plist-get params :step))
(step-header
(pcase step
@takaxp
takaxp / daylight-theme.el
Last active September 9, 2022 22:05
my theme for light
;;; daylight-theme.el --- my default theme
(deftheme daylight
"my default theme")
(custom-theme-set-faces
'daylight
;; '(default ((t (:stipple nil :background "White" :foreground "Black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "nil" :family "Monaco"))))
'(default ((t (:stipple nil :background "White" :foreground "Black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :width normal :foundry "nil"))))
'(bold ((t (:weight bold))))
@takaxp
takaxp / night-theme.el
Last active September 9, 2022 22:05
my theme for dark
;;; night-theme.el --- Night Theme
(deftheme night
"Night Theme")
(custom-theme-set-faces
'night
;; '(default ((t (:stipple nil :background "#31343F" :foreground "#abb2bf" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "nil" :family "Monaco"))))
'(default ((t (:stipple nil :background "#31343F" :foreground "#abb2bf" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :width normal :foundry "nil"))))
'(bold ((t (:weight bold))))
@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))