emacs window systems

在配置emacs的时候,一直想区别对待x-window和terminal两种环境。上周五配的nxhtml时,因为mumamo会给同一个buffer中的不同模式加上背景色,而我一般以终端方式使用emacs,所以当然希望背景全是黑的。


(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.

‘(mumamo-background-chunk-major ((((class color) (min-colors 8)) (:background “black”))))
‘(mumamo-background-chunk-submode1 ((((class color) (min-colors 8)) (:background “black”))))
‘(mumamo-background-chunk-submode2 ((((class color) (min-colors 8)) (:background “black”))))
‘(mumamo-background-chunk-submode3 ((((class color) (min-colors 8)) (:background “black”))))
‘(mumamo-background-chunk-submode4 ((((class color) (min-colors 8)) (:background “black”)))))

这时候,情况出现了。使用GUI方式时同一buffer的不同模式的背景是黑色,但和GUI默认的代码高亮方案冲突了,所以代码基本没法看。而terminal下面又表现的近乎完美,所以才有想区别对待x-window和terminal两种情况。翻遍emacs lisp才找到原来有个系统变量window-system,那么接下来的事情就好办了,为x-window装一个配色解决方案:color-theme:


;; color theme
(if (eq window-system ‘x)
(progn
(setq default-font “DejaVu Sans Mono”)
(add-to-list ‘load-path “/share/.emacs.d/color-theme-6.6.0″)
(require ‘color-theme)
(eval-after-load “color-theme”
‘(progn
(color-theme-initialize)
(color-theme-hober)))))

下面是emacs lisp手册中的原文描述:


Window Systems
Emacs works with several window systems, most notably the X Window System. Both Emacs and X use the term “window”, but use it differently. An Emacs frame is a single window as far as X is concerned; the individual Emacs windows are not known to X at all.

topVariable: window-system
This variable tells Lisp programs what window system Emacs is running under. The possible values are

x
Emacs is displaying using X.
pc
Emacs is displaying using MSDOS.
w32
Emacs is displaying using Windows NT or Windows 95.
nil
Emacs is using a character-based terminal.

这下就完美了!!!

secureCRT登陆Linux服务器emacs代码高亮

secureCRT中登录到服务器上时,汉字支持很好,但emacs中的代码总是不能高亮彩色显示,今天摸索了一下,终于找到了解决办法。

首先要从两个方面来设置:

1> secureCRT的设置。确保仿真终端类型为linux,并勾选“ANSI颜色选项”。

2> 服务器端的设置。在.bashrc中添加:export TERM=xterm 语句。

OK.

Debug php in emacs with geben

While PHP-developing it sometimes is just too tedious to do those ‘add a echo here and there, then reload and search the echoed strings on the screen’-loops. So I searched for a debugger for my favourite editor emacs. After a lengthy install procedure I finally got it running: With geben on emacs you can debug PHP (step through and evaluate expressions)
Continue reading

emacs+psvn

psvn:一个emacs的插件,官方有比较详细的介绍:http://www.xsteve.at/prg/vc_svn/,不过是E文的。

当然也可以看这里(中文的):http://lifegoo.pluskid.org/wiki/EmacsSubversion.htmlhttp://emacser.com/svn-status-mode-line.htm

首先下载命令行的subversion,下载地址在这里(到官方下载还要注册。。。):http://www.open.collab.net/files/documents/60/3564/CollabNetSubversion-client-1.6.12-1.win32.exe,安装。
Continue reading

今天基本配好了emacs了!

终于看到ecb和cedet正式版了,今天把YASnippet、ECB、Cedet、Auto-complete都装好了。真是不容易。我用的是Windows平台。
不过装好之后仍有个问题,总提示:

Warning: cedet-called-interactively-p called with 0 arguments, but requires 1

在网上找了很久都未果,看来仍和平台或emacs版本有关,只能继续期待官方更新了。。。,不过并不影写使用。
上个图:

Continue reading

Lisp的set和setq函数在emacs中的使用介绍

转自:http://www.ksarea.com/articles/20070913_introduce-lisp-set-setq-in-emacs.html

set函数:
为了将符号flowers的值设置为列表(rose violet daisy buttercup),我们在emacs中使用如下列表:
(set ‘flowers ‘(rose violet daisy buttercup));例一
光标置于表达式之后,键入C-x C-e或者C-x-e,列表(rose violet daisy buttercup)将会出现在回显区。这是set函数的返回值,每个Lisp函数如果不产生错误消息,它将必须有一个返回值作为附带效果,而函数的附带效果有且仅有一个附带效果。

我们已经为符号flowers赋值,那么我们可以对它进行求值:
flowers
光标置于它之后,键入C-x C-e或者C-x-e,回显区将显示列表(rose violet daisy buttercup)。我们也可以将flowers的值以字符串形式输出,这里使用到函数message:
(message “%s” flowers);有点类似C语言里的printf
同样键入C-x C-e或者C-x-e,回显区将以字符串“(rose violet daisy buttercup)”的形式显示flowers的值。
Continue reading