| Version 36 (modified by munepi, 15 years ago) (diff) |
|---|
vine-default の仕組みを新しくしました VineSeed:22246。
vine-default を呼ぶタイミングの改善しました。
これにより、今後は after-vine-default-setup-hook を廃止します。 一部の PACKAGE/vine-default-PACKAGE.el で after-vine-default-setup-hook にひっかけているものがあるので、 しばらくの間は暫定的に残しておきます。
from site-start.el.emacs24 of emacs24-24.0.50-3.20110128vl6.x86_64
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; GNU Emacs EMACS_VERSION default settings for Vine Linux
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defcustom emacs-ime (getenv "EMACS_IME")
"A variable of default Input Method Editor"
:type 'string)
(if (null emacs-ime)
(setq emacs-ime "ibus-el"))
(defcustom vine-default t
"A boolean for all Vine Linux default settings"
:type 'boolean)
(if (equal (getenv "LOGNAME") "root")
(setq vine-default nil))
(defcustom vine-default-base t
"A boolean for vine-default-base"
:type 'boolean)
(defcustom vine-default-faces t
"A boolean for vine-default-faces"
:type 'boolean)
(defvar vine-default-setup-hook nil
"List of functions to be called at vine-default-setup")
(defvar after-vine-default-setup-hook nil
"This hook is obsolete! Please do not use this hook.
List of functions to be called at the end of vine-default-setup")
(defun vine-default-setup ()
"A function for setup to default configurations of Vine Linux"
(when vine-default
(message "Starting vine-default-setup ...")
(when vine-default-base
(message "Loading vine-default-base ...")
(require 'vine-default-base))
(when vine-default-faces
(message "Loading vine-default-faces ...")
(require 'vine-default-faces))
(run-hooks 'vine-default-setup-hook)
(run-hooks 'after-vine-default-setup-hook);; obsolete
)
)
(defun show-vine-default ()
"A function to show current vine-default configurations"
(interactive)
(shell-command
"/usr/lib/emacsen-common/show-vine-default.sh EMACS_VERSION"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; run functions from the /etc/emacs-EMACS_VERSION/site-start.d directory
;;; Files in this directory ending with ".el" are run on startup
(mapc 'load (directory-files "/etc/emacs-EMACS_VERSION/site-start.d" t "\\.el\\'"))
;;; load local configuration
(if (file-exists-p (expand-file-name "/etc/emacs/emacs24-local.el"))
(load (expand-file-name "/etc/emacs/emacs24-local.el")))
;;; load vine-default configuration per user before vine-default-setup
(if (file-exists-p (expand-file-name "~/.emacs.d/emacs24-vine-default.el"))
(load (expand-file-name "~/.emacs.d/emacs24-vine-default.el")))
;;; run vine-default-setup
(vine-default-setup)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Local Variables:
;; mode: emacs-lisp
;; End:
from howm-init.el of howm-1.3.9.1-2vl6.noarch
;; ;; howm-init.el ;; ;; for Vine Linux with emacsen-common ;; Munehiro Yamamoto <munepi@vinelinux.org> (defcustom vine-default-howm t "A boolean for vine-default-howm" :type 'boolean) (add-hook 'vine-default-setup-hook (lambda() (when vine-default-howm (message "Loading vine-default-howm ...") (require 'vine-default-howm)))) ;;; end of file
from emacs24-local.el of emacs24-24.0.50-3.20110128vl6.x86_64
;; ;; GNU Emacs EMACS_VERSION local configuration file ;; ;; This configuration is read at the end of site-start.el. ;; Emacs configuration files are read ;; - distribution wide from site-start.el ;; - system wide from this configuration file ;; - per user from ~/.emacs.d/init.el, ;; where per user settings override system wide settings, ;; and system wide settings override site-start.el. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Local Variables: ;; mode: emacs-lisp ;; End:
Emacs XX を起動して、vine-default-setup が実行される前に、~/.emacs.d/emacsXX-vine-default.el から vine-default に関する設定を読み込みます。
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; -*- coding: utf-8-unix -*- ;; FSF Emacs 24 用 vine-default 設定ファイル ;; Munehiro Yamamoto <munepi@vinelinux.org> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Vine Linux のデフォルト設定を無効にしたい場合は、 ;; 以下を有効にしてください。 ;; (setq vine-default nil) ;;; 環境変数 EMACS_IME と異なる IME を使いたい場合は、 ;;; 以下を有効にして設定することができます。 ;; (setq emacs-ime "atokx3");; anthy-el atokx3 ibus-el mozc tamago scim scim-bridge skk wnn7egg ;;; マクロサーチパスの追加 ;;; 例えば、~/lib/emacs 以下にユーザ用の *.el, *.elc を置くことができます。 ;; (add-to-list 'load-path "~/lib/emacs") ;; (add-to-list 'load-path "~/.emacs.d/auto-install") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Local Variables: ;; mode: emacs-lisp ;; End:
from vine-default-howm.el of howm-1.3.9.1-2vl6.noarch
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; -*- coding: utf-8-unix -*- ;; FSF Emacs 23 用 Vine Linux howm 設定 ;; Munehiro Yamamoto <munepi@vinelinux.org> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; howm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (autoload 'howm-menu "howm-mode" "Hitori Otegaru Wiki Modoki" t) (setq howm-process-coding-system 'utf-8) (setq howm-menu-lang 'ja) ;; (global-set-key "\C-c,," 'howm-menu) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (provide 'vine-default-howm) ;; Local Variables: ;; mode: emacs-lisp ;; End:
Vine Linux 6 では、デフォルトのユーザ初期設定ファイルとして、 ${HOME}/.emacs.d/init.el を推奨します。
Emacs は、~/.emacs, ~/.emacs.el, ~/.emacs.d/init.el の順番に探し、 一番最初に見つけたファイルを「デフォルトのユーザ初期設定ファイル」とする挙動をします。
${HOME}/.emacs.d/init.el は、 例えばこのような感じで良いと考えています。
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; -*- coding: utf-8-unix -*-
;; FSF Emacs バージョン分岐用ファイル
;; Munehiro Yamamoto <munepi@vinelinux.org>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq user-init-file
(concat "~/.emacs.d/emacs" (number-to-string emacs-major-version)
"-init.el"))
(setq custom-file
(concat "~/.emacs.d/emacs" (number-to-string emacs-major-version)
"-custom.el"))
(if (file-exists-p (expand-file-name user-init-file))
(load-file (expand-file-name user-init-file)))
(if (file-exists-p (expand-file-name custom-file))
(load-file (expand-file-name custom-file)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Local Variables:
;; mode: emacs-lisp
;; End:
====================
このようにしておくと、複数のバージョンのユーザ初期設定ファイルと カスタムファイル(M-x customize により書き込まれる設定ファイル)を別々に管理できます。
必要であれば、Emacs バージョン共通の設定ファイルなどを設けて、以下のようにしてもよいでしょう。
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; -*- coding: utf-8-unix -*-
;; FSF Emacs バージョン分岐用ファイル
;; Munehiro Yamamoto <munepi@vinelinux.org>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ユーザーの初期設定ファイルの指定
(setq user-init-file
(concat "~/.emacs.d/emacs" (number-to-string emacs-major-version)
"-init.el"))
(setq custom-file
(concat "~/.emacs.d/emacs" (number-to-string emacs-major-version)
"-custom.el"))
(if (file-exists-p (expand-file-name user-init-file))
(load (expand-file-name user-init-file)))
(if (file-exists-p (expand-file-name custom-file))
(load (expand-file-name custom-file)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 個人的な設定ファイル: Emacs バージョン共通
(setq my-emacs-common-file "~/.emacs.d/emacs-common.el")
(if (file-exists-p (expand-file-name my-emacs-common-file))
(load-file (expand-file-name my-emacs-common-file)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Local Variables:
;; mode: emacs-lisp
;; End:
Emacs XX を起動すると、上記の ~/.emacs.d/init.el から ~/.emacs.d/emacsXX-init.el が
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; -*- coding: utf-8-unix -*- ;; FSF Emacs 24 用 ユーザ設定ファイル ;; Munehiro Yamamoto <munepi@vinelinux.org> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Local Variables: ;; mode: emacs-lisp ;; End:
Vine Linux 5 までの設定ファイル ~/.emacs.* は、すべて ~/.emacs.d/dot.emacs/ 以下に移すようにするのはどうでしょうか?
Vine Linux 5 に対応する emacs-23, emacs22-22.x に関する情報を集めています。