------------------------------------------------------------ revno: 115073 fixes bug: http://debbugs.gnu.org/15827 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-11-12 00:16:50 -0800 message: * ps-print.el (ps-face-attribute-list): Handle anonymous faces diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-12 07:25:14 +0000 +++ lisp/ChangeLog 2013-11-12 08:16:50 +0000 @@ -1,3 +1,8 @@ +2013-11-12 Glenn Morris + + * ps-print.el (ps-face-attribute-list): + Handle anonymous faces. (Bug#15827) + 2013-11-12 Martin Rudalics * window.el (display-buffer-other-frame): Fix doc-string. === modified file 'lisp/ps-print.el' --- lisp/ps-print.el 2013-10-30 16:29:36 +0000 +++ lisp/ps-print.el 2013-11-12 08:16:50 +0000 @@ -6293,6 +6293,10 @@ ;; only background color, not a `real' face ((ps-face-background-color-p (car face-or-list)) (vector 0 nil (ps-face-extract-color face-or-list))) + ;; Anonymous face. + ((keywordp (car face-or-list)) + (vector 0 (plist-get face-or-list :foreground) + (plist-get face-or-list :background))) ;; list of faces (t (let ((effects 0) ------------------------------------------------------------ revno: 115072 committer: martin rudalics branch nick: trunk timestamp: Tue 2013-11-12 08:25:14 +0100 message: Fix doc-string of display-buffer-other-frame. (Bug#15868) * window.el (display-buffer-other-frame): Fix doc-string. (Bug#15868) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-11 18:05:47 +0000 +++ lisp/ChangeLog 2013-11-12 07:25:14 +0000 @@ -1,3 +1,8 @@ +2013-11-12 Martin Rudalics + + * window.el (display-buffer-other-frame): Fix doc-string. + (Bug#15868) + 2013-11-11 Stefan Monnier * subr.el (force-mode-line-update): Delete, move to buffer.c. === modified file 'lisp/window.el' --- lisp/window.el 2013-10-10 07:57:28 +0000 +++ lisp/window.el 2013-11-12 07:25:14 +0000 @@ -5545,7 +5545,7 @@ window)))) (defun display-buffer-other-frame (buffer) - "Display buffer BUFFER in another frame. + "Display buffer BUFFER preferably in another frame. This uses the function `display-buffer' as a subroutine; see its documentation for additional customization information." (interactive "BDisplay buffer in other frame: ") ------------------------------------------------------------ revno: 115071 committer: Paul Eggert branch nick: trunk timestamp: Mon 2013-11-11 22:07:37 -0800 message: * xterm.c (syms_of_xterm): staticpro Qalt, Qhyper, Qmeta, and Qsuper. This is safer, and it's what w32fns.c does. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-12 03:09:48 +0000 +++ src/ChangeLog 2013-11-12 06:07:37 +0000 @@ -1,6 +1,7 @@ 2013-11-12 Paul Eggert - * xterm.c (syms_of_xterm): staticpro Qmodifier_value. + * xterm.c (syms_of_xterm): staticpro Qmodifier_value, Qalt, Qhyper, + Qmeta, and Qsuper. This is safer, and it's what w32fns.c does. * buffer.c (Fforce_mode_line_update): Don't fall off end of function that requires a return value. === modified file 'src/xterm.c' --- src/xterm.c 2013-11-12 03:09:48 +0000 +++ src/xterm.c 2013-11-12 06:07:37 +0000 @@ -10588,13 +10588,13 @@ #endif DEFSYM (Qmodifier_value, "modifier-value"); - Qalt = intern_c_string ("alt"); + DEFSYM (Qalt, "alt"); Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); - Qhyper = intern_c_string ("hyper"); + DEFSYM (Qhyper, "hyper"); Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier)); - Qmeta = intern_c_string ("meta"); + DEFSYM (Qmeta, "meta"); Fput (Qmeta, Qmodifier_value, make_number (meta_modifier)); - Qsuper = intern_c_string ("super"); + DEFSYM (Qsuper, "super"); Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); DEFVAR_LISP ("x-alt-keysym", Vx_alt_keysym, ------------------------------------------------------------ revno: 115070 author: Paul Eggert committer: Paul Eggert branch nick: trunk timestamp: Mon 2013-11-11 19:09:48 -0800 message: * xterm.c (syms_of_xterm): staticpro Qmodifier_value. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-12 01:24:04 +0000 +++ src/ChangeLog 2013-11-12 03:09:48 +0000 @@ -1,5 +1,7 @@ 2013-11-12 Paul Eggert + * xterm.c (syms_of_xterm): staticpro Qmodifier_value. + * buffer.c (Fforce_mode_line_update): Don't fall off end of function that requires a return value. (Fset_buffer_modified_p): Take advantage of this change to do === modified file 'src/xterm.c' --- src/xterm.c 2013-10-29 16:08:08 +0000 +++ src/xterm.c 2013-11-12 03:09:48 +0000 @@ -10587,7 +10587,7 @@ Vx_toolkit_scroll_bars = Qnil; #endif - Qmodifier_value = intern_c_string ("modifier-value"); + DEFSYM (Qmodifier_value, "modifier-value"); Qalt = intern_c_string ("alt"); Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); Qhyper = intern_c_string ("hyper"); ------------------------------------------------------------ revno: 115069 committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-11-11 19:01:07 -0800 message: * configure.ac: test portability fix (I can never remember whether this is still relevant or not) diff: === modified file 'configure.ac' --- configure.ac 2013-11-12 02:50:28 +0000 +++ configure.ac 2013-11-12 03:01:07 +0000 @@ -24,7 +24,7 @@ AC_PREREQ(2.65) AC_INIT(emacs, 24.3.50) -test "$MSYSTEM" = "MINGW32" && . $srcdir/nt/mingw-cfg.site +test "x$MSYSTEM" = "xMINGW32" && . $srcdir/nt/mingw-cfg.site dnl Set emacs_config_options to the options of 'configure', quoted for the shell, dnl and then quoted again for a C string. Separate options with spaces. ------------------------------------------------------------ revno: 115068 author: Dani Moncayo committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-11-11 18:50:28 -0800 message: Remove nt/msysconfig.sh * configure.ac [MINGW32]: Source nt/mingw-cfg.site. * make-dist: Don't distribute nt/msysconfig.sh. * nt/msysconfig.sh: Remove. * nt/INSTALL: Update for this. * nt/mingw-cfg.site: Comment. diff: === modified file 'ChangeLog' --- ChangeLog 2013-11-12 02:40:14 +0000 +++ ChangeLog 2013-11-12 02:50:28 +0000 @@ -1,5 +1,8 @@ 2013-11-12 Dani Moncayo + * configure.ac [MINGW32]: Source nt/mingw-cfg.site. + * make-dist: Don't distribute nt/msysconfig.sh. + * Makefile.in (epaths-force-w32): Simplify w32srcdir computation. 2013-11-08 Paul Eggert === modified file 'configure.ac' --- configure.ac 2013-11-07 05:31:04 +0000 +++ configure.ac 2013-11-12 02:50:28 +0000 @@ -24,6 +24,8 @@ AC_PREREQ(2.65) AC_INIT(emacs, 24.3.50) +test "$MSYSTEM" = "MINGW32" && . $srcdir/nt/mingw-cfg.site + dnl Set emacs_config_options to the options of 'configure', quoted for the shell, dnl and then quoted again for a C string. Separate options with spaces. dnl Add some environment variables, if they were passed via the environment === modified file 'make-dist' --- make-dist 2013-11-11 01:00:03 +0000 +++ make-dist 2013-11-12 02:50:28 +0000 @@ -404,7 +404,7 @@ ln config.nt emacsclient.rc emacs-src.tags ../${tempdir}/nt ln nmake.defs gmake.defs subdirs.el [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt ln Makefile.in gnulib.mk ../${tempdir}/nt - ln msysconfig.sh mingw-cfg.site epaths.nt INSTALL.OLD ../${tempdir}/nt + ln mingw-cfg.site epaths.nt INSTALL.OLD ../${tempdir}/nt ln ChangeLog INSTALL README README.W32 makefile.w32-in ../${tempdir}/nt) echo "Making links to \`nt/inc' and its subdirectories" === modified file 'nt/ChangeLog' --- nt/ChangeLog 2013-11-09 00:33:41 +0000 +++ nt/ChangeLog 2013-11-12 02:50:28 +0000 @@ -1,3 +1,8 @@ +2013-11-12 Dani Moncayo + + * msysconfig.sh: Remove. + * INSTALL: Update for this. + 2013-11-09 Glenn Morris * mingw-cfg.site: No need for this to be executable. === modified file 'nt/INSTALL' --- nt/INSTALL 2013-11-05 07:54:03 +0000 +++ nt/INSTALL 2013-11-12 02:50:28 +0000 @@ -31,15 +31,15 @@ 1. If you want to build Emacs outside of the source tree (recommended), create the build directory and chdir there. - 2. Invoke the MSYS-specific configure script: + 2. Invoke the configure script: - If you are building outside the source tree: - /PATH/TO/EMACS/SOURCE/TREE/nt/msysconfig.sh --prefix=PREFIX ... + /PATH/TO/EMACS/SOURCE/TREE/configure --prefix=PREFIX ... - If you are building in-place, i.e. inside the source tree: - ./nt/msysconfig.sh --prefix=PREFIX ... + ./configure --prefix=PREFIX ... It is always preferable to use --prefix to configure Emacs for some specific location of its installed tree; the default @@ -49,7 +49,7 @@ You can pass other options to the configure script. Here's a typical example (for an in-place debug build): - CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=/d/usr/emacs --enable-checking + CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./configure --prefix=/d/usr/emacs --enable-checking 3. After the configure script finishes, it should display the resulting configuration. After that, type @@ -313,11 +313,11 @@ You invoke the configure script like this: - /PATH/TO/EMACS/SOURCE/TREE/nt/msysconfig.sh --prefix=PREFIX ... + /PATH/TO/EMACS/SOURCE/TREE/configure --prefix=PREFIX ... or, if you are building in-place, i.e. inside the source tree: - ./nt/msysconfig.sh --prefix=PREFIX ... + ./configure --prefix=PREFIX ... Here PREFIX is the place where you eventually want to install Emacs once built, e.g. /d/usr. We recommend to always use --prefix when @@ -337,12 +337,12 @@ Windows-style file names was reported to cause subtle and hard to figure out problems during the build. This applies both to the command switches, such as --prefix=, and to the absolute file name - of msysconfig.sh, if you are building outside of the source tree. + of 'configure', if you are building outside of the source tree. You can pass additional options to the configure script, for the full list type - ./nt/msysconfig.sh --help + ./configure --help As explained in the help text, you may need to tell the script what are the optional flags to invoke the compiler. This is needed if @@ -355,7 +355,7 @@ headers in C:\emacs\libs\jpeg-6b-4-lib\include, you will need to say something like this: - CPPFLAGS='-I/c/emacs/libs/libpng-1.2.37-lib/include -I/c/emacs/libs/jpeg-6b-4-lib/include' ./nt/msysconfig.sh --prefix=PREFIX + CPPFLAGS='-I/c/emacs/libs/libpng-1.2.37-lib/include -I/c/emacs/libs/jpeg-6b-4-lib/include' ./configure --prefix=PREFIX which is quite a mouth-full, especially if you have more directories to specify... Perhaps you may wish to revisit your installation @@ -363,9 +363,9 @@ If you have a global site-lisp directory from previous Emacs installation, and you want Emacs to continue using it, specify it - via the --enable-locallisppath switch to msysconfig.sh, like this: + via the --enable-locallisppath switch to 'configure', like this: - ./nt/msysconfig.sh --prefix=PREFIX --enable-locallisppath="/d/usr/share/emacs/VERSION/site-lisp:/d/wherever/site-lisp" + ./configure --prefix=PREFIX --enable-locallisppath="/d/usr/share/emacs/VERSION/site-lisp:/d/wherever/site-lisp" Use the normal MSYS /d/foo/bar style to specify directories by their absolute file names. @@ -373,7 +373,7 @@ A few frequently used options are needed when you want to produce an unoptimized binary with runtime checks enabled: - CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=PREFIX --enable-checking + CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./configure --prefix=PREFIX --enable-checking Once invoked, the configure script will run for some time, and, if successful, will eventually produce a summary of the configuration === modified file 'nt/mingw-cfg.site' --- nt/mingw-cfg.site 2013-11-09 00:33:41 +0000 +++ nt/mingw-cfg.site 2013-11-12 02:50:28 +0000 @@ -12,10 +12,11 @@ # value of a shell variable ac_cv_header_foo_h. The value should be # yes if the header is deemed to exist, no otherwise. Or it could be # something else, if the value computed by 'configure' requires that. -# In general, since configure instructs GCC to use header files -# in nt/inc, you should not need to futz with header file tests. But -# there are exceptions, like with getopt.h below (which is a MinGW -# system header, but we do not want to use it). +# In general, since configure (when invoked from an MSYS environment) +# instructs GCC to use header files in nt/inc, you should not need to +# futz with header file tests. But there are exceptions, like with +# getopt.h below (which is a MinGW system header, but we do not want +# to use it). # # For each library function foo you want to supply test results, set # the value of a shell variable ac_cv_func_foo. Again, the value is === removed file 'nt/msysconfig.sh' --- nt/msysconfig.sh 2013-05-18 07:17:03 +0000 +++ nt/msysconfig.sh 1970-01-01 00:00:00 +0000 @@ -1,39 +0,0 @@ -#! /bin/sh -### msysconfig.sh - Run the top-level 'configure' script as appropriate -### for the MinGW/MSYS build of a native MS-Windows port of Emacs. - -## Copyright (C) 2013 Free Software Foundation, Inc. - -## Author: Eli Zaretskii - -## This file is part of GNU Emacs. - -## GNU Emacs is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. - -## GNU Emacs is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with GNU Emacs. If not, see . - -### Commentary: - -## The Posix 'configure' script needs a few tweaks to produce desired -## results when running under MSYS with the purpose of configuring -## Emacs for the MinGW MS-Windows build. Rather than asking users to -## type these tweaks every time they configure the package, we provide -## this helper script which takes care of the mundane things. - -### Code: - -srcdir=`dirname "$0"` -parent=`dirname "$srcdir"` - -## The nt/mingw-cfg.site file provides various autoconf variables that -## are needed for a successful MinGW build. -CONFIG_SITE="$srcdir/mingw-cfg.site" $parent/configure "$@" ------------------------------------------------------------ revno: 115067 author: Dani Moncayo committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-11-11 18:40:14 -0800 message: * Makefile.in (epaths-force-w32): Simplify w32srcdir computation. diff: === modified file 'ChangeLog' --- ChangeLog 2013-11-08 16:24:40 +0000 +++ ChangeLog 2013-11-12 02:40:14 +0000 @@ -1,3 +1,7 @@ +2013-11-12 Dani Moncayo + + * Makefile.in (epaths-force-w32): Simplify w32srcdir computation. + 2013-11-08 Paul Eggert Merge from gnulib, incorporating: === modified file 'Makefile.in' --- Makefile.in 2013-11-05 21:51:09 +0000 +++ Makefile.in 2013-11-12 02:40:14 +0000 @@ -351,7 +351,7 @@ # the data directory. "pwd -W" produces Windows-style 'd:/foo/bar' # absolute directory names, so we use it here to countermand that lossage. epaths-force-w32: FRC - @(w32srcdir=`cd "${srcdir}"; pwd -W | sed -e 's,^\([A-Za-z]\):,/\1,' | ${msys_to_w32}` ; \ + @(w32srcdir=`cd "${srcdir}" && pwd -W` ; \ prefixpattern=`echo '${prefix}' | ${msys_to_w32} | ${msys_sed_sh_escape}` ; \ locallisppath=`echo '${locallisppath}' | ${msys_lisppath_to_w32} | ${msys_prefix_subst}` ; \ sed < ${srcdir}/nt/epaths.nt > epaths.h.$$$$ \ ------------------------------------------------------------ revno: 115066 committer: Paul Eggert branch nick: trunk timestamp: Mon 2013-11-11 17:24:04 -0800 message: * buffer.c (Fforce_mode_line_update): Don't fall off end of function that requires a return value. (Fset_buffer_modified_p): Take advantage of this change to do a tail call. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-11 18:05:47 +0000 +++ src/ChangeLog 2013-11-12 01:24:04 +0000 @@ -1,3 +1,10 @@ +2013-11-12 Paul Eggert + + * buffer.c (Fforce_mode_line_update): Don't fall off end of function + that requires a return value. + (Fset_buffer_modified_p): Take advantage of this change to do + a tail call. + 2013-11-11 Stefan Monnier * buffer.c (Frestore_buffer_modified_p): Sync it with === modified file 'src/buffer.c' --- src/buffer.c 2013-11-11 18:05:47 +0000 +++ src/buffer.c 2013-11-12 01:24:04 +0000 @@ -1341,6 +1341,7 @@ update_mode_lines = 10; current_buffer->prevent_redisplay_optimizations_p = 1; } + return all; } DEFUN ("set-buffer-modified-p", Fset_buffer_modified_p, Sset_buffer_modified_p, @@ -1362,9 +1363,7 @@ Ideally, I think there should be another mechanism for fontifying buffers without "modifying" buffers, or redisplay should be smarter about updating the `*' in mode lines. --gerd */ - Fforce_mode_line_update (Qnil); - - return flag; + return Fforce_mode_line_update (Qnil); } DEFUN ("restore-buffer-modified-p", Frestore_buffer_modified_p, ------------------------------------------------------------ revno: 115065 committer: Xue Fuqiao branch nick: trunk timestamp: Tue 2013-11-12 06:52:08 +0800 message: Doc fixes. * doc/lispref/os.texi (User Identification, Time of Day, Time Conversion): Minor fixes. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-11-10 12:18:03 +0000 +++ doc/lispref/ChangeLog 2013-11-11 22:52:08 +0000 @@ -1,3 +1,8 @@ +2013-11-11 Xue Fuqiao + + * os.texi (User Identification, Time of Day, Time Conversion): + Minor fixes. + 2013-11-10 Jan Djärv * keymaps.texi (Tool Bar): Mention that Gtk+/NS ignores item 1 to 3. === modified file 'doc/lispref/os.texi' --- doc/lispref/os.texi 2013-11-09 07:19:16 +0000 +++ doc/lispref/os.texi 2013-11-11 22:52:08 +0000 @@ -552,8 +552,8 @@ In some cases, the option is followed in the command line by an argument. In these cases, the @var{handler-function} can find all the remaining command-line arguments in the variable -@code{command-line-args-left}. (The entire list of command-line -arguments is in @code{command-line-args}.) +@code{command-line-args-left} (see below). (The entire list of +command-line arguments is in @code{command-line-args}.) The command-line arguments are parsed by the @code{command-line-1} function in the @file{startup.el} file. See also @ref{Emacs @@ -961,6 +961,7 @@ removes @var{variable} from the environment. Otherwise, @var{value} should be a string. +@c FIXME: Document `substitute-env-vars'? --xfq If the optional argument @var{substitute} is non-@code{nil}, Emacs calls the function @code{substitute-env-vars} to expand any environment variables in @var{value}. @@ -1097,9 +1098,9 @@ Lisp packages that load files of customizations, or any other sort of user profile, should obey this variable in deciding where to find it. They should load the profile of the user name found in this variable. -If @code{init-file-user} is @code{nil}, meaning that the @samp{-q} -option was used, then Lisp packages should not load any customization -files or user profile. +If @code{init-file-user} is @code{nil}, meaning that the @samp{-q}, +@samp{-Q}, or @samp{-batch} option was used, then Lisp packages should +not load any customization files or user profile. @end defvar @defopt user-mail-address @@ -1149,6 +1150,7 @@ variables are also useful for constructing frame titles (@pxref{Frame Titles}). +@cindex UID @defun user-real-uid This function returns the real @acronym{UID} of the user. The value may be a floating point number, in the (unlikely) event that @@ -1160,6 +1162,7 @@ The value may be a floating point number. @end defun +@cindex GID @defun group-gid This function returns the effective @acronym{GID} of the Emacs process. The value may be a floating point number. @@ -1219,9 +1222,9 @@ argument to @code{current-time-string}, two-, three-, and four-integer lists are accepted. You can convert times from the list representation into standard human-readable strings using -@code{current-time}, or to other forms using the @code{decode-time} -and @code{format-time-string} functions documented in the following -sections. +@code{current-time-string}, or to other forms using the +@code{decode-time} and @code{format-time-string} functions documented +in the following sections. @defun current-time-string &optional time-value This function returns the current time and date as a human-readable @@ -1265,6 +1268,7 @@ @end defun @defun current-time-zone &optional time-value +@cindex time zone, current This function returns a list describing the time zone that the user is in. @@ -1291,6 +1295,7 @@ @node Time Conversion @section Time Conversion +@cindex calendrical information These functions convert time values (lists of two to four integers, as explained in the previous section) into calendrical information and ------------------------------------------------------------ revno: 115064 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2013-11-11 13:05:47 -0500 message: * lisp/subr.el (force-mode-line-update): Delete, move to buffer.c. * src/buffer.c (Frestore_buffer_modified_p): Sync it with Fset_buffer_modified_p. (Fforce_mode_line_update): New function, moved from subr.el. (Fset_buffer_modified_p): Use them. (syms_of_buffer): Defsubr Fforce_mode_line_update. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-11 15:18:07 +0000 +++ lisp/ChangeLog 2013-11-11 18:05:47 +0000 @@ -1,3 +1,7 @@ +2013-11-11 Stefan Monnier + + * subr.el (force-mode-line-update): Delete, move to buffer.c. + 2013-11-11 Michael Albinus * net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer) === modified file 'lisp/subr.el' --- lisp/subr.el 2013-11-04 14:09:36 +0000 +++ lisp/subr.el 2013-11-11 18:05:47 +0000 @@ -2382,14 +2382,6 @@ (define-obsolete-function-alias 'redraw-modeline 'force-mode-line-update "24.3") -(defun force-mode-line-update (&optional all) - "Force redisplay of the current buffer's mode line and header line. -With optional non-nil ALL, force redisplay of all mode lines and -header lines. This function also forces recomputation of the -menu bar menus and the frame title." - (if all (with-current-buffer (other-buffer))) - (set-buffer-modified-p (buffer-modified-p))) - (defun momentary-string-display (string pos &optional exit-char message) "Momentarily display STRING in the buffer at POS. Display remains until next event is input. === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-11 16:37:54 +0000 +++ src/ChangeLog 2013-11-11 18:05:47 +0000 @@ -1,3 +1,11 @@ +2013-11-11 Stefan Monnier + + * buffer.c (Frestore_buffer_modified_p): Sync it with + Fset_buffer_modified_p. + (Fforce_mode_line_update): New function, moved from subr.el. + (Fset_buffer_modified_p): Use them. + (syms_of_buffer): Defsubr Fforce_mode_line_update. + 2013-11-11 Paul Eggert * search.c (find_newline): Rewrite to prefer offsets to pointers. === modified file 'src/buffer.c' --- src/buffer.c 2013-11-08 10:21:35 +0000 +++ src/buffer.c 2013-11-11 18:05:47 +0000 @@ -1328,15 +1328,55 @@ return BUF_SAVE_MODIFF (buf) < BUF_MODIFF (buf) ? Qt : Qnil; } +DEFUN ("force-mode-line-update", Fforce_mode_line_update, + Sforce_mode_line_update, 0, 1, 0, + doc: /* Force redisplay of the current buffer's mode line and header line. +With optional non-nil ALL, force redisplay of all mode lines and +header lines. This function also forces recomputation of the +menu bar menus and the frame title. */) + (Lisp_Object all) +{ + if (!NILP (all) || buffer_window_count (current_buffer)) + { + update_mode_lines = 10; + current_buffer->prevent_redisplay_optimizations_p = 1; + } +} + DEFUN ("set-buffer-modified-p", Fset_buffer_modified_p, Sset_buffer_modified_p, 1, 1, 0, doc: /* Mark current buffer as modified or unmodified according to FLAG. A non-nil FLAG means mark the buffer modified. */) (Lisp_Object flag) { + Frestore_buffer_modified_p (flag); + + /* Set update_mode_lines only if buffer is displayed in some window. + Packages like jit-lock or lazy-lock preserve a buffer's modified + state by recording/restoring the state around blocks of code. + Setting update_mode_lines makes redisplay consider all windows + (on all frames). Stealth fontification of buffers not displayed + would incur additional redisplay costs if we'd set + update_modes_lines unconditionally. + + Ideally, I think there should be another mechanism for fontifying + buffers without "modifying" buffers, or redisplay should be + smarter about updating the `*' in mode lines. --gerd */ + Fforce_mode_line_update (Qnil); + + return flag; +} + +DEFUN ("restore-buffer-modified-p", Frestore_buffer_modified_p, + Srestore_buffer_modified_p, 1, 1, 0, + doc: /* Like `set-buffer-modified-p', with a difference concerning redisplay. +It is not ensured that mode lines will be updated to show the modified +state of the current buffer. Use with care. */) + (Lisp_Object flag) +{ +#ifdef CLASH_DETECTION Lisp_Object fn; -#ifdef CLASH_DETECTION /* If buffer becoming modified, lock the file. If buffer becoming unmodified, unlock the file. */ @@ -1376,52 +1416,6 @@ or increase MODIFF. */ : MODIFF++); - /* Set update_mode_lines only if buffer is displayed in some window. - Packages like jit-lock or lazy-lock preserve a buffer's modified - state by recording/restoring the state around blocks of code. - Setting update_mode_lines makes redisplay consider all windows - (on all frames). Stealth fontification of buffers not displayed - would incur additional redisplay costs if we'd set - update_modes_lines unconditionally. - - Ideally, I think there should be another mechanism for fontifying - buffers without "modifying" buffers, or redisplay should be - smarter about updating the `*' in mode lines. --gerd */ - if (buffer_window_count (current_buffer)) - { - update_mode_lines = 10; - current_buffer->prevent_redisplay_optimizations_p = 1; - } - - return flag; -} - -DEFUN ("restore-buffer-modified-p", Frestore_buffer_modified_p, - Srestore_buffer_modified_p, 1, 1, 0, - doc: /* Like `set-buffer-modified-p', with a difference concerning redisplay. -It is not ensured that mode lines will be updated to show the modified -state of the current buffer. Use with care. */) - (Lisp_Object flag) -{ -#ifdef CLASH_DETECTION - Lisp_Object fn; - - /* If buffer becoming modified, lock the file. - If buffer becoming unmodified, unlock the file. */ - - fn = BVAR (current_buffer, file_truename); - /* Test buffer-file-name so that binding it to nil is effective. */ - if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename))) - { - bool already = SAVE_MODIFF < MODIFF; - if (!already && !NILP (flag)) - lock_file (fn); - else if (already && NILP (flag)) - unlock_file (fn); - } -#endif /* CLASH_DETECTION */ - - SAVE_MODIFF = NILP (flag) ? MODIFF : 0; return flag; } @@ -1794,7 +1788,7 @@ /* Run replace_buffer_in_windows before making another buffer current since set-window-buffer-start-and-point will refuse to make another buffer current if the selected window does not show the current - buffer. (Bug#10114) */ + buffer (bug#10114). */ replace_buffer_in_windows (buffer); /* Exit if replacing the buffer in windows has killed our buffer. */ @@ -5403,12 +5397,12 @@ if (PER_BUFFER_IDX (offset) == 0) /* Did a DEFVAR_PER_BUFFER without initializing the corresponding - slot of buffer_local_flags */ + slot of buffer_local_flags. */ emacs_abort (); } -/* initialize the buffer routines */ +/* Initialize the buffer routines. */ void syms_of_buffer (void) { @@ -5798,7 +5792,8 @@ DEFVAR_PER_BUFFER ("buffer-file-name", &BVAR (current_buffer, filename), Qstringp, - doc: /* Name of file visited in current buffer, or nil if not visiting a file. */); + doc: /* Name of file visited in current buffer, or nil if not visiting a file. +This should be an absolute file name. */); DEFVAR_PER_BUFFER ("buffer-file-truename", &BVAR (current_buffer, file_truename), Qstringp, @@ -6298,6 +6293,7 @@ defsubr (&Sbuffer_local_value); defsubr (&Sbuffer_local_variables); defsubr (&Sbuffer_modified_p); + defsubr (&Sforce_mode_line_update); defsubr (&Sset_buffer_modified_p); defsubr (&Sbuffer_modified_tick); defsubr (&Sbuffer_chars_modified_tick); ------------------------------------------------------------ revno: 115063 committer: Paul Eggert branch nick: trunk timestamp: Mon 2013-11-11 08:37:54 -0800 message: * search.c (find_newline): Rewrite to prefer offsets to pointers. This avoids undefined behavior when subtracting pointers into different aways. On my platform it also makes the code a tad smaller and presumably faster. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-11 05:18:53 +0000 +++ src/ChangeLog 2013-11-11 16:37:54 +0000 @@ -1,3 +1,10 @@ +2013-11-11 Paul Eggert + + * search.c (find_newline): Rewrite to prefer offsets to pointers. + This avoids undefined behavior when subtracting pointers into + different aways. On my platform it also makes the code a tad + smaller and presumably faster. + 2013-11-11 Stefan Monnier * keyboard.c (command_loop_1): Use region-extract-function. === modified file 'src/search.c' --- src/search.c 2013-11-09 21:24:10 +0000 +++ src/search.c 2013-11-11 16:37:54 +0000 @@ -720,58 +720,45 @@ { /* The termination address of the dumb loop. */ - register unsigned char *ceiling_addr - = BYTE_POS_ADDR (ceiling_byte) + 1; - register unsigned char *cursor - = BYTE_POS_ADDR (start_byte); - unsigned char *base = cursor; - - while (cursor < ceiling_addr) - { + unsigned char *lim_addr = BYTE_POS_ADDR (ceiling_byte) + 1; + ptrdiff_t lim_byte = ceiling_byte + 1; + + /* Nonpositive offsets (relative to LIM_ADDR and LIM_BYTE) + of the base, the cursor, and the next line. */ + ptrdiff_t base = start_byte - lim_byte; + ptrdiff_t cursor, next; + + for (cursor = base; cursor < 0; cursor = next) + { /* The dumb loop. */ - unsigned char *nl = memchr (cursor, '\n', ceiling_addr - cursor); + unsigned char *nl = memchr (lim_addr + cursor, '\n', - cursor); + next = nl ? nl - lim_addr : 0; /* If we're looking for newlines, cache the fact that - the region from start to cursor is free of them. */ + this line's region is free of them. */ if (newline_cache) { - unsigned char *low = cursor; - unsigned char *lim = nl ? nl : ceiling_addr; know_region_cache (current_buffer, newline_cache, - BYTE_TO_CHAR (low - base + start_byte), - BYTE_TO_CHAR (lim - base + start_byte)); + BYTE_TO_CHAR (lim_byte + cursor), + BYTE_TO_CHAR (lim_byte + next)); + /* know_region_cache can relocate buffer text. */ + lim_addr = BYTE_POS_ADDR (ceiling_byte) + 1; } if (! nl) break; + next++; if (--count == 0) { immediate_quit = 0; if (bytepos) - *bytepos = nl + 1 - base + start_byte; - return BYTE_TO_CHAR (nl + 1 - base + start_byte); - } - if (newline_cache) - { - /* The call to know_region_cache could have - allocated memory and caused relocation of buffer - text. If it did, adjust pointers into buffer - text. */ - ptrdiff_t offset = BYTE_POS_ADDR (start_byte) - base; - - if (offset != 0) - { - cursor += offset; - base += offset; - ceiling_addr += offset; - nl += offset; - } - } - cursor = nl + 1; + *bytepos = lim_byte + next; + return BYTE_TO_CHAR (lim_byte + next); + } } - start_byte += ceiling_addr - base; + start_byte = lim_byte; start = BYTE_TO_CHAR (start_byte); } } @@ -810,24 +797,28 @@ { /* The termination address of the dumb loop. */ - register unsigned char *ceiling_addr = BYTE_POS_ADDR (ceiling_byte); - register unsigned char *cursor = BYTE_POS_ADDR (start_byte - 1); - unsigned char *base = cursor; - - while (cursor >= ceiling_addr) + unsigned char *ceiling_addr = BYTE_POS_ADDR (ceiling_byte); + + /* Offsets (relative to CEILING_ADDR and CEILING_BYTE) of + the base, the cursor, and the previous line. These + offsets are at least -1. */ + ptrdiff_t base = start_byte - ceiling_byte; + ptrdiff_t cursor, prev; + + for (cursor = base; 0 < cursor; cursor = prev) { - unsigned char *nl = memrchr (ceiling_addr, '\n', - cursor + 1 - ceiling_addr); + unsigned char *nl = memrchr (ceiling_addr, '\n', cursor); + prev = nl ? nl - ceiling_addr : -1; /* If we're looking for newlines, cache the fact that - the region from after the cursor to start is free of them. */ + this line's region is free of them. */ if (newline_cache) { - unsigned char *low = nl ? nl : ceiling_addr - 1; - unsigned char *lim = cursor; know_region_cache (current_buffer, newline_cache, - BYTE_TO_CHAR (low - base + start_byte), - BYTE_TO_CHAR (lim - base + start_byte)); + BYTE_TO_CHAR (ceiling_byte + prev + 1), + BYTE_TO_CHAR (ceiling_byte + cursor)); + /* know_region_cache can relocate buffer text. */ + ceiling_addr = BYTE_POS_ADDR (ceiling_byte); } if (! nl) @@ -837,25 +828,12 @@ { immediate_quit = 0; if (bytepos) - *bytepos = nl - base + start_byte; - return BYTE_TO_CHAR (nl - base + start_byte); - } - if (newline_cache) - { - ptrdiff_t offset = BYTE_POS_ADDR (start_byte - 1) - base; - - if (offset != 0) - { - cursor += offset; - base += offset; - ceiling_addr += offset; - nl += offset; - } - } - cursor = nl - 1; + *bytepos = ceiling_byte + prev + 1; + return BYTE_TO_CHAR (ceiling_byte + prev + 1); + } } - start_byte += ceiling_addr - 1 - base; + start_byte = ceiling_byte; start = BYTE_TO_CHAR (start_byte); } } ------------------------------------------------------------ revno: 115062 committer: Michael Albinus branch nick: trunk timestamp: Mon 2013-11-11 16:22:57 +0100 message: * automated/tramp-tests.el (tramp-test-temporary-file-directory): Check $TRAMP_TEST_TEMPORARY_FILE_DIRECTORY. (tramp-read-passwd): Check $TRAMP_TEST_ALLOW_PASSWORD. (tramp-test09-insert-file-contents, tramp-test10-write-region): (tramp-test26-process-file): Add tests. (tramp-test11-copy-file): Remove debug message. (tramp-test20-file-modes): Special case, if user is "root". diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-11-08 09:31:15 +0000 +++ test/ChangeLog 2013-11-11 15:22:57 +0000 @@ -1,3 +1,13 @@ +2013-11-11 Michael Albinus + + * automated/tramp-tests.el (tramp-test-temporary-file-directory): + Check $TRAMP_TEST_TEMPORARY_FILE_DIRECTORY. + (tramp-read-passwd): Check $TRAMP_TEST_ALLOW_PASSWORD. + (tramp-test09-insert-file-contents, tramp-test10-write-region): + (tramp-test26-process-file): Add tests. + (tramp-test11-copy-file): Remove debug message. + (tramp-test20-file-modes): Special case, if user is "root". + 2013-11-08 Michael Albinus * automated/file-notify-tests.el: === modified file 'test/automated/tramp-tests.el' --- test/automated/tramp-tests.el 2013-11-08 09:31:15 +0000 +++ test/automated/tramp-tests.el 2013-11-11 15:22:57 +0000 @@ -22,12 +22,14 @@ ;; The tests require a recent ert.el from Emacs 24.4. ;; Some of the tests require access to a remote host files. Set -;; `tramp-test-temporary-file-directory' to a suitable value. It must -;; NOT require an interactive password prompt, when running the tests -;; in batch mode. +;; $TRAMP_TEST_TEMPORARY_FILE_DIRECTORY to a suitable value in order +;; to overwrite the default value. If you want to skip tests +;; accessing a remote host, set this environment variable to +;; "/dev/null" or whatever is appropriate on your system. -;; If you want to skip tests accessing a remote host, set this -;; variable to `null-device'. +;; When running the tests in batch mode, it must NOT require an +;; interactive password prompt unless the environment variable +;; $TRAMP_TEST_ALLOW_PASSWORD is set. ;; A whole test run can be performed calling the command `tramp-test-all'. @@ -38,12 +40,19 @@ ;; There is no default value on w32 systems, which could work out of the box. (defconst tramp-test-temporary-file-directory - (if (eq system-type 'windows-nt) null-device "/ssh::/tmp") + (cond + ((getenv "TRAMP_TEST_TEMPORARY_FILE_DIRECTORY")) + ((eq system-type 'windows-nt) null-device) + (t (format "/ssh::%s" temporary-file-directory))) "Temporary directory for Tramp tests.") (setq tramp-verbose 0 tramp-message-show-message nil) -(when noninteractive (defalias 'tramp-read-passwd 'ignore)) + +;; Disable interactive passwords in batch mode. +(when (and noninteractive (not (getenv "TRAMP_TEST_ALLOW_PASSWORD"))) + (defalias 'tramp-read-passwd 'ignore)) + ;; This shall happen on hydra only. (when (getenv "NIX_STORE") (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) @@ -542,6 +551,14 @@ (write-region "foo" nil tmp-name) (with-temp-buffer (insert-file-contents tmp-name) + (should (string-equal (buffer-string) "foo")) + (insert-file-contents tmp-name) + (should (string-equal (buffer-string) "foofoo")) + ;; Insert partly. + (insert-file-contents tmp-name nil 1 3) + (should (string-equal (buffer-string) "oofoofoo")) + ;; Replace. + (insert-file-contents tmp-name nil nil nil 'replace) (should (string-equal (buffer-string) "foo")))) (ignore-errors (delete-file tmp-name))))) @@ -556,15 +573,33 @@ (write-region nil nil tmp-name)) (with-temp-buffer (insert-file-contents tmp-name) - (should (string-equal (buffer-string) "foo")))) - (ignore-errors (delete-file tmp-name))))) + (should (string-equal (buffer-string) "foo"))) + ;; Append. + (with-temp-buffer + (insert "bla") + (write-region nil nil tmp-name 'append)) + (with-temp-buffer + (insert-file-contents tmp-name) + (should (string-equal (buffer-string) "foobla"))) + ;; Write string. + (write-region "foo" nil tmp-name) + (with-temp-buffer + (insert-file-contents tmp-name) + (should (string-equal (buffer-string) "foo"))) + ;; Write partly. + (with-temp-buffer + (insert "123456789") + (write-region 3 5 tmp-name)) + (with-temp-buffer + (insert-file-contents tmp-name) + (should (string-equal (buffer-string) "34")))) + (ignore-errors (delete-file tmp-name))))) (ert-deftest tramp-test11-copy-file () "Check `copy-file'." (skip-unless (tramp--test-enabled)) (let ((tmp-name1 (tramp--test-make-temp-name)) (tmp-name2 (tramp--test-make-temp-name))) - (message "%s %s" tmp-name1 tmp-name2) (unwind-protect (progn (write-region "foo" nil tmp-name1) @@ -779,22 +814,22 @@ "Check `file-modes'. This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." (skip-unless (tramp--test-enabled)) - (let ((tmp-name1 (tramp--test-make-temp-name)) - (tmp-name2 (tramp--test-make-temp-name))) + (let ((tmp-name (tramp--test-make-temp-name))) (unwind-protect (progn - (write-region "foo" nil tmp-name1) - (should (file-exists-p tmp-name1)) - (set-file-modes tmp-name1 #o777) - (should (= (file-modes tmp-name1) #o777)) - (should (file-executable-p tmp-name1)) - (should (file-writable-p tmp-name1)) - (set-file-modes tmp-name1 #o444) - (should (= (file-modes tmp-name1) #o444)) - (should-not (file-executable-p tmp-name1)) - (should-not (file-writable-p tmp-name1))) - (delete-file tmp-name1) - (delete-file tmp-name2)))) + (write-region "foo" nil tmp-name) + (should (file-exists-p tmp-name)) + (set-file-modes tmp-name #o777) + (should (= (file-modes tmp-name) #o777)) + (should (file-executable-p tmp-name)) + (should (file-writable-p tmp-name)) + (set-file-modes tmp-name #o444) + (should (= (file-modes tmp-name) #o444)) + (should-not (file-executable-p tmp-name)) + ;; A file is always writable for user "root". + (unless (string-equal (file-remote-p tmp-name 'user) "root") + (should-not (file-writable-p tmp-name)))) + (delete-file tmp-name)))) (ert-deftest tramp-test21-file-links () "Check `file-symlink-p'. @@ -921,8 +956,11 @@ "Check `process-file'." (skip-unless (tramp--test-enabled)) (let ((default-directory tramp-test-temporary-file-directory)) + ;; We cannot use "/bin/true" and "/bin/false"; those paths do not + ;; exist on hydra. (should (zerop (process-file "true"))) (should-not (zerop (process-file "false"))) + (should-not (zerop (process-file "binary-does-not-exist"))) (with-temp-buffer (should (zerop (process-file "ls" nil t))) (should (> (point-max) (point-min)))))) ------------------------------------------------------------ revno: 115061 committer: Michael Albinus branch nick: trunk timestamp: Mon 2013-11-11 16:18:07 +0100 message: * net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer) (tramp-sh-handle-file-local-copy): Don't write a message when saving temporary files. * net/tramp-smb.el (tramp-smb-handle-copy-directory): Fix bug when both directories are remote. (tramp-smb-handle-directory-files): Do not return double entries. Do not expand full file names. (tramp-smb-handle-insert-directory): Accept nil SWITCHES. (tramp-smb-handle-write-region): Implement APPEND. (tramp-smb-get-stat-capability): Fix a stupid bug. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-11 05:18:53 +0000 +++ lisp/ChangeLog 2013-11-11 15:18:07 +0000 @@ -1,3 +1,17 @@ +2013-11-11 Michael Albinus + + * net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer) + (tramp-sh-handle-file-local-copy): Don't write a message when + saving temporary files. + + * net/tramp-smb.el (tramp-smb-handle-copy-directory): Fix bug when + both directories are remote. + (tramp-smb-handle-directory-files): Do not return double entries. + Do not expand full file names. + (tramp-smb-handle-insert-directory): Accept nil SWITCHES. + (tramp-smb-handle-write-region): Implement APPEND. + (tramp-smb-get-stat-capability): Fix a stupid bug. + 2013-11-11 Stefan Monnier * bindings.el (ctl-x-map): Bind C-x SPC to rectangle-mark-mode. === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2013-11-10 08:35:04 +0000 +++ lisp/net/tramp-sh.el 2013-11-11 15:18:07 +0000 @@ -2013,7 +2013,7 @@ ;; `jka-compr-inhibit' to t. (let ((coding-system-for-write 'binary) (jka-compr-inhibit t)) - (write-region (point-min) (point-max) newname))) + (write-region (point-min) (point-max) newname nil 'no-message))) ;; KEEP-DATE handling. (when keep-date (set-file-times newname (nth 5 (file-attributes filename)))) ;; Set the mode. @@ -2932,7 +2932,8 @@ ;; epa-file gets confused. (let (file-name-handler-alist (coding-system-for-write 'binary)) - (write-region (point-min) (point-max) tmpfile))) + (write-region + (point-min) (point-max) tmpfile nil 'no-message))) ;; If tramp-decoding-function is not defined for this ;; method, we invoke tramp-decoding-command instead. @@ -2942,7 +2943,8 @@ (let (file-name-handler-alist (coding-system-for-write 'binary)) (with-current-buffer (tramp-get-buffer v) - (write-region (point-min) (point-max) tmpfile2))) + (write-region + (point-min) (point-max) tmpfile2 nil 'no-message))) (unwind-protect (tramp-call-local-coding-command loc-dec tmpfile2 tmpfile) === modified file 'lisp/net/tramp-smb.el' --- lisp/net/tramp-smb.el 2013-10-28 19:30:40 +0000 +++ lisp/net/tramp-smb.el 2013-11-11 15:18:07 +0000 @@ -411,10 +411,12 @@ (tramp-compat-temporary-file-directory))))) (unwind-protect (progn - (tramp-compat-copy-directory - dirname tmpdir keep-date parents) - (tramp-compat-copy-directory - tmpdir newname keep-date parents)) + (make-directory tmpdir) + (tramp-compat-copy-directory + dirname tmpdir keep-date 'parents) + (tramp-compat-copy-directory + (expand-file-name (file-name-nondirectory dirname) tmpdir) + newname keep-date parents)) (tramp-compat-delete-directory tmpdir 'recursive)))) ;; We can copy recursively. @@ -640,7 +642,8 @@ (directory &optional full match nosort) "Like `directory-files' for Tramp files." (let ((result (mapcar 'directory-file-name - (file-name-all-completions "" directory)))) + (file-name-all-completions "" directory))) + res) ;; Discriminate with regexp. (when match (setq result @@ -651,12 +654,13 @@ (when full (setq result (mapcar - (lambda (x) (expand-file-name x directory)) + (lambda (x) (format "%s/%s" directory x)) result))) ;; Sort them if necessary. (unless nosort (setq result (sort result 'string-lessp))) - ;; That's it. - result)) + ;; Remove double entries. + (dolist (elt result res) + (add-to-list 'res elt 'append)))) (defun tramp-smb-handle-expand-file-name (name &optional dir) "Like `expand-file-name' for Tramp files." @@ -924,6 +928,7 @@ (filename switches &optional wildcard full-directory-p) "Like `insert-directory' for Tramp files." (setq filename (expand-file-name filename)) + (unless switches (setq switches "")) (if full-directory-p ;; Called from `dired-add-entry'. (setq filename (file-name-as-directory filename)) @@ -1441,9 +1446,6 @@ "Like `write-region' for Tramp files." (setq filename (expand-file-name filename)) (with-parsed-tramp-file-name filename nil - (unless (eq append nil) - (tramp-error - v 'file-error "Cannot append to file using Tramp (`%s')" filename)) ;; XEmacs takes a coding system as the seventh argument, not `confirm'. (when (and (not (featurep 'xemacs)) confirm (file-exists-p filename)) @@ -1456,6 +1458,8 @@ (tramp-flush-file-property v localname) (let ((curbuf (current-buffer)) (tmpfile (tramp-compat-make-temp-file filename))) + (when (and append (file-exists-p filename)) + (copy-file filename tmpfile 'ok)) ;; We say `no-message' here because we don't want the visited file ;; modtime data to be clobbered from the temp file. We call ;; `set-visited-file-modtime' ourselves later on. @@ -1727,7 +1731,7 @@ ;; When we are not logged in yet, we return nil. (if (and (tramp-smb-get-share vec) (let ((p (tramp-get-connection-process vec))) - p (processp p) (memq (process-status p) '(run open)))) + (and p (processp p) (memq (process-status p) '(run open))))) (with-tramp-connection-property (tramp-get-connection-process vec) "stat-capability" (tramp-smb-send-command vec "stat \"/\"")))) ------------------------------------------------------------ revno: 115060 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2013-11-11 00:18:53 -0500 message: * lisp/bindings.el (ctl-x-map): Bind C-x SPC to rectangle-mark-mode. * src/keyboard.c (command_loop_1): Use region-extract-function. * src/insdel.c (Qregion_extract_function): Not static any more (can we stop pretending that these vars can benefit from being marked static?). diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-11-11 04:50:56 +0000 +++ etc/NEWS 2013-11-11 05:18:53 +0000 @@ -189,7 +189,7 @@ * Editing Changes in Emacs 24.4 -** New command `rectangle-mark' makes a rectangular region. +** Command `rectangle-mark-mode' bound to C-x SPC makes a rectangular region. Most commands are still unaware of it, but kill/yank do work on the rectangle. ** C-x TAB enters a transient interactive mode. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-11 04:55:39 +0000 +++ lisp/ChangeLog 2013-11-11 05:18:53 +0000 @@ -1,3 +1,7 @@ +2013-11-11 Stefan Monnier + + * bindings.el (ctl-x-map): Bind C-x SPC to rectangle-mark-mode. + 2013-11-11 Nathan Trapuzzano (tiny change) * emacs-lisp/cconv.el (cconv-convert): Print warning instead of === modified file 'lisp/bindings.el' --- lisp/bindings.el 2013-08-08 00:44:22 +0000 +++ lisp/bindings.el 2013-11-11 05:18:53 +0000 @@ -891,6 +891,7 @@ (define-key ctl-x-map "\C-x" 'exchange-point-and-mark) (define-key ctl-x-map "\C-@" 'pop-global-mark) +(define-key ctl-x-map " " 'rectangle-mark-mode) (define-key ctl-x-map [?\C- ] 'pop-global-mark) (define-key global-map "\C-n" 'next-line) === modified file 'lisp/rect.el' --- lisp/rect.el 2013-11-04 20:45:36 +0000 +++ lisp/rect.el 2013-11-11 05:18:53 +0000 @@ -414,9 +414,7 @@ ;;; New rectangle integration with kill-ring. -;; FIXME: lots of known problems with the new rectangle support: -;; - no key binding for mark-rectangle. -;; - no access to the `string-rectangle' functionality. +;; FIXME: known problems with the new rectangle support: ;; - lots of commands handle the region without paying attention to its ;; rectangular shape. === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-09 21:24:10 +0000 +++ src/ChangeLog 2013-11-11 05:18:53 +0000 @@ -1,3 +1,9 @@ +2013-11-11 Stefan Monnier + + * keyboard.c (command_loop_1): Use region-extract-function. + * insdel.c (Qregion_extract_function): Not static any more (can we + stop pretending that these vars can benefit from being marked static?). + 2013-11-09 Eli Zaretskii * search.c (find_newline): If buffer text is relocated during the === modified file 'src/insdel.c' --- src/insdel.c 2013-11-06 04:11:04 +0000 +++ src/insdel.c 2013-11-11 05:18:53 +0000 @@ -1778,7 +1778,7 @@ bset_point_before_scroll (current_buffer, Qnil); } -static Lisp_Object Qregion_extract_function; +Lisp_Object Qregion_extract_function; /* Check that it is okay to modify the buffer between START and END, which are char positions. === modified file 'src/keyboard.c' --- src/keyboard.c 2013-11-06 21:17:26 +0000 +++ src/keyboard.c 2013-11-11 05:18:53 +0000 @@ -1321,6 +1321,8 @@ /* The last boundary auto-added to buffer-undo-list. */ Lisp_Object last_undo_boundary; +extern Lisp_Object Qregion_extract_function; + /* FIXME: This is wrong rather than test window-system, we should call a new set-selection, which will then dispatch to x-set-selection, or tty-set-selection, or w32-set-selection, ... */ @@ -1629,16 +1631,11 @@ && NILP (Fmemq (Vthis_command, Vselection_inhibit_update_commands))) { - ptrdiff_t beg - = XINT (Fmarker_position (BVAR (current_buffer, mark))); - ptrdiff_t end = PT; - if (beg < end) - call2 (Qx_set_selection, QPRIMARY, - make_buffer_string (beg, end, 0)); - else if (beg > end) - call2 (Qx_set_selection, QPRIMARY, - make_buffer_string (end, beg, 0)); - /* Don't set empty selections. */ + Lisp_Object txt + = call1 (Fsymbol_value (Qregion_extract_function), Qnil); + if (XINT (Flength (txt)) > 0) + /* Don't set empty selections. */ + call2 (Qx_set_selection, QPRIMARY, txt); } if (current_buffer != prev_buffer || MODIFF != prev_modiff)