Around emacs, linux, etc.
Emacs
Emacs is the extensible, customizable, self-documenting real-time display editor.
export org-mode file in command line
Jan 19th
see http://thread.gmane.org/gmane.emacs.orgmode/7675 for more informations
以下是我用来export单个文件的命令
生成html
emacs --batch --eval '(progn (setq user-full-name "Your Name")(setq user-mail-address "Your Mail Address")(find-file "/path/to/file.org")(org-export-as-html 3))'
生成txt
emacs --batch --eval '(progn (setq user-full-name "Your Name")(setq user-mail-address "Your Mail Address")(find-file "/path/to/file.org")(org-export-as-ascii 3))'
segment fault when dump-emacs
Dec 1st
dump-emacs 是个好东西,不过最近老是dump失败
gdb了一下 发现挂在unexec那
google之至http://bugs.gentoo.org/show_bug.cgi?id=221281#c6
The breakage is caused by the “randomize brk()” patch.
See the LKML, http://lkml.org/lkml/2007/10/23/435:This is known to break older versions of some emacs variants, whose
dumper code assumed that the last variable declared in the program is
equal to the start of the dynamically allocated memory region.The corresponding kernel parameter is accessible via
/proc/sys/kernel/randomize_va_space, the breakage occurs if its value is 2.
结论为执行下sysctl -w kernel.randomize_va_space=0再dump即可
shell里这么写
#!/bin/bash MYEMACS=/home/x/bin/emacs-dump EMACS=/home/x/bin/emacs cat > /tmp/dump-emacs.el <<EOF (load "/home/x/.emacs") (dump-emacs "$MYEMACS" "$EMACS") EOF OLD_VASPACE=`sysctl kernel.randomize_va_space|tr -d " "` sudo sysctl -w kernel.randomize_va_space=0 $EMACS --batch --load /tmp/dump-emacs.el sudo sysctl -w "$OLD_VASPACE"
即可
jump-or-exec in emacs
Oct 6th
去年的时候发在水木里的
类似sawfish下的jump-or-exec
用于查找名为buffer-name的buffer,如果不存在则调用func,如果存在的话切换到这个buffer,如果这个buffer就是当前的buffer且给出了可选参数onfocused的话就把这个buffer作为参数来调用onfocused
因为不会用正则匹配查找buffer,所以只能全匹配。
没有sawfish的时候怎么用jump-or-exec来切换窗口
Oct 6th
最初是因为compiz不成熟,所以一直在用sawfish,最近切到了compiz后就不能用sawfish了,非常好用的jump-or-exec也没了,本来打算自己搞个的,发现已经有人弄过了。地址在 http://pluskid.lifegoo.com/wiki/JumpOrExec.html
通过一个python脚本和wmctrl来实现的jump-or-exec,配合xbindkeys,基本上不用再担心切换wm的问题了
不过python脚本的启动明显没有shell脚本来的快,改写成shell脚本代码如下
More >
有了xft后emacs的字体设置,解决新开frame还是老字体的问题
Mar 17th
有了xft以后emacs的字体设置现在已经可以简单到不能简单了,而且很漂亮,真的很养眼。
其实这个设置也没什么特别的,主要是今天在emacs@newsmth上看到有人问新开frame仍然使用的是老字体的问题,想起自己当初因为这个琢磨了很久emacs的font是怎么搞的,所以应该还是有必要发出来共享一下的
(progn
(set-default-font "courier 10 pitch-12")
(set-fontset-font "fontset-default" 'han '("微软雅黑" . "unicode-bmp"))
(add-to-list 'default-frame-alist '(font . "courier 10 pitch-12")))
progn那个可以去掉的,我当初是为了测试方便能够一起eval三句用的
我不会创建fontset,所以先set-default-font来设置默认字体,这个会自动创建一个fontset
然后修改这个fontset来增加中文显示字体
最后把这个fontset加到default-frame-alist,因为新开的frame会从default-frame-alist里继承,也就继承了字体的设置
Seems scim conflicts with Xorg or sawfish or emacs?
Mar 9th
I first found this problem when using ubuntu dapper & emacs 23.0.0.1.
Sometimes when speedbar is started in emacs, every key press in emacs does not effects unless next time I switched to emacs.
At first, I thought it was a little bug with emacs 23, so I did not take it serious.
But after upgrading to feisty & emacs 23.0.0.9, this happens more often. When created a new frame, either speedbar or C+X 5 2, key press frozen. And everything returns all right when all other frames are closed. And evem more, key press lags when switching windows! So I thought it maybe bug with xorg or sawfish!
So I asked in emacs@newsmth, and someone said it maybe problem between xim & emacs in reply. Then I disabled scim and now seems everything ok.
搜狐微博
新浪微博
Recent Comments