Browse Source

Fix make run-emacs

pull/5/head
10sr 9 years ago
parent
commit
b5d57e4a27
2 changed files with 23 additions and 18 deletions
  1. +2
    -2
      Makefile
  2. +21
    -16
      emacs.el

+ 2
- 2
Makefile View File

@@ -345,7 +345,7 @@ command_extract_setup_load := $(grep) -e 'SETUP_LOAD: ' | \
sed -e 's/^.*SETUP_LOAD: //' -e 's|DOTFILES_DIR|$(dotfiles_dir)|' sed -e 's/^.*SETUP_LOAD: //' -e 's|DOTFILES_DIR|$(dotfiles_dir)|'


$(home)/.emacs.d/init.el $(home)/.vimrc $(home)/.tmux.conf: $(home)/.emacs.d/init.el $(home)/.vimrc $(home)/.tmux.conf:
cat "$<" | $(command_extract_setup_load) | tee -a "$@"
test -f "$@" || cat "$<" | $(command_extract_setup_load) | tee -a "$@"






@@ -353,7 +353,7 @@ $(home)/.emacs.d/init.el $(home)/.vimrc $(home)/.tmux.conf:
# === # ===


run-emacs: $(home)/.emacs.d/init.el run-emacs: $(home)/.emacs.d/init.el
$(emacs) -q --eval "(setq )" --load "$<"
$(emacs) -q --eval "(setq user-emacs-directory \"$(home)/.emacs.d/\")" --load "$<"








+ 21
- 16
emacs.el View File

@@ -30,6 +30,14 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Some macros for internals ;; Some macros for internals


(defun call-after-init (func)
"If `after-init-hook' has been run, call FUNC immediately.
Otherwize hook it."
(if after-init-time
(funcall func)
(add-hook 'after-init-hook
func)))

(defmacro defvar-set (symbol value &optional docstring) (defmacro defvar-set (symbol value &optional docstring)
"Define SYMBOL as a variable and set to VALUE. "Define SYMBOL as a variable and set to VALUE.


@@ -276,12 +284,11 @@ IF OK-IF-ALREADY-EXISTS is true force download."
(let ((kill-emacs-hook nil)) (let ((kill-emacs-hook nil))
(kill-emacs))) (kill-emacs)))


(add-hook 'after-init-hook
(lambda ()
(message "%s %s" invocation-name emacs-version)
(message "%s was taken to initialize emacs." (emacs-init-time))
(switch-to-buffer "*Messages*")
))
(call-after-init
(lambda ()
(message "%s %s" invocation-name emacs-version)
(message "%s was taken to initialize emacs." (emacs-init-time))
(switch-to-buffer "*Messages*")))


(cd ".") ; when using windows use / instead of \ in `default-directory' (cd ".") ; when using windows use / instead of \ in `default-directory'


@@ -302,9 +309,8 @@ IF OK-IF-ALREADY-EXISTS is true force download."
;; (comint-show-maximum-output) ;; (comint-show-maximum-output)


;; kill scratch ;; kill scratch
(add-hook 'after-init-hook
(lambda ()
(kill-buffer "*scratch*")))
(call-after-init (lambda ()
(kill-buffer "*scratch*")))


;; modifier keys ;; modifier keys
;; (setq mac-option-modifier 'control) ;; (setq mac-option-modifier 'control)
@@ -447,11 +453,10 @@ IF OK-IF-ALREADY-EXISTS is true force download."


;; http://www.geocities.jp/simizu_daisuke/bunkei-meadow.html#frame-title ;; http://www.geocities.jp/simizu_daisuke/bunkei-meadow.html#frame-title
;; display date ;; display date
(add-hook 'after-init-hook
(lambda ()
(when display-time-mode
(display-time-update))
))
(call-after-init (lambda ()
(when display-time-mode
(display-time-update))
))


(when (safe-require-or-eval 'time) (when (safe-require-or-eval 'time)
(setq display-time-interval 29) (setq display-time-interval 29)
@@ -824,7 +829,7 @@ IF OK-IF-ALREADY-EXISTS is true force download."
;; Load scim-bridge. ;; Load scim-bridge.
(when (safe-require-or-eval 'scim-bridge) (when (safe-require-or-eval 'scim-bridge)
;; Turn on scim-mode automatically after loading .emacs ;; Turn on scim-mode automatically after loading .emacs
(add-hook 'after-init-hook 'scim-mode-on)
(call-after-init 'scim-mode-on)
(defvar-set scim-cursor-color "red") (defvar-set scim-cursor-color "red")
(scim-define-preedit-key ?\^h t) (scim-define-preedit-key ?\^h t)
(scim-define-common-key ?\* nil) (scim-define-common-key ?\* nil)
@@ -915,7 +920,7 @@ IF OK-IF-ALREADY-EXISTS is true force download."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; https://github.com/lunaryorn/flycheck ;; https://github.com/lunaryorn/flycheck
(when (safe-require-or-eval 'flycheck) (when (safe-require-or-eval 'flycheck)
(add-hook 'after-init-hook 'global-flycheck-mode))
(call-after-init 'global-flycheck-mode))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; window ;; window


Loading…
Cancel
Save