(我正在使用emacs23;在 Debian 7 上;Xfce。)
我想尝试Gilles 推荐的使用 Emacs 做快速笔记的解决方案。
尝试运行时emacsclient -a "" -e "(remember-other-frame)"
,出现以下错误:
*错误*:未知终端类型
怎么了?
(不太确定我在做什么,)我尝试从 Emacs 中启动服务器:Ctrl+x并输入server-start. 然后它说:
警告(服务器):无法启动 Emacs 服务器。
有一个现有的 Emacs 服务器,名为“服务器”。
在这个 Emacs 进程中启动服务器,停止现有的
服务器或者调用 `Mx server-force-delete' 强行断开它。
按Ctrl+x并输入时server-force-delete,它说:
连接文件“/tmp/emacs1000/server”已删除
当我现在emacsclient -a "" -e "(remember-other-frame)"
从不同的终端窗口emacs -nw
运行时(仍然在第一个窗口中运行),我得到:
emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
Warning: due to a long standing Gtk+ bug
http://bugzilla.gnome.org/show_bug.cgi?id=85715
Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.
Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
("emacs")
Loading 00debian-vars...
Loading 00debian-vars...done
Loading /etc/emacs/site-start.d/50a2ps.el (source)...
Loading /etc/emacs/site-start.d/50a2ps.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
Starting Emacs daemon.
Emacs daemon should have started, trying to connect again
*ERROR*: Unknown terminal type
Run Code Online (Sandbox Code Playgroud)
的输出echo $TERM; echo $DISPLAY
:
xterm
:0.0
Run Code Online (Sandbox Code Playgroud)
您是从终端模拟器运行它吗,如果是,是哪个,如果不是,在哪里?
我不确定什么是“终端模拟器”,但我使用的终端设备将自身(在“信息”菜单中)标识为:Xfce 终端模拟器(终端 0.4.8)。这是安装 Debian 7 + Xfce 时的默认设置。
你在有什么
~/.emacs
和~/.emacs.d
?
~/.emacs
不存在。~/.emacs.d
仅包含一个子文件夹auto-save-list
(其中包含名称以 开头的空文件.saves
)。remember-other-frame
调用switch-to-buffer-other-frame
它调用display-buffer
与变量pop-up-frames
设置为t
。这导致make-frame
使用参数调用pop-up-frame-alist
。该函数make-frame
在与当前选定的帧相同的显示设备上创建一个帧。(Emacs 所谓的框架就是 GUI 所谓的窗口,除了框架也可以在文本终端中。)此时 Emacs 仍然在守护进程模式下运行,所以没有被选中的框架。因此make-frame
看不到GUI环境,认为应该创建一个终端框架,但也没有文本终端,导致出现令人困惑的错误信息“未知终端类型”。
remember-other-frame
是从现有 Emacs 窗口中调用的正确函数,但从 emacsclient 调用在技术上是错误的。在那里,我们应该使用-c
选项让 Emacs 创建一个新框架,以及普通remember
函数。
emacsclient -a "" -c -e "(remember)"
Run Code Online (Sandbox Code Playgroud)
然而,这不是很好,因为remember
创建了一个必须用 关闭的窗口C-c C-c
(这也是保存注释的东西),然后框架必须用 关闭C-x 5 0
。如果您忘记了C-c C-c
(这更有可能是因为要键入C-x 5 0
的消息会覆盖C-c C-c
在回显区域中要键入的消息),该注释甚至不会被保存。
make-frame
明确指示在当前 X 显示上创建框架。
emacsclient -a "" -e "
(let ((pop-up-frame-alist \`((window-system . x)
(display . \"$DISPLAY\")
,@pop-up-frame-alist)))
(remember-other-frame))"
Run Code Online (Sandbox Code Playgroud)
您可以将所有内容放在一行中,只需确保不要更改标点符号。
emacsclient -a "" -e "(let ((pop-up-frame-alist \`((window-system . x) (display . \"$DISPLAY\") ,@pop-up-frame-alist))) (remember-other-frame))"
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2490 次 |
最近记录: |