emacs 23.1 released
http://article.gmane.org/gmane.org.fsf.announce/1129
From: Chong Yidong <cyd <at> stupidchicken.com>
Subject: Emacs 23.1 released
Newsgroups: gmane.org.fsf.announce
Date: 2009-07-30 03:01:22 GMT (5 days, 4 hours and 4 minutes ago)
在我从大连回北京的路上悄悄发布了,恩…… 刚拜读了下 NEWS,看来又可以消灭许多额外的 elisp 包,函数等等了。偶的读书笔记:
1. *** The Emacs character set is now a superset of Unicode. (It has about four times the code space, which should be plenty).
The internal encoding used for buffers and strings is now Unicode-based and called `utf-8-emacs' (`emacs-internal' is an alias for this). This encoding is backward-compatible with Unicode's UTF-8 encoding. The internal encoding previously used by Emacs, `emacs-mule', is still available for reading and writing files.
During byte-compilation, Emacs 23 uses `utf-8-emacs' to write files. As a result, byte-compiled files containing non-ASCII characters can't be read by earlier versions of Emacs. Files compiled by Emacs 20, 21, or 22 are loaded correctly as `emacs-mule' (whether or not they contain multibyte characters). This takes somewhat more time, so it may be worth recompiling existing .elc files which don't need to be shared with older Emacsen.
竟然搞了个 utf-8 的 superset(超集?) -- "utf-8-emacs"。难怪我前阵子发现 emms 有些乱码用 utf-8 都保存不了,用 utf-8-emacs 倒是可以。莫非以后 prefer-coding-system 要从 utf-8 改成 utf-8-emacs?FIXME
2. *** There are new language environments for Chinese-GBK, Chinese-GB18030, Khmer, Bengali, Punjabi, Gujarati, Oriya, Telugu, Sinhala, and TaiViet.
emacs 终于认识朱镕基总理的第 2 个字了。当然,你的字体里应该包含这个字哦。
3. *** Minibuffer input of shell commands now comes with completion.
赞!之前装过一个 shell-command.el --- enables tab-completion for `shell-command'可以扔掉了。
4. *** When enable-recursive-minibuffers is non-nil, operations which use switch-to-buffer (such as C-x b and C-x C-f) do not fail any more when used in a minibuffer or a dedicated window. Instead, they fallback on using pop-to-buffer, which will use some other window. This change has no effect when enable-recursive-minibuffers is nil (the default).
经常受困(如 M-x C-x o),但没想过去解决它。有了它,好多了。
5. *** New commands to change the default face size in the current buffer. To increase it, type `C-x C-+' or `C-x C-='. To decrease it, type `C-x C--'. To restore the default (global) face size, type `C-x C-0'. These work via Text Scale mode, a new minor mode.
The final key in the above commands may be repeated without the leading `C-x', e.g. `C-x C-= C-= C-=' increases the face height by three steps. Each step scales the height of the default face by the value of the variable `text-scale-mode-step'.
演示时会比较实用。
6. *** C-l is bound to the new command recenter-top-bottom, rather than recenter. This moves the current line to window center, top and bottom on successive invocations.
这个,看起来是个不错的主意,给我点时间适应一下。
7. ** proced.el provides a Dired-like interface for operating on processes. Proced makes an Emacs buffer containing a listing of the current processes. You can use the normal Emacs commands to move around in this buffer, and special Proced commands to operate on the processes listed. It is currently only functional on GNU/Linux, MS-Windows and Solaris.
不错!用得不多,得提醒自己常用。尚不支持 Mac,残念啊!
8. ** There is a new `whitespace' package. (The pre-existing one has been renamed to `old-whitespace'.) Now, besides reporting bogus blanks, the whitespace package has a minor mode and a global minor mode to visualize blanks (TAB, (HARD) SPACE and NEWLINE). The visualization is made via faces and/or display table. It can also indicate lines that extend beyond a given column, trailing blanks, and empty lines at the start or end of a buffer. See `whitespace-style' for more details. The `whitespace-action' option specifies what to do when a buffer is visited, killed, or written.
可以用不同显示效果区分出空格、tab、回车。看图:
whitespace-mode.png
9. *** `&' runs the command `dired-do-async-shell-command' that executes the command asynchronously without the need to manually add ampersand to the end of the command. Its output appears in the buffer `*Async Shell Command*'.
好!
10. *** `M-s f C-s' and `M-s f M-C-s' run Isearch that matches only at file names. When a new user option `dired-isearch-filenames' is t, then even ordinary Isearch started with `C-s' and `C-M-s' matches only at file names in the Dired buffer. When `dired-isearch-filenames' is `dwim' then activation of file name Isearch depends on the position of point - if point is on a file name initially, then Isearch matches only file names, otherwise it matches everywhere in the Dired buffer. You can toggle file names matching on or off by typing `M-s f' in Isearch mode.
我写的 dired-isearch.el 可以扔掉了…… 主意应该是我头一个想到并实现的吧,emacs-devel上讨论了几回没下文,不知他们什么时候背着我偷偷实现了(当然实现方法不一样)…… =,=
11. *** VC now supports applying VC operations to a set of files at a time. This enables VC to work much more effectively with changeset-oriented version-control systems such as Subversion, GNU Arch, Mercurial, Git and Bzr. VC will now pass a multiple-file commit to these systems as a single changeset.
等你很久了!
12. *** A new command `display-time-world' has been added to the Time package. It creates a buffer with an updating time display using several time zones.
曾经想过写一个,从没下手写过。这下省了。
13. *** `apply-partially' performs a "curried" application of a function.
currying function!
14. ** Emacs session information
*** The new variables `before-init-time' and `after-init-time' record the value of `current-time' before and after Emacs loads the init files.
*** The new function `emacs-uptime' returns the uptime of an Emacs instance.
*** The new function `emacs-init-time' returns the duration of the Emacs initialization.
又和我英雄略同了。我老早前写的可以扔了:
(defvar xwl-emacs-start-time (current-time))
(defun xwl-emacs-uptime ()
(interactive)
(let* ((diff (time-subtract (current-time) xwl-emacs-start-time))
(str (format "Emacs started at %s, more than %d days(= %.2f hours) ago"
(format-time-string "%Y/%m/%d %H:%M:%S" xwl-emacs-start-time)
(time-to-number-of-days diff)
(/ (time-to-seconds diff) 3600.0))))
(message str)))
总结:看起来挺美!对 Mac 的支持差了点,写 22 的那个 Andrew 大哥别跟 RMS 较真就好了。另外现在单位不让使用自己本本,上网又要代理,又是 XP 系统,玩起 Emacs 还是颇有不便。祝 Emacs 英明神武、一统江湖!





Comments [0]