aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-04-14 13:16:48 -0700
committerPaul Eggert2011-04-14 13:16:48 -0700
commit8bd7b8304a41da5dc0c8a11967c1a6005e9465d0 (patch)
tree145588110166df723c31f3fceaa00c190b77aa8c
parentcd64ea1d0df393beb93d1bdf19bd3990e3378f85 (diff)
parent9024ff7943e9529ec38a80aaaa0db43224c1e885 (diff)
downloademacs-8bd7b8304a41da5dc0c8a11967c1a6005e9465d0.tar.gz
emacs-8bd7b8304a41da5dc0c8a11967c1a6005e9465d0.zip
Merge from mainline.
-rw-r--r--ChangeLog4
-rw-r--r--autogen/Makefile.in15
-rwxr-xr-xautogen/configure7
-rw-r--r--configure.in5
-rw-r--r--doc/misc/ChangeLog20
-rw-r--r--doc/misc/ede.texi18
-rw-r--r--doc/misc/gnus.texi79
-rw-r--r--doc/misc/tramp.texi35
-rw-r--r--etc/NEWS6
-rw-r--r--lisp/ChangeLog109
-rw-r--r--lisp/autorevert.el14
-rw-r--r--lisp/calendar/cal-hebrew.el9
-rw-r--r--lisp/calendar/cal-tex.el10
-rw-r--r--lisp/dframe.el2
-rw-r--r--lisp/emacs-lisp/advice.el141
-rw-r--r--lisp/gnus/ChangeLog49
-rw-r--r--lisp/gnus/gnus-art.el6
-rw-r--r--lisp/gnus/gnus-registry.el35
-rw-r--r--lisp/gnus/gnus-start.el55
-rw-r--r--lisp/gnus/gnus-sum.el2
-rw-r--r--lisp/gnus/mm-url.el11
-rw-r--r--lisp/gnus/registry.el4
-rw-r--r--lisp/help-fns.el75
-rw-r--r--lisp/icomplete.el7
-rw-r--r--lisp/ido.el18
-rw-r--r--lisp/image-mode.el2
-rw-r--r--lisp/minibuffer.el117
-rw-r--r--lisp/net/network-stream.el6
-rw-r--r--lisp/net/tramp-sh.el23
-rw-r--r--lisp/net/tramp-smb.el2
-rw-r--r--src/ChangeLog76
-rw-r--r--src/ChangeLog.112
-rw-r--r--src/alloc.c14
-rw-r--r--src/charset.c2
-rw-r--r--src/fileio.c27
-rw-r--r--src/keyboard.c2
-rw-r--r--src/lisp.h4
-rw-r--r--src/sound.c8
-rw-r--r--src/sysdep.c26
-rw-r--r--src/termcap.c10
-rw-r--r--src/xdisp.c22
-rw-r--r--src/xfns.c2
-rw-r--r--src/xsettings.c6
43 files changed, 642 insertions, 445 deletions
diff --git a/ChangeLog b/ChangeLog
index b766dbed7dd..a63fbc96bff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12011-04-12 Glenn Morris <rgm@gnu.org>
2
3 * configure.in: Require ImageMagick >= 6.2.8. (Bug#7955)
4
12011-04-09 Paul Eggert <eggert@cs.ucla.edu> 52011-04-09 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 * lib/allocator.c: New file, automatically generated by gnulib. 7 * lib/allocator.c: New file, automatically generated by gnulib.
diff --git a/autogen/Makefile.in b/autogen/Makefile.in
index fc16d7236e6..92e02110712 100644
--- a/autogen/Makefile.in
+++ b/autogen/Makefile.in
@@ -78,7 +78,8 @@ AR = ar
78ARFLAGS = cru 78ARFLAGS = cru
79libgnu_a_AR = $(AR) $(ARFLAGS) 79libgnu_a_AR = $(AR) $(ARFLAGS)
80am__DEPENDENCIES_1 = 80am__DEPENDENCIES_1 =
81am_libgnu_a_OBJECTS = careadlinkat.$(OBJEXT) dtoastr.$(OBJEXT) 81am_libgnu_a_OBJECTS = allocator.$(OBJEXT) careadlinkat.$(OBJEXT) \
82 dtoastr.$(OBJEXT)
82libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS) 83libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS)
83depcomp = $(SHELL) $(top_srcdir)/depcomp 84depcomp = $(SHELL) $(top_srcdir)/depcomp
84am__depfiles_maybe = depfiles 85am__depfiles_maybe = depfiles
@@ -692,10 +693,10 @@ x_default_search_path = @x_default_search_path@
692BUILT_SOURCES = arg-nonnull.h c++defs.h $(GETOPT_H) $(STDBOOL_H) \ 693BUILT_SOURCES = arg-nonnull.h c++defs.h $(GETOPT_H) $(STDBOOL_H) \
693 $(STDDEF_H) $(STDINT_H) stdio.h stdlib.h sys/stat.h time.h \ 694 $(STDDEF_H) $(STDINT_H) stdio.h stdlib.h sys/stat.h time.h \
694 unistd.h warn-on-use.h 695 unistd.h warn-on-use.h
695EXTRA_DIST = $(top_srcdir)/./arg-nonnull.h $(top_srcdir)/./c++defs.h \ 696EXTRA_DIST = allocator.h $(top_srcdir)/./arg-nonnull.h \
696 allocator.h careadlinkat.h md5.c md5.h dosname.h ftoastr.c \ 697 $(top_srcdir)/./c++defs.h careadlinkat.h md5.c md5.h dosname.h \
697 ftoastr.h filemode.c filemode.h getloadavg.c getopt.c \ 698 ftoastr.c ftoastr.h filemode.c filemode.h getloadavg.c \
698 getopt.in.h getopt1.c getopt_int.h intprops.h lstat.c \ 699 getopt.c getopt.in.h getopt1.c getopt_int.h intprops.h lstat.c \
699 mktime-internal.h mktime.c readlink.c stat.c stdbool.in.h \ 700 mktime-internal.h mktime.c readlink.c stat.c stdbool.in.h \
700 stddef.in.h stdint.in.h stdio.in.h stdlib.in.h strftime.c \ 701 stddef.in.h stdint.in.h stdio.in.h stdlib.in.h strftime.c \
701 strftime.h symlink.c sys_stat.in.h time.in.h time_r.c \ 702 strftime.h symlink.c sys_stat.in.h time.in.h time_r.c \
@@ -708,7 +709,8 @@ MOSTLYCLEANFILES = core *.stackdump arg-nonnull.h arg-nonnull.h-t \
708 time.h-t unistd.h unistd.h-t warn-on-use.h warn-on-use.h-t 709 time.h-t unistd.h unistd.h-t warn-on-use.h warn-on-use.h-t
709noinst_LIBRARIES = libgnu.a 710noinst_LIBRARIES = libgnu.a
710DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src 711DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src
711libgnu_a_SOURCES = careadlinkat.c dtoastr.c gettext.h ignore-value.h 712libgnu_a_SOURCES = allocator.c careadlinkat.c dtoastr.c gettext.h \
713 ignore-value.h
712libgnu_a_LIBADD = $(gl_LIBOBJS) 714libgnu_a_LIBADD = $(gl_LIBOBJS)
713libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) 715libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
714EXTRA_libgnu_a_SOURCES = md5.c ftoastr.c filemode.c getloadavg.c \ 716EXTRA_libgnu_a_SOURCES = md5.c ftoastr.c filemode.c getloadavg.c \
@@ -766,6 +768,7 @@ mostlyclean-compile:
766distclean-compile: 768distclean-compile:
767 -rm -f *.tab.c 769 -rm -f *.tab.c
768 770
771@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocator.Po@am__quote@
769@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/careadlinkat.Po@am__quote@ 772@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/careadlinkat.Po@am__quote@
770@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtoastr.Po@am__quote@ 773@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtoastr.Po@am__quote@
771@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemode.Po@am__quote@ 774@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemode.Po@am__quote@
diff --git a/autogen/configure b/autogen/configure
index 563c729f18e..7ec88c66fb5 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -6196,6 +6196,7 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
6196 6196
6197 6197
6198 6198
6199 # Code from module allocator:
6199 # Code from module arg-nonnull: 6200 # Code from module arg-nonnull:
6200 # Code from module c++defs: 6201 # Code from module c++defs:
6201 # Code from module careadlinkat: 6202 # Code from module careadlinkat:
@@ -10008,7 +10009,10 @@ fi
10008HAVE_IMAGEMAGICK=no 10009HAVE_IMAGEMAGICK=no
10009if test "${HAVE_X11}" = "yes"; then 10010if test "${HAVE_X11}" = "yes"; then
10010 if test "${with_imagemagick}" != "no"; then 10011 if test "${with_imagemagick}" != "no"; then
10011 IMAGEMAGICK_MODULE="Wand" 10012 ## 6.2.8 is the earliest version known to work, but earlier versions
10013 ## might work - let us know if you find one.
10014 ## 6.0.7 does not work. See bug#7955.
10015 IMAGEMAGICK_MODULE="Wand >= 6.2.8"
10012 10016
10013 succeeded=no 10017 succeeded=no
10014 10018
@@ -15465,6 +15469,7 @@ fi
15465 15469
15466 15470
15467 gl_source_base='lib' 15471 gl_source_base='lib'
15472 # Code from module allocator:
15468 # Code from module arg-nonnull: 15473 # Code from module arg-nonnull:
15469 # Code from module c++defs: 15474 # Code from module c++defs:
15470 # Code from module careadlinkat: 15475 # Code from module careadlinkat:
diff --git a/configure.in b/configure.in
index fef19f27642..3d99873eabb 100644
--- a/configure.in
+++ b/configure.in
@@ -1805,7 +1805,10 @@ fi
1805HAVE_IMAGEMAGICK=no 1805HAVE_IMAGEMAGICK=no
1806if test "${HAVE_X11}" = "yes"; then 1806if test "${HAVE_X11}" = "yes"; then
1807 if test "${with_imagemagick}" != "no"; then 1807 if test "${with_imagemagick}" != "no"; then
1808 IMAGEMAGICK_MODULE="Wand" 1808 ## 6.2.8 is the earliest version known to work, but earlier versions
1809 ## might work - let us know if you find one.
1810 ## 6.0.7 does not work. See bug#7955.
1811 IMAGEMAGICK_MODULE="Wand >= 6.2.8"
1809 PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :) 1812 PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :)
1810 AC_SUBST(IMAGEMAGICK_CFLAGS) 1813 AC_SUBST(IMAGEMAGICK_CFLAGS)
1811 AC_SUBST(IMAGEMAGICK_LIBS) 1814 AC_SUBST(IMAGEMAGICK_LIBS)
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 4daf5b1b9fb..1660ed5335b 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,23 @@
12011-04-14 Michael Albinus <michael.albinus@gmx.de>
2
3 * tramp.texi (Frequently Asked Questions): New item for disabling
4 Tramp in other packages.
5
62011-04-14 Teodor Zlatanov <tzz@lifelogs.com>
7
8 * gnus.texi (nnmairix caveats, Setup, Registry Article Refer Method)
9 (Fancy splitting to parent, Store arbitrary data): Updated
10 gnus-registry docs.
11
122011-04-13 Juanma Barranquero <lekktu@gmail.com>
13
14 * ede.texi: Fix typos.
15
162011-04-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17
18 * gnus.texi (Window Layout): @itemize @code doesn't exist.
19 It's @table @code.
20
12011-03-19 Antoine Levitt <antoine.levitt@gmail.com> 212011-03-19 Antoine Levitt <antoine.levitt@gmail.com>
2 22
3 * gnus.texi (Listing Groups): Document gnus-group-list-ticked 23 * gnus.texi (Listing Groups): Document gnus-group-list-ticked
diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi
index bc097a87150..67df955ca8f 100644
--- a/doc/misc/ede.texi
+++ b/doc/misc/ede.texi
@@ -2123,7 +2123,7 @@ Results in --add-missing being passed to automake.
2123@end deffn 2123@end deffn
2124 2124
2125@deffn Method ede-proj-flush-autoconf :AFTER this 2125@deffn Method ede-proj-flush-autoconf :AFTER this
2126Flush the configure file (current buffer) to accomodate @var{THIS}. 2126Flush the configure file (current buffer) to accommodate @var{THIS}.
2127By flushing, remove any cruft that may be in the file. Subsequent 2127By flushing, remove any cruft that may be in the file. Subsequent
2128calls to @dfn{ede-proj-tweak-autoconf} can restore items removed by flush. 2128calls to @dfn{ede-proj-tweak-autoconf} can restore items removed by flush.
2129@end deffn 2129@end deffn
@@ -2174,7 +2174,7 @@ These are removed with make clean.
2174@end deffn 2174@end deffn
2175 2175
2176@deffn Method ede-proj-tweak-autoconf :AFTER this 2176@deffn Method ede-proj-tweak-autoconf :AFTER this
2177Tweak the configure file (current buffer) to accomodate @var{THIS}. 2177Tweak the configure file (current buffer) to accommodate @var{THIS}.
2178@end deffn 2178@end deffn
2179 2179
2180@deffn Method ede-proj-compilers :AFTER obj 2180@deffn Method ede-proj-compilers :AFTER obj
@@ -2684,7 +2684,7 @@ Bonus: Return a cons cell: (COMPILED . UPTODATE).
2684@end deffn 2684@end deffn
2685 2685
2686@deffn Method ede-proj-flush-autoconf :AFTER this 2686@deffn Method ede-proj-flush-autoconf :AFTER this
2687Flush the configure file (current buffer) to accomodate @var{THIS}. 2687Flush the configure file (current buffer) to accommodate @var{THIS}.
2688@end deffn 2688@end deffn
2689 2689
2690@deffn Method ede-buffer-mine :AFTER this buffer 2690@deffn Method ede-buffer-mine :AFTER this buffer
@@ -2697,7 +2697,7 @@ Return the variable name for @var{THIS}'s sources.
2697@end deffn 2697@end deffn
2698 2698
2699@deffn Method ede-proj-tweak-autoconf :AFTER this 2699@deffn Method ede-proj-tweak-autoconf :AFTER this
2700Tweak the configure file (current buffer) to accomodate @var{THIS}. 2700Tweak the configure file (current buffer) to accommodate @var{THIS}.
2701@end deffn 2701@end deffn
2702 2702
2703@deffn Method ede-update-version-in-source :AFTER this version 2703@deffn Method ede-update-version-in-source :AFTER this version
@@ -2777,7 +2777,7 @@ Create or update the autoload target.
2777@end deffn 2777@end deffn
2778 2778
2779@deffn Method ede-proj-flush-autoconf :AFTER this 2779@deffn Method ede-proj-flush-autoconf :AFTER this
2780Flush the configure file (current buffer) to accomodate @var{THIS}. 2780Flush the configure file (current buffer) to accommodate @var{THIS}.
2781@end deffn 2781@end deffn
2782 2782
2783@deffn Method ede-buffer-mine :AFTER this buffer 2783@deffn Method ede-buffer-mine :AFTER this buffer
@@ -2796,7 +2796,7 @@ Argument @var{THIS} is the target which needs to insert an info file.
2796@end deffn 2796@end deffn
2797 2797
2798@deffn Method ede-proj-tweak-autoconf :AFTER this 2798@deffn Method ede-proj-tweak-autoconf :AFTER this
2799Tweak the configure file (current buffer) to accomodate @var{THIS}. 2799Tweak the configure file (current buffer) to accommodate @var{THIS}.
2800@end deffn 2800@end deffn
2801 2801
2802@deffn Method ede-update-version-in-source :AFTER this version 2802@deffn Method ede-update-version-in-source :AFTER this version
@@ -3008,7 +3008,7 @@ The preferred interpreter for this code.
3008@subsubsection Specialized Methods 3008@subsubsection Specialized Methods
3009 3009
3010@deffn Method ede-proj-tweak-autoconf :AFTER this 3010@deffn Method ede-proj-tweak-autoconf :AFTER this
3011Tweak the configure file (current buffer) to accomodate @var{THIS}. 3011Tweak the configure file (current buffer) to accommodate @var{THIS}.
3012@end deffn 3012@end deffn
3013 3013
3014 3014
@@ -3536,7 +3536,7 @@ For example, C code uses .o on unix, and Emacs Lisp uses .elc.
3536@subsubsection Specialized Methods 3536@subsubsection Specialized Methods
3537 3537
3538@deffn Method ede-proj-flush-autoconf :AFTER this 3538@deffn Method ede-proj-flush-autoconf :AFTER this
3539Flush the configure file (current buffer) to accomodate @var{THIS}. 3539Flush the configure file (current buffer) to accommodate @var{THIS}.
3540@end deffn 3540@end deffn
3541 3541
3542@deffn Method ede-proj-makefile-insert-rules :AFTER this 3542@deffn Method ede-proj-makefile-insert-rules :AFTER this
@@ -3558,7 +3558,7 @@ Retrieves the slot @code{sourcetype} from an object of class @code{ede-compilati
3558@end deffn 3558@end deffn
3559 3559
3560@deffn Method ede-proj-tweak-autoconf :AFTER this 3560@deffn Method ede-proj-tweak-autoconf :AFTER this
3561Tweak the configure file (current buffer) to accomodate @var{THIS}. 3561Tweak the configure file (current buffer) to accommodate @var{THIS}.
3562@end deffn 3562@end deffn
3563 3563
3564 3564
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 9771392f0cc..9d9b767bcba 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -22061,10 +22061,11 @@ mairix.)
22061@item 22061@item
22062If you use the Gnus registry: don't use the registry with 22062If you use the Gnus registry: don't use the registry with
22063@code{nnmairix} groups (put them in 22063@code{nnmairix} groups (put them in
22064@code{gnus-registry-unfollowed-groups}). Be @emph{extra careful} if 22064@code{gnus-registry-unfollowed-groups}; this is the default). Be
22065you use @code{gnus-registry-split-fancy-with-parent}; mails which are 22065@emph{extra careful} if you use
22066split into @code{nnmairix} groups are usually gone for good as soon as 22066@code{gnus-registry-split-fancy-with-parent}; mails which are split
22067you check the group for new mail (yes, it has happened to me...). 22067into @code{nnmairix} groups are usually gone for good as soon as you
22068check the group for new mail (yes, it has happened to me...).
22068 22069
22069@item 22070@item
22070Therefore: @emph{Never ever} put ``real'' mails into @code{nnmairix} 22071Therefore: @emph{Never ever} put ``real'' mails into @code{nnmairix}
@@ -22836,7 +22837,7 @@ windows resized.
22836Here's a list of most of the currently known window configurations, 22837Here's a list of most of the currently known window configurations,
22837and when they're used: 22838and when they're used:
22838 22839
22839@itemize @code 22840@table @code
22840@item group 22841@item group
22841The group buffer. 22842The group buffer.
22842 22843
@@ -22903,7 +22904,7 @@ Composing a bounce message.
22903@item mml-preview 22904@item mml-preview
22904Previewing a @acronym{MIME} part. 22905Previewing a @acronym{MIME} part.
22905 22906
22906@end itemize 22907@end table
22907 22908
22908 22909
22909@subsection Example Window Configurations 22910@subsection Example Window Configurations
@@ -25916,8 +25917,7 @@ of all messages matching a particular set of criteria.
25916Fortunately, setting up the Gnus registry is pretty easy: 25917Fortunately, setting up the Gnus registry is pretty easy:
25917 25918
25918@lisp 25919@lisp
25919(setq gnus-registry-max-entries 2500 25920(setq gnus-registry-max-entries 2500)
25920 gnus-registry-use-long-group-names t)
25921 25921
25922(gnus-registry-initialize) 25922(gnus-registry-initialize)
25923@end lisp 25923@end lisp
@@ -25939,16 +25939,16 @@ what they do before you copy them blindly).
25939 ("spam" t) 25939 ("spam" t)
25940 ("train" t)) 25940 ("train" t))
25941 gnus-registry-max-entries 500000 25941 gnus-registry-max-entries 500000
25942 gnus-registry-use-long-group-names t 25942 ;; this is the default
25943 gnus-registry-track-extra '(sender subject)) 25943 gnus-registry-track-extra '(sender subject))
25944@end lisp 25944@end lisp
25945 25945
25946They say: keep a lot of messages around, use long group names, track 25946They say: keep a lot of messages around, track messages by sender and
25947messages by sender and subject (not just parent Message-ID), and when 25947subject (not just parent Message-ID), and when the registry splits
25948the registry splits incoming mail, use a majority rule to decide where 25948incoming mail, use a majority rule to decide where messages should go
25949messages should go if there's more than one possibility. In addition, 25949if there's more than one possibility. In addition, the registry
25950the registry should ignore messages in groups that match ``nntp'', 25950should ignore messages in groups that match ``nntp'', ``nnrss'',
25951``nnrss'', ``spam'', or ``train.'' 25951``spam'', or ``train.''
25952 25952
25953You are doubtless impressed by all this, but you ask: ``I am a Gnus 25953You are doubtless impressed by all this, but you ask: ``I am a Gnus
25954user, I customize to live. Give me more.'' Here you go, these are 25954user, I customize to live. Give me more.'' Here you go, these are
@@ -25958,19 +25958,9 @@ the general settings.
25958The groups that will not be followed by 25958The groups that will not be followed by
25959@code{gnus-registry-split-fancy-with-parent}. They will still be 25959@code{gnus-registry-split-fancy-with-parent}. They will still be
25960remembered by the registry. This is a list of regular expressions. 25960remembered by the registry. This is a list of regular expressions.
25961@end defvar 25961By default any group name that ends with ``delayed'', ``drafts'',
25962 25962``queue'', or ``INBOX'', belongs to the nnmairix backend, or contains
25963@defvar gnus-registry-ignored-groups 25963the word ``archive'' is not followed.
25964The groups that will not be remembered by the registry. This is a
25965list of regular expressions, also available through Group/Topic
25966customization (so you can ignore or keep a specific group or a whole
25967topic).
25968@end defvar
25969
25970@defvar gnus-registry-use-long-group-names
25971Whether the registry will use long group names. It's recommended to
25972set this to @code{t}, although everything works if you don't. Future
25973functionality will require it.
25974@end defvar 25964@end defvar
25975 25965
25976@defvar gnus-registry-max-entries 25966@defvar gnus-registry-max-entries
@@ -25978,8 +25968,15 @@ The number (an integer or @code{nil} for unlimited) of entries the
25978registry will keep. 25968registry will keep.
25979@end defvar 25969@end defvar
25980 25970
25971@defvar gnus-registry-max-pruned-entries
25972The maximum number (an integer or @code{nil} for unlimited) of entries
25973the registry will keep after pruning.
25974@end defvar
25975
25981@defvar gnus-registry-cache-file 25976@defvar gnus-registry-cache-file
25982The file where the registry will be stored between Gnus sessions. 25977The file where the registry will be stored between Gnus sessions. By
25978default the file name is @code{.gnus.registry.eioio} in the same
25979directory as your @code{.newsrc.eld}.
25983@end defvar 25980@end defvar
25984 25981
25985@node Registry Article Refer Method 25982@node Registry Article Refer Method
@@ -26003,8 +26000,7 @@ lines:
26003;; Keep enough entries to have a good hit rate when referring to an 26000;; Keep enough entries to have a good hit rate when referring to an
26004;; article using the registry. Use long group names so that Gnus 26001;; article using the registry. Use long group names so that Gnus
26005;; knows where the article is. 26002;; knows where the article is.
26006(setq gnus-registry-max-entries 2500 26003(setq gnus-registry-max-entries 2500)
26007 gnus-registry-use-long-group-names t)
26008 26004
26009(gnus-registry-initialize) 26005(gnus-registry-initialize)
26010 26006
@@ -26050,9 +26046,8 @@ following variables.
26050 26046
26051@defvar gnus-registry-track-extra 26047@defvar gnus-registry-track-extra
26052This is a list of symbols, so it's best to change it from the 26048This is a list of symbols, so it's best to change it from the
26053Customize interface. By default it's @code{nil}, but you may want to 26049Customize interface. By default it's @code{(subject sender)}, which
26054track @code{subject} and @code{sender} as well when splitting by parent. 26050may work for you. It can be annoying if your mail flow is large and
26055It may work for you. It can be annoying if your mail flow is large and
26056people don't stick to the same groups. 26051people don't stick to the same groups.
26057@end defvar 26052@end defvar
26058 26053
@@ -26060,7 +26055,8 @@ people don't stick to the same groups.
26060This is a symbol, so it's best to change it from the Customize 26055This is a symbol, so it's best to change it from the Customize
26061interface. By default it's @code{nil}, but you may want to set it to 26056interface. By default it's @code{nil}, but you may want to set it to
26062@code{majority} or @code{first} to split by sender or subject based on 26057@code{majority} or @code{first} to split by sender or subject based on
26063the majority of matches or on the first found. 26058the majority of matches or on the first found. I find @code{majority}
26059works best.
26064@end defvar 26060@end defvar
26065 26061
26066@node Store custom flags and keywords 26062@node Store custom flags and keywords
@@ -26095,17 +26091,12 @@ The registry has a simple API that uses a Message-ID as the key to
26095store arbitrary data (as long as it can be converted to a list for 26091store arbitrary data (as long as it can be converted to a list for
26096storage). 26092storage).
26097 26093
26098@defun gnus-registry-store-extra-entry (id key value) 26094@defun gnus-registry-set-id-key (id key value)
26099Store @code{value} in the extra data key @code{key} for message 26095Store @code{value} under @code{key} for message @code{id}.
26100@code{id}.
26101@end defun
26102
26103@defun gnus-registry-delete-extra-entry (id key)
26104Delete the extra data key @code{key} for message @code{id}.
26105@end defun 26096@end defun
26106 26097
26107@defun gnus-registry-fetch-extra (id key) 26098@defun gnus-registry-get-id-key (id key)
26108Get the extra data key @code{key} for message @code{id}. 26099Get the data under @code{key} for message @code{id}.
26109@end defun 26100@end defun
26110 26101
26111@defvar gnus-registry-extra-entries-precious 26102@defvar gnus-registry-extra-entries-precious
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index e1c4a806de2..2663d2df0f5 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -2812,7 +2812,6 @@ When @value{tramp} does not connect to the remote host, there are three
2812reasons heading the bug mailing list: 2812reasons heading the bug mailing list:
2813 2813
2814@itemize @minus 2814@itemize @minus
2815
2816@item 2815@item
2817Unknown characters in the prompt 2816Unknown characters in the prompt
2818 2817
@@ -2882,7 +2881,6 @@ checksum.
2882 (when (file-remote-p default-directory) 2881 (when (file-remote-p default-directory)
2883 (set (make-local-variable 'file-precious-flag) t)))) 2882 (set (make-local-variable 'file-precious-flag) t))))
2884@end lisp 2883@end lisp
2885
2886@end itemize 2884@end itemize
2887 2885
2888 2886
@@ -3377,14 +3375,43 @@ export EDITOR=/path/to/emacsclient.sh
3377 3375
3378 3376
3379@item 3377@item
3380How can I disable @value{tramp}? 3378There are packages which call @value{tramp} although I haven't entered
3379a remote file name ever. I dislike it, how could I disable it?
3381 3380
3382Shame on you, why did you read until now? 3381In general, @value{tramp} functions are used only when
3382you apply remote file name syntax. However, some packages enable
3383@value{tramp} on their own.
3383 3384
3384@itemize @minus 3385@itemize @minus
3386@item
3387@file{ido.el}
3388
3389You could disable @value{tramp} file name completion:
3390
3391@lisp
3392(custom-set-variables
3393 '(ido-enable-tramp-completion nil))
3394@end lisp
3385 3395
3386@item 3396@item
3397@file{rlogin.el}
3398
3399You could disable remote directory tracking mode:
3400
3401@lisp
3402(rlogin-directory-tracking-mode -1)
3403@end lisp
3404@end itemize
3405
3406
3407@item
3408How can I disable @value{tramp} at all?
3409
3410Shame on you, why did you read until now?
3411
3412@itemize @minus
3387@ifset emacs 3413@ifset emacs
3414@item
3388If you just want to have @value{ftppackagename} as default remote 3415If you just want to have @value{ftppackagename} as default remote
3389files access package, you should apply the following code: 3416files access package, you should apply the following code:
3390 3417
diff --git a/etc/NEWS b/etc/NEWS
index 08d94a4e9cb..869e95216e5 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -131,8 +131,10 @@ for this.
131** ImageMagick support. 131** ImageMagick support.
132It is now possible to use the ImageMagick library to load many new 132It is now possible to use the ImageMagick library to load many new
133image formats in Emacs. By default, Emacs links with the ImageMagick 133image formats in Emacs. By default, Emacs links with the ImageMagick
134libraries if they are present at build time. To disable this, use 134libraries if they are present at build time. This needs ImageMagick
135the configure option `--without-imagemagick'. 1356.2.8 or newer (versions newer than 6.0.7 _may_ work but have not been
136tested). To disable ImageMagick support, use the configure option
137`--without-imagemagick'.
136 138
137The new function `imagemagick-types' returns a list of image file 139The new function `imagemagick-types' returns a list of image file
138extensions that your installation of ImageMagick supports. The 140extensions that your installation of ImageMagick supports. The
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 51f8066077d..bde1f1174c9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,80 @@
12011-04-14 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp-sh.el (tramp-sh-handle-file-attributes): Handle the
4 case when the scripts fail. Use `tramp-do-file-attributes-with-ls'
5 then.
6 (tramp-do-copy-or-rename-file-out-of-band): Do not check any
7 longer, whether`executable-find' is bound.
8
9 * net/tramp-smb.el (tramp-smb-handle-copy-file): Fix docstring.
10
112011-04-14 Stefan Monnier <monnier@iro.umontreal.ca>
12
13 * minibuffer.el (completion-in-region-mode-predicate)
14 (completion-in-region-mode--predicate): New vars.
15 (completion-in-region, completion-in-region--postch)
16 (completion-in-region-mode): Use them.
17 (completion--capf-wrapper): Also return the hook function.
18 (completion-at-point, completion-help-at-point):
19 Adjust and provide a predicate.
20
21 Preserve arg names for advice of subr and lexical functions (bug#8457).
22 * help-fns.el (help-function-arglist): Consolidate the subr and
23 new-byte-code cases. Add argument `preserve-names' to extract names
24 from the docstring when needed.
25 * emacs-lisp/advice.el (ad-define-subr-args, ad-undefine-subr-args)
26 (ad-subr-args-defined-p, ad-get-subr-args, ad-subr-arglist): Remove.
27 (ad-arglist): Use help-function-arglist's new arg.
28 (ad-definition-type): Use cond.
29
302011-04-13 Juanma Barranquero <lekktu@gmail.com>
31
32 * autorevert.el (auto-revert-handler):
33 Bind `remote-file-name-inhibit-cache', not `tramp-cache-inhibit-cache',
34 which was removed in 2010-10-02T13:21:43Z!michael.albinus@gmx.de.
35 Don't quote lambda.
36
37 * image-mode.el (image-transform-set-scale):
38 Fix change in 2011-04-09T20:28:01Z!cyd@stupidchicken.com.
39
402011-04-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
41
42 * net/network-stream.el (network-stream-open-starttls): Only do
43 opportunistic STARTTLS upgrades if we have built-in gnutls support.
44 Upgrades via gnutls-cli are too slow to be done opportunistically.
45
462011-04-12 Juanma Barranquero <lekktu@gmail.com>
47
48 * dframe.el (dframe-current-frame): Remove spurious quote.
49
502011-04-12 Glenn Morris <rgm@gnu.org>
51
52 * calendar/cal-tex.el (cal-tex-end-document):
53 Try to automatically use latin1 input if needed.
54
55 * calendar/cal-hebrew.el (diary-hebrew-rosh-hodesh):
56 Don't try to cons a mark onto an empty element.
57
582011-04-11 Leo Liu <sdl.web@gmail.com>
59
60 * ido.el (ido-buffer-internal): Allow method 'kill for virtual
61 buffers.
62 (ido-kill-buffer-at-head): Support killing virtual buffers.
63
642011-04-10 Chong Yidong <cyd@stupidchicken.com>
65
66 * minibuffer.el (completion-show-inline-help): New var.
67 (completion--do-completion, minibuffer-complete)
68 (minibuffer-force-complete, minibuffer-complete-word): Inhibit
69 minibuffer messages if completion-show-inline-help is nil.
70
71 * icomplete.el (icomplete-mode): Bind completion-show-inline-help
72 to avoid interference from inline help (Bug#5849).
73
12011-04-10 Leo Liu <sdl.web@gmail.com> 742011-04-10 Leo Liu <sdl.web@gmail.com>
2 75
3 * emacs-lisp/tabulated-list.el (tabulated-list-print-entry): Fix 76 * emacs-lisp/tabulated-list.el (tabulated-list-print-entry):
4 typo. 77 Fix typo.
5 78
62011-04-09 Chong Yidong <cyd@stupidchicken.com> 792011-04-09 Chong Yidong <cyd@stupidchicken.com>
7 80
@@ -14,14 +87,14 @@
14 (image-transform-fit-to-width): Handle image-toggle-display-image 87 (image-transform-fit-to-width): Handle image-toggle-display-image
15 and image-transform-resize directly. 88 and image-transform-resize directly.
16 89
172011-04-08 Sho Nakatani <lay.sakura@gmail.com> 902011-04-08 Sho Nakatani <lay.sakura@gmail.com>
18 91
19 * doc-view.el (doc-view-fit-width-to-window) 92 * doc-view.el (doc-view-fit-width-to-window)
20 (doc-view-fit-height-to-window, doc-view-fit-page-to-window): New 93 (doc-view-fit-height-to-window, doc-view-fit-page-to-window):
21 functions for fitting the shown image to the Emacs window size. 94 New functions for fitting the shown image to the Emacs window size.
22 (doc-view-mode-map): Add bindings for the new functions. 95 (doc-view-mode-map): Add bindings for the new functions.
23 96
242011-03-24 Juanma Barranquero <lekktu@gmail.com> 972011-04-08 Juanma Barranquero <lekktu@gmail.com>
25 98
26 * vc-annotate.el (vc-annotate-show-log-revision-at-line): 99 * vc-annotate.el (vc-annotate-show-log-revision-at-line):
27 Fix typo in docstring. 100 Fix typo in docstring.
@@ -101,12 +174,12 @@
101 (package-menu-refresh, list-packages): Use it. 174 (package-menu-refresh, list-packages): Use it.
102 (package-menu--print-info): Renamed from package-print-package. 175 (package-menu--print-info): Renamed from package-print-package.
103 Return insertion data instead of inserting it directly. 176 Return insertion data instead of inserting it directly.
104 (package-menu-describe-package, package-menu-execute): Use 177 (package-menu-describe-package, package-menu-execute):
105 tabulated-list-get-id. 178 Use tabulated-list-get-id.
106 (package-menu-mark-delete, package-menu-mark-install) 179 (package-menu-mark-delete, package-menu-mark-install)
107 (package-menu-mark-unmark, package-menu-backup-unmark) 180 (package-menu-mark-unmark, package-menu-backup-unmark)
108 (package-menu-mark-obsolete-for-deletion): Use 181 (package-menu-mark-obsolete-for-deletion):
109 tabulated-list-put-tag. 182 Use tabulated-list-put-tag.
110 (package--list-packages, package-menu-revert) 183 (package--list-packages, package-menu-revert)
111 (package-menu-get-package, package-menu-get-version) 184 (package-menu-get-package, package-menu-get-version)
112 (package-menu-sort-by-column): Functions deleted. 185 (package-menu-sort-by-column): Functions deleted.
@@ -223,11 +296,11 @@
223 296
2242011-04-02 Chong Yidong <cyd@stupidchicken.com> 2972011-04-02 Chong Yidong <cyd@stupidchicken.com>
225 298
226 * emacs-lisp/package.el (package--with-work-buffer): Recognize 299 * emacs-lisp/package.el (package--with-work-buffer):
227 https URLs. 300 Recognize https URLs.
228 301
229 * net/network-stream.el: Move from gnus/proto-stream.el. Change 302 * net/network-stream.el: Move from gnus/proto-stream.el.
230 prefix to network-stream throughout. 303 Change prefix to network-stream throughout.
231 (open-protocol-stream): Merge into open-network-stream, leaving 304 (open-protocol-stream): Merge into open-network-stream, leaving
232 open-protocol-stream as an alias. Handle nil BUFFER args. 305 open-protocol-stream as an alias. Handle nil BUFFER args.
233 306
@@ -905,10 +978,10 @@
905 978
9062011-03-11 Ken Manheimer <ken.manheimer@gmail.com> 9792011-03-11 Ken Manheimer <ken.manheimer@gmail.com>
907 980
908 * allout-widgets.el (allout-widgets-tally): Initialize 981 * allout-widgets.el (allout-widgets-tally):
909 allout-widgets-tally as a hash table rather than nil to prevent 982 Initialize allout-widgets-tally as a hash table rather than nil to
910 mode-line redisplay warnings. 983 prevent mode-line redisplay warnings. Also, clarify the module
911 Also, clarify the module description and fix a comment typo. 984 description and fix a comment typo.
912 985
9132011-03-11 Juanma Barranquero <lekktu@gmail.com> 9862011-03-11 Juanma Barranquero <lekktu@gmail.com>
914 987
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 2bc7310d7e5..c67b6663bd0 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -434,9 +434,9 @@ This is an internal function used by Auto-Revert Mode."
434 (file-readable-p buffer-file-name) 434 (file-readable-p buffer-file-name)
435 (if auto-revert-tail-mode 435 (if auto-revert-tail-mode
436 ;; Tramp caches the file attributes. Setting 436 ;; Tramp caches the file attributes. Setting
437 ;; `tramp-cache-inhibit' forces Tramp to 437 ;; `remote-file-name-inhibit-cache' forces Tramp
438 ;; reread the values. 438 ;; to reread the values.
439 (let ((tramp-cache-inhibit-cache t)) 439 (let ((remote-file-name-inhibit-cache t))
440 (/= auto-revert-tail-pos 440 (/= auto-revert-tail-pos
441 (setq size 441 (setq size
442 (nth 7 (file-attributes 442 (nth 7 (file-attributes
@@ -460,10 +460,10 @@ This is an internal function used by Auto-Revert Mode."
460 (when buffer-file-name 460 (when buffer-file-name
461 (setq eob (eobp)) 461 (setq eob (eobp))
462 (walk-windows 462 (walk-windows
463 #'(lambda (window) 463 (lambda (window)
464 (and (eq (window-buffer window) buffer) 464 (and (eq (window-buffer window) buffer)
465 (= (window-point window) (point-max)) 465 (= (window-point window) (point-max))
466 (push window eoblist))) 466 (push window eoblist)))
467 'no-mini t)) 467 'no-mini t))
468 (if auto-revert-tail-mode 468 (if auto-revert-tail-mode
469 (auto-revert-tail-handler size) 469 (auto-revert-tail-handler size)
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index e5373a28756..44c3e62a7c2 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -954,16 +954,17 @@ use when highlighting the day in the calendar."
954 (format "%s (second day)" this-month) 954 (format "%s (second day)" this-month)
955 this-month)))) 955 this-month))))
956 (if (= (% d 7) 6) ; Saturday--check for Shabbat Mevarchim 956 (if (= (% d 7) 6) ; Saturday--check for Shabbat Mevarchim
957 (cons mark 957 (cond ((and (> h-day 22) (/= h-month 6) (= 29 last-day))
958 (cond ((and (> h-day 22) (/= h-month 6) (= 29 last-day)) 958 (cons mark
959 (format "Mevarchim Rosh Hodesh %s (%s)" 959 (format "Mevarchim Rosh Hodesh %s (%s)"
960 (aref h-month-names 960 (aref h-month-names
961 (if (= h-month 961 (if (= h-month
962 (calendar-hebrew-last-month-of-year 962 (calendar-hebrew-last-month-of-year
963 h-year)) 963 h-year))
964 0 h-month)) 964 0 h-month))
965 (aref calendar-day-name-array (- 29 h-day)))) 965 (aref calendar-day-name-array (- 29 h-day)))))
966 ((and (< h-day 30) (> h-day 22) (= 30 last-day)) 966 ((and (< h-day 30) (> h-day 22) (= 30 last-day))
967 (cons mark
967 (format "Mevarchim Rosh Hodesh %s (%s-%s)" 968 (format "Mevarchim Rosh Hodesh %s (%s-%s)"
968 (aref h-month-names h-month) 969 (aref h-month-names h-month)
969 (if (= h-day 29) 970 (if (= h-day 29)
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index a3f71107854..2fc215c06c4 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -1587,6 +1587,16 @@ FINAL-SEPARATOR is non-nil."
1587Insert the trailer to LaTeX document, pop to LaTeX buffer, add 1587Insert the trailer to LaTeX document, pop to LaTeX buffer, add
1588informative header, and run HOOK." 1588informative header, and run HOOK."
1589 (cal-tex-e-document) 1589 (cal-tex-e-document)
1590 (or (and cal-tex-preamble-extra
1591 (string-match "inputenc" cal-tex-preamble-extra))
1592 (not (re-search-backward "[^[:ascii:]]" nil 'move))
1593 (progn
1594 (goto-char (point-min))
1595 (when (search-forward "documentclass" nil t)
1596 (forward-line 1)
1597 ;; Eg for some Bahai holidays.
1598 ;; FIXME latin1 might not always be right.
1599 (insert "\\usepackage[latin1]{inputenc}\n"))))
1590 (latex-mode) 1600 (latex-mode)
1591 (pop-to-buffer cal-tex-buffer) 1601 (pop-to-buffer cal-tex-buffer)
1592 (goto-char (point-min)) 1602 (goto-char (point-min))
diff --git a/lisp/dframe.el b/lisp/dframe.el
index 312f49f6053..71773b1abf8 100644
--- a/lisp/dframe.el
+++ b/lisp/dframe.el
@@ -632,7 +632,7 @@ selecting FRAME-VAR."
632FRAME-VAR is the variable storing the currently active dedicated frame. 632FRAME-VAR is the variable storing the currently active dedicated frame.
633If the current frame's buffer uses DESIRED-MAJOR-MODE, then use that frame." 633If the current frame's buffer uses DESIRED-MAJOR-MODE, then use that frame."
634 (if (not (eq (selected-frame) (symbol-value frame-var))) 634 (if (not (eq (selected-frame) (symbol-value frame-var)))
635 (if (and (eq major-mode 'desired-major-mode) 635 (if (and (eq major-mode desired-major-mode)
636 (get-buffer-window (current-buffer)) 636 (get-buffer-window (current-buffer))
637 (window-frame (get-buffer-window (current-buffer)))) 637 (window-frame (get-buffer-window (current-buffer))))
638 (window-frame (get-buffer-window (current-buffer))) 638 (window-frame (get-buffer-window (current-buffer)))
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 39ea97aa98e..5934975e36a 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -503,36 +503,6 @@
503;; exact structure of the original argument list as long as the new argument 503;; exact structure of the original argument list as long as the new argument
504;; list takes a compatible number/magnitude of actual arguments. 504;; list takes a compatible number/magnitude of actual arguments.
505 505
506;; @@@ Definition of subr argument lists:
507;; ======================================
508;; When advice constructs the advised definition of a function it has to
509;; know the argument list of the original function. For functions and macros
510;; the argument list can be determined from the actual definition, however,
511;; for subrs there is no such direct access available. In Lemacs and for some
512;; subrs in Emacs-19 the argument list of a subr can be determined from
513;; its documentation string, in a v18 Emacs even that is not possible. If
514;; advice cannot at all determine the argument list of a subr it uses
515;; `(&rest ad-subr-args)' which will always work but is inefficient because
516;; it conses up arguments. The macro `ad-define-subr-args' can be used by
517;; the advice programmer to explicitly tell advice about the argument list
518;; of a certain subr, for example,
519;;
520;; (ad-define-subr-args 'fset '(sym newdef))
521;;
522;; is used by advice itself to tell a v18 Emacs about the arguments of `fset'.
523;; The following can be used to undo such a definition:
524;;
525;; (ad-undefine-subr-args 'fset)
526;;
527;; The argument list definition is stored on the property list of the subr
528;; name symbol. When an argument list could be determined from the
529;; documentation string it will be cached under that property. The general
530;; mechanism for looking up the argument list of a subr is the following:
531;; 1) look for a definition stored on the property list
532;; 2) if that failed try to infer it from the documentation string and
533;; if successful cache it on the property list
534;; 3) otherwise use `(&rest ad-subr-args)'
535
536;; @@ Activation and deactivation: 506;; @@ Activation and deactivation:
537;; =============================== 507;; ===============================
538;; The definition of an advised function does not change until all its advice 508;; The definition of an advised function does not change until all its advice
@@ -1654,41 +1624,6 @@
1654;; (fii 3 2) 1624;; (fii 3 2)
1655;; 5 1625;; 5
1656;; 1626;;
1657;; @@ Specifying argument lists of subrs:
1658;; ======================================
1659;; The argument lists of subrs cannot be determined directly from Lisp.
1660;; This means that Advice has to use `(&rest ad-subr-args)' as the
1661;; argument list of the advised subr which is not very efficient. In Lemacs
1662;; subr argument lists can be determined from their documentation string, in
1663;; Emacs-19 this is the case for some but not all subrs. To accommodate
1664;; for the cases where the argument lists cannot be determined (e.g., in a
1665;; v18 Emacs) Advice comes with a specification mechanism that allows the
1666;; advice programmer to tell advice what the argument list of a certain subr
1667;; really is.
1668;;
1669;; In a v18 Emacs the following will return the &rest idiom:
1670;;
1671;; (ad-arglist (symbol-function 'car))
1672;; (&rest ad-subr-args)
1673;;
1674;; To tell advice what the argument list of `car' really is we
1675;; can do the following:
1676;;
1677;; (ad-define-subr-args 'car '(list))
1678;; ((list))
1679;;
1680;; Now `ad-arglist' will return the proper argument list (this method is
1681;; actually used by advice itself for the advised definition of `fset'):
1682;;
1683;; (ad-arglist (symbol-function 'car))
1684;; (list)
1685;;
1686;; The defined argument list will be stored on the property list of the
1687;; subr name symbol. When advice looks for a subr argument list it first
1688;; checks for a definition on the property list, if that fails it tries
1689;; to infer it from the documentation string and caches it on the property
1690;; list if it was successful, otherwise `(&rest ad-subr-args)' will be used.
1691;;
1692;; @@ Advising interactive subrs: 1627;; @@ Advising interactive subrs:
1693;; ============================== 1628;; ==============================
1694;; For the most part there is no difference between advising functions and 1629;; For the most part there is no difference between advising functions and
@@ -2536,52 +2471,11 @@ See Info node `(elisp)Computed Advice' for detailed documentation."
2536If DEFINITION could be from a subr then its NAME should be 2471If DEFINITION could be from a subr then its NAME should be
2537supplied to make subr arglist lookup more efficient." 2472supplied to make subr arglist lookup more efficient."
2538 (require 'help-fns) 2473 (require 'help-fns)
2539 (cond 2474 (help-function-arglist
2540 ((or (ad-macro-p definition) (ad-advice-p definition)) 2475 (if (or (ad-macro-p definition) (ad-advice-p definition))
2541 (help-function-arglist (cdr definition))) 2476 (cdr definition)
2542 (t (help-function-arglist definition)))) 2477 definition)
2543 2478 'preserve-names))
2544;; Store subr-args as `((arg1 arg2 ...))' so I can distinguish
2545;; a defined empty arglist `(nil)' from an undefined arglist:
2546(defmacro ad-define-subr-args (subr arglist)
2547 `(put ,subr 'ad-subr-arglist (list ,arglist)))
2548(defmacro ad-undefine-subr-args (subr)
2549 `(put ,subr 'ad-subr-arglist nil))
2550(defmacro ad-subr-args-defined-p (subr)
2551 `(get ,subr 'ad-subr-arglist))
2552(defmacro ad-get-subr-args (subr)
2553 `(car (get ,subr 'ad-subr-arglist)))
2554
2555(defun ad-subr-arglist (subr-name)
2556 "Retrieve arglist of the subr with SUBR-NAME.
2557Either use the one stored under the `ad-subr-arglist' property,
2558or try to retrieve it from the docstring and cache it under
2559that property, or otherwise use `(&rest ad-subr-args)'."
2560 (if (ad-subr-args-defined-p subr-name)
2561 (ad-get-subr-args subr-name)
2562 ;; says jwz: Should use this for Lemacs 19.8 and above:
2563 ;;((fboundp 'subr-min-args)
2564 ;; ...)
2565 ;; says hans: I guess what Jamie means is that I should use the values
2566 ;; of `subr-min-args' and `subr-max-args' to construct the subr arglist
2567 ;; without having to look it up via parsing the docstring, e.g.,
2568 ;; values 1 and 2 would suggest `(arg1 &optional arg2)' as an
2569 ;; argument list. However, that won't work because there is no
2570 ;; way to distinguish a subr with args `(a &optional b &rest c)' from
2571 ;; one with args `(a &rest c)' using that mechanism. Also, the argument
2572 ;; names from the docstring are more meaningful. Hence, I'll stick with
2573 ;; the old way of doing things.
2574 (let ((doc (or (ad-real-documentation subr-name t) "")))
2575 (if (not (string-match "\n\n\\((.+)\\)\\'" doc))
2576 ;; Signalling an error leads to bugs during bootstrapping because
2577 ;; the DOC file is not yet built (which is an error, BTW).
2578 ;; (error "The usage info is missing from the subr %s" subr-name)
2579 '(&rest ad-subr-args)
2580 (ad-define-subr-args
2581 subr-name
2582 (cdr (car (read-from-string
2583 (downcase (match-string 1 doc))))))
2584 (ad-get-subr-args subr-name)))))
2585 2479
2586(defun ad-docstring (definition) 2480(defun ad-docstring (definition)
2587 "Return the unexpanded docstring of DEFINITION." 2481 "Return the unexpanded docstring of DEFINITION."
@@ -2629,17 +2523,16 @@ definition (see the code for `documentation')."
2629 2523
2630(defun ad-definition-type (definition) 2524(defun ad-definition-type (definition)
2631 "Return symbol that describes the type of DEFINITION." 2525 "Return symbol that describes the type of DEFINITION."
2632 (if (ad-macro-p definition) 2526 (cond
2633 'macro 2527 ((ad-macro-p definition) 'macro)
2634 (if (ad-subr-p definition) 2528 ((ad-subr-p definition)
2635 (if (ad-special-form-p definition) 2529 (if (ad-special-form-p definition)
2636 'special-form 2530 'special-form
2637 'subr) 2531 'subr))
2638 (if (or (ad-lambda-p definition) 2532 ((or (ad-lambda-p definition)
2639 (ad-compiled-p definition)) 2533 (ad-compiled-p definition))
2640 'function 2534 'function)
2641 (if (ad-advice-p definition) 2535 ((ad-advice-p definition) 'advice)))
2642 'advice)))))
2643 2536
2644(defun ad-has-proper-definition (function) 2537(defun ad-has-proper-definition (function)
2645 "True if FUNCTION is a symbol with a proper definition. 2538 "True if FUNCTION is a symbol with a proper definition.
@@ -3921,10 +3814,6 @@ undone on exit of this macro."
3921;; Use the advice mechanism to advise `documentation' to make it 3814;; Use the advice mechanism to advise `documentation' to make it
3922;; generate proper documentation strings for advised definitions: 3815;; generate proper documentation strings for advised definitions:
3923 3816
3924;; This makes sure we get the right arglist for `documentation'
3925;; during bootstrapping.
3926(ad-define-subr-args 'documentation '(function &optional raw))
3927
3928;; @@ Starting, stopping and recovering from the advice package magic: 3817;; @@ Starting, stopping and recovering from the advice package magic:
3929;; =================================================================== 3818;; ===================================================================
3930 3819
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index baabe5f65b9..cc5156610be 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,52 @@
12011-04-14 Teodor Zlatanov <tzz@lifelogs.com>
2
3 * gnus-registry.el: Updated gnus-registry docs.
4
52011-04-12 Teodor Zlatanov <tzz@lifelogs.com>
6
7 * gnus-registry.el (gnus-registry--split-fancy-with-parent-internal):
8 Fix logic bug.
9 (gnus-registry-post-process-groups): Fix logging of no results and
10 quote sender and subject.
11
122011-04-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13
14 * gnus-start.el (gnus-get-unread-articles): Slight cleanup.
15 (gnus-read-active-for-groups): Don't try to finish getting stuff where
16 we had no early-data returned.
17 (gnus-get-unread-articles): Add a sanity check so that we don't issue
18 two async commands to the same server at the same time.
19
202011-04-12 Stig Sandbeck Mathisen <ssm@fnord.no> (tiny change)
21
22 * gnus-sum.el (gnus-summary-select-article-buffer): Doc fix.
23
242011-04-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
25
26 * gnus-registry.el (gnus-registry-remake-db): Put the warning on a
27 "warning" level.
28
29 * mm-url.el (mm-url-package-name): Removed to ease third-party reuse.
30 (mm-url-insert-file-contents): Don't set the package names.
31
322011-04-11 Teodor Zlatanov <tzz@lifelogs.com>
33
34 * gnus-registry.el (gnus-registry-action): Remove properties and
35 simplify subject in `gnus-registry-handle-action'.
36 (gnus-registry-spool-action): Get subject and sender from message if
37 they are not passed in.
38 (gnus-registry-handle-action): Remove properties and simplify subject
39 consistently.
40
412011-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
42
43 * registry.el: Require CL before using defmacro*.
44
452011-04-11 Katsumi Yamaoka <yamaoka@jpl.org>
46
47 * gnus-art.el (article-treat-date): Assume that
48 gnus-article-date-headers may be a group parameter.
49
12011-04-07 Teodor Zlatanov <tzz@lifelogs.com> 502011-04-07 Teodor Zlatanov <tzz@lifelogs.com>
2 51
3 * gnus-registry.el (gnus-registry-handle-action): More debugging. 52 * gnus-registry.el (gnus-registry-handle-action): More debugging.
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 97677988f0a..e03c787d995 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -3407,7 +3407,11 @@ lines forward."
3407 (setq ended t))))) 3407 (setq ended t)))))
3408 3408
3409(defun article-treat-date () 3409(defun article-treat-date ()
3410 (article-date-ut gnus-article-date-headers t)) 3410 (article-date-ut (if (gnus-buffer-live-p gnus-summary-buffer)
3411 (with-current-buffer gnus-summary-buffer
3412 gnus-article-date-headers)
3413 gnus-article-date-headers)
3414 t))
3411 3415
3412(defun article-date-ut (&optional type highlight date-position) 3416(defun article-date-ut (&optional type highlight date-position)
3413 "Convert DATE date to TYPE in the current article. 3417 "Convert DATE date to TYPE in the current article.
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index 9824fc26f16..9f95ce756ab 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -33,9 +33,10 @@
33;; you, submit a bug report and I'll be glad to fix it. It needs 33;; you, submit a bug report and I'll be glad to fix it. It needs
34;; documentation in the manual (also on my to-do list). 34;; documentation in the manual (also on my to-do list).
35 35
36;; Put this in your startup file (~/.gnus.el for instance) 36;; Put this in your startup file (~/.gnus.el for instance) or use Customize:
37 37
38;; (setq gnus-registry-max-entries 2500) 38;; (setq gnus-registry-max-entries 2500
39;; gnus-registry-track-extra '(sender subject))
39 40
40;; (gnus-registry-initialize) 41;; (gnus-registry-initialize)
41 42
@@ -258,7 +259,7 @@ the Bit Bucket."
258This is not required after changing `gnus-registry-cache-file'." 259This is not required after changing `gnus-registry-cache-file'."
259 (interactive (list (y-or-n-p "Remake and CLEAR the Gnus registry? "))) 260 (interactive (list (y-or-n-p "Remake and CLEAR the Gnus registry? ")))
260 (when forsure 261 (when forsure
261 (gnus-message 1 "Remaking the Gnus registry") 262 (gnus-message 4 "Remaking the Gnus registry")
262 (setq gnus-registry-db (gnus-registry-make-db)))) 263 (setq gnus-registry-db (gnus-registry-make-db))))
263 264
264(defun gnus-registry-read () 265(defun gnus-registry-read ()
@@ -294,11 +295,8 @@ This is not required after changing `gnus-registry-cache-file'."
294;; article move/copy/spool/delete actions 295;; article move/copy/spool/delete actions
295(defun gnus-registry-action (action data-header from &optional to method) 296(defun gnus-registry-action (action data-header from &optional to method)
296 (let* ((id (mail-header-id data-header)) 297 (let* ((id (mail-header-id data-header))
297 (subject (gnus-string-remove-all-properties 298 (subject (mail-header-subject data-header))
298 (gnus-registry-simplify-subject 299 (sender (mail-header-from data-header))
299 (mail-header-subject data-header))))
300 (sender (gnus-string-remove-all-properties
301 (mail-header-from data-header)))
302 (from (gnus-group-guess-full-name-from-command-method from)) 300 (from (gnus-group-guess-full-name-from-command-method from))
303 (to (if to (gnus-group-guess-full-name-from-command-method to) nil)) 301 (to (if to (gnus-group-guess-full-name-from-command-method to) nil))
304 (to-name (if to to "the Bit Bucket"))) 302 (to-name (if to to "the Bit Bucket")))
@@ -312,7 +310,9 @@ This is not required after changing `gnus-registry-cache-file'."
312 to subject sender))) 310 to subject sender)))
313 311
314(defun gnus-registry-spool-action (id group &optional subject sender) 312(defun gnus-registry-spool-action (id group &optional subject sender)
315 (let ((to (gnus-group-guess-full-name-from-command-method group))) 313 (let ((to (gnus-group-guess-full-name-from-command-method group))
314 (subject (or subject (message-fetch-field "subject")))
315 (sender (or sender (message-fetch-field "from"))))
316 (when (and (stringp id) (string-match "\r$" id)) 316 (when (and (stringp id) (string-match "\r$" id))
317 (setq id (substring id 0 -1))) 317 (setq id (substring id 0 -1)))
318 (gnus-message 7 "Gnus registry: article %s spooled to %s" 318 (gnus-message 7 "Gnus registry: article %s spooled to %s"
@@ -326,7 +326,10 @@ This is not required after changing `gnus-registry-cache-file'."
326 "gnus-registry-handle-action %S" (list id from to subject sender)) 326 "gnus-registry-handle-action %S" (list id from to subject sender))
327 (let ((db gnus-registry-db) 327 (let ((db gnus-registry-db)
328 ;; safe if not found 328 ;; safe if not found
329 (entry (gnus-registry-get-or-make-entry id))) 329 (entry (gnus-registry-get-or-make-entry id))
330 (subject (gnus-string-remove-all-properties
331 (gnus-registry-simplify-subject subject)))
332 (sender (gnus-string-remove-all-properties sender)))
330 333
331 ;; this could be done by calling `gnus-registry-set-id-key' 334 ;; this could be done by calling `gnus-registry-set-id-key'
332 ;; several times but it's better to bunch the transactions 335 ;; several times but it's better to bunch the transactions
@@ -426,9 +429,9 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
426 (when (and (null found) 429 (when (and (null found)
427 (memq 'sender gnus-registry-track-extra) 430 (memq 'sender gnus-registry-track-extra)
428 sender 431 sender
429 (gnus-grep-in-list 432 (not (gnus-grep-in-list
430 sender 433 sender
431 gnus-registry-unfollowed-addresses)) 434 gnus-registry-unfollowed-addresses)))
432 (let ((groups (apply 435 (let ((groups (apply
433 'append 436 'append
434 (mapcar 437 (mapcar
@@ -562,12 +565,12 @@ possible. Uses `gnus-registry-split-strategy'."
562 ((null out) 565 ((null out)
563 (gnus-message 566 (gnus-message
564 5 567 5
565 "%s: no matches for %s %s." 568 "%s: no matches for %s '%s'."
566 log-agent out mode key) 569 log-agent mode key)
567 nil) 570 nil)
568 (t (gnus-message 571 (t (gnus-message
569 5 572 5
570 "%s: too many extra matches (%s) for %s %s. Returning none." 573 "%s: too many extra matches (%s) for %s '%s'. Returning none."
571 log-agent out mode key) 574 log-agent out mode key)
572 nil)))) 575 nil))))
573 576
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index d9d218c6cba..e3b0089cea9 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -1699,33 +1699,43 @@ If SCAN, request a scan of that group as well."
1699 (gnus-read-active-file-1 method nil)))) 1699 (gnus-read-active-file-1 method nil))))
1700 1700
1701 ;; Start early async retrieval of data. 1701 ;; Start early async retrieval of data.
1702 (dolist (elem type-cache) 1702 (let ((done-methods nil)
1703 (destructuring-bind (method method-type infos dummy) elem 1703 sanity-spec)
1704 (when (and method infos 1704 (dolist (elem type-cache)
1705 (not (gnus-method-denied-p method))) 1705 (destructuring-bind (method method-type infos dummy) elem
1706 ;; If the open-server method doesn't exist, then the method 1706 (setq sanity-spec (list (car method) (cadr method)))
1707 ;; itself doesn't exist, so we ignore it. 1707 (when (and method infos
1708 (if (not (ignore-errors (gnus-get-function method 'open-server))) 1708 (not (gnus-method-denied-p method)))
1709 (setq type-cache (delq elem type-cache)) 1709 ;; If the open-server method doesn't exist, then the method
1710 (unless (gnus-server-opened method) 1710 ;; itself doesn't exist, so we ignore it.
1711 (gnus-open-server method)) 1711 (if (not (ignore-errors (gnus-get-function method 'open-server)))
1712 (when (and 1712 (setq type-cache (delq elem type-cache))
1713 (gnus-server-opened method) 1713 (unless (gnus-server-opened method)
1714 (gnus-check-backend-function 1714 (gnus-open-server method))
1715 'retrieve-group-data-early (car method))) 1715 (when (and
1716 (when (gnus-check-backend-function 'request-scan (car method)) 1716 ;; This is a sanity check, so that we never
1717 (gnus-request-scan nil method)) 1717 ;; attempt to start two async requests to the
1718 ;; Store the token we get back from -early so that we 1718 ;; same server, because that will fail. This
1719 ;; can pass it to -finish later. 1719 ;; should never happen, since the methods should
1720 (setcar (nthcdr 3 elem) 1720 ;; be unique at this point, but apparently it
1721 (gnus-retrieve-group-data-early method infos))))))) 1721 ;; does happen in the wild with some setups.
1722 (not (member sanity-spec done-methods))
1723 (gnus-server-opened method)
1724 (gnus-check-backend-function
1725 'retrieve-group-data-early (car method)))
1726 (push sanity-spec done-methods)
1727 (when (gnus-check-backend-function 'request-scan (car method))
1728 (gnus-request-scan nil method))
1729 ;; Store the token we get back from -early so that we
1730 ;; can pass it to -finish later.
1731 (setcar (nthcdr 3 elem)
1732 (gnus-retrieve-group-data-early method infos))))))))
1722 1733
1723 ;; Do the rest of the retrieval. 1734 ;; Do the rest of the retrieval.
1724 (dolist (elem type-cache) 1735 (dolist (elem type-cache)
1725 (destructuring-bind (method method-type infos early-data) elem 1736 (destructuring-bind (method method-type infos early-data) elem
1726 (when (and method infos 1737 (when (and method infos
1727 (not (eq (gnus-server-status method) 1738 (not (gnus-method-denied-p method)))
1728 'denied)))
1729 (let ((updatep (gnus-check-backend-function 1739 (let ((updatep (gnus-check-backend-function
1730 'request-update-info (car method)))) 1740 'request-update-info (car method))))
1731 ;; See if any of the groups from this method require updating. 1741 ;; See if any of the groups from this method require updating.
@@ -1763,6 +1773,7 @@ If SCAN, request a scan of that group as well."
1763 ;; Finish up getting the data from the methods that have -early 1773 ;; Finish up getting the data from the methods that have -early
1764 ;; methods. 1774 ;; methods.
1765 ((and 1775 ((and
1776 early-data
1766 (gnus-check-backend-function 'finish-retrieve-group-infos (car method)) 1777 (gnus-check-backend-function 'finish-retrieve-group-infos (car method))
1767 (or (not (gnus-agent-method-p method)) 1778 (or (not (gnus-agent-method-p method))
1768 (gnus-online method))) 1779 (gnus-online method)))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index e3ae1d7f528..d023bc5bb63 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -7035,7 +7035,7 @@ displayed, no centering will be performed."
7035 7035
7036(defun gnus-summary-select-article-buffer () 7036(defun gnus-summary-select-article-buffer ()
7037 "Reconfigure windows to show the article buffer. 7037 "Reconfigure windows to show the article buffer.
7038If `gnus-widen-article-buffer' is set, show only the article 7038If `gnus-widen-article-window' is set, show only the article
7039buffer." 7039buffer."
7040 (interactive) 7040 (interactive)
7041 (if (not (gnus-buffer-live-p gnus-article-buffer)) 7041 (if (not (gnus-buffer-live-p gnus-article-buffer))
diff --git a/lisp/gnus/mm-url.el b/lisp/gnus/mm-url.el
index 498d0612519..2ce3791ef3d 100644
--- a/lisp/gnus/mm-url.el
+++ b/lisp/gnus/mm-url.el
@@ -83,13 +83,6 @@ Likely values are `wget', `w3m', `lynx' and `curl'."
83 83
84;;; Internal variables 84;;; Internal variables
85 85
86(defvar mm-url-package-name
87 (gnus-replace-in-string
88 (gnus-replace-in-string gnus-version " v.*$" "")
89 " " "-"))
90
91(defvar mm-url-package-version gnus-version-number)
92
93;; Stolen from w3. 86;; Stolen from w3.
94(defvar mm-url-html-entities 87(defvar mm-url-html-entities
95 '( 88 '(
@@ -298,10 +291,6 @@ If `mm-url-use-external' is non-nil, use `mm-url-program'."
298 (if (not (and (boundp 'url-version) 291 (if (not (and (boundp 'url-version)
299 (equal url-version "Emacs"))) 292 (equal url-version "Emacs")))
300 (list (cons "Connection" "Close")))) 293 (list (cons "Connection" "Close"))))
301 (url-package-name (or mm-url-package-name
302 url-package-name))
303 (url-package-version (or mm-url-package-version
304 url-package-version))
305 result) 294 result)
306 (setq result (url-insert-file-contents url)) 295 (setq result (url-insert-file-contents url))
307 (save-excursion 296 (save-excursion
diff --git a/lisp/gnus/registry.el b/lisp/gnus/registry.el
index 3c402cb361a..23e75815979 100644
--- a/lisp/gnus/registry.el
+++ b/lisp/gnus/registry.el
@@ -77,14 +77,14 @@
77 77
78;;; Code: 78;;; Code:
79 79
80(eval-when-compile (require 'cl))
81
80(eval-when-compile 82(eval-when-compile
81 (when (null (ignore-errors (require 'ert))) 83 (when (null (ignore-errors (require 'ert)))
82 (defmacro* ert-deftest (name () &body docstring-keys-and-body)))) 84 (defmacro* ert-deftest (name () &body docstring-keys-and-body))))
83 85
84(ignore-errors 86(ignore-errors
85 (require 'ert)) 87 (require 'ert))
86
87(eval-when-compile (require 'cl))
88(eval-and-compile 88(eval-and-compile
89 (or (ignore-errors (progn 89 (or (ignore-errors (progn
90 (require 'eieio) 90 (require 'eieio)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 206a9af3a90..97ce7ca44ef 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -99,46 +99,55 @@ ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"."
99 (format "%S" (help-make-usage 'fn arglist)))))) 99 (format "%S" (help-make-usage 'fn arglist))))))
100 100
101;; FIXME: Move to subr.el? 101;; FIXME: Move to subr.el?
102(defun help-function-arglist (def) 102(defun help-function-arglist (def &optional preserve-names)
103 "Return a formal argument list for the function DEF.
104IF PRESERVE-NAMES is non-nil, return a formal arglist that uses
105the same names as used in the original source code, when possible."
103 ;; Handle symbols aliased to other symbols. 106 ;; Handle symbols aliased to other symbols.
104 (if (and (symbolp def) (fboundp def)) (setq def (indirect-function def))) 107 (if (and (symbolp def) (fboundp def)) (setq def (indirect-function def)))
105 ;; If definition is a macro, find the function inside it. 108 ;; If definition is a macro, find the function inside it.
106 (if (eq (car-safe def) 'macro) (setq def (cdr def))) 109 (if (eq (car-safe def) 'macro) (setq def (cdr def)))
107 (cond 110 (cond
108 ((and (byte-code-function-p def) (integerp (aref def 0))) 111 ((and (byte-code-function-p def) (listp (aref def 0))) (aref def 0))
109 (let* ((args-desc (aref def 0))
110 (max (lsh args-desc -8))
111 (min (logand args-desc 127))
112 (rest (logand args-desc 128))
113 (arglist ()))
114 (dotimes (i min)
115 (push (intern (concat "arg" (number-to-string (1+ i)))) arglist))
116 (when (> max min)
117 (push '&optional arglist)
118 (dotimes (i (- max min))
119 (push (intern (concat "arg" (number-to-string (+ 1 i min))))
120 arglist)))
121 (unless (zerop rest) (push '&rest arglist) (push 'rest arglist))
122 (nreverse arglist)))
123 ((byte-code-function-p def) (aref def 0))
124 ((eq (car-safe def) 'lambda) (nth 1 def)) 112 ((eq (car-safe def) 'lambda) (nth 1 def))
125 ((eq (car-safe def) 'closure) (nth 2 def)) 113 ((eq (car-safe def) 'closure) (nth 2 def))
126 ((subrp def) 114 ((or (and (byte-code-function-p def) (integerp (aref def 0)))
127 (let ((arity (subr-arity def)) 115 (subrp def))
128 (arglist ())) 116 (or (when preserve-names
129 (dotimes (i (car arity)) 117 (let* ((doc (condition-case nil (documentation def) (error nil)))
130 (push (intern (concat "arg" (number-to-string (1+ i)))) arglist)) 118 (docargs (if doc (car (help-split-fundoc doc nil))))
131 (cond 119 (arglist (if docargs
132 ((not (numberp (cdr arglist))) 120 (cdar (read-from-string (downcase docargs)))))
133 (push '&rest arglist) 121 (valid t))
134 (push 'rest arglist)) 122 ;; Check validity.
135 ((< (car arity) (cdr arity)) 123 (dolist (arg arglist)
136 (push '&optional arglist) 124 (unless (and (symbolp arg)
137 (dotimes (i (- (cdr arity) (car arity))) 125 (let ((name (symbol-name arg)))
138 (push (intern (concat "arg" (number-to-string 126 (if (eq (aref name 0) ?&)
139 (+ 1 i (car arity))))) 127 (memq arg '(&rest &optional))
140 arglist)))) 128 (not (string-match "\\." name)))))
141 (nreverse arglist))) 129 (setq valid nil)))
130 (when valid arglist)))
131 (let* ((args-desc (if (not (subrp def))
132 (aref def 0)
133 (let ((a (subr-arity def)))
134 (logior (car a)
135 (if (numberp (cdr a))
136 (lsh (cdr a) 8)
137 (lsh 1 7))))))
138 (max (lsh args-desc -8))
139 (min (logand args-desc 127))
140 (rest (logand args-desc 128))
141 (arglist ()))
142 (dotimes (i min)
143 (push (intern (concat "arg" (number-to-string (1+ i)))) arglist))
144 (when (> max min)
145 (push '&optional arglist)
146 (dotimes (i (- max min))
147 (push (intern (concat "arg" (number-to-string (+ 1 i min))))
148 arglist)))
149 (unless (zerop rest) (push '&rest arglist) (push 'rest arglist))
150 (nreverse arglist))))
142 ((and (eq (car-safe def) 'autoload) (not (eq (nth 4 def) 'keymap))) 151 ((and (eq (car-safe def) 'autoload) (not (eq (nth 4 def) 'keymap)))
143 "[Arg list not available until function definition is loaded.]") 152 "[Arg list not available until function definition is loaded.]")
144 (t t))) 153 (t t)))
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 490b2b2ebfc..ab67fcfcdfd 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -179,8 +179,11 @@ otherwise turn it off."
179 (if icomplete-mode 179 (if icomplete-mode
180 ;; The following is not really necessary after first time - 180 ;; The following is not really necessary after first time -
181 ;; no great loss. 181 ;; no great loss.
182 (add-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup) 182 (progn
183 (remove-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup))) 183 (setq completion-show-inline-help nil)
184 (add-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup))
185 (remove-hook 'minibuffer-setup-hook 'icomplete-minibuffer-setup)
186 (setq completion-show-inline-help t)))
184 187
185;;;_ > icomplete-simple-completing-p () 188;;;_ > icomplete-simple-completing-p ()
186(defun icomplete-simple-completing-p () 189(defun icomplete-simple-completing-p ()
diff --git a/lisp/ido.el b/lisp/ido.el
index 0ce83d9b88c..9606879ce70 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -2176,9 +2176,7 @@ If cursor is not at the end of the user input, move to end of input."
2176 (ido-current-directory nil) 2176 (ido-current-directory nil)
2177 (ido-directory-nonreadable nil) 2177 (ido-directory-nonreadable nil)
2178 (ido-directory-too-big nil) 2178 (ido-directory-too-big nil)
2179 (ido-use-virtual-buffers (if (eq method 'kill) 2179 (ido-use-virtual-buffers ido-use-virtual-buffers)
2180 nil ;; Don't consider virtual buffers for killing
2181 ido-use-virtual-buffers))
2182 (require-match (confirm-nonexistent-file-or-buffer)) 2180 (require-match (confirm-nonexistent-file-or-buffer))
2183 (buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default 2181 (buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default
2184 require-match initial)) 2182 require-match initial))
@@ -3917,10 +3915,10 @@ If cursor is not at the end of the user input, delete to end of input."
3917 (let ((enable-recursive-minibuffers t) 3915 (let ((enable-recursive-minibuffers t)
3918 (buf (ido-name (car ido-matches))) 3916 (buf (ido-name (car ido-matches)))
3919 (nextbuf (cadr ido-matches))) 3917 (nextbuf (cadr ido-matches)))
3920 (when (get-buffer buf) 3918 (cond
3919 ((get-buffer buf)
3921 ;; If next match names a buffer use the buffer object; buffer 3920 ;; If next match names a buffer use the buffer object; buffer
3922 ;; name may be changed by packages such as uniquify; mindful 3921 ;; name may be changed by packages such as uniquify.
3923 ;; of virtual buffers.
3924 (when (and nextbuf (get-buffer nextbuf)) 3922 (when (and nextbuf (get-buffer nextbuf))
3925 (setq nextbuf (get-buffer nextbuf))) 3923 (setq nextbuf (get-buffer nextbuf)))
3926 (if (null (kill-buffer buf)) 3924 (if (null (kill-buffer buf))
@@ -3934,7 +3932,13 @@ If cursor is not at the end of the user input, delete to end of input."
3934 (setq ido-default-item nextbuf 3932 (setq ido-default-item nextbuf
3935 ido-text-init ido-text 3933 ido-text-init ido-text
3936 ido-exit 'refresh) 3934 ido-exit 'refresh)
3937 (exit-minibuffer)))))) 3935 (exit-minibuffer)))
3936 ;; Handle virtual buffers
3937 ((assoc buf ido-virtual-buffers)
3938 (setq recentf-list
3939 (delete (cdr (assoc buf ido-virtual-buffers)) recentf-list))
3940 (setq ido-cur-list (delete buf ido-cur-list))
3941 (setq ido-rescan t))))))
3938 3942
3939;;; DELETE CURRENT FILE 3943;;; DELETE CURRENT FILE
3940(defun ido-delete-file-at-head () 3944(defun ido-delete-file-at-head ()
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 96d874dbec6..c99689f33ad 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -610,7 +610,7 @@ takes effect only if Emacs is compiled with ImageMagick support."
610This command has no effect unless Emacs is compiled with 610This command has no effect unless Emacs is compiled with
611ImageMagick support." 611ImageMagick support."
612 (interactive "nScale: ") 612 (interactive "nScale: ")
613 (setq image-transform-resize resize) 613 (setq image-transform-resize scale)
614 (image-toggle-display-image)) 614 (image-toggle-display-image))
615 615
616(defun image-transform-fit-to-height () 616(defun image-transform-fit-to-height ()
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 19084aad5d6..0d26d6bdcf6 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -58,6 +58,10 @@
58 58
59;;; Todo: 59;;; Todo:
60 60
61;; - completion-insert-complete-hook (called after inserting a complete
62;; completion), typically used for "complete-abbrev" where it would expand
63;; the abbrev. Tho we'd probably want to provide it from the
64;; completion-table.
61;; - extend `boundaries' to provide various other meta-data about the 65;; - extend `boundaries' to provide various other meta-data about the
62;; output of `all-completions': 66;; output of `all-completions':
63;; - preferred sorting order when displayed in *Completions*. 67;; - preferred sorting order when displayed in *Completions*.
@@ -381,6 +385,9 @@ If the current buffer is not a minibuffer, erase its entire contents."
381 ;; is on, the field doesn't cover the entire minibuffer contents. 385 ;; is on, the field doesn't cover the entire minibuffer contents.
382 (delete-region (minibuffer-prompt-end) (point-max))) 386 (delete-region (minibuffer-prompt-end) (point-max)))
383 387
388(defvar completion-show-inline-help t
389 "If non-nil, print helpful inline messages during completion.")
390
384(defcustom completion-auto-help t 391(defcustom completion-auto-help t
385 "Non-nil means automatically provide help for invalid completion input. 392 "Non-nil means automatically provide help for invalid completion input.
386If the value is t the *Completion* buffer is displayed whenever completion 393If the value is t the *Completion* buffer is displayed whenever completion
@@ -568,8 +575,9 @@ E = after completion we now have an Exact match.
568 (cond 575 (cond
569 ((null comp) 576 ((null comp)
570 (minibuffer-hide-completions) 577 (minibuffer-hide-completions)
571 (unless completion-fail-discreetly 578 (when (and (not completion-fail-discreetly) completion-show-inline-help)
572 (ding) (minibuffer-message "No match")) 579 (ding)
580 (minibuffer-message "No match"))
573 (minibuffer--bitset nil nil nil)) 581 (minibuffer--bitset nil nil nil))
574 ((eq t comp) 582 ((eq t comp)
575 (minibuffer-hide-completions) 583 (minibuffer-hide-completions)
@@ -639,9 +647,10 @@ E = after completion we now have an Exact match.
639 (minibuffer-hide-completions)) 647 (minibuffer-hide-completions))
640 ;; Show the completion table, if requested. 648 ;; Show the completion table, if requested.
641 ((not exact) 649 ((not exact)
642 (if (case completion-auto-help 650 (if (cond ((null completion-show-inline-help) t)
643 (lazy (eq this-command last-command)) 651 ((eq completion-auto-help 'lazy)
644 (t completion-auto-help)) 652 (eq this-command last-command))
653 (t completion-auto-help))
645 (minibuffer-completion-help) 654 (minibuffer-completion-help)
646 (minibuffer-message "Next char not unique"))) 655 (minibuffer-message "Next char not unique")))
647 ;; If the last exact completion and this one were the same, it 656 ;; If the last exact completion and this one were the same, it
@@ -683,9 +692,11 @@ scroll the window of possible completions."
683 t) 692 t)
684 (t (case (completion--do-completion) 693 (t (case (completion--do-completion)
685 (#b000 nil) 694 (#b000 nil)
686 (#b001 (minibuffer-message "Sole completion") 695 (#b001 (if completion-show-inline-help
696 (minibuffer-message "Sole completion"))
687 t) 697 t)
688 (#b011 (minibuffer-message "Complete, but not unique") 698 (#b011 (if completion-show-inline-help
699 (minibuffer-message "Complete, but not unique"))
689 t) 700 t)
690 (t t))))) 701 (t t)))))
691 702
@@ -743,7 +754,9 @@ Repeated uses step through the possible completions."
743 (end (field-end)) 754 (end (field-end))
744 (all (completion-all-sorted-completions))) 755 (all (completion-all-sorted-completions)))
745 (if (not (consp all)) 756 (if (not (consp all))
746 (minibuffer-message (if all "No more completions" "No completions")) 757 (if completion-show-inline-help
758 (minibuffer-message
759 (if all "No more completions" "No completions")))
747 (setq completion-cycling t) 760 (setq completion-cycling t)
748 (goto-char end) 761 (goto-char end)
749 (insert (car all)) 762 (insert (car all))
@@ -931,9 +944,11 @@ Return nil if there is no valid completion, else t."
931 (interactive) 944 (interactive)
932 (case (completion--do-completion 'completion--try-word-completion) 945 (case (completion--do-completion 'completion--try-word-completion)
933 (#b000 nil) 946 (#b000 nil)
934 (#b001 (minibuffer-message "Sole completion") 947 (#b001 (if completion-show-inline-help
948 (minibuffer-message "Sole completion"))
935 t) 949 t)
936 (#b011 (minibuffer-message "Complete, but not unique") 950 (#b011 (if completion-show-inline-help
951 (minibuffer-message "Complete, but not unique"))
937 t) 952 t)
938 (t t))) 953 (t t)))
939 954
@@ -1243,12 +1258,22 @@ and PREDICATE, either by calling NEXT-FUN or by doing it themselves.")
1243 1258
1244(defvar completion-in-region--data nil) 1259(defvar completion-in-region--data nil)
1245 1260
1261(defvar completion-in-region-mode-predicate nil
1262 "Predicate to tell `completion-in-region-mode' when to exit.
1263It is called with no argument and should return nil when
1264`completion-in-region-mode' should exit (and hence pop down
1265the *Completions* buffer).")
1266
1267(defvar completion-in-region-mode--predicate nil
1268 "Copy of the value of `completion-in-region-mode-predicate'.
1269This holds the value `completion-in-region-mode-predicate' had when
1270we entered `completion-in-region-mode'.")
1271
1246(defun completion-in-region (start end collection &optional predicate) 1272(defun completion-in-region (start end collection &optional predicate)
1247 "Complete the text between START and END using COLLECTION. 1273 "Complete the text between START and END using COLLECTION.
1248Return nil if there is no valid completion, else t. 1274Return nil if there is no valid completion, else t.
1249Point needs to be somewhere between START and END." 1275Point needs to be somewhere between START and END."
1250 (assert (<= start (point)) (<= (point) end)) 1276 (assert (<= start (point)) (<= (point) end))
1251 ;; FIXME: undisplay the *Completions* buffer once the completion is done.
1252 (with-wrapper-hook 1277 (with-wrapper-hook
1253 ;; FIXME: Maybe we should use this hook to provide a "display 1278 ;; FIXME: Maybe we should use this hook to provide a "display
1254 ;; completions" operation as well. 1279 ;; completions" operation as well.
@@ -1257,9 +1282,10 @@ Point needs to be somewhere between START and END."
1257 (minibuffer-completion-predicate predicate) 1282 (minibuffer-completion-predicate predicate)
1258 (ol (make-overlay start end nil nil t))) 1283 (ol (make-overlay start end nil nil t)))
1259 (overlay-put ol 'field 'completion) 1284 (overlay-put ol 'field 'completion)
1260 (completion-in-region-mode 1) 1285 (when completion-in-region-mode-predicate
1261 (setq completion-in-region--data 1286 (completion-in-region-mode 1)
1262 (list (current-buffer) start end collection)) 1287 (setq completion-in-region--data
1288 (list (current-buffer) start end collection)))
1263 (unwind-protect 1289 (unwind-protect
1264 (call-interactively 'minibuffer-complete) 1290 (call-interactively 'minibuffer-complete)
1265 (delete-overlay ol))))) 1291 (delete-overlay ol)))))
@@ -1288,13 +1314,8 @@ Point needs to be somewhere between START and END."
1288 (save-excursion 1314 (save-excursion
1289 (goto-char (nth 2 completion-in-region--data)) 1315 (goto-char (nth 2 completion-in-region--data))
1290 (line-end-position))) 1316 (line-end-position)))
1291 (let ((comp-data (run-hook-wrapped 1317 (when completion-in-region-mode--predicate
1292 'completion-at-point-functions 1318 (funcall completion-in-region-mode--predicate))))
1293 ;; Only use the known-safe functions.
1294 #'completion--capf-wrapper 'safe)))
1295 (eq (car comp-data)
1296 ;; We're still in the same completion field.
1297 (nth 1 completion-in-region--data)))))
1298 (completion-in-region-mode -1))) 1319 (completion-in-region-mode -1)))
1299 1320
1300;; (defalias 'completion-in-region--prech 'completion-in-region--postch) 1321;; (defalias 'completion-in-region--prech 'completion-in-region--postch)
@@ -1309,9 +1330,12 @@ Point needs to be somewhere between START and END."
1309 (delq (assq 'completion-in-region-mode minor-mode-overriding-map-alist) 1330 (delq (assq 'completion-in-region-mode minor-mode-overriding-map-alist)
1310 minor-mode-overriding-map-alist)) 1331 minor-mode-overriding-map-alist))
1311 (if (null completion-in-region-mode) 1332 (if (null completion-in-region-mode)
1312 (unless (equal "*Completions*" (buffer-name (window-buffer))) 1333 (unless (or (equal "*Completions*" (buffer-name (window-buffer)))
1334 (null completion-in-region-mode--predicate))
1313 (minibuffer-hide-completions)) 1335 (minibuffer-hide-completions))
1314 ;; (add-hook 'pre-command-hook #'completion-in-region--prech) 1336 ;; (add-hook 'pre-command-hook #'completion-in-region--prech)
1337 (set (make-local-variable 'completion-in-region-mode--predicate)
1338 completion-in-region-mode-predicate)
1315 (add-hook 'post-command-hook #'completion-in-region--postch) 1339 (add-hook 'post-command-hook #'completion-in-region--postch)
1316 (push `(completion-in-region-mode . ,completion-in-region-mode-map) 1340 (push `(completion-in-region-mode . ,completion-in-region-mode-map)
1317 minor-mode-overriding-map-alist))) 1341 minor-mode-overriding-map-alist)))
@@ -1355,7 +1379,7 @@ Currently supported properties are:
1355 (message 1379 (message
1356 "Completion function %S uses a deprecated calling convention" fun) 1380 "Completion function %S uses a deprecated calling convention" fun)
1357 (push fun completion--capf-misbehave-funs)))) 1381 (push fun completion--capf-misbehave-funs))))
1358 res))) 1382 (if res (cons fun res)))))
1359 1383
1360(defun completion-at-point () 1384(defun completion-at-point ()
1361 "Perform completion on the text around point. 1385 "Perform completion on the text around point.
@@ -1363,18 +1387,20 @@ The completion method is determined by `completion-at-point-functions'."
1363 (interactive) 1387 (interactive)
1364 (let ((res (run-hook-wrapped 'completion-at-point-functions 1388 (let ((res (run-hook-wrapped 'completion-at-point-functions
1365 #'completion--capf-wrapper 'all))) 1389 #'completion--capf-wrapper 'all)))
1366 (cond 1390 (pcase res
1367 ((functionp res) (funcall res)) 1391 (`(,_ . ,(and (pred functionp) f)) (funcall f))
1368 ((consp res) 1392 (`(,hookfun . (,start ,end ,collection . ,plist))
1369 (let* ((plist (nthcdr 3 res)) 1393 (let* ((completion-annotate-function
1370 (start (nth 0 res))
1371 (end (nth 1 res))
1372 (completion-annotate-function
1373 (or (plist-get plist :annotation-function) 1394 (or (plist-get plist :annotation-function)
1374 completion-annotate-function))) 1395 completion-annotate-function))
1375 (completion-in-region start end (nth 2 res) 1396 (completion-in-region-mode-predicate
1397 (lambda ()
1398 ;; We're still in the same completion field.
1399 (eq (car (funcall hookfun)) start))))
1400 (completion-in-region start end collection
1376 (plist-get plist :predicate)))) 1401 (plist-get plist :predicate))))
1377 (res)))) ;Maybe completion already happened and the function returned t. 1402 ;; Maybe completion already happened and the function returned t.
1403 (_ (cdr res)))))
1378 1404
1379(defun completion-help-at-point () 1405(defun completion-help-at-point ()
1380 "Display the completions on the text around point. 1406 "Display the completions on the text around point.
@@ -1383,29 +1409,36 @@ The completion method is determined by `completion-at-point-functions'."
1383 (let ((res (run-hook-wrapped 'completion-at-point-functions 1409 (let ((res (run-hook-wrapped 'completion-at-point-functions
1384 ;; Ignore misbehaving functions. 1410 ;; Ignore misbehaving functions.
1385 #'completion--capf-wrapper 'optimist))) 1411 #'completion--capf-wrapper 'optimist)))
1386 (cond 1412 (pcase res
1387 ((functionp res) 1413 (`(,_ . ,(and (pred functionp) f))
1388 (message "Don't know how to show completions for %S" res)) 1414 (message "Don't know how to show completions for %S" f))
1389 ((consp res) 1415 (`(,hookfun . (,start ,end ,collection . ,plist))
1390 (let* ((plist (nthcdr 3 res)) 1416 (let* ((minibuffer-completion-table collection)
1391 (minibuffer-completion-table (nth 2 res))
1392 (minibuffer-completion-predicate (plist-get plist :predicate)) 1417 (minibuffer-completion-predicate (plist-get plist :predicate))
1393 (completion-annotate-function 1418 (completion-annotate-function
1394 (or (plist-get plist :annotation-function) 1419 (or (plist-get plist :annotation-function)
1395 completion-annotate-function)) 1420 completion-annotate-function))
1396 (ol (make-overlay (nth 0 res) (nth 1 res) nil nil t))) 1421 (completion-in-region-mode-predicate
1422 (lambda ()
1423 ;; We're still in the same completion field.
1424 (eq (car (funcall hookfun)) start)))
1425 (ol (make-overlay start end nil nil t)))
1397 ;; FIXME: We should somehow (ab)use completion-in-region-function or 1426 ;; FIXME: We should somehow (ab)use completion-in-region-function or
1398 ;; introduce a corresponding hook (plus another for word-completion, 1427 ;; introduce a corresponding hook (plus another for word-completion,
1399 ;; and another for force-completion, maybe?). 1428 ;; and another for force-completion, maybe?).
1400 (overlay-put ol 'field 'completion) 1429 (overlay-put ol 'field 'completion)
1430 (completion-in-region-mode 1)
1431 (setq completion-in-region--data
1432 (list (current-buffer) start end collection))
1401 (unwind-protect 1433 (unwind-protect
1402 (call-interactively 'minibuffer-completion-help) 1434 (call-interactively 'minibuffer-completion-help)
1403 (delete-overlay ol)))) 1435 (delete-overlay ol))))
1404 (res 1436 (`(,hookfun . ,_)
1405 ;; The hook function already performed completion :-( 1437 ;; The hook function already performed completion :-(
1406 ;; Not much we can do at this point. 1438 ;; Not much we can do at this point.
1439 (message "%s already performed completion!" hookfun)
1407 nil) 1440 nil)
1408 (t (message "Nothing to complete at point"))))) 1441 (_ (message "Nothing to complete at point")))))
1409 1442
1410;;; Key bindings. 1443;;; Key bindings.
1411 1444
diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el
index 070cd2641db..67bb7eae68e 100644
--- a/lisp/net/network-stream.el
+++ b/lisp/net/network-stream.el
@@ -171,9 +171,11 @@ values:
171 (resulting-type 'plain) 171 (resulting-type 'plain)
172 starttls-command) 172 starttls-command)
173 173
174 ;; If we have STARTTLS support, try to upgrade the connection. 174 ;; If we have built-in STARTTLS support, try to upgrade the
175 ;; connection.
175 (when (and (or (fboundp 'open-gnutls-stream) 176 (when (and (or (fboundp 'open-gnutls-stream)
176 (executable-find "gnutls-cli")) 177 (and require-tls
178 (executable-find "gnutls-cli")))
177 capabilities success-string starttls-function 179 capabilities success-string starttls-function
178 (setq starttls-command 180 (setq starttls-command
179 (funcall starttls-function capabilities))) 181 (funcall starttls-function capabilities)))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index ec5c46b2897..cb4aca12edb 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1145,13 +1145,15 @@ target of the symlink differ."
1145 (save-excursion 1145 (save-excursion
1146 (tramp-convert-file-attributes 1146 (tramp-convert-file-attributes
1147 v 1147 v
1148 (cond 1148 (or
1149 ((tramp-get-remote-stat v) 1149 (cond
1150 (tramp-do-file-attributes-with-stat v localname id-format)) 1150 ((tramp-get-remote-stat v)
1151 ((tramp-get-remote-perl v) 1151 (tramp-do-file-attributes-with-stat v localname id-format))
1152 (tramp-do-file-attributes-with-perl v localname id-format)) 1152 ((tramp-get-remote-perl v)
1153 (t 1153 (tramp-do-file-attributes-with-perl v localname id-format))
1154 (tramp-do-file-attributes-with-ls v localname id-format))))))))) 1154 (t nil))
1155 ;; The scripts could fail, for example with huge file size.
1156 (tramp-do-file-attributes-with-ls v localname id-format))))))))
1155 1157
1156(defun tramp-do-file-attributes-with-ls (vec localname &optional id-format) 1158(defun tramp-do-file-attributes-with-ls (vec localname &optional id-format)
1157 "Implement `file-attributes' for Tramp files using the ls(1) command." 1159 "Implement `file-attributes' for Tramp files using the ls(1) command."
@@ -2296,10 +2298,9 @@ The method used must be an out-of-band method."
2296 (tramp-get-method-parameter method 'tramp-copy-env)))) 2298 (tramp-get-method-parameter method 'tramp-copy-env))))
2297 2299
2298 ;; Check for program. 2300 ;; Check for program.
2299 (when (and (fboundp 'executable-find) 2301 (unless (let ((default-directory
2300 (not (let ((default-directory 2302 (tramp-compat-temporary-file-directory)))
2301 (tramp-compat-temporary-file-directory))) 2303 (executable-find copy-program))
2302 (executable-find copy-program))))
2303 (tramp-error 2304 (tramp-error
2304 v 'file-error "Cannot find copy program: %s" copy-program)) 2305 v 'file-error "Cannot find copy program: %s" copy-program))
2305 2306
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 7e1b0f5b8e9..36477f7b439 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -339,7 +339,7 @@ pass to the OPERATION."
339 preserve-uid-gid preserve-selinux-context) 339 preserve-uid-gid preserve-selinux-context)
340 "Like `copy-file' for Tramp files. 340 "Like `copy-file' for Tramp files.
341KEEP-DATE is not handled in case NEWNAME resides on an SMB server. 341KEEP-DATE is not handled in case NEWNAME resides on an SMB server.
342PRESERVE-UID-GID is completely ignored." 342PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
343 (setq filename (expand-file-name filename) 343 (setq filename (expand-file-name filename)
344 newname (expand-file-name newname)) 344 newname (expand-file-name newname))
345 (with-progress-reporter 345 (with-progress-reporter
diff --git a/src/ChangeLog b/src/ChangeLog
index 29b2457e08a..2b0df1f7a30 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,8 +1,6 @@
12011-04-14 Paul Eggert <eggert@cs.ucla.edu> 12011-04-14 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * lisp.h (INFUN): Remove. Suggested by Dan Nicolaescu in 3 Improve C-level modularity by making more things 'static'.
4 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00393.html>.
5 All uses spelled out.
6 4
7 Don't publish debugger-only interfaces to other modules. 5 Don't publish debugger-only interfaces to other modules.
8 * lisp.h (safe_debug_print, debug_output_compilation_hack): 6 * lisp.h (safe_debug_print, debug_output_compilation_hack):
@@ -49,7 +47,7 @@
49 (get_tty_terminal): Now static. 47 (get_tty_terminal): Now static.
50 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM. 48 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
51 * termhooks.h (term_mouse_moveto): Do not declare if 49 * termhooks.h (term_mouse_moveto): Do not declare if
52 HAVE_WINDOW_SYSTEMM. 50 HAVE_WINDOW_SYSTEM.
53 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes): 51 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
54 (tty_turn_off_highlight, get_tty_terminal): Remove decls. 52 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
55 53
@@ -132,8 +130,6 @@
132 Now static. 130 Now static.
133 * intervals.h (merge_interval_right, delete_interval): Remove decls. 131 * intervals.h (merge_interval_right, delete_interval): Remove decls.
134 132
1352011-04-13 Paul Eggert <eggert@cs.ucla.edu>
136
137 * insdel.c: Make symbols static if they're not exported. 133 * insdel.c: Make symbols static if they're not exported.
138 However, leave prepare_to_modify_buffer alone. It's never 134 However, leave prepare_to_modify_buffer alone. It's never
139 called from outside this function, but that appears to be a bug. 135 called from outside this function, but that appears to be a bug.
@@ -218,8 +214,6 @@
218 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS && 214 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
219 USE_X_TOOLKIT. 215 USE_X_TOOLKIT.
220 216
2212011-04-12 Paul Eggert <eggert@cs.ucla.edu>
222
223 * ftxfont.c: Make symbols static if they're not exported. 217 * ftxfont.c: Make symbols static if they're not exported.
224 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined 218 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
225 HAVE_FREETYPE. 219 HAVE_FREETYPE.
@@ -281,8 +275,6 @@
281 * lisp.h (circular_list_error, FOREACH): Remove; unused. 275 * lisp.h (circular_list_error, FOREACH): Remove; unused.
282 * data.c (circular_list_error): Remove. 276 * data.c (circular_list_error): Remove.
283 277
2842011-04-11 Paul Eggert <eggert@cs.ucla.edu>
285
286 * commands.h (last_point_position, last_point_position_buffer): 278 * commands.h (last_point_position, last_point_position_buffer):
287 (last_point_position_window): Remove decls. 279 (last_point_position_window): Remove decls.
288 * keyboard.c: Make these variables static. 280 * keyboard.c: Make these variables static.
@@ -370,11 +362,8 @@
370 to see whether these functions can be called from other modules. 362 to see whether these functions can be called from other modules.
371 DEFUN now defines a static function. To make the function external 363 DEFUN now defines a static function. To make the function external
372 so that it can be used in other C modules, use the new macro DEFUE. 364 so that it can be used in other C modules, use the new macro DEFUE.
373 * lisp.h (DEFINE_FUNC): New macro, with the old contents of DEFUN. 365 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
374 (DEFUN): Rewrite in terms of DEFINE_FUNC. It now generates a 366 (Finit_image_library):
375 static function definition. Use DEFUE if you want an extern one.
376 (DEFUE, INFUN): New macros.
377 (Funibyte_char_to_multibyte, Fsyntax_table_p, Finit_image_library):
378 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer): 367 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
379 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute): 368 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
380 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes): 369 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
@@ -423,12 +412,63 @@
423 (Fset_window_margins, Fset_window_vscroll): New forward static decls. 412 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
424 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls. 413 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
425 414
4262011-04-10 Paul Eggert <eggert@cs.ucla.edu>
427
428 * editfns.c (Fformat): Remove unreachable code. 415 * editfns.c (Fformat): Remove unreachable code.
429 416
4172011-04-14 Andreas Schwab <schwab@linux-m68k.org>
418
419 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
420 change. (Bug#8496)
421
4222011-04-13 Eli Zaretskii <eliz@gnu.org>
423
424 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
425 when at ZV. (Bug#8487)
426
4272011-04-12 Andreas Schwab <schwab@linux-m68k.org>
428
429 * charset.c (Fclear_charset_maps): Use xfree instead of free.
430 (Bug#8437)
431 * keyboard.c (parse_tool_bar_item): Likewise.
432 * sound.c (sound_cleanup, alsa_close): Likewise.
433 * termcap.c (tgetent): Likewise.
434 * xfns.c (x_default_font_parameter): Likewise.
435 * xsettings.c (read_and_apply_settings): Likewise.
436
437 * alloc.c (overrun_check_malloc, overrun_check_realloc)
438 (overrun_check_free): Protoize.
439
4402011-04-12 Paul Eggert <eggert@cs.ucla.edu>
441
442 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
443 since callers should never pass a negative size.
444 Change the signature to match that of plain 'read' and 'write'; see
445 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
446 * lisp.h: Update prototypes of emacs_write and emacs_read.
447
4482011-04-11 Eli Zaretskii <eliz@gnu.org>
449
450 * xdisp.c (redisplay_window): Don't try to determine the character
451 position of the scroll margin if the window start point w->startp
452 is outside the buffer's accessible region. (Bug#8468)
453
4542011-04-10 Eli Zaretskii <eliz@gnu.org>
455
456 Fix write-region and its subroutines for buffers > 2GB.
457 * fileio.c (a_write, e_write): Modify declaration of arguments and
458 local variables to support buffers larger than 2GB.
459 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
460
461 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
462 argument, local variables, and return value.
463
464 * lisp.h: Update prototypes of emacs_write and emacs_read.
465
466 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
467
4302011-04-10 Paul Eggert <eggert@cs.ucla.edu> 4682011-04-10 Paul Eggert <eggert@cs.ucla.edu>
431 469
470 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
471
432 Fix more problems found by GCC 4.6.0's static checks. 472 Fix more problems found by GCC 4.6.0's static checks.
433 473
434 * xdisp.c (vmessage): Use a better test for character truncation. 474 * xdisp.c (vmessage): Use a better test for character truncation.
@@ -534,7 +574,7 @@
534 * xselect.c (x_decline_selection_request) 574 * xselect.c (x_decline_selection_request)
535 (x_reply_selection_request): Avoid type-punned deref of X events. 575 (x_reply_selection_request): Avoid type-punned deref of X events.
536 576
5372011-04-09 Eli Zaretskii <eliz@emacstest.gnu.org> 5772011-04-09 Eli Zaretskii <eliz@gnu.org>
538 578
539 Fix some uses of `int' instead of EMACS_INT. 579 Fix some uses of `int' instead of EMACS_INT.
540 * search.c (string_match_1, fast_string_match) 580 * search.c (string_match_1, fast_string_match)
diff --git a/src/ChangeLog.11 b/src/ChangeLog.11
index 703b084743c..6f462e32534 100644
--- a/src/ChangeLog.11
+++ b/src/ChangeLog.11
@@ -4906,7 +4906,7 @@
4906 (Finternal_describe_syntax_value): Recognize new flag; use the 4906 (Finternal_describe_syntax_value): Recognize new flag; use the
4907 SYNTAX_FLAGS_* macros. 4907 SYNTAX_FLAGS_* macros.
4908 (scan_sexps_forward, Fparse_partial_sexp): Change representation of 4908 (scan_sexps_forward, Fparse_partial_sexp): Change representation of
4909 comment style to accomodate the new styles. 4909 comment style to accommodate the new styles.
4910 (back_comment, forw_comment, Fforward_comment, scan_lists) 4910 (back_comment, forw_comment, Fforward_comment, scan_lists)
4911 (scan_sexps_forward): Update code to obey the new comment style flag. 4911 (scan_sexps_forward): Update code to obey the new comment style flag.
4912 4912
diff --git a/src/alloc.c b/src/alloc.c
index 1c793c985eb..16cd183aaa1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -565,8 +565,7 @@ static int check_depth;
565/* Like malloc, but wraps allocated block with header and trailer. */ 565/* Like malloc, but wraps allocated block with header and trailer. */
566 566
567POINTER_TYPE * 567POINTER_TYPE *
568overrun_check_malloc (size) 568overrun_check_malloc (size_t size)
569 size_t size;
570{ 569{
571 register unsigned char *val; 570 register unsigned char *val;
572 size_t overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_SIZE*2 : 0; 571 size_t overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_SIZE*2 : 0;
@@ -590,11 +589,9 @@ overrun_check_malloc (size)
590 with header and trailer. */ 589 with header and trailer. */
591 590
592POINTER_TYPE * 591POINTER_TYPE *
593overrun_check_realloc (block, size) 592overrun_check_realloc (POINTER_TYPE *block, size_t size)
594 POINTER_TYPE *block;
595 size_t size;
596{ 593{
597 register unsigned char *val = (unsigned char *)block; 594 register unsigned char *val = (unsigned char *) block;
598 size_t overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_SIZE*2 : 0; 595 size_t overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_SIZE*2 : 0;
599 596
600 if (val 597 if (val
@@ -630,10 +627,9 @@ overrun_check_realloc (block, size)
630/* Like free, but checks block for overrun. */ 627/* Like free, but checks block for overrun. */
631 628
632void 629void
633overrun_check_free (block) 630overrun_check_free (POINTER_TYPE *block)
634 POINTER_TYPE *block;
635{ 631{
636 unsigned char *val = (unsigned char *)block; 632 unsigned char *val = (unsigned char *) block;
637 633
638 ++check_depth; 634 ++check_depth;
639 if (val 635 if (val
diff --git a/src/charset.c b/src/charset.c
index cc7c53ae61c..c4699dcb0a7 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -2143,7 +2143,7 @@ It should be called only from temacs invoked for dumping. */)
2143{ 2143{
2144 if (temp_charset_work) 2144 if (temp_charset_work)
2145 { 2145 {
2146 free (temp_charset_work); 2146 xfree (temp_charset_work);
2147 temp_charset_work = NULL; 2147 temp_charset_work = NULL;
2148 } 2148 }
2149 2149
diff --git a/src/fileio.c b/src/fileio.c
index 7f749536d56..b8c5e796db4 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -146,8 +146,10 @@ static Lisp_Object Qcar_less_than_car;
146 146
147static Lisp_Object Fmake_symbolic_link (Lisp_Object, Lisp_Object, Lisp_Object); 147static Lisp_Object Fmake_symbolic_link (Lisp_Object, Lisp_Object, Lisp_Object);
148static int a_write (int, Lisp_Object, int, int, 148static int a_write (int, Lisp_Object, int, int,
149static int a_write (int, Lisp_Object, EMACS_INT, EMACS_INT,
149 Lisp_Object *, struct coding_system *); 150 Lisp_Object *, struct coding_system *);
150static int e_write (int, Lisp_Object, int, int, struct coding_system *); 151static int e_write (int, Lisp_Object, EMACS_INT, EMACS_INT,
152 struct coding_system *);
151 153
152 154
153void 155void
@@ -1808,7 +1810,8 @@ If PRESERVE-SELINUX-CONTEXT is non-nil and SELinux is enabled
1808on the system, we copy the SELinux context of FILE to NEWNAME. */) 1810on the system, we copy the SELinux context of FILE to NEWNAME. */)
1809 (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists, Lisp_Object keep_time, Lisp_Object preserve_uid_gid, Lisp_Object preserve_selinux_context) 1811 (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists, Lisp_Object keep_time, Lisp_Object preserve_uid_gid, Lisp_Object preserve_selinux_context)
1810{ 1812{
1811 int ifd, ofd, n; 1813 int ifd, ofd;
1814 EMACS_INT n;
1812 char buf[16 * 1024]; 1815 char buf[16 * 1024];
1813 struct stat st, out_st; 1816 struct stat st, out_st;
1814 Lisp_Object handler; 1817 Lisp_Object handler;
@@ -3802,9 +3805,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3802 /* For a special file, all we can do is guess. */ 3805 /* For a special file, all we can do is guess. */
3803 total = READ_BUF_SIZE; 3806 total = READ_BUF_SIZE;
3804 3807
3805 /* FIXME: This if-statement is a no-op, because 'inserted' must be zero here 3808 if (NILP (visit) && total > 0)
3806 (Bug#8496). */
3807 if (NILP (visit) && inserted > 0)
3808 { 3809 {
3809#ifdef CLASH_DETECTION 3810#ifdef CLASH_DETECTION
3810 if (!NILP (BVAR (current_buffer, file_truename)) 3811 if (!NILP (BVAR (current_buffer, file_truename))
@@ -3914,7 +3915,6 @@ variable `last-coding-system-used' to the coding system actually used. */)
3914 if (inserted == 0) 3915 if (inserted == 0)
3915 { 3916 {
3916#ifdef CLASH_DETECTION 3917#ifdef CLASH_DETECTION
3917 /* FIXME: This code is a no-op, too (Bug#8496). */
3918 if (we_locked_file) 3918 if (we_locked_file)
3919 unlock_file (BVAR (current_buffer, file_truename)); 3919 unlock_file (BVAR (current_buffer, file_truename));
3920#endif 3920#endif
@@ -4799,11 +4799,13 @@ build_annotations (Lisp_Object start, Lisp_Object end)
4799 The return value is negative in case of system call failure. */ 4799 The return value is negative in case of system call failure. */
4800 4800
4801static int 4801static int
4802a_write (int desc, Lisp_Object string, int pos, register int nchars, Lisp_Object *annot, struct coding_system *coding) 4802a_write (int desc, Lisp_Object string, EMACS_INT pos,
4803 register EMACS_INT nchars, Lisp_Object *annot,
4804 struct coding_system *coding)
4803{ 4805{
4804 Lisp_Object tem; 4806 Lisp_Object tem;
4805 int nextpos; 4807 EMACS_INT nextpos;
4806 int lastpos = pos + nchars; 4808 EMACS_INT lastpos = pos + nchars;
4807 4809
4808 while (NILP (*annot) || CONSP (*annot)) 4810 while (NILP (*annot) || CONSP (*annot))
4809 { 4811 {
@@ -4843,7 +4845,8 @@ a_write (int desc, Lisp_Object string, int pos, register int nchars, Lisp_Object
4843 are indexes to the string STRING. */ 4845 are indexes to the string STRING. */
4844 4846
4845static int 4847static int
4846e_write (int desc, Lisp_Object string, int start, int end, struct coding_system *coding) 4848e_write (int desc, Lisp_Object string, EMACS_INT start, EMACS_INT end,
4849 struct coding_system *coding)
4847{ 4850{
4848 if (STRINGP (string)) 4851 if (STRINGP (string))
4849 { 4852 {
@@ -4874,8 +4877,8 @@ e_write (int desc, Lisp_Object string, int start, int end, struct coding_system
4874 } 4877 }
4875 else 4878 else
4876 { 4879 {
4877 int start_byte = CHAR_TO_BYTE (start); 4880 EMACS_INT start_byte = CHAR_TO_BYTE (start);
4878 int end_byte = CHAR_TO_BYTE (end); 4881 EMACS_INT end_byte = CHAR_TO_BYTE (end);
4879 4882
4880 coding->src_multibyte = (end - start) < (end_byte - start_byte); 4883 coding->src_multibyte = (end - start) < (end_byte - start_byte);
4881 if (CODING_REQUIRE_ENCODING (coding)) 4884 if (CODING_REQUIRE_ENCODING (coding))
diff --git a/src/keyboard.c b/src/keyboard.c
index 28e7e5bd463..7895d05b34f 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -8270,7 +8270,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8270 PROP (TOOL_BAR_ITEM_LABEL) = new_lbl; 8270 PROP (TOOL_BAR_ITEM_LABEL) = new_lbl;
8271 else 8271 else
8272 PROP (TOOL_BAR_ITEM_LABEL) = make_string ("", 0); 8272 PROP (TOOL_BAR_ITEM_LABEL) = make_string ("", 0);
8273 free (buf); 8273 xfree (buf);
8274 } 8274 }
8275 8275
8276 /* If got a filter apply it on binding. */ 8276 /* If got a filter apply it on binding. */
diff --git a/src/lisp.h b/src/lisp.h
index 09830a980f2..8b8e25eb689 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3316,8 +3316,8 @@ extern long get_random (void);
3316extern void seed_random (long); 3316extern void seed_random (long);
3317extern int emacs_open (const char *, int, int); 3317extern int emacs_open (const char *, int, int);
3318extern int emacs_close (int); 3318extern int emacs_close (int);
3319extern int emacs_read (int, char *, unsigned int); 3319extern ssize_t emacs_read (int, char *, size_t);
3320extern int emacs_write (int, const char *, unsigned int); 3320extern ssize_t emacs_write (int, const char *, size_t);
3321enum { READLINK_BUFSIZE = 1024 }; 3321enum { READLINK_BUFSIZE = 1024 };
3322extern char *emacs_readlink (const char *, char [READLINK_BUFSIZE]); 3322extern char *emacs_readlink (const char *, char [READLINK_BUFSIZE]);
3323#ifndef HAVE_MEMSET 3323#ifndef HAVE_MEMSET
diff --git a/src/sound.c b/src/sound.c
index e121b5e37f3..697e81c814b 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -460,8 +460,8 @@ sound_cleanup (Lisp_Object arg)
460 current_sound_device->close (current_sound_device); 460 current_sound_device->close (current_sound_device);
461 if (current_sound->fd > 0) 461 if (current_sound->fd > 0)
462 emacs_close (current_sound->fd); 462 emacs_close (current_sound->fd);
463 free (current_sound_device); 463 xfree (current_sound_device);
464 free (current_sound); 464 xfree (current_sound);
465 465
466 return Qnil; 466 return Qnil;
467} 467}
@@ -897,7 +897,7 @@ vox_init (struct sound_device *sd)
897static void 897static void
898vox_write (struct sound_device *sd, const char *buffer, int nbytes) 898vox_write (struct sound_device *sd, const char *buffer, int nbytes)
899{ 899{
900 int nwritten = emacs_write (sd->fd, buffer, nbytes); 900 ssize_t nwritten = emacs_write (sd->fd, buffer, nbytes);
901 if (nwritten < 0) 901 if (nwritten < 0)
902 sound_perror ("Error writing to sound device"); 902 sound_perror ("Error writing to sound device");
903} 903}
@@ -1095,7 +1095,7 @@ alsa_close (struct sound_device *sd)
1095 snd_pcm_drain (p->handle); 1095 snd_pcm_drain (p->handle);
1096 snd_pcm_close (p->handle); 1096 snd_pcm_close (p->handle);
1097 } 1097 }
1098 free (p); 1098 xfree (p);
1099 } 1099 }
1100} 1100}
1101 1101
diff --git a/src/sysdep.c b/src/sysdep.c
index 3dc255933ee..0d9b31f35cd 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1825,10 +1825,18 @@ emacs_close (int fd)
1825 return rtnval; 1825 return rtnval;
1826} 1826}
1827 1827
1828int 1828ssize_t
1829emacs_read (int fildes, char *buf, unsigned int nbyte) 1829emacs_read (int fildes, char *buf, size_t nbyte)
1830{ 1830{
1831 register int rtnval; 1831 register ssize_t rtnval;
1832
1833 /* Defend against the possibility that a buggy caller passes a negative NBYTE
1834 argument, which would be converted to a large unsigned size_t NBYTE. This
1835 defense prevents callers from doing large writes, unfortunately. This
1836 size restriction can be removed once we have carefully checked that there
1837 are no such callers. */
1838 if ((ssize_t) nbyte < 0)
1839 abort ();
1832 1840
1833 while ((rtnval = read (fildes, buf, nbyte)) == -1 1841 while ((rtnval = read (fildes, buf, nbyte)) == -1
1834 && (errno == EINTR)) 1842 && (errno == EINTR))
@@ -1836,14 +1844,18 @@ emacs_read (int fildes, char *buf, unsigned int nbyte)
1836 return (rtnval); 1844 return (rtnval);
1837} 1845}
1838 1846
1839int 1847ssize_t
1840emacs_write (int fildes, const char *buf, unsigned int nbyte) 1848emacs_write (int fildes, const char *buf, size_t nbyte)
1841{ 1849{
1842 register int rtnval, bytes_written; 1850 register ssize_t rtnval, bytes_written;
1851
1852 /* Defend against negative NBYTE, as in emacs_read. */
1853 if ((ssize_t) nbyte < 0)
1854 abort ();
1843 1855
1844 bytes_written = 0; 1856 bytes_written = 0;
1845 1857
1846 while (nbyte > 0) 1858 while (nbyte != 0)
1847 { 1859 {
1848 rtnval = write (fildes, buf, nbyte); 1860 rtnval = write (fildes, buf, nbyte);
1849 1861
diff --git a/src/termcap.c b/src/termcap.c
index 27a20a67ae1..5b71ad229d7 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -1,6 +1,6 @@
1/* Work-alike for termcap, plus extra features. 1/* Work-alike for termcap, plus extra features.
2 Copyright (C) 1985, 1986, 1993, 1994, 1995, 2000, 2001, 2002, 2003, 2 Copyright (C) 1985, 1986, 1993, 1994, 1995, 2000, 2001, 2002, 2003,
3 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 3 2004, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc.
4 4
5This program is free software; you can redistribute it and/or modify 5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by 6it under the terms of the GNU General Public License as published by
@@ -468,15 +468,15 @@ tgetent (char *bp, const char *name)
468 if (scan_file (term, fd, &buf) == 0) 468 if (scan_file (term, fd, &buf) == 0)
469 { 469 {
470 close (fd); 470 close (fd);
471 free (buf.beg); 471 xfree (buf.beg);
472 if (malloc_size) 472 if (malloc_size)
473 free (bp); 473 xfree (bp);
474 return 0; 474 return 0;
475 } 475 }
476 476
477 /* Free old `term' if appropriate. */ 477 /* Free old `term' if appropriate. */
478 if (term != name) 478 if (term != name)
479 free (term); 479 xfree (term);
480 480
481 /* If BP is malloc'd by us, make sure it is big enough. */ 481 /* If BP is malloc'd by us, make sure it is big enough. */
482 if (malloc_size) 482 if (malloc_size)
@@ -506,7 +506,7 @@ tgetent (char *bp, const char *name)
506 } 506 }
507 507
508 close (fd); 508 close (fd);
509 free (buf.beg); 509 xfree (buf.beg);
510 510
511 if (malloc_size) 511 if (malloc_size)
512 bp = (char *) xrealloc (bp, bp1 - bp + 1); 512 bp = (char *) xrealloc (bp, bp1 - bp + 1);
diff --git a/src/xdisp.c b/src/xdisp.c
index 3370d84d67f..4f1830f4c6c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3617,7 +3617,7 @@ handle_invisible_prop (struct it *it)
3617 _after_ bidi iteration avoids affecting the visual 3617 _after_ bidi iteration avoids affecting the visual
3618 order of the displayed text when invisible properties 3618 order of the displayed text when invisible properties
3619 are added or removed. */ 3619 are added or removed. */
3620 if (it->bidi_it.first_elt) 3620 if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV)
3621 { 3621 {
3622 /* If we were `reseat'ed to a new paragraph, 3622 /* If we were `reseat'ed to a new paragraph,
3623 determine the paragraph base direction. We need 3623 determine the paragraph base direction. We need
@@ -8374,10 +8374,13 @@ vmessage (const char *m, va_list ap)
8374 8374
8375 /* Do any truncation at a character boundary. */ 8375 /* Do any truncation at a character boundary. */
8376 if (! (0 <= len && len < bufsize)) 8376 if (! (0 <= len && len < bufsize))
8377 for (len = strnlen (buf, bufsize); 8377 {
8378 len && ! CHAR_HEAD_P (buf[len - 1]); 8378 char *end = memchr (buf, 0, bufsize);
8379 len--) 8379 for (len = end ? end - buf : bufsize;
8380 continue; 8380 len && ! CHAR_HEAD_P (buf[len - 1]);
8381 len--)
8382 continue;
8383 }
8381 8384
8382 message2 (FRAME_MESSAGE_BUF (f), len, 0); 8385 message2 (FRAME_MESSAGE_BUF (f), len, 0);
8383 } 8386 }
@@ -14206,7 +14209,14 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
14206 14209
14207 /* If there is a scroll margin at the top of the window, find 14210 /* If there is a scroll margin at the top of the window, find
14208 its character position. */ 14211 its character position. */
14209 if (margin) 14212 if (margin
14213 /* Cannot call start_display if startp is not in the
14214 accessible region of the buffer. This can happen when we
14215 have just switched to a different buffer and/or changed
14216 its restriction. In that case, startp is initialized to
14217 the character position 1 (BEG) because we did not yet
14218 have chance to display the buffer even once. */
14219 && BEGV <= CHARPOS (startp) && CHARPOS (startp) <= ZV)
14210 { 14220 {
14211 struct it it1; 14221 struct it it1;
14212 14222
diff --git a/src/xfns.c b/src/xfns.c
index 1182ef8e770..290b6161215 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2958,7 +2958,7 @@ x_default_font_parameter (struct frame *f, Lisp_Object parms)
2958 { 2958 {
2959 char *name = xstrdup (system_font); 2959 char *name = xstrdup (system_font);
2960 font = font_open_by_name (f, name); 2960 font = font_open_by_name (f, name);
2961 free (name); 2961 xfree (name);
2962 } 2962 }
2963 } 2963 }
2964 2964
diff --git a/src/xsettings.c b/src/xsettings.c
index d09b702a428..2513bcc5aa8 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -566,20 +566,20 @@ read_and_apply_settings (struct x_display_info *dpyinfo, int send_event_p)
566 if (send_event_p) 566 if (send_event_p)
567 store_config_changed_event (Qtool_bar_style, dpyname); 567 store_config_changed_event (Qtool_bar_style, dpyname);
568 } 568 }
569 free (settings.tb_style); 569 xfree (settings.tb_style);
570 } 570 }
571 571
572 if (settings.seen & SEEN_FONT) 572 if (settings.seen & SEEN_FONT)
573 { 573 {
574 if (!current_font || strcmp (current_font, settings.font) != 0) 574 if (!current_font || strcmp (current_font, settings.font) != 0)
575 { 575 {
576 free (current_font); 576 xfree (current_font);
577 current_font = settings.font; 577 current_font = settings.font;
578 if (send_event_p) 578 if (send_event_p)
579 store_config_changed_event (Qfont_name, dpyname); 579 store_config_changed_event (Qfont_name, dpyname);
580 } 580 }
581 else 581 else
582 free (settings.font); 582 xfree (settings.font);
583 } 583 }
584} 584}
585 585