aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--README.imagemagick151
-rw-r--r--admin/unidata/Makefile.in2
-rw-r--r--admin/unidata/makefile.w32-in2
-rwxr-xr-xconfigure548
-rw-r--r--configure.in22
-rw-r--r--doc/emacs/ChangeLog4
-rw-r--r--doc/emacs/misc.texi9
-rw-r--r--doc/lispref/ChangeLog26
-rw-r--r--doc/lispref/commands.texi10
-rw-r--r--doc/lispref/compile.texi6
-rw-r--r--doc/lispref/display.texi46
-rw-r--r--doc/lispref/loading.texi7
-rw-r--r--doc/lispref/modes.texi12
-rw-r--r--doc/lispref/nonascii.texi3
-rw-r--r--doc/lispref/objects.texi4
-rw-r--r--doc/lispref/processes.texi28
-rw-r--r--doc/misc/ChangeLog4
-rw-r--r--doc/misc/dbus.texi51
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/NEWS27
-rw-r--r--leim/ChangeLog23
-rw-r--r--leim/Makefile.in2
-rw-r--r--leim/makefile.w32-in2
-rw-r--r--leim/quail/arabic.el4
-rw-r--r--leim/quail/georgian.el10
-rw-r--r--leim/quail/greek.el11
-rw-r--r--leim/quail/latin-ltx.el4
-rw-r--r--leim/quail/vntelex.el2
-rw-r--r--lisp/ChangeLog230
-rw-r--r--lisp/Makefile.in5
-rw-r--r--lisp/align.el6
-rw-r--r--lisp/calendar/diary-lib.el4
-rw-r--r--lisp/cus-edit.el4
-rw-r--r--lisp/emacs-lisp/easy-mmode.el30
-rw-r--r--lisp/emacs-lisp/package.el3
-rw-r--r--lisp/facemenu.el105
-rw-r--r--lisp/files.el46
-rw-r--r--lisp/ido.el67
-rw-r--r--lisp/image-mode.el83
-rw-r--r--lisp/image.el21
-rw-r--r--lisp/international/mule.el10
-rw-r--r--lisp/iswitchb.el10
-rw-r--r--lisp/mail/rmail.el13
-rw-r--r--lisp/makefile.w32-in5
-rw-r--r--lisp/menu-bar.el3
-rw-r--r--lisp/mouse.el716
-rw-r--r--lisp/net/dbus.el55
-rw-r--r--lisp/progmodes/flymake.el3
-rw-r--r--lisp/progmodes/make-mode.el8
-rw-r--r--lisp/progmodes/python.el95
-rw-r--r--lisp/progmodes/ruby-mode.el5
-rw-r--r--lisp/simple.el41
-rw-r--r--lisp/startup.el24
-rw-r--r--lisp/subr.el9
-rw-r--r--lisp/textmodes/flyspell.el6
-rw-r--r--lisp/vc/add-log.el12
-rw-r--r--lisp/whitespace.el356
-rw-r--r--lisp/woman.el5
-rw-r--r--msdos/ChangeLog8
-rw-r--r--msdos/mainmake.v22
-rw-r--r--msdos/sed1v2.inp2
-rw-r--r--msdos/sedleim.inp2
-rw-r--r--nt/ChangeLog4
-rw-r--r--nt/addpm.c7
-rw-r--r--src/ChangeLog198
-rw-r--r--src/Makefile.in9
-rw-r--r--src/alloc.c15
-rw-r--r--src/callproc.c5
-rw-r--r--src/cmds.c41
-rw-r--r--src/composite.c50
-rw-r--r--src/config.in6
-rw-r--r--src/dbusbind.c234
-rw-r--r--src/deps.mk4
-rw-r--r--src/dispnew.c41
-rw-r--r--src/doc.c31
-rw-r--r--src/emacs.c70
-rw-r--r--src/eval.c27
-rw-r--r--src/image.c535
-rw-r--r--src/keyboard.c44
-rw-r--r--src/makefile.w32-in1
-rw-r--r--src/process.c89
-rw-r--r--src/puresize.h9
-rw-r--r--src/s/aix4-2.h4
-rw-r--r--src/s/hpux10-20.h7
-rw-r--r--src/s/ms-w32.h1
-rw-r--r--src/s/unixware.h2
-rw-r--r--src/sysdep.c180
-rw-r--r--src/sysselect.h5
-rw-r--r--src/systty.h124
-rw-r--r--src/term.c3
-rw-r--r--src/unexcoff.c64
-rw-r--r--src/w32fns.c7
-rw-r--r--src/w32menu.c6
-rw-r--r--src/xdisp.c23
95 files changed, 3007 insertions, 1866 deletions
diff --git a/ChangeLog b/ChangeLog
index 71b597d889b..842a167e818 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
12010-08-23 Andreas Schwab <schwab@linux-m68k.org>
2
3 * configure.in: Fix check for librsvg, imagemagick and
4 MagickExportImagePixels.
5
62010-08-18 Joakim Verona <joakim@verona.se>
7
8 * Makefile.in, configure.in: Checks for ImageMagick.
9
12010-08-10 Dan Nicolaescu <dann@ics.uci.edu> 102010-08-10 Dan Nicolaescu <dann@ics.uci.edu>
2 11
3 * configure.in (AC_PREREQ): Require autoconf 2.65. 12 * configure.in (AC_PREREQ): Require autoconf 2.65.
diff --git a/README.imagemagick b/README.imagemagick
new file mode 100644
index 00000000000..792e9fd90ea
--- /dev/null
+++ b/README.imagemagick
@@ -0,0 +1,151 @@
1* README for the ImageMagick Emacs branch
2
3This is the imagemagick branch of Emacs. Imagemagick can now be used
4to load many new image formats, and also do useful transforms like
5scaling and rotation.
6
7This file will attempt to contain draft NEWS, Changelog and manual
8entries for the new functionality.
9
10You might need to regenerate the configure scripts:
11aclocal
12automake
13autoheader
14autoconf
15./configure --with-imagemagick
16
17
18* TODO image-type-header-regexps priorities the jpeg loader over the
19imagemagick one. This is not wrong, but how should a user go about
20prefering the imagemagick loader? The user might like zooming etc in
21jpegs.
22
23try (setq image-type-header-regexps nil) for a quick hack to prefer
24imagemagick over the jpg loader.
25
26* TODO For some reason its unbearably slow to look at a page in a large
27 image bundle using the :index feature. The imagemagick "display"
28 command is also a bit slow, but nowhere near as slow as the emacs
29 code. It seems imagemagick tries to unpack every page when loading
30 the bundle. This feature is not the primary usecase for the
31 imagemagick patch though.
32
33 ImageMagick 6.6.2-9 introduced a bugfix for single page djvu load.
34 It is now way faster to use the :index feature, but its still not
35 very fast.
36
37** DONE optimize number of pages calculation for bundles as suggested by
38 imagemagick forum: "set the density to something low like 2 and use
39 MagickPingImage()"
40
41** TODO try to cache the num pages calculation. it can take a while to
42 calculate the number of pages, and if you need to do it for each
43 page view, page-flipping becomes uselessly slow.
44
45* TODO integrate with image-dired
46
47* TODO integrate with docview.
48
49* TODO integrate with image-mode
50Some work has been done, M-x image-transform-fit-to-height will fit
51the image to the height of the Emacs window for instance.
52
53* TODO look for optimizations for handling images with low depth
54Currently the code seems to default to 24 bit RGB which is costly for
55images with lower bit depth.
56
57* TODO complete documentation drafts below
58
59* DONE fix inconsistencys with spelling of imagemagick in the src
60* DONE report number of images in image bundle types somehow
61Works like for "gif" support. Thanks to Juri Linkov.
62* DONE probably add pdf to inhibited types
63* DONE inhibit types is defconst should probably be defcustom
64* TODO decide what to do with some uncommitted imagemagick support
65 functions for image size etc.
66* TODO Test with more systems
67Tested on Fedora 12, Fedora 14 so far, and the libmagick that ships with it.
68Ubuntu 8.04 was also tested, but it seems it ships a broken
69ImageMagick.
70
71I also tried using an imagemagick compiled from their SVN, in
72parallell with the one packaged by Fedora, it worked well.
73
74* DONE Also need some way to handle render methods that only work on newer ImageMagicks
75Is handled by configure now
76
77* Some nits from Stefan Monnier
78I just took a quick look at the code and I see the following nits to fix:
79
80** DONE obviously a merge will have to come with a good ChangeLog.
81** DONE also the merge will need to come with documentation. Maybe not in the
82 Texinfo form yet, but at least in the etc/NEWS with enough info that
83 describes the `scale' and other such arguments that someone can start
84 using them.
85** DONE the README talks about naming inconsistencies, I think these should be
86 fixed before a first commit (should be straightforward).
87
88** DONE the "let" in image.el should not be followed by a line break and the while
89 should be replaced by a dolist.
90
91** DONE the prototype of imagemagick_load_image has some odd indentation in ([[2010.06.14]])
92 its args, not sure what happened.
93** DONE a few lines in the C code break the 80columns limit.
94** DONE please use ANSI style function declarations rather than K&R for new code. ([[2010.06.14]])
95** DONE you can get rid of the prototypes by reordering the code. ([[2010.06.14]])
96** DONE the docstrings in DEFUN should not be indented (they'll display ([[2010.06.14]])
97 weirdly otherwise in C-h f).
98** DONE Some "{" are at the end of a for/if rather than on their own line. ([[2010.06.14]])
99** DONE why use "*( imtypes + i)" rather than "imtypes[i]"? ([[2010.06.14]])
100** DONE some "," lack a space after them. ([[2010.06.14]])
101** DONE several "=" and "==" lack spaces around them. ([[2010.06.14]])
102
103
104* NEWS entry
105** ImageMagick support
106It is now possible to use the Imagemagick library to load many new
107image formats in Emacs.
108
109To enable, use the following configure option:
110--with-imagemagick
111
112The new function (imagemagick-types) returns a list of image file
113extensions that your installation of imagemagick supports.
114
115The function (imagemagick-register-types) will enable the imagemagick
116support for the extensions in imagemagick-types minus the types listed
117in imagemagick-types-inhibit.
118
119imagemagick-types-inhibit has the value '(C HTML HTM TXT PDF) by default.
120This means imagemagick will be used also to load jpeg files, if you
121have both jpeg and imagemagick libraries linked. Add 'JPG to
122imagemagick-types-inhibit if you do not want this.
123
124imagemagick-render-type is a new variable which can be set to choose
125between screen render methods.
126
127- 0 is a conservative metod which works with older ImageMagick
128 versions. It is a bit slow, but robust.
129
130- 1 utilizes a newer ImageMagick method
131
132
133Images loaded with imagemagick will support a couple of new display
134specification behaviours:
135
136- if the :width and :height keywords are specified, these values are
137used for scaling the image. If only one of :width or :height is
138specified, the other one will be calculated so as to preserve the
139aspect ratio.If both :width and :height are specified, aspect ratio
140will not be preserved.
141
142- :rotation specifies a rotation angle in degrees.
143
144- :index specifies which image inside an image bundle file format, such
145as TIFF or DJVM, to view.
146
147The image-metadata function can be used to retrieve the total number
148of images in an image bundle. This is simmilar to how GIF files work.
149
150* Manual entry
151nothing yet, but the NEWS entry could be adapted.
diff --git a/admin/unidata/Makefile.in b/admin/unidata/Makefile.in
index 91a3640fff7..e7b0fbe4bf9 100644
--- a/admin/unidata/Makefile.in
+++ b/admin/unidata/Makefile.in
@@ -21,7 +21,7 @@
21 21
22EMACS = ../../src/emacs 22EMACS = ../../src/emacs
23DSTDIR = ../../lisp/international 23DSTDIR = ../../lisp/international
24RUNEMACS = ${EMACS} -Q --multibyte -batch 24RUNEMACS = ${EMACS} -Q -batch
25 25
26all: ${DSTDIR}/charprop.el ../../src/biditype.h ../../src/bidimirror.h 26all: ${DSTDIR}/charprop.el ../../src/biditype.h ../../src/bidimirror.h
27 27
diff --git a/admin/unidata/makefile.w32-in b/admin/unidata/makefile.w32-in
index 85dfb135df8..58cea29db8b 100644
--- a/admin/unidata/makefile.w32-in
+++ b/admin/unidata/makefile.w32-in
@@ -27,7 +27,7 @@ lisp = $(CURDIR)/../../lisp
27# lisp/subdirs.el is not generated yet when the commands below run. 27# lisp/subdirs.el is not generated yet when the commands below run.
28EMACSLOADPATH = $(lisp);$(lisp)/international;$(lisp)/emacs-lisp 28EMACSLOADPATH = $(lisp);$(lisp)/international;$(lisp)/emacs-lisp
29# Quote EMACS so it could be a file name with embedded whitespace 29# Quote EMACS so it could be a file name with embedded whitespace
30RUNEMACS = "$(EMACS)" -Q --multibyte -batch 30RUNEMACS = "$(EMACS)" -Q -batch
31 31
32all: $(DSTDIR)/charprop.el ../../src/biditype.h ../../src/bidimirror.h 32all: $(DSTDIR)/charprop.el ../../src/biditype.h ../../src/bidimirror.h
33 33
diff --git a/configure b/configure
index 3eaf150a25e..527c53690bd 100755
--- a/configure
+++ b/configure
@@ -1,11 +1,11 @@
1#! /bin/sh 1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles. 2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.66 for emacs 24.0.50. 3# Generated by GNU Autoconf 2.65 for emacs 24.0.50.
4# 4#
5# 5#
6# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 6# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
7# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software 7# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
8# Foundation, Inc. 8# Inc.
9# 9#
10# 10#
11# This configure script is free software; the Free Software Foundation 11# This configure script is free software; the Free Software Foundation
@@ -316,7 +316,7 @@ $as_echo X"$as_dir" |
316 test -d "$as_dir" && break 316 test -d "$as_dir" && break
317 done 317 done
318 test -z "$as_dirs" || eval "mkdir $as_dirs" 318 test -z "$as_dirs" || eval "mkdir $as_dirs"
319 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" 319 } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
320 320
321 321
322} # as_fn_mkdir_p 322} # as_fn_mkdir_p
@@ -356,19 +356,19 @@ else
356fi # as_fn_arith 356fi # as_fn_arith
357 357
358 358
359# as_fn_error STATUS ERROR [LINENO LOG_FD] 359# as_fn_error ERROR [LINENO LOG_FD]
360# ---------------------------------------- 360# ---------------------------------
361# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are 361# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
362# provided, also output the error to LOG_FD, referencing LINENO. Then exit the 362# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
363# script with STATUS, using 1 if that was 0. 363# script with status $?, using 1 if that was 0.
364as_fn_error () 364as_fn_error ()
365{ 365{
366 as_status=$1; test $as_status -eq 0 && as_status=1 366 as_status=$?; test $as_status -eq 0 && as_status=1
367 if test "$4"; then 367 if test "$3"; then
368 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 368 as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
369 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 369 $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
370 fi 370 fi
371 $as_echo "$as_me: error: $2" >&2 371 $as_echo "$as_me: error: $1" >&2
372 as_fn_exit $as_status 372 as_fn_exit $as_status
373} # as_fn_error 373} # as_fn_error
374 374
@@ -530,7 +530,7 @@ test -n "$DJDIR" || exec 7<&0 </dev/null
530exec 6>&1 530exec 6>&1
531 531
532# Name of the host. 532# Name of the host.
533# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, 533# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
534# so uname gets run too. 534# so uname gets run too.
535ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` 535ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
536 536
@@ -688,6 +688,8 @@ DBUS_CFLAGS
688GTK_OBJ 688GTK_OBJ
689GTK_LIBS 689GTK_LIBS
690GTK_CFLAGS 690GTK_CFLAGS
691IMAGEMAGICK_LIBS
692IMAGEMAGICK_CFLAGS
691RSVG_LIBS 693RSVG_LIBS
692RSVG_CFLAGS 694RSVG_CFLAGS
693VMLIMIT_OBJ 695VMLIMIT_OBJ
@@ -805,6 +807,7 @@ with_tiff
805with_gif 807with_gif
806with_png 808with_png
807with_rsvg 809with_rsvg
810with_imagemagick
808with_xft 811with_xft
809with_libotf 812with_libotf
810with_m17n_flt 813with_m17n_flt
@@ -950,7 +953,7 @@ do
950 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` 953 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
951 # Reject names that are not valid shell variable names. 954 # Reject names that are not valid shell variable names.
952 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 955 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
953 as_fn_error $? "invalid feature name: $ac_useropt" 956 as_fn_error "invalid feature name: $ac_useropt"
954 ac_useropt_orig=$ac_useropt 957 ac_useropt_orig=$ac_useropt
955 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 958 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
956 case $ac_user_opts in 959 case $ac_user_opts in
@@ -976,7 +979,7 @@ do
976 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` 979 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
977 # Reject names that are not valid shell variable names. 980 # Reject names that are not valid shell variable names.
978 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 981 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
979 as_fn_error $? "invalid feature name: $ac_useropt" 982 as_fn_error "invalid feature name: $ac_useropt"
980 ac_useropt_orig=$ac_useropt 983 ac_useropt_orig=$ac_useropt
981 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 984 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
982 case $ac_user_opts in 985 case $ac_user_opts in
@@ -1180,7 +1183,7 @@ do
1180 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` 1183 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1181 # Reject names that are not valid shell variable names. 1184 # Reject names that are not valid shell variable names.
1182 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 1185 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1183 as_fn_error $? "invalid package name: $ac_useropt" 1186 as_fn_error "invalid package name: $ac_useropt"
1184 ac_useropt_orig=$ac_useropt 1187 ac_useropt_orig=$ac_useropt
1185 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 1188 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1186 case $ac_user_opts in 1189 case $ac_user_opts in
@@ -1196,7 +1199,7 @@ do
1196 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` 1199 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1197 # Reject names that are not valid shell variable names. 1200 # Reject names that are not valid shell variable names.
1198 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && 1201 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1199 as_fn_error $? "invalid package name: $ac_useropt" 1202 as_fn_error "invalid package name: $ac_useropt"
1200 ac_useropt_orig=$ac_useropt 1203 ac_useropt_orig=$ac_useropt
1201 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` 1204 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1202 case $ac_user_opts in 1205 case $ac_user_opts in
@@ -1226,8 +1229,8 @@ do
1226 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) 1229 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1227 x_libraries=$ac_optarg ;; 1230 x_libraries=$ac_optarg ;;
1228 1231
1229 -*) as_fn_error $? "unrecognized option: \`$ac_option' 1232 -*) as_fn_error "unrecognized option: \`$ac_option'
1230Try \`$0 --help' for more information" 1233Try \`$0 --help' for more information."
1231 ;; 1234 ;;
1232 1235
1233 *=*) 1236 *=*)
@@ -1235,7 +1238,7 @@ Try \`$0 --help' for more information"
1235 # Reject names that are not valid shell variable names. 1238 # Reject names that are not valid shell variable names.
1236 case $ac_envvar in #( 1239 case $ac_envvar in #(
1237 '' | [0-9]* | *[!_$as_cr_alnum]* ) 1240 '' | [0-9]* | *[!_$as_cr_alnum]* )
1238 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; 1241 as_fn_error "invalid variable name: \`$ac_envvar'" ;;
1239 esac 1242 esac
1240 eval $ac_envvar=\$ac_optarg 1243 eval $ac_envvar=\$ac_optarg
1241 export $ac_envvar ;; 1244 export $ac_envvar ;;
@@ -1253,13 +1256,13 @@ done
1253 1256
1254if test -n "$ac_prev"; then 1257if test -n "$ac_prev"; then
1255 ac_option=--`echo $ac_prev | sed 's/_/-/g'` 1258 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1256 as_fn_error $? "missing argument to $ac_option" 1259 as_fn_error "missing argument to $ac_option"
1257fi 1260fi
1258 1261
1259if test -n "$ac_unrecognized_opts"; then 1262if test -n "$ac_unrecognized_opts"; then
1260 case $enable_option_checking in 1263 case $enable_option_checking in
1261 no) ;; 1264 no) ;;
1262 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; 1265 fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
1263 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; 1266 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1264 esac 1267 esac
1265fi 1268fi
@@ -1282,7 +1285,7 @@ do
1282 [\\/$]* | ?:[\\/]* ) continue;; 1285 [\\/$]* | ?:[\\/]* ) continue;;
1283 NONE | '' ) case $ac_var in *prefix ) continue;; esac;; 1286 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1284 esac 1287 esac
1285 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 1288 as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
1286done 1289done
1287 1290
1288# There might be people who depend on the old broken behavior: `$host' 1291# There might be people who depend on the old broken behavior: `$host'
@@ -1296,8 +1299,8 @@ target=$target_alias
1296if test "x$host_alias" != x; then 1299if test "x$host_alias" != x; then
1297 if test "x$build_alias" = x; then 1300 if test "x$build_alias" = x; then
1298 cross_compiling=maybe 1301 cross_compiling=maybe
1299 $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. 1302 $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
1300 If a cross compiler is detected then cross compile mode will be used" >&2 1303 If a cross compiler is detected then cross compile mode will be used." >&2
1301 elif test "x$build_alias" != "x$host_alias"; then 1304 elif test "x$build_alias" != "x$host_alias"; then
1302 cross_compiling=yes 1305 cross_compiling=yes
1303 fi 1306 fi
@@ -1312,9 +1315,9 @@ test "$silent" = yes && exec 6>/dev/null
1312ac_pwd=`pwd` && test -n "$ac_pwd" && 1315ac_pwd=`pwd` && test -n "$ac_pwd" &&
1313ac_ls_di=`ls -di .` && 1316ac_ls_di=`ls -di .` &&
1314ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || 1317ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1315 as_fn_error $? "working directory cannot be determined" 1318 as_fn_error "working directory cannot be determined"
1316test "X$ac_ls_di" = "X$ac_pwd_ls_di" || 1319test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1317 as_fn_error $? "pwd does not report name of working directory" 1320 as_fn_error "pwd does not report name of working directory"
1318 1321
1319 1322
1320# Find the source files, if location was not specified. 1323# Find the source files, if location was not specified.
@@ -1353,11 +1356,11 @@ else
1353fi 1356fi
1354if test ! -r "$srcdir/$ac_unique_file"; then 1357if test ! -r "$srcdir/$ac_unique_file"; then
1355 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." 1358 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1356 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" 1359 as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
1357fi 1360fi
1358ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" 1361ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1359ac_abs_confdir=`( 1362ac_abs_confdir=`(
1360 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" 1363 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
1361 pwd)` 1364 pwd)`
1362# When building in place, set srcdir=. 1365# When building in place, set srcdir=.
1363if test "$ac_abs_confdir" = "$ac_pwd"; then 1366if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1397,7 +1400,7 @@ Configuration:
1397 --help=short display options specific to this package 1400 --help=short display options specific to this package
1398 --help=recursive display the short help of all the included packages 1401 --help=recursive display the short help of all the included packages
1399 -V, --version display version information and exit 1402 -V, --version display version information and exit
1400 -q, --quiet, --silent do not print \`checking ...' messages 1403 -q, --quiet, --silent do not print \`checking...' messages
1401 --cache-file=FILE cache test results in FILE [disabled] 1404 --cache-file=FILE cache test results in FILE [disabled]
1402 -C, --config-cache alias for \`--cache-file=config.cache' 1405 -C, --config-cache alias for \`--cache-file=config.cache'
1403 -n, --no-create do not create output files 1406 -n, --no-create do not create output files
@@ -1511,6 +1514,7 @@ Optional Packages:
1511 --without-gif don't compile with GIF image support 1514 --without-gif don't compile with GIF image support
1512 --without-png don't compile with PNG image support 1515 --without-png don't compile with PNG image support
1513 --without-rsvg don't compile with SVG image support 1516 --without-rsvg don't compile with SVG image support
1517 --with-imagemagick compile with ImageMagick image support
1514 --without-xft don't use XFT for anti aliased fonts 1518 --without-xft don't use XFT for anti aliased fonts
1515 --without-libotf don't use libotf for OpenType font support 1519 --without-libotf don't use libotf for OpenType font support
1516 --without-m17n-flt don't use m17n-flt for text shaping 1520 --without-m17n-flt don't use m17n-flt for text shaping
@@ -1613,9 +1617,9 @@ test -n "$ac_init_help" && exit $ac_status
1613if $ac_init_version; then 1617if $ac_init_version; then
1614 cat <<\_ACEOF 1618 cat <<\_ACEOF
1615emacs configure 24.0.50 1619emacs configure 24.0.50
1616generated by GNU Autoconf 2.66 1620generated by GNU Autoconf 2.65
1617 1621
1618Copyright (C) 2010 Free Software Foundation, Inc. 1622Copyright (C) 2009 Free Software Foundation, Inc.
1619This configure script is free software; the Free Software Foundation 1623This configure script is free software; the Free Software Foundation
1620gives unlimited permission to copy, distribute and modify it. 1624gives unlimited permission to copy, distribute and modify it.
1621_ACEOF 1625_ACEOF
@@ -1755,10 +1759,10 @@ fi
1755ac_fn_c_check_header_mongrel () 1759ac_fn_c_check_header_mongrel ()
1756{ 1760{
1757 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1761 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1758 if eval "test \"\${$3+set}\"" = set; then : 1762 if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
1759 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1763 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1760$as_echo_n "checking for $2... " >&6; } 1764$as_echo_n "checking for $2... " >&6; }
1761if eval "test \"\${$3+set}\"" = set; then : 1765if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
1762 $as_echo_n "(cached) " >&6 1766 $as_echo_n "(cached) " >&6
1763fi 1767fi
1764eval ac_res=\$$3 1768eval ac_res=\$$3
@@ -1821,7 +1825,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1821esac 1825esac
1822 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1826 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1823$as_echo_n "checking for $2... " >&6; } 1827$as_echo_n "checking for $2... " >&6; }
1824if eval "test \"\${$3+set}\"" = set; then : 1828if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
1825 $as_echo_n "(cached) " >&6 1829 $as_echo_n "(cached) " >&6
1826else 1830else
1827 eval "$3=\$ac_header_compiler" 1831 eval "$3=\$ac_header_compiler"
@@ -1885,7 +1889,7 @@ ac_fn_c_check_header_compile ()
1885 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1889 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1886 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1890 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1887$as_echo_n "checking for $2... " >&6; } 1891$as_echo_n "checking for $2... " >&6; }
1888if eval "test \"\${$3+set}\"" = set; then : 1892if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
1889 $as_echo_n "(cached) " >&6 1893 $as_echo_n "(cached) " >&6
1890else 1894else
1891 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 1895 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1907,18 +1911,15 @@ $as_echo "$ac_res" >&6; }
1907 1911
1908} # ac_fn_c_check_header_compile 1912} # ac_fn_c_check_header_compile
1909 1913
1910# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES 1914# ac_fn_c_check_decl LINENO SYMBOL VAR
1911# --------------------------------------------- 1915# ------------------------------------
1912# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR 1916# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
1913# accordingly.
1914ac_fn_c_check_decl () 1917ac_fn_c_check_decl ()
1915{ 1918{
1916 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1919 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1917 as_decl_name=`echo $2|sed 's/ *(.*//'` 1920 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
1918 as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` 1921$as_echo_n "checking whether $2 is declared... " >&6; }
1919 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 1922if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
1920$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
1921if eval "test \"\${$3+set}\"" = set; then :
1922 $as_echo_n "(cached) " >&6 1923 $as_echo_n "(cached) " >&6
1923else 1924else
1924 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 1925 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1927,12 +1928,8 @@ $4
1927int 1928int
1928main () 1929main ()
1929{ 1930{
1930#ifndef $as_decl_name 1931#ifndef $2
1931#ifdef __cplusplus 1932 (void) $2;
1932 (void) $as_decl_use;
1933#else
1934 (void) $as_decl_name;
1935#endif
1936#endif 1933#endif
1937 1934
1938 ; 1935 ;
@@ -1961,7 +1958,7 @@ ac_fn_c_check_header_preproc ()
1961 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1958 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1962 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 1959 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1963$as_echo_n "checking for $2... " >&6; } 1960$as_echo_n "checking for $2... " >&6; }
1964if eval "test \"\${$3+set}\"" = set; then : 1961if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
1965 $as_echo_n "(cached) " >&6 1962 $as_echo_n "(cached) " >&6
1966else 1963else
1967 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 1964 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1991,7 +1988,7 @@ ac_fn_c_check_member ()
1991 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 1988 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1992 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 1989 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
1993$as_echo_n "checking for $2.$3... " >&6; } 1990$as_echo_n "checking for $2.$3... " >&6; }
1994if eval "test \"\${$4+set}\"" = set; then : 1991if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then :
1995 $as_echo_n "(cached) " >&6 1992 $as_echo_n "(cached) " >&6
1996else 1993else
1997 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 1994 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2047,7 +2044,7 @@ ac_fn_c_check_func ()
2047 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2044 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2048 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 2045 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2049$as_echo_n "checking for $2... " >&6; } 2046$as_echo_n "checking for $2... " >&6; }
2050if eval "test \"\${$3+set}\"" = set; then : 2047if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2051 $as_echo_n "(cached) " >&6 2048 $as_echo_n "(cached) " >&6
2052else 2049else
2053 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 2050 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2115,7 +2112,7 @@ ac_fn_c_check_type ()
2115 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 2112 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2116 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 2113 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2117$as_echo_n "checking for $2... " >&6; } 2114$as_echo_n "checking for $2... " >&6; }
2118if eval "test \"\${$3+set}\"" = set; then : 2115if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2119 $as_echo_n "(cached) " >&6 2116 $as_echo_n "(cached) " >&6
2120else 2117else
2121 eval "$3=no" 2118 eval "$3=no"
@@ -2164,7 +2161,7 @@ This file contains any messages produced by compilers while
2164running configure, to aid debugging if configure makes a mistake. 2161running configure, to aid debugging if configure makes a mistake.
2165 2162
2166It was created by emacs $as_me 24.0.50, which was 2163It was created by emacs $as_me 24.0.50, which was
2167generated by GNU Autoconf 2.66. Invocation command line was 2164generated by GNU Autoconf 2.65. Invocation command line was
2168 2165
2169 $ $0 $@ 2166 $ $0 $@
2170 2167
@@ -2274,9 +2271,11 @@ trap 'exit_status=$?
2274 { 2271 {
2275 echo 2272 echo
2276 2273
2277 $as_echo "## ---------------- ## 2274 cat <<\_ASBOX
2275## ---------------- ##
2278## Cache variables. ## 2276## Cache variables. ##
2279## ---------------- ##" 2277## ---------------- ##
2278_ASBOX
2280 echo 2279 echo
2281 # The following way of writing the cache mishandles newlines in values, 2280 # The following way of writing the cache mishandles newlines in values,
2282( 2281(
@@ -2310,9 +2309,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2310) 2309)
2311 echo 2310 echo
2312 2311
2313 $as_echo "## ----------------- ## 2312 cat <<\_ASBOX
2313## ----------------- ##
2314## Output variables. ## 2314## Output variables. ##
2315## ----------------- ##" 2315## ----------------- ##
2316_ASBOX
2316 echo 2317 echo
2317 for ac_var in $ac_subst_vars 2318 for ac_var in $ac_subst_vars
2318 do 2319 do
@@ -2325,9 +2326,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2325 echo 2326 echo
2326 2327
2327 if test -n "$ac_subst_files"; then 2328 if test -n "$ac_subst_files"; then
2328 $as_echo "## ------------------- ## 2329 cat <<\_ASBOX
2330## ------------------- ##
2329## File substitutions. ## 2331## File substitutions. ##
2330## ------------------- ##" 2332## ------------------- ##
2333_ASBOX
2331 echo 2334 echo
2332 for ac_var in $ac_subst_files 2335 for ac_var in $ac_subst_files
2333 do 2336 do
@@ -2341,9 +2344,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2341 fi 2344 fi
2342 2345
2343 if test -s confdefs.h; then 2346 if test -s confdefs.h; then
2344 $as_echo "## ----------- ## 2347 cat <<\_ASBOX
2348## ----------- ##
2345## confdefs.h. ## 2349## confdefs.h. ##
2346## ----------- ##" 2350## ----------- ##
2351_ASBOX
2347 echo 2352 echo
2348 cat confdefs.h 2353 cat confdefs.h
2349 echo 2354 echo
@@ -2398,12 +2403,7 @@ _ACEOF
2398ac_site_file1=NONE 2403ac_site_file1=NONE
2399ac_site_file2=NONE 2404ac_site_file2=NONE
2400if test -n "$CONFIG_SITE"; then 2405if test -n "$CONFIG_SITE"; then
2401 # We do not want a PATH search for config.site. 2406 ac_site_file1=$CONFIG_SITE
2402 case $CONFIG_SITE in #((
2403 -*) ac_site_file1=./$CONFIG_SITE;;
2404 */*) ac_site_file1=$CONFIG_SITE;;
2405 *) ac_site_file1=./$CONFIG_SITE;;
2406 esac
2407elif test "x$prefix" != xNONE; then 2407elif test "x$prefix" != xNONE; then
2408 ac_site_file1=$prefix/share/config.site 2408 ac_site_file1=$prefix/share/config.site
2409 ac_site_file2=$prefix/etc/config.site 2409 ac_site_file2=$prefix/etc/config.site
@@ -2418,11 +2418,7 @@ do
2418 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 2418 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2419$as_echo "$as_me: loading site script $ac_site_file" >&6;} 2419$as_echo "$as_me: loading site script $ac_site_file" >&6;}
2420 sed 's/^/| /' "$ac_site_file" >&5 2420 sed 's/^/| /' "$ac_site_file" >&5
2421 . "$ac_site_file" \ 2421 . "$ac_site_file"
2422 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2423$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2424as_fn_error $? "failed to load site script $ac_site_file
2425See \`config.log' for more details" "$LINENO" 5; }
2426 fi 2422 fi
2427done 2423done
2428 2424
@@ -2503,7 +2499,7 @@ if $ac_cache_corrupted; then
2503$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2499$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2504 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 2500 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2505$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} 2501$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2506 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 2502 as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2507fi 2503fi
2508## -------------------- ## 2504## -------------------- ##
2509## Main body of script. ## 2505## Main body of script. ##
@@ -2677,7 +2673,7 @@ if test "${with_x_toolkit+set}" = set; then :
2677 g | gt | gtk ) val=gtk ;; 2673 g | gt | gtk ) val=gtk ;;
2678 gtk3 ) val=gtk3 ;; 2674 gtk3 ) val=gtk3 ;;
2679 * ) 2675 * )
2680as_fn_error $? "\`--with-x-toolkit=$withval' is invalid; 2676as_fn_error "\`--with-x-toolkit=$withval' is invalid;
2681this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk' or 2677this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk' or
2682\`gtk3'. \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5 2678\`gtk3'. \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5
2683 ;; 2679 ;;
@@ -2736,6 +2732,14 @@ else
2736fi 2732fi
2737 2733
2738 2734
2735# Check whether --with-imagemagick was given.
2736if test "${with_imagemagick+set}" = set; then :
2737 withval=$with_imagemagick;
2738else
2739 with_imagemagick=no
2740fi
2741
2742
2739 2743
2740# Check whether --with-xft was given. 2744# Check whether --with-xft was given.
2741if test "${with_xft+set}" = set; then : 2745if test "${with_xft+set}" = set; then :
@@ -2956,7 +2960,7 @@ do
2956 stringfreelist) ac_gc_check_string_free_list=1 ;; 2960 stringfreelist) ac_gc_check_string_free_list=1 ;;
2957 xmallocoverrun) ac_xmalloc_overrun=1 ;; 2961 xmallocoverrun) ac_xmalloc_overrun=1 ;;
2958 conslist) ac_gc_check_cons_list=1 ;; 2962 conslist) ac_gc_check_cons_list=1 ;;
2959 *) as_fn_error $? "unknown check category $check" "$LINENO" 5 ;; 2963 *) as_fn_error "unknown check category $check" "$LINENO" 5 ;;
2960 esac 2964 esac
2961done 2965done
2962IFS="$ac_save_IFS" 2966IFS="$ac_save_IFS"
@@ -3074,22 +3078,16 @@ fi
3074 3078
3075ac_aux_dir= 3079ac_aux_dir=
3076for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do 3080for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
3077 if test -f "$ac_dir/install-sh"; then 3081 for ac_t in install-sh install.sh shtool; do
3078 ac_aux_dir=$ac_dir 3082 if test -f "$ac_dir/$ac_t"; then
3079 ac_install_sh="$ac_aux_dir/install-sh -c" 3083 ac_aux_dir=$ac_dir
3080 break 3084 ac_install_sh="$ac_aux_dir/$ac_t -c"
3081 elif test -f "$ac_dir/install.sh"; then 3085 break 2
3082 ac_aux_dir=$ac_dir 3086 fi
3083 ac_install_sh="$ac_aux_dir/install.sh -c" 3087 done
3084 break
3085 elif test -f "$ac_dir/shtool"; then
3086 ac_aux_dir=$ac_dir
3087 ac_install_sh="$ac_aux_dir/shtool install -c"
3088 break
3089 fi
3090done 3088done
3091if test -z "$ac_aux_dir"; then 3089if test -z "$ac_aux_dir"; then
3092 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 3090 as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
3093fi 3091fi
3094 3092
3095# These three variables are undocumented and unsupported, 3093# These three variables are undocumented and unsupported,
@@ -3103,7 +3101,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
3103 3101
3104# Make sure we can run config.sub. 3102# Make sure we can run config.sub.
3105$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || 3103$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
3106 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 3104 as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
3107 3105
3108{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 3106{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
3109$as_echo_n "checking build system type... " >&6; } 3107$as_echo_n "checking build system type... " >&6; }
@@ -3114,16 +3112,16 @@ else
3114test "x$ac_build_alias" = x && 3112test "x$ac_build_alias" = x &&
3115 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` 3113 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
3116test "x$ac_build_alias" = x && 3114test "x$ac_build_alias" = x &&
3117 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 3115 as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
3118ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || 3116ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
3119 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 3117 as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
3120 3118
3121fi 3119fi
3122{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 3120{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
3123$as_echo "$ac_cv_build" >&6; } 3121$as_echo "$ac_cv_build" >&6; }
3124case $ac_cv_build in 3122case $ac_cv_build in
3125*-*-*) ;; 3123*-*-*) ;;
3126*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; 3124*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
3127esac 3125esac
3128build=$ac_cv_build 3126build=$ac_cv_build
3129ac_save_IFS=$IFS; IFS='-' 3127ac_save_IFS=$IFS; IFS='-'
@@ -3148,7 +3146,7 @@ else
3148 ac_cv_host=$ac_cv_build 3146 ac_cv_host=$ac_cv_build
3149else 3147else
3150 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || 3148 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
3151 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 3149 as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
3152fi 3150fi
3153 3151
3154fi 3152fi
@@ -3156,7 +3154,7 @@ fi
3156$as_echo "$ac_cv_host" >&6; } 3154$as_echo "$ac_cv_host" >&6; }
3157case $ac_cv_host in 3155case $ac_cv_host in
3158*-*-*) ;; 3156*-*-*) ;;
3159*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; 3157*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
3160esac 3158esac
3161host=$ac_cv_host 3159host=$ac_cv_host
3162ac_save_IFS=$IFS; IFS='-' 3160ac_save_IFS=$IFS; IFS='-'
@@ -3450,7 +3448,7 @@ fi
3450 3448
3451 3449
3452if test $unported = yes; then 3450if test $unported = yes; then
3453 as_fn_error $? "Emacs hasn't been ported to \`${canonical}' systems. 3451 as_fn_error "Emacs hasn't been ported to \`${canonical}' systems.
3454Check \`etc/MACHINES' for recognized configuration names." "$LINENO" 5 3452Check \`etc/MACHINES' for recognized configuration names." "$LINENO" 5
3455fi 3453fi
3456 3454
@@ -3764,8 +3762,8 @@ fi
3764 3762
3765test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 3763test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3766$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3764$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3767as_fn_error $? "no acceptable C compiler found in \$PATH 3765as_fn_error "no acceptable C compiler found in \$PATH
3768See \`config.log' for more details" "$LINENO" 5; } 3766See \`config.log' for more details." "$LINENO" 5; }
3769 3767
3770# Provide some information about the compiler. 3768# Provide some information about the compiler.
3771$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 3769$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -3879,8 +3877,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
3879 3877
3880{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 3878{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3881$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3879$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3882as_fn_error 77 "C compiler cannot create executables 3880{ as_fn_set_status 77
3883See \`config.log' for more details" "$LINENO" 5; } 3881as_fn_error "C compiler cannot create executables
3882See \`config.log' for more details." "$LINENO" 5; }; }
3884else 3883else
3885 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 3884 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3886$as_echo "yes" >&6; } 3885$as_echo "yes" >&6; }
@@ -3922,8 +3921,8 @@ done
3922else 3921else
3923 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 3922 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3924$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3923$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3925as_fn_error $? "cannot compute suffix of executables: cannot compile and link 3924as_fn_error "cannot compute suffix of executables: cannot compile and link
3926See \`config.log' for more details" "$LINENO" 5; } 3925See \`config.log' for more details." "$LINENO" 5; }
3927fi 3926fi
3928rm -f conftest conftest$ac_cv_exeext 3927rm -f conftest conftest$ac_cv_exeext
3929{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 3928{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3980,9 +3979,9 @@ $as_echo "$ac_try_echo"; } >&5
3980 else 3979 else
3981 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 3980 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3982$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3981$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3983as_fn_error $? "cannot run C compiled programs. 3982as_fn_error "cannot run C compiled programs.
3984If you meant to cross compile, use \`--host'. 3983If you meant to cross compile, use \`--host'.
3985See \`config.log' for more details" "$LINENO" 5; } 3984See \`config.log' for more details." "$LINENO" 5; }
3986 fi 3985 fi
3987 fi 3986 fi
3988fi 3987fi
@@ -4033,8 +4032,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
4033 4032
4034{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 4033{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4035$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 4034$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4036as_fn_error $? "cannot compute suffix of object files: cannot compile 4035as_fn_error "cannot compute suffix of object files: cannot compile
4037See \`config.log' for more details" "$LINENO" 5; } 4036See \`config.log' for more details." "$LINENO" 5; }
4038fi 4037fi
4039rm -f conftest.$ac_cv_objext conftest.$ac_ext 4038rm -f conftest.$ac_cv_objext conftest.$ac_ext
4040fi 4039fi
@@ -4451,8 +4450,8 @@ if $ac_preproc_ok; then :
4451else 4450else
4452 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 4451 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4453$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 4452$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4454as_fn_error $? "C preprocessor \"$CPP\" fails sanity check 4453as_fn_error "C preprocessor \"$CPP\" fails sanity check
4455See \`config.log' for more details" "$LINENO" 5; } 4454See \`config.log' for more details." "$LINENO" 5; }
4456fi 4455fi
4457 4456
4458ac_ext=c 4457ac_ext=c
@@ -4513,7 +4512,7 @@ esac
4513 done 4512 done
4514IFS=$as_save_IFS 4513IFS=$as_save_IFS
4515 if test -z "$ac_cv_path_GREP"; then 4514 if test -z "$ac_cv_path_GREP"; then
4516 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 4515 as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4517 fi 4516 fi
4518else 4517else
4519 ac_cv_path_GREP=$GREP 4518 ac_cv_path_GREP=$GREP
@@ -4579,7 +4578,7 @@ esac
4579 done 4578 done
4580IFS=$as_save_IFS 4579IFS=$as_save_IFS
4581 if test -z "$ac_cv_path_EGREP"; then 4580 if test -z "$ac_cv_path_EGREP"; then
4582 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 4581 as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4583 fi 4582 fi
4584else 4583else
4585 ac_cv_path_EGREP=$EGREP 4584 ac_cv_path_EGREP=$EGREP
@@ -4711,7 +4710,8 @@ do :
4711 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 4710 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
4712ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default 4711ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
4713" 4712"
4714if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 4713eval as_val=\$$as_ac_Header
4714 if test "x$as_val" = x""yes; then :
4715 cat >>confdefs.h <<_ACEOF 4715 cat >>confdefs.h <<_ACEOF
4716#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 4716#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
4717_ACEOF 4717_ACEOF
@@ -5040,8 +5040,8 @@ if $ac_preproc_ok; then :
5040else 5040else
5041 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 5041 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5042$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 5042$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5043as_fn_error $? "C preprocessor \"$CPP\" fails sanity check 5043as_fn_error "C preprocessor \"$CPP\" fails sanity check
5044See \`config.log' for more details" "$LINENO" 5; } 5044See \`config.log' for more details." "$LINENO" 5; }
5045fi 5045fi
5046 5046
5047ac_ext=c 5047ac_ext=c
@@ -5478,7 +5478,7 @@ if test "$MAKEINFO" = "no"; then
5478 if test "x${with_makeinfo}" = "xno"; then 5478 if test "x${with_makeinfo}" = "xno"; then
5479 MAKEINFO=off 5479 MAKEINFO=off
5480 elif test ! -e $srcdir/info/emacs; then 5480 elif test ! -e $srcdir/info/emacs; then
5481 as_fn_error $? "You do not seem to have makeinfo >= 4.6, and your 5481 as_fn_error "You do not seem to have makeinfo >= 4.6, and your
5482source tree does not seem to have pre-built manuals in the \`info' directory. 5482source tree does not seem to have pre-built manuals in the \`info' directory.
5483Either install a suitable version of makeinfo, or re-run configure 5483Either install a suitable version of makeinfo, or re-run configure
5484with the \`--without-makeinfo' option to build without the manuals. " "$LINENO" 5 5484with the \`--without-makeinfo' option to build without the manuals. " "$LINENO" 5
@@ -5632,7 +5632,7 @@ fi
5632 if test "x$GCC" = "xyes"; then 5632 if test "x$GCC" = "xyes"; then
5633 C_SWITCH_MACHINE="-fno-common" 5633 C_SWITCH_MACHINE="-fno-common"
5634 else 5634 else
5635 as_fn_error $? "What gives? Fix me if DEC Unix supports ELF now." "$LINENO" 5 5635 as_fn_error "What gives? Fix me if DEC Unix supports ELF now." "$LINENO" 5
5636 fi 5636 fi
5637 else 5637 else
5638 UNEXEC_OBJ=unexalpha.o 5638 UNEXEC_OBJ=unexalpha.o
@@ -5910,7 +5910,7 @@ else
5910 ## Some platforms don't use any of these files, so it is not 5910 ## Some platforms don't use any of these files, so it is not
5911 ## appropriate to put this test outside the if block. 5911 ## appropriate to put this test outside the if block.
5912 test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \ 5912 test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \
5913 as_fn_error $? "crt*.o not found in specified location." "$LINENO" 5 5913 as_fn_error "crt*.o not found in specified location." "$LINENO" 5
5914 5914
5915fi 5915fi
5916 5916
@@ -5965,7 +5965,8 @@ if test "${with_sound}" != "no"; then
5965do : 5965do :
5966 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 5966 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5967ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 5967ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
5968if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 5968eval as_val=\$$as_ac_Header
5969 if test "x$as_val" = x""yes; then :
5969 cat >>confdefs.h <<_ACEOF 5970 cat >>confdefs.h <<_ACEOF
5970#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 5971#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5971_ACEOF 5972_ACEOF
@@ -6156,7 +6157,7 @@ else
6156fi 6157fi
6157rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 6158rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6158 if test "$emacs_alsa_subdir" != yes; then 6159 if test "$emacs_alsa_subdir" != yes; then
6159 as_fn_error $? "pkg-config found alsa, but it does not compile. See config.log for error messages." "$LINENO" 5 6160 as_fn_error "pkg-config found alsa, but it does not compile. See config.log for error messages." "$LINENO" 5
6160 fi 6161 fi
6161 ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE" 6162 ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
6162 fi 6163 fi
@@ -6191,7 +6192,8 @@ for ac_header in sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
6191do : 6192do :
6192 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 6193 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
6193ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 6194ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
6194if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 6195eval as_val=\$$as_ac_Header
6196 if test "x$as_val" = x""yes; then :
6195 cat >>confdefs.h <<_ACEOF 6197 cat >>confdefs.h <<_ACEOF
6196#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 6198#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
6197_ACEOF 6199_ACEOF
@@ -7246,7 +7248,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
7246 7248
7247 ;; #( 7249 ;; #(
7248 *) 7250 *)
7249 as_fn_error $? "unknown endianness 7251 as_fn_error "unknown endianness
7250 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; 7252 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
7251 esac 7253 esac
7252 7254
@@ -7255,7 +7257,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
7255$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } 7257$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
7256set x ${MAKE-make} 7258set x ${MAKE-make}
7257ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` 7259ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
7258if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : 7260if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
7259 $as_echo_n "(cached) " >&6 7261 $as_echo_n "(cached) " >&6
7260else 7262else
7261 cat >conftest.make <<\_ACEOF 7263 cat >conftest.make <<\_ACEOF
@@ -7263,7 +7265,7 @@ SHELL = /bin/sh
7263all: 7265all:
7264 @echo '@@@%%%=$(MAKE)=@@@%%%' 7266 @echo '@@@%%%=$(MAKE)=@@@%%%'
7265_ACEOF 7267_ACEOF
7266# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. 7268# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
7267case `${MAKE-make} -f conftest.make 2>/dev/null` in 7269case `${MAKE-make} -f conftest.make 2>/dev/null` in
7268 *@@@%%%=?*=@@@%%%*) 7270 *@@@%%%=?*=@@@%%%*)
7269 eval ac_cv_prog_make_${ac_make}_set=yes;; 7271 eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -7399,7 +7401,7 @@ if test "x$with_x" = xno; then
7399 have_x=disabled 7401 have_x=disabled
7400else 7402else
7401 case $x_includes,$x_libraries in #( 7403 case $x_includes,$x_libraries in #(
7402 *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( 7404 *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #(
7403 *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : 7405 *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
7404 $as_echo_n "(cached) " >&6 7406 $as_echo_n "(cached) " >&6
7405else 7407else
@@ -7417,7 +7419,7 @@ libdir:
7417 @echo libdir='${LIBDIR}' 7419 @echo libdir='${LIBDIR}'
7418_ACEOF 7420_ACEOF
7419 if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then 7421 if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
7420 # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. 7422 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
7421 for ac_var in incroot usrlibdir libdir; do 7423 for ac_var in incroot usrlibdir libdir; do
7422 eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" 7424 eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
7423 done 7425 done
@@ -7686,7 +7688,7 @@ if test "${with_ns}" != no; then
7686if test "x$ac_cv_header_AppKit_AppKit_h" = x""yes; then : 7688if test "x$ac_cv_header_AppKit_AppKit_h" = x""yes; then :
7687 HAVE_NS=yes 7689 HAVE_NS=yes
7688else 7690else
7689 as_fn_error $? "\`--with-ns' was specified, but the include 7691 as_fn_error "\`--with-ns' was specified, but the include
7690 files are missing or cannot be compiled." "$LINENO" 5 7692 files are missing or cannot be compiled." "$LINENO" 5
7691fi 7693fi
7692 7694
@@ -7802,7 +7804,7 @@ fi
7802 if test "$HAVE_XSERVER" = true || 7804 if test "$HAVE_XSERVER" = true ||
7803 test -n "$DISPLAY" || 7805 test -n "$DISPLAY" ||
7804 test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then 7806 test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then
7805 as_fn_error $? "You seem to be running X, but no X development libraries 7807 as_fn_error "You seem to be running X, but no X development libraries
7806were found. You should install the relevant development files for X 7808were found. You should install the relevant development files for X
7807and for the toolkit you want, such as Gtk+, Lesstif or Motif. Also make 7809and for the toolkit you want, such as Gtk+, Lesstif or Motif. Also make
7808sure you have development files for image handling, i.e. 7810sure you have development files for image handling, i.e.
@@ -7925,7 +7927,8 @@ do :
7925 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 7927 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7926ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default 7928ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7927" 7929"
7928if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 7930eval as_val=\$$as_ac_Header
7931 if test "x$as_val" = x""yes; then :
7929 cat >>confdefs.h <<_ACEOF 7932 cat >>confdefs.h <<_ACEOF
7930#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 7933#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7931_ACEOF 7934_ACEOF
@@ -8432,7 +8435,8 @@ XScreenNumberOfScreen XSetWMProtocols
8432do : 8435do :
8433 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 8436 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
8434ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 8437ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
8435if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 8438eval as_val=\$$as_ac_var
8439 if test "x$as_val" = x""yes; then :
8436 cat >>confdefs.h <<_ACEOF 8440 cat >>confdefs.h <<_ACEOF
8437#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 8441#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
8438_ACEOF 8442_ACEOF
@@ -8592,7 +8596,7 @@ $as_echo "no" >&6; }
8592 fi 8596 fi
8593 8597
8594 if test $succeeded = yes; then 8598 if test $succeeded = yes; then
8595 : 8599 HAVE_RSVG=yes
8596 else 8600 else
8597 : 8601 :
8598 fi 8602 fi
@@ -8600,8 +8604,7 @@ $as_echo "no" >&6; }
8600 8604
8601 8605
8602 8606
8603 if test ".${RSVG_CFLAGS}" != "."; then 8607 if test $HAVE_RSVG = yes; then
8604 HAVE_RSVG=yes
8605 8608
8606$as_echo "#define HAVE_RSVG 1" >>confdefs.h 8609$as_echo "#define HAVE_RSVG 1" >>confdefs.h
8607 8610
@@ -8611,6 +8614,126 @@ $as_echo "#define HAVE_RSVG 1" >>confdefs.h
8611 fi 8614 fi
8612fi 8615fi
8613 8616
8617HAVE_IMAGEMAGICK=no
8618if test "${with_imagemagick}" != "no"; then
8619 IMAGEMAGICK_MODULE="Wand"
8620
8621 succeeded=no
8622
8623 # Extract the first word of "pkg-config", so it can be a program name with args.
8624set dummy pkg-config; ac_word=$2
8625{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8626$as_echo_n "checking for $ac_word... " >&6; }
8627if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
8628 $as_echo_n "(cached) " >&6
8629else
8630 case $PKG_CONFIG in
8631 [\\/]* | ?:[\\/]*)
8632 ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
8633 ;;
8634 *)
8635 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8636for as_dir in $PATH
8637do
8638 IFS=$as_save_IFS
8639 test -z "$as_dir" && as_dir=.
8640 for ac_exec_ext in '' $ac_executable_extensions; do
8641 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8642 ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
8643 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8644 break 2
8645 fi
8646done
8647 done
8648IFS=$as_save_IFS
8649
8650 test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
8651 ;;
8652esac
8653fi
8654PKG_CONFIG=$ac_cv_path_PKG_CONFIG
8655if test -n "$PKG_CONFIG"; then
8656 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
8657$as_echo "$PKG_CONFIG" >&6; }
8658else
8659 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8660$as_echo "no" >&6; }
8661fi
8662
8663
8664
8665 if test "$PKG_CONFIG" = "no" ; then
8666 :
8667 else
8668 PKG_CONFIG_MIN_VERSION=0.9.0
8669 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
8670 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $IMAGEMAGICK_MODULE" >&5
8671$as_echo_n "checking for $IMAGEMAGICK_MODULE... " >&6; }
8672
8673 if $PKG_CONFIG --exists "$IMAGEMAGICK_MODULE" 2>&5; then
8674 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8675$as_echo "yes" >&6; }
8676 succeeded=yes
8677
8678 { $as_echo "$as_me:${as_lineno-$LINENO}: checking IMAGEMAGICK_CFLAGS" >&5
8679$as_echo_n "checking IMAGEMAGICK_CFLAGS... " >&6; }
8680 IMAGEMAGICK_CFLAGS=`$PKG_CONFIG --cflags "$IMAGEMAGICK_MODULE"|sed -e 's,///*,/,g'`
8681 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IMAGEMAGICK_CFLAGS" >&5
8682$as_echo "$IMAGEMAGICK_CFLAGS" >&6; }
8683
8684 { $as_echo "$as_me:${as_lineno-$LINENO}: checking IMAGEMAGICK_LIBS" >&5
8685$as_echo_n "checking IMAGEMAGICK_LIBS... " >&6; }
8686 IMAGEMAGICK_LIBS=`$PKG_CONFIG --libs "$IMAGEMAGICK_MODULE"|sed -e 's,///*,/,g'`
8687 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IMAGEMAGICK_LIBS" >&5
8688$as_echo "$IMAGEMAGICK_LIBS" >&6; }
8689 else
8690 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8691$as_echo "no" >&6; }
8692 IMAGEMAGICK_CFLAGS=""
8693 IMAGEMAGICK_LIBS=""
8694 ## If we have a custom action on failure, don't print errors, but
8695 ## do set a variable so people can do so.
8696 IMAGEMAGICK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$IMAGEMAGICK_MODULE"`
8697
8698 fi
8699
8700
8701
8702 else
8703 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
8704 echo "*** See http://www.freedesktop.org/software/pkgconfig"
8705 fi
8706 fi
8707
8708 if test $succeeded = yes; then
8709 HAVE_IMAGEMAGICK=yes
8710 else
8711 :
8712 fi
8713
8714
8715
8716
8717 if test $HAVE_IMAGEMAGICK = yes; then
8718
8719$as_echo "#define HAVE_IMAGEMAGICK 1" >>confdefs.h
8720
8721 CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS"
8722 LIBS="$IMAGEMAGICK_LIBS $LIBS"
8723 for ac_func in MagickExportImagePixels
8724do :
8725 ac_fn_c_check_func "$LINENO" "MagickExportImagePixels" "ac_cv_func_MagickExportImagePixels"
8726if test "x$ac_cv_func_MagickExportImagePixels" = x""yes; then :
8727 cat >>confdefs.h <<_ACEOF
8728#define HAVE_MAGICKEXPORTIMAGEPIXELS 1
8729_ACEOF
8730
8731fi
8732done
8733
8734 fi
8735fi
8736
8614 8737
8615HAVE_GTK=no 8738HAVE_GTK=no
8616if test "${with_gtk3}" = "yes"; then 8739if test "${with_gtk3}" = "yes"; then
@@ -8713,7 +8836,7 @@ $as_echo "no" >&6; }
8713 fi 8836 fi
8714 8837
8715 if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then 8838 if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
8716 as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5 8839 as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
8717 fi 8840 fi
8718fi 8841fi
8719 8842
@@ -8819,7 +8942,7 @@ $as_echo "no" >&6; }
8819 fi 8942 fi
8820 8943
8821 if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then 8944 if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
8822 as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5 8945 as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
8823 fi 8946 fi
8824fi 8947fi
8825fi 8948fi
@@ -8846,7 +8969,7 @@ done
8846 8969
8847 if test "${GTK_COMPILES}" != "yes"; then 8970 if test "${GTK_COMPILES}" != "yes"; then
8848 if test "$USE_X_TOOLKIT" != "maybe"; then 8971 if test "$USE_X_TOOLKIT" != "maybe"; then
8849 as_fn_error $? "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5; 8972 as_fn_error "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5;
8850 fi 8973 fi
8851 else 8974 else
8852 HAVE_GTK=yes 8975 HAVE_GTK=yes
@@ -8976,7 +9099,8 @@ $as_echo "#define HAVE_GTK_AND_PTHREAD 1" >>confdefs.h
8976do : 9099do :
8977 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 9100 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
8978ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 9101ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
8979if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 9102eval as_val=\$$as_ac_var
9103 if test "x$as_val" = x""yes; then :
8980 cat >>confdefs.h <<_ACEOF 9104 cat >>confdefs.h <<_ACEOF
8981#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 9105#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
8982_ACEOF 9106_ACEOF
@@ -9341,7 +9465,7 @@ $as_echo "yes; using Lucid toolkit" >&6; }
9341 USE_X_TOOLKIT=LUCID 9465 USE_X_TOOLKIT=LUCID
9342 LUCID_LIBW=-lXaw 9466 LUCID_LIBW=-lXaw
9343 elif test x"${USE_X_TOOLKIT}" = xLUCID; then 9467 elif test x"${USE_X_TOOLKIT}" = xLUCID; then
9344 as_fn_error $? "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5 9468 as_fn_error "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5
9345 else 9469 else
9346 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; do not use toolkit by default" >&5 9470 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; do not use toolkit by default" >&5
9347$as_echo "no; do not use toolkit by default" >&6; } 9471$as_echo "no; do not use toolkit by default" >&6; }
@@ -10518,7 +10642,8 @@ if test "${HAVE_X11}" = "yes"; then
10518do : 10642do :
10519 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 10643 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
10520ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 10644ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
10521if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : 10645eval as_val=\$$as_ac_Header
10646 if test "x$as_val" = x""yes; then :
10522 cat >>confdefs.h <<_ACEOF 10647 cat >>confdefs.h <<_ACEOF
10523#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 10648#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
10524_ACEOF 10649_ACEOF
@@ -10770,7 +10895,7 @@ if test "${HAVE_X11}" = "yes"; then
10770 MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no" 10895 MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
10771 10896
10772 if test "X${MISSING}" != X; then 10897 if test "X${MISSING}" != X; then
10773 as_fn_error $? "The following required libraries were not found: 10898 as_fn_error "The following required libraries were not found:
10774 $MISSING 10899 $MISSING
10775Maybe some development libraries/packages are missing? 10900Maybe some development libraries/packages are missing?
10776If you don't want to link with them give 10901If you don't want to link with them give
@@ -11105,7 +11230,8 @@ if test $ac_cv_os_cray = yes; then
11105 for ac_func in _getb67 GETB67 getb67; do 11230 for ac_func in _getb67 GETB67 getb67; do
11106 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 11231 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
11107ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 11232ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
11108if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 11233eval as_val=\$$as_ac_var
11234 if test "x$as_val" = x""yes; then :
11109 11235
11110cat >>confdefs.h <<_ACEOF 11236cat >>confdefs.h <<_ACEOF
11111#define CRAY_STACKSEG_END $ac_func 11237#define CRAY_STACKSEG_END $ac_func
@@ -11169,7 +11295,7 @@ fi
11169 11295
11170 11296
11171if test x"$ac_cv_func_alloca_works" != xyes; then 11297if test x"$ac_cv_func_alloca_works" != xyes; then
11172 as_fn_error $? "a system implementation of alloca is required " "$LINENO" 5 11298 as_fn_error "a system implementation of alloca is required " "$LINENO" 5
11173fi 11299fi
11174 11300
11175# fmod, logb, and frexp are found in -lm on most systems. 11301# fmod, logb, and frexp are found in -lm on most systems.
@@ -11365,7 +11491,7 @@ fi
11365 11491
11366 11492
11367 if test $ac_cv_prog_liblockfile = yes; then 11493 if test $ac_cv_prog_liblockfile = yes; then
11368 as_fn_error $? "Shared liblockfile found but can't link against it. 11494 as_fn_error "Shared liblockfile found but can't link against it.
11369This probably means that movemail could lose mail. 11495This probably means that movemail could lose mail.
11370There may be a \`development' package to install containing liblockfile." "$LINENO" 5 11496There may be a \`development' package to install containing liblockfile." "$LINENO" 5
11371 fi 11497 fi
@@ -11454,7 +11580,8 @@ cfmakeraw cfsetspeed isnan copysign __executable_start
11454do : 11580do :
11455 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 11581 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
11456ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 11582ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
11457if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 11583eval as_val=\$$as_ac_var
11584 if test "x$as_val" = x""yes; then :
11458 cat >>confdefs.h <<_ACEOF 11585 cat >>confdefs.h <<_ACEOF
11459#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 11586#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
11460_ACEOF 11587_ACEOF
@@ -11485,7 +11612,8 @@ done
11485do : 11612do :
11486 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 11613 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
11487ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 11614ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
11488if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 11615eval as_val=\$$as_ac_var
11616 if test "x$as_val" = x""yes; then :
11489 cat >>confdefs.h <<_ACEOF 11617 cat >>confdefs.h <<_ACEOF
11490#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 11618#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
11491_ACEOF 11619_ACEOF
@@ -11537,8 +11665,8 @@ static time_t time_t_max;
11537static time_t time_t_min; 11665static time_t time_t_min;
11538 11666
11539/* Values we'll use to set the TZ environment variable. */ 11667/* Values we'll use to set the TZ environment variable. */
11540static const char *tz_strings[] = { 11668static char *tz_strings[] = {
11541 (const char *) 0, "TZ=GMT0", "TZ=JST-9", 11669 (char *) 0, "TZ=GMT0", "TZ=JST-9",
11542 "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" 11670 "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
11543}; 11671};
11544#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) 11672#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
@@ -11555,7 +11683,7 @@ spring_forward_gap ()
11555 instead of "TZ=America/Vancouver" in order to detect the bug even 11683 instead of "TZ=America/Vancouver" in order to detect the bug even
11556 on systems that don't support the Olson extension, or don't have the 11684 on systems that don't support the Olson extension, or don't have the
11557 full zoneinfo tables installed. */ 11685 full zoneinfo tables installed. */
11558 putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); 11686 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
11559 11687
11560 tm.tm_year = 98; 11688 tm.tm_year = 98;
11561 tm.tm_mon = 3; 11689 tm.tm_mon = 3;
@@ -11568,14 +11696,16 @@ spring_forward_gap ()
11568} 11696}
11569 11697
11570static int 11698static int
11571mktime_test1 (time_t now) 11699mktime_test1 (now)
11700 time_t now;
11572{ 11701{
11573 struct tm *lt; 11702 struct tm *lt;
11574 return ! (lt = localtime (&now)) || mktime (lt) == now; 11703 return ! (lt = localtime (&now)) || mktime (lt) == now;
11575} 11704}
11576 11705
11577static int 11706static int
11578mktime_test (time_t now) 11707mktime_test (now)
11708 time_t now;
11579{ 11709{
11580 return (mktime_test1 (now) 11710 return (mktime_test1 (now)
11581 && mktime_test1 ((time_t) (time_t_max - now)) 11711 && mktime_test1 ((time_t) (time_t_max - now))
@@ -11599,7 +11729,8 @@ irix_6_4_bug ()
11599} 11729}
11600 11730
11601static int 11731static int
11602bigtime_test (int j) 11732bigtime_test (j)
11733 int j;
11603{ 11734{
11604 struct tm tm; 11735 struct tm tm;
11605 time_t now; 11736 time_t now;
@@ -11643,7 +11774,7 @@ year_2050_test ()
11643 instead of "TZ=America/Vancouver" in order to detect the bug even 11774 instead of "TZ=America/Vancouver" in order to detect the bug even
11644 on systems that don't support the Olson extension, or don't have the 11775 on systems that don't support the Olson extension, or don't have the
11645 full zoneinfo tables installed. */ 11776 full zoneinfo tables installed. */
11646 putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); 11777 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
11647 11778
11648 t = mktime (&tm); 11779 t = mktime (&tm);
11649 11780
@@ -11678,7 +11809,7 @@ main ()
11678 for (i = 0; i < N_STRINGS; i++) 11809 for (i = 0; i < N_STRINGS; i++)
11679 { 11810 {
11680 if (tz_strings[i]) 11811 if (tz_strings[i])
11681 putenv ((char*) tz_strings[i]); 11812 putenv (tz_strings[i]);
11682 11813
11683 for (t = 0; t <= time_t_max - delta; t += delta) 11814 for (t = 0; t <= time_t_max - delta; t += delta)
11684 if (! mktime_test (t)) 11815 if (! mktime_test (t))
@@ -11730,7 +11861,7 @@ ac_have_func=no # yes means we've found a way to get the load average.
11730 11861
11731# Make sure getloadavg.c is where it belongs, at configure-time. 11862# Make sure getloadavg.c is where it belongs, at configure-time.
11732test -f "$srcdir/$ac_config_libobj_dir/getloadavg.c" || 11863test -f "$srcdir/$ac_config_libobj_dir/getloadavg.c" ||
11733 as_fn_error $? "$srcdir/$ac_config_libobj_dir/getloadavg.c is missing" "$LINENO" 5 11864 as_fn_error "$srcdir/$ac_config_libobj_dir/getloadavg.c is missing" "$LINENO" 5
11734 11865
11735ac_save_LIBS=$LIBS 11866ac_save_LIBS=$LIBS
11736 11867
@@ -12599,7 +12730,7 @@ else
12599fi 12730fi
12600 12731
12601if test "$have_tputs_et_al" != true; then 12732if test "$have_tputs_et_al" != true; then
12602 as_fn_error $? "I couldn't find termcap functions (tputs and friends). 12733 as_fn_error "I couldn't find termcap functions (tputs and friends).
12603Maybe some development libraries/packages are missing? Try installing 12734Maybe some development libraries/packages are missing? Try installing
12604libncurses-dev(el), libterminfo-dev(el) or similar." "$LINENO" 5 12735libncurses-dev(el), libterminfo-dev(el) or similar." "$LINENO" 5
12605fi 12736fi
@@ -13746,7 +13877,8 @@ for ac_func in fork vfork
13746do : 13877do :
13747 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 13878 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13748ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 13879ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13749if eval test \"x\$"$as_ac_var"\" = x"yes"; then : 13880eval as_val=\$$as_ac_var
13881 if test "x$as_val" = x""yes; then :
13750 cat >>confdefs.h <<_ACEOF 13882 cat >>confdefs.h <<_ACEOF
13751#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 13883#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13752_ACEOF 13884_ACEOF
@@ -14120,14 +14252,14 @@ if test "x$GCC" = xyes \
14120 && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \ 14252 && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \
14121 && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \ 14253 && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \
14122 && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then 14254 && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then
14123 as_fn_error $? "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5 14255 as_fn_error "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
14124fi 14256fi
14125 14257
14126#### Find out which version of Emacs this is. 14258#### Find out which version of Emacs this is.
14127version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \ 14259version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \
14128 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'` 14260 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
14129if test x"${version}" = x; then 14261if test x"${version}" = x; then
14130 as_fn_error $? "can't find current emacs version in \`${srcdir}/src/emacs.c'." "$LINENO" 5 14262 as_fn_error "can't find current emacs version in \`${srcdir}/src/emacs.c'." "$LINENO" 5
14131fi 14263fi
14132if test x"${version}" != x"$PACKAGE_VERSION"; then 14264if test x"${version}" != x"$PACKAGE_VERSION"; then
14133 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/src/emacs.c'." >&5 14265 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/src/emacs.c'." >&5
@@ -14551,6 +14683,7 @@ echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
14551echo " Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF" 14683echo " Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF"
14552echo " Does Emacs use -lpng? ${HAVE_PNG}" 14684echo " Does Emacs use -lpng? ${HAVE_PNG}"
14553echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}" 14685echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}"
14686echo " Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK}"
14554echo " Does Emacs use -lgpm? ${HAVE_GPM}" 14687echo " Does Emacs use -lgpm? ${HAVE_GPM}"
14555echo " Does Emacs use -ldbus? ${HAVE_DBUS}" 14688echo " Does Emacs use -ldbus? ${HAVE_DBUS}"
14556echo " Does Emacs use -lgconf? ${HAVE_GCONF}" 14689echo " Does Emacs use -lgconf? ${HAVE_GCONF}"
@@ -14685,7 +14818,6 @@ DEFS=-DHAVE_CONFIG_H
14685 14818
14686ac_libobjs= 14819ac_libobjs=
14687ac_ltlibobjs= 14820ac_ltlibobjs=
14688U=
14689for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue 14821for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
14690 # 1. Remove the extension, and $U if already installed. 14822 # 1. Remove the extension, and $U if already installed.
14691 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' 14823 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -14848,19 +14980,19 @@ export LANGUAGE
14848(unset CDPATH) >/dev/null 2>&1 && unset CDPATH 14980(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
14849 14981
14850 14982
14851# as_fn_error STATUS ERROR [LINENO LOG_FD] 14983# as_fn_error ERROR [LINENO LOG_FD]
14852# ---------------------------------------- 14984# ---------------------------------
14853# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are 14985# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
14854# provided, also output the error to LOG_FD, referencing LINENO. Then exit the 14986# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
14855# script with STATUS, using 1 if that was 0. 14987# script with status $?, using 1 if that was 0.
14856as_fn_error () 14988as_fn_error ()
14857{ 14989{
14858 as_status=$1; test $as_status -eq 0 && as_status=1 14990 as_status=$?; test $as_status -eq 0 && as_status=1
14859 if test "$4"; then 14991 if test "$3"; then
14860 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 14992 as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
14861 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 14993 $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
14862 fi 14994 fi
14863 $as_echo "$as_me: error: $2" >&2 14995 $as_echo "$as_me: error: $1" >&2
14864 as_fn_exit $as_status 14996 as_fn_exit $as_status
14865} # as_fn_error 14997} # as_fn_error
14866 14998
@@ -15056,7 +15188,7 @@ $as_echo X"$as_dir" |
15056 test -d "$as_dir" && break 15188 test -d "$as_dir" && break
15057 done 15189 done
15058 test -z "$as_dirs" || eval "mkdir $as_dirs" 15190 test -z "$as_dirs" || eval "mkdir $as_dirs"
15059 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" 15191 } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
15060 15192
15061 15193
15062} # as_fn_mkdir_p 15194} # as_fn_mkdir_p
@@ -15110,7 +15242,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15110# values after options handling. 15242# values after options handling.
15111ac_log=" 15243ac_log="
15112This file was extended by emacs $as_me 24.0.50, which was 15244This file was extended by emacs $as_me 24.0.50, which was
15113generated by GNU Autoconf 2.66. Invocation command line was 15245generated by GNU Autoconf 2.65. Invocation command line was
15114 15246
15115 CONFIG_FILES = $CONFIG_FILES 15247 CONFIG_FILES = $CONFIG_FILES
15116 CONFIG_HEADERS = $CONFIG_HEADERS 15248 CONFIG_HEADERS = $CONFIG_HEADERS
@@ -15176,10 +15308,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15176ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" 15308ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
15177ac_cs_version="\\ 15309ac_cs_version="\\
15178emacs config.status 24.0.50 15310emacs config.status 24.0.50
15179configured by $0, generated by GNU Autoconf 2.66, 15311configured by $0, generated by GNU Autoconf 2.65,
15180 with options \\"\$ac_cs_config\\" 15312 with options \\"\$ac_cs_config\\"
15181 15313
15182Copyright (C) 2010 Free Software Foundation, Inc. 15314Copyright (C) 2009 Free Software Foundation, Inc.
15183This config.status script is free software; the Free Software Foundation 15315This config.status script is free software; the Free Software Foundation
15184gives unlimited permission to copy, distribute and modify it." 15316gives unlimited permission to copy, distribute and modify it."
15185 15317
@@ -15233,7 +15365,7 @@ do
15233 ac_need_defaults=false;; 15365 ac_need_defaults=false;;
15234 --he | --h) 15366 --he | --h)
15235 # Conflict between --help and --header 15367 # Conflict between --help and --header
15236 as_fn_error $? "ambiguous option: \`$1' 15368 as_fn_error "ambiguous option: \`$1'
15237Try \`$0 --help' for more information.";; 15369Try \`$0 --help' for more information.";;
15238 --help | --hel | -h ) 15370 --help | --hel | -h )
15239 $as_echo "$ac_cs_usage"; exit ;; 15371 $as_echo "$ac_cs_usage"; exit ;;
@@ -15242,7 +15374,7 @@ Try \`$0 --help' for more information.";;
15242 ac_cs_silent=: ;; 15374 ac_cs_silent=: ;;
15243 15375
15244 # This is an error. 15376 # This is an error.
15245 -*) as_fn_error $? "unrecognized option: \`$1' 15377 -*) as_fn_error "unrecognized option: \`$1'
15246Try \`$0 --help' for more information." ;; 15378Try \`$0 --help' for more information." ;;
15247 15379
15248 *) as_fn_append ac_config_targets " $1" 15380 *) as_fn_append ac_config_targets " $1"
@@ -15310,7 +15442,7 @@ do
15310 "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;; 15442 "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;;
15311 "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; 15443 "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
15312 15444
15313 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 15445 *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
15314 esac 15446 esac
15315done 15447done
15316 15448
@@ -15348,7 +15480,7 @@ $debug ||
15348{ 15480{
15349 tmp=./conf$$-$RANDOM 15481 tmp=./conf$$-$RANDOM
15350 (umask 077 && mkdir "$tmp") 15482 (umask 077 && mkdir "$tmp")
15351} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 15483} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
15352 15484
15353# Set up the scripts for CONFIG_FILES section. 15485# Set up the scripts for CONFIG_FILES section.
15354# No need to generate them if there are no CONFIG_FILES. 15486# No need to generate them if there are no CONFIG_FILES.
@@ -15382,7 +15514,7 @@ if test "x$ac_cr" = x; then
15382fi 15514fi
15383ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` 15515ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
15384if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then 15516if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
15385 ac_cs_awk_cr='\\r' 15517 ac_cs_awk_cr='\r'
15386else 15518else
15387 ac_cs_awk_cr=$ac_cr 15519 ac_cs_awk_cr=$ac_cr
15388fi 15520fi
@@ -15399,7 +15531,7 @@ _ACEOF
15399 echo "_ACEOF" 15531 echo "_ACEOF"
15400} >conf$$files.sh && 15532} >conf$$files.sh &&
15401. ./conf$$files.sh || 15533. ./conf$$files.sh ||
15402 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 15534 as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
15403rm -f conf$$files.sh 15535rm -f conf$$files.sh
15404 15536
15405{ 15537{
@@ -15407,18 +15539,18 @@ rm -f conf$$files.sh
15407 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && 15539 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
15408 echo "_ACEOF" 15540 echo "_ACEOF"
15409} >conf$$subs.sh || 15541} >conf$$subs.sh ||
15410 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 15542 as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
15411ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` 15543ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
15412ac_delim='%!_!# ' 15544ac_delim='%!_!# '
15413for ac_last_try in false false false false false :; do 15545for ac_last_try in false false false false false :; do
15414 . ./conf$$subs.sh || 15546 . ./conf$$subs.sh ||
15415 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 15547 as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
15416 15548
15417 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` 15549 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
15418 if test $ac_delim_n = $ac_delim_num; then 15550 if test $ac_delim_n = $ac_delim_num; then
15419 break 15551 break
15420 elif $ac_last_try; then 15552 elif $ac_last_try; then
15421 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 15553 as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
15422 else 15554 else
15423 ac_delim="$ac_delim!$ac_delim _$ac_delim!! " 15555 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
15424 fi 15556 fi
@@ -15513,28 +15645,20 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
15513else 15645else
15514 cat 15646 cat
15515fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ 15647fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
15516 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 15648 || as_fn_error "could not setup config files machinery" "$LINENO" 5
15517_ACEOF 15649_ACEOF
15518 15650
15519# VPATH may cause trouble with some makes, so we remove sole $(srcdir), 15651# VPATH may cause trouble with some makes, so we remove $(srcdir),
15520# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and 15652# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
15521# trailing colons and then remove the whole line if VPATH becomes empty 15653# trailing colons and then remove the whole line if VPATH becomes empty
15522# (actually we leave an empty line to preserve line numbers). 15654# (actually we leave an empty line to preserve line numbers).
15523if test "x$srcdir" = x.; then 15655if test "x$srcdir" = x.; then
15524 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ 15656 ac_vpsub='/^[ ]*VPATH[ ]*=/{
15525h 15657s/:*\$(srcdir):*/:/
15526s/// 15658s/:*\${srcdir}:*/:/
15527s/^/:/ 15659s/:*@srcdir@:*/:/
15528s/[ ]*$/:/ 15660s/^\([^=]*=[ ]*\):*/\1/
15529s/:\$(srcdir):/:/g
15530s/:\${srcdir}:/:/g
15531s/:@srcdir@:/:/g
15532s/^:*//
15533s/:*$// 15661s/:*$//
15534x
15535s/\(=[ ]*\).*/\1/
15536G
15537s/\n//
15538s/^[^=]*=[ ]*$// 15662s/^[^=]*=[ ]*$//
15539}' 15663}'
15540fi 15664fi
@@ -15562,7 +15686,7 @@ for ac_last_try in false false :; do
15562 if test -z "$ac_t"; then 15686 if test -z "$ac_t"; then
15563 break 15687 break
15564 elif $ac_last_try; then 15688 elif $ac_last_try; then
15565 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 15689 as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
15566 else 15690 else
15567 ac_delim="$ac_delim!$ac_delim _$ac_delim!! " 15691 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
15568 fi 15692 fi
@@ -15647,7 +15771,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
15647_ACAWK 15771_ACAWK
15648_ACEOF 15772_ACEOF
15649cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 15773cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
15650 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 15774 as_fn_error "could not setup config headers machinery" "$LINENO" 5
15651fi # test -n "$CONFIG_HEADERS" 15775fi # test -n "$CONFIG_HEADERS"
15652 15776
15653 15777
@@ -15660,7 +15784,7 @@ do
15660 esac 15784 esac
15661 case $ac_mode$ac_tag in 15785 case $ac_mode$ac_tag in
15662 :[FHL]*:*);; 15786 :[FHL]*:*);;
15663 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; 15787 :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
15664 :[FH]-) ac_tag=-:-;; 15788 :[FH]-) ac_tag=-:-;;
15665 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; 15789 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
15666 esac 15790 esac
@@ -15688,7 +15812,7 @@ do
15688 [\\/$]*) false;; 15812 [\\/$]*) false;;
15689 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; 15813 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
15690 esac || 15814 esac ||
15691 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; 15815 as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
15692 esac 15816 esac
15693 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac 15817 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
15694 as_fn_append ac_file_inputs " '$ac_f'" 15818 as_fn_append ac_file_inputs " '$ac_f'"
@@ -15715,7 +15839,7 @@ $as_echo "$as_me: creating $ac_file" >&6;}
15715 15839
15716 case $ac_tag in 15840 case $ac_tag in
15717 *:-:* | *:-) cat >"$tmp/stdin" \ 15841 *:-:* | *:-) cat >"$tmp/stdin" \
15718 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; 15842 || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
15719 esac 15843 esac
15720 ;; 15844 ;;
15721 esac 15845 esac
@@ -15851,22 +15975,22 @@ if $ac_cs_awk_getline; then
15851else 15975else
15852 $AWK -f "$tmp/subs.awk" | $SHELL 15976 $AWK -f "$tmp/subs.awk" | $SHELL
15853fi >$tmp/out \ 15977fi >$tmp/out \
15854 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 15978 || as_fn_error "could not create $ac_file" "$LINENO" 5
15855 15979
15856test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && 15980test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
15857 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && 15981 { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
15858 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && 15982 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
15859 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' 15983 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
15860which seems to be undefined. Please make sure it is defined" >&5 15984which seems to be undefined. Please make sure it is defined." >&5
15861$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' 15985$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
15862which seems to be undefined. Please make sure it is defined" >&2;} 15986which seems to be undefined. Please make sure it is defined." >&2;}
15863 15987
15864 rm -f "$tmp/stdin" 15988 rm -f "$tmp/stdin"
15865 case $ac_file in 15989 case $ac_file in
15866 -) cat "$tmp/out" && rm -f "$tmp/out";; 15990 -) cat "$tmp/out" && rm -f "$tmp/out";;
15867 *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; 15991 *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
15868 esac \ 15992 esac \
15869 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 15993 || as_fn_error "could not create $ac_file" "$LINENO" 5
15870 ;; 15994 ;;
15871 :H) 15995 :H)
15872 # 15996 #
@@ -15877,19 +16001,19 @@ which seems to be undefined. Please make sure it is defined" >&2;}
15877 $as_echo "/* $configure_input */" \ 16001 $as_echo "/* $configure_input */" \
15878 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" 16002 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
15879 } >"$tmp/config.h" \ 16003 } >"$tmp/config.h" \
15880 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 16004 || as_fn_error "could not create $ac_file" "$LINENO" 5
15881 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then 16005 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
15882 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 16006 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
15883$as_echo "$as_me: $ac_file is unchanged" >&6;} 16007$as_echo "$as_me: $ac_file is unchanged" >&6;}
15884 else 16008 else
15885 rm -f "$ac_file" 16009 rm -f "$ac_file"
15886 mv "$tmp/config.h" "$ac_file" \ 16010 mv "$tmp/config.h" "$ac_file" \
15887 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 16011 || as_fn_error "could not create $ac_file" "$LINENO" 5
15888 fi 16012 fi
15889 else 16013 else
15890 $as_echo "/* $configure_input */" \ 16014 $as_echo "/* $configure_input */" \
15891 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ 16015 && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
15892 || as_fn_error $? "could not create -" "$LINENO" 5 16016 || as_fn_error "could not create -" "$LINENO" 5
15893 fi 16017 fi
15894 ;; 16018 ;;
15895 16019
@@ -15926,7 +16050,7 @@ _ACEOF
15926ac_clean_files=$ac_clean_files_save 16050ac_clean_files=$ac_clean_files_save
15927 16051
15928test $ac_write_fail = 0 || 16052test $ac_write_fail = 0 ||
15929 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 16053 as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
15930 16054
15931 16055
15932# configure is writing to config.log, and then calls config.status. 16056# configure is writing to config.log, and then calls config.status.
@@ -15947,7 +16071,7 @@ if test "$no_create" != yes; then
15947 exec 5>>config.log 16071 exec 5>>config.log
15948 # Use ||, not &&, to avoid exiting from the if with $? = 1, which 16072 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15949 # would make configure fail if this is the last instruction. 16073 # would make configure fail if this is the last instruction.
15950 $ac_cs_success || as_fn_exit 1 16074 $ac_cs_success || as_fn_exit $?
15951fi 16075fi
15952if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then 16076if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
15953 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 16077 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
diff --git a/configure.in b/configure.in
index ada0b189d3c..e69ce064c0c 100644
--- a/configure.in
+++ b/configure.in
@@ -155,6 +155,7 @@ OPTION_DEFAULT_ON([tiff],[don't compile with TIFF image support])
155OPTION_DEFAULT_ON([gif],[don't compile with GIF image support]) 155OPTION_DEFAULT_ON([gif],[don't compile with GIF image support])
156OPTION_DEFAULT_ON([png],[don't compile with PNG image support]) 156OPTION_DEFAULT_ON([png],[don't compile with PNG image support])
157OPTION_DEFAULT_ON([rsvg],[don't compile with SVG image support]) 157OPTION_DEFAULT_ON([rsvg],[don't compile with SVG image support])
158OPTION_DEFAULT_OFF([imagemagick],[compile with ImageMagick image support])
158 159
159OPTION_DEFAULT_ON([xft],[don't use XFT for anti aliased fonts]) 160OPTION_DEFAULT_ON([xft],[don't use XFT for anti aliased fonts])
160OPTION_DEFAULT_ON([libotf],[don't use libotf for OpenType font support]) 161OPTION_DEFAULT_ON([libotf],[don't use libotf for OpenType font support])
@@ -1824,12 +1825,11 @@ if test "${HAVE_X11}" = "yes" || test "${NS_IMPL_GNUSTEP}" = "yes"; then
1824 RSVG_REQUIRED=2.11.0 1825 RSVG_REQUIRED=2.11.0
1825 RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED" 1826 RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"
1826 1827
1827 PKG_CHECK_MODULES(RSVG, $RSVG_MODULE, :, :) 1828 PKG_CHECK_MODULES(RSVG, $RSVG_MODULE, HAVE_RSVG=yes, :)
1828 AC_SUBST(RSVG_CFLAGS) 1829 AC_SUBST(RSVG_CFLAGS)
1829 AC_SUBST(RSVG_LIBS) 1830 AC_SUBST(RSVG_LIBS)
1830 1831
1831 if test ".${RSVG_CFLAGS}" != "."; then 1832 if test $HAVE_RSVG = yes; then
1832 HAVE_RSVG=yes
1833 AC_DEFINE(HAVE_RSVG, 1, [Define to 1 if using librsvg.]) 1833 AC_DEFINE(HAVE_RSVG, 1, [Define to 1 if using librsvg.])
1834 CFLAGS="$CFLAGS $RSVG_CFLAGS" 1834 CFLAGS="$CFLAGS $RSVG_CFLAGS"
1835 LIBS="$RSVG_LIBS $LIBS" 1835 LIBS="$RSVG_LIBS $LIBS"
@@ -1837,6 +1837,21 @@ if test "${HAVE_X11}" = "yes" || test "${NS_IMPL_GNUSTEP}" = "yes"; then
1837 fi 1837 fi
1838fi 1838fi
1839 1839
1840HAVE_IMAGEMAGICK=no
1841if test "${with_imagemagick}" != "no"; then
1842 IMAGEMAGICK_MODULE="Wand"
1843 PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :)
1844 AC_SUBST(IMAGEMAGICK_CFLAGS)
1845 AC_SUBST(IMAGEMAGICK_LIBS)
1846
1847 if test $HAVE_IMAGEMAGICK = yes; then
1848 AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.])
1849 CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS"
1850 LIBS="$IMAGEMAGICK_LIBS $LIBS"
1851 AC_CHECK_FUNCS(MagickExportImagePixels)
1852 fi
1853fi
1854
1840 1855
1841HAVE_GTK=no 1856HAVE_GTK=no
1842if test "${with_gtk3}" = "yes"; then 1857if test "${with_gtk3}" = "yes"; then
@@ -3662,6 +3677,7 @@ echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
3662echo " Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF" 3677echo " Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF"
3663echo " Does Emacs use -lpng? ${HAVE_PNG}" 3678echo " Does Emacs use -lpng? ${HAVE_PNG}"
3664echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}" 3679echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}"
3680echo " Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK}"
3665echo " Does Emacs use -lgpm? ${HAVE_GPM}" 3681echo " Does Emacs use -lgpm? ${HAVE_GPM}"
3666echo " Does Emacs use -ldbus? ${HAVE_DBUS}" 3682echo " Does Emacs use -ldbus? ${HAVE_DBUS}"
3667echo " Does Emacs use -lgconf? ${HAVE_GCONF}" 3683echo " Does Emacs use -lgconf? ${HAVE_GCONF}"
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 8285a313191..55ec7b75cce 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,7 @@
12010-08-21 Glenn Morris <rgm@gnu.org>
2
3 * misc.texi (Amusements): Mention bubbles and animate.
4
12010-07-31 Eli Zaretskii <eliz@gnu.org> 52010-07-31 Eli Zaretskii <eliz@gnu.org>
2 6
3 * files.texi (Visiting): Add more index entries for 7 * files.texi (Visiting): Add more index entries for
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 387e1be715a..029cf410664 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -2784,6 +2784,10 @@ bored, try an argument of 9. Sit back and watch.
2784 If you want a little more personal involvement, try @kbd{M-x gomoku}, 2784 If you want a little more personal involvement, try @kbd{M-x gomoku},
2785which plays the game Go Moku with you. 2785which plays the game Go Moku with you.
2786 2786
2787@findex bubbles
2788 @kbd{M-x bubbles} is a game in which the object is to remove as many
2789bubbles as you can in the smallest number of moves.
2790
2787@findex blackbox 2791@findex blackbox
2788@findex mpuz 2792@findex mpuz
2789@findex 5x5 2793@findex 5x5
@@ -2832,6 +2836,11 @@ bats.
2832@kbd{M-x solitaire} plays a game of solitaire in which you jump pegs 2836@kbd{M-x solitaire} plays a game of solitaire in which you jump pegs
2833across other pegs. 2837across other pegs.
2834 2838
2839@findex animate-birthday-present
2840@cindex animate
2841The @code{animate} package makes text dance. For an example, try
2842@kbd{M-x animate-birthday-present}.
2843
2835@findex studlify-region 2844@findex studlify-region
2836@cindex StudlyCaps 2845@cindex StudlyCaps
2837@kbd{M-x studlify-region} studlify-cases the region, producing 2846@kbd{M-x studlify-region} studlify-cases the region, producing
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index fe64ca9d835..53b8ac25522 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,29 @@
12010-08-24 Markus Triska <triska@gmx.at>
2
3 * processes.texi (Filter Functions): Use `buffer-live-p' instead
4 of `buffer-name' in the main text as well as in the example
5 (Bug#3098).
6
72010-08-22 Chong Yidong <cyd@stupidchicken.com>
8
9 * nonascii.texi (Text Representations):
10 * loading.texi (Loading Non-ASCII):
11 * compile.texi (Byte Compilation): Don't mention obsolete
12 --unibyte command-line argument.
13
142010-08-22 Chong Yidong <cyd@stupidchicken.com>
15
16 * modes.texi (Defining Minor Modes): Doc fix (Bug#6880).
17
182010-08-22 Chong Yidong <cyd@stupidchicken.com>
19
20 * objects.texi (Bool-Vector Type): Minor definition tweak (Bug#6878).
21
222010-08-20 Eli Zaretskii <eliz@gnu.org>
23
24 * commands.texi (Misc Events): Add cross-references to where
25 POSITION of a mouse event is described in detail.
26
12010-08-08 Christoph <cschol2112@googlemail.com> 272010-08-08 Christoph <cschol2112@googlemail.com>
2 28
3 * control.texi (Handling Errors) <error-message-string>: Fix arg name. 29 * control.texi (Handling Errors) <error-message-string>: Fix arg name.
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index d22cfd955cb..17cfcc0def8 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -1616,7 +1616,8 @@ These kinds of event are generated by moving a mouse wheel. Their
1616usual meaning is a kind of scroll or zoom. 1616usual meaning is a kind of scroll or zoom.
1617 1617
1618The element @var{position} is a list describing the position of the 1618The element @var{position} is a list describing the position of the
1619event, in the same format as used in a mouse-click event. 1619event, in the same format as used in a mouse-click event (@pxref{Click
1620Events}).
1620 1621
1621@vindex mouse-wheel-up-event 1622@vindex mouse-wheel-up-event
1622@vindex mouse-wheel-down-event 1623@vindex mouse-wheel-down-event
@@ -1633,9 +1634,10 @@ selected in an application outside of Emacs, and then dragged and
1633dropped onto an Emacs frame. 1634dropped onto an Emacs frame.
1634 1635
1635The element @var{position} is a list describing the position of the 1636The element @var{position} is a list describing the position of the
1636event, in the same format as used in a mouse-click event, and 1637event, in the same format as used in a mouse-click event (@pxref{Click
1637@var{files} is the list of file names that were dragged and dropped. 1638Events}), and @var{files} is the list of file names that were dragged
1638The usual way to handle this event is by visiting these files. 1639and dropped. The usual way to handle this event is by visiting these
1640files.
1639 1641
1640This kind of event is generated, at present, only on some kinds of 1642This kind of event is generated, at present, only on some kinds of
1641systems. 1643systems.
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index 1c28664e7c3..69b57f19ea7 100644
--- a/doc/lispref/compile.texi
+++ b/doc/lispref/compile.texi
@@ -22,12 +22,6 @@ hardware (as true compiled code is), byte-code is completely
22transportable from machine to machine without recompilation. It is not, 22transportable from machine to machine without recompilation. It is not,
23however, as fast as true compiled code. 23however, as fast as true compiled code.
24 24
25 Compiling a Lisp file with the Emacs byte compiler always reads the
26file as multibyte text, even if Emacs was started with @samp{--unibyte},
27unless the file specifies otherwise. This is so that compilation gives
28results compatible with running the same file without compilation.
29@xref{Loading Non-ASCII}.
30
31 In general, any version of Emacs can run byte-compiled code produced 25 In general, any version of Emacs can run byte-compiled code produced
32by recent earlier versions of Emacs, but the reverse is not true. 26by recent earlier versions of Emacs, but the reverse is not true.
33 27
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 9f07fb42ef4..716efbd9059 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -4039,6 +4039,7 @@ displayed (@pxref{Display Feature Testing}).
4039* GIF Images:: Special features for GIF format. 4039* GIF Images:: Special features for GIF format.
4040* TIFF Images:: Special features for TIFF format. 4040* TIFF Images:: Special features for TIFF format.
4041* PostScript Images:: Special features for PostScript format. 4041* PostScript Images:: Special features for PostScript format.
4042* ImageMagick Images:: Special features available through ImageMagick.
4042* Other Image Types:: Various other formats are supported. 4043* Other Image Types:: Various other formats are supported.
4043* Defining Images:: Convenient ways to define an image for later use. 4044* Defining Images:: Convenient ways to define an image for later use.
4044* Showing Images:: Convenient ways to display an image once it is defined. 4045* Showing Images:: Convenient ways to display an image once it is defined.
@@ -4463,6 +4464,51 @@ specifying the bounding box of the PostScript image, analogous to the
4463@end example 4464@end example
4464@end table 4465@end table
4465 4466
4467@node ImageMagick Images
4468@subsection ImageMagick Images
4469The Imagemagick library can be used to load many image formats in Emacs.
4470
4471The function (imagemagick-types) returns a list of image file
4472extensions that your installation of imagemagick supports.
4473
4474The function (imagemagick-register-types) will enable the imagemagick
4475support for the extensions in imagemagick-types minus the types listed
4476in imagemagick-types-inhibit.
4477
4478imagemagick-types-inhibit has the value '(C HTML HTM TXT PDF) by
4479default. There can be overlap between image loaders in your Emacs
4480installation. If you never want to use the ImageMagick loader to use
4481Jpeg files, for instance, add 'JPG to imagemagick-types-inhibit. Which
4482loader that will be used in practice depends on the priority of the
4483loaders.
4484
4485imagemagick-render-type is a new variable which can be set to choose
4486between screen render methods for the ImageMagick loader.
4487
4488- 0 is a conservative metod which works with older ImageMagick
4489 versions. It is a bit slow, but robust.
4490
4491- 1 utilizes a newer ImageMagick method
4492
4493
4494Images loaded with imagemagick will support a couple of new display
4495specification behaviours:
4496
4497- if the :width and :height keywords are specified, these values are
4498used for scaling the image. If only one of :width or :height is
4499specified, the other one will be calculated so as to preserve the
4500aspect ratio.If both :width and :height are specified, aspect ratio
4501will not be preserved.
4502
4503- :rotation specifies a rotation angle in degrees.
4504
4505- :index specifies which image inside an image bundle file format, such
4506as TIFF or DJVM, to view.
4507
4508The image-metadata function can be used to retrieve the total number
4509of images in an image bundle. This is simmilar to how GIF files work.
4510
4511
4466@node Other Image Types 4512@node Other Image Types
4467@subsection Other Image Types 4513@subsection Other Image Types
4468@cindex PBM 4514@cindex PBM
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index bbdd67fc3a5..dee2a0252eb 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -367,13 +367,6 @@ example) is read without decoding, the text of the program will be
367unibyte text, and its string constants will be unibyte strings. 367unibyte text, and its string constants will be unibyte strings.
368@xref{Coding Systems}. 368@xref{Coding Systems}.
369 369
370 To make the results more predictable, Emacs always performs decoding
371into the multibyte representation when loading Lisp files, even if it
372was started with the @samp{--unibyte} option. This means that string
373constants with non-@acronym{ASCII} characters translate into multibyte
374strings. The only exception is when a particular file specifies no
375decoding.
376
377 The reason Emacs is designed this way is so that Lisp programs give 370 The reason Emacs is designed this way is so that Lisp programs give
378predictable results, regardless of how Emacs was started. In addition, 371predictable results, regardless of how Emacs was started. In addition,
379this enables programs that depend on using multibyte text to work even 372this enables programs that depend on using multibyte text to work even
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 3953da59b93..12f16b67663 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -1411,14 +1411,20 @@ The string @var{lighter} says what to display in the mode line
1411when the mode is enabled; if it is @code{nil}, the mode is not displayed 1411when the mode is enabled; if it is @code{nil}, the mode is not displayed
1412in the mode line. 1412in the mode line.
1413 1413
1414The optional argument @var{keymap} specifies the keymap for the minor mode. 1414The optional argument @var{keymap} specifies the keymap for the minor
1415It can be a variable name, whose value is the keymap, or it can be an alist 1415mode. If non-@code{nil}, it should be a variable name (whose value is
1416specifying bindings in this form: 1416a keymap), a keymap, or an alist of the form
1417 1417
1418@example 1418@example
1419(@var{key-sequence} . @var{definition}) 1419(@var{key-sequence} . @var{definition})
1420@end example 1420@end example
1421 1421
1422@noindent
1423where each @var{key-sequence} and @var{definition} are arguments
1424suitable for passing to @code{define-key} (@pxref{Changing Key
1425Bindings}). If @var{keymap} is a keymap or an alist, this also
1426defines the variable @code{@var{mode}-map}.
1427
1422The above three arguments @var{init-value}, @var{lighter}, and 1428The above three arguments @var{init-value}, @var{lighter}, and
1423@var{keymap} can be (partially) omitted when @var{keyword-args} are 1429@var{keymap} can be (partially) omitted when @var{keyword-args} are
1424used. The @var{keyword-args} consist of keywords followed by 1430used. The @var{keyword-args} consist of keywords followed by
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 00a1dffed6a..40c78d97da7 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -102,9 +102,6 @@ it contains unibyte encoded text or binary non-text data.
102 102
103You cannot set this variable directly; instead, use the function 103You cannot set this variable directly; instead, use the function
104@code{set-buffer-multibyte} to change a buffer's representation. 104@code{set-buffer-multibyte} to change a buffer's representation.
105
106The @samp{--unibyte} command line option does its job by setting the
107default value to @code{nil} early in startup.
108@end defvar 105@end defvar
109 106
110@defun position-bytes position 107@defun position-bytes position
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index 5c3ac13cdaf..c8ccb15a2d3 100644
--- a/doc/lispref/objects.texi
+++ b/doc/lispref/objects.texi
@@ -1189,8 +1189,8 @@ Syntax tables (@pxref{Syntax Tables}).
1189@node Bool-Vector Type 1189@node Bool-Vector Type
1190@subsection Bool-Vector Type 1190@subsection Bool-Vector Type
1191 1191
1192 A @dfn{bool-vector} is a one-dimensional array of elements that 1192 A @dfn{bool-vector} is a one-dimensional array whose elements must
1193must be @code{t} or @code{nil}. 1193be @code{t} or @code{nil}.
1194 1194
1195 The printed representation of a bool-vector is like a string, except 1195 The printed representation of a bool-vector is like a string, except
1196that it begins with @samp{#&} followed by the length. The string 1196that it begins with @samp{#&} followed by the length. The string
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 747d865b0e1..265c76471f0 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -1273,22 +1273,24 @@ process's buffer, mimicking the actions of Emacs when there is no
1273filter. Such filter functions need to use @code{set-buffer} in order to 1273filter. Such filter functions need to use @code{set-buffer} in order to
1274be sure to insert in that buffer. To avoid setting the current buffer 1274be sure to insert in that buffer. To avoid setting the current buffer
1275semipermanently, these filter functions must save and restore the 1275semipermanently, these filter functions must save and restore the
1276current buffer. They should also update the process marker, and in some 1276current buffer. They should also check whether the buffer is still
1277cases update the value of point. Here is how to do these things: 1277alive, update the process marker, and in some cases update the value
1278of point. Here is how to do these things:
1278 1279
1279@smallexample 1280@smallexample
1280@group 1281@group
1281(defun ordinary-insertion-filter (proc string) 1282(defun ordinary-insertion-filter (proc string)
1282 (with-current-buffer (process-buffer proc) 1283 (when (buffer-live-p (process-buffer proc))
1283 (let ((moving (= (point) (process-mark proc)))) 1284 (with-current-buffer (process-buffer proc)
1285 (let ((moving (= (point) (process-mark proc))))
1284@end group 1286@end group
1285@group 1287@group
1286 (save-excursion 1288 (save-excursion
1287 ;; @r{Insert the text, advancing the process marker.} 1289 ;; <at> r{Insert the text, advancing the process marker.}
1288 (goto-char (process-mark proc)) 1290 (goto-char (process-mark proc))
1289 (insert string) 1291 (insert string)
1290 (set-marker (process-mark proc) (point))) 1292 (set-marker (process-mark proc) (point)))
1291 (if moving (goto-char (process-mark proc)))))) 1293 (if moving (goto-char (process-mark proc)))))))
1292@end group 1294@end group
1293@end smallexample 1295@end smallexample
1294 1296
@@ -1315,12 +1317,6 @@ expression searching or matching had to explicitly save and restore the
1315match data. Now Emacs does this automatically for filter functions; 1317match data. Now Emacs does this automatically for filter functions;
1316they never need to do it explicitly. @xref{Match Data}. 1318they never need to do it explicitly. @xref{Match Data}.
1317 1319
1318 A filter function that writes the output into the buffer of the
1319process should check whether the buffer is still alive. If it tries to
1320insert into a dead buffer, it will get an error. The expression
1321@code{(buffer-name (process-buffer @var{process}))} returns @code{nil}
1322if the buffer is dead.
1323
1324 The output to the function may come in chunks of any size. A program 1320 The output to the function may come in chunks of any size. A program
1325that produces the same output twice in a row may send it as one batch of 1321that produces the same output twice in a row may send it as one batch of
1326200 characters one time, and five batches of 40 characters the next. If 1322200 characters one time, and five batches of 40 characters the next. If
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 8cc9c082ce9..f9e81e8fc0f 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,7 @@
12010-08-23 Michael Albinus <michael.albinus@gmx.de>
2
3 * dbus.texi (Alternative Buses): New chapter.
4
12010-08-12 Stefan Monnier <monnier@iro.umontreal.ca> 52010-08-12 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * cl.texi (Mapping over Sequences): Rename mapc => cl-mapc. 7 * cl.texi (Mapping over Sequences): Rename mapc => cl-mapc.
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi
index 248884532df..f4f96d55391 100644
--- a/doc/misc/dbus.texi
+++ b/doc/misc/dbus.texi
@@ -53,6 +53,7 @@ another. An overview of D-Bus can be found at
53* Asynchronous Methods:: Calling methods non-blocking. 53* Asynchronous Methods:: Calling methods non-blocking.
54* Receiving Method Calls:: Offering own methods. 54* Receiving Method Calls:: Offering own methods.
55* Signals:: Sending and receiving signals. 55* Signals:: Sending and receiving signals.
56* Alternative Buses:: Alternative buses.
56* Errors and Events:: Errors and events. 57* Errors and Events:: Errors and events.
57* Index:: Index including concepts, functions, variables. 58* Index:: Index including concepts, functions, variables.
58 59
@@ -1579,6 +1580,56 @@ which objects the GNU/Linux @code{hal} daemon adds.
1579@end defun 1580@end defun
1580 1581
1581 1582
1583@node Alternative Buses
1584@chapter Alternative buses.
1585@cindex bus names
1586@cindex UNIX domain socket
1587
1588Until now, we have spoken about the system and the session buses,
1589which are the default buses to be connected to. However, it is
1590possible to connect to any bus, from which the address is known. This
1591is a UNIX domain socket. Everywhere, where a @var{bus} is mentioned
1592as argument of a function (the symbol @code{:system} or the symbol
1593@code{:session}), this address can be used instead. The connection to
1594this bus must be initialized first.
1595
1596@defun dbus-init-bus bus
1597Establish the connection to D-Bus @var{bus}.
1598
1599@var{bus} can be either the symbol @code{:system} or the symbol
1600@code{:session}, or it can be a string denoting the address of the
1601corresponding bus. For the system and session busses, this function
1602is called when loading @file{dbus.el}, there is no need to call it
1603again.
1604
1605Example: You open another session bus in a terminal window on your host:
1606
1607@example
1608# eval `dbus-launch --auto-syntax`
1609# echo $DBUS_SESSION_BUS_ADDRESS
1610
1611@print{} unix:abstract=/tmp/dbus-JoFtAVG92w,guid=2f320a1ebe50b7ef58e
1612@end example
1613
1614In Emacs, you can access to this bus via its address:
1615
1616@lisp
1617(setq my-bus
1618 "unix:abstract=/tmp/dbus-JoFtAVG92w,guid=2f320a1ebe50b7ef58e")
1619
1620@result{} "unix:abstract=/tmp/dbus-JoFtAVG92w,guid=2f320a1ebe50b7ef58e"
1621
1622(dbus-init-bus my-bus)
1623
1624@result{} nil
1625
1626(dbus-get-unique-name my-bus)
1627
1628@result{} ":1.0"
1629@end lisp
1630@end defun
1631
1632
1582@node Errors and Events 1633@node Errors and Events
1583@chapter Errors and events. 1634@chapter Errors and events.
1584@cindex debugging 1635@cindex debugging
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 0e021c8707c..dcb73156d7e 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -2,6 +2,10 @@
2 2
3 * HELLO: Change designation sequences for Arabic text. 3 * HELLO: Change designation sequences for Arabic text.
4 4
52010-08-23 Michael Albinus <michael.albinus@gmx.de>
6
7 * NEWS: dbus.el supports alternative buses.
8
52010-08-14 Eli Zaretskii <eliz@gnu.org> 92010-08-14 Eli Zaretskii <eliz@gnu.org>
6 10
7 * tutorials/TUTORIAL.he: Use MAQAF instead of hyphen where appropriate. 11 * tutorials/TUTORIAL.he: Use MAQAF instead of hyphen where appropriate.
diff --git a/etc/NEWS b/etc/NEWS
index ad4c9938bd0..ca03f89bc39 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -59,6 +59,10 @@ automatically select it.
59 59
60* Startup Changes in Emacs 24.1 60* Startup Changes in Emacs 24.1
61 61
62** The --unibyte, --multibyte, --no-multibyte, and --no-unibyte
63command line arguments no longer have any effect. (They were declared
64obsolete in Emacs 23.)
65
62 66
63* Changes in Emacs 24.1 67* Changes in Emacs 24.1
64 68
@@ -109,6 +113,22 @@ The frame-parameter tool-bar-position controls this. It takes the values
109top, left, right or bottom. The Options => Show/Hide menu has entries 113top, left, right or bottom. The Options => Show/Hide menu has entries
110for this. 114for this.
111 115
116** ImageMagick support
117It is now possible to use the Imagemagick library to load many new
118image formats in Emacs.
119
120To enable, use the following configure option:
121--with-imagemagick
122
123The new function (imagemagick-types) returns a list of image file
124extensions that your installation of imagemagick supports.
125
126The function (imagemagick-register-types) will enable the imagemagick
127support for the extensions in imagemagick-types minus the types listed
128in imagemagick-types-inhibit.
129
130See the Emacs Manual for more information.
131
112** The colors for selected text (the region face) are taken from the GTK 132** The colors for selected text (the region face) are taken from the GTK
113theme when Emacs is built with GTK. 133theme when Emacs is built with GTK.
114 134
@@ -393,6 +413,11 @@ enabled by default in 23.1.
393supports multithread non-stop debugging and debugging of several 413supports multithread non-stop debugging and debugging of several
394threads simultaneously. 414threads simultaneously.
395 415
416** D-Bus
417
418*** It is possible now, to access alternative buses than the default
419system or session bus.
420
396 421
397* New Modes and Packages in Emacs 24.1 422* New Modes and Packages in Emacs 24.1
398 423
@@ -437,6 +462,8 @@ has now been removed.
437 462
438* Lisp changes in Emacs 24.1 463* Lisp changes in Emacs 24.1
439 464
465** New hook post-self-insert-hook run at the end of self-insert-command.
466
440** Syntax tables support a new "comment style c" additionally to style b. 467** Syntax tables support a new "comment style c" additionally to style b.
441** frame-local variables cannot be let-bound any more. 468** frame-local variables cannot be let-bound any more.
442** prog-mode is a new major-mode meant to be the parent of programming mode. 469** prog-mode is a new major-mode meant to be the parent of programming mode.
diff --git a/leim/ChangeLog b/leim/ChangeLog
index 174102b7817..36788bbd5e7 100644
--- a/leim/ChangeLog
+++ b/leim/ChangeLog
@@ -1,3 +1,26 @@
12010-08-15 Andreas Schwab <schwab@linux-m68k.org>
2
3 * quail/vntelex.el ("vietnamese-telex"): Doc fix.
4
5 * quail/georgian.el: Remove extra backslashes.
6
72010-08-14 Andreas Schwab <schwab@linux-m68k.org>
8
9 * quail/arabic.el: Quote [ and ].
10 * quail/latin-ltx.el: Likewise.
11
12 * quail/greek.el ("greek", "greek-postfix"): Change string to
13 character.
14
152010-08-13 Kenichi Handa <handa@m17n.org>
16
17 * quail/greek.el ("greek-postfix"): Add rules for Greek style
18 quotes.
19
202010-08-09 Kenichi Handa <handa@m17n.org>
21
22 * quail/greek.el ("greek"): Add rules for Greek style quotes.
23
12010-05-15 Glenn Morris <rgm@gnu.org> 242010-05-15 Glenn Morris <rgm@gnu.org>
2 25
3 * Makefile.in (install): Remove references to CVS-related files. 26 * Makefile.in (install): Remove references to CVS-related files.
diff --git a/leim/Makefile.in b/leim/Makefile.in
index 6eb18bc76d9..ba70319ca1e 100644
--- a/leim/Makefile.in
+++ b/leim/Makefile.in
@@ -48,7 +48,7 @@ buildlisppath=${srcdir}/../lisp
48 48
49# How to run Emacs. 49# How to run Emacs.
50RUN-EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \ 50RUN-EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \
51 ${BUILT-EMACS} -batch --no-init-file --no-site-file --multibyte 51 ${BUILT-EMACS} -batch --no-init-file --no-site-file
52 52
53# Subdirectories to be made if ${srcdir} is different from the current 53# Subdirectories to be made if ${srcdir} is different from the current
54# directory. 54# directory.
diff --git a/leim/makefile.w32-in b/leim/makefile.w32-in
index dbebc32602c..f55fbbf816c 100644
--- a/leim/makefile.w32-in
+++ b/leim/makefile.w32-in
@@ -37,7 +37,7 @@ BUILT_EMACS = $(THISDIR)/$(dot)$(dot)/src/$(BLD)/emacs.exe
37buildlisppath=$(CURDIR)/$(dot)$(dot)/lisp 37buildlisppath=$(CURDIR)/$(dot)$(dot)/lisp
38 38
39# How to run Emacs. 39# How to run Emacs.
40RUN_EMACS = "$(BUILT_EMACS)" -batch --no-init-file --no-site-file --multibyte 40RUN_EMACS = "$(BUILT_EMACS)" -batch --no-init-file --no-site-file
41 41
42# Set EMACSLOADPATH correctly (already defined in environment). 42# Set EMACSLOADPATH correctly (already defined in environment).
43EMACSLOADPATH=$(buildlisppath) 43EMACSLOADPATH=$(buildlisppath)
diff --git a/leim/quail/arabic.el b/leim/quail/arabic.el
index 4e613cad16e..cb77183bc96 100644
--- a/leim/quail/arabic.el
+++ b/leim/quail/arabic.el
@@ -57,8 +57,8 @@ Based on Arabic table in X Keyboard Configuration DB.
57 57
58 ("A" ?ِ) 58 ("A" ?ِ)
59 ("S" ?ٍ) 59 ("S" ?ٍ)
60 ("D" ?]) 60 ("D" ?\])
61 ("F" ?[) 61 ("F" ?\[)
62 ("G" ["لأ"]) 62 ("G" ["لأ"])
63 ("H" ?أ) 63 ("H" ?أ)
64 ("J" ?ـ) 64 ("J" ?ـ)
diff --git a/leim/quail/georgian.el b/leim/quail/georgian.el
index 0101a930d37..a063d126667 100644
--- a/leim/quail/georgian.el
+++ b/leim/quail/georgian.el
@@ -51,7 +51,7 @@
51 ("n" ?ნ) 51 ("n" ?ნ)
52 ("o" ?ო) 52 ("o" ?ო)
53 (".p" ?პ) 53 (".p" ?პ)
54 ("\+z" ?ჟ) 54 ("+z" ?ჟ)
55 ("r" ?რ) 55 ("r" ?რ)
56 ("s" ?ს) 56 ("s" ?ს)
57 (".t" ?ტ) 57 (".t" ?ტ)
@@ -60,14 +60,14 @@
60 ("k" ?ქ) 60 ("k" ?ქ)
61 (".g" ?ღ) 61 (".g" ?ღ)
62 ("q" ?ყ) 62 ("q" ?ყ)
63 ("\+s" ?შ) 63 ("+s" ?შ)
64 ("\+c" ?ჩ) 64 ("+c" ?ჩ)
65 ("c" ?ც) 65 ("c" ?ც)
66 ("j" ?ძ) 66 ("j" ?ძ)
67 (".c" ?წ) 67 (".c" ?წ)
68 (".\+c" ?ჭ) 68 (".+c" ?ჭ)
69 ("x" ?ხ) 69 ("x" ?ხ)
70 ("\+j" ?ჯ) 70 ("+j" ?ჯ)
71 ("h" ?ჰ) 71 ("h" ?ჰ)
72 ("q1" ?ჴ) 72 ("q1" ?ჴ)
73 ("e0" ?ჱ) 73 ("e0" ?ჱ)
diff --git a/leim/quail/greek.el b/leim/quail/greek.el
index 1085ca229cf..688b247b0b5 100644
--- a/leim/quail/greek.el
+++ b/leim/quail/greek.el
@@ -1279,7 +1279,9 @@ e.g.
1279 (";:i" ?,F@(B) 1279 (";:i" ?,F@(B)
1280 (":;i" ?,F@(B) 1280 (":;i" ?,F@(B)
1281 (";:y" ?,F`(B) 1281 (";:y" ?,F`(B)
1282 (":;y" ?,F`(B)) 1282 (":;y" ?,F`(B)
1283 (";<" ?$(Q)((B)
1284 (";>" ?$(Q)2(B))
1283 1285
1284(quail-define-package 1286(quail-define-package
1285 "greek-postfix" "GreekPost" ",FX(B" nil 1287 "greek-postfix" "GreekPost" ",FX(B" nil
@@ -1419,7 +1421,12 @@ e.g.
1419 ("i:;" ?,F@(B) 1421 ("i:;" ?,F@(B)
1420 ("i;:" ?,F@(B) 1422 ("i;:" ?,F@(B)
1421 ("y:;" ?,F`(B) 1423 ("y:;" ?,F`(B)
1422 ("y;:" ?,F`(B)) 1424 ("y;:" ?,F`(B)
1425 ;; These two are asymmetric with ";<" and ";>" in "greek" input
1426 ;; method. But, as the other Latin postfix methods adopt "<<" and
1427 ;; ">>", it may be better to follow them.
1428 ("<<" ?$(Q)((B)
1429 (">>" ?$(Q)2(B))
1423 1430
1424 1431
1425;; arch-tag: 2a37e042-db1b-4ecf-b755-117775a3c150 1432;; arch-tag: 2a37e042-db1b-4ecf-b755-117775a3c150
diff --git a/leim/quail/latin-ltx.el b/leim/quail/latin-ltx.el
index 5001c4dd0ef..8b58bf39d54 100644
--- a/leim/quail/latin-ltx.el
+++ b/leim/quail/latin-ltx.el
@@ -653,7 +653,7 @@ system, including many technical ones. Examples:
653 ("\\lambda" ?λ) 653 ("\\lambda" ?λ)
654 ("\\langle" ?〈) 654 ("\\langle" ?〈)
655 ("\\lbrace" ?{) 655 ("\\lbrace" ?{)
656 ("\\lbrack" ?[) 656 ("\\lbrack" ?\[)
657 ("\\lceil" ?⌈) 657 ("\\lceil" ?⌈)
658 ("\\ldots" ?…) 658 ("\\ldots" ?…)
659 ("\\le" ?≤) 659 ("\\le" ?≤)
@@ -788,7 +788,7 @@ system, including many technical ones. Examples:
788 ("\\quad" ? ) 788 ("\\quad" ? )
789 ("\\rangle" ?〉) 789 ("\\rangle" ?〉)
790 ("\\rbrace" ?}) 790 ("\\rbrace" ?})
791 ("\\rbrack" ?]) 791 ("\\rbrack" ?\])
792 ("\\rceil" ?⌉) 792 ("\\rceil" ?⌉)
793 ("\\rfloor" ?⌋) 793 ("\\rfloor" ?⌋)
794 ("\\rightarrow" ?→) 794 ("\\rightarrow" ?→)
diff --git a/leim/quail/vntelex.el b/leim/quail/vntelex.el
index 8af020b093c..4a94a4be59c 100644
--- a/leim/quail/vntelex.el
+++ b/leim/quail/vntelex.el
@@ -53,7 +53,7 @@ Other diacritics:
53 acute s as -> ,1a(B 53 acute s as -> ,1a(B
54 grave f af -> ,1`(B 54 grave f af -> ,1`(B
55 hook above r ar -> ,1d(B 55 hook above r ar -> ,1d(B
56 tilde x ax -> ,1c(B 56 tilde x ax -> ,1c(B
57 dot below j aj -> ,1U(B 57 dot below j aj -> ,1U(B
58 58
59 d bar dd -> ,1p(B 59 d bar dd -> ,1p(B
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 962b1618fbd..868667e4103 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -6,6 +6,205 @@
6 * international/fontset.el (setup-default-fontset): Fix typo for 6 * international/fontset.el (setup-default-fontset): Fix typo for
7 arabic OTF spec (fini->fina). 7 arabic OTF spec (fini->fina).
8 8
92010-08-24 Vinicius Jose Latorre <viniciusjl@ig.com.br>
10
11 * whitespace.el: Allow cleaning up blanks without blank
12 visualization (Bug#6651). Adjust help window for
13 whitespace-toggle-options (Bug#6479). Allow to use fill-column
14 instead of whitespace-line-column (from EmacsWiki). New version
15 13.1.
16 (whitespace-style): Added new value 'face. Adjust docstring.
17 (whitespace-space, whitespace-hspace, whitespace-tab): Adjust
18 foreground property face.
19 (whitespace-line-column): Adjust docstring and type declaration.
20 (whitespace-style-value-list, whitespace-toggle-option-alist)
21 (whitespace-help-text): Adjust const initialization.
22 (whitespace-toggle-options, global-whitespace-toggle-options):
23 Adjust docstring.
24 (whitespace-display-window, whitespace-interactive-char)
25 (whitespace-style-face-p, whitespace-color-on): Adjust code.
26 (whitespace-help-scroll): New fun.
27
282010-08-24 Chong Yidong <cyd@stupidchicken.com>
29
30 * emacs-lisp/package.el (list-packages): Alias for
31 package-list-packages.
32
332010-08-24 Kevin Ryde <user42@zip.com.au>
34
35 * textmodes/flyspell.el (flyspell-check-tex-math-command): Doc fix
36 (Bug#5651).
37
38 * progmodes/ruby-mode.el (ruby): Add defgroup.
39
402010-08-24 Chong Yidong <cyd@stupidchicken.com>
41
42 * progmodes/python.el: Add Ipython support (Bug#5390).
43 (python-shell-prompt-alist)
44 (python-shell-continuation-prompt-alist): New options.
45 (python--set-prompt-regexp): New function.
46 (inferior-python-mode, run-python, python-shell): Require
47 ansi-color. Use python--set-prompt-regexp to set the comint
48 prompt based on the Python interpreter.
49 (python--prompt-regexp): New var.
50 (python-check-comint-prompt)
51 (python-comint-output-filter-function): Use it.
52 (run-python): Use a pipe (Bug#5694).
53
542010-08-24 Fabian Ezequiel Gallina <galli.87@gmail.com> (tiny change)
55
56 * progmodes/python.el (python-send-region): Send a different
57 Python command if Ipython is in use.
58 (python-check-version): Use a Python command to find the version.
59
602010-08-24 Chong Yidong <cyd@stupidchicken.com>
61
62 * mouse.el (mouse-yank-primary): Avoid setting primary when
63 deactivating the mark (Bug#6872).
64
652010-08-23 Michael Albinus <michael.albinus@gmx.de>
66
67 * net/dbus.el: Accept UNIX domain sockets as bus address.
68 (top): Don't initialize `dbus-registered-objects-table' anymore,
69 this is done in dbusbind,c.
70 (dbus-check-event): Adapt test for bus.
71 (dbus-return-values-table, dbus-unregister-service)
72 (dbus-event-bus-name, dbus-introspect, dbus-register-property):
73 Adapt doc string.
74
752010-08-23 Juanma Barranquero <lekktu@gmail.com>
76
77 * ido.el (ido-use-virtual-buffers): Fix typo in docstring.
78
792010-08-22 Juri Linkov <juri@jurta.org>
80
81 * simple.el (read-extended-command): New function with the logic
82 for `completing-read' moved to Elisp from `execute-extended-command'.
83 Use `function-called-at-point' in `minibuffer-default-add-function'
84 to get a command name for M-n (bug#5364, bug#5214).
85
862010-08-22 Chong Yidong <cyd@stupidchicken.com>
87
88 * startup.el (command-line-1): Issue warning for ignored arguments
89 --unibyte, etc (Bug#6886).
90
912010-08-22 Chong Yidong <cyd@stupidchicken.com>
92
93 * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix (Bug#6880).
94
952010-08-22 Leo <sdl.web@gmail.com>
96
97 Fix buffer-list rename&refresh after after killing a buffer in ido.
98 * lisp/ido.el: Revert Óscar's.
99 (ido-kill-buffer-at-head): Exit the minibuffer with ido-exit=refresh.
100 Remember the buffers at head, rather than their name.
101 * lisp/iswitchb.el (iswitchb-kill-buffer): Re-make the list.
102
1032010-08-22 Kirk Kelsey <kirk.kelsey@0x4b.net> (tiny change)
104 Stefan Monnier <monnier@iro.umontreal.ca>
105
106 * progmodes/make-mode.el (makefile-fill-paragraph): Account for the
107 extra backslash added to each line (bug#6890).
108
1092010-08-22 Stefan Monnier <monnier@iro.umontreal.ca>
110
111 * subr.el (read-key): Don't echo keystrokes (bug#6883).
112
1132010-08-22 Glenn Morris <rgm@gnu.org>
114
115 * menu-bar.el (menu-bar-games-menu): Add landmark.
116
1172010-08-22 Glenn Morris <rgm@gnu.org>
118
119 * align.el (align-regexp): Make group and spacing arguments
120 use the interactive defaults when non-interactive. (Bug#6698)
121
122 * mail/rmail.el (rmail-forward): Replace mail-text-start with its
123 expansion, so as not to need sendmail.
124 (mail-text-start): Remove declaration.
125 (rmail-retry-failure): Require sendmail.
126
1272010-08-22 Chong Yidong <cyd@stupidchicken.com>
128
129 * subr.el (read-key): Don't hide the menu-bar entries (bug#6881).
130
1312010-08-22 Michael Albinus <michael.albinus@gmx.de>
132
133 * progmodes/flymake.el (flymake-start-syntax-check-process):
134 Use `start-file-process' in order to let it run also on remote hosts.
135
1362010-08-22 Kenichi Handa <handa@m17n.org>
137
138 * files.el: Add `word-wrap' as safe local variable.
139
1402010-08-22 Glenn Morris <rgm@gnu.org>
141
142 * woman.el (woman-translate): Case matters. (Bug#6849)
143
1442010-08-22 Chong Yidong <cyd@stupidchicken.com>
145
146 * simple.el (kill-region): Doc fix (Bug#6787).
147
1482010-08-22 Glenn Morris <rgm@gnu.org>
149
150 * calendar/diary-lib.el (diary-header-line-format):
151 Fit it to the window, not the frame.
152
1532010-08-22 Andreas Schwab <schwab@linux-m68k.org>
154
155 * subr.el (ignore-errors): Add debug declaration.
156
1572010-08-22 Geoff Gole <geoffgole@gmail.com> (tiny change)
158
159 * whitespace.el (whitespace-color-off): Remove post-command-hook
160 locally.
161
1622010-08-21 Stefan Monnier <monnier@iro.umontreal.ca>
163
164 * vc/add-log.el (add-log-file-name): Don't get confused by symlinks.
165
1662010-08-21 Chong Yidong <cyd@stupidchicken.com>
167
168 * cus-edit.el (custom-group-value-create): Add extra newline
169 before end line (Bug#6876).
170
1712010-08-21 Chong Yidong <cyd@stupidchicken.com>
172
173 * mouse.el (mouse-save-then-kill): Don't save region to kill ring
174 when extending it. Before killing on the second click, check if
175 the buffer is the correct one. Doc fix.
176 (mouse-secondary-save-then-kill): Allow usage without first
177 calling mouse-start-secondary, by defaulting to point. Don't save
178 an empty secondary selection. Doc fix.
179
1802010-08-21 Vinicius Jose Latorre <viniciusjl@ig.com.br>
181
182 * whitespace.el: Fix slow cursor movement (Bug#6172). Reported by
183 Christoph Groth <cwg@falma.de> and Liu Xin <x_liu@neusoft.com>.
184 New version 13.0.
185 (whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp):
186 Adjust initialization.
187 (whitespace-bob-marker, whitespace-eob-marker)
188 (whitespace-buffer-changed): New vars.
189 (whitespace-cleanup, whitespace-color-on, whitespace-color-off)
190 (whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp)
191 (whitespace-post-command-hook, whitespace-display-char-on):
192 Adjust code.
193 (whitespace-looking-back, whitespace-buffer-changed): New funs.
194 (whitespace-space-regexp, whitespace-tab-regexp): Fun eliminated.
195
1962010-08-19 Stefan Monnier <monnier@iro.umontreal.ca>
197
198 * files.el (locate-file-completion-table): Only list the .el and .elc
199 extensions if there's no other choice (bug#5955).
200
201 * facemenu.el (facemenu-self-insert-data): New var.
202 (facemenu-post-self-insert-function, facemenu-set-self-insert-face):
203 New functions.
204 (facemenu-add-face): Use them.
205
206 * simple.el (blink-matching-open): Obey forward-sexp-function.
207
92010-08-18 Stefan Monnier <monnier@iro.umontreal.ca> 2082010-08-18 Stefan Monnier <monnier@iro.umontreal.ca>
10 209
11 * simple.el (prog-mode-map): New var. 210 * simple.el (prog-mode-map): New var.
@@ -34,6 +233,17 @@
34 * emacs-lisp/autoload.el (make-autoload): Preload the macros's 233 * emacs-lisp/autoload.el (make-autoload): Preload the macros's
35 declarations that are useful before running the macro. 234 declarations that are useful before running the macro.
36 235
2362010-08-18 Joakim Verona <joakim@verona.se>
237
238 * image.el (imagemagick-types-inhibit): New variable.
239 (imagemagick-register-types): New function.
240 * image-mode.el (image-transform-properties): New function.
241 (image-transform-set-scale, image-transform-fit-to-height)
242 (image-transform-set-rotation, image-transform-set-resize)
243 (image-transform-fit-to-width, image-transform-fit-to-height):
244 New functions.
245 (image-toggle-display-image): Support image transforms.
246
372010-08-18 Katsumi Yamaoka <yamaoka@jpl.org> 2472010-08-18 Katsumi Yamaoka <yamaoka@jpl.org>
38 248
39 * image.el (create-animated-image): Don't add heuristic mask to image 249 * image.el (create-animated-image): Don't add heuristic mask to image
@@ -297,7 +507,7 @@
297 (ctext-standard-encodings): New variable. 507 (ctext-standard-encodings): New variable.
298 (ctext-non-standard-encodings-table): List only elements for 508 (ctext-non-standard-encodings-table): List only elements for
299 non-standard encodings. 509 non-standard encodings.
300 (ctext-pre-write-conversion): Adjusted for the above change. 510 (ctext-pre-write-conversion): Adjust for the above change.
301 Check ctext-standard-encodings. 511 Check ctext-standard-encodings.
302 512
303 * international/mule-conf.el (compound-text): Doc fix. 513 * international/mule-conf.el (compound-text): Doc fix.
@@ -3186,7 +3396,8 @@
3186 * minibuffer.el (tags-completion-at-point-function): New function. 3396 * minibuffer.el (tags-completion-at-point-function): New function.
3187 (completion-at-point-functions): Use it. 3397 (completion-at-point-functions): Use it.
3188 3398
3189 * cedet/semantic.el (semantic-completion-at-point-function): New function. 3399 * cedet/semantic.el (semantic-completion-at-point-function):
3400 New function.
3190 (semantic-mode): Use semantic-completion-at-point-function for 3401 (semantic-mode): Use semantic-completion-at-point-function for
3191 completion-at-point-functions instead. 3402 completion-at-point-functions instead.
3192 3403
@@ -3236,8 +3447,8 @@
3236 3447
32372010-04-28 Chong Yidong <cyd@stupidchicken.com> 34482010-04-28 Chong Yidong <cyd@stupidchicken.com>
3238 3449
3239 * progmodes/bug-reference.el (bug-reference-url-format): Revert 3450 * progmodes/bug-reference.el (bug-reference-url-format):
3240 2010-04-27 change due to security risk. 3451 Revert 2010-04-27 change due to security risk.
3241 3452
32422010-04-28 Stefan Monnier <monnier@iro.umontreal.ca> 34532010-04-28 Stefan Monnier <monnier@iro.umontreal.ca>
3243 3454
@@ -3412,8 +3623,7 @@
3412 3623
3413 * ido.el (ido-init-completion-maps): For ido-switch-buffer, C-o 3624 * ido.el (ido-init-completion-maps): For ido-switch-buffer, C-o
3414 toggles the use of virtual buffers. 3625 toggles the use of virtual buffers.
3415 (ido-buffer-internal): Guard `ido-use-virtual-buffers' global 3626 (ido-buffer-internal): Guard `ido-use-virtual-buffers' global value.
3416 value.
3417 (ido-toggle-virtual-buffers): New function. 3627 (ido-toggle-virtual-buffers): New function.
3418 3628
34192010-04-21 Juanma Barranquero <lekktu@gmail.com> 36292010-04-21 Juanma Barranquero <lekktu@gmail.com>
@@ -3990,7 +4200,7 @@
3990 4200
3991 Enable recentf-mode if using virtual buffers. 4201 Enable recentf-mode if using virtual buffers.
3992 * ido.el (recentf-list): Declare for byte-compiler. 4202 * ido.el (recentf-list): Declare for byte-compiler.
3993 (ido-virtual-buffers): Move up to silence byte-compiler. Add docstring. 4203 (ido-virtual-buffers): Move up to silence byte-compiler. Add docstring.
3994 (ido-make-buffer-list): Simplify. 4204 (ido-make-buffer-list): Simplify.
3995 (ido-add-virtual-buffers-to-list): Simplify. Enable recentf-mode. 4205 (ido-add-virtual-buffers-to-list): Simplify. Enable recentf-mode.
3996 4206
@@ -5501,8 +5711,8 @@
55012010-01-21 Alan Mackenzie <acm@muc.de> 57112010-01-21 Alan Mackenzie <acm@muc.de>
5502 5712
5503 Fix a situation where deletion of a cpp construct throws an error. 5713 Fix a situation where deletion of a cpp construct throws an error.
5504 * progmodes/cc-engine.el (c-invalidate-state-cache): Before 5714 * progmodes/cc-engine.el (c-invalidate-state-cache):
5505 invoking c-with-all-but-one-cpps-commented-out, check that the 5715 Before invoking c-with-all-but-one-cpps-commented-out, check that the
5506 special cpp construct is still in the buffer. 5716 special cpp construct is still in the buffer.
5507 (c-parse-state): Record the special cpp with markers, not numbers. 5717 (c-parse-state): Record the special cpp with markers, not numbers.
5508 5718
@@ -6229,7 +6439,7 @@
6229 6439
6230 * ps-print.el (ps-face-attributes): It was not returning the 6440 * ps-print.el (ps-face-attributes): It was not returning the
6231 attribute face for faces specified as string. Reported by harven 6441 attribute face for faces specified as string. Reported by harven
6232 <harven@free.fr>. 6442 <harven@free.fr>. (Bug#5254)
6233 (ps-print-version): New version 7.3.5. 6443 (ps-print-version): New version 7.3.5.
6234 6444
62352009-12-18 Ulf Jasper <ulf.jasper@web.de> 64452009-12-18 Ulf Jasper <ulf.jasper@web.de>
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 4effdddff6a..8d681b4f673 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -33,10 +33,9 @@ VPATH = $(srcdir)
33# to use an absolute file name. 33# to use an absolute file name.
34EMACS = ${abs_top_builddir}/src/emacs 34EMACS = ${abs_top_builddir}/src/emacs
35 35
36# Command line flags for Emacs. This must include --multibyte, 36# Command line flags for Emacs.
37# otherwise some files will not compile.
38 37
39EMACSOPT = -batch --no-site-file --multibyte 38EMACSOPT = -batch --no-site-file
40 39
41# Extra flags to pass to the byte compiler 40# Extra flags to pass to the byte compiler
42BYTE_COMPILE_EXTRA_FLAGS = 41BYTE_COMPILE_EXTRA_FLAGS =
diff --git a/lisp/align.el b/lisp/align.el
index 9d811327021..0812d362875 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -1,7 +1,7 @@
1;;; align.el --- align text to a specific column, by regexp 1;;; align.el --- align text to a specific column, by regexp
2 2
3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 4;; 2008, 2009, 2010 Free Software Foundation, Inc.
5 5
6;; Author: John Wiegley <johnw@gnu.org> 6;; Author: John Wiegley <johnw@gnu.org>
7;; Maintainer: FSF 7;; Maintainer: FSF
@@ -944,6 +944,8 @@ region, call `align-regexp' and type in that regular expression."
944 (list (concat "\\(\\s-*\\)" 944 (list (concat "\\(\\s-*\\)"
945 (read-string "Align regexp: ")) 945 (read-string "Align regexp: "))
946 1 align-default-spacing nil)))) 946 1 align-default-spacing nil))))
947 (or group (setq group 1))
948 (or spacing (setq spacing align-default-spacing))
947 (let ((rule 949 (let ((rule
948 (list (list nil (cons 'regexp regexp) 950 (list (list nil (cons 'regexp regexp)
949 (cons 'group (abs group)) 951 (cons 'group (abs group))
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 8fb464aa7e6..39354bd31e3 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -383,14 +383,14 @@ The format of the header is specified by `diary-header-line-format'."
383 "Some text is hidden - press \"s\" in calendar \ 383 "Some text is hidden - press \"s\" in calendar \
384before edit/copy" 384before edit/copy"
385 "Diary")) 385 "Diary"))
386 ?\s (frame-width))) 386 ?\s (window-width)))
387 "Format of the header line displayed by `diary-simple-display'. 387 "Format of the header line displayed by `diary-simple-display'.
388Only used if `diary-header-line-flag' is non-nil." 388Only used if `diary-header-line-flag' is non-nil."
389 :group 'diary 389 :group 'diary
390 :type 'sexp 390 :type 'sexp
391 :initialize 'custom-initialize-default 391 :initialize 'custom-initialize-default
392 :set 'diary-set-header 392 :set 'diary-set-header
393 :version "22.1") 393 :version "23.3") ; frame-width -> window-width
394 394
395;; The first version of this also checked for diary-selective-display 395;; The first version of this also checked for diary-selective-display
396;; in the non-fancy case. This was an attempt to distinguish between 396;; in the non-fancy case. This was an attempt to distinguish between
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 9fa817bd102..e4cb29b50f2 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4097,8 +4097,8 @@ If GROUPS-ONLY non-nil, return only those members that are groups."
4097 (custom-group-state-update widget) 4097 (custom-group-state-update widget)
4098 (progress-reporter-done reporter)) 4098 (progress-reporter-done reporter))
4099 ;; End line 4099 ;; End line
4100 (let ((p (point))) 4100 (let ((p (1+ (point))))
4101 (insert "\n") 4101 (insert "\n\n")
4102 (put-text-property p (1+ p) 'face '(:underline t)) 4102 (put-text-property p (1+ p) 'face '(:underline t))
4103 (overlay-put (make-overlay p (1+ p)) 4103 (overlay-put (make-overlay p (1+ p))
4104 'before-string 4104 'before-string
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 5a21946183e..337f1d6c402 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -86,25 +86,23 @@ replacing its case-insensitive matches with the literal string in LIGHTER."
86;;;###autoload 86;;;###autoload
87(defmacro define-minor-mode (mode doc &optional init-value lighter keymap &rest body) 87(defmacro define-minor-mode (mode doc &optional init-value lighter keymap &rest body)
88 "Define a new minor mode MODE. 88 "Define a new minor mode MODE.
89This function defines the associated control variable MODE, keymap MODE-map, 89This defines the control variable MODE and the toggle command MODE.
90and toggle command MODE.
91
92DOC is the documentation for the mode toggle command. 90DOC is the documentation for the mode toggle command.
91
93Optional INIT-VALUE is the initial value of the mode's variable. 92Optional INIT-VALUE is the initial value of the mode's variable.
94Optional LIGHTER is displayed in the modeline when the mode is on. 93Optional LIGHTER is displayed in the modeline when the mode is on.
95Optional KEYMAP is the default (defvar) keymap bound to the mode keymap. 94Optional KEYMAP is the default keymap bound to the mode keymap.
96 If it is a list, it is passed to `easy-mmode-define-keymap' 95 If non-nil, it should be a variable name (whose value is a keymap),
97 in order to build a valid keymap. It's generally better to use 96 a keymap, or a list of arguments for `easy-mmode-define-keymap'.
98 a separate MODE-map variable than to use this argument. 97 If KEYMAP is a keymap or list, this also defines the variable MODE-map.
99The above three arguments can be skipped if keyword arguments are 98
100used (see below). 99BODY contains code to execute each time the mode is enabled or disabled.
101 100 It is executed after toggling the mode, and before running MODE-hook.
102BODY contains code to execute each time the mode is activated or deactivated. 101 Before the actual body code, you can write keyword arguments, i.e.
103 It is executed after toggling the mode, 102 alternating keywords and values. These following special keywords
104 and before running the hook variable `MODE-hook'. 103 are supported (other keywords are passed to `defcustom' if the minor
105 Before the actual body code, you can write keyword arguments (alternating 104 mode is global):
106 keywords and values). These following keyword arguments are supported (other 105
107 keywords will be passed to `defcustom' if the minor mode is global):
108:group GROUP Custom group name to use in all generated `defcustom' forms. 106:group GROUP Custom group name to use in all generated `defcustom' forms.
109 Defaults to MODE without the possible trailing \"-mode\". 107 Defaults to MODE without the possible trailing \"-mode\".
110 Don't use this default group name unless you have written a 108 Don't use this default group name unless you have written a
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 2e8c7dc7d4f..634a05df15e 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1557,6 +1557,9 @@ The list is displayed in a buffer named `*Packages*'."
1557 (package-refresh-contents) 1557 (package-refresh-contents)
1558 (package--list-packages)) 1558 (package--list-packages))
1559 1559
1560;;;###autoload
1561(defalias 'list-packages 'package-list-packages)
1562
1560(defun package-list-packages-no-fetch () 1563(defun package-list-packages-no-fetch ()
1561 "Display a list of packages. 1564 "Display a list of packages.
1562Does not fetch the updated list of packages before displaying. 1565Does not fetch the updated list of packages before displaying.
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 20b86676ea9..992c6418d45 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -699,6 +699,22 @@ determine the correct answer."
699 (cond ((equal a b) t) 699 (cond ((equal a b) t)
700 ((equal (color-values a) (color-values b))))) 700 ((equal (color-values a) (color-values b)))))
701 701
702
703(defvar facemenu-self-insert-data nil)
704
705(defun facemenu-post-self-insert-function ()
706 (when (and (car facemenu-self-insert-data)
707 (eq last-command (cdr facemenu-self-insert-data)))
708 (put-text-property (1- (point)) (point)
709 'face (car facemenu-self-insert-data))
710 (setq facemenu-self-insert-data nil))
711 (remove-hook 'post-self-insert-hook 'facemenu-post-self-insert-function))
712
713(defun facemenu-set-self-insert-face (face)
714 "Arrange for the next self-inserted char to have face `face'."
715 (setq facemenu-self-insert-data (cons face this-command))
716 (add-hook 'post-self-insert-hook 'facemenu-post-self-insert-function))
717
702(defun facemenu-add-face (face &optional start end) 718(defun facemenu-add-face (face &optional start end)
703 "Add FACE to text between START and END. 719 "Add FACE to text between START and END.
704If START is nil or START to END is empty, add FACE to next typed character 720If START is nil or START to END is empty, add FACE to next typed character
@@ -712,51 +728,52 @@ As a special case, if FACE is `default', then the region is left with NO face
712text property. Otherwise, selecting the default face would not have any 728text property. Otherwise, selecting the default face would not have any
713effect. See `facemenu-remove-face-function'." 729effect. See `facemenu-remove-face-function'."
714 (interactive "*xFace: \nr") 730 (interactive "*xFace: \nr")
715 (if (and (eq face 'default) 731 (cond
716 (not (eq facemenu-remove-face-function t))) 732 ((and (eq face 'default)
717 (if facemenu-remove-face-function 733 (not (eq facemenu-remove-face-function t)))
718 (funcall facemenu-remove-face-function start end) 734 (if facemenu-remove-face-function
719 (if (and start (< start end)) 735 (funcall facemenu-remove-face-function start end)
720 (remove-text-properties start end '(face default))
721 (setq self-insert-face 'default
722 self-insert-face-command this-command)))
723 (if facemenu-add-face-function
724 (save-excursion
725 (if end (goto-char end))
726 (save-excursion
727 (if start (goto-char start))
728 (insert-before-markers
729 (funcall facemenu-add-face-function face end)))
730 (if facemenu-end-add-face
731 (insert (if (stringp facemenu-end-add-face)
732 facemenu-end-add-face
733 (funcall facemenu-end-add-face face)))))
734 (if (and start (< start end)) 736 (if (and start (< start end))
735 (let ((part-start start) part-end) 737 (remove-text-properties start end '(face default))
736 (while (not (= part-start end)) 738 (facemenu-set-self-insert-face 'default))))
737 (setq part-end (next-single-property-change part-start 'face 739 (facemenu-add-face-function
738 nil end)) 740 (save-excursion
739 (let ((prev (get-text-property part-start 'face))) 741 (if end (goto-char end))
740 (put-text-property part-start part-end 'face 742 (save-excursion
741 (if (null prev) 743 (if start (goto-char start))
742 face 744 (insert-before-markers
743 (facemenu-active-faces 745 (funcall facemenu-add-face-function face end)))
744 (cons face 746 (if facemenu-end-add-face
745 (if (listp prev) 747 (insert (if (stringp facemenu-end-add-face)
746 prev 748 facemenu-end-add-face
747 (list prev))) 749 (funcall facemenu-end-add-face face))))))
748 ;; Specify the selected frame 750 ((and start (< start end))
749 ;; because nil would mean to use 751 (let ((part-start start) part-end)
750 ;; the new-frame default settings, 752 (while (not (= part-start end))
751 ;; and those are usually nil. 753 (setq part-end (next-single-property-change part-start 'face
752 (selected-frame))))) 754 nil end))
753 (setq part-start part-end))) 755 (let ((prev (get-text-property part-start 'face)))
754 (setq self-insert-face (if (eq last-command self-insert-face-command) 756 (put-text-property part-start part-end 'face
755 (cons face (if (listp self-insert-face) 757 (if (null prev)
756 self-insert-face 758 face
757 (list self-insert-face))) 759 (facemenu-active-faces
758 face) 760 (cons face
759 self-insert-face-command this-command)))) 761 (if (listp prev)
762 prev
763 (list prev)))
764 ;; Specify the selected frame
765 ;; because nil would mean to use
766 ;; the new-frame default settings,
767 ;; and those are usually nil.
768 (selected-frame)))))
769 (setq part-start part-end))))
770 (t
771 (facemenu-set-self-insert-face
772 (if (eq last-command (cdr facemenu-self-insert-data))
773 (cons face (if (listp (car facemenu-self-insert-data))
774 (car facemenu-self-insert-data)
775 (list (car facemenu-self-insert-data))))
776 face))))
760 (unless (facemenu-enable-faces-p) 777 (unless (facemenu-enable-faces-p)
761 (message "Font-lock mode will override any faces you set in this buffer"))) 778 (message "Font-lock mode will override any faces you set in this buffer")))
762 779
diff --git a/lisp/files.el b/lisp/files.el
index 8b131e04ebc..3d9dd9065c2 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -757,21 +757,44 @@ one or more of those symbols."
757 (let ((x (file-name-directory suffix))) 757 (let ((x (file-name-directory suffix)))
758 (if x (1- (length x)) (length suffix)))))) 758 (if x (1- (length x)) (length suffix))))))
759 (t 759 (t
760 (let ((names nil) 760 (let ((names '())
761 ;; If we have files like "foo.el" and "foo.elc", we could load one of
762 ;; them with "foo.el", "foo.elc", or "foo", where just "foo" is the
763 ;; preferred way. So if we list all 3, that gives a lot of redundant
764 ;; entries for the poor soul looking just for "foo". OTOH, sometimes
765 ;; the user does want to pay attention to the extension. We try to
766 ;; diffuse this tension by stripping the suffix, except when the
767 ;; result is a single element (i.e. usually we only list "foo" unless
768 ;; it's the only remaining element in the list, in which case we do
769 ;; list "foo", "foo.elc" and "foo.el").
770 (fullnames '())
761 (suffix (concat (regexp-opt suffixes t) "\\'")) 771 (suffix (concat (regexp-opt suffixes t) "\\'"))
762 (string-dir (file-name-directory string)) 772 (string-dir (file-name-directory string))
763 (string-file (file-name-nondirectory string))) 773 (string-file (file-name-nondirectory string)))
764 (dolist (dir dirs) 774 (dolist (dir dirs)
765 (unless dir 775 (unless dir
766 (setq dir default-directory)) 776 (setq dir default-directory))
767 (if string-dir (setq dir (expand-file-name string-dir dir))) 777 (if string-dir (setq dir (expand-file-name string-dir dir)))
768 (when (file-directory-p dir) 778 (when (file-directory-p dir)
769 (dolist (file (file-name-all-completions 779 (dolist (file (file-name-all-completions
770 string-file dir)) 780 string-file dir))
771 (push file names) 781 (if (not (string-match suffix file))
772 (when (string-match suffix file) 782 (push file names)
773 (setq file (substring file 0 (match-beginning 0))) 783 (push file fullnames)
774 (push file names))))) 784 (push (substring file 0 (match-beginning 0)) names)))))
785 ;; Switching from names to names+fullnames creates a non-monotonicity
786 ;; which can cause problems with things like partial-completion.
787 ;; To minimize the problem, filter out completion-regexp-list, so that
788 ;; M-x load-library RET t/x.e TAB finds some files.
789 (if completion-regexp-list
790 (setq names (all-completions "" names)))
791 ;; Remove duplicates of the first element, so that we can easily check
792 ;; if `names' really only contains a single element.
793 (when (cdr names) (setcdr names (delete (car names) (cdr names))))
794 (unless (cdr names)
795 ;; There's no more than one matching non-suffixed element, so expand
796 ;; the list by adding the suffixed elements as well.
797 (setq names (nconc names fullnames)))
775 (completion-table-with-context 798 (completion-table-with-context
776 string-dir names string-file pred action))))) 799 string-dir names string-file pred action)))))
777 800
@@ -2782,6 +2805,7 @@ asking you for confirmation."
2782 (no-update-autoloads . booleanp) 2805 (no-update-autoloads . booleanp)
2783 (tab-width . integerp) ;; C source code 2806 (tab-width . integerp) ;; C source code
2784 (truncate-lines . booleanp) ;; C source code 2807 (truncate-lines . booleanp) ;; C source code
2808 (word-wrap . booleanp) ;; C source code
2785 (bidi-display-reordering . booleanp))) ;; C source code 2809 (bidi-display-reordering . booleanp))) ;; C source code
2786 2810
2787(put 'bidi-paragraph-direction 'safe-local-variable 2811(put 'bidi-paragraph-direction 'safe-local-variable
diff --git a/lisp/ido.el b/lisp/ido.el
index d34893d708b..858ee3ed5b0 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -780,7 +780,7 @@ Essentially it works as follows: Say you are visiting a file and
780the buffer gets cleaned up by mignight.el. Later, you want to 780the buffer gets cleaned up by mignight.el. Later, you want to
781switch to that buffer, but find it's no longer open. With 781switch to that buffer, but find it's no longer open. With
782virtual buffers enabled, the buffer name stays in the buffer 782virtual buffers enabled, the buffer name stays in the buffer
783list (using the ido-virtual face, and always at the end), and if 783list (using the `ido-virtual' face, and always at the end), and if
784you select it, it opens the file back up again. This allows you 784you select it, it opens the file back up again. This allows you
785to think less about whether recently opened files are still open 785to think less about whether recently opened files are still open
786or not. Most of the time you can quit Emacs, restart, and then 786or not. Most of the time you can quit Emacs, restart, and then
@@ -1070,11 +1070,11 @@ Only used if `ido-use-virtual-buffers' is non-nil.")
1070;; Stores the current list of items that will be searched through. 1070;; Stores the current list of items that will be searched through.
1071;; The list is ordered, so that the most interesting item comes first, 1071;; The list is ordered, so that the most interesting item comes first,
1072;; although by default, the files visible in the current frame are put 1072;; although by default, the files visible in the current frame are put
1073;; at the end of the list. 1073;; at the end of the list. Created by `ido-make-item-list'.
1074(defvar ido-cur-list nil) 1074(defvar ido-cur-list)
1075 1075
1076;; Stores the choice list for ido-completing-read 1076;; Stores the choice list for ido-completing-read
1077(defvar ido-choice-list nil) 1077(defvar ido-choice-list)
1078 1078
1079;; Stores the list of items which are ignored when building 1079;; Stores the list of items which are ignored when building
1080;; `ido-cur-list'. It is in no specific order. 1080;; `ido-cur-list'. It is in no specific order.
@@ -3400,11 +3400,9 @@ for first matching file."
3400 (if ido-temp-list 3400 (if ido-temp-list
3401 (nconc ido-temp-list ido-current-buffers) 3401 (nconc ido-temp-list ido-current-buffers)
3402 (setq ido-temp-list ido-current-buffers)) 3402 (setq ido-temp-list ido-current-buffers))
3403 (when (and default (buffer-live-p (get-buffer default))) 3403 (if default
3404 (setq ido-temp-list 3404 (setq ido-temp-list
3405 (cons default (delete default ido-temp-list)))) 3405 (cons default (delete default ido-temp-list))))
3406 (if ido-use-virtual-buffers
3407 (ido-add-virtual-buffers-to-list))
3408 (run-hooks 'ido-make-buffer-list-hook) 3406 (run-hooks 'ido-make-buffer-list-hook)
3409 ido-temp-list)) 3407 ido-temp-list))
3410 3408
@@ -3672,7 +3670,6 @@ This is to make them appear as if they were \"virtual buffers\"."
3672 ;; Used by `ido-get-buffers-in-frames' to walk through all windows 3670 ;; Used by `ido-get-buffers-in-frames' to walk through all windows
3673 (let ((buf (buffer-name (window-buffer win)))) 3671 (let ((buf (buffer-name (window-buffer win))))
3674 (unless (or (member buf ido-bufs-in-frame) 3672 (unless (or (member buf ido-bufs-in-frame)
3675 (minibufferp buf)
3676 (member buf ido-ignore-item-temp-list)) 3673 (member buf ido-ignore-item-temp-list))
3677 ;; Only add buf if it is not already in list. 3674 ;; Only add buf if it is not already in list.
3678 ;; This prevents same buf in two different windows being 3675 ;; This prevents same buf in two different windows being
@@ -3913,27 +3910,6 @@ This is to make them appear as if they were \"virtual buffers\"."
3913 ;;(add-hook 'completion-setup-hook 'completion-setup-function) 3910 ;;(add-hook 'completion-setup-hook 'completion-setup-function)
3914 (display-completion-list completion-list))))))) 3911 (display-completion-list completion-list)))))))
3915 3912
3916(defun ido-kill-buffer-internal (buf)
3917 "Kill buffer BUF and rebuild ido's buffer list if needed."
3918 (if (not (kill-buffer buf))
3919 ;; buffer couldn't be killed.
3920 (setq ido-rescan t)
3921 ;; else buffer was killed so remove name from list.
3922 (setq ido-cur-list (delq buf ido-cur-list))
3923 ;; Some packages, like uniquify.el, may rename buffers when one
3924 ;; is killed, so we need to test this condition to avoid using
3925 ;; an outdated list of buffer names. We don't want to always
3926 ;; rebuild the list of buffers, as this alters the previous
3927 ;; buffer order that the user was seeing on the prompt. However,
3928 ;; when we rebuild the list, we try to keep the previous second
3929 ;; buffer as the first one.
3930 (catch 'update
3931 (dolist (b ido-cur-list)
3932 (unless (get-buffer b)
3933 (setq ido-cur-list (ido-make-buffer-list (cadr ido-matches)))
3934 (setq ido-rescan t)
3935 (throw 'update nil))))))
3936
3937;;; KILL CURRENT BUFFER 3913;;; KILL CURRENT BUFFER
3938(defun ido-kill-buffer-at-head () 3914(defun ido-kill-buffer-at-head ()
3939 "Kill the buffer at the head of `ido-matches'. 3915 "Kill the buffer at the head of `ido-matches'.
@@ -3942,15 +3918,26 @@ If cursor is not at the end of the user input, delete to end of input."
3942 (if (not (eobp)) 3918 (if (not (eobp))
3943 (delete-region (point) (line-end-position)) 3919 (delete-region (point) (line-end-position))
3944 (let ((enable-recursive-minibuffers t) 3920 (let ((enable-recursive-minibuffers t)
3945 (buf (ido-name (car ido-matches)))) 3921 (buf (ido-name (car ido-matches)))
3946 (when buf 3922 (nextbuf (cadr ido-matches)))
3947 (ido-kill-buffer-internal buf) 3923 (when (get-buffer buf)
3948 ;; Check if buffer still exists. 3924 ;; If next match names a buffer use the buffer object; buffer
3949 (if (get-buffer buf) 3925 ;; name may be changed by packages such as uniquify; mindful
3950 ;; buffer couldn't be killed. 3926 ;; of virtual buffers.
3927 (when (and nextbuf (get-buffer nextbuf))
3928 (setq nextbuf (get-buffer nextbuf)))
3929 (if (null (kill-buffer buf))
3930 ;; Buffer couldn't be killed.
3951 (setq ido-rescan t) 3931 (setq ido-rescan t)
3952 ;; else buffer was killed so remove name from list. 3932 ;; Else `kill-buffer' succeeds so re-make the buffer list
3953 (setq ido-cur-list (delq buf ido-cur-list))))))) 3933 ;; taking into account packages like uniquify may rename
3934 ;; buffers.
3935 (if (bufferp nextbuf)
3936 (setq nextbuf (buffer-name nextbuf)))
3937 (setq ido-default-item nextbuf
3938 ido-text-init ido-text
3939 ido-exit 'refresh)
3940 (exit-minibuffer))))))
3954 3941
3955;;; DELETE CURRENT FILE 3942;;; DELETE CURRENT FILE
3956(defun ido-delete-file-at-head () 3943(defun ido-delete-file-at-head ()
@@ -3988,7 +3975,7 @@ Record command in `command-history' if optional RECORD is non-nil."
3988 ((eq method 'kill) 3975 ((eq method 'kill)
3989 (if record 3976 (if record
3990 (ido-record-command 'kill-buffer buffer)) 3977 (ido-record-command 'kill-buffer buffer))
3991 (ido-kill-buffer-internal buffer)) 3978 (kill-buffer buffer))
3992 3979
3993 ((eq method 'other-window) 3980 ((eq method 'other-window)
3994 (if record 3981 (if record
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index a34989171bb..5bda540fdfe 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -493,7 +493,10 @@ was inserted."
493 (buffer-substring-no-properties (point-min) (point-max))) 493 (buffer-substring-no-properties (point-min) (point-max)))
494 filename)) 494 filename))
495 (type (image-type file-or-data nil data-p)) 495 (type (image-type file-or-data nil data-p))
496 (image (create-animated-image file-or-data type data-p)) 496 (image0 (create-animated-image file-or-data type data-p))
497 (image (append image0
498 (image-transform-properties image0)
499 ))
497 (props 500 (props
498 `(display ,image 501 `(display ,image
499 intangible ,image 502 intangible ,image
@@ -556,6 +559,84 @@ the image file and `image-mode' showing the image as an image."
556 (when (not (string= image-type (bookmark-prop-get bmk 'image-type))) 559 (when (not (string= image-type (bookmark-prop-get bmk 'image-type)))
557 (image-toggle-display)))) 560 (image-toggle-display))))
558 561
562
563(defvar image-transform-minor-mode-map
564 (let ((map (make-sparse-keymap)))
565; (define-key map [(control ?+)] 'image-scale-in)
566; (define-key map [(control ?-)] 'image-scale-out)
567; (define-key map [(control ?=)] 'image-scale-none)
568;; (define-key map "c f h" 'image-scale-fit-height)
569;; (define-key map "c ]" 'image-rotate-right)
570 map)
571 "Minor mode keymap for transforming the view of images Image mode.")
572
573(define-minor-mode image-transform-mode
574 "minor mode for scaleing and rotation"
575 nil "image-transform"
576 image-transform-minor-mode-map)
577
578(defvar image-transform-resize nil
579 "The image resize operation. See the command
580 `image-transform-set-scale' for more information." )
581
582(defvar image-transform-rotation 0.0)
583
584
585(defun image-transform-properties (display)
586 "Calculate the display properties for transformations; scaling
587and rotation. "
588 (let*
589 ((size (image-size display t))
590 (height
591 (cond
592 ((and (numberp image-transform-resize) (eq 100 image-transform-resize))
593 nil)
594 ((numberp image-transform-resize)
595 (* image-transform-resize (cdr size)))
596 ((eq image-transform-resize 'fit-height)
597 (- (nth 3 (window-inside-pixel-edges)) (nth 1 (window-inside-pixel-edges))))
598 (t nil)))
599 (width (if (eq image-transform-resize 'fit-width)
600 (- (nth 2 (window-inside-pixel-edges)) (nth 0 (window-inside-pixel-edges))))))
601
602 `(,@(if height (list :height height))
603 ,@(if width (list :width width))
604 ,@(if (not (equal 0.0 image-transform-rotation))
605 (list :rotation image-transform-rotation))
606 ;;TODO fit-to-* should consider the rotation angle
607 )))
608
609(defun image-transform-set-scale (scale)
610 "SCALE sets the scaling for images. "
611 (interactive "nscale:")
612 (image-transform-set-resize (float scale)))
613
614(defun image-transform-fit-to-height ()
615 "Fit image height to window height. "
616 (interactive)
617 (image-transform-set-resize 'fit-height))
618
619(defun image-transform-fit-to-width ()
620 "Fit image width to window width. "
621 (interactive)
622 (image-transform-set-resize 'fit-width))
623
624(defun image-transform-set-resize (resize)
625 "Set the resize mode for images. The RESIZE value can be the
626symbol fit-height which fits the image to the window height. The
627symbol fit-width fits the image to the window width. A number
628indicates a scaling factor. nil indicates scale to 100%. "
629 (setq image-transform-resize resize)
630 (if (eq 'image-mode major-mode) (image-toggle-display-image)))
631
632(defun image-transform-set-rotation (rotation)
633 "Set the image ROTATION angle. "
634 (interactive "nrotation:")
635 ;;TODO 0 90 180 270 degrees are the only reasonable angles here
636 ;;otherwise combining with rescaling will get very awkward
637 (setq image-transform-rotation (float rotation))
638 (if (eq major-mode 'image-mode) (image-toggle-display-image)))
639
559(provide 'image-mode) 640(provide 'image-mode)
560 641
561;; arch-tag: b5b2b7e6-26a7-4b79-96e3-1546b5c4c6cb 642;; arch-tag: b5b2b7e6-26a7-4b79-96e3-1546b5c4c6cb
diff --git a/lisp/image.el b/lisp/image.el
index 4a68b4999ea..93cc92ef264 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -694,6 +694,27 @@ shall be displayed."
694 (cons images tmo)))))) 694 (cons images tmo))))))
695 695
696 696
697(defcustom imagemagick-types-inhibit
698 '(C HTML HTM TXT PDF)
699 "Types the imagemagick loader should not try to handle.")
700
701;;;###autoload
702(defun imagemagick-register-types ()
703 "Register file types that imagemagick is able to handle."
704 (let ((im-types (imagemagick-types)))
705 (dolist (im-inhibit imagemagick-types-inhibit)
706 (setq im-types (remove im-inhibit im-types)))
707 (dolist (im-type im-types)
708 (let ((extension (downcase (symbol-name im-type))))
709 (push
710 (cons (concat "\\." extension "\\'") 'image-mode)
711 auto-mode-alist)
712 (push
713 (cons (concat "\\." extension "\\'") 'imagemagick)
714 image-type-file-name-regexps)))))
715
716
717
697(provide 'image) 718(provide 'image)
698 719
699;; arch-tag: 8e76a07b-eb48-4f3e-a7a0-1a7ba9f096b3 720;; arch-tag: 8e76a07b-eb48-4f3e-a7a0-1a7ba9f096b3
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 59d6ff42c97..84b8db3e9ca 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -326,8 +326,7 @@ Return t if file exists."
326 (with-current-buffer buffer 326 (with-current-buffer buffer
327 ;; So that we don't get completely screwed if the 327 ;; So that we don't get completely screwed if the
328 ;; file is encoded in some complicated character set, 328 ;; file is encoded in some complicated character set,
329 ;; read it with real decoding, as a multibyte buffer, 329 ;; read it with real decoding, as a multibyte buffer.
330 ;; even if this is a --unibyte Emacs session.
331 (set-buffer-multibyte t) 330 (set-buffer-multibyte t)
332 ;; Don't let deactivate-mark remain set. 331 ;; Don't let deactivate-mark remain set.
333 (let (deactivate-mark) 332 (let (deactivate-mark)
@@ -346,12 +345,7 @@ Return t if file exists."
346 (eval-buffer buffer nil 345 (eval-buffer buffer nil
347 ;; This is compatible with what `load' does. 346 ;; This is compatible with what `load' does.
348 (if purify-flag file fullname) 347 (if purify-flag file fullname)
349 ;; If this Emacs is running with --unibyte, 348 nil t))
350 ;; convert multibyte strings to unibyte
351 ;; after reading them.
352;; (not (default-value 'enable-multibyte-characters))
353 nil t
354 ))
355 (let (kill-buffer-hook kill-buffer-query-functions) 349 (let (kill-buffer-hook kill-buffer-query-functions)
356 (kill-buffer buffer))) 350 (kill-buffer buffer)))
357 (do-after-load-evaluation fullname) 351 (do-after-load-evaluation fullname)
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el
index ea4b00dc90d..081897a89b3 100644
--- a/lisp/iswitchb.el
+++ b/lisp/iswitchb.el
@@ -1027,8 +1027,8 @@ Return the modified list with the last element prepended to it."
1027(defun iswitchb-kill-buffer () 1027(defun iswitchb-kill-buffer ()
1028 "Kill the buffer at the head of `iswitchb-matches'." 1028 "Kill the buffer at the head of `iswitchb-matches'."
1029 (interactive) 1029 (interactive)
1030 (let ( (enable-recursive-minibuffers t) 1030 (let ((enable-recursive-minibuffers t)
1031 buf) 1031 buf)
1032 1032
1033 (setq buf (car iswitchb-matches)) 1033 (setq buf (car iswitchb-matches))
1034 ;; check to see if buf is non-nil. 1034 ;; check to see if buf is non-nil.
@@ -1042,8 +1042,10 @@ Return the modified list with the last element prepended to it."
1042 (if (get-buffer buf) 1042 (if (get-buffer buf)
1043 ;; buffer couldn't be killed. 1043 ;; buffer couldn't be killed.
1044 (setq iswitchb-rescan t) 1044 (setq iswitchb-rescan t)
1045 ;; else buffer was killed so remove name from list. 1045 ;; Else `kill-buffer' succeeds so re-make the buffer list
1046 (setq iswitchb-buflist (delq buf iswitchb-buflist))))))) 1046 ;; taking into account packages like uniquify may rename
1047 ;; buffers
1048 (iswitchb-make-buflist iswitchb-default))))))
1047 1049
1048;;; VISIT CHOSEN BUFFER 1050;;; VISIT CHOSEN BUFFER
1049(defun iswitchb-visit-buffer (buffer) 1051(defun iswitchb-visit-buffer (buffer)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index fbf5c534a28..fa0b7bef207 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -191,8 +191,6 @@ please report it with \\[report-emacs-bug].")
191 :group 'rmail-retrieve 191 :group 'rmail-retrieve
192 :type '(repeat (directory))) 192 :type '(repeat (directory)))
193 193
194(declare-function mail-position-on-field "sendmail" (field &optional soft))
195(declare-function mail-text-start "sendmail" ())
196(declare-function rmail-dont-reply-to "mail-utils" (destinations)) 194(declare-function rmail-dont-reply-to "mail-utils" (destinations))
197(declare-function rmail-update-summary "rmailsum" (&rest ignore)) 195(declare-function rmail-update-summary "rmailsum" (&rest ignore))
198 196
@@ -1643,8 +1641,6 @@ The duplicate copy goes into the Rmail file just after the original."
1643(declare-function rmail-summary-mark-deleted "rmailsum" (&optional n undel)) 1641(declare-function rmail-summary-mark-deleted "rmailsum" (&optional n undel))
1644(declare-function rfc822-addresses "rfc822" (header-text)) 1642(declare-function rfc822-addresses "rfc822" (header-text))
1645(declare-function mail-abbrev-make-syntax-table "mailabbrev.el" ()) 1643(declare-function mail-abbrev-make-syntax-table "mailabbrev.el" ())
1646(declare-function mail-sendmail-delimit-header "sendmail" ())
1647(declare-function mail-header-end "sendmail" ())
1648 1644
1649;; RLK feature not added in this version: 1645;; RLK feature not added in this version:
1650;; argument specifies inbox file or files in various ways. 1646;; argument specifies inbox file or files in various ways.
@@ -3686,7 +3682,8 @@ see the documentation of `rmail-resend'."
3686 ;; The mail buffer is now current. 3682 ;; The mail buffer is now current.
3687 (save-excursion 3683 (save-excursion
3688 ;; Insert after header separator--before signature if any. 3684 ;; Insert after header separator--before signature if any.
3689 (goto-char (mail-text-start)) 3685 (rfc822-goto-eoh)
3686 (forward-line 1)
3690 (if (or rmail-enable-mime rmail-enable-mime-composing) 3687 (if (or rmail-enable-mime rmail-enable-mime-composing)
3691 (funcall rmail-insert-mime-forwarded-message-function 3688 (funcall rmail-insert-mime-forwarded-message-function
3692 forward-buffer) 3689 forward-buffer)
@@ -3841,6 +3838,10 @@ The message should be narrowed to just the headers."
3841 (1- (point)) 3838 (1- (point))
3842 (point-max))))))) 3839 (point-max)))))))
3843 3840
3841(declare-function mail-sendmail-delimit-header "sendmail" ())
3842(declare-function mail-header-end "sendmail" ())
3843(declare-function mail-position-on-field "sendmail" (field &optional soft))
3844
3844(defun rmail-retry-failure () 3845(defun rmail-retry-failure ()
3845 "Edit a mail message which is based on the contents of the current message. 3846 "Edit a mail message which is based on the contents of the current message.
3846For a message rejected by the mail system, extract the interesting headers and 3847For a message rejected by the mail system, extract the interesting headers and
@@ -3932,6 +3933,8 @@ specifying headers which should not be copied into the new message."
3932 (goto-char (point-min)) 3933 (goto-char (point-min))
3933 (if bounce-indent 3934 (if bounce-indent
3934 (indent-rigidly (point-min) (point-max) bounce-indent)) 3935 (indent-rigidly (point-min) (point-max) bounce-indent))
3936 ;; FIXME better to replace sendmail functions.
3937 (require 'sendmail)
3935 (mail-sendmail-delimit-header) 3938 (mail-sendmail-delimit-header)
3936 (save-restriction 3939 (save-restriction
3937 (narrow-to-region (point-min) (mail-header-end)) 3940 (narrow-to-region (point-min) (mail-header-end))
diff --git a/lisp/makefile.w32-in b/lisp/makefile.w32-in
index 871b690f007..df997b76585 100644
--- a/lisp/makefile.w32-in
+++ b/lisp/makefile.w32-in
@@ -32,10 +32,9 @@ srcdir = $(CURDIR)/..
32 32
33EMACS = $(THISDIR)/../bin/emacs.exe 33EMACS = $(THISDIR)/../bin/emacs.exe
34 34
35# Command line flags for Emacs. This must include --multibyte, 35# Command line flags for Emacs.
36# otherwise some files will not compile.
37 36
38EMACSOPT = -batch --no-init-file --no-site-file --multibyte 37EMACSOPT = -batch --no-init-file --no-site-file
39 38
40# Extra flags to pass to the byte compiler 39# Extra flags to pass to the byte compiler
41BYTE_COMPILE_EXTRA_FLAGS = 40BYTE_COMPILE_EXTRA_FLAGS =
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 3c1241237f1..ed5c189252b 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1272,6 +1272,9 @@ mail status in mode line"))
1272(define-key menu-bar-games-menu [life] 1272(define-key menu-bar-games-menu [life]
1273 `(menu-item ,(purecopy "Life") life 1273 `(menu-item ,(purecopy "Life") life
1274 :help ,(purecopy "Watch how John Conway's cellular automaton evolves"))) 1274 :help ,(purecopy "Watch how John Conway's cellular automaton evolves")))
1275(define-key menu-bar-games-menu [land]
1276 `(menu-item ,(purecopy "Landmark") landmark
1277 :help ,(purecopy "Watch a neural-network robot learn landmarks")))
1275(define-key menu-bar-games-menu [hanoi] 1278(define-key menu-bar-games-menu [hanoi]
1276 `(menu-item ,(purecopy "Towers of Hanoi") hanoi 1279 `(menu-item ,(purecopy "Towers of Hanoi") hanoi
1277 :help ,(purecopy "Watch Towers-of-Hanoi puzzle solved by Emacs"))) 1280 :help ,(purecopy "Watch Towers-of-Hanoi puzzle solved by Emacs")))
diff --git a/lisp/mouse.el b/lisp/mouse.el
index f404de98ce3..a2a0191ce79 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1268,10 +1268,11 @@ regardless of where you click."
1268 (interactive "e") 1268 (interactive "e")
1269 ;; Give temporary modes such as isearch a chance to turn off. 1269 ;; Give temporary modes such as isearch a chance to turn off.
1270 (run-hooks 'mouse-leave-buffer-hook) 1270 (run-hooks 'mouse-leave-buffer-hook)
1271 ;; Without this, confusing things happen upon e.g. inserting into
1272 ;; the middle of an active region.
1271 (when select-active-regions 1273 (when select-active-regions
1272 ;; Without this, confusing things happen upon e.g. inserting into 1274 (let (select-active-regions)
1273 ;; the middle of an active region. 1275 (deactivate-mark)))
1274 (deactivate-mark))
1275 (or mouse-yank-at-point (mouse-set-point click)) 1276 (or mouse-yank-at-point (mouse-set-point click))
1276 (let ((primary 1277 (let ((primary
1277 (cond 1278 (cond
@@ -1297,8 +1298,7 @@ This does not delete the region; it acts like \\[kill-ring-save]."
1297;; whenever it was equal to the front of the kill ring, but some 1298;; whenever it was equal to the front of the kill ring, but some
1298;; people found that confusing. 1299;; people found that confusing.
1299 1300
1300;; A list (TEXT START END), describing the text and position of the last 1301;; The position of the last invocation of `mouse-save-then-kill'.
1301;; invocation of mouse-save-then-kill.
1302(defvar mouse-save-then-kill-posn nil) 1302(defvar mouse-save-then-kill-posn nil)
1303 1303
1304(defun mouse-save-then-kill-delete-region (beg end) 1304(defun mouse-save-then-kill-delete-region (beg end)
@@ -1336,111 +1336,76 @@ This does not delete the region; it acts like \\[kill-ring-save]."
1336 (undo-boundary)) 1336 (undo-boundary))
1337 1337
1338(defun mouse-save-then-kill (click) 1338(defun mouse-save-then-kill (click)
1339 "Set the region according to CLICK; the second time, kill the region. 1339 "Set the region according to CLICK; the second time, kill it.
1340Assuming this command is bound to a mouse button, CLICK is the 1340CLICK should be a mouse click event.
1341corresponding input event. 1341
1342 1342If the region is inactive, activate it temporarily. Set mark at
1343If the region is already active, adjust it. Normally, this 1343the original point, and move point to the position of CLICK.
1344happens by moving either point or mark, whichever is closer, to 1344
1345the position of CLICK. But if you have selected words or lines, 1345If the region is already active, adjust it. Normally, do this by
1346the region is adjusted by moving point or mark to the word or 1346moving point or mark, whichever is closer, to CLICK. But if you
1347line boundary closest to CLICK. 1347have selected whole words or lines, move point or mark to the
1348 1348word or line boundary closest to CLICK instead.
1349If the region is inactive, activate it temporarily; set mark at 1349
1350the original point, and move click to the position of CLICK. 1350If this command is called a second consecutive time with the same
1351 1351CLICK position, kill the region."
1352However, if this command is being called a second time (i.e. the
1353value of `last-command' is `mouse-save-then-kill'), kill the
1354region instead. If the text in the region is the same as the
1355text in the front of the kill ring, just delete it."
1356 (interactive "e") 1352 (interactive "e")
1357 (let ((before-scroll 1353 (mouse-minibuffer-check click)
1358 (with-current-buffer (window-buffer (posn-window (event-start click))) 1354 (let* ((posn (event-start click))
1359 point-before-scroll))) 1355 (click-pt (posn-point posn))
1360 (mouse-minibuffer-check click) 1356 (window (posn-window posn))
1361 (let ((click-posn (posn-point (event-start click))) 1357 (buf (window-buffer window))
1362 ;; Don't let a subsequent kill command append to this one: 1358 ;; Don't let a subsequent kill command append to this one.
1363 ;; prevent setting this-command to kill-region. 1359 (this-command this-command)
1364 (this-command this-command)) 1360 ;; Check if the user has multi-clicked to select words/lines.
1365 (if (and (with-current-buffer 1361 (click-count
1366 (window-buffer (posn-window (event-start click))) 1362 (if (and (eq mouse-selection-click-count-buffer buf)
1367 (and (mark t) 1363 (with-current-buffer buf (mark t)))
1368 (> (mod mouse-selection-click-count 3) 0) 1364 mouse-selection-click-count
1369 ;; Don't be fooled by a recent click in some other buffer. 1365 0)))
1370 (eq mouse-selection-click-count-buffer 1366 (cond
1371 (current-buffer))))) 1367 ((not (numberp click-pt)) nil)
1372 (if (and (eq last-command 'mouse-save-then-kill) 1368 ;; If the user clicked without moving point, kill the region.
1373 (equal click-posn (nth 2 mouse-save-then-kill-posn))) 1369 ;; This also resets `mouse-selection-click-count'.
1374 ;; If we click this button again without moving it, kill. 1370 ((and (eq last-command 'mouse-save-then-kill)
1375 (progn 1371 (eq click-pt mouse-save-then-kill-posn)
1376 ;; Call `deactivate-mark' to save the primary selection. 1372 (eq window (selected-window)))
1377 (deactivate-mark) 1373 (kill-region (mark t) (point))
1378 (mouse-save-then-kill-delete-region (mark) (point)) 1374 (setq mouse-selection-click-count 0)
1379 (setq mouse-selection-click-count 0) 1375 (setq mouse-save-then-kill-posn nil))
1380 (setq mouse-save-then-kill-posn nil)) 1376
1381 ;; Find both ends of the object selected by this click. 1377 ;; Otherwise, if there is a suitable region, adjust it by moving
1382 (let* ((range 1378 ;; one end (whichever is closer) to CLICK-PT.
1383 (mouse-start-end click-posn click-posn 1379 ((or (with-current-buffer buf (region-active-p))
1384 mouse-selection-click-count))) 1380 (and (eq window (selected-window))
1385 ;; Move whichever end is closer to the click. 1381 (mark t)
1386 ;; That's what xterm does, and it seems reasonable. 1382 (or (and (eq last-command 'mouse-save-then-kill)
1387 (if (< (abs (- click-posn (mark t))) 1383 mouse-save-then-kill-posn)
1388 (abs (- click-posn (point)))) 1384 (and (memq last-command '(mouse-drag-region
1389 (set-mark (car range)) 1385 mouse-set-region))
1390 (goto-char (nth 1 range))) 1386 (or mark-even-if-inactive
1391 ;; We have already put the old region in the kill ring. 1387 (not transient-mark-mode))))))
1392 ;; Replace it with the extended region. 1388 (select-window window)
1393 ;; (It would be annoying to make a separate entry.) 1389 (let* ((range (mouse-start-end click-pt click-pt click-count)))
1394 (kill-new (buffer-substring (point) (mark t)) t) 1390 (if (< (abs (- click-pt (mark t)))
1395 (mouse-set-region-1) 1391 (abs (- click-pt (point))))
1396 ;; Arrange for a repeated mouse-3 to kill this region. 1392 (set-mark (car range))
1397 (setq mouse-save-then-kill-posn 1393 (goto-char (nth 1 range)))
1398 (list (car kill-ring) (point) click-posn)))) 1394 (setq deactivate-mark nil)
1399 1395 (mouse-set-region-1)
1400 (if (and (eq last-command 'mouse-save-then-kill) 1396 ;; Arrange for a repeated mouse-3 to kill the region.
1401 mouse-save-then-kill-posn 1397 (setq mouse-save-then-kill-posn click-pt)))
1402 (eq (car mouse-save-then-kill-posn) (car kill-ring)) 1398
1403 (equal (cdr mouse-save-then-kill-posn) 1399 ;; Otherwise, set the mark where point is and move to CLICK-PT.
1404 (list (point) click-posn))) 1400 (t
1405 ;; If this is the second time we've called 1401 (select-window window)
1406 ;; mouse-save-then-kill, delete the text from the buffer. 1402 (mouse-set-mark-fast click)
1407 (progn 1403 (let ((before-scroll (with-current-buffer buf point-before-scroll)))
1408 ;; Call `deactivate-mark' to save the primary selection. 1404 (if before-scroll (goto-char before-scroll)))
1409 (deactivate-mark) 1405 (exchange-point-and-mark)
1410 (mouse-save-then-kill-delete-region (point) (mark t)) 1406 (mouse-set-region-1)
1411 ;; After we kill, another click counts as "the first time". 1407 (setq mouse-save-then-kill-posn click-pt)))))
1412 (setq mouse-save-then-kill-posn nil)) 1408
1413 ;; This is not a repetition.
1414 ;; We are adjusting an old selection or creating a new one.
1415 (if (or (and (eq last-command 'mouse-save-then-kill)
1416 mouse-save-then-kill-posn)
1417 (and mark-active transient-mark-mode)
1418 (and (memq last-command
1419 '(mouse-drag-region mouse-set-region))
1420 (or mark-even-if-inactive
1421 (not transient-mark-mode))))
1422 ;; We have a selection or suitable region, so adjust it.
1423 (let* ((posn (event-start click))
1424 (new (posn-point posn)))
1425 (select-window (posn-window posn))
1426 (if (numberp new)
1427 (progn
1428 ;; Move whichever end of the region is closer to the click.
1429 ;; That is what xterm does, and it seems reasonable.
1430 (if (<= (abs (- new (point))) (abs (- new (mark t))))
1431 (goto-char new)
1432 (set-mark new))
1433 (setq deactivate-mark nil)))
1434 (kill-new (buffer-substring (point) (mark t)) t))
1435 ;; Set the mark where point is, then move where clicked.
1436 (mouse-set-mark-fast click)
1437 (if before-scroll
1438 (goto-char before-scroll))
1439 (exchange-point-and-mark) ;Why??? --Stef
1440 (kill-new (buffer-substring (point) (mark t))))
1441 (mouse-set-region-1)
1442 (setq mouse-save-then-kill-posn
1443 (list (car kill-ring) (point) click-posn)))))))
1444 1409
1445(global-set-key [M-mouse-1] 'mouse-start-secondary) 1410(global-set-key [M-mouse-1] 'mouse-start-secondary)
1446(global-set-key [M-drag-mouse-1] 'mouse-set-secondary) 1411(global-set-key [M-drag-mouse-1] 'mouse-set-secondary)
@@ -1520,9 +1485,6 @@ The function returns a non-nil value if it creates a secondary selection."
1520 ;; of one word or line. 1485 ;; of one word or line.
1521 (let ((range (mouse-start-end start-point start-point click-count))) 1486 (let ((range (mouse-start-end start-point start-point click-count)))
1522 (set-marker mouse-secondary-start nil) 1487 (set-marker mouse-secondary-start nil)
1523 ;; Why the double move? --Stef
1524 ;; (move-overlay mouse-secondary-overlay 1 1
1525 ;; (window-buffer start-window))
1526 (move-overlay mouse-secondary-overlay (car range) (nth 1 range) 1488 (move-overlay mouse-secondary-overlay (car range) (nth 1 range)
1527 (window-buffer start-window))) 1489 (window-buffer start-window)))
1528 ;; Single-press: cancel any preexisting secondary selection. 1490 ;; Single-press: cancel any preexisting secondary selection.
@@ -1616,117 +1578,99 @@ is to prevent accidents."
1616 (delete-overlay mouse-secondary-overlay)) 1578 (delete-overlay mouse-secondary-overlay))
1617 1579
1618(defun mouse-secondary-save-then-kill (click) 1580(defun mouse-secondary-save-then-kill (click)
1619 "Save text to point in kill ring; the second time, kill the text. 1581 "Set the secondary selection and save it to the kill ring.
1620You must use this in a buffer where you have recently done \\[mouse-start-secondary]. 1582The second time, kill it. CLICK should be a mouse click event.
1621If the text between where you did \\[mouse-start-secondary] and where 1583
1622you use this command matches the text at the front of the kill ring, 1584If you have not called `mouse-start-secondary' in the clicked
1623this command deletes the text. 1585buffer, activate the secondary selection and set it between point
1624Otherwise, it adds the text to the kill ring, like \\[kill-ring-save], 1586and the click position CLICK.
1625which prepares for a second click with this command to delete the text. 1587
1626 1588Otherwise, adjust the bounds of the secondary selection.
1627If you have already made a secondary selection in that buffer, 1589Normally, do this by moving its beginning or end, whichever is
1628this command extends or retracts the selection to where you click. 1590closer, to CLICK. But if you have selected whole words or lines,
1629If you do this again in a different position, it extends or retracts 1591adjust to the word or line boundary closest to CLICK instead.
1630again. If you do this twice in the same position, it kills the selection." 1592
1593If this command is called a second consecutive time with the same
1594CLICK position, kill the secondary selection."
1631 (interactive "e") 1595 (interactive "e")
1632 (mouse-minibuffer-check click) 1596 (mouse-minibuffer-check click)
1633 (let ((posn (event-start click)) 1597 (let* ((posn (event-start click))
1634 (click-posn (posn-point (event-start click))) 1598 (click-pt (posn-point posn))
1635 ;; Don't let a subsequent kill command append to this one: 1599 (window (posn-window posn))
1636 ;; prevent setting this-command to kill-region. 1600 (buf (window-buffer window))
1637 (this-command this-command)) 1601 ;; Don't let a subsequent kill command append to this one.
1638 (or (eq (window-buffer (posn-window posn)) 1602 (this-command this-command)
1639 (or (overlay-buffer mouse-secondary-overlay) 1603 ;; Check if the user has multi-clicked to select words/lines.
1640 (if mouse-secondary-start 1604 (click-count
1641 (marker-buffer mouse-secondary-start)))) 1605 (if (eq (overlay-buffer mouse-secondary-overlay) buf)
1642 (error "Wrong buffer")) 1606 mouse-secondary-click-count
1643 (with-current-buffer (window-buffer (posn-window posn)) 1607 0))
1644 (if (> (mod mouse-secondary-click-count 3) 0) 1608 (beg (overlay-start mouse-secondary-overlay))
1645 (if (not (and (eq last-command 'mouse-secondary-save-then-kill) 1609 (end (overlay-end mouse-secondary-overlay)))
1646 (equal click-posn 1610
1647 (car (cdr-safe (cdr-safe mouse-save-then-kill-posn)))))) 1611 (cond
1648 ;; Find both ends of the object selected by this click. 1612 ((not (numberp click-pt)) nil)
1649 (let* ((range 1613
1650 (mouse-start-end click-posn click-posn 1614 ;; If the secondary selection is not active in BUF, activate it.
1651 mouse-secondary-click-count))) 1615 ((not (eq buf (or (overlay-buffer mouse-secondary-overlay)
1652 ;; Move whichever end is closer to the click. 1616 (if mouse-secondary-start
1653 ;; That's what xterm does, and it seems reasonable. 1617 (marker-buffer mouse-secondary-start)))))
1654 (if (< (abs (- click-posn (overlay-start mouse-secondary-overlay))) 1618 (select-window window)
1655 (abs (- click-posn (overlay-end mouse-secondary-overlay)))) 1619 (setq mouse-secondary-start (make-marker))
1656 (move-overlay mouse-secondary-overlay (car range) 1620 (move-marker mouse-secondary-start (point))
1657 (overlay-end mouse-secondary-overlay)) 1621 (move-overlay mouse-secondary-overlay (point) click-pt buf)
1658 (move-overlay mouse-secondary-overlay 1622 (kill-ring-save (point) click-pt))
1659 (overlay-start mouse-secondary-overlay) 1623
1660 (nth 1 range))) 1624 ;; If the user clicked without moving point, delete the secondary
1661 ;; We have already put the old region in the kill ring. 1625 ;; selection. This also resets `mouse-secondary-click-count'.
1662 ;; Replace it with the extended region. 1626 ((and (eq last-command 'mouse-secondary-save-then-kill)
1663 ;; (It would be annoying to make a separate entry.) 1627 (eq click-pt mouse-save-then-kill-posn)
1664 (kill-new (buffer-substring 1628 (eq window (selected-window)))
1665 (overlay-start mouse-secondary-overlay) 1629 (mouse-save-then-kill-delete-region beg end)
1666 (overlay-end mouse-secondary-overlay)) t) 1630 (delete-overlay mouse-secondary-overlay)
1667 ;; Arrange for a repeated mouse-3 to kill this region. 1631 (setq mouse-secondary-click-count 0)
1668 (setq mouse-save-then-kill-posn 1632 (setq mouse-save-then-kill-posn nil))
1669 (list (car kill-ring) (point) click-posn))) 1633
1670 ;; If we click this button again without moving it, 1634 ;; Otherwise, if there is a suitable secondary selection overlay,
1671 ;; that time kill. 1635 ;; adjust it by moving one end (whichever is closer) to CLICK-PT.
1672 (progn 1636 ((and beg (eq buf (overlay-buffer mouse-secondary-overlay)))
1673 (mouse-save-then-kill-delete-region 1637 (let* ((range (mouse-start-end click-pt click-pt click-count)))
1674 (overlay-start mouse-secondary-overlay) 1638 (if (< (abs (- click-pt beg))
1675 (overlay-end mouse-secondary-overlay)) 1639 (abs (- click-pt end)))
1676 (setq mouse-save-then-kill-posn nil) 1640 (move-overlay mouse-secondary-overlay (car range) end)
1677 (setq mouse-secondary-click-count 0) 1641 (move-overlay mouse-secondary-overlay beg (nth 1 range))))
1678 (delete-overlay mouse-secondary-overlay))) 1642 (setq deactivate-mark nil)
1679 (if (and (eq last-command 'mouse-secondary-save-then-kill) 1643 (if (eq last-command 'mouse-secondary-save-then-kill)
1680 mouse-save-then-kill-posn 1644 ;; If the front of the kill ring comes from an immediately
1681 (eq (car mouse-save-then-kill-posn) (car kill-ring)) 1645 ;; previous use of this command, replace the entry.
1682 (equal (cdr mouse-save-then-kill-posn) (list (point) click-posn))) 1646 (kill-new
1683 ;; If this is the second time we've called 1647 (buffer-substring (overlay-start mouse-secondary-overlay)
1684 ;; mouse-secondary-save-then-kill, delete the text from the buffer. 1648 (overlay-end mouse-secondary-overlay))
1685 (progn 1649 t)
1686 (mouse-save-then-kill-delete-region 1650 (let (deactivate-mark)
1687 (overlay-start mouse-secondary-overlay) 1651 (copy-region-as-kill (overlay-start mouse-secondary-overlay)
1688 (overlay-end mouse-secondary-overlay)) 1652 (overlay-end mouse-secondary-overlay))))
1689 (setq mouse-save-then-kill-posn nil) 1653 (setq mouse-save-then-kill-posn click-pt))
1690 (delete-overlay mouse-secondary-overlay)) 1654
1691 (if (overlay-start mouse-secondary-overlay) 1655 ;; Otherwise, set the secondary selection overlay.
1692 ;; We have a selection, so adjust it. 1656 (t
1693 (progn 1657 (select-window window)
1694 (if (numberp click-posn) 1658 (if mouse-secondary-start
1695 (progn 1659 ;; All we have is one end of a selection, so put the other
1696 ;; Move whichever end of the region is closer to the click. 1660 ;; end here.
1697 ;; That is what xterm does, and it seems reasonable. 1661 (let ((start (+ 0 mouse-secondary-start)))
1698 (if (< (abs (- click-posn (overlay-start mouse-secondary-overlay))) 1662 (kill-ring-save start click-pt)
1699 (abs (- click-posn (overlay-end mouse-secondary-overlay)))) 1663 (move-overlay mouse-secondary-overlay start click-pt)))
1700 (move-overlay mouse-secondary-overlay click-posn 1664 (setq mouse-save-then-kill-posn click-pt))))
1701 (overlay-end mouse-secondary-overlay)) 1665
1702 (move-overlay mouse-secondary-overlay 1666 ;; Finally, set the window system's secondary selection.
1703 (overlay-start mouse-secondary-overlay) 1667 (let (str)
1704 click-posn)) 1668 (and (overlay-buffer mouse-secondary-overlay)
1705 (setq deactivate-mark nil))) 1669 (setq str (buffer-substring (overlay-start mouse-secondary-overlay)
1706 (if (eq last-command 'mouse-secondary-save-then-kill) 1670 (overlay-end mouse-secondary-overlay)))
1707 ;; If the front of the kill ring comes from 1671 (> (length str) 0)
1708 ;; an immediately previous use of this command, 1672 (x-set-selection 'SECONDARY str))))
1709 ;; replace it with the extended region. 1673
1710 ;; (It would be annoying to make a separate entry.)
1711 (kill-new (buffer-substring
1712 (overlay-start mouse-secondary-overlay)
1713 (overlay-end mouse-secondary-overlay)) t)
1714 (let (deactivate-mark)
1715 (copy-region-as-kill (overlay-start mouse-secondary-overlay)
1716 (overlay-end mouse-secondary-overlay)))))
1717 (if mouse-secondary-start
1718 ;; All we have is one end of a selection,
1719 ;; so put the other end here.
1720 (let ((start (+ 0 mouse-secondary-start)))
1721 (kill-ring-save start click-posn)
1722 (move-overlay mouse-secondary-overlay start click-posn))))
1723 (setq mouse-save-then-kill-posn
1724 (list (car kill-ring) (point) click-posn))))
1725 (if (overlay-buffer mouse-secondary-overlay)
1726 (x-set-selection 'SECONDARY
1727 (buffer-substring
1728 (overlay-start mouse-secondary-overlay)
1729 (overlay-end mouse-secondary-overlay)))))))
1730 1674
1731(defcustom mouse-buffer-menu-maxlen 20 1675(defcustom mouse-buffer-menu-maxlen 20
1732 "Number of buffers in one pane (submenu) of the buffer menu. 1676 "Number of buffers in one pane (submenu) of the buffer menu.
@@ -1907,332 +1851,6 @@ and selects that window."
1907 ;; Few buffers--put them all in one pane. 1851 ;; Few buffers--put them all in one pane.
1908 (list (cons title alist)))) 1852 (list (cons title alist))))
1909 1853
1910;; These need to be rewritten for the new scroll bar implementation.
1911
1912;;!! ;; Commands for the scroll bar.
1913;;!!
1914;;!! (defun mouse-scroll-down (click)
1915;;!! (interactive "@e")
1916;;!! (scroll-down (1+ (cdr (mouse-coords click)))))
1917;;!!
1918;;!! (defun mouse-scroll-up (click)
1919;;!! (interactive "@e")
1920;;!! (scroll-up (1+ (cdr (mouse-coords click)))))
1921;;!!
1922;;!! (defun mouse-scroll-down-full ()
1923;;!! (interactive "@")
1924;;!! (scroll-down nil))
1925;;!!
1926;;!! (defun mouse-scroll-up-full ()
1927;;!! (interactive "@")
1928;;!! (scroll-up nil))
1929;;!!
1930;;!! (defun mouse-scroll-move-cursor (click)
1931;;!! (interactive "@e")
1932;;!! (move-to-window-line (1+ (cdr (mouse-coords click)))))
1933;;!!
1934;;!! (defun mouse-scroll-absolute (event)
1935;;!! (interactive "@e")
1936;;!! (let* ((pos (car event))
1937;;!! (position (car pos))
1938;;!! (length (car (cdr pos))))
1939;;!! (if (<= length 0) (setq length 1))
1940;;!! (let* ((scale-factor (max 1 (/ length (/ 8000000 (buffer-size)))))
1941;;!! (newpos (* (/ (* (/ (buffer-size) scale-factor)
1942;;!! position)
1943;;!! length)
1944;;!! scale-factor)))
1945;;!! (goto-char newpos)
1946;;!! (recenter '(4)))))
1947;;!!
1948;;!! (defun mouse-scroll-left (click)
1949;;!! (interactive "@e")
1950;;!! (scroll-left (1+ (car (mouse-coords click)))))
1951;;!!
1952;;!! (defun mouse-scroll-right (click)
1953;;!! (interactive "@e")
1954;;!! (scroll-right (1+ (car (mouse-coords click)))))
1955;;!!
1956;;!! (defun mouse-scroll-left-full ()
1957;;!! (interactive "@")
1958;;!! (scroll-left nil))
1959;;!!
1960;;!! (defun mouse-scroll-right-full ()
1961;;!! (interactive "@")
1962;;!! (scroll-right nil))
1963;;!!
1964;;!! (defun mouse-scroll-move-cursor-horizontally (click)
1965;;!! (interactive "@e")
1966;;!! (move-to-column (1+ (car (mouse-coords click)))))
1967;;!!
1968;;!! (defun mouse-scroll-absolute-horizontally (event)
1969;;!! (interactive "@e")
1970;;!! (let* ((pos (car event))
1971;;!! (position (car pos))
1972;;!! (length (car (cdr pos))))
1973;;!! (set-window-hscroll (selected-window) 33)))
1974;;!!
1975;;!! (global-set-key [scroll-bar mouse-1] 'mouse-scroll-up)
1976;;!! (global-set-key [scroll-bar mouse-2] 'mouse-scroll-absolute)
1977;;!! (global-set-key [scroll-bar mouse-3] 'mouse-scroll-down)
1978;;!!
1979;;!! (global-set-key [vertical-slider mouse-1] 'mouse-scroll-move-cursor)
1980;;!! (global-set-key [vertical-slider mouse-2] 'mouse-scroll-move-cursor)
1981;;!! (global-set-key [vertical-slider mouse-3] 'mouse-scroll-move-cursor)
1982;;!!
1983;;!! (global-set-key [thumbup mouse-1] 'mouse-scroll-up-full)
1984;;!! (global-set-key [thumbup mouse-2] 'mouse-scroll-up-full)
1985;;!! (global-set-key [thumbup mouse-3] 'mouse-scroll-up-full)
1986;;!!
1987;;!! (global-set-key [thumbdown mouse-1] 'mouse-scroll-down-full)
1988;;!! (global-set-key [thumbdown mouse-2] 'mouse-scroll-down-full)
1989;;!! (global-set-key [thumbdown mouse-3] 'mouse-scroll-down-full)
1990;;!!
1991;;!! (global-set-key [horizontal-scroll-bar mouse-1] 'mouse-scroll-left)
1992;;!! (global-set-key [horizontal-scroll-bar mouse-2]
1993;;!! 'mouse-scroll-absolute-horizontally)
1994;;!! (global-set-key [horizontal-scroll-bar mouse-3] 'mouse-scroll-right)
1995;;!!
1996;;!! (global-set-key [horizontal-slider mouse-1]
1997;;!! 'mouse-scroll-move-cursor-horizontally)
1998;;!! (global-set-key [horizontal-slider mouse-2]
1999;;!! 'mouse-scroll-move-cursor-horizontally)
2000;;!! (global-set-key [horizontal-slider mouse-3]
2001;;!! 'mouse-scroll-move-cursor-horizontally)
2002;;!!
2003;;!! (global-set-key [thumbleft mouse-1] 'mouse-scroll-left-full)
2004;;!! (global-set-key [thumbleft mouse-2] 'mouse-scroll-left-full)
2005;;!! (global-set-key [thumbleft mouse-3] 'mouse-scroll-left-full)
2006;;!!
2007;;!! (global-set-key [thumbright mouse-1] 'mouse-scroll-right-full)
2008;;!! (global-set-key [thumbright mouse-2] 'mouse-scroll-right-full)
2009;;!! (global-set-key [thumbright mouse-3] 'mouse-scroll-right-full)
2010;;!!
2011;;!! (global-set-key [horizontal-scroll-bar S-mouse-2]
2012;;!! 'mouse-split-window-horizontally)
2013;;!! (global-set-key [mode-line S-mouse-2]
2014;;!! 'mouse-split-window-horizontally)
2015;;!! (global-set-key [vertical-scroll-bar S-mouse-2]
2016;;!! 'mouse-split-window)
2017
2018;;!! ;;;;
2019;;!! ;;;; Here are experimental things being tested. Mouse events
2020;;!! ;;;; are of the form:
2021;;!! ;;;; ((x y) window screen-part key-sequence timestamp)
2022;;!! ;;
2023;;!! ;;;;
2024;;!! ;;;; Dynamically track mouse coordinates
2025;;!! ;;;;
2026;;!! ;;
2027;;!! ;;(defun track-mouse (event)
2028;;!! ;; "Track the coordinates, absolute and relative, of the mouse."
2029;;!! ;; (interactive "@e")
2030;;!! ;; (while mouse-grabbed
2031;;!! ;; (let* ((pos (read-mouse-position (selected-screen)))
2032;;!! ;; (abs-x (car pos))
2033;;!! ;; (abs-y (cdr pos))
2034;;!! ;; (relative-coordinate (coordinates-in-window-p
2035;;!! ;; (list (car pos) (cdr pos))
2036;;!! ;; (selected-window))))
2037;;!! ;; (if (consp relative-coordinate)
2038;;!! ;; (message "mouse: [%d %d], (%d %d)" abs-x abs-y
2039;;!! ;; (car relative-coordinate)
2040;;!! ;; (car (cdr relative-coordinate)))
2041;;!! ;; (message "mouse: [%d %d]" abs-x abs-y)))))
2042;;!!
2043;;!! ;;
2044;;!! ;; Dynamically put a box around the line indicated by point
2045;;!! ;;
2046;;!! ;;
2047;;!! ;;(require 'backquote)
2048;;!! ;;
2049;;!! ;;(defun mouse-select-buffer-line (event)
2050;;!! ;; (interactive "@e")
2051;;!! ;; (let ((relative-coordinate
2052;;!! ;; (coordinates-in-window-p (car event) (selected-window)))
2053;;!! ;; (abs-y (car (cdr (car event)))))
2054;;!! ;; (if (consp relative-coordinate)
2055;;!! ;; (progn
2056;;!! ;; (save-excursion
2057;;!! ;; (move-to-window-line (car (cdr relative-coordinate)))
2058;;!! ;; (x-draw-rectangle
2059;;!! ;; (selected-screen)
2060;;!! ;; abs-y 0
2061;;!! ;; (save-excursion
2062;;!! ;; (move-to-window-line (car (cdr relative-coordinate)))
2063;;!! ;; (end-of-line)
2064;;!! ;; (push-mark nil t)
2065;;!! ;; (beginning-of-line)
2066;;!! ;; (- (region-end) (region-beginning))) 1))
2067;;!! ;; (sit-for 1)
2068;;!! ;; (x-erase-rectangle (selected-screen))))))
2069;;!! ;;
2070;;!! ;;(defvar last-line-drawn nil)
2071;;!! ;;(defvar begin-delim "[^ \t]")
2072;;!! ;;(defvar end-delim "[^ \t]")
2073;;!! ;;
2074;;!! ;;(defun mouse-boxing (event)
2075;;!! ;; (interactive "@e")
2076;;!! ;; (save-excursion
2077;;!! ;; (let ((screen (selected-screen)))
2078;;!! ;; (while (= (x-mouse-events) 0)
2079;;!! ;; (let* ((pos (read-mouse-position screen))
2080;;!! ;; (abs-x (car pos))
2081;;!! ;; (abs-y (cdr pos))
2082;;!! ;; (relative-coordinate
2083;;!! ;; (coordinates-in-window-p `(,abs-x ,abs-y)
2084;;!! ;; (selected-window)))
2085;;!! ;; (begin-reg nil)
2086;;!! ;; (end-reg nil)
2087;;!! ;; (end-column nil)
2088;;!! ;; (begin-column nil))
2089;;!! ;; (if (and (consp relative-coordinate)
2090;;!! ;; (or (not last-line-drawn)
2091;;!! ;; (not (= last-line-drawn abs-y))))
2092;;!! ;; (progn
2093;;!! ;; (move-to-window-line (car (cdr relative-coordinate)))
2094;;!! ;; (if (= (following-char) 10)
2095;;!! ;; ()
2096;;!! ;; (progn
2097;;!! ;; (setq begin-reg (1- (re-search-forward end-delim)))
2098;;!! ;; (setq begin-column (1- (current-column)))
2099;;!! ;; (end-of-line)
2100;;!! ;; (setq end-reg (1+ (re-search-backward begin-delim)))
2101;;!! ;; (setq end-column (1+ (current-column)))
2102;;!! ;; (message "%s" (buffer-substring begin-reg end-reg))
2103;;!! ;; (x-draw-rectangle screen
2104;;!! ;; (setq last-line-drawn abs-y)
2105;;!! ;; begin-column
2106;;!! ;; (- end-column begin-column) 1))))))))))
2107;;!! ;;
2108;;!! ;;(defun mouse-erase-box ()
2109;;!! ;; (interactive)
2110;;!! ;; (if last-line-drawn
2111;;!! ;; (progn
2112;;!! ;; (x-erase-rectangle (selected-screen))
2113;;!! ;; (setq last-line-drawn nil))))
2114;;!!
2115;;!! ;;; (defun test-x-rectangle ()
2116;;!! ;;; (use-local-mouse-map (setq rectangle-test-map (make-sparse-keymap)))
2117;;!! ;;; (define-key rectangle-test-map mouse-motion-button-left 'mouse-boxing)
2118;;!! ;;; (define-key rectangle-test-map mouse-button-left-up 'mouse-erase-box))
2119;;!!
2120;;!! ;;
2121;;!! ;; Here is how to do double clicking in lisp. About to change.
2122;;!! ;;
2123;;!!
2124;;!! (defvar double-start nil)
2125;;!! (defconst double-click-interval 300
2126;;!! "Max ticks between clicks")
2127;;!!
2128;;!! (defun double-down (event)
2129;;!! (interactive "@e")
2130;;!! (if double-start
2131;;!! (let ((interval (- (nth 4 event) double-start)))
2132;;!! (if (< interval double-click-interval)
2133;;!! (progn
2134;;!! (backward-up-list 1)
2135;;!! ;; (message "Interval %d" interval)
2136;;!! (sleep-for 1)))
2137;;!! (setq double-start nil))
2138;;!! (setq double-start (nth 4 event))))
2139;;!!
2140;;!! (defun double-up (event)
2141;;!! (interactive "@e")
2142;;!! (and double-start
2143;;!! (> (- (nth 4 event ) double-start) double-click-interval)
2144;;!! (setq double-start nil)))
2145;;!!
2146;;!! ;;; (defun x-test-doubleclick ()
2147;;!! ;;; (use-local-mouse-map (setq doubleclick-test-map (make-sparse-keymap)))
2148;;!! ;;; (define-key doubleclick-test-map mouse-button-left 'double-down)
2149;;!! ;;; (define-key doubleclick-test-map mouse-button-left-up 'double-up))
2150;;!!
2151;;!! ;;
2152;;!! ;; This scrolls while button is depressed. Use preferable in scroll bar.
2153;;!! ;;
2154;;!!
2155;;!! (defvar scrolled-lines 0)
2156;;!! (defconst scroll-speed 1)
2157;;!!
2158;;!! (defun incr-scroll-down (event)
2159;;!! (interactive "@e")
2160;;!! (setq scrolled-lines 0)
2161;;!! (incremental-scroll scroll-speed))
2162;;!!
2163;;!! (defun incr-scroll-up (event)
2164;;!! (interactive "@e")
2165;;!! (setq scrolled-lines 0)
2166;;!! (incremental-scroll (- scroll-speed)))
2167;;!!
2168;;!! (defun incremental-scroll (n)
2169;;!! (while (= (x-mouse-events) 0)
2170;;!! (setq scrolled-lines (1+ (* scroll-speed scrolled-lines)))
2171;;!! (scroll-down n)
2172;;!! (sit-for 300 t)))
2173;;!!
2174;;!! (defun incr-scroll-stop (event)
2175;;!! (interactive "@e")
2176;;!! (message "Scrolled %d lines" scrolled-lines)
2177;;!! (setq scrolled-lines 0)
2178;;!! (sleep-for 1))
2179;;!!
2180;;!! ;;; (defun x-testing-scroll ()
2181;;!! ;;; (let ((scrolling-map (function mouse-vertical-scroll-bar-prefix)))
2182;;!! ;;; (define-key scrolling-map mouse-button-left 'incr-scroll-down)
2183;;!! ;;; (define-key scrolling-map mouse-button-right 'incr-scroll-up)
2184;;!! ;;; (define-key scrolling-map mouse-button-left-up 'incr-scroll-stop)
2185;;!! ;;; (define-key scrolling-map mouse-button-right-up 'incr-scroll-stop)))
2186;;!!
2187;;!! ;;
2188;;!! ;; Some playthings suitable for picture mode? They need work.
2189;;!! ;;
2190;;!!
2191;;!! (defun mouse-kill-rectangle (event)
2192;;!! "Kill the rectangle between point and the mouse cursor."
2193;;!! (interactive "@e")
2194;;!! (let ((point-save (point)))
2195;;!! (save-excursion
2196;;!! (mouse-set-point event)
2197;;!! (push-mark nil t)
2198;;!! (if (> point-save (point))
2199;;!! (kill-rectangle (point) point-save)
2200;;!! (kill-rectangle point-save (point))))))
2201;;!!
2202;;!! (defun mouse-open-rectangle (event)
2203;;!! "Kill the rectangle between point and the mouse cursor."
2204;;!! (interactive "@e")
2205;;!! (let ((point-save (point)))
2206;;!! (save-excursion
2207;;!! (mouse-set-point event)
2208;;!! (push-mark nil t)
2209;;!! (if (> point-save (point))
2210;;!! (open-rectangle (point) point-save)
2211;;!! (open-rectangle point-save (point))))))
2212;;!!
2213;;!! ;; Must be a better way to do this.
2214;;!!
2215;;!! (defun mouse-multiple-insert (n char)
2216;;!! (while (> n 0)
2217;;!! (insert char)
2218;;!! (setq n (1- n))))
2219;;!!
2220;;!! ;; What this could do is not finalize until button was released.
2221;;!!
2222;;!! (defun mouse-move-text (event)
2223;;!! "Move text from point to cursor position, inserting spaces."
2224;;!! (interactive "@e")
2225;;!! (let* ((relative-coordinate
2226;;!! (coordinates-in-window-p (car event) (selected-window))))
2227;;!! (if (consp relative-coordinate)
2228;;!! (cond ((> (current-column) (car relative-coordinate))
2229;;!! (delete-char
2230;;!! (- (car relative-coordinate) (current-column))))
2231;;!! ((< (current-column) (car relative-coordinate))
2232;;!! (mouse-multiple-insert
2233;;!! (- (car relative-coordinate) (current-column)) " "))
2234;;!! ((= (current-column) (car relative-coordinate)) (ding))))))
2235
2236(define-obsolete-function-alias 1854(define-obsolete-function-alias
2237 'mouse-choose-completion 'choose-completion "23.2") 1855 'mouse-choose-completion 'choose-completion "23.2")
2238 1856
@@ -2475,10 +2093,6 @@ choose a font."
2475 (mouse-menu-bar-map) 2093 (mouse-menu-bar-map)
2476 (mouse-menu-major-mode-map))))) 2094 (mouse-menu-major-mode-map)))))
2477 2095
2478
2479;; Replaced with dragging mouse-1
2480;; (global-set-key [S-mouse-1] 'mouse-set-mark)
2481
2482;; Binding mouse-1 to mouse-select-window when on mode-, header-, or 2096;; Binding mouse-1 to mouse-select-window when on mode-, header-, or
2483;; vertical-line prevents Emacs from signaling an error when the mouse 2097;; vertical-line prevents Emacs from signaling an error when the mouse
2484;; button is released after dragging these lines, on non-toolkit 2098;; button is released after dragging these lines, on non-toolkit
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index 870bd2e313d..ee876e04190 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -108,15 +108,12 @@ catched in `condition-case' by `dbus-error'.")
108 108
109;;; Hash table of registered functions. 109;;; Hash table of registered functions.
110 110
111;; We create it here. So we have a simple test in dbusbind.c, whether
112;; the Lisp code has been loaded.
113(setq dbus-registered-objects-table (make-hash-table :test 'equal))
114
115(defvar dbus-return-values-table (make-hash-table :test 'equal) 111(defvar dbus-return-values-table (make-hash-table :test 'equal)
116 "Hash table for temporary storing arguments of reply messages. 112 "Hash table for temporary storing arguments of reply messages.
117A key in this hash table is a list (BUS SERIAL). BUS is either the 113A key in this hash table is a list (BUS SERIAL). BUS is either a
118symbol `:system' or the symbol `:session'. SERIAL is the serial number 114Lisp symbol, `:system' or `:session', or a string denoting the
119of the reply message. See `dbus-call-method-non-blocking-handler' and 115bus address. SERIAL is the serial number of the reply message.
116See `dbus-call-method-non-blocking-handler' and
120`dbus-call-method-non-blocking'.") 117`dbus-call-method-non-blocking'.")
121 118
122(defun dbus-list-hash-table () 119(defun dbus-list-hash-table ()
@@ -187,8 +184,8 @@ association to the service from D-Bus."
187 184
188(defun dbus-unregister-service (bus service) 185(defun dbus-unregister-service (bus service)
189 "Unregister all objects related to SERVICE from D-Bus BUS. 186 "Unregister all objects related to SERVICE from D-Bus BUS.
190BUS must be either the symbol `:system' or the symbol `:session'. 187BUS is either a Lisp symbol, `:system' or `:session', or a string
191SERVICE must be a known service name." 188denoting the bus address. SERVICE must be a known service name."
192 (maphash 189 (maphash
193 (lambda (key value) 190 (lambda (key value)
194 (dolist (elt value) 191 (dolist (elt value)
@@ -353,15 +350,15 @@ EVENT is a list which starts with symbol `dbus-event':
353 (dbus-event BUS TYPE SERIAL SERVICE PATH INTERFACE MEMBER HANDLER &rest ARGS) 350 (dbus-event BUS TYPE SERIAL SERVICE PATH INTERFACE MEMBER HANDLER &rest ARGS)
354 351
355BUS identifies the D-Bus the message is coming from. It is 352BUS identifies the D-Bus the message is coming from. It is
356either the symbol `:system' or the symbol `:session'. TYPE is 353either a Lisp symbol, `:system' or `:session', or a string
357the D-Bus message type which has caused the event, SERIAL is the 354denoting the bus address. TYPE is the D-Bus message type which
358serial number of the received D-Bus message. SERVICE and PATH 355has caused the event, SERIAL is the serial number of the received
359are the unique name and the object path of the D-Bus object 356D-Bus message. SERVICE and PATH are the unique name and the
360emitting the message. INTERFACE and MEMBER denote the message 357object path of the D-Bus object emitting the message. INTERFACE
361which has been sent. HANDLER is the function which has been 358and MEMBER denote the message which has been sent. HANDLER is
362registered for this message. ARGS are the arguments passed to 359the function which has been registered for this message. ARGS
363HANDLER, when it is called during event handling in 360are the arguments passed to HANDLER, when it is called during
364`dbus-handle-event'. 361event handling in `dbus-handle-event'.
365 362
366This function raises a `dbus-error' signal in case the event is 363This function raises a `dbus-error' signal in case the event is
367not well formed." 364not well formed."
@@ -369,7 +366,8 @@ not well formed."
369 (unless (and (listp event) 366 (unless (and (listp event)
370 (eq (car event) 'dbus-event) 367 (eq (car event) 'dbus-event)
371 ;; Bus symbol. 368 ;; Bus symbol.
372 (symbolp (nth 1 event)) 369 (or (symbolp (nth 1 event))
370 (stringp (nth 1 event)))
373 ;; Type. 371 ;; Type.
374 (and (natnump (nth 2 event)) 372 (and (natnump (nth 2 event))
375 (< dbus-message-type-invalid (nth 2 event))) 373 (< dbus-message-type-invalid (nth 2 event)))
@@ -434,9 +432,10 @@ If the HANDLER returns a `dbus-error', it is propagated as return message."
434 432
435(defun dbus-event-bus-name (event) 433(defun dbus-event-bus-name (event)
436 "Return the bus name the event is coming from. 434 "Return the bus name the event is coming from.
437The result is either the symbol `:system' or the symbol `:session'. 435The result is either a Lisp symbol, `:system' or `:session', or a
438EVENT is a D-Bus event, see `dbus-check-event'. This function 436string denoting the bus address. EVENT is a D-Bus event, see
439raises a `dbus-error' signal in case the event is not well formed." 437`dbus-check-event'. This function raises a `dbus-error' signal
438in case the event is not well formed."
440 (dbus-check-event event) 439 (dbus-check-event event)
441 (nth 1 event)) 440 (nth 1 event))
442 441
@@ -566,10 +565,11 @@ apply
566 "Return all interfaces and sub-nodes of SERVICE, 565 "Return all interfaces and sub-nodes of SERVICE,
567registered at object path PATH at bus BUS. 566registered at object path PATH at bus BUS.
568 567
569BUS must be either the symbol `:system' or the symbol `:session'. 568BUS is either a Lisp symbol, `:system' or `:session', or a string
570SERVICE must be a known service name, and PATH must be a valid 569denoting the bus address. SERVICE must be a known service name,
571object path. The last two parameters are strings. The result, 570and PATH must be a valid object path. The last two parameters
572the introspection data, is a string in XML format." 571are strings. The result, the introspection data, is a string in
572XML format."
573 ;; We don't want to raise errors. `dbus-call-method-non-blocking' 573 ;; We don't want to raise errors. `dbus-call-method-non-blocking'
574 ;; is used, because the handler can be registered in our Emacs 574 ;; is used, because the handler can be registered in our Emacs
575 ;; instance; caller an callee would block each other. 575 ;; instance; caller an callee would block each other.
@@ -873,7 +873,8 @@ name of the property, and its value. If there are no properties,
873 (bus service path interface property access value &optional emits-signal) 873 (bus service path interface property access value &optional emits-signal)
874 "Register property PROPERTY on the D-Bus BUS. 874 "Register property PROPERTY on the D-Bus BUS.
875 875
876BUS is either the symbol `:system' or the symbol `:session'. 876BUS is either a Lisp symbol, `:system' or `:session', or a string
877denoting the bus address.
877 878
878SERVICE is the D-Bus service name of the D-Bus. It must be a 879SERVICE is the D-Bus service name of the D-Bus. It must be a
879known name. 880known name.
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 2a198215536..712af6fd288 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1152,7 +1152,8 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
1152 (when dir 1152 (when dir
1153 (let ((default-directory dir)) 1153 (let ((default-directory dir))
1154 (flymake-log 3 "starting process on dir %s" default-directory))) 1154 (flymake-log 3 "starting process on dir %s" default-directory)))
1155 (setq process (apply 'start-process "flymake-proc" (current-buffer) cmd args)) 1155 (setq process (apply 'start-file-process
1156 "flymake-proc" (current-buffer) cmd args))
1156 (set-process-sentinel process 'flymake-process-sentinel) 1157 (set-process-sentinel process 'flymake-process-sentinel)
1157 (set-process-filter process 'flymake-process-filter) 1158 (set-process-filter process 'flymake-process-filter)
1158 (push process flymake-processes) 1159 (push process flymake-processes)
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 15664c8e56d..362a1db6c10 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -1300,7 +1300,9 @@ definition and conveniently use this command."
1300 (save-restriction 1300 (save-restriction
1301 (narrow-to-region beginning end) 1301 (narrow-to-region beginning end)
1302 (makefile-backslash-region (point-min) (point-max) t) 1302 (makefile-backslash-region (point-min) (point-max) t)
1303 (let ((fill-paragraph-function nil)) 1303 (let ((fill-paragraph-function nil)
1304 ;; Adjust fill-column to allow space for the backslash.
1305 (fill-column (- fill-column 1)))
1304 (fill-paragraph nil)) 1306 (fill-paragraph nil))
1305 (makefile-backslash-region (point-min) (point-max) nil) 1307 (makefile-backslash-region (point-min) (point-max) nil)
1306 (goto-char (point-max)) 1308 (goto-char (point-max))
@@ -1314,7 +1316,9 @@ definition and conveniently use this command."
1314 ;; resulting region. 1316 ;; resulting region.
1315 (save-restriction 1317 (save-restriction
1316 (narrow-to-region (point) (line-beginning-position 2)) 1318 (narrow-to-region (point) (line-beginning-position 2))
1317 (let ((fill-paragraph-function nil)) 1319 (let ((fill-paragraph-function nil)
1320 ;; Adjust fill-column to allow space for the backslash.
1321 (fill-column (- fill-column 1)))
1318 (fill-paragraph nil)) 1322 (fill-paragraph nil))
1319 (makefile-backslash-region (point-min) (point-max) nil)) 1323 (makefile-backslash-region (point-min) (point-max) nil))
1320 ;; Return non-nil to indicate it's been filled. 1324 ;; Return non-nil to indicate it's been filled.
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 2b09e346331..849951a633a 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -579,6 +579,33 @@ having to restart the program."
579 "Queue of Python temp files awaiting execution. 579 "Queue of Python temp files awaiting execution.
580Currently-active file is at the head of the list.") 580Currently-active file is at the head of the list.")
581 581
582(defcustom python-shell-prompt-alist
583 '(("ipython" . "^In \\[[0-9]+\\]: *")
584 (t . "^>>> "))
585 "Alist of Python input prompts.
586Each element has the form (PROGRAM . REGEXP), where PROGRAM is
587the value of `python-python-command' for the python process and
588REGEXP is a regular expression matching the Python prompt.
589PROGRAM can also be t, which specifies the default when no other
590element matches `python-python-command'."
591 :type 'string
592 :group 'python
593 :version "24.1")
594
595(defcustom python-shell-continuation-prompt-alist
596 '(("ipython" . "^ [.][.][.]+: *")
597 (t . "^[.][.][.] "))
598 "Alist of Python continued-line prompts.
599Each element has the form (PROGRAM . REGEXP), where PROGRAM is
600the value of `python-python-command' for the python process and
601REGEXP is a regular expression matching the Python prompt for
602continued lines.
603PROGRAM can also be t, which specifies the default when no other
604element matches `python-python-command'."
605 :type 'string
606 :group 'python
607 :version "24.1")
608
582(defvar python-pdbtrack-is-tracking-p nil) 609(defvar python-pdbtrack-is-tracking-p nil)
583 610
584(defconst python-pdbtrack-stack-entry-regexp 611(defconst python-pdbtrack-stack-entry-regexp
@@ -1311,13 +1338,9 @@ See `python-check-command' for the default."
1311 1338
1312;;;; Inferior mode stuff (following cmuscheme). 1339;;;; Inferior mode stuff (following cmuscheme).
1313 1340
1314;; Fixme: Make sure we can work with IPython.
1315
1316(defcustom python-python-command "python" 1341(defcustom python-python-command "python"
1317 "Shell command to run Python interpreter. 1342 "Shell command to run Python interpreter.
1318Any arguments can't contain whitespace. 1343Any arguments can't contain whitespace."
1319Note that IPython may not work properly; it must at least be used
1320with the `-cl' flag, i.e. use `ipython -cl'."
1321 :group 'python 1344 :group 'python
1322 :type 'string) 1345 :type 'string)
1323 1346
@@ -1395,6 +1418,23 @@ local value.")
1395;; Autoloaded. 1418;; Autoloaded.
1396(declare-function compilation-shell-minor-mode "compile" (&optional arg)) 1419(declare-function compilation-shell-minor-mode "compile" (&optional arg))
1397 1420
1421(defvar python--prompt-regexp nil)
1422
1423(defun python--set-prompt-regexp ()
1424 (let ((prompt (cdr-safe (or (assoc python-python-command
1425 python-shell-prompt-alist)
1426 (assq t python-shell-prompt-alist))))
1427 (cprompt (cdr-safe (or (assoc python-python-command
1428 python-shell-continuation-prompt-alist)
1429 (assq t python-shell-continuation-prompt-alist)))))
1430 (set (make-local-variable 'comint-prompt-regexp)
1431 (concat "\\("
1432 (mapconcat 'identity
1433 (delq nil (list prompt cprompt "^([Pp]db) "))
1434 "\\|")
1435 "\\)"))
1436 (set (make-local-variable 'python--prompt-regexp) prompt)))
1437
1398;; Fixme: This should inherit some stuff from `python-mode', but I'm 1438;; Fixme: This should inherit some stuff from `python-mode', but I'm
1399;; not sure how much: at least some keybindings, like C-c C-f; 1439;; not sure how much: at least some keybindings, like C-c C-f;
1400;; syntax?; font-locking, e.g. for triple-quoted strings? 1440;; syntax?; font-locking, e.g. for triple-quoted strings?
@@ -1417,14 +1457,12 @@ For running multiple processes in multiple buffers, see `run-python' and
1417 1457
1418\\{inferior-python-mode-map}" 1458\\{inferior-python-mode-map}"
1419 :group 'python 1459 :group 'python
1460 (require 'ansi-color) ; for ipython
1420 (setq mode-line-process '(":%s")) 1461 (setq mode-line-process '(":%s"))
1421 (set (make-local-variable 'comint-input-filter) 'python-input-filter) 1462 (set (make-local-variable 'comint-input-filter) 'python-input-filter)
1422 (add-hook 'comint-preoutput-filter-functions #'python-preoutput-filter 1463 (add-hook 'comint-preoutput-filter-functions #'python-preoutput-filter
1423 nil t) 1464 nil t)
1424 ;; Still required by `comint-redirect-send-command', for instance 1465 (python--set-prompt-regexp)
1425 ;; (and we need to match things like `>>> ... >>> '):
1426 (set (make-local-variable 'comint-prompt-regexp)
1427 (rx line-start (1+ (and (or (repeat 3 (any ">.")) "(Pdb)") " "))))
1428 (set (make-local-variable 'compilation-error-regexp-alist) 1466 (set (make-local-variable 'compilation-error-regexp-alist)
1429 python-compilation-regexp-alist) 1467 python-compilation-regexp-alist)
1430 (compilation-shell-minor-mode 1)) 1468 (compilation-shell-minor-mode 1))
@@ -1521,12 +1559,12 @@ Don't save anything for STR matching `inferior-python-filter-regexp'."
1521 cmd))) 1559 cmd)))
1522 (unless (shell-command-to-string cmd) 1560 (unless (shell-command-to-string cmd)
1523 (error "Can't run Python command `%s'" cmd)) 1561 (error "Can't run Python command `%s'" cmd))
1524 (let* ((res (shell-command-to-string (concat cmd " --version")))) 1562 (let* ((res (shell-command-to-string
1525 (string-match "Python \\([0-9]\\)\\.\\([0-9]\\)" res) 1563 (concat cmd
1526 (unless (and (equal "2" (match-string 1 res)) 1564 " -c \"from sys import version_info;\
1527 (match-beginning 2) 1565print version_info >= (2, 2) and version_info < (3, 0)\""))))
1528 (>= (string-to-number (match-string 2 res)) 2)) 1566 (unless (string-match "True" res)
1529 (error "Only Python versions >= 2.2 and < 3.0 supported"))) 1567 (error "Only Python versions >= 2.2 and < 3.0 are supported")))
1530 (setq python-version-checked t))) 1568 (setq python-version-checked t)))
1531 1569
1532;;;###autoload 1570;;;###autoload
@@ -1549,6 +1587,7 @@ buffer for a list of commands.)"
1549 (interactive (if current-prefix-arg 1587 (interactive (if current-prefix-arg
1550 (list (read-string "Run Python: " python-command) nil t) 1588 (list (read-string "Run Python: " python-command) nil t)
1551 (list python-command))) 1589 (list python-command)))
1590 (require 'ansi-color) ; for ipython
1552 (unless cmd (setq cmd python-command)) 1591 (unless cmd (setq cmd python-command))
1553 (python-check-version cmd) 1592 (python-check-version cmd)
1554 (setq python-command cmd) 1593 (setq python-command cmd)
@@ -1566,8 +1605,10 @@ buffer for a list of commands.)"
1566 (if path (concat path path-separator)) 1605 (if path (concat path path-separator))
1567 data-directory) 1606 data-directory)
1568 process-environment)) 1607 process-environment))
1569 ;; Suppress use of pager for help output: 1608 ;; If we use a pipe, unicode characters are not printed
1570 (process-connection-type nil)) 1609 ;; correctly (Bug#5794) and IPython does not work at
1610 ;; all (Bug#5390).
1611 (process-connection-type t))
1571 (apply 'make-comint-in-buffer "Python" 1612 (apply 'make-comint-in-buffer "Python"
1572 (generate-new-buffer "*Python*") 1613 (generate-new-buffer "*Python*")
1573 (car cmdlist) nil (cdr cmdlist))) 1614 (car cmdlist) nil (cdr cmdlist)))
@@ -1623,7 +1664,12 @@ buffer for a list of commands.)"
1623 ;; non-ASCII. 1664 ;; non-ASCII.
1624 (interactive "r") 1665 (interactive "r")
1625 (let* ((f (make-temp-file "py")) 1666 (let* ((f (make-temp-file "py"))
1626 (command (format "emacs.eexecfile(%S)" f)) 1667 (command
1668 ;; IPython puts the FakeModule module into __main__ so
1669 ;; emacs.eexecfile becomes useless.
1670 (if (string-match "^ipython" python-command)
1671 (format "execfile %S" f)
1672 (format "emacs.eexecfile(%S)" f)))
1627 (orig-start (copy-marker start))) 1673 (orig-start (copy-marker start)))
1628 (when (save-excursion 1674 (when (save-excursion
1629 (goto-char start) 1675 (goto-char start)
@@ -1823,7 +1869,9 @@ If there isn't, it's probably not appropriate to send input to return Eldoc
1823information etc. If PROC is non-nil, check the buffer for that process." 1869information etc. If PROC is non-nil, check the buffer for that process."
1824 (with-current-buffer (process-buffer (or proc (python-proc))) 1870 (with-current-buffer (process-buffer (or proc (python-proc)))
1825 (save-excursion 1871 (save-excursion
1826 (save-match-data (re-search-backward ">>> \\=" nil t))))) 1872 (save-match-data
1873 (re-search-backward (concat python--prompt-regexp " *\\=")
1874 nil t)))))
1827 1875
1828;; Fixme: Is there anything reasonable we can do with random methods? 1876;; Fixme: Is there anything reasonable we can do with random methods?
1829;; (Currently only works with functions.) 1877;; (Currently only works with functions.)
@@ -2539,9 +2587,7 @@ Runs `jython-mode-hook' after `python-mode-hook'."
2539 "Watch output for Python prompt and exec next file waiting in queue. 2587 "Watch output for Python prompt and exec next file waiting in queue.
2540This function is appropriate for `comint-output-filter-functions'." 2588This function is appropriate for `comint-output-filter-functions'."
2541 ;; TBD: this should probably use split-string 2589 ;; TBD: this should probably use split-string
2542 (when (and (or (string-equal string ">>> ") 2590 (when (and (string-match python--prompt-regexp string)
2543 (and (>= (length string) 5)
2544 (string-equal (substring string -5) "\n>>> ")))
2545 python-file-queue) 2591 python-file-queue)
2546 (condition-case nil 2592 (condition-case nil
2547 (delete-file (car python-file-queue)) 2593 (delete-file (car python-file-queue))
@@ -2753,6 +2799,7 @@ comint believe the user typed this string so that
2753 (funcall (process-filter proc) proc msg)) 2799 (funcall (process-filter proc) proc msg))
2754 (set-buffer curbuf)) 2800 (set-buffer curbuf))
2755 (process-send-string proc cmd))) 2801 (process-send-string proc cmd)))
2802
2756;;;###autoload 2803;;;###autoload
2757(defun python-shell (&optional argprompt) 2804(defun python-shell (&optional argprompt)
2758 "Start an interactive Python interpreter in another window. 2805 "Start an interactive Python interpreter in another window.
@@ -2792,6 +2839,7 @@ interaction between undo and process filters; the same problem exists in
2792non-Python process buffers using the default (Emacs-supplied) process 2839non-Python process buffers using the default (Emacs-supplied) process
2793filter." 2840filter."
2794 (interactive "P") 2841 (interactive "P")
2842 (require 'ansi-color) ; For ipython
2795 ;; Set the default shell if not already set 2843 ;; Set the default shell if not already set
2796 (when (null python-which-shell) 2844 (when (null python-which-shell)
2797 (python-toggle-shells python-default-interpreter)) 2845 (python-toggle-shells python-default-interpreter))
@@ -2808,10 +2856,9 @@ filter."
2808 )))) 2856 ))))
2809 (switch-to-buffer-other-window 2857 (switch-to-buffer-other-window
2810 (apply 'make-comint python-which-bufname python-which-shell nil args)) 2858 (apply 'make-comint python-which-bufname python-which-shell nil args))
2811 (make-local-variable 'comint-prompt-regexp)
2812 (set-process-sentinel (get-buffer-process (current-buffer)) 2859 (set-process-sentinel (get-buffer-process (current-buffer))
2813 'python-sentinel) 2860 'python-sentinel)
2814 (setq comint-prompt-regexp "^>>> \\|^[.][.][.] \\|^(pdb) ") 2861 (python--set-prompt-regexp)
2815 (add-hook 'comint-output-filter-functions 2862 (add-hook 'comint-output-filter-functions
2816 'python-comint-output-filter-function nil t) 2863 'python-comint-output-filter-function nil t)
2817 ;; pdbtrack 2864 ;; pdbtrack
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index a75c5b01bb8..0b92234bf1c 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -43,6 +43,11 @@
43 43
44(eval-when-compile (require 'cl)) 44(eval-when-compile (require 'cl))
45 45
46(defgroup ruby nil
47 "Major mode for editing Ruby code."
48 :prefix "ruby-"
49 :group 'languages)
50
46(defconst ruby-keyword-end-re 51(defconst ruby-keyword-end-re
47 (if (string-match "\\_>" "ruby") 52 (if (string-match "\\_>" "ruby")
48 "\\_>" 53 "\\_>"
diff --git a/lisp/simple.el b/lisp/simple.el
index 7c941fd63b9..c1ec78da7b9 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1301,6 +1301,40 @@ to get different commands to edit and resubmit."
1301 (if command-history 1301 (if command-history
1302 (error "Argument %d is beyond length of command history" arg) 1302 (error "Argument %d is beyond length of command history" arg)
1303 (error "There are no previous complex commands to repeat"))))) 1303 (error "There are no previous complex commands to repeat")))))
1304
1305(defun read-extended-command ()
1306 "Read command name to invoke in `execute-extended-command'."
1307 (minibuffer-with-setup-hook
1308 (lambda ()
1309 (set (make-local-variable 'minibuffer-default-add-function)
1310 (lambda ()
1311 ;; Get a command name at point in the original buffer
1312 ;; to propose it after M-n.
1313 (with-current-buffer (window-buffer (minibuffer-selected-window))
1314 (and (commandp (function-called-at-point))
1315 (format "%S" (function-called-at-point)))))))
1316 ;; Read a string, completing from and restricting to the set of
1317 ;; all defined commands. Don't provide any initial input.
1318 ;; Save the command read on the extended-command history list.
1319 (completing-read
1320 (concat (cond
1321 ((eq current-prefix-arg '-) "- ")
1322 ((and (consp current-prefix-arg)
1323 (eq (car current-prefix-arg) 4)) "C-u ")
1324 ((and (consp current-prefix-arg)
1325 (integerp (car current-prefix-arg)))
1326 (format "%d " (car current-prefix-arg)))
1327 ((integerp current-prefix-arg)
1328 (format "%d " current-prefix-arg)))
1329 ;; This isn't strictly correct if `execute-extended-command'
1330 ;; is bound to anything else (e.g. [menu]).
1331 ;; It could use (key-description (this-single-command-keys)),
1332 ;; but actually a prompt other than "M-x" would be confusing,
1333 ;; because "M-x" is a well-known prompt to read a command
1334 ;; and it serves as a shorthand for "Extended command: ".
1335 "M-x ")
1336 obarray 'commandp t nil 'extended-command-history)))
1337
1304 1338
1305(defvar minibuffer-history nil 1339(defvar minibuffer-history nil
1306 "Default minibuffer history list. 1340 "Default minibuffer history list.
@@ -3103,7 +3137,8 @@ If the buffer is read-only, Emacs will beep and refrain from deleting
3103the text, but put the text in the kill ring anyway. This means that 3137the text, but put the text in the kill ring anyway. This means that
3104you can use the killing commands to copy text from a read-only buffer. 3138you can use the killing commands to copy text from a read-only buffer.
3105 3139
3106This is the primitive for programs to kill text (as opposed to deleting it). 3140Lisp programs should use this function for killing text.
3141 (To delete text, use `delete-region'.)
3107Supply two arguments, character positions indicating the stretch of text 3142Supply two arguments, character positions indicating the stretch of text
3108 to be killed. 3143 to be killed.
3109Any command that calls this function is a \"kill command\". 3144Any command that calls this function is a \"kill command\".
@@ -5495,7 +5530,9 @@ it skips the contents of comments that end before point."
5495 (and parse-sexp-ignore-comments 5530 (and parse-sexp-ignore-comments
5496 (not blink-matching-paren-dont-ignore-comments)))) 5531 (not blink-matching-paren-dont-ignore-comments))))
5497 (condition-case () 5532 (condition-case ()
5498 (scan-sexps oldpos -1) 5533 (progn
5534 (forward-sexp -1)
5535 (point))
5499 (error nil)))))) 5536 (error nil))))))
5500 (matching-paren 5537 (matching-paren
5501 (and blinkpos 5538 (and blinkpos
diff --git a/lisp/startup.el b/lisp/startup.el
index 76e11491c0c..72169799acf 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -785,15 +785,16 @@ opening the first frame (e.g. open a connection to an X server).")
785 argi (match-string 1 argi))) 785 argi (match-string 1 argi)))
786 (when (string-match "\\`--." orig-argi) 786 (when (string-match "\\`--." orig-argi)
787 (let ((completion (try-completion argi longopts))) 787 (let ((completion (try-completion argi longopts)))
788 (if (eq completion t) 788 (cond ((eq completion t)
789 (setq argi (substring argi 1)) 789 (setq argi (substring argi 1)))
790 (if (stringp completion) 790 ((stringp completion)
791 (let ((elt (assoc completion longopts))) 791 (let ((elt (assoc completion longopts)))
792 (or elt 792 (unless elt
793 (error "Option `%s' is ambiguous" argi)) 793 (error "Option `%s' is ambiguous" argi))
794 (setq argi (substring (car elt) 1))) 794 (setq argi (substring (car elt) 1))))
795 (setq argval nil 795 (t
796 argi orig-argi))))) 796 (setq argval nil
797 argi orig-argi)))))
797 (cond 798 (cond
798 ;; The --display arg is handled partly in C, partly in Lisp. 799 ;; The --display arg is handled partly in C, partly in Lisp.
799 ;; When it shows up here, we just put it back to be handled 800 ;; When it shows up here, we just put it back to be handled
@@ -2231,6 +2232,11 @@ A fancy display is used on graphic displays, normal otherwise."
2231 (move-to-column (1- cl1-column))) 2232 (move-to-column (1- cl1-column)))
2232 (setq cl1-column 0)) 2233 (setq cl1-column 0))
2233 2234
2235 ;; These command lines now have no effect.
2236 ((string-match "\\`--?\\(no-\\)?\\(uni\\|multi\\)byte$" argi)
2237 (display-warning 'initialization
2238 (format "Ignoring obsolete arg %s" argi)))
2239
2234 ((equal argi "--") 2240 ((equal argi "--")
2235 (setq just-files t)) 2241 (setq just-files t))
2236 (t 2242 (t
diff --git a/lisp/subr.el b/lisp/subr.el
index 9fb737fd038..90480ea0e7f 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -219,6 +219,7 @@ Treated as a declaration when used at the right place in a
219(defmacro ignore-errors (&rest body) 219(defmacro ignore-errors (&rest body)
220 "Execute BODY; if an error occurs, return nil. 220 "Execute BODY; if an error occurs, return nil.
221Otherwise, return result of last form in BODY." 221Otherwise, return result of last form in BODY."
222 (declare (debug t) (indent 0))
222 `(condition-case nil (progn ,@body) (error nil))) 223 `(condition-case nil (progn ,@body) (error nil)))
223 224
224;;;; Basic Lisp functions. 225;;;; Basic Lisp functions.
@@ -1818,6 +1819,7 @@ When there's an ambiguity because the key looks like the prefix of
1818some sort of escape sequence, the ambiguity is resolved via `read-key-delay'." 1819some sort of escape sequence, the ambiguity is resolved via `read-key-delay'."
1819 (let ((overriding-terminal-local-map read-key-empty-map) 1820 (let ((overriding-terminal-local-map read-key-empty-map)
1820 (overriding-local-map nil) 1821 (overriding-local-map nil)
1822 (echo-keystrokes 0)
1821 (old-global-map (current-global-map)) 1823 (old-global-map (current-global-map))
1822 (timer (run-with-idle-timer 1824 (timer (run-with-idle-timer
1823 ;; Wait long enough that Emacs has the time to receive and 1825 ;; Wait long enough that Emacs has the time to receive and
@@ -1842,7 +1844,12 @@ some sort of escape sequence, the ambiguity is resolved via `read-key-delay'."
1842 (throw 'read-key keys))))))) 1844 (throw 'read-key keys)))))))
1843 (unwind-protect 1845 (unwind-protect
1844 (progn 1846 (progn
1845 (use-global-map read-key-empty-map) 1847 (use-global-map
1848 (let ((map (make-sparse-keymap)))
1849 ;; Don't hide the menu-bar and tool-bar entries.
1850 (define-key map [menu-bar] (lookup-key global-map [menu-bar]))
1851 (define-key map [tool-bar] (lookup-key global-map [tool-bar]))
1852 map))
1846 (aref (catch 'read-key (read-key-sequence-vector prompt nil t)) 0)) 1853 (aref (catch 'read-key (read-key-sequence-vector prompt nil t)) 0))
1847 (cancel-timer timer) 1854 (cancel-timer timer)
1848 (use-global-map old-global-map)))) 1855 (use-global-map old-global-map))))
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index e8a92b101ef..8a73a0f818e 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -199,9 +199,9 @@ Ispell's ultimate default dictionary."
199 199
200(defcustom flyspell-check-tex-math-command nil 200(defcustom flyspell-check-tex-math-command nil
201 "Non-nil means check even inside TeX math environment. 201 "Non-nil means check even inside TeX math environment.
202TeX math environments are discovered by the TEXMATHP that implemented 202TeX math environments are discovered by `texmathp', implemented
203inside the texmathp.el Emacs package. That package may be found at: 203inside AUCTeX package. That package may be found at
204http://strw.leidenuniv.nl/~dominik/Tools" 204URL `http://www.gnu.org/software/auctex/'"
205 :group 'flyspell 205 :group 'flyspell
206 :type 'boolean) 206 :type 'boolean)
207 207
diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el
index cf391b2f9ac..23f1e33f181 100644
--- a/lisp/vc/add-log.el
+++ b/lisp/vc/add-log.el
@@ -755,7 +755,17 @@ Optional arg BUFFER-FILE overrides `buffer-file-name'."
755 (if add-log-file-name-function 755 (if add-log-file-name-function
756 (funcall add-log-file-name-function buffer-file) 756 (funcall add-log-file-name-function buffer-file)
757 (setq buffer-file 757 (setq buffer-file
758 (file-relative-name buffer-file (file-name-directory log-file))) 758 (let* ((dir (file-name-directory log-file))
759 (rel (file-relative-name buffer-file dir)))
760 ;; Sometimes with symlinks, the two buffers may have names that
761 ;; appear to belong to different directory trees. So check the
762 ;; file-truenames, to see if we get a better result.
763 (if (not (string-match "\\`\\.\\./" rel))
764 rel
765 (let ((new (file-relative-name (file-truename buffer-file)
766 (file-truename dir))))
767 (if (< (length new) (length rel))
768 new rel)))))
759 ;; If we have a backup file, it's presumably because we're 769 ;; If we have a backup file, it's presumably because we're
760 ;; comparing old and new versions (e.g. for deleted 770 ;; comparing old and new versions (e.g. for deleted
761 ;; functions) and we'll want to use the original name. 771 ;; functions) and we'll want to use the original name.
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 79ce9a330d4..0ef41b5a002 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -6,7 +6,7 @@
6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
7;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> 7;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
8;; Keywords: data, wp 8;; Keywords: data, wp
9;; Version: 12.1 9;; Version: 13.1
10;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre 10;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
11 11
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
@@ -382,19 +382,28 @@
382 382
383 383
384(defcustom whitespace-style 384(defcustom whitespace-style
385 '(tabs spaces trailing lines space-before-tab newline 385 '(face
386 indentation empty space-after-tab 386 tabs spaces trailing lines space-before-tab newline
387 space-mark tab-mark newline-mark) 387 indentation empty space-after-tab
388 space-mark tab-mark newline-mark)
388 "Specify which kind of blank is visualized. 389 "Specify which kind of blank is visualized.
389 390
390It's a list containing some or all of the following values: 391It's a list containing some or all of the following values:
391 392
393 face enable all visualization via faces (see below).
394
392 trailing trailing blanks are visualized via faces. 395 trailing trailing blanks are visualized via faces.
396 It has effect only if `face' (see above)
397 is present in `whitespace-style'.
393 398
394 tabs TABs are visualized via faces. 399 tabs TABs are visualized via faces.
400 It has effect only if `face' (see above)
401 is present in `whitespace-style'.
395 402
396 spaces SPACEs and HARD SPACEs are visualized via 403 spaces SPACEs and HARD SPACEs are visualized via
397 faces. 404 faces.
405 It has effect only if `face' (see above)
406 is present in `whitespace-style'.
398 407
399 lines lines which have columns beyond 408 lines lines which have columns beyond
400 `whitespace-line-column' are highlighted via 409 `whitespace-line-column' are highlighted via
@@ -402,6 +411,8 @@ It's a list containing some or all of the following values:
402 Whole line is highlighted. 411 Whole line is highlighted.
403 It has precedence over `lines-tail' (see 412 It has precedence over `lines-tail' (see
404 below). 413 below).
414 It has effect only if `face' (see above)
415 is present in `whitespace-style'.
405 416
406 lines-tail lines which have columns beyond 417 lines-tail lines which have columns beyond
407 `whitespace-line-column' are highlighted via 418 `whitespace-line-column' are highlighted via
@@ -409,45 +420,69 @@ It's a list containing some or all of the following values:
409 But only the part of line which goes 420 But only the part of line which goes
410 beyond `whitespace-line-column' column. 421 beyond `whitespace-line-column' column.
411 It has effect only if `lines' (see above) 422 It has effect only if `lines' (see above)
412 is not present in `whitespace-style'. 423 is not present in `whitespace-style'
424 and if `face' (see above) is present in
425 `whitespace-style'.
413 426
414 newline NEWLINEs are visualized via faces. 427 newline NEWLINEs are visualized via faces.
428 It has effect only if `face' (see above)
429 is present in `whitespace-style'.
415 430
416 empty empty lines at beginning and/or end of buffer 431 empty empty lines at beginning and/or end of buffer
417 are visualized via faces. 432 are visualized via faces.
433 It has effect only if `face' (see above)
434 is present in `whitespace-style'.
418 435
419 indentation::tab 8 or more SPACEs at beginning of line are 436 indentation::tab 8 or more SPACEs at beginning of line are
420 visualized via faces. 437 visualized via faces.
438 It has effect only if `face' (see above)
439 is present in `whitespace-style'.
421 440
422 indentation::space TABs at beginning of line are visualized via 441 indentation::space TABs at beginning of line are visualized via
423 faces. 442 faces.
443 It has effect only if `face' (see above)
444 is present in `whitespace-style'.
424 445
425 indentation 8 or more SPACEs at beginning of line are 446 indentation 8 or more SPACEs at beginning of line are
426 visualized, if `indent-tabs-mode' (which see) 447 visualized, if `indent-tabs-mode' (which see)
427 is non-nil; otherwise, TABs at beginning of 448 is non-nil; otherwise, TABs at beginning of
428 line are visualized via faces. 449 line are visualized via faces.
450 It has effect only if `face' (see above)
451 is present in `whitespace-style'.
429 452
430 space-after-tab::tab 8 or more SPACEs after a TAB are 453 space-after-tab::tab 8 or more SPACEs after a TAB are
431 visualized via faces. 454 visualized via faces.
455 It has effect only if `face' (see above)
456 is present in `whitespace-style'.
432 457
433 space-after-tab::space TABs are visualized when 8 or more 458 space-after-tab::space TABs are visualized when 8 or more
434 SPACEs occur after a TAB, via faces. 459 SPACEs occur after a TAB, via faces.
460 It has effect only if `face' (see above)
461 is present in `whitespace-style'.
435 462
436 space-after-tab 8 or more SPACEs after a TAB are 463 space-after-tab 8 or more SPACEs after a TAB are
437 visualized, if `indent-tabs-mode' 464 visualized, if `indent-tabs-mode'
438 (which see) is non-nil; otherwise, 465 (which see) is non-nil; otherwise,
439 the TABs are visualized via faces. 466 the TABs are visualized via faces.
467 It has effect only if `face' (see above)
468 is present in `whitespace-style'.
440 469
441 space-before-tab::tab SPACEs before TAB are visualized via 470 space-before-tab::tab SPACEs before TAB are visualized via
442 faces. 471 faces.
472 It has effect only if `face' (see above)
473 is present in `whitespace-style'.
443 474
444 space-before-tab::space TABs are visualized when SPACEs occur 475 space-before-tab::space TABs are visualized when SPACEs occur
445 before TAB, via faces. 476 before TAB, via faces.
477 It has effect only if `face' (see above)
478 is present in `whitespace-style'.
446 479
447 space-before-tab SPACEs before TAB are visualized, if 480 space-before-tab SPACEs before TAB are visualized, if
448 `indent-tabs-mode' (which see) is 481 `indent-tabs-mode' (which see) is
449 non-nil; otherwise, the TABs are 482 non-nil; otherwise, the TABs are
450 visualized via faces. 483 visualized via faces.
484 It has effect only if `face' (see above)
485 is present in `whitespace-style'.
451 486
452 space-mark SPACEs and HARD SPACEs are visualized via 487 space-mark SPACEs and HARD SPACEs are visualized via
453 display table. 488 display table.
@@ -486,6 +521,11 @@ So, for example, if indentation and indentation::space are
486included in `whitespace-style' list, the indentation value is 521included in `whitespace-style' list, the indentation value is
487evaluated instead of indentation::space value. 522evaluated instead of indentation::space value.
488 523
524One reason for not visualize spaces via faces (if `face' is not
525included in `whitespace-style') is to use exclusively for
526cleanning up a buffer. See `whitespace-cleanup' and
527`whitespace-cleanup-region' for documentation.
528
489See also `whitespace-display-mappings' for documentation." 529See also `whitespace-display-mappings' for documentation."
490 :type '(repeat :tag "Kind of Blank" 530 :type '(repeat :tag "Kind of Blank"
491 (choice :tag "Kind of Blank Face" 531 (choice :tag "Kind of Blank Face"
@@ -521,9 +561,9 @@ Used when `whitespace-style' includes the value `spaces'."
521 561
522(defface whitespace-space 562(defface whitespace-space
523 '((((class color) (background dark)) 563 '((((class color) (background dark))
524 (:background "grey20" :foreground "aquamarine3")) 564 (:background "grey20" :foreground "darkgray"))
525 (((class color) (background light)) 565 (((class color) (background light))
526 (:background "LightYellow" :foreground "aquamarine3")) 566 (:background "LightYellow" :foreground "lightgray"))
527 (t (:inverse-video t))) 567 (t (:inverse-video t)))
528 "Face used to visualize SPACE." 568 "Face used to visualize SPACE."
529 :group 'whitespace) 569 :group 'whitespace)
@@ -539,9 +579,9 @@ Used when `whitespace-style' includes the value `spaces'."
539 579
540(defface whitespace-hspace ; 'nobreak-space 580(defface whitespace-hspace ; 'nobreak-space
541 '((((class color) (background dark)) 581 '((((class color) (background dark))
542 (:background "grey24" :foreground "aquamarine3")) 582 (:background "grey24" :foreground "darkgray"))
543 (((class color) (background light)) 583 (((class color) (background light))
544 (:background "LemonChiffon3" :foreground "aquamarine3")) 584 (:background "LemonChiffon3" :foreground "lightgray"))
545 (t (:inverse-video t))) 585 (t (:inverse-video t)))
546 "Face used to visualize HARD SPACE." 586 "Face used to visualize HARD SPACE."
547 :group 'whitespace) 587 :group 'whitespace)
@@ -557,9 +597,9 @@ Used when `whitespace-style' includes the value `tabs'."
557 597
558(defface whitespace-tab 598(defface whitespace-tab
559 '((((class color) (background dark)) 599 '((((class color) (background dark))
560 (:background "grey22" :foreground "aquamarine3")) 600 (:background "grey22" :foreground "darkgray"))
561 (((class color) (background light)) 601 (((class color) (background light))
562 (:background "beige" :foreground "aquamarine3")) 602 (:background "beige" :foreground "lightgray"))
563 (t (:inverse-video t))) 603 (t (:inverse-video t)))
564 "Face used to visualize TAB." 604 "Face used to visualize TAB."
565 :group 'whitespace) 605 :group 'whitespace)
@@ -812,7 +852,7 @@ Used when `whitespace-style' includes `indentation',
812 :group 'whitespace) 852 :group 'whitespace)
813 853
814 854
815(defcustom whitespace-empty-at-bob-regexp "\\`\\(\\([ \t]*\n\\)+\\)" 855(defcustom whitespace-empty-at-bob-regexp "^\\(\\([ \t]*\n\\)+\\)"
816 "Specify regexp for empty lines at beginning of buffer. 856 "Specify regexp for empty lines at beginning of buffer.
817 857
818If you're using `mule' package, there may be other characters besides: 858If you're using `mule' package, there may be other characters besides:
@@ -827,7 +867,7 @@ Used when `whitespace-style' includes `empty'."
827 :group 'whitespace) 867 :group 'whitespace)
828 868
829 869
830(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)\\'" 870(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)"
831 "Specify regexp for empty lines at end of buffer. 871 "Specify regexp for empty lines at end of buffer.
832 872
833If you're using `mule' package, there may be other characters besides: 873If you're using `mule' package, there may be other characters besides:
@@ -866,8 +906,13 @@ Used when `whitespace-style' includes `space-after-tab',
866(defcustom whitespace-line-column 80 906(defcustom whitespace-line-column 80
867 "Specify column beyond which the line is highlighted. 907 "Specify column beyond which the line is highlighted.
868 908
909It must be an integer or nil. If nil, the `fill-column' variable value is
910used.
911
869Used when `whitespace-style' includes `lines' or `lines-tail'." 912Used when `whitespace-style' includes `lines' or `lines-tail'."
870 :type '(integer :tag "Line Length") 913 :type '(choice :tag "Line Length Limit"
914 (integer :tag "Line Length")
915 (const :tag "Use fill-column" nil))
871 :group 'whitespace) 916 :group 'whitespace)
872 917
873 918
@@ -1151,7 +1196,8 @@ See also `whitespace-newline' and `whitespace-display-mappings'."
1151 1196
1152 1197
1153(defconst whitespace-style-value-list 1198(defconst whitespace-style-value-list
1154 '(tabs 1199 '(face
1200 tabs
1155 spaces 1201 spaces
1156 trailing 1202 trailing
1157 lines 1203 lines
@@ -1176,7 +1222,8 @@ See also `whitespace-newline' and `whitespace-display-mappings'."
1176 1222
1177 1223
1178(defconst whitespace-toggle-option-alist 1224(defconst whitespace-toggle-option-alist
1179 '((?t . tabs) 1225 '((?f . face)
1226 (?t . tabs)
1180 (?s . spaces) 1227 (?s . spaces)
1181 (?r . trailing) 1228 (?r . trailing)
1182 (?l . lines) 1229 (?l . lines)
@@ -1228,6 +1275,19 @@ Used by `whitespace-trailing-regexp' function (which see).")
1228 "Used to save locally the font-lock refontify state. 1275 "Used to save locally the font-lock refontify state.
1229Used by `whitespace-post-command-hook' function (which see).") 1276Used by `whitespace-post-command-hook' function (which see).")
1230 1277
1278(defvar whitespace-bob-marker nil
1279 "Used to save locally the bob marker value.
1280Used by `whitespace-post-command-hook' function (which see).")
1281
1282(defvar whitespace-eob-marker nil
1283 "Used to save locally the eob marker value.
1284Used by `whitespace-post-command-hook' function (which see).")
1285
1286(defvar whitespace-buffer-changed nil
1287 "Used to indicate locally if buffer changed.
1288Used by `whitespace-post-command-hook' and `whitespace-buffer-changed'
1289functions (which see).")
1290
1231 1291
1232;;;###autoload 1292;;;###autoload
1233(defun whitespace-toggle-options (arg) 1293(defun whitespace-toggle-options (arg)
@@ -1243,6 +1303,7 @@ Interactively, it reads one of the following chars:
1243 1303
1244 CHAR MEANING 1304 CHAR MEANING
1245 (VIA FACES) 1305 (VIA FACES)
1306 f toggle face visualization
1246 t toggle TAB visualization 1307 t toggle TAB visualization
1247 s toggle SPACE and HARD SPACE visualization 1308 s toggle SPACE and HARD SPACE visualization
1248 r toggle trailing blanks visualization 1309 r toggle trailing blanks visualization
@@ -1271,6 +1332,7 @@ Interactively, it reads one of the following chars:
1271Non-interactively, ARG should be a symbol or a list of symbols. 1332Non-interactively, ARG should be a symbol or a list of symbols.
1272The valid symbols are: 1333The valid symbols are:
1273 1334
1335 face toggle face visualization
1274 tabs toggle TAB visualization 1336 tabs toggle TAB visualization
1275 spaces toggle SPACE and HARD SPACE visualization 1337 spaces toggle SPACE and HARD SPACE visualization
1276 trailing toggle trailing blanks visualization 1338 trailing toggle trailing blanks visualization
@@ -1320,6 +1382,7 @@ Interactively, it accepts one of the following chars:
1320 1382
1321 CHAR MEANING 1383 CHAR MEANING
1322 (VIA FACES) 1384 (VIA FACES)
1385 f toggle face visualization
1323 t toggle TAB visualization 1386 t toggle TAB visualization
1324 s toggle SPACE and HARD SPACE visualization 1387 s toggle SPACE and HARD SPACE visualization
1325 r toggle trailing blanks visualization 1388 r toggle trailing blanks visualization
@@ -1348,6 +1411,7 @@ Interactively, it accepts one of the following chars:
1348Non-interactively, ARG should be a symbol or a list of symbols. 1411Non-interactively, ARG should be a symbol or a list of symbols.
1349The valid symbols are: 1412The valid symbols are:
1350 1413
1414 face toggle face visualization
1351 tabs toggle TAB visualization 1415 tabs toggle TAB visualization
1352 spaces toggle SPACE and HARD SPACE visualization 1416 spaces toggle SPACE and HARD SPACE visualization
1353 trailing toggle trailing blanks visualization 1417 trailing toggle trailing blanks visualization
@@ -1463,10 +1527,10 @@ documentation."
1463 (let (overwrite-mode) ; enforce no overwrite 1527 (let (overwrite-mode) ; enforce no overwrite
1464 (goto-char (point-min)) 1528 (goto-char (point-min))
1465 (when (re-search-forward 1529 (when (re-search-forward
1466 whitespace-empty-at-bob-regexp nil t) 1530 (concat "\\`" whitespace-empty-at-bob-regexp) nil t)
1467 (delete-region (match-beginning 1) (match-end 1))) 1531 (delete-region (match-beginning 1) (match-end 1)))
1468 (when (re-search-forward 1532 (when (re-search-forward
1469 whitespace-empty-at-eob-regexp nil t) 1533 (concat whitespace-empty-at-eob-regexp "\\'") nil t)
1470 (delete-region (match-beginning 1) (match-end 1))))))) 1534 (delete-region (match-beginning 1) (match-end 1)))))))
1471 ;; PROBLEM 3: 8 or more SPACEs at bol 1535 ;; PROBLEM 3: 8 or more SPACEs at bol
1472 ;; PROBLEM 4: SPACEs before TAB 1536 ;; PROBLEM 4: SPACEs before TAB
@@ -1877,9 +1941,10 @@ cleaning up these problems."
1877 1941
1878(defconst whitespace-help-text 1942(defconst whitespace-help-text
1879 "\ 1943 "\
1880 Whitespace Toggle Options 1944 Whitespace Toggle Options | scroll up : SPC or > |
1881 1945 | scroll down: M-SPC or < |
1882 FACES 1946 FACES \\__________________________/
1947 [] f - toggle face visualization
1883 [] t - toggle TAB visualization 1948 [] t - toggle TAB visualization
1884 [] s - toggle SPACE and HARD SPACE visualization 1949 [] s - toggle SPACE and HARD SPACE visualization
1885 [] r - toggle trailing blanks visualization 1950 [] r - toggle trailing blanks visualization
@@ -1953,15 +2018,13 @@ cleaning up these problems."
1953 "Display BUFFER in a new window." 2018 "Display BUFFER in a new window."
1954 (goto-char (point-min)) 2019 (goto-char (point-min))
1955 (set-buffer-modified-p nil) 2020 (set-buffer-modified-p nil)
1956 (let ((size (- (window-height) 2021 (when (< (window-height) (* 2 window-min-height))
1957 (max window-min-height 2022 (kill-buffer buffer)
1958 (1+ (count-lines (point-min) 2023 (error "Window height is too small; \
1959 (point-max)))))))
1960 (when (<= size 0)
1961 (kill-buffer buffer)
1962 (error "Frame height is too small; \
1963can't split window to display whitespace toggle options")) 2024can't split window to display whitespace toggle options"))
1964 (set-window-buffer (split-window nil size) buffer))) 2025 (let ((win (split-window)))
2026 (set-window-buffer win buffer)
2027 (shrink-window-if-larger-than-buffer win)))
1965 2028
1966 2029
1967(defun whitespace-kill-buffer (buffer-name) 2030(defun whitespace-kill-buffer (buffer-name)
@@ -1977,6 +2040,24 @@ can't split window to display whitespace toggle options"))
1977 (whitespace-kill-buffer whitespace-help-buffer-name)) 2040 (whitespace-kill-buffer whitespace-help-buffer-name))
1978 2041
1979 2042
2043(defun whitespace-help-scroll (&optional up)
2044 "Scroll help window, if it exists.
2045
2046If UP is non-nil, scroll up; otherwise, scroll down."
2047 (condition-case data-help
2048 (let ((buffer (get-buffer whitespace-help-buffer-name)))
2049 (if buffer
2050 (with-selected-window (get-buffer-window buffer)
2051 (if up
2052 (scroll-up 3)
2053 (scroll-down 3)))
2054 (ding)))
2055 ;; handler
2056 ((error)
2057 ;; just ignore error
2058 )))
2059
2060
1980(defun whitespace-interactive-char (local-p) 2061(defun whitespace-interactive-char (local-p)
1981 "Interactive function to read a char and return a symbol. 2062 "Interactive function to read a char and return a symbol.
1982 2063
@@ -1987,6 +2068,7 @@ It accepts one of the following chars:
1987 2068
1988 CHAR MEANING 2069 CHAR MEANING
1989 (VIA FACES) 2070 (VIA FACES)
2071 f toggle face visualization
1990 t toggle TAB visualization 2072 t toggle TAB visualization
1991 s toggle SPACE and HARD SPACE visualization 2073 s toggle SPACE and HARD SPACE visualization
1992 r toggle trailing blanks visualization 2074 r toggle trailing blanks visualization
@@ -2036,9 +2118,13 @@ See also `whitespace-toggle-option-alist'."
2036 (cdr 2118 (cdr
2037 (assq ch whitespace-toggle-option-alist))))) 2119 (assq ch whitespace-toggle-option-alist)))))
2038 ;; while body 2120 ;; while body
2039 (if (eq ch ?\?) 2121 (cond
2040 (whitespace-help-on style) 2122 ((eq ch ?\?) (whitespace-help-on style))
2041 (ding))) 2123 ((eq ch ?\ ) (whitespace-help-scroll t))
2124 ((eq ch ?\M- ) (whitespace-help-scroll))
2125 ((eq ch ?>) (whitespace-help-scroll t))
2126 ((eq ch ?<) (whitespace-help-scroll))
2127 (t (ding))))
2042 (whitespace-help-off) 2128 (whitespace-help-off)
2043 (message " ")) ; clean echo area 2129 (message " ")) ; clean echo area
2044 ;; handler 2130 ;; handler
@@ -2117,22 +2203,23 @@ resultant list will be returned."
2117 2203
2118(defun whitespace-style-face-p () 2204(defun whitespace-style-face-p ()
2119 "Return t if there is some visualization via face." 2205 "Return t if there is some visualization via face."
2120 (or (memq 'tabs whitespace-active-style) 2206 (and (memq 'face whitespace-active-style)
2121 (memq 'spaces whitespace-active-style) 2207 (or (memq 'tabs whitespace-active-style)
2122 (memq 'trailing whitespace-active-style) 2208 (memq 'spaces whitespace-active-style)
2123 (memq 'lines whitespace-active-style) 2209 (memq 'trailing whitespace-active-style)
2124 (memq 'lines-tail whitespace-active-style) 2210 (memq 'lines whitespace-active-style)
2125 (memq 'newline whitespace-active-style) 2211 (memq 'lines-tail whitespace-active-style)
2126 (memq 'empty whitespace-active-style) 2212 (memq 'newline whitespace-active-style)
2127 (memq 'indentation whitespace-active-style) 2213 (memq 'empty whitespace-active-style)
2128 (memq 'indentation::tab whitespace-active-style) 2214 (memq 'indentation whitespace-active-style)
2129 (memq 'indentation::space whitespace-active-style) 2215 (memq 'indentation::tab whitespace-active-style)
2130 (memq 'space-after-tab whitespace-active-style) 2216 (memq 'indentation::space whitespace-active-style)
2131 (memq 'space-after-tab::tab whitespace-active-style) 2217 (memq 'space-after-tab whitespace-active-style)
2132 (memq 'space-after-tab::space whitespace-active-style) 2218 (memq 'space-after-tab::tab whitespace-active-style)
2133 (memq 'space-before-tab whitespace-active-style) 2219 (memq 'space-after-tab::space whitespace-active-style)
2134 (memq 'space-before-tab::tab whitespace-active-style) 2220 (memq 'space-before-tab whitespace-active-style)
2135 (memq 'space-before-tab::space whitespace-active-style))) 2221 (memq 'space-before-tab::tab whitespace-active-style)
2222 (memq 'space-before-tab::space whitespace-active-style))))
2136 2223
2137 2224
2138(defun whitespace-color-on () 2225(defun whitespace-color-on ()
@@ -2146,8 +2233,15 @@ resultant list will be returned."
2146 (set (make-local-variable 'whitespace-point) 2233 (set (make-local-variable 'whitespace-point)
2147 (point)) 2234 (point))
2148 (set (make-local-variable 'whitespace-font-lock-refontify) 2235 (set (make-local-variable 'whitespace-font-lock-refontify)
2236 0)
2237 (set (make-local-variable 'whitespace-bob-marker)
2238 (point-min-marker))
2239 (set (make-local-variable 'whitespace-eob-marker)
2240 (point-max-marker))
2241 (set (make-local-variable 'whitespace-buffer-changed)
2149 nil) 2242 nil)
2150 (add-hook 'post-command-hook #'whitespace-post-command-hook nil t) 2243 (add-hook 'post-command-hook #'whitespace-post-command-hook nil t)
2244 (add-hook 'before-change-functions #'whitespace-buffer-changed nil t)
2151 ;; turn off font lock 2245 ;; turn off font lock
2152 (set (make-local-variable 'whitespace-font-lock-mode) 2246 (set (make-local-variable 'whitespace-font-lock-mode)
2153 font-lock-mode) 2247 font-lock-mode)
@@ -2158,7 +2252,7 @@ resultant list will be returned."
2158 nil 2252 nil
2159 (list 2253 (list
2160 ;; Show SPACEs 2254 ;; Show SPACEs
2161 (list #'whitespace-space-regexp 1 whitespace-space t) 2255 (list whitespace-space-regexp 1 whitespace-space t)
2162 ;; Show HARD SPACEs 2256 ;; Show HARD SPACEs
2163 (list whitespace-hspace-regexp 1 whitespace-hspace t)) 2257 (list whitespace-hspace-regexp 1 whitespace-hspace t))
2164 t)) 2258 t))
@@ -2167,7 +2261,7 @@ resultant list will be returned."
2167 nil 2261 nil
2168 (list 2262 (list
2169 ;; Show TABs 2263 ;; Show TABs
2170 (list #'whitespace-tab-regexp 1 whitespace-tab t)) 2264 (list whitespace-tab-regexp 1 whitespace-tab t))
2171 t)) 2265 t))
2172 (when (memq 'trailing whitespace-active-style) 2266 (when (memq 'trailing whitespace-active-style)
2173 (font-lock-add-keywords 2267 (font-lock-add-keywords
@@ -2183,14 +2277,16 @@ resultant list will be returned."
2183 (list 2277 (list
2184 ;; Show "long" lines 2278 ;; Show "long" lines
2185 (list 2279 (list
2186 (format 2280 (let ((line-column (or whitespace-line-column fill-column)))
2187 "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$" 2281 (format
2188 whitespace-tab-width (1- whitespace-tab-width) 2282 "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$"
2189 (/ whitespace-line-column whitespace-tab-width) 2283 whitespace-tab-width
2190 (let ((rem (% whitespace-line-column whitespace-tab-width))) 2284 (1- whitespace-tab-width)
2191 (if (zerop rem) 2285 (/ line-column whitespace-tab-width)
2192 "" 2286 (let ((rem (% line-column whitespace-tab-width)))
2193 (format ".\\{%d\\}" rem)))) 2287 (if (zerop rem)
2288 ""
2289 (format ".\\{%d\\}" rem)))))
2194 (if (memq 'lines whitespace-active-style) 2290 (if (memq 'lines whitespace-active-style)
2195 0 ; whole line 2291 0 ; whole line
2196 2) ; line tail 2292 2) ; line tail
@@ -2296,7 +2392,8 @@ resultant list will be returned."
2296 ;; turn off font lock 2392 ;; turn off font lock
2297 (when (whitespace-style-face-p) 2393 (when (whitespace-style-face-p)
2298 (font-lock-mode 0) 2394 (font-lock-mode 0)
2299 (remove-hook 'post-command-hook #'whitespace-post-command-hook) 2395 (remove-hook 'post-command-hook #'whitespace-post-command-hook t)
2396 (remove-hook 'before-change-functions #'whitespace-buffer-changed t)
2300 (when whitespace-font-lock 2397 (when whitespace-font-lock
2301 (setq whitespace-font-lock nil 2398 (setq whitespace-font-lock nil
2302 font-lock-keywords whitespace-font-lock-keywords)) 2399 font-lock-keywords whitespace-font-lock-keywords))
@@ -2317,37 +2414,128 @@ resultant list will be returned."
2317(defun whitespace-empty-at-bob-regexp (limit) 2414(defun whitespace-empty-at-bob-regexp (limit)
2318 "Match spaces at beginning of buffer which do not contain the point at \ 2415 "Match spaces at beginning of buffer which do not contain the point at \
2319beginning of buffer." 2416beginning of buffer."
2320 (and (/= whitespace-point 1) 2417 (let ((b (point))
2321 (re-search-forward whitespace-empty-at-bob-regexp limit t))) 2418 r)
2419 (cond
2420 ;; at bob
2421 ((= b 1)
2422 (setq r (and (/= whitespace-point 1)
2423 (looking-at whitespace-empty-at-bob-regexp)))
2424 (if r
2425 (set-marker whitespace-bob-marker (match-end 1))
2426 (set-marker whitespace-bob-marker b)))
2427 ;; inside bob empty region
2428 ((<= limit whitespace-bob-marker)
2429 (setq r (looking-at whitespace-empty-at-bob-regexp))
2430 (if r
2431 (when (< (match-end 1) limit)
2432 (set-marker whitespace-bob-marker (match-end 1)))
2433 (set-marker whitespace-bob-marker b)))
2434 ;; intersection with end of bob empty region
2435 ((<= b whitespace-bob-marker)
2436 (setq r (looking-at whitespace-empty-at-bob-regexp))
2437 (if r
2438 (set-marker whitespace-bob-marker (match-end 1))
2439 (set-marker whitespace-bob-marker b)))
2440 ;; it is not inside bob empty region
2441 (t
2442 (setq r nil)))
2443 ;; move to end of matching
2444 (and r (goto-char (match-end 1)))
2445 r))
2446
2447
2448(defsubst whitespace-looking-back (regexp limit)
2449 (save-excursion
2450 (when (/= 0 (skip-chars-backward " \t\n" limit))
2451 (unless (bolp)
2452 (forward-line 1))
2453 (looking-at regexp))))
2322 2454
2323 2455
2324(defun whitespace-empty-at-eob-regexp (limit) 2456(defun whitespace-empty-at-eob-regexp (limit)
2325 "Match spaces at end of buffer which do not contain the point at end of \ 2457 "Match spaces at end of buffer which do not contain the point at end of \
2326buffer." 2458buffer."
2327 (and (/= whitespace-point (1+ (buffer-size))) 2459 (let ((b (point))
2328 (re-search-forward whitespace-empty-at-eob-regexp limit t))) 2460 (e (1+ (buffer-size)))
2329 2461 r)
2330 2462 (cond
2331(defun whitespace-space-regexp (limit) 2463 ;; at eob
2332 "Match spaces." 2464 ((= limit e)
2333 (setq whitespace-font-lock-refontify t) 2465 (when (/= whitespace-point e)
2334 (re-search-forward whitespace-space-regexp limit t)) 2466 (goto-char limit)
2335 2467 (setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b)))
2336 2468 (if r
2337(defun whitespace-tab-regexp (limit) 2469 (set-marker whitespace-eob-marker (match-beginning 1))
2338 "Match tabs." 2470 (set-marker whitespace-eob-marker limit)
2339 (setq whitespace-font-lock-refontify t) 2471 (goto-char b))) ; return back to initial position
2340 (re-search-forward whitespace-tab-regexp limit t)) 2472 ;; inside eob empty region
2473 ((>= b whitespace-eob-marker)
2474 (goto-char limit)
2475 (setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b))
2476 (if r
2477 (when (> (match-beginning 1) b)
2478 (set-marker whitespace-eob-marker (match-beginning 1)))
2479 (set-marker whitespace-eob-marker limit)
2480 (goto-char b))) ; return back to initial position
2481 ;; intersection with beginning of eob empty region
2482 ((>= limit whitespace-eob-marker)
2483 (goto-char limit)
2484 (setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b))
2485 (if r
2486 (set-marker whitespace-eob-marker (match-beginning 1))
2487 (set-marker whitespace-eob-marker limit)
2488 (goto-char b))) ; return back to initial position
2489 ;; it is not inside eob empty region
2490 (t
2491 (setq r nil)))
2492 r))
2493
2494
2495(defun whitespace-buffer-changed (beg end)
2496 "Set `whitespace-buffer-changed' variable to t."
2497 (setq whitespace-buffer-changed t))
2341 2498
2342 2499
2343(defun whitespace-post-command-hook () 2500(defun whitespace-post-command-hook ()
2344 "Save current point into `whitespace-point' variable. 2501 "Save current point into `whitespace-point' variable.
2345Also refontify when necessary." 2502Also refontify when necessary."
2346 (setq whitespace-point (point)) 2503 (setq whitespace-point (point)) ; current point position
2347 (let ((refontify (or (eolp) ; end of line 2504 (let ((refontify
2348 (= whitespace-point 1)))) ; beginning of buffer 2505 (or
2349 (when (or whitespace-font-lock-refontify refontify) 2506 ;; it is at end of line ...
2350 (setq whitespace-font-lock-refontify refontify) 2507 (and (eolp)
2508 ;; ... with trailing SPACE or TAB
2509 (or (= (preceding-char) ?\ )
2510 (= (preceding-char) ?\t)))
2511 ;; it is at beginning of buffer (bob)
2512 (= whitespace-point 1)
2513 ;; the buffer was modified and ...
2514 (and whitespace-buffer-changed
2515 (or
2516 ;; ... or inside bob whitespace region
2517 (<= whitespace-point whitespace-bob-marker)
2518 ;; ... or at bob whitespace region border
2519 (and (= whitespace-point (1+ whitespace-bob-marker))
2520 (= (preceding-char) ?\n))))
2521 ;; it is at end of buffer (eob)
2522 (= whitespace-point (1+ (buffer-size)))
2523 ;; the buffer was modified and ...
2524 (and whitespace-buffer-changed
2525 (or
2526 ;; ... or inside eob whitespace region
2527 (>= whitespace-point whitespace-eob-marker)
2528 ;; ... or at eob whitespace region border
2529 (and (= whitespace-point (1- whitespace-eob-marker))
2530 (= (following-char) ?\n)))))))
2531 (when (or refontify (> whitespace-font-lock-refontify 0))
2532 (setq whitespace-buffer-changed nil)
2533 ;; adjust refontify counter
2534 (setq whitespace-font-lock-refontify
2535 (if refontify
2536 1
2537 (1- whitespace-font-lock-refontify)))
2538 ;; refontify
2351 (jit-lock-refontify)))) 2539 (jit-lock-refontify))))
2352 2540
2353 2541
@@ -2386,11 +2574,11 @@ Also refontify when necessary."
2386 (unless whitespace-display-table-was-local 2574 (unless whitespace-display-table-was-local
2387 (setq whitespace-display-table-was-local t 2575 (setq whitespace-display-table-was-local t
2388 whitespace-display-table 2576 whitespace-display-table
2577 (copy-sequence buffer-display-table))
2578 ;; asure `buffer-display-table' is unique
2579 ;; when two or more windows are visible.
2580 (setq buffer-display-table
2389 (copy-sequence buffer-display-table))) 2581 (copy-sequence buffer-display-table)))
2390 ;; asure `buffer-display-table' is unique
2391 ;; when two or more windows are visible.
2392 (set (make-local-variable 'buffer-display-table)
2393 (copy-sequence buffer-display-table))
2394 (unless buffer-display-table 2582 (unless buffer-display-table
2395 (setq buffer-display-table (make-display-table))) 2583 (setq buffer-display-table (make-display-table)))
2396 (dolist (entry whitespace-display-mappings) 2584 (dolist (entry whitespace-display-mappings)
diff --git a/lisp/woman.el b/lisp/woman.el
index 291ebcee740..1a9d512d302 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -3388,7 +3388,10 @@ Format paragraphs upto TO. Supports special chars.
3388 "Translate up to marker TO. Do this last of all transformations." 3388 "Translate up to marker TO. Do this last of all transformations."
3389 (if translations 3389 (if translations
3390 (let ((matches (car translations)) 3390 (let ((matches (car translations))
3391 (alist (cdr translations))) 3391 (alist (cdr translations))
3392 ;; Translations are case-sensitive, eg ".tr ab" does not
3393 ;; affect "A" (bug#6849).
3394 (case-fold-search nil))
3392 (while (re-search-forward matches to t) 3395 (while (re-search-forward matches to t)
3393 ;; Done like this to retain text properties and 3396 ;; Done like this to retain text properties and
3394 ;; support translation of special characters: 3397 ;; support translation of special characters:
diff --git a/msdos/ChangeLog b/msdos/ChangeLog
index 7df89880410..c4c7981e907 100644
--- a/msdos/ChangeLog
+++ b/msdos/ChangeLog
@@ -1,3 +1,11 @@
12010-08-20 Eli Zaretskii <eliz@gnu.org>
2
3 * sed1v2.inp (IMAGEMAGICK_LIBS, IMAGEMAGICK_CFLAGS): Edit to empty.
4
52010-08-15 Eli Zaretskii <eliz@gnu.org>
6
7 * mainmake.v2 (version): Update due to change in emacs.c.
8
12010-08-05 Eli Zaretskii <eliz@gnu.org> 92010-08-05 Eli Zaretskii <eliz@gnu.org>
2 10
3 * sed1v2.inp (UNEXEC_OBJ): Edit to unexcoff.o, due to renaming of 11 * sed1v2.inp (UNEXEC_OBJ): Edit to unexcoff.o, due to renaming of
diff --git a/msdos/mainmake.v2 b/msdos/mainmake.v2
index 4bb13e367ed..79bd827d8c6 100644
--- a/msdos/mainmake.v2
+++ b/msdos/mainmake.v2
@@ -65,7 +65,7 @@ MAKESHELL=/xyzzy/command
65top_srcdir := $(subst \,/,$(shell cd)) 65top_srcdir := $(subst \,/,$(shell cd))
66 66
67# Find out which version of Emacs this is. 67# Find out which version of Emacs this is.
68version := ${shell sed -n -e '/^const char emacs_version/s/^[^"]*\("[^"]*"\).*/\1/p' src/emacs.c} 68version := ${shell sed -n -e '/^static const char emacs_version/s/^[^"]*\("[^"]*"\).*/\1/p' src/emacs.c}
69 69
70# Q: Do we need to bootstrap? 70# Q: Do we need to bootstrap?
71# A: Only if we find admin/admin.el, i.e. we are building out of 71# A: Only if we find admin/admin.el, i.e. we are building out of
diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp
index 4be1bccefdf..e9dfc9dea3d 100644
--- a/msdos/sed1v2.inp
+++ b/msdos/sed1v2.inp
@@ -88,6 +88,8 @@ s/\.h\.in/.h-in/
88/^CFLAGS_SOUND *=/s/@CFLAGS_SOUND@// 88/^CFLAGS_SOUND *=/s/@CFLAGS_SOUND@//
89/^RSVG_LIBS *=/s/@RSVG_LIBS@// 89/^RSVG_LIBS *=/s/@RSVG_LIBS@//
90/^RSVG_CFLAGS *=/s/@RSVG_CFLAGS@// 90/^RSVG_CFLAGS *=/s/@RSVG_CFLAGS@//
91/^IMAGEMAGICK_LIBS *=/s/@IMAGEMAGICK_LIBS@//
92/^IMAGEMAGICK_CFLAGS *=/s/@IMAGEMAGICK_CFLAGS@//
91/^WIDGET_OBJ *=/s/@WIDGET_OBJ@// 93/^WIDGET_OBJ *=/s/@WIDGET_OBJ@//
92/^CYGWIN_OBJ *=/s/@CYGWIN_OBJ@// 94/^CYGWIN_OBJ *=/s/@CYGWIN_OBJ@//
93/^MSDOS_OBJ *=/s/= */= dosfns.o msdos.o w16select.o/ 95/^MSDOS_OBJ *=/s/= */= dosfns.o msdos.o w16select.o/
diff --git a/msdos/sedleim.inp b/msdos/sedleim.inp
index 20da3e64ae5..b5193e665a7 100644
--- a/msdos/sedleim.inp
+++ b/msdos/sedleim.inp
@@ -34,7 +34,7 @@ s|\([ ]\)echo|\1djecho|g
34 34
35/RUN-EMACS *=/,/^$/c\ 35/RUN-EMACS *=/,/^$/c\
36export EMACSLOADPATH=${buildlisppath}\ 36export EMACSLOADPATH=${buildlisppath}\
37RUN-EMACS = ${BUILT-EMACS} -batch --no-init-file --no-site-file --multibyte 37RUN-EMACS = ${BUILT-EMACS} -batch --no-init-file --no-site-file
38 38
39/^ cd ../c\ 39/^ cd ../c\
40 ${MAKE} -C ../src ${MFLAGS} emacs 40 ${MAKE} -C ../src ${MFLAGS} emacs
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 07550e1b2d2..05f01767bd3 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,7 @@
12010-08-19 Juanma Barranquero <lekktu@gmail.com>
2
3 * addpm.c (add_registry): Create App Paths of type REG_EXPAND_SZ.
4
12010-08-12 Jason Rumney <jasonr@gnu.org> 52010-08-12 Jason Rumney <jasonr@gnu.org>
2 6
3 * addpm.c (add_registry): Set path for runemacs.exe to use. 7 * addpm.c (add_registry): Set path for runemacs.exe to use.
diff --git a/nt/addpm.c b/nt/addpm.c
index 4fcebe2ca14..de09fd5382c 100644
--- a/nt/addpm.c
+++ b/nt/addpm.c
@@ -113,7 +113,7 @@ add_registry (char *path)
113 emacs_path = (char *) alloca (len); 113 emacs_path = (char *) alloca (len);
114 sprintf (emacs_path, "%s\\bin\\emacs.exe", path); 114 sprintf (emacs_path, "%s\\bin\\emacs.exe", path);
115 115
116 RegSetValueEx (hrootkey, NULL, 0, REG_SZ, emacs_path, len); 116 RegSetValueEx (hrootkey, NULL, 0, REG_EXPAND_SZ, emacs_path, len);
117 117
118 /* Look for a GTK installation. If found, add it to the library search 118 /* Look for a GTK installation. If found, add it to the library search
119 path for Emacs so that the image libraries it provides are available 119 path for Emacs so that the image libraries it provides are available
@@ -135,7 +135,8 @@ add_registry (char *path)
135 len = strlen (path) + 5 + size; 135 len = strlen (path) + 5 + size;
136 dll_paths = (char *) alloca (size + strlen (path) + 1); 136 dll_paths = (char *) alloca (size + strlen (path) + 1);
137 sprintf (dll_paths, "%s\\bin;%s", path, gtk_path); 137 sprintf (dll_paths, "%s\\bin;%s", path, gtk_path);
138 RegSetValueEx (hrootkey, "Path", 0, REG_SZ, dll_paths, len); 138 RegSetValueEx (hrootkey, "Path", 0, REG_EXPAND_SZ,
139 dll_paths, len);
139 140
140 /* Set the same path for runemacs.exe, as the Explorer shell 141 /* Set the same path for runemacs.exe, as the Explorer shell
141 looks this up, so the above does not take effect when 142 looks this up, so the above does not take effect when
@@ -145,7 +146,7 @@ add_registry (char *path)
145 KEY_WRITE, NULL, &runemacs_key, NULL) 146 KEY_WRITE, NULL, &runemacs_key, NULL)
146 == ERROR_SUCCESS) 147 == ERROR_SUCCESS)
147 { 148 {
148 RegSetValueEx (runemacs_key, "Path", 0, REG_SZ, 149 RegSetValueEx (runemacs_key, "Path", 0, REG_EXPAND_SZ,
149 dll_paths, len); 150 dll_paths, len);
150 151
151 RegCloseKey (runemacs_key); 152 RegCloseKey (runemacs_key);
diff --git a/src/ChangeLog b/src/ChangeLog
index 0a1a268d962..5ce4c049c77 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,186 @@
12010-08-25 Kenichi Handa <handa@m17n.org>
2
3 * composite.c (composition_compute_stop_pos): Don't break
4 composition at PT.
5 (composition_reseat_it): Likewise. Fix calculation of character
6 position starting a composition.
7 (Fcomposition_get_gstring): Don't limit the number of components
8 for automatic composition.
9
102010-08-25 Kenichi Handa <handa@m17n.org>
11
12 * composite.c (composition_compute_stop_pos): In forward search,
13 pay attention to the possibility that some character after ENDPOS
14 will be composed with charactrs before ENDPOS.
15
162010-08-24 Chong Yidong <cyd@stupidchicken.com>
17
18 * keyboard.c (command_loop_1): Don't clobber primary selection
19 during handle-switch-frame (Bug#6872).
20
212010-08-23 Michael Albinus <michael.albinus@gmx.de>
22
23 * dbusbind.c: Accept UNIX domain sockets as bus address.
24 (Fdbus_close_bus): New function.
25 (Vdbus_registered_buses): New variable.
26 (xd_initialize): Implement string as bus address.
27 (Fdbus_init_bus): Add bus to Vdbus_registered_buses).
28 (Fdbus_get_unique_name, Fdbus_call_method)
29 (Fdbus_call_method_asynchronously, Fdbus_method_return_internal)
30 (Fdbus_method_error_internal, Fdbus_send_signal)
31 (Fdbus_register_signal, Fdbus_register_method): Remove bus type
32 check. This is done in xd_initialize_bus. Adapt doc string, if
33 necessary.
34 (xd_pending_messages, xd_read_queued_messages): Loop over buses in
35 Vdbus_registered_buses.
36 (Vdbus_registered_objects_table): Create hash.
37
382010-08-22 Juri Linkov <juri@jurta.org>
39
40 * keyboard.c (Fexecute_extended_command): Move reading a command name
41 with `completing-read' to a new Elisp function `read-extended-command'.
42 Call it to read a command to `function' (bug#5364, bug#5214).
43
442010-08-22 Chong Yidong <cyd@stupidchicken.com>
45
46 * emacs.c (main): Remove handling of --unibyte arg (Bug#6886).
47
482010-08-22 Andreas Schwab <schwab@linux-m68k.org>
49
50 * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA_LISP
51 instead of SAFE_ALLOCA.
52
532010-08-22 Chong Yidong <cyd@stupidchicken.com>
54
55 * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA
56 (Bug#6214).
57
582010-08-22 Jan Djärv <jan.h.d@swipnet.se>
59
60 * doc.c (Fsnarf_documentation): Set skip_file only if p[1] is S.
61
622010-08-22 Jan Djärv <jan.h.d@swipnet.se>
63
64 * doc.c (Fsnarf_documentation): Initialize skip_file before
65 build-files test.
66
672010-08-22 Peter O'Gorman <pogma@thewrittenword.com> (tiny change)
68
69 * s/hpux10-20.h (HAVE_TERMIOS, NO_TERMIO, ORDINARY_LINK):
70 New definitions.
71 (HAVE_TERMIO): Remove.
72
732010-08-22 Eli Zaretskii <eliz@gnu.org>
74
75 * deps.mk (sysdep.o, msdos.o): Depend on sysselect.h.
76
77 * sysselect.h [WINDOWSNT]: Don't define the FD_* and select stuff
78 for w32.
79
80 * s/ms-w32.h (HAVE_SYS_TIMEB_H): Don't #undef HAVE_SYS_SELECT_H,
81 it's done in nt/config.nt.
82
83 * makefile.w32-in ($(BLD)/sysdep.$(O)): Depend on sysselect.h.
84
85 * unexcoff.c (report_error, make_hdr, write_segment)
86 (copy_text_and_data, copy_sym, mark_x, adjust_lnnoptrs, unexec):
87 Convert argument lists and prototypes to ANSI C.
88 (make_hdr, write_segment): Remove unused variables.
89 (unexec): Remove commented-out line. Initialize `new' to shut up
90 compiler warnings.
91
922010-08-22 Dan Nicolaescu <dann@ics.uci.edu>
93
94 Simplify termio code.
95 All non-MSDOS non-WINDOWSNT platforms define HAVE_TERMIOS, so
96 HAVE_TERMIO code is obsolete.
97 Replace HAVE_TERMIOS conditionals with !DOS_NT.
98 * systty.h: Do not define HAVE_TCATTR.
99 Remove HAVE_TERMIO, HAVE_LTCHARS and HAVE_TCHARS code.
100 Do not define EMACS_HAVE_TTY_PGRP. Only define
101 EMACS_GET_TTY_PGRP for !DOS_NT.
102 * sysdep.c: Include sysselect.h unconditionally. Do not include
103 sys/ioctl.h and termios.h, systty.h does it. Use
104 HAVE_SYS_UTSNAME_H instead of USG as an include guard.
105 (init_baud_rate): Remove HAVE_TERMIO code.
106 (child_setup_tty): Remove HAVE_TERMIO code.
107 (emacs_get_tty, emacs_set_tty): Remove HAVE_TERMIO, HAVE_TCHARS
108 and HAVE_LTCHARS code. Use !DOS_NT instead of HAVE_TCATTR.
109 (new_ltchars, new_tchars): Remove, unused.
110 (init_sys_modes): Remove HAVE_TERMIO, HAVE_TCHARS and HAVE_LTCHARS
111 code. Remove special casing for __mips__, it was a no-op. Remove
112 HAVE_TCATTR conditional, it is implied by HAVE_TERMIOS.
113 (init_sys_modes): Remove HPUX special case.
114 * process.c: Include stdlib.h unconditionally. Do not include
115 fcntl.h, systty.h does it. Remove conditional code for
116 HAVE_SERIAL, it is always true.
117 (process_send_signal): Remove HAVE_TERMIOS conditional, it's
118 always true when SIGNALS_VIA_CHARACTERS is true.
119 (Fcontinue_process, Fprocess_send_eof): Simplify conditionals:
120 !WINDOWSNT means HAVE_TERMIOS.
121 (create_process): Remove HAVE_TERMIOS, it's inside a HAVE_PTYS
122 conditional, which is true for all HAVE_TERMIOS systems.
123 * keyboard.c (init_keyboard): Do not use HAVE_TERMIO, use !DOS_NT
124 instead of HAVE_TERMIOS.
125 * emacs.c (shut_down_emacs): Use !defined DOS_NT instead of
126 EMACS_HAVE_TTY_PGRP.
127 * callproc.c (child_setup): Move EMACS_SET_TTY_PGRP use to the
128 non-MSDOS, non-WINDOWSNT code, it's only defined for such systems
129 anyway.
130
1312010-08-21 Eli Zaretskii <eliz@gnu.org>
132
133 * dispnew.c (buffer_posn_from_coords): Fix off-by-one error in
134 mirroring pixel positions.
135
1362010-08-20 Dan Nicolaescu <dann@ics.uci.edu>
137
138 * alloc.c (malloc_sbrk_used, malloc_sbrk_unused): Remove,
139 write only.
140 (init_alloc_once): Remove writes to malloc_sbrk_unused, and
141 malloc_sbrk_used, nothing uses them.
142
143 * puresize.h: Remove code assuming PNTR_COMPARISON_TYPE is not
144 defined, unconditionally defined in lisp.h.
145
146 * term.c: Do not include <termios.h>, systty.h does it.
147
148 * s/unixware.h (HAVE_TCATTR):
149 * s/aix4-2.h (HAVE_TCATTR): Remove definitions, not needed.
150 systty.h defines it when HAVE_TERMIOS is defined.
151
1522010-08-20 Eli Zaretskii <eliz@gnu.org>
153
154 * dispnew.c (buffer_posn_from_coords): Fix last change for text
155 terminals: add one-character offset for R2L lines.
156
157 * emacs.c <emacs_version>: Add a comment regarding
158 msdos/mainmake.v2's dependency on the syntax of this declaration.
159
1602010-08-20 Eli Zaretskii <eliz@gnu.org>
161
162 * dispnew.c (buffer_posn_from_coords): Fix calculation of buffer
163 position for R2L lines by mirroring the pixel position wrt the
164 text are box. Improve commentary.
165
1662010-08-20 Andreas Schwab <schwab@linux-m68k.org>
167
168 * image.c (imagemagick_clear_image): Remove debugging output.
169
1702010-08-19 Stefan Monnier <monnier@iro.umontreal.ca>
171
172 * cmds.c (Vself_insert_face, Vself_insert_face_command): Remove.
173 (Qpost_self_insert_hook, Vpost_self_insert_hook): New vars.
174 (internal_self_insert): Run Qpost_self_insert_hook rather than handle
175 self-insert-face.
176 (syms_of_cmds): Initialize the new vars.
177
1782010-08-19 Jason Rumney <jasonr@gnu.org>
179
180 * w32menu.c (set_frame_menubar): Remove call to undefined function.
181
182 * w32fns.c (w32_wnd_proc): Don't check context before initializing.
183
12010-08-19 Jan Djärv <jan.h.d@swipnet.se> 1842010-08-19 Jan Djärv <jan.h.d@swipnet.se>
2 185
3 * nsselect.m (nxatoms_of_nsselect): Use "Selection" and "Secondary". 186 * nsselect.m (nxatoms_of_nsselect): Use "Selection" and "Secondary".
@@ -33,6 +216,17 @@
33 NXSecondaryPboard = SecondarySelection. 216 NXSecondaryPboard = SecondarySelection.
34 (syms_of_nsselect): Intern QCLIPBOARD (Bug#6677). 217 (syms_of_nsselect): Intern QCLIPBOARD (Bug#6677).
35 218
2192010-08-18 Joakim Verona <joakim@verona.se>
220
221 * image.c: Add support for ImageMagick. When HAVE_IMAGEMAGICK is
222 defined:
223 (imagemagick_image_p): New function to test for ImageMagic image.
224 (imagemagick_load): New function to load ImageMagick image.
225 (imagemagick_load_image): New function, helper for imagemagick_load.
226 (imagemagick-types): New function.
227 (Qimagemagick): New Lisp_object.
228 (imagemagick-render-type): New variable, decides which renderer to use.
229
362010-08-17 Stefan Monnier <monnier@iro.umontreal.ca> 2302010-08-17 Stefan Monnier <monnier@iro.umontreal.ca>
37 231
38 * gtkutil.c (update_frame_tool_bar): Don't assume TOOL_BAR_ITEM_LABEL 232 * gtkutil.c (update_frame_tool_bar): Don't assume TOOL_BAR_ITEM_LABEL
@@ -329,10 +523,10 @@
329 523
3302010-08-08 Kenichi Handa <handa@m17n.org> 5242010-08-08 Kenichi Handa <handa@m17n.org>
331 525
332 * charset.c: Include <stdlib.h> 526 * charset.c: Include <stdlib.h>.
333 (struct charset_sort_data): New struct. 527 (struct charset_sort_data): New struct.
334 (charset_compare): New function. 528 (charset_compare): New function.
335 (Fsort_charsets): New funciton. 529 (Fsort_charsets): New function.
336 (syms_of_charset): Declare Fsort_charsets as a Lisp function. 530 (syms_of_charset): Declare Fsort_charsets as a Lisp function.
337 531
338 * coding.c (decode_coding_iso_2022): Fix checking of dimension 532 * coding.c (decode_coding_iso_2022): Fix checking of dimension
diff --git a/src/Makefile.in b/src/Makefile.in
index a8d400c7c39..9ee5631ef70 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,3 +1,4 @@
1
1# Makefile for GNU Emacs. 2# Makefile for GNU Emacs.
2# Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 3# Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
3# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 4# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
@@ -222,6 +223,10 @@ CFLAGS_SOUND= @CFLAGS_SOUND@
222RSVG_LIBS= @RSVG_LIBS@ 223RSVG_LIBS= @RSVG_LIBS@
223RSVG_CFLAGS= @RSVG_CFLAGS@ 224RSVG_CFLAGS= @RSVG_CFLAGS@
224 225
226IMAGEMAGICK_LIBS= @IMAGEMAGICK_LIBS@
227IMAGEMAGICK_CFLAGS= @IMAGEMAGICK_CFLAGS@
228
229
225## widget.o if USE_X_TOOLKIT, otherwise empty. 230## widget.o if USE_X_TOOLKIT, otherwise empty.
226WIDGET_OBJ=@WIDGET_OBJ@ 231WIDGET_OBJ=@WIDGET_OBJ@
227 232
@@ -315,7 +320,7 @@ MKDEPDIR=@MKDEPDIR@
315## FIXME? MYCPPFLAGS only referenced in etc/DEBUG. 320## FIXME? MYCPPFLAGS only referenced in etc/DEBUG.
316ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} \ 321ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} \
317 ${C_SWITCH_MACHINE} ${C_SWITCH_SYSTEM} ${C_SWITCH_X_SITE} \ 322 ${C_SWITCH_MACHINE} ${C_SWITCH_SYSTEM} ${C_SWITCH_X_SITE} \
318 ${C_SWITCH_X_SYSTEM} ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} \ 323 ${C_SWITCH_X_SYSTEM} ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${IMAGEMAGICK_CFLAGS} ${DBUS_CFLAGS} \
319 ${GCONF_CFLAGS} ${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS} \ 324 ${GCONF_CFLAGS} ${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS} \
320 ${LIBOTF_CFLAGS} ${M17N_FLT_CFLAGS} ${DEPFLAGS} ${PROFILING_CFLAGS} \ 325 ${LIBOTF_CFLAGS} ${M17N_FLT_CFLAGS} ${DEPFLAGS} ${PROFILING_CFLAGS} \
321 ${C_WARNINGS_SWITCH} ${CFLAGS} 326 ${C_WARNINGS_SWITCH} ${CFLAGS}
@@ -590,7 +595,7 @@ SOME_MACHINE_LISP = ../lisp/mouse.elc \
590## duplicated symbols. If the standard libraries were compiled 595## duplicated symbols. If the standard libraries were compiled
591## with GCC, we might need LIB_GCC again after them. 596## with GCC, we might need LIB_GCC again after them.
592LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \ 597LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \
593 $(RSVG_LIBS) $(DBUS_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ 598 $(RSVG_LIBS) ${IMAGEMAGICK_LIBS} $(DBUS_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \
594 $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) ${GCONF_LIBS} ${LIBSELINUX_LIBS} \ 599 $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) ${GCONF_LIBS} ${LIBSELINUX_LIBS} \
595 $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ 600 $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
596 $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC) 601 $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC)
diff --git a/src/alloc.c b/src/alloc.c
index 473c5622ab3..1f615a7d505 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -214,16 +214,6 @@ int abort_on_gc;
214 214
215int garbage_collection_messages; 215int garbage_collection_messages;
216 216
217#ifndef VIRT_ADDR_VARIES
218extern
219#endif /* VIRT_ADDR_VARIES */
220int malloc_sbrk_used;
221
222#ifndef VIRT_ADDR_VARIES
223extern
224#endif /* VIRT_ADDR_VARIES */
225int malloc_sbrk_unused;
226
227/* Number of live and free conses etc. */ 217/* Number of live and free conses etc. */
228 218
229static int total_conses, total_markers, total_symbols, total_vector_size; 219static int total_conses, total_markers, total_symbols, total_vector_size;
@@ -6178,11 +6168,6 @@ init_alloc_once (void)
6178 consing_since_gc = 0; 6168 consing_since_gc = 0;
6179 gc_cons_threshold = 100000 * sizeof (Lisp_Object); 6169 gc_cons_threshold = 100000 * sizeof (Lisp_Object);
6180 gc_relative_threshold = 0; 6170 gc_relative_threshold = 0;
6181
6182#ifdef VIRT_ADDR_VARIES
6183 malloc_sbrk_unused = 1<<22; /* A large number */
6184 malloc_sbrk_used = 100000; /* as reasonable as any number */
6185#endif /* VIRT_ADDR_VARIES */
6186} 6171}
6187 6172
6188void 6173void
diff --git a/src/callproc.c b/src/callproc.c
index de28ffa42ef..8c1384df6a1 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1231,8 +1231,6 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
1231#else 1231#else
1232 setpgrp (pid, pid); 1232 setpgrp (pid, pid);
1233#endif /* USG */ 1233#endif /* USG */
1234 /* setpgrp_of_tty is incorrect here; it uses input_fd. */
1235 EMACS_SET_TTY_PGRP (0, &pid);
1236 1234
1237#ifdef MSDOS 1235#ifdef MSDOS
1238 pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env); 1236 pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env);
@@ -1251,6 +1249,9 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
1251 report_file_error ("Spawning child process", Qnil); 1249 report_file_error ("Spawning child process", Qnil);
1252 return cpid; 1250 return cpid;
1253#else /* not WINDOWSNT */ 1251#else /* not WINDOWSNT */
1252 /* setpgrp_of_tty is incorrect here; it uses input_fd. */
1253 EMACS_SET_TTY_PGRP (0, &pid);
1254
1254 /* execvp does not accept an environment arg so the only way 1255 /* execvp does not accept an environment arg so the only way
1255 to pass this environment is to set environ. Our caller 1256 to pass this environment is to set environ. Our caller
1256 is responsible for restoring the ambient value of environ. */ 1257 is responsible for restoring the ambient value of environ. */
diff --git a/src/cmds.c b/src/cmds.c
index 4cb6ca199e7..f306ede7ca5 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -37,12 +37,6 @@ Lisp_Object Qkill_forward_chars, Qkill_backward_chars, Vblink_paren_function;
37/* A possible value for a buffer's overwrite-mode variable. */ 37/* A possible value for a buffer's overwrite-mode variable. */
38Lisp_Object Qoverwrite_mode_binary; 38Lisp_Object Qoverwrite_mode_binary;
39 39
40/* Non-nil means put this face on the next self-inserting character. */
41Lisp_Object Vself_insert_face;
42
43/* This is the command that set up Vself_insert_face. */
44Lisp_Object Vself_insert_face_command;
45
46static int internal_self_insert (int, int); 40static int internal_self_insert (int, int);
47 41
48DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, 42DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0,
@@ -346,6 +340,7 @@ After insertion, the value of `auto-fill-function' is called if the
346 A value of 2 means this did things that call for an undo boundary. */ 340 A value of 2 means this did things that call for an undo boundary. */
347 341
348static Lisp_Object Qexpand_abbrev; 342static Lisp_Object Qexpand_abbrev;
343static Lisp_Object Qpost_self_insert_hook, Vpost_self_insert_hook;
349 344
350static int 345static int
351internal_self_insert (int c, int noautofill) 346internal_self_insert (int c, int noautofill)
@@ -451,10 +446,10 @@ internal_self_insert (int c, int noautofill)
451 && synt != Sword 446 && synt != Sword
452 && NILP (current_buffer->read_only) 447 && NILP (current_buffer->read_only)
453 && PT > BEGV 448 && PT > BEGV
454 && (!NILP (current_buffer->enable_multibyte_characters) 449 && (SYNTAX (!NILP (current_buffer->enable_multibyte_characters)
455 ? SYNTAX (XFASTINT (Fprevious_char ())) == Sword 450 ? XFASTINT (Fprevious_char ())
456 : (SYNTAX (UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ()))) 451 : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ())))
457 == Sword))) 452 == Sword))
458 { 453 {
459 int modiff = MODIFF; 454 int modiff = MODIFF;
460 Lisp_Object sym; 455 Lisp_Object sym;
@@ -514,15 +509,6 @@ internal_self_insert (int c, int noautofill)
514 hairy = 2; 509 hairy = 2;
515 } 510 }
516 511
517 /* If previous command specified a face to use, use it. */
518 if (!NILP (Vself_insert_face)
519 && EQ (current_kboard->Vlast_command, Vself_insert_face_command))
520 {
521 Fput_text_property (make_number (PT - 1), make_number (PT),
522 Qface, Vself_insert_face, Qnil);
523 Vself_insert_face = Qnil;
524 }
525
526 if ((synt == Sclose || synt == Smath) 512 if ((synt == Sclose || synt == Smath)
527 && !NILP (Vblink_paren_function) && INTERACTIVE 513 && !NILP (Vblink_paren_function) && INTERACTIVE
528 && !noautofill) 514 && !noautofill)
@@ -530,6 +516,9 @@ internal_self_insert (int c, int noautofill)
530 call0 (Vblink_paren_function); 516 call0 (Vblink_paren_function);
531 hairy = 2; 517 hairy = 2;
532 } 518 }
519 /* Run hooks for electric keys. */
520 call1 (Vrun_hooks, Qpost_self_insert_hook);
521
533 return hairy; 522 return hairy;
534} 523}
535 524
@@ -550,15 +539,13 @@ syms_of_cmds (void)
550 Qexpand_abbrev = intern_c_string ("expand-abbrev"); 539 Qexpand_abbrev = intern_c_string ("expand-abbrev");
551 staticpro (&Qexpand_abbrev); 540 staticpro (&Qexpand_abbrev);
552 541
553 DEFVAR_LISP ("self-insert-face", &Vself_insert_face, 542 Qpost_self_insert_hook = intern_c_string ("post-self-insert-hook");
554 doc: /* If non-nil, set the face of the next self-inserting character to this. 543 staticpro (&Qpost_self_insert_hook);
555See also `self-insert-face-command'. */);
556 Vself_insert_face = Qnil;
557 544
558 DEFVAR_LISP ("self-insert-face-command", &Vself_insert_face_command, 545 DEFVAR_LISP ("post-self-insert-hook", &Vpost_self_insert_hook,
559 doc: /* This is the command that set up `self-insert-face'. 546 doc: /* Hook run at the end of `self-insert-command'.
560If `last-command' does not equal this value, we ignore `self-insert-face'. */); 547This run is run after inserting the charater. */);
561 Vself_insert_face_command = Qnil; 548 Vpost_self_insert_hook = Qnil;
562 549
563 DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function, 550 DEFVAR_LISP ("blink-paren-function", &Vblink_paren_function,
564 doc: /* Function called, if non-nil, whenever a close parenthesis is inserted. 551 doc: /* Function called, if non-nil, whenever a close parenthesis is inserted.
diff --git a/src/composite.c b/src/composite.c
index 392da1ceba1..233f9ac8969 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -969,7 +969,9 @@ autocmp_chars (Lisp_Object rule, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT
969static Lisp_Object _work_val; 969static Lisp_Object _work_val;
970static int _work_char; 970static int _work_char;
971 971
972/* 1 iff the character C is composable. */ 972/* 1 iff the character C is composable. Characters of general
973 category Z? or C? are not composable except for ZWNJ and ZWJ. */
974
973#define CHAR_COMPOSABLE_P(C) \ 975#define CHAR_COMPOSABLE_P(C) \
974 ((C) == 0x200C || (C) == 0x200D \ 976 ((C) == 0x200C || (C) == 0x200D \
975 || (_work_val = CHAR_TABLE_REF (Vunicode_category_table, (C)), \ 977 || (_work_val = CHAR_TABLE_REF (Vunicode_category_table, (C)), \
@@ -1028,19 +1030,6 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos,
1028 cmp_it->stop_pos = endpos = start; 1030 cmp_it->stop_pos = endpos = start;
1029 cmp_it->ch = -1; 1031 cmp_it->ch = -1;
1030 } 1032 }
1031 if (NILP (string))
1032 {
1033 /* A composition never strides over PT. */
1034 if (PT > charpos)
1035 {
1036 if (PT < endpos)
1037 cmp_it->stop_pos = endpos = PT;
1038 }
1039 else if (PT < charpos && PT > endpos)
1040 {
1041 cmp_it->stop_pos = endpos = PT - 1;
1042 }
1043 }
1044 if (NILP (current_buffer->enable_multibyte_characters) 1033 if (NILP (current_buffer->enable_multibyte_characters)
1045 || NILP (Vauto_composition_mode)) 1034 || NILP (Vauto_composition_mode))
1046 return; 1035 return;
@@ -1091,6 +1080,16 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos,
1091 } 1080 }
1092 } 1081 }
1093 } 1082 }
1083 if (charpos == endpos)
1084 {
1085 /* We couldn't find a composition point before ENDPOS. But,
1086 some character after ENDPOS may be composed with
1087 characters before ENDPOS. So, we should stop at the safe
1088 point. */
1089 charpos = endpos - MAX_AUTO_COMPOSITION_LOOKBACK;
1090 if (charpos < start)
1091 charpos = start;
1092 }
1094 } 1093 }
1095 else if (charpos > endpos) 1094 else if (charpos > endpos)
1096 { 1095 {
@@ -1223,23 +1222,8 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos,
1223int 1222int
1224composition_reseat_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT endpos, struct window *w, struct face *face, Lisp_Object string) 1223composition_reseat_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT endpos, struct window *w, struct face *face, Lisp_Object string)
1225{ 1224{
1226 if (endpos <= charpos) 1225 if (endpos < 0)
1227 { 1226 endpos = NILP (string) ? BEGV : 0;
1228 if (NILP (string))
1229 {
1230 if (endpos < 0)
1231 endpos = BEGV;
1232 if (endpos < PT && PT < charpos)
1233 endpos = PT;
1234 }
1235 else if (endpos < 0)
1236 endpos = 0;
1237 }
1238 else
1239 {
1240 if (NILP (string) && charpos < PT && PT < endpos)
1241 endpos = PT;
1242 }
1243 1227
1244 if (cmp_it->ch == -2) 1228 if (cmp_it->ch == -2)
1245 { 1229 {
@@ -1301,7 +1285,7 @@ composition_reseat_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_I
1301 elt = XCAR (val); 1285 elt = XCAR (val);
1302 if (cmp_it->lookback > 0) 1286 if (cmp_it->lookback > 0)
1303 { 1287 {
1304 cpos -= cmp_it->lookback; 1288 cpos = charpos - cmp_it->lookback;
1305 if (STRINGP (string)) 1289 if (STRINGP (string))
1306 bpos = string_char_to_byte (string, cpos); 1290 bpos = string_char_to_byte (string, cpos);
1307 else 1291 else
@@ -1763,8 +1747,6 @@ should be ignored. */)
1763 1747
1764 CHECK_NATNUM (from); 1748 CHECK_NATNUM (from);
1765 CHECK_NATNUM (to); 1749 CHECK_NATNUM (to);
1766 if (XINT (to) > XINT (from) + MAX_COMPOSITION_COMPONENTS)
1767 to = make_number (XINT (from) + MAX_COMPOSITION_COMPONENTS);
1768 if (! FONT_OBJECT_P (font_object)) 1750 if (! FONT_OBJECT_P (font_object))
1769 { 1751 {
1770 struct coding_system *coding; 1752 struct coding_system *coding;
diff --git a/src/config.in b/src/config.in
index ea17a54d913..604a737a8b0 100644
--- a/src/config.in
+++ b/src/config.in
@@ -294,6 +294,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
294/* Define to 1 if netdb.h declares h_errno. */ 294/* Define to 1 if netdb.h declares h_errno. */
295#undef HAVE_H_ERRNO 295#undef HAVE_H_ERRNO
296 296
297/* Define to 1 if using imagemagick. */
298#undef HAVE_IMAGEMAGICK
299
297/* Define to 1 if you have inet sockets. */ 300/* Define to 1 if you have inet sockets. */
298#undef HAVE_INET_SOCKETS 301#undef HAVE_INET_SOCKETS
299 302
@@ -432,6 +435,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
432/* Define to 1 if you have the <mach/mach.h> header file. */ 435/* Define to 1 if you have the <mach/mach.h> header file. */
433#undef HAVE_MACH_MACH_H 436#undef HAVE_MACH_MACH_H
434 437
438/* Define to 1 if you have the `MagickExportImagePixels' function. */
439#undef HAVE_MAGICKEXPORTIMAGEPIXELS
440
435/* Define to 1 if you have the <maillock.h> header file. */ 441/* Define to 1 if you have the <maillock.h> header file. */
436#undef HAVE_MAILLOCK_H 442#undef HAVE_MAILLOCK_H
437 443
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 683d6f047fa..3b6f0e543bb 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -31,6 +31,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31 31
32/* Subroutines. */ 32/* Subroutines. */
33Lisp_Object Qdbus_init_bus; 33Lisp_Object Qdbus_init_bus;
34Lisp_Object Qdbus_close_bus;
34Lisp_Object Qdbus_get_unique_name; 35Lisp_Object Qdbus_get_unique_name;
35Lisp_Object Qdbus_call_method; 36Lisp_Object Qdbus_call_method;
36Lisp_Object Qdbus_call_method_asynchronously; 37Lisp_Object Qdbus_call_method_asynchronously;
@@ -59,6 +60,9 @@ Lisp_Object QCdbus_type_object_path, QCdbus_type_signature;
59Lisp_Object QCdbus_type_array, QCdbus_type_variant; 60Lisp_Object QCdbus_type_array, QCdbus_type_variant;
60Lisp_Object QCdbus_type_struct, QCdbus_type_dict_entry; 61Lisp_Object QCdbus_type_struct, QCdbus_type_dict_entry;
61 62
63/* Registered buses. */
64Lisp_Object Vdbus_registered_buses;
65
62/* Hash table which keeps function definitions. */ 66/* Hash table which keeps function definitions. */
63Lisp_Object Vdbus_registered_objects_table; 67Lisp_Object Vdbus_registered_objects_table;
64 68
@@ -111,7 +115,7 @@ int xd_in_read_queued_messages = 0;
111 } while (0) 115 } while (0)
112 116
113/* Macros for debugging. In order to enable them, build with 117/* Macros for debugging. In order to enable them, build with
114 "make MYCPPFLAGS='-DDBUS_DEBUG -Wall'". */ 118 "MYCPPFLAGS='-DDBUS_DEBUG -Wall' make". */
115#ifdef DBUS_DEBUG 119#ifdef DBUS_DEBUG
116#define XD_DEBUG_MESSAGE(...) \ 120#define XD_DEBUG_MESSAGE(...) \
117 do { \ 121 do { \
@@ -713,10 +717,10 @@ xd_retrieve_arg (unsigned int dtype, DBusMessageIter *iter)
713 } 717 }
714} 718}
715 719
716/* Initialize D-Bus connection. BUS is a Lisp symbol, either :system 720/* Initialize D-Bus connection. BUS is either a Lisp symbol, :system
717 or :session. It tells which D-Bus to initialize. If RAISE_ERROR 721 or :session, or a string denoting the bus address. It tells which
718 is non-zero signal an error when the connection cannot be 722 D-Bus to initialize. If RAISE_ERROR is non-zero, signal an error
719 initialized. */ 723 when the connection cannot be initialized. */
720static DBusConnection * 724static DBusConnection *
721xd_initialize (Lisp_Object bus, int raise_error) 725xd_initialize (Lisp_Object bus, int raise_error)
722{ 726{
@@ -724,34 +728,66 @@ xd_initialize (Lisp_Object bus, int raise_error)
724 DBusError derror; 728 DBusError derror;
725 729
726 /* Parameter check. */ 730 /* Parameter check. */
727 CHECK_SYMBOL (bus); 731 if (!STRINGP (bus))
728 if (!(EQ (bus, QCdbus_system_bus) || EQ (bus, QCdbus_session_bus))) 732 {
729 if (raise_error) 733 CHECK_SYMBOL (bus);
730 XD_SIGNAL2 (build_string ("Wrong bus name"), bus); 734 if (!(EQ (bus, QCdbus_system_bus) || EQ (bus, QCdbus_session_bus)))
731 else 735 {
732 return NULL; 736 if (raise_error)
737 XD_SIGNAL2 (build_string ("Wrong bus name"), bus);
738 else
739 return NULL;
740 }
733 741
734 /* We do not want to have an autolaunch for the session bus. */ 742 /* We do not want to have an autolaunch for the session bus. */
735 if (EQ (bus, QCdbus_session_bus) 743 if (EQ (bus, QCdbus_session_bus)
736 && getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL) 744 && getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL)
737 if (raise_error) 745 {
738 XD_SIGNAL2 (build_string ("No connection to bus"), bus); 746 if (raise_error)
739 else 747 XD_SIGNAL2 (build_string ("No connection to bus"), bus);
740 return NULL; 748 else
749 return NULL;
750 }
751 }
741 752
742 /* Open a connection to the bus. */ 753 /* Open a connection to the bus. */
743 dbus_error_init (&derror); 754 dbus_error_init (&derror);
744 755
745 if (EQ (bus, QCdbus_system_bus)) 756 if (STRINGP (bus))
746 connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror); 757 connection = dbus_connection_open (SDATA (bus), &derror);
747 else 758 else
748 connection = dbus_bus_get (DBUS_BUS_SESSION, &derror); 759 if (EQ (bus, QCdbus_system_bus))
760 connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror);
761 else
762 connection = dbus_bus_get (DBUS_BUS_SESSION, &derror);
749 763
750 if (dbus_error_is_set (&derror)) 764 if (dbus_error_is_set (&derror))
751 if (raise_error) 765 {
752 XD_ERROR (derror); 766 if (raise_error)
753 else 767 XD_ERROR (derror);
754 connection = NULL; 768 else
769 connection = NULL;
770 }
771
772 /* If it is not the system or session bus, we must register
773 ourselves. Otherwise, we have called dbus_bus_get, which has
774 configured us to exit if the connection closes - we undo this
775 setting. */
776 if (connection != NULL)
777 {
778 if (STRINGP (bus))
779 dbus_bus_register (connection, &derror);
780 else
781 dbus_connection_set_exit_on_disconnect (connection, FALSE);
782 }
783
784 if (dbus_error_is_set (&derror))
785 {
786 if (raise_error)
787 XD_ERROR (derror);
788 else
789 connection = NULL;
790 }
755 791
756 if (connection == NULL && raise_error) 792 if (connection == NULL && raise_error)
757 XD_SIGNAL2 (build_string ("No connection to bus"), bus); 793 XD_SIGNAL2 (build_string ("No connection to bus"), bus);
@@ -794,7 +830,8 @@ xd_add_watch (DBusWatch *watch, void *data)
794} 830}
795 831
796/* Remove connection file descriptor from input_wait_mask. DATA is 832/* Remove connection file descriptor from input_wait_mask. DATA is
797 the used bus, either QCdbus_system_bus or QCdbus_session_bus. */ 833 the used bus, either a string or QCdbus_system_bus or
834 QCdbus_session_bus. */
798void 835void
799xd_remove_watch (DBusWatch *watch, void *data) 836xd_remove_watch (DBusWatch *watch, void *data)
800{ 837{
@@ -830,15 +867,11 @@ xd_remove_watch (DBusWatch *watch, void *data)
830} 867}
831 868
832DEFUN ("dbus-init-bus", Fdbus_init_bus, Sdbus_init_bus, 1, 1, 0, 869DEFUN ("dbus-init-bus", Fdbus_init_bus, Sdbus_init_bus, 1, 1, 0,
833 doc: /* Initialize connection to D-Bus BUS. 870 doc: /* Initialize connection to D-Bus BUS. */)
834This is an internal function, it shall not be used outside dbus.el. */)
835 (Lisp_Object bus) 871 (Lisp_Object bus)
836{ 872{
837 DBusConnection *connection; 873 DBusConnection *connection;
838 874
839 /* Check parameters. */
840 CHECK_SYMBOL (bus);
841
842 /* Open a connection to the bus. */ 875 /* Open a connection to the bus. */
843 connection = xd_initialize (bus, TRUE); 876 connection = xd_initialize (bus, TRUE);
844 877
@@ -850,6 +883,28 @@ This is an internal function, it shall not be used outside dbus.el. */)
850 NULL, (void*) XHASH (bus), NULL)) 883 NULL, (void*) XHASH (bus), NULL))
851 XD_SIGNAL1 (build_string ("Cannot add watch functions")); 884 XD_SIGNAL1 (build_string ("Cannot add watch functions"));
852 885
886 /* Add bus to list of registered buses. */
887 Vdbus_registered_buses = Fcons (bus, Vdbus_registered_buses);
888
889 /* Return. */
890 return Qnil;
891}
892
893DEFUN ("dbus-close-bus", Fdbus_close_bus, Sdbus_close_bus, 1, 1, 0,
894 doc: /* Close connection to D-Bus BUS. */)
895 (Lisp_Object bus)
896{
897 DBusConnection *connection;
898
899 /* Open a connection to the bus. */
900 connection = xd_initialize (bus, TRUE);
901
902 /* Decrement reference count to the bus. */
903 dbus_connection_unref (connection);
904
905 /* Remove bus from list of registered buses. */
906 Vdbus_registered_buses = Fdelete (bus, Vdbus_registered_buses);
907
853 /* Return. */ 908 /* Return. */
854 return Qnil; 909 return Qnil;
855} 910}
@@ -862,9 +917,6 @@ DEFUN ("dbus-get-unique-name", Fdbus_get_unique_name, Sdbus_get_unique_name,
862 DBusConnection *connection; 917 DBusConnection *connection;
863 const char *name; 918 const char *name;
864 919
865 /* Check parameters. */
866 CHECK_SYMBOL (bus);
867
868 /* Open a connection to the bus. */ 920 /* Open a connection to the bus. */
869 connection = xd_initialize (bus, TRUE); 921 connection = xd_initialize (bus, TRUE);
870 922
@@ -880,7 +932,8 @@ DEFUN ("dbus-get-unique-name", Fdbus_get_unique_name, Sdbus_get_unique_name,
880DEFUN ("dbus-call-method", Fdbus_call_method, Sdbus_call_method, 5, MANY, 0, 932DEFUN ("dbus-call-method", Fdbus_call_method, Sdbus_call_method, 5, MANY, 0,
881 doc: /* Call METHOD on the D-Bus BUS. 933 doc: /* Call METHOD on the D-Bus BUS.
882 934
883BUS is either the symbol `:system' or the symbol `:session'. 935BUS is either a Lisp symbol, `:system' or `:session', or a string
936denoting the bus address.
884 937
885SERVICE is the D-Bus service name to be used. PATH is the D-Bus 938SERVICE is the D-Bus service name to be used. PATH is the D-Bus
886object path SERVICE is registered at. INTERFACE is an interface 939object path SERVICE is registered at. INTERFACE is an interface
@@ -967,7 +1020,6 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TI
967 interface = args[3]; 1020 interface = args[3];
968 method = args[4]; 1021 method = args[4];
969 1022
970 CHECK_SYMBOL (bus);
971 CHECK_STRING (service); 1023 CHECK_STRING (service);
972 CHECK_STRING (path); 1024 CHECK_STRING (path);
973 CHECK_STRING (interface); 1025 CHECK_STRING (interface);
@@ -1082,7 +1134,8 @@ DEFUN ("dbus-call-method-asynchronously", Fdbus_call_method_asynchronously,
1082 Sdbus_call_method_asynchronously, 6, MANY, 0, 1134 Sdbus_call_method_asynchronously, 6, MANY, 0,
1083 doc: /* Call METHOD on the D-Bus BUS asynchronously. 1135 doc: /* Call METHOD on the D-Bus BUS asynchronously.
1084 1136
1085BUS is either the symbol `:system' or the symbol `:session'. 1137BUS is either a Lisp symbol, `:system' or `:session', or a string
1138denoting the bus address.
1086 1139
1087SERVICE is the D-Bus service name to be used. PATH is the D-Bus 1140SERVICE is the D-Bus service name to be used. PATH is the D-Bus
1088object path SERVICE is registered at. INTERFACE is an interface 1141object path SERVICE is registered at. INTERFACE is an interface
@@ -1148,7 +1201,6 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE
1148 method = args[4]; 1201 method = args[4];
1149 handler = args[5]; 1202 handler = args[5];
1150 1203
1151 CHECK_SYMBOL (bus);
1152 CHECK_STRING (service); 1204 CHECK_STRING (service);
1153 CHECK_STRING (path); 1205 CHECK_STRING (path);
1154 CHECK_STRING (interface); 1206 CHECK_STRING (interface);
@@ -1271,7 +1323,6 @@ usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */)
1271 serial = args[1]; 1323 serial = args[1];
1272 service = args[2]; 1324 service = args[2];
1273 1325
1274 CHECK_SYMBOL (bus);
1275 CHECK_NUMBER (serial); 1326 CHECK_NUMBER (serial);
1276 CHECK_STRING (service); 1327 CHECK_STRING (service);
1277 GCPRO3 (bus, serial, service); 1328 GCPRO3 (bus, serial, service);
@@ -1363,7 +1414,6 @@ usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */)
1363 serial = args[1]; 1414 serial = args[1];
1364 service = args[2]; 1415 service = args[2];
1365 1416
1366 CHECK_SYMBOL (bus);
1367 CHECK_NUMBER (serial); 1417 CHECK_NUMBER (serial);
1368 CHECK_STRING (service); 1418 CHECK_STRING (service);
1369 GCPRO3 (bus, serial, service); 1419 GCPRO3 (bus, serial, service);
@@ -1436,7 +1486,8 @@ usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */)
1436DEFUN ("dbus-send-signal", Fdbus_send_signal, Sdbus_send_signal, 5, MANY, 0, 1486DEFUN ("dbus-send-signal", Fdbus_send_signal, Sdbus_send_signal, 5, MANY, 0,
1437 doc: /* Send signal SIGNAL on the D-Bus BUS. 1487 doc: /* Send signal SIGNAL on the D-Bus BUS.
1438 1488
1439BUS is either the symbol `:system' or the symbol `:session'. 1489BUS is either a Lisp symbol, `:system' or `:session', or a string
1490denoting the bus address.
1440 1491
1441SERVICE is the D-Bus service name SIGNAL is sent from. PATH is the 1492SERVICE is the D-Bus service name SIGNAL is sent from. PATH is the
1442D-Bus object path SERVICE is registered at. INTERFACE is an interface 1493D-Bus object path SERVICE is registered at. INTERFACE is an interface
@@ -1480,7 +1531,6 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
1480 interface = args[3]; 1531 interface = args[3];
1481 signal = args[4]; 1532 signal = args[4];
1482 1533
1483 CHECK_SYMBOL (bus);
1484 CHECK_STRING (service); 1534 CHECK_STRING (service);
1485 CHECK_STRING (path); 1535 CHECK_STRING (path);
1486 CHECK_STRING (interface); 1536 CHECK_STRING (interface);
@@ -1552,7 +1602,8 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
1552} 1602}
1553 1603
1554/* Check, whether there is pending input in the message queue of the 1604/* Check, whether there is pending input in the message queue of the
1555 D-Bus BUS. BUS is a Lisp symbol, either :system or :session. */ 1605 D-Bus BUS. BUS is either a Lisp symbol, :system or :session, or a
1606 string denoting the bus address. */
1556int 1607int
1557xd_get_dispatch_status (Lisp_Object bus) 1608xd_get_dispatch_status (Lisp_Object bus)
1558{ 1609{
@@ -1572,24 +1623,31 @@ xd_get_dispatch_status (Lisp_Object bus)
1572 ? TRUE : FALSE; 1623 ? TRUE : FALSE;
1573} 1624}
1574 1625
1575/* Check for queued incoming messages from the system and session buses. */ 1626/* Check for queued incoming messages from the buses. */
1576int 1627int
1577xd_pending_messages (void) 1628xd_pending_messages (void)
1578{ 1629{
1630 Lisp_Object busp = Vdbus_registered_buses;
1631
1632 while (!NILP (busp))
1633 {
1634 /* We do not want to have an autolaunch for the session bus. */
1635 if (EQ ((CAR_SAFE (busp)), QCdbus_session_bus)
1636 && getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL)
1637 continue;
1579 1638
1580 /* Vdbus_registered_objects_table will be initialized as hash table 1639 if (xd_get_dispatch_status (CAR_SAFE (busp)))
1581 in dbus.el. When this package isn't loaded yet, it doesn't make 1640 return TRUE;
1582 sense to handle D-Bus messages. */ 1641
1583 return (HASH_TABLE_P (Vdbus_registered_objects_table) 1642 busp = CDR_SAFE (busp);
1584 ? (xd_get_dispatch_status (QCdbus_system_bus) 1643 }
1585 || ((getenv ("DBUS_SESSION_BUS_ADDRESS") != NULL) 1644
1586 ? xd_get_dispatch_status (QCdbus_session_bus) 1645 return FALSE;
1587 : FALSE))
1588 : FALSE);
1589} 1646}
1590 1647
1591/* Read queued incoming message of the D-Bus BUS. BUS is a Lisp 1648/* Read queued incoming message of the D-Bus BUS. BUS is either a
1592 symbol, either :system or :session. */ 1649 Lisp symbol, :system or :session, or a string denoting the bus
1650 address. */
1593static Lisp_Object 1651static Lisp_Object
1594xd_read_message (Lisp_Object bus) 1652xd_read_message (Lisp_Object bus)
1595{ 1653{
@@ -1746,29 +1804,28 @@ xd_read_message (Lisp_Object bus)
1746 RETURN_UNGCPRO (Qnil); 1804 RETURN_UNGCPRO (Qnil);
1747} 1805}
1748 1806
1749/* Read queued incoming messages from the system and session buses. */ 1807/* Read queued incoming messages from all buses. */
1750void 1808void
1751xd_read_queued_messages (void) 1809xd_read_queued_messages (void)
1752{ 1810{
1811 Lisp_Object busp = Vdbus_registered_buses;
1753 1812
1754 /* Vdbus_registered_objects_table will be initialized as hash table 1813 xd_in_read_queued_messages = 1;
1755 in dbus.el. When this package isn't loaded yet, it doesn't make 1814 while (!NILP (busp))
1756 sense to handle D-Bus messages. Furthermore, we ignore all Lisp
1757 errors during the call. */
1758 if (HASH_TABLE_P (Vdbus_registered_objects_table))
1759 { 1815 {
1760 xd_in_read_queued_messages = 1; 1816 /* We ignore all Lisp errors during the call. */
1761 internal_catch (Qdbus_error, xd_read_message, QCdbus_system_bus); 1817 internal_catch (Qdbus_error, xd_read_message, CAR_SAFE (busp));
1762 internal_catch (Qdbus_error, xd_read_message, QCdbus_session_bus); 1818 busp = CDR_SAFE (busp);
1763 xd_in_read_queued_messages = 0;
1764 } 1819 }
1820 xd_in_read_queued_messages = 0;
1765} 1821}
1766 1822
1767DEFUN ("dbus-register-signal", Fdbus_register_signal, Sdbus_register_signal, 1823DEFUN ("dbus-register-signal", Fdbus_register_signal, Sdbus_register_signal,
1768 6, MANY, 0, 1824 6, MANY, 0,
1769 doc: /* Register for signal SIGNAL on the D-Bus BUS. 1825 doc: /* Register for signal SIGNAL on the D-Bus BUS.
1770 1826
1771BUS is either the symbol `:system' or the symbol `:session'. 1827BUS is either a Lisp symbol, `:system' or `:session', or a string
1828denoting the bus address.
1772 1829
1773SERVICE is the D-Bus service name used by the sending D-Bus object. 1830SERVICE is the D-Bus service name used by the sending D-Bus object.
1774It can be either a known name or the unique name of the D-Bus object 1831It can be either a known name or the unique name of the D-Bus object
@@ -1822,7 +1879,6 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG
1822 signal = args[4]; 1879 signal = args[4];
1823 handler = args[5]; 1880 handler = args[5];
1824 1881
1825 CHECK_SYMBOL (bus);
1826 if (!NILP (service)) CHECK_STRING (service); 1882 if (!NILP (service)) CHECK_STRING (service);
1827 if (!NILP (path)) CHECK_STRING (path); 1883 if (!NILP (path)) CHECK_STRING (path);
1828 CHECK_STRING (interface); 1884 CHECK_STRING (interface);
@@ -1915,7 +1971,8 @@ DEFUN ("dbus-register-method", Fdbus_register_method, Sdbus_register_method,
1915 6, 6, 0, 1971 6, 6, 0,
1916 doc: /* Register for method METHOD on the D-Bus BUS. 1972 doc: /* Register for method METHOD on the D-Bus BUS.
1917 1973
1918BUS is either the symbol `:system' or the symbol `:session'. 1974BUS is either a Lisp symbol, `:system' or `:session', or a string
1975denoting the bus address.
1919 1976
1920SERVICE is the D-Bus service name of the D-Bus object METHOD is 1977SERVICE is the D-Bus service name of the D-Bus object METHOD is
1921registered for. It must be a known name. 1978registered for. It must be a known name.
@@ -1933,7 +1990,6 @@ used for composing the returning D-Bus message. */)
1933 DBusError derror; 1990 DBusError derror;
1934 1991
1935 /* Check parameters. */ 1992 /* Check parameters. */
1936 CHECK_SYMBOL (bus);
1937 CHECK_STRING (service); 1993 CHECK_STRING (service);
1938 CHECK_STRING (path); 1994 CHECK_STRING (path);
1939 CHECK_STRING (interface); 1995 CHECK_STRING (interface);
@@ -1978,6 +2034,10 @@ syms_of_dbusbind (void)
1978 staticpro (&Qdbus_init_bus); 2034 staticpro (&Qdbus_init_bus);
1979 defsubr (&Sdbus_init_bus); 2035 defsubr (&Sdbus_init_bus);
1980 2036
2037 Qdbus_close_bus = intern_c_string ("dbus-close-bus");
2038 staticpro (&Qdbus_close_bus);
2039 defsubr (&Sdbus_close_bus);
2040
1981 Qdbus_get_unique_name = intern_c_string ("dbus-get-unique-name"); 2041 Qdbus_get_unique_name = intern_c_string ("dbus-get-unique-name");
1982 staticpro (&Qdbus_get_unique_name); 2042 staticpro (&Qdbus_get_unique_name);
1983 defsubr (&Sdbus_get_unique_name); 2043 defsubr (&Sdbus_get_unique_name);
@@ -2074,18 +2134,25 @@ syms_of_dbusbind (void)
2074 QCdbus_type_dict_entry = intern_c_string (":dict-entry"); 2134 QCdbus_type_dict_entry = intern_c_string (":dict-entry");
2075 staticpro (&QCdbus_type_dict_entry); 2135 staticpro (&QCdbus_type_dict_entry);
2076 2136
2137 DEFVAR_LISP ("dbus-registered-buses",
2138 &Vdbus_registered_buses,
2139 doc: /* List of D-Bus buses we are polling for messages. */);
2140 Vdbus_registered_buses = Qnil;
2141
2077 DEFVAR_LISP ("dbus-registered-objects-table", 2142 DEFVAR_LISP ("dbus-registered-objects-table",
2078 &Vdbus_registered_objects_table, 2143 &Vdbus_registered_objects_table,
2079 doc: /* Hash table of registered functions for D-Bus. 2144 doc: /* Hash table of registered functions for D-Bus.
2145
2080There are two different uses of the hash table: for accessing 2146There are two different uses of the hash table: for accessing
2081registered interfaces properties, targeted by signals or method calls, 2147registered interfaces properties, targeted by signals or method calls,
2082and for calling handlers in case of non-blocking method call returns. 2148and for calling handlers in case of non-blocking method call returns.
2083 2149
2084In the first case, the key in the hash table is the list (BUS 2150In the first case, the key in the hash table is the list (BUS
2085INTERFACE MEMBER). BUS is either the symbol `:system' or the symbol 2151INTERFACE MEMBER). BUS is either a Lisp symbol, `:system' or
2086`:session'. INTERFACE is a string which denotes a D-Bus interface, 2152`:session', or a string denoting the bus address. INTERFACE is a
2087and MEMBER, also a string, is either a method, a signal or a property 2153string which denotes a D-Bus interface, and MEMBER, also a string, is
2088INTERFACE is offering. All arguments but BUS must not be nil. 2154either a method, a signal or a property INTERFACE is offering. All
2155arguments but BUS must not be nil.
2089 2156
2090The value in the hash table is a list of quadruple lists 2157The value in the hash table is a list of quadruple lists
2091\((UNAME SERVICE PATH OBJECT) (UNAME SERVICE PATH OBJECT) ...). 2158\((UNAME SERVICE PATH OBJECT) (UNAME SERVICE PATH OBJECT) ...).
@@ -2097,15 +2164,18 @@ be called when a D-Bus message, which matches the key criteria,
2097arrives (methods and signals), or a cons cell containing the value of 2164arrives (methods and signals), or a cons cell containing the value of
2098the property. 2165the property.
2099 2166
2100In the second case, the key in the hash table is the list (BUS SERIAL). 2167In the second case, the key in the hash table is the list (BUS
2101BUS is either the symbol `:system' or the symbol `:session'. SERIAL 2168SERIAL). BUS is either a Lisp symbol, `:system' or `:session', or a
2102is the serial number of the non-blocking method call, a reply is 2169string denoting the bus address. SERIAL is the serial number of the
2103expected. Both arguments must not be nil. The value in the hash 2170non-blocking method call, a reply is expected. Both arguments must
2104table is HANDLER, the function to be called when the D-Bus reply 2171not be nil. The value in the hash table is HANDLER, the function to
2105message arrives. */); 2172be called when the D-Bus reply message arrives. */);
2106 /* We initialize Vdbus_registered_objects_table in dbus.el, because 2173 {
2107 we need to define a hash table function first. */ 2174 Lisp_Object args[2];
2108 Vdbus_registered_objects_table = Qnil; 2175 args[0] = QCtest;
2176 args[1] = Qequal;
2177 Vdbus_registered_objects_table = Fmake_hash_table (2, args);
2178 }
2109 2179
2110 DEFVAR_LISP ("dbus-debug", &Vdbus_debug, 2180 DEFVAR_LISP ("dbus-debug", &Vdbus_debug,
2111 doc: /* If non-nil, debug messages of D-Bus bindings are raised. */); 2181 doc: /* If non-nil, debug messages of D-Bus bindings are raised. */);
diff --git a/src/deps.mk b/src/deps.mk
index 8eeed3822d0..d00be96744b 100644
--- a/src/deps.mk
+++ b/src/deps.mk
@@ -142,7 +142,7 @@ mktime.o: mktime.c $(config_h)
142msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \ 142msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \
143 termopts.h termchar.h character.h coding.h ccl.h disptab.h window.h \ 143 termopts.h termchar.h character.h coding.h ccl.h disptab.h window.h \
144 keyboard.h $(INTERVALS_H) buffer.h commands.h blockinput.h atimer.h \ 144 keyboard.h $(INTERVALS_H) buffer.h commands.h blockinput.h atimer.h \
145 lisp.h $(config_h) 145 lisp.h sysselect.h $(config_h)
146nsfns.o: nsfns.m charset.h nsterm.h nsgui.h frame.h window.h buffer.h \ 146nsfns.o: nsfns.m charset.h nsterm.h nsgui.h frame.h window.h buffer.h \
147 dispextern.h fontset.h $(INTERVALS_H) keyboard.h blockinput.h \ 147 dispextern.h fontset.h $(INTERVALS_H) keyboard.h blockinput.h \
148 atimer.h systime.h epaths.h termhooks.h coding.h systime.h lisp.h $(config_h) 148 atimer.h systime.h epaths.h termhooks.h coding.h systime.h lisp.h $(config_h)
@@ -176,7 +176,7 @@ syntax.o: syntax.c syntax.h buffer.h commands.h category.h character.h \
176sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \ 176sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \
177 process.h dispextern.h termhooks.h termchar.h termopts.h coding.h \ 177 process.h dispextern.h termhooks.h termchar.h termopts.h coding.h \
178 frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h lisp.h \ 178 frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h lisp.h \
179 $(config_h) composite.h 179 $(config_h) composite.h sysselect.h
180term.o: term.c termchar.h termhooks.h termopts.h lisp.h $(config_h) \ 180term.o: term.c termchar.h termhooks.h termopts.h lisp.h $(config_h) \
181 cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \ 181 cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \
182 xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \ 182 xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \
diff --git a/src/dispnew.c b/src/dispnew.c
index 35893872c73..9344d792f3d 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5351,9 +5351,15 @@ update_frame_line (struct frame *f, int vpos)
5351 ***********************************************************************/ 5351 ***********************************************************************/
5352 5352
5353/* Determine what's under window-relative pixel position (*X, *Y). 5353/* Determine what's under window-relative pixel position (*X, *Y).
5354 Return the object (string or buffer) that's there. 5354 Return the OBJECT (string or buffer) that's there.
5355 Return in *POS the position in that object. 5355 Return in *POS the position in that object.
5356 Adjust *X and *Y to character positions. */ 5356 Adjust *X and *Y to character positions.
5357 Return in *DX and *DY the pixel coordinates of the click,
5358 relative to the top left corner of OBJECT, or relative to
5359 the top left corner of the character glyph at (*X, *Y)
5360 if OBJECT is nil.
5361 Return WIDTH and HEIGHT of the object at (*X, *Y), or zero
5362 if the coordinates point to an empty area of the display. */
5357 5363
5358Lisp_Object 5364Lisp_Object
5359buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *pos, Lisp_Object *object, int *dx, int *dy, int *width, int *height) 5365buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *pos, Lisp_Object *object, int *dx, int *dy, int *width, int *height)
@@ -5366,7 +5372,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5366#ifdef HAVE_WINDOW_SYSTEM 5372#ifdef HAVE_WINDOW_SYSTEM
5367 struct image *img = 0; 5373 struct image *img = 0;
5368#endif 5374#endif
5369 int x0, x1; 5375 int x0, x1, to_x;
5370 5376
5371 /* We used to set current_buffer directly here, but that does the 5377 /* We used to set current_buffer directly here, but that does the
5372 wrong thing with `face-remapping-alist' (bug#2044). */ 5378 wrong thing with `face-remapping-alist' (bug#2044). */
@@ -5377,8 +5383,33 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5377 start_display (&it, w, startp); 5383 start_display (&it, w, startp);
5378 5384
5379 x0 = *x - WINDOW_LEFT_MARGIN_WIDTH (w); 5385 x0 = *x - WINDOW_LEFT_MARGIN_WIDTH (w);
5380 move_it_to (&it, -1, x0 + it.first_visible_x, *y, -1, 5386
5381 MOVE_TO_X | MOVE_TO_Y); 5387 /* First, move to the beginning of the row corresponding to *Y. We
5388 need to be in that row to get the correct value of base paragraph
5389 direction for the text at (*X, *Y). */
5390 move_it_to (&it, -1, 0, *y, -1, MOVE_TO_X | MOVE_TO_Y);
5391
5392 /* TO_X is the pixel position that the iterator will compute for the
5393 glyph at *X. We add it.first_visible_x because iterator
5394 positions include the hscroll. */
5395 to_x = x0 + it.first_visible_x;
5396 if (it.bidi_it.paragraph_dir == R2L)
5397 /* For lines in an R2L paragraph, we need to mirror TO_X wrt the
5398 text area. This is because the iterator, even in R2L
5399 paragraphs, delivers glyphs as if they started at the left
5400 margin of the window. (When we actually produce glyphs for
5401 display, we reverse their order in PRODUCE_GLYPHS, but the
5402 iterator doesn't know about that.) The following line adjusts
5403 the pixel position to the iterator geometry, which is what
5404 move_it_* routines use. (The -1 is because in a window whose
5405 text-area width is W, the rightmost pixel position is W-1, and
5406 it should be mirrored into zero pixel position.) */
5407 to_x = window_box_width (w, TEXT_AREA) - to_x - 1;
5408
5409 /* Now move horizontally in the row to the glyph under *X. Second
5410 argument is ZV to prevent move_it_in_display_line from matching
5411 based on buffer positions. */
5412 move_it_in_display_line (&it, ZV, to_x, MOVE_TO_X);
5382 5413
5383 Fset_buffer (old_current_buffer); 5414 Fset_buffer (old_current_buffer);
5384 5415
diff --git a/src/doc.c b/src/doc.c
index 9a7001eb01d..f8ab9d081b9 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -285,8 +285,7 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
285 to - (get_doc_string_buffer + offset)); 285 to - (get_doc_string_buffer + offset));
286 else 286 else
287 { 287 {
288 /* Let the data determine whether the string is multibyte, 288 /* The data determines whether the string is multibyte. */
289 even if Emacs is running in --unibyte mode. */
290 int nchars = multibyte_chars_in_text (get_doc_string_buffer + offset, 289 int nchars = multibyte_chars_in_text (get_doc_string_buffer + offset,
291 to - (get_doc_string_buffer + offset)); 290 to - (get_doc_string_buffer + offset));
292 return make_string_from_bytes (get_doc_string_buffer + offset, 291 return make_string_from_bytes (get_doc_string_buffer + offset,
@@ -622,24 +621,28 @@ the same file name is found in the `doc-directory'. */)
622 p = buf; 621 p = buf;
623 end = buf + (filled < 512 ? filled : filled - 128); 622 end = buf + (filled < 512 ? filled : filled - 128);
624 while (p != end && *p != '\037') p++; 623 while (p != end && *p != '\037') p++;
625 /* p points to ^_Ffunctionname\n or ^_Vvarname\n. */ 624 /* p points to ^_Ffunctionname\n or ^_Vvarname\n or ^_Sfilename\n. */
626 if (p != end) 625 if (p != end)
627 { 626 {
628 end = strchr (p, '\n'); 627 end = strchr (p, '\n');
629 628
630 /* See if this is a file name, and if it is a file in build-files. */ 629 /* See if this is a file name, and if it is a file in build-files. */
631 if (p[1] == 'S' && end - p > 4 && end[-2] == '.' 630 if (p[1] == 'S')
632 && (end[-1] == 'o' || end[-1] == 'c'))
633 { 631 {
634 int len = end - p - 2; 632 skip_file = 0;
635 char *fromfile = alloca (len + 1); 633 if (end - p > 4 && end[-2] == '.'
636 strncpy (fromfile, &p[2], len); 634 && (end[-1] == 'o' || end[-1] == 'c'))
637 fromfile[len] = 0; 635 {
638 if (fromfile[len-1] == 'c') 636 int len = end - p - 2;
639 fromfile[len-1] = 'o'; 637 char *fromfile = alloca (len + 1);
640 638 strncpy (fromfile, &p[2], len);
641 skip_file = NILP (Fmember (build_string (fromfile), 639 fromfile[len] = 0;
642 Vbuild_files)); 640 if (fromfile[len-1] == 'c')
641 fromfile[len-1] = 'o';
642
643 skip_file = NILP (Fmember (build_string (fromfile),
644 Vbuild_files));
645 }
643 } 646 }
644 647
645 sym = oblookup (Vobarray, p + 2, 648 sym = oblookup (Vobarray, p + 2,
diff --git a/src/emacs.c b/src/emacs.c
index 026a210af50..397d3d9ad27 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -91,6 +91,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
91#endif 91#endif
92#endif 92#endif
93 93
94/* If you change the following line, remember to update
95 msdos/mainmake.v2 which gleans the Emacs version from it! */
94static const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; 96static const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
95static const char emacs_version[] = "24.0.50"; 97static const char emacs_version[] = "24.0.50";
96 98
@@ -1330,68 +1332,6 @@ main (int argc, char **argv)
1330 init_atimer (); 1332 init_atimer ();
1331 running_asynch_code = 0; 1333 running_asynch_code = 0;
1332 1334
1333 /* Handle --unibyte and the EMACS_UNIBYTE envvar,
1334 but not while dumping. */
1335 if (1)
1336 {
1337 int inhibit_unibyte = 0;
1338
1339 /* --multibyte overrides EMACS_UNIBYTE. */
1340 if (argmatch (argv, argc, "-no-unibyte", "--no-unibyte", 4, NULL, &skip_args)
1341 || argmatch (argv, argc, "-multibyte", "--multibyte", 4, NULL, &skip_args)
1342 /* Ignore EMACS_UNIBYTE before dumping. */
1343 || (!initialized && noninteractive))
1344 inhibit_unibyte = 1;
1345
1346 /* --unibyte requests that we set up to do everything with single-byte
1347 buffers and strings. We need to handle this before calling
1348 init_lread, init_editfns and other places that generate Lisp strings
1349 from text in the environment. */
1350 /* Actually this shouldn't be needed as of 20.4 in a generally
1351 unibyte environment. As handa says, environment values
1352 aren't now decoded; also existing buffers are now made
1353 unibyte during startup if .emacs sets unibyte. Tested with
1354 8-bit data in environment variables and /etc/passwd, setting
1355 unibyte and Latin-1 in .emacs. -- Dave Love */
1356 if (argmatch (argv, argc, "-unibyte", "--unibyte", 4, NULL, &skip_args)
1357 || argmatch (argv, argc, "-no-multibyte", "--no-multibyte", 4, NULL, &skip_args)
1358 || (getenv ("EMACS_UNIBYTE") && !inhibit_unibyte))
1359 {
1360 Lisp_Object old_log_max;
1361 Lisp_Object symbol, tail;
1362
1363 symbol = intern_c_string ("enable-multibyte-characters");
1364 Fset_default (symbol, Qnil);
1365
1366 if (initialized)
1367 {
1368 /* Erase pre-dump messages in *Messages* now so no abort. */
1369 old_log_max = Vmessage_log_max;
1370 XSETFASTINT (Vmessage_log_max, 0);
1371 message_dolog ("", 0, 1, 0);
1372 Vmessage_log_max = old_log_max;
1373 }
1374
1375 for (tail = Vbuffer_alist; CONSP (tail);
1376 tail = XCDR (tail))
1377 {
1378 Lisp_Object buffer;
1379
1380 buffer = Fcdr (XCAR (tail));
1381 /* Make a multibyte buffer unibyte. */
1382 if (BUF_Z_BYTE (XBUFFER (buffer)) > BUF_Z (XBUFFER (buffer)))
1383 {
1384 struct buffer *current = current_buffer;
1385
1386 set_buffer_temp (XBUFFER (buffer));
1387 Fset_buffer_multibyte (Qnil);
1388 set_buffer_temp (current);
1389 }
1390 }
1391 message ("Warning: unibyte sessions are obsolete and will disappear");
1392 }
1393 }
1394
1395 no_loadup 1335 no_loadup
1396 = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args); 1336 = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
1397 1337
@@ -1790,10 +1730,6 @@ const struct standard_args standard_args[] =
1790 { "-script", "--script", 100, 1 }, 1730 { "-script", "--script", 100, 1 },
1791 { "-daemon", "--daemon", 99, 0 }, 1731 { "-daemon", "--daemon", 99, 0 },
1792 { "-help", "--help", 90, 0 }, 1732 { "-help", "--help", 90, 0 },
1793 { "-no-unibyte", "--no-unibyte", 83, 0 },
1794 { "-multibyte", "--multibyte", 82, 0 },
1795 { "-unibyte", "--unibyte", 81, 0 },
1796 { "-no-multibyte", "--no-multibyte", 80, 0 },
1797 { "-nl", "--no-loadup", 70, 0 }, 1733 { "-nl", "--no-loadup", 70, 0 },
1798 /* -d must come last before the options handled in startup.el. */ 1734 /* -d must come last before the options handled in startup.el. */
1799 { "-d", "--display", 60, 1 }, 1735 { "-d", "--display", 60, 1 },
@@ -2094,7 +2030,7 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff)
2094 Vinhibit_redisplay = Qt; 2030 Vinhibit_redisplay = Qt;
2095 2031
2096 /* If we are controlling the terminal, reset terminal modes. */ 2032 /* If we are controlling the terminal, reset terminal modes. */
2097#ifdef EMACS_HAVE_TTY_PGRP 2033#ifndef DOS_NT
2098 { 2034 {
2099 int pgrp = EMACS_GETPGRP (0); 2035 int pgrp = EMACS_GETPGRP (0);
2100 2036
diff --git a/src/eval.c b/src/eval.c
index 5c6b268187b..89d353cf7cb 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1011,12 +1011,13 @@ usage: (let VARLIST BODY...) */)
1011 int count = SPECPDL_INDEX (); 1011 int count = SPECPDL_INDEX ();
1012 register int argnum; 1012 register int argnum;
1013 struct gcpro gcpro1, gcpro2; 1013 struct gcpro gcpro1, gcpro2;
1014 USE_SAFE_ALLOCA;
1014 1015
1015 varlist = Fcar (args); 1016 varlist = Fcar (args);
1016 1017
1017 /* Make space to hold the values to give the bound variables */ 1018 /* Make space to hold the values to give the bound variables */
1018 elt = Flength (varlist); 1019 elt = Flength (varlist);
1019 temps = (Lisp_Object *) alloca (XFASTINT (elt) * sizeof (Lisp_Object)); 1020 SAFE_ALLOCA_LISP (temps, XFASTINT (elt));
1020 1021
1021 /* Compute the values and store them in `temps' */ 1022 /* Compute the values and store them in `temps' */
1022 1023
@@ -1049,6 +1050,7 @@ usage: (let VARLIST BODY...) */)
1049 } 1050 }
1050 1051
1051 elt = Fprogn (Fcdr (args)); 1052 elt = Fprogn (Fcdr (args));
1053 SAFE_FREE ();
1052 return unbind_to (count, elt); 1054 return unbind_to (count, elt);
1053} 1055}
1054 1056
@@ -2301,8 +2303,9 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
2301 /* Pass a vector of evaluated arguments */ 2303 /* Pass a vector of evaluated arguments */
2302 Lisp_Object *vals; 2304 Lisp_Object *vals;
2303 register int argnum = 0; 2305 register int argnum = 0;
2306 USE_SAFE_ALLOCA;
2304 2307
2305 vals = (Lisp_Object *) alloca (XINT (numargs) * sizeof (Lisp_Object)); 2308 SAFE_ALLOCA_LISP (vals, XINT (numargs));
2306 2309
2307 GCPRO3 (args_left, fun, fun); 2310 GCPRO3 (args_left, fun, fun);
2308 gcpro3.var = vals; 2311 gcpro3.var = vals;
@@ -2320,6 +2323,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
2320 2323
2321 val = (XSUBR (fun)->function.aMANY) (XINT (numargs), vals); 2324 val = (XSUBR (fun)->function.aMANY) (XINT (numargs), vals);
2322 UNGCPRO; 2325 UNGCPRO;
2326 SAFE_FREE ();
2323 goto done; 2327 goto done;
2324 } 2328 }
2325 2329
@@ -2430,8 +2434,9 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
2430 register int i, numargs; 2434 register int i, numargs;
2431 register Lisp_Object spread_arg; 2435 register Lisp_Object spread_arg;
2432 register Lisp_Object *funcall_args; 2436 register Lisp_Object *funcall_args;
2433 Lisp_Object fun; 2437 Lisp_Object fun, retval;
2434 struct gcpro gcpro1; 2438 struct gcpro gcpro1;
2439 USE_SAFE_ALLOCA;
2435 2440
2436 fun = args [0]; 2441 fun = args [0];
2437 funcall_args = 0; 2442 funcall_args = 0;
@@ -2470,8 +2475,7 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
2470 { 2475 {
2471 /* Avoid making funcall cons up a yet another new vector of arguments 2476 /* Avoid making funcall cons up a yet another new vector of arguments
2472 by explicitly supplying nil's for optional values */ 2477 by explicitly supplying nil's for optional values */
2473 funcall_args = (Lisp_Object *) alloca ((1 + XSUBR (fun)->max_args) 2478 SAFE_ALLOCA_LISP (funcall_args, 1 + XSUBR (fun)->max_args);
2474 * sizeof (Lisp_Object));
2475 for (i = numargs; i < XSUBR (fun)->max_args;) 2479 for (i = numargs; i < XSUBR (fun)->max_args;)
2476 funcall_args[++i] = Qnil; 2480 funcall_args[++i] = Qnil;
2477 GCPRO1 (*funcall_args); 2481 GCPRO1 (*funcall_args);
@@ -2483,8 +2487,7 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
2483 function itself as well as its arguments. */ 2487 function itself as well as its arguments. */
2484 if (!funcall_args) 2488 if (!funcall_args)
2485 { 2489 {
2486 funcall_args = (Lisp_Object *) alloca ((1 + numargs) 2490 SAFE_ALLOCA_LISP (funcall_args, 1 + numargs);
2487 * sizeof (Lisp_Object));
2488 GCPRO1 (*funcall_args); 2491 GCPRO1 (*funcall_args);
2489 gcpro1.nvars = 1 + numargs; 2492 gcpro1.nvars = 1 + numargs;
2490 } 2493 }
@@ -2500,7 +2503,11 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
2500 } 2503 }
2501 2504
2502 /* By convention, the caller needs to gcpro Ffuncall's args. */ 2505 /* By convention, the caller needs to gcpro Ffuncall's args. */
2503 RETURN_UNGCPRO (Ffuncall (gcpro1.nvars, funcall_args)); 2506 retval = Ffuncall (gcpro1.nvars, funcall_args);
2507 UNGCPRO;
2508 SAFE_FREE ();
2509
2510 return retval;
2504} 2511}
2505 2512
2506/* Run hook variables in various ways. */ 2513/* Run hook variables in various ways. */
@@ -3065,9 +3072,10 @@ apply_lambda (Lisp_Object fun, Lisp_Object args, int eval_flag)
3065 struct gcpro gcpro1, gcpro2, gcpro3; 3072 struct gcpro gcpro1, gcpro2, gcpro3;
3066 register int i; 3073 register int i;
3067 register Lisp_Object tem; 3074 register Lisp_Object tem;
3075 USE_SAFE_ALLOCA;
3068 3076
3069 numargs = Flength (args); 3077 numargs = Flength (args);
3070 arg_vector = (Lisp_Object *) alloca (XINT (numargs) * sizeof (Lisp_Object)); 3078 SAFE_ALLOCA_LISP (arg_vector, XINT (numargs));
3071 args_left = args; 3079 args_left = args;
3072 3080
3073 GCPRO3 (*arg_vector, args_left, fun); 3081 GCPRO3 (*arg_vector, args_left, fun);
@@ -3096,6 +3104,7 @@ apply_lambda (Lisp_Object fun, Lisp_Object args, int eval_flag)
3096 tem = call_debugger (Fcons (Qexit, Fcons (tem, Qnil))); 3104 tem = call_debugger (Fcons (Qexit, Fcons (tem, Qnil)));
3097 /* Don't do it again when we return to eval. */ 3105 /* Don't do it again when we return to eval. */
3098 backtrace_list->debug_on_exit = 0; 3106 backtrace_list->debug_on_exit = 0;
3107 SAFE_FREE ();
3099 return tem; 3108 return tem;
3100} 3109}
3101 3110
diff --git a/src/image.c b/src/image.c
index 34d89d2e195..ae4bf2fd937 100644
--- a/src/image.c
+++ b/src/image.c
@@ -583,7 +583,7 @@ Lisp_Object Qxbm;
583 583
584Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data; 584Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data;
585Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask; 585Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
586Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask; 586Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask, QCgeometry, QCcrop, QCrotation;
587 587
588/* Other symbols. */ 588/* Other symbols. */
589 589
@@ -7342,6 +7342,510 @@ gif_load (struct frame *f, struct image *img)
7342#endif /* HAVE_GIF */ 7342#endif /* HAVE_GIF */
7343 7343
7344 7344
7345/***********************************************************************
7346 imagemagick
7347***********************************************************************/
7348#if defined (HAVE_IMAGEMAGICK)
7349Lisp_Object Vimagemagick_render_type;
7350
7351/* The symbol `imagemagick' identifying images of this type. */
7352
7353Lisp_Object Qimagemagick;
7354Lisp_Object Vimagemagick_render_type;
7355
7356/* Indices of image specification fields in imagemagick_format, below. */
7357
7358enum imagemagick_keyword_index
7359 {
7360 IMAGEMAGICK_TYPE,
7361 IMAGEMAGICK_DATA,
7362 IMAGEMAGICK_FILE,
7363 IMAGEMAGICK_ASCENT,
7364 IMAGEMAGICK_MARGIN,
7365 IMAGEMAGICK_RELIEF,
7366 IMAGEMAGICK_ALGORITHM,
7367 IMAGEMAGICK_HEURISTIC_MASK,
7368 IMAGEMAGICK_MASK,
7369 IMAGEMAGICK_BACKGROUND,
7370 IMAGEMAGICK_HEIGHT,
7371 IMAGEMAGICK_WIDTH,
7372 IMAGEMAGICK_ROTATION,
7373 IMAGEMAGICK_CROP,
7374 IMAGEMAGICK_LAST
7375 };
7376
7377/* Vector of image_keyword structures describing the format
7378 of valid user-defined image specifications. */
7379
7380static struct image_keyword imagemagick_format[IMAGEMAGICK_LAST] =
7381 {
7382 {":type", IMAGE_SYMBOL_VALUE, 1},
7383 {":data", IMAGE_STRING_VALUE, 0},
7384 {":file", IMAGE_STRING_VALUE, 0},
7385 {":ascent", IMAGE_ASCENT_VALUE, 0},
7386 {":margin", IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR, 0},
7387 {":relief", IMAGE_INTEGER_VALUE, 0},
7388 {":conversion", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
7389 {":heuristic-mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
7390 {":mask", IMAGE_DONT_CHECK_VALUE_TYPE, 0},
7391 {":background", IMAGE_STRING_OR_NIL_VALUE, 0},
7392 {":height", IMAGE_INTEGER_VALUE, 0},
7393 {":width", IMAGE_INTEGER_VALUE, 0},
7394 {":rotation", IMAGE_NUMBER_VALUE, 0},
7395 {":crop", IMAGE_DONT_CHECK_VALUE_TYPE, 0}
7396 };
7397/* Free X resources of imagemagick image IMG which is used on frame F. */
7398
7399static void
7400imagemagick_clear_image (struct frame *f,
7401 struct image *img)
7402{
7403 x_clear_image (f, img);
7404}
7405
7406
7407
7408/* Return non-zero if OBJECT is a valid IMAGEMAGICK image specification. Do
7409 this by calling parse_image_spec and supplying the keywords that
7410 identify the IMAGEMAGICK format. */
7411
7412static int
7413imagemagick_image_p (Lisp_Object object)
7414{
7415 struct image_keyword fmt[IMAGEMAGICK_LAST];
7416 bcopy (imagemagick_format, fmt, sizeof fmt);
7417
7418 if (!parse_image_spec (object, fmt, IMAGEMAGICK_LAST, Qimagemagick))
7419 return 0;
7420
7421 /* Must specify either the :data or :file keyword. */
7422 return fmt[IMAGEMAGICK_FILE].count + fmt[IMAGEMAGICK_DATA].count == 1;
7423}
7424
7425/* The GIF library also defines DrawRectangle, but its never used in Emacs.
7426 Therefore rename the function so it doesnt collide with ImageMagick. */
7427#define DrawRectangle DrawRectangleGif
7428#include <wand/MagickWand.h>
7429
7430/* imagemagick_load_image is a helper function for imagemagick_load,
7431 which does the actual loading given contents and size, apart from
7432 frame and image structures, passed from imagemagick_load.
7433
7434 Uses librimagemagick to do most of the image processing.
7435
7436 non-zero when successful.
7437*/
7438
7439static int
7440imagemagick_load_image (/* Pointer to emacs frame structure. */
7441 struct frame *f,
7442 /* Pointer to emacs image structure. */
7443 struct image *img,
7444 /* String containing the IMAGEMAGICK data to
7445 be parsed. */
7446 unsigned char *contents,
7447 /* Size of data in bytes. */
7448 unsigned int size,
7449 /* Filename, either pass filename or
7450 contents/size. */
7451 unsigned char *filename)
7452{
7453 size_t width;
7454 size_t height;
7455
7456 MagickBooleanType
7457 status;
7458
7459 XImagePtr ximg;
7460 Lisp_Object specified_bg;
7461 XColor background;
7462 int x;
7463 int y;
7464
7465 MagickWand *image_wand;
7466 MagickWand *ping_wand;
7467 PixelIterator *iterator;
7468 PixelWand **pixels;
7469 MagickPixelPacket pixel;
7470 Lisp_Object image;
7471 Lisp_Object value;
7472 Lisp_Object crop, geometry;
7473 long ino;
7474 int desired_width, desired_height;
7475 double rotation;
7476 int imagemagick_rendermethod;
7477 int pixelwidth;
7478 ImageInfo *image_info;
7479 ExceptionInfo *exception;
7480 Image * im_image;
7481
7482
7483 /* Handle image index for image types who can contain more than one
7484 image. Interface :index is same as for GIF. First we "ping" the
7485 image to see how many sub-images it contains. Pinging is faster
7486 than loading the image to find out things about it. */
7487 image = image_spec_value (img->spec, QCindex, NULL);
7488 ino = INTEGERP (image) ? XFASTINT (image) : 0;
7489 ping_wand=NewMagickWand();
7490 MagickSetResolution(ping_wand, 2, 2);
7491 if (filename != NULL)
7492 {
7493 status = MagickPingImage(ping_wand, filename);
7494 }
7495 else
7496 {
7497 status = MagickPingImageBlob(ping_wand, contents, size);
7498 }
7499
7500 if (ino >= MagickGetNumberImages(ping_wand))
7501 {
7502 image_error ("Invalid image number `%s' in image `%s'",
7503 image, img->spec);
7504 UNGCPRO;
7505 return 0;
7506 }
7507
7508 if (MagickGetNumberImages(ping_wand) > 1)
7509 img->data.lisp_val =
7510 Fcons (Qcount,
7511 Fcons (make_number (MagickGetNumberImages(ping_wand)),
7512 img->data.lisp_val));
7513
7514 DestroyMagickWand (ping_wand);
7515 /* Now, after pinging, we know how many images are inside the
7516 file. If its not a bundle, just one. */
7517
7518 if (filename != NULL)
7519 {
7520 image_info=CloneImageInfo((ImageInfo *) NULL);
7521 (void) strcpy(image_info->filename, filename);
7522 image_info -> number_scenes = 1;
7523 image_info -> scene = ino;
7524 exception=AcquireExceptionInfo();
7525
7526 im_image = ReadImage (image_info, exception);
7527 CatchException(exception);
7528
7529 image_wand = NewMagickWandFromImage(im_image);
7530 }
7531 else
7532 {
7533 image_wand = NewMagickWand();
7534 status = MagickReadImageBlob(image_wand, contents, size);
7535 }
7536 image_error ("im read failed", Qnil, Qnil);
7537 if (status == MagickFalse) goto imagemagick_error;
7538
7539 /* If width and/or height is set in the display spec assume we want
7540 to scale to those values. if either h or w is unspecified, the
7541 unspecified should be calculated from the specified to preserve
7542 aspect ratio. */
7543
7544 value = image_spec_value (img->spec, QCwidth, NULL);
7545 desired_width = (INTEGERP (value) ? XFASTINT (value) : -1);
7546 value = image_spec_value (img->spec, QCheight, NULL);
7547 desired_height = (INTEGERP (value) ? XFASTINT (value) : -1);
7548
7549 height = MagickGetImageHeight (image_wand);
7550 width = MagickGetImageWidth (image_wand);
7551
7552 if(desired_width != -1 && desired_height == -1)
7553 {
7554 /* w known, calculate h. */
7555 desired_height = ( (double)desired_width / width ) * height;
7556 }
7557 if(desired_width == -1 && desired_height != -1)
7558 {
7559 /* h known, calculate w. */
7560 desired_width = ( (double)desired_height / height ) * width;
7561 }
7562 if(desired_width != -1 && desired_height != -1)
7563 {
7564 status = MagickScaleImage(image_wand, desired_width, desired_height);
7565 if (status == MagickFalse) {
7566 image_error ("Imagemagick scale failed", Qnil, Qnil);
7567 goto imagemagick_error;
7568 }
7569 }
7570
7571
7572 /* crop behaves similar to image slicing in Emacs but is more memory
7573 efficient */
7574 crop = image_spec_value (img->spec, QCcrop, NULL);
7575
7576 if(CONSP (crop))
7577 {
7578 /*
7579 after some testing, it seems MagickCropImage is the fastest
7580 crop function in ImageMagick. This crop function seems to do
7581 less copying than the alternatives, but it still reads the
7582 entire image into memory before croping, which is aparently
7583 difficult to avoid when using imagemagick. */
7584
7585 int w,h,x,y;
7586 w=XFASTINT(XCAR(crop));
7587 h=XFASTINT(XCAR(XCDR(crop)));
7588 x=XFASTINT(XCAR(XCDR(XCDR(crop))));
7589 y=XFASTINT(XCAR(XCDR(XCDR(XCDR(crop)))));
7590 MagickCropImage(image_wand, w,h, x,y);
7591 }
7592
7593 /* Furthermore :rotation. we need background color and angle for
7594 rotation. */
7595 /*
7596 TODO background handling for rotation specified_bg =
7597 image_spec_value (img->spec, QCbackground, NULL); if (!STRINGP
7598 (specified_bg). */
7599 value = image_spec_value (img->spec, QCrotation, NULL);
7600 if (FLOATP (value))
7601 {
7602 PixelWand* background = NewPixelWand();
7603 PixelSetColor (background, "#ffffff");/*TODO remove hardcode*/
7604
7605 rotation = extract_float (value);
7606
7607 status = MagickRotateImage (image_wand, background, rotation);
7608 DestroyPixelWand (background);
7609 if (status == MagickFalse)
7610 {
7611 image_error ("Imagemagick image rotate failed", Qnil, Qnil);
7612 goto imagemagick_error;
7613 }
7614 }
7615
7616 /* Finaly we are done manipulating the image, figure out resulting
7617 width, height, and then transfer ownerwship to Emacs. */
7618 height = MagickGetImageHeight (image_wand);
7619 width = MagickGetImageWidth (image_wand);
7620 if (status == MagickFalse)
7621 {
7622 image_error ("Imagemagick image get size failed", Qnil, Qnil);
7623 goto imagemagick_error;
7624 }
7625
7626 if (! check_image_size (f, width, height))
7627 {
7628 image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
7629 goto imagemagick_error;
7630 }
7631
7632 /* We can now get a valid pixel buffer from the imagemagick file, if all
7633 went ok. */
7634
7635 init_color_table ();
7636 imagemagick_rendermethod = (INTEGERP (Vimagemagick_render_type)
7637 ? XFASTINT (Vimagemagick_render_type) : 0);
7638 if (imagemagick_rendermethod == 0)
7639 {
7640 /* Try to create a x pixmap to hold the imagemagick pixmap. */
7641 if (!x_create_x_image_and_pixmap (f, width, height, 0,
7642 &ximg, &img->pixmap))
7643 {
7644 image_error("Imagemagick X bitmap allocation failure", Qnil, Qnil);
7645 goto imagemagick_error;
7646 }
7647
7648 /* Copy imagegmagick image to x with primitive yet robust pixel
7649 pusher loop. This has been tested a lot with many different
7650 images. */
7651
7652 /* Copy pixels from the imagemagick image structure to the x image map. */
7653 iterator = NewPixelIterator (image_wand);
7654 if ((iterator == (PixelIterator *) NULL))
7655 {
7656 image_error ("Imagemagick pixel iterator creation failed",
7657 Qnil, Qnil);
7658 goto imagemagick_error;
7659 }
7660
7661 for (y = 0; y < (long) MagickGetImageHeight(image_wand); y++)
7662 {
7663 pixels = PixelGetNextIteratorRow (iterator, &width);
7664 if ((pixels == (PixelWand **) NULL))
7665 break;
7666 for (x = 0; x < (long) width; x++)
7667 {
7668 PixelGetMagickColor (pixels[x], &pixel);
7669 XPutPixel (ximg, x, y,
7670 lookup_rgb_color (f,
7671 pixel.red,
7672 pixel.green,
7673 pixel.blue));
7674 }
7675 }
7676 DestroyPixelIterator (iterator);
7677 }
7678
7679 if (imagemagick_rendermethod == 1)
7680 {
7681 /* Magicexportimage is normaly faster than pixelpushing. This
7682 method is also well tested. Some aspects of this method are
7683 ad-hoc and needs to be more researched. */
7684 int imagedepth = 24;/*MagickGetImageDepth(image_wand);*/
7685 char* exportdepth = imagedepth <= 8 ? "I" : "BGRP";/*"RGBP";*/
7686 /* Try to create a x pixmap to hold the imagemagick pixmap. */
7687 if (!x_create_x_image_and_pixmap (f, width, height, imagedepth,
7688 &ximg, &img->pixmap)){
7689 image_error("Imagemagick X bitmap allocation failure", Qnil, Qnil);
7690 goto imagemagick_error;
7691 }
7692
7693
7694 /* Oddly, the below code doesnt seem to work:*/
7695 /* switch(ximg->bitmap_unit){ */
7696 /* case 8: */
7697 /* pixelwidth=CharPixel; */
7698 /* break; */
7699 /* case 16: */
7700 /* pixelwidth=ShortPixel; */
7701 /* break; */
7702 /* case 32: */
7703 /* pixelwidth=LongPixel; */
7704 /* break; */
7705 /* } */
7706 /*
7707 Here im just guessing the format of the bitmap.
7708 happens to work fine for:
7709 - bw djvu images
7710 on rgb display.
7711 seems about 3 times as fast as pixel pushing(not carefully measured)
7712 */
7713 pixelwidth = CharPixel;/*??? TODO figure out*/
7714#ifdef HAVE_MAGICKEXPORTIMAGEPIXELS
7715 MagickExportImagePixels(image_wand,
7716 0, 0,
7717 width, height,
7718 exportdepth,
7719 pixelwidth,
7720 /*&(img->pixmap));*/
7721 ximg->data);
7722#else
7723 image_error("You dont have MagickExportImagePixels, upgrade ImageMagick!",
7724 Qnil, Qnil);
7725#endif
7726 }
7727
7728
7729#ifdef COLOR_TABLE_SUPPORT
7730 /* Remember colors allocated for this image. */
7731 img->colors = colors_in_color_table (&img->ncolors);
7732 free_color_table ();
7733#endif /* COLOR_TABLE_SUPPORT */
7734
7735
7736 img->width = width;
7737 img->height = height;
7738
7739 /* Put the image into the pixmap, then free the X image and its
7740 buffer. */
7741 x_put_x_image (f, ximg, img->pixmap, width, height);
7742 x_destroy_x_image (ximg);
7743
7744
7745 /* Final cleanup. image_wand should be the only resource left. */
7746 DestroyMagickWand (image_wand);
7747
7748 return 1;
7749
7750 imagemagick_error:
7751 /* TODO more cleanup. */
7752 image_error ("Error parsing IMAGEMAGICK image `%s'", img->spec, Qnil);
7753 return 0;
7754}
7755
7756
7757/* Load IMAGEMAGICK image IMG for use on frame F. Value is non-zero if
7758 successful. this function will go into the imagemagick_type structure, and
7759 the prototype thus needs to be compatible with that structure. */
7760
7761static int
7762imagemagick_load (struct frame *f,
7763 struct image *img)
7764{
7765 int success_p = 0;
7766 Lisp_Object file_name;
7767
7768 /* If IMG->spec specifies a file name, create a non-file spec from it. */
7769 file_name = image_spec_value (img->spec, QCfile, NULL);
7770 if (STRINGP (file_name))
7771 {
7772 Lisp_Object file;
7773 unsigned char *contents;
7774 int size;
7775 struct gcpro gcpro1;
7776
7777 file = x_find_image_file (file_name);
7778 GCPRO1 (file);
7779 if (!STRINGP (file))
7780 {
7781 image_error ("Cannot find image file `%s'", file_name, Qnil);
7782 UNGCPRO;
7783 return 0;
7784 }
7785 success_p = imagemagick_load_image (f, img, 0, 0, SDATA(file_name));
7786 UNGCPRO;
7787 }
7788 /* Else its not a file, its a lisp object. Load the image from a
7789 lisp object rather than a file. */
7790 else
7791 {
7792 Lisp_Object data;
7793
7794 data = image_spec_value (img->spec, QCdata, NULL);
7795 success_p = imagemagick_load_image (f, img, SDATA (data),
7796 SBYTES (data), NULL);
7797 }
7798
7799 return success_p;
7800}
7801
7802/* Structure describing the image type `imagemagick'. Its the same
7803 type of structure defined for all image formats, handled by Emacs
7804 image functions. See struct image_type in dispextern.h. */
7805
7806static struct image_type imagemagick_type =
7807 {
7808 /* An identifier showing that this is an image structure for the
7809 IMAGEMAGICK format. */
7810 &Qimagemagick,
7811 /* Handle to a function that can be used to identify a IMAGEMAGICK
7812 file. */
7813 imagemagick_image_p,
7814 /* Handle to function used to load a IMAGEMAGICK file. */
7815 imagemagick_load,
7816 /* Handle to function to free resources for IMAGEMAGICK. */
7817 imagemagick_clear_image,
7818 /* An internal field to link to the next image type in a list of
7819 image types, will be filled in when registering the format. */
7820 NULL
7821 };
7822
7823
7824
7825
7826DEFUN ("imagemagick-types", Fimagemagick_types, Simagemagick_types, 0, 0, 0,
7827 doc: /* Return image file types supported by ImageMagick.
7828 Since ImageMagick recognizes a lot of file-types that clash with Emacs,
7829 such as .c, we want to be able to alter the list at the lisp level. */)
7830 (void)
7831{
7832 Lisp_Object typelist = Qnil;
7833 size_t numf;
7834 ExceptionInfo ex;
7835 char** imtypes = GetMagickList ("*", &numf, &ex);
7836 int i;
7837 Lisp_Object Qimagemagicktype;
7838 for (i = 0; i < numf; i++)
7839 {
7840 Qimagemagicktype = intern (imtypes[i]);
7841 typelist = Fcons (Qimagemagicktype, typelist);
7842 }
7843 return typelist;
7844}
7845
7846#endif /* defined (HAVE_IMAGEMAGICK) */
7847
7848
7345 7849
7346/*********************************************************************** 7850/***********************************************************************
7347 SVG 7851 SVG
@@ -8117,6 +8621,15 @@ of `image-library-alist', which see). */)
8117 return CHECK_LIB_AVAILABLE (&svg_type, init_svg_functions, libraries); 8621 return CHECK_LIB_AVAILABLE (&svg_type, init_svg_functions, libraries);
8118#endif 8622#endif
8119 8623
8624#if defined (HAVE_IMAGEMAGICK)
8625 if (EQ (type, Qimagemagick)){
8626 /* MagickWandGenesis() initalizes the imagemagick library. */
8627 MagickWandGenesis();
8628 return CHECK_LIB_AVAILABLE (&imagemagick_type, init_imagemagick_functions,
8629 libraries);
8630 }
8631#endif
8632
8120#ifdef HAVE_GHOSTSCRIPT 8633#ifdef HAVE_GHOSTSCRIPT
8121 if (EQ (type, Qpostscript)) 8634 if (EQ (type, Qpostscript))
8122 return CHECK_LIB_AVAILABLE (&gs_type, init_gs_functions, libraries); 8635 return CHECK_LIB_AVAILABLE (&gs_type, init_gs_functions, libraries);
@@ -8202,6 +8715,12 @@ non-numeric, there is no explicit limit on the size of images. */);
8202 staticpro (&QCheuristic_mask); 8715 staticpro (&QCheuristic_mask);
8203 QCindex = intern_c_string (":index"); 8716 QCindex = intern_c_string (":index");
8204 staticpro (&QCindex); 8717 staticpro (&QCindex);
8718 QCgeometry = intern (":geometry");
8719 staticpro (&QCgeometry);
8720 QCcrop = intern (":crop");
8721 staticpro (&QCcrop);
8722 QCrotation = intern (":rotation");
8723 staticpro (&QCrotation);
8205 QCmatrix = intern_c_string (":matrix"); 8724 QCmatrix = intern_c_string (":matrix");
8206 staticpro (&QCmatrix); 8725 staticpro (&QCmatrix);
8207 QCcolor_adjustment = intern_c_string (":color-adjustment"); 8726 QCcolor_adjustment = intern_c_string (":color-adjustment");
@@ -8262,6 +8781,12 @@ non-numeric, there is no explicit limit on the size of images. */);
8262 ADD_IMAGE_TYPE (Qpng); 8781 ADD_IMAGE_TYPE (Qpng);
8263#endif 8782#endif
8264 8783
8784#if defined (HAVE_IMAGEMAGICK)
8785 Qimagemagick = intern ("imagemagick");
8786 staticpro (&Qimagemagick);
8787 ADD_IMAGE_TYPE (Qimagemagick);
8788#endif
8789
8265#if defined (HAVE_RSVG) 8790#if defined (HAVE_RSVG)
8266 Qsvg = intern_c_string ("svg"); 8791 Qsvg = intern_c_string ("svg");
8267 staticpro (&Qsvg); 8792 staticpro (&Qsvg);
@@ -8278,6 +8803,9 @@ non-numeric, there is no explicit limit on the size of images. */);
8278#endif /* HAVE_RSVG */ 8803#endif /* HAVE_RSVG */
8279 8804
8280 defsubr (&Sinit_image_library); 8805 defsubr (&Sinit_image_library);
8806#ifdef HAVE_IMAGEMAGICK
8807 defsubr (&Simagemagick_types);
8808#endif
8281 defsubr (&Sclear_image_cache); 8809 defsubr (&Sclear_image_cache);
8282 defsubr (&Simage_flush); 8810 defsubr (&Simage_flush);
8283 defsubr (&Simage_size); 8811 defsubr (&Simage_size);
@@ -8308,6 +8836,11 @@ The value can also be nil, meaning the cache is never cleared.
8308 8836
8309The function `clear-image-cache' disregards this variable. */); 8837The function `clear-image-cache' disregards this variable. */);
8310 Vimage_cache_eviction_delay = make_number (300); 8838 Vimage_cache_eviction_delay = make_number (300);
8839#ifdef HAVE_IMAGEMAGICK
8840 DEFVAR_LISP ("imagemagick-render-type", &Vimagemagick_render_type,
8841 doc: /* Choose between ImageMagick render methods. */);
8842#endif
8843
8311} 8844}
8312 8845
8313void 8846void
diff --git a/src/keyboard.c b/src/keyboard.c
index 2fd13c4ae24..cac051f7882 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -368,7 +368,7 @@ Lisp_Object Vselect_active_regions;
368 Used by the `select-active-regions' feature. */ 368 Used by the `select-active-regions' feature. */
369Lisp_Object Vsaved_region_selection; 369Lisp_Object Vsaved_region_selection;
370 370
371Lisp_Object Qx_set_selection, QPRIMARY; 371Lisp_Object Qx_set_selection, QPRIMARY, Qhandle_switch_frame;
372 372
373Lisp_Object Qself_insert_command; 373Lisp_Object Qself_insert_command;
374Lisp_Object Qforward_char; 374Lisp_Object Qforward_char;
@@ -1799,10 +1799,11 @@ command_loop_1 (void)
1799 { 1799 {
1800 /* Even if not deactivating the mark, set PRIMARY if 1800 /* Even if not deactivating the mark, set PRIMARY if
1801 `select-active-regions' is non-nil. */ 1801 `select-active-regions' is non-nil. */
1802 if (EQ (Vselect_active_regions, Qonly) 1802 if ((EQ (Vselect_active_regions, Qonly)
1803 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) 1803 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
1804 : (!NILP (Vselect_active_regions) 1804 : (!NILP (Vselect_active_regions)
1805 && !NILP (Vtransient_mark_mode))) 1805 && !NILP (Vtransient_mark_mode)))
1806 && !EQ (Vthis_command, Qhandle_switch_frame))
1806 { 1807 {
1807 int beg = XINT (Fmarker_position (current_buffer->mark)); 1808 int beg = XINT (Fmarker_position (current_buffer->mark));
1808 int end = XINT (make_number (PT)); 1809 int end = XINT (make_number (PT));
@@ -10345,13 +10346,12 @@ give to the command you invoke, if it asks for an argument. */)
10345 (Lisp_Object prefixarg) 10346 (Lisp_Object prefixarg)
10346{ 10347{
10347 Lisp_Object function; 10348 Lisp_Object function;
10348 char buf[40];
10349 int saved_last_point_position; 10349 int saved_last_point_position;
10350 Lisp_Object saved_keys, saved_last_point_position_buffer; 10350 Lisp_Object saved_keys, saved_last_point_position_buffer;
10351 Lisp_Object bindings, value; 10351 Lisp_Object bindings, value;
10352 struct gcpro gcpro1, gcpro2, gcpro3; 10352 struct gcpro gcpro1, gcpro2, gcpro3;
10353#ifdef HAVE_WINDOW_SYSTEM 10353#ifdef HAVE_WINDOW_SYSTEM
10354 /* The call to Fcompleting_read wil start and cancel the hourglass, 10354 /* The call to Fcompleting_read will start and cancel the hourglass,
10355 but if the hourglass was already scheduled, this means that no 10355 but if the hourglass was already scheduled, this means that no
10356 hourglass will be shown for the actual M-x command itself. 10356 hourglass will be shown for the actual M-x command itself.
10357 So we restart it if it is already scheduled. Note that checking 10357 So we restart it if it is already scheduled. Note that checking
@@ -10364,31 +10364,9 @@ give to the command you invoke, if it asks for an argument. */)
10364 XVECTOR (this_command_keys)->contents); 10364 XVECTOR (this_command_keys)->contents);
10365 saved_last_point_position_buffer = last_point_position_buffer; 10365 saved_last_point_position_buffer = last_point_position_buffer;
10366 saved_last_point_position = last_point_position; 10366 saved_last_point_position = last_point_position;
10367 buf[0] = 0;
10368 GCPRO3 (saved_keys, prefixarg, saved_last_point_position_buffer); 10367 GCPRO3 (saved_keys, prefixarg, saved_last_point_position_buffer);
10369 10368
10370 if (EQ (prefixarg, Qminus)) 10369 function = call0 (intern ("read-extended-command"));
10371 strcpy (buf, "- ");
10372 else if (CONSP (prefixarg) && XINT (XCAR (prefixarg)) == 4)
10373 strcpy (buf, "C-u ");
10374 else if (CONSP (prefixarg) && INTEGERP (XCAR (prefixarg)))
10375 sprintf (buf, "%ld ", (long) XINT (XCAR (prefixarg)));
10376 else if (INTEGERP (prefixarg))
10377 sprintf (buf, "%ld ", (long) XINT (prefixarg));
10378
10379 /* This isn't strictly correct if execute-extended-command
10380 is bound to anything else. Perhaps it should use
10381 this_command_keys? */
10382 strcat (buf, "M-x ");
10383
10384 /* Prompt with buf, and then read a string, completing from and
10385 restricting to the set of all defined commands. Don't provide
10386 any initial input. Save the command read on the extended-command
10387 history list. */
10388 function = Fcompleting_read (build_string (buf),
10389 Vobarray, Qcommandp,
10390 Qt, Qnil, Qextended_command_history, Qnil,
10391 Qnil);
10392 10370
10393#ifdef HAVE_WINDOW_SYSTEM 10371#ifdef HAVE_WINDOW_SYSTEM
10394 if (hstarted) start_hourglass (); 10372 if (hstarted) start_hourglass ();
@@ -11506,11 +11484,11 @@ init_keyboard (void)
11506 Emacs on SIGINT when there are no termcap frames on the 11484 Emacs on SIGINT when there are no termcap frames on the
11507 controlling terminal. */ 11485 controlling terminal. */
11508 signal (SIGINT, interrupt_signal); 11486 signal (SIGINT, interrupt_signal);
11509#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) 11487#ifndef DOS_NT
11510 /* For systems with SysV TERMIO, C-g is set up for both SIGINT and 11488 /* For systems with SysV TERMIO, C-g is set up for both SIGINT and
11511 SIGQUIT and we can't tell which one it will give us. */ 11489 SIGQUIT and we can't tell which one it will give us. */
11512 signal (SIGQUIT, interrupt_signal); 11490 signal (SIGQUIT, interrupt_signal);
11513#endif /* HAVE_TERMIO */ 11491#endif /* not DOS_NT */
11514 } 11492 }
11515/* Note SIGIO has been undef'd if FIONREAD is missing. */ 11493/* Note SIGIO has been undef'd if FIONREAD is missing. */
11516#ifdef SIGIO 11494#ifdef SIGIO
@@ -11725,6 +11703,8 @@ syms_of_keyboard (void)
11725 staticpro (&Qx_set_selection); 11703 staticpro (&Qx_set_selection);
11726 QPRIMARY = intern_c_string ("PRIMARY"); 11704 QPRIMARY = intern_c_string ("PRIMARY");
11727 staticpro (&QPRIMARY); 11705 staticpro (&QPRIMARY);
11706 Qhandle_switch_frame = intern_c_string ("handle-switch-frame");
11707 staticpro (&Qhandle_switch_frame);
11728 11708
11729 Qinput_method_exit_on_first_char = intern_c_string ("input-method-exit-on-first-char"); 11709 Qinput_method_exit_on_first_char = intern_c_string ("input-method-exit-on-first-char");
11730 staticpro (&Qinput_method_exit_on_first_char); 11710 staticpro (&Qinput_method_exit_on_first_char);
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index fc86ae6cb0c..8d99d6cedfe 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -1357,6 +1357,7 @@ $(BLD)/sysdep.$(O) : \
1357 $(SRC)/frame.h \ 1357 $(SRC)/frame.h \
1358 $(SRC)/keyboard.h \ 1358 $(SRC)/keyboard.h \
1359 $(SRC)/process.h \ 1359 $(SRC)/process.h \
1360 $(SRC)/sysselect.h \
1360 $(SRC)/syssignal.h \ 1361 $(SRC)/syssignal.h \
1361 $(SRC)/systime.h \ 1362 $(SRC)/systime.h \
1362 $(SRC)/systty.h \ 1363 $(SRC)/systty.h \
diff --git a/src/process.c b/src/process.c
index 4a658623077..f348dca7d35 100644
--- a/src/process.c
+++ b/src/process.c
@@ -31,9 +31,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31#ifdef HAVE_INTTYPES_H 31#ifdef HAVE_INTTYPES_H
32#include <inttypes.h> 32#include <inttypes.h>
33#endif 33#endif
34#ifdef STDC_HEADERS
35#include <stdlib.h> 34#include <stdlib.h>
36#endif
37 35
38#ifdef HAVE_UNISTD_H 36#ifdef HAVE_UNISTD_H
39#include <unistd.h> 37#include <unistd.h>
@@ -61,9 +59,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
61 59
62#if defined(HAVE_SYS_IOCTL_H) 60#if defined(HAVE_SYS_IOCTL_H)
63#include <sys/ioctl.h> 61#include <sys/ioctl.h>
64#if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5)
65#include <fcntl.h>
66#endif /* HAVE_PTYS and no O_NDELAY */
67#if defined(HAVE_NET_IF_H) 62#if defined(HAVE_NET_IF_H)
68#include <net/if.h> 63#include <net/if.h>
69#endif /* HAVE_NET_IF_H */ 64#endif /* HAVE_NET_IF_H */
@@ -182,16 +177,9 @@ extern Lisp_Object QCfilter;
182 177
183extern const char *get_operating_system_release (void); 178extern const char *get_operating_system_release (void);
184 179
185/* Serial processes require termios or Windows. */
186#if defined (HAVE_TERMIOS) || defined (WINDOWSNT)
187#define HAVE_SERIAL
188#endif
189
190#ifdef HAVE_SERIAL
191/* From sysdep.c or w32.c */ 180/* From sysdep.c or w32.c */
192extern int serial_open (char *port); 181extern int serial_open (char *port);
193extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact); 182extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact);
194#endif
195 183
196#ifndef HAVE_H_ERRNO 184#ifndef HAVE_H_ERRNO
197extern int h_errno; 185extern int h_errno;
@@ -1903,7 +1891,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1903 setpgrp (); 1891 setpgrp ();
1904#endif /* USG */ 1892#endif /* USG */
1905#endif /* not HAVE_SETSID */ 1893#endif /* not HAVE_SETSID */
1906#if defined (HAVE_TERMIOS) && defined (LDISC1) 1894#if defined (LDISC1)
1907 if (pty_flag && xforkin >= 0) 1895 if (pty_flag && xforkin >= 0)
1908 { 1896 {
1909 struct termios t; 1897 struct termios t;
@@ -2569,7 +2557,6 @@ OPTION is not a supported option, return nil instead; otherwise return t. */)
2569} 2557}
2570 2558
2571 2559
2572#ifdef HAVE_SERIAL
2573DEFUN ("serial-process-configure", 2560DEFUN ("serial-process-configure",
2574 Fserial_process_configure, 2561 Fserial_process_configure,
2575 Sserial_process_configure, 2562 Sserial_process_configure,
@@ -2865,7 +2852,6 @@ usage: (make-serial-process &rest ARGS) */)
2865 UNGCPRO; 2852 UNGCPRO;
2866 return proc; 2853 return proc;
2867} 2854}
2868#endif /* HAVE_SERIAL */
2869 2855
2870/* Create a network stream/datagram client/server process. Treated 2856/* Create a network stream/datagram client/server process. Treated
2871 exactly like a normal process when reading and writing. Primary 2857 exactly like a normal process when reading and writing. Primary
@@ -5801,9 +5787,6 @@ process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
5801 /* If possible, send signals to the entire pgrp 5787 /* If possible, send signals to the entire pgrp
5802 by sending an input character to it. */ 5788 by sending an input character to it. */
5803 5789
5804 /* TERMIOS is the latest and bestest, and seems most likely to
5805 work. If the system has it, use it. */
5806#ifdef HAVE_TERMIOS
5807 struct termios t; 5790 struct termios t;
5808 cc_t *sig_char = NULL; 5791 cc_t *sig_char = NULL;
5809 5792
@@ -5835,65 +5818,6 @@ process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
5835 } 5818 }
5836 /* If we can't send the signal with a character, 5819 /* If we can't send the signal with a character,
5837 fall through and send it another way. */ 5820 fall through and send it another way. */
5838#else /* ! HAVE_TERMIOS */
5839
5840 /* On Berkeley descendants, the following IOCTL's retrieve the
5841 current control characters. */
5842#if defined (TIOCGLTC) && defined (TIOCGETC)
5843
5844 struct tchars c;
5845 struct ltchars lc;
5846
5847 switch (signo)
5848 {
5849 case SIGINT:
5850 ioctl (p->infd, TIOCGETC, &c);
5851 send_process (proc, &c.t_intrc, 1, Qnil);
5852 return;
5853 case SIGQUIT:
5854 ioctl (p->infd, TIOCGETC, &c);
5855 send_process (proc, &c.t_quitc, 1, Qnil);
5856 return;
5857#ifdef SIGTSTP
5858 case SIGTSTP:
5859 ioctl (p->infd, TIOCGLTC, &lc);
5860 send_process (proc, &lc.t_suspc, 1, Qnil);
5861 return;
5862#endif /* ! defined (SIGTSTP) */
5863 }
5864
5865#else /* ! defined (TIOCGLTC) && defined (TIOCGETC) */
5866
5867 /* On SYSV descendants, the TCGETA ioctl retrieves the current control
5868 characters. */
5869#ifdef TCGETA
5870 struct termio t;
5871 switch (signo)
5872 {
5873 case SIGINT:
5874 ioctl (p->infd, TCGETA, &t);
5875 send_process (proc, &t.c_cc[VINTR], 1, Qnil);
5876 return;
5877 case SIGQUIT:
5878 ioctl (p->infd, TCGETA, &t);
5879 send_process (proc, &t.c_cc[VQUIT], 1, Qnil);
5880 return;
5881#ifdef SIGTSTP
5882 case SIGTSTP:
5883 ioctl (p->infd, TCGETA, &t);
5884 send_process (proc, &t.c_cc[VSWTCH], 1, Qnil);
5885 return;
5886#endif /* ! defined (SIGTSTP) */
5887 }
5888#else /* ! defined (TCGETA) */
5889 Your configuration files are messed up.
5890 /* If your system configuration files define SIGNALS_VIA_CHARACTERS,
5891 you'd better be using one of the alternatives above! */
5892#endif /* ! defined (TCGETA) */
5893#endif /* ! defined (TIOCGLTC) && defined (TIOCGETC) */
5894 /* In this case, the code above should alway return. */
5895 abort ();
5896#endif /* ! defined HAVE_TERMIOS */
5897 5821
5898 /* The code above may fall through if it can't 5822 /* The code above may fall through if it can't
5899 handle the signal. */ 5823 handle the signal. */
@@ -6065,10 +5989,9 @@ traffic. */)
6065#ifdef WINDOWSNT 5989#ifdef WINDOWSNT
6066 if (fd_info[ p->infd ].flags & FILE_SERIAL) 5990 if (fd_info[ p->infd ].flags & FILE_SERIAL)
6067 PurgeComm (fd_info[ p->infd ].hnd, PURGE_RXABORT | PURGE_RXCLEAR); 5991 PurgeComm (fd_info[ p->infd ].hnd, PURGE_RXABORT | PURGE_RXCLEAR);
6068#endif 5992#else /* not WINDOWSNT */
6069#ifdef HAVE_TERMIOS
6070 tcflush (p->infd, TCIFLUSH); 5993 tcflush (p->infd, TCIFLUSH);
6071#endif 5994#endif /* not WINDOWSNT */
6072 } 5995 }
6073 p->command = Qnil; 5996 p->command = Qnil;
6074 return process; 5997 return process;
@@ -6282,10 +6205,10 @@ process has been transmitted to the serial port. */)
6282 send_process (proc, "\004", 1, Qnil); 6205 send_process (proc, "\004", 1, Qnil);
6283 else if (EQ (XPROCESS (proc)->type, Qserial)) 6206 else if (EQ (XPROCESS (proc)->type, Qserial))
6284 { 6207 {
6285#ifdef HAVE_TERMIOS 6208#ifndef WINDOWSNT
6286 if (tcdrain (XPROCESS (proc)->outfd) != 0) 6209 if (tcdrain (XPROCESS (proc)->outfd) != 0)
6287 error ("tcdrain() failed: %s", emacs_strerror (errno)); 6210 error ("tcdrain() failed: %s", emacs_strerror (errno));
6288#endif 6211#endif /* not WINDOWSNT */
6289 /* Do nothing on Windows because writes are blocking. */ 6212 /* Do nothing on Windows because writes are blocking. */
6290 } 6213 }
6291 else 6214 else
@@ -7672,10 +7595,8 @@ The variable takes effect when `start-process' is called. */);
7672 defsubr (&Slist_processes); 7595 defsubr (&Slist_processes);
7673 defsubr (&Sprocess_list); 7596 defsubr (&Sprocess_list);
7674 defsubr (&Sstart_process); 7597 defsubr (&Sstart_process);
7675#ifdef HAVE_SERIAL
7676 defsubr (&Sserial_process_configure); 7598 defsubr (&Sserial_process_configure);
7677 defsubr (&Smake_serial_process); 7599 defsubr (&Smake_serial_process);
7678#endif /* HAVE_SERIAL */
7679 defsubr (&Sset_network_process_option); 7600 defsubr (&Sset_network_process_option);
7680 defsubr (&Smake_network_process); 7601 defsubr (&Smake_network_process);
7681 defsubr (&Sformat_network_address); 7602 defsubr (&Sformat_network_address);
diff --git a/src/puresize.h b/src/puresize.h
index 682e8926135..3c7f92228a0 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -87,7 +87,6 @@ extern EMACS_INT pure[];
87 && (PNTR_COMPARISON_TYPE) XPNTR (obj) >= (PNTR_COMPARISON_TYPE) pure) 87 && (PNTR_COMPARISON_TYPE) XPNTR (obj) >= (PNTR_COMPARISON_TYPE) pure)
88 88
89#else /* not VIRT_ADDR_VARIES */ 89#else /* not VIRT_ADDR_VARIES */
90#ifdef PNTR_COMPARISON_TYPE
91/* When PNTR_COMPARISON_TYPE is not the default (unsigned int). */ 90/* When PNTR_COMPARISON_TYPE is not the default (unsigned int). */
92 91
93extern char my_edata[]; 92extern char my_edata[];
@@ -95,14 +94,6 @@ extern char my_edata[];
95#define PURE_P(obj) \ 94#define PURE_P(obj) \
96 ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) my_edata) 95 ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) my_edata)
97 96
98#else /* not VIRT_ADDRESS_VARIES, not PNTR_COMPARISON_TYPE */
99
100extern char my_edata[];
101
102#define PURE_P(obj) \
103 (XPNTR (obj) < (unsigned int) my_edata)
104
105#endif /* PNTR_COMPARISON_TYPE */
106#endif /* VIRT_ADDRESS_VARIES */ 97#endif /* VIRT_ADDRESS_VARIES */
107 98
108/* arch-tag: fd9b0a91-a70e-4729-a75a-6bb4ca1ce14f 99/* arch-tag: fd9b0a91-a70e-4729-a75a-6bb4ca1ce14f
diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h
index 84920f888e1..0a3d48db639 100644
--- a/src/s/aix4-2.h
+++ b/src/s/aix4-2.h
@@ -55,10 +55,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
55 55
56/* Special items needed to make Emacs run on this system. */ 56/* Special items needed to make Emacs run on this system. */
57 57
58/* The following definition seems to be needed in AIX version 3.1.6.8.
59 It may not have been needed in certain earlier versions. */
60#define HAVE_TCATTR
61
62/* AIX doesn't define this. */ 58/* AIX doesn't define this. */
63#define unix 1 59#define unix 1
64 60
diff --git a/src/s/hpux10-20.h b/src/s/hpux10-20.h
index ee0fa9abe02..d34ff16104b 100644
--- a/src/s/hpux10-20.h
+++ b/src/s/hpux10-20.h
@@ -35,9 +35,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
35 if system supports pty's. 'p' means it is /dev/ptym/ptyp0 */ 35 if system supports pty's. 'p' means it is /dev/ptym/ptyp0 */
36#define FIRST_PTY_LETTER 'p' 36#define FIRST_PTY_LETTER 'p'
37 37
38/* Define HAVE_TERMIO if the system provides sysV-style ioctls 38#define HAVE_TERMIOS
39 for terminal control. */ 39#define NO_TERMIO
40#define HAVE_TERMIO 40
41#define ORDINARY_LINK
41 42
42/* Define HAVE_PTYS if the system supports pty devices. */ 43/* Define HAVE_PTYS if the system supports pty devices. */
43#define HAVE_PTYS 44#define HAVE_PTYS
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index f61fae57eff..4ae5f32e873 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -106,7 +106,6 @@ struct sigaction {
106#define HAVE_SOUND 1 106#define HAVE_SOUND 1
107#define LISP_FLOAT_TYPE 1 107#define LISP_FLOAT_TYPE 1
108 108
109#undef HAVE_SYS_SELECT_H
110#define HAVE_SYS_TIMEB_H 1 109#define HAVE_SYS_TIMEB_H 1
111#define HAVE_SYS_TIME_H 1 110#define HAVE_SYS_TIME_H 1
112#define HAVE_UNISTD_H 1 111#define HAVE_UNISTD_H 1
diff --git a/src/s/unixware.h b/src/s/unixware.h
index ac989d48e2c..81b1b3d97fa 100644
--- a/src/s/unixware.h
+++ b/src/s/unixware.h
@@ -21,8 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include "usg5-4-common.h" 22#include "usg5-4-common.h"
23 23
24/* fnf@cygnus.com says these exist. */
25#define HAVE_TCATTR
26/* #define HAVE_GETWD (appears to be buggy on SVR4.2) */ 24/* #define HAVE_GETWD (appears to be buggy on SVR4.2) */
27#undef HAVE_GETWD 25#undef HAVE_GETWD
28 26
diff --git a/src/sysdep.c b/src/sysdep.c
index 2ae3c509522..e7d35d46bf7 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -35,15 +35,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
35#endif 35#endif
36 36
37#include "lisp.h" 37#include "lisp.h"
38/* Including stdlib.h isn't necessarily enough to get srandom
39 declared, e.g. without __USE_XOPEN_EXTENDED with glibc 2. */
40
41/* The w32 build defines select stuff in w32.h, which is included by
42 sys/select.h (included below). */
43#ifndef WINDOWSNT
44#include "sysselect.h" 38#include "sysselect.h"
45#endif
46
47#include "blockinput.h" 39#include "blockinput.h"
48 40
49#ifdef WINDOWSNT 41#ifdef WINDOWSNT
@@ -84,17 +76,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
84#include <fcntl.h> 76#include <fcntl.h>
85#endif 77#endif
86 78
87#ifndef MSDOS
88#include <sys/ioctl.h>
89#endif
90
91#include "systty.h" 79#include "systty.h"
92#include "syswait.h" 80#include "syswait.h"
93 81
94#if defined (USG) 82#ifdef HAVE_SYS_UTSNAME_H
95#include <sys/utsname.h> 83#include <sys/utsname.h>
96#include <memory.h> 84#include <memory.h>
97#endif /* USG */ 85#endif /* HAVE_SYS_UTSNAME_H */
98 86
99#include "keyboard.h" 87#include "keyboard.h"
100#include "frame.h" 88#include "frame.h"
@@ -149,17 +137,6 @@ static const int baud_convert[] =
149 1800, 2400, 4800, 9600, 19200, 38400 137 1800, 2400, 4800, 9600, 19200, 38400
150 }; 138 };
151 139
152#ifdef HAVE_SPEED_T
153#include <termios.h>
154#else
155#if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T)
156#else
157#if defined (HAVE_TERMIOS_H) && defined (GNU_LINUX)
158#include <termios.h>
159#endif
160#endif
161#endif
162
163int emacs_ospeed; 140int emacs_ospeed;
164 141
165void croak (char *) NO_RETURN; 142void croak (char *) NO_RETURN;
@@ -308,32 +285,11 @@ init_baud_rate (int fd)
308#ifdef DOS_NT 285#ifdef DOS_NT
309 emacs_ospeed = 15; 286 emacs_ospeed = 15;
310#else /* not DOS_NT */ 287#else /* not DOS_NT */
311#ifdef HAVE_TERMIOS
312 struct termios sg; 288 struct termios sg;
313 289
314 sg.c_cflag = B9600; 290 sg.c_cflag = B9600;
315 tcgetattr (fd, &sg); 291 tcgetattr (fd, &sg);
316 emacs_ospeed = cfgetospeed (&sg); 292 emacs_ospeed = cfgetospeed (&sg);
317#else /* not TERMIOS */
318#ifdef HAVE_TERMIO
319 struct termio sg;
320
321 sg.c_cflag = B9600;
322#ifdef HAVE_TCATTR
323 tcgetattr (fd, &sg);
324#else
325 ioctl (fd, TCGETA, &sg);
326#endif
327 emacs_ospeed = sg.c_cflag & CBAUD;
328#else /* neither TERMIOS nor TERMIO */
329 struct sgttyb sg;
330
331 sg.sg_ospeed = B9600;
332 if (ioctl (fd, TIOCGETP, &sg) < 0)
333 abort ();
334 emacs_ospeed = sg.sg_ospeed;
335#endif /* not HAVE_TERMIO */
336#endif /* not HAVE_TERMIOS */
337#endif /* not DOS_NT */ 293#endif /* not DOS_NT */
338 } 294 }
339 295
@@ -417,7 +373,7 @@ wait_for_termination (int pid)
417void 373void
418flush_pending_output (int channel) 374flush_pending_output (int channel)
419{ 375{
420#ifdef HAVE_TERMIOS 376#ifndef DOS_NT
421 /* If we try this, we get hit with SIGTTIN, because 377 /* If we try this, we get hit with SIGTTIN, because
422 the child's tty belongs to the child's pgrp. */ 378 the child's tty belongs to the child's pgrp. */
423#else 379#else
@@ -447,8 +403,6 @@ child_setup_tty (int out)
447 struct emacs_tty s; 403 struct emacs_tty s;
448 404
449 EMACS_GET_TTY (out, &s); 405 EMACS_GET_TTY (out, &s);
450
451#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
452 s.main.c_oflag |= OPOST; /* Enable output postprocessing */ 406 s.main.c_oflag |= OPOST; /* Enable output postprocessing */
453 s.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL on output */ 407 s.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL on output */
454#ifdef NLDLY 408#ifdef NLDLY
@@ -526,19 +480,7 @@ child_setup_tty (int out)
526 s.main.c_cc[VTIME] = 0; 480 s.main.c_cc[VTIME] = 0;
527#endif 481#endif
528 482
529#else /* not HAVE_TERMIO */
530
531 s.main.sg_flags &= ~(ECHO | CRMOD | ANYP | ALLDELAY | RAW | LCASE
532 | CBREAK | TANDEM);
533 s.main.sg_flags |= LPASS8;
534 s.main.sg_erase = 0377;
535 s.main.sg_kill = 0377;
536 s.lmode = LLITOUT | s.lmode; /* Don't strip 8th bit */
537
538#endif /* not HAVE_TERMIO */
539
540 EMACS_SET_TTY (out, &s, 0); 483 EMACS_SET_TTY (out, &s, 0);
541
542#endif /* not WINDOWSNT */ 484#endif /* not WINDOWSNT */
543} 485}
544#endif /* MSDOS */ 486#endif /* MSDOS */
@@ -841,38 +783,11 @@ int
841emacs_get_tty (int fd, struct emacs_tty *settings) 783emacs_get_tty (int fd, struct emacs_tty *settings)
842{ 784{
843 /* Retrieve the primary parameters - baud rate, character size, etcetera. */ 785 /* Retrieve the primary parameters - baud rate, character size, etcetera. */
844#ifdef HAVE_TCATTR 786#ifndef DOS_NT
845 /* We have those nifty POSIX tcmumbleattr functions. */ 787 /* We have those nifty POSIX tcmumbleattr functions. */
846 memset (&settings->main, 0, sizeof (settings->main)); 788 memset (&settings->main, 0, sizeof (settings->main));
847 if (tcgetattr (fd, &settings->main) < 0) 789 if (tcgetattr (fd, &settings->main) < 0)
848 return -1; 790 return -1;
849
850#else
851#ifdef HAVE_TERMIO
852 /* The SYSV-style interface? */
853 if (ioctl (fd, TCGETA, &settings->main) < 0)
854 return -1;
855
856#else
857#ifndef DOS_NT
858 /* I give up - I hope you have the BSD ioctls. */
859 if (ioctl (fd, TIOCGETP, &settings->main) < 0)
860 return -1;
861#endif /* not DOS_NT */
862#endif
863#endif
864
865 /* Suivant - Do we have to get struct ltchars data? */
866#ifdef HAVE_LTCHARS
867 if (ioctl (fd, TIOCGLTC, &settings->ltchars) < 0)
868 return -1;
869#endif
870
871 /* How about a struct tchars and a wordful of lmode bits? */
872#ifdef HAVE_TCHARS
873 if (ioctl (fd, TIOCGETC, &settings->tchars) < 0
874 || ioctl (fd, TIOCLGET, &settings->lmode) < 0)
875 return -1;
876#endif 791#endif
877 792
878 /* We have survived the tempest. */ 793 /* We have survived the tempest. */
@@ -888,7 +803,7 @@ int
888emacs_set_tty (int fd, struct emacs_tty *settings, int flushp) 803emacs_set_tty (int fd, struct emacs_tty *settings, int flushp)
889{ 804{
890 /* Set the primary parameters - baud rate, character size, etcetera. */ 805 /* Set the primary parameters - baud rate, character size, etcetera. */
891#ifdef HAVE_TCATTR 806#ifndef DOS_NT
892 int i; 807 int i;
893 /* We have those nifty POSIX tcmumbleattr functions. 808 /* We have those nifty POSIX tcmumbleattr functions.
894 William J. Smith <wjs@wiis.wang.com> writes: 809 William J. Smith <wjs@wiis.wang.com> writes:
@@ -926,34 +841,6 @@ emacs_set_tty (int fd, struct emacs_tty *settings, int flushp)
926 else 841 else
927 continue; 842 continue;
928 } 843 }
929
930#else
931#ifdef HAVE_TERMIO
932 /* The SYSV-style interface? */
933 if (ioctl (fd, flushp ? TCSETAF : TCSETAW, &settings->main) < 0)
934 return -1;
935
936#else
937#ifndef DOS_NT
938 /* I give up - I hope you have the BSD ioctls. */
939 if (ioctl (fd, (flushp) ? TIOCSETP : TIOCSETN, &settings->main) < 0)
940 return -1;
941#endif /* not DOS_NT */
942
943#endif
944#endif
945
946 /* Suivant - Do we have to get struct ltchars data? */
947#ifdef HAVE_LTCHARS
948 if (ioctl (fd, TIOCSLTC, &settings->ltchars) < 0)
949 return -1;
950#endif
951
952 /* How about a struct tchars and a wordful of lmode bits? */
953#ifdef HAVE_TCHARS
954 if (ioctl (fd, TIOCSETC, &settings->tchars) < 0
955 || ioctl (fd, TIOCLSET, &settings->lmode) < 0)
956 return -1;
957#endif 844#endif
958 845
959 /* We have survived the tempest. */ 846 /* We have survived the tempest. */
@@ -976,13 +863,6 @@ unsigned char _sobuf[BUFSIZ+8];
976char _sobuf[BUFSIZ]; 863char _sobuf[BUFSIZ];
977#endif 864#endif
978 865
979#ifdef HAVE_LTCHARS
980static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1};
981#endif
982#ifdef HAVE_TCHARS
983static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1};
984#endif
985
986/* Initialize the terminal mode on all tty devices that are currently 866/* Initialize the terminal mode on all tty devices that are currently
987 open. */ 867 open. */
988 868
@@ -1016,7 +896,7 @@ init_sys_modes (struct tty_display_info *tty_out)
1016 896
1017 tty = *tty_out->old_tty; 897 tty = *tty_out->old_tty;
1018 898
1019#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) 899#if !defined (DOS_NT)
1020 XSETINT (Vtty_erase_char, tty.main.c_cc[VERASE]); 900 XSETINT (Vtty_erase_char, tty.main.c_cc[VERASE]);
1021 901
1022 tty.main.c_iflag |= (IGNBRK); /* Ignore break condition */ 902 tty.main.c_iflag |= (IGNBRK); /* Ignore break condition */
@@ -1088,12 +968,11 @@ init_sys_modes (struct tty_display_info *tty_out)
1088 of C-z */ 968 of C-z */
1089#endif /* VSWTCH */ 969#endif /* VSWTCH */
1090 970
1091#if defined (__mips__) || defined (HAVE_TCATTR)
1092#ifdef VSUSP 971#ifdef VSUSP
1093 tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off mips handling of C-z. */ 972 tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off handling of C-z. */
1094#endif /* VSUSP */ 973#endif /* VSUSP */
1095#ifdef V_DSUSP 974#ifdef V_DSUSP
1096 tty.main.c_cc[V_DSUSP] = CDISABLE; /* Turn off mips handling of C-y. */ 975 tty.main.c_cc[V_DSUSP] = CDISABLE; /* Turn off handling of C-y. */
1097#endif /* V_DSUSP */ 976#endif /* V_DSUSP */
1098#ifdef VDSUSP /* Some systems have VDSUSP, some have V_DSUSP. */ 977#ifdef VDSUSP /* Some systems have VDSUSP, some have V_DSUSP. */
1099 tty.main.c_cc[VDSUSP] = CDISABLE; 978 tty.main.c_cc[VDSUSP] = CDISABLE;
@@ -1129,7 +1008,6 @@ init_sys_modes (struct tty_display_info *tty_out)
1129 tty.main.c_cc[VSTOP] = CDISABLE; 1008 tty.main.c_cc[VSTOP] = CDISABLE;
1130#endif /* VSTOP */ 1009#endif /* VSTOP */
1131 } 1010 }
1132#endif /* mips or HAVE_TCATTR */
1133 1011
1134#ifdef AIX 1012#ifdef AIX
1135 tty.main.c_cc[VSTRT] = CDISABLE; 1013 tty.main.c_cc[VSTRT] = CDISABLE;
@@ -1152,41 +1030,8 @@ init_sys_modes (struct tty_display_info *tty_out)
1152 tty.main.c_iflag &= ~IGNBRK; 1030 tty.main.c_iflag &= ~IGNBRK;
1153 tty.main.c_iflag &= ~BRKINT; 1031 tty.main.c_iflag &= ~BRKINT;
1154#endif 1032#endif
1155#else /* if not HAVE_TERMIO */
1156#ifndef DOS_NT
1157 XSETINT (Vtty_erase_char, tty.main.sg_erase);
1158 tty.main.sg_flags &= ~(ECHO | CRMOD | XTABS);
1159 if (meta_key)
1160 tty.main.sg_flags |= ANYP;
1161 tty.main.sg_flags |= interrupt_input ? RAW : CBREAK;
1162#endif /* not DOS_NT */ 1033#endif /* not DOS_NT */
1163#endif /* not HAVE_TERMIO */
1164
1165 /* If going to use CBREAK mode, we must request C-g to interrupt
1166 and turn off start and stop chars, etc. If not going to use
1167 CBREAK mode, do this anyway so as to turn off local flow
1168 control for user coming over network on 4.2; in this case,
1169 only t_stopc and t_startc really matter. */
1170#ifndef HAVE_TERMIO
1171#ifdef HAVE_TCHARS
1172 /* Note: if not using CBREAK mode, it makes no difference how we
1173 set this */
1174 tty.tchars = new_tchars;
1175 tty.tchars.t_intrc = quit_char;
1176 if (tty_out->flow_control)
1177 {
1178 tty.tchars.t_startc = '\021';
1179 tty.tchars.t_stopc = '\023';
1180 }
1181 1034
1182 tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | tty_out->old_tty.lmode;
1183
1184#endif /* HAVE_TCHARS */
1185#endif /* not HAVE_TERMIO */
1186
1187#ifdef HAVE_LTCHARS
1188 tty.ltchars = new_ltchars;
1189#endif /* HAVE_LTCHARS */
1190#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida, MW Aug 1993 */ 1035#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida, MW Aug 1993 */
1191 if (!tty_out->term_initted) 1036 if (!tty_out->term_initted)
1192 internal_terminal_init (); 1037 internal_terminal_init ();
@@ -1205,7 +1050,7 @@ init_sys_modes (struct tty_display_info *tty_out)
1205 if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TIOCSTART, 0); 1050 if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TIOCSTART, 0);
1206#endif 1051#endif
1207 1052
1208#if defined (HAVE_TERMIOS) || defined (HPUX) 1053#if !defined (DOS_NT)
1209#ifdef TCOON 1054#ifdef TCOON
1210 if (!tty_out->flow_control) tcflow (fileno (tty_out->input), TCOON); 1055 if (!tty_out->flow_control) tcflow (fileno (tty_out->input), TCOON);
1211#endif 1056#endif
@@ -2688,7 +2533,7 @@ strsignal (int code)
2688} 2533}
2689#endif /* HAVE_STRSIGNAL */ 2534#endif /* HAVE_STRSIGNAL */
2690 2535
2691#ifdef HAVE_TERMIOS 2536#ifndef DOS_NT
2692/* For make-serial-process */ 2537/* For make-serial-process */
2693int 2538int
2694serial_open (char *port) 2539serial_open (char *port)
@@ -2717,9 +2562,6 @@ serial_open (char *port)
2717 2562
2718 return fd; 2563 return fd;
2719} 2564}
2720#endif /* TERMIOS */
2721
2722#ifdef HAVE_TERMIOS
2723 2565
2724#if !defined (HAVE_CFMAKERAW) 2566#if !defined (HAVE_CFMAKERAW)
2725/* Workaround for targets which are missing cfmakeraw. */ 2567/* Workaround for targets which are missing cfmakeraw. */
@@ -2906,7 +2748,7 @@ serial_configure (struct Lisp_Process *p,
2906 p->childp = childp2; 2748 p->childp = childp2;
2907 2749
2908} 2750}
2909#endif /* TERMIOS */ 2751#endif /* not DOS_NT */
2910 2752
2911/* System depended enumeration of and access to system processes a-la ps(1). */ 2753/* System depended enumeration of and access to system processes a-la ps(1). */
2912 2754
diff --git a/src/sysselect.h b/src/sysselect.h
index ddb3e91f2e3..0c90814390c 100644
--- a/src/sysselect.h
+++ b/src/sysselect.h
@@ -27,6 +27,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
27#endif 27#endif
28#endif 28#endif
29 29
30/* The w32 build defines select stuff in w32.h, which is included
31 where w32 needs it, but not where sysselect.h is included. The w32
32 definitions in w32.h are incompatible with the below. */
33#ifndef WINDOWSNT
30#ifdef FD_SET 34#ifdef FD_SET
31#ifdef FD_SETSIZE 35#ifdef FD_SETSIZE
32#define MAXDESC FD_SETSIZE 36#define MAXDESC FD_SETSIZE
@@ -44,6 +48,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
44#define FD_ISSET(n, p) (*(p) & (1 << (n))) 48#define FD_ISSET(n, p) (*(p) & (1 << (n)))
45#define FD_ZERO(p) (*(p) = 0) 49#define FD_ZERO(p) (*(p) = 0)
46#endif /* no FD_SET */ 50#endif /* no FD_SET */
51#endif /* not WINDOWSNT */
47 52
48#if !defined (HAVE_SELECT) 53#if !defined (HAVE_SELECT)
49#define select sys_select 54#define select sys_select
diff --git a/src/systty.h b/src/systty.h
index 39feef9c3d0..8c46411cedb 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -17,34 +17,17 @@ GNU General Public License for more details.
17You should have received a copy of the GNU General Public License 17You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20#ifdef HAVE_TERMIOS
21#define HAVE_TCATTR
22#endif
23
24
25/* Include the proper files. */ 20/* Include the proper files. */
26#ifdef HAVE_TERMIO 21#ifndef DOS_NT
27#ifndef NO_TERMIO 22#ifndef NO_TERMIO
28#include <termio.h> 23#include <termio.h>
29#endif /* not NO_TERMIO */ 24#endif /* not NO_TERMIO */
30#include <fcntl.h>
31#else /* not HAVE_TERMIO */
32#ifdef HAVE_TERMIOS
33#ifndef NO_TERMIO
34#include <termio.h>
35#endif
36#include <termios.h> 25#include <termios.h>
37#include <fcntl.h> 26#include <fcntl.h>
38#else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
39#ifndef DOS_NT
40#include <sgtty.h>
41#endif /* not DOS_NT */ 27#endif /* not DOS_NT */
42#endif /* not HAVE_TERMIOS */
43#endif /* not HAVE_TERMIO */
44 28
45#ifdef __GNU_LIBRARY__ 29#ifdef HAVE_SYS_IOCTL_H
46#include <sys/ioctl.h> 30#include <sys/ioctl.h>
47#include <termios.h>
48#endif 31#endif
49 32
50#ifdef HPUX 33#ifdef HPUX
@@ -74,17 +57,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
74#undef SIGIO 57#undef SIGIO
75#endif 58#endif
76 59
77/* On TERMIOS systems, the tcmumbleattr calls take care of these
78 parameters, and it's a bad idea to use them (on AIX, it makes the
79 tty hang for a long time). */
80#if defined (TIOCGLTC) && !defined (HAVE_TERMIOS)
81#define HAVE_LTCHARS
82#endif
83
84#if defined (TIOCGETC) && !defined (HAVE_TERMIOS)
85#define HAVE_TCHARS
86#endif
87
88 60
89/* Try to establish the correct character to disable terminal functions 61/* Try to establish the correct character to disable terminal functions
90 in a system-independent manner. Note that USG (at least) define 62 in a system-independent manner. Note that USG (at least) define
@@ -111,60 +83,19 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
111#define EMACS_OUTQSIZE(fd, size) (ioctl ((fd), TIOCOUTQ, (size))) 83#define EMACS_OUTQSIZE(fd, size) (ioctl ((fd), TIOCOUTQ, (size)))
112#endif 84#endif
113 85
114#ifdef HAVE_TERMIO
115#ifdef TCOUTQ
116#undef EMACS_OUTQSIZE
117#define EMACS_OUTQSIZE(fd, size) (ioctl ((fd), TCOUTQ, (size)))
118#endif
119#endif
120
121 86
122/* Manipulate a terminal's current process group. */ 87/* Manipulate a terminal's current process group. */
123 88
124/* EMACS_HAVE_TTY_PGRP is true if we can get and set the tty's current 89/* EMACS_GET_TTY_PGRP(int FD, int *PGID) sets *PGID the terminal FD's
125 controlling process group.
126
127 EMACS_GET_TTY_PGRP(int FD, int *PGID) sets *PGID the terminal FD's
128 current process group. Return -1 if there is an error. 90 current process group. Return -1 if there is an error.
129 91
130 EMACS_SET_TTY_PGRP(int FD, int *PGID) sets the terminal FD's 92 EMACS_SET_TTY_PGRP(int FD, int *PGID) sets the terminal FD's
131 current process group to *PGID. Return -1 if there is an error. */ 93 current process group to *PGID. Return -1 if there is an error. */
132 94
133/* HPUX tty process group stuff doesn't work, says the anonymous voice 95#ifndef DOS_NT
134 from the past. */
135#ifndef HPUX
136#ifdef TIOCGPGRP
137#define EMACS_HAVE_TTY_PGRP
138#else
139#ifdef HAVE_TERMIOS
140#define EMACS_HAVE_TTY_PGRP
141#endif /* HAVE_TERMIOS */
142#endif /* TIOCGPGRP */
143#endif /* not HPUX */
144
145#ifdef EMACS_HAVE_TTY_PGRP
146
147#if defined (HAVE_TERMIOS)
148
149#define EMACS_GET_TTY_PGRP(fd, pgid) (*(pgid) = tcgetpgrp ((fd))) 96#define EMACS_GET_TTY_PGRP(fd, pgid) (*(pgid) = tcgetpgrp ((fd)))
150#define EMACS_SET_TTY_PGRP(fd, pgid) (tcsetpgrp ((fd), *(pgid))) 97#define EMACS_SET_TTY_PGRP(fd, pgid) (tcsetpgrp ((fd), *(pgid)))
151 98#endif /* not DOS_NT */
152#else /* not HAVE_TERMIOS */
153#ifdef TIOCSPGRP
154
155#define EMACS_GET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCGPGRP, (pgid)))
156#define EMACS_SET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCSPGRP, (pgid)))
157
158#endif /* TIOCSPGRP */
159#endif /* HAVE_TERMIOS */
160
161#else /* not EMACS_SET_TTY_PGRP */
162
163/* Just ignore this for now and hope for the best */
164#define EMACS_GET_TTY_PGRP(fd, pgid) 0
165#define EMACS_SET_TTY_PGRP(fd, pgif) 0
166
167#endif /* not EMACS_SET_TTY_PGRP */
168 99
169/* EMACS_GETPGRP (arg) returns the process group of the process. */ 100/* EMACS_GETPGRP (arg) returns the process group of the process. */
170 101
@@ -207,32 +138,11 @@ struct emacs_tty {
207 138
208/* There is always one of the following elements, so there is no need 139/* There is always one of the following elements, so there is no need
209 for dummy get and set definitions. */ 140 for dummy get and set definitions. */
210#ifdef HAVE_TCATTR 141#ifndef DOS_NT
211 struct termios main; 142 struct termios main;
212#else /* not HAVE_TCATTR */ 143#else /* DOS_NT */
213#ifdef HAVE_TERMIO
214 struct termio main;
215#else /* not HAVE_TERMIO */
216#ifdef DOS_NT
217 int main; 144 int main;
218#else /* not DOS_NT */ 145#endif /* DOS_NT */
219 struct sgttyb main;
220#endif /* not DOS_NT */
221#endif /* not HAVE_TERMIO */
222#endif /* not HAVE_TCATTR */
223
224/* If we have TERMIOS, we don't need to do this - they're taken care of
225 by the tc*attr calls. */
226#ifndef HAVE_TERMIOS
227#ifdef HAVE_LTCHARS
228 struct ltchars ltchars;
229#endif /* HAVE_LTCHARS */
230
231#ifdef HAVE_TCHARS
232 struct tchars tchars;
233 int lmode;
234#endif /* HAVE_TCHARS */
235#endif /* not defined HAVE_TERMIOS */
236}; 146};
237 147
238/* Define EMACS_GET_TTY and EMACS_SET_TTY, 148/* Define EMACS_GET_TTY and EMACS_SET_TTY,
@@ -249,7 +159,7 @@ extern int emacs_set_tty (int, struct emacs_tty *, int);
249 159
250/* Define EMACS_TTY_TABS_OK. */ 160/* Define EMACS_TTY_TABS_OK. */
251 161
252#ifdef HAVE_TERMIOS 162#ifndef DOS_NT
253 163
254#ifdef TABDLY 164#ifdef TABDLY
255#define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3) 165#define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3)
@@ -257,21 +167,9 @@ extern int emacs_set_tty (int, struct emacs_tty *, int);
257#define EMACS_TTY_TABS_OK(p) 1 167#define EMACS_TTY_TABS_OK(p) 1
258#endif /* not TABDLY */ 168#endif /* not TABDLY */
259 169
260#else /* not def HAVE_TERMIOS */ 170#else /* DOS_NT */
261#ifdef HAVE_TERMIO
262
263#define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3)
264
265#else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
266
267#ifdef DOS_NT
268#define EMACS_TTY_TABS_OK(p) 0 171#define EMACS_TTY_TABS_OK(p) 0
269#else /* not DOS_NT */ 172#endif /* DOS_NT */
270#define EMACS_TTY_TABS_OK(p) (((p)->main.sg_flags & XTABS) != XTABS)
271#endif /* not DOS_NT */
272
273#endif /* not def HAVE_TERMIO */
274#endif /* not def HAVE_TERMIOS */
275 173
276/* arch-tag: cf4b90bc-be41-401c-be98-40619178a712 174/* arch-tag: cf4b90bc-be41-401c-be98-40619178a712
277 (do not change this comment) */ 175 (do not change this comment) */
diff --git a/src/term.c b/src/term.c
index 4f326234956..d1279498060 100644
--- a/src/term.c
+++ b/src/term.c
@@ -31,9 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31#include <unistd.h> 31#include <unistd.h>
32#endif 32#endif
33 33
34#if HAVE_TERMIOS_H
35#include <termios.h> /* For TIOCNOTTY. */
36#endif
37#ifdef HAVE_SYS_IOCTL_H 34#ifdef HAVE_SYS_IOCTL_H
38#include <sys/ioctl.h> 35#include <sys/ioctl.h>
39#endif 36#endif
diff --git a/src/unexcoff.c b/src/unexcoff.c
index 3e9786348c3..cb4b8d603b5 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -84,6 +84,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
84#ifdef MSDOS 84#ifdef MSDOS
85#include <fcntl.h> /* for O_RDONLY, O_RDWR */ 85#include <fcntl.h> /* for O_RDONLY, O_RDWR */
86#include <crt0.h> /* for _crt0_startup_flags and its bits */ 86#include <crt0.h> /* for _crt0_startup_flags and its bits */
87#include <sys/exceptn.h>
87static int save_djgpp_startup_flags; 88static int save_djgpp_startup_flags;
88#define filehdr external_filehdr 89#define filehdr external_filehdr
89#define scnhdr external_scnhdr 90#define scnhdr external_scnhdr
@@ -128,7 +129,7 @@ struct aouthdr
128#endif 129#endif
129 130
130 131
131extern char *start_of_data (); /* Start of initialized data */ 132extern char *start_of_data (void); /* Start of initialized data */
132 133
133static long block_copy_start; /* Old executable start point */ 134static long block_copy_start; /* Old executable start point */
134static struct filehdr f_hdr; /* File header */ 135static struct filehdr f_hdr; /* File header */
@@ -153,10 +154,8 @@ static int pagemask;
153#include <setjmp.h> 154#include <setjmp.h>
154#include "lisp.h" 155#include "lisp.h"
155 156
156static 157static void
157report_error (file, fd) 158report_error (const char *file, int fd)
158 char *file;
159 int fd;
160{ 159{
161 if (fd) 160 if (fd)
162 close (fd); 161 close (fd);
@@ -167,20 +166,18 @@ report_error (file, fd)
167#define ERROR1(msg,x) report_error_1 (new, msg, x, 0); return -1 166#define ERROR1(msg,x) report_error_1 (new, msg, x, 0); return -1
168#define ERROR2(msg,x,y) report_error_1 (new, msg, x, y); return -1 167#define ERROR2(msg,x,y) report_error_1 (new, msg, x, y); return -1
169 168
170static 169static void
171report_error_1 (fd, msg, a1, a2) 170report_error_1 (int fd, const char *msg, int a1, int a2)
172 int fd;
173 char *msg;
174 int a1, a2;
175{ 171{
176 close (fd); 172 close (fd);
177 error (msg, a1, a2); 173 error (msg, a1, a2);
178} 174}
179 175
180static int make_hdr (); 176static int make_hdr (int, int, unsigned, unsigned, unsigned,
181static int copy_text_and_data (); 177 const char *, const char *);
182static int copy_sym (); 178static int copy_text_and_data (int, int);
183static void mark_x (); 179static int copy_sym (int, int, const char *, const char *);
180static void mark_x (const char *);
184 181
185/* **************************************************************** 182/* ****************************************************************
186 * make_hdr 183 * make_hdr
@@ -189,13 +186,9 @@ static void mark_x ();
189 * Modify the text and data sizes. 186 * Modify the text and data sizes.
190 */ 187 */
191static int 188static int
192make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) 189make_hdr (int new, int a_out, unsigned data_start, unsigned bss_start,
193 int new, a_out; 190 unsigned entry_address, const char *a_name, const char *new_name)
194 unsigned data_start, bss_start, entry_address;
195 char *a_name;
196 char *new_name;
197{ 191{
198 int tem;
199 auto struct scnhdr f_thdr; /* Text section header */ 192 auto struct scnhdr f_thdr; /* Text section header */
200 auto struct scnhdr f_dhdr; /* Data section header */ 193 auto struct scnhdr f_dhdr; /* Data section header */
201 auto struct scnhdr f_bhdr; /* Bss section header */ 194 auto struct scnhdr f_bhdr; /* Bss section header */
@@ -363,12 +356,10 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
363 356
364} 357}
365 358
366write_segment (new, ptr, end) 359void
367 int new; 360write_segment (int new, const char *ptr, const char *end)
368 register char *ptr, *end;
369{ 361{
370 register int i, nwrite, ret; 362 register int i, nwrite, ret;
371 char buf[80];
372 /* This is the normal amount to write at once. 363 /* This is the normal amount to write at once.
373 It is the size of block that NFS uses. */ 364 It is the size of block that NFS uses. */
374 int writesize = 1 << 13; 365 int writesize = 1 << 13;
@@ -411,8 +402,7 @@ write_segment (new, ptr, end)
411 * Copy the text and data segments from memory to the new a.out 402 * Copy the text and data segments from memory to the new a.out
412 */ 403 */
413static int 404static int
414copy_text_and_data (new, a_out) 405copy_text_and_data (int new, int a_out)
415 int new, a_out;
416{ 406{
417 register char *end; 407 register char *end;
418 register char *ptr; 408 register char *ptr;
@@ -456,9 +446,7 @@ copy_text_and_data (new, a_out)
456 * Copy the relocation information and symbol table from the a.out to the new 446 * Copy the relocation information and symbol table from the a.out to the new
457 */ 447 */
458static int 448static int
459copy_sym (new, a_out, a_name, new_name) 449copy_sym (int new, int a_out, const char *a_name, const char *new_name)
460 int new, a_out;
461 char *a_name, *new_name;
462{ 450{
463 char page[1024]; 451 char page[1024];
464 int n; 452 int n;
@@ -494,8 +482,7 @@ copy_sym (new, a_out, a_name, new_name)
494 * After successfully building the new a.out, mark it executable 482 * After successfully building the new a.out, mark it executable
495 */ 483 */
496static void 484static void
497mark_x (name) 485mark_x (const char *name)
498 char *name;
499{ 486{
500 struct stat sbuf; 487 struct stat sbuf;
501 int um; 488 int um;
@@ -535,10 +522,8 @@ mark_x (name)
535 a reasonable size buffer. But I don't have time to work on such 522 a reasonable size buffer. But I don't have time to work on such
536 things, so I am installing it as submitted to me. -- RMS. */ 523 things, so I am installing it as submitted to me. -- RMS. */
537 524
538adjust_lnnoptrs (writedesc, readdesc, new_name) 525int
539 int writedesc; 526adjust_lnnoptrs (int writedesc, int readdesc, const char *new_name)
540 int readdesc;
541 char *new_name;
542{ 527{
543 register int nsyms; 528 register int nsyms;
544 register int new; 529 register int new;
@@ -585,11 +570,11 @@ adjust_lnnoptrs (writedesc, readdesc, new_name)
585 * 570 *
586 * driving logic. 571 * driving logic.
587 */ 572 */
588unexec (new_name, a_name, data_start, bss_start, entry_address) 573int
589 char *new_name, *a_name; 574unexec (const char *new_name, const char *a_name,
590 unsigned data_start, bss_start, entry_address; 575 unsigned data_start, unsigned bss_start, unsigned entry_address)
591{ 576{
592 int new, a_out = -1; 577 int new = -1, a_out = -1;
593 578
594 if (a_name && (a_out = open (a_name, O_RDONLY)) < 0) 579 if (a_name && (a_out = open (a_name, O_RDONLY)) < 0)
595 { 580 {
@@ -607,7 +592,6 @@ unexec (new_name, a_name, data_start, bss_start, entry_address)
607 ) 592 )
608 { 593 {
609 close (new); 594 close (new);
610 /* unlink (new_name); /* Failed, unlink new a.out */
611 return -1; 595 return -1;
612 } 596 }
613 597
diff --git a/src/w32fns.c b/src/w32fns.c
index 64d0d8cb6d1..f91ad948828 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3109,9 +3109,6 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
3109 HIMC context; 3109 HIMC context;
3110 struct window *w; 3110 struct window *w;
3111 3111
3112 if (!context)
3113 break;
3114
3115 f = x_window_to_frame (dpyinfo, hwnd); 3112 f = x_window_to_frame (dpyinfo, hwnd);
3116 w = XWINDOW (FRAME_SELECTED_WINDOW (f)); 3113 w = XWINDOW (FRAME_SELECTED_WINDOW (f));
3117 3114
@@ -3129,6 +3126,10 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
3129 - WINDOW_MODE_LINE_HEIGHT (w)); 3126 - WINDOW_MODE_LINE_HEIGHT (w));
3130 3127
3131 context = get_ime_context_fn (hwnd); 3128 context = get_ime_context_fn (hwnd);
3129
3130 if (!context)
3131 break;
3132
3132 set_ime_composition_window_fn (context, &form); 3133 set_ime_composition_window_fn (context, &form);
3133 release_ime_context_fn (hwnd, context); 3134 release_ime_context_fn (hwnd, context);
3134 } 3135 }
diff --git a/src/w32menu.c b/src/w32menu.c
index 1146843bec8..0ed9bffe70c 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -420,12 +420,8 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
420 420
421 set_buffer_internal_1 (XBUFFER (buffer)); 421 set_buffer_internal_1 (XBUFFER (buffer));
422 422
423 /* Run the Lucid hook. */ 423 /* Run the hooks. */
424 safe_run_hooks (Qactivate_menubar_hook); 424 safe_run_hooks (Qactivate_menubar_hook);
425 /* If it has changed current-menubar from previous value,
426 really recompute the menubar from the value. */
427 if (! NILP (Vlucid_menu_bar_dirty_flag))
428 call0 (Qrecompute_lucid_menubar);
429 safe_run_hooks (Qmenu_bar_update_hook); 425 safe_run_hooks (Qmenu_bar_update_hook);
430 FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); 426 FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
431 427
diff --git a/src/xdisp.c b/src/xdisp.c
index d730387a51b..93fdb68eeac 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -217,7 +217,26 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
217 glyph with suitably computed width. Both the blanks and the 217 glyph with suitably computed width. Both the blanks and the
218 stretch glyph are given the face of the background of the line. 218 stretch glyph are given the face of the background of the line.
219 This way, the terminal-specific back-end can still draw the glyphs 219 This way, the terminal-specific back-end can still draw the glyphs
220 left to right, even for R2L lines. */ 220 left to right, even for R2L lines.
221
222 Note one important detail mentioned above: that the bidi reordering
223 engine, driven by the iterator, produces characters in R2L rows
224 starting at the character that will be the rightmost on display.
225 As far as the iterator is concerned, the geometry of such rows is
226 still left to right, i.e. the iterator "thinks" the first character
227 is at the leftmost pixel position. The iterator does not know that
228 PRODUCE_GLYPHS reverses the order of the glyphs that the iterator
229 delivers. This is important when functions from the the move_it_*
230 family are used to get to certain screen position or to match
231 screen coordinates with buffer coordinates: these functions use the
232 iterator geometry, which is left to right even in R2L paragraphs.
233 This works well with most callers of move_it_*, because they need
234 to get to a specific column, and columns are still numbered in the
235 reading order, i.e. the rightmost character in a R2L paragraph is
236 still column zero. But some callers do not get well with this; a
237 notable example is mouse clicks that need to find the character
238 that corresponds to certain pixel coordinates. See
239 buffer_posn_from_coords in dispnew.c for how this is handled. */
221 240
222#include <config.h> 241#include <config.h>
223#include <stdio.h> 242#include <stdio.h>
@@ -10839,7 +10858,7 @@ note_tool_bar_highlight (struct frame *f, int x, int y)
10839 enum draw_glyphs_face draw = DRAW_IMAGE_RAISED; 10858 enum draw_glyphs_face draw = DRAW_IMAGE_RAISED;
10840 int mouse_down_p, rc; 10859 int mouse_down_p, rc;
10841 10860
10842 /* Function note_mouse_highlight is called with negative x(y 10861 /* Function note_mouse_highlight is called with negative X/Y
10843 values when mouse moves outside of the frame. */ 10862 values when mouse moves outside of the frame. */
10844 if (x <= 0 || y <= 0) 10863 if (x <= 0 || y <= 0)
10845 { 10864 {