Skip to content

Commit

Permalink
2013-08-23 新增博文:第三篇
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyjiang committed Oct 7, 2015
1 parent 0f5d4d8 commit 0b3c86d
Show file tree
Hide file tree
Showing 34 changed files with 815 additions and 127 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified _includes/.DS_Store
Binary file not shown.
Binary file modified _includes/themes/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion _plugins/debug.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def debug(obj, stdout=false)
end # DebugFilter
end # Jekyll

Liquid::Template.register_filter(Jekyll::DebugFilter)
Liquid::Template.register_filter(Jekyll::DebugFilter)
Binary file modified _posts/.DS_Store
Binary file not shown.
62 changes: 62 additions & 0 deletions _posts/2014-08-23-emacs-org-mode-time-stamp-language.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
layout: post
title: Emacs Org mode 时间戳 (Time Stamp) 设置为中文的方法
categories: [技术]
tags: [Emacs, Org mode]
icon: code
---
<h1>Emacs和Org mode介绍</h1>
<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
先简要介绍一下Emacs和Org mode。Emacs可以算是GNU(关于GNU,可以参考其<a href="http://www.gnu.org/" target="_blank">官网介绍</a> )社区王牌性的作品。简单来说,它是一个文本编辑器,但由于其可定制性极强,使用者可以依据自己的喜好将它“改装”成各种样子。也正是由于其自由度极高,一句经典的调侃是
</p>

<blockquote>
Emacs is anything but an editor.
</blockquote>

<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
此外,由于<a href="www.vim.org" target="_blank">Vim</a>也是十分强大的编辑器,二者之间的圣战也是程序员们津津乐道的话题,可以参考 <a href="http://en.wikipedia.org/wiki/Editor_war" target="_blank">Wiki: Editor War</a>
</p>

<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
<a href="orgmode.org" target="_blank">Org mode</a>是以Emacs中的Outline Mode为基础进行扩展后的强大模式,利用Org mode可以方便地按照大纲方式组织文本。因此Org mode非常适合于写作长文章或其他组织性较强的工作,此外它也有其他一些应用,例如可以作为GTD工具(详见<a href="http://doc.norang.ca/org-mode.html#ChangeHistory" target="_blank">Org Mode - Organize Your Life In Plain Text!</a>)等。
</p>

<h1>Emacs Org mode中的时间戳</h1>
<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
Org mode中有一个功能,就是插入时间戳(time stamp),可以参考<a href="http://orgmode.org/manual/Timestamps.html#Timestamps" target="_blank">The Org Manual 8.1 Timestamps</a>,PDF版本可以从<a href="http://orgmode.org/org.pdf" target="_blank">这里</a>下载。正常情况下,Org mode中默认的时间戳是英文的,如下图所示(最下面一行的Saturday):
</p>

<img class = "center" src="{{site.url}}/image/2014-08/org mode time stamp.png" width="800px"/>

<h1>系统环境及解决方案</h1>
<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
系统环境Mac OS 10.9.4,Emacs版本(<a href="http://emacsformacosx.com/" target="_blank">Emacs for Mac OS X</a>)24.3。现在我想实现的是将Org mode中的时间戳最后的Saturday由英文改为中文。在网上看到一篇文章很受启发:<a href="http://blog.aizhet.com/Windows/3941.html" target="_blank">org-mode里时间戳显示语言的问题</a>。但该文章叙述的是如何从中文改成英文,而我是要反其道而行之。借鉴他文章中的思路,在Emacs的启动配置文件(.emacs或.emacs.d/init.el)中添加如下代码:
</p>

{% highlight lisp %}

(set-locale-environment "zh_CN.utf-8")

{% endhighlight %}

<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
添加上述代码之后再在Org mode中插入的时间戳即为中文。但我的Mac系统上还有个问题,例如星期一的缩写应为周一,但我的系统上显示的是一。在Windows下利用cygwin安装的Emacs就没有这个问题,怀疑是Mac系统设置的问题。好在Org mode中还提供了自定义时间戳格式的设置,只能暂时先用全称代替缩写了。在Emacs的启动配置文件(.emacs或.emacs.d/init.el)中添加如下代码:
</p>

{% highlight lisp %}

(setq-default org-display-custom-times t)
(setq org-time-stamp-custom-formats '("<%Y-%m-%d %A>" . "<%Y-%m-%d %A %H:%M>"))

{% endhighlight %}

<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
其中的%A代替了默认设置中的%a,即为星期几(weekday)的全称。有关时间戳格式更详细的介绍可以参考 <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Parsing.html#Time-Parsing" target="_blank">GNU Emacs Lisp Reference Manual 39.7 Parsing and Formatting Times</a>,PDF版本可以从<a href="https://www.gnu.org/software/emacs/manual/pdf/elisp.pdf" target="_blank">这里</a>下载。
</p>

<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
最后补上一张设置好之后的图:
</p>

<img class="center" src="{{site.url}}/image/2014-08/time stamp Chinese.png"/ width="800px">
8 changes: 8 additions & 0 deletions _posts/2014-08-27-CA-information.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: post
title: 国航相关信息汇总
categories: [生活]
tags: [博士, 国航]
icon: leaf
---
<h1>国航常旅客计划</h1>
2 changes: 1 addition & 1 deletion _site/2014/08/15/first-post/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ <h1>致谢</h1>



<li><a href="/posts.html#Emacs">Emacs <span>1</span></a></li>
<li><a href="/posts.html#Emacs">Emacs <span>2</span></a></li>

<li><a href="/posts.html#org-mode">org-mode <span>1</span></a></li>

Expand Down
4 changes: 2 additions & 2 deletions _site/2014/08/16/pt-share/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ <h1>初识PT</h1>

<h1>三大PT</h1>
<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
虽然六维的资源非常全,在校内下载速度也很快(一般是几M/s),但六维还是有一些限制的
虽然六维的资源非常全,在校内下载速度也很快(一般是几M/s),但六维还是存在以下限制
</p>

<ul>
Expand Down Expand Up @@ -174,7 +174,7 @@ <h1>三大PT</h1>

<li><a href="/posts.html">索引</a></li>

<li class="next disabled"><a>后一篇 &rarr;</a>
<li class="next"><a href="/2014/08/23/emacs-org-mode-time-stamp-language" title="Emacs Org mode 时间戳 (Time Stamp) 设置为中文的方法">后一篇 &rarr;</a></li>

</ul>
<br />
Expand Down
250 changes: 250 additions & 0 deletions _site/2014/08/23/emacs-org-mode-time-stamp-language/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@


<!DOCTYPE html>
<html lang="cn">
<head>
<meta charset="utf-8">
<title>Emacs Org mode 时间戳 (Time Stamp) 设置为中文的方法</title>


<meta name="author" content="Tommy">

<!-- Enable responsive viewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<!-- Le styles -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href="/css/typo.css" rel="stylesheet">
<link href="/css/solarized.css" rel="stylesheet" type="text/css" media="all">
<link href="/css/datatables-bootstrap.css" rel="stylesheet">
<link href="/css/codepiano.css" rel="stylesheet">

<!-- javascript files -->
<script type="text/javascript" src="/js/jquery-2.0.0.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/js/datatables-bootstrap.js"></script>
<script type="text/javascript" src="/js/codepiano.js"></script>

<!-- Le fav and touch icons -->
<!-- Update these with your own images
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
-->

<!-- atom & rss feed -->
<link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed">
<link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed">

<script type="text/javascript">
</script>

</head>

<body id="scroll-pane" data-spy="scroll" data-target="#time-list-nav">
<div class="wrapper">
<!-- 导航条 -->
<div class="nav navbar-nav" id="nav-wrap">
<div class="navbar-header">
<div class="col-md-2">
</div>
<div class="col-md-8">
<a class="navbar-brand" href="/">
<span class="site-author"> Tommy </span>
<span class="site-title"> /* 电力引领生活 */ </span>
</a>
<ul id="nav-menu" class="nav navbar-nav">








<li class="posts"><a href="/posts.html">文章</a></li>
<li class="timeline"><a href="/timeline.html">归档</a></li>
<li class="categories"><a href="/categories.html">目录</a></li>
<li class="about"><a href="/about.html">关于</a></li>

</ul>
</div>
<div class="col-md-2">
</div>
</div>
</div>

<!-- 正文 -->


<div class="row post-full typo">
<div class="col-md-2"></div>
<div class="col-md-8 typo">
<h2>Emacs Org mode 时间戳 (Time Stamp) 设置为中文的方法 </h2>
<div class="post_info">

<ul id="post_info" class="tag_box inline">
<li><i class="fa fa-calendar"></i></li>
<li> 2014 年 08 月 23 日</li>
<li><i class="fa fa-folder-open"></i></li>



<li>
<a href="/categories.html#技术-ref">
技术
</a>
</li>




</ul>

</div>
<div class="content">
<h1>Emacs和Org mode介绍</h1>
<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
先简要介绍一下Emacs和Org mode。Emacs可以算是GNU(关于GNU,可以参考其<a href="http://www.gnu.org/" target="_blank">官网介绍</a> )社区王牌性的作品。简单来说,它是一个文本编辑器,但由于其可定制性极强,使用者可以依据自己的喜好将它“改装”成各种样子。也正是由于其自由度极高,一句经典的调侃是
</p>

<blockquote>
Emacs is anything but an editor.
</blockquote>

<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
此外,由于<a href="www.vim.org" target="_blank">Vim</a>也是十分强大的编辑器,二者之间的圣战也是程序员们津津乐道的话题,可以参考 <a href="http://en.wikipedia.org/wiki/Editor_war" target="_blank">Wiki: Editor War</a>
</p>

<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
<a href="orgmode.org" target="_blank">Org mode</a>是以Emacs中的Outline Mode为基础进行扩展后的强大模式,利用Org mode可以方便地按照大纲方式组织文本。因此Org mode非常适合于写作长文章或其他组织性较强的工作,此外它也有其他一些应用,例如可以作为GTD工具(详见<a href="http://doc.norang.ca/org-mode.html#ChangeHistory" target="_blank">Org Mode - Organize Your Life In Plain Text!</a>)等。
</p>

<h1>Emacs Org mode中的时间戳</h1>
<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
Org mode中有一个功能,就是插入时间戳(time stamp),可以参考<a href="http://orgmode.org/manual/Timestamps.html#Timestamps" target="_blank">The Org Manual 8.1 Timestamps</a>,PDF版本可以从<a href="http://orgmode.org/org.pdf" target="_blank">这里</a>下载。正常情况下,Org mode中默认的时间戳是英文的,如下图所示(最下面一行的Saturday):
</p>

<img class = "center" src="/image/2014-08/org mode time stamp.png" width="800px"/>

<h1>系统环境及解决方案</h1>
<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
系统环境Mac OS 10.9.4,Emacs版本(<a href="http://emacsformacosx.com/" target="_blank">Emacs for Mac OS X</a>)24.3。现在我想实现的是将Org mode中的时间戳最后的Saturday由英文改为中文。在网上看到一篇文章很受启发:<a href="http://blog.aizhet.com/Windows/3941.html" target="_blank">org-mode里时间戳显示语言的问题</a>。但该文章叙述的是如何从中文改成英文,而我是要反其道而行之。借鉴他文章中的思路,在Emacs的启动配置文件(.emacs或.emacs.d/init.el)中添加如下代码:
</p>

<div class="highlight"><pre><code class="language-lisp" data-lang="lisp"><span class="p">(</span><span class="nv">set-locale-environment</span> <span class="s">&quot;zh_CN.utf-8&quot;</span><span class="p">)</span></code></pre></div>

<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
添加上述代码之后再在Org mode中插入的时间戳即为中文。但我的Mac系统上还有个问题,例如星期一的缩写应为周一,但我的系统上显示的是一。在Windows下利用cygwin安装的Emacs就没有这个问题,怀疑是Mac系统设置的问题。好在Org mode中还提供了自定义时间戳格式的设置,只能暂时先用全称代替缩写了。在Emacs的启动配置文件(.emacs或.emacs.d/init.el)中添加如下代码:
</p>

<div class="highlight"><pre><code class="language-lisp" data-lang="lisp"><span class="p">(</span><span class="nv">setq-default</span> <span class="nv">org-display-custom-times</span> <span class="no">t</span><span class="p">)</span>
<span class="p">(</span><span class="k">setq</span> <span class="nv">org-time-stamp-custom-formats</span> <span class="o">&#39;</span><span class="p">(</span><span class="s">&quot;&lt;%Y-%m-%d %A&gt;&quot;</span> <span class="o">.</span> <span class="s">&quot;&lt;%Y-%m-%d %A %H:%M&gt;&quot;</span><span class="p">))</span></code></pre></div>

<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
其中的%A代替了默认设置中的%a,即为星期几(weekday)的全称。有关时间戳格式更详细的介绍可以参考 <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Parsing.html#Time-Parsing" target="_blank">GNU Emacs Lisp Reference Manual 39.7 Parsing and Formatting Times</a>,PDF版本可以从<a href="https://www.gnu.org/software/emacs/manual/pdf/elisp.pdf" target="_blank">这里</a>下载。
</p>

<p class="paragraph" style="text-align:justify; text-justify:inter-ideograph;">
最后补上一张设置好之后的图:
</p>

<img class="center" src="/image/2014-08/time stamp Chinese.png"/ width="800px">

</div>


<ul id="tag_info" class="tag_box inline">
<li><i class="fa fa-tags"></i></li>



<li><a href="/posts.html#Emacs">Emacs <span>2</span></a></li>

<li><a href="/posts.html#Org mode">Org mode <span>1</span></a></li>




</ul>


<hr>
<ul class="pagination pull-right">

<li class="prev"><a href="/2014/08/16/pt-share" title="我与PT">&larr; 前一篇</a></li>

<li><a href="/posts.html">索引</a></li>

<li class="next disabled"><a>后一篇 &rarr;</a>

</ul>
<br />
<div id="comment-hook"></div>



<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="Emacs Org mode 时间戳 (Time Stamp) 设置为中文的方法" data-title="Emacs Org mode 时间戳 (Time Stamp) 设置为中文的方法" data-url="page.url"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"tommyjiang"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- 多说公共JS代码 end -->





</div>
<div class="col-md-2"></div>
</div>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {equationNumbers: {autoNumber: ["AMS"], useLabelIds: true}},
"HTML-CSS": {linebreaks: {automatic: true}},
SVG: {linebreaks: {automatic: true}}
});
</script>




</div>
<!-- 底部声明 -->
<div class="row bottom">
<div class="col-md-2">
</div>
<div class="col-md-8 text-center">
&mdash;&nbsp;&nbsp;<a href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.zh" class="license">原创作品许可 &mdash; 署名-非商业性使用-禁止演绎 3.0 未本地化版本 &mdash; CC BY-NC-ND 3.0 </a>&nbsp;&nbsp;&mdash;
</div>
<div class="col-md-2">
</div>
</div>



</body>
</html>

Binary file removed _site/assets/partitionNew.jpg
Binary file not shown.
Loading

0 comments on commit 0b3c86d

Please sign in to comment.