2

私はemacsgrailsの開発に使用しようとしています。grails-emacs-mode で試してみた

私のubuntu 12.04にはありemacsます。emacs23

prayag@prayag:~$ ls -l /usr/share/emacs[tab][tab]
emacs/   emacs23/ 

grails-emacs-mode が示唆するようにgrails-mode.elprimary.orgファイルを自分のemacs23/site-list

prayag@prayag:~$ ls -l /usr/share/emacs23/site-lisp/
total 32
-rw-r--r-- 1 root root  3013 Nov 17 00:39 debian-startup.elc
drwxr-xr-x 2 root root  4096 Nov 17 00:39 dictionaries-common
-rw-r--r-- 1 root root 18205 Feb 14 01:11 grails-mode.el
-rw-r--r-- 1 root root     0 Feb 14 01:11 primary.org
-rw-r--r-- 1 root root   106 Sep 22 01:16 subdirs.el

次に、ホームディレクトリにファイルが存在しないため、init.el内部に作成します。コンテナ_.emacs.d.emacsinit.el

(require 'grails-mode)
(setq grails-mode t)
(setq project-mode t)
(add-to-list 'auto-mode-alist '("\.gsp$" . nxml-mode)) ; Use whatever mode you want for views.
(project-load-all) ; Loads all saved projects. Recommended, but not required.

現在、開いemacs23てもメニューバーにグレイルは表示されません。

私も試しました

M-x
load-file .emacs.d/init.el

投げる

Warning (initialization): An error occurred while loading `/home/prayag/.emacs.d/init.el':

File error: Cannot open load file, project-mode

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

grails-emacs

を起動するemacs23 --debug-initと、次のエラーがスローされます。

Debugger entered--Lisp error: (file-error "Cannot open load file" "project-mode")
  require(project-mode)
  eval-buffer(#<buffer  *load*<2>> nil "/usr/share/emacs/23.3/site-lisp/grails-mode.el" nil t)  ; Reading at buffer position 422
  load-with-code-conversion("/usr/share/emacs/23.3/site-lisp/grails-mode.el" "/usr/share/emacs/23.3/site-lisp/grails-mode.el" nil t)
  require(grails-mode)
  eval-buffer(#<buffer  *load*> nil "/home/prayag/.emacs.d/init.el" nil t)  ; Reading at buffer position 23
  load-with-code-conversion("/home/prayag/.emacs.d/init.el" "/home/prayag/.emacs.d/init.el" t t)
  load("/home/prayag/.emacs.d/init" t t)
  #[nil "\205\264
4

2 に答える 2

1

グレイルモードは全く知りません。あなたのリンクをクリックしたところ、project-mode は依存関係にあると述べられています。

依存関係: project-mode が唯一の依存関係です。

結果として、それもインストールする必要があります。Emacs プロジェクト コードへのリンク。このプロジェクトに追加の依存関係がないことを願っています...

補足として、後で、パッケージのインストールとパッケージの依存関係を処理するための非常に便利な方法が組み込まれている最新の emacs (v24) をインストールしてみてください。私はそれをチェックアウトしました.それは別の(しかし非常に知っている)リポジトリに存在します:Marmalade-repo.org.

于 2013-02-14T11:32:08.043 に答える
1

emacs-grails-mode ページで説明されているように、grails-modeには project-mode が必要です。そのため、 project-modeもインストールする必要があります。

また、ここから残りの groovy パッケージ (grails モードを除くすべて) を取得します

emacs-grails-mode-extは grails-mode へのささやかな貢献であり、Grails コマンドを emacs から直接実行できるようにします。特定のプロジェクト (プロジェクト モード) に対して、 create-domain-classcreate-serviceなどの Grails コマンドを実行できます。

hereから関数ido-find-file-in-tag-filesも使用し、 Cx CMfにバインドし ます。

emacs-grails-mode による簡単なガイド:

  • コマンド ラインまたはeshell -> grails create-app yourappからプロジェクトを作成します。
  • diredを使用して、Grails プロジェクト フォルダーに移動します。
  • Mx project-new -> 新しいプロジェクトを作成する (プロジェクトモード)
  • Mx project-save ->プロジェクトを保存
  • Mx project-load-and-select -> 引数としてプロジェクト名
  • メニューバーを使用する場合は Grails メニューもあります

emacs24 がインストールされている場合は、現在の emacs セットアップをここで使用することもできます。Ubuntu 12.04で利用できると思いますが、よくわかりません。私は通常、OSX のソースから emacs をビルドするか、Ubuntu でemacs-snapshotを使用します。

お役に立てれば。

于 2013-02-14T11:48:27.613 に答える