<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>浏忙大爆炸 &#187; 技术</title>
	<atom:link href="http://blog.waterlin.org/articles/category/%e6%8a%80%e6%9c%af/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.waterlin.org</link>
	<description>源于理工科男的烂笔头情结</description>
	<lastBuildDate>Sat, 04 Sep 2010 09:48:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>微软 DirectShow 的自摆乌龙</title>
		<link>http://blog.waterlin.org/articles/qedit-problem-in-windows-directshow.html</link>
		<comments>http://blog.waterlin.org/articles/qedit-problem-in-windows-directshow.html#comments</comments>
		<pubDate>Sat, 04 Sep 2010 09:48:08 +0000</pubDate>
		<dc:creator>waterlin</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.waterlin.org/articles/qedit-problem-in-windows-directshow.html</guid>
		<description><![CDATA[在使用有关 DirectShow 东西的时候，使用了头文件 #include &#60;qedit.h&#62; 结果，编译的时候提示如下错误： 错误 1 fatal error C1083: 无法打开包括文件:"dxtrans.h": No such file or directory c:\program files\microsoft sdks\windows\v6.0a\include\qedit.h 498 这个真是奇怪了，为啥微软自己 SDK 里的东西，都会出现找不到头文件的问题呢？ 解决办法可以有两种： (1) 从其它地方把 dxtrans.h 这个文件拷过来，例如从 Program Files\Windows Mobile 5.0 SDK R2\PocketPC\Include\Armv4i\dxtrans.h Program Files\Windows Mobile 5.0 SDK R2\Smartphone\Include\Armv4i\dxtrans.h D:\Program Files\Windows Mobile 6 SDK\PocketPC\Include\Armv4i D:\Program Files\Windows Mobile 6 SDK\Smartphone\Include\Armv4i 里拷 dxtrans.h 这个文件出来。 (2) [...]]]></description>
			<content:encoded><![CDATA[<p>在使用有关 DirectShow 东西的时候，使用了头文件</p>
<pre>
<span>#include</span> <span>&lt;qedit.h&gt;</span>
</pre>
<p>结果，编译的时候提示如下错误：</p>
<pre>
错误    1       fatal error C1083: 无法打开包括文件:"dxtrans.h": No such file or directory    c:\program files\microsoft sdks\windows\v6.0a\include\qedit.h   498
</pre>
<p>这个真是奇怪了，为啥微软自己 SDK 里的东西，都会出现找不到头文件的问题呢？</p>
<p>解决办法可以有两种：</p>
<p>(1) 从其它地方把 dxtrans.h 这个文件拷过来，例如从</p>
<pre>
Program Files\Windows Mobile 5.0 SDK R2\PocketPC\Include\Armv4i\dxtrans.h
Program Files\Windows Mobile 5.0 SDK R2\Smartphone\Include\Armv4i\dxtrans.h
D:\Program Files\Windows Mobile 6 SDK\PocketPC\Include\Armv4i
D:\Program Files\Windows Mobile 6 SDK\Smartphone\Include\Armv4i
</pre>
<p>里拷 dxtrans.h 这个文件出来。</p>
<p>(2) 或者在引用 qedit.h 头文件的时候，加上这么几句：</p>
<pre>
<span>#pragma</span> include_alias( <span>"dxtrans.h"</span>, <span>"qedit.h"</span> )
<span>#define</span> <span>__IDxtCompositor_INTERFACE_DEFINED__</span>
<span>#define</span> <span>__IDxtAlphaSetter_INTERFACE_DEFINED__</span>
<span>#define</span> <span>__IDxtJpeg_INTERFACE_DEFINED__</span>
<span>#define</span> <span>__IDxtKey_INTERFACE_DEFINED__</span>
<span>#include</span> <span>"Qedit.h"</span>
</pre>
<p>也可以。</p>
<p>微软的<a href="http://social.msdn.microsoft.com/forums/en-US/windowssdk/thread/ed097d2c-3d68-4f48-8448-277eaaf68252/">MSDN上还有对这个问题的讨论</a>，看来真是微软自摆乌龙了。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.waterlin.org/articles/qedit-problem-in-windows-directshow.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows SDK 6.0A: unknwn.idl compilation error</title>
		<link>http://blog.waterlin.org/articles/windows-sdk-60a-unknwn-idl-compilation-error.html</link>
		<comments>http://blog.waterlin.org/articles/windows-sdk-60a-unknwn-idl-compilation-error.html#comments</comments>
		<pubDate>Thu, 02 Sep 2010 11:09:36 +0000</pubDate>
		<dc:creator>waterlin</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.waterlin.org/articles/windows-sdk-60a-unknwn-idl-compilation-error.html</guid>
		<description><![CDATA[不知道为什么，之前还能在 Visual Studio 2005 下编译得好好的工程，今天突然就碰到下面的问题： Error 1 error MIDL2025 : syntax error : expecting ] or , near "annotation" C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\unknwn.idl 108 Error 2 error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\unknwn.idl 108 这个是 MIDL 编译器相关的问题，当你给新版本的 Windows SDK 头文件使用旧版本的 MIDL 编译器时，就会有这个问题。 解决的办法，就是把你新版本的 MIDL 编译器添加到 Visual Studio 的包含目录里。微软 Mike [...]]]></description>
			<content:encoded><![CDATA[<p>不知道为什么，之前还能在 Visual Studio 2005 下编译得好好的工程，今天突然就碰到下面的问题：</p>
<pre>
Error    1    error MIDL2025 : syntax error : expecting ] or , near "annotation"    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\unknwn.idl    108
Error    2    error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation     C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\unknwn.idl    108
</pre>
<p>这个是 MIDL 编译器相关的问题，当你给新版本的 Windows SDK 头文件使用旧版本的 MIDL 编译器时，就会有这个问题。</p>
<p>解决的办法，就是把你新版本的 MIDL 编译器添加到 Visual Studio 的包含目录里。微软 <a href="http://blogs.msdn.com/b/mikewasson">Mike Wasson</a> 的博客 <a href="http://blogs.msdn.com/b/mikewasson/archive/2006/10/02/midl-error_3a00_-_2700_annotation_2700_.aspx">MIDL error: &#8216;annotation&#8217;</a> 对此有着详细的解释，内容摘要如下：</p>
<pre>
A colleage recently got this error while compiling unknown.idl:

1&gt;C:\Program Files\Microsoft SDKs\Windows\v6.0\Include\unknwn.idl(108) : error MIDL2025 : syntax error : expecting ] or , near "annotation"
1&gt;C:\Program Files\Microsoft SDKs\Windows\v6.0\Include\unknwn.idl(108) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation

If you get this error, you are using a new version of the Windows headers with an older version of the MIDL compiler.

Fix:

1. Make sure you installed the MIDL compiler when you installed the latest Windows SDK. It should appear under "Program Files\Microsoft SDKs\Windows\v6.0\Bin".

Note: To install the MIDL compiler, you need to select Developer Tools / Windows Development Tools / Win32 Development Tools in the Windows SDK setup wizard. (At least, as of RC1.)

2. In Visual Studio, under Tools &gt; Options &gt; Projects and Solutions &gt; VC++ Directories &gt; Executable Files, add

    x:\Program Files\Microsoft SDKs\Windows\v6.0\bin

to the top of the list.
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.waterlin.org/articles/windows-sdk-60a-unknwn-idl-compilation-error.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Installer 把安装目录写到注册表里的方法</title>
		<link>http://blog.waterlin.org/articles/windows-installer-sets-installation-path-dynamicly.html</link>
		<comments>http://blog.waterlin.org/articles/windows-installer-sets-installation-path-dynamicly.html#comments</comments>
		<pubDate>Wed, 25 Aug 2010 08:24:45 +0000</pubDate>
		<dc:creator>waterlin</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.waterlin.org/articles/windows-installer-sets-installation-path-dynamicly.html</guid>
		<description><![CDATA[在用 Visual Studio 2005 建立生成安装文件的工程时，因为应用程序的需要，在安装的时候要求 Windows Installer 把用户选择的安装路径写到注册表里。这个时候，有什么解决办法呢？ 可以在生成安装文件的工程里，手动插入一个系统预留的属性值（即需要转义的字符串），在 Windows Installer 安装程序的时候，会自动把这些属性值替换掉。可以用 [] 或 {} 来把该属性值括起来。 例如，右键点击&#8221;安装工程名称 ==&#62; 视图 ==&#62; 编辑器 ==&#62; 注册表&#8221;，这时，可以添加如下注册表项： HKEY_CURRENT_USER&#124;HKEY_LOCAL_MACHINE\Software\[Manufacturer]\ 这样，在 Windows Installer 安装程序的时候， [Manufacturer] 就会自动转义为实际的值。当然，如果没有对应的系统预留属性值，则转义为空值( blank )。 系统预留的属性值有很多个，例如对于安装目录来说，是 [TARGETDIR] ，即 [TARGETDIR] 会根据安装时用户选择的安装路径赋值。当你在注册表里，需要填写程序安装路径的时候，就可以用这个属性值来占位。Windows Installer 在安装的时候，自然会把它替换为实际路径。安装后，会显示为类似于下面的路径： C:\Program Files\TestApp\TestAppFirstPart\ 如果你需要在注册表里指定相应的可执行文件或动态链接库，比如说，你要在注册表里插入下面的路径： C:\Program Files\TestApp\TestAppFirstPart\test.dll 这时，你就应该在工程里把属性值设为： [TARGETDIR]test.dll 注意 [TARGETDIR] 生成的目录会有最后一个 \ 号。 更多 Windows Installer 使用技巧可以看 [...]]]></description>
			<content:encoded><![CDATA[<p>在用 Visual Studio 2005 建立生成安装文件的工程时，因为应用程序的需要，在安装的时候要求 <a href="http://msdn.microsoft.com/en-us/library/19x10e5c.aspx">Windows Installer</a> 把用户选择的安装路径写到<a href="http://msdn.microsoft.com/en-us/library/Aa371168">注册表</a>里。这个时候，有什么解决办法呢？</p>
<p>可以在生成安装文件的工程里，手动插入一个系统预留的<a href="http://blog.waterlin.org/articles/more-discussion-about-windows-registry.html">属性值（即需要转义的字符串）</a>，在 Windows Installer 安装程序的时候，会自动把这些属性值替换掉。可以用 <strong>[]</strong> 或 <strong>{}</strong> 来把该属性值括起来。</p>
<p>例如，右键点击&#8221;安装工程名称 ==&gt; 视图 ==&gt; 编辑器 ==&gt; 注册表&#8221;，这时，可以添加如下注册表项：</p>
<pre>
HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE\Software\[Manufacturer]\
</pre>
<p>这样，在 Windows Installer 安装程序的时候， <strong>[Manufacturer]</strong> 就会自动转义为实际的值。当然，如果没有对应的系统预留属性值，则转义为空值( blank )。</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa368609">系统预留的属性值有很多个</a>，例如对于安装目录来说，是 <strong>[TARGETDIR]</strong> ，即 <strong>[TARGETDIR]</strong> 会根据安装时用户选择的安装路径赋值。当你在<a href="http://blog.waterlin.org/articles/more-discussion-about-windows-registry.html">注册表</a>里，需要填写程序安装路径的时候，就可以用这个属性值来占位。Windows Installer 在安装的时候，自然会把它替换为实际路径。安装后，会显示为类似于下面的路径：</p>
<pre>
C:\Program Files\TestApp\TestAppFirstPart\
</pre>
<p>如果你需要在注册表里指定相应的可执行文件或动态链接库，比如说，你要在注册表里插入下面的路径：</p>
<pre>
C:\Program Files\TestApp\TestAppFirstPart\test.dll
</pre>
<p>这时，你就应该在工程里把属性值设为：</p>
<pre>
[TARGETDIR]test.dll
</pre>
<p>注意 <strong>[TARGETDIR]</strong> 生成的目录会有最后一个 <strong>\</strong> 号。</p>
<p>更多 Windows Installer 使用技巧可以看 <a href="http://robertdickau.com/msi_tips.html">Windows Installer (MSI) Tips and Notes</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.waterlin.org/articles/windows-installer-sets-installation-path-dynamicly.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs Muse 及 Org 开启文档锚链接的方法</title>
		<link>http://blog.waterlin.org/articles/using-anchor-link-in-emacs-muse-and-org-mode.html</link>
		<comments>http://blog.waterlin.org/articles/using-anchor-link-in-emacs-muse-and-org-mode.html#comments</comments>
		<pubDate>Wed, 11 Aug 2010 11:36:09 +0000</pubDate>
		<dc:creator>waterlin</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://blog.waterlin.org/articles/using-anchor-link-in-emacs-muse-and-org-mode.html</guid>
		<description><![CDATA[在用 Emacs Muse 或 Org 来写文档的时候，经常需要用到内部链接，尤其是要链接到某一章节，这个时候，启用固定的锚链接是最合适的方法。 Muse的锚链接 经常需要内部链接 Emacs Muse 写的文档，即链接一个锚链接，可以用下面的方法设置一个锚链接： #Open-Ubuntu-ssh 把上面这个语句放到文档的任意地方，然后，在 Muse 文档里直接用下面的方式即可生成锚链接： [[test.html#Open-Ubuntu-ssh][test anchor link]] 当然，如果你要链接其它文件的锚链接，则要加上相应的文件名。 Org Mode 的锚链接 Emacs Org Mode 也可以方便地实现文档内部的锚链接功能，与 Muse 类似，用下面的语句就可以生成相应的锚链接： # &#60;&#60;My Target&#62;&#62; 把上面这句话放到文档的任意地方，即可设置文档的锚连接。至于目标链接的形式，和普通链接一样。 对比 Org Mode 比 Muse Mode 设计得更好的地方在于：如果你没有用形如 # My Target 的方式来设置锚链接，并且你依然采用了锚链接的形式来生成一个链接，则 Org 会自动根据你文档的子标题关键字来寻找最接近的锚链接（当然，这个方法对中文标题来讲，会麻烦一些吧？）。]]></description>
			<content:encoded><![CDATA[<p>在用 Emacs Muse 或 Org 来写文档的时候，经常需要用到内部链接，尤其是要链接到某一章节，这个时候，启用固定的锚链接是最合适的方法。</p>
<div class="outline-3">
<h3 id="sec-1.1">Muse的锚链接</h3>
<div class="outline-text-3">
<p>经常需要内部链接 <a href="http://blog.waterlin.org/articles/emacs-muse-tags-interpret.html">Emacs Muse</a> 写的文档，即链接一个锚链接，可以用<a href="http://mwolson.org/projects/MuseQuickStart.html#sec15">下面的方法</a>设置一个锚链接：</p>
<pre>
#Open-Ubuntu-ssh
</pre>
<p>把上面这个语句放到文档的任意地方，然后，在 Muse 文档里直接用下面的方式即可生成锚链接：</p>
<pre>
[[test.html#Open-Ubuntu-ssh][test anchor link]]
</pre>
<p>当然，如果你要链接其它文件的锚链接，则要加上相应的文件名。</p>
</p></div>
</p></div>
<div class="outline-3">
<h3 id="sec-1.2">Org Mode 的锚链接</h3>
<div class="outline-text-3">
<p><a href="http://blog.waterlin.org/articles/publish-org-files-to-html-project.html">Emacs Org Mode</a> 也可以方便地实现文档内部的锚链接功能，与 Muse 类似，用<a href="http://orgmode.org/org.html#Internal-links">下面的语句</a>就可以生成相应的锚链接：</p>
<pre>
# &lt;&lt;My Target&gt;&gt;
</pre>
<p>把上面这句话放到文档的任意地方，即可设置文档的锚连接。至于目标链接的形式，和普通链接一样。</p>
</p></div>
</p></div>
<div class="outline-3">
<h3 id="sec-1.3">对比</h3>
<div class="outline-text-3">
<p>Org Mode 比 Muse Mode 设计得更好的地方在于：如果你没有用形如 # <a class="target" name="My==Target">My Target</a> 的方式来设置锚链接，并且你依然采用了锚链接的形式来生成一个链接，则 Org 会自动根据你文档的子标题关键字来寻找最接近的锚链接（当然，这个方法对中文标题来讲，会麻烦一些吧？）。</p>
</p></div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.waterlin.org/articles/using-anchor-link-in-emacs-muse-and-org-mode.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>今天被 Org Mode 折磨了</title>
		<link>http://blog.waterlin.org/articles/being-crazy-by-org-mode-today.html</link>
		<comments>http://blog.waterlin.org/articles/being-crazy-by-org-mode-today.html#comments</comments>
		<pubDate>Tue, 27 Jul 2010 12:32:57 +0000</pubDate>
		<dc:creator>waterlin</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[生活]]></category>

		<guid isPermaLink="false">http://blog.waterlin.org/articles/being-crazy-by-org-mode-today.html</guid>
		<description><![CDATA[今天在写《Emacs Org Mode 与 BibTeX 的结合》这篇笔记的时候，有一段如下的东西要放到文章里： #+TODO: TODO(t) STARTED(s) &#124; DONE(d) DEFERRED(f) REFTEX 结果我忘记在前面空格，导致我一用 C-c C-t 来设置 Org 笔记状态的时候，Emacs 只显示上面这几种状态。 害得我把今天在 .emacs 里新加的设置全部取消来找原因，折腾了很久，无果。最后碰巧发现是这句的问题，真是郁闷死了！ 所以，以后用 Org Mode 写东西，注意放在 block 里的内容，最好都空格而不是顶格写。]]></description>
			<content:encoded><![CDATA[<p>今天在写<a href="http://blog.waterlin.org/articles/bind-emacs-org-mode-with-bibtex.html">《Emacs Org Mode 与 BibTeX 的结合》</a>这篇笔记的时候，有一段如下的东西要放到文章里：</p>
<pre>
#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
</pre>
<p>结果我忘记在前面空格，导致我一用 C-c C-t 来设置 Org 笔记状态的时候，Emacs 只显示上面这几种状态。</p>
<p>害得我把今天在 .emacs 里新加的设置全部取消来找原因，折腾了很久，无果。最后碰巧发现是这句的问题，真是郁闷死了！</p>
<p>所以，以后用 Org Mode 写东西，注意放在 block 里的内容，最好都空格而不是顶格写。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.waterlin.org/articles/being-crazy-by-org-mode-today.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>设置 Emacs Desktop 的存储路径</title>
		<link>http://blog.waterlin.org/articles/use-different-emacs-desktop-between-computers.html</link>
		<comments>http://blog.waterlin.org/articles/use-different-emacs-desktop-between-computers.html#comments</comments>
		<pubDate>Tue, 27 Jul 2010 12:09:18 +0000</pubDate>
		<dc:creator>waterlin</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://blog.waterlin.org/articles/use-different-emacs-desktop-between-computers.html</guid>
		<description><![CDATA[我在多台电脑上使用 Emacs，同时也开启了 Desktop 功能，可是我并不想让所有电脑的 .emacs.desktop 存储的是同一批文件，这样我可以在不同的电脑上有针对性地干不同的事情。因此，我琢磨着，怎么在用 Dropbox 同步 Emacs 文件的时候，并不同步 .emacs.desktop 文件。 总的来说，可以有几种方法来设置这个 .emacs.desktop 的相关信息： 自动化配置 通过使用命令 M-x customize-group RET desktop 可以配置 desktop 的相关属性，即打开 desktop 组的设置选项进行相关设置。 可以通过下面的代码来进行相关的设置 (setq desktop-path '("~/.emacs.d/")) (setq desktop-dirname "~/.emacs.d/") (setq desktop-base-file-name ".emacs-desktop") 因为我用 Dropbox 在多台电脑里同步 Emacs 配置文件，所以采用的是第2种方法，这样各台机的配置就不会相互影响了。如果你需要针对不同的机器设置不同的参数，可以参考多台电脑间同步 Emacs 配置文件的方法，针对不同的机器使用不同的参数进行配置；如果设置项太多，还可以写成一个函数重复调用。]]></description>
			<content:encoded><![CDATA[<p>我在多台电脑上使用 Emacs，同时也<a href="http://blog.waterlin.org/articles/让emacs自动打开本次退出时已经打开的文件.html">开启了 Desktop 功能</a>，可是我并不想让所有电脑的 .emacs.desktop 存储的是同一批文件，这样我可以在不同的电脑上有针对性地干不同的事情。因此，我琢磨着，怎么在用 Dropbox 同步 Emacs 文件的时候，并不同步 .emacs.desktop 文件。</p>
<p>总的来说，可以有几种方法来设置这个 .emacs.desktop 的相关信息：</p>
<ol>
<li>自动化配置
<p>通过使用命令 <strong>M-x customize-group RET desktop</strong> 可以配置 desktop 的相关属性，即打开 desktop 组的设置选项进行相关设置。</p>
</li>
<li>可以通过<a href="http://www.emacswiki.org/emacs/DeskTop">下面的代码</a>来进行相关的设置</li>
</ol>
<pre>
(setq desktop-path '(<span>"~/.emacs.d/"</span>))
(setq desktop-dirname <span>"~/.emacs.d/"</span>)
(setq desktop-base-file-name <span>".emacs-desktop"</span>)
</pre>
<p>因为我<a href="http://blog.waterlin.org/articles/using-dropbox-to-sync-emacs-notes.html">用 Dropbox 在多台电脑里同步 Emacs 配置文件</a>，所以采用的是第2种方法，这样各台机的配置就不会相互影响了。如果你需要针对不同的机器设置不同的参数，可以参考<a href="http://blog.waterlin.org/articles/how-to-sync-emacs-configure-files.html">多台电脑间同步 Emacs 配置文件</a>的方法，针对不同的机器使用不同的参数进行配置；如果设置项太多，还可以写成一个函数重复调用。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.waterlin.org/articles/use-different-emacs-desktop-between-computers.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs Org Mode 与 BibTeX 的结合</title>
		<link>http://blog.waterlin.org/articles/bind-emacs-org-mode-with-bibtex.html</link>
		<comments>http://blog.waterlin.org/articles/bind-emacs-org-mode-with-bibtex.html#comments</comments>
		<pubDate>Tue, 27 Jul 2010 11:50:25 +0000</pubDate>
		<dc:creator>waterlin</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://blog.waterlin.org/articles/bind-emacs-org-mode-with-bibtex.html</guid>
		<description><![CDATA[Emacs Org Mode 可以是一个优秀的笔记工具，可是，如果你想用它来写正式一点的论文，可以吗？当然可以了，你可以把 Org Mode 和 LaTeX 结合起来用，当然最重要的是要解决参考文献引用的问题。 整体的思路如下： 先准备好你的 BibTeX 文件 可以用 Emacs BibTeX Mode 或 JabRef 之类的方式来生成这个文件，当然也可以用其它文献管理工具，只要它能导出 BibTeX 文件即可。 用 Emacs Org 建立工程并记笔记 创建 Org 工程的时候，和一般的工程没有任何区别。 用 RefTeX 方式来插入 BibTeX 的记录 在这里，重点介绍一下第三个步骤，即如何在 Org Mode 里插入 BibTeX 记录。从官方的这篇参考文献里可以看出，我们可以用三种方法在 org 文件里引用 BibTeX 参考文献，从而插入 LaTeX 类的参考文献。 1). 最简单的办法，给所有的 Org 文件指定一个 BibTeX 文件，然后在 Org 文件里插入该 BibTeX [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.waterlin.org/articles/publish-org-files-to-html-project.html">Emacs Org Mode 可以是一个优秀的笔记工具</a>，可是，如果你想用它来写正式一点的论文，可以吗？当然可以了，你可以<a href="http://orgmode.org/worg/org-contrib/babel/languages/org-babel-doc-LaTeX.php">把 Org Mode 和 LaTeX 结合起来用</a>，当然最重要的是要解决参考文献引用的问题。</p>
<p>整体的思路如下：</p>
<ol>
<li>先准备好你的 BibTeX 文件
<p>可以用 Emacs BibTeX Mode 或 JabRef 之类的方式来生成这个文件，当然也可以用其它文献管理工具，只要它能导出 BibTeX 文件即可。</p>
</li>
<li>用 Emacs Org 建立工程并记笔记
<p><a href="http://blog.waterlin.org/articles/publish-org-files-to-html-project.html">创建 Org 工程</a>的时候，和一般的工程没有任何区别。</p>
</li>
<li>用 RefTeX 方式来插入 BibTeX 的记录</li>
</ol>
<p>在这里，重点介绍一下第三个步骤，即如何在 Org Mode 里插入 BibTeX 记录。从官方的<a href="http://orgmode.org/worg/org-faq.php#sec-18_11_1">这篇参考文献</a>里可以看出，我们可以用三种方法在 org 文件里引用 BibTeX 参考文献，从而插入 LaTeX 类的参考文献。</p>
<p>1). 最简单的办法，给所有的 Org 文件指定一个 BibTeX 文件，然后在 Org 文件里插入该 BibTeX 文件的参考文献记录</p>
<p>具体的办法，先把下面的代码放到 .emacs 里：</p>
<pre>
(setq reftex-default-bibliography
      (quote
       (<span>"default.bib"</span> <span>"~/org/notes/refer.bib"</span>)))
(define-key org-mode-map (kbd <span>"C-c )"</span>) 'reftex-citation)
</pre>
<p>在这里，我指定的 BibTeX 文件为 <strong>default.bib</strong> 和 <strong>~/org/notes/refer.bib</strong> 。然后，可以在所有的 Org 文件里，通过命令 <strong>C-c )</strong> 或 <strong>M-x reftex-citation</strong> 来进行参考文献的插入，根据提示进行相关操作即可。</p>
<p>2). 为特定的 Org 文件，指定特定的 BibTeX 文件</p>
<p>这个方法是 <a href="http://www.mfasold.net/blog/2009/02/using-emacs-org-mode-to-draft-papers/">Marios Braindump 的博客里介绍的</a>，具体方法如下：</p>
<p>先把下面的代码放到 .emacs 里：</p>
<pre>
(<span>defun</span> <span>org-mode-reftex-setup</span> ()
  (load-library <span>"reftex"</span>)
  (and (buffer-file-name)
       (file-exists-p (buffer-file-name))
       (reftex-parse-all))
  (define-key org-mode-map (kbd <span>"C-c )"</span>) 'reftex-citation))
(add-hook 'org-mode-hook 'org-mode-reftex-setup)
</pre>
<p>然后在你需要插入 BibTeX 参考文献的 Org 文件里，加入下面这段话（可以是任意位置）：</p>
<pre>
<span>\bibliographystyle</span>{plain}
<span>\bibliography</span>{<span>BIB-NAME</span>}
</pre>
<p>把上面的 BIB-NAME 换成你想指定的 BibTeX 文件，这样就可以对该 Org 文件指定特定的 BibTeX 文件，然后可以用 <strong>C-c )</strong> 或 <strong>M-x reftex-citation</strong> 来插入该 BibTeX 文件里的参考文献。</p>
<p>上面的代码会在 Emacs 启动的时候，要求你指定一个 master 文件，用来存储生成的 tex 文件。</p>
<p>3). 另外一种方法，实现为特定的 Org 文件指定特定 BibTeX 文件的功能</p>
<p>还有<a href="http://orgmode.org/worg/org-faq.php#sec-18_11_2">另外一种方法</a>，可以实现第2种方法类似的功能，即为特定 Org 文件指定特定 BibTeX 文件的方法。把下面的代码放到 .emacs 文件里：</p>
<pre>
(<span>defun</span> <span>org-mode-article-modes</span> ()
  (reftex-mode t)
  (and (buffer-file-name)
       (file-exists-p (buffer-file-name))
       (reftex-parse-all)))

(add-hook 'org-mode-hook
          (<span>lambda</span> ()
            (<span>if</span> (member <span>"REFTEX"</span> org-todo-keywords-1)
                (org-mode-article-modes))))
</pre>
<p>然后把下面这一行加到你需要插入 BibTeX 的 Org 文件的开头：</p>
<pre>
#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
</pre>
<p>其它步骤与第2种方法类似。这种方法我没有仔细测试，有兴趣的 Emacser 们可以试试。</p>
<p>通过以上方法，就可以在用 Org Mode 打造的笔记本里，很方便地索引 BibTeX 里的参考文献了。</p>
<p>当然，如果你不喜欢用 Org Mode，也有其它用 Emacs 来写论文的思路，例如：Emacs + AucTeX + RefTeX + Outline-minor-mode</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.waterlin.org/articles/bind-emacs-org-mode-with-bibtex.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>让 Emacs Org 直接显示图片的 iimage 模式</title>
		<link>http://blog.waterlin.org/articles/using-iimage-mode-to-show-images-in-emacs.html</link>
		<comments>http://blog.waterlin.org/articles/using-iimage-mode-to-show-images-in-emacs.html#comments</comments>
		<pubDate>Thu, 15 Jul 2010 05:25:51 +0000</pubDate>
		<dc:creator>waterlin</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://blog.waterlin.org/articles/using-iimage-mode-to-show-images-in-emacs.html</guid>
		<description><![CDATA[在 Emacs 里用 Org mode 来编辑，如果链接一张图片，只能显示图片的链接地址，并不能真正显示一张图片。 如果用 iimage 这个 minor mode，则可以使 Emacs 在编辑区里显示图片。下载 iimage.el 文件扔到 Emacs 的目录里，然后在 .emacs 里添加下面的代码： ;; iimage mode (autoload 'iimage-mode "iimage" "Support Inline image minor mode." t) (autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t) 然后就可以用命令 M-x iimage-mode RET 在当前模式里启动 iimage 这个 minor mode。 如果想在 Emacs org 模式里启用 iimage [...]]]></description>
			<content:encoded><![CDATA[<p>在 Emacs 里用 Org mode 来编辑，如果链接一张图片，只能显示图片的链接地址，并不能真正显示一张图片。</p>
<p>如果用 <a href="http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html">iimage</a> 这个 minor mode，则可以使 Emacs 在编辑区里显示图片。下载 <a href="http://www.netlaputa.ne.jp/~kose/Emacs/lisp/iimage.el">iimage.el</a> 文件扔到 Emacs 的目录里，然后在 .emacs 里添加下面的代码：</p>
<pre>
<span>;; </span><span>iimage mode
</span>(autoload 'iimage-mode <span>"iimage"</span> <span>"Support Inline image minor mode."</span> t)
(autoload 'turn-on-iimage-mode <span>"iimage"</span> <span>"Turn on Inline image minor mode."</span> t)
</pre>
<p>然后就可以用命令</p>
<pre>
M-x iimage-mode RET
</pre>
<p>在当前模式里启动 iimage 这个 minor mode。</p>
<p>如果想<a href="http://orgmode.org/worg/org-configs/org-config-examples.php">在 Emacs org 模式里启用 iimage 模式</a>，把下面的代码放到配置文件里，则可以在 Emacs Org 的编辑区里显示图片。</p>
<pre>
(<span>defun</span> <span>org-toggle-iimage-in-org</span> ()
  <span>"display images in your org file"</span>
  (interactive)
  (<span>if</span> (face-underline-p 'org-link)
      (set-face-underline-p 'org-link nil)
      (set-face-underline-p 'org-link t))
  (iimage-mode))
</pre>
<p>以后要写图文并茂的笔记就方便多了，不用发布后再浏览图片在文章里的效果了。</p>
<p>可以用 <strong>M-x org-toggle-iimage-in-org</strong> 或 <strong>M-x iimage-mode</strong> 命令来激活 iimage 模式，类似以下这些链接形式会直接显示为图片：</p>
<pre>
file://foo.png
`file://foo.png'
[[foo.gif]]
‹foo.png›
`foo.JPG'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.waterlin.org/articles/using-iimage-mode-to-show-images-in-emacs.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>用 Visual Studio 2005 做移动开发需要注意版本问题</title>
		<link>http://blog.waterlin.org/articles/pay-attention-to-visual-studio-2005-edition-about-mobile-development.html</link>
		<comments>http://blog.waterlin.org/articles/pay-attention-to-visual-studio-2005-edition-about-mobile-development.html#comments</comments>
		<pubDate>Thu, 24 Jun 2010 10:31:34 +0000</pubDate>
		<dc:creator>waterlin</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.waterlin.org/articles/pay-attention-to-visual-studio-2005-edition-about-mobile-development.html</guid>
		<description><![CDATA[最近一直在做 Windows Mobile 的移动开发，重装系统后，用 Visual Studio 2005 死活没有办法新建工程。 仔细地找了找答案，原来需要打上 Visual Studio 2005 SP1 的补丁才行！ 另外，做 M8 的开发，也需要用上 Visual Studio 2005 SP1 才行，否则连 Samples 都编译不过。]]></description>
			<content:encoded><![CDATA[<p>最近一直在做 Windows Mobile 的移动开发，重装系统后，用 Visual Studio 2005 死活没有办法新建工程。</p>
<p>仔细地找了找答案，原来需要打上 Visual Studio 2005 SP1 的补丁才行！</p>
<p>另外，做 M8 的开发，也需要用上 Visual Studio 2005 SP1 才行，否则连 Samples 都编译不过。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.waterlin.org/articles/pay-attention-to-visual-studio-2005-edition-about-mobile-development.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>不知道为什么，Emacs 里用 Gpg4Win 不好使</title>
		<link>http://blog.waterlin.org/articles/why-can-not-use-gpg4win-in-emacs-minibuffer.html</link>
		<comments>http://blog.waterlin.org/articles/why-can-not-use-gpg4win-in-emacs-minibuffer.html#comments</comments>
		<pubDate>Thu, 24 Jun 2010 10:28:04 +0000</pubDate>
		<dc:creator>waterlin</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://blog.waterlin.org/articles/why-can-not-use-gpg4win-in-emacs-minibuffer.html</guid>
		<description><![CDATA[在我的 Windows 系统下，用 Gpg4Win 来作为 Emacs EasyPG 文件加密解密的工具，可是每次用 EasyPG 打开加密的文件时，都会弹出一个对话框来让我输 Key。 弹出对话框来倒也无所谓，很要命的是，在这个对话框里，没有办法输入 Key。每每要用加密文件的关键时刻，我都不知所措，想尽办法重启电脑之类的来解决该问题。 今天一怒之下，改用 Cygwin 里的 GnuPG 了，现在 EasyPG 的表现和 Linux 下终于一样了，在 MiniBuffer 里输 Key 即可。 有人知道这是什么问题吗？是我哪里配置得有问题吗？]]></description>
			<content:encoded><![CDATA[<p>在我的 Windows 系统下，<a href="http://blog.waterlin.org/articles/using-easypg-in-emacs-under-windows.html">用 Gpg4Win 来作为 Emacs EasyPG 文件加密解密的工具</a>，可是每次<a href="http://blog.waterlin.org/articles/using-emacs-to-encry-file.html">用 EasyPG 打开加密的文件</a>时，都会弹出一个对话框来让我输 Key。</p>
<p>弹出对话框来倒也无所谓，很要命的是，在这个对话框里，没有办法输入 Key。每每要用加密文件的关键时刻，我都不知所措，想尽办法重启电脑之类的来解决该问题。</p>
<p>今天一怒之下，改用 Cygwin 里的 GnuPG 了，现在 EasyPG 的表现和 Linux 下终于一样了，在 MiniBuffer 里输 Key 即可。</p>
<p>有人知道这是什么问题吗？是我哪里配置得有问题吗？</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.waterlin.org/articles/why-can-not-use-gpg4win-in-emacs-minibuffer.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
