aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2012-08-22 18:03:03 +0900
committerKenichi Handa2012-08-22 18:03:03 +0900
commit4ff819d728960bf5e52b72501c606f4bb3fde028 (patch)
treed8f0d96db0215f253bd0a4bbf7b9cda177e662ce
parentd75ffb4ed0b2e72a9361a07d16a5c884a9459728 (diff)
parent8223e9280fa69afeeae1a8b51735cbb8393f2e8d (diff)
downloademacs-4ff819d728960bf5e52b72501c606f4bb3fde028.tar.gz
emacs-4ff819d728960bf5e52b72501c606f4bb3fde028.zip
merge trunk
-rw-r--r--ChangeLog5
-rw-r--r--admin/ChangeLog7
-rwxr-xr-xadmin/merge-gnulib2
-rw-r--r--autogen/config.in3
-rwxr-xr-xautogen/configure23
-rw-r--r--configure.ac13
-rw-r--r--leim/ChangeLog7
-rw-r--r--leim/quail/indian.el2
-rw-r--r--lib-src/ChangeLog4
-rw-r--r--lib-src/makefile.w32-in1
-rw-r--r--lisp/ChangeLog30
-rw-r--r--lisp/mouse.el14
-rw-r--r--lisp/net/tramp-sh.el75
-rw-r--r--lisp/window.el154
-rw-r--r--lwlib/ChangeLog8
-rw-r--r--lwlib/lwlib-Xaw.c3
-rw-r--r--lwlib/lwlib.c1
-rw-r--r--lwlib/xlwmenu.c3
-rw-r--r--nt/ChangeLog5
-rw-r--r--nt/config.nt3
-rw-r--r--src/ChangeLog59
-rw-r--r--src/category.c1
-rw-r--r--src/charset.c4
-rw-r--r--src/dispnew.c1
-rw-r--r--src/doc.c7
-rw-r--r--src/doprnt.c1
-rw-r--r--src/editfns.c1
-rw-r--r--src/fileio.c17
-rw-r--r--src/font.c9
-rw-r--r--src/frame.c8
-rw-r--r--src/gtkutil.c6
-rw-r--r--src/image.c34
-rw-r--r--src/intervals.c47
-rw-r--r--src/lisp.h1
-rw-r--r--src/makefile.w32-in13
-rw-r--r--src/nsfont.m2
-rw-r--r--src/nsimage.m3
-rw-r--r--src/nsterm.m8
-rw-r--r--src/syntax.c1
-rw-r--r--src/sysdep.c6
-rw-r--r--src/term.c1
-rw-r--r--src/xfaces.c55
-rw-r--r--src/xfns.c1
-rw-r--r--src/xterm.c1
44 files changed, 430 insertions, 220 deletions
diff --git a/ChangeLog b/ChangeLog
index c29a9856a02..9b6e368ec75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12012-08-17 Jan Beich <jbeich@tormail.org> (tiny change)
2
3 * configure.ac (PTY_OPEN): Try posix_openpt on gnu-linux,
4 gnu-kfreebsd, freebsd, and netbsd. (Bug#12040)
5
12012-08-14 Paul Eggert <eggert@cs.ucla.edu> 62012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 Merge from gnulib, incorporating: 8 Merge from gnulib, incorporating:
diff --git a/admin/ChangeLog b/admin/ChangeLog
index c579930d2bf..ea977e80cfa 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,10 @@
12012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2
3 Use ASCII tests for character types.
4 * merge-gnulib (GNULIB_MODULES): Add c-ctype. This documents a
5 new direct dependency; c-ctype was already being used indirectly
6 via other gnulib modules.
7
12012-08-14 Paul Eggert <eggert@cs.ucla.edu> 82012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2 9
3 Use bool for Emacs Lisp booleans. 10 Use bool for Emacs Lisp booleans.
diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index c5b9eba5ee6..63865edf3ce 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -26,7 +26,7 @@
26GNULIB_URL=git://git.savannah.gnu.org/gnulib.git 26GNULIB_URL=git://git.savannah.gnu.org/gnulib.git
27 27
28GNULIB_MODULES=' 28GNULIB_MODULES='
29 alloca-opt c-strcase 29 alloca-opt c-ctype c-strcase
30 careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 30 careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512
31 dtoastr dtotimespec dup2 environ 31 dtoastr dtotimespec dup2 environ
32 filemode getloadavg getopt-gnu gettime gettimeofday 32 filemode getloadavg getopt-gnu gettime gettimeofday
diff --git a/autogen/config.in b/autogen/config.in
index 8e18d1c9206..bd10c9f4076 100644
--- a/autogen/config.in
+++ b/autogen/config.in
@@ -731,6 +731,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
731/* Define to 1 if you have the `posix_memalign' function. */ 731/* Define to 1 if you have the `posix_memalign' function. */
732#undef HAVE_POSIX_MEMALIGN 732#undef HAVE_POSIX_MEMALIGN
733 733
734/* Define to 1 if you have the `posix_openpt' function. */
735#undef HAVE_POSIX_OPENPT
736
734/* Define if you have the /proc filesystem. */ 737/* Define if you have the /proc filesystem. */
735#undef HAVE_PROCFS 738#undef HAVE_PROCFS
736 739
diff --git a/autogen/configure b/autogen/configure
index bfe15b6fb2a..961d1acbd38 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -13258,12 +13258,14 @@ done
13258 13258
13259 13259
13260# PTY-related GNU extensions. 13260# PTY-related GNU extensions.
13261for ac_func in getpt 13261for ac_func in getpt posix_openpt
13262do : 13262do :
13263 ac_fn_c_check_func "$LINENO" "getpt" "ac_cv_func_getpt" 13263 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13264if test "x$ac_cv_func_getpt" = x""yes; then : 13264ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13265eval as_val=\$$as_ac_var
13266 if test "x$as_val" = x""yes; then :
13265 cat >>confdefs.h <<_ACEOF 13267 cat >>confdefs.h <<_ACEOF
13266#define HAVE_GETPT 1 13268#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13267_ACEOF 13269_ACEOF
13268 13270
13269fi 13271fi
@@ -14883,7 +14885,7 @@ case $opsys in
14883 14885
14884 ;; 14886 ;;
14885 14887
14886 darwin ) 14888 darwin )
14887 $as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++)" >>confdefs.h 14889 $as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++)" >>confdefs.h
14888 14890
14889 $as_echo "#define FIRST_PTY_LETTER 'p'" >>confdefs.h 14891 $as_echo "#define FIRST_PTY_LETTER 'p'" >>confdefs.h
@@ -14896,12 +14898,12 @@ case $opsys in
14896 14898
14897 ;; 14899 ;;
14898 14900
14899 gnu | freebsd | netbsd | openbsd ) 14901 gnu | openbsd )
14900 $as_echo "#define FIRST_PTY_LETTER 'p'" >>confdefs.h 14902 $as_echo "#define FIRST_PTY_LETTER 'p'" >>confdefs.h
14901 14903
14902 ;; 14904 ;;
14903 14905
14904 gnu-linux | gnu-kfreebsd ) 14906 gnu-linux | gnu-kfreebsd | freebsd | netbsd )
14905 if test "x$ac_cv_func_grantpt" = xyes; then 14907 if test "x$ac_cv_func_grantpt" = xyes; then
14906 14908
14907$as_echo "#define UNIX98_PTYS 1" >>confdefs.h 14909$as_echo "#define UNIX98_PTYS 1" >>confdefs.h
@@ -14910,7 +14912,12 @@ $as_echo "#define UNIX98_PTYS 1" >>confdefs.h
14910 14912
14911 $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptyname; sigblock (sigmask (SIGCHLD)); if (grantpt (fd) == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname(fd))) { sigunblock (sigmask (SIGCHLD)); close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); sigunblock (sigmask (SIGCHLD)); }" >>confdefs.h 14913 $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptyname; sigblock (sigmask (SIGCHLD)); if (grantpt (fd) == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname(fd))) { sigunblock (sigmask (SIGCHLD)); close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); sigunblock (sigmask (SIGCHLD)); }" >>confdefs.h
14912 14914
14913 if test "x$ac_cv_func_getpt" = xyes; then 14915 if test "x$ac_cv_func_posix_openpt" = xyes; then
14916 $as_echo "#define PTY_OPEN fd = posix_openpt (O_RDWR | O_NOCTTY)" >>confdefs.h
14917
14918 $as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h
14919
14920 elif test "x$ac_cv_func_getpt" = xyes; then
14914 $as_echo "#define PTY_OPEN fd = getpt ()" >>confdefs.h 14921 $as_echo "#define PTY_OPEN fd = getpt ()" >>confdefs.h
14915 14922
14916 $as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h 14923 $as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h
diff --git a/configure.ac b/configure.ac
index 92fb5f8413b..2394790c455 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2773,7 +2773,7 @@ AC_FUNC_GETPGRP
2773AC_CHECK_FUNCS(grantpt) 2773AC_CHECK_FUNCS(grantpt)
2774 2774
2775# PTY-related GNU extensions. 2775# PTY-related GNU extensions.
2776AC_CHECK_FUNCS(getpt) 2776AC_CHECK_FUNCS(getpt posix_openpt)
2777 2777
2778# Check this now, so that we will NOT find the above functions in ncurses. 2778# Check this now, so that we will NOT find the above functions in ncurses.
2779# That is because we have not set up to link ncurses in lib-src. 2779# That is because we have not set up to link ncurses in lib-src.
@@ -3397,6 +3397,7 @@ case $opsys in
3397 AC_DEFINE(PTY_TTY_NAME_SPRINTF, []) 3397 AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
3398 ;; 3398 ;;
3399 3399
3400 dnl FIXME? Maybe use same as freebsd - see bug#12040.
3400 darwin ) 3401 darwin )
3401 AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)]) 3402 AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)])
3402 dnl Not used, because PTY_ITERATION is defined. 3403 dnl Not used, because PTY_ITERATION is defined.
@@ -3409,11 +3410,11 @@ case $opsys in
3409 AC_DEFINE(PTY_TTY_NAME_SPRINTF, []) 3410 AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
3410 ;; 3411 ;;
3411 3412
3412 gnu | freebsd | netbsd | openbsd ) 3413 gnu | openbsd )
3413 AC_DEFINE(FIRST_PTY_LETTER, ['p']) 3414 AC_DEFINE(FIRST_PTY_LETTER, ['p'])
3414 ;; 3415 ;;
3415 3416
3416 gnu-linux | gnu-kfreebsd ) 3417 gnu-linux | gnu-kfreebsd | freebsd | netbsd )
3417 dnl if HAVE_GRANTPT 3418 dnl if HAVE_GRANTPT
3418 if test "x$ac_cv_func_grantpt" = xyes; then 3419 if test "x$ac_cv_func_grantpt" = xyes; then
3419 AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.]) 3420 AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.])
@@ -3421,8 +3422,12 @@ case $opsys in
3421 dnl Note that grantpt and unlockpt may fork. We must block SIGCHLD 3422 dnl Note that grantpt and unlockpt may fork. We must block SIGCHLD
3422 dnl to prevent sigchld_handler from intercepting the child's death. 3423 dnl to prevent sigchld_handler from intercepting the child's death.
3423 AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname; sigblock (sigmask (SIGCHLD)); if (grantpt (fd) == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname(fd))) { sigunblock (sigmask (SIGCHLD)); close (fd); return -1; } snprintf (pty_name, sizeof pty_name, "%s", ptyname); sigunblock (sigmask (SIGCHLD)); }]) 3424 AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname; sigblock (sigmask (SIGCHLD)); if (grantpt (fd) == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname(fd))) { sigunblock (sigmask (SIGCHLD)); close (fd); return -1; } snprintf (pty_name, sizeof pty_name, "%s", ptyname); sigunblock (sigmask (SIGCHLD)); }])
3425 dnl if HAVE_POSIX_OPENPT
3426 if test "x$ac_cv_func_posix_openpt" = xyes; then
3427 AC_DEFINE(PTY_OPEN, [fd = posix_openpt (O_RDWR | O_NOCTTY)])
3428 AC_DEFINE(PTY_NAME_SPRINTF, [])
3424 dnl if HAVE_GETPT 3429 dnl if HAVE_GETPT
3425 if test "x$ac_cv_func_getpt" = xyes; then 3430 elif test "x$ac_cv_func_getpt" = xyes; then
3426 AC_DEFINE(PTY_OPEN, [fd = getpt ()]) 3431 AC_DEFINE(PTY_OPEN, [fd = getpt ()])
3427 AC_DEFINE(PTY_NAME_SPRINTF, []) 3432 AC_DEFINE(PTY_NAME_SPRINTF, [])
3428 else 3433 else
diff --git a/leim/ChangeLog b/leim/ChangeLog
index fcf0e72c3f4..5c29052d98b 100644
--- a/leim/ChangeLog
+++ b/leim/ChangeLog
@@ -1,3 +1,10 @@
12012-08-17 Daniel Bergey <bergey@alum.mit.edu> (tiny change)
2
3 * quail/indian.el (quail-define-inscript-package):
4 Set kbd-translate for all Inscript layouts. It's a positional
5 layout: vowels should be on the left hand regardless of the
6 underlying characters produced by those keys. (Bug#12072)
7
12012-08-06 Mohsen BANAN <libre@mohsen.1.banan.byname.net> 82012-08-06 Mohsen BANAN <libre@mohsen.1.banan.byname.net>
2 9
3 * quail/persian.el: Add some mappings. (Bug#11812) 10 * quail/persian.el: Add some mappings. (Bug#11812)
diff --git a/leim/quail/indian.el b/leim/quail/indian.el
index 1c01693478b..2541e60c57d 100644
--- a/leim/quail/indian.el
+++ b/leim/quail/indian.el
@@ -309,7 +309,7 @@ Full key sequences are listed below:")
309(defun quail-define-inscript-package (char-tables key-tables pkgname lang 309(defun quail-define-inscript-package (char-tables key-tables pkgname lang
310 title docstring) 310 title docstring)
311 (funcall 'quail-define-package pkgname lang title nil docstring 311 (funcall 'quail-define-package pkgname lang title nil docstring
312 nil nil nil nil nil nil nil nil) 312 nil nil nil t nil nil nil nil)
313 (let (char-table key-table char key) 313 (let (char-table key-table char key)
314 (while (and char-tables key-tables) 314 (while (and char-tables key-tables)
315 (setq char-table (car char-tables) 315 (setq char-table (car char-tables)
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index f3fd3751005..fe90917a70b 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,7 @@
12012-08-17 Juanma Barranquero <lekktu@gmail.com>
2
3 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4
12012-08-15 Paul Eggert <eggert@cs.ucla.edu> 52012-08-15 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 * etags.c (Pascal_functions): Fix parenthesization typo. 7 * etags.c (Pascal_functions): Fix parenthesization typo.
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
index a03d761e7ec..64974b88b6f 100644
--- a/lib-src/makefile.w32-in
+++ b/lib-src/makefile.w32-in
@@ -451,6 +451,7 @@ $(BLD)/profile.$(O) : \
451$(BLD)/regex.$(O) : \ 451$(BLD)/regex.$(O) : \
452 $(SRC)/regex.c \ 452 $(SRC)/regex.c \
453 $(SRC)/regex.h \ 453 $(SRC)/regex.h \
454 $(NT_INC)/stdbool.h \
454 $(NT_INC)/unistd.h \ 455 $(NT_INC)/unistd.h \
455 $(CONFIG_H) 456 $(CONFIG_H)
456 457
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7c67bb1b5b2..6be54850414 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,36 @@
12012-08-17 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp-sh.el (tramp-sh-handle-start-file-process): Eliminate
4 superfluous prompt. (Bug#12203)
5
62012-08-17 Chong Yidong <cyd@gnu.org>
7
8 * mouse.el (mouse-appearance-menu): If x-select-font returns a
9 font spec, set the font directly (Bug#3228).
10
112012-08-17 Martin Rudalics <rudalics@gmx.at>
12
13 * window.el (delete-window): Fix last fix.
14
12012-08-16 Martin Rudalics <rudalics@gmx.at> 152012-08-16 Martin Rudalics <rudalics@gmx.at>
2 16
3 * window.el (window-valid-p): Move to window.c. 17 * window.el (window-valid-p): Move to window.c.
18 (window-child, window-child-count, window-last-child)
19 (window-normalize-window, window-combined-p)
20 (window-combinations, window-atom-root, window-min-size)
21 (window-sizable, window-sizable-p, window-size-fixed-p)
22 (window-min-delta, window-max-delta, window--resizable)
23 (window--resizable-p, window-resizable, window-total-size)
24 (window-full-height-p, window-full-width-p, window-body-size)
25 (window-at-side-p, adjust-window-trailing-edge, maximize-window)
26 (minimize-window, window-deletable-p, delete-window)
27 (delete-other-windows, set-window-buffer-start-and-point)
28 (next-buffer, previous-buffer, split-window, balance-windows-2)
29 (set-window-text-height, window-buffer-height)
30 (fit-window-to-buffer, shrink-window-if-larger-than-buffer)
31 (truncated-partial-width-window-p): Minor code adjustments. In
32 doc-strings state whether the argument window has to denote a
33 live, valid or any window.
4 34
52012-08-16 Phil Sainty <psainty@orcon.net.nz> (tiny change) 352012-08-16 Phil Sainty <psainty@orcon.net.nz> (tiny change)
6 36
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 589bbd67b1b..4ea84288f69 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1951,12 +1951,14 @@ choose a font."
1951 (choice 1951 (choice
1952 ;; Either choice == 'x-select-font, or choice is a 1952 ;; Either choice == 'x-select-font, or choice is a
1953 ;; symbol whose name is a font. 1953 ;; symbol whose name is a font.
1954 (buffer-face-mode-invoke (font-face-attributes 1954 (let ((font (if (eq choice 'x-select-font)
1955 (if (eq choice 'x-select-font) 1955 (x-select-font)
1956 (x-select-font) 1956 (symbol-name choice))))
1957 (symbol-name choice))) 1957 (buffer-face-mode-invoke
1958 t 1958 (if (fontp font 'font-spec)
1959 (called-interactively-p 'interactive)))))))) 1959 (list :font font)
1960 (font-face-attributes font))
1961 t (called-interactively-p 'interactive)))))))))
1960 1962
1961 1963
1962;;; Bindings for mouse commands. 1964;;; Bindings for mouse commands.
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index e757247c2a2..6283188d46a 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2738,51 +2738,64 @@ the result will be a local, non-Tramp, filename."
2738 (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer))) 2738 (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
2739 (name1 name) 2739 (name1 name)
2740 (i 0)) 2740 (i 0))
2741 (unwind-protect 2741
2742 (save-excursion 2742 (unless buffer
2743 (save-restriction 2743 ;; BUFFER can be nil. We use a temporary buffer.
2744 (unless buffer 2744 (setq buffer (generate-new-buffer tramp-temp-buffer-name)))
2745 ;; BUFFER can be nil. We use a temporary buffer. 2745 (while (get-process name1)
2746 (setq buffer (generate-new-buffer tramp-temp-buffer-name))) 2746 ;; NAME must be unique as process name.
2747 (while (get-process name1) 2747 (setq i (1+ i)
2748 ;; NAME must be unique as process name. 2748 name1 (format "%s<%d>" name i)))
2749 (setq i (1+ i) 2749 (setq name name1)
2750 name1 (format "%s<%d>" name i))) 2750 ;; Set the new process properties.
2751 (setq name name1) 2751 (tramp-set-connection-property v "process-name" name)
2752 ;; Set the new process properties. 2752 (tramp-set-connection-property v "process-buffer" buffer)
2753 (tramp-set-connection-property v "process-name" name) 2753
2754 (tramp-set-connection-property v "process-buffer" buffer) 2754 (with-current-buffer (tramp-get-connection-buffer v)
2755 ;; Activate narrowing in order to save BUFFER contents. 2755 (unwind-protect
2756 ;; Clear also the modification time; otherwise we might 2756 (save-excursion
2757 ;; be interrupted by `verify-visited-file-modtime'. 2757 (save-restriction
2758 (with-current-buffer (tramp-get-connection-buffer v) 2758 ;; Activate narrowing in order to save BUFFER
2759 (let ((buffer-undo-list t)) 2759 ;; contents. Clear also the modification time;
2760 ;; otherwise we might be interrupted by
2761 ;; `verify-visited-file-modtime'.
2762 (let ((buffer-undo-list t)
2763 (buffer-read-only nil)
2764 (mark (point)))
2760 (clear-visited-file-modtime) 2765 (clear-visited-file-modtime)
2761 (narrow-to-region (point-max) (point-max)) 2766 (narrow-to-region (point-max) (point-max))
2767 ;; We call `tramp-maybe-open-connection', in order
2768 ;; to cleanup the prompt afterwards.
2769 (tramp-maybe-open-connection v)
2770 (widen)
2771 (delete-region mark (point))
2772 (narrow-to-region (point-max) (point-max))
2773 ;; Now do it.
2762 (if command 2774 (if command
2763 ;; Send the command. 2775 ;; Send the command.
2764 (tramp-send-command v command nil t) ; nooutput 2776 (tramp-send-command v command nil t) ; nooutput
2765 ;; Check, whether a pty is associated. 2777 ;; Check, whether a pty is associated.
2766 (tramp-maybe-open-connection v)
2767 (unless (tramp-compat-process-get 2778 (unless (tramp-compat-process-get
2768 (tramp-get-connection-process v) 'remote-tty) 2779 (tramp-get-connection-process v) 'remote-tty)
2769 (tramp-error 2780 (tramp-error
2770 v 'file-error 2781 v 'file-error
2771 "pty association is not supported for `%s'" name))))) 2782 "pty association is not supported for `%s'" name))))
2772 (let ((p (tramp-get-connection-process v))) 2783 (let ((p (tramp-get-connection-process v)))
2773 ;; Set query flag for this process. 2784 ;; Set query flag for this process. We ignore errors,
2774 (tramp-compat-set-process-query-on-exit-flag p t) 2785 ;; because the process could have finished already.
2775 ;; Return process. 2786 (ignore-errors
2776 p))) 2787 (tramp-compat-set-process-query-on-exit-flag p t))
2777 ;; Save exit. 2788 ;; Return process.
2778 (with-current-buffer (tramp-get-connection-buffer v) 2789 p)))
2790
2791 ;; Save exit.
2779 (if (string-match tramp-temp-buffer-name (buffer-name)) 2792 (if (string-match tramp-temp-buffer-name (buffer-name))
2780 (progn 2793 (progn
2781 (set-process-buffer (tramp-get-connection-process v) nil) 2794 (set-process-buffer (tramp-get-connection-process v) nil)
2782 (kill-buffer (current-buffer))) 2795 (kill-buffer (current-buffer)))
2783 (set-buffer-modified-p bmp))) 2796 (set-buffer-modified-p bmp))
2784 (tramp-set-connection-property v "process-name" nil) 2797 (tramp-set-connection-property v "process-name" nil)
2785 (tramp-set-connection-property v "process-buffer" nil))))) 2798 (tramp-set-connection-property v "process-buffer" nil))))))
2786 2799
2787(defun tramp-sh-handle-process-file 2800(defun tramp-sh-handle-process-file
2788 (program &optional infile destination display &rest args) 2801 (program &optional infile destination display &rest args)
diff --git a/lisp/window.el b/lisp/window.el
index d7129df8585..142e80e1666 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -91,11 +91,13 @@ be any window."
91 (and window (window-parent window) (window-prev-sibling window))) 91 (and window (window-parent window) (window-prev-sibling window)))
92 92
93(defun window-child (window) 93(defun window-child (window)
94 "Return WINDOW's first child window." 94 "Return WINDOW's first child window.
95WINDOW can be any window."
95 (or (window-top-child window) (window-left-child window))) 96 (or (window-top-child window) (window-left-child window)))
96 97
97(defun window-child-count (window) 98(defun window-child-count (window)
98 "Return number of WINDOW's child windows." 99 "Return number of WINDOW's child windows.
100WINDOW can be any window."
99 (let ((count 0)) 101 (let ((count 0))
100 (when (and (windowp window) (setq window (window-child window))) 102 (when (and (windowp window) (setq window (window-child window)))
101 (while window 103 (while window
@@ -104,7 +106,8 @@ be any window."
104 count)) 106 count))
105 107
106(defun window-last-child (window) 108(defun window-last-child (window)
107 "Return last child window of WINDOW." 109 "Return last child window of WINDOW.
110WINDOW can be any window."
108 (when (and (windowp window) (setq window (window-child window))) 111 (when (and (windowp window) (setq window (window-child window)))
109 (while (window-next-sibling window) 112 (while (window-next-sibling window)
110 (setq window (window-next-sibling window)))) 113 (setq window (window-next-sibling window))))
@@ -135,20 +138,22 @@ FRAME must be a live frame and defaults to the selected frame."
135 (selected-frame))) 138 (selected-frame)))
136 139
137(defun window-normalize-window (window &optional live-only) 140(defun window-normalize-window (window &optional live-only)
138 "Return window specified by WINDOW. 141 "Return the window specified by WINDOW.
139If WINDOW is nil, return `selected-window'. 142If WINDOW is nil, return the selected window. Otherwise, if
140If WINDOW is a live window or internal window, return WINDOW; 143WINDOW is a live or an internal window, return WINDOW; if
141 if LIVE-ONLY is non-nil, return WINDOW for a live window only. 144LIVE-ONLY is non-nil, return WINDOW for a live window only.
142Otherwise, signal an error." 145Otherwise, signal an error."
143 (cond ((null window) 146 (cond
144 (selected-window)) 147 ((null window)
145 (live-only 148 (selected-window))
146 (if (window-live-p window) 149 (live-only
147 window 150 (if (window-live-p window)
148 (error "%s is not a live window" window))) 151 window
149 ((if (window-valid-p window) 152 (error "%s is not a live window" window)))
150 window 153 ((window-valid-p window)
151 (error "%s is not a window" window))))) 154 window)
155 (t
156 (error "%s is not a valid window" window))))
152 157
153(defvar ignore-window-parameters nil 158(defvar ignore-window-parameters nil
154 "If non-nil, standard functions ignore window parameters. 159 "If non-nil, standard functions ignore window parameters.
@@ -199,7 +204,7 @@ narrower, explicitly specify the SIZE argument of that function."
199 204
200(defun window-combined-p (&optional window horizontal) 205(defun window-combined-p (&optional window horizontal)
201 "Return non-nil if WINDOW has siblings in a given direction. 206 "Return non-nil if WINDOW has siblings in a given direction.
202If WINDOW is omitted or nil, it defaults to the selected window. 207WINDOW must be a valid window and defaults to the selected one.
203 208
204HORIZONTAL determines a direction for the window combination. 209HORIZONTAL determines a direction for the window combination.
205If HORIZONTAL is omitted or nil, return non-nil if WINDOW is part 210If HORIZONTAL is omitted or nil, return non-nil if WINDOW is part
@@ -215,7 +220,7 @@ horizontal window combination."
215 220
216(defun window-combinations (window &optional horizontal) 221(defun window-combinations (window &optional horizontal)
217 "Return largest number of windows vertically arranged within WINDOW. 222 "Return largest number of windows vertically arranged within WINDOW.
218If WINDOW is omitted or nil, it defaults to the selected window. 223WINDOW must be a valid window and defaults to the selected one.
219If HORIZONTAL is non-nil, return the largest number of 224If HORIZONTAL is non-nil, return the largest number of
220windows horizontally arranged within WINDOW." 225windows horizontally arranged within WINDOW."
221 (setq window (window-normalize-window window)) 226 (setq window (window-normalize-window window))
@@ -313,7 +318,7 @@ too."
313;;; Atomic windows. 318;;; Atomic windows.
314(defun window-atom-root (&optional window) 319(defun window-atom-root (&optional window)
315 "Return root of atomic window WINDOW is a part of. 320 "Return root of atomic window WINDOW is a part of.
316WINDOW can be any window and defaults to the selected one. 321WINDOW must be a valid window and defaults to the selected one.
317Return nil if WINDOW is not part of an atomic window." 322Return nil if WINDOW is not part of an atomic window."
318 (setq window (window-normalize-window window)) 323 (setq window (window-normalize-window window))
319 (let (root) 324 (let (root)
@@ -517,10 +522,10 @@ window).")
517 522
518(defun window-min-size (&optional window horizontal ignore) 523(defun window-min-size (&optional window horizontal ignore)
519 "Return the minimum size of WINDOW. 524 "Return the minimum size of WINDOW.
520WINDOW can be an arbitrary window and defaults to the selected 525WINDOW must be a valid window and defaults to the selected one.
521one. Optional argument HORIZONTAL non-nil means return the 526Optional argument HORIZONTAL non-nil means return the minimum
522minimum number of columns of WINDOW; otherwise return the minimum 527number of columns of WINDOW; otherwise return the minimum number
523number of WINDOW's lines. 528of WINDOW's lines.
524 529
525Optional argument IGNORE, if non-nil, means ignore restrictions 530Optional argument IGNORE, if non-nil, means ignore restrictions
526imposed by fixed size windows, `window-min-height' or 531imposed by fixed size windows, `window-min-height' or
@@ -600,6 +605,7 @@ means ignore all of the above restrictions for all windows."
600 605
601(defun window-sizable (window delta &optional horizontal ignore) 606(defun window-sizable (window delta &optional horizontal ignore)
602 "Return DELTA if DELTA lines can be added to WINDOW. 607 "Return DELTA if DELTA lines can be added to WINDOW.
608WINDOW must be a valid window and defaults to the selected one.
603Optional argument HORIZONTAL non-nil means return DELTA if DELTA 609Optional argument HORIZONTAL non-nil means return DELTA if DELTA
604columns can be added to WINDOW. A return value of zero means 610columns can be added to WINDOW. A return value of zero means
605that no lines (or columns) can be added to WINDOW. 611that no lines (or columns) can be added to WINDOW.
@@ -641,6 +647,7 @@ ignore all of the above restrictions for all windows."
641 647
642(defun window-sizable-p (window delta &optional horizontal ignore) 648(defun window-sizable-p (window delta &optional horizontal ignore)
643 "Return t if WINDOW can be resized by DELTA lines. 649 "Return t if WINDOW can be resized by DELTA lines.
650WINDOW must be a valid window and defaults to the selected one.
644For the meaning of the arguments of this function see the 651For the meaning of the arguments of this function see the
645doc-string of `window-sizable'." 652doc-string of `window-sizable'."
646 (setq window (window-normalize-window window)) 653 (setq window (window-normalize-window window))
@@ -683,9 +690,9 @@ doc-string of `window-sizable'."
683 690
684(defun window-size-fixed-p (&optional window horizontal) 691(defun window-size-fixed-p (&optional window horizontal)
685 "Return non-nil if WINDOW's height is fixed. 692 "Return non-nil if WINDOW's height is fixed.
686WINDOW can be an arbitrary window and defaults to the selected 693WINDOW must be a valid window and defaults to the selected one.
687window. Optional argument HORIZONTAL non-nil means return 694Optional argument HORIZONTAL non-nil means return non-nil if
688non-nil if WINDOW's width is fixed. 695WINDOW's width is fixed.
689 696
690If this function returns nil, this does not necessarily mean that 697If this function returns nil, this does not necessarily mean that
691WINDOW can be resized in the desired direction. The function 698WINDOW can be resized in the desired direction. The function
@@ -733,8 +740,8 @@ WINDOW can be resized in the desired direction. The function
733 740
734(defun window-min-delta (&optional window horizontal ignore trail noup nodown) 741(defun window-min-delta (&optional window horizontal ignore trail noup nodown)
735 "Return number of lines by which WINDOW can be shrunk. 742 "Return number of lines by which WINDOW can be shrunk.
736WINDOW can be an arbitrary window and defaults to the selected 743WINDOW must be a valid window and defaults to the selected one.
737window. Return zero if WINDOW cannot be shrunk. 744Return zero if WINDOW cannot be shrunk.
738 745
739Optional argument HORIZONTAL non-nil means return number of 746Optional argument HORIZONTAL non-nil means return number of
740columns by which WINDOW can be shrunk. 747columns by which WINDOW can be shrunk.
@@ -815,8 +822,8 @@ at least one other window can be enlarged appropriately."
815 822
816(defun window-max-delta (&optional window horizontal ignore trail noup nodown) 823(defun window-max-delta (&optional window horizontal ignore trail noup nodown)
817 "Return maximum number of lines by which WINDOW can be enlarged. 824 "Return maximum number of lines by which WINDOW can be enlarged.
818WINDOW can be an arbitrary window and defaults to the selected 825WINDOW must be a valid window and defaults to the selected one.
819window. The return value is zero if WINDOW cannot be enlarged. 826The return value is zero if WINDOW cannot be enlarged.
820 827
821Optional argument HORIZONTAL non-nil means return maximum number 828Optional argument HORIZONTAL non-nil means return maximum number
822of columns by which WINDOW can be enlarged. 829of columns by which WINDOW can be enlarged.
@@ -853,6 +860,7 @@ only whether other windows can be shrunk appropriately."
853;; Make NOUP also inhibit the min-size check. 860;; Make NOUP also inhibit the min-size check.
854(defun window--resizable (window delta &optional horizontal ignore trail noup nodown) 861(defun window--resizable (window delta &optional horizontal ignore trail noup nodown)
855 "Return DELTA if WINDOW can be resized vertically by DELTA lines. 862 "Return DELTA if WINDOW can be resized vertically by DELTA lines.
863WINDOW must be a valid window and defaults to the selected one.
856Optional argument HORIZONTAL non-nil means return DELTA if WINDOW 864Optional argument HORIZONTAL non-nil means return DELTA if WINDOW
857can be resized horizontally by DELTA columns. A return value of 865can be resized horizontally by DELTA columns. A return value of
858zero means that WINDOW is not resizable. 866zero means that WINDOW is not resizable.
@@ -899,6 +907,7 @@ violate size restrictions of WINDOW or its child windows."
899 907
900(defun window--resizable-p (window delta &optional horizontal ignore trail noup nodown) 908(defun window--resizable-p (window delta &optional horizontal ignore trail noup nodown)
901 "Return t if WINDOW can be resized vertically by DELTA lines. 909 "Return t if WINDOW can be resized vertically by DELTA lines.
910WINDOW must be a valid window and defaults to the selected one.
902For the meaning of the arguments of this function see the 911For the meaning of the arguments of this function see the
903doc-string of `window--resizable'." 912doc-string of `window--resizable'."
904 (setq window (window-normalize-window window)) 913 (setq window (window-normalize-window window))
@@ -910,6 +919,7 @@ doc-string of `window--resizable'."
910 919
911(defun window-resizable (window delta &optional horizontal ignore) 920(defun window-resizable (window delta &optional horizontal ignore)
912 "Return DELTA if WINDOW can be resized vertically by DELTA lines. 921 "Return DELTA if WINDOW can be resized vertically by DELTA lines.
922WINDOW must be a valid window and defaults to the selected one.
913Optional argument HORIZONTAL non-nil means return DELTA if WINDOW 923Optional argument HORIZONTAL non-nil means return DELTA if WINDOW
914can be resized horizontally by DELTA columns. A return value of 924can be resized horizontally by DELTA columns. A return value of
915zero means that WINDOW is not resizable. 925zero means that WINDOW is not resizable.
@@ -936,7 +946,7 @@ means ignore all of the above restrictions for all windows."
936 946
937(defun window-total-size (&optional window horizontal) 947(defun window-total-size (&optional window horizontal)
938 "Return the total height or width of WINDOW. 948 "Return the total height or width of WINDOW.
939If WINDOW is omitted or nil, it defaults to the selected window. 949WINDOW must be a valid window and defaults to the selected one.
940 950
941If HORIZONTAL is omitted or nil, return the total height of 951If HORIZONTAL is omitted or nil, return the total height of
942WINDOW, in lines, like `window-total-height'. Otherwise return 952WINDOW, in lines, like `window-total-height'. Otherwise return
@@ -953,8 +963,8 @@ the total width, in columns, like `window-total-width'."
953 "Return t if WINDOW is as high as its containing frame. 963 "Return t if WINDOW is as high as its containing frame.
954More precisely, return t if and only if the total height of 964More precisely, return t if and only if the total height of
955WINDOW equals the total height of the root window of WINDOW's 965WINDOW equals the total height of the root window of WINDOW's
956frame. WINDOW can be any window and defaults to the selected 966frame. WINDOW must be a valid window and defaults to the
957one." 967selected one."
958 (setq window (window-normalize-window window)) 968 (setq window (window-normalize-window window))
959 (= (window-total-size window) 969 (= (window-total-size window)
960 (window-total-size (frame-root-window window)))) 970 (window-total-size (frame-root-window window))))
@@ -963,15 +973,14 @@ one."
963 "Return t if WINDOW is as wide as its containing frame. 973 "Return t if WINDOW is as wide as its containing frame.
964More precisely, return t if and only if the total width of WINDOW 974More precisely, return t if and only if the total width of WINDOW
965equals the total width of the root window of WINDOW's frame. 975equals the total width of the root window of WINDOW's frame.
966WINDOW can be any window and defaults to the selected one." 976WINDOW must be a valid window and defaults to the selected one."
967 (setq window (window-normalize-window window)) 977 (setq window (window-normalize-window window))
968 (= (window-total-size window t) 978 (= (window-total-size window t)
969 (window-total-size (frame-root-window window) t))) 979 (window-total-size (frame-root-window window) t)))
970 980
971(defun window-body-size (&optional window horizontal) 981(defun window-body-size (&optional window horizontal)
972 "Return the height or width of WINDOW's text area. 982 "Return the height or width of WINDOW's text area.
973If WINDOW is omitted or nil, it defaults to the selected window. 983WINDOW must be a live window and defaults to the selected one.
974Signal an error if the window is not live.
975 984
976If HORIZONTAL is omitted or nil, return the height of the text 985If HORIZONTAL is omitted or nil, return the height of the text
977area, like `window-body-height'. Otherwise, return the width of 986area, like `window-body-height'. Otherwise, return the width of
@@ -1081,9 +1090,9 @@ regardless of whether that buffer is current or not."
1081 1090
1082(defun window-at-side-p (&optional window side) 1091(defun window-at-side-p (&optional window side)
1083 "Return t if WINDOW is at SIDE of its containing frame. 1092 "Return t if WINDOW is at SIDE of its containing frame.
1084WINDOW can be any window and defaults to the selected one. SIDE 1093WINDOW must be a valid window and defaults to the selected one.
1085can be any of the symbols `left', `top', `right' or `bottom'. 1094SIDE can be any of the symbols `left', `top', `right' or
1086The default value nil is handled like `bottom'." 1095`bottom'. The default value nil is handled like `bottom'."
1087 (setq window (window-normalize-window window)) 1096 (setq window (window-normalize-window window))
1088 (let ((edge 1097 (let ((edge
1089 (cond 1098 (cond
@@ -2019,7 +2028,8 @@ any windows."
2019(defun adjust-window-trailing-edge (window delta &optional horizontal) 2028(defun adjust-window-trailing-edge (window delta &optional horizontal)
2020 "Move WINDOW's bottom edge by DELTA lines. 2029 "Move WINDOW's bottom edge by DELTA lines.
2021Optional argument HORIZONTAL non-nil means move WINDOW's right 2030Optional argument HORIZONTAL non-nil means move WINDOW's right
2022edge by DELTA columns. WINDOW defaults to the selected window. 2031edge by DELTA columns. WINDOW must be a valid window and
2032defaults to the selected one.
2023 2033
2024If DELTA is greater than zero, move the edge downwards or to the 2034If DELTA is greater than zero, move the edge downwards or to the
2025right. If DELTA is less than zero, move the edge upwards or to 2035right. If DELTA is less than zero, move the edge upwards or to
@@ -2203,7 +2213,7 @@ Return nil."
2203(defun maximize-window (&optional window) 2213(defun maximize-window (&optional window)
2204 "Maximize WINDOW. 2214 "Maximize WINDOW.
2205Make WINDOW as large as possible without deleting any windows. 2215Make WINDOW as large as possible without deleting any windows.
2206WINDOW can be any window and defaults to the selected window." 2216WINDOW must be a valid window and defaults to the selected one."
2207 (interactive) 2217 (interactive)
2208 (setq window (window-normalize-window window)) 2218 (setq window (window-normalize-window window))
2209 (window-resize window (window-max-delta window)) 2219 (window-resize window (window-max-delta window))
@@ -2212,7 +2222,7 @@ WINDOW can be any window and defaults to the selected window."
2212(defun minimize-window (&optional window) 2222(defun minimize-window (&optional window)
2213 "Minimize WINDOW. 2223 "Minimize WINDOW.
2214Make WINDOW as small as possible without deleting any windows. 2224Make WINDOW as small as possible without deleting any windows.
2215WINDOW can be any window and defaults to the selected window." 2225WINDOW must be a valid window and defaults to the selected one."
2216 (interactive) 2226 (interactive)
2217 (setq window (window-normalize-window window)) 2227 (setq window (window-normalize-window window))
2218 (window-resize window (- (window-min-delta window))) 2228 (window-resize window (- (window-min-delta window)))
@@ -2368,8 +2378,8 @@ and no others."
2368;;; Deleting windows. 2378;;; Deleting windows.
2369(defun window-deletable-p (&optional window) 2379(defun window-deletable-p (&optional window)
2370 "Return t if WINDOW can be safely deleted from its frame. 2380 "Return t if WINDOW can be safely deleted from its frame.
2371Return `frame' if deleting WINDOW should also delete its 2381WINDOW must be a valid window and defaults to the selected one.
2372frame." 2382Return `frame' if deleting WINDOW should also delete its frame."
2373 (setq window (window-normalize-window window)) 2383 (setq window (window-normalize-window window))
2374 2384
2375 (unless ignore-window-parameters 2385 (unless ignore-window-parameters
@@ -2407,8 +2417,8 @@ frame."
2407 2417
2408(defun delete-window (&optional window) 2418(defun delete-window (&optional window)
2409 "Delete WINDOW. 2419 "Delete WINDOW.
2410WINDOW can be an arbitrary window and defaults to the selected 2420WINDOW must be a valid window and defaults to the selected one.
2411one. Return nil. 2421Return nil.
2412 2422
2413If the variable `ignore-window-parameters' is non-nil or the 2423If the variable `ignore-window-parameters' is non-nil or the
2414`delete-window' parameter of WINDOW equals t, do not process any 2424`delete-window' parameter of WINDOW equals t, do not process any
@@ -2419,8 +2429,9 @@ function.
2419 2429
2420Otherwise, if WINDOW is part of an atomic window, call 2430Otherwise, if WINDOW is part of an atomic window, call
2421`delete-window' with the root of the atomic window as its 2431`delete-window' with the root of the atomic window as its
2422argument. If WINDOW is the only window on its frame or the last 2432argument. Signal an error if WINDOW is either the only window on
2423non-side window, signal an error." 2433its frame, the last non-side window, or part of an atomic window
2434that is its frame's root window."
2424 (interactive) 2435 (interactive)
2425 (setq window (window-normalize-window window)) 2436 (setq window (window-normalize-window window))
2426 (let* ((frame (window-frame window)) 2437 (let* ((frame (window-frame window))
@@ -2487,7 +2498,7 @@ non-side window, signal an error."
2487 2498
2488(defun delete-other-windows (&optional window) 2499(defun delete-other-windows (&optional window)
2489 "Make WINDOW fill its frame. 2500 "Make WINDOW fill its frame.
2490WINDOW may be any window and defaults to the selected one. 2501WINDOW must be a valid window and defaults to the selected one.
2491Return nil. 2502Return nil.
2492 2503
2493If the variable `ignore-window-parameters' is non-nil or the 2504If the variable `ignore-window-parameters' is non-nil or the
@@ -2630,11 +2641,13 @@ WINDOW."
2630 2641
2631(defun set-window-buffer-start-and-point (window buffer &optional start point) 2642(defun set-window-buffer-start-and-point (window buffer &optional start point)
2632 "Set WINDOW's buffer to BUFFER. 2643 "Set WINDOW's buffer to BUFFER.
2644WINDOW must be a live window and defaults to the selected one.
2633Optional argument START non-nil means set WINDOW's start position 2645Optional argument START non-nil means set WINDOW's start position
2634to START. Optional argument POINT non-nil means set WINDOW's 2646to START. Optional argument POINT non-nil means set WINDOW's
2635point to POINT. If WINDOW is selected this also sets BUFFER's 2647point to POINT. If WINDOW is selected this also sets BUFFER's
2636`point' to POINT. If WINDOW is selected and the buffer it showed 2648`point' to POINT. If WINDOW is selected and the buffer it showed
2637before was current this also makes BUFFER the current buffer." 2649before was current this also makes BUFFER the current buffer."
2650 (setq window (window-normalize-window window t))
2638 (let ((selected (eq window (selected-window))) 2651 (let ((selected (eq window (selected-window)))
2639 (current (eq (window-buffer window) (current-buffer)))) 2652 (current (eq (window-buffer window) (current-buffer))))
2640 (set-window-buffer window buffer) 2653 (set-window-buffer window buffer)
@@ -2948,16 +2961,24 @@ displayed there."
2948(defun next-buffer () 2961(defun next-buffer ()
2949 "In selected window switch to next buffer." 2962 "In selected window switch to next buffer."
2950 (interactive) 2963 (interactive)
2951 (if (window-minibuffer-p) 2964 (cond
2952 (error "Cannot switch buffers in minibuffer window")) 2965 ((window-minibuffer-p)
2953 (switch-to-next-buffer)) 2966 (error "Cannot switch buffers in minibuffer window"))
2967 ((eq (window-dedicated-p) t)
2968 (error "Window is strongly dedicated to its buffer"))
2969 (t
2970 (switch-to-next-buffer))))
2954 2971
2955(defun previous-buffer () 2972(defun previous-buffer ()
2956 "In selected window switch to previous buffer." 2973 "In selected window switch to previous buffer."
2957 (interactive) 2974 (interactive)
2958 (if (window-minibuffer-p) 2975 (cond
2959 (error "Cannot switch buffers in minibuffer window")) 2976 ((window-minibuffer-p)
2960 (switch-to-prev-buffer)) 2977 (error "Cannot switch buffers in minibuffer window"))
2978 ((eq (window-dedicated-p) t)
2979 (error "Window is strongly dedicated to its buffer"))
2980 (t
2981 (switch-to-prev-buffer))))
2961 2982
2962(defun delete-windows-on (&optional buffer-or-name frame) 2983(defun delete-windows-on (&optional buffer-or-name frame)
2963 "Delete all windows showing BUFFER-OR-NAME. 2984 "Delete all windows showing BUFFER-OR-NAME.
@@ -3130,7 +3151,7 @@ Optional argument HORIZONTAL non-nil means return minimum width."
3130 3151
3131(defun split-window (&optional window size side) 3152(defun split-window (&optional window size side)
3132 "Make a new window adjacent to WINDOW. 3153 "Make a new window adjacent to WINDOW.
3133WINDOW can be any window and defaults to the selected one. 3154WINDOW must be a valid window and defaults to the selected one.
3134Return the new window which is always a live window. 3155Return the new window which is always a live window.
3135 3156
3136Optional argument SIZE a positive number means make WINDOW SIZE 3157Optional argument SIZE a positive number means make WINDOW SIZE
@@ -3451,7 +3472,7 @@ right, if any."
3451(defun balance-windows-2 (window horizontal) 3472(defun balance-windows-2 (window horizontal)
3452 "Subroutine of `balance-windows-1'. 3473 "Subroutine of `balance-windows-1'.
3453WINDOW must be a vertical combination (horizontal if HORIZONTAL 3474WINDOW must be a vertical combination (horizontal if HORIZONTAL
3454is non-nil." 3475is non-nil)."
3455 (let* ((first (window-child window)) 3476 (let* ((first (window-child window))
3456 (sub first) 3477 (sub first)
3457 (number-of-children 0) 3478 (number-of-children 0)
@@ -5179,9 +5200,9 @@ documentation for additional customization information."
5179 5200
5180(defun set-window-text-height (window height) 5201(defun set-window-text-height (window height)
5181 "Set the height in lines of the text display area of WINDOW to HEIGHT. 5202 "Set the height in lines of the text display area of WINDOW to HEIGHT.
5182WINDOW must be a live window. HEIGHT doesn't include the mode 5203WINDOW must be a live window and defaults to the selected one.
5183line or header line, if any, or any partial-height lines in the 5204HEIGHT doesn't include the mode line or header line, if any, or
5184text display area. 5205any partial-height lines in the text display area.
5185 5206
5186Note that the current implementation of this function cannot 5207Note that the current implementation of this function cannot
5187always set the height exactly, but attempts to be conservative, 5208always set the height exactly, but attempts to be conservative,
@@ -5248,7 +5269,9 @@ in some window."
5248 (1+ (vertical-motion (buffer-size) window)))))) 5269 (1+ (vertical-motion (buffer-size) window))))))
5249 5270
5250(defun window-buffer-height (window) 5271(defun window-buffer-height (window)
5251 "Return the height (in screen lines) of the buffer that WINDOW is displaying." 5272 "Return the height (in screen lines) of the buffer that WINDOW is displaying.
5273WINDOW must be a live window and defaults to the selected one."
5274 (setq window (window-normalize-window window t))
5252 (with-current-buffer (window-buffer window) 5275 (with-current-buffer (window-buffer window)
5253 (max 1 5276 (max 1
5254 (count-screen-lines (point-min) (point-max) 5277 (count-screen-lines (point-min) (point-max)
@@ -5260,7 +5283,7 @@ in some window."
5260;;; Resizing buffers to fit their contents exactly. 5283;;; Resizing buffers to fit their contents exactly.
5261(defun fit-window-to-buffer (&optional window max-height min-height override) 5284(defun fit-window-to-buffer (&optional window max-height min-height override)
5262 "Adjust height of WINDOW to display its buffer's contents exactly. 5285 "Adjust height of WINDOW to display its buffer's contents exactly.
5263WINDOW can be any live window and defaults to the selected one. 5286WINDOW must be a live window and defaults to the selected one.
5264 5287
5265Optional argument MAX-HEIGHT specifies the maximum height of 5288Optional argument MAX-HEIGHT specifies the maximum height of
5266WINDOW and defaults to the height of WINDOW's frame. Optional 5289WINDOW and defaults to the height of WINDOW's frame. Optional
@@ -5379,7 +5402,7 @@ WINDOW defaults to the selected window."
5379 "Shrink height of WINDOW if its buffer doesn't need so many lines. 5402 "Shrink height of WINDOW if its buffer doesn't need so many lines.
5380More precisely, shrink WINDOW vertically to be as small as 5403More precisely, shrink WINDOW vertically to be as small as
5381possible, while still showing the full contents of its buffer. 5404possible, while still showing the full contents of its buffer.
5382WINDOW defaults to the selected window. 5405WINDOW must be a live window and defaults to the selected one.
5383 5406
5384Do not shrink WINDOW to less than `window-min-height' lines. Do 5407Do not shrink WINDOW to less than `window-min-height' lines. Do
5385nothing if the buffer contains more lines than the present window 5408nothing if the buffer contains more lines than the present window
@@ -5801,13 +5824,12 @@ is active. This function is run by `mouse-autoselect-window-timer'."
5801 5824
5802(defun truncated-partial-width-window-p (&optional window) 5825(defun truncated-partial-width-window-p (&optional window)
5803 "Return non-nil if lines in WINDOW are specifically truncated due to its width. 5826 "Return non-nil if lines in WINDOW are specifically truncated due to its width.
5804WINDOW defaults to the selected window. 5827WINDOW must be a live window and defaults to the selected one.
5805Return nil if WINDOW is not a partial-width window 5828Return nil if WINDOW is not a partial-width window
5806 (regardless of the value of `truncate-lines'). 5829 (regardless of the value of `truncate-lines').
5807Otherwise, consult the value of `truncate-partial-width-windows' 5830Otherwise, consult the value of `truncate-partial-width-windows'
5808 for the buffer shown in WINDOW." 5831 for the buffer shown in WINDOW."
5809 (unless window 5832 (setq window (window-normalize-window window t))
5810 (setq window (selected-window)))
5811 (unless (window-full-width-p window) 5833 (unless (window-full-width-p window)
5812 (let ((t-p-w-w (buffer-local-value 'truncate-partial-width-windows 5834 (let ((t-p-w-w (buffer-local-value 'truncate-partial-width-windows
5813 (window-buffer window)))) 5835 (window-buffer window))))
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index 8d36e2e22d7..7d49d9b531b 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -1,3 +1,11 @@
12012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2
3 Use ASCII tests for character types.
4 * lwlib-Xaw.c, lwlib.c, xlwmenu.c:
5 Don't include <ctype.h>; no longer needed.
6 * lwlib-Xaw.c (openFont):
7 * xlwmenu.c (openXftFont): Test just for ASCII digits.
8
12012-08-01 Glenn Morris <rgm@gnu.org> 92012-08-01 Glenn Morris <rgm@gnu.org>
2 10
3 * Makefile.in (config_h): Add conf_post.h. 11 * Makefile.in (config_h): Add conf_post.h.
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c
index 7f834df1aad..d37fb70fdb8 100644
--- a/lwlib/lwlib-Xaw.c
+++ b/lwlib/lwlib-Xaw.c
@@ -24,7 +24,6 @@ Boston, MA 02110-1301, USA. */
24 24
25#include <stdio.h> 25#include <stdio.h>
26#include <setjmp.h> 26#include <setjmp.h>
27#include <ctype.h>
28 27
29#include <lisp.h> 28#include <lisp.h>
30 29
@@ -125,7 +124,7 @@ openFont (Widget widget, char *name)
125 XftFont *fn; 124 XftFont *fn;
126 125
127 /* Try to convert Gtk-syntax (Sans 9) to Xft syntax Sans-9. */ 126 /* Try to convert Gtk-syntax (Sans 9) to Xft syntax Sans-9. */
128 while (i > 0 && isdigit (fname[i])) 127 while (i > 0 && '0' <= fname[i] && fname[i] <= '9')
129 --i; 128 --i;
130 if (fname[i] == ' ') 129 if (fname[i] == ' ')
131 { 130 {
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index 5820be8d7a4..ad3792dd59d 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -28,7 +28,6 @@ Boston, MA 02110-1301, USA. */
28 28
29#include <sys/types.h> 29#include <sys/types.h>
30#include <stdio.h> 30#include <stdio.h>
31#include <ctype.h>
32#include "lwlib-int.h" 31#include "lwlib-int.h"
33#include "lwlib-utils.h" 32#include "lwlib-utils.h"
34#include <X11/StringDefs.h> 33#include <X11/StringDefs.h>
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index e8831c37f8f..c76cb1a3f38 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -28,7 +28,6 @@ Boston, MA 02110-1301, USA. */
28#include <lisp.h> 28#include <lisp.h>
29 29
30#include <stdio.h> 30#include <stdio.h>
31#include <ctype.h>
32 31
33#include <sys/types.h> 32#include <sys/types.h>
34#if (defined __sun) && !(defined SUNOS41) 33#if (defined __sun) && !(defined SUNOS41)
@@ -1858,7 +1857,7 @@ openXftFont (XlwMenuWidget mw)
1858 int screen = XScreenNumberOfScreen (mw->core.screen); 1857 int screen = XScreenNumberOfScreen (mw->core.screen);
1859 int len = strlen (fname), i = len-1; 1858 int len = strlen (fname), i = len-1;
1860 /* Try to convert Gtk-syntax (Sans 9) to Xft syntax Sans-9. */ 1859 /* Try to convert Gtk-syntax (Sans 9) to Xft syntax Sans-9. */
1861 while (i > 0 && isdigit (fname[i])) 1860 while (i > 0 && '0' <= fname[i] && fname[i] <= '9')
1862 --i; 1861 --i;
1863 if (fname[i] == ' ') 1862 if (fname[i] == ' ')
1864 { 1863 {
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 4727950b9a9..12273ec7853 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,8 @@
12012-08-17 Juanma Barranquero <lekktu@gmail.com>
2
3 * config.nt: Sync with autogen/config.in.
4 (HAVE_POSIX_OPENPT): New macro.
5
12012-08-14 Juanma Barranquero <lekktu@gmail.com> 62012-08-14 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * config.nt: Sync with autogen/config.in. 8 * config.nt: Sync with autogen/config.in.
diff --git a/nt/config.nt b/nt/config.nt
index b07c04d92e2..5181e09e64e 100644
--- a/nt/config.nt
+++ b/nt/config.nt
@@ -740,6 +740,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
740/* Define to 1 if you have the `posix_memalign' function. */ 740/* Define to 1 if you have the `posix_memalign' function. */
741#undef HAVE_POSIX_MEMALIGN 741#undef HAVE_POSIX_MEMALIGN
742 742
743/* Define to 1 if you have the `posix_openpt' function. */
744#undef HAVE_POSIX_OPENPT
745
743/* Define if you have the /proc filesystem. */ 746/* Define if you have the /proc filesystem. */
744#undef HAVE_PROCFS 747#undef HAVE_PROCFS
745 748
diff --git a/src/ChangeLog b/src/ChangeLog
index 95140401eb2..72a11c177c4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,61 @@
12012-08-17 Chong Yidong <cyd@gnu.org>
2
3 * xfaces.c (merge_face_vectors): If the target font specfies a
4 font spec, make the font's attributes take precedence over
5 directly-specified attributes.
6 (merge_face_ref): Recognize :font.
7
82012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
9
10 Do not use memcpy for copying intervals.
11 * intervals.c (reproduce_interval): New function.
12 (reproduce_tree, reproduce_tree_obj): Use it.
13 (reproduce_tree_obj): Remove prototype.
14
152012-08-17 Paul Eggert <eggert@cs.ucla.edu>
16
17 * lisp.h (duration_to_sec_usec): Remove unused decl.
18
192012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
20
21 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
22 to an allocated instance of NSString, not to the class itself.
23
242012-08-17 Juanma Barranquero <lekktu@gmail.com>
25
26 * makefile.w32-in (C_CTYPE_H): New macro.
27 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
28 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
29 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
30
312012-08-16 Paul Eggert <eggert@cs.ucla.edu>
32
33 Use ASCII tests for character types.
34 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
35 * xfns.c, xterm.c:
36 Don't include <ctype.h>; was not needed.
37 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
38 * sysdep.c, xfaces.c:
39 Include <c-ctype.h> instead of <ctype.h>.
40 * nsterm.m: Include <c-ctype.h>.
41 * charset.c (read_hex):
42 * doc.c (Fsnarf_documentation):
43 * fileio.c (IS_DRIVE) [WINDOWSNT]:
44 (DRIVE_LETTER) [DOS_NT]:
45 (Ffile_name_directory, Fexpand_file_name)
46 (Fsubstitute_in_file_name):
47 * font.c (font_parse_xlfd, font_parse_fcname):
48 * frame.c (x_set_font_backend):
49 * gtkutil.c (xg_get_font):
50 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
51 * nsimage.m (hexchar):
52 * nsterm.m (ns_xlfd_to_fontname):
53 * sysdep.c (system_process_attributes):
54 * xfaces.c (hash_string_case_insensitive):
55 Use C-locale tests instead of locale-specific tests for character
56 types, since we want the ASCII interpretation here, not the
57 interpretation suitable for whatever happens to be the current locale.
58
12012-08-16 Martin Rudalics <rudalics@gmx.at> 592012-08-16 Martin Rudalics <rudalics@gmx.at>
2 60
3 Consistently check windows for validity/liveness 61 Consistently check windows for validity/liveness
@@ -3411,6 +3469,7 @@
3411 has at least microseconds now. All uses removed. 3469 has at least microseconds now. All uses removed.
3412 (update_frame, update_single_window, update_window, update_frame_1) 3470 (update_frame, update_single_window, update_window, update_frame_1)
3413 (Fsleep_for, sit_for): Port to higher-resolution time stamps. 3471 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
3472 (duration_to_sec_usec): Remove; no longer needed.
3414 3473
3415 * editfns.c (time_overflow): Now extern. 3474 * editfns.c (time_overflow): Now extern.
3416 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument) 3475 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
diff --git a/src/category.c b/src/category.c
index 3d5b3cff04a..246a7d35a6d 100644
--- a/src/category.c
+++ b/src/category.c
@@ -32,7 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32 32
33#define CATEGORY_INLINE EXTERN_INLINE 33#define CATEGORY_INLINE EXTERN_INLINE
34 34
35#include <ctype.h>
36#include <setjmp.h> 35#include <setjmp.h>
37#include "lisp.h" 36#include "lisp.h"
38#include "character.h" 37#include "character.h"
diff --git a/src/charset.c b/src/charset.c
index fbbcefc4915..87c16e12008 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -30,10 +30,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30 30
31#include <stdio.h> 31#include <stdio.h>
32#include <unistd.h> 32#include <unistd.h>
33#include <ctype.h>
34#include <limits.h> 33#include <limits.h>
35#include <sys/types.h> 34#include <sys/types.h>
36#include <setjmp.h> 35#include <setjmp.h>
36#include <c-ctype.h>
37#include "lisp.h" 37#include "lisp.h"
38#include "character.h" 38#include "character.h"
39#include "charset.h" 39#include "charset.h"
@@ -446,7 +446,7 @@ read_hex (FILE *fp, int *eof, int *overflow)
446 return 0; 446 return 0;
447 } 447 }
448 n = 0; 448 n = 0;
449 while (isxdigit (c = getc (fp))) 449 while (c_isxdigit (c = getc (fp)))
450 { 450 {
451 if (UINT_MAX >> 4 < n) 451 if (UINT_MAX >> 4 < n)
452 *overflow = 1; 452 *overflow = 1;
diff --git a/src/dispnew.c b/src/dispnew.c
index b82761f8cad..3288faba61b 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23 23
24#include <signal.h> 24#include <signal.h>
25#include <stdio.h> 25#include <stdio.h>
26#include <ctype.h>
27#include <setjmp.h> 26#include <setjmp.h>
28#include <unistd.h> 27#include <unistd.h>
29 28
diff --git a/src/doc.c b/src/doc.c
index d17e90f11c0..ed311d918d7 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -22,11 +22,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22 22
23#include <sys/types.h> 23#include <sys/types.h>
24#include <sys/file.h> /* Must be after sys/types.h for USG*/ 24#include <sys/file.h> /* Must be after sys/types.h for USG*/
25#include <ctype.h>
26#include <setjmp.h> 25#include <setjmp.h>
27#include <fcntl.h> 26#include <fcntl.h>
28#include <unistd.h> 27#include <unistd.h>
29 28
29#include <c-ctype.h>
30
30#include "lisp.h" 31#include "lisp.h"
31#include "character.h" 32#include "character.h"
32#include "buffer.h" 33#include "buffer.h"
@@ -597,9 +598,9 @@ the same file name is found in the `doc-directory'. */)
597 { 598 {
598 ptrdiff_t len; 599 ptrdiff_t len;
599 600
600 while (*beg && isspace (*beg)) ++beg; 601 while (*beg && c_isspace (*beg)) ++beg;
601 602
602 for (end = beg; *end && ! isspace (*end); ++end) 603 for (end = beg; *end && ! c_isspace (*end); ++end)
603 if (*end == '/') beg = end+1; /* skip directory part */ 604 if (*end == '/') beg = end+1; /* skip directory part */
604 605
605 len = end - beg; 606 len = end - beg;
diff --git a/src/doprnt.c b/src/doprnt.c
index 63f05cb74e2..b36e946005d 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -102,7 +102,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
102 102
103#include <config.h> 103#include <config.h>
104#include <stdio.h> 104#include <stdio.h>
105#include <ctype.h>
106#include <setjmp.h> 105#include <setjmp.h>
107#include <float.h> 106#include <float.h>
108#include <unistd.h> 107#include <unistd.h>
diff --git a/src/editfns.c b/src/editfns.c
index 5ac012c8378..b7feb733782 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -44,7 +44,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
44#include <sys/resource.h> 44#include <sys/resource.h>
45#endif 45#endif
46 46
47#include <ctype.h>
48#include <float.h> 47#include <float.h>
49#include <limits.h> 48#include <limits.h>
50#include <intprops.h> 49#include <intprops.h>
diff --git a/src/fileio.c b/src/fileio.c
index eba157ea042..5991a238ffc 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -30,7 +30,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30#include <pwd.h> 30#include <pwd.h>
31#endif 31#endif
32 32
33#include <ctype.h>
34#include <errno.h> 33#include <errno.h>
35 34
36#ifdef HAVE_LIBSELINUX 35#ifdef HAVE_LIBSELINUX
@@ -38,6 +37,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38#include <selinux/context.h> 37#include <selinux/context.h>
39#endif 38#endif
40 39
40#include <c-ctype.h>
41
41#include "lisp.h" 42#include "lisp.h"
42#include "intervals.h" 43#include "intervals.h"
43#include "character.h" 44#include "character.h"
@@ -67,12 +68,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
67#define IS_DRIVE(x) ((x) >= 'A' && (x) <= 'z') 68#define IS_DRIVE(x) ((x) >= 'A' && (x) <= 'z')
68#endif 69#endif
69#ifdef WINDOWSNT 70#ifdef WINDOWSNT
70#define IS_DRIVE(x) isalpha ((unsigned char) (x)) 71#define IS_DRIVE(x) c_isalpha (x)
71#endif 72#endif
72/* Need to lower-case the drive letter, or else expanded 73/* Need to lower-case the drive letter, or else expanded
73 filenames will sometimes compare unequal, because 74 filenames will sometimes compare unequal, because
74 `expand-file-name' doesn't always down-case the drive letter. */ 75 `expand-file-name' doesn't always down-case the drive letter. */
75#define DRIVE_LETTER(x) (tolower ((unsigned char) (x))) 76#define DRIVE_LETTER(x) c_tolower (x)
76#endif 77#endif
77 78
78#include "systime.h" 79#include "systime.h"
@@ -364,7 +365,7 @@ Given a Unix syntax file name, returns a string ending in slash. */)
364 r += 2; 365 r += 2;
365 } 366 }
366 367
367 if (getdefdir (toupper ((unsigned char) *beg) - 'A' + 1, r)) 368 if (getdefdir (c_toupper (*beg) - 'A' + 1, r))
368 { 369 {
369 if (!IS_DIRECTORY_SEP (res[strlen (res) - 1])) 370 if (!IS_DIRECTORY_SEP (res[strlen (res) - 1]))
370 strcat (res, "/"); 371 strcat (res, "/");
@@ -1053,7 +1054,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1053 if (!IS_DIRECTORY_SEP (nm[0])) 1054 if (!IS_DIRECTORY_SEP (nm[0]))
1054 { 1055 {
1055 adir = alloca (MAXPATHLEN + 1); 1056 adir = alloca (MAXPATHLEN + 1);
1056 if (!getdefdir (toupper (drive) - 'A' + 1, adir)) 1057 if (!getdefdir (c_toupper (drive) - 'A' + 1, adir))
1057 adir = NULL; 1058 adir = NULL;
1058 } 1059 }
1059 if (!adir) 1060 if (!adir)
@@ -1129,7 +1130,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1129 adir = alloca (MAXPATHLEN + 1); 1130 adir = alloca (MAXPATHLEN + 1);
1130 if (drive) 1131 if (drive)
1131 { 1132 {
1132 if (!getdefdir (toupper (drive) - 'A' + 1, adir)) 1133 if (!getdefdir (c_toupper (drive) - 'A' + 1, adir))
1133 newdir = "/"; 1134 newdir = "/";
1134 } 1135 }
1135 else 1136 else
@@ -1635,7 +1636,7 @@ those `/' is discarded. */)
1635 else 1636 else
1636 { 1637 {
1637 o = p; 1638 o = p;
1638 while (p != endp && (isalnum (*p) || *p == '_')) p++; 1639 while (p != endp && (c_isalnum (*p) || *p == '_')) p++;
1639 s = p; 1640 s = p;
1640 } 1641 }
1641 1642
@@ -1698,7 +1699,7 @@ those `/' is discarded. */)
1698 else 1699 else
1699 { 1700 {
1700 o = p; 1701 o = p;
1701 while (p != endp && (isalnum (*p) || *p == '_')) p++; 1702 while (p != endp && (c_isalnum (*p) || *p == '_')) p++;
1702 s = p; 1703 s = p;
1703 } 1704 }
1704 1705
diff --git a/src/font.c b/src/font.c
index c3040b8aa3f..5b9e4f1cfcf 100644
--- a/src/font.c
+++ b/src/font.c
@@ -23,9 +23,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <config.h> 23#include <config.h>
24#include <float.h> 24#include <float.h>
25#include <stdio.h> 25#include <stdio.h>
26#include <ctype.h>
27#include <setjmp.h> 26#include <setjmp.h>
28 27
28#include <c-ctype.h>
29
29#include "lisp.h" 30#include "lisp.h"
30#include "character.h" 31#include "character.h"
31#include "buffer.h" 32#include "buffer.h"
@@ -1079,7 +1080,7 @@ font_parse_xlfd (char *name, ptrdiff_t len, Lisp_Object font)
1079 p = f[XLFD_POINT_INDEX]; 1080 p = f[XLFD_POINT_INDEX];
1080 if (*p == '[') 1081 if (*p == '[')
1081 point_size = parse_matrix (p); 1082 point_size = parse_matrix (p);
1082 else if (isdigit (*p)) 1083 else if (c_isdigit (*p))
1083 point_size = atoi (p), point_size /= 10; 1084 point_size = atoi (p), point_size /= 10;
1084 if (point_size >= 0) 1085 if (point_size >= 0)
1085 ASET (font, FONT_SIZE_INDEX, make_float (point_size)); 1086 ASET (font, FONT_SIZE_INDEX, make_float (point_size));
@@ -1346,7 +1347,7 @@ font_parse_fcname (char *name, ptrdiff_t len, Lisp_Object font)
1346 { 1347 {
1347 int decimal = 0, size_found = 1; 1348 int decimal = 0, size_found = 1;
1348 for (q = p + 1; *q && *q != ':'; q++) 1349 for (q = p + 1; *q && *q != ':'; q++)
1349 if (! isdigit (*q)) 1350 if (! c_isdigit (*q))
1350 { 1351 {
1351 if (*q != '.' || decimal) 1352 if (*q != '.' || decimal)
1352 { 1353 {
@@ -1474,7 +1475,7 @@ font_parse_fcname (char *name, ptrdiff_t len, Lisp_Object font)
1474 1475
1475 /* Scan backwards from the end, looking for a size. */ 1476 /* Scan backwards from the end, looking for a size. */
1476 for (p = name + len - 1; p >= name; p--) 1477 for (p = name + len - 1; p >= name; p--)
1477 if (!isdigit (*p)) 1478 if (!c_isdigit (*p))
1478 break; 1479 break;
1479 1480
1480 if ((p < name + len - 1) && ((p + 1 == name) || *p == ' ')) 1481 if ((p < name + len - 1) && ((p + 1 == name) || *p == ' '))
diff --git a/src/frame.c b/src/frame.c
index ea682835a87..9dabae55abc 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -20,10 +20,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#include <config.h> 20#include <config.h>
21 21
22#include <stdio.h> 22#include <stdio.h>
23#include <ctype.h>
24#include <errno.h> 23#include <errno.h>
25#include <limits.h> 24#include <limits.h>
26#include <setjmp.h> 25#include <setjmp.h>
26
27#include <c-ctype.h>
28
27#include "lisp.h" 29#include "lisp.h"
28#include "character.h" 30#include "character.h"
29#ifdef HAVE_X_WINDOWS 31#ifdef HAVE_X_WINDOWS
@@ -3271,7 +3273,7 @@ x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
3271 new_value = Qnil; 3273 new_value = Qnil;
3272 while (*p0) 3274 while (*p0)
3273 { 3275 {
3274 while (*p1 && ! isspace (*p1) && *p1 != ',') p1++; 3276 while (*p1 && ! c_isspace (*p1) && *p1 != ',') p1++;
3275 if (p0 < p1) 3277 if (p0 < p1)
3276 new_value = Fcons (Fintern (make_string (p0, p1 - p0), Qnil), 3278 new_value = Fcons (Fintern (make_string (p0, p1 - p0), Qnil),
3277 new_value); 3279 new_value);
@@ -3279,7 +3281,7 @@ x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
3279 { 3281 {
3280 int c; 3282 int c;
3281 3283
3282 while ((c = *++p1) && isspace (c)); 3284 while ((c = *++p1) && c_isspace (c));
3283 } 3285 }
3284 p0 = p1; 3286 p0 = p1;
3285 } 3287 }
diff --git a/src/gtkutil.c b/src/gtkutil.c
index a4de47f073c..2941605d448 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -24,7 +24,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24#include <signal.h> 24#include <signal.h>
25#include <stdio.h> 25#include <stdio.h>
26#include <setjmp.h> 26#include <setjmp.h>
27#include <ctype.h> 27
28#include <c-ctype.h>
29
28#include "lisp.h" 30#include "lisp.h"
29#include "xterm.h" 31#include "xterm.h"
30#include "blockinput.h" 32#include "blockinput.h"
@@ -2072,7 +2074,7 @@ xg_get_font (FRAME_PTR f, const char *default_name)
2072 if (p) 2074 if (p)
2073 { 2075 {
2074 char *ep = p+1; 2076 char *ep = p+1;
2075 while (isdigit (*ep)) 2077 while (c_isdigit (*ep))
2076 ++ep; 2078 ++ep;
2077 if (*ep == '\0') *p = ' '; 2079 if (*ep == '\0') *p = ' ';
2078 } 2080 }
diff --git a/src/image.c b/src/image.c
index 8a318c2f6ec..f2778165ece 100644
--- a/src/image.c
+++ b/src/image.c
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#include <config.h> 20#include <config.h>
21#include <stdio.h> 21#include <stdio.h>
22#include <math.h> 22#include <math.h>
23#include <ctype.h>
24#include <unistd.h> 23#include <unistd.h>
25 24
26#ifdef HAVE_PNG 25#ifdef HAVE_PNG
@@ -33,6 +32,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
33 32
34#include <setjmp.h> 33#include <setjmp.h>
35 34
35#include <c-ctype.h>
36
36/* This makes the fields of a Display accessible, in Xlib header files. */ 37/* This makes the fields of a Display accessible, in Xlib header files. */
37 38
38#define XLIB_ILLEGAL_ACCESS 39#define XLIB_ILLEGAL_ACCESS
@@ -2405,12 +2406,12 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
2405 loop: 2406 loop:
2406 2407
2407 /* Skip white space. */ 2408 /* Skip white space. */
2408 while (*s < end && (c = *(*s)++, isspace (c))) 2409 while (*s < end && (c = *(*s)++, c_isspace (c)))
2409 ; 2410 ;
2410 2411
2411 if (*s >= end) 2412 if (*s >= end)
2412 c = 0; 2413 c = 0;
2413 else if (isdigit (c)) 2414 else if (c_isdigit (c))
2414 { 2415 {
2415 int value = 0, digit; 2416 int value = 0, digit;
2416 2417
@@ -2422,7 +2423,7 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
2422 while (*s < end) 2423 while (*s < end)
2423 { 2424 {
2424 c = *(*s)++; 2425 c = *(*s)++;
2425 if (isdigit (c)) 2426 if (c_isdigit (c))
2426 digit = c - '0'; 2427 digit = c - '0';
2427 else if (c >= 'a' && c <= 'f') 2428 else if (c >= 'a' && c <= 'f')
2428 digit = c - 'a' + 10; 2429 digit = c - 'a' + 10;
@@ -2433,11 +2434,11 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
2433 value = 16 * value + digit; 2434 value = 16 * value + digit;
2434 } 2435 }
2435 } 2436 }
2436 else if (isdigit (c)) 2437 else if (c_isdigit (c))
2437 { 2438 {
2438 value = c - '0'; 2439 value = c - '0';
2439 while (*s < end 2440 while (*s < end
2440 && (c = *(*s)++, isdigit (c))) 2441 && (c = *(*s)++, c_isdigit (c)))
2441 value = 8 * value + c - '0'; 2442 value = 8 * value + c - '0';
2442 } 2443 }
2443 } 2444 }
@@ -2445,7 +2446,7 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
2445 { 2446 {
2446 value = c - '0'; 2447 value = c - '0';
2447 while (*s < end 2448 while (*s < end
2448 && (c = *(*s)++, isdigit (c))) 2449 && (c = *(*s)++, c_isdigit (c)))
2449 value = 10 * value + c - '0'; 2450 value = 10 * value + c - '0';
2450 } 2451 }
2451 2452
@@ -2454,11 +2455,11 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
2454 *ival = value; 2455 *ival = value;
2455 c = XBM_TK_NUMBER; 2456 c = XBM_TK_NUMBER;
2456 } 2457 }
2457 else if (isalpha (c) || c == '_') 2458 else if (c_isalpha (c) || c == '_')
2458 { 2459 {
2459 *sval++ = c; 2460 *sval++ = c;
2460 while (*s < end 2461 while (*s < end
2461 && (c = *(*s)++, (isalnum (c) || c == '_'))) 2462 && (c = *(*s)++, (c_isalnum (c) || c == '_')))
2462 *sval++ = c; 2463 *sval++ = c;
2463 *sval = 0; 2464 *sval = 0;
2464 if (*s < end) 2465 if (*s < end)
@@ -3661,16 +3662,17 @@ xpm_scan (const unsigned char **s,
3661 while (*s < end) 3662 while (*s < end)
3662 { 3663 {
3663 /* Skip white-space. */ 3664 /* Skip white-space. */
3664 while (*s < end && (c = *(*s)++, isspace (c))) 3665 while (*s < end && (c = *(*s)++, c_isspace (c)))
3665 ; 3666 ;
3666 3667
3667 /* gnus-pointer.xpm uses '-' in its identifier. 3668 /* gnus-pointer.xpm uses '-' in its identifier.
3668 sb-dir-plus.xpm uses '+' in its identifier. */ 3669 sb-dir-plus.xpm uses '+' in its identifier. */
3669 if (isalpha (c) || c == '_' || c == '-' || c == '+') 3670 if (c_isalpha (c) || c == '_' || c == '-' || c == '+')
3670 { 3671 {
3671 *beg = *s - 1; 3672 *beg = *s - 1;
3672 while (*s < end 3673 while (*s < end
3673 && (c = **s, isalnum (c) || c == '_' || c == '-' || c == '+')) 3674 && (c = **s, c_isalnum (c)
3675 || c == '_' || c == '-' || c == '+'))
3674 ++*s; 3676 ++*s;
3675 *len = *s - *beg; 3677 *len = *s - *beg;
3676 return XPM_TK_IDENT; 3678 return XPM_TK_IDENT;
@@ -5014,7 +5016,7 @@ pbm_scan_number (unsigned char **s, unsigned char *end)
5014 while (*s < end) 5016 while (*s < end)
5015 { 5017 {
5016 /* Skip white-space. */ 5018 /* Skip white-space. */
5017 while (*s < end && (c = *(*s)++, isspace (c))) 5019 while (*s < end && (c = *(*s)++, c_isspace (c)))
5018 ; 5020 ;
5019 5021
5020 if (c == '#') 5022 if (c == '#')
@@ -5023,11 +5025,11 @@ pbm_scan_number (unsigned char **s, unsigned char *end)
5023 while (*s < end && (c = *(*s)++, c != '\n')) 5025 while (*s < end && (c = *(*s)++, c != '\n'))
5024 ; 5026 ;
5025 } 5027 }
5026 else if (isdigit (c)) 5028 else if (c_isdigit (c))
5027 { 5029 {
5028 /* Read decimal number. */ 5030 /* Read decimal number. */
5029 val = c - '0'; 5031 val = c - '0';
5030 while (*s < end && (c = *(*s)++, isdigit (c))) 5032 while (*s < end && (c = *(*s)++, c_isdigit (c)))
5031 val = 10 * val + c - '0'; 5033 val = 10 * val + c - '0';
5032 break; 5034 break;
5033 } 5035 }
@@ -8554,7 +8556,7 @@ gs_load (struct frame *f, struct image *img)
8554 don't either. Let the Lisp loader use `unwind-protect' instead. */ 8556 don't either. Let the Lisp loader use `unwind-protect' instead. */
8555 printnum1 = FRAME_X_WINDOW (f); 8557 printnum1 = FRAME_X_WINDOW (f);
8556 printnum2 = img->pixmap; 8558 printnum2 = img->pixmap;
8557 window_and_pixmap_id 8559 window_and_pixmap_id
8558 = make_formatted_string (buffer, "%"pMu" %"pMu, printnum1, printnum2); 8560 = make_formatted_string (buffer, "%"pMu" %"pMu, printnum1, printnum2);
8559 8561
8560 printnum1 = FRAME_FOREGROUND_PIXEL (f); 8562 printnum1 = FRAME_FOREGROUND_PIXEL (f);
diff --git a/src/intervals.c b/src/intervals.c
index 09949bbbd45..b0ef7c8d3b9 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -59,7 +59,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
59static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); 59static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object);
60static INTERVAL merge_interval_right (INTERVAL); 60static INTERVAL merge_interval_right (INTERVAL);
61static INTERVAL reproduce_tree (INTERVAL, INTERVAL); 61static INTERVAL reproduce_tree (INTERVAL, INTERVAL);
62static INTERVAL reproduce_tree_obj (INTERVAL, Lisp_Object);
63 62
64/* Utility functions for intervals. */ 63/* Utility functions for intervals. */
65 64
@@ -1498,6 +1497,26 @@ merge_interval_left (register INTERVAL i)
1498 abort (); 1497 abort ();
1499} 1498}
1500 1499
1500/* Create a copy of SOURCE but with the default value of UP. */
1501
1502static INTERVAL
1503reproduce_interval (INTERVAL source)
1504{
1505 register INTERVAL target = make_interval ();
1506
1507 target->total_length = source->total_length;
1508 target->position = source->position;
1509
1510 copy_properties (source, target);
1511
1512 if (! NULL_LEFT_CHILD (source))
1513 interval_set_left (target, reproduce_tree (source->left, target));
1514 if (! NULL_RIGHT_CHILD (source))
1515 interval_set_right (target, reproduce_tree (source->right, target));
1516
1517 return target;
1518}
1519
1501/* Make an exact copy of interval tree SOURCE which descends from 1520/* Make an exact copy of interval tree SOURCE which descends from
1502 PARENT. This is done by recursing through SOURCE, copying 1521 PARENT. This is done by recursing through SOURCE, copying
1503 the current interval and its properties, and then adjusting 1522 the current interval and its properties, and then adjusting
@@ -1506,33 +1525,19 @@ merge_interval_left (register INTERVAL i)
1506static INTERVAL 1525static INTERVAL
1507reproduce_tree (INTERVAL source, INTERVAL parent) 1526reproduce_tree (INTERVAL source, INTERVAL parent)
1508{ 1527{
1509 register INTERVAL t = make_interval (); 1528 register INTERVAL target = reproduce_interval (source);
1510
1511 memcpy (t, source, sizeof *t);
1512 copy_properties (source, t);
1513 interval_set_parent (t, parent);
1514 if (! NULL_LEFT_CHILD (source))
1515 interval_set_left (t, reproduce_tree (source->left, t));
1516 if (! NULL_RIGHT_CHILD (source))
1517 interval_set_right (t, reproduce_tree (source->right, t));
1518 1529
1519 return t; 1530 interval_set_parent (target, parent);
1531 return target;
1520} 1532}
1521 1533
1522static INTERVAL 1534static INTERVAL
1523reproduce_tree_obj (INTERVAL source, Lisp_Object parent) 1535reproduce_tree_obj (INTERVAL source, Lisp_Object parent)
1524{ 1536{
1525 register INTERVAL t = make_interval (); 1537 register INTERVAL target = reproduce_interval (source);
1526
1527 memcpy (t, source, sizeof *t);
1528 copy_properties (source, t);
1529 interval_set_object (t, parent);
1530 if (! NULL_LEFT_CHILD (source))
1531 interval_set_left (t, reproduce_tree (source->left, t));
1532 if (! NULL_RIGHT_CHILD (source))
1533 interval_set_right (t, reproduce_tree (source->right, t));
1534 1538
1535 return t; 1539 interval_set_object (target, parent);
1540 return target;
1536} 1541}
1537 1542
1538/* Insert the intervals of SOURCE into BUFFER at POSITION. 1543/* Insert the intervals of SOURCE into BUFFER at POSITION.
diff --git a/src/lisp.h b/src/lisp.h
index fb0e44520d6..8ac01211a1f 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2682,7 +2682,6 @@ _Noreturn void __executable_start (void);
2682#endif 2682#endif
2683extern Lisp_Object selected_frame; 2683extern Lisp_Object selected_frame;
2684extern Lisp_Object Vwindow_system; 2684extern Lisp_Object Vwindow_system;
2685void duration_to_sec_usec (double, int *, int *);
2686extern Lisp_Object sit_for (Lisp_Object, int, int); 2685extern Lisp_Object sit_for (Lisp_Object, int, int);
2687extern void init_display (void); 2686extern void init_display (void);
2688extern void syms_of_display (void); 2687extern void syms_of_display (void);
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 31dc94f7964..9c13f561a04 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -395,6 +395,8 @@ BLOCKINPUT_H = $(SRC)/blockinput.h \
395 $(ATIMER_H) 395 $(ATIMER_H)
396BUFFER_H = $(SRC)/buffer.h \ 396BUFFER_H = $(SRC)/buffer.h \
397 $(SYSTIME_H) 397 $(SYSTIME_H)
398C_CTYPE_H = $(GNU_LIB)/c-ctype.h \
399 $(NT_INC)/stdbool.h
398CAREADLINKAT_H = $(GNU_LIB)/careadlinkat.h \ 400CAREADLINKAT_H = $(GNU_LIB)/careadlinkat.h \
399 $(NT_INC)/unistd.h 401 $(NT_INC)/unistd.h
400CHARACTER_H = $(SRC)/character.h \ 402CHARACTER_H = $(SRC)/character.h \
@@ -441,7 +443,8 @@ LISP_H = $(SRC)/lisp.h \
441 $(SRC)/globals.h \ 443 $(SRC)/globals.h \
442 $(GNU_LIB)/intprops.h \ 444 $(GNU_LIB)/intprops.h \
443 $(INTTYPES_H) \ 445 $(INTTYPES_H) \
444 $(NT_INC)/stdalign.h 446 $(NT_INC)/stdalign.h \
447 $(NT_INC)/stdbool.h
445MD5_H = $(GNU_LIB)/md5.h \ 448MD5_H = $(GNU_LIB)/md5.h \
446 $(NT_INC)/stdint.h 449 $(NT_INC)/stdint.h
447MENU_H = $(SRC)/menu.h \ 450MENU_H = $(SRC)/menu.h \
@@ -626,6 +629,7 @@ $(BLD)/charset.$(O) : \
626 $(CHARSET_H) \ 629 $(CHARSET_H) \
627 $(CODING_H) \ 630 $(CODING_H) \
628 $(CONFIG_H) \ 631 $(CONFIG_H) \
632 $(C_CTYPE_H) \
629 $(LISP_H) 633 $(LISP_H)
630 634
631$(BLD)/chartab.$(O) : \ 635$(BLD)/chartab.$(O) : \
@@ -747,6 +751,7 @@ $(BLD)/doc.$(O) : \
747 $(BUFFER_H) \ 751 $(BUFFER_H) \
748 $(CHARACTER_H) \ 752 $(CHARACTER_H) \
749 $(CONFIG_H) \ 753 $(CONFIG_H) \
754 $(C_CTYPE_H) \
750 $(KEYBOARD_H) \ 755 $(KEYBOARD_H) \
751 $(LISP_H) 756 $(LISP_H)
752 757
@@ -820,6 +825,7 @@ $(BLD)/fileio.$(O) : \
820 $(CHARACTER_H) \ 825 $(CHARACTER_H) \
821 $(CODING_H) \ 826 $(CODING_H) \
822 $(CONFIG_H) \ 827 $(CONFIG_H) \
828 $(C_CTYPE_H) \
823 $(DISPEXTERN_H) \ 829 $(DISPEXTERN_H) \
824 $(FRAME_H) \ 830 $(FRAME_H) \
825 $(INTERVALS_H) \ 831 $(INTERVALS_H) \
@@ -881,6 +887,7 @@ $(BLD)/font.$(O) : \
881 $(CHARACTER_H) \ 887 $(CHARACTER_H) \
882 $(CHARSET_H) \ 888 $(CHARSET_H) \
883 $(CONFIG_H) \ 889 $(CONFIG_H) \
890 $(C_CTYPE_H) \
884 $(DISPEXTERN_H) \ 891 $(DISPEXTERN_H) \
885 $(FONT_H) \ 892 $(FONT_H) \
886 $(FRAME_H) \ 893 $(FRAME_H) \
@@ -916,6 +923,7 @@ $(BLD)/frame.$(O) : \
916 $(BUFFER_H) \ 923 $(BUFFER_H) \
917 $(CHARACTER_H) \ 924 $(CHARACTER_H) \
918 $(CONFIG_H) \ 925 $(CONFIG_H) \
926 $(C_CTYPE_H) \
919 $(DISPEXTERN_H) \ 927 $(DISPEXTERN_H) \
920 $(FONT_H) \ 928 $(FONT_H) \
921 $(FRAME_H) \ 929 $(FRAME_H) \
@@ -967,6 +975,7 @@ $(BLD)/image.$(O) : \
967 $(CHARACTER_H) \ 975 $(CHARACTER_H) \
968 $(CODING_H) \ 976 $(CODING_H) \
969 $(CONFIG_H) \ 977 $(CONFIG_H) \
978 $(C_CTYPE_H) \
970 $(DISPEXTERN_H) \ 979 $(DISPEXTERN_H) \
971 $(FONT_H) \ 980 $(FONT_H) \
972 $(FRAME_H) \ 981 $(FRAME_H) \
@@ -1354,6 +1363,7 @@ $(BLD)/sysdep.$(O) : \
1354 $(BLOCKINPUT_H) \ 1363 $(BLOCKINPUT_H) \
1355 $(CAREADLINKAT_H) \ 1364 $(CAREADLINKAT_H) \
1356 $(CONFIG_H) \ 1365 $(CONFIG_H) \
1366 $(C_CTYPE_H) \
1357 $(DISPEXTERN_H) \ 1367 $(DISPEXTERN_H) \
1358 $(FRAME_H) \ 1368 $(FRAME_H) \
1359 $(GRP_H) \ 1369 $(GRP_H) \
@@ -1499,6 +1509,7 @@ $(BLD)/xfaces.$(O) : \
1499 $(CHARACTER_H) \ 1509 $(CHARACTER_H) \
1500 $(CHARSET_H) \ 1510 $(CHARSET_H) \
1501 $(CONFIG_H) \ 1511 $(CONFIG_H) \
1512 $(C_CTYPE_H) \
1502 $(DISPEXTERN_H) \ 1513 $(DISPEXTERN_H) \
1503 $(FONT_H) \ 1514 $(FONT_H) \
1504 $(FRAME_H) \ 1515 $(FRAME_H) \
diff --git a/src/nsfont.m b/src/nsfont.m
index fdb6e0c33c1..1f8d28cd238 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -275,7 +275,7 @@ ns_ascii_average_width (NSFont *sfont)
275 for (ch = 0; ch < 95; ch++) 275 for (ch = 0; ch < 95; ch++)
276 chars[ch] = ' ' + ch; 276 chars[ch] = ' ' + ch;
277 277
278 ascii_printable = [NSString initWithFormat: @"%s", chars]; 278 ascii_printable = [[NSString alloc] initWithFormat: @"%s", chars];
279 } 279 }
280 280
281#ifdef NS_IMPL_COCOA 281#ifdef NS_IMPL_COCOA
diff --git a/src/nsimage.m b/src/nsimage.m
index 1479294948b..8a8a3ddaae4 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -302,7 +302,7 @@ static EmacsImage *ImageList = nil;
302 [bmRep release]; 302 [bmRep release];
303 return nil; 303 return nil;
304 } 304 }
305#define hexchar(x) (isdigit (x) ? x - '0' : x - 'a' + 10) 305#define hexchar(x) ('0' <= (x) && (x) <= '9' ? (x) - '0' : (x) - 'a' + 10)
306 s1 = *s++; 306 s1 = *s++;
307 s2 = *s++; 307 s2 = *s++;
308 c = hexchar (s1) * 0x10 + hexchar (s2); 308 c = hexchar (s1) * 0x10 + hexchar (s2);
@@ -501,4 +501,3 @@ static EmacsImage *ImageList = nil;
501} 501}
502 502
503@end 503@end
504
diff --git a/src/nsterm.m b/src/nsterm.m
index 76e6ee8fb40..a628a248c77 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -36,6 +36,8 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
36#include <signal.h> 36#include <signal.h>
37#include <unistd.h> 37#include <unistd.h>
38#include <setjmp.h> 38#include <setjmp.h>
39
40#include <c-ctype.h>
39#include <c-strcase.h> 41#include <c-strcase.h>
40#include <ftoastr.h> 42#include <ftoastr.h>
41 43
@@ -6785,20 +6787,20 @@ ns_xlfd_to_fontname (const char *xlfd)
6785 6787
6786 /* undo hack in ns_fontname_to_xlfd, converting '$' to '-', '_' to ' ' 6788 /* undo hack in ns_fontname_to_xlfd, converting '$' to '-', '_' to ' '
6787 also uppercase after '-' or ' ' */ 6789 also uppercase after '-' or ' ' */
6788 name[0] = toupper (name[0]); 6790 name[0] = c_toupper (name[0]);
6789 for (len =strlen (name), i =0; i<len; i++) 6791 for (len =strlen (name), i =0; i<len; i++)
6790 { 6792 {
6791 if (name[i] == '$') 6793 if (name[i] == '$')
6792 { 6794 {
6793 name[i] = '-'; 6795 name[i] = '-';
6794 if (i+1<len) 6796 if (i+1<len)
6795 name[i+1] = toupper (name[i+1]); 6797 name[i+1] = c_toupper (name[i+1]);
6796 } 6798 }
6797 else if (name[i] == '_') 6799 else if (name[i] == '_')
6798 { 6800 {
6799 name[i] = ' '; 6801 name[i] = ' ';
6800 if (i+1<len) 6802 if (i+1<len)
6801 name[i+1] = toupper (name[i+1]); 6803 name[i+1] = c_toupper (name[i+1]);
6802 } 6804 }
6803 } 6805 }
6804/*fprintf (stderr, "converted '%s' to '%s'\n",xlfd,name); */ 6806/*fprintf (stderr, "converted '%s' to '%s'\n",xlfd,name); */
diff --git a/src/syntax.c b/src/syntax.c
index 1cbad1ae0a4..69965d1d824 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22 22
23#include <ctype.h>
24#include <sys/types.h> 23#include <sys/types.h>
25#include <setjmp.h> 24#include <setjmp.h>
26#include "lisp.h" 25#include "lisp.h"
diff --git a/src/sysdep.c b/src/sysdep.c
index 01ca905a987..1dbe8938e46 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#define SYSTIME_INLINE EXTERN_INLINE 22#define SYSTIME_INLINE EXTERN_INLINE
23 23
24#include <ctype.h>
25#include <signal.h> 24#include <signal.h>
26#include <stdio.h> 25#include <stdio.h>
27#include <setjmp.h> 26#include <setjmp.h>
@@ -33,6 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
33#include <unistd.h> 32#include <unistd.h>
34 33
35#include <allocator.h> 34#include <allocator.h>
35#include <c-ctype.h>
36#include <careadlinkat.h> 36#include <careadlinkat.h>
37#include <ignore-value.h> 37#include <ignore-value.h>
38#include <utimens.h> 38#include <utimens.h>
@@ -2733,7 +2733,7 @@ system_process_attributes (Lisp_Object pid)
2733 if (emacs_read (fd, &ch, 1) != 1) 2733 if (emacs_read (fd, &ch, 1) != 1)
2734 break; 2734 break;
2735 c = ch; 2735 c = ch;
2736 if (isspace (c) || c == '\\') 2736 if (c_isspace (c) || c == '\\')
2737 cmdline_size++; /* for later quoting, see below */ 2737 cmdline_size++; /* for later quoting, see below */
2738 } 2738 }
2739 if (cmdline_size) 2739 if (cmdline_size)
@@ -2757,7 +2757,7 @@ system_process_attributes (Lisp_Object pid)
2757 for (p = cmdline; p < cmdline + nread; p++) 2757 for (p = cmdline; p < cmdline + nread; p++)
2758 { 2758 {
2759 /* Escape-quote whitespace and backslashes. */ 2759 /* Escape-quote whitespace and backslashes. */
2760 if (isspace (*p) || *p == '\\') 2760 if (c_isspace (*p) || *p == '\\')
2761 { 2761 {
2762 memmove (p + 1, p, nread - (p - cmdline)); 2762 memmove (p + 1, p, nread - (p - cmdline));
2763 nread++; 2763 nread++;
diff --git a/src/term.c b/src/term.c
index 514c7ad11ec..c5cec3062e3 100644
--- a/src/term.c
+++ b/src/term.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include <config.h> 22#include <config.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <ctype.h>
25#include <errno.h> 24#include <errno.h>
26#include <sys/file.h> 25#include <sys/file.h>
27#include <sys/time.h> 26#include <sys/time.h>
diff --git a/src/xfaces.c b/src/xfaces.c
index ed372c6b419..8c6542ee725 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -279,7 +279,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
279 279
280#endif /* HAVE_X_WINDOWS */ 280#endif /* HAVE_X_WINDOWS */
281 281
282#include <ctype.h> 282#include <c-ctype.h>
283 283
284/* Number of pt per inch (from the TeXbook). */ 284/* Number of pt per inch (from the TeXbook). */
285 285
@@ -2281,6 +2281,7 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to,
2281 struct named_merge_point *named_merge_points) 2281 struct named_merge_point *named_merge_points)
2282{ 2282{
2283 int i; 2283 int i;
2284 Lisp_Object font = Qnil;
2284 2285
2285 /* If FROM inherits from some other faces, merge their attributes into 2286 /* If FROM inherits from some other faces, merge their attributes into
2286 TO before merging FROM's direct attributes. Note that an :inherit 2287 TO before merging FROM's direct attributes. Note that an :inherit
@@ -2291,24 +2292,13 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to,
2291 && !NILP (from[LFACE_INHERIT_INDEX])) 2292 && !NILP (from[LFACE_INHERIT_INDEX]))
2292 merge_face_ref (f, from[LFACE_INHERIT_INDEX], to, 0, named_merge_points); 2293 merge_face_ref (f, from[LFACE_INHERIT_INDEX], to, 0, named_merge_points);
2293 2294
2294 i = LFACE_FONT_INDEX; 2295 if (FONT_SPEC_P (from[LFACE_FONT_INDEX]))
2295 if (!UNSPECIFIEDP (from[i]))
2296 { 2296 {
2297 if (!UNSPECIFIEDP (to[i])) 2297 if (!UNSPECIFIEDP (to[LFACE_FONT_INDEX]))
2298 to[i] = merge_font_spec (from[i], to[i]); 2298 font = merge_font_spec (from[LFACE_FONT_INDEX], to[LFACE_FONT_INDEX]);
2299 else 2299 else
2300 to[i] = copy_font_spec (from[i]); 2300 font = copy_font_spec (from[LFACE_FONT_INDEX]);
2301 if (! NILP (AREF (to[i], FONT_FOUNDRY_INDEX))) 2301 to[LFACE_FONT_INDEX] = font;
2302 to[LFACE_FOUNDRY_INDEX] = SYMBOL_NAME (AREF (to[i], FONT_FOUNDRY_INDEX));
2303 if (! NILP (AREF (to[i], FONT_FAMILY_INDEX)))
2304 to[LFACE_FAMILY_INDEX] = SYMBOL_NAME (AREF (to[i], FONT_FAMILY_INDEX));
2305 if (! NILP (AREF (to[i], FONT_WEIGHT_INDEX)))
2306 to[LFACE_WEIGHT_INDEX] = FONT_WEIGHT_FOR_FACE (to[i]);
2307 if (! NILP (AREF (to[i], FONT_SLANT_INDEX)))
2308 to[LFACE_SLANT_INDEX] = FONT_SLANT_FOR_FACE (to[i]);
2309 if (! NILP (AREF (to[i], FONT_WIDTH_INDEX)))
2310 to[LFACE_SWIDTH_INDEX] = FONT_WIDTH_FOR_FACE (to[i]);
2311 ASET (to[i], FONT_SIZE_INDEX, Qnil);
2312 } 2302 }
2313 2303
2314 for (i = 1; i < LFACE_VECTOR_SIZE; ++i) 2304 for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
@@ -2319,8 +2309,7 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to,
2319 to[i] = merge_face_heights (from[i], to[i], to[i]); 2309 to[i] = merge_face_heights (from[i], to[i], to[i]);
2320 font_clear_prop (to, FONT_SIZE_INDEX); 2310 font_clear_prop (to, FONT_SIZE_INDEX);
2321 } 2311 }
2322 else if (i != LFACE_FONT_INDEX 2312 else if (i != LFACE_FONT_INDEX && ! EQ (to[i], from[i]))
2323 && ! EQ (to[i], from[i]))
2324 { 2313 {
2325 to[i] = from[i]; 2314 to[i] = from[i];
2326 if (i >= LFACE_FAMILY_INDEX && i <=LFACE_SLANT_INDEX) 2315 if (i >= LFACE_FAMILY_INDEX && i <=LFACE_SLANT_INDEX)
@@ -2334,6 +2323,25 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to,
2334 } 2323 }
2335 } 2324 }
2336 2325
2326 /* If FROM specifies a font spec, make its contents take precedence
2327 over :family and other attributes. This is needed for face
2328 remapping using :font to work. */
2329
2330 if (!NILP (font))
2331 {
2332 if (! NILP (AREF (font, FONT_FOUNDRY_INDEX)))
2333 to[LFACE_FOUNDRY_INDEX] = SYMBOL_NAME (AREF (font, FONT_FOUNDRY_INDEX));
2334 if (! NILP (AREF (font, FONT_FAMILY_INDEX)))
2335 to[LFACE_FAMILY_INDEX] = SYMBOL_NAME (AREF (font, FONT_FAMILY_INDEX));
2336 if (! NILP (AREF (font, FONT_WEIGHT_INDEX)))
2337 to[LFACE_WEIGHT_INDEX] = FONT_WEIGHT_FOR_FACE (font);
2338 if (! NILP (AREF (font, FONT_SLANT_INDEX)))
2339 to[LFACE_SLANT_INDEX] = FONT_SLANT_FOR_FACE (font);
2340 if (! NILP (AREF (font, FONT_WIDTH_INDEX)))
2341 to[LFACE_SWIDTH_INDEX] = FONT_WIDTH_FOR_FACE (font);
2342 ASET (font, FONT_SIZE_INDEX, Qnil);
2343 }
2344
2337 /* TO is always an absolute face, which should inherit from nothing. 2345 /* TO is always an absolute face, which should inherit from nothing.
2338 We blindly copy the :inherit attribute above and fix it up here. */ 2346 We blindly copy the :inherit attribute above and fix it up here. */
2339 to[LFACE_INHERIT_INDEX] = Qnil; 2347 to[LFACE_INHERIT_INDEX] = Qnil;
@@ -2575,6 +2583,13 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to,
2575 else 2583 else
2576 err = 1; 2584 err = 1;
2577 } 2585 }
2586 else if (EQ (keyword, QCfont))
2587 {
2588 if (FONTP (value))
2589 to[LFACE_FONT_INDEX] = value;
2590 else
2591 err = 1;
2592 }
2578 else if (EQ (keyword, QCinherit)) 2593 else if (EQ (keyword, QCinherit))
2579 { 2594 {
2580 /* This is not really very useful; it's just like a 2595 /* This is not really very useful; it's just like a
@@ -4059,7 +4074,7 @@ hash_string_case_insensitive (Lisp_Object string)
4059 unsigned hash = 0; 4074 unsigned hash = 0;
4060 eassert (STRINGP (string)); 4075 eassert (STRINGP (string));
4061 for (s = SDATA (string); *s; ++s) 4076 for (s = SDATA (string); *s; ++s)
4062 hash = (hash << 1) ^ tolower (*s); 4077 hash = (hash << 1) ^ c_tolower (*s);
4063 return hash; 4078 return hash;
4064} 4079}
4065 4080
diff --git a/src/xfns.c b/src/xfns.c
index 2e7334b7d71..a9d22e7d3c6 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -49,7 +49,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
49 49
50#ifdef HAVE_X_WINDOWS 50#ifdef HAVE_X_WINDOWS
51 51
52#include <ctype.h>
53#include <sys/types.h> 52#include <sys/types.h>
54#include <sys/stat.h> 53#include <sys/stat.h>
55 54
diff --git a/src/xterm.c b/src/xterm.c
index 1b746f87d53..b1a73d07998 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -50,7 +50,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
50#include "systime.h" 50#include "systime.h"
51 51
52#include <fcntl.h> 52#include <fcntl.h>
53#include <ctype.h>
54#include <errno.h> 53#include <errno.h>
55#include <setjmp.h> 54#include <setjmp.h>
56#include <sys/stat.h> 55#include <sys/stat.h>