LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1097|回复: 8

怎样消除emacs的这样的错误提示?

[复制链接]
发表于 2005-12-11 19:13:32 | 显示全部楼层 |阅读模式
每次启动emacs都有这样的错误提示
  1. Symbol's function definition is void: terminal-init-rxvt
复制代码

我用的是rxvt,以前是好的,好像自从装了ecb还是什么后,就会有这样的东东了
不影响使用,但在命令行不能指定打开一个文件
例如我输入
  1. emacs -nw a.c
复制代码
就会有上面的错误
然后a.c也不会打开,出来的只是Message buffer,要另外C-x C-f才行
哪位大虾知道怎么解决?
发表于 2005-12-12 12:11:21 | 显示全部楼层
错误的意思是 terminal-init-rxvt 作为函数的值是 void。不过我没用过这个包。你原来用它是在哪个包里的?默认的位置是 /usr/share/emacs/VER/lisp、~/.emacs.d。你可以用 grep 查找它的位置。然后再看看有没有解决方案。
回复 支持 反对

使用道具 举报

发表于 2005-12-12 12:19:53 | 显示全部楼层
我知道了,是在 term/rxvt.el 里。解决方案是在 Emacs Lisp 解释器使用它之前装载这个文件。由于不知道细节,先试试在 ~/.emacs 里加入下面的代码行不行吧:
  1. (load-file "path-to-rxvt.el")
复制代码

不过这不是好的解决方案。如果你确定是安装了 ecb 的原因,也许是包管理器的 Bug 吧。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-12 15:34:55 | 显示全部楼层
恩,果然可以了
谢谢herberteuler兄
这个问题困扰我很就了,呵呵

不知道是不是ecb的原因
但我用emacs -q启动就没问题
先这样凑合着用吧
回复 支持 反对

使用道具 举报

发表于 2005-12-12 15:54:03 | 显示全部楼层
如果不介意,能不能把 .emacs 贴一下,一起来找找其中的问题?因为如果 emacs -q 是正常的话,问题应该就在 ~/.emacs,或者 default.el 中。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-14 15:05:39 | 显示全部楼层
Post by herberteuler
如果不介意,能不能把 .emacs 贴一下,一起来找找其中的问题?因为如果 emacs -q 是正常的话,问题应该就在 ~/.emacs,或者 default.el 中。

不好意思,是我记错了,如果不load rxvt.el, emacs -q -nw的话还是会出错.

我的.emacs是一个杂货箱,每次在网上看到有趣或有用的dd就加进去,所以很乱,我想等我有空学了elisp再动手整理吧
还是帖出来吧, 大虾们替我找找问题, 小弟感激不尽
[PHP];;set the dir emacs-lisp resident
(setq load-path (cons "~/.emacs.d" load-path))
(load "/usr/share/emacs/site-lisp/site-gentoo")
(load "/usr/share/emacs/23.0.0/lisp/term/rxvt")
(add-to-list 'load-path
             "/usr/share/emacs/site-lisp/eieio/")
(add-to-list 'load-path
             "/usr/share/emacs/site-lisp/gnuserv/");

;;hide toolbar
(tool-bar-mode 0)

;;highline current line(like ue under windows) when editting c files
(add-hook 'c-mode-hook 'hl-line-mode)

;;设置tab为4个空格宽度
(setq default-tab-width 4)

;;to edit compressed files
(require 'jka-compr)
;;to create a LaTex document
;;(require 'tex-site)
;;(require 'preview)

(setq compilation-scroll-output t)

;;bind a shortcut for goto-line
(global-set-key [(meta g)] 'goto-line)
;;hit ctl-i to compile programs
(global-set-key [(ctrl i)] 'compile)

(setq visible-bell t)

(set-clipboard-coding-system 'ctext)

;;display the time now
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(display-time)
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
'(case-fold-search t)
'(column-number-mode t)
'(cua-mode nil nil (cua-base))
'(current-language-environment "Chinese-GBK")
'(default-input-method "chinese-py-punct")
'(display-battery-mode nil)
'(display-time-mode t)
'(ecb-directories-menu-user-extension-function nil)
'(ecb-history-menu-user-extension-function nil)
'(ecb-methods-menu-user-extension-function nil)
'(ecb-options-version "2.31")
'(ecb-sources-menu-user-extension-function nil)
'(global-font-lock-mode t nil (font-lock))
'(save-place t nil (saveplace))
'(show-paren-mode t)
'(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify)))
'(transient-mark-mode t))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
)
;;(setq tabbar-buffer-groups-function 'tabbar-buffer-ignore-groups)

;; chinese character suport
;;(set-terminal-coding-system 'chinese-iso-8bit)
;;(set-keyboard-coding-system 'chinese-iso-8bit)
;;(set-language-environment "Chinese")
;;(set-default-coding-systems 'utf-8)
;;(set-terminal-coding-system 'utf-8)
(set-clipboard-coding-system 'gbk)
;;(set-selection-coding-system 'chinese-iso-8bit)
;;(setq locale-coding-system 'chinese-iso-8bit)
;;(setq current-language-environment "Chinese-GB")

;;显示列号。
;;(setq column-number-mode t)
;;关闭起动时的那个“开机画面”
(setq inhibit-startup-message t)
;;在标题栏显示buffer的名字,而不是 emacs@!#*&!(&@# 这样没用的提示。
(setq frame-title-format "emacs@%b")
;;ido mode. 超强的buffer切换工具, Emacs 也有通常编辑器的那种
;;在 Tab 中选择 buffer 的 mode,但是用了ido 以后,我再也不需要
;;他它了,ido mode 是我见过最方便的 buffer 切换模式。
(require 'ido)
(ido-mode t)

;; setting up semantic
(setq semantic-load-turn-everything-on t)
(add-to-list 'load-path
             "/usr/share/emacs/site-lisp/semantic/")
(require 'semantic-load)

(setq mouse-yank-at-point t)

;;(global-set-key [(control f9)] 'calendar)

(add-to-list 'load-path
             "/usr/share/emacs/site-lisp/ecb/")
(require 'ecb)

;; hippie-expand
(global-set-key [(meta ?/)] 'hippie-expand)
;;hippie-expand的补全方式,是一个优先列表
(setq hippie-expand-try-functions-list
      '(try-expand-dabbrev
        try-expand-dabbrev-visible
        try-expand-dabbrev-all-buffers
        try-expand-dabbrev-from-kill
        try-complete-file-name-partially
        try-complete-file-name
        try-expand-all-abbrevs
        try-expand-list
        try-expand-line
        try-complete-lisp-symbol-partially
        try-complete-lisp-symbol))

;; config thumbs(cmd to load thumb mode:M-x thumbs)
;;(autoload 'thumbs "thumbs" "review images in a directory." t)

;; 类似vi的括号匹配(from: http://learn.tsinghua.edu.cn/homepage/2001315450/emacs_elisp.html)
;; 规则: 当%在括号上按下时,匹配括号,否则输入一个%
(global-set-key "%" 'match-paren)
         
(defun match-paren (arg)
  "Go to the matching paren if on a paren; otherwise insert %."
  (interactive "p")
  (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
        ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
        (t (self-insert-command (or arg 1)))))

(require 'ibuffer)
(global-set-key (kbd "C-x C-b") 'ibuffer)

(require 'gdb-ui)
(setq gdb-many-windows t)

(require 'xcscope)

;; to use outline minor mode
(setq outline-minor-mode-prefix [(control o)])
(global-set-key [(meta o)] 'open-line)

;; start server
(server-start)

;;(global-set-key [(tab)] 'lisp-indent-line)

(setq todo-file-do "~/.emacs.d/todo/do")
(setq todo-file-done "~/.emacs.d/todo/done")
(setq todo-file-top "~/.emacs.d/todo/top")

(setq diary-file "~/.emacs.d/diary")
(setq diary-mail-addr "nait83@gmail.com")
(add-hook 'diary-hook 'appt-make-list)



(global-set-key (kbd "<f12>") 'todo-show)
;;hitting F11 to get the man page for the library call at the current cursor position.
(global-set-key [(f11)] (lambda () (interactive)  (manual-entry  (current-word))))
;;(require 'browse-kill-ring)
;;(global-set-key [(control c)(k)] 'browse-kill-ring)
;;(browse-kill-ring-default-keybindings)

;; generic mode
(require 'generic)
(require 'generic-x)

[/PHP]
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-14 15:11:27 | 显示全部楼层
还有一个问题
当在别的程序里选种一块有中文的字符时,到emacs中C-y粘贴时,在中文的两边总有一些乱码也一起粘贴进来了
例如,在firefox里选中"中文",粘贴到emacs中会出现下图所示的奇怪前导字符

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2005-12-14 15:51:35 | 显示全部楼层
Post by nait
不好意思,是我记错了,如果不load rxvt.el, emacs -q -nw的话还是会出错.

我的.emacs是一个杂货箱,每次在网上看到有趣或有用的dd就加进去,所以很乱,我想等我有空学了elisp再动手整理吧
还是帖出来吧, 大虾们替我找找问题, 小弟感激不尽
[PHP];;set the dir emacs-lisp resident
(setq load-path (cons "~/.emacs.d" load-path))
(load "/usr/share/emacs/site-lisp/site-gentoo")
(load "/usr/share/emacs/23.0.0/lisp/term/rxvt")
(add-to-list 'load-path
             "/usr/share/emacs/site-lisp/eieio/")
(add-to-list 'load-path
             "/usr/share/emacs/site-lisp/gnuserv/");

;;hide toolbar
(tool-bar-mode 0)

;;highline current line(like ue under windows) when editting c files
(add-hook 'c-mode-hook 'hl-line-mode)

;;设置tab为4个空格宽度
(setq default-tab-width 4)

;;to edit compressed files
(require 'jka-compr)
;;to create a LaTex document
;;(require 'tex-site)
;;(require 'preview)

(setq compilation-scroll-output t)

;;bind a shortcut for goto-line
(global-set-key [(meta g)] 'goto-line)
;;hit ctl-i to compile programs
(global-set-key [(ctrl i)] 'compile)

(setq visible-bell t)

(set-clipboard-coding-system 'ctext)

;;display the time now
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(display-time)
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
'(case-fold-search t)
'(column-number-mode t)
'(cua-mode nil nil (cua-base))
'(current-language-environment "Chinese-GBK")
'(default-input-method "chinese-py-punct")
'(display-battery-mode nil)
'(display-time-mode t)
'(ecb-directories-menu-user-extension-function nil)
'(ecb-history-menu-user-extension-function nil)
'(ecb-methods-menu-user-extension-function nil)
'(ecb-options-version "2.31")
'(ecb-sources-menu-user-extension-function nil)
'(global-font-lock-mode t nil (font-lock))
'(save-place t nil (saveplace))
'(show-paren-mode t)
'(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify)))
'(transient-mark-mode t))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
)
;;(setq tabbar-buffer-groups-function 'tabbar-buffer-ignore-groups)

;; chinese character suport
;;(set-terminal-coding-system 'chinese-iso-8bit)
;;(set-keyboard-coding-system 'chinese-iso-8bit)
;;(set-language-environment "Chinese")
;;(set-default-coding-systems 'utf-8)
;;(set-terminal-coding-system 'utf-8)
(set-clipboard-coding-system 'gbk)
;;(set-selection-coding-system 'chinese-iso-8bit)
;;(setq locale-coding-system 'chinese-iso-8bit)
;;(setq current-language-environment "Chinese-GB")

;;显示列号。
;;(setq column-number-mode t)
;;关闭起动时的那个“开机画面”
(setq inhibit-startup-message t)
;;在标题栏显示buffer的名字,而不是 emacs@!#*&!(&@# 这样没用的提示。
(setq frame-title-format "emacs@%b")
;;ido mode. 超强的buffer切换工具, Emacs 也有通常编辑器的那种
;;在 Tab 中选择 buffer 的 mode,但是用了ido 以后,我再也不需要
;;他它了,ido mode 是我见过最方便的 buffer 切换模式。
(require 'ido)
(ido-mode t)

;; setting up semantic
(setq semantic-load-turn-everything-on t)
(add-to-list 'load-path
             "/usr/share/emacs/site-lisp/semantic/")
(require 'semantic-load)

(setq mouse-yank-at-point t)

;;(global-set-key [(control f9)] 'calendar)

(add-to-list 'load-path
             "/usr/share/emacs/site-lisp/ecb/")
(require 'ecb)

;; hippie-expand
(global-set-key [(meta ?/)] 'hippie-expand)
;;hippie-expand的补全方式,是一个优先列表
(setq hippie-expand-try-functions-list
      '(try-expand-dabbrev
        try-expand-dabbrev-visible
        try-expand-dabbrev-all-buffers
        try-expand-dabbrev-from-kill
        try-complete-file-name-partially
        try-complete-file-name
        try-expand-all-abbrevs
        try-expand-list
        try-expand-line
        try-complete-lisp-symbol-partially
        try-complete-lisp-symbol))

;; config thumbs(cmd to load thumb mode:M-x thumbs)
;;(autoload 'thumbs "thumbs" "review images in a directory." t)

;; 类似vi的括号匹配(from: http://learn.tsinghua.edu.cn/homepage/2001315450/emacs_elisp.html)
;; 规则: 当%在括号上按下时,匹配括号,否则输入一个%
(global-set-key "%" 'match-paren)
         
(defun match-paren (arg)
  "Go to the matching paren if on a paren; otherwise insert %."
  (interactive "p")
  (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
        ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
        (t (self-insert-command (or arg 1)))))

(require 'ibuffer)
(global-set-key (kbd "C-x C-b") 'ibuffer)

(require 'gdb-ui)
(setq gdb-many-windows t)

(require 'xcscope)

;; to use outline minor mode
(setq outline-minor-mode-prefix [(control o)])
(global-set-key [(meta o)] 'open-line)

;; start server
(server-start)

;;(global-set-key [(tab)] 'lisp-indent-line)

(setq todo-file-do "~/.emacs.d/todo/do")
(setq todo-file-done "~/.emacs.d/todo/done")
(setq todo-file-top "~/.emacs.d/todo/top")

(setq diary-file "~/.emacs.d/diary")
(setq diary-mail-addr "nait83@gmail.com")
(add-hook 'diary-hook 'appt-make-list)



(global-set-key (kbd "<f12>") 'todo-show)
;;hitting F11 to get the man page for the library call at the current cursor position.
(global-set-key [(f11)] (lambda () (interactive)  (manual-entry  (current-word))))
;;(require 'browse-kill-ring)
;;(global-set-key [(control c)(k)] 'browse-kill-ring)
;;(browse-kill-ring-default-keybindings)

;; generic mode
(require 'generic)
(require 'generic-x)

[/PHP]
如你所说,这似乎不是 .emacs 的问题。不过 term/README 给出了信息:
  1.    When Emacs starts, it checks the TERM environment variable to see what type
  2. of terminal the user is running on, checks for an elisp file named
  3. "term/${TERM}.el", and if one exists, loads it.  If that doesn't yield a file
  4. that exists, the last hyphen and what follows it is stripped.  If that doesn't
  5. yield a file that exists, the previous hyphen is stripped, and so on until all
  6. hyphens are gone.  For example, if the terminal type is `aaa-48-foo', Emacs
  7. will try first `term/aaa-48-foo.el', then `term/aaa-48.el' and finally
  8. `term/aaa.el'.  Each terminal specific file should contain a function
  9. named terminal-init-TERMINALNAME (eg terminal-init-aaa-48 for
  10. term/aaa-48.el) that Emacs will call in order to initialize the
  11. terminal. The terminal files should not contain any top level forms
  12. that are executed when the file is loaded, all the initialization
  13. actions are performed by the terminal-init-TERMINALNAME functions.
复制代码

另外,这是实现上面的描述的代码:
  1.     (let* ((TERM (getenv "TERM"))
  2.            (term TERM)
  3.           hyphend)
  4.       (while (and term
  5.                   (not (load (concat term-file-prefix term) t t)))
  6.         ;; Strip off last hyphen and what follows, then try again
  7.         (setq term
  8.               (if (setq hyphend (string-match "[-_][^-_]+\\'" term))
  9.                   (substring term 0 hyphend)
  10.                 nil)))
  11.       (setq term TERM)
  12.       ;; The terminal file has been loaded, now call the terminal specific
  13.       ;; initialization function.
  14.       (while term
  15.         (let ((term-init-func (intern-soft (concat "terminal-init-" term))))
  16.           (if (not (fboundp term-init-func))
  17.               ;; Strip off last hyphen and what follows, then try again
  18.               (setq term
  19.                     (if (setq hyphend (string-match "[-_][^-_]+\\'" term))
  20.                         (substring term 0 hyphend)
  21.                       nil))
  22.             (setq term nil)
  23.             (funcall term-init-func))))))
复制代码

它在 startup.el 中。这些目录都是相对于 Emacs 的 lisp 目录的。这样,只要设置好 TERM 这个环境变量就可以了。不过我在 Windows 里即使将 TERM 设置为 rxvt 也不行,不知道为什么,呵呵。我也是从 CVS 中 Checkout 代码后编译的,而且用 M-x getenv 得到的 TERM 的值也是 rxvt。你试试在 Gentoo 里行不行吧。
回复 支持 反对

使用道具 举报

发表于 2005-12-14 16:00:16 | 显示全部楼层
Post by nait
还有一个问题
当在别的程序里选种一块有中文的字符时,到emacs中C-y粘贴时,在中文的两边总有一些乱码也一起粘贴进来了
例如,在firefox里选中"中文",粘贴到emacs中会出现下图所示的奇怪前导字符
这个我现在无法重现,至少在 Win 里还没有问题。你看看在 Firefox 里选中内容以后下面这个命令的执行结果吧:
  1. M-x describe-variable RET kill-ring RET
复制代码

也许这里就已经有乱码了。如果是这样,应该就是 Emacs 和 X 的剪贴板的通信问题了。还有可能是文本属性的问题,所以先看看结果是什么吧。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表