Commit b70d23ff authored by Paul Eggert's avatar Paul Eggert
Browse files

Merge from mainline.

parents 06c550d2 11043dbd
2011-04-05 Paul Eggert <eggert@cs.ucla.edu>
2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
* 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).
* Makefile.in (GNULIB_MODULES): Add careadlinkat.
* lib/allocator.h, lib/careadlinkat.c, lib/careadlinkat.h:
* 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>
* autogen/update_autogen: Pass -f to autoreconf.
......
......@@ -25,6 +25,9 @@
## This is a helper script to update the pre-built generated files in
## the autogen/ directory. This is suitable for running from cron.
## 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:
......@@ -48,13 +51,17 @@ cd ../
usage ()
{
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.
Options:
-f: force an update even if the source files are locally modified.
-c: if the update succeeds and the generated files are modified,
commit them (caution).
-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
exit 1
}
......@@ -65,8 +72,13 @@ EOF
force=
commit=
quiet=
clean=
ldefs_flag=
lboot_flag=
## Parameters.
ldefs_in=lisp/loaddefs.el
ldefs_out=lisp/ldefs-boot.el
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"
......@@ -81,7 +93,7 @@ tempfile=/tmp/$PN.$$
trap "rm -f $tempfile 2> /dev/null" EXIT
while getopts ":hcfq" option ; do
while getopts ":hcflqCL" option ; do
case $option in
(h) usage ;;
......@@ -89,8 +101,14 @@ while getopts ":hcfq" option ; do
(f) force=1 ;;
(l) ldefs_flag=1 ;;
(q) quiet=1 ;;
(C) clean=1 ;;
(L) lboot_flag=1 ;;
(\?) die "Bad option -$OPTARG" ;;
(:) die "Option -$OPTARG requires an argument" ;;
......@@ -101,16 +119,17 @@ done
shift $(( --OPTIND ))
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
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
case $stat in
......@@ -124,9 +143,21 @@ while read stat file; do
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..."
autoreconf -f -i -I m4 2>| $tempfile
autoreconf ${clean:+-f} -i -I m4 2>| $tempfile
retval=$?
......@@ -162,27 +193,111 @@ while read stat file; do
done < $tempfile
[ "$modified" ] || {
cd ../
## Uses global $commit.
commit ()
{
local type=$1
shift
[ $# -gt 0 ] || {
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 ../
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
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>
 
* net/rcirc.el: Update my e-mail address.
......
......@@ -70,6 +70,18 @@ AUTOGENEL = loaddefs.el \
cedet/ede/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.
# During bootstrapping the byte-compiler is run interpreted when compiling
# itself, and uses more stack than usual.
......@@ -153,13 +165,9 @@ finder-data: doit
echo Directories: $$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
# are identified by being the value of `generated-autoload-file'.
# The chmod +w is to handle env var CVSREAD=1.
autoloads: $(LOADDEFS) doit
chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \
$(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) && chmod +w $(AUTOGEN_VCS)
cd $(lisp); $(setwins_almost); \
echo Directories: $$wins; \
$(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
......
......@@ -204,6 +204,18 @@ EVENT is an event like `last-nonmenu-event'."
(define-obsolete-function-alias 'scroll-calendar-left-three-months
'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
(defun calendar-scroll-right-three-months (arg &optional event)
"Scroll the displayed calendar window right by 3*ARG months.
......
......@@ -1648,14 +1648,17 @@ line."
(define-key map [down-mouse-2]
(easy-menu-binding cal-menu-global-mouse-menu))
;; Left-click moves us forward in time, right-click backwards.
;; 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 drag-mouse-1] 'calendar-scroll-left)
;; 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 drag-mouse-3] 'calendar-scroll-right)
(define-key map [vertical-scroll-bar drag-mouse-3]
'calendar-scroll-right))
map)
"Keymap for `calendar-mode'.")
......
......@@ -1765,8 +1765,7 @@ variables directly.
Note: This function will erase modifications done by
`font-lock-add-keywords' or `font-lock-remove-keywords', but will
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)
(font-lock-mode 1))
......
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>
 
* gnus-sum.el (gnus-update-marks): Reinstate the code to not alter
......
......@@ -23,7 +23,7 @@
;;; Commentary:
;; This is the gnus-registry.el package, which works with all
;; backends, not just nnmail (e.g. NNTP). The major issue is that it
;; Gnus backends, not just nnmail. The major issue is that it
;; doesn't go across backends, so for instance if an article is in
;; nnml:sys and you see a reference to it in nnimap splitting, the
;; article will end up in nnimap:sys
......@@ -35,8 +35,7 @@
;; Put this in your startup file (~/.gnus.el for instance)
;; (setq gnus-registry-max-entries 2500
;; gnus-registry-use-long-group-names t)
;; (setq gnus-registry-max-entries 2500)
;; (gnus-registry-initialize)
......@@ -51,18 +50,22 @@
;; - get the correct group on spool actions
;; - articles that are spooled to a different backend should be handled
;; - articles that are spooled to a different backend should be moved
;; after splitting
;;; Code:
(eval-when-compile (require 'cl))
(require 'ert)
(require 'gnus)
(require 'gnus-int)
(require 'gnus-sum)
(require 'gnus-art)
(require 'gnus-util)
(require 'nnmail)
(require 'easymenu)
(require 'registry)
(defvar gnus-adaptive-word-syntax-table)
......@@ -74,12 +77,7 @@
:version "22.1"
:group 'gnus)
(defvar gnus-registry-hashtb (make-hash-table
:size 256
:test 'equal)
"*The article registry by Message ID.")
(defcustom gnus-registry-marks
(defvar gnus-registry-marks
'((Important
:char ?i
:image "summary_important")
......@@ -105,29 +103,25 @@ Each entry must have a character to be useful for summary mode
line display and for keyboard shortcuts.
Each entry must have an image string to be useful for visual
display."
:group 'gnus-registry
:type '(repeat :tag "Registry Marks"
(cons :tag "Mark"
(symbol :tag "Name")
(checklist :tag "Options" :greedy t
(group :inline t
(const :format "" :value :char)
(character :tag "Character code"))
(group :inline t
(const :format "" :value :image)
(string :tag "Image"))))))
display.")
(defcustom gnus-registry-default-mark 'To-Do
"The default mark. Should be a valid key for `gnus-registry-marks'."
:group 'gnus-registry
:type 'symbol)
(defcustom gnus-registry-unfollowed-addresses
(list (regexp-quote user-mail-address))
"List of addresses that gnus-registry-split-fancy-with-parent won't trace.
The addresses are matched, they don't have to be fully qualified."
:group 'gnus-registry
:type '(repeat regexp))
(defcustom gnus-registry-unfollowed-groups
'("delayed$" "drafts$" "queue$" "INBOX$" "^nnmairix:" "archive")
"List of groups that gnus-registry-split-fancy-with-parent won't return.
The group names are matched, they don't have to be fully
qualified. This parameter tells the Registry 'never split a
qualified. This parameter tells the Gnus registry 'never split a
message into a group that matches one of these, regardless of
references.'
......@@ -146,28 +140,16 @@ nnmairix groups are specifically excluded because they are ephemeral."
(defvar gnus-registry-misc-menus nil) ; ugly way to keep the menus
(defcustom gnus-registry-clean-empty t
"Whether the empty registry entries should be deleted.
Registry entries are considered empty when they have no groups
and no extra data."
:group 'gnus-registry
:type 'boolean)
(defcustom gnus-registry-use-long-group-names t
"Whether the registry should use long group names."
:group 'gnus-registry
:type 'boolean)
(defcustom gnus-registry-max-track-groups 20
"The maximum number of non-unique group matches to check for a message ID."
:group 'gnus-registry
:type '(radio (const :format "Unlimited " nil)
(integer :format "Maximum non-unique matches: %v")))
(make-obsolete-variable 'gnus-registry-clean-empty nil "23.4")
(make-obsolete-variable 'gnus-registry-use-long-group-names nil "23.4")
(make-obsolete-variable 'gnus-registry-max-track-groups nil "23.4")
(make-obsolete-variable 'gnus-registry-entry-caching nil "23.4")
(make-obsolete-variable 'gnus-registry-trim-articles-without-groups nil "23.4")
(defcustom gnus-registry-track-extra nil
(defcustom gnus-registry-track-extra '(subject sender)
"Whether the registry should track extra data about a message.
The Subject and Sender (From:) headers are currently tracked this
way."
The Subject and Sender (From:) headers are tracked this way by
default."
:group 'gnus-registry
:type
'(set :tag "Tracking choices"
......@@ -175,45 +157,49 @@ way."
(const :tag "Track by sender (From: header)" sender)))
(defcustom gnus-registry-split-strategy nil
"Whether the registry should track extra data about a message.
The Subject and Sender (From:) headers are currently tracked this
way."
"The splitting strategy applied to the keys in `gnus-registry-track-extra'.
Given a set of unique found groups G and counts for each element
of G, and a key K (typically 'sender or 'subject):
When nil, if G has only one element, use it. Otherwise give up.
This is the fastest but also least useful strategy.
When 'majority, use the majority by count. So if there is a
group with the most articles counted by K, use that. Ties are
resolved in no particular order, simply the first one found wins.
This is the slowest strategy but also the most accurate one.
When 'first, the first element of G wins. This is fast and
should be OK if your senders and subjects don't \"bleed\" across
groups."
:group 'gnus-registry
:type
'(choice :tag "Tracking choices"
'(choice :tag "Splitting strategy"
(const :tag "Only use single choices, discard multiple matches" nil)
(const :tag "Majority of matches wins" majority)
(const :tag "First found wins" first)))
(defcustom gnus-registry-entry-caching t
"Whether the registry should cache extra information."
:group 'gnus-registry
:type 'boolean)
(defcustom gnus-registry-minimum-subject-length 5
"The minimum length of a subject before it's considered trackable."
:group 'gnus-registry
:type 'integer)
(defcustom gnus-registry-trim-articles-without-groups t
"Whether the registry should clean out message IDs without groups."
:group 'gnus-registry
:type 'boolean)
(defcustom gnus-registry-extra-entries-precious '(marks)
"What extra entries are precious, meaning they won't get trimmed.
When you save the Gnus registry, it's trimmed to be no longer
than `gnus-registry-max-entries' (which is nil by default, so no
trimming happens). Any entries with extra data in this list (by
default, marks are included, so articles with marks are
considered precious) will not be trimmed."
(defcustom gnus-registry-extra-entries-precious '(mark)
"What extra keys are precious, meaning entries with them won't get pruned.
By default, 'mark is included, so articles with marks are
considered precious.
Before you save the Gnus registry, it's pruned. Any entries with
keys in this list will not be pruned. All other entries go to
the Bit Bucket."
:group 'gnus-registry
:type '(repeat symbol))
(defcustom gnus-registry-cache-file
(nnheader-concat
(or gnus-dribble-directory gnus-home-directory "~/")
".gnus.registry.eld")
".gnus.registry.eioio")
"File where the Gnus registry will be stored."
:group 'gnus-registry
:type 'file)
......@@ -224,218 +210,83 @@ considered precious) will not be trimmed."
:type '(radio (const :format "Unlimited " nil)
(integer :format "Maximum number: %v")))
(defun gnus-registry-track-subject-p ()
(memq 'subject gnus-registry-track-extra))
(defcustom gnus-registry-max-pruned-entries nil
"Maximum number of pruned entries in the registry, nil for unlimited."
:group 'gnus-registry
:type '(radio (const :format "Unlimited " nil)
(integer :format "Maximum number: %v")))
(defun gnus-registry-track-sender-p ()
(memq 'sender gnus-registry-track-extra))
(defun gnus-registry-fixup-registry (db)
(when db