global:
http://www.gnu.org/software/global/
装好后, 去到代码目录:
$ cd src
$ gtags
.emacs
;;global
(autoload 'gtags-mode "gtags" "" t)
(gtags-mode 1)
(global-set-key (kbd "C-]") 'gtags-find-tag-from-here)
C-] 跳到定义
M-* 跳回
global现在不支持python,浏览python代码用etags也足够了:
$ etags *.py
在emacs里,
M-. 第一次会提示你指定TAGS路径..然后会跳转到定义处.
M-* 跳回.
2009年3月19日星期四
2009年2月26日星期四
emacs ido
在emacs中打开和新建文件使用的是M-x find-file(即C-x C-f),如果文件不存在就创建一个新文件。默认的提示输入文件名的方式类似shell中的补全。
Emacs提供一个很好的补全方式──ido-mode
The ido.el is now a default elisp package in Emacs 23.
You can get the newest version from CVS.
Use following elisp to enable ido-mode:
(require 'ido)
(ido-mode t)
一些命令:
C-f to return to normal find-file
C-d to enter dired.
C-l to run ido-reread-directory to refresh the current work directory.
C-j to stop automatically completing file names. For example, you have "test.01" and "test.02" in your work directory, but you want to create a new file "test" instead of finding "test.01" or "test.02". Then you should type C-j after inputting "test", to run ido-select-text.
Tab or ? to show completion help.
Emacs提供一个很好的补全方式──ido-mode
The ido.el is now a default elisp package in Emacs 23.
You can get the newest version from CVS.
Use following elisp to enable ido-mode:
(require 'ido)
(ido-mode t)
一些命令:
C-f to return to normal find-file
C-d to enter dired.
C-l to run ido-reread-directory to refresh the current work directory.
C-j to stop automatically completing file names. For example, you have "test.01" and "test.02" in your work directory, but you want to create a new file "test" instead of finding "test.01" or "test.02". Then you should type C-j after inputting "test", to run ido-select-text.
Tab or ? to show completion help.
二进制diff工具xdelta
diff和patch是针对文本文件的一对工具.
如果要处理的是二进制文件,可以使用一个专门用来处理二进制文件的工具xdelta.
比如你以前下载了 emacs-23.0.90.tar.gz (41M), 现在 emacs-23.0.91.tar.gz 出来了,你可以只下载一个emacs-23.0.90-23.0.91.xdelta (622K), 而不必下载 emacs-23.0.91.tar.gz.
安装xdelta:
sudo apt-get install xdelta
文档:
man xdelta
生成补丁(Delta):
xdelta delta fromfile tofile patchout
应用补丁(Patch):
xdalta patch patchout
例如:
xdalta patch emacs-23.0.90-23.0.91.xdelta
不会把原文件覆盖掉,会生成一个emacs-23.0.91.tar.gz
查看补丁(Info):
xdelta info ***.xdelta
里面有文件名, 长度, md5等信息.
如果要处理的是二进制文件,可以使用一个专门用来处理二进制文件的工具xdelta.
比如你以前下载了 emacs-23.0.90.tar.gz (41M), 现在 emacs-23.0.91.tar.gz 出来了,你可以只下载一个emacs-23.0.90-23.0.91.xdelta (622K), 而不必下载 emacs-23.0.91.tar.gz.
安装xdelta:
sudo apt-get install xdelta
文档:
man xdelta
生成补丁(Delta):
xdelta delta fromfile tofile patchout
应用补丁(Patch):
xdalta patch patchout
例如:
xdalta patch emacs-23.0.90-23.0.91.xdelta
不会把原文件覆盖掉,会生成一个emacs-23.0.91.tar.gz
查看补丁(Info):
xdelta info ***.xdelta
里面有文件名, 长度, md5等信息.
2009年2月24日星期二
float length = 178.5, weight = 63.5;
今天去广东省国际旅行卫生保健中心体检, 很多人,好多鬼佬。
丫的竟然要照片,没带,只好乖乖拍照30元, 一般地铁里那种快相才20元.
教训:出来混,pp随身带!
抽血,尿尿,胸透,身高体重血压体温,心电图,五官,内外科一个都不少,别担心,不用检查小jj。
裸眼视力: 左眼1.0, 右眼0.8
丫的竟然要照片,没带,只好乖乖拍照30元, 一般地铁里那种快相才20元.
教训:出来混,pp随身带!
抽血,尿尿,胸透,身高体重血压体温,心电图,五官,内外科一个都不少,别担心,不用检查小jj。
裸眼视力: 左眼1.0, 右眼0.8
2009年2月21日星期六
VirtualBox安装配置FreeBSD
安装照着手册就行了,特别是在虚拟机,当作是独占一个硬盘的情况。
http://www.freebsd.org/doc/zh_CN.GB2312/books/handbook/install.html
配置:
网络:
NAT + 端口转发. 启用DHCP.
网卡: Intel PRO/1000, 所以下面填e1000, 而不是pcnet。(详见VirtualBox UserManual)
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/telnet/Protocol" TCP
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/telnet/GuestPort" 23
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/telnet/HostPort" 2323
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/Protocol" TCP
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/HostPort" 2222
现在可以ssh过去了
ssh -p 2222 user@host
用户管理:
将用户添加到wheel组, 才可以su.
编辑 /etc/group 文件, wheel:*:0:root,bbs
安装sudo
ps. VirtualBox 对 FreeBSD 7 时常出现这个bug:
sigreturn: eflags = 0x80247
console锁死了,只能通过另外一个终端ssh上去BSD,杀死进程或者执行reboot重启.
http://www.virtualbox.org/ticket/2341 希望尽快解决
http://www.freebsd.org/doc/zh_CN.GB2312/books/handbook/install.html
配置:
网络:
NAT + 端口转发. 启用DHCP.
网卡: Intel PRO/1000, 所以下面填e1000, 而不是pcnet。(详见VirtualBox UserManual)
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/telnet/Protocol" TCP
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/telnet/GuestPort" 23
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/telnet/HostPort" 2323
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/Protocol" TCP
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata freebsd "VBoxInternal/Devices/e1000/0/LUN#0/Config/ssh/HostPort" 2222
现在可以ssh过去了
ssh -p 2222 user@host
用户管理:
将用户添加到wheel组, 才可以su.
编辑 /etc/group 文件, wheel:*:0:root,bbs
安装sudo
- cd /usr/ports/security/sudo
- make install clean
- visudo 增加一行: wheel ALL=(ALL) NOPASSWD: ALL
ps. VirtualBox 对 FreeBSD 7 时常出现这个bug:
sigreturn: eflags = 0x80247
console锁死了,只能通过另外一个终端ssh上去BSD,杀死进程或者执行reboot重启.
http://www.virtualbox.org/ticket/2341 希望尽快解决
2009年2月20日星期五
重新编译了emacs 23
1.下载emacs23代码 (2月初放出来的pretest)
http://alpha.gnu.org/gnu/emacs/pretest/emacs-23.0.90.tar.gz
或者通过cvs下载最新的代码:
cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/sources/emacs co emacs
2. 编译安装
让emacs支持xft字体
./configure --enable-font-backend --with-xft --with-freetype --with-x-toolkit=gtk
make bootstrap
make info
make install
3. 写~/.Xresources 文件
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintfull
Emacs.FontBackend: xft
4. .emacs 设置
(set-default-font "Bitstream Vera Sans Mono-13")
(set-fontset-font "fontset-default"
'gb18030 '("WenQuanYi Bitmap Song" . "unicode-bmp"))
5. 启动时添加选项 --enable-font-backend (好像非必须)
6. 上pp

参考: http://fxl.blogbus.com/logs/11846673.html
http://alpha.gnu.org/gnu/emacs/pretest/emacs-23.0.90.tar.gz
或者通过cvs下载最新的代码:
cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/sources/emacs co emacs
2. 编译安装
让emacs支持xft字体
./configure --enable-font-backend --with-xft --with-freetype --with-x-toolkit=gtk
make bootstrap
make info
make install
3. 写~/.Xresources 文件
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintfull
Emacs.FontBackend: xft
4. .emacs 设置
(set-default-font "Bitstream Vera Sans Mono-13")
(set-fontset-font "fontset-default"
'gb18030 '("WenQuanYi Bitmap Song" . "unicode-bmp"))
5. 启动时添加选项 --enable-font-backend (好像非必须)
6. 上pp

参考: http://fxl.blogbus.com/logs/11846673.html
2009年2月1日星期日
svn 导入数据到版本库
$ svnadmin create /home/svn/someproject
$ svn import mytree file:///home/svn/someproject -m "Initial import"
在导入之后,原来的目录树并没有转化成工作拷贝,
为了开始工作,还是需要运行svn checkout导出一个工作拷贝:
$ svn co file:///home/svn/someproject
svn book:
http://www.subversion.org.cn/svnbook/1.4/index.html
$ svn import mytree file:///home/svn/someproject -m "Initial import"
在导入之后,原来的目录树并没有转化成工作拷贝,
为了开始工作,还是需要运行svn checkout导出一个工作拷贝:
$ svn co file:///home/svn/someproject
svn book:
http://www.subversion.org.cn/svnbook/1.4/index.html
订阅:
博文 (Atom)