Permalink
Browse files

Add org-mode config

Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
  • Loading branch information...
1 parent 5cac52d commit 5f8d8d1f60c9bb14150ce8e3a6fb7acfd41dd83d @uwabami committed Mar 30, 2012
Showing with 200 additions and 4 deletions.
  1. +1 −1 Makefile
  2. +31 −2 config/init.org
  3. +167 −0 config/org-mode_config.org
  4. +1 −1 site-lisp/org-mode
View
@@ -7,7 +7,7 @@ TARGET_DIR := site-lisp auto-install config
all: TARGET $(ELCFiles)
update:
- git submodule foreach 'git checkout master ; git pull origin master; git pull --rebase'
+ git submodule foreach 'git fetch --all && git rebase origin/master'
rm -f $(HOME)/.emacs.d/site-lisp/00build-stamp
gc:
View
@@ -1,7 +1,7 @@
# -*- mode: org; coding: utf-8-unix; indent-tabs-mode: nil -*-
#
# Copyright(C) Youhei SASAKI All rights reserved.
-# $Lastupdate: 2012/03/30 02:33:47$
+# $Lastupdate: 2012/03/30 17:35:54$
# License: Expat
#
#+TITLE: Emacsの基本設定
@@ -274,6 +274,7 @@
(setq auto-save-timeout 15)
(setq auto-save-interval 60)
(setq make-backup-files t)
+ (setq backup-by-copying t) ; symlink は使わない
(setq backup-directory-alist
`(("." . ,my:user-emacs-temporary-directory)))
(setq auto-save-file-name-transforms
@@ -330,6 +331,29 @@
(my:make-scratch 1)))))
#+END_SRC
+*** 履歴ファイル管理
+ undo 関連
+ #+BEGIN_SRC emacs-lisp
+ (setq undo-limit 160000) ; 無限にしたいができないので, 倍に
+ (setq undo-strong-limit 240000)
+ (savehist-mode 1) ; ミニバッファの履歴を保存しリストア
+ (setq savehist-file
+ (concat my:user-emacs-temporary-directory "history"))
+ (setq history-length t) ; t で無制限
+ #+END_SRC
+ recentf 関連. [[file:auto-install_config.org][auto-installとinstallしたelispの設定]] も参照のこと.
+ #+BEGIN_SRC emacs-lisp
+ (add-hook 'after-init-hook 'recentf-mode)
+ (eval-after-load "recentf"
+ '(progn
+ (setq recentf-max-saved-items 2000)
+ (setq recentf-save-file
+ (concat my:user-emacs-temporary-directory "recentf"))
+ (setq recentf-auto-cleanup 'never)
+ (run-with-idle-timer 300 t 'recentf-save-list)
+ (run-with-idle-timer 600 t 'recentf-cleanup)
+ ))
+ #+END_SRC
*** モードラインのファイル名にディレクトリも表示
#+BEGIN_SRC emacs-lisp
(require 'uniquify)
@@ -511,8 +535,9 @@
auto-install とは異なり, パッケージのバージョン管理もしてくれる.
*** install
elpa 自体は auto-install-el で導入することに
- #+BEGIN_SRC emacs-lisp
+ #+BEGIN_SRC
(unless (locate-library "package")
+ (require 'auto-install nil t)
(auto-install-from-url "http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp/emacs-lisp/package.el"))
#+END_SRC
これが実行されると ~/.emacs.d/init.el に設定が追記されるので
@@ -556,6 +581,10 @@
(add-to-load-path "site-lisp/yasnippet")
(my:load-org-file "yasnippet_config.org")
#+END_SRC
+** org-mode
+ #+BEGIN_SRC emacs-lisp
+ (my:load-org-file "org-mode_config.org")
+ #+END_SRC
* Footnotes
[fn:1] バッドノウハウと奥が深い症候群: [[http://0xcc.net/misc/bad-knowhow.html]]
View
@@ -0,0 +1,167 @@
+# -*- mode: org; coding: utf-8-unix; indent-tabs-mode: nil -*-
+#
+# Copyright(C) Youhei SASAKI All rights reserved.
+# $Lastupdate: 2012/03/30 14:11:05$
+# License: Expat
+#
+#+TITLE: Orgモードの設定
+#+AUTHOR: Youhei SASAKI
+#+EMAIL: uwabami@gfd-dennou.org
+* 始めに
+* 基本設定
+ #+BEGIN_SRC emacs-lisp
+ (require 'org-install)
+ (require 'org)
+ ;; 打ち切らない.
+ (setq org-startup-truncated nil)
+ ;; ファイルを開く時は項目を折り畳んだ状態にする
+ (setq org-startup-folded t)
+ ;; 開いた時に画像を inline で表示しない
+ (setq org-startup-with-inline-images nil)
+ ;; link を return で追う
+ (setq org-retrun-follows-link t)
+ ;; フォントロックを有効に
+ (add-hook 'org-mode-hook 'turn-on-font-lock)
+ ;; 基本ディレクトリ
+ (setq org-directory "~/Documents/Dropbox/org/")
+ ;; Agenda
+ (setq org-default-notes-file (concat org-directory "remember.org"))
+ ;; (when (locate-library "remember-el")
+ ;; (setq remember-annotation-functions '(org-remember-annotation))
+ ;; (setq remember-handler-functions '(org-remember-handler))
+ ;; (setq org-remember-templates
+ ;; '(("Todo" ?t "** TODO %?\n %i\n %a\n %t" nil "Inbox")
+ ;; ("Bug" ?b "** TODO %? :bug:\n %i\n %a\n %t" nil "Inbox")
+ ;; ("Idea" ?i "** %?\n %i\n %a\n %t" nil "New Ideas")
+ ;; )))
+ #+END_SRC
+* LaTeX export の設定
+** 日本語LaTeX用の設定
+ DebianのLaTeXはまだUTF-8を処理できないので, EUC-JPでexportする.
+ #+BEGIN_SRC emacs-lisp
+ ;; LaTeX export
+ (require 'org-latex)
+ (setq org-export-latex-coding-system 'euc-jp-unix)
+ (setq org-export-latex-date-format "%Y年%m月%d日")
+ #+END_SRC
+** jsarticle classの追加
+ inputenc 等は読み込まないことにしてファイル毎にスタイルを設定する.
+ #+BEGIN_SRC emacs-lisp
+ (add-to-list 'org-export-latex-classes
+ '("jsarticle"
+ "\\documentclass{jsarticle}
+ [NO-DEFAULT-PACKAGES]
+ [NO-PACKAGES]
+ [EXTRA]
+ "
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
+ ("\\paragraph{%s}" . "\\paragraph*{%s}")
+ ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
+ (setq org-export-latex-default-class "jsarticle")
+ #+END_SRC
+** latexmk
+ PDF作成にはlatexmkを使う
+ #+BEGIN_SRC emacs-lisp
+ (setq org-latex-to-pdf-process
+ '("latexmk -pdfdvi %f"))
+ #+END_SRC
+* Beamer export の設定
+ #+BEGIN_SRC emacs-lisp
+ ;; LaTeX-Beamer export
+ (require 'org-beamer)
+ ;; デフォルトのヘッドラインレベル -> 2
+ (setq org-beamer-frame-level 2)
+ ;; frame のオプション
+ (setq org-beamer-frame-default-options "[fragile]")
+ (setq org-export-with-sub-superscripts nil)
+#+END_SRC
+
+* HTML export の設定
+ #+BEGIN_SRC emacs-lisp
+ ;; ;; org-jekyll の読み込み
+ ;; ;; (my:not-locate-library org-jekyll "site-lisp/org-jekyll")
+ ;; ;; HTML export の設定
+ ;; (require 'org-html)
+ ;; ;; default の style sheet は使わない
+ ;; (setq org-export-html-style-include-default nil)
+ ;; ;; -----------------------------------------------------------
+ ;; ;;; Website 用の org file の置き場所
+ ;; ;; @see http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
+ ;; ;; (require 'org-publish)
+ ;; ;;
+ ;; ;; バックアップファイルを作成しない
+ ;; (setq make-backup-files nil)
+ ;; ;; cache の置き場所を ~/.emacs.d/tmp/org-timestamps/ に変える
+ ;; ;; (setq org-publish-timestamp-directory
+ ;; ;; (convert-standard-filename (concat user-emacs-directory "tmp/org-timestamps/")))
+ ;; (setq org-publish-use-timestamps-flag nil)
+ ;; ;; project の設定
+ ;; (setq org-publish-project-alist
+ ;; '(
+ ;; ("emacs-setup"
+ ;; :base-directory "~/.emacs.d/site-start.d/"
+ ;; :exclude ".*\.el|^Makefile|.*\.gpg|sitemap\.org"
+ ;; :base-extension "org"
+ ;; :publishing-directory "~/Public/cc-env/Emacs/"
+ ;; :recursive nil
+ ;; :publish-function org-publish-org-to-html
+ ;; :auto-sitemap t
+ ;; :sitemap-filename "sitemap.org"
+ ;; :sitemap-title "sitemap"
+ ;; :headline-levels 2
+ ;; :auto-preamble t
+ ;; )
+ ;; ("web-org"
+ ;; :base-directory "~/Public/org/"
+ ;; :exclude "^menu.*\.org\\|cc-env\\|css\\|img\\|.*\.pdf\\|.*\.tex"
+ ;; :base-extension "org"
+ ;; :publishing-directory "~/Public/"
+ ;; :recursive t
+ ;; :publish-function org-publish-org-to-html
+ ;; :headline-levels 2
+ ;; :html-postamble auto ;; default
+ ;; :auto-preamble t
+ ;; )
+ ;; ("web"
+ ;; :components ("web-org" "Emacs"))
+ ;; ))
+ ;; ;; ;;; insert skelton and export config files
+ ;; ;; ;;
+ ;; ;; ;; @see http://thenybble.de/projects/orgsite.html
+ ;; ;; ;;
+ ;; ;; (defvar my-website-base-dir "~/Public/org/src" "Base directory of Website")
+ ;; ;; (defvar my-website-config-name "export-config-")
+ ;; ;; (setq my-website-base-dir (expand-file-name "~/Public/org/src"))
+ ;; ;; (defun my-repeat-string (str times)
+ ;; ;; (with-output-to-string
+ ;; ;; (dotimes (i times)
+ ;; ;; (princ str))))
+ ;; ;; (defun my-get-nesting-depth (filename basename)
+ ;; ;; (with-temp-buffer
+ ;; ;; (insert (file-relative-name filename basename))
+ ;; ;; (goto-line 0)
+ ;; ;; (count-matches "/")))
+ ;; ;; (defun my-make-website-conf-path (filename)
+ ;; ;; (let ((nesting-level (my-get-nesting-depth filename my-website-base-dir)))
+ ;; ;; (concat (my-repeat-string "../" (+ nesting-level 1))
+ ;; ;; my-website-config-name (int-to-string nesting-level) ".org")))
+ ;; ;; (define-skeleton my-org-website-skeleton "" "Enter Title: "
+ ;; ;; "#+TITLE: " str ?\n
+ ;; ;; "#+SETUPFILE: "
+ ;; ;; (my-make-website-conf-path (buffer-file-name)) ?\n
+ ;; ;; "#+INCLUDE: "
+ ;; ;; (my-make-website-conf-path (buffer-file-name)) ?\n ?\n
+ ;; ;; "* " _ )
+ ;; ;; (defun my-org-website-insert-skeleton-maybe ()
+ ;; ;; (if (and (buffer-file-name)
+ ;; ;; (not (file-remote-p (buffer-file-name)))
+ ;; ;; (string-match (concat "^" my-website-base-dir)
+ ;; ;; (expand-file-name (buffer-file-name))))
+ ;; ;; (my-org-website-skeleton)))
+ ;; ;; (add-hook 'find-file-hook 'auto-insert)
+ ;; ;; (setq auto-insert-query nil)
+ ;; ;; (setq auto-insert-alist
+ ;; ;; '((org-mode . my-org-website-insert-skeleton-maybe)))
+ #+END_SRC
Submodule org-mode updated from 22bfdc to 676942

0 comments on commit 5f8d8d1

Please sign in to comment.