xemacs kill-matching-buffers或sort / filter * buffer list *

时间:2012-10-22 16:25:52

标签: xemacs

在xemacs中,如何杀死匹配特定模式的缓冲区?我试过了 “kill-matching-buffers”,但我的xemacs似乎没有 那。我需要加载/ eval-buffer来获取这个.el / .elc文件 功能?

我还想找到一种方法来过滤缓冲列表,这样我就可以 只看到我想删除的缓冲区,或者让它们彼此相邻 通过排序。

1 个答案:

答案 0 :(得分:1)

kill-matching-buffers代码如下。您应该能够以最小的努力使其与XEmacs一起使用。

(defun kill-matching-buffers (regexp &optional internal-too)
  "Kill buffers whose name matches the specified REGEXP.
The optional second argument indicates whether to kill internal buffers too."
  (interactive "sKill buffers matching this regular expression: \nP")
  (dolist (buffer (buffer-list))
    (let ((name (buffer-name buffer)))
      (when (and name (not (string-equal name ""))
                 (or internal-too (/= (aref name 0) ?\s))
                 (string-match regexp name))
        (kill-buffer-ask buffer)))))

如果您需要dolist的定义(不知道它是否是XEmacs),请检查cl-macs.el