Skip to content

Commit

Permalink
Fix install target
Browse files Browse the repository at this point in the history
  - Fix case environment variable '$DIR' ends with '/'(#260, #261)
  - Do byte-compile by byte-compile target
  - Fix output message by non interactive case
    byte sequence is outputted
  • Loading branch information
syohex committed Nov 17, 2013
1 parent 8a13f40 commit 273d3da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -19,7 +19,7 @@ byte-compile: check-dependency
test: check-dependency
${EMACS} -batch -Q -l tests/run-test.el

install:
install: byte-compile
${EMACS} -Q -L . -batch -l etc/install ${DIR}

README.html: README.md
Expand Down
17 changes: 8 additions & 9 deletions etc/install.el
Expand Up @@ -5,22 +5,21 @@
It causes sometimes errors or installation fault. Are you sure? "))
(let* ((basedir (file-name-directory (directory-file-name (file-name-directory load-file-name))))
(default-dir "~/.emacs.d/")
(todir (or (car command-line-args-left)
(read-file-name "Install to: " default-dir default-dir)))
(basedictdir (concat basedir "/dict"))
(todictdir (concat todir "/ac-dict")))
(todir (file-name-as-directory
(or (car command-line-args-left)
(read-directory-name "Install to: " default-dir default-dir))))
(basedictdir (concat basedir "dict"))
(todictdir (concat todir "ac-dict")))
(cond
((not (file-directory-p basedir))
(error "Base directory is not found"))
((or (eq (length todir) 0)
((or (= (length todir) 0)
(not (file-directory-p todir)))
(error "To directory is empty or not found"))
(t
(message "Installing to %s from %s" todir basedir)
(add-to-list 'load-path basedir)
(make-directory todictdir t)
(loop for file in (directory-files basedir t "^.*\\.el$")
do (byte-compile-file file))
(loop for file in (directory-files basedir t "^.*\\.elc?$")
do (copy-file file todir t))
(loop for file in (directory-files basedictdir t "^[^\\.]")
Expand All @@ -33,13 +32,13 @@ Add the following code to your .emacs:
"
(if (and (not (member (expand-file-name todir) load-path))
(not (member (concat (expand-file-name todir) "/") load-path)))
(format "(add-to-list 'load-path \"%s\")\n" todir)
(format "(add-to-list 'load-path \"%s\")\n" (directory-file-name todir))
"")
"(require 'auto-complete-config)\n"
;(format "(add-to-list 'ac-dictionary-directories \"%s\")\n" todictdir)
"(ac-config-default)\n")))
(if noninteractive
(progn (mapc 'princ msg)
(progn (princ msg)
(princ "\n"))
(switch-to-buffer "*Installation Result*")
(erase-buffer)
Expand Down

0 comments on commit 273d3da

Please sign in to comment.