aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2011-08-07 14:24:24 +0200
committerJoakim Verona2011-08-07 14:24:24 +0200
commit1cab149286abf2ec366c764e13c5036a3c6f4204 (patch)
tree41af6e515047b06d8506dd65ac781014d64149f5
parent5cf126ad687c0174ab2d8de5f2acb2d1dfbefa27 (diff)
parent09ade3a37d5ecde376f264bbac1e2088eae72f53 (diff)
downloademacs-1cab149286abf2ec366c764e13c5036a3c6f4204.tar.gz
emacs-1cab149286abf2ec366c764e13c5036a3c6f4204.zip
mostly upstream
-rw-r--r--ChangeLog5
-rw-r--r--README.xwidget3
-rw-r--r--autogen/Makefile.in1
-rw-r--r--autogen/config.in6
-rwxr-xr-xautogen/configure131
-rw-r--r--configure.in30
-rw-r--r--doc/misc/ChangeLog4
-rw-r--r--doc/misc/trampver.texi2
-rw-r--r--lisp/ChangeLog32
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el2
-rw-r--r--lisp/emacs-lisp/cl-macs.el38
-rw-r--r--lisp/gnus/ChangeLog24
-rw-r--r--lisp/gnus/gnus-sum.el1
-rw-r--r--lisp/gnus/gnus.el2
-rw-r--r--lisp/gnus/mml1991.el94
-rw-r--r--lisp/gnus/nnir.el16
-rw-r--r--lisp/help-fns.el11
-rw-r--r--lisp/minibuffer.el15
-rw-r--r--lisp/net/tramp-sh.el6
-rw-r--r--lisp/net/trampver.el4
-rw-r--r--lisp/org/ob-awk.el2
-rw-r--r--lisp/org/ob-lilypond.el2
-rw-r--r--lisp/org/ob-maxima.el23
-rw-r--r--lisp/org/org-pcomplete.el3
-rw-r--r--lisp/org/org-special-blocks.el22
-rw-r--r--lisp/progmodes/js.el10
-rw-r--r--lisp/subr.el14
-rw-r--r--lisp/window.el20
-rw-r--r--lisp/xwidget.el19
-rw-r--r--src/ChangeLog182
-rw-r--r--src/Makefile.in5
-rw-r--r--src/alloc.c18
-rw-r--r--src/bidi.c94
-rw-r--r--src/callproc.c6
-rw-r--r--src/dispextern.h2
-rw-r--r--src/dispnew.c2
-rw-r--r--src/emacs.c4
-rw-r--r--src/fontset.c2
-rw-r--r--src/gmalloc.c2
-rw-r--r--src/gtkutil.c12
-rw-r--r--src/indent.c2
-rw-r--r--src/keyboard.c2
-rw-r--r--src/keymap.c12
-rw-r--r--src/regex.c4
-rw-r--r--src/syssignal.h2
-rw-r--r--src/window.c18
-rw-r--r--src/xdisp.c110
-rw-r--r--src/xterm.c38
-rw-r--r--src/xwidget.c1
49 files changed, 701 insertions, 359 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b5772f13b4..30f22850d40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12011-08-04 Jan Djärv <jan.h.d@swipnet.se>
2
3 * configure.in (HAVE_PTHREAD): Add check for -lpthread (Bug#9216).
4 (HAVE_GTK_AND_PTHREAD): Remove.
5
12011-07-28 Alp Aker <alp.tekin.aker@gmail.com> 62011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
2 7
3 * configure.in (HAVE_RSVG): Allow use of -lrsvg-2 for any NextStep 8 * configure.in (HAVE_RSVG): Allow use of -lrsvg-2 for any NextStep
diff --git a/README.xwidget b/README.xwidget
index f457b5cd10e..710c10ed7f3 100644
--- a/README.xwidget
+++ b/README.xwidget
@@ -897,6 +897,9 @@ Debugger entered--Lisp error: (error "Two bases given in one event")
897 897
898for some reason hapens sometimes with xwidget events. 898for some reason hapens sometimes with xwidget events.
899 899
900maybe I need to set the originating window?
901 event.frame_or_window = Qnil; //frame; //how to get the frame here? //TODO i store it in the xwidget now
902
900*** TODO console messages 903*** TODO console messages
901http://webkitgtk.org/reference/webkitgtk-webkitwebview.html#WebKitWebView-console-message 904http://webkitgtk.org/reference/webkitgtk-webkitwebview.html#WebKitWebView-console-message
902http://getfirebug.com/wiki/index.php/Console_API#console.count.28.5Btitle.5D.29 905http://getfirebug.com/wiki/index.php/Console_API#console.count.28.5Btitle.5D.29
diff --git a/autogen/Makefile.in b/autogen/Makefile.in
index 3348d3a4c02..5b28ad0808b 100644
--- a/autogen/Makefile.in
+++ b/autogen/Makefile.in
@@ -495,6 +495,7 @@ LIBXT_OTHER = @LIBXT_OTHER@
495LIBX_OTHER = @LIBX_OTHER@ 495LIBX_OTHER = @LIBX_OTHER@
496LIB_GCC = @LIB_GCC@ 496LIB_GCC = @LIB_GCC@
497LIB_MATH = @LIB_MATH@ 497LIB_MATH = @LIB_MATH@
498LIB_PTHREAD = @LIB_PTHREAD@
498LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@ 499LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
499LIB_STANDARD = @LIB_STANDARD@ 500LIB_STANDARD = @LIB_STANDARD@
500LTLIBINTL = @LTLIBINTL@ 501LTLIBINTL = @LTLIBINTL@
diff --git a/autogen/config.in b/autogen/config.in
index d4ec03b8343..ca44b80c91e 100644
--- a/autogen/config.in
+++ b/autogen/config.in
@@ -321,9 +321,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
321/* Define to 1 if you have the `gtk_adjustment_get_page_size' function. */ 321/* Define to 1 if you have the `gtk_adjustment_get_page_size' function. */
322#undef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE 322#undef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
323 323
324/* Define to 1 if you have GTK and pthread (-lpthread). */
325#undef HAVE_GTK_AND_PTHREAD
326
327/* Define to 1 if you have the `gtk_dialog_get_action_area' function. */ 324/* Define to 1 if you have the `gtk_dialog_get_action_area' function. */
328#undef HAVE_GTK_DIALOG_GET_ACTION_AREA 325#undef HAVE_GTK_DIALOG_GET_ACTION_AREA
329 326
@@ -582,6 +579,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
582/* Define to 1 if you have the `pstat_getdynamic' function. */ 579/* Define to 1 if you have the `pstat_getdynamic' function. */
583#undef HAVE_PSTAT_GETDYNAMIC 580#undef HAVE_PSTAT_GETDYNAMIC
584 581
582/* Define to 1 if you have pthread (-lpthread). */
583#undef HAVE_PTHREAD
584
585/* Define to 1 if you have the <pthread.h> header file. */ 585/* Define to 1 if you have the <pthread.h> header file. */
586#undef HAVE_PTHREAD_H 586#undef HAVE_PTHREAD_H
587 587
diff --git a/autogen/configure b/autogen/configure
index ca256457459..e0de2f2dc33 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -1115,6 +1115,7 @@ IMAGEMAGICK_LIBS
1115IMAGEMAGICK_CFLAGS 1115IMAGEMAGICK_CFLAGS
1116RSVG_LIBS 1116RSVG_LIBS
1117RSVG_CFLAGS 1117RSVG_CFLAGS
1118LIB_PTHREAD
1118VMLIMIT_OBJ 1119VMLIMIT_OBJ
1119GMALLOC_OBJ 1120GMALLOC_OBJ
1120HAVE_XSERVER 1121HAVE_XSERVER
@@ -9884,6 +9885,72 @@ if test "x$ac_cv_lib_Xbsd_main" = x""yes; then :
9884fi 9885fi
9885 9886
9886 9887
9888LIB_PTHREAD=
9889for ac_header in pthread.h
9890do :
9891 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
9892if test "x$ac_cv_header_pthread_h" = x""yes; then :
9893 cat >>confdefs.h <<_ACEOF
9894#define HAVE_PTHREAD_H 1
9895_ACEOF
9896
9897fi
9898
9899done
9900
9901if test "$ac_cv_header_pthread_h"; then
9902 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5
9903$as_echo_n "checking for pthread_self in -lpthread... " >&6; }
9904if test "${ac_cv_lib_pthread_pthread_self+set}" = set; then :
9905 $as_echo_n "(cached) " >&6
9906else
9907 ac_check_lib_save_LIBS=$LIBS
9908LIBS="-lpthread $LIBS"
9909cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9910/* end confdefs.h. */
9911
9912/* Override any GCC internal prototype to avoid an error.
9913 Use char because int might match the return type of a GCC
9914 builtin and then its argument prototype would still apply. */
9915#ifdef __cplusplus
9916extern "C"
9917#endif
9918char pthread_self ();
9919int
9920main ()
9921{
9922return pthread_self ();
9923 ;
9924 return 0;
9925}
9926_ACEOF
9927if ac_fn_c_try_link "$LINENO"; then :
9928 ac_cv_lib_pthread_pthread_self=yes
9929else
9930 ac_cv_lib_pthread_pthread_self=no
9931fi
9932rm -f core conftest.err conftest.$ac_objext \
9933 conftest$ac_exeext conftest.$ac_ext
9934LIBS=$ac_check_lib_save_LIBS
9935fi
9936{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_self" >&5
9937$as_echo "$ac_cv_lib_pthread_pthread_self" >&6; }
9938if test "x$ac_cv_lib_pthread_pthread_self" = x""yes; then :
9939 HAVE_PTHREAD=yes
9940fi
9941
9942fi
9943if test "$HAVE_PTHREAD" = yes; then
9944 case "${canonical}" in
9945 *-hpux*) ;;
9946 *) LIB_PTHREAD="-lpthread" ;;
9947 esac
9948
9949$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
9950
9951fi
9952
9953
9887{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cma_open in -lpthreads" >&5 9954{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cma_open in -lpthreads" >&5
9888$as_echo_n "checking for cma_open in -lpthreads... " >&6; } 9955$as_echo_n "checking for cma_open in -lpthreads... " >&6; }
9889if test "${ac_cv_lib_pthreads_cma_open+set}" = set; then : 9956if test "${ac_cv_lib_pthreads_cma_open+set}" = set; then :
@@ -10709,70 +10776,6 @@ done
10709 10776
10710 fi 10777 fi
10711 10778
10712 HAVE_GTK_AND_PTHREAD=no
10713 for ac_header in pthread.h
10714do :
10715 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
10716if test "x$ac_cv_header_pthread_h" = x""yes; then :
10717 cat >>confdefs.h <<_ACEOF
10718#define HAVE_PTHREAD_H 1
10719_ACEOF
10720
10721fi
10722
10723done
10724
10725 if test "$ac_cv_header_pthread_h"; then
10726 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5
10727$as_echo_n "checking for pthread_self in -lpthread... " >&6; }
10728if test "${ac_cv_lib_pthread_pthread_self+set}" = set; then :
10729 $as_echo_n "(cached) " >&6
10730else
10731 ac_check_lib_save_LIBS=$LIBS
10732LIBS="-lpthread $LIBS"
10733cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10734/* end confdefs.h. */
10735
10736/* Override any GCC internal prototype to avoid an error.
10737 Use char because int might match the return type of a GCC
10738 builtin and then its argument prototype would still apply. */
10739#ifdef __cplusplus
10740extern "C"
10741#endif
10742char pthread_self ();
10743int
10744main ()
10745{
10746return pthread_self ();
10747 ;
10748 return 0;
10749}
10750_ACEOF
10751if ac_fn_c_try_link "$LINENO"; then :
10752 ac_cv_lib_pthread_pthread_self=yes
10753else
10754 ac_cv_lib_pthread_pthread_self=no
10755fi
10756rm -f core conftest.err conftest.$ac_objext \
10757 conftest$ac_exeext conftest.$ac_ext
10758LIBS=$ac_check_lib_save_LIBS
10759fi
10760{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_self" >&5
10761$as_echo "$ac_cv_lib_pthread_pthread_self" >&6; }
10762if test "x$ac_cv_lib_pthread_pthread_self" = x""yes; then :
10763 HAVE_GTK_AND_PTHREAD=yes
10764fi
10765
10766 fi
10767 if test "$HAVE_GTK_AND_PTHREAD" = yes; then
10768 case "${canonical}" in
10769 *-hpux*) ;;
10770 *) GTK_LIBS="$GTK_LIBS -lpthread" ;;
10771 esac
10772
10773$as_echo "#define HAVE_GTK_AND_PTHREAD 1" >>confdefs.h
10774
10775 fi
10776 10779
10777 for ac_func in gtk_widget_get_window gtk_widget_set_has_window \ 10780 for ac_func in gtk_widget_get_window gtk_widget_set_has_window \
10778 gtk_dialog_get_action_area gtk_widget_get_sensitive \ 10781 gtk_dialog_get_action_area gtk_widget_get_sensitive \
diff --git a/configure.in b/configure.in
index 0d0c2c5ea25..b27537ce796 100644
--- a/configure.in
+++ b/configure.in
@@ -1689,6 +1689,21 @@ dnl AC_CHECK_LIB(resolv, gethostbyname)
1689dnl FIXME replace main with a function we actually want from this library. 1689dnl FIXME replace main with a function we actually want from this library.
1690AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd") 1690AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
1691 1691
1692dnl Check if pthreads is available.
1693LIB_PTHREAD=
1694AC_CHECK_HEADERS(pthread.h)
1695if test "$ac_cv_header_pthread_h"; then
1696 AC_CHECK_LIB(pthread, pthread_self, HAVE_PTHREAD=yes)
1697fi
1698if test "$HAVE_PTHREAD" = yes; then
1699 case "${canonical}" in
1700 *-hpux*) ;;
1701 *) LIB_PTHREAD="-lpthread" ;;
1702 esac
1703 AC_DEFINE(HAVE_PTHREAD, 1, [Define to 1 if you have pthread (-lpthread).])
1704fi
1705AC_SUBST([LIB_PTHREAD])
1706
1692AC_CHECK_LIB(pthreads, cma_open) 1707AC_CHECK_LIB(pthreads, cma_open)
1693 1708
1694## Note: when using cpp in s/aix4.2.h, this definition depended on 1709## Note: when using cpp in s/aix4.2.h, this definition depended on
@@ -1945,21 +1960,6 @@ if test "${HAVE_GTK}" = "yes"; then
1945 AC_CHECK_FUNCS(gtk_file_selection_new) 1960 AC_CHECK_FUNCS(gtk_file_selection_new)
1946 fi 1961 fi
1947 1962
1948 dnl Check if pthreads are available. Emacs only needs this when using
1949 dnl gtk_file_chooser under Gnome.
1950 HAVE_GTK_AND_PTHREAD=no
1951 AC_CHECK_HEADERS(pthread.h)
1952 if test "$ac_cv_header_pthread_h"; then
1953 AC_CHECK_LIB(pthread, pthread_self, HAVE_GTK_AND_PTHREAD=yes)
1954 fi
1955 if test "$HAVE_GTK_AND_PTHREAD" = yes; then
1956 case "${canonical}" in
1957 *-hpux*) ;;
1958 *) GTK_LIBS="$GTK_LIBS -lpthread" ;;
1959 esac
1960 AC_DEFINE(HAVE_GTK_AND_PTHREAD, 1,
1961 [Define to 1 if you have GTK and pthread (-lpthread).])
1962 fi
1963 1963
1964 dnl Check for functions introduced in 2.14 and later. 1964 dnl Check for functions introduced in 2.14 and later.
1965 AC_CHECK_FUNCS(gtk_widget_get_window gtk_widget_set_has_window \ 1965 AC_CHECK_FUNCS(gtk_widget_get_window gtk_widget_set_has_window \
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 967f457f3c4..b677c1aa4ee 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,7 @@
12011-08-03 Michael Albinus <michael.albinus@gmx.de>
2
3 * trampver.texi: Update release number.
4
12011-07-30 Michael Albinus <michael.albinus@gmx.de> 52011-07-30 Michael Albinus <michael.albinus@gmx.de>
2 6
3 Sync with Tramp 2.2.2. 7 Sync with Tramp 2.2.2.
diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi
index 043217a6c9e..31d3ac0204f 100644
--- a/doc/misc/trampver.texi
+++ b/doc/misc/trampver.texi
@@ -8,7 +8,7 @@
8@c In the Tramp CVS, the version number is auto-frobbed from 8@c In the Tramp CVS, the version number is auto-frobbed from
9@c configure.ac, so you should edit that file and run 9@c configure.ac, so you should edit that file and run
10@c "autoconf && ./configure" to change the version number. 10@c "autoconf && ./configure" to change the version number.
11@set trampver 2.2.2 11@set trampver 2.2.3-pre
12 12
13@c Other flags from configuration 13@c Other flags from configuration
14@set instprefix /usr/local 14@set instprefix /usr/local
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6a4d4b9cc9c..7c1fa3a656b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,35 @@
12011-08-05 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * progmodes/js.el (js--regexp-literal): Accept regexps at the beginning
4 of statements and in a few more cases (bug#9183).
5
6 * emacs-lisp/cl-macs.el (cl--make-usage-var, cl--make-usage-args):
7 New functions.
8 (cl-transform-lambda): Use them (bug#9239).
9
102011-08-05 Martin Rudalics <rudalics@gmx.at>
11
12 * window.el (display-buffer-same-window)
13 (display-buffer-same-frame, display-buffer-other-window)
14 (pop-to-buffer-same-window, pop-to-buffer-same-frame)
15 (pop-to-buffer-other-window)
16 (pop-to-buffer-same-frame-other-window)
17 (pop-to-buffer-other-frame): Make them defuns.
18 (switch-to-buffer): Don't set LABEL argument of pop-to-buffer.
19
202011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
21
22 * subr.el (make-composed-keymap): Move from C. Change calling
23 convention, and improve docstring to bring attention to a subtle point.
24 * minibuffer.el (completing-read-default): Adjust accordingly.
25
262011-08-03 Michael Albinus <michael.albinus@gmx.de>
27
28 * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell)
29 (tramp-open-shell): Use `tramp-shell-quote-argument'.
30
31 * net/trampver.el: Update release number.
32
12011-08-03 Stefan Monnier <monnier@iro.umontreal.ca> 332011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
2 34
3 * progmodes/sh-script.el (sh-font-lock-paren): Don't mistake "main" for 35 * progmodes/sh-script.el (sh-font-lock-paren): Don't mistake "main" for
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index 4b9985380c3..7beb4d4b4cc 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -282,7 +282,7 @@ Not documented
282;;;;;; flet progv psetq do-all-symbols do-symbols dotimes dolist 282;;;;;; flet progv psetq do-all-symbols do-symbols dotimes dolist
283;;;;;; do* do loop return-from return block etypecase typecase ecase 283;;;;;; do* do loop return-from return block etypecase typecase ecase
284;;;;;; case load-time-value eval-when destructuring-bind function* 284;;;;;; case load-time-value eval-when destructuring-bind function*
285;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "21df83d6106cb0c3d037e75ad79359dc") 285;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "0907093f7720996444ededb4edfe8072")
286;;; Generated autoloads from cl-macs.el 286;;; Generated autoloads from cl-macs.el
287 287
288(autoload 'gensym "cl-macs" "\ 288(autoload 'gensym "cl-macs" "\
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 6d242eda3ab..fb19115287c 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -238,6 +238,37 @@ It is a list of elements of the form either:
238 238
239(declare-function help-add-fundoc-usage "help-fns" (docstring arglist)) 239(declare-function help-add-fundoc-usage "help-fns" (docstring arglist))
240 240
241(defun cl--make-usage-var (x)
242 "X can be a var or a (destructuring) lambda-list."
243 (cond
244 ((symbolp x) (make-symbol (upcase (symbol-name x))))
245 ((consp x) (cl--make-usage-args x))
246 (t x)))
247
248(defun cl--make-usage-args (arglist)
249 ;; `orig-args' can contain &cl-defs (an internal
250 ;; CL thingy I don't understand), so remove it.
251 (let ((x (memq '&cl-defs arglist)))
252 (when x (setq arglist (delq (car x) (remq (cadr x) arglist)))))
253 (let ((state nil))
254 (mapcar (lambda (x)
255 (cond
256 ((symbolp x)
257 (if (eq ?\& (aref (symbol-name x) 0))
258 (setq state x)
259 (make-symbol (upcase (symbol-name x)))))
260 ((not (consp x)) x)
261 ((memq state '(nil &rest)) (cl--make-usage-args x))
262 (t ;(VAR INITFORM SVAR) or ((KEYWORD VAR) INITFORM SVAR).
263 (list*
264 (if (and (consp (car x)) (eq state '&key))
265 (list (caar x) (cl--make-usage-var (nth 1 (car x))))
266 (cl--make-usage-var (car x)))
267 (nth 1 x) ;INITFORM.
268 (cl--make-usage-args (nthcdr 2 x)) ;SVAR.
269 ))))
270 arglist)))
271
241(defun cl-transform-lambda (form bind-block) 272(defun cl-transform-lambda (form bind-block)
242 (let* ((args (car form)) (body (cdr form)) (orig-args args) 273 (let* ((args (car form)) (body (cdr form)) (orig-args args)
243 (bind-defs nil) (bind-enquote nil) 274 (bind-defs nil) (bind-enquote nil)
@@ -282,11 +313,8 @@ It is a list of elements of the form either:
282 (require 'help-fns) 313 (require 'help-fns)
283 (cons (help-add-fundoc-usage 314 (cons (help-add-fundoc-usage
284 (if (stringp (car hdr)) (pop hdr)) 315 (if (stringp (car hdr)) (pop hdr))
285 ;; orig-args can contain &cl-defs (an internal 316 (format "(fn %S)"
286 ;; CL thingy I don't understand), so remove it. 317 (cl--make-usage-args orig-args)))
287 (let ((x (memq '&cl-defs orig-args)))
288 (if (null x) orig-args
289 (delq (car x) (remq (cadr x) orig-args)))))
290 hdr))) 318 hdr)))
291 (list (nconc (list 'let* bind-lets) 319 (list (nconc (list 'let* bind-lets)
292 (nreverse bind-forms) body))))))) 320 (nreverse bind-forms) body)))))))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index e88b5154c76..e13d2d594ca 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,27 @@
12011-08-05 Andrew Cohen <cohen@andy.bu.edu>
2
3 * gnus-sum.el (gnus-summary-refer-article): Warp to article. This
4 allows article-referral to work from an nnir group.
5
62011-08-04 Andrew Cohen <cohen@andy.bu.edu>
7
8 * gnus.el (registry-ignore): Add nnir groups to the ignore-list.
9
102011-08-04 Daiki Ueno <ueno@unixuser.org>
11
12 * mml1991.el (mml1991-epg-find-usable-key)
13 (mml1991-epg-find-usable-secret-key): New function.
14 (mml1991-epg-sign): Check if signing key is usable.
15 (mml1991-epg-encrypt): Check if encrypting key is usable (bug#8955).
16
172011-08-03 Andrew Cohen <cohen@andy.bu.edu>
18
19 * nnir.el (nnir-read-server-parm): Add an argument to restrict to
20 server-variables only. This should fix a bug introduced with commit
21 e1889675b7f4adf057833c5513c9374134c4e053.
22 (nnir-run-query): 'nnir-search-engine should not be set from the global
23 environment.
24
12011-08-02 Andrew Cohen <cohen@andy.bu.edu> 252011-08-02 Andrew Cohen <cohen@andy.bu.edu>
2 26
3 * nnir.el (nnir-search-thread): Position point on referring article 27 * nnir.el (nnir-search-thread): Position point on referring article
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index a8cf5e7c427..dda9cb3fbf6 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -9037,6 +9037,7 @@ non-numeric or nil fetch the number specified by the
9037(defun gnus-summary-refer-article (message-id) 9037(defun gnus-summary-refer-article (message-id)
9038 "Fetch an article specified by MESSAGE-ID." 9038 "Fetch an article specified by MESSAGE-ID."
9039 (interactive "sMessage-ID: ") 9039 (interactive "sMessage-ID: ")
9040 (gnus-warp-to-article)
9040 (when (and (stringp message-id) 9041 (when (and (stringp message-id)
9041 (not (zerop (length message-id)))) 9042 (not (zerop (length message-id))))
9042 (setq message-id (gnus-replace-in-string message-id " " "")) 9043 (setq message-id (gnus-replace-in-string message-id " " ""))
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 7ff90f583cf..cd9b6eeb949 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1875,7 +1875,7 @@ total number of articles in the group.")
1875 :variable-default (mapcar 1875 :variable-default (mapcar
1876 (lambda (g) (list g t)) 1876 (lambda (g) (list g t))
1877 '("delayed$" "drafts$" "queue$" "INBOX$" 1877 '("delayed$" "drafts$" "queue$" "INBOX$"
1878 "^nnmairix:" "archive")) 1878 "^nnmairix:" "^nnir:" "archive"))
1879 :variable-document 1879 :variable-document
1880 "*Groups in which the registry should be turned off." 1880 "*Groups in which the registry should be turned off."
1881 :variable-group gnus-registry 1881 :variable-group gnus-registry
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index a5d778845c1..ad9f95796fe 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -247,6 +247,10 @@ Whether the passphrase is cached at all is controlled by
247(autoload 'epg-context-set-textmode "epg") 247(autoload 'epg-context-set-textmode "epg")
248(autoload 'epg-context-set-signers "epg") 248(autoload 'epg-context-set-signers "epg")
249(autoload 'epg-context-set-passphrase-callback "epg") 249(autoload 'epg-context-set-passphrase-callback "epg")
250(autoload 'epg-key-sub-key-list "epg")
251(autoload 'epg-sub-key-capability "epg")
252(autoload 'epg-sub-key-validity "epg")
253(autoload 'epg-sub-key-fingerprint "epg")
250(autoload 'epg-sign-string "epg") 254(autoload 'epg-sign-string "epg")
251(autoload 'epg-encrypt-string "epg") 255(autoload 'epg-encrypt-string "epg")
252(autoload 'epg-configuration "epg-config") 256(autoload 'epg-configuration "epg-config")
@@ -274,17 +278,59 @@ Whether the passphrase is cached at all is controlled by
274 (cons key-id mml1991-epg-secret-key-id-list)) 278 (cons key-id mml1991-epg-secret-key-id-list))
275 (copy-sequence passphrase))))) 279 (copy-sequence passphrase)))))
276 280
281(defun mml1991-epg-find-usable-key (keys usage)
282 (catch 'found
283 (while keys
284 (let ((pointer (epg-key-sub-key-list (car keys))))
285 (while pointer
286 (if (and (memq usage (epg-sub-key-capability (car pointer)))
287 (not (memq 'disabled (epg-sub-key-capability (car pointer))))
288 (not (memq (epg-sub-key-validity (car pointer))
289 '(revoked expired))))
290 (throw 'found (car keys)))
291 (setq pointer (cdr pointer))))
292 (setq keys (cdr keys)))))
293
294;; XXX: since gpg --list-secret-keys does not return validity of each
295;; key, `mml1991-epg-find-usable-key' defined above is not enough for
296;; secret keys. The function `mml1991-epg-find-usable-secret-key'
297;; below looks at appropriate public keys to check usability.
298(defun mml1991-epg-find-usable-secret-key (context name usage)
299 (let ((secret-keys (epg-list-keys context name t))
300 secret-key)
301 (while (and (not secret-key) secret-keys)
302 (if (mml1991-epg-find-usable-key
303 (epg-list-keys context (epg-sub-key-fingerprint
304 (car (epg-key-sub-key-list
305 (car secret-keys)))))
306 usage)
307 (setq secret-key (car secret-keys)
308 secret-keys nil)
309 (setq secret-keys (cdr secret-keys))))
310 secret-key))
311
277(defun mml1991-epg-sign (cont) 312(defun mml1991-epg-sign (cont)
278 (let ((context (epg-make-context)) 313 (let ((context (epg-make-context))
279 headers cte signers signature) 314 headers cte signer-key signers signature)
280 (if (eq mm-sign-option 'guided) 315 (if (eq mm-sign-option 'guided)
281 (setq signers (epa-select-keys context "Select keys for signing. 316 (setq signers (epa-select-keys context "Select keys for signing.
282If no one is selected, default secret key is used. " 317If no one is selected, default secret key is used. "
283 mml1991-signers t)) 318 mml1991-signers t))
284 (if mml1991-signers 319 (if mml1991-signers
285 (setq signers (mapcar (lambda (name) 320 (setq signers (delq nil
286 (car (epg-list-keys context name t))) 321 (mapcar
287 mml1991-signers)))) 322 (lambda (name)
323 (setq signer-key
324 (mml1991-epg-find-usable-secret-key
325 context name 'sign))
326 (unless (or signer-key
327 (y-or-n-p
328 (format
329 "No secret key for %s; skip it? "
330 name)))
331 (error "No secret key for %s" name))
332 signer-key)
333 mml1991-signers)))))
288 (epg-context-set-armor context t) 334 (epg-context-set-armor context t)
289 (epg-context-set-textmode context t) 335 (epg-context-set-textmode context t)
290 (epg-context-set-signers context signers) 336 (epg-context-set-signers context signers)
@@ -344,7 +390,11 @@ If no one is selected, default secret key is used. "
344 (split-string 390 (split-string
345 (message-options-get 'message-recipients) 391 (message-options-get 'message-recipients)
346 "[ \f\t\n\r\v,]+"))) 392 "[ \f\t\n\r\v,]+")))
347 cipher signers config) 393 recipient-key signer-key cipher signers config)
394 (when mml1991-encrypt-to-self
395 (unless mml1991-signers
396 (error "mml1991-signers is not set"))
397 (setq recipients (nconc recipients mml1991-signers)))
348 ;; We should remove this check if epg-0.0.6 is released. 398 ;; We should remove this check if epg-0.0.6 is released.
349 (if (and (condition-case nil 399 (if (and (condition-case nil
350 (require 'epg-config) 400 (require 'epg-config)
@@ -363,26 +413,32 @@ If no one is selected, default secret key is used. "
363If no one is selected, symmetric encryption will be performed. " 413If no one is selected, symmetric encryption will be performed. "
364 recipients)) 414 recipients))
365 (setq recipients 415 (setq recipients
366 (delq nil (mapcar (lambda (name) 416 (delq nil (mapcar
367 (car (epg-list-keys context name))) 417 (lambda (name)
368 recipients)))) 418 (setq recipient-key (mml1991-epg-find-usable-key
369 (if mml1991-encrypt-to-self 419 (epg-list-keys context name)
370 (if mml1991-signers 420 'encrypt))
371 (setq recipients 421 (unless (or recipient-key
372 (nconc recipients 422 (y-or-n-p
373 (mapcar (lambda (name) 423 (format "No public key for %s; skip it? "
374 (car (epg-list-keys context name))) 424 name)))
375 mml1991-signers))) 425 (error "No public key for %s" name))
376 (error "mml1991-signers not set"))) 426 recipient-key)
427 recipients)))
428 (unless recipients
429 (error "No recipient specified")))
377 (when sign 430 (when sign
378 (if (eq mm-sign-option 'guided) 431 (if (eq mm-sign-option 'guided)
379 (setq signers (epa-select-keys context "Select keys for signing. 432 (setq signers (epa-select-keys context "Select keys for signing.
380If no one is selected, default secret key is used. " 433If no one is selected, default secret key is used. "
381 mml1991-signers t)) 434 mml1991-signers t))
382 (if mml1991-signers 435 (if mml1991-signers
383 (setq signers (mapcar (lambda (name) 436 (setq signers (delq nil
384 (car (epg-list-keys context name t))) 437 (mapcar
385 mml1991-signers)))) 438 (lambda (name)
439 (mml1991-epg-find-usable-secret-key
440 context name 'sign))
441 mml1991-signers)))))
386 (epg-context-set-signers context signers)) 442 (epg-context-set-signers context signers))
387 (epg-context-set-armor context t) 443 (epg-context-set-armor context t)
388 (epg-context-set-textmode context t) 444 (epg-context-set-textmode context t)
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index d35e6560e71..17fc3f3fe81 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -1624,7 +1624,7 @@ actually)."
1624 (let* ((server (car x)) 1624 (let* ((server (car x))
1625 (nnir-search-engine 1625 (nnir-search-engine
1626 (or (nnir-read-server-parm 'nnir-search-engine 1626 (or (nnir-read-server-parm 'nnir-search-engine
1627 server) 1627 server t)
1628 (cdr (assoc (car 1628 (cdr (assoc (car
1629 (gnus-server-to-method server)) 1629 (gnus-server-to-method server))
1630 nnir-method-default-engines)))) 1630 nnir-method-default-engines))))
@@ -1643,14 +1643,16 @@ actually)."
1643 nil))) 1643 nil)))
1644 groups)))) 1644 groups))))
1645 1645
1646(defun nnir-read-server-parm (key server) 1646(defun nnir-read-server-parm (key server &optional not-global)
1647 "Returns the parameter value of key for the given server, where 1647 "Returns the parameter value corresponding to `key' for
1648server is of form 'backend:name'." 1648`server'. If no server-specific value is found consult the global
1649environment unless `not-global' is non-nil."
1649 (let ((method (gnus-server-to-method server))) 1650 (let ((method (gnus-server-to-method server)))
1650 (cond ((and method (assq key (cddr method))) 1651 (cond ((and method (assq key (cddr method)))
1651 (nth 1 (assq key (cddr method)))) 1652 (nth 1 (assq key (cddr method))))
1652 ((boundp key) (symbol-value key)) 1653 ((and (not not-global) (boundp key)) (symbol-value key))
1653 (t nil)))) 1654 (t nil))))
1655
1654 1656
1655(defun nnir-possibly-change-server (server) 1657(defun nnir-possibly-change-server (server)
1656 (unless (and server (nnir-server-opened server)) 1658 (unless (and server (nnir-server-opened server))
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index b13e6a77d5d..5e034b14fde 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -65,7 +65,9 @@
65 65
66(defun help-split-fundoc (docstring def) 66(defun help-split-fundoc (docstring def)
67 "Split a function DOCSTRING into the actual doc and the usage info. 67 "Split a function DOCSTRING into the actual doc and the usage info.
68Return (USAGE . DOC) or nil if there's no usage info. 68Return (USAGE . DOC) or nil if there's no usage info, where USAGE info
69is a string describing the argument list of DEF, such as
70\"(apply FUNCTION &rest ARGUMENTS)\".
69DEF is the function whose usage we're looking for in DOCSTRING." 71DEF is the function whose usage we're looking for in DOCSTRING."
70 ;; Functions can get the calling sequence at the end of the doc string. 72 ;; Functions can get the calling sequence at the end of the doc string.
71 ;; In cases where `function' has been fset to a subr we can't search for 73 ;; In cases where `function' has been fset to a subr we can't search for
@@ -156,12 +158,7 @@ the same names as used in the original source code, when possible."
156(defun help-make-usage (function arglist) 158(defun help-make-usage (function arglist)
157 (cons (if (symbolp function) function 'anonymous) 159 (cons (if (symbolp function) function 'anonymous)
158 (mapcar (lambda (arg) 160 (mapcar (lambda (arg)
159 (if (not (symbolp arg)) 161 (if (not (symbolp arg)) arg
160 (if (and (consp arg) (symbolp (car arg)))
161 ;; CL style default values for optional args.
162 (cons (intern (upcase (symbol-name (car arg))))
163 (cdr arg))
164 arg)
165 (let ((name (symbol-name arg))) 162 (let ((name (symbol-name arg)))
166 (cond 163 (cond
167 ((string-match "\\`&" name) arg) 164 ((string-match "\\`&" name) arg)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index d62b377954d..0a2774de572 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2754,15 +2754,12 @@ See `completing-read' for the meaning of the arguments."
2754 base-keymap 2754 base-keymap
2755 ;; Layer minibuffer-local-filename-completion-map 2755 ;; Layer minibuffer-local-filename-completion-map
2756 ;; on top of the base map. 2756 ;; on top of the base map.
2757 ;; Use make-composed-keymap so that set-keymap-parent 2757 (make-composed-keymap
2758 ;; doesn't modify minibuffer-local-filename-completion-map. 2758 minibuffer-local-filename-completion-map
2759 (let ((map (make-composed-keymap 2759 ;; Set base-keymap as the parent, so that nil bindings
2760 minibuffer-local-filename-completion-map))) 2760 ;; in minibuffer-local-filename-completion-map can
2761 ;; Set base-keymap as the parent, so that nil bindings 2761 ;; override bindings in base-keymap.
2762 ;; in minibuffer-local-filename-completion-map can 2762 base-keymap)))
2763 ;; override bindings in base-keymap.
2764 (set-keymap-parent map base-keymap)
2765 map)))
2766 (result (read-from-minibuffer prompt initial-input keymap 2763 (result (read-from-minibuffer prompt initial-input keymap
2767 nil hist def inherit-input-method))) 2764 nil hist def inherit-input-method)))
2768 (when (and (equal result "") def) 2765 (when (and (equal result "") def)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 5c497748943..428bd6422d8 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3640,11 +3640,11 @@ file exists and nonzero exit status otherwise."
3640 (when extra-args (setq shell (concat shell " " extra-args))) 3640 (when extra-args (setq shell (concat shell " " extra-args)))
3641 (tramp-send-command 3641 (tramp-send-command
3642 vec (format "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s" 3642 vec (format "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s"
3643 (shell-quote-argument tramp-end-of-output) shell) 3643 (tramp-shell-quote-argument tramp-end-of-output) shell)
3644 t)) 3644 t))
3645 ;; Setting prompts. 3645 ;; Setting prompts.
3646 (tramp-send-command 3646 (tramp-send-command
3647 vec (format "PS1=%s" (shell-quote-argument tramp-end-of-output)) t) 3647 vec (format "PS1=%s" (tramp-shell-quote-argument tramp-end-of-output)) t)
3648 (tramp-send-command vec "PS2=''" t) 3648 (tramp-send-command vec "PS2=''" t)
3649 (tramp-send-command vec "PS3=''" t) 3649 (tramp-send-command vec "PS3=''" t)
3650 (tramp-send-command vec "PROMPT_COMMAND=''" t))) 3650 (tramp-send-command vec "PROMPT_COMMAND=''" t)))
@@ -3736,7 +3736,7 @@ process to set up. VEC specifies the connection."
3736 3736
3737 (tramp-message vec 5 "Setting shell prompt") 3737 (tramp-message vec 5 "Setting shell prompt")
3738 (tramp-send-command 3738 (tramp-send-command
3739 vec (format "PS1=%s" (shell-quote-argument tramp-end-of-output)) t) 3739 vec (format "PS1=%s" (tramp-shell-quote-argument tramp-end-of-output)) t)
3740 (tramp-send-command vec "PS2=''" t) 3740 (tramp-send-command vec "PS2=''" t)
3741 (tramp-send-command vec "PS3=''" t) 3741 (tramp-send-command vec "PS3=''" t)
3742 (tramp-send-command vec "PROMPT_COMMAND=''" t) 3742 (tramp-send-command vec "PROMPT_COMMAND=''" t)
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index da51662b216..5492441ac77 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -31,7 +31,7 @@
31;; should be changed only there. 31;; should be changed only there.
32 32
33;;;###tramp-autoload 33;;;###tramp-autoload
34(defconst tramp-version "2.2.2" 34(defconst tramp-version "2.2.3-pre"
35 "This version of Tramp.") 35 "This version of Tramp.")
36 36
37;;;###tramp-autoload 37;;;###tramp-autoload
@@ -44,7 +44,7 @@
44 (= emacs-major-version 21) 44 (= emacs-major-version 21)
45 (>= emacs-minor-version 4))) 45 (>= emacs-minor-version 4)))
46 "ok" 46 "ok"
47 (format "Tramp 2.2.2 is not fit for %s" 47 (format "Tramp 2.2.3-pre is not fit for %s"
48 (when (string-match "^.*$" (emacs-version)) 48 (when (string-match "^.*$" (emacs-version))
49 (match-string 0 (emacs-version))))))) 49 (match-string 0 (emacs-version)))))))
50 (unless (string-match "\\`ok\\'" x) (error "%s" x))) 50 (unless (string-match "\\`ok\\'" x) (error "%s" x)))
diff --git a/lisp/org/ob-awk.el b/lisp/org/ob-awk.el
index 368957c2f9b..fe84b906d79 100644
--- a/lisp/org/ob-awk.el
+++ b/lisp/org/ob-awk.el
@@ -24,8 +24,6 @@
24 24
25;;; Commentary: 25;;; Commentary:
26 26
27;;; Commentary:
28
29;; Babel's awk can use special header argument: 27;; Babel's awk can use special header argument:
30;; 28;;
31;; - :in-file takes a path to a file of data to be processed by awk 29;; - :in-file takes a path to a file of data to be processed by awk
diff --git a/lisp/org/ob-lilypond.el b/lisp/org/ob-lilypond.el
index 23f5d511d34..557a898ff1a 100644
--- a/lisp/org/ob-lilypond.el
+++ b/lisp/org/ob-lilypond.el
@@ -1,6 +1,6 @@
1;;; ob-lilypond.el --- org-babel functions for lilypond evaluation 1;;; ob-lilypond.el --- org-babel functions for lilypond evaluation
2 2
3;; Copyright (C) 2010 Free Software Foundation, Inc. 3;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
4 4
5;; Author: Martyn Jago 5;; Author: Martyn Jago
6;; Keywords: babel language, literate programming 6;; Keywords: babel language, literate programming
diff --git a/lisp/org/ob-maxima.el b/lisp/org/ob-maxima.el
index 7534065f1f7..9e42017168d 100644
--- a/lisp/org/ob-maxima.el
+++ b/lisp/org/ob-maxima.el
@@ -1,28 +1,27 @@
1;;; ob-maxima.el --- org-babel functions for maxima evaluation 1;;; ob-maxima.el --- org-babel functions for maxima evaluation
2 2
3;; Copyright (c) 2009, 2010, 2011 Eric S Fraga, Eric Schulte 3;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
4 4
5;; Author: Eric S Fraga, Eric Schulte 5;; Author: Eric S Fraga
6;; Eric Schulte
6;; Keywords: literate programming, reproducible research, maxima 7;; Keywords: literate programming, reproducible research, maxima
7;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
8;; Version: 7.7 9;; Version: 7.7
9 10
10;;; License: 11;; This file is part of GNU Emacs.
11 12
12;; This program is free software; you can redistribute it and/or modify 13;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by 14;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation; either version 3, or (at your option) 15;; the Free Software Foundation, either version 3 of the License, or
15;; any later version. 16;; (at your option) any later version.
16;; 17
17;; This program is distributed in the hope that it will be useful, 18;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details. 21;; GNU General Public License for more details.
21;; 22
22;; You should have received a copy of the GNU General Public License 23;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs; see the file COPYING. If not, write to the 24;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25;; Boston, MA 02110-1301, USA.
26 25
27;;; Commentary: 26;;; Commentary:
28 27
diff --git a/lisp/org/org-pcomplete.el b/lisp/org/org-pcomplete.el
index e34ab38e4e5..9b3e49b5101 100644
--- a/lisp/org/org-pcomplete.el
+++ b/lisp/org/org-pcomplete.el
@@ -1,7 +1,6 @@
1;;; org-pcomplete.el --- In-buffer completion code 1;;; org-pcomplete.el --- In-buffer completion code
2 2
3;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 3;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
4;; Free Software Foundation, Inc.
5;; 4;;
6;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; John Wiegley <johnw at gnu dot org> 6;; John Wiegley <johnw at gnu dot org>
diff --git a/lisp/org/org-special-blocks.el b/lisp/org/org-special-blocks.el
index 4f4d5e8e561..c09b27de895 100644
--- a/lisp/org/org-special-blocks.el
+++ b/lisp/org/org-special-blocks.el
@@ -1,25 +1,23 @@
1;;; org-special-blocks.el --- Turn blocks into LaTeX envs and HTML divs 1;;; org-special-blocks.el --- Turn blocks into LaTeX envs and HTML divs
2 2
3;; Copyright (C) 2009 Chris Gray 3;; Copyright (C) 2009, 2011 Free Software Foundation, Inc.
4 4
5;; Author: Chris Gray <chrismgray@gmail.com> 5;; Author: Chris Gray <chrismgray@gmail.com>
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
9;; This program is free software; you can redistribute it and/or 9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; modify it under the terms of the GNU General Public License as 10;; it under the terms of the GNU General Public License as published by
11;; published by the Free Software Foundation; either version 2, or (at 11;; the Free Software Foundation, either version 3 of the License, or
12;; your option) any later version. 12;; (at your option) any later version.
13 13
14;; This program is distributed in the hope that it will be useful, but 14;; GNU Emacs is distributed in the hope that it will be useful,
15;; WITHOUT ANY WARRANTY; without even the implied warranty of 15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; General Public License for more details. 17;; GNU General Public License for more details.
18 18
19;; You should have received a copy of the GNU General Public License 19;; You should have received a copy of the GNU General Public License
20;; along with this program ; see the file COPYING. If not, write to 20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22;; Boston, MA 02111-1307, USA.
23 21
24;;; Commentary: 22;;; Commentary:
25;; 23;;
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 1bdcb4cfa89..4abbe3b895f 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1658,15 +1658,19 @@ This performs fontification according to `js--class-styles'."
1658;; below. 1658;; below.
1659(eval-and-compile 1659(eval-and-compile
1660 (defconst js--regexp-literal 1660 (defconst js--regexp-literal
1661 "[=(,:]\\(?:\\s-\\|\n\\)*\\(/\\)\\(?:\\\\.\\|[^/*\\]\\)\\(?:\\\\.\\|[^/\\]\\)*\\(/\\)" 1661 (concat
1662 ;; We want to match regular expressions only at the beginning of
1663 ;; expressions.
1664 ;; FIXME: Should we also allow /regexp/ after infix operators such as +,
1665 ;; /, -, *, >, ...?
1666 "\\(?:\\`\\|[=([{,:;]\\)\\(?:\\s-\\|\n\\)*"
1667 "\\(/\\)\\(?:\\\\.\\|[^/*\\]\\)\\(?:\\\\.\\|[^/\\]\\)*\\(/\\)")
1662 "Regexp matching a JavaScript regular expression literal. 1668 "Regexp matching a JavaScript regular expression literal.
1663Match groups 1 and 2 are the characters forming the beginning and 1669Match groups 1 and 2 are the characters forming the beginning and
1664end of the literal.")) 1670end of the literal."))
1665 1671
1666(defconst js-syntax-propertize-function 1672(defconst js-syntax-propertize-function
1667 (syntax-propertize-rules 1673 (syntax-propertize-rules
1668 ;; We want to match regular expressions only at the beginning of
1669 ;; expressions.
1670 (js--regexp-literal (1 "\"") (2 "\"")))) 1674 (js--regexp-literal (1 "\"") (2 "\""))))
1671 1675
1672;;; Indentation 1676;;; Indentation
diff --git a/lisp/subr.el b/lisp/subr.el
index ef19797012a..d57c507a548 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -526,6 +526,20 @@ but optional second arg NODIGITS non-nil treats them like other chars."
526 (define-key map (char-to-string loop) 'digit-argument) 526 (define-key map (char-to-string loop) 'digit-argument)
527 (setq loop (1+ loop)))))) 527 (setq loop (1+ loop))))))
528 528
529(defun make-composed-keymap (maps &optional parent)
530 "Construct a new keymap composed of MAPS and inheriting from PARENT.
531When looking up a key in the returned map, the key is looked in each
532keymap of MAPS in turn until a binding is found.
533If no binding is found in MAPS, the lookup continues in PARENT, if non-nil.
534As always with keymap inheritance, a nil binding in MAPS overrides
535any corresponding binding in PARENT, but it does not override corresponding
536bindings in other keymaps of MAPS.
537MAPS can be a list of keymaps or a single keymap.
538PARENT if non-nil should be a keymap."
539 `(keymap
540 ,@(if (keymapp maps) (list maps) maps)
541 ,@parent))
542
529(defun define-key-after (keymap key definition &optional after) 543(defun define-key-after (keymap key definition &optional after)
530 "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding. 544 "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding.
531This is like `define-key' except that the binding for KEY is placed 545This is like `define-key' except that the binding for KEY is placed
diff --git a/lisp/window.el b/lisp/window.el
index 215dbab7849..7e666af6abf 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5796,7 +5796,7 @@ this list as arguments."
5796 ;; regardless of graphic-only restrictions. 5796 ;; regardless of graphic-only restrictions.
5797 (display-buffer-pop-up-frame buffer))))) 5797 (display-buffer-pop-up-frame buffer)))))
5798 5798
5799(defsubst display-buffer-same-window (&optional buffer-or-name label) 5799(defun display-buffer-same-window (&optional buffer-or-name label)
5800 "Display buffer specified by BUFFER-OR-NAME in the selected window. 5800 "Display buffer specified by BUFFER-OR-NAME in the selected window.
5801Another window will be used only if the buffer can't be shown in 5801Another window will be used only if the buffer can't be shown in
5802the selected window, usually because it is dedicated to another 5802the selected window, usually because it is dedicated to another
@@ -5805,7 +5805,7 @@ buffer. Optional argument BUFFER-OR-NAME and LABEL are as for
5805 (interactive "BDisplay buffer in same window:\nP") 5805 (interactive "BDisplay buffer in same window:\nP")
5806 (display-buffer buffer-or-name 'same-window label)) 5806 (display-buffer buffer-or-name 'same-window label))
5807 5807
5808(defsubst display-buffer-same-frame (&optional buffer-or-name label) 5808(defun display-buffer-same-frame (&optional buffer-or-name label)
5809 "Display buffer specified by BUFFER-OR-NAME in a window on the same frame. 5809 "Display buffer specified by BUFFER-OR-NAME in a window on the same frame.
5810Another frame will be used only if there is no other choice. 5810Another frame will be used only if there is no other choice.
5811Optional argument BUFFER-OR-NAME and LABEL are as for 5811Optional argument BUFFER-OR-NAME and LABEL are as for
@@ -5813,7 +5813,7 @@ Optional argument BUFFER-OR-NAME and LABEL are as for
5813 (interactive "BDisplay buffer on same frame:\nP") 5813 (interactive "BDisplay buffer on same frame:\nP")
5814 (display-buffer buffer-or-name 'same-frame label)) 5814 (display-buffer buffer-or-name 'same-frame label))
5815 5815
5816(defsubst display-buffer-other-window (&optional buffer-or-name label) 5816(defun display-buffer-other-window (&optional buffer-or-name label)
5817 "Display buffer specified by BUFFER-OR-NAME in another window. 5817 "Display buffer specified by BUFFER-OR-NAME in another window.
5818The selected window will be used only if there is no other 5818The selected window will be used only if there is no other
5819choice. Windows on the selected frame are preferred to windows 5819choice. Windows on the selected frame are preferred to windows
@@ -5887,7 +5887,7 @@ additional information."
5887 (select-frame-set-input-focus new-frame norecord)) 5887 (select-frame-set-input-focus new-frame norecord))
5888 buffer)) 5888 buffer))
5889 5889
5890(defsubst pop-to-buffer-same-window (&optional buffer-or-name norecord label) 5890(defun pop-to-buffer-same-window (&optional buffer-or-name norecord label)
5891 "Pop to buffer specified by BUFFER-OR-NAME in the selected window. 5891 "Pop to buffer specified by BUFFER-OR-NAME in the selected window.
5892Another window will be used only if the buffer can't be shown in 5892Another window will be used only if the buffer can't be shown in
5893the selected window, usually because it is dedicated to another 5893the selected window, usually because it is dedicated to another
@@ -5896,7 +5896,7 @@ as for `pop-to-buffer'."
5896 (interactive "BPop to buffer in selected window:\nP") 5896 (interactive "BPop to buffer in selected window:\nP")
5897 (pop-to-buffer buffer-or-name 'same-window norecord label)) 5897 (pop-to-buffer buffer-or-name 'same-window norecord label))
5898 5898
5899(defsubst pop-to-buffer-same-frame (&optional buffer-or-name norecord label) 5899(defun pop-to-buffer-same-frame (&optional buffer-or-name norecord label)
5900 "Pop to buffer specified by BUFFER-OR-NAME in a window on the selected frame. 5900 "Pop to buffer specified by BUFFER-OR-NAME in a window on the selected frame.
5901Another frame will be used only if there is no other choice. 5901Another frame will be used only if there is no other choice.
5902Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are as for 5902Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are as for
@@ -5904,7 +5904,7 @@ Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are as for
5904 (interactive "BPop to buffer on same frame:\nP") 5904 (interactive "BPop to buffer on same frame:\nP")
5905 (pop-to-buffer buffer-or-name 'same-frame norecord label)) 5905 (pop-to-buffer buffer-or-name 'same-frame norecord label))
5906 5906
5907(defsubst pop-to-buffer-other-window (&optional buffer-or-name norecord label) 5907(defun pop-to-buffer-other-window (&optional buffer-or-name norecord label)
5908 "Pop to buffer specified by BUFFER-OR-NAME in another window. 5908 "Pop to buffer specified by BUFFER-OR-NAME in another window.
5909The selected window will be used only if there is no other 5909The selected window will be used only if there is no other
5910choice. Windows on the selected frame are preferred to windows 5910choice. Windows on the selected frame are preferred to windows
@@ -5913,7 +5913,7 @@ LABEL are as for `pop-to-buffer'."
5913 (interactive "BPop to buffer in another window:\nP") 5913 (interactive "BPop to buffer in another window:\nP")
5914 (pop-to-buffer buffer-or-name 'other-window norecord)) 5914 (pop-to-buffer buffer-or-name 'other-window norecord))
5915 5915
5916(defsubst pop-to-buffer-same-frame-other-window (&optional buffer-or-name norecord label) 5916(defun pop-to-buffer-same-frame-other-window (&optional buffer-or-name norecord label)
5917 "Pop to buffer specified by BUFFER-OR-NAME in another window on the selected frame. 5917 "Pop to buffer specified by BUFFER-OR-NAME in another window on the selected frame.
5918The selected window or another frame will be used only if there 5918The selected window or another frame will be used only if there
5919is no other choice. Optional arguments BUFFER-OR-NAME, NORECORD 5919is no other choice. Optional arguments BUFFER-OR-NAME, NORECORD
@@ -5921,7 +5921,7 @@ and LABEL are as for `pop-to-buffer'."
5921 (interactive "BPop to buffer in another window on same frame:\nP") 5921 (interactive "BPop to buffer in another window on same frame:\nP")
5922 (pop-to-buffer buffer-or-name 'same-frame-other-window norecord label)) 5922 (pop-to-buffer buffer-or-name 'same-frame-other-window norecord label))
5923 5923
5924(defsubst pop-to-buffer-other-frame (&optional buffer-or-name norecord label) 5924(defun pop-to-buffer-other-frame (&optional buffer-or-name norecord label)
5925 "Pop to buffer specified by BUFFER-OR-NAME on another frame. 5925 "Pop to buffer specified by BUFFER-OR-NAME on another frame.
5926The selected frame will be used only if there's no other choice. 5926The selected frame will be used only if there's no other choice.
5927Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are as for 5927Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are as for
@@ -5994,8 +5994,7 @@ Return the buffer switched to."
5994 (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name))) 5994 (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
5995 (if (null force-same-window) 5995 (if (null force-same-window)
5996 (pop-to-buffer 5996 (pop-to-buffer
5997 buffer '(same-window (reuse-window-dedicated . weak)) 5997 buffer '(same-window (reuse-window-dedicated . weak)) norecord)
5998 norecord 'switch-to-buffer)
5999 (cond 5998 (cond
6000 ;; Don't call set-window-buffer if it's not needed since it 5999 ;; Don't call set-window-buffer if it's not needed since it
6001 ;; might signal an error (e.g. if the window is dedicated). 6000 ;; might signal an error (e.g. if the window is dedicated).
@@ -6005,6 +6004,7 @@ Return the buffer switched to."
6005 ((eq (window-dedicated-p) t) 6004 ((eq (window-dedicated-p) t)
6006 (error "Cannot switch buffers in a dedicated window")) 6005 (error "Cannot switch buffers in a dedicated window"))
6007 (t (set-window-buffer nil buffer))) 6006 (t (set-window-buffer nil buffer)))
6007
6008 (unless norecord 6008 (unless norecord
6009 (select-window (selected-window))) 6009 (select-window (selected-window)))
6010 (set-buffer buffer)))) 6010 (set-buffer buffer))))
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index 0a1d22b9224..df6e77b708b 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -82,7 +82,12 @@ defaults to the string looking like a url around the cursor position."
82(defmacro xwidget-image-mode-navigation-adaptor (fn) 82(defmacro xwidget-image-mode-navigation-adaptor (fn)
83 `(lambda () (interactive) 83 `(lambda () (interactive)
84 (flet ((image-display-size (spec) (xwidget-image-display-size spec))) 84 (flet ((image-display-size (spec) (xwidget-image-display-size spec)))
85 (funcall ,fn)))) 85 (funcall ,fn ))))
86
87(defmacro xwidget-image-mode-navigation-adaptor-p (fn)
88 `(lambda (n) (interactive "p")
89 (flet ((image-display-size (spec) (xwidget-image-display-size spec)))
90 (funcall ,fn n))))
86 91
87 92
88;;todo. 93;;todo.
@@ -109,12 +114,12 @@ defaults to the string looking like a url around the cursor position."
109 (define-key map [remap scroll-down-command] (xwidget-image-mode-navigation-adaptor 'image-scroll-down)) 114 (define-key map [remap scroll-down-command] (xwidget-image-mode-navigation-adaptor 'image-scroll-down))
110 115
111 116
112 (define-key map [remap forward-char] (xwidget-image-mode-navigation-adaptor 'image-forward-hscroll)) 117 (define-key map [remap forward-char] (xwidget-image-mode-navigation-adaptor-p 'image-forward-hscroll))
113 (define-key map [remap backward-char] (xwidget-image-mode-navigation-adaptor 'image-backward-hscroll)) 118 (define-key map [remap backward-char] (xwidget-image-mode-navigation-adaptor-p 'image-backward-hscroll))
114 (define-key map [remap right-char] (xwidget-image-mode-navigation-adaptor 'image-forward-hscroll)) 119 (define-key map [remap right-char] (xwidget-image-mode-navigation-adaptor-p 'image-forward-hscroll))
115 (define-key map [remap left-char] (xwidget-image-mode-navigation-adaptor 'image-backward-hscroll)) 120 (define-key map [remap left-char] (xwidget-image-mode-navigation-adaptor-p 'image-backward-hscroll))
116 (define-key map [remap previous-line] (xwidget-image-mode-navigation-adaptor 'image-previous-line)) 121 (define-key map [remap previous-line] (xwidget-image-mode-navigation-adaptor-p 'image-previous-line))
117 (define-key map [remap next-line] (xwidget-image-mode-navigation-adaptor 'image-next-line)) 122 (define-key map [remap next-line] (xwidget-image-mode-navigation-adaptor-p 'image-next-line))
118 123
119 124
120 (define-key map [remap move-beginning-of-line] (xwidget-image-mode-navigation-adaptor 'image-bol)) 125 (define-key map [remap move-beginning-of-line] (xwidget-image-mode-navigation-adaptor 'image-bol))
diff --git a/src/ChangeLog b/src/ChangeLog
index 7c043f6d087..039c225c1f6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,77 @@
12011-08-06 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
4 display property strides EOL and includes a newline, as in
5 longlines-mode. (Bug#9254)
6 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
7 word-wrap under bidirectional display. (Bug#9224)
8
9 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10 is non-zero, even if the data buffer is NULL. Fixes a crash in
11 vertical-motion with longlines-mode. (Bug#9254)
12
132011-08-05 Eli Zaretskii <eliz@gnu.org>
14
15 * bidi.c <bidi_cache_total_alloc>: Now static.
16 (bidi_initialize): Initialize bidi_cache_total_alloc.
17
18 *xdisp.c (display_line): Release buffer allocated for shelved bidi
19 cache. (Bug#9221)
20
21 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
22 amount allocated this far in `bidi_cache_total_alloc'.
23 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
24 non-zero, only free the data buffer without restoring the cache
25 contents. All callers changed.
26
27 * dispextern.h (bidi_unshelve_cache): Update prototype.
28
29 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
30 (move_it_in_display_line, move_it_to)
31 (move_it_vertically_backward, move_it_by_lines): Replace the call
32 to xfree to an equivalent call to bidi_unshelve_cache.
33 (move_it_in_display_line_to): Fix logic of returning
34 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35
362011-08-05 Eli Zaretskii <eliz@gnu.org>
37
38 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
39 came from a string character with a `cursor' property. (Bug#9229)
40
412011-08-04 Jan Djärv <jan.h.d@swipnet.se>
42
43 * Makefile.in (LIB_PTHREAD): New variable.
44 (LIBES): Add LIB_PTHREAD (Bug#9216).
45
46 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
47 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
48
492011-08-04 Andreas Schwab <schwab@linux-m68k.org>
50
51 * regex.c (re_iswctype): Remove some redundant boolean
52 conversions.
53
542011-08-04 Jan Djärv <jan.h.d@swipnet.se>
55
56 * xterm.c (x_find_topmost_parent): New function.
57 (x_set_frame_alpha): Find topmost parent window with
58 x_find_topmost_parent and set the property there also (bug#9181).
59 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
60
612011-08-04 Paul Eggert <eggert@cs.ucla.edu>
62
63 * callproc.c (Fcall_process): Avoid vfork clobbering
64 the local vars buffer, coding_systems, current_dir.
65
662011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
67
68 * keymap.c (Fmake_composed_keymap): Move to subr.el.
69
12011-08-03 Paul Eggert <eggert@cs.ucla.edu> 702011-08-03 Paul Eggert <eggert@cs.ucla.edu>
2 71
72 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
73 so that it is not optimized away.
74
3 * xdisp.c (compute_display_string_pos): Remove unused local. 75 * xdisp.c (compute_display_string_pos): Remove unused local.
4 76
52011-08-02 Eli Zaretskii <eliz@gnu.org> 772011-08-02 Eli Zaretskii <eliz@gnu.org>
@@ -16,8 +88,8 @@
16 non-zero. 88 non-zero.
17 89
18 * bidi.c (bidi_fetch_char): Accept an additional argument 90 * bidi.c (bidi_fetch_char): Accept an additional argument
19 DISP_PROP_P, and pass it to compute_display_string_pos. Only 91 DISP_PROP_P, and pass it to compute_display_string_pos.
20 handle text covered by a display string if DISP_PROP_P is returned 92 Only handle text covered by a display string if DISP_PROP_P is returned
21 non-zero. All callers of bidi_fetch_char changed. 93 non-zero. All callers of bidi_fetch_char changed.
22 94
232011-08-02 Stefan Monnier <monnier@iro.umontreal.ca> 952011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -363,8 +435,8 @@
363 435
364 * xdisp.c (move_it_in_display_line_to): Record the best matching 436 * xdisp.c (move_it_in_display_line_to): Record the best matching
365 position for TO_CHARPOS while scanning the line, and restore it on 437 position for TO_CHARPOS while scanning the line, and restore it on
366 exit if none of the characters scanned was an exact match. Fixes 438 exit if none of the characters scanned was an exact match.
367 vertical-motion and pos-visible-in-window-p under bidi redisplay 439 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
368 when exact match is impossible due to invisible text, and the 440 when exact match is impossible due to invisible text, and the
369 lines are truncated. 441 lines are truncated.
370 442
@@ -549,8 +621,8 @@
549 (reseat_to_string): Initialize bidi_it->string.s and 621 (reseat_to_string): Initialize bidi_it->string.s and
550 bidi_it->string.schars. 622 bidi_it->string.schars.
551 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to 623 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
552 NULL (avoids a crash in bidi_paragraph_init). Initialize 624 NULL (avoids a crash in bidi_paragraph_init).
553 itb.string.lstring. 625 Initialize itb.string.lstring.
554 (init_iterator): Call bidi_init_it only of a valid 626 (init_iterator): Call bidi_init_it only of a valid
555 buffer position was specified. Initialize paragraph_embedding to 627 buffer position was specified. Initialize paragraph_embedding to
556 L2R. 628 L2R.
@@ -566,12 +638,12 @@
566 (init_iterator, reseat_1, reseat_to_string): Initialize the 638 (init_iterator, reseat_1, reseat_to_string): Initialize the
567 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS 639 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
568 when iterating on a string not from display properties). 640 when iterating on a string not from display properties).
569 (compute_display_string_pos, compute_display_string_end): Fix 641 (compute_display_string_pos, compute_display_string_end):
570 calculation of the object to scan. Fixes an error when using 642 Fix calculation of the object to scan. Fixes an error when using
571 arrow keys. 643 arrow keys.
572 (next_element_from_buffer): Don't abort when IT_CHARPOS is before 644 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
573 base_level_stop; instead, set base_level_stop to BEGV. Fixes 645 base_level_stop; instead, set base_level_stop to BEGV.
574 crashes in vertical-motion. 646 Fixes crashes in vertical-motion.
575 (next_element_from_buffer): Improve commentary for when 647 (next_element_from_buffer): Improve commentary for when
576 the iterator is before prev_stop. 648 the iterator is before prev_stop.
577 (init_iterator): Initialize bidi_p from the default value of 649 (init_iterator): Initialize bidi_p from the default value of
@@ -584,8 +656,8 @@
584 (next_element_from_string): Support bidi reordering of Lisp 656 (next_element_from_string): Support bidi reordering of Lisp
585 strings. 657 strings.
586 (handle_stop_backwards): Support Lisp strings as well. 658 (handle_stop_backwards): Support Lisp strings as well.
587 (display_string): Support display of R2L glyph rows. Use 659 (display_string): Support display of R2L glyph rows.
588 IT_STRING_CHARPOS when displaying from a Lisp string. 660 Use IT_STRING_CHARPOS when displaying from a Lisp string.
589 (init_iterator): Don't initialize it->bidi_p for strings 661 (init_iterator): Don't initialize it->bidi_p for strings
590 here. 662 here.
591 (reseat_to_string): Initialize it->bidi_p for strings here. 663 (reseat_to_string): Initialize it->bidi_p for strings here.
@@ -667,8 +739,8 @@
667 displayed in margins. (Bug#8133) (Bug#8867) 739 displayed in margins. (Bug#8133) (Bug#8867)
668 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past 740 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
669 TO_CHARPOS. 741 TO_CHARPOS.
670 (pos_visible_p): Support positions in bidi-reordered lines. Save 742 (pos_visible_p): Support positions in bidi-reordered lines.
671 and restore bidi cache. 743 Save and restore bidi cache.
672 744
673 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int. 745 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
674 (bidi_paragraph_info): Delete unused struct. 746 (bidi_paragraph_info): Delete unused struct.
@@ -688,8 +760,8 @@
688 `len' according to what STRING_CHAR_AND_LENGTH expects. 760 `len' according to what STRING_CHAR_AND_LENGTH expects.
689 (bidi_paragraph_init, bidi_resolve_explicit_1) 761 (bidi_paragraph_init, bidi_resolve_explicit_1)
690 (bidi_resolve_explicit, bidi_resolve_weak) 762 (bidi_resolve_explicit, bidi_resolve_weak)
691 (bidi_level_of_next_char, bidi_move_to_visually_next): Support 763 (bidi_level_of_next_char, bidi_move_to_visually_next):
692 iteration over a string. 764 Support iteration over a string.
693 (bidi_set_sor_type, bidi_resolve_explicit_1) 765 (bidi_set_sor_type, bidi_resolve_explicit_1)
694 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit 766 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
695 can now be zero (for strings); special values 0 and -1 were 767 can now be zero (for strings); special values 0 and -1 were
@@ -720,20 +792,20 @@
720 (bidi_cache_fetch_state, bidi_cache_search) 792 (bidi_cache_fetch_state, bidi_cache_search)
721 (bidi_cache_find_level_change, bidi_cache_ensure_space) 793 (bidi_cache_find_level_change, bidi_cache_ensure_space)
722 (bidi_cache_iterator_state, bidi_cache_find) 794 (bidi_cache_iterator_state, bidi_cache_find)
723 (bidi_find_other_level_edge, bidi_cache_start_stack): All 795 (bidi_find_other_level_edge, bidi_cache_start_stack):
724 variables related to cache indices are now EMACS_INT. 796 All variables related to cache indices are now EMACS_INT.
725 797
726 * dispextern.h (struct bidi_string_data): New structure. 798 * dispextern.h (struct bidi_string_data): New structure.
727 (struct bidi_it): New member `string'. Make flag members be 1-bit 799 (struct bidi_it): New member `string'. Make flag members be 1-bit
728 fields, and put them last in the struct. 800 fields, and put them last in the struct.
729 (compute_display_string_pos, compute_display_string_end): Update 801 (compute_display_string_pos, compute_display_string_end):
730 prototypes. 802 Update prototypes.
731 (bidi_push_it, bidi_pop_it): Add prototypes. 803 (bidi_push_it, bidi_pop_it): Add prototypes.
732 (struct iterator_stack_entry): New members bidi_p, 804 (struct iterator_stack_entry): New members bidi_p,
733 paragraph_embedding, and from_disp_prop_p. 805 paragraph_embedding, and from_disp_prop_p.
734 (struct it): Member bidi_p is now a bit field 1 bit wide. 806 (struct it): Member bidi_p is now a bit field 1 bit wide.
735 (bidi_shelve_cache, bidi_unshelve_cache): Declare 807 (bidi_shelve_cache, bidi_unshelve_cache):
736 prototypes. 808 Declare prototypes.
737 809
738 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector) 810 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
739 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors 811 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
@@ -1015,7 +1087,7 @@
1015 (char_table_set_range): Adjuted for the above change. 1087 (char_table_set_range): Adjuted for the above change.
1016 (map_sub_char_table): Delete args default_val and parent. Add arg 1088 (map_sub_char_table): Delete args default_val and parent. Add arg
1017 top. Give decoded values to a Lisp function. 1089 top. Give decoded values to a Lisp function.
1018 (map_char_table): Adjusted for the above change. Give decoded 1090 (map_char_table): Adjust for the above change. Give decoded
1019 values to a Lisp function. Gcpro more variables. 1091 values to a Lisp function. Gcpro more variables.
1020 (uniprop_table_uncompress) 1092 (uniprop_table_uncompress)
1021 (uniprop_decode_value_run_length): New functions. 1093 (uniprop_decode_value_run_length): New functions.
@@ -1032,10 +1104,10 @@
1032 and Sput_unicode_property_internal. Defvar_lisp 1104 and Sput_unicode_property_internal. Defvar_lisp
1033 char-code-property-alist. 1105 char-code-property-alist.
1034 1106
1035 * composite.c (CHAR_COMPOSABLE_P): Adjusted for the change of 1107 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
1036 Vunicode_category_table. 1108 Vunicode_category_table.
1037 1109
1038 * font.c (font_range): Adjusted for the change of 1110 * font.c (font_range): Adjust for the change of
1039 Vunicode_category_table. 1111 Vunicode_category_table.
1040 1112
10412011-07-07 Dan Nicolaescu <dann@ics.uci.edu> 11132011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
@@ -1064,14 +1136,14 @@
1064 (store_monospaced_changed): Add comment. Call dpyinfo_valid. 1136 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
1065 (struct xsettings): Move font inside HAVE_XFT. 1137 (struct xsettings): Move font inside HAVE_XFT.
1066 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines. 1138 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
1067 (GSETTINGS_MONO_FONT): Renamed from SYSTEM_MONO_FONT. 1139 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
1068 Move inside HAVE_XFT. 1140 Move inside HAVE_XFT.
1069 (something_changed_gsettingsCB): Renamed from something_changedCB. 1141 (something_changed_gsettingsCB): Rename from something_changedCB.
1070 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME 1142 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
1071 also. 1143 also.
1072 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines. 1144 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
1073 (GCONF_MONO_FONT): Renamed from SYSTEM_MONO_FONT. Move inside HAVE_XFT. 1145 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
1074 (something_changed_gconfCB): Renamed from something_changedCB. 1146 (something_changed_gconfCB): Rename from something_changedCB.
1075 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also. 1147 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
1076 (parse_settings): Move check for font inside HAVE_XFT. 1148 (parse_settings): Move check for font inside HAVE_XFT.
1077 (read_settings, apply_xft_settings): Add comment. 1149 (read_settings, apply_xft_settings): Add comment.
@@ -1084,8 +1156,8 @@
1084 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE 1156 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
1085 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT. 1157 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
1086 (xsettings_initialize): Call init_gsettings last. 1158 (xsettings_initialize): Call init_gsettings last.
1087 (xsettings_get_system_font, xsettings_get_system_normal_font): Add 1159 (xsettings_get_system_font, xsettings_get_system_normal_font):
1088 comment. 1160 Add comment.
1089 1161
10902011-07-05 Paul Eggert <eggert@cs.ucla.edu> 11622011-07-05 Paul Eggert <eggert@cs.ucla.edu>
1091 1163
@@ -1268,7 +1340,7 @@
1268 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj 1340 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
1269 to NULL. 1341 to NULL.
1270 1342
1271 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Renamed from 1343 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
1272 GCONF_CFLAGS/LIBS. 1344 GCONF_CFLAGS/LIBS.
1273 1345
12742011-06-29 Martin Rudalics <rudalics@gmx.at> 13462011-06-29 Martin Rudalics <rudalics@gmx.at>
@@ -2015,7 +2087,7 @@
2015 2087
2016 * character.c, coding.c, doprnt.c, editfns.c, eval.c: 2088 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
2017 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND. 2089 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
2018 * lisp.h (STRING_BYTES_BOUND): Renamed from STRING_BYTES_MAX. 2090 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
2019 2091
2020 * character.c (string_escape_byte8): Fix nbytes/nchars typo. 2092 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
2021 2093
@@ -2124,8 +2196,8 @@
2124 Qclone_number. Remove external declaration of Qdelete_window. 2196 Qclone_number. Remove external declaration of Qdelete_window.
2125 (Fbuffer_list): Rewrite doc-string. Minor restructuring of 2197 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
2126 code. 2198 code.
2127 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer): Run 2199 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
2128 Qbuffer_list_update_hook if allowed. 2200 Run Qbuffer_list_update_hook if allowed.
2129 (Fother_buffer): Rewrite doc-string. Major rewrite for new 2201 (Fother_buffer): Rewrite doc-string. Major rewrite for new
2130 buffer list implementation. 2202 buffer list implementation.
2131 (other_buffer_safely): New function. 2203 (other_buffer_safely): New function.
@@ -2136,8 +2208,8 @@
2136 (record_buffer): Inhibit quitting and rewrite using quittable 2208 (record_buffer): Inhibit quitting and rewrite using quittable
2137 functions. Run Qbuffer_list_update_hook if allowed. 2209 functions. Run Qbuffer_list_update_hook if allowed.
2138 (Frecord_buffer, Funrecord_buffer): New functions. 2210 (Frecord_buffer, Funrecord_buffer): New functions.
2139 (switch_to_buffer_1, Fswitch_to_buffer): Remove. Move 2211 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
2140 switch-to-buffer to window.el. 2212 Move switch-to-buffer to window.el.
2141 (bury-buffer): Move to window.el. 2213 (bury-buffer): Move to window.el.
2142 (Vbuffer_list_update_hook): New variable. 2214 (Vbuffer_list_update_hook): New variable.
2143 2215
@@ -2165,8 +2237,8 @@
2165 (select_window_norecord, select_frame_norecord): Move in front 2237 (select_window_norecord, select_frame_norecord): Move in front
2166 of run_window_configuration_change_hook. Remove now obsolete 2238 of run_window_configuration_change_hook. Remove now obsolete
2167 declarations. 2239 declarations.
2168 (Fset_window_buffer): Rewrite doc-string. Call 2240 (Fset_window_buffer): Rewrite doc-string.
2169 Qrecord_window_buffer. 2241 Call Qrecord_window_buffer.
2170 (keys_of_window): Move binding for other-window to window.el. 2242 (keys_of_window): Move binding for other-window to window.el.
2171 2243
21722011-06-11 Chong Yidong <cyd@stupidchicken.com> 22442011-06-11 Chong Yidong <cyd@stupidchicken.com>
@@ -2248,8 +2320,8 @@
2248 orig_total_lines. 2320 orig_total_lines.
2249 (Fdelete_window, delete_window): Remove. Window deletion is 2321 (Fdelete_window, delete_window): Remove. Window deletion is
2250 handled by window.el. 2322 handled by window.el.
2251 (window_loop): Remove DELETE_OTHER_WINDOWS case. Replace 2323 (window_loop): Remove DELETE_OTHER_WINDOWS case.
2252 Fdelete_window calls with calls to Qdelete_window. 2324 Replace Fdelete_window calls with calls to Qdelete_window.
2253 (Fdelete_other_windows): Remove. Deleting other windows is 2325 (Fdelete_other_windows): Remove. Deleting other windows is
2254 handled by window.el. 2326 handled by window.el.
2255 (window_fixed_size_p): Remove. Fixed-sizeness of windows is 2327 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
@@ -2272,8 +2344,8 @@
2272 (grow_mini_window, shrink_mini_window): Implement by calling 2344 (grow_mini_window, shrink_mini_window): Implement by calling
2273 Qresize_root_window_vertically, resize_window_check and 2345 Qresize_root_window_vertically, resize_window_check and
2274 resize_window_apply. 2346 resize_window_apply.
2275 (saved_window, Fset_window_configuration, save_window_save): Do 2347 (saved_window, Fset_window_configuration, save_window_save):
2276 not handle orig_top_line, orig_total_lines, and 2348 Do not handle orig_top_line, orig_total_lines, and
2277 resize_proportionally. 2349 resize_proportionally.
2278 (window_min_height, window_min_width): Move to window.el. 2350 (window_min_height, window_min_width): Move to window.el.
2279 (keys_of_window): Move bindings for delete-other-windows, 2351 (keys_of_window): Move bindings for delete-other-windows,
@@ -2293,8 +2365,8 @@
2293 * xdisp.c (init_xdisp): Don't use set_window_height but set 2365 * xdisp.c (init_xdisp): Don't use set_window_height but set
2294 heights directly. 2366 heights directly.
2295 2367
2296 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Use 2368 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
2297 resize_frame_windows instead of change_window_heights and run 2369 Use resize_frame_windows instead of change_window_heights and run
2298 run_window_configuration_change_hook. 2370 run_window_configuration_change_hook.
2299 2371
2300 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows 2372 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
@@ -2316,8 +2388,8 @@
2316 (Frun_window_configuration_change_hook, make_parent_window) 2388 (Frun_window_configuration_change_hook, make_parent_window)
2317 (resize_window_check, resize_window_apply, Fresize_window_apply) 2389 (resize_window_check, resize_window_apply, Fresize_window_apply)
2318 (resize_frame_windows, Fsplit_window_internal) 2390 (resize_frame_windows, Fsplit_window_internal)
2319 (Fdelete_window_internal, Fresize_mini_window_internal): New 2391 (Fdelete_window_internal, Fresize_mini_window_internal):
2320 functions. 2392 New functions.
2321 (syms_of_window): New variables Vwindow_splits and Vwindow_nest. 2393 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
2322 2394
23232011-06-08 Martin Rudalics <rudalics@gmx.at> 23952011-06-08 Martin Rudalics <rudalics@gmx.at>
@@ -2337,8 +2409,8 @@
2337 (Fwindow_nest, Fset_window_nest, Fwindow_new_total) 2409 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
2338 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers) 2410 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
2339 (Fset_window_prev_buffers, Fwindow_next_buffers) 2411 (Fset_window_prev_buffers, Fwindow_next_buffers)
2340 (Fset_window_next_buffers, Fset_window_clone_number): New 2412 (Fset_window_next_buffers, Fset_window_clone_number):
2341 functions. 2413 New functions.
2342 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start) 2414 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
2343 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p): 2415 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
2344 Doc-string fixes. 2416 Doc-string fixes.
@@ -2364,10 +2436,10 @@
2364 (Fwindow_top_line, window_body_lines, Fwindow_body_size) 2436 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
2365 (Fwindow_list_1): New functions. 2437 (Fwindow_list_1): New functions.
2366 (window_box_text_cols): Replace with window_body_cols. 2438 (window_box_text_cols): Replace with window_body_cols.
2367 (Fwindow_width, Fscroll_left, Fscroll_right): Use 2439 (Fwindow_width, Fscroll_left, Fscroll_right):
2368 window_body_cols instead of window_box_text_cols. 2440 Use window_body_cols instead of window_box_text_cols.
2369 (delete_window, Fset_window_configuration): Call 2441 (delete_window, Fset_window_configuration):
2370 delete_all_subwindows with window as argument. 2442 Call delete_all_subwindows with window as argument.
2371 (delete_all_subwindows): Take a window as argument and not a 2443 (delete_all_subwindows): Take a window as argument and not a
2372 structure. Rewrite. 2444 structure. Rewrite.
2373 (window_loop): Remove handling of GET_LRU_WINDOW and 2445 (window_loop): Remove handling of GET_LRU_WINDOW and
@@ -2378,8 +2450,8 @@
2378 window_box_text_cols. delete_all_subwindows now takes a 2450 window_box_text_cols. delete_all_subwindows now takes a
2379 Lisp_Object as argument. 2451 Lisp_Object as argument.
2380 2452
2381 * indent.c (compute_motion, Fcompute_motion): Use 2453 * indent.c (compute_motion, Fcompute_motion):
2382 window_body_cols instead of window_box_text_cols. 2454 Use window_body_cols instead of window_box_text_cols.
2383 2455
2384 * frame.c (delete_frame): Call delete_all_subwindows with root 2456 * frame.c (delete_frame): Call delete_all_subwindows with root
2385 window as argument. 2457 window as argument.
diff --git a/src/Makefile.in b/src/Makefile.in
index 2dfef64a762..e5b1c5b4eb8 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -130,6 +130,9 @@ START_FILES = @START_FILES@
130## -lm, or empty. 130## -lm, or empty.
131LIB_MATH=@LIB_MATH@ 131LIB_MATH=@LIB_MATH@
132 132
133## -lpthreads, or empty.
134LIB_PTHREAD=@LIB_PTHREAD@
135
133LIBTIFF=@LIBTIFF@ 136LIBTIFF=@LIBTIFF@
134LIBJPEG=@LIBJPEG@ 137LIBJPEG=@LIBJPEG@
135LIBPNG=@LIBPNG@ 138LIBPNG=@LIBPNG@
@@ -395,7 +398,7 @@ LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \
395 $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ 398 $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \
396 $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ 399 $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \
397 $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ 400 $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
398 $(LIBGNUTLS_LIBS) $(LIB_PTHREAD_SIGMASK) \ 401 $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \
399 $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC) 402 $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC)
400 403
401all: emacs$(EXEEXT) $(OTHER_FILES) 404all: emacs$(EXEEXT) $(OTHER_FILES)
diff --git a/src/alloc.c b/src/alloc.c
index b96fc1f0642..36ad645612d 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -24,7 +24,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24 24
25#include <signal.h> 25#include <signal.h>
26 26
27#ifdef HAVE_GTK_AND_PTHREAD 27#ifdef HAVE_PTHREAD
28#include <pthread.h> 28#include <pthread.h>
29#endif 29#endif
30 30
@@ -84,13 +84,15 @@ extern size_t __malloc_extra_blocks;
84#endif /* not DOUG_LEA_MALLOC */ 84#endif /* not DOUG_LEA_MALLOC */
85 85
86#if ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT 86#if ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT
87#ifdef HAVE_GTK_AND_PTHREAD 87#ifdef HAVE_PTHREAD
88 88
89/* When GTK uses the file chooser dialog, different backends can be loaded 89/* When GTK uses the file chooser dialog, different backends can be loaded
90 dynamically. One such a backend is the Gnome VFS backend that gets loaded 90 dynamically. One such a backend is the Gnome VFS backend that gets loaded
91 if you run Gnome. That backend creates several threads and also allocates 91 if you run Gnome. That backend creates several threads and also allocates
92 memory with malloc. 92 memory with malloc.
93 93
94 Also, gconf and gsettings may create several threads.
95
94 If Emacs sets malloc hooks (! SYSTEM_MALLOC) and the emacs_blocked_* 96 If Emacs sets malloc hooks (! SYSTEM_MALLOC) and the emacs_blocked_*
95 functions below are called from malloc, there is a chance that one 97 functions below are called from malloc, there is a chance that one
96 of these threads preempts the Emacs main thread and the hook variables 98 of these threads preempts the Emacs main thread and the hook variables
@@ -122,12 +124,12 @@ static pthread_mutex_t alloc_mutex;
122 } \ 124 } \
123 while (0) 125 while (0)
124 126
125#else /* ! defined HAVE_GTK_AND_PTHREAD */ 127#else /* ! defined HAVE_PTHREAD */
126 128
127#define BLOCK_INPUT_ALLOC BLOCK_INPUT 129#define BLOCK_INPUT_ALLOC BLOCK_INPUT
128#define UNBLOCK_INPUT_ALLOC UNBLOCK_INPUT 130#define UNBLOCK_INPUT_ALLOC UNBLOCK_INPUT
129 131
130#endif /* ! defined HAVE_GTK_AND_PTHREAD */ 132#endif /* ! defined HAVE_PTHREAD */
131#endif /* ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT */ 133#endif /* ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT */
132 134
133/* Mark, unmark, query mark bit of a Lisp string. S must be a pointer 135/* Mark, unmark, query mark bit of a Lisp string. S must be a pointer
@@ -1265,7 +1267,7 @@ emacs_blocked_realloc (void *ptr, size_t size, const void *ptr2)
1265} 1267}
1266 1268
1267 1269
1268#ifdef HAVE_GTK_AND_PTHREAD 1270#ifdef HAVE_PTHREAD
1269/* Called from Fdump_emacs so that when the dumped Emacs starts, it has a 1271/* Called from Fdump_emacs so that when the dumped Emacs starts, it has a
1270 normal malloc. Some thread implementations need this as they call 1272 normal malloc. Some thread implementations need this as they call
1271 malloc before main. The pthread_self call in BLOCK_INPUT_ALLOC then 1273 malloc before main. The pthread_self call in BLOCK_INPUT_ALLOC then
@@ -1278,7 +1280,7 @@ reset_malloc_hooks (void)
1278 __malloc_hook = old_malloc_hook; 1280 __malloc_hook = old_malloc_hook;
1279 __realloc_hook = old_realloc_hook; 1281 __realloc_hook = old_realloc_hook;
1280} 1282}
1281#endif /* HAVE_GTK_AND_PTHREAD */ 1283#endif /* HAVE_PTHREAD */
1282 1284
1283 1285
1284/* Called from main to set up malloc to use our hooks. */ 1286/* Called from main to set up malloc to use our hooks. */
@@ -1286,7 +1288,7 @@ reset_malloc_hooks (void)
1286void 1288void
1287uninterrupt_malloc (void) 1289uninterrupt_malloc (void)
1288{ 1290{
1289#ifdef HAVE_GTK_AND_PTHREAD 1291#ifdef HAVE_PTHREAD
1290#ifdef DOUG_LEA_MALLOC 1292#ifdef DOUG_LEA_MALLOC
1291 pthread_mutexattr_t attr; 1293 pthread_mutexattr_t attr;
1292 1294
@@ -1300,7 +1302,7 @@ uninterrupt_malloc (void)
1300 and the bundled gmalloc.c doesn't require it. */ 1302 and the bundled gmalloc.c doesn't require it. */
1301 pthread_mutex_init (&alloc_mutex, NULL); 1303 pthread_mutex_init (&alloc_mutex, NULL);
1302#endif /* !DOUG_LEA_MALLOC */ 1304#endif /* !DOUG_LEA_MALLOC */
1303#endif /* HAVE_GTK_AND_PTHREAD */ 1305#endif /* HAVE_PTHREAD */
1304 1306
1305 if (__free_hook != emacs_blocked_free) 1307 if (__free_hook != emacs_blocked_free)
1306 old_free_hook = __free_hook; 1308 old_free_hook = __free_hook;
diff --git a/src/bidi.c b/src/bidi.c
index ae5143b37e0..2879198ce31 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -620,12 +620,15 @@ bidi_pop_it (struct bidi_it *bidi_it)
620 bidi_cache_last_idx = -1; 620 bidi_cache_last_idx = -1;
621} 621}
622 622
623static ptrdiff_t bidi_cache_total_alloc;
624
623/* Stash away a copy of the cache and its control variables. */ 625/* Stash away a copy of the cache and its control variables. */
624void * 626void *
625bidi_shelve_cache (void) 627bidi_shelve_cache (void)
626{ 628{
627 unsigned char *databuf; 629 unsigned char *databuf;
628 630
631 /* Empty cache. */
629 if (bidi_cache_idx == 0) 632 if (bidi_cache_idx == 0)
630 return NULL; 633 return NULL;
631 634
@@ -634,6 +637,12 @@ bidi_shelve_cache (void)
634 + sizeof (bidi_cache_start_stack) 637 + sizeof (bidi_cache_start_stack)
635 + sizeof (bidi_cache_sp) + sizeof (bidi_cache_start) 638 + sizeof (bidi_cache_sp) + sizeof (bidi_cache_start)
636 + sizeof (bidi_cache_last_idx)); 639 + sizeof (bidi_cache_last_idx));
640 bidi_cache_total_alloc +=
641 sizeof (bidi_cache_idx) + bidi_cache_idx * sizeof (struct bidi_it)
642 + sizeof (bidi_cache_start_stack)
643 + sizeof (bidi_cache_sp) + sizeof (bidi_cache_start)
644 + sizeof (bidi_cache_last_idx);
645
637 memcpy (databuf, &bidi_cache_idx, sizeof (bidi_cache_idx)); 646 memcpy (databuf, &bidi_cache_idx, sizeof (bidi_cache_idx));
638 memcpy (databuf + sizeof (bidi_cache_idx), 647 memcpy (databuf + sizeof (bidi_cache_idx),
639 bidi_cache, bidi_cache_idx * sizeof (struct bidi_it)); 648 bidi_cache, bidi_cache_idx * sizeof (struct bidi_it));
@@ -657,45 +666,69 @@ bidi_shelve_cache (void)
657 return databuf; 666 return databuf;
658} 667}
659 668
660/* Restore the cache state from a copy stashed away by bidi_shelve_cache. */ 669/* Restore the cache state from a copy stashed away by
670 bidi_shelve_cache, and free the buffer used to stash that copy.
671 JUST_FREE non-zero means free the buffer, but don't restore the
672 cache; used when the corresponding iterator is discarded instead of
673 being restored. */
661void 674void
662bidi_unshelve_cache (void *databuf) 675bidi_unshelve_cache (void *databuf, int just_free)
663{ 676{
664 unsigned char *p = databuf; 677 unsigned char *p = databuf;
665 678
666 if (!p) 679 if (!p)
667 { 680 {
668 /* A NULL pointer means an empty cache. */ 681 if (!just_free)
669 bidi_cache_start = 0; 682 {
670 bidi_cache_sp = 0; 683 /* A NULL pointer means an empty cache. */
671 bidi_cache_reset (); 684 bidi_cache_start = 0;
685 bidi_cache_sp = 0;
686 bidi_cache_reset ();
687 }
672 } 688 }
673 else 689 else
674 { 690 {
675 memcpy (&bidi_cache_idx, p, sizeof (bidi_cache_idx)); 691 if (just_free)
676 bidi_cache_ensure_space (bidi_cache_idx); 692 {
677 memcpy (bidi_cache, p + sizeof (bidi_cache_idx), 693 ptrdiff_t idx;
678 bidi_cache_idx * sizeof (struct bidi_it)); 694
679 memcpy (bidi_cache_start_stack, 695 memcpy (&idx, p, sizeof (bidi_cache_idx));
680 p + sizeof (bidi_cache_idx) 696 bidi_cache_total_alloc -=
681 + bidi_cache_idx * sizeof (struct bidi_it), 697 sizeof (bidi_cache_idx) + idx * sizeof (struct bidi_it)
682 sizeof (bidi_cache_start_stack)); 698 + sizeof (bidi_cache_start_stack) + sizeof (bidi_cache_sp)
683 memcpy (&bidi_cache_sp, 699 + sizeof (bidi_cache_start) + sizeof (bidi_cache_last_idx);
684 p + sizeof (bidi_cache_idx) 700 }
685 + bidi_cache_idx * sizeof (struct bidi_it) 701 else
686 + sizeof (bidi_cache_start_stack), 702 {
687 sizeof (bidi_cache_sp)); 703 memcpy (&bidi_cache_idx, p, sizeof (bidi_cache_idx));
688 memcpy (&bidi_cache_start, 704 bidi_cache_ensure_space (bidi_cache_idx);
689 p + sizeof (bidi_cache_idx) 705 memcpy (bidi_cache, p + sizeof (bidi_cache_idx),
690 + bidi_cache_idx * sizeof (struct bidi_it) 706 bidi_cache_idx * sizeof (struct bidi_it));
691 + sizeof (bidi_cache_start_stack) + sizeof (bidi_cache_sp), 707 memcpy (bidi_cache_start_stack,
692 sizeof (bidi_cache_start)); 708 p + sizeof (bidi_cache_idx)
693 memcpy (&bidi_cache_last_idx, 709 + bidi_cache_idx * sizeof (struct bidi_it),
694 p + sizeof (bidi_cache_idx) 710 sizeof (bidi_cache_start_stack));
695 + bidi_cache_idx * sizeof (struct bidi_it) 711 memcpy (&bidi_cache_sp,
696 + sizeof (bidi_cache_start_stack) + sizeof (bidi_cache_sp) 712 p + sizeof (bidi_cache_idx)
697 + sizeof (bidi_cache_start), 713 + bidi_cache_idx * sizeof (struct bidi_it)
698 sizeof (bidi_cache_last_idx)); 714 + sizeof (bidi_cache_start_stack),
715 sizeof (bidi_cache_sp));
716 memcpy (&bidi_cache_start,
717 p + sizeof (bidi_cache_idx)
718 + bidi_cache_idx * sizeof (struct bidi_it)
719 + sizeof (bidi_cache_start_stack) + sizeof (bidi_cache_sp),
720 sizeof (bidi_cache_start));
721 memcpy (&bidi_cache_last_idx,
722 p + sizeof (bidi_cache_idx)
723 + bidi_cache_idx * sizeof (struct bidi_it)
724 + sizeof (bidi_cache_start_stack) + sizeof (bidi_cache_sp)
725 + sizeof (bidi_cache_start),
726 sizeof (bidi_cache_last_idx));
727 bidi_cache_total_alloc -=
728 sizeof (bidi_cache_idx) + bidi_cache_idx * sizeof (struct bidi_it)
729 + sizeof (bidi_cache_start_stack) + sizeof (bidi_cache_sp)
730 + sizeof (bidi_cache_start) + sizeof (bidi_cache_last_idx);
731 }
699 732
700 xfree (p); 733 xfree (p);
701 } 734 }
@@ -742,6 +775,7 @@ bidi_initialize (void)
742 staticpro (&paragraph_separate_re); 775 staticpro (&paragraph_separate_re);
743 776
744 bidi_cache_sp = 0; 777 bidi_cache_sp = 0;
778 bidi_cache_total_alloc = 0;
745 779
746 bidi_initialized = 1; 780 bidi_initialized = 1;
747} 781}
diff --git a/src/callproc.c b/src/callproc.c
index f148f6233d4..3a91be3d8da 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -603,6 +603,9 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
603 603
604 /* vfork, and prevent local vars from being clobbered by the vfork. */ 604 /* vfork, and prevent local vars from being clobbered by the vfork. */
605 { 605 {
606 Lisp_Object volatile buffer_volatile = buffer;
607 Lisp_Object volatile coding_systems_volatile = coding_systems;
608 Lisp_Object volatile current_dir_volatile = current_dir;
606 int volatile fd1_volatile = fd1; 609 int volatile fd1_volatile = fd1;
607 int volatile fd_error_volatile = fd_error; 610 int volatile fd_error_volatile = fd_error;
608 int volatile fd_output_volatile = fd_output; 611 int volatile fd_output_volatile = fd_output;
@@ -611,6 +614,9 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
611 614
612 pid = vfork (); 615 pid = vfork ();
613 616
617 buffer = buffer_volatile;
618 coding_systems = coding_systems_volatile;
619 current_dir = current_dir_volatile;
614 fd1 = fd1_volatile; 620 fd1 = fd1_volatile;
615 fd_error = fd_error_volatile; 621 fd_error = fd_error_volatile;
616 fd_output = fd_output_volatile; 622 fd_output = fd_output_volatile;
diff --git a/src/dispextern.h b/src/dispextern.h
index a3dfcff3521..fa831b56a7d 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3006,7 +3006,7 @@ extern int bidi_mirror_char (int);
3006extern void bidi_push_it (struct bidi_it *); 3006extern void bidi_push_it (struct bidi_it *);
3007extern void bidi_pop_it (struct bidi_it *); 3007extern void bidi_pop_it (struct bidi_it *);
3008extern void *bidi_shelve_cache (void); 3008extern void *bidi_shelve_cache (void);
3009extern void bidi_unshelve_cache (void *); 3009extern void bidi_unshelve_cache (void *, int);
3010 3010
3011/* Defined in xdisp.c */ 3011/* Defined in xdisp.c */
3012 3012
diff --git a/src/dispnew.c b/src/dispnew.c
index 1d9f849c43e..d4da4297529 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5284,7 +5284,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5284 argument is ZV to prevent move_it_in_display_line from matching 5284 argument is ZV to prevent move_it_in_display_line from matching
5285 based on buffer positions. */ 5285 based on buffer positions. */
5286 move_it_in_display_line (&it, ZV, to_x, MOVE_TO_X); 5286 move_it_in_display_line (&it, ZV, to_x, MOVE_TO_X);
5287 bidi_unshelve_cache (itdata); 5287 bidi_unshelve_cache (itdata, 0);
5288 5288
5289 Fset_buffer (old_current_buffer); 5289 Fset_buffer (old_current_buffer);
5290 5290
diff --git a/src/emacs.c b/src/emacs.c
index bda56740e83..868df894353 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1123,7 +1123,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1123#if defined (USG5) && defined (INTERRUPT_INPUT) 1123#if defined (USG5) && defined (INTERRUPT_INPUT)
1124 setpgrp (); 1124 setpgrp ();
1125#endif 1125#endif
1126#if defined (HAVE_GTK_AND_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC) 1126#if defined (HAVE_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
1127 { 1127 {
1128 extern void malloc_enable_thread (void); 1128 extern void malloc_enable_thread (void);
1129 1129
@@ -2191,7 +2191,7 @@ You must run Emacs in batch mode in order to dump it. */)
2191 memory_warnings (my_edata, malloc_warning); 2191 memory_warnings (my_edata, malloc_warning);
2192 } 2192 }
2193#endif /* not WINDOWSNT */ 2193#endif /* not WINDOWSNT */
2194#if defined (HAVE_GTK_AND_PTHREAD) && !defined SYNC_INPUT 2194#if defined (HAVE_PTHREAD) && !defined SYNC_INPUT
2195 /* Pthread may call malloc before main, and then we will get an endless 2195 /* Pthread may call malloc before main, and then we will get an endless
2196 loop, because pthread_self (see alloc.c) calls malloc the first time 2196 loop, because pthread_self (see alloc.c) calls malloc the first time
2197 it is called on some systems. */ 2197 it is called on some systems. */
diff --git a/src/fontset.c b/src/fontset.c
index 3091f43d6e9..74eb61d2665 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -2100,6 +2100,8 @@ DEFUN ("fontset-list", Ffontset_list, Sfontset_list, 0, 0, 0,
2100 2100
2101#ifdef FONTSET_DEBUG 2101#ifdef FONTSET_DEBUG
2102 2102
2103Lisp_Object dump_fontset (Lisp_Object) EXTERNALLY_VISIBLE;
2104
2103Lisp_Object 2105Lisp_Object
2104dump_fontset (Lisp_Object fontset) 2106dump_fontset (Lisp_Object fontset)
2105{ 2107{
diff --git a/src/gmalloc.c b/src/gmalloc.c
index fa4aa1fdf6a..916bb300fe1 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -37,7 +37,7 @@ Fifth Floor, Boston, MA 02110-1301, USA.
37#include <config.h> 37#include <config.h>
38#endif 38#endif
39 39
40#ifdef HAVE_GTK_AND_PTHREAD 40#ifdef HAVE_PTHREAD
41#define USE_PTHREAD 41#define USE_PTHREAD
42#endif 42#endif
43 43
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 8826b08851a..dd4d99b9d33 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1907,12 +1907,12 @@ xg_get_file_name (FRAME_PTR f,
1907 int filesel_done = 0; 1907 int filesel_done = 0;
1908 xg_get_file_func func; 1908 xg_get_file_func func;
1909 1909
1910#if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN) 1910#if defined (HAVE_PTHREAD) && defined (__SIGRTMIN)
1911 /* I really don't know why this is needed, but without this the GLIBC add on 1911 /* I really don't know why this is needed, but without this the GLIBC add on
1912 library linuxthreads hangs when the Gnome file chooser backend creates 1912 library linuxthreads hangs when the Gnome file chooser backend creates
1913 threads. */ 1913 threads. */
1914 sigblock (sigmask (__SIGRTMIN)); 1914 sigblock (sigmask (__SIGRTMIN));
1915#endif /* HAVE_GTK_AND_PTHREAD */ 1915#endif /* HAVE_PTHREAD */
1916 1916
1917#ifdef HAVE_GTK_FILE_SELECTION_NEW 1917#ifdef HAVE_GTK_FILE_SELECTION_NEW
1918 1918
@@ -1932,7 +1932,7 @@ xg_get_file_name (FRAME_PTR f,
1932 1932
1933 filesel_done = xg_dialog_run (f, w); 1933 filesel_done = xg_dialog_run (f, w);
1934 1934
1935#if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN) 1935#if defined (HAVE_PTHREAD) && defined (__SIGRTMIN)
1936 sigunblock (sigmask (__SIGRTMIN)); 1936 sigunblock (sigmask (__SIGRTMIN));
1937#endif 1937#endif
1938 1938
@@ -1960,9 +1960,9 @@ xg_get_font_name (FRAME_PTR f, const char *default_name)
1960 char *fontname = NULL; 1960 char *fontname = NULL;
1961 int done = 0; 1961 int done = 0;
1962 1962
1963#if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN) 1963#if defined (HAVE_PTHREAD) && defined (__SIGRTMIN)
1964 sigblock (sigmask (__SIGRTMIN)); 1964 sigblock (sigmask (__SIGRTMIN));
1965#endif /* HAVE_GTK_AND_PTHREAD */ 1965#endif /* HAVE_PTHREAD */
1966 1966
1967 w = gtk_font_selection_dialog_new ("Pick a font"); 1967 w = gtk_font_selection_dialog_new ("Pick a font");
1968 if (!default_name) 1968 if (!default_name)
@@ -1974,7 +1974,7 @@ xg_get_font_name (FRAME_PTR f, const char *default_name)
1974 1974
1975 done = xg_dialog_run (f, w); 1975 done = xg_dialog_run (f, w);
1976 1976
1977#if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN) 1977#if defined (HAVE_PTHREAD) && defined (__SIGRTMIN)
1978 sigunblock (sigmask (__SIGRTMIN)); 1978 sigunblock (sigmask (__SIGRTMIN));
1979#endif 1979#endif
1980 1980
diff --git a/src/indent.c b/src/indent.c
index aaeaaf591ef..70689311dd5 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2135,7 +2135,7 @@ whether or not it is currently displayed in some window. */)
2135 } 2135 }
2136 2136
2137 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 2137 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
2138 bidi_unshelve_cache (itdata); 2138 bidi_unshelve_cache (itdata, 0);
2139 } 2139 }
2140 2140
2141 if (BUFFERP (old_buffer)) 2141 if (BUFFERP (old_buffer))
diff --git a/src/keyboard.c b/src/keyboard.c
index b1d95a69124..95f64847a4f 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -44,7 +44,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
44#include "process.h" 44#include "process.h"
45#include <errno.h> 45#include <errno.h>
46 46
47#ifdef HAVE_GTK_AND_PTHREAD 47#ifdef HAVE_PTHREAD
48#include <pthread.h> 48#include <pthread.h>
49#endif 49#endif
50#ifdef MSDOS 50#ifdef MSDOS
diff --git a/src/keymap.c b/src/keymap.c
index c461fdddbbc..3b0edbf4fb3 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -150,17 +150,6 @@ in case you use it as a menu with `x-popup-menu'. */)
150 return Fcons (Qkeymap, Qnil); 150 return Fcons (Qkeymap, Qnil);
151} 151}
152 152
153DEFUN ("make-composed-keymap", Fmake_composed_keymap, Smake_composed_keymap,
154 0, MANY, 0,
155 doc: /* Construct and return a new keymap composed of KEYMAPS.
156When looking up a key in the returned map, the key is looked in each
157keymap in turn until a binding is found.
158usage: (make-composed-keymap &rest KEYMAPS) */)
159 (ptrdiff_t nargs, Lisp_Object *args)
160{
161 return Fcons (Qkeymap, Flist (nargs, args));
162}
163
164/* This function is used for installing the standard key bindings 153/* This function is used for installing the standard key bindings
165 at initialization time. 154 at initialization time.
166 155
@@ -3761,7 +3750,6 @@ be preferred. */);
3761 defsubr (&Sset_keymap_parent); 3750 defsubr (&Sset_keymap_parent);
3762 defsubr (&Smake_keymap); 3751 defsubr (&Smake_keymap);
3763 defsubr (&Smake_sparse_keymap); 3752 defsubr (&Smake_sparse_keymap);
3764 defsubr (&Smake_composed_keymap);
3765 defsubr (&Smap_keymap_internal); 3753 defsubr (&Smap_keymap_internal);
3766 defsubr (&Smap_keymap); 3754 defsubr (&Smap_keymap);
3767 defsubr (&Scopy_keymap); 3755 defsubr (&Scopy_keymap);
diff --git a/src/regex.c b/src/regex.c
index 545a198acd7..d1b835621d9 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2106,9 +2106,9 @@ re_iswctype (int ch, re_wctype_t cc)
2106 case RECC_UPPER: return ISUPPER (ch) != 0; 2106 case RECC_UPPER: return ISUPPER (ch) != 0;
2107 case RECC_XDIGIT: return ISXDIGIT (ch) != 0; 2107 case RECC_XDIGIT: return ISXDIGIT (ch) != 0;
2108 case RECC_ASCII: return IS_REAL_ASCII (ch) != 0; 2108 case RECC_ASCII: return IS_REAL_ASCII (ch) != 0;
2109 case RECC_NONASCII: return !IS_REAL_ASCII (ch) != 0; 2109 case RECC_NONASCII: return !IS_REAL_ASCII (ch);
2110 case RECC_UNIBYTE: return ISUNIBYTE (ch) != 0; 2110 case RECC_UNIBYTE: return ISUNIBYTE (ch) != 0;
2111 case RECC_MULTIBYTE: return !ISUNIBYTE (ch) != 0; 2111 case RECC_MULTIBYTE: return !ISUNIBYTE (ch);
2112 case RECC_WORD: return ISWORD (ch) != 0; 2112 case RECC_WORD: return ISWORD (ch) != 0;
2113 case RECC_ERROR: return false; 2113 case RECC_ERROR: return false;
2114 default: 2114 default:
diff --git a/src/syssignal.h b/src/syssignal.h
index c5c749407cc..7533a5a64fd 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -18,7 +18,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19extern void init_signals (void); 19extern void init_signals (void);
20 20
21#if defined (HAVE_GTK_AND_PTHREAD) || defined (HAVE_NS) 21#ifdef HAVE_PTHREAD
22#include <pthread.h> 22#include <pthread.h>
23/* If defined, asynchronous signals delivered to a non-main thread are 23/* If defined, asynchronous signals delivered to a non-main thread are
24 forwarded to the main thread. */ 24 forwarded to the main thread. */
diff --git a/src/window.c b/src/window.c
index c945e0695f2..c7a4e1872fc 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1381,7 +1381,7 @@ if it isn't already recorded. */)
1381 if (it.current_y < it.last_visible_y) 1381 if (it.current_y < it.last_visible_y)
1382 move_it_past_eol (&it); 1382 move_it_past_eol (&it);
1383 value = make_number (IT_CHARPOS (it)); 1383 value = make_number (IT_CHARPOS (it));
1384 bidi_unshelve_cache (itdata); 1384 bidi_unshelve_cache (itdata, 0);
1385 1385
1386 if (old_buffer) 1386 if (old_buffer)
1387 set_buffer_internal (old_buffer); 1387 set_buffer_internal (old_buffer);
@@ -4278,7 +4278,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4278 } 4278 }
4279 4279
4280 start = it.current.pos; 4280 start = it.current.pos;
4281 bidi_unshelve_cache (itdata); 4281 bidi_unshelve_cache (itdata, 0);
4282 } 4282 }
4283 else if (auto_window_vscroll_p) 4283 else if (auto_window_vscroll_p)
4284 { 4284 {
@@ -4422,7 +4422,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4422 } 4422 }
4423 else 4423 else
4424 { 4424 {
4425 bidi_unshelve_cache (itdata); 4425 bidi_unshelve_cache (itdata, 0);
4426 if (noerror) 4426 if (noerror)
4427 return; 4427 return;
4428 else if (n < 0) /* could happen with empty buffers */ 4428 else if (n < 0) /* could happen with empty buffers */
@@ -4439,7 +4439,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4439 w->vscroll = 0; 4439 w->vscroll = 0;
4440 else 4440 else
4441 { 4441 {
4442 bidi_unshelve_cache (itdata); 4442 bidi_unshelve_cache (itdata, 0);
4443 if (noerror) 4443 if (noerror)
4444 return; 4444 return;
4445 else 4445 else
@@ -4588,7 +4588,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4588 SET_PT_BOTH (charpos, bytepos); 4588 SET_PT_BOTH (charpos, bytepos);
4589 } 4589 }
4590 } 4590 }
4591 bidi_unshelve_cache (itdata); 4591 bidi_unshelve_cache (itdata, 0);
4592} 4592}
4593 4593
4594 4594
@@ -5015,7 +5015,7 @@ displayed_window_lines (struct window *w)
5015 start_display (&it, w, start); 5015 start_display (&it, w, start);
5016 move_it_vertically (&it, height); 5016 move_it_vertically (&it, height);
5017 bottom_y = line_bottom_y (&it); 5017 bottom_y = line_bottom_y (&it);
5018 bidi_unshelve_cache (itdata); 5018 bidi_unshelve_cache (itdata, 0);
5019 5019
5020 /* rms: On a non-window display, 5020 /* rms: On a non-window display,
5021 the value of it.vpos at the bottom of the screen 5021 the value of it.vpos at the bottom of the screen
@@ -5121,7 +5121,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5121 move_it_vertically_backward (&it, window_box_height (w) / 2); 5121 move_it_vertically_backward (&it, window_box_height (w) / 2);
5122 charpos = IT_CHARPOS (it); 5122 charpos = IT_CHARPOS (it);
5123 bytepos = IT_BYTEPOS (it); 5123 bytepos = IT_BYTEPOS (it);
5124 bidi_unshelve_cache (itdata); 5124 bidi_unshelve_cache (itdata, 0);
5125 } 5125 }
5126 else if (iarg < 0) 5126 else if (iarg < 0)
5127 { 5127 {
@@ -5169,7 +5169,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5169 } 5169 }
5170 if (h <= 0) 5170 if (h <= 0)
5171 { 5171 {
5172 bidi_unshelve_cache (itdata); 5172 bidi_unshelve_cache (itdata, 0);
5173 return Qnil; 5173 return Qnil;
5174 } 5174 }
5175 5175
@@ -5192,7 +5192,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5192 charpos = IT_CHARPOS (it); 5192 charpos = IT_CHARPOS (it);
5193 bytepos = IT_BYTEPOS (it); 5193 bytepos = IT_BYTEPOS (it);
5194 5194
5195 bidi_unshelve_cache (itdata); 5195 bidi_unshelve_cache (itdata, 0);
5196 } 5196 }
5197 else 5197 else
5198 { 5198 {
diff --git a/src/xdisp.c b/src/xdisp.c
index 6f871903ed5..f01b277d35c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -606,7 +606,7 @@ int current_mode_line_height, current_header_line_height;
606#define SAVE_IT(ITCOPY,ITORIG,CACHE) \ 606#define SAVE_IT(ITCOPY,ITORIG,CACHE) \
607 do { \ 607 do { \
608 if (CACHE) \ 608 if (CACHE) \
609 xfree (CACHE); \ 609 bidi_unshelve_cache (CACHE, 1); \
610 ITCOPY = ITORIG; \ 610 ITCOPY = ITORIG; \
611 CACHE = bidi_shelve_cache(); \ 611 CACHE = bidi_shelve_cache(); \
612 } while (0) 612 } while (0)
@@ -615,7 +615,7 @@ int current_mode_line_height, current_header_line_height;
615 do { \ 615 do { \
616 if (pITORIG != pITCOPY) \ 616 if (pITORIG != pITCOPY) \
617 *(pITORIG) = *(pITCOPY); \ 617 *(pITORIG) = *(pITCOPY); \
618 bidi_unshelve_cache (CACHE); \ 618 bidi_unshelve_cache (CACHE, 0); \
619 CACHE = NULL; \ 619 CACHE = NULL; \
620 } while (0) 620 } while (0)
621 621
@@ -1346,9 +1346,9 @@ pos_visible_p (struct window *w, EMACS_INT charpos, int *x, int *y,
1346 *vpos = it2.vpos; 1346 *vpos = it2.vpos;
1347 } 1347 }
1348 else 1348 else
1349 xfree (it2data); 1349 bidi_unshelve_cache (it2data, 1);
1350 } 1350 }
1351 bidi_unshelve_cache (itdata); 1351 bidi_unshelve_cache (itdata, 0);
1352 1352
1353 if (old_buffer) 1353 if (old_buffer)
1354 set_buffer_internal_1 (old_buffer); 1354 set_buffer_internal_1 (old_buffer);
@@ -2632,7 +2632,7 @@ init_iterator (struct it *it, struct window *w,
2632 it->paragraph_embedding = R2L; 2632 it->paragraph_embedding = R2L;
2633 else 2633 else
2634 it->paragraph_embedding = NEUTRAL_DIR; 2634 it->paragraph_embedding = NEUTRAL_DIR;
2635 bidi_unshelve_cache (NULL); 2635 bidi_unshelve_cache (NULL, 0);
2636 bidi_init_it (charpos, IT_BYTEPOS (*it), FRAME_WINDOW_P (it->f), 2636 bidi_init_it (charpos, IT_BYTEPOS (*it), FRAME_WINDOW_P (it->f),
2637 &it->bidi_it); 2637 &it->bidi_it);
2638 } 2638 }
@@ -5653,7 +5653,7 @@ back_to_previous_visible_line_start (struct it *it)
5653 pos = --IT_CHARPOS (it2); 5653 pos = --IT_CHARPOS (it2);
5654 --IT_BYTEPOS (it2); 5654 --IT_BYTEPOS (it2);
5655 it2.sp = 0; 5655 it2.sp = 0;
5656 bidi_unshelve_cache (NULL); 5656 bidi_unshelve_cache (NULL, 0);
5657 it2.string_from_display_prop_p = 0; 5657 it2.string_from_display_prop_p = 0;
5658 it2.from_disp_prop_p = 0; 5658 it2.from_disp_prop_p = 0;
5659 if (handle_display_prop (&it2) == HANDLED_RETURN 5659 if (handle_display_prop (&it2) == HANDLED_RETURN
@@ -5863,7 +5863,7 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p)
5863 { 5863 {
5864 bidi_init_it (IT_CHARPOS (*it), IT_BYTEPOS (*it), FRAME_WINDOW_P (it->f), 5864 bidi_init_it (IT_CHARPOS (*it), IT_BYTEPOS (*it), FRAME_WINDOW_P (it->f),
5865 &it->bidi_it); 5865 &it->bidi_it);
5866 bidi_unshelve_cache (NULL); 5866 bidi_unshelve_cache (NULL, 0);
5867 it->bidi_it.paragraph_dir = NEUTRAL_DIR; 5867 it->bidi_it.paragraph_dir = NEUTRAL_DIR;
5868 it->bidi_it.string.s = NULL; 5868 it->bidi_it.string.s = NULL;
5869 it->bidi_it.string.lstring = Qnil; 5869 it->bidi_it.string.lstring = Qnil;
@@ -8063,13 +8063,19 @@ move_it_in_display_line_to (struct it *it,
8063 positions smaller than TO_CHARPOS, return 8063 positions smaller than TO_CHARPOS, return
8064 MOVE_POS_MATCH_OR_ZV, like the unidirectional display 8064 MOVE_POS_MATCH_OR_ZV, like the unidirectional display
8065 did. */ 8065 did. */
8066 if ((op & MOVE_TO_POS) != 0 8066 if (it->bidi_p && (op & MOVE_TO_POS) != 0)
8067 && !saw_smaller_pos
8068 && IT_CHARPOS (*it) > to_charpos)
8069 { 8067 {
8070 result = MOVE_POS_MATCH_OR_ZV; 8068 if (!saw_smaller_pos && IT_CHARPOS (*it) > to_charpos)
8071 if (it->bidi_p && IT_CHARPOS (ppos_it) < ZV) 8069 {
8072 RESTORE_IT (it, &ppos_it, ppos_data); 8070 if (IT_CHARPOS (ppos_it) < ZV)
8071 RESTORE_IT (it, &ppos_it, ppos_data);
8072 goto buffer_pos_reached;
8073 }
8074 else if (it->line_wrap == WORD_WRAP && atpos_it.sp >= 0
8075 && IT_CHARPOS (*it) > to_charpos)
8076 goto buffer_pos_reached;
8077 else
8078 result = MOVE_NEWLINE_OR_CR;
8073 } 8079 }
8074 else 8080 else
8075 result = MOVE_NEWLINE_OR_CR; 8081 result = MOVE_NEWLINE_OR_CR;
@@ -8108,14 +8114,13 @@ move_it_in_display_line_to (struct it *it,
8108 character positions smaller than TO_CHARPOS, 8114 character positions smaller than TO_CHARPOS,
8109 return MOVE_POS_MATCH_OR_ZV, like the 8115 return MOVE_POS_MATCH_OR_ZV, like the
8110 unidirectional display did. */ 8116 unidirectional display did. */
8111 || ((op & MOVE_TO_POS) != 0 8117 || (it->bidi_p && (op & MOVE_TO_POS) != 0
8112 && !saw_smaller_pos 8118 && !saw_smaller_pos
8113 && IT_CHARPOS (*it) > to_charpos)) 8119 && IT_CHARPOS (*it) > to_charpos))
8114 { 8120 {
8115 result = MOVE_POS_MATCH_OR_ZV; 8121 if (!at_eob_p && IT_CHARPOS (ppos_it) < ZV)
8116 if (it->bidi_p && !at_eob_p && IT_CHARPOS (ppos_it) < ZV)
8117 RESTORE_IT (it, &ppos_it, ppos_data); 8122 RESTORE_IT (it, &ppos_it, ppos_data);
8118 break; 8123 goto buffer_pos_reached;
8119 } 8124 }
8120 if (ITERATOR_AT_END_OF_LINE_P (it)) 8125 if (ITERATOR_AT_END_OF_LINE_P (it))
8121 { 8126 {
@@ -8123,14 +8128,13 @@ move_it_in_display_line_to (struct it *it,
8123 break; 8128 break;
8124 } 8129 }
8125 } 8130 }
8126 else if ((op & MOVE_TO_POS) != 0 8131 else if (it->bidi_p && (op & MOVE_TO_POS) != 0
8127 && !saw_smaller_pos 8132 && !saw_smaller_pos
8128 && IT_CHARPOS (*it) > to_charpos) 8133 && IT_CHARPOS (*it) > to_charpos)
8129 { 8134 {
8130 result = MOVE_POS_MATCH_OR_ZV; 8135 if (IT_CHARPOS (ppos_it) < ZV)
8131 if (it->bidi_p && IT_CHARPOS (ppos_it) < ZV)
8132 RESTORE_IT (it, &ppos_it, ppos_data); 8136 RESTORE_IT (it, &ppos_it, ppos_data);
8133 break; 8137 goto buffer_pos_reached;
8134 } 8138 }
8135 result = MOVE_LINE_TRUNCATED; 8139 result = MOVE_LINE_TRUNCATED;
8136 break; 8140 break;
@@ -8150,13 +8154,13 @@ move_it_in_display_line_to (struct it *it,
8150 done: 8154 done:
8151 8155
8152 if (atpos_data) 8156 if (atpos_data)
8153 xfree (atpos_data); 8157 bidi_unshelve_cache (atpos_data, 1);
8154 if (atx_data) 8158 if (atx_data)
8155 xfree (atx_data); 8159 bidi_unshelve_cache (atx_data, 1);
8156 if (wrap_data) 8160 if (wrap_data)
8157 xfree (wrap_data); 8161 bidi_unshelve_cache (wrap_data, 1);
8158 if (ppos_data) 8162 if (ppos_data)
8159 xfree (ppos_data); 8163 bidi_unshelve_cache (ppos_data, 1);
8160 8164
8161 /* Restore the iterator settings altered at the beginning of this 8165 /* Restore the iterator settings altered at the beginning of this
8162 function. */ 8166 function. */
@@ -8191,7 +8195,7 @@ move_it_in_display_line (struct it *it,
8191 (it, -1, prev_x, MOVE_TO_X); 8195 (it, -1, prev_x, MOVE_TO_X);
8192 } 8196 }
8193 else 8197 else
8194 xfree (save_data); 8198 bidi_unshelve_cache (save_data, 1);
8195 } 8199 }
8196 else 8200 else
8197 move_it_in_display_line_to (it, to_charpos, to_x, op); 8201 move_it_in_display_line_to (it, to_charpos, to_x, op);
@@ -8450,7 +8454,7 @@ move_it_to (struct it *it, EMACS_INT to_charpos, int to_x, int to_y, int to_vpos
8450 } 8454 }
8451 8455
8452 if (backup_data) 8456 if (backup_data)
8453 xfree (backup_data); 8457 bidi_unshelve_cache (backup_data, 1);
8454 8458
8455 TRACE_MOVE ((stderr, "move_it_to: reached %d\n", reached)); 8459 TRACE_MOVE ((stderr, "move_it_to: reached %d\n", reached));
8456} 8460}
@@ -8529,7 +8533,7 @@ move_it_vertically_backward (struct it *it, int dy)
8529 RESTORE_IT (it, it, it2data); 8533 RESTORE_IT (it, it, it2data);
8530 if (nlines > 0) 8534 if (nlines > 0)
8531 move_it_by_lines (it, nlines); 8535 move_it_by_lines (it, nlines);
8532 xfree (it3data); 8536 bidi_unshelve_cache (it3data, 1);
8533 } 8537 }
8534 else 8538 else
8535 { 8539 {
@@ -8725,7 +8729,7 @@ move_it_by_lines (struct it *it, int dvpos)
8725 if (IT_CHARPOS (*it) >= start_charpos) 8729 if (IT_CHARPOS (*it) >= start_charpos)
8726 RESTORE_IT (it, &it2, it2data); 8730 RESTORE_IT (it, &it2, it2data);
8727 else 8731 else
8728 xfree (it2data); 8732 bidi_unshelve_cache (it2data, 1);
8729 } 8733 }
8730 else 8734 else
8731 RESTORE_IT (it, it, it2data); 8735 RESTORE_IT (it, it, it2data);
@@ -13341,6 +13345,9 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13341 /* Last buffer position covered by an overlay string with an integer 13345 /* Last buffer position covered by an overlay string with an integer
13342 `cursor' property. */ 13346 `cursor' property. */
13343 EMACS_INT bpos_covered = 0; 13347 EMACS_INT bpos_covered = 0;
13348 /* Non-zero means the display string on which to display the cursor
13349 comes from a text property, not from an overlay. */
13350 int string_from_text_prop = 0;
13344 13351
13345 /* Skip over glyphs not having an object at the start and the end of 13352 /* Skip over glyphs not having an object at the start and the end of
13346 the row. These are special glyphs like truncation marks on 13353 the row. These are special glyphs like truncation marks on
@@ -13659,9 +13666,14 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13659 { 13666 {
13660 Lisp_Object str; 13667 Lisp_Object str;
13661 EMACS_INT tem; 13668 EMACS_INT tem;
13669 /* If the display property covers the newline, we
13670 need to search for it one position farther. */
13671 EMACS_INT lim = pos_after
13672 + (pos_after == MATRIX_ROW_END_CHARPOS (row) + delta);
13662 13673
13674 string_from_text_prop = 0;
13663 str = glyph->object; 13675 str = glyph->object;
13664 tem = string_buffer_position_lim (str, pos, pos_after, 0); 13676 tem = string_buffer_position_lim (str, pos, lim, 0);
13665 if (tem == 0 /* from overlay */ 13677 if (tem == 0 /* from overlay */
13666 || pos <= tem) 13678 || pos <= tem)
13667 { 13679 {
@@ -13685,7 +13697,10 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13685 EMACS_INT strpos = glyph->charpos; 13697 EMACS_INT strpos = glyph->charpos;
13686 13698
13687 if (tem) 13699 if (tem)
13688 cursor = glyph; 13700 {
13701 cursor = glyph;
13702 string_from_text_prop = 1;
13703 }
13689 for ( ; 13704 for ( ;
13690 (row->reversed_p ? glyph > stop : glyph < stop) 13705 (row->reversed_p ? glyph > stop : glyph < stop)
13691 && EQ (glyph->object, str); 13706 && EQ (glyph->object, str);
@@ -13760,14 +13775,12 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13760 w->cursor.vpos >= 0 13775 w->cursor.vpos >= 0
13761 /* that candidate is not the row we are processing */ 13776 /* that candidate is not the row we are processing */
13762 && MATRIX_ROW (matrix, w->cursor.vpos) != row 13777 && MATRIX_ROW (matrix, w->cursor.vpos) != row
13763 /* the row we are processing is part of a continued line */
13764 && (row->continued_p || MATRIX_ROW_CONTINUATION_LINE_P (row))
13765 /* Make sure cursor.vpos specifies a row whose start and end 13778 /* Make sure cursor.vpos specifies a row whose start and end
13766 charpos occlude point. This is because some callers of this 13779 charpos occlude point. This is because some callers of this
13767 function leave cursor.vpos at the row where the cursor was 13780 function leave cursor.vpos at the row where the cursor was
13768 displayed during the last redisplay cycle. */ 13781 displayed during the last redisplay cycle. */
13769 && MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)) <= pt_old 13782 && MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)) <= pt_old
13770 && pt_old < MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))) 13783 && pt_old <= MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)))
13771 { 13784 {
13772 struct glyph *g1 = 13785 struct glyph *g1 =
13773 MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos; 13786 MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos;
@@ -13776,15 +13789,29 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13776 if (!(row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)) 13789 if (!(row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end))
13777 return 0; 13790 return 0;
13778 /* Keep the candidate whose buffer position is the closest to 13791 /* Keep the candidate whose buffer position is the closest to
13779 point. */ 13792 point or has the `cursor' property. */
13780 if (/* previous candidate is a glyph in TEXT_AREA of that row */ 13793 if (/* previous candidate is a glyph in TEXT_AREA of that row */
13781 w->cursor.hpos >= 0 13794 w->cursor.hpos >= 0
13782 && w->cursor.hpos < MATRIX_ROW_USED (matrix, w->cursor.vpos) 13795 && w->cursor.hpos < MATRIX_ROW_USED (matrix, w->cursor.vpos)
13783 && BUFFERP (g1->object) 13796 && ((BUFFERP (g1->object)
13784 && (g1->charpos == pt_old /* an exact match always wins */ 13797 && (g1->charpos == pt_old /* an exact match always wins */
13785 || (BUFFERP (glyph->object) 13798 || (BUFFERP (glyph->object)
13786 && eabs (g1->charpos - pt_old) 13799 && eabs (g1->charpos - pt_old)
13787 < eabs (glyph->charpos - pt_old)))) 13800 < eabs (glyph->charpos - pt_old))))
13801 /* previous candidate is a glyph from a string that has
13802 a non-nil `cursor' property */
13803 || (STRINGP (g1->object)
13804 && (!NILP (Fget_char_property (make_number (g1->charpos),
13805 Qcursor, g1->object))
13806 /* pevious candidate is from the same display
13807 string as this one, and the display string
13808 came from a text property */
13809 || (EQ (g1->object, glyph->object)
13810 && string_from_text_prop)
13811 /* this candidate is from newline and its
13812 position is not an exact match */
13813 || (INTEGERP (glyph->object)
13814 && glyph->charpos != pt_old)))))
13788 return 0; 13815 return 0;
13789 /* If this candidate gives an exact match, use that. */ 13816 /* If this candidate gives an exact match, use that. */
13790 if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old) 13817 if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old)
@@ -18853,6 +18880,9 @@ display_line (struct it *it)
18853 } 18880 }
18854 } 18881 }
18855 18882
18883 if (wrap_data)
18884 bidi_unshelve_cache (wrap_data, 1);
18885
18856 /* If line is not empty and hscrolled, maybe insert truncation glyphs 18886 /* If line is not empty and hscrolled, maybe insert truncation glyphs
18857 at the left window margin. */ 18887 at the left window margin. */
18858 if (it->first_visible_x 18888 if (it->first_visible_x
diff --git a/src/xterm.c b/src/xterm.c
index 510016e3d45..7087f2eeccb 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -445,6 +445,27 @@ x_display_info_for_display (Display *dpy)
445 return 0; 445 return 0;
446} 446}
447 447
448static Window
449x_find_topmost_parent (struct frame *f)
450{
451 struct x_output *x = f->output_data.x;
452 Window win = None, wi = x->parent_desc;
453 Display *dpy = FRAME_X_DISPLAY (f);
454
455 while (wi != FRAME_X_DISPLAY_INFO (f)->root_window)
456 {
457 Window root;
458 Window *children;
459 unsigned int nchildren;
460
461 win = wi;
462 XQueryTree (dpy, win, &root, &wi, &children, &nchildren);
463 XFree (children);
464 }
465
466 return win;
467}
468
448#define OPAQUE 0xffffffff 469#define OPAQUE 0xffffffff
449 470
450void 471void
@@ -456,6 +477,7 @@ x_set_frame_alpha (struct frame *f)
456 double alpha = 1.0; 477 double alpha = 1.0;
457 double alpha_min = 1.0; 478 double alpha_min = 1.0;
458 unsigned long opac; 479 unsigned long opac;
480 Window parent;
459 481
460 if (dpyinfo->x_highlight_frame == f) 482 if (dpyinfo->x_highlight_frame == f)
461 alpha = f->alpha[0]; 483 alpha = f->alpha[0];
@@ -476,6 +498,19 @@ x_set_frame_alpha (struct frame *f)
476 498
477 opac = alpha * OPAQUE; 499 opac = alpha * OPAQUE;
478 500
501 x_catch_errors (dpy);
502
503 /* If there is a parent from the window manager, put the property there
504 also, to work around broken window managers that fail to do that.
505 Do this unconditionally as this function is called on reparent when
506 alpha has not changed on the frame. */
507
508 parent = x_find_topmost_parent (f);
509 if (parent != None)
510 XChangeProperty (dpy, parent, dpyinfo->Xatom_net_wm_window_opacity,
511 XA_CARDINAL, 32, PropModeReplace,
512 (unsigned char *) &opac, 1L);
513
479 /* return unless necessary */ 514 /* return unless necessary */
480 { 515 {
481 unsigned char *data; 516 unsigned char *data;
@@ -483,7 +518,6 @@ x_set_frame_alpha (struct frame *f)
483 int rc, format; 518 int rc, format;
484 unsigned long n, left; 519 unsigned long n, left;
485 520
486 x_catch_errors (dpy);
487 rc = XGetWindowProperty (dpy, win, dpyinfo->Xatom_net_wm_window_opacity, 521 rc = XGetWindowProperty (dpy, win, dpyinfo->Xatom_net_wm_window_opacity,
488 0L, 1L, False, XA_CARDINAL, 522 0L, 1L, False, XA_CARDINAL,
489 &actual, &format, &n, &left, 523 &actual, &format, &n, &left,
@@ -6097,6 +6131,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6097 /* Perhaps reparented due to a WM restart. Reset this. */ 6131 /* Perhaps reparented due to a WM restart. Reset this. */
6098 FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_UNKNOWN; 6132 FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_UNKNOWN;
6099 FRAME_X_DISPLAY_INFO (f)->net_supported_window = 0; 6133 FRAME_X_DISPLAY_INFO (f)->net_supported_window = 0;
6134
6135 x_set_frame_alpha (f);
6100 } 6136 }
6101 goto OTHER; 6137 goto OTHER;
6102 6138
diff --git a/src/xwidget.c b/src/xwidget.c
index 1a3e76dd4a2..0a5ce3c6f0c 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -402,7 +402,6 @@ void webkit_osr_document_load_finished_callback (WebKitWebView *webkitwebvi
402 event.frame_or_window = Qnil; //frame; //how to get the frame here? //TODO i store it in the xwidget now 402 event.frame_or_window = Qnil; //frame; //how to get the frame here? //TODO i store it in the xwidget now
403 403
404 event.arg = Qnil; 404 event.arg = Qnil;
405 //event.arg = Fcons (make_number (xembedid), event.arg);
406 event.arg = Fcons (xw, event.arg); //TODO 405 event.arg = Fcons (xw, event.arg); //TODO
407 event.arg = Fcons (intern ("document-load-finished"), event.arg); 406 event.arg = Fcons (intern ("document-load-finished"), event.arg);
408 407