aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Antipov2012-07-20 08:13:04 +0400
committerDmitry Antipov2012-07-20 08:13:04 +0400
commit89dea803ea4293eb8d14b87067d1e3eebdcbd180 (patch)
treeb7b69d2de44b308bd792d634e5e0098bec274182
parent52b852c77d74800aaa1338dc72f786f7e261bfee (diff)
downloademacs-89dea803ea4293eb8d14b87067d1e3eebdcbd180.tar.gz
emacs-89dea803ea4293eb8d14b87067d1e3eebdcbd180.zip
Drop idle buffer compaction due to an absence of the
proved efficiency. * lisp/compact.el: Remove.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/compact.el60
2 files changed, 6 insertions, 60 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3216afa3e4c..f2b89c086dd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Drop idle buffer compaction due to an absence of the
4 proved efficiency.
5 * compact.el: Remove.
6
12012-07-19 Sam Steingold <sds@gnu.org> 72012-07-19 Sam Steingold <sds@gnu.org>
2 8
3 * vc/vc-dispatcher.el (vc-compilation-mode): Add, based on 9 * vc/vc-dispatcher.el (vc-compilation-mode): Add, based on
diff --git a/lisp/compact.el b/lisp/compact.el
deleted file mode 100644
index 0d9523147bc..00000000000
--- a/lisp/compact.el
+++ /dev/null
@@ -1,60 +0,0 @@
1;;; compact.el --- compact buffers when idle
2
3;; Copyright (C) 2012 Free Software Foundation, Inc.
4
5;; Maintainer: FSF
6;; Package: emacs
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22
23;;; Commentary:
24
25;; This package provides the ability to compact buffers when Emacs is idle.
26;; Initially written by Dmitry Antipov <dmantipov@yandex.ru>.
27
28;;; Code:
29
30(require 'timer)
31
32(defun compact-buffers ()
33 "Run `compact-buffer' for each buffer except current buffer.
34Schedule next compaction if `compact-buffers-when-idle' is greater than zero."
35 (mapc (lambda (buffer)
36 (and (not (eq buffer (current-buffer)))
37 (compact-buffer buffer)))
38 (buffer-list))
39 (compact-buffers-idle))
40
41(defun compact-buffers-idle ()
42 "Compact buffers if `compact-buffers-when-idle' is greater than zero."
43 (and (floatp compact-buffers-when-idle)
44 (> compact-buffers-when-idle 0.0)
45 (run-with-idle-timer compact-buffers-when-idle nil 'compact-buffers)))
46
47(defcustom compact-buffers-when-idle 1.0
48 "Compact all buffers when Emacs is idle more than this period of time.
49Compaction is done by truncating `buffer-undo-list' and shrinking the gap.
50Value less than or equal to zero disables idle compaction."
51 :type 'float
52 :group 'alloc
53 :set (lambda (symbol value)
54 (progn (set-default symbol value)
55 (compact-buffers-idle)))
56 :version "24.2")
57
58(provide 'compact)
59
60;;; compact.el ends here