论坛首页 Ruby版

emacs-rails 在win下怎么装

浏览 1927 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
时间:2007-06-14 关键字: emacs
.emacs写着
;;使用rails模式

(setq load-path (cons "f:/emacs/site-lisp/rails" load-path))
(require 'inf-ruby)
(require 'find-recursive)
(require 'snippet)
(require 'rails)


错误提示
An error has occurred while loading `c:/Documents and Settings/lscx/Application Data/.emacs':

Symbol's value as variable is void: 

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

我在XP下安装的
   
时间:2007-06-14
ychael 写道
.emacs写着
;;使用rails模式

(setq load-path (cons "f:/emacs/site-lisp/rails" load-path))
(require 'inf-ruby)
(require 'find-recursive)
(require 'snippet)
(require 'rails)


错误提示
An error has occurred while loading `c:/Documents and Settings/lscx/Application Data/.emacs':

Symbol's value as variable is void: 

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

我在XP下安装的


劝你不要在Windows下开发了。不光是Emacs,其他问题一堆一堆滴。
   
0 请登录后投票
时间:2007-06-15
open emacs with:
emacs --debug-init

then you will get the backtracings, put them here.
   
0 请登录后投票
时间:2007-06-16
贴下site-lisp下的文件
   
0 请登录后投票
时间:2007-06-16
.emacs
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;基本设置

;自动加载
(add-to-list 'load-path    "f:/emacs/site-lisp/emacs-rails")  
(add-to-list 'load-path    "f:/emacs")  
(add-to-list 'load-path    "f:/emacs/yaml-mode")  
(add-to-list 'load-path    "f:/emacs/site-lisp/color-theme-6.6.0/") 

;关闭出错提示音
(setq visible-bell t)

;关闭开机画面
(setq inhibit-startup-message t)

;显示列号
(setq column-number-mode t)
(setq line-number-mode t)
(setq default-fill-coloum 60)

;语法加亮
(global-font-lock-mode t)
(setq transient-mark-mode t)

;设置 TAB
(setq indent-tabs-mode t)
(setq tab-width 4)
;do not jump when encounter a parentheses
(show-paren-mode t)
(setq show-paran-style 'parentheses)
;do not jump when scroll
(setq scroll-step 1
      scroll-margin 3
      scroll-conservatively 10000)

;; 设置颜色 
(require 'color-theme)  
(color-theme-initialize)  
(color-theme-pok-wob)  
;;(color-theme-dark-blue) 

;; 复制(删除)目录的时,第归的复制(删除)其中的子目录。
(setq dired-recursive-copies t)
(setq dired-recursive-deletes t)

;设置初始目录
;(setq default-directory "~/project/rforum")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;CODing Style

;自动缩进

(mapcar
 (lambda (mode)
   (let ((mode-hook (intern (concat (symbol-name mode) "-hook")))
         (mode-map (intern (concat (symbol-name mode) "-map"))))
     (add-hook mode-hook
               `(lambda nil 
                        (local-set-key 
                               (kbd "RET")
                               (or (lookup-key ,mode-map "\C-j")
                                   (lookup-key global-map "\C-j"))))))) '(c-mode c++-mode cperl-mode emacs-lisp-mode java-mode html-mode lisp-mode ruby-mode sh-mode))

;格式化文件 M-x iwb

(defun iwb ()
 "indent whole buffer"
 (interactive)
 (delete-trailing-whitespace)
 (indent-region (point-min) (point-max) nil))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;RUBY

;ruby mode设置

;;说明ruby-mode模式调用哪个函数块
(autoload 'ruby-mode "ruby-mode"
  "Mode for editing ruby source files" t)

;;看到文件后缀为.rb的,对其使用ruby-mode模式,然后它会调用autoload中
;;指定的函数块
(setq auto-mode-alist
      (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))

;;如果文件后缀名不为.rb,但是脚本第一行有#!ruby之类的说明
;;也相应调用此ruby模式 
(setq interpreter-mode-alist (append '(("ruby" . ruby-mode))
                                     interpreter-mode-alist))

;;调用inf-ruby
(autoload 'run-ruby "inf-ruby"
  "Run an inferior Ruby process")
(autoload 'inf-ruby-keys "inf-ruby"
  "Set local key defs for inf-ruby in ruby-mode")

;;加载钩子
(add-hook 'ruby-mode-hook
          (lambda()
            (require 'ruby-electric)
;代码自动完成         
(ruby-electric-mode t)
            ))

;;使用ruby-electric次模式
(require 'ruby-electric)
(defun try-complete-abbrev (old)
   (if (expand-abbrev) t nil))

(setq hippie-expand-try-functions-list
       '(try-complete-abbrev
         try-complete-file-name
         try-expand-dabbrev))

;;使用rails模式

(setq load-path (cons "f:/emacs/site-lisp/rails" load-path))  
(require 'inf-ruby)  
(require 'find-recursive)  
(require 'snippet)  
(require 'rails)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;调试、

   
0 请登录后投票
时间:2007-06-16
在CMD运行emacs --debug-init结果
  • 911a1cd6-de15-43ae-a22f-dfdce02feaf6-thumb
  • 描述:
  • 大小: 6.9 KB
   
0 请登录后投票
时间:2007-06-16
还有个问题怎么样让 M-X SPEEDERBAR这种集成到EMACS的工具栏
   
0 请登录后投票
时间:2007-06-16
tiw 写道
open emacs with:
emacs --debug-init

then you will get the backtracings, put them here.


Emacs Rails在XP下运行的挺好的。
   
0 请登录后投票
时间:2007-06-16
debug 信息不全, 估计是编码的问题, 不确定.

整合speedbar可以考虑ecb.
   
0 请登录后投票
时间:2007-08-07
我也遇到和你同样的问题,经过调查,这个问题的原因不是乱码引起的。而是由于ruby-mode.el的问题。ruby-mode.el貌似在checkout的时候会自动将版本号添加至$Revision$中,比如我用SVN下载来来的是这样:
(defconst ruby-mode-revision "$Revision: 12030 $")
建议按照以下方式下载ruby-mode.el

$svn co http://svn.ruby-lang.org/repos/ruby/trunk/misc/ .
   
0 请登录后投票
论坛首页 Ruby版

跳转论坛: