Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
b70d23ff
Commit
b70d23ff
authored
Apr 05, 2011
by
Paul Eggert
Browse files
Merge from mainline.
parents
06c550d2
11043dbd
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
2619 additions
and
2332 deletions
+2619
-2332
ChangeLog
ChangeLog
+11
-3
autogen/update_autogen
autogen/update_autogen
+132
-17
lisp/ChangeLog
lisp/ChangeLog
+38
-0
lisp/Makefile.in
lisp/Makefile.in
+14
-6
lisp/calendar/cal-move.el
lisp/calendar/cal-move.el
+12
-0
lisp/calendar/calendar.el
lisp/calendar/calendar.el
+10
-7
lisp/font-lock.el
lisp/font-lock.el
+1
-2
lisp/gnus/ChangeLog
lisp/gnus/ChangeLog
+32
-0
lisp/gnus/gnus-registry.el
lisp/gnus/gnus-registry.el
+558
-806
lisp/gnus/nnregistry.el
lisp/gnus/nnregistry.el
+1
-1
lisp/gnus/registry.el
lisp/gnus/registry.el
+411
-0
lisp/gnus/spam.el
lisp/gnus/spam.el
+10
-17
lisp/info.el
lisp/info.el
+92
-94
lisp/ldefs-boot.el
lisp/ldefs-boot.el
+1287
-1372
lisp/mh-e/ChangeLog
lisp/mh-e/ChangeLog
+5
-0
lisp/mh-e/mh-funcs.el
lisp/mh-e/mh-funcs.el
+3
-2
lisp/minibuffer.el
lisp/minibuffer.el
+2
-5
No files found.
ChangeLog
View file @
b70d23ff
2011-04-0
5
Paul Eggert <eggert@cs.ucla.edu>
2011-04-0
6
Paul Eggert <eggert@cs.ucla.edu>
* configure.in (ATTRIBUTE_FORMAT, ATTRIBUTE_FORMAT_PRINTF): New macros.
* configure.in (ATTRIBUTE_FORMAT, ATTRIBUTE_FORMAT_PRINTF): New macros.
2011-04-01 Paul Eggert <eggert@cs.ucla.edu>
Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
* Makefile.in (GNULIB_MODULES): Add careadlinkat.
* Makefile.in (GNULIB_MODULES): Add careadlinkat.
* lib/allocator.h, lib/careadlinkat.c, lib/careadlinkat.h:
* lib/allocator.h, lib/careadlinkat.c, lib/careadlinkat.h:
* m4/ssize_t.m4: New files, automatically generated from gnulib.
* m4/ssize_t.m4: New files, automatically generated from gnulib.
2011-04-06 Glenn Morris <rgm@gnu.org>
* autogen/update_autogen: Handle loaddefs-like files as well.
(usage): Add -l, -C.
(clean, ldefs_flag, ldefs_in, ldefs_out): New variables.
With -l, check status of lisp/ as well.
With -C, clean before building.
(autoreconf): Only pass -f in the `clean' case.
(commit): New function.
2011-03-28 Glenn Morris <rgm@gnu.org>
2011-03-28 Glenn Morris <rgm@gnu.org>
* autogen/update_autogen: Pass -f to autoreconf.
* autogen/update_autogen: Pass -f to autoreconf.
...
...
autogen/update_autogen
View file @
b70d23ff
...
@@ -25,6 +25,9 @@
...
@@ -25,6 +25,9 @@
## This is a helper script to update the pre-built generated files in
## This is a helper script to update the pre-built generated files in
## the autogen/ directory. This is suitable for running from cron.
## the autogen/ directory. This is suitable for running from cron.
## Only Emacs maintainers need use this, so it uses bash features.
## Only Emacs maintainers need use this, so it uses bash features.
##
## With the -l option, it also updates the versioned loaddefs-like
## files in lisp/. These include ldefs-boot, cl-loaddefs, rmail, etc.
### Code:
### Code:
...
@@ -48,13 +51,17 @@ cd ../
...
@@ -48,13 +51,17 @@ cd ../
usage
()
usage
()
{
{
cat
1>&2
<<
EOF
cat
1>&2
<<
EOF
Usage:
${
PN
}
[-f] [-c] [-q]
Usage:
${
PN
}
[-f] [-c] [-q]
[-l [-L]] [-C] [-- make-flags]
Update the generated files in the Emacs autogen/ directory.
Update the generated files in the Emacs autogen/ directory.
Options:
Options:
-f: force an update even if the source files are locally modified.
-f: force an update even if the source files are locally modified.
-c: if the update succeeds and the generated files are modified,
-c: if the update succeeds and the generated files are modified,
commit them (caution).
commit them (caution).
-q: be quiet; only give error messages, not status messages.
-q: be quiet; only give error messages, not status messages.
-l: also update the versioned loaddefs-like files in lisp/.
This requires a build. Passes any non-option args to make (eg -- -j2).
-L: also update ldefs-boot.el.
-C: start from a clean state. Slower, but more correct.
EOF
EOF
exit
1
exit
1
}
}
...
@@ -65,8 +72,13 @@ EOF
...
@@ -65,8 +72,13 @@ EOF
force
=
force
=
commit
=
commit
=
quiet
=
quiet
=
clean
=
ldefs_flag
=
lboot_flag
=
## Parameters.
## Parameters.
ldefs_in
=
lisp/loaddefs.el
ldefs_out
=
lisp/ldefs-boot.el
sources
=
"configure.in lib/Makefile.am"
sources
=
"configure.in lib/Makefile.am"
genfiles
=
"configure aclocal.m4 src/config.in lib/Makefile.in compile config.guess config.sub depcomp install-sh missing"
genfiles
=
"configure aclocal.m4 src/config.in lib/Makefile.in compile config.guess config.sub depcomp install-sh missing"
...
@@ -81,7 +93,7 @@ tempfile=/tmp/$PN.$$
...
@@ -81,7 +93,7 @@ tempfile=/tmp/$PN.$$
trap
"rm -f
$tempfile
2> /dev/null"
EXIT
trap
"rm -f
$tempfile
2> /dev/null"
EXIT
while
getopts
":hcf
q
"
option
;
do
while
getopts
":hcf
lqCL
"
option
;
do
case
$option
in
case
$option
in
(
h
)
usage
;;
(
h
)
usage
;;
...
@@ -89,8 +101,14 @@ while getopts ":hcfq" option ; do
...
@@ -89,8 +101,14 @@ while getopts ":hcfq" option ; do
(
f
)
force
=
1
;;
(
f
)
force
=
1
;;
(
l
)
ldefs_flag
=
1
;;
(
q
)
quiet
=
1
;;
(
q
)
quiet
=
1
;;
(
C
)
clean
=
1
;;
(
L
)
lboot_flag
=
1
;;
(
\?
)
die
"Bad option -
$OPTARG
"
;;
(
\?
)
die
"Bad option -
$OPTARG
"
;;
(
:
)
die
"Option -
$OPTARG
requires an argument"
;;
(
:
)
die
"Option -
$OPTARG
requires an argument"
;;
...
@@ -101,16 +119,17 @@ done
...
@@ -101,16 +119,17 @@ done
shift
$((
--
OPTIND
))
shift
$((
--
OPTIND
))
OPTIND
=
1
OPTIND
=
1
[
$#
-eq
0
]
||
die
"Wrong number of arguments"
## Does not work 100% because a lot of Emacs batch output comes on stderr (?).
[
"
$quiet
"
]
&&
exec
1> /dev/null
[
"
$quiet
"
]
&&
exec
1> /dev/null
echo
"Running bzr status..."
echo
"Running bzr status..."
bzr status
-S
$sources
>
|
$tempfile
||
die
"bzr status error for sources"
bzr status
-S
$sources
${
ldefs_flag
:+lisp
}
>
|
$tempfile
||
\
die
"bzr status error for sources"
## The lisp portion could be more permissive, eg only care about .el files.
while
read stat
file
;
do
while
read stat
file
;
do
case
$stat
in
case
$stat
in
...
@@ -124,9 +143,21 @@ while read stat file; do
...
@@ -124,9 +143,21 @@ while read stat file; do
done
<
$tempfile
done
<
$tempfile
## Probably this is overkill, and there's no need to "bootstrap" just
## for making autoloads.
[
"
$clean
"
]
&&
{
echo
"Running 'make maintainer-clean'..."
make maintainer-clean
#|| die "Cleaning error"
rm
-f
$ldefs_in
}
echo
"Running autoreconf..."
echo
"Running autoreconf..."
autoreconf
-f
-i
-I
m4 2>|
$tempfile
autoreconf
${
clean
:+
-f
}
-i
-I
m4 2>|
$tempfile
retval
=
$?
retval
=
$?
...
@@ -162,27 +193,111 @@ while read stat file; do
...
@@ -162,27 +193,111 @@ while read stat file; do
done
<
$tempfile
done
<
$tempfile
[
"
$modified
"
]
||
{
cd
../
## Uses global $commit.
commit
()
{
local type
=
$1
shift
[
$#
-gt
0
]
||
{
echo
"No files were modified"
echo
"No files were modified"
exit
0
return
0
}
echo
"Modified file(s):
$@
"
[
"
$commit
"
]
||
return
0
echo
"Committing..."
## bzr status output is always relative to top-level, not PWD.
bzr commit
-m
"Auto-commit of
$type
files."
"
$@
"
||
return
$?
echo
"Committed files:
$@
"
}
# function commit
commit
"generated"
$modified
||
die
"bzr commit error"
[
"
$ldefs_flag
"
]
||
exit
0
echo
"Finding loaddef targets..."
sed
-n
-e
'/^AUTOGEN_VCS/,/^$/ s/\\//p'
lisp/Makefile.in |
\
sed
'/AUTOGEN_VCS/d'
>
|
$tempfile
||
die
"sed error"
genfiles
=
while
read
genfile
;
do
[
-r
lisp/
$genfile
]
||
die
"Unable to read
$genfile
"
genfiles
=
"
$genfiles
$genfile
"
done
<
$tempfile
[
"
$genfiles
"
]
||
die
"Error setting genfiles"
[
-e
Makefile
]
||
{
echo
"Running ./configure..."
## Minimize required packages.
./configure
--without-x
||
die
"configure error"
}
}
echo
"Modified file(s):
$modified
"
[
"
$commit
"
]
||
exit
0
## Build the minimum needed to get the autoloads.
echo
"Running lib/ make..."
make
-C
lib
"
$@
"
all
||
die
"make lib error"
echo
"Running src/ make..."
make
-C
src
"
$@
"
bootstrap-emacs
||
die
"make src error"
echo
"Running lisp/ make..."
make
-C
lisp
"
$@
"
autoloads
EMACS
=
../src/bootstrap-emacs
||
die
"make src error"
[
!
"
$lboot_flag
"
]
||
cp
$ldefs_in
$ldefs_out
||
die
"cp ldefs_boot error"
cd
lisp
echo
"Checking status of loaddef files..."
## It probably would be fine to just check+commit lisp/, since
## making autoloads should not effect any other files. But better
## safe than sorry.
bzr status
-S
$genfiles
${
ldefs_out
#lisp/
}
>
|
$tempfile
||
\
die
"bzr status error for generated files"
modified
=
while
read stat
file
;
do
[
"
$stat
"
!=
"M"
]
&&
die
"Unexpected status (
$stat
) for generated
$file
"
modified
=
"
$modified
$file
"
done
<
$tempfile
echo
"Committing..."
## bzr status output is annoyingly always relative to top-level, not PWD.
cd
../
cd
../
bzr commit
-m
"Auto-commit of generated files."
$modified
||
\
die
"bzr commit error"
commit
"loaddefs"
$modified
||
die
"bzr commit error"
echo
"Committed files:
$modified
"
exit
exit
0
### update_autogen ends here
### update_autogen ends here
lisp/ChangeLog
View file @
b70d23ff
2011-04-06 Glenn Morris <rgm@gnu.org>
* Makefile.in (AUTOGEN_VCS): New variable.
(autoloads): Use $AUTOGEN_VCS.
* calendar/cal-move.el (calendar-scroll-toolkit-scroll): New function.
* calendar/calendar.el (calendar-mode-map):
Check for toolkit scroll bars. (Bug#8305)
2011-04-05 Chong Yidong <cyd@stupidchicken.com>
* minibuffer.el (completion-in-region--postch)
(completion-in-region-mode): Remove unnecessary messages.
2011-04-05 Juanma Barranquero <lekktu@gmail.com>
* font-lock.el (font-lock-refresh-defaults):
Don't bind `hi-lock--inhibit-font-lock-hook', removed in
2010-10-09T04:09:19Z!cyd@stupidchicken.com and 2010-10-11T23:57:49Z!lekktu@gmail.com (2010-10-12).
* info.el (Info-directory-list, Info-read-node-name-2)
(Info-split-parameter-string): Doc fixes.
(Info-virtual-nodes): Reflow docstring.
(Info-find-file, Info-directory-toc-nodes, Info-history-toc-nodes)
(Info-apropos-toc-nodes, info-finder, Info-get-token)
(Info-find-emacs-command-nodes, Info-speedbar-key-map):
Fix typos in docstrings.
(Info-revert-buffer-function, Info-search, Info-isearch-pop-state)
(Info-speedbar-hierarchy-buttons, Info-speedbar-goto-node)
(Info-speedbar-buttons, Info-desktop-buffer-misc-data)
(Info-restore-desktop-buffer): Mark unused parameters.
(Info-directory-find-file, Info-directory-find-node)
(Info-history-find-file, Info-history-find-node, Info-toc-find-node)
(Info-virtual-index-find-node, Info-apropos-find-file)
(Info-apropos-find-node, Info-finder-find-file, Info-finder-find-node):
Mark unused parameters; fix typos in docstrings.
(Info-virtual-index): Remove unused local variable `nodename'.
2011-04-05 Deniz Dogan <deniz@dogan.se>
2011-04-05 Deniz Dogan <deniz@dogan.se>
* net/rcirc.el: Update my e-mail address.
* net/rcirc.el: Update my e-mail address.
...
...
lisp/Makefile.in
View file @
b70d23ff
...
@@ -70,6 +70,18 @@ AUTOGENEL = loaddefs.el \
...
@@ -70,6 +70,18 @@ AUTOGENEL = loaddefs.el \
cedet/ede/loaddefs.el
\
cedet/ede/loaddefs.el
\
cedet/srecode/loaddefs.el
cedet/srecode/loaddefs.el
# Versioned files that are the value of someone's `generated-autoload-file'.
# Note that update_loaddefs parses this.
AUTOGEN_VCS
=
\
ps-print.el
\
emulation/tpu-edt.el
\
emacs-lisp/cl-loaddefs.el
\
mail/rmail.el
\
dired.el
\
ibuffer.el
\
htmlfontify.el
\
emacs-lisp/eieio.el
# Value of max-lisp-eval-depth when compiling initially.
# Value of max-lisp-eval-depth when compiling initially.
# During bootstrapping the byte-compiler is run interpreted when compiling
# During bootstrapping the byte-compiler is run interpreted when compiling
# itself, and uses more stack than usual.
# itself, and uses more stack than usual.
...
@@ -153,13 +165,9 @@ finder-data: doit
...
@@ -153,13 +165,9 @@ finder-data: doit
echo
Directories:
$$
wins
;
\
echo
Directories:
$$
wins
;
\
$(emacs)
-l
finder
--eval
'(setq generated-finder-keywords-file "
$(lisp)
/finder-inf.el")'
-f
finder-compile-keywords-make-dist
$$
wins
$(emacs)
-l
finder
--eval
'(setq generated-finder-keywords-file "
$(lisp)
/finder-inf.el")'
-f
finder-compile-keywords-make-dist
$$
wins
# The chmod +w is to handle env var CVSREAD=1. Files named
# The chmod +w is to handle env var CVSREAD=1.
# are identified by being the value of `generated-autoload-file'.
autoloads
:
$(LOADDEFS) doit
autoloads
:
$(LOADDEFS) doit
chmod
+w
$(lisp)
/ps-print.el
$(lisp)
/emulation/tpu-edt.el
\
cd
$(lisp)
&&
chmod
+w
$(AUTOGEN_VCS)
$(lisp)
/emacs-lisp/cl-loaddefs.el
$(lisp)
/mail/rmail.el
\
$(lisp)
/dired.el
$(lisp)
/ibuffer.el
$(lisp)
/htmlfontify.el
\
$(lisp)
/emacs-lisp/eieio.el
cd
$(lisp)
;
$(setwins_almost)
;
\
cd
$(lisp)
;
$(setwins_almost)
;
\
echo
Directories:
$$
wins
;
\
echo
Directories:
$$
wins
;
\
$(emacs)
-l
autoload
--eval
'(setq generated-autoload-file "
$(lisp)
/loaddefs.el")'
-f
batch-update-autoloads
$$
wins
$(emacs)
-l
autoload
--eval
'(setq generated-autoload-file "
$(lisp)
/loaddefs.el")'
-f
batch-update-autoloads
$$
wins
...
...
lisp/calendar/cal-move.el
View file @
b70d23ff
...
@@ -204,6 +204,18 @@ EVENT is an event like `last-nonmenu-event'."
...
@@ -204,6 +204,18 @@ EVENT is an event like `last-nonmenu-event'."
(
define-obsolete-function-alias
'scroll-calendar-left-three-months
(
define-obsolete-function-alias
'scroll-calendar-left-three-months
'calendar-scroll-left-three-months
"23.1"
)
'calendar-scroll-left-three-months
"23.1"
)
;; cf scroll-bar-toolkit-scroll
;;;###cal-autoload
(
defun
calendar-scroll-toolkit-scroll
(
event
)
"Function to scroll the calendar after a toolkit scroll-bar click."
(
interactive
"e"
)
(
let
((
part
(
nth
4
(
event-end
event
))))
;; Not bothering with drag events (handle, end-scroll).
(
cond
((
memq
part
'
(
above-handle
up
top
))
(
calendar-scroll-right
nil
event
))
((
memq
part
'
(
below-handle
down
bottom
))
(
calendar-scroll-left
nil
event
)))))
;;;###cal-autoload
;;;###cal-autoload
(
defun
calendar-scroll-right-three-months
(
arg
&optional
event
)
(
defun
calendar-scroll-right-three-months
(
arg
&optional
event
)
"Scroll the displayed calendar window right by 3*ARG months.
"Scroll the displayed calendar window right by 3*ARG months.
...
...
lisp/calendar/calendar.el
View file @
b70d23ff
...
@@ -1648,14 +1648,17 @@ line."
...
@@ -1648,14 +1648,17 @@ line."
(
define-key
map
[down-mouse-2]
(
define-key
map
[down-mouse-2]
(
easy-menu-binding
cal-menu-global-mouse-menu
))
(
easy-menu-binding
cal-menu-global-mouse-menu
))
;; Left-click moves us forward in time, right-click backwards.
;; cf scroll-bar.el.
;; cf scroll-bar.el.
(
if
(
and
(
boundp
'x-toolkit-scroll-bars
)
x-toolkit-scroll-bars
)
(
define-key
map
[vertical-scroll-bar
mouse-1]
'calendar-scroll-toolkit-scroll
)
;; Left-click moves us forward in time, right-click backwards.
(
define-key
map
[vertical-scroll-bar
mouse-1]
'calendar-scroll-left
)
(
define-key
map
[vertical-scroll-bar
mouse-1]
'calendar-scroll-left
)
(
define-key
map
[vertical-scroll-bar
drag-mouse-1]
'calendar-scroll-left
)
(
define-key
map
[vertical-scroll-bar
drag-mouse-1]
'calendar-scroll-left
)
;; down-mouse-2 stays as scroll-bar-drag.
;; down-mouse-2 stays as scroll-bar-drag.
(
define-key
map
[vertical-scroll-bar
mouse-3]
'calendar-scroll-right
)
(
define-key
map
[vertical-scroll-bar
mouse-3]
'calendar-scroll-right
)
(
define-key
map
[vertical-scroll-bar
drag-mouse-3]
'calendar-scroll-right
)
(
define-key
map
[vertical-scroll-bar
drag-mouse-3]
'calendar-scroll-right
))
map
)
map
)
"Keymap for `calendar-mode'."
)
"Keymap for `calendar-mode'."
)
...
...
lisp/font-lock.el
View file @
b70d23ff
...
@@ -1765,8 +1765,7 @@ variables directly.
...
@@ -1765,8 +1765,7 @@ variables directly.
Note: This function will erase modifications done by
Note: This function will erase modifications done by
`font-lock-add-keywords' or `font-lock-remove-keywords', but will
`font-lock-add-keywords' or `font-lock-remove-keywords', but will
preserve `hi-lock-mode' highlighting patterns."
preserve `hi-lock-mode' highlighting patterns."
(
let
((
hi-lock--inhibit-font-lock-hook
t
))
(
font-lock-mode
-1
)
(
font-lock-mode
-1
))
(
kill-local-variable
'font-lock-set-defaults
)
(
kill-local-variable
'font-lock-set-defaults
)
(
font-lock-mode
1
))
(
font-lock-mode
1
))
...
...
lisp/gnus/ChangeLog
View file @
b70d23ff
2011-04-05 Teodor Zlatanov <tzz@lifelogs.com>
* gnus-registry.el (gnus-registry-fixup-registry): New function to
fixup the parameters that can be customized by the user between
save/read cycles.
(gnus-registry-read): Use it.
(gnus-registry-make-db): Use it.
(gnus-registry-spool-action, gnus-registry-handle-action): Fix
messaging.
(gnus-registry--split-fancy-with-parent-internal): Fix loop. Map
references to actual group names with sender and subject tracking.
(gnus-registry-post-process-groups): Use `cond' for better messaging.
(gnus-registry-usage-test): Add subject lookup test.
* registry.el (registry-db, initialize-instance): Set up constructor
instead of :initform arguments for the sake of older Emacsen.
(registry-lookup-breaks-before-lexbind): New method to demonstrate
pre-lexbind merge bug.
(registry-usage-test): Use it.
(initialize-instance, registry-db): Move the non-function initforms
back to the class definition.
2011-04-03 Teodor Zlatanov <tzz@lifelogs.com>
* registry.el: New library to manage gnus-registry-style data.
* gnus-registry.el: Use it (major rewrite).
* nnregistry.el: Use it.
* spam.el: Use it.
2011-04-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
2011-04-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus-sum.el (gnus-update-marks): Reinstate the code to not alter
* gnus-sum.el (gnus-update-marks): Reinstate the code to not alter
...
...
lisp/gnus/gnus-registry.el
View file @
b70d23ff
This diff is collapsed.
Click to expand it.
lisp/gnus/nnregistry.el
View file @
b70d23ff
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
(
deffoo
nnregistry-request-article
(
id
&optional
group
server
buffer
)
(
deffoo
nnregistry-request-article
(
id
&optional
group
server
buffer
)
(
and
(
not
nnregistry-within-nnregistry
)
(
and
(
not
nnregistry-within-nnregistry
)
(
let*
((
nnregistry-within-nnregistry
t
)
(
let*
((
nnregistry-within-nnregistry
t
)
(
group
(
gnus-registry-
f
et
ch-
group
id
))
(
group
(
nth
0
(
gnus-registry-
g
et
-id-key
id
'
group
)
))
(
gnus-override-method
nil
))
(
gnus-override-method
nil
))
(
message
"nnregistry: requesting article `%s' in group `%s'"
(
message
"nnregistry: requesting article `%s' in group `%s'"
id
group
)
id
group
)
...
...
lisp/gnus/registry.el
0 → 100644
View file @
b70d23ff
;;; registry.el --- Track and remember data items by various fields
;; Copyright (C) 2011 Free Software Foundation, Inc.
;; Author: Teodor Zlatanov <tzz@lifelogs.com>
;; Keywords: data
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This library provides a general-purpose EIEIO-based registry
;; database with persistence, initialized with these fields:
;; version: a float, 0.1 currently (don't change it)
;; max-hard: an integer, default 5000000
;; max-soft: an integer, default 50000
;; precious: a list of symbols
;; tracked: a list of symbols
;; tracker: a hashtable tuned for 100 symbols to track (you should
;; only access this with the :lookup2-function and the
;; :lookup2+-function)
;; data: a hashtable with default size 10K and resize threshold 2.0
;; (this reflects the expected usage so override it if you know better)
;; ...plus methods to do all the work: `registry-search',
;; `registry-lookup', `registry-lookup-secondary',
;; `registry-lookup-secondary-value', `registry-insert',
;; `registry-delete', `registry-prune', `registry-size' which see
;; and with the following properties:
;; Every piece of data has a unique ID and some general-purpose fields
;; (F1=D1, F2=D2, F3=(a b c)...) expressed as an alist, e.g.
;; ((F1 D1) (F2 D2) (F3 a b c))
;; Note that whether a field has one or many pieces of data, the data
;; is always a list of values.
;; The user decides which fields are "precious", F2 for example. At
;; PRUNE TIME (when the :prune-function is called), the registry will
;; trim any entries without the F2 field until the size is :max-soft
;; or less. No entries with the F2 field will be removed at PRUNE
;; TIME.
;; When an entry is inserted, the registry will reject new entries
;; if they bring it over the max-hard limit, even if they have the F2
;; field.
;; The user decides which fields are "tracked", F1 for example. Any
;; new entry is then indexed by all the tracked fields so it can be
;; quickly looked up that way. The data is always a list (see example
;; above) and each list element is indexed.
;; Precious and tracked field names must be symbols. All other
;; fields can be any other Emacs Lisp types.
;;; Code:
(
eval-when-compile
(
require
'ert
))
(
eval-when-compile
(
require
'cl
))
(
eval-and-compile
(
or
(
ignore-errors
(
progn
(
require
'eieio
)
(
require
'eieio-base
)))
;; gnus-fallback-lib/ from gnus/lisp/gnus-fallback-lib
(
ignore-errors
(
let
((
load-path
(
cons
(
expand-file-name
"gnus-fallback-lib/eieio"
(
file-name-directory
(
locate-library
"gnus"
)))
load-path
)))
(
require
'eieio
)
(
require
'eieio-base
)))
(
error
"eieio not found in `load-path' or gnus-fallback-lib/ directory."
)))
(
defclass
registry-db
(
eieio-persistent
)
((
version
:initarg
:version
:initform
0.1
:type
float
:custom
float