merge trunk

This commit is contained in:
Kenichi Handa 2012-10-11 20:29:47 +09:00
commit d3e4228575
131 changed files with 3597 additions and 1852 deletions

View file

@ -2,6 +2,15 @@
* .bzrignore: Add several files under admin/charsets.
2012-10-08 Daniel Colascione <dancol@dancol.org>
* configure.ac: Add --with-w32 as a window system option. Limit
it to Cygwin for now. Integrate w32 into the refactored window
system configuration and set TERM_HEADER to w32term.h when w32 is
configured.
(CYGWIN_OBJ): Add cygw32.o.
2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
* configure.ac: Check that OSX is 10.4 or newer.

View file

@ -22,6 +22,11 @@
charsets/mapfiles/MULE-tibetan.map,
charsets/mapfiles/MULE-uviscii.map: Fix typo.
2012-10-09 Glenn Morris <rgm@gnu.org>
* admin.el (cusver-scan-cus-start): New function.
(cusver-check): Scan old cus-start.el.
2012-10-07 Glenn Morris <rgm@gnu.org>
* admin.el (cusver-new-version): Set default.

View file

@ -446,8 +446,6 @@ If optional OLD is non-nil, also include defvars."
(1+ emacs-minor-version))
"Version number that new defcustoms should have.")
;; TODO do something about renamed variables with aliases to the old name?
;; Scan old cus-start.el to find variables moved from C to lisp?
(defun cusver-scan (file &optional old)
"Scan FILE for `defcustom' calls.
Return a list with elements of the form (VAR . VER),
@ -486,6 +484,21 @@ If optional argument OLD is non-nil, also scan for defvars."
(message "%sdone" m)
alist))
(defun cusver-scan-cus-start (file)
"Scan cus-start.el and return an alist with elements (VAR . VER)."
(if (file-readable-p file)
(with-temp-buffer
(insert-file-contents file)
(when (search-forward "(let ((all '(" nil t)
(backward-char 1)
(let (var ver alist)
(dolist (elem (ignore-errors (read (current-buffer))))
(when (symbolp (setq var (car-safe elem)))
(or (stringp (setq ver (nth 3 elem)))
(setq ver nil))
(setq alist (cons (cons var ver) alist))))
alist)))))
(define-button-type 'cusver-xref 'action #'cusver-goto-xref)
(defun cusver-goto-xref (button)
@ -501,11 +514,9 @@ If optional argument OLD is non-nil, also scan for defvars."
(pop-to-buffer (current-buffer))))))
;; You should probably at least do a grep over the old directory
;; to check the results of this look sensible. Eg cus-start if
;; something moved from C to Lisp.
;; TODO handle renamed things with aliases to the old names.
;; What to do about new files? Does everything in there need a :version,
;; or eg just the defgroup?
;; to check the results of this look sensible.
;; TODO Check cus-start if something moved from C to Lisp.
;; TODO Handle renamed things with aliases to the old names.
(defun cusver-check (newdir olddir version)
"Check that defcustoms have :version tags where needed.
NEWDIR is the current lisp/ directory, OLDDIR is that from the previous
@ -537,6 +548,8 @@ changes (in a non-trivial way). This function does not check for that."
(message "Reading old defcustoms...")
(dolist (file oldfiles)
(setq oldcus (append oldcus (cusver-scan file t))))
(setq oldcus (append oldcus (cusver-scan-cus-start
(expand-file-name "cus-start.el" olddir))))
;; newcus has elements (FILE (VAR VER) ... ).
;; oldcus just (VAR . VER).
(message "Checking for version tags...")

View file

@ -753,6 +753,8 @@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
VERSION = @VERSION@
VMLIMIT_OBJ = @VMLIMIT_OBJ@
W32_LIBS = @W32_LIBS@
W32_OBJ = @W32_OBJ@
WARN_CFLAGS = @WARN_CFLAGS@
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
WERROR_CFLAGS = @WERROR_CFLAGS@

View file

@ -692,6 +692,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
Mac OS X. */
#undef HAVE_NS
/* Define to use native MS Windows GUI. */
#undef HAVE_NTGUI
/* Define to 1 if libotf has OTF_get_variation_glyphs. */
#undef HAVE_OTF_GET_VARIATION_GLYPHS

160
autogen/configure vendored
View file

@ -1204,6 +1204,8 @@ LIB_PTHREAD
VMLIMIT_OBJ
GMALLOC_OBJ
HAVE_XSERVER
W32_LIBS
W32_OBJ
LIB_STANDARD
NS_OBJC_OBJ
NS_OBJ
@ -1362,6 +1364,7 @@ with_toolkit_scroll_bars
with_xaw3d
with_xim
with_ns
with_w32
with_gpm
with_dbus
with_gconf
@ -2081,6 +2084,7 @@ Optional Packages:
--without-xaw3d don't use Xaw3d
--without-xim don't use X11 XIM
--with-ns use NeXTstep (Cocoa or GNUstep) windowing system
--with-w32 use native MS Windows GUI
--without-gpm don't use -lgpm for mouse support on a GNU/Linux
console
--without-dbus don't compile with D-Bus support
@ -4093,6 +4097,14 @@ else
fi
# Check whether --with-w32 was given.
if test "${with_w32+set}" = set; then :
withval=$with_w32;
else
with_w32=no
fi
# Check whether --with-gpm was given.
if test "${with_gpm+set}" = set; then :
@ -9568,6 +9580,7 @@ $as_echo "#define NS_HAVE_NSINTEGER 1" >>confdefs.h
fi
INSTALL_ARCH_INDEP_EXTRA=install-etc
ns_self_contained=no
NS_OBJ=
@ -9603,6 +9616,38 @@ CPPFLAGS="$tmp_CPPFLAGS"
HAVE_W32=no
W32_OBJ=
W32_LIBS=
if test "${with_w32}" != no; then
if test "${opsys}" != "cygwin"; then
as_fn_error "Using w32 with an autotools build is only supported for Cygwin." "$LINENO" 5
fi
ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
if test "x$ac_cv_header_windows_h" = x""yes; then :
HAVE_W32=yes
else
as_fn_error "\`--with-w32' was specified, but windows.h
cannot be found." "$LINENO" 5
fi
$as_echo "#define HAVE_NTGUI 1" >>confdefs.h
W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
fi
if test "${HAVE_W32}" = "yes"; then
window_system=w32
with_xft=no
fi
## $window_system is now set to the window system we will
## ultimately use.
@ -9635,6 +9680,9 @@ case "${window_system}" in
nextstep )
term_header=nsterm.h
;;
w32 )
term_header=w32term.h
;;
esac
if test -n "${term_header}"; then
@ -11700,6 +11748,10 @@ if test "${with_toolkit_scroll_bars}" != "no"; then
elif test "${HAVE_NS}" = "yes"; then
$as_echo "#define USE_TOOLKIT_SCROLL_BARS 1" >>confdefs.h
USE_TOOLKIT_SCROLL_BARS=yes
elif test "${HAVE_W32}" = "yes"; then
$as_echo "#define USE_TOOLKIT_SCROLL_BARS 1" >>confdefs.h
USE_TOOLKIT_SCROLL_BARS=yes
fi
fi
@ -12262,6 +12314,99 @@ fi
### Use -lXpm if available, unless `--with-xpm=no'.
HAVE_XPM=no
LIBXPM=
if test "${HAVE_W32}" = "yes"; then
if test "${with_xpm}" != "no"; then
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS -I/usr/include/noX"
LDFLAGS="$LDFLAGS -L/usr/lib/noX"
ac_fn_c_check_header_mongrel "$LINENO" "X11/xpm.h" "ac_cv_header_X11_xpm_h" "$ac_includes_default"
if test "x$ac_cv_header_X11_xpm_h" = x""yes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmReadFileToImage in -lXpm" >&5
$as_echo_n "checking for XpmReadFileToImage in -lXpm... " >&6; }
if test "${ac_cv_lib_Xpm_XpmReadFileToImage+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXpm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char XpmReadFileToImage ();
int
main ()
{
return XpmReadFileToImage ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_Xpm_XpmReadFileToImage=yes
else
ac_cv_lib_Xpm_XpmReadFileToImage=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_XpmReadFileToImage" >&5
$as_echo "$ac_cv_lib_Xpm_XpmReadFileToImage" >&6; }
if test "x$ac_cv_lib_Xpm_XpmReadFileToImage" = x""yes; then :
HAVE_XPM=yes
fi
fi
if test "${HAVE_XPM}" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmReturnAllocPixels preprocessor define" >&5
$as_echo_n "checking for XpmReturnAllocPixels preprocessor define... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "X11/xpm.h"
#ifndef XpmReturnAllocPixels
no_return_alloc_pixels
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "no_return_alloc_pixels" >/dev/null 2>&1; then :
HAVE_XPM=no
else
HAVE_XPM=yes
fi
rm -f conftest*
if test "${HAVE_XPM}" = "yes"; then
REAL_CPPFLAGS="$REAL_CPPFLAGS -I/usr/include/noX"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
CPPFLAGS="$SAVE_CPPFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
fi
fi
fi
if test "${HAVE_XPM}" = "yes"; then
$as_echo "#define HAVE_XPM 1" >>confdefs.h
LIBXPM=-lXpm
fi
fi
if test "${HAVE_X11}" = "yes"; then
if test "${with_xpm}" != "no"; then
ac_fn_c_check_header_mongrel "$LINENO" "X11/xpm.h" "ac_cv_header_X11_xpm_h" "$ac_includes_default"
@ -12348,10 +12493,11 @@ $as_echo "#define HAVE_XPM 1" >>confdefs.h
fi
### Use -ljpeg if available, unless `--with-jpeg=no'.
HAVE_JPEG=no
LIBJPEG=
if test "${HAVE_X11}" = "yes"; then
if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
if test "${with_jpeg}" != "no"; then
ac_fn_c_check_header_mongrel "$LINENO" "jerror.h" "ac_cv_header_jerror_h" "$ac_includes_default"
if test "x$ac_cv_header_jerror_h" = x""yes; then :
@ -12430,7 +12576,7 @@ fi
### Use -lpng if available, unless `--with-png=no'.
HAVE_PNG=no
LIBPNG=
if test "${HAVE_X11}" = "yes"; then
if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
if test "${with_png}" != "no"; then
# Debian unstable as of July 2003 has multiple libpngs, and puts png.h
# in /usr/include/libpng.
@ -12520,7 +12666,7 @@ fi
### Use -ltiff if available, unless `--with-tiff=no'.
HAVE_TIFF=no
LIBTIFF=
if test "${HAVE_X11}" = "yes"; then
if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
if test "${with_tiff}" != "no"; then
ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default"
if test "x$ac_cv_header_tiffio_h" = x""yes; then :
@ -12584,7 +12730,8 @@ fi
### Use -lgif or -lungif if available, unless `--with-gif=no'.
HAVE_GIF=no
LIBGIF=
if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
|| test "${HAVE_W32}" = "yes"; then
ac_fn_c_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default"
if test "x$ac_cv_header_gif_lib_h" = x""yes; then :
# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
@ -12805,6 +12952,9 @@ $as_echo "#define NS_IMPL_GNUSTEP 1" >>confdefs.h
OTHER_FILES=ns-app
fi
if test "${HAVE_W32}" = "yes"; then
HAVE_MENUS=yes
fi
### Use session management (-lSM -lICE) if available
HAVE_X_SM=no
@ -16078,7 +16228,7 @@ fi
if test "$opsys" = "cygwin"; then
CYGWIN_OBJ="sheap.o"
CYGWIN_OBJ="sheap.o cygw32.o"
## Cygwin differs because of its unexec().
PRE_ALLOC_OBJ=
POST_ALLOC_OBJ=lastfile.o

View file

@ -177,6 +177,7 @@ OPTION_DEFAULT_ON([toolkit-scroll-bars],[don't use Motif or Xaw3d scroll bars])
OPTION_DEFAULT_ON([xaw3d],[don't use Xaw3d])
OPTION_DEFAULT_ON([xim],[don't use X11 XIM])
OPTION_DEFAULT_OFF([ns],[use NeXTstep (Cocoa or GNUstep) windowing system])
OPTION_DEFAULT_OFF([w32], [use native MS Windows GUI])
OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console])
OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support])
@ -1534,6 +1535,7 @@ fail;
AC_DEFINE(NS_HAVE_NSINTEGER, 1, [Define to 1 if `NSInteger' is defined.])
fi
fi
AC_SUBST(TEMACS_LDFLAGS2)
INSTALL_ARCH_INDEP_EXTRA=install-etc
@ -1574,6 +1576,30 @@ AC_SUBST(NS_OBJ)
AC_SUBST(NS_OBJC_OBJ)
AC_SUBST(LIB_STANDARD)
HAVE_W32=no
W32_OBJ=
W32_LIBS=
if test "${with_w32}" != no; then
if test "${opsys}" != "cygwin"; then
AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.])
fi
AC_CHECK_HEADER([windows.h], [HAVE_W32=yes],
[AC_MSG_ERROR([`--with-w32' was specified, but windows.h
cannot be found.])])
AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.])
W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
fi
AC_SUBST(W32_OBJ)
AC_SUBST(W32_LIBS)
if test "${HAVE_W32}" = "yes"; then
window_system=w32
with_xft=no
fi
## $window_system is now set to the window system we will
## ultimately use.
@ -1610,6 +1636,9 @@ dnl use the toolkit if we have gtk, or X11R5 or newer.
nextstep )
term_header=nsterm.h
;;
w32 )
term_header=w32term.h
;;
esac
if test -n "${term_header}"; then
@ -2310,6 +2339,9 @@ if test "${with_toolkit_scroll_bars}" != "no"; then
elif test "${HAVE_NS}" = "yes"; then
AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
USE_TOOLKIT_SCROLL_BARS=yes
elif test "${HAVE_W32}" = "yes"; then
AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
USE_TOOLKIT_SCROLL_BARS=yes
fi
fi
@ -2476,6 +2508,41 @@ AC_SUBST(M17N_FLT_LIBS)
### Use -lXpm if available, unless `--with-xpm=no'.
HAVE_XPM=no
LIBXPM=
if test "${HAVE_W32}" = "yes"; then
if test "${with_xpm}" != "no"; then
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS -I/usr/include/noX"
LDFLAGS="$LDFLAGS -L/usr/lib/noX"
AC_CHECK_HEADER(X11/xpm.h,
[AC_CHECK_LIB(Xpm, XpmReadFileToImage, HAVE_XPM=yes)])
if test "${HAVE_XPM}" = "yes"; then
AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define)
AC_EGREP_CPP(no_return_alloc_pixels,
[#include "X11/xpm.h"
#ifndef XpmReturnAllocPixels
no_return_alloc_pixels
#endif
], HAVE_XPM=no, HAVE_XPM=yes)
if test "${HAVE_XPM}" = "yes"; then
REAL_CPPFLAGS="$REAL_CPPFLAGS -I/usr/include/noX"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
CPPFLAGS="$SAVE_CPPFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
fi
fi
fi
if test "${HAVE_XPM}" = "yes"; then
AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm libary (-lXpm).])
LIBXPM=-lXpm
fi
fi
if test "${HAVE_X11}" = "yes"; then
if test "${with_xpm}" != "no"; then
AC_CHECK_HEADER(X11/xpm.h,
@ -2502,12 +2569,13 @@ no_return_alloc_pixels
LIBXPM=-lXpm
fi
fi
AC_SUBST(LIBXPM)
### Use -ljpeg if available, unless `--with-jpeg=no'.
HAVE_JPEG=no
LIBJPEG=
if test "${HAVE_X11}" = "yes"; then
if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
if test "${with_jpeg}" != "no"; then
dnl Checking for jpeglib.h can lose because of a redefinition of
dnl HAVE_STDLIB_H.
@ -2535,7 +2603,7 @@ AC_SUBST(LIBJPEG)
### Use -lpng if available, unless `--with-png=no'.
HAVE_PNG=no
LIBPNG=
if test "${HAVE_X11}" = "yes"; then
if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
if test "${with_png}" != "no"; then
# Debian unstable as of July 2003 has multiple libpngs, and puts png.h
# in /usr/include/libpng.
@ -2568,7 +2636,7 @@ AC_SUBST(LIBPNG)
### Use -ltiff if available, unless `--with-tiff=no'.
HAVE_TIFF=no
LIBTIFF=
if test "${HAVE_X11}" = "yes"; then
if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
if test "${with_tiff}" != "no"; then
AC_CHECK_HEADER(tiffio.h,
[tifflibs="-lz -lm"
@ -2588,7 +2656,8 @@ AC_SUBST(LIBTIFF)
### Use -lgif or -lungif if available, unless `--with-gif=no'.
HAVE_GIF=no
LIBGIF=
if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
|| test "${HAVE_W32}" = "yes"; then
AC_CHECK_HEADER(gif_lib.h,
# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
# Earlier versions can crash Emacs.
@ -2670,6 +2739,9 @@ if test "${HAVE_NS}" = "yes"; then
OTHER_FILES=ns-app
fi
if test "${HAVE_W32}" = "yes"; then
HAVE_MENUS=yes
fi
### Use session management (-lSM -lICE) if available
HAVE_X_SM=no
@ -4205,7 +4277,7 @@ fi
AC_SUBST(RALLOC_OBJ)
if test "$opsys" = "cygwin"; then
CYGWIN_OBJ="sheap.o"
CYGWIN_OBJ="sheap.o cygw32.o"
## Cygwin differs because of its unexec().
PRE_ALLOC_OBJ=
POST_ALLOC_OBJ=lastfile.o

View file

@ -1,3 +1,13 @@
2012-10-10 Dani Moncayo <dmoncayo@gmail.com>
* basic.texi (Arguments): Fix typos.
2012-10-08 Glenn Morris <rgm@gnu.org>
* cal-xtra.texi (Calendar Customizing): Mention calendar-month-header.
* calendar.texi (Writing Calendar Files): Mention cal-html-holidays.
2012-10-06 Glenn Morris <rgm@gnu.org>
* calendar.texi (Writing Calendar Files): Tweak week descriptions.
@ -419,7 +429,7 @@
* misc.texi (emacsclient Options): Add cross-reference to "Windows
Startup". (Bug#11091)
2012-04-02 Dani Moncayo <dmoncayo@gmail.com> (tiny change)
2012-04-02 Dani Moncayo <dmoncayo@gmail.com>
* custom.texi (Changing a Variable): Fix example.
@ -452,7 +462,7 @@
* mule.texi (International Chars):
etc/HELLO is for character demonstration.
2012-03-15 Dani Moncayo <dmoncayo@gmail.com> (tiny change)
2012-03-15 Dani Moncayo <dmoncayo@gmail.com>
* dired.texi (Shell Commands in Dired): Fix typo.
@ -479,7 +489,7 @@
* macos.texi (Mac / GNUstep Customization): Remove text about
ns-find-file and ns-drag-file (Bug#5855, Bug#10050).
2012-02-25 Dani Moncayo <dmoncayo@gmail.com> (tiny change)
2012-02-25 Dani Moncayo <dmoncayo@gmail.com>
* buffers.texi (Select Buffer): Mention that saving in a new file
name can switch to a different major mode.

View file

@ -757,7 +757,8 @@ the character @samp{1}.
value. For example, the command @kbd{M-q} (@code{fill-paragraph})
fills text; with an argument, it justifies the text as well.
(@xref{Filling}, for more information on @kbd{M-q}.) For these
commands, it is enough to the argument with a single @kbd{C-u}.
commands, it is enough to specify the argument with a single
@kbd{C-u}.
Some commands use the value of the argument as a repeat count, but
do something special when there is no argument. For example, the
@ -776,10 +777,10 @@ described when they come up; they exist to make an individual command
more convenient, and they are documented in that command's
documentation string.
We use the term ``prefix argument'' as well as ``numeric argument'',
to emphasize that you type these argument before the command, and to
distinguish them from minibuffer arguments that come after the
command.
We use the term @dfn{prefix argument} to emphasize that you type
such arguments before the command, and to distinguish them from
minibuffer arguments (@pxref{Minibuffer}), which are entered after
invoking the command.
@node Repeating
@section Repeating a Command

View file

@ -41,6 +41,11 @@ To display text @emph{between} the months, for example week numbers,
customize the variables @code{calendar-intermonth-header} and
@code{calendar-intermonth-text} as described in their documentation.
@vindex calendar-month-header
The variable @code{calendar-month-header} controls the text that
appears above each month in the calendar. By default, it shows the
month and year.
@vindex calendar-holiday-marker
@vindex diary-entry-marker
@vindex calendar-today-marker

View file

@ -349,11 +349,12 @@ calendar deletes or iconifies that frame depending on the value of
@cindex calendar and HTML
The Calendar HTML commands produce files of HTML code that contain
calendar and diary entries. Each file applies to one month, and has a
name of the format @file{@var{yyyy}-@var{mm}.html}, where @var{yyyy} and
@var{mm} are the four-digit year and two-digit month, respectively. The
variable @code{cal-html-directory} specifies the default output
directory for the HTML files.
calendar, holiday, and diary entries. Each file applies to one month,
and has a name of the format @file{@var{yyyy}-@var{mm}.html}, where
@var{yyyy} and @var{mm} are the four-digit year and two-digit month,
respectively. The variable @code{cal-html-directory} specifies the
default output directory for the HTML files. To prevent holidays
from being shown, customize @code{cal-html-holidays}.
@vindex cal-html-css-default
Diary entries enclosed by @code{<} and @code{>} are interpreted as

View file

@ -1978,7 +1978,7 @@
* numbers.texi (Integer Basics): Add indexing for
most-positive-fixnum and most-negative-fixnum. (Bug#9525)
2011-09-14 Dani Moncayo <dmoncayo@gmail.com> (tiny change)
2011-09-14 Dani Moncayo <dmoncayo@gmail.com>
* lists.texi (Sets And Lists): Fix typo. (Bug#9393)
@ -1987,7 +1987,7 @@
* processes.texi (Network Servers): Clarify what the process
buffer is used for (bug#9233).
2011-08-30 Dani Moncayo <dmoncayo@gmail.com> (tiny change)
2011-08-30 Dani Moncayo <dmoncayo@gmail.com>
* lists.texi (Building Lists): Fix typo.

View file

@ -1,3 +1,7 @@
2012-10-09 Michael Albinus <michael.albinus@gmx.de>
* trampver.texi: Update release number.
2012-10-06 Glenn Morris <rgm@gnu.org>
* erc.texi: Include emacsver.texi, and use EMACSVER rather than

View file

@ -8,7 +8,7 @@
@c In the Tramp CVS, the version number is auto-frobbed from
@c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number.
@set trampver 2.2.6
@set trampver 2.2.7-pre
@c Other flags from configuration
@set instprefix /usr/local

View file

@ -23,18 +23,36 @@ so we will look at it and add it to the manual.
* Installation Changes in Emacs 24.3
---
** The default toolkit has been changed to Gtk+ version 3.
If you don't pass --with-x-toolkit to configure or if you pass
--with-x-toolkit=gtk or --with-x-toolkit=yes, configure will try to build
with Gtk+ version 3, and if that fails, try Gtk+ version 2.
You can explicitly require a specific version by passing
--with-x-toolkit=gtk2 or --with-x-toolkit=gtk3 to configure.
---
** New configure option '--without-all' to disable additional features.
This disables most of the features that are normally enabled by default.
---
** New configure option '--enable-link-time-optimization' to utilize
an appropriate feature provided by GCC since version 4.5.0.
---
** New configure option '--enable-gcc-warnings', intended for developers.
If building with GCC, this enables compile-time checks that warn about
possibly-questionable C code. On a recent GNU system there should be
no warnings; on older and on non-GNU systems the generated warnings
may be useful.
---
** The configuration option '--enable-use-lisp-union-type' has been
renamed to '--enable-check-lisp-object-type', as the resulting
Lisp_Object type no longer uses a union to implement the compile time
check that this option enables.
---
** The configure option '--disable-maintainer-mode' has been removed,
as it was confusingly-named and rarely useful.
@ -60,18 +78,10 @@ directories to the search path. You must add them yourself if you want them.
(from the bin and libexec directories, respectively). The former is
no longer relevant, the latter is replaced by lisp (in vc-sccs.el).
** The configuration option '--enable-use-lisp-union-type' has been
renamed to '--enable-check-lisp-object-type', as the resulting
Lisp_Object type no longer uses a union to implement the compile time
check that this option enables.
---
** The default toolkit has been changed to Gtk+ version 3.
If you don't pass --with-x-toolkit to configure or if you pass
--with-x-toolkit=gtk or --with-x-toolkit=yes, configure will try to build
with Gtk+ version 3, and if that fails, try Gtk+ version 2.
You can explicitly require a specific version by passing
--with-x-toolkit=gtk2 or --with-x-toolkit=gtk3 to configure.
** The native Windows user interface is available for Cygwin. Passing
--with-w32 will configure a Cygwin emacs to use the Windows user
interface instead of the default, X11.
* Startup Changes in Emacs 24.3
@ -160,8 +170,6 @@ On encountering a fatal error, Emacs now outputs a textual description
of the fatal signal, and a short backtrace on platforms like glibc
that support backtraces.
** `message-log-max' now defaults to 1000, not 100.
---
** If your Emacs was built from a bzr checkout, the new variable
`emacs-bzr-version' contains information about the bzr revision used.
@ -280,14 +288,16 @@ Use `Buffer-menu-name-width' and `Buffer-menu-size-width' instead.
** Calendar
+++
*** You can customize the header text that appears above each calendar month.
See the variable `calendar-month-header'.
+++
*** New LaTeX calendar style, produced by `cal-tex-cursor-week2-summary'.
+++
*** The calendars produced by cal-html include holidays.
Customize cal-html-holidays to change this.
Customize `cal-html-holidays' to change this.
** CL
@ -421,6 +431,9 @@ The option `follow-intercept-processes' has been removed.
specifying URL types which should be converted to remote file names at
the FFAP prompt. The default is now '("ftp").
** Generic-x
`javascript-generic-mode' is now an obsolete alias for `js-mode'.
** Ibuffer
*** New `derived-mode' filter, bound to `/ M'.
@ -703,7 +716,7 @@ are deprecated and will be removed eventually.
*** `compile-internal'
*** `mode-line-inverse-video'
*** `cvs-commit-buffer-require-final-newline'
(use `'log-edit-require-final-newline'instead)
(use `log-edit-require-final-newline' instead)
*** `cvs-changelog-full-paragraphs'
(use `log-edit-changelog-full-paragraphs' instead)
*** `cvs-diff-ignore-marks', `cvs-diff-buffer-name'
@ -832,7 +845,7 @@ macro-calls to be left for later expansion (as before), but will also
result in a warning ("Eager macro-expansion skipped due to cycle")
describing the cycle.
** Misc new functions:
** Miscellaneous new functions:
*** `autoloadp'
*** `autoload-do-load'.
@ -877,6 +890,11 @@ is detected.
Emacs now supports mouse highlight, help-echo (in the echo area), and
mouse-autoselect-window.
** Two new functions are available in Cygwin builds of Emacs:
cygwin-convert-path-from-windows and cygwin-convert-path-to-windows.
These functions allow Lisp code to access the Cygwin file-name mapping
machinery to convert between Cygwin and Windows-native file names.
** On MS-Windows Vista and later Emacs now supports symbolic links.
* Changes in Emacs 24.2

View file

@ -1,3 +1,20 @@
2012-10-08 Eli Zaretskii <eliz@gnu.org>
* makefile.w32-in (obj): Add cygw32.o.
2012-10-08 Daniel Colascione <dancol@dancol.org>
* emacsclient.c: Include windows.h when HAVE_NTGUI.
(alt_display): New variable. We send the display held by this
variable when the primary display is either unsupported or not
present.
(longopts): Allow display everywhere.
(w32_set_user_model_id): Move lower in file, inside HAVE_NTGUI
section.
(decode_options): Use alt_display. Explain why.
(main): Retry connection with alt_display if connection with main
display fails.
2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
* make-docfile.c (write_globals): Special-case

View file

@ -44,6 +44,10 @@ char *w32_getenv (char *);
#else /* !WINDOWSNT */
# ifdef HAVE_NTGUI
# include <windows.h>
# endif /* HAVE_NTGUI */
# include "syswait.h"
# ifdef HAVE_INET_SOCKETS
@ -140,6 +144,9 @@ int current_frame = 1;
/* The display on which Emacs should work. --display. */
const char *display = NULL;
/* The alternate display we should try if Emacs does not support display. */
const char *alt_display = NULL;
/* The parent window ID, if we are opening a frame via XEmbed. */
char *parent_id = NULL;
@ -182,9 +189,7 @@ struct option longopts[] =
{ "socket-name", required_argument, NULL, 's' },
#endif
{ "server-file", required_argument, NULL, 'f' },
#ifndef WINDOWSNT
{ "display", required_argument, NULL, 'd' },
#endif
{ "parent-id", required_argument, NULL, 'p' },
{ 0, 0, 0, 0 }
};
@ -385,32 +390,6 @@ w32_getenv (char *envvar)
return NULL;
}
void
w32_set_user_model_id (void)
{
HMODULE shell;
HRESULT (WINAPI * set_user_model) (wchar_t * id);
/* On Windows 7 and later, we need to set the user model ID
to associate emacsclient launched files with Emacs frames
in the UI. */
shell = LoadLibrary ("shell32.dll");
if (shell)
{
set_user_model
= (void *) GetProcAddress (shell,
"SetCurrentProcessExplicitAppUserModelID");
/* If the function is defined, then we are running on Windows 7
or newer, and the UI uses this to group related windows
together. Since emacs, runemacs, emacsclient are related, we
want them grouped even though the executables are different,
so we need to set a consistent ID between them. */
if (set_user_model)
set_user_model (L"GNU.Emacs");
FreeLibrary (shell);
}
}
int
w32_window_app (void)
@ -605,16 +584,29 @@ decode_options (int argc, char **argv)
Without the -c option, we used to set `display' to $DISPLAY by
default, but this changed the default behavior and is sometimes
inconvenient. So we force users to use "--display $DISPLAY" if
they want Emacs to connect to their current display. */
they want Emacs to connect to their current display.
Some window systems have a notion of default display not
reflected in the DISPLAY variable. If the user didn't give us an
explicit display, try this platform-specific after trying the
display in DISPLAY (if any). */
if (!current_frame && !tty && !display)
{
display = egetenv ("DISPLAY");
#ifdef NS_IMPL_COCOA
/* Under Cocoa, we don't really use displays the same way as in X,
so provide a dummy. */
if (!display || strlen (display) == 0)
display = "ns";
/* Set these here so we use a default_display only when the user
didn't give us an explicit display. */
#if defined (NS_IMPL_COCOA)
alt_display = "ns";
#elif defined (HAVE_NTGUI)
alt_display = "w32";
#endif
display = egetenv ("DISPLAY");
}
if (!display)
{
display = alt_display;
alt_display = NULL;
}
/* A null-string display is invalid. */
@ -1415,10 +1407,37 @@ set_socket (int no_exit_if_error)
exit (EXIT_FAILURE);
}
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */
FARPROC get_wc; /* Pointer to RealGetWindowClassA. */
void
w32_set_user_model_id (void)
{
HMODULE shell;
HRESULT (WINAPI * set_user_model) (wchar_t * id);
/* On Windows 7 and later, we need to set the user model ID
to associate emacsclient launched files with Emacs frames
in the UI. */
shell = LoadLibrary ("shell32.dll");
if (shell)
{
set_user_model
= (void *) GetProcAddress (shell,
"SetCurrentProcessExplicitAppUserModelID");
/* If the function is defined, then we are running on Windows 7
or newer, and the UI uses this to group related windows
together. Since emacs, runemacs, emacsclient are related, we
want them grouped even though the executables are different,
so we need to set a consistent ID between them. */
if (set_user_model)
set_user_model (L"GNU.Emacs");
FreeLibrary (shell);
}
}
BOOL CALLBACK
w32_find_emacs_process (HWND hWnd, LPARAM lParam)
{
@ -1467,7 +1486,7 @@ w32_give_focus (void)
&& (get_wc = GetProcAddress (user32, "RealGetWindowClassA")))
EnumWindows (w32_find_emacs_process, (LPARAM) 0);
}
#endif
#endif /* HAVE_NTGUI */
/* Start the emacs daemon and try to connect to it. */
@ -1537,11 +1556,13 @@ main (int argc, char **argv)
main_argv = argv;
progname = argv[0];
#ifdef WINDOWSNT
/* On Windows 7 and later, we need to explicitly associate emacsclient
with emacs so the UI behaves sensibly. */
#ifdef HAVE_NTGUI
/* On Windows 7 and later, we need to explicitly associate
emacsclient with emacs so the UI behaves sensibly. This
association does no harm if we're not actually connecting to an
Emacs using a window display. */
w32_set_user_model_id ();
#endif
#endif /* HAVE_NTGUI */
/* Process options. */
decode_options (argc, argv);
@ -1577,9 +1598,10 @@ main (int argc, char **argv)
fail ();
}
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
if (display && !strcmp (display, "w32"))
w32_give_focus ();
#endif
#endif /* HAVE_NTGUI */
/* Send over our environment and current directory. */
if (!current_frame)
@ -1748,46 +1770,56 @@ main (int argc, char **argv)
if (end_p != NULL)
*end_p++ = '\0';
if (strprefix ("-emacs-pid ", p))
{
/* -emacs-pid PID: The process id of the Emacs process. */
emacs_pid = strtol (p + strlen ("-emacs-pid"), NULL, 10);
}
else if (strprefix ("-window-system-unsupported ", p))
{
/* -window-system-unsupported: Emacs was compiled without X
support. Try again on the terminal. */
nowait = 0;
tty = 1;
goto retry;
}
else if (strprefix ("-print ", p))
{
/* -print STRING: Print STRING on the terminal. */
str = unquote_argument (p + strlen ("-print "));
if (needlf)
printf ("\n");
printf ("%s", str);
needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
}
else if (strprefix ("-print-nonl ", p))
{
/* -print-nonl STRING: Print STRING on the terminal.
Used to continue a preceding -print command. */
str = unquote_argument (p + strlen ("-print-nonl "));
printf ("%s", str);
needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
}
else if (strprefix ("-error ", p))
{
/* -error DESCRIPTION: Signal an error on the terminal. */
str = unquote_argument (p + strlen ("-error "));
if (needlf)
printf ("\n");
fprintf (stderr, "*ERROR*: %s", str);
needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
exit_status = EXIT_FAILURE;
}
if (strprefix ("-emacs-pid ", p))
{
/* -emacs-pid PID: The process id of the Emacs process. */
emacs_pid = strtol (p + strlen ("-emacs-pid"), NULL, 10);
}
else if (strprefix ("-window-system-unsupported ", p))
{
/* -window-system-unsupported: Emacs was compiled without support
for whatever window system we tried. Try the alternate
display, or, failing that, try the terminal. */
if (alt_display)
{
display = alt_display;
alt_display = NULL;
}
else
{
nowait = 0;
tty = 1;
}
goto retry;
}
else if (strprefix ("-print ", p))
{
/* -print STRING: Print STRING on the terminal. */
str = unquote_argument (p + strlen ("-print "));
if (needlf)
printf ("\n");
printf ("%s", str);
needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
}
else if (strprefix ("-print-nonl ", p))
{
/* -print-nonl STRING: Print STRING on the terminal.
Used to continue a preceding -print command. */
str = unquote_argument (p + strlen ("-print-nonl "));
printf ("%s", str);
needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
}
else if (strprefix ("-error ", p))
{
/* -error DESCRIPTION: Signal an error on the terminal. */
str = unquote_argument (p + strlen ("-error "));
if (needlf)
printf ("\n");
fprintf (stderr, "*ERROR*: %s", str);
needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
exit_status = EXIT_FAILURE;
}
#ifdef SIGSTOP
else if (strprefix ("-suspend ", p))
{

View file

@ -124,7 +124,7 @@ $(BLD)/profile.exe: $(PROFILEOBJS)
obj = dosfns.o msdos.o \
xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
fontset.o menu.o \
w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
w32.o w32console.o w32fns.o w32heap.o w32inevt.o cygw32.o \
w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
font.o w32font.o w32uniscribe.o \
dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \

View file

@ -2,16 +2,248 @@
* international/eucjp-ms.el: Re-generated.
2012-10-10 Kenichi Handa <handa@gnu.org>
* select.el (xselect--encode-string): If a coding is specified for
selection, and that is compatible with COMPOUND_TEXT, use it.
2012-10-10 Martin Rudalics <rudalics@gmx.at>
* window.el (switch-to-buffer-preserve-window-point): New option.
(switch-to-buffer): Obey
`switch-to-buffer-preserve-window-point' (Bug#4041).
2012-10-09 Stefan Monnier <monnier@iro.umontreal.ca>
* newcomment.el (comment-start-skip, comment-end-skip, comment-end):
Don't document nil as a useful value (bug#12583).
2012-10-09 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-debug-message):
Remove "tramp-with-progress-reporter" from regexp of ignored functions.
(with-tramp-progress-reporter): Rename from
`tramp-with-progress-reporter'.
(with-tramp-file-property, with-tramp-connection-property):
Move from tramp-cache.el, rename from `with-file-property' and
`with-connection-property', respectively.
* net/tramp-cache.el: Remove `with-file-property' and
`with-connection-property'.
* net/tramp.el:
* net/tramp-gvfs.el:
* net/tramp-sh.el:
* net/tramp-smb.el: Adapt callees.
* net/trampver.el: Update release number.
2012-10-09 Glenn Morris <rgm@gnu.org>
* w32-fns.el (set-message-beep):
* term/w32-win.el (set-message-beep): Update declarations.
2012-10-09 Stefan Monnier <monnier@iro.umontreal.ca>
* bindings.el (mode-line-toggle-read-only, mode-line-toggle-modified)
(mode-line-widen, mode-line-input-method-map)
(mode-line-coding-system-map, mode-line-remote)
(mode-line-unbury-buffer, mode-line-bury-buffer)
(mode-line-next-buffer, mode-line-previous-buffer):
Replace save-selected-window+select-window => with-selected-window.
* progmodes/cc-bytecomp.el (cc-bytecomp-defmacro): Remove, unused.
* progmodes/cc-vars.el (bq-process): Remove, unused.
* emacs-lisp/cl-macs.el (cl-defstruct): Obey the :read-only property.
2012-10-09 Fabián Ezequiel Gallina <fgallina@cuca>
Implemented `backward-up-list'-like navigation.
* progmodes/python.el (python-nav-up-list)
(python-nav-backward-up-list): New functions.
(python-mode-map): Define substitute key for backward-up-list to
python-nav-backward-up-list.
2012-10-08 Fabián Ezequiel Gallina <fgallina@cuca>
* progmodes/python.el (python-fill-paragraph): Rename from
python-fill-paragraph-function. Fixed fill-paragraph for
decorators (Bug#12605).
2012-10-08 Fabián Ezequiel Gallina <fgallina@cuca>
* progmodes/python.el (python-shell-output-filter): Handle extra
carriage return in OSX (Bug#12409).
2012-10-08 Fabián Ezequiel Gallina <fgallina@cuca>
Fix shell handling of unbalanced quotes and parens in output.
* progmodes/python.el (python-rx-constituents): Add string-delimiter.
(python-syntax-propertize-function): Use it.
(python-shell-output-syntax-table): New var.
(inferior-python-mode): Prevent unbalanced parens/quotes from
previous output mess with current input context.
2012-10-08 Juanma Barranquero <lekktu@gmail.com>
* generic-x.el (javascript-generic-mode, javascript-generic-mode-hook):
Make obsolete aliases of js-mode and js-mode-hook (from js.el).
2012-10-08 Michael Albinus <michael.albinus@gmx.de>
* ffap.el (ffap-replace-file-component): Support Tramp file name
syntax, not only ange-ftp's one.
2012-10-08 Glenn Morris <rgm@gnu.org>
* cus-start.el (message-log-max): Set :version.
* calendar/calendar.el (calendar-intermonth-header): Doc fix.
2012-10-08 Martin Rudalics <rudalics@gmx.at>
* emacs-lisp/edebug.el (edebug-pop-to-buffer): Don't try to split
the minibuffer window (Bug#10851).
2012-10-08 Fabián Ezequiel Gallina <fgallina@cuca>
Enhancements on forward-sexp movement.
* progmodes/python.el (python-nav-beginning-of-statement)
(python-nav-end-of-statement): Return point-marker.
(python-nav-forward-sexp): lisp-like forward-sexp behavior.
(python-info-current-symbol)
(python-info-statement-starts-block-p): Rename from
python-info-beginning-of-block-p.
(python-info-statement-ends-block-p): Rename from
python-info-end-of-block-p.
(python-info-beginning-of-statement-p)
(python-info-end-of-statement-p)
(python-info-beginning-of-block-p, python-info-end-of-block-p):
New functions.
2012-10-08 Stefan Monnier <monnier@iro.umontreal.ca>
* comint.el (comint-preinput-scroll-to-bottom): Preserve the
frame-selected-windows.
2012-10-08 Daniel Colascione <dancol@dancol.org>
* battery.el (battery-status-function): Check for
w32-battery-status itself, not system-time windows-nt.
* frame.el: Require cl-lib.
(display-format-alist): New variable mapping frame types to
functions that initialize them.
(window-system-for-display): New function: interprets
display-format-alist.
(make-frame-on-display): Remove existing display-selection logic
and just forward to make-frame, which will now DTRT.
(make-frame): Restructure to use window-system-for-display to
figure out how to create a frame on a given display.
(display-mouse-p): Look for frame-type w32, not a particular
system-type.
* loadup.el: Load w32 lisp code when we have the w32 feature.
* mouse.el (mouse-yank-primarY): Look for frame-type w32, not
system-type windows-nt.
* server.el (server-create-window-system-frame): Look for window
type.
(server-proces-filter): Only force a window system when windows-nt
_and_ w32. Explain why.
* simple.el (normal-erase-is-backspace-mode): Add w32 to the list
of window systems we configure for the mode.
* startup.el (command-line): Mark window system is initialized
after we've done it.
* common-win.el (x-select-text): Look for w32, not windows-nt.
* ns-win.el: Require cl-lib. Add ourselves to
display-format-alist.
(ns-initialize-window-system): Assert we're not initialized twice.
* w32-win.el: Enable lexical binding; require cl-lib; add
ourselves to display-format-alist.
(w32-handle-dropped-file): Convert incoming dropped files from
Windows paths to Cygwin ones before passing them on to the rest of
Emacs.
(w32-drag-n-drop): New paramter new-frame. Simplify logic.
(w32-initialize-window-system): Assert we're not initialized twice.
* x-win.el: Require cl-lib; add ourselves to display-format-alist.
(x-initialize-window-system): Assert we're not initialized twice.
* w32-common-fns.el: New File.
(w32-version, w32-using-nt, w32-get-clipboard-data)
(w32-set-clipboard-data, x-set-selection, x-get-selection)
(w32-charset-info-alist, x-last-selected, text)
(x-get-selection-value, x-selection-value): Move here.
* w32-fns.el: Require w32-common-fns.
(w32-version, w32-using-nt, w32-get-clipboard-data)
(w32-set-clipboard-data, x-set-selection, x-get-selection)
(w32-charset-info-alist, x-last-selected, text)
(x-get-selection-value, x-selection-value): Move to
w32-common-fns.
* w32-vars.el:
(w32-allow-system-shell, w32-system-shells): Define only in
non-cygwin case.
2012-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (read-passwd-map): Don't use `defconst' (bug#12597).
(read-passwd): Remove a few more potential sources of leaks.
2012-10-07 Fabián Ezequiel Gallina <fgallina@cuca>
* progmodes/python.el (inferior-python-mode)
(python-shell-make-comint): Fix initialization of local
variables copied from parent buffer.
2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
* term/ns-win.el (ns-read-file-name): Update declaration to match
nsfns.m.
(ns-respond-to-change-font): Change fontsize separatly so we are sure
it is set when font is acted upon.
2012-10-07 Fabián Ezequiel Gallina <fgallina@cuca>
Enhancements to indentation.
* progmodes/python.el (python-indent-context): Give priority to
inside-string context. Make comments indentation markers.
(python-indent-region): Do not mess with strings, unless it's the
enclosing set of quotes.
2012-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
* window.el (internal--before-save-selected-window)
(internal--after-save-selected-window): New functions extracted from
save-selected-window. Make sure we return the `alist' we construct.
(save-selected-window): Use them.
* textmodes/tex-mode.el (tex-recenter-output-buffer):
Use with-selected-window.
* emacs-lisp/autoload.el (make-autoload): Add `cl-defmacro' to the
forms that define macros (bug#12593).
2012-10-07 Kenichi Handa <handa@gnu.org>
* international/mule-conf.el (compound-text-with-extensions): Add
:mime-charset property as x-ctext.
* international/mule-conf.el (compound-text-with-extensions):
Add :mime-charset property as x-ctext.
2012-10-07 Stefan Merten <smerten@oekonux.de>
* textmodes/rst.el (rst-new-adornment-down, rst-indent-field)
(rst-indent-literal-normal, rst-indent-literal-minimized)
(rst-indent-comment): Correct :version tag.
(rst-official-cvs-rev): Correct version string.
2012-10-07 Glenn Morris <rgm@gnu.org>

View file

@ -60,7 +60,7 @@
(> (buffer-size) 0)))
(error nil)))
'battery-pmset)
((eq system-type 'windows-nt)
((fboundp 'w32-battery-status)
'w32-battery-status))
"Function for getting battery status information.
The function has to return an alist of conversion definitions.

View file

@ -38,23 +38,20 @@ corresponding to the mode line clicked."
(defun mode-line-toggle-read-only (event)
"Like `toggle-read-only', for the mode-line."
(interactive "e")
(save-selected-window
(select-window (posn-window (event-start event)))
(with-selected-window (posn-window (event-start event))
(read-only-mode 'toggle)))
(defun mode-line-toggle-modified (event)
"Toggle the buffer-modified flag from the mode-line."
(interactive "e")
(save-selected-window
(select-window (posn-window (event-start event)))
(with-selected-window (posn-window (event-start event))
(set-buffer-modified-p (not (buffer-modified-p)))
(force-mode-line-update)))
(defun mode-line-widen (event)
"Widen a buffer from the mode-line."
(interactive "e")
(save-selected-window
(select-window (posn-window (event-start event)))
(with-selected-window (posn-window (event-start event))
(widen)
(force-mode-line-update)))
@ -63,17 +60,13 @@ corresponding to the mode line clicked."
(define-key map [mode-line mouse-2]
(lambda (e)
(interactive "e")
(save-selected-window
(select-window
(posn-window (event-start e)))
(with-selected-window (posn-window (event-start e))
(toggle-input-method)
(force-mode-line-update))))
(define-key map [mode-line mouse-3]
(lambda (e)
(interactive "e")
(save-selected-window
(select-window
(posn-window (event-start e)))
(with-selected-window (posn-window (event-start e))
(describe-current-input-method))))
(purecopy map)))
@ -82,16 +75,14 @@ corresponding to the mode line clicked."
(define-key map [mode-line mouse-1]
(lambda (e)
(interactive "e")
(save-selected-window
(select-window (posn-window (event-start e)))
(with-selected-window (posn-window (event-start e))
(when (and enable-multibyte-characters
buffer-file-coding-system)
(describe-coding-system buffer-file-coding-system)))))
(define-key map [mode-line mouse-3]
(lambda (e)
(interactive "e")
(save-selected-window
(select-window (posn-window (event-start e)))
(with-selected-window (posn-window (event-start e))
(call-interactively 'set-buffer-file-coding-system))))
(purecopy map))
"Local keymap for the coding-system part of the mode line.")
@ -237,8 +228,7 @@ mnemonics of the following coding systems:
'mouse-face 'mode-line-highlight
'help-echo (purecopy (lambda (window _object _point)
(format "%s"
(save-selected-window
(select-window window)
(with-selected-window window
(concat
(if (file-remote-p default-directory)
"Current directory is remote: "
@ -474,15 +464,13 @@ By default, this shows the information specified by
(defun mode-line-unbury-buffer (event) "\
Call `unbury-buffer' in this window."
(interactive "e")
(save-selected-window
(select-window (posn-window (event-start event)))
(with-selected-window (posn-window (event-start event))
(unbury-buffer)))
(defun mode-line-bury-buffer (event) "\
Like `bury-buffer', but temporarily select EVENT's window."
(interactive "e")
(save-selected-window
(select-window (posn-window (event-start event)))
(with-selected-window (posn-window (event-start event))
(bury-buffer)))
(defun mode-line-other-buffer () "\
@ -493,15 +481,13 @@ Switch to the most recently selected buffer other than the current one."
(defun mode-line-next-buffer (event)
"Like `next-buffer', but temporarily select EVENT's window."
(interactive "e")
(save-selected-window
(select-window (posn-window (event-start event)))
(with-selected-window (posn-window (event-start event))
(next-buffer)))
(defun mode-line-previous-buffer (event)
"Like `previous-buffer', but temporarily select EVENT's window."
(interactive "e")
(save-selected-window
(select-window (posn-window (event-start event)))
(with-selected-window (posn-window (event-start event))
(previous-buffer)))
(defmacro bound-and-true-p (var)

View file

@ -511,7 +511,7 @@ Must be at least one less than `calendar-column-width'."
:version "23.1")
(defcustom calendar-intermonth-header nil
"Header text display in the space to the left of each calendar month.
"Header text to display in the space to the left of each calendar month.
See `calendar-intermonth-text'."
:group 'calendar
:initialize 'custom-initialize-default

View file

@ -1,3 +1,22 @@
2012-10-08 David Engster <deng@randomsample.de>>
* semantic/bovine/el.el: Add `semantic-default-elisp-setup' to
`emacs-lisp-mode-hook'. This was accidentally removed during the
CEDET update (2012-10-01T18:10:29Z!cyd@gnu.org).
2012-10-07 David Engster <deng@randomsample.de>
* semantic/wisent/python.el (semantic-ctxt-current-function)
(semantic-ctxt-current-assignment): New overrides, simply
returning nil. The defaults do not work correctly and can send
the parser in an infinite loop (bug#12458).
* semantic/ede-grammar.el (project-compile-target): Fix grammar
compilation after introduction of %provide statement.
* semantic.el (semantic-new-buffer-setup-functions): Remove setup
function for `f90-mode', since the parser only exists upstream.
2012-10-06 Glenn Morris <rgm@gnu.org>
* semantic/complete.el (semantic-displayor-tooltip-max-tags): Doc fix.

View file

@ -273,7 +273,6 @@ setup to use Semantic."
(js-mode . wisent-javascript-setup-parser)
(python-mode . wisent-python-default-setup)
(scheme-mode . semantic-default-scheme-setup)
(f90-mode . semantic-default-f90-setup)
(srecode-template-mode . srecode-template-setup-parser)
(texinfo-mode . semantic-default-texi-setup)
(makefile-automake-mode . semantic-default-make-setup)

View file

@ -944,6 +944,8 @@ ELisp variables can be pretty long, so track this one too.")
"Setup hook function for Emacs Lisp files and Semantic."
)
(add-hook 'emacs-lisp-mode-hook 'semantic-default-elisp-setup)
;;; LISP MODE
;;
;; @TODO: Lisp supports syntaxes that Emacs Lisp does not.

View file

@ -143,12 +143,10 @@ Lays claim to all -by.el, and -wy.el files."
(utd 0))
(mapc (lambda (src)
(with-current-buffer (find-file-noselect src)
(save-excursion
(semantic-grammar-create-package))
;; After compile, the current buffer is the compiled grammar.
;; Save and compile it.
(save-buffer)
(let* ((src (buffer-file-name))
(let* ((package (semantic-grammar-create-package))
(fname (progn (string-match ".*/\\(.+\\.el\\)" package)
(match-string 1 package)))
(src (with-current-buffer fname (buffer-file-name)))
(csrc (concat (file-name-sans-extension src) ".elc")))
(if (< emacs-major-version 24)
;; Does not have `byte-recompile-file'

View file

@ -478,6 +478,22 @@ To be implemented for Python! For now just return nil."
(let ((name (semantic-tag-name tag)))
(concat (mapconcat 'identity (split-string name "\\.") "/") ".py")))
;; Override ctxt-current-function/assignment defaults, since they do
;; not work properly with Python code, even leading to endless loops
;; (see bug #xxxxx).
(define-mode-local-override semantic-ctxt-current-function python-mode (&optional point)
"Return the current function call the cursor is in at POINT.
The function returned is the one accepting the arguments that
the cursor is currently in. It will not return function symbol if the
cursor is on the text representing that function."
nil)
(define-mode-local-override semantic-ctxt-current-assignment python-mode (&optional point)
"Return the current assignment near the cursor at POINT.
Return a list as per `semantic-ctxt-current-symbol'.
Return nil if there is nothing relevant."
nil)
;;; Enable Semantic in `python-mode'.
;;

View file

@ -2088,8 +2088,7 @@ This function should be a pre-command hook."
(if (and comint-scroll-to-bottom-on-input
(memq this-command '(self-insert-command comint-magic-space yank
hilit-yank)))
(let* ((selected (selected-window))
(current (current-buffer))
(let* ((current (current-buffer))
(process (get-buffer-process current))
(scroll comint-scroll-to-bottom-on-input))
(if (and process (< (point) (process-mark process)))
@ -2099,10 +2098,8 @@ This function should be a pre-command hook."
(lambda (window)
(if (and (eq (window-buffer window) current)
(or (eq scroll t) (eq scroll 'all)))
(progn
(select-window window)
(goto-char (point-max))
(select-window selected))))
(with-selected-window window
(goto-char (point-max)))))
nil t))))))
(defvar follow-mode)
@ -2783,11 +2780,8 @@ the load or compile."
(if (and buff
(buffer-modified-p buff)
(y-or-n-p (format "Save buffer %s first? " (buffer-name buff))))
;; save BUFF.
(let ((old-buffer (current-buffer)))
(set-buffer buff)
(save-buffer)
(set-buffer old-buffer)))))
(with-current-buffer buff
(save-buffer)))))
(defun comint-extract-string ()
"Return string around point, or nil."

View file

@ -452,7 +452,8 @@ since it could result in memory overflow and make Emacs crash."
(message-log-max debug (choice (const :tag "Disable" nil)
(integer :menu-tag "lines"
:format "%v")
(other :tag "Unlimited" t)))
(other :tag "Unlimited" t))
"24.3")
(unibyte-display-via-language-environment mule boolean)
(blink-cursor-alist cursor alist "22.1")
(overline-margin display integer "22.1")

View file

@ -153,7 +153,7 @@ expression, in which case we want to handle forms differently."
easy-mmode-define-minor-mode define-minor-mode
cl-defun defun* cl-defmacro defmacro*
define-overloadable-function))
(let* ((macrop (memq car '(defmacro defmacro*)))
(let* ((macrop (memq car '(defmacro cl-defmacro defmacro*)))
(name (nth 1 form))
(args (pcase car
((or `defun `defmacro

View file

@ -260,7 +260,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value.
;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when
;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp
;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*)
;;;;;; "cl-macs" "cl-macs.el" "6951d080daefb5194b1d21fe9b2deae4")
;;;;;; "cl-macs" "cl-macs.el" "885919e79dbcd11081cfb2e039b470c7")
;;; Generated autoloads from cl-macs.el
(autoload 'cl--compiler-macro-list* "cl-macs" "\

View file

@ -2324,26 +2324,29 @@ value, that slot cannot be set via `setf'.
(if (= pos 0) '(car cl-x)
`(nth ,pos cl-x)))) forms)
(push (cons accessor t) side-eff)
;; Don't bother defining a setf-expander, since gv-get can use
;; the compiler macro to get the same result.
;;(push `(gv-define-setter ,accessor (cl-val cl-x)
;; ,(if (cadr (memq :read-only (cddr desc)))
;; `(progn (ignore cl-x cl-val)
;; (error "%s is a read-only slot"
;; ',accessor))
;; ;; If cl is loaded only for compilation,
;; ;; the call to cl--struct-setf-expander would
;; ;; cause a warning because it may not be
;; ;; defined at run time. Suppress that warning.
;; `(progn
;; (declare-function
;; cl--struct-setf-expander "cl-macs"
;; (x name accessor pred-form pos))
;; (cl--struct-setf-expander
;; cl-val cl-x ',name ',accessor
;; ,(and pred-check `',pred-check)
;; ,pos))))
;; forms)
(if (cadr (memq :read-only (cddr desc)))
(push `(gv-define-expander ,accessor
(lambda (_cl-do _cl-x)
(error "%s is a read-only slot" ',accessor)))
forms)
;; For normal slots, we don't need to define a setf-expander,
;; since gv-get can use the compiler macro to get the
;; same result.
;; (push `(gv-define-setter ,accessor (cl-val cl-x)
;; ;; If cl is loaded only for compilation,
;; ;; the call to cl--struct-setf-expander would
;; ;; cause a warning because it may not be
;; ;; defined at run time. Suppress that warning.
;; (progn
;; (declare-function
;; cl--struct-setf-expander "cl-macs"
;; (x name accessor pred-form pos))
;; (cl--struct-setf-expander
;; cl-val cl-x ',name ',accessor
;; ,(and pred-check `',pred-check)
;; ,pos)))
;; forms)
)
(if print-auto
(nconc print-func
(list `(princ ,(format " %s" slot) cl-s)

View file

@ -371,7 +371,7 @@ Return the result of the last expression in BODY."
((get-buffer-window buffer 0))
((one-window-p 'nomini)
;; When there's one window only, split it.
(split-window))
(split-window (minibuffer-selected-window)))
((let ((trace-window (get-buffer-window edebug-trace-buffer)))
(catch 'found
(dolist (elt (window-list nil 'nomini))
@ -382,7 +382,7 @@ Return the result of the last expression in BODY."
(throw 'found elt))))))
;; All windows are dedicated or show `edebug-trace-buffer', split
;; selected one.
(t (split-window))))
(t (split-window (minibuffer-selected-window)))))
(set-window-buffer window buffer)
(select-window window)
(set-window-hscroll window 0)) ;; should this be??

View file

@ -96,7 +96,7 @@ ALTERNATIVE2 etc."
;; This is defined originally in xfaces.c.
(defcustom face-font-registry-alternatives
(mapcar (lambda (arg) (mapcar 'purecopy arg))
(if (eq system-type 'windows-nt)
(if (featurep 'w32)
'(("iso8859-1" "ms-oemlatin")
("gb2312.1980" "gb2312" "gbk" "gb18030")
("jisx0208.1990" "jisx0208.1983" "jisx0208.1978")

View file

@ -482,18 +482,12 @@ Returned values:
(defun ffap-replace-file-component (fullname name)
"In remote FULLNAME, replace path with NAME. May return nil."
;; Use ange-ftp or efs if loaded, but do not load them otherwise.
(let (found)
(mapc
(function (lambda (sym) (and (fboundp sym) (setq found sym))))
'(
efs-replace-path-component
ange-ftp-replace-path-component
ange-ftp-replace-name-component
))
(and found
(fset 'ffap-replace-file-component found)
(funcall found fullname name))))
;; Use efs if loaded, but do not load it otherwise.
(if (fboundp 'efs-replace-path-component)
(funcall efs-replace-path-component fullname name)
(and (stringp fullname)
(stringp name)
(concat (file-remote-p fullname) name))))
;; (ffap-replace-file-component "/who@foo.com:/whatever" "/new")
(defun ffap-file-suffix (file)

View file

@ -25,6 +25,8 @@
;;; Commentary:
;;; Code:
(eval-when-compile (require 'cl-lib))
(defvar frame-creation-function-alist
(list (cons nil
(if (fboundp 'tty-create-frame-with-faces)
@ -45,6 +47,12 @@ Then, for frames on WINDOW-SYSTEM, any parameters specified in
ALIST supersede the corresponding parameters specified in
`default-frame-alist'.")
(defvar display-format-alist nil
"Alist of patterns to decode display names.
The car of each entry is a regular expression matching a display
name string. The cdr is a symbol giving the window-system that
handles the corresponding kind of display.")
;; The initial value given here used to ask for a minibuffer.
;; But that's not necessary, because the default is to have one.
;; By not specifying it here, we let an X resource specify it.
@ -510,31 +518,19 @@ is not considered (see `next-frame')."
0))
(select-frame-set-input-focus (selected-frame)))
(declare-function x-initialize-window-system "term/x-win" ())
(declare-function ns-initialize-window-system "term/ns-win" ())
(defvar x-display-name) ; term/x-win
(defun window-system-for-display (display)
"Return the window system for DISPLAY.
Return nil if we don't know how to interpret DISPLAY."
(cl-loop for descriptor in display-format-alist
for pattern = (car descriptor)
for system = (cdr descriptor)
when (string-match-p pattern display) return system))
(defun make-frame-on-display (display &optional parameters)
"Make a frame on display DISPLAY.
The optional argument PARAMETERS specifies additional frame parameters."
(interactive "sMake frame on display: ")
(cond ((featurep 'ns)
(when (and (boundp 'ns-initialized) (not ns-initialized))
(setq x-display-name display)
(ns-initialize-window-system))
(make-frame `((window-system . ns)
(display . ,display) . ,parameters)))
((eq system-type 'windows-nt)
;; On Windows, ignore DISPLAY.
(make-frame parameters))
(t
(unless (string-match-p "\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" display)
(error "Invalid display, not HOST:SERVER or HOST:SERVER.SCREEN"))
(when (and (boundp 'x-initialized) (not x-initialized))
(setq x-display-name display)
(x-initialize-window-system))
(make-frame `((window-system . x)
(display . ,display) . ,parameters)))))
(make-frame (cons (cons 'display display) parameters)))
(declare-function x-close-connection "xfns.c" (terminal))
@ -616,6 +612,8 @@ neither or both.
(window-system . nil) The frame should be displayed on a terminal device.
(window-system . x) The frame should be displayed in an X window.
(display . \":0\") The frame should appear on display :0.
(terminal . TERMINAL) The frame should use the terminal object TERMINAL.
In addition, any parameter specified in `default-frame-alist',
@ -626,11 +624,15 @@ this function runs the hook `before-make-frame-hook'. After
creating the frame, it runs the hook `after-make-frame-functions'
with one arg, the newly created frame.
If a display parameter is supplied and a window-system is not,
guess the window-system from the display.
On graphical displays, this function does not itself make the new
frame the selected frame. However, the window system may select
the new frame according to its own rules."
(interactive)
(let* ((w (cond
(let* ((display (cdr (assq 'display parameters)))
(w (cond
((assq 'terminal parameters)
(let ((type (terminal-live-p (cdr (assq 'terminal parameters)))))
(cond
@ -640,6 +642,10 @@ the new frame according to its own rules."
(t type))))
((assq 'window-system parameters)
(cdr (assq 'window-system parameters)))
(display
(or (window-system-for-display display)
(error "Don't know how to interpret display \"%S\""
display)))
(t window-system)))
(frame-creation-function (cdr (assq w frame-creation-function-alist)))
(oldframe (selected-frame))
@ -647,6 +653,11 @@ the new frame according to its own rules."
frame)
(unless frame-creation-function
(error "Don't know how to create a frame on window system %s" w))
(unless (get w 'window-system-initialized)
(funcall (cdr (assq w window-system-initialization-alist)))
(put w 'window-system-initialized t))
;; Add parameters from `window-system-default-frame-alist'.
(dolist (p (cdr (assq w window-system-default-frame-alist)))
(unless (assq (car p) params)
@ -1260,7 +1271,7 @@ frame's display)."
(cond
((eq frame-type 'pc)
(msdos-mouse-p))
((eq system-type 'windows-nt)
((eq frame-type 'w32)
(with-no-warnings
(> w32-num-mouse-buttons 0)))
((memq frame-type '(x ns))

View file

@ -646,83 +646,10 @@ like an INI file. You can add this hook to `find-file-hook'."
"Generic mode for Sys V pkginfo files."))
;; Javascript mode
;; Includes extra keywords from Armando Singer [asinger@MAIL.COLGATE.EDU]
;; Obsolete; defer to js-mode from js.el.
(when (memq 'javascript-generic-mode generic-extras-enable-list)
(define-generic-mode javascript-generic-mode
'("//" ("/*" . "*/"))
'("break"
"case"
"continue"
"default"
"delete"
"do"
"else"
"export"
"for"
"function"
"if"
"import"
"in"
"new"
"return"
"switch"
"this"
"typeof"
"var"
"void"
"while"
"with"
;; words reserved for ECMA extensions below
"catch"
"class"
"const"
"debugger"
"enum"
"extends"
"finally"
"super"
"throw"
"try"
;; Java Keywords reserved by JavaScript
"abstract"
"boolean"
"byte"
"char"
"double"
"false"
"final"
"float"
"goto"
"implements"
"instanceof"
"int"
"interface"
"long"
"native"
"null"
"package"
"private"
"protected"
"public"
"short"
"static"
"synchronized"
"throws"
"transient"
"true")
'(("^\\s-*function\\s-+\\([A-Za-z0-9_]+\\)"
(1 font-lock-function-name-face))
("^\\s-*var\\s-+\\([A-Za-z0-9_]+\\)"
(1 font-lock-variable-name-face)))
'("\\.js\\'")
(list
(function
(lambda ()
(setq imenu-generic-expression
'((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)
("*Variables*" "^var\\s-+\\([A-Za-z0-9_]+\\)" 1))))))
"Generic mode for JavaScript files."))
(define-obsolete-function-alias 'javascript-generic-mode 'js-mode "24.3")
(define-obsolete-variable-alias 'javascript-generic-mode-hook 'js-mode-hook "24.3"))
;; VRML files
(when (memq 'vrml-generic-mode generic-extras-enable-list)

View file

@ -1,3 +1,8 @@
2012-10-09 Lars Magne Ingebrigtsen <larsi@gnus.org>
* shr.el (shr-insert): \r is also not inserted, so don't try to delete
it.
2012-10-06 Glenn Morris <rgm@gnu.org>
* gnus-notifications.el (gnus-notifications):

View file

@ -391,7 +391,7 @@ size, and full-buffer size."
(shr-indent))
(end-of-line))
(insert " ")))
(unless (string-match "[ \t\n ]\\'" text)
(unless (string-match "[ \t\r\n ]\\'" text)
(delete-char -1)))))
(defun shr-find-fill-point ()

View file

@ -2670,7 +2670,8 @@ See also `locale-charset-language-names', `locale-language-names',
;; On Windows, override locale-coding-system,
;; default-file-name-coding-system, keyboard-coding-system,
;; terminal-coding-system with system codepage.
(when (boundp 'w32-ansi-code-page)
(when (and (eq system-type 'windows-nt)
(boundp 'w32-ansi-code-page))
(let ((code-page-coding (intern (format "cp%d" w32-ansi-code-page))))
(when (coding-system-p code-page-coding)
(unless frame (setq locale-coding-system code-page-coding))

View file

@ -237,15 +237,18 @@
(load "term/common-win")
(load "term/x-win")))
(if (eq system-type 'windows-nt)
(if (or (eq system-type 'windows-nt)
(featurep 'w32))
(progn
(load "w32-vars")
(load "term/common-win")
(load "w32-vars")
(load "term/w32-win")
(load "ls-lisp")
(load "disp-table")
(load "dos-w32")
(load "w32-fns")))
(load "w32-common-fns")
(when (eq system-type 'windows-nt)
(load "w32-fns")
(load "ls-lisp")
(load "dos-w32"))))
(if (eq system-type 'ms-dos)
(progn
(load "dos-w32")

View file

@ -1151,7 +1151,7 @@ regardless of where you click."
(or mouse-yank-at-point (mouse-set-point click))
(let ((primary
(cond
((eq system-type 'windows-nt)
((eq (framep (selected-frame)) 'w32)
;; MS-Windows emulates PRIMARY in x-get-selection, but not
;; in x-get-selection-value (the latter only accesses the
;; clipboard). So try PRIMARY first, in case they selected

View file

@ -138,27 +138,6 @@ Returns VALUE."
(set var (1+ val))))
value))
;;;###tramp-autoload
(defmacro with-file-property (vec file property &rest body)
"Check in Tramp cache for PROPERTY, otherwise execute BODY and set cache.
FILE must be a local file name on a connection identified via VEC."
`(if (file-name-absolute-p ,file)
(let ((value (tramp-get-file-property ,vec ,file ,property 'undef)))
(when (eq value 'undef)
;; We cannot pass @body as parameter to
;; `tramp-set-file-property' because it mangles our
;; debug messages.
(setq value (progn ,@body))
(tramp-set-file-property ,vec ,file ,property value))
value)
,@body))
;;;###tramp-autoload
(put 'with-file-property 'lisp-indent-function 3)
(put 'with-file-property 'edebug-form-spec t)
(tramp-compat-font-lock-add-keywords
'emacs-lisp-mode '("\\<with-file-property\\>"))
;;;###tramp-autoload
(defun tramp-flush-file-property (vec file)
"Remove all properties of FILE in the cache context of VEC."
@ -249,24 +228,6 @@ PROPERTY is set persistent when KEY is a vector."
(tramp-message key 7 "%s %s" property value)
value))
;;;###tramp-autoload
(defmacro with-connection-property (key property &rest body)
"Check in Tramp for property PROPERTY, otherwise executes BODY and set."
`(let ((value (tramp-get-connection-property ,key ,property 'undef)))
(when (eq value 'undef)
;; We cannot pass ,@body as parameter to
;; `tramp-set-connection-property' because it mangles our debug
;; messages.
(setq value (progn ,@body))
(tramp-set-connection-property ,key ,property value))
value))
;;;###tramp-autoload
(put 'with-connection-property 'lisp-indent-function 2)
(put 'with-connection-property 'edebug-form-spec t)
(tramp-compat-font-lock-add-keywords
'emacs-lisp-mode '("\\<with-connection-property\\>"))
;;;###tramp-autoload
(defun tramp-flush-connection-property (key)
"Remove all properties identified by KEY.

View file

@ -537,7 +537,7 @@ is no information where to trace the message.")
"Like `copy-file' for Tramp files."
(with-parsed-tramp-file-name
(if (tramp-tramp-file-p filename) filename newname) nil
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 0 (format "Copying %s to %s" filename newname)
(condition-case err
(let ((args
@ -741,7 +741,7 @@ is no information where to trace the message.")
"Like `rename-file' for Tramp files."
(with-parsed-tramp-file-name
(if (tramp-tramp-file-p filename) filename newname) nil
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 0 (format "Renaming %s to %s" filename newname)
(condition-case err
(rename-file
@ -1056,7 +1056,7 @@ ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or \"[xx:xx:xx:xx:xx:xx]\"."
(catch 'mounted
(dolist
(elt
(with-file-property vec "/" "list-mounts"
(with-tramp-file-property vec "/" "list-mounts"
(with-tramp-dbus-call-method vec t
:session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "listMounts"))
@ -1199,7 +1199,7 @@ connection if a previous connection has died for some reason."
(tramp-gvfs-object-path
(tramp-make-tramp-file-name method user host ""))))
(tramp-with-progress-reporter
(with-tramp-progress-reporter
vec 3
(if (zerop (length user))
(format "Opening connection for %s using %s" host method)

View file

@ -1058,7 +1058,7 @@ target of the symlink differ."
"Like `file-truename' for Tramp files."
(with-parsed-tramp-file-name (expand-file-name filename) nil
(tramp-make-tramp-file-name method user host
(with-file-property v localname "file-truename"
(with-tramp-file-property v localname "file-truename"
(let ((result nil)) ; result steps in reverse order
(tramp-message v 4 "Finding true name for `%s'" filename)
(cond
@ -1167,7 +1167,7 @@ target of the symlink differ."
(defun tramp-sh-handle-file-exists-p (filename)
"Like `file-exists-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
(with-file-property v localname "file-exists-p"
(with-tramp-file-property v localname "file-exists-p"
(or (not (null (tramp-get-file-property
v localname "file-attributes-integer" nil)))
(not (null (tramp-get-file-property
@ -1185,7 +1185,8 @@ target of the symlink differ."
;; Don't modify `last-coding-system-used' by accident.
(let ((last-coding-system-used last-coding-system-used))
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-file-property v localname (format "file-attributes-%s" id-format)
(with-tramp-file-property
v localname (format "file-attributes-%s" id-format)
(save-excursion
(tramp-convert-file-attributes
v
@ -1481,7 +1482,8 @@ and gid of the corresponding user is taken. Both parameters must be integers."
(defun tramp-remote-selinux-p (vec)
"Check, whether SELINUX is enabled on the remote host."
(with-connection-property (tramp-get-connection-process vec) "selinux-p"
(with-tramp-connection-property
(tramp-get-connection-process vec) "selinux-p"
(let ((result (tramp-find-executable
vec "getenforce" (tramp-get-remote-path vec) t t)))
(and result
@ -1493,7 +1495,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
(defun tramp-sh-handle-file-selinux-context (filename)
"Like `file-selinux-context' for Tramp files."
(with-parsed-tramp-file-name filename nil
(with-file-property v localname "file-selinux-context"
(with-tramp-file-property v localname "file-selinux-context"
(let ((context '(nil nil nil nil))
(regexp (concat "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\):"
"\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\)")))
@ -1537,7 +1539,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
(defun tramp-sh-handle-file-executable-p (filename)
"Like `file-executable-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
(with-file-property v localname "file-executable-p"
(with-tramp-file-property v localname "file-executable-p"
;; Examine `file-attributes' cache to see if request can be
;; satisfied without remote operation.
(or (tramp-check-cached-permissions v ?x)
@ -1546,7 +1548,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
(defun tramp-sh-handle-file-readable-p (filename)
"Like `file-readable-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
(with-file-property v localname "file-readable-p"
(with-tramp-file-property v localname "file-readable-p"
;; Examine `file-attributes' cache to see if request can be
;; satisfied without remote operation.
(or (tramp-check-cached-permissions v ?r)
@ -1600,13 +1602,13 @@ and gid of the corresponding user is taken. Both parameters must be integers."
;; desirable to return t immediately for "/method:foo:". It can
;; be expected that this is always a directory.
(or (zerop (length localname))
(with-file-property v localname "file-directory-p"
(with-tramp-file-property v localname "file-directory-p"
(tramp-run-test "-d" filename)))))
(defun tramp-sh-handle-file-writable-p (filename)
"Like `file-writable-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
(with-file-property v localname "file-writable-p"
(with-tramp-file-property v localname "file-writable-p"
(if (file-exists-p filename)
;; Examine `file-attributes' cache to see if request can be
;; satisfied without remote operation.
@ -1619,7 +1621,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
(defun tramp-sh-handle-file-ownership-preserved-p (filename)
"Like `file-ownership-preserved-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
(with-file-property v localname "file-ownership-preserved-p"
(with-tramp-file-property v localname "file-ownership-preserved-p"
(let ((attributes (file-attributes filename)))
;; Return t if the file doesn't exist, since it's true that no
;; information would be lost by an (attempted) delete and create.
@ -1637,7 +1639,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
(let* ((temp
(copy-tree
(with-parsed-tramp-file-name directory nil
(with-file-property
(with-tramp-file-property
v localname
(format "directory-files-and-attributes-%s" id-format)
(save-excursion
@ -1987,7 +1989,7 @@ file names."
(tramp-error
v 'file-already-exists "File %s already exists" newname))
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 0 (format "%s %s to %s"
(if (eq op 'copy) "Copying" "Renaming")
filename newname)
@ -2505,7 +2507,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
nil)
((and suffix (nth 2 suffix))
;; We found an uncompression rule.
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 0 (format "Uncompressing %s" file)
(when (tramp-send-command-and-check
v (concat (nth 2 suffix) " "
@ -2517,7 +2519,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
(t
;; We don't recognize the file as compressed, so compress it.
;; Try gzip.
(tramp-with-progress-reporter v 0 (format "Compressing %s" file)
(with-tramp-progress-reporter v 0 (format "Compressing %s" file)
(when (tramp-send-command-and-check
v (concat "gzip -f "
(tramp-shell-quote-argument localname)))
@ -2673,7 +2675,7 @@ the result will be a local, non-Tramp, filename."
(string-match "\\`su\\(do\\)?\\'" method))
(setq uname (concat uname user)))
(setq uname
(with-connection-property v uname
(with-tramp-connection-property v uname
(tramp-send-command
v (format "cd %s; pwd" (tramp-shell-quote-argument uname)))
(with-current-buffer (tramp-get-buffer v)
@ -2943,7 +2945,7 @@ the result will be a local, non-Tramp, filename."
;; Use inline encoding for file transfer.
(rem-enc
(save-excursion
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 3 (format "Encoding remote file %s" filename)
(tramp-barf-unless-okay
v (format rem-enc (tramp-shell-quote-argument localname))
@ -2957,7 +2959,7 @@ the result will be a local, non-Tramp, filename."
(with-temp-buffer
(set-buffer-multibyte nil)
(insert-buffer-substring (tramp-get-buffer v))
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 3 (format "Decoding remote file %s with function %s"
filename loc-dec)
(funcall loc-dec (point-min) (point-max))
@ -2975,7 +2977,7 @@ the result will be a local, non-Tramp, filename."
(let (file-name-handler-alist
(coding-system-for-write 'binary))
(write-region (point-min) (point-max) tmpfile2))
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 3 (format "Decoding remote file %s with command %s"
filename loc-dec)
(unwind-protect
@ -3203,7 +3205,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
(set-buffer-multibyte nil)
;; Use encoding function or command.
(if (functionp loc-enc)
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 3 (format "Encoding region using function `%s'"
loc-enc)
(let ((coding-system-for-read 'binary))
@ -3221,7 +3223,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
(tramp-compat-temporary-file-directory)))
(funcall loc-enc (point-min) (point-max))))
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 3 (format "Encoding region using command `%s'"
loc-enc)
(unless (zerop (tramp-call-local-coding-command
@ -3235,7 +3237,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
;; Send buffer into remote decoding command which
;; writes to remote file. Because this happens on
;; the remote host, we cannot use the function.
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 3
(format "Decoding region into remote file %s" filename)
(goto-char (point-max))
@ -3335,7 +3337,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
"Like `vc-registered' for Tramp files."
(tramp-compat-with-temp-message ""
(with-parsed-tramp-file-name file nil
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 3 (format "Checking `vc-registered' for %s" file)
;; There could be new files, created by the vc backend. We
@ -3433,7 +3435,7 @@ Only send the definition if it has not already been done."
(let ((scripts (tramp-get-connection-property
(tramp-get-connection-process vec) "scripts" nil)))
(unless (member name scripts)
(tramp-with-progress-reporter vec 5 (format "Sending script `%s'" name)
(with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name)
;; The script could contain a call of Perl. This is masked with `%s'.
(tramp-barf-unless-okay
vec
@ -3602,7 +3604,7 @@ file exists and nonzero exit status otherwise."
(defun tramp-open-shell (vec shell)
"Opens shell SHELL."
(tramp-with-progress-reporter
(with-tramp-progress-reporter
vec 5 (format "Opening remote shell `%s'" shell)
;; Find arguments for this shell.
(let ((tramp-end-of-output tramp-initial-end-of-output)
@ -3638,7 +3640,7 @@ file exists and nonzero exit status otherwise."
(tramp-file-name-method vec) 'tramp-remote-shell)))
shell)
(setq shell
(with-connection-property vec "remote-shell"
(with-tramp-connection-property vec "remote-shell"
;; CCC: "root" does not exist always, see QNAP 459.
;; Which check could we apply instead?
(tramp-send-command vec "echo ~root" t)
@ -3673,7 +3675,7 @@ file exists and nonzero exit status otherwise."
(tramp-open-shell vec shell))
;; Busyboxes tend to behave strange. We check for the existence.
(with-connection-property vec "busybox"
(with-tramp-connection-property vec "busybox"
(tramp-send-command vec (format "%s --version" shell) t)
(let ((case-fold-search t))
(and (string-match "busybox" (buffer-string)) t))))))
@ -3798,7 +3800,7 @@ process to set up. VEC specifies the connection."
;; successfully, sending 625 bytes failed. Emacs makes a hack when
;; this host type is detected locally. It cannot handle remote
;; hosts, though.
(with-connection-property proc "chunksize"
(with-tramp-connection-property proc "chunksize"
(cond
((and (integerp tramp-chunksize) (> tramp-chunksize 0))
tramp-chunksize)
@ -4327,7 +4329,7 @@ connection if a previous connection has died for some reason."
(when (and (boundp 'non-essential) (symbol-value 'non-essential))
(throw 'non-essential 'non-essential))
(tramp-with-progress-reporter
(with-tramp-progress-reporter
vec 3
(if (zerop (length (tramp-file-name-user vec)))
(format "Opening connection for %s using %s"
@ -4773,7 +4775,7 @@ This is used internally by `tramp-file-mode-from-int'."
;; Variables local to connection.
(defun tramp-get-remote-path (vec)
(with-connection-property
(with-tramp-connection-property
;; When `tramp-own-remote-path' is in `tramp-remote-path', we
;; cache the result for the session only. Otherwise, the result
;; is cached persistently.
@ -4845,7 +4847,7 @@ This is used internally by `tramp-file-mode-from-int'."
remote-path)))))
(defun tramp-get-ls-command (vec)
(with-connection-property vec "ls"
(with-tramp-connection-property vec "ls"
(tramp-message vec 5 "Finding a suitable `ls' command")
(or
(catch 'ls-found
@ -4871,7 +4873,7 @@ This is used internally by `tramp-file-mode-from-int'."
(defun tramp-get-ls-command-with-dired (vec)
(save-match-data
(with-connection-property vec "ls-dired"
(with-tramp-connection-property vec "ls-dired"
(tramp-message vec 5 "Checking, whether `ls --dired' works")
;; Some "ls" versions are sensible wrt the order of arguments,
;; they fail when "-al" is after the "--dired" argument (for
@ -4880,7 +4882,7 @@ This is used internally by `tramp-file-mode-from-int'."
vec (format "%s --dired -al /dev/null" (tramp-get-ls-command vec))))))
(defun tramp-get-test-command (vec)
(with-connection-property vec "test"
(with-tramp-connection-property vec "test"
(tramp-message vec 5 "Finding a suitable `test' command")
(if (tramp-send-command-and-check vec "test 0")
"test"
@ -4890,7 +4892,7 @@ This is used internally by `tramp-file-mode-from-int'."
;; Does `test A -nt B' work? Use abominable `find' construct if it
;; doesn't. BSD/OS 4.0 wants the parentheses around the command,
;; for otherwise the shell crashes.
(with-connection-property vec "test-nt"
(with-tramp-connection-property vec "test-nt"
(or
(progn
(tramp-send-command
@ -4908,17 +4910,17 @@ This is used internally by `tramp-file-mode-from-int'."
"tramp_test_nt %s %s"))))
(defun tramp-get-file-exists-command (vec)
(with-connection-property vec "file-exists"
(with-tramp-connection-property vec "file-exists"
(tramp-message vec 5 "Finding command to check if file exists")
(tramp-find-file-exists-command vec)))
(defun tramp-get-remote-ln (vec)
(with-connection-property vec "ln"
(with-tramp-connection-property vec "ln"
(tramp-message vec 5 "Finding a suitable `ln' command")
(tramp-find-executable vec "ln" (tramp-get-remote-path vec))))
(defun tramp-get-remote-perl (vec)
(with-connection-property vec "perl"
(with-tramp-connection-property vec "perl"
(tramp-message vec 5 "Finding a suitable `perl' command")
(let ((result
(or (tramp-find-executable vec "perl5" (tramp-get-remote-path vec))
@ -4926,16 +4928,16 @@ This is used internally by `tramp-file-mode-from-int'."
vec "perl" (tramp-get-remote-path vec)))))
;; We must check also for some Perl modules.
(when result
(with-connection-property vec "perl-file-spec"
(with-tramp-connection-property vec "perl-file-spec"
(tramp-send-command-and-check
vec (format "%s -e 'use File::Spec;'" result)))
(with-connection-property vec "perl-cwd-realpath"
(with-tramp-connection-property vec "perl-cwd-realpath"
(tramp-send-command-and-check
vec (format "%s -e 'use Cwd \"realpath\";'" result))))
result)))
(defun tramp-get-remote-stat (vec)
(with-connection-property vec "stat"
(with-tramp-connection-property vec "stat"
(tramp-message vec 5 "Finding a suitable `stat' command")
(let ((result (tramp-find-executable
vec "stat" (tramp-get-remote-path vec)))
@ -4953,7 +4955,7 @@ This is used internally by `tramp-file-mode-from-int'."
result)))
(defun tramp-get-remote-readlink (vec)
(with-connection-property vec "readlink"
(with-tramp-connection-property vec "readlink"
(tramp-message vec 5 "Finding a suitable `readlink' command")
(let ((result (tramp-find-executable
vec "readlink" (tramp-get-remote-path vec))))
@ -4963,12 +4965,12 @@ This is used internally by `tramp-file-mode-from-int'."
result))))
(defun tramp-get-remote-trash (vec)
(with-connection-property vec "trash"
(with-tramp-connection-property vec "trash"
(tramp-message vec 5 "Finding a suitable `trash' command")
(tramp-find-executable vec "trash" (tramp-get-remote-path vec))))
(defun tramp-get-remote-id (vec)
(with-connection-property vec "id"
(with-tramp-connection-property vec "id"
(tramp-message vec 5 "Finding POSIX `id' command")
(or
(catch 'id-found
@ -4982,7 +4984,7 @@ This is used internally by `tramp-file-mode-from-int'."
(tramp-error vec 'file-error "Couldn't find a POSIX `id' command"))))
(defun tramp-get-remote-uid (vec id-format)
(with-connection-property vec (format "uid-%s" id-format)
(with-tramp-connection-property vec (format "uid-%s" id-format)
(let ((res (tramp-send-command-and-read
vec
(format "%s -u%s %s"
@ -4994,7 +4996,7 @@ This is used internally by `tramp-file-mode-from-int'."
(if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
(defun tramp-get-remote-gid (vec id-format)
(with-connection-property vec (format "gid-%s" id-format)
(with-tramp-connection-property vec (format "gid-%s" id-format)
(let ((res (tramp-send-command-and-read
vec
(format "%s -g%s %s"
@ -5020,7 +5022,7 @@ the length of the file to be compressed.
If no corresponding command is found, nil is returned."
(when (and (integerp tramp-inline-compress-start-size)
(> size tramp-inline-compress-start-size))
(with-connection-property (tramp-get-connection-process vec) prop
(with-tramp-connection-property (tramp-get-connection-process vec) prop
(tramp-find-inline-compress vec)
(tramp-get-connection-property
(tramp-get-connection-process vec) prop nil))))
@ -5041,7 +5043,8 @@ function cell is returned to be applied on a buffer."
;; no inline coding is found.
(ignore-errors
(let ((coding
(with-connection-property (tramp-get-connection-process vec) prop
(with-tramp-connection-property
(tramp-get-connection-process vec) prop
(tramp-find-inline-encoding vec)
(tramp-get-connection-property
(tramp-get-connection-process vec) prop nil)))

View file

@ -355,7 +355,7 @@ pass to the OPERATION."
(let ((t1 (tramp-tramp-file-p dirname))
(t2 (tramp-tramp-file-p newname)))
(with-parsed-tramp-file-name (if t1 dirname newname) nil
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 0 (format "Copying %s to %s" dirname newname)
(cond
;; We must use a local temporary directory.
@ -491,7 +491,7 @@ KEEP-DATE has no effect in case NEWNAME resides on an SMB server.
PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
(setq filename (expand-file-name filename)
newname (expand-file-name newname))
(tramp-with-progress-reporter
(with-tramp-progress-reporter
(tramp-dissect-file-name (if (file-remote-p filename) filename newname))
0 (format "Copying %s to %s" filename newname)
@ -642,7 +642,8 @@ PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
(unless id-format (setq id-format 'integer))
(ignore-errors
(with-parsed-tramp-file-name filename nil
(with-file-property v localname (format "file-attributes-%s" id-format)
(with-tramp-file-property
v localname (format "file-attributes-%s" id-format)
(if (and (tramp-smb-get-share v) (tramp-smb-get-stat-capability v))
(tramp-smb-do-file-attributes-with-stat v id-format)
;; Reading just the filename entry via "dir localname" is not
@ -753,7 +754,7 @@ PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
v 'file-error
"Cannot make local copy of non-existing file `%s'" filename))
(let ((tmpfile (tramp-compat-make-temp-file filename)))
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
(unless (tramp-smb-send-command
v (format "get \"%s\" \"%s\""
@ -771,7 +772,7 @@ PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
(all-completions
filename
(with-parsed-tramp-file-name directory nil
(with-file-property v localname "file-name-all-completions"
(with-tramp-file-property v localname "file-name-all-completions"
(save-match-data
(let ((entries (tramp-smb-get-file-entries directory)))
(mapcar
@ -1119,7 +1120,7 @@ target of the symlink differ."
(if (file-remote-p filename) filename newname))
'file-already-exists newname))
(tramp-with-progress-reporter
(with-tramp-progress-reporter
(tramp-dissect-file-name (if (file-remote-p filename) filename newname))
0 (format "Renaming %s to %s" filename newname)
@ -1253,7 +1254,7 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
(list start end tmpfile append 'no-message lockname confirm)
(list start end tmpfile append 'no-message lockname)))
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 3 (format "Moving tmp file %s to %s" tmpfile filename)
(unwind-protect
(unless (tramp-smb-send-command
@ -1312,7 +1313,7 @@ Either the shares are listed, or the `dir' command is executed.
Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)."
(with-parsed-tramp-file-name (file-name-as-directory directory) nil
(setq localname (or localname "/"))
(with-file-property v localname "file-entries"
(with-tramp-file-property v localname "file-entries"
(with-current-buffer (tramp-get-connection-buffer v)
(let* ((share (tramp-smb-get-share v))
(cache (tramp-get-connection-property v "share-cache" nil))
@ -1497,7 +1498,7 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
;; When we are not logged in yet, we return nil.
(if (let ((p (tramp-get-connection-process vec)))
(and p (processp p) (memq (process-status p) '(run open))))
(with-connection-property
(with-tramp-connection-property
(tramp-get-connection-process vec) "cifs-capabilities"
(save-match-data
(when (tramp-smb-send-command vec "posix")
@ -1515,7 +1516,7 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
;; When we are not logged in yet, we return nil.
(if (let ((p (tramp-get-connection-process vec)))
(and p (processp p) (memq (process-status p) '(run open))))
(with-connection-property
(with-tramp-connection-property
(tramp-get-connection-process vec) "stat-capability"
(tramp-smb-send-command vec "stat ."))))
@ -1625,7 +1626,7 @@ If ARGUMENT is non-nil, use it as argument for
(setq args (append args (list argument))))
;; OK, let's go.
(tramp-with-progress-reporter
(with-tramp-progress-reporter
vec 3
(format "Opening connection for //%s%s/%s"
(if (not (zerop (length user))) (concat user "@") "")

View file

@ -1353,8 +1353,7 @@ ARGS to actually emit the message (if applicable)."
"tramp-debug-message"
"tramp-error"
"tramp-error-with-buffer"
"tramp-message"
"tramp-with-progress-reporter")
"tramp-message")
t)
"$")
fn)))
@ -1498,7 +1497,7 @@ If VAR is nil, then we bind `v' to the structure and `method', `user',
(when (string-match message (or (current-message) ""))
(tramp-compat-funcall 'progress-reporter-update reporter value))))
(defmacro tramp-with-progress-reporter (vec level message &rest body)
(defmacro with-tramp-progress-reporter (vec level message &rest body)
"Executes BODY, spinning a progress reporter with MESSAGE.
If LEVEL does not fit for visible messages, or if this is a
nested call of the macro, there are only traces without a visible
@ -1527,7 +1526,42 @@ progress reporter."
(tramp-message ,vec ,level "%s...done" ,message))))
(tramp-compat-font-lock-add-keywords
'emacs-lisp-mode '("\\<tramp-with-progress-reporter\\>"))
'emacs-lisp-mode '("\\<with-tramp-progress-reporter\\>"))
(defmacro with-tramp-file-property (vec file property &rest body)
"Check in Tramp cache for PROPERTY, otherwise execute BODY and set cache.
FILE must be a local file name on a connection identified via VEC."
`(if (file-name-absolute-p ,file)
(let ((value (tramp-get-file-property ,vec ,file ,property 'undef)))
(when (eq value 'undef)
;; We cannot pass @body as parameter to
;; `tramp-set-file-property' because it mangles our
;; debug messages.
(setq value (progn ,@body))
(tramp-set-file-property ,vec ,file ,property value))
value)
,@body))
(put 'with-tramp-file-property 'lisp-indent-function 3)
(put 'with-tramp-file-property 'edebug-form-spec t)
(tramp-compat-font-lock-add-keywords
'emacs-lisp-mode '("\\<with-tramp-file-property\\>"))
(defmacro with-tramp-connection-property (key property &rest body)
"Check in Tramp for property PROPERTY, otherwise executes BODY and set."
`(let ((value (tramp-get-connection-property ,key ,property 'undef)))
(when (eq value 'undef)
;; We cannot pass ,@body as parameter to
;; `tramp-set-connection-property' because it mangles our debug
;; messages.
(setq value (progn ,@body))
(tramp-set-connection-property ,key ,property value))
value))
(put 'with-tramp-connection-property 'lisp-indent-function 2)
(put 'with-tramp-connection-property 'edebug-form-spec t)
(tramp-compat-font-lock-add-keywords
'emacs-lisp-mode '("\\<with-tramp-connection-property\\>"))
(defalias 'tramp-drop-volume-letter
(if (memq system-type '(cygwin windows-nt))
@ -2860,7 +2894,7 @@ User is always nil."
(setq filename (expand-file-name filename))
(let (result local-copy remote-copy)
(with-parsed-tramp-file-name filename nil
(tramp-with-progress-reporter
(with-tramp-progress-reporter
v 3 (format "Inserting `%s'" filename)
(unwind-protect
(if (not (file-exists-p filename))
@ -2983,7 +3017,7 @@ User is always nil."
(if (not (file-exists-p file))
nil
(let ((tramp-message-show-message (not nomessage)))
(tramp-with-progress-reporter v 0 (format "Loading %s" file)
(with-tramp-progress-reporter v 0 (format "Loading %s" file)
(let ((local-copy (file-local-copy file)))
;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil.
(unwind-protect
@ -3127,7 +3161,7 @@ beginning of local filename are not substituted."
"Send the login name."
(when (not (stringp tramp-current-user))
(setq tramp-current-user
(with-connection-property vec "login-as"
(with-tramp-connection-property vec "login-as"
(save-window-excursion
(let ((enable-recursive-minibuffers t))
(pop-to-buffer (tramp-get-connection-buffer vec))
@ -3417,13 +3451,13 @@ the remote host use line-endings as defined in the variable
(defun tramp-get-inode (vec)
"Returns the virtual inode number.
If it doesn't exist, generate a new one."
(with-file-property vec (tramp-file-name-localname vec) "inode"
(with-tramp-file-property vec (tramp-file-name-localname vec) "inode"
(setq tramp-inodes (1+ tramp-inodes))))
(defun tramp-get-device (vec)
"Returns the virtual device number.
If it doesn't exist, generate a new one."
(with-connection-property (tramp-get-connection-process vec) "device"
(with-tramp-connection-property (tramp-get-connection-process vec) "device"
(cons -1 (setq tramp-devices (1+ tramp-devices)))))
(defun tramp-equal-remote (file1 file2)
@ -3545,7 +3579,7 @@ would yield `t'. On the other hand, the following check results in nil:
(defun tramp-get-remote-tmpdir (vec)
"Return directory for temporary files on the remote host identified by VEC."
(with-connection-property vec "tmpdir"
(with-tramp-connection-property vec "tmpdir"
(let ((dir (tramp-make-tramp-file-name
(tramp-file-name-method vec)
(tramp-file-name-user vec)
@ -3833,7 +3867,6 @@ Only works for Bourne-like shells."
;; * In Emacs 21, `insert-directory' shows total number of bytes used
;; by the files in that directory. Add this here.
;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman)
;; * Make ffap.el grok Tramp filenames. (Eli Tziperman)
;; * abbreviate-file-name
;; * Better error checking. At least whenever we see something
;; strange when doing zerop, we should kill the process and start

View file

@ -31,7 +31,7 @@
;; should be changed only there.
;;;###tramp-autoload
(defconst tramp-version "2.2.6"
(defconst tramp-version "2.2.7-pre"
"This version of Tramp.")
;;;###tramp-autoload
@ -44,7 +44,7 @@
(= emacs-major-version 21)
(>= emacs-minor-version 4)))
"ok"
(format "Tramp 2.2.6 is not fit for %s"
(format "Tramp 2.2.7-pre is not fit for %s"
(when (string-match "^.*$" (emacs-version))
(match-string 0 (emacs-version)))))))
(unless (string-match "\\`ok\\'" x) (error "%s" x)))

View file

@ -117,20 +117,20 @@ Comments might be indented to a different value in order not to go beyond
If there are any \\(...\\) pairs, the comment delimiter text is held to begin
at the place matched by the close of the first pair.")
;;;###autoload
(put 'comment-start-skip 'safe-local-variable 'string-or-null-p)
(put 'comment-start-skip 'safe-local-variable 'stringp)
;;;###autoload
(defvar comment-end-skip nil
"Regexp to match the end of a comment plus everything back to its body.")
;;;###autoload
(put 'comment-end-skip 'safe-local-variable 'string-or-null-p)
(put 'comment-end-skip 'safe-local-variable 'stringp)
;;;###autoload
(defvar comment-end (purecopy "")
"String to insert to end a new comment.
Should be an empty string if comments are terminated by end-of-line.")
;;;###autoload
(put 'comment-end 'safe-local-variable 'string-or-null-p)
(put 'comment-end 'safe-local-variable 'stringp)
;;;###autoload
(defvar comment-indent-function 'comment-indent-default
@ -327,9 +327,9 @@ terminated by the end of line (i.e. `comment-end' is empty)."
;;;###autoload
(defun comment-normalize-vars (&optional noerror)
"Check and setup the variables needed by other commenting functions.
Functions autoloaded from newcomment.el, being entry points, should call
this function before any other, so the rest of the code can assume that
the variables are properly set."
Any command calling functions from newcomment.el should call this function
before any other, so the rest of the code can assume that the variables are
properly set."
(unless (and (not comment-start) noerror)
(unless comment-start
(let ((cs (read-string "No comment syntax is defined. Use: ")))

View file

@ -338,30 +338,6 @@ at compile time, e.g. for macros and inline functions."
(cc-bytecomp-debug-msg
"cc-bytecomp-defun: Covered function %s" ',fun))))))
(put 'cc-bytecomp-defmacro 'lisp-indent-function 'defun)
(defmacro cc-bytecomp-defmacro (fun &rest temp-macro)
"Bind the symbol as a macro during compilation (and evaluation) of the
file. Don't use outside `eval-when-compile'."
`(let ((orig-fun (assq ',fun cc-bytecomp-original-functions)))
(if (not orig-fun)
(setq orig-fun
(list ',fun
nil
(if (fboundp ',fun)
(progn
(cc-bytecomp-debug-msg
"cc-bytecomp-defmacro: Saving %s" ',fun)
(symbol-function ',fun))
(cc-bytecomp-debug-msg
"cc-bytecomp-defmacro: Saving %s as unbound" ',fun)
'unbound))
cc-bytecomp-original-functions
(cons orig-fun cc-bytecomp-original-functions)))
(defmacro ,fun ,@temp-macro)
(cc-bytecomp-debug-msg
"cc-bytecomp-defmacro: Bound macro %s" ',fun)
(setcar (cdr orig-fun) (symbol-function ',fun))))
(defmacro cc-bytecomp-put (symbol propname value)
"Set a property on a symbol during compilation (and evaluation) of
the file. Don't use outside `eval-when-compile'."

View file

@ -49,16 +49,6 @@
(require 'custom)
(require 'widget))
(cc-eval-when-compile
;; Need the function form of `backquote', which isn't standardized
;; between Emacsen. It's called `bq-process' in XEmacs, and
;; `backquote-process' in Emacs. `backquote-process' returns a
;; slightly more convoluted form, so let `bq-process' be the norm.
(if (fboundp 'backquote-process)
(cc-bytecomp-defmacro bq-process (form)
`(cdr (backquote-process ,form)))))
;;; Helpers
;; This widget exists in newer versions of the Custom library

View file

@ -235,6 +235,9 @@
(substitute-key-definition 'forward-sentence
'python-nav-forward-block
map global-map)
(substitute-key-definition 'backward-up-list
'python-nav-backward-up-list
map global-map)
(define-key map "\C-c\C-j" 'imenu)
;; Indent specific
(define-key map "\177" 'python-indent-dedent-line-backspace)
@ -337,19 +340,28 @@
"==" ">=" "is" "not")))
;; FIXME: Use regexp-opt.
(assignment-operator . ,(rx (or "=" "+=" "-=" "*=" "/=" "//=" "%=" "**="
">>=" "<<=" "&=" "^=" "|="))))
"Additional Python specific sexps for `python-rx'"))
">>=" "<<=" "&=" "^=" "|=")))
(string-delimiter . ,(rx (and
;; Match even number of backslashes.
(or (not (any ?\\ ?\' ?\")) point
;; Quotes might be preceded by a escaped quote.
(and (or (not (any ?\\)) point) ?\\
(* ?\\ ?\\) (any ?\' ?\")))
(* ?\\ ?\\)
;; Match single or triple quotes of any kind.
(group (or "\"" "\"\"\"" "'" "'''"))))))
"Additional Python specific sexps for `python-rx'")
(defmacro python-rx (&rest regexps)
"Python mode specialized rx macro.
(defmacro python-rx (&rest regexps)
"Python mode specialized rx macro.
This variant of `rx' supports common python named REGEXPS."
(let ((rx-constituents (append python-rx-constituents rx-constituents)))
(cond ((null regexps)
(error "No regexp"))
((cdr regexps)
(rx-to-string `(and ,@regexps) t))
(t
(rx-to-string (car regexps) t)))))
(let ((rx-constituents (append python-rx-constituents rx-constituents)))
(cond ((null regexps)
(error "No regexp"))
((cdr regexps)
(rx-to-string `(and ,@regexps) t))
(t
(rx-to-string (car regexps) t))))))
;;; Font-lock and syntax
@ -498,16 +510,7 @@ The type returned can be `comment', `string' or `paren'."
(defconst python-syntax-propertize-function
(syntax-propertize-rules
((rx
(and
;; Match even number of backslashes.
(or (not (any ?\\ ?\' ?\")) point
;; Quotes might be preceded by a escaped quote.
(and (or (not (any ?\\)) point) ?\\
(* ?\\ ?\\) (any ?\' ?\")))
(* ?\\ ?\\)
;; Match single or triple quotes of any kind.
(group (or "\"" "\"\"\"" "'" "'''"))))
((python-rx string-delimiter)
(0 (ignore (python-syntax-stringify))))))
(defsubst python-syntax-count-quotes (quote-char &optional point limit)
@ -676,12 +679,12 @@ START is the buffer position where the sexp starts."
(goto-char (line-beginning-position))
(bobp))
'no-indent)
;; Inside a paren
((setq start (python-syntax-context 'paren ppss))
'inside-paren)
;; Inside string
((setq start (python-syntax-context 'string ppss))
'inside-string)
;; Inside a paren
((setq start (python-syntax-context 'paren ppss))
'inside-paren)
;; After backslash
((setq start (when (not (or (python-syntax-context 'string ppss)
(python-syntax-context 'comment ppss)))
@ -710,7 +713,7 @@ START is the buffer position where the sexp starts."
;; After normal line
((setq start (save-excursion
(back-to-indentation)
(python-util-forward-comment -1)
(skip-chars-backward (rx (or whitespace ?\n)))
(python-nav-beginning-of-statement)
(point-marker)))
'after-line)
@ -973,7 +976,16 @@ Called from a program, START and END specify the region to indent."
(back-to-indentation)
(setq word (current-word))
(forward-line 1)
(when word
(when (and word
;; Don't mess with strings, unless it's the
;; enclosing set of quotes.
(or (not (python-syntax-context 'string))
(eq
(syntax-after
(+ (1- (point))
(current-indentation)
(python-syntax-count-quotes (char-after) (point))))
(string-to-syntax "|"))))
(beginning-of-line)
(delete-horizontal-space)
(indent-to (python-indent-calculate-indentation)))))
@ -1160,7 +1172,8 @@ Returns nil if point is not in a def or class."
(python-info-line-ends-backslash-p))
(python-syntax-context 'string)
(python-syntax-context 'paren))
(forward-line -1)))))
(forward-line -1))))
(point-marker))
(defun python-nav-end-of-statement ()
"Move to end of current statement."
@ -1171,7 +1184,8 @@ Returns nil if point is not in a def or class."
(python-info-line-ends-backslash-p)
(python-syntax-context 'string)
(python-syntax-context 'paren))
(forward-line 1)))))
(forward-line 1))))
(point-marker))
(defun python-nav-backward-statement (&optional arg)
"Move backward to previous statement.
@ -1286,151 +1300,104 @@ When ARG > 0 move forward, else if ARG is < 0."
(while (and (funcall search-fn paren-regexp nil t)
(python-syntax-context 'paren)))))))
(defun python-nav--forward-sexp ()
"Move to forward sexp."
(case (python-syntax-context-type)
(string
;; Inside of a string, get out of it.
(while (and (re-search-forward "[\"']" nil t)
(python-syntax-context 'string))))
(comment
;; Inside of a comment, just move forward.
(python-util-forward-comment))
(paren
(python-nav-lisp-forward-sexp-safe 1))
(t
(if (and (not (eobp))
(= (syntax-class (syntax-after (point))) 4))
;; Looking an open-paren
(python-nav-lisp-forward-sexp-safe 1)
(let ((block-starting-pos
(save-excursion (python-nav-beginning-of-block)))
(block-ending-pos
(save-excursion (python-nav-end-of-block)))
(next-block-starting-pos
(save-excursion (python-nav-forward-block))))
(cond
((not block-starting-pos)
;; Not inside a block, move to closest one.
(and next-block-starting-pos
(goto-char next-block-starting-pos)))
((= (point) block-starting-pos)
;; Point is at beginning of block
(if (and next-block-starting-pos
(< next-block-starting-pos block-ending-pos))
;; Beginning of next block is closer than current's
;; end, move to it.
(goto-char next-block-starting-pos)
(goto-char block-ending-pos)))
((= block-ending-pos (point))
;; Point is at end of current block
(let ((parent-block-end-pos
(save-excursion
(python-util-forward-comment)
(python-nav-beginning-of-block)
(python-nav-end-of-block))))
(if (and parent-block-end-pos
(or (not next-block-starting-pos)
(> next-block-starting-pos parent-block-end-pos)))
;; If the parent block ends before next block
;; starts move to it.
(goto-char parent-block-end-pos)
(and next-block-starting-pos
(goto-char next-block-starting-pos)))))
(t (python-nav-end-of-block))))))))
(defun python-nav--forward-sexp (&optional dir)
"Move to forward sexp.
With positive Optional argument DIR direction move forward, else
backwards."
(setq dir (or dir 1))
(unless (= dir 0)
(let* ((forward-p (if (> dir 0)
(and (setq dir 1) t)
(and (setq dir -1) nil)))
(re-search-fn (if forward-p
're-search-forward
're-search-backward))
(context-type (python-syntax-context-type)))
(cond
((eq context-type 'string)
;; Inside of a string, get out of it.
(while (and (funcall re-search-fn "[\"']" nil t)
(python-syntax-context 'string))))
((eq context-type 'comment)
;; Inside of a comment, just move forward.
(python-util-forward-comment dir))
((or (eq context-type 'paren)
(and forward-p (looking-at (python-rx open-paren)))
(and (not forward-p)
(eq (syntax-class (syntax-after (1- (point))))
(car (string-to-syntax ")")))))
;; Inside a paren or looking at it, lisp knows what to do.
(python-nav-lisp-forward-sexp-safe dir))
(t
;; This part handles the lispy feel of
;; `python-nav-forward-sexp'. Knowing everything about the
;; current context and the context of the next sexp tries to
;; follow the lisp sexp motion commands in a symmetric manner.
(let* ((context
(cond
((python-info-beginning-of-block-p) 'block-start)
((python-info-end-of-block-p) 'block-end)
((python-info-beginning-of-statement-p) 'statement-start)
((python-info-end-of-statement-p) 'statement-end)))
(next-sexp-pos
(save-excursion
(python-nav-lisp-forward-sexp-safe dir)
(point)))
(next-sexp-context
(save-excursion
(goto-char next-sexp-pos)
(cond
((python-info-beginning-of-block-p) 'block-start)
((python-info-end-of-block-p) 'block-end)
((python-info-beginning-of-statement-p) 'statement-start)
((python-info-end-of-statement-p) 'statement-end)
((python-info-statement-starts-block-p) 'starts-block)
((python-info-statement-ends-block-p) 'ends-block)))))
(if forward-p
(cond ((and (not (eobp))
(python-info-current-line-empty-p))
(python-util-forward-comment dir)
(python-nav--forward-sexp dir))
((eq context 'block-start)
(python-nav-end-of-block))
((eq context 'statement-start)
(python-nav-end-of-statement))
((and (memq context '(statement-end block-end))
(eq next-sexp-context 'ends-block))
(goto-char next-sexp-pos)
(python-nav-end-of-block))
((and (memq context '(statement-end block-end))
(eq next-sexp-context 'starts-block))
(goto-char next-sexp-pos)
(python-nav-end-of-block))
((memq context '(statement-end block-end))
(goto-char next-sexp-pos)
(python-nav-end-of-statement))
(t (goto-char next-sexp-pos)))
(cond ((and (not (bobp))
(python-info-current-line-empty-p))
(python-util-forward-comment dir)
(python-nav--forward-sexp dir))
((eq context 'block-end)
(python-nav-beginning-of-block))
((eq context 'statement-end)
(python-nav-beginning-of-statement))
((and (memq context '(statement-start block-start))
(eq next-sexp-context 'starts-block))
(goto-char next-sexp-pos)
(python-nav-beginning-of-block))
((and (memq context '(statement-start block-start))
(eq next-sexp-context 'ends-block))
(goto-char next-sexp-pos)
(python-nav-beginning-of-block))
((memq context '(statement-start block-start))
(goto-char next-sexp-pos)
(python-nav-beginning-of-statement))
(t (goto-char next-sexp-pos))))))))))
(defun python-nav--backward-sexp ()
"Move to backward sexp."
(case (python-syntax-context-type)
(string
;; Inside of a string, get out of it.
(while (and (re-search-backward "[\"']" nil t)
(python-syntax-context 'string))))
(comment
;; Inside of a comment, just move backward.
(python-util-forward-comment -1))
(paren
;; Handle parens like we are lisp.
(python-nav-lisp-forward-sexp-safe -1))
(t
(let* ((block-starting-pos
(save-excursion (python-nav-beginning-of-block)))
(block-ending-pos
(save-excursion (python-nav-end-of-block)))
(prev-block-ending-pos
(save-excursion (when (python-nav-backward-block)
(python-nav-end-of-block))))
(prev-block-parent-ending-pos
(save-excursion
(when prev-block-ending-pos
(goto-char prev-block-ending-pos)
(python-util-forward-comment)
(python-nav-beginning-of-block)
(python-nav-end-of-block)))))
(if (and (not (bobp))
(= (syntax-class (syntax-after (1- (point)))) 5))
;; Char before point is a paren closing char, handle it
;; like we are lisp.
(python-nav-lisp-forward-sexp-safe -1)
(cond
((not block-ending-pos)
;; Not in and ending pos, move to end of previous block.
(and (python-nav-backward-block)
(python-nav-end-of-block)))
((= (point) block-ending-pos)
;; In ending pos, we need to search backwards for the
;; closest point looking the list of candidates from here.
(let ((candidates))
(dolist (name
'(prev-block-parent-ending-pos
prev-block-ending-pos
block-ending-pos
block-starting-pos))
(when (and (symbol-value name)
(< (symbol-value name) (point)))
(add-to-list 'candidates (symbol-value name))))
(goto-char (apply 'max candidates))))
((> (point) block-ending-pos)
;; After an ending position, move to it.
(goto-char block-ending-pos))
((= (point) block-starting-pos)
;; On a block starting position.
(if (not (> (point) (or prev-block-ending-pos (point))))
;; Point is after the end position of the block that
;; wraps the current one, just move a block backward.
(python-nav-backward-block)
;; If we got here we are facing a case like this one:
;;
;; try:
;; return here()
;; except Exception as e:
;;
;; Where point is on the "except" and must move to the
;; end of "here()".
(goto-char prev-block-ending-pos)
(let ((parent-block-ending-pos
(save-excursion
(python-nav-forward-sexp)
(and (not (looking-at (python-rx block-start)))
(point)))))
(when (and parent-block-ending-pos
(> parent-block-ending-pos prev-block-ending-pos))
;; If we got here we are facing a case like this one:
;;
;; except ImportError:
;; if predicate():
;; processing()
;; here()
;; except AttributeError:
;;
;; Where point is on the "except" and must move to
;; the end of "here()". Without this extra step we'd
;; just get to the end of processing().
(goto-char parent-block-ending-pos)))))
(t
(if (and prev-block-ending-pos (< prev-block-ending-pos (point)))
(goto-char prev-block-ending-pos)
(python-nav-beginning-of-block)))))))))
(python-nav--forward-sexp -1))
(defun python-nav-forward-sexp (&optional arg)
"Move forward across one block of code.
@ -1445,6 +1412,67 @@ move backward N times."
(python-nav--backward-sexp)
(setq arg (1+ arg))))
(defun python-nav--up-list (&optional dir)
"Internal implementation of `python-nav-up-list'.
DIR is always 1 or -1 and comes sanitized from
`python-nav-up-list' calls."
(let ((context (python-syntax-context-type))
(forward-p (> dir 0)))
(cond
((memq context '(string comment)))
((eq context 'paren)
(let ((forward-sexp-function))
(up-list dir)))
((and forward-p (python-info-end-of-block-p))
(let ((parent-end-pos
(save-excursion
(let ((indentation (and
(python-nav-beginning-of-block)
(current-indentation))))
(while (and indentation
(> indentation 0)
(>= (current-indentation) indentation)
(python-nav-backward-block)))
(python-nav-end-of-block)))))
(and (> (or parent-end-pos (point)) (point))
(goto-char parent-end-pos))))
(forward-p (python-nav-end-of-block))
((and (not forward-p)
(> (current-indentation) 0)
(python-info-beginning-of-block-p))
(let ((prev-block-pos
(save-excursion
(let ((indentation (current-indentation)))
(while (and (python-nav-backward-block)
(> (current-indentation) indentation))))
(point))))
(and (> (point) prev-block-pos)
(goto-char prev-block-pos))))
((not forward-p) (python-nav-beginning-of-block)))))
(defun python-nav-up-list (&optional arg)
"Move forward out of one level of parentheses (or blocks).
With ARG, do this that many times.
A negative argument means move backward but still to a less deep spot.
This command assumes point is not in a string or comment."
(interactive "^p")
(or arg (setq arg 1))
(while (> arg 0)
(python-nav--up-list 1)
(setq arg (1- arg)))
(while (< arg 0)
(python-nav--up-list -1)
(setq arg (1+ arg))))
(defun python-nav-backward-up-list (&optional arg)
"Move backward out of one level of parentheses (or blocks).
With ARG, do this that many times.
A negative argument means move backward but still to a less deep spot.
This command assumes point is not in a string or comment."
(interactive "^p")
(or arg (setq arg 1))
(python-nav-up-list (- arg)))
;;; Shell integration
@ -1643,6 +1671,22 @@ uniqueness for different types of configurations."
OUTPUT is a string with the contents of the buffer."
(ansi-color-filter-apply output))
(defvar python-shell--parent-buffer nil)
(defvar python-shell-output-syntax-table
(let ((table (make-syntax-table python-dotty-syntax-table)))
(modify-syntax-entry ?\' "." table)
(modify-syntax-entry ?\" "." table)
(modify-syntax-entry ?\( "." table)
(modify-syntax-entry ?\[ "." table)
(modify-syntax-entry ?\{ "." table)
(modify-syntax-entry ?\) "." table)
(modify-syntax-entry ?\] "." table)
(modify-syntax-entry ?\} "." table)
table)
"Syntax table for shell output.
It makes parens and quotes be treated as punctuation chars.")
(define-derived-mode inferior-python-mode comint-mode "Inferior Python"
"Major mode for Python inferior process.
Runs a Python interpreter as a subprocess of Emacs, with Python
@ -1665,7 +1709,12 @@ initialization of the interpreter via `python-shell-setup-codes'
variable.
\(Type \\[describe-mode] in the process buffer for a list of commands.)"
(set-syntax-table python-mode-syntax-table)
(and python-shell--parent-buffer
(python-util-clone-local-variables python-shell--parent-buffer))
(setq comint-prompt-regexp (format "^\\(?:%s\\|%s\\|%s\\)"
python-shell-prompt-regexp
python-shell-prompt-block-regexp
python-shell-prompt-pdb-regexp))
(setq mode-line-process '(":%s"))
(make-local-variable 'comint-output-filter-functions)
(add-hook 'comint-output-filter-functions
@ -1686,10 +1735,21 @@ variable.
(make-local-variable 'python-pdbtrack-tracked-buffer)
(make-local-variable 'python-shell-internal-last-output)
(when python-shell-enable-font-lock
(set-syntax-table python-mode-syntax-table)
(set (make-local-variable 'font-lock-defaults)
'(python-font-lock-keywords nil nil nil nil))
(set (make-local-variable 'syntax-propertize-function)
python-syntax-propertize-function))
(syntax-propertize-rules
(comint-prompt-regexp
(0 (ignore
(put-text-property
comint-last-input-start end 'syntax-table
python-shell-output-syntax-table)
(font-lock-unfontify-region comint-last-input-start end))))
((python-rx string-delimiter)
(0 (ignore
(and (not (eq (get-text-property start 'field) 'output))
(python-syntax-stringify))))))))
(compilation-shell-minor-mode 1))
(defun python-shell-make-comint (cmd proc-name &optional pop internal)
@ -1712,15 +1772,10 @@ killed."
(let* ((cmdlist (split-string-and-unquote cmd))
(buffer (apply #'make-comint-in-buffer proc-name proc-buffer-name
(car cmdlist) nil (cdr cmdlist)))
(current-buffer (current-buffer))
(python-shell--parent-buffer (current-buffer))
(process (get-buffer-process buffer)))
(with-current-buffer buffer
(inferior-python-mode)
(python-util-clone-local-variables current-buffer)
(setq comint-prompt-regexp (format "^\\(?:%s\\|%s\\|%s\\)"
python-shell-prompt-regexp
python-shell-prompt-block-regexp
python-shell-prompt-pdb-regexp)))
(inferior-python-mode))
(accept-process-output process)
(and pop (pop-to-buffer buffer t))
(and internal (set-process-query-on-exit-flag process nil))))
@ -1875,7 +1930,9 @@ detecting a prompt at the end of the buffer."
python-shell-output-filter-buffer
(concat python-shell-output-filter-buffer string))
(when (string-match
(format "\n\\(?:%s\\|%s\\|%s\\)$"
;; XXX: It seems on OSX an extra carriage return is attached
;; at the end of output, this handles that too.
(format "\r?\n\\(?:%s\\|%s\\|%s\\)$"
python-shell-prompt-regexp
python-shell-prompt-block-regexp
python-shell-prompt-pdb-regexp)
@ -2279,28 +2336,28 @@ inferior python process is updated properly."
(defcustom python-fill-comment-function 'python-fill-comment
"Function to fill comments.
This is the function used by `python-fill-paragraph-function' to
This is the function used by `python-fill-paragraph' to
fill comments."
:type 'symbol
:group 'python)
(defcustom python-fill-string-function 'python-fill-string
"Function to fill strings.
This is the function used by `python-fill-paragraph-function' to
This is the function used by `python-fill-paragraph' to
fill strings."
:type 'symbol
:group 'python)
(defcustom python-fill-decorator-function 'python-fill-decorator
"Function to fill decorators.
This is the function used by `python-fill-paragraph-function' to
This is the function used by `python-fill-paragraph' to
fill decorators."
:type 'symbol
:group 'python)
(defcustom python-fill-paren-function 'python-fill-paren
"Function to fill parens.
This is the function used by `python-fill-paragraph-function' to
This is the function used by `python-fill-paragraph' to
fill parens."
:type 'symbol
:group 'python)
@ -2377,7 +2434,7 @@ SYMMETRIC:
:safe (lambda (val)
(memq val '(django onetwo pep-257 pep-257-nn symmetric nil))))
(defun python-fill-paragraph-function (&optional justify)
(defun python-fill-paragraph (&optional justify)
"`fill-paragraph-function' handling multi-line strings and possibly comments.
If any of the current line is in or at the end of a multi-line string,
fill the string or the paragraph of it that point is in, preserving
@ -2396,8 +2453,7 @@ Optional argument JUSTIFY defines if the paragraph should be justified."
(funcall python-fill-string-function justify))
;; Decorators
((equal (char-after (save-excursion
(back-to-indentation)
(point))) ?@)
(python-nav-beginning-of-statement))) ?@)
(funcall python-fill-decorator-function justify))
;; Parens
((or (python-syntax-context 'paren)
@ -2409,12 +2465,12 @@ Optional argument JUSTIFY defines if the paragraph should be justified."
(t t))))
(defun python-fill-comment (&optional justify)
"Comment fill function for `python-fill-paragraph-function'.
"Comment fill function for `python-fill-paragraph'.
JUSTIFY should be used (if applicable) as in `fill-paragraph'."
(fill-comment-paragraph justify))
(defun python-fill-string (&optional justify)
"String fill function for `python-fill-paragraph-function'.
"String fill function for `python-fill-paragraph'.
JUSTIFY should be used (if applicable) as in `fill-paragraph'."
(let* ((marker (point-marker))
(str-start-pos
@ -2484,12 +2540,12 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
(indent-according-to-mode))))) t)
(defun python-fill-decorator (&optional justify)
"Decorator fill function for `python-fill-paragraph-function'.
"Decorator fill function for `python-fill-paragraph'.
JUSTIFY should be used (if applicable) as in `fill-paragraph'."
t)
(defun python-fill-paren (&optional justify)
"Paren fill function for `python-fill-paragraph-function'.
"Paren fill function for `python-fill-paragraph'.
JUSTIFY should be used (if applicable) as in `fill-paragraph'."
(save-restriction
(narrow-to-region (progn
@ -2879,12 +2935,43 @@ parent defun name."
".") ".")
name)))))))
(defsubst python-info-beginning-of-block-statement-p ()
(defun python-info-statement-starts-block-p ()
"Return non-nil if current statement opens a block."
(save-excursion
(python-nav-beginning-of-statement)
(looking-at (python-rx block-start))))
(defun python-info-statement-ends-block-p ()
"Return non-nil if point is at end of block."
(let ((end-of-block-pos (save-excursion
(python-nav-end-of-block)))
(end-of-statement-pos (save-excursion
(python-nav-end-of-statement))))
(and end-of-block-pos end-of-statement-pos
(= end-of-block-pos end-of-statement-pos))))
(defun python-info-beginning-of-statement-p ()
"Return non-nil if point is at beginning of statement."
(= (point) (save-excursion
(python-nav-beginning-of-statement)
(point))))
(defun python-info-end-of-statement-p ()
"Return non-nil if point is at end of statement."
(= (point) (save-excursion
(python-nav-end-of-statement)
(point))))
(defun python-info-beginning-of-block-p ()
"Return non-nil if point is at beginning of block."
(and (python-info-beginning-of-statement-p)
(python-info-statement-starts-block-p)))
(defun python-info-end-of-block-p ()
"Return non-nil if point is at end of block."
(and (python-info-end-of-statement-p)
(python-info-statement-ends-block-p)))
(defun python-info-closing-block ()
"Return the point of the block the current line closes."
(let ((closing-word (save-excursion
@ -3109,7 +3196,7 @@ if that value is non-nil."
(set (make-local-variable 'paragraph-start) "\\s-*$")
(set (make-local-variable 'fill-paragraph-function)
'python-fill-paragraph-function)
'python-fill-paragraph)
(set (make-local-variable 'beginning-of-defun-function)
#'python-beginning-of-defun-function)

View file

@ -248,7 +248,17 @@ two markers or an overlay. Otherwise, it is nil."
(setq non-unicode t)
(setq eight-bit t)))))
str)
(setq type (if non-unicode 'COMPOUND_TEXT
(setq type (if (or non-unicode
(and
non-latin-1
;; If a coding is specified for
;; selection, and that is
;; compatible with COMPOUND_TEXT,
;; use it.
coding
(eq (coding-system-get coding :mime-charset)
'x-ctext)))
'COMPOUND_TEXT
(if non-latin-1 'UTF8_STRING
(if eight-bit 'C_STRING
'STRING))))))))

View file

@ -833,35 +833,40 @@ This handles splitting the command if it would be bigger than
(defun server-create-window-system-frame (display nowait proc parent-id
&optional parameters)
(add-to-list 'frame-inherited-parameters 'client)
(if (not (fboundp 'make-frame-on-display))
(progn
;; This emacs does not support X.
(server-log "Window system unsupported" proc)
(server-send-string proc "-window-system-unsupported \n")
nil)
;; Flag frame as client-created, but use a dummy client.
;; This will prevent the frame from being deleted when
;; emacsclient quits while also preventing
;; `server-save-buffers-kill-terminal' from unexpectedly
;; killing emacs on that frame.
(let* ((params `((client . ,(if nowait 'nowait proc))
;; This is a leftover, see above.
(environment . ,(process-get proc 'env))
,@parameters))
(display (or display
(frame-parameter nil 'display)
(getenv "DISPLAY")
(error "Please specify display")))
frame)
(if parent-id
(push (cons 'parent-id (string-to-number parent-id)) params))
(setq frame (make-frame-on-display display params))
(server-log (format "%s created" frame) proc)
(select-frame frame)
(process-put proc 'frame frame)
(process-put proc 'terminal (frame-terminal frame))
frame)))
(let* ((display (or display
(frame-parameter nil 'display)
(error "Please specify display.")))
(w (or (cdr (assq 'window-system parameters))
(window-system-for-display display))))
(unless (assq w window-system-initialization-alist)
(setq w nil))
(cond (w
;; Flag frame as client-created, but use a dummy client.
;; This will prevent the frame from being deleted when
;; emacsclient quits while also preventing
;; `server-save-buffers-kill-terminal' from unexpectedly
;; killing emacs on that frame.
(let* ((params `((client . ,(if nowait 'nowait proc))
;; This is a leftover, see above.
(environment . ,(process-get proc 'env))
,@parameters))
frame)
(if parent-id
(push (cons 'parent-id (string-to-number parent-id)) params))
(add-to-list 'frame-inherited-parameters 'client)
(setq frame (make-frame-on-display display params))
(server-log (format "%s created" frame) proc)
(select-frame frame)
(process-put proc 'frame frame)
(process-put proc 'terminal (frame-terminal frame))
frame))
(t
(server-log "Window system unsupported" proc)
(server-send-string proc "-window-system-unsupported \n")
nil))))
(defun server-goto-toplevel (proc)
(condition-case nil
@ -1121,9 +1126,13 @@ The following commands are accepted by the client:
tty-type (pop args-left)
dontkill (or dontkill
(not use-current-frame)))
;; On Windows, emacsclient always asks for a tty frame.
;; If running a GUI server, force the frame type to GUI.
(when (eq window-system 'w32)
;; On Windows, emacsclient always asks for a tty
;; frame. If running a GUI server, force the frame
;; type to GUI. (Cygwin is perfectly happy with
;; multi-tty support, so don't override the user's
;; choice there.)
(when (and (eq system-type 'windows-nt)
(eq window-system 'w32))
(push "-window-system" args-left)))
;; -position LINE[:COLUMN]: Set point to the given

View file

@ -6872,7 +6872,7 @@ call `normal-erase-is-backspace-mode' (which see) instead."
(if (if (eq normal-erase-is-backspace 'maybe)
(and (not noninteractive)
(or (memq system-type '(ms-dos windows-nt))
(memq window-system '(ns))
(memq window-system '(w32 ns))
(and (memq window-system '(x))
(fboundp 'x-backspace-delete-keys-p)
(x-backspace-delete-keys-p))

View file

@ -890,7 +890,8 @@ Amongst another things, it parses the command-line arguments."
;; Initialize the window system. (Open connection, etc.)
(funcall
(or (cdr (assq initial-window-system window-system-initialization-alist))
(error "Unsupported window system `%s'" initial-window-system))))
(error "Unsupported window system `%s'" initial-window-system)))
(put initial-window-system 'window-system-initialized t))
;; If there was an error, print the error message and exit.
(error
(princ

View file

@ -2143,7 +2143,9 @@ any other non-digit terminates the character code and is then used as input."))
(setq first nil))
code))
(defconst read-passwd-map
(defvar read-passwd-map
;; BEWARE: `defconst' would purecopy it, breaking the sharing with
;; minibuffer-local-map along the way!
(let ((map (make-sparse-keymap)))
(set-keymap-parent map minibuffer-local-map)
(define-key map "\C-u" #'delete-minibuffer-contents) ;bug#12570
@ -2186,7 +2188,9 @@ by doing (clear-string STRING)."
(lambda ()
(setq minibuf (current-buffer))
;; Turn off electricity.
(set (make-local-variable 'post-self-insert-hook) nil)
(setq-local post-self-insert-hook nil)
(setq-local buffer-undo-list t)
(setq-local select-active-regions nil)
(use-local-map read-passwd-map)
(add-hook 'after-change-functions hide-chars-fun nil 'local))
(unwind-protect

View file

@ -57,7 +57,7 @@ clipboard as well.
On Nextstep, put TEXT in the pasteboard (`x-select-enable-clipboard'
is not used)."
(cond ((eq system-type 'windows-nt)
(cond ((eq (framep (selected-frame)) 'w32)
(if x-select-enable-clipboard
(w32-set-clipboard-data text))
(setq x-last-selected-text text))

View file

@ -39,7 +39,7 @@
;; this file, which works in close coordination with src/nsfns.m.
;;; Code:
(eval-when-compile (require 'cl-lib))
(or (featurep 'ns)
(error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS"
(invocation-name)))
@ -448,7 +448,7 @@ Lines are highlighted according to `ns-input-line'."
;; nsterm.m
(declare-function ns-read-file-name "nsfns.m"
(prompt &optional dir isLoad init))
(prompt &optional dir mustmatch init dir_only_p))
;;;; File handling.
@ -633,8 +633,9 @@ This function has been overloaded in Nextstep.")
`ns-input-fontsize' of new font."
(interactive)
(modify-frame-parameters (selected-frame)
(list (cons 'font ns-input-font)
(cons 'fontsize ns-input-fontsize)))
(list (cons 'fontsize ns-input-fontsize)))
(modify-frame-parameters (selected-frame)
(list (cons 'font ns-input-font)))
(set-frame-font ns-input-font))
@ -908,6 +909,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
;; defines functions and variables that we use now.
(defun ns-initialize-window-system ()
"Initialize Emacs for Nextstep (Cocoa / GNUstep) windowing."
(cl-assert (not ns-initialized))
;; PENDING: not needed?
(setq command-line-args (x-handle-args command-line-args))
@ -935,6 +937,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(x-apply-session-resources)
(setq ns-initialized t))
(add-to-list 'display-format-alist '("\\`ns\\'" . ns))
(add-to-list 'handle-args-function-alist '(ns . x-handle-args))
(add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces))
(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system))

View file

@ -1,4 +1,4 @@
;;; w32-win.el --- parse switches controlling interface with W32 window system
;;; w32-win.el --- parse switches controlling interface with W32 window system -*- lexical-binding: t -*-
;; Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
@ -68,6 +68,7 @@
;; (if (not (eq window-system 'w32))
;; (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name)))
(eval-when-compile (require 'cl-lib))
(require 'frame)
(require 'mouse)
(require 'scroll-bar)
@ -88,7 +89,7 @@
(make-obsolete 'w32-default-color-map nil "24.1")
(declare-function w32-send-sys-command "w32fns.c")
(declare-function set-message-beep "w32console.c")
(declare-function set-message-beep "w32fns.c")
;; Conditional on new-fontset so bootstrapping works on non-GUI compiles
(if (fboundp 'new-fontset)
@ -102,7 +103,22 @@
;; (interactive "e")
;; (princ event))
(defun w32-drag-n-drop (event)
(defun w32-handle-dropped-file (window file-name)
(let ((f (if (eq system-type 'cygwin)
(cygwin-convert-path-from-windows file-name t)
(subst-char-in-string ?\\ ?/ file-name)))
(coding (or file-name-coding-system
default-file-name-coding-system)))
(setq file-name
(mapconcat 'url-hexify-string
(split-string (encode-coding-string f coding)
"/")
"/")))
(dnd-handle-one-url window 'private
(concat "file:" file-name)))
(defun w32-drag-n-drop (event &optional new-frame)
"Edit the files listed in the drag-n-drop EVENT.
Switch to a buffer editing the last file dropped."
(interactive "e")
@ -116,26 +132,21 @@ Switch to a buffer editing the last file dropped."
(y (cdr coords)))
(if (and (> x 0) (> y 0))
(set-frame-selected-window nil window))
(mapc (lambda (file-name)
(let ((f (subst-char-in-string ?\\ ?/ file-name))
(coding (or file-name-coding-system
default-file-name-coding-system)))
(setq file-name
(mapconcat 'url-hexify-string
(split-string (encode-coding-string f coding)
"/")
"/")))
(dnd-handle-one-url window 'private
(concat "file:" file-name)))
(car (cdr (cdr event)))))
(raise-frame)))
(when new-frame
(select-frame (make-frame)))
(raise-frame)
(setq window (selected-window))
(mapc (apply-partially #'w32-handle-dropped-file window)
(car (cdr (cdr event)))))))
(defun w32-drag-n-drop-other-frame (event)
"Edit the files listed in the drag-n-drop EVENT, in other frames.
May create new frames, or reuse existing ones. The frame editing
the last file dropped is selected."
(interactive "e")
(mapcar 'find-file-other-frame (car (cdr (cdr event)))))
(w32-drag-n-drop event t))
;; Bind the drag-n-drop event.
(global-set-key [drag-n-drop] 'w32-drag-n-drop)
@ -230,6 +241,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(defun w32-initialize-window-system ()
"Initialize Emacs for W32 GUI frames."
(cl-assert (not w32-initialized))
;; Do the actual Windows setup here; the above code just defines
;; functions and variables that we use now.
@ -243,7 +255,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
;; so as not to choke when we use it in X resource queries.
(replace-regexp-in-string "[.*]" "-" (invocation-name))))
(x-open-connection "" x-command-line-resources
(x-open-connection "w32" x-command-line-resources
;; Exit with a fatal error if this fails and we
;; are the initial display
(eq initial-window-system 'w32))
@ -294,7 +306,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(setq default-frame-alist
(cons '(reverse . t) default-frame-alist)))))
;; Don't let Emacs suspend under w32 gui
;; Don't let Emacs suspend under Windows.
(add-hook 'suspend-hook 'x-win-suspend-error)
;; Turn off window-splitting optimization; w32 is usually fast enough
@ -312,6 +324,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(x-apply-session-resources)
(setq w32-initialized t))
(add-to-list 'display-format-alist '("\\`w32\\'" . w32))
(add-to-list 'handle-args-function-alist '(w32 . x-handle-args))
(add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces))
(add-to-list 'window-system-initialization-alist '(w32 . w32-initialize-window-system))

View file

@ -67,6 +67,8 @@
;; An alist of X options and the function which handles them. See
;; ../startup.el.
(eval-when-compile (require 'cl-lib))
(if (not (fboundp 'x-create-frame))
(error "%s: Loading x-win.el but not compiled for X" (invocation-name)))
@ -1338,6 +1340,8 @@ Request data types in the order specified by `x-select-request-type'."
(defun x-initialize-window-system ()
"Initialize Emacs for X frames and open the first connection to an X server."
(cl-assert (not x-initialized))
;; Make sure we have a valid resource name.
(or (stringp x-resource-name)
(let (i)
@ -1451,6 +1455,7 @@ Request data types in the order specified by `x-select-request-type'."
(x-apply-session-resources)
(setq x-initialized t))
(add-to-list 'display-format-alist '("\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" . x))
(add-to-list 'handle-args-function-alist '(x . x-handle-args))
(add-to-list 'frame-creation-function-alist '(x . x-create-frame-with-faces))
(add-to-list 'window-system-initialization-alist '(x . x-initialize-window-system))

View file

@ -218,7 +218,7 @@ and before TAIL-RE and DELIM-RE in VAR or DEFAULT for no match."
;; Use CVSHeader to really get information from CVS and not other version
;; control systems.
(defconst rst-cvs-header
"$CVSHeader: sm/rst_el/rst.el,v 1.327.2.5 2012-10-07 12:44:34 stefan Exp $")
"$CVSHeader: sm/rst_el/rst.el,v 1.327.2.6 2012-10-07 13:05:50 stefan Exp $")
(defconst rst-cvs-rev
(rst-extract-version "\\$" "CVSHeader: \\S + " "[0-9]+\\(?:\\.[0-9]+\\)+"
" .*" rst-cvs-header "0.0")
@ -247,7 +247,7 @@ SVN revision is the upstream (docutils) revision.")
"Official version of the package.")
(defconst rst-official-cvs-rev
(rst-extract-version "[%$]" "Revision: " "[0-9]+\\(?:\\.[0-9]+\\)+" " "
"$Revision: 1.327.2.5 $")
"%Revision: 1.327 %")
"CVS revision of this file in the official version.")
(defconst rst-version

View file

@ -2565,8 +2565,7 @@ line LINE of the window, or centered if LINE is nil."
(if (null tex-shell)
(message "No TeX output buffer")
(setq window (display-buffer tex-shell))
(save-selected-window
(select-window window)
(with-selected-window window
(bury-buffer tex-shell)
(goto-char (point-max))
(recenter (if linenum

View file

@ -1,3 +1,8 @@
2012-10-08 Glenn Morris <rgm@gnu.org>
* url-methods.el (url-scheme-get-property): url-https.el was
merged into url-http.el, so load the latter for https. (Bug#12599)
2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
* url-http.el (url-http-user-agent-string): Leak less info.

View file

@ -118,7 +118,9 @@ it has not already been loaded."
(let* ((stub (concat "url-" scheme))
(loader (intern stub)))
(condition-case ()
(require loader)
;; url-https.el was merged into url-http because of 8+3
;; filename limitations, so we have to do this dance.
(require (if (equal "https" scheme) 'url-http loader))
(error nil))
(if (fboundp loader)
(progn

130
lisp/w32-common-fns.el Normal file
View file

@ -0,0 +1,130 @@
;;; w32-common-fns.el --- Lisp routines for Windows and Cygwin-w32
;; Copyright (C) 1994, 2001-2012 Free Software Foundation, Inc.
;; 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 <http://www.gnu.org/licenses/>.
;;; Commentary:
;;;
;;; This file contains functions that are used by both native NT Emacs
;;; and Cygwin Emacs compiled to use the native Windows widget
;;; library.
(defun w32-version ()
"Return the MS-Windows version numbers.
The value is a list of three integers: the major and minor version
numbers, and the build number."
(x-server-version))
(defun w32-using-nt ()
"Return non-nil if running on a Windows NT descendant.
That includes all Windows systems except for 9X/Me."
(getenv "SystemRoot"))
(declare-function w32-get-clipboard-data "w32select.c")
(declare-function w32-set-clipboard-data "w32select.c")
(declare-function x-server-version "w32fns.c" (&optional display))
;;; Fix interface to (X-specific) mouse.el
(defun x-set-selection (type data)
"Make an X selection of type TYPE and value DATA.
The argument TYPE (nil means `PRIMARY') says which selection, and
DATA specifies the contents. TYPE must be a symbol. \(It can also
be a string, which stands for the symbol with that name, but this
is considered obsolete.) DATA may be a string, a symbol, an
integer (or a cons of two integers or list of two integers).
The selection may also be a cons of two markers pointing to the same buffer,
or an overlay. In these cases, the selection is considered to be the text
between the markers *at whatever time the selection is examined*.
Thus, editing done in the buffer after you specify the selection
can alter the effective value of the selection.
The data may also be a vector of valid non-vector selection values.
The return value is DATA.
Interactively, this command sets the primary selection. Without
prefix argument, it reads the selection in the minibuffer. With
prefix argument, it uses the text of the region as the selection value.
Note that on MS-Windows, primary and secondary selections set by Emacs
are not available to other programs."
(put 'x-selections (or type 'PRIMARY) data))
(defun x-get-selection (&optional type _data-type)
"Return the value of an X Windows selection.
The argument TYPE (default `PRIMARY') says which selection,
and the argument DATA-TYPE (default `STRING') says
how to convert the data.
TYPE may be any symbol \(but nil stands for `PRIMARY'). However,
only a few symbols are commonly used. They conventionally have
all upper-case names. The most often used ones, in addition to
`PRIMARY', are `SECONDARY' and `CLIPBOARD'.
DATA-TYPE is usually `STRING', but can also be one of the symbols
in `selection-converter-alist', which see."
(get 'x-selections (or type 'PRIMARY)))
;; x-selection-owner-p is used in simple.el
(defun x-selection-owner-p (&optional type)
(and (memq type '(nil PRIMARY SECONDARY))
(get 'x-selections (or type 'PRIMARY))))
;; The "Windows" keys on newer keyboards bring up the Start menu
;; whether you want it or not - make Emacs ignore these keystrokes
;; rather than beep.
(global-set-key [lwindow] 'ignore)
(global-set-key [rwindow] 'ignore)
(defvar w32-charset-info-alist) ; w32font.c
;;;; Selections
;; We keep track of the last text selected here, so we can check the
;; current selection against it, and avoid passing back our own text
;; from x-selection-value.
(defvar x-last-selected-text nil)
(defun x-get-selection-value ()
"Return the value of the current selection.
Consult the selection. Treat empty strings as if they were unset."
(if x-select-enable-clipboard
(let (text)
;; Don't die if x-get-selection signals an error.
(condition-case c
(setq text (w32-get-clipboard-data))
(error (message "w32-get-clipboard-data:%s" c)))
(if (string= text "") (setq text nil))
(cond
((not text) nil)
((eq text x-last-selected-text) nil)
((string= text x-last-selected-text)
;; Record the newer string, so subsequent calls can use the 'eq' test.
(setq x-last-selected-text text)
nil)
(t
(setq x-last-selected-text text))))))
(defalias 'x-selection-value 'x-get-selection-value)
;; Arrange for the kill and yank functions to set and check the clipboard.
(setq interprogram-cut-function 'x-select-text)
(setq interprogram-paste-function 'x-get-selection-value)
(provide 'w32-common-fns)

View file

@ -26,34 +26,20 @@
;;; Code:
(require 'w32-vars)
(require 'w32-common-fns)
(defvar explicit-shell-file-name)
;;;; Function keys
(declare-function set-message-beep "w32console.c")
(declare-function w32-get-clipboard-data "w32select.c")
(declare-function set-message-beep "w32fns.c")
(declare-function w32-get-locale-info "w32proc.c")
(declare-function w32-get-valid-locale-ids "w32proc.c")
(declare-function w32-set-clipboard-data "w32select.c")
;; Map all versions of a filename (8.3, longname, mixed case) to the
;; same buffer.
(setq find-file-visit-truename t)
(declare-function x-server-version "w32fns.c" (&optional display))
(defun w32-version ()
"Return the MS-Windows version numbers.
The value is a list of three integers: the major and minor version
numbers, and the build number."
(x-server-version))
(defun w32-using-nt ()
"Return non-nil if running on a Windows NT descendant.
That includes all Windows systems except for 9X/Me."
(and (eq system-type 'windows-nt) (getenv "SystemRoot")))
(defun w32-shell-name ()
"Return the name of the shell being used."
(or (bound-and-true-p shell-file-name)
@ -240,53 +226,6 @@ requires it (see `w32-shell-dos-semantics')."
(setq start (match-end 0))))
name)))
;;; Fix interface to (X-specific) mouse.el
(defun x-set-selection (type data)
"Make an X selection of type TYPE and value DATA.
The argument TYPE (nil means `PRIMARY') says which selection, and
DATA specifies the contents. TYPE must be a symbol. \(It can also
be a string, which stands for the symbol with that name, but this
is considered obsolete.) DATA may be a string, a symbol, an
integer (or a cons of two integers or list of two integers).
The selection may also be a cons of two markers pointing to the same buffer,
or an overlay. In these cases, the selection is considered to be the text
between the markers *at whatever time the selection is examined*.
Thus, editing done in the buffer after you specify the selection
can alter the effective value of the selection.
The data may also be a vector of valid non-vector selection values.
The return value is DATA.
Interactively, this command sets the primary selection. Without
prefix argument, it reads the selection in the minibuffer. With
prefix argument, it uses the text of the region as the selection value.
Note that on MS-Windows, primary and secondary selections set by Emacs
are not available to other programs."
(put 'x-selections (or type 'PRIMARY) data))
(defun x-get-selection (&optional type _data-type)
"Return the value of an X Windows selection.
The argument TYPE (default `PRIMARY') says which selection,
and the argument DATA-TYPE (default `STRING') says
how to convert the data.
TYPE may be any symbol \(but nil stands for `PRIMARY'). However,
only a few symbols are commonly used. They conventionally have
all upper-case names. The most often used ones, in addition to
`PRIMARY', are `SECONDARY' and `CLIPBOARD'.
DATA-TYPE is usually `STRING', but can also be one of the symbols
in `selection-converter-alist', which see."
(get 'x-selections (or type 'PRIMARY)))
;; x-selection-owner-p is used in simple.el
(defun x-selection-owner-p (&optional type)
(and (memq type '(nil PRIMARY SECONDARY))
(get 'x-selections (or type 'PRIMARY))))
(defun set-w32-system-coding-system (coding-system)
"Set the coding system used by the Windows system to CODING-SYSTEM.
This is used for things like passing font names with non-ASCII
@ -311,14 +250,6 @@ This function is provided for backward compatibility, since
;; Set to a system sound if you want a fancy bell.
(set-message-beep nil)
;; The "Windows" keys on newer keyboards bring up the Start menu
;; whether you want it or not - make Emacs ignore these keystrokes
;; rather than beep.
(global-set-key [lwindow] 'ignore)
(global-set-key [rwindow] 'ignore)
(defvar w32-charset-info-alist) ; w32font.c
(defun w32-add-charset-info (xlfd-charset windows-charset codepage)
"Function to add character sets to display with Windows fonts.
Creates entries in `w32-charset-info-alist'.
@ -379,40 +310,6 @@ bit output with no translation."
(make-obsolete-variable 'w32-charset-to-codepage-alist
'w32-charset-info-alist "21.1")
;;;; Selections
;; We keep track of the last text selected here, so we can check the
;; current selection against it, and avoid passing back our own text
;; from x-selection-value.
(defvar x-last-selected-text nil)
(defun x-get-selection-value ()
"Return the value of the current selection.
Consult the selection. Treat empty strings as if they were unset."
(if x-select-enable-clipboard
(let (text)
;; Don't die if x-get-selection signals an error.
(condition-case c
(setq text (w32-get-clipboard-data))
(error (message "w32-get-clipboard-data:%s" c)))
(if (string= text "") (setq text nil))
(cond
((not text) nil)
((eq text x-last-selected-text) nil)
((string= text x-last-selected-text)
;; Record the newer string, so subsequent calls can use the 'eq' test.
(setq x-last-selected-text text)
nil)
(t
(setq x-last-selected-text text))))))
(defalias 'x-selection-value 'x-get-selection-value)
;; Arrange for the kill and yank functions to set and check the clipboard.
(setq interprogram-cut-function 'x-select-text)
(setq interprogram-paste-function 'x-get-selection-value)
;;;; Support for build process

View file

@ -44,17 +44,19 @@ X does. See `w32-fixed-font-alist' for the font menu definition."
"Include proportional fonts in the default font dialog.")
(make-obsolete-variable 'w32-list-proportional-fonts "no longer used." "23.1")
(defcustom w32-allow-system-shell nil
"Disable startup warning when using \"system\" shells."
:type 'boolean
:group 'w32)
(unless (eq system-type 'cygwin)
(defcustom w32-allow-system-shell nil
"Disable startup warning when using \"system\" shells."
:type 'boolean
:group 'w32))
(defcustom w32-system-shells '("cmd" "cmd.exe" "command" "command.com"
"4nt" "4nt.exe" "4dos" "4dos.exe"
"tcc" "tcc.exe" "ndos" "ndos.exe")
"List of strings recognized as Windows system shells."
:type '(repeat string)
:group 'w32)
(unless (eq system-type 'cygwin)
(defcustom w32-system-shells '("cmd" "cmd.exe" "command" "command.com"
"4nt" "4nt.exe" "4dos" "4dos.exe"
"tcc" "tcc.exe" "ndos" "ndos.exe")
"List of strings recognized as Windows system shells."
:type '(repeat string)
:group 'w32))
;; Want "menu" custom type for this.
(defcustom w32-fixed-font-alist

View file

@ -28,6 +28,35 @@
;;; Code:
(defun internal--before-save-selected-window ()
(cons (selected-window)
;; We save and restore all frames' selected windows, because
;; `select-window' can change the frame-selected-window of
;; whatever frame that window is in. Each text terminal's
;; top-frame is preserved by putting it last in the list.
(apply #'append
(mapcar (lambda (terminal)
(let ((frames (frames-on-display-list terminal))
(top-frame (tty-top-frame terminal))
alist)
(if top-frame
(setq frames
(cons top-frame
(delq top-frame frames))))
(dolist (f frames)
(push (cons f (frame-selected-window f))
alist))
alist))
(terminal-list)))))
(defun internal--after-save-selected-window (state)
(dolist (elt (cdr state))
(and (frame-live-p (car elt))
(window-live-p (cdr elt))
(set-frame-selected-window (car elt) (cdr elt) 'norecord)))
(when (window-live-p (car state))
(select-window (car state) 'norecord)))
(defmacro save-selected-window (&rest body)
"Execute BODY, then select the previously selected window.
The value returned is the value of the last form in BODY.
@ -44,34 +73,11 @@ its normal operation could make a different buffer current. The
order of recently selected windows and the buffer list ordering
are not altered by this macro (unless they are altered in BODY)."
(declare (indent 0) (debug t))
`(let ((save-selected-window-window (selected-window))
;; We save and restore all frames' selected windows, because
;; `select-window' can change the frame-selected-window of
;; whatever frame that window is in. Each text terminal's
;; top-frame is preserved by putting it last in the list.
(save-selected-window-alist
(apply 'append
(mapcar (lambda (terminal)
(let ((frames (frames-on-display-list terminal))
(top-frame (tty-top-frame terminal))
alist)
(if top-frame
(setq frames
(cons top-frame
(delq top-frame frames))))
(dolist (f frames)
(push (cons f (frame-selected-window f))
alist))))
(terminal-list)))))
`(let ((save-selected-window--state (internal--before-save-selected-window)))
(save-current-buffer
(unwind-protect
(progn ,@body)
(dolist (elt save-selected-window-alist)
(and (frame-live-p (car elt))
(window-live-p (cdr elt))
(set-frame-selected-window (car elt) (cdr elt) 'norecord)))
(when (window-live-p save-selected-window-window)
(select-window save-selected-window-window 'norecord))))))
(internal--after-save-selected-window save-selected-window--state)))))
(defvar temp-buffer-window-setup-hook nil
"Normal hook run by `with-temp-buffer-window' before buffer display.
@ -5812,6 +5818,26 @@ buffer with the name BUFFER-OR-NAME and return that buffer."
buffer))
(other-buffer)))
(defcustom switch-to-buffer-preserve-window-point nil
"If non-nil, `switch-to-buffer' tries to preserve `window-point'.
If this is nil, `switch-to-buffer' displays the buffer at that
buffer's `point'. If this is `already-displayed', it tries to
display the buffer at its pevious position in the selected
window, provided the buffer is currently displayed in some other
window on any visible or iconified frame. If this is t, it
unconditionally tries to display the buffer at its previous
position in the selected window.
This variable is ignored if the the buffer is already displayed
in the selected window or never appeared in it before, or if
`switch-to-buffer' calls `pop-to-buffer' to display the buffer."
:type '(choice
(const :tag "Never" nil)
(const :tag "If already displayed elsewhere" already-displayed)
(const :tag "Always" t))
:group 'windows
:version "24.3")
(defun switch-to-buffer (buffer-or-name &optional norecord force-same-window)
"Switch to buffer BUFFER-OR-NAME in the selected window.
If the selected window cannot display the specified
@ -5837,6 +5863,10 @@ If optional argument FORCE-SAME-WINDOW is non-nil, the buffer
must be displayed in the selected window; if that is impossible,
signal an error rather than calling `pop-to-buffer'.
The option `switch-to-buffer-preserve-window-point' can be used
to make the buffer appear at its last position in the selected
window.
Return the buffer switched to."
(interactive
(list (read-buffer-to-switch "Switch to buffer: ") nil 'force-same-window))
@ -5853,7 +5883,19 @@ Return the buffer switched to."
(if force-same-window
(user-error "Cannot switch buffers in a dedicated window")
(pop-to-buffer buffer norecord)))
(t (set-window-buffer nil buffer)))
(t
(let* ((entry (assq buffer (window-prev-buffers)))
(displayed (and (eq switch-to-buffer-preserve-window-point
'already-displayed)
(get-buffer-window buffer 0))))
(set-window-buffer nil buffer)
(when (and entry
(or (eq switch-to-buffer-preserve-window-point t)
displayed))
;; Try to restore start and point of buffer in the selected
;; window (Bug#4041).
(set-window-start (selected-window) (nth 1 entry) t)
(set-window-point nil (nth 2 entry))))))
(unless norecord
(select-window (selected-window)))

View file

@ -1,3 +1,7 @@
2012-10-08 Eli Zaretskii <eliz@gnu.org>
* sed1v2.inp (W32_LIBS, W32_OBJ): Edit to empty.
2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
Merge from gnulib.

View file

@ -128,6 +128,8 @@ s/\.h\.in/.h-in/
/^CANNOT_DUMP *=/s/@CANNOT_DUMP@/no/
/^DEPFLAGS *=/s/@DEPFLAGS@//
/^MKDEPDIR *=/s/@MKDEPDIR@//
/^W32_OBJ *=/s/@W32_OBJ@//
/^W32_LIBS *=/s/@W32_LIBS@//
/^version *=/s/@[^@\n]*@//
/^@SET_MAKE@$/s/@SET_MAKE@//
/^ [ ]*\$(libsrc)\/make-docfile.*>.*\/DOC/s!make-docfile!make-docfile -o $(etc)/DOC!

View file

@ -1,3 +1,8 @@
2012-10-08 Juanma Barranquero <lekktu@gmail.com>
* config.nt: Sync with autogen/config.in.
(HAVE_NTGUI): New macro.
2012-10-02 Eli Zaretskii <eliz@gnu.org>
* preprep.c (RVA_TO_PTR): Cast the result to 'void *', to avoid

View file

@ -701,6 +701,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
Mac OS X. */
#undef HAVE_NS
/* Define to use native Windows GUI. */
#define HAVE_NTGUI 1
/* Define to 1 if libotf has OTF_get_variation_glyphs. */
#undef HAVE_OTF_GET_VARIATION_GLYPHS

View file

@ -1,10 +1,368 @@
2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
* marker.c (cached_modiff): EMACS_INT, not int.
* w32select.c (waiting_for_input): Declare by including "keyboard.h"
instead of having a wrong decl.
* nsmenu.m (waiting_for_input): Remove wrong decl.
2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
keyboard.c, keymap.c: Use bool for booleans.
* dispnew.c (sit_for): Distinguish between 3-way display_option
and boolean do_display.
* keyboard.c (single_kboard, this_command_key_count_reset)
(waiting_for_input, echoing, immediate_quit, input_pending)
(interrupt_input, interrupts_deferred, pop_kboard)
(temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
(command_loop_1, adjust_point_for_property)
(safe_run_hooks_error, input_polling_used, read_char):
(help_char_p, readable_events, kbd_buffer_events_waiting)
(kbd_buffer_get_event, timer_check_2, make_lispy_event)
(lucid_event_type_list_p, get_input_pending):
(gobble_input, menu_separator_name_p, menu_bar_item)
(parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
(read_char_minibuf_menu_prompt, access_keymap_keyremap)
(keyremap_step, test_undefined, read_key_sequence)
(detect_input_pending, detect_input_pending_ignore_squeezables)
(detect_input_pending_run_timers, requeued_events_pending_p)
(quit_throw_to_read_char, Fset_input_interrupt_mode):
* keymap.c (get_keymap, keymap_parent, keymap_memberp)
(access_keymap_1, access_keymap, map_keymap, get_keyelt)
(Fdefine_key, Flookup_key, struct accessible_keymaps_data)
(accessible_keymaps_1, Fkey_description, push_key_description):
(shadow_lookup, struct where_is_internal_data)
(where_is_internal, Fwhere_is_internal, where_is_internal_1)
(Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
(describe_map, describe_vector):
* menu.c (single_menu_item):
* nsmenu.m (ns_update_menubar):
* process.c (wait_reading_process_output):
* search.c (scan_buffer, scan_newline):
Use bool for boolean.
* keyboard.c (timers_run, swallow_events)
(detect_input_pending_run_timers):
* process.c (wait_reading_process_output):
Use unsigned for counter where wraparound-on-overflow is desired,
since unsigned is guaranteed to have that behavior and signed is not.
(read_char): Use ptrdiff_t for string length.
(get_input_pending): Remove first argument, since it was always
the same pointer-to-int (now pointer-to-boolean) &input_pending,
and behave as if it had that value. Return new value of
input_pending. All callers changed.
* keyboard.h (struct kboard): Use unsigned : 1 for boolean member
immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
a string length.
* keymap.c (push_key_description): Omit last arg, which was always 1.
All callers changed.
* regex.c (immediate_quit) [emacs]: Remove duplicate decl.
2012-10-10 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
($(BLD)/term.$(O)): Update dependencies.
2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
* alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
* lisp.h (enum pvec_type): Adjust comments and omit explicit
initializer for PVEC_NORMAL_VECTOR.
2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
Clean out old termopts cruft.
* termopts.h (flow_control, meta_key): Remove unused decls.
* dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
Don't include termopts.h.
2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
* alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
* commands.h (immediate_quit): Remove duplicate decl.
2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
* nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
caching.
(nsfont_open): Remove setting of Vfonts_in_cache.
(syms_of_nsfont): Remove initialization of Vfonts_in_cache
2012-10-09 Eli Zaretskii <eliz@gnu.org>
* w32fns.c (w32_last_error): Change the return value to DWORD, to
match what GetLastError returns. Explain why the function is
needed.
* frame.c (delete_frame): Rename local variable 'tooltip_frame' to
'is_tooltip_frame', to avoid confusion with its global namesake.
2012-10-08 Daniel Colascione <dancol@dancol.org>
* xdisp.c (start_hourglass): Call w32_note_current_window when
HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
build that caused Emacs to display the hourglass cursor forever.
* w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
which is broken under remote desktop, calculate the number of
colors available for a display based on the display's number of
planes and number of bits per pixel per plane. (bug#10397).
2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
* nsfont.m (Vfonts_in_cache): New variable.
(nsfont_open): Use unsignedLongLongValue for cache in case wide ints
are used. Add cached fonts to Vfonts_in_cache.
(syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
2012-10-08 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
in nt/config.nt.
(FONT_H): Define after FRAME_H.
($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
Update dependencies.
* w32term.c: Remove leftover declaration of keyboard_codepage.
2012-10-08 Eli Zaretskii <eliz@gnu.org>
* makefile.w32-in (FONT_H): Add $(FRAME_H).
(W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
(GLOBAL_SOURCES): Add cygw32.c.
($(BLD)/unexw32.$(O)):
($(BLD)/w32.$(O)):
($(BLD)/w32console.$(O)):
($(BLD)/w32fns.$(O)):
($(BLD)/w32heap.$(O)):
($(BLD)/w32menu.$(O)):
($(BLD)/w32proc.$(O)): Add w32common.h.
* w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
'const char *'.
(x_to_w32_color): Don't modify the argument, modify a copy instead.
2012-10-08 Daniel Colascione <dancol@dancol.org>
* w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
(WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
accidental message numbering hole. Change other messages to
match.
* w32select.h (HAVE_W32SELECT): Remove.
* w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
w32common.h instead of w32heap.h
* w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
(get_allocation_unit, get_processor_type, get_w32_major_version)
(get_w32_minor_version, sysinfo_cache, osinfo_cache)
(w32_major_version, w32_minor_version, w32_build_number, OS_9X)
(OS_NT, os_subtype, cache_system_info): Move declarations to
w32common.
* w32heap.c: Include w32common.h.
(sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
(w32_minor_version, w32_build_number, w32_subtype): Remove
duplicate definitions.
* w32fns.c: Include w32common.h; include w32heap.h only in
WINDOWSNT.
(Fx_file_dialog): Clarify comment on GetOpenFileName structure.
Use `report_file_error' instead of `error' in order to better
inform users of what went wrong. Increase NTGUI_UNICODE file
dialog box file name length to 32k, the maximum allowed by the NT
kernel.
* w32common.h: New file.
(ROUND_UP, ROUND_DOWN, get_page_size)
(get_allocation_unit, get_processor_type, get_w32_major_version)
(get_w32_minor_version, sysinfo_cache, osinfo_cache)
(w32_major_version, w32_minor_version, w32_build_number, OS_9X)
(OS_NT, os_subtype, cache_system_info): Move here.
* unexw32.c, unexcw.c: Include w32common.h.
* emacs.c (main): Use (defined (WINDOWSNT) || defined
HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
to call syms_of_w32select.
* cygw32.h: Remove obsolete EXFUN declarations.
* cygw32.c (Qutf_16_le): Rename to Qutf_16le.
* Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
of w32inevt.o from SOME_MACHINE_OBJECTS.
2012-10-08 Daniel Colascione <dancol@dancol.org>
* image.c: Permanent fix for JPEG compilation issue --- limit
jpeglib `boolean' redefinition to Cygwin builds.
2012-10-08 Eli Zaretskii <eliz@gnu.org>
* image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
* emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
Cygwin.
2012-10-08 Daniel Colascione <dancol@dancol.org>
* xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
now a supported configuration.
* Makefile.in: consolidate image variables into LIBIMAGE; add
W32_OBJ and W32_LIBS. Compile new files.
* conf_post.h:
(_DebPrint) declare tracing facility for W32 debugging. We need
to unify tracing later.
(NTGUI_UNICODE) Define when compiling for Cygwin to allow the
unconditional use of W32 Unicode functions. Cygwin runs only on
100% Unicode operating systems.
* cygw32.c: New file. Define Cygwin-specific facilities.
(Fcygwin_convert_path_to_windows)
(Fcygwin_convert_path_from_windows): New user functions for
accessing Cygwin path-munging routines.
* cygw32.h: New file.
(WCSDATA, to_unicode, from_unicode): Define facilities for storing
UTF-16LE strings temporarily inside non-Lisp-visible string
objects.
(w32_strerror): Just what it says on the tin.
* emacs.c: Make the NS fork-then-exec code for daemon-launching
also run for Cygwin; both systems have the same problem with using
GUI facilities in a forked child. Also call syms_of_cygw32,
syms_of_w32select in correct places.
(DAEMON_MUST_EXEC): new macro defined to signal that a platform
needs fork-then-exec for daemon launching.
* font.h: Include frame.h.
* image.c: Use the image library cache machinery only when we're
compiling for native WINDOWSNT; Cygwin can use shared libraries
like any other Unixlike system.
* keyboard.c: Clarify a comment regarding the input loop.
* menu.c: When NTGUI_UNICODE is defined, use Unicode menu
functions directly instead of trying to detect at runtime that our
host operating system supports them. We make this change for two
reasons: Cygwin lacks support for the multibyte character
conversion functions used by the legacy menu code, and Cygwin
never needs to rely on non-Unicode APIs.
* unexw32.c (hinst): Declare extern.
* w32.c: Change header order;
(w32_strerror): Move to w32fns.c because we need it for
non-WINDOWSNT builds.
* w32.h: Add #error macro to make sure we don't include w32.h for
Cygwin builds. Remove w32select declarations.
* w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
w32fns.c. w32console.c is WINDOWSNT-only.
* w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
POSIXy alternative.
(faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
(w32_major_version, w32_minor_version, w32_build_number)
(os_subtype, sound_type): Define here
(w32_defined_color): Make color parameter const for consistency
with other _defined_color functions.
(w32_createwindow): Unconditionally call w32_init_class instead of
doing so only when hprevinst is non-NULL. Plumbing hprevinst
through the code is complex and unnecessary because class
registration is practically free.
(w32_name_of_message): New EMACSDEBUG-only function.
(Fset_message_beep): Move here
(Fx_open_connection): Require that the display name for Windows be
"w32" for consistency, emacsclient disambiguation, and maybe, one
day, multi-window-system support.
(file_dialog_callback): NTGUI_UNICODE changes; encode and decode
Cygwin files for W32 GUI facilities, since these clearly don't
expect Cygwin names.
(_DebPrint): Define.
(w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
(w32_kbd_patch_key, w32_sys_ring_bell): Move here.
(Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
(w32_last_error): Remove.
* w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
* w32heap.c (syspage_mask): Declare here.
(cache_system_info): Remove.
* w32inevt.c (faked_key): Define globally, not statically.
(w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
(w32_console_toggle_lock_key): Move to w32fns.c.
* w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
* w32proc.c (_DebPrint): Move to w32fns.c.
* w32select.c: Include string.h, stdio.h for Cygwin.
* w32select.h: New File.
* w32term.c: Include io.h for non-CYGWIN builds; needed for
get_osfhandle.
(w32_message_fd): New variable. Under Cygwin, holds the file
descriptor the system used to tell us about pending thread
messages.
(w32_init_term): Remove incorrect calls to fcntl and init_sigio
that prevented compilation under non-WINDOWSNT systems.
(w32_initialize): Open /dev/windows and assign it to
w32_message_fd. Provide w32 feature.
* w32term.h: Include frame.h, atimer.h. Declare various frame functions.
(WM_EMACS_INPUT_READY): add.
(prepend_msg, w32_message_fd): Declare globally.
* w32xfns.c:
(keyboard_handle): Use only when WINDOWSNT.
(notify_msg_ready): New function. Posts a message to the main
thread's message queue under CYGWIN, which wakes up the main
thread from select(2) by making the /dev/windows file descriptor
ready. Under WINDOWSNT, it sets an event the same way the old
code did.
(post, prepend_msg): Actually call notify_msg_ready instead of
setting the input event directly.
2012-10-07 Eli Zaretskii <eliz@gnu.org>
* ralloc.c (relinquish): If a heap is ready to be relinquished,
but it still has blocs in it, don't return it to the system,
instead of aborting. (Bug#12402)
2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (ns_dumpglyphs_image): Only draw slize of image (Bug#12506).
* nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
* nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
MAC_OS_X_VERSION_10_6.
(syms_of_nsterm): Remove comment about Panther and above for ns-antialias-text.
(syms_of_nsterm): Remove comment about Panther and above for
ns-antialias-text.
* nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
(EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
(struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
@ -12,7 +370,8 @@
* nsselect.m (ns_string_from_pasteboard): Remove check for >=
MAC_OS_X_VERSION_10_4.
* nsmenu.m (fillWithWidgetValue:): Remove code for < MAC_OS_X_VERSION_10_2.
* nsmenu.m (fillWithWidgetValue:): Remove code for <
MAC_OS_X_VERSION_10_2.
* nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
@ -21,13 +380,13 @@
* nsterm.m (ns_in_resize): Remove (Bug#12479).
(ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
(ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove ns_in_resize
check.
(ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove
ns_in_resize check.
(ns_clear_frame_area): Remove resize handle code.
* nsfns.m (ns_in_resize): Remove.
(x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove ns_in_resize
check.
(x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
ns_in_resize check.
2012-10-07 Paul Eggert <eggert@cs.ucla.edu>

View file

@ -135,13 +135,10 @@ LIB_MATH=@LIB_MATH@
## -lpthreads, or empty.
LIB_PTHREAD=@LIB_PTHREAD@
LIBTIFF=@LIBTIFF@
LIBJPEG=@LIBJPEG@
LIBPNG=@LIBPNG@
LIBGIF=@LIBGIF@
LIBXPM=@LIBXPM@
LIBIMAGE=@LIBTIFF@ @LIBJPEG@ @LIBPNG@ @LIBGIF@ @LIBXPM@
XFT_LIBS=@XFT_LIBS@
LIBX_EXTRA=$(LIBTIFF) $(LIBJPEG) $(LIBPNG) $(LIBGIF) $(LIBXPM) -lX11 $(XFT_LIBS)
LIBX_EXTRA=-lX11 $(XFT_LIBS)
FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
@ -261,6 +258,13 @@ NS_OBJ=@NS_OBJ@
NS_OBJC_OBJ=@NS_OBJC_OBJ@
## Only set if NS_IMPL_GNUSTEP.
GNU_OBJC_CFLAGS=@GNU_OBJC_CFLAGS@
## w32fns.o w32menu.c w32reg.o fringe.o fontset.o w32font.o w32term.o
## w32xfns.o w32select.o image.o w32uniscribe.o if HAVE_W32, else
## empty.
W32_OBJ=@W32_OBJ@
## -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32 lusp10 -lcomctl32
## --lwinspool if HAVE_W32, else empty.
W32_LIBS=@W32_LIBS@
## Empty if !HAVE_X_WINDOWS
## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT
@ -342,7 +346,7 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
doprnt.o intervals.o textprop.o composite.o xml.o \
profiler.o \
$(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
$(WINDOW_SYSTEM_OBJ)
$(W32_OBJ) $(WINDOW_SYSTEM_OBJ)
obj = $(base_obj) $(NS_OBJC_OBJ)
## Object files used on some machine or other.
@ -351,7 +355,7 @@ obj = $(base_obj) $(NS_OBJC_OBJ)
## in the list, in case they ever add any such entries.
SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
fontset.o dbusbind.o \
fontset.o dbusbind.o cygw32.o \
nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
@ -385,9 +389,11 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
## Note that SunOS needs -lm to come before -lc; otherwise, you get
## duplicated symbols. If the standard libraries were compiled
## with GCC, we might need LIB_GCC again after them.
LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \
$(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) $(LIB_TIMER_TIME) \
$(DBUS_LIBS) $(LIB_EXECINFO) \
LIBES = $(LIBS) $(W32_LIBS) $(LIBX_BASE) $(LIBIMAGE) \
$(LIBX_OTHER) $(LIBSOUND) \
$(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) \
$(LIB_TIMER_TIME) $(DBUS_LIBS) \
$(LIB_EXECINFO) \
$(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \
$(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \
$(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \

View file

@ -5689,7 +5689,7 @@ mark_object (Lisp_Object arg)
pvectype = ((ptr->header.size & PVEC_TYPE_MASK)
>> PSEUDOVECTOR_SIZE_BITS);
else
pvectype = 0;
pvectype = PVEC_NORMAL_VECTOR;
if (pvectype != PVEC_SUBR && pvectype != PVEC_BUFFER)
CHECK_LIVE (live_vector_p);
@ -6311,19 +6311,14 @@ gc_sweep (void)
/* Free all unmarked buffers */
{
register struct buffer *buffer = all_buffers, *prev = 0, *next;
register struct buffer *buffer, **bprev = &all_buffers;
total_buffers = 0;
while (buffer)
for (buffer = all_buffers; buffer; buffer = *bprev)
if (!VECTOR_MARKED_P (buffer))
{
if (prev)
prev->header.next = buffer->header.next;
else
all_buffers = buffer->header.next.buffer;
next = buffer->header.next.buffer;
*bprev = buffer->header.next.buffer;
lisp_free (buffer);
buffer = next;
}
else
{
@ -6331,7 +6326,7 @@ gc_sweep (void)
/* Do not use buffer_(set|get)_intervals here. */
buffer->text->intervals = balance_intervals (buffer->text->intervals);
total_buffers++;
prev = buffer, buffer = buffer->header.next.buffer;
bprev = &buffer->header.next.buffer;
}
}

View file

@ -36,9 +36,6 @@ extern Lisp_Object control_x_map;
events until a non-ASCII event is acceptable as input. */
extern Lisp_Object unread_switch_frame;
/* Nonzero means ^G can quit instantly */
extern int immediate_quit;
/* Nonzero if input is coming from the keyboard */
#define INTERACTIVE (NILP (Vexecuting_kbd_macro) && !noninteractive)

View file

@ -142,6 +142,20 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
#endif
#endif
#if defined HAVE_NTGUI && !defined DebPrint
# ifdef EMACSDEBUG
extern void _DebPrint (const char *fmt, ...);
# define DebPrint(stuff) _DebPrint stuff
# else
# define DebPrint(stuff)
# endif
#endif
#if defined CYGWIN && defined HAVE_NTGUI
# define NTGUI_UNICODE /* Cygwin runs only on UNICODE-supporting systems */
# define _WIN32_WINNT 0x500 /* Win2k */
#endif
#ifdef emacs /* Don't do this for lib-src. */
/* Tell regex.c to use a type compatible with Emacs. */
#define RE_TRANSLATE_TYPE Lisp_Object

169
src/cygw32.c Normal file
View file

@ -0,0 +1,169 @@
/* Cygwin support routines.
Copyright (C) 2011-2012 Free Software Foundation, Inc.
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 <http://www.gnu.org/licenses/>. */
#include "cygw32.h"
#include "character.h"
#include "buffer.h"
#include <unistd.h>
#include <fcntl.h>
static Lisp_Object Qutf_16le;
static Lisp_Object
fchdir_unwind (Lisp_Object dir_fd)
{
(void) fchdir (XFASTINT (dir_fd));
(void) close (XFASTINT (dir_fd));
return Qnil;
}
static void
chdir_to_default_directory ()
{
Lisp_Object new_cwd;
int old_cwd_fd = open (".", O_RDONLY | O_DIRECTORY);
if (old_cwd_fd == -1)
error ("could not open current directory: %s", strerror (errno));
record_unwind_protect (fchdir_unwind, make_number (old_cwd_fd));
new_cwd = Funhandled_file_name_directory (
Fexpand_file_name (build_string ("."), Qnil));
if (!STRINGP (new_cwd))
new_cwd = build_string ("/");
if (chdir (SDATA (ENCODE_FILE (new_cwd))))
error ("could not chdir: %s", strerror (errno));
}
static Lisp_Object
conv_filename_to_w32_unicode (Lisp_Object in, int absolute_p)
{
ssize_t converted_len;
Lisp_Object converted;
unsigned flags;
int count = SPECPDL_INDEX ();
chdir_to_default_directory ();
flags = CCP_POSIX_TO_WIN_W;
if (!absolute_p) {
flags |= CCP_RELATIVE;
}
in = ENCODE_FILE (in);
converted_len = cygwin_conv_path (flags, SDATA (in), NULL, 0);
if (converted_len < 2)
error ("cygwin_conv_path: %s", strerror (errno));
converted = make_uninit_string (converted_len - 1);
if (cygwin_conv_path (flags, SDATA (in),
SDATA (converted), converted_len))
error ("cygwin_conv_path: %s", strerror (errno));
return unbind_to (count, converted);
}
static Lisp_Object
conv_filename_from_w32_unicode (const wchar_t* in, int absolute_p)
{
ssize_t converted_len;
Lisp_Object converted;
unsigned flags;
int count = SPECPDL_INDEX ();
chdir_to_default_directory ();
flags = CCP_WIN_W_TO_POSIX;
if (!absolute_p) {
flags |= CCP_RELATIVE;
}
converted_len = cygwin_conv_path (flags, in, NULL, 0);
if (converted_len < 1)
error ("cygwin_conv_path: %s", strerror (errno));
converted = make_uninit_string (converted_len - 1 /*subtract terminator*/);
if (cygwin_conv_path (flags, in, SDATA (converted), converted_len))
error ("cygwin_conv_path: %s", strerror (errno));
return unbind_to (count, DECODE_FILE (converted));
}
Lisp_Object
from_unicode (Lisp_Object str)
{
CHECK_STRING (str);
if (!STRING_MULTIBYTE (str) &&
SBYTES (str) & 1)
{
str = Fsubstring (str, make_number (0), make_number (-1));
}
return code_convert_string_norecord (str, Qutf_16le, 0);
}
wchar_t *
to_unicode (Lisp_Object str, Lisp_Object *buf)
{
*buf = code_convert_string_norecord (str, Qutf_16le, 1);
/* We need to make a another copy (in addition to the one made by
code_convert_string_norecord) to ensure that the final string is
_doubly_ zero terminated --- that is, that the string is
terminated by two zero bytes and one utf-16le null character.
Because strings are already terminated with a single zero byte,
we just add one additional zero. */
str = make_uninit_string (SBYTES (*buf) + 1);
memcpy (SDATA (str), SDATA (*buf), SBYTES (*buf));
SDATA (str) [SBYTES (*buf)] = '\0';
*buf = str;
return WCSDATA (*buf);
}
DEFUN ("cygwin-convert-path-to-windows",
Fcygwin_convert_path_to_windows, Scygwin_convert_path_to_windows,
1, 2, 0,
doc: /* Convert PATH to a Windows path. If ABSOLUTE-P if
non-nil, return an absolute path.*/)
(Lisp_Object path, Lisp_Object absolute_p)
{
return from_unicode (
conv_filename_to_w32_unicode (path, absolute_p == Qnil ? 0 : 1));
}
DEFUN ("cygwin-convert-path-from-windows",
Fcygwin_convert_path_from_windows, Scygwin_convert_path_from_windows,
1, 2, 0,
doc: /* Convert a Windows path to a Cygwin path. If ABSOLUTE-P
if non-nil, return an absolute path.*/)
(Lisp_Object path, Lisp_Object absolute_p)
{
return conv_filename_from_w32_unicode (to_unicode (path, &path),
absolute_p == Qnil ? 0 : 1);
}
void
syms_of_cygw32 (void)
{
/* No, not utf-16-le: that one has a BOM. */
DEFSYM (Qutf_16le, "utf-16le");
defsubr (&Scygwin_convert_path_from_windows);
defsubr (&Scygwin_convert_path_to_windows);
}

53
src/cygw32.h Normal file
View file

@ -0,0 +1,53 @@
/* Header for Cygwin support routines.
Copyright (C) 2011-2012 Free Software Foundation, Inc.
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 <http://www.gnu.org/licenses/>. */
#ifndef CYGW32_H
#define CYGW32_H
#include <config.h>
#include <windef.h>
#include <sys/cygwin.h>
#include <wchar.h>
#include <signal.h>
#include <stdio.h>
#include <limits.h>
#include <errno.h>
#include <math.h>
#include <setjmp.h>
#include "lisp.h"
#include "coding.h"
/* *** Character conversion *** */
/* Access the wide-character string stored in a Lisp string object. */
#define WCSDATA(x) ((wchar_t *) SDATA (x))
/* Convert the multi-byte string in STR to UTF-16LE encoded unibyte
string, and store it in *BUF. BUF may safely point to STR on entry. */
extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf);
/* Convert STR, a UTF-16LE encoded string embedded in a unibyte string
object, to a multi-byte Emacs string, and return it. */
extern Lisp_Object from_unicode (Lisp_Object str);
/* *** Misc *** */
extern void syms_of_cygw32 (void);
extern char * w32_strerror (int error_no);
#endif /* CYGW32_H */

View file

@ -3144,7 +3144,7 @@ int draw_window_fringes (struct window *, int);
int update_window_fringes (struct window *, int);
void compute_fringe_widths (struct frame *, int);
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
void w32_init_fringe (struct redisplay_interface *);
void w32_reset_fringes (void);
#endif
@ -3247,7 +3247,7 @@ extern char unspecified_fg[], unspecified_bg[];
#ifdef HAVE_X_WINDOWS
void gamma_correct (struct frame *, XColor *);
#endif
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
void gamma_correct (struct frame *, COLORREF *);
#endif

View file

@ -26,7 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "lisp.h"
#include "termchar.h"
#include "termopts.h"
/* cm.h must come after dispextern.h on Windows. */
#include "dispextern.h"
#include "cm.h"
@ -5919,15 +5918,16 @@ additional wait period, in milliseconds; this is for backwards compatibility.
TIMEOUT is number of seconds to wait (float or integer),
or t to wait forever.
READING is true if reading input.
If DO_DISPLAY is >0 display process output while waiting.
If DO_DISPLAY is >1 perform an initial redisplay before waiting.
If DISPLAY_OPTION is >0 display process output while waiting.
If DISPLAY_OPTION is >1 perform an initial redisplay before waiting.
*/
Lisp_Object
sit_for (Lisp_Object timeout, bool reading, int do_display)
sit_for (Lisp_Object timeout, bool reading, int display_option)
{
intmax_t sec;
int nsec;
bool do_display = display_option > 0;
swallow_events (do_display);
@ -5935,7 +5935,7 @@ sit_for (Lisp_Object timeout, bool reading, int do_display)
|| !NILP (Vexecuting_kbd_macro))
return Qnil;
if (do_display >= 2)
if (display_option > 1)
redisplay_preserve_echo_area (2);
if (INTEGERP (timeout))

View file

@ -33,9 +33,17 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef WINDOWSNT
#include <fcntl.h>
#include <windows.h> /* just for w32.h */
#include "w32.h"
#include "w32heap.h" /* for prototype of sbrk */
#include "w32heap.h"
#endif
#if defined WINDOWSNT || defined HAVE_NTGUI
#include "w32select.h"
#include "w32font.h"
#endif
#if defined HAVE_NTGUI && defined CYGWIN
#include "cygw32.h"
#endif
#ifdef HAVE_WINDOW_SYSTEM
@ -156,6 +164,22 @@ static void *my_heap_start;
static uprintmax_t heap_bss_diff;
#endif
/* To run as a daemon under Cocoa or Windows, we must do a fork+exec,
not a simple fork.
On Cocoa, CoreFoundation lib fails in forked process:
http://developer.apple.com/ReleaseNotes/
CoreFoundation/CoreFoundation.html)
On Windows, a Cygwin fork child cannot access the USER subsystem.
We mark being in the exec'd process by a daemon name argument of
form "--daemon=\nFD0,FD1\nNAME" where FD are the pipe file descriptors,
NAME is the original daemon name, if any. */
#if defined NS_IMPL_COCOA || (defined HAVE_NTGUI && defined CYGWIN)
# define DAEMON_MUST_EXEC
#endif
/* True means running Emacs without interactive terminal. */
bool noninteractive;
@ -669,7 +693,7 @@ main (int argc, char **argv)
bool no_loadup = 0;
char *junk = 0;
char *dname_arg = 0;
#ifdef NS_IMPL_COCOA
#ifdef DAEMON_MUST_EXEC
char dname_arg2[80];
#endif
char *ch_to_dir;
@ -964,25 +988,19 @@ main (int argc, char **argv)
exit (1);
}
#ifndef NS_IMPL_COCOA
#ifndef DAEMON_MUST_EXEC
#ifdef USE_GTK
fprintf (stderr, "\nWarning: due to a long standing Gtk+ bug\nhttp://bugzilla.gnome.org/show_bug.cgi?id=85715\n\
Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.\n\
Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.\n");
#endif
#endif /* USE_GTK */
f = fork ();
#else /* NS_IMPL_COCOA */
/* Under Cocoa we must do fork+exec as CoreFoundation lib fails in
forked process: http://developer.apple.com/ReleaseNotes/
CoreFoundation/CoreFoundation.html)
We mark being in the exec'd process by a daemon name argument of
form "--daemon=\nFD0,FD1\nNAME" where FD are the pipe file descriptors,
NAME is the original daemon name, if any. */
#else /* DAEMON_MUST_EXEC */
if (!dname_arg || !strchr (dname_arg, '\n'))
f = fork (); /* in orig */
else
f = 0; /* in exec'd */
#endif /* NS_IMPL_COCOA */
#endif /* !DAEMON_MUST_EXEC */
if (f > 0)
{
int retval;
@ -1018,7 +1036,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
exit (1);
}
#ifdef NS_IMPL_COCOA
#ifdef DAEMON_MUST_EXEC
{
/* In orig process, forked as child, OR in exec'd. */
if (!dname_arg || !strchr (dname_arg, '\n'))
@ -1054,7 +1072,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
dname_arg2);
dname_arg = *dname_arg2 ? dname_arg2 : NULL;
}
#endif /* NS_IMPL_COCOA */
#endif /* DAEMON_MUST_EXEC */
if (dname_arg)
daemon_name = xstrdup (dname_arg);
@ -1357,6 +1375,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
#ifdef WINDOWSNT
syms_of_ntproc ();
#endif /* WINDOWSNT */
#if defined CYGWIN && defined HAVE_NTGUI
syms_of_cygw32 ();
#endif
syms_of_window ();
syms_of_xdisp ();
syms_of_font ();
@ -1387,11 +1408,14 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
#ifdef HAVE_NTGUI
syms_of_w32term ();
syms_of_w32fns ();
syms_of_w32select ();
syms_of_w32menu ();
syms_of_fontset ();
#endif /* HAVE_NTGUI */
#if defined WINDOWSNT || defined HAVE_NTGUI
syms_of_w32select ();
#endif
#ifdef MSDOS
syms_of_xmenu ();
syms_of_dosfns ();
@ -1436,8 +1460,11 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
globals_of_w32font ();
globals_of_w32fns ();
globals_of_w32menu ();
globals_of_w32select ();
#endif /* HAVE_NTGUI */
#if defined WINDOWSNT || defined HAVE_NTGUI
globals_of_w32select ();
#endif
}
init_charset ();

View file

@ -5208,9 +5208,9 @@ EMACS_FONT_LOG is set. Otherwise, it is set to t. */);
#ifdef HAVE_BDFFONT
syms_of_bdffont ();
#endif /* HAVE_BDFFONT */
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
syms_of_w32font ();
#endif /* WINDOWSNT */
#endif /* HAVE_NTGUI */
#ifdef HAVE_NS
syms_of_nsfont ();
#endif /* HAVE_NS */

View file

@ -23,6 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define EMACS_FONT_H
#include "ccl.h"
#include "frame.h"
/* We have three types of Lisp objects related to font.
@ -818,11 +819,11 @@ extern struct font_driver ftxfont_driver;
extern void syms_of_bdffont (void);
#endif /* HAVE_BDFFONT */
#endif /* HAVE_X_WINDOWS */
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
extern struct font_driver w32font_driver;
extern struct font_driver uniscribe_font_driver;
extern void syms_of_w32font (void);
#endif /* WINDOWSNT */
#endif /* HAVE_NTGUI */
#ifdef HAVE_NS
extern Lisp_Object Qfontsize;
extern struct font_driver nsfont_driver;

View file

@ -42,7 +42,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_X_WINDOWS
#include "xterm.h"
#endif
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
#include "w32term.h"
#endif
#ifdef HAVE_NS

View file

@ -1124,7 +1124,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
struct frame *sf = SELECTED_FRAME ();
struct kboard *kb;
int minibuffer_selected, tooltip_frame;
int minibuffer_selected, is_tooltip_frame;
if (EQ (frame, Qnil))
{
@ -1176,13 +1176,13 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
}
}
tooltip_frame = !NILP (Fframe_parameter (frame, intern ("tooltip")));
is_tooltip_frame = !NILP (Fframe_parameter (frame, intern ("tooltip")));
/* Run `delete-frame-functions' unless FORCE is `noelisp' or
frame is a tooltip. FORCE is set to `noelisp' when handling
a disconnect from the terminal, so we don't dare call Lisp
code. */
if (NILP (Vrun_hooks) || tooltip_frame)
if (NILP (Vrun_hooks) || is_tooltip_frame)
;
else if (EQ (force, Qnoelisp))
pending_funcalls
@ -1461,7 +1461,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
}
/* Cause frame titles to update--necessary if we now have just one frame. */
if (!tooltip_frame)
if (!is_tooltip_frame)
update_mode_lines = 1;
return Qnil;
@ -2697,7 +2697,7 @@ static const struct frame_parm_table frame_parms[] =
{"tool-bar-position", &Qtool_bar_position},
};
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
/* Calculate fullscreen size. Return in *TOP_POS and *LEFT_POS the
wanted positions of the WM window (not Emacs window).
@ -2741,7 +2741,7 @@ x_fullscreen_adjust (struct frame *f, int *width, int *height, int *top_pos, int
*height = newheight;
}
#endif /* WINDOWSNT */
#endif /* HAVE_NTGUI */
#ifdef HAVE_WINDOW_SYSTEM

View file

@ -618,7 +618,7 @@ typedef struct frame *FRAME_PTR;
#define FRAME_INITIAL_P(f) ((f)->output_method == output_initial)
#define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap)
#define FRAME_X_P(f) ((f)->output_method == output_x_window)
#ifndef WINDOWSNT
#ifndef HAVE_NTGUI
#define FRAME_W32_P(f) (0)
#else
#define FRAME_W32_P(f) ((f)->output_method == output_w32)
@ -1210,7 +1210,7 @@ extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int);
extern Lisp_Object Qface_set_after_frame_default;
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
extern void x_fullscreen_adjust (struct frame *f, int *, int *,
int *, int *);
#endif
@ -1282,6 +1282,7 @@ extern char *x_get_resource_string (const char *, const char *);
#endif
extern void x_query_colors (struct frame *f, XColor *, int);
extern void x_query_color (struct frame *f, XColor *);
#endif /* HAVE_WINDOW_SYSTEM */

View file

@ -75,7 +75,12 @@ typedef struct x_bitmap_record Bitmap_Record;
#endif /* HAVE_X_WINDOWS */
#ifdef HAVE_NTGUI
#include "w32.h"
/* We need (or want) w32.h only when we're _not_ compiling for Cygwin. */
#ifdef WINDOWSNT
# include "w32.h"
#endif
/* W32_TODO : Color tables on W32. */
#undef COLOR_TABLE_SUPPORT
@ -560,8 +565,9 @@ static struct image_type *lookup_image_type (Lisp_Object);
static void x_laplace (struct frame *, struct image *);
static void x_emboss (struct frame *, struct image *);
static void x_build_heuristic_mask (struct frame *, struct image *,
Lisp_Object);
#ifdef HAVE_NTGUI
Lisp_Object);
#ifdef WINDOWSNT
extern Lisp_Object Vlibrary_cache;
#define CACHE_IMAGE_TYPE(type, status) \
do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0)
#else
@ -589,7 +595,7 @@ define_image_type (struct image_type *type)
if (type->init)
{
#ifdef HAVE_NTGUI
#if defined HAVE_NTGUI && defined WINDOWSNT
/* If we failed to load the library before, don't try again. */
Lisp_Object tested = Fassq (target_type, Vlibrary_cache);
if (CONSP (tested) && NILP (XCDR (tested)))
@ -1834,7 +1840,7 @@ mark_image_cache (struct image_cache *c)
X / NS / W32 support code
***********************************************************************/
#ifdef HAVE_NTGUI
#ifdef WINDOWSNT
/* Macro for defining functions that will be loaded from image DLLs. */
#define DEF_IMGLIB_FN(rettype,func,args) static rettype (FAR CDECL *fn_##func)args
@ -1845,7 +1851,7 @@ mark_image_cache (struct image_cache *c)
if (!fn_##func) return 0; \
}
#endif /* HAVE_NTGUI */
#endif /* WINDOWSNT */
/* Return true if XIMG's size WIDTH x HEIGHT doesn't break the
windowing system.
@ -2897,7 +2903,7 @@ xbm_load (struct frame *f, struct image *img)
else
bits = (char *) XBOOL_VECTOR (data)->data;
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
{
char *invertedBits;
int nbytes, i;
@ -3008,7 +3014,7 @@ static const struct image_keyword xpm_format[XPM_LAST] =
{":background", IMAGE_STRING_OR_NIL_VALUE, 0}
};
#ifdef HAVE_NTGUI
#if defined HAVE_NTGUI && defined WINDOWSNT
static bool init_xpm_functions (void);
#else
#define init_xpm_functions NULL
@ -3207,7 +3213,7 @@ xpm_free_colors (Display *dpy, Colormap cmap, Pixel *pixels, int npixels, void *
#endif /* ALLOC_XPM_COLORS */
#ifdef HAVE_NTGUI
#ifdef WINDOWSNT
/* XPM library details. */
@ -3233,8 +3239,15 @@ init_xpm_functions (void)
return 1;
}
#endif /* HAVE_NTGUI */
#endif /* WINDOWSNT */
#if defined HAVE_NTGUI && !defined WINDOWSNT
/* Glue for code below */
#define fn_XpmReadFileToImage XpmReadFileToImage
#define fn_XpmCreateImageFromBuffer XpmCreateImageFromBuffer
#define fn_XImageFree XImageFree
#define fn_XpmFreeAttributes XpmFreeAttributes
#endif /* HAVE_NTGUI && !WINDOWSNT */
/* Value is true if COLOR_SYMBOLS is a valid color symbols list
for XPM images. Such a list must consist of conses whose car and
@ -5340,7 +5353,7 @@ static const struct image_keyword png_format[PNG_LAST] =
{":background", IMAGE_STRING_OR_NIL_VALUE, 0}
};
#ifdef HAVE_NTGUI
#if defined HAVE_NTGUI && defined WINDOWSNT
static bool init_png_functions (void);
#else
#define init_png_functions NULL
@ -5378,7 +5391,7 @@ png_image_p (Lisp_Object object)
#ifdef HAVE_PNG
#ifdef HAVE_NTGUI
#ifdef WINDOWSNT
/* PNG library details. */
DEF_IMGLIB_FN (png_voidp, png_get_io_ptr, (png_structp));
@ -5478,7 +5491,7 @@ init_png_functions (void)
#define fn_png_set_longjmp_fn png_set_longjmp_fn
#endif /* libpng version >= 1.5 */
#endif /* HAVE_NTGUI */
#endif /* WINDOWSNT */
/* Possibly inefficient/inexact substitutes for _setjmp and _longjmp.
Do not use sys_setjmp, as PNG supports only jmp_buf. The _longjmp
@ -5999,7 +6012,7 @@ static const struct image_keyword jpeg_format[JPEG_LAST] =
{":background", IMAGE_STRING_OR_NIL_VALUE, 0}
};
#ifdef HAVE_NTGUI
#if defined HAVE_NTGUI && defined WINDOWSNT
static bool init_jpeg_functions (void);
#else
#define init_jpeg_functions NULL
@ -6049,14 +6062,27 @@ jpeg_image_p (Lisp_Object object)
#define __WIN32__ 1
#endif
/* rpcndr.h (via windows.h) and jpeglib.h both define boolean types.
Some versions of jpeglib try to detect whether rpcndr.h is loaded,
using the Windows boolean type instead of the jpeglib boolean type
if so. Cygwin jpeglib, however, doesn't try to detect whether its
headers are included along with windows.h, so under Cygwin, jpeglib
attempts to define a conflicting boolean type. Worse, forcing
Cygwin jpeglib headers to use the Windows boolean type doesn't work
because it created an ABI incompatibility between the
already-compiled jpeg library and the header interface definition.
The best we can do is to define jpeglib's boolean type to a
different name. This name, jpeg_boolean, remains in effect through
the rest of image.c.
*/
#if defined CYGWIN && defined HAVE_NTGUI
#define boolean jpeg_boolean
#endif
#include <jpeglib.h>
#include <jerror.h>
#ifdef HAVE_STLIB_H_1
#define HAVE_STDLIB_H 1
#endif
#ifdef HAVE_NTGUI
#ifdef WINDOWSNT
/* JPEG library details. */
DEF_IMGLIB_FN (void, jpeg_CreateDecompress, (j_decompress_ptr, int, size_t));
@ -6106,7 +6132,7 @@ jpeg_resync_to_restart_wrapper (j_decompress_ptr cinfo, int desired)
#define fn_jpeg_std_error jpeg_std_error
#define jpeg_resync_to_restart_wrapper jpeg_resync_to_restart
#endif /* HAVE_NTGUI */
#endif /* WINDOWSNT */
struct my_jpeg_error_mgr
{
@ -6630,7 +6656,7 @@ tiff_image_p (Lisp_Object object)
#include <tiffio.h>
#ifdef HAVE_NTGUI
#ifdef WINDOWSNT
/* TIFF library details. */
DEF_IMGLIB_FN (TIFFErrorHandler, TIFFSetErrorHandler, (TIFFErrorHandler));
@ -6674,7 +6700,7 @@ init_tiff_functions (void)
#define fn_TIFFReadRGBAImage TIFFReadRGBAImage
#define fn_TIFFClose TIFFClose
#define fn_TIFFSetDirectory TIFFSetDirectory
#endif /* HAVE_NTGUI */
#endif /* WINDOWSNT */
/* Reading from a memory buffer for TIFF images Based on the PNG
@ -7046,7 +7072,7 @@ static const struct image_keyword gif_format[GIF_LAST] =
{":background", IMAGE_STRING_OR_NIL_VALUE, 0}
};
#ifdef HAVE_NTGUI
#if defined HAVE_NTGUI && defined WINDOWSNT
static bool init_gif_functions (void);
#else
#define init_gif_functions NULL
@ -7110,7 +7136,7 @@ gif_image_p (Lisp_Object object)
#endif /* HAVE_NTGUI */
#ifdef HAVE_NTGUI
#ifdef WINDOWSNT
/* GIF library details. */
DEF_IMGLIB_FN (int, DGifCloseFile, (GifFileType *));
@ -7140,7 +7166,7 @@ init_gif_functions (void)
#define fn_DGifOpen DGifOpen
#define fn_DGifOpenFileName DGifOpenFileName
#endif /* HAVE_NTGUI */
#endif /* WINDOWSNT */
/* Reading a GIF image from memory
Based on the PNG memory stuff to a certain extent. */
@ -8137,7 +8163,7 @@ svg_image_p (Lisp_Object object)
#include <librsvg/rsvg.h>
#ifdef HAVE_NTGUI
#ifdef WINDOWSNT
/* SVG library functions. */
DEF_IMGLIB_FN (RsvgHandle *, rsvg_handle_new);
@ -8215,7 +8241,7 @@ init_svg_functions (void)
#define fn_g_type_init g_type_init
#define fn_g_object_unref g_object_unref
#define fn_g_error_free g_error_free
#endif /* !HAVE_NTGUI */
#endif /* !WINDOWSNT */
/* Load SVG image IMG for use on frame F. Value is true if
successful. */

View file

@ -30,7 +30,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "frame.h"
#include "window.h"
#include "termchar.h"
#include "termopts.h"
#include "disptab.h"
#include "intervals.h"
#include "dispextern.h"

View file

@ -86,8 +86,8 @@ KBOARD *initial_kboard;
KBOARD *current_kboard;
KBOARD *all_kboards;
/* Nonzero in the single-kboard state, 0 in the any-kboard state. */
static int single_kboard;
/* True in the single-kboard state, false in the any-kboard state. */
static bool single_kboard;
/* Non-nil disable property on a command means
do not execute it; call disabled-command-function's value instead. */
@ -113,9 +113,9 @@ static Lisp_Object recent_keys;
Lisp_Object this_command_keys;
ptrdiff_t this_command_key_count;
/* 1 after calling Freset_this_command_lengths.
Usually it is 0. */
static int this_command_key_count_reset;
/* True after calling Freset_this_command_lengths.
Usually it is false. */
static bool this_command_key_count_reset;
/* This vector is used as a buffer to record the events that were actually read
by read_key_sequence. */
@ -140,11 +140,11 @@ static ptrdiff_t before_command_echo_length;
static sys_jmp_buf getcjmp;
/* True while doing kbd input. */
int waiting_for_input;
bool waiting_for_input;
/* True while displaying for echoing. Delays C-g throwing. */
static int echoing;
static bool echoing;
/* Non-null means we can start echoing at the next input pause even
though there is something in the echo area. */
@ -163,8 +163,8 @@ struct kboard *echo_kboard;
Lisp_Object echo_message_buffer;
/* Nonzero means C-g should cause immediate error-signal. */
int immediate_quit;
/* True means C-g should cause immediate error-signal. */
bool immediate_quit;
/* Character that causes a quit. Normally C-g.
@ -270,7 +270,7 @@ static Lisp_Object Qhelp_form_show;
static FILE *dribble;
/* Nonzero if input is available. */
int input_pending;
bool input_pending;
/* Circular buffer for pre-read keyboard input. */
@ -313,7 +313,7 @@ static Lisp_Object Qmouse_fixup_help_message;
/* Symbols to denote kinds of events. */
static Lisp_Object Qfunction_key;
Lisp_Object Qmouse_click;
#if defined (WINDOWSNT)
#ifdef HAVE_NTGUI
Lisp_Object Qlanguage_change;
#endif
static Lisp_Object Qdrag_n_drop;
@ -372,18 +372,18 @@ static ptrdiff_t echo_length (void);
static Lisp_Object Qpolling_period;
/* Incremented whenever a timer is run. */
int timers_run;
unsigned timers_run;
/* Address (if not 0) of EMACS_TIME to zero out if a SIGIO interrupt
happens. */
EMACS_TIME *input_available_clear_time;
/* Nonzero means use SIGIO interrupts; zero means use CBREAK mode.
Default is 1 if INTERRUPT_INPUT is defined. */
int interrupt_input;
/* True means use SIGIO interrupts; false means use CBREAK mode.
Default is true if INTERRUPT_INPUT is defined. */
bool interrupt_input;
/* Nonzero while interrupts are temporarily deferred during redisplay. */
int interrupts_deferred;
bool interrupts_deferred;
/* If we support a window system, turn on the code to poll periodically
to detect C-g. It isn't actually used when doing interrupt input. */
@ -411,10 +411,10 @@ static EMACS_TIME timer_last_idleness_start_time;
/* Function for init_keyboard to call with no args (if nonzero). */
static void (*keyboard_init_hook) (void);
static void get_input_pending (int *, int);
static int readable_events (int);
static bool get_input_pending (int);
static bool readable_events (int);
static Lisp_Object read_char_x_menu_prompt (ptrdiff_t, Lisp_Object *,
Lisp_Object, int *);
Lisp_Object, bool *);
static Lisp_Object read_char_minibuf_menu_prompt (int, ptrdiff_t,
Lisp_Object *);
static Lisp_Object make_lispy_event (struct input_event *);
@ -428,7 +428,7 @@ static Lisp_Object modify_event_symbol (ptrdiff_t, int, Lisp_Object,
Lisp_Object, const char *const *,
Lisp_Object *, ptrdiff_t);
static Lisp_Object make_lispy_switch_frame (Lisp_Object);
static int help_char_p (Lisp_Object);
static bool help_char_p (Lisp_Object);
static void save_getcjmp (sys_jmp_buf);
static void restore_getcjmp (sys_jmp_buf);
static Lisp_Object apply_modifiers (int, Lisp_Object);
@ -438,7 +438,7 @@ static Lisp_Object restore_kboard_configuration (Lisp_Object);
static void deliver_input_available_signal (int signo);
#endif
static void handle_interrupt (bool);
static _Noreturn void quit_throw_to_read_char (int);
static _Noreturn void quit_throw_to_read_char (bool);
static void process_special_events (void);
static void timer_start_idle (void);
static void timer_stop_idle (void);
@ -516,7 +516,7 @@ echo_char (Lisp_Object c)
if (INTEGERP (c))
{
ptr = push_key_description (XINT (c), ptr, 1);
ptr = push_key_description (XINT (c), ptr);
}
else if (SYMBOLP (c))
{
@ -925,7 +925,7 @@ pop_kboard (void)
{
struct terminal *t;
struct kboard_stack *p = kboard_stack;
int found = 0;
bool found = 0;
for (t = terminal_list; t; t = t->next_terminal)
{
if (t->kboard == p->kboard)
@ -958,7 +958,7 @@ pop_kboard (void)
void
temporarily_switch_to_single_kboard (struct frame *f)
{
int was_locked = single_kboard;
bool was_locked = single_kboard;
if (was_locked)
{
if (f != NULL && FRAME_KBOARD (f) != current_kboard)
@ -1057,12 +1057,7 @@ cmd_error (Lisp_Object data)
Vprint_length = old_length;
Vquit_flag = Qnil;
Vinhibit_quit = Qnil;
#if 0 /* This shouldn't be necessary anymore. --lorentey */
if (command_loop_level == 0 && minibuf_level == 0)
any_kboard_state ();
#endif
return make_number (0);
}
@ -1149,12 +1144,6 @@ command_loop (void)
while (1)
{
internal_catch (Qtop_level, top_level_1, Qnil);
#if 0 /* This shouldn't be necessary anymore. --lorentey */
/* Reset single_kboard in case top-level set it while
evaluating an -f option, or we are stuck there for some
other reason. */
any_kboard_state ();
#endif
internal_catch (Qtop_level, command_loop_2, Qnil);
executing_kbd_macro = Qnil;
@ -1265,8 +1254,7 @@ tracking_off (Lisp_Object old_value)
if (!readable_events (READABLE_EVENTS_DO_TIMERS_NOW))
{
redisplay_preserve_echo_area (6);
get_input_pending (&input_pending,
READABLE_EVENTS_DO_TIMERS_NOW);
get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW);
}
}
return Qnil;
@ -1301,7 +1289,7 @@ usage: (track-mouse BODY...) */)
#if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS
static
#endif
int ignore_mouse_drag_p;
bool ignore_mouse_drag_p;
static FRAME_PTR
some_mouse_moved (void)
@ -1329,9 +1317,9 @@ some_mouse_moved (void)
sans error-handling encapsulation. */
static int read_key_sequence (Lisp_Object *, int, Lisp_Object,
int, int, int);
bool, bool, bool);
void safe_run_hooks (Lisp_Object);
static void adjust_point_for_property (ptrdiff_t, int);
static void adjust_point_for_property (ptrdiff_t, bool);
/* Cancel hourglass from protect_unwind.
ARG is not used. */
@ -1359,10 +1347,7 @@ command_loop_1 (void)
int i;
EMACS_INT prev_modiff = 0;
struct buffer *prev_buffer = NULL;
#if 0 /* This shouldn't be necessary anymore. --lorentey */
int was_locked = single_kboard;
#endif
int already_adjusted = 0;
bool already_adjusted = 0;
kset_prefix_arg (current_kboard, Qnil);
kset_last_prefix_arg (current_kboard, Qnil);
@ -1731,10 +1716,6 @@ command_loop_1 (void)
if (!NILP (KVAR (current_kboard, defining_kbd_macro))
&& NILP (KVAR (current_kboard, Vprefix_arg)))
finalize_kbd_macro_chars ();
#if 0 /* This shouldn't be necessary anymore. --lorentey */
if (!was_locked)
any_kboard_state ();
#endif
}
}
@ -1744,7 +1725,7 @@ command_loop_1 (void)
LAST_PT is the last position of point. */
static void
adjust_point_for_property (ptrdiff_t last_pt, int modified)
adjust_point_for_property (ptrdiff_t last_pt, bool modified)
{
ptrdiff_t beg, end;
Lisp_Object val, overlay, tmp;
@ -1752,7 +1733,7 @@ adjust_point_for_property (ptrdiff_t last_pt, int modified)
suppress the point adjustment for automatic composition so that a
user can keep inserting another character at point or keep
deleting characters around point. */
int check_composition = ! modified, check_display = 1, check_invisible = 1;
bool check_composition = ! modified, check_display = 1, check_invisible = 1;
ptrdiff_t orig_pt = PT;
/* FIXME: cycling is probably not necessary because these properties
@ -1791,7 +1772,8 @@ adjust_point_for_property (ptrdiff_t last_pt, int modified)
check_display = 0;
if (check_invisible && PT > BEGV && PT < ZV)
{
int inv, ellipsis = 0;
int inv;
bool ellipsis = 0;
beg = end = PT;
/* Find boundaries `beg' and `end' of the invisible area, if any. */
@ -1920,7 +1902,7 @@ safe_run_hooks_error (Lisp_Object error_data)
if (SYMBOLP (hook))
{
Lisp_Object val;
int found = 0;
bool found = 0;
Lisp_Object newval = Qnil;
for (val = find_symbol_value (hook); CONSP (val); val = XCDR (val))
if (EQ (fun, XCAR (val)))
@ -2050,9 +2032,9 @@ start_polling (void)
#endif
}
/* Nonzero if we are using polling to handle input asynchronously. */
/* True if we are using polling to handle input asynchronously. */
int
bool
input_polling_used (void)
{
#ifdef POLL_FOR_INPUT
@ -2228,7 +2210,7 @@ show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object,
/* Input of single characters from keyboard */
static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, int *used_mouse_menu,
static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, bool *used_mouse_menu,
EMACS_TIME *end_time);
static void record_char (Lisp_Object c);
@ -2265,9 +2247,9 @@ do { if (polling_stopped_here) start_polling (); \
not to run input methods, but in other respects to act as if
not reading a key sequence.
If USED_MOUSE_MENU is non-null, then we set *USED_MOUSE_MENU to 1
if we used a mouse menu to read the input, or zero otherwise. If
USED_MOUSE_MENU is null, we don't dereference it.
If USED_MOUSE_MENU is non-null, then set *USED_MOUSE_MENU to true
if we used a mouse menu to read the input, or false otherwise. If
USED_MOUSE_MENU is null, don't dereference it.
Value is -2 when we find input on another keyboard. A second call
to read_char will read it.
@ -2281,7 +2263,7 @@ do { if (polling_stopped_here) start_polling (); \
Lisp_Object
read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
Lisp_Object prev_event,
int *used_mouse_menu, EMACS_TIME *end_time)
bool *used_mouse_menu, EMACS_TIME *end_time)
{
Lisp_Object c;
ptrdiff_t jmpcount;
@ -2290,9 +2272,9 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
Lisp_Object tem, save;
volatile Lisp_Object previous_echo_area_message;
volatile Lisp_Object also_record;
volatile int reread;
volatile bool reread;
struct gcpro gcpro1, gcpro2;
int volatile polling_stopped_here = 0;
bool volatile polling_stopped_here = 0;
struct kboard *orig_kboard = current_kboard;
also_record = Qnil;
@ -2328,7 +2310,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
if (CONSP (Vunread_command_events))
{
int was_disabled = 0;
bool was_disabled = 0;
c = XCAR (Vunread_command_events);
Vunread_command_events = XCDR (Vunread_command_events);
@ -2430,7 +2412,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
/* if redisplay was requested */
if (commandflag >= 0)
{
int echo_current = EQ (echo_message_buffer, echo_area_buffer[0]);
bool echo_current = EQ (echo_message_buffer, echo_area_buffer[0]);
/* If there is pending input, process any events which are not
user-visible, such as X selection_request events. */
@ -2862,12 +2844,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
if (!NILP (tem))
{
struct buffer *prev_buffer = current_buffer;
#if 0 /* This shouldn't be necessary anymore. --lorentey */
int was_locked = single_kboard;
ptrdiff_t count = SPECPDL_INDEX ();
record_single_kboard_state ();
#endif
last_input_event = c;
Fcommand_execute (tem, Qnil, Fvector (1, &last_input_event), Qt);
@ -2878,13 +2854,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
example banishing the mouse under mouse-avoidance-mode. */
timer_resume_idle ();
#if 0 /* This shouldn't be necessary anymore. --lorentey */
/* Resume allowing input from any kboard, if that was true before. */
if (!was_locked)
any_kboard_state ();
unbind_to (count, Qnil);
#endif
if (current_buffer != prev_buffer)
{
/* The command may have changed the keymaps. Pretend there
@ -2992,15 +2961,15 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
{
Lisp_Object keys;
ptrdiff_t key_count;
int key_count_reset;
bool key_count_reset;
struct gcpro gcpro1;
ptrdiff_t count = SPECPDL_INDEX ();
/* Save the echo status. */
int saved_immediate_echo = current_kboard->immediate_echo;
bool saved_immediate_echo = current_kboard->immediate_echo;
struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause;
Lisp_Object saved_echo_string = KVAR (current_kboard, echo_string);
int saved_echo_after_prompt = current_kboard->echo_after_prompt;
ptrdiff_t saved_echo_after_prompt = current_kboard->echo_after_prompt;
#if 0
if (before_command_restore_flag)
@ -3201,9 +3170,9 @@ record_menu_key (Lisp_Object c)
num_input_events++;
}
/* Return 1 if should recognize C as "the help character". */
/* Return true if should recognize C as "the help character". */
static int
static bool
help_char_p (Lisp_Object c)
{
Lisp_Object tail;
@ -3375,7 +3344,7 @@ restore_getcjmp (sys_jmp_buf temp)
/* Return true if there are any events in the queue that read-char
would return. If this returns false, a read-char would block. */
static int
static bool
readable_events (int flags)
{
if (flags & READABLE_EVENTS_DO_TIMERS_NOW)
@ -3714,15 +3683,14 @@ discard_mouse_events (void)
}
/* Return non-zero if there are any real events waiting in the event
/* Return true if there are any real events waiting in the event
buffer, not counting `NO_EVENT's.
If DISCARD is non-zero, discard NO_EVENT events at the front of
the input queue, possibly leaving the input queue empty if there
are no real input events. */
Discard NO_EVENT events at the front of the input queue, possibly
leaving the input queue empty if there are no real input events. */
int
kbd_buffer_events_waiting (int discard)
bool
kbd_buffer_events_waiting (void)
{
struct input_event *sp;
@ -3734,9 +3702,7 @@ kbd_buffer_events_waiting (int discard)
sp = kbd_buffer;
}
if (discard)
kbd_fetch_ptr = sp;
kbd_fetch_ptr = sp;
return sp != kbd_store_ptr && sp->kind != NO_EVENT;
}
@ -3758,7 +3724,7 @@ clear_event (struct input_event *event)
static Lisp_Object
kbd_buffer_get_event (KBOARD **kbp,
int *used_mouse_menu,
bool *used_mouse_menu,
EMACS_TIME *end_time)
{
Lisp_Object obj;
@ -3766,8 +3732,8 @@ kbd_buffer_get_event (KBOARD **kbp,
#ifdef subprocesses
if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE/4)
{
/* Start reading input again, we have processed enough so we can
accept new events again. */
/* Start reading input again because we have processed enough to
be able to accept new events again. */
unhold_keyboard_input ();
start_polling ();
}
@ -3947,7 +3913,7 @@ kbd_buffer_get_event (KBOARD **kbp,
x_activate_menubar (XFRAME (event->frame_or_window));
}
#endif
#if defined (WINDOWSNT)
#ifdef HAVE_NTGUI
else if (event->kind == LANGUAGE_CHANGE_EVENT)
{
/* Make an event (language-change (FRAME CODEPAGE LANGUAGE-ID)). */
@ -4203,14 +4169,14 @@ process_special_events (void)
are ripe, and return, without reading any user-visible events. */
void
swallow_events (int do_display)
swallow_events (bool do_display)
{
int old_timers_run;
unsigned old_timers_run;
process_special_events ();
old_timers_run = timers_run;
get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW);
get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW);
if (timers_run != old_timers_run && do_display)
redisplay_preserve_echo_area (7);
@ -4337,7 +4303,7 @@ timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers)
EMACS_TIME difference;
EMACS_TIME timer_difference = invalid_emacs_time ();
EMACS_TIME idle_timer_difference = invalid_emacs_time ();
int ripe, timer_ripe = 0, idle_timer_ripe = 0;
bool ripe, timer_ripe = 0, idle_timer_ripe = 0;
/* Set TIMER and TIMER_DIFFERENCE
based on the next ordinary timer.
@ -5417,7 +5383,7 @@ make_lispy_event (struct input_event *event)
(sizeof (lispy_function_keys)
/ sizeof (lispy_function_keys[0])));
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
case MULTIMEDIA_KEY_EVENT:
if (event->code < (sizeof (lispy_multimedia_keys)
/ sizeof (lispy_multimedia_keys[0]))
@ -5441,7 +5407,7 @@ make_lispy_event (struct input_event *event)
#endif
{
int button = event->code;
int is_double;
bool is_double;
Lisp_Object position;
Lisp_Object *start_pos_ptr;
Lisp_Object start_pos;
@ -5722,7 +5688,7 @@ make_lispy_event (struct input_event *event)
struct frame *fr;
int fuzz;
int symbol_num;
int is_double;
bool is_double;
if (WINDOWP (event->frame_or_window))
fr = XFRAME (XWINDOW (event->frame_or_window)->frame);
@ -6664,11 +6630,11 @@ parse_solitary_modifier (Lisp_Object symbol)
return 0;
}
/* Return 1 if EVENT is a list whose elements are all integers or symbols.
/* Return true if EVENT is a list whose elements are all integers or symbols.
Such a list is not valid as an event,
but it can be a Lucid-style event type list. */
int
bool
lucid_event_type_list_p (Lisp_Object object)
{
Lisp_Object tail;
@ -6693,8 +6659,10 @@ lucid_event_type_list_p (Lisp_Object object)
return NILP (tail);
}
/* Store into *addr a value nonzero if terminal input chars are available.
Serves the purpose of ioctl (0, FIONREAD, addr)
/* Return true if terminal input chars are available.
Also, store the return value into INPUT_PENDING.
Serves the purpose of ioctl (0, FIONREAD, ...)
but works even if FIONREAD does not exist.
(In fact, this may actually read some input.)
@ -6705,19 +6673,21 @@ lucid_event_type_list_p (Lisp_Object object)
If READABLE_EVENTS_IGNORE_SQUEEZABLES is set in FLAGS, ignore mouse
movements and toolkit scroll bar thumb drags. */
static void
get_input_pending (int *addr, int flags)
static bool
get_input_pending (int flags)
{
/* First of all, have we already counted some input? */
*addr = (!NILP (Vquit_flag) || readable_events (flags));
input_pending = (!NILP (Vquit_flag) || readable_events (flags));
/* If input is being read as it arrives, and we have none, there is none. */
if (*addr > 0 || (interrupt_input && ! interrupts_deferred))
return;
if (!input_pending && (!interrupt_input || interrupts_deferred))
{
/* Try to read some input and see how much we get. */
gobble_input ();
input_pending = (!NILP (Vquit_flag) || readable_events (flags));
}
/* Try to read some input and see how much we get. */
gobble_input ();
*addr = (!NILP (Vquit_flag) || readable_events (flags));
return input_pending;
}
/* Put a BUFFER_SWITCH_EVENT in the buffer
@ -6767,7 +6737,7 @@ int
gobble_input (void)
{
int nread = 0;
int err = 0;
bool err = 0;
struct terminal *t;
/* Store pending user signal events, if any. */
@ -7337,9 +7307,9 @@ static const char* separator_names[] = {
0,
};
/* Return non-zero if LABEL specifies a separator. */
/* Return true if LABEL specifies a separator. */
int
bool
menu_separator_name_p (const char *label)
{
if (!label)
@ -7514,6 +7484,7 @@ menu_bar_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy1, void *dumm
{
struct gcpro gcpro1;
int i;
bool parsed;
Lisp_Object tem;
if (EQ (item, Qundefined))
@ -7545,9 +7516,9 @@ menu_bar_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy1, void *dumm
parse_menu_item, so that if it turns out it wasn't a menu item,
it still correctly hides any further menu item. */
GCPRO1 (key);
i = parse_menu_item (item, 1);
parsed = parse_menu_item (item, 1);
UNGCPRO;
if (!i)
if (!parsed)
return;
item = AREF (item_properties, ITEM_PROPERTY_DEF);
@ -7623,7 +7594,7 @@ menu_item_eval_property (Lisp_Object sexpr)
parse_menu_item returns true if the item is a menu item and false
otherwise. */
int
bool
parse_menu_item (Lisp_Object item, int inmenubar)
{
Lisp_Object def, tem, item_string, start;
@ -7923,7 +7894,7 @@ static Lisp_Object QCrtl;
static void init_tool_bar_items (Lisp_Object);
static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void*);
static int parse_tool_bar_item (Lisp_Object, Lisp_Object);
static bool parse_tool_bar_item (Lisp_Object, Lisp_Object);
static void append_tool_bar_item (void);
@ -8056,7 +8027,7 @@ set_prop (ptrdiff_t idx, Lisp_Object val)
/* Parse a tool bar item specification ITEM for key KEY and return the
result in tool_bar_item_properties. Value is zero if ITEM is
result in tool_bar_item_properties. Value is false if ITEM is
invalid.
ITEM is a list `(menu-item CAPTION BINDING PROPS...)'.
@ -8101,12 +8072,13 @@ set_prop (ptrdiff_t idx, Lisp_Object val)
A text label to show with the tool bar button if labels are enabled. */
static int
static bool
parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
{
Lisp_Object filter = Qnil;
Lisp_Object caption;
int i, have_label = 0;
int i;
bool have_label = 0;
/* Definition looks like `(menu-item CAPTION BINDING PROPS...)'.
Rule out items that aren't lists, don't start with
@ -8363,9 +8335,9 @@ append_tool_bar_item (void)
PREV_EVENT is the previous input event, or nil if we are reading
the first event of a key sequence.
If USED_MOUSE_MENU is non-null, then we set *USED_MOUSE_MENU to 1
if we used a mouse menu to read the input, or zero otherwise. If
USED_MOUSE_MENU is null, we don't dereference it.
If USED_MOUSE_MENU is non-null, set *USED_MOUSE_MENU to true
if we used a mouse menu to read the input, or false otherwise. If
USED_MOUSE_MENU is null, don't dereference it.
The prompting is done based on the prompt-string of the map
and the strings associated with various map elements.
@ -8378,7 +8350,7 @@ append_tool_bar_item (void)
static Lisp_Object
read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps,
Lisp_Object prev_event, int *used_mouse_menu)
Lisp_Object prev_event, bool *used_mouse_menu)
{
#ifdef HAVE_MENUS
ptrdiff_t mapno;
@ -8472,7 +8444,7 @@ read_char_minibuf_menu_prompt (int commandflag,
/* FIXME: Use the minibuffer's frame width. */
ptrdiff_t width = FRAME_COLS (SELECTED_FRAME ()) - 4;
ptrdiff_t idx = -1;
int nobindings = 1;
bool nobindings = 1;
Lisp_Object rest, vector;
char *menu;
@ -8520,7 +8492,7 @@ read_char_minibuf_menu_prompt (int commandflag,
/* Present the documented bindings, a line at a time. */
while (1)
{
int notfirst = 0;
bool notfirst = 0;
ptrdiff_t i = nlength;
Lisp_Object obj;
Lisp_Object orig_defn_macro;
@ -8576,8 +8548,8 @@ read_char_minibuf_menu_prompt (int commandflag,
/* Ignore the element if it has no prompt string. */
if (INTEGERP (event) && parse_menu_item (elt, -1))
{
/* 1 if the char to type matches the string. */
int char_matches;
/* True if the char to type matches the string. */
bool char_matches;
Lisp_Object upcased_event, downcased_event;
Lisp_Object desc = Qnil;
Lisp_Object s
@ -8629,7 +8601,7 @@ read_char_minibuf_menu_prompt (int commandflag,
i += 2;
}
notfirst = 1;
nobindings = 0 ;
nobindings = 0;
/* If the char to type doesn't match the string's
first char, explicitly show what char to type. */
@ -8763,14 +8735,14 @@ typedef struct keyremap
/* Lookup KEY in MAP.
MAP is a keymap mapping keys to key vectors or functions.
If the mapping is a function and DO_FUNCTION is non-zero, then
If the mapping is a function and DO_FUNCALL is true,
the function is called with PROMPT as parameter and its return
value is used as the return value of this function (after checking
that it is indeed a vector). */
static Lisp_Object
access_keymap_keyremap (Lisp_Object map, Lisp_Object key, Lisp_Object prompt,
int do_funcall)
bool do_funcall)
{
Lisp_Object next;
@ -8809,15 +8781,15 @@ access_keymap_keyremap (Lisp_Object map, Lisp_Object key, Lisp_Object prompt,
BUFSIZE is its maximum size.
FKEY is a pointer to the keyremap structure to use.
INPUT is the index of the last element in KEYBUF.
DOIT if non-zero says that the remapping can actually take place.
DOIT if true says that the remapping can actually take place.
DIFF is used to return the number of keys added/removed by the remapping.
PARENT is the root of the keymap.
PROMPT is the prompt to use if the remapping happens through a function.
The return value is non-zero if the remapping actually took place. */
Return true if the remapping actually took place. */
static int
static bool
keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey,
int input, int doit, int *diff, Lisp_Object prompt)
int input, bool doit, int *diff, Lisp_Object prompt)
{
Lisp_Object next, key;
@ -8871,7 +8843,7 @@ keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey,
return 0;
}
static int
static bool
test_undefined (Lisp_Object binding)
{
return (EQ (binding, Qundefined)
@ -8913,13 +8885,13 @@ test_undefined (Lisp_Object binding)
off the switch-frame event until later; the next call to
read_char will return it.
If FIX_CURRENT_BUFFER is nonzero, we restore current_buffer
If FIX_CURRENT_BUFFER, we restore current_buffer
from the selected window's buffer. */
static int
read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
int dont_downcase_last, int can_return_switch_frame,
int fix_current_buffer)
bool dont_downcase_last, bool can_return_switch_frame,
bool fix_current_buffer)
{
Lisp_Object from_string;
ptrdiff_t count = SPECPDL_INDEX ();
@ -8952,7 +8924,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
key sequence. */
Lisp_Object orig_keymap;
/* 1 if we have already considered switching to the local-map property
/* Positive if we have already considered switching to the local-map property
of the place where a mouse click occurred. */
int localized_local_map = 0;
@ -8992,10 +8964,10 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
/* Likewise, for key_translation_map and input-decode-map. */
keyremap keytran, indec;
/* Non-zero if we are trying to map a key by changing an upper-case
/* True if we are trying to map a key by changing an upper-case
letter to lower case, or a shifted function key to an unshifted
one. */
int shift_translated = 0;
bool shift_translated = 0;
/* If we receive a `switch-frame' or `select-window' event in the middle of
a key sequence, we put it off for later.
@ -9011,7 +8983,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
int original_uppercase_position = -1;
/* Gets around Microsoft compiler limitations. */
int dummyflag = 0;
bool dummyflag = 0;
struct buffer *starting_buffer;
@ -9173,7 +9145,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
: (/* indec.start < t || fkey.start < t || */ keytran.start < t))
{
Lisp_Object key;
int used_mouse_menu = 0;
bool used_mouse_menu = 0;
/* Where the last real key started. If we need to throw away a
key that has expanded into more than one element of keybuf
@ -9267,7 +9239,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
return. Any better way to fix this? -- cyd */
|| (interrupted_kboard != current_kboard))
{
int found = 0;
bool found = 0;
struct kboard *k;
for (k = all_kboards; k; k = k->next_kboard)
@ -9821,7 +9793,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
while (indec.end < t)
{
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
int done, diff;
bool done;
int diff;
GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame);
done = keyremap_step (keybuf, bufsize, &indec, max (t, mock_input),
@ -9855,7 +9828,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
while (fkey.end < indec.start)
{
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
int done, diff;
bool done;
int diff;
GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame);
done = keyremap_step (keybuf, bufsize, &fkey,
@ -9884,7 +9858,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
while (keytran.end < fkey.start)
{
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
int done, diff;
bool done;
int diff;
GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame);
done = keyremap_step (keybuf, bufsize, &keytran, max (t, mock_input),
@ -10270,38 +10245,32 @@ a special event, so ignore the prefix argument and don't clear it. */)
/* Return nonzero if input events are pending. */
/* Return true if input events are pending. */
int
bool
detect_input_pending (void)
{
if (!input_pending)
get_input_pending (&input_pending, 0);
return input_pending;
return input_pending || get_input_pending (0);
}
/* Return nonzero if input events other than mouse movements are
/* Return true if input events other than mouse movements are
pending. */
int
bool
detect_input_pending_ignore_squeezables (void)
{
if (!input_pending)
get_input_pending (&input_pending, READABLE_EVENTS_IGNORE_SQUEEZABLES);
return input_pending;
return input_pending || get_input_pending (READABLE_EVENTS_IGNORE_SQUEEZABLES);
}
/* Return nonzero if input events are pending, and run any pending timers. */
/* Return true if input events are pending, and run any pending timers. */
int
detect_input_pending_run_timers (int do_display)
bool
detect_input_pending_run_timers (bool do_display)
{
int old_timers_run = timers_run;
unsigned old_timers_run = timers_run;
if (!input_pending)
get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW);
get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW);
if (old_timers_run != timers_run && do_display)
{
@ -10332,13 +10301,13 @@ clear_input_pending (void)
input_pending = 0;
}
/* Return nonzero if there are pending requeued events.
/* Return true if there are pending requeued events.
This isn't used yet. The hope is to make wait_reading_process_output
call it, and return if it runs Lisp code that unreads something.
The problem is, kbd_buffer_get_event needs to be fixed to know what
to do in that case. It isn't trivial. */
int
bool
requeued_events_pending_p (void)
{
return (!NILP (Vunread_command_events));
@ -10359,10 +10328,9 @@ if there is a doubt, the value is t. */)
/* Process non-user-visible events (Bug#10195). */
process_special_events ();
get_input_pending (&input_pending,
READABLE_EVENTS_DO_TIMERS_NOW
| READABLE_EVENTS_FILTER_EVENTS);
return input_pending > 0 ? Qt : Qnil;
return (get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW
| READABLE_EVENTS_FILTER_EVENTS)
? Qt : Qnil);
}
DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0,
@ -10868,7 +10836,7 @@ handle_interrupt (bool in_signal_handler)
/* Handle a C-g by making read_char return C-g. */
static void
quit_throw_to_read_char (int from_signal)
quit_throw_to_read_char (bool from_signal)
{
/* When not called from a signal handler it is safe to call
Lisp. */
@ -10898,7 +10866,7 @@ otherwise Emacs uses CBREAK mode.
See also `current-input-mode'. */)
(Lisp_Object interrupt)
{
int new_interrupt_input;
bool new_interrupt_input;
#ifdef USABLE_SIGIO
#ifdef HAVE_X_WINDOWS
if (x_display_list != NULL)
@ -11394,7 +11362,7 @@ syms_of_keyboard (void)
DEFSYM (Qconfig_changed_event, "config-changed-event");
DEFSYM (Qmenu_enable, "menu-enable");
#if defined (WINDOWSNT)
#ifdef HAVE_NTGUI
DEFSYM (Qlanguage_change, "language-change");
#endif

View file

@ -169,12 +169,12 @@ struct kboard
reading from this KBOARD again until more input arrives. */
char kbd_queue_has_data;
/* Nonzero means echo each character as typed. */
char immediate_echo;
/* True means echo each character as typed. */
unsigned immediate_echo : 1;
/* If we have echoed a prompt string specified by the user,
this is its length in characters. Otherwise this is -1. */
char echo_after_prompt;
ptrdiff_t echo_after_prompt;
};
KEYBOARD_INLINE void
@ -463,14 +463,14 @@ extern Lisp_Object Qhelp_echo;
extern Lisp_Object Qmode_line, Qvertical_line, Qheader_line;
/* True while doing kbd input. */
extern int waiting_for_input;
extern bool waiting_for_input;
/* Address (if not 0) of EMACS_TIME to zero out if a SIGIO interrupt
happens. */
extern EMACS_TIME *input_available_clear_time;
#if defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS
extern int ignore_mouse_drag_p;
extern bool ignore_mouse_drag_p;
#endif
/* The primary selection. */
@ -482,7 +482,7 @@ struct input_event;
extern Lisp_Object parse_modifiers (Lisp_Object);
extern Lisp_Object reorder_modifiers (Lisp_Object);
extern Lisp_Object read_char (int, ptrdiff_t, Lisp_Object *, Lisp_Object,
int *, EMACS_TIME *);
bool *, EMACS_TIME *);
extern int parse_solitary_modifier (Lisp_Object symbol);
@ -506,10 +506,10 @@ extern Time last_event_timestamp;
extern int quit_char;
extern int timers_run;
extern unsigned int timers_run;
extern int menu_separator_name_p (const char *);
extern int parse_menu_item (Lisp_Object, int);
extern bool menu_separator_name_p (const char *);
extern bool parse_menu_item (Lisp_Object, int);
extern void init_kboard (KBOARD *);
extern void delete_kboard (KBOARD *);
@ -524,15 +524,15 @@ extern void start_polling (void);
extern void stop_polling (void);
extern void set_poll_suppress_count (int);
extern int gobble_input (void);
extern int input_polling_used (void);
extern bool input_polling_used (void);
extern void clear_input_pending (void);
extern int requeued_events_pending_p (void);
extern bool requeued_events_pending_p (void);
extern void bind_polling_period (int);
extern int make_ctrl_char (int) ATTRIBUTE_CONST;
extern void stuff_buffered_input (Lisp_Object);
extern void clear_waiting_for_input (void);
extern void swallow_events (int);
extern int lucid_event_type_list_p (Lisp_Object);
extern void swallow_events (bool);
extern bool lucid_event_type_list_p (Lisp_Object);
extern void kbd_buffer_store_event (struct input_event *);
extern void kbd_buffer_store_event_hold (struct input_event *,
struct input_event *);
@ -544,14 +544,14 @@ extern void gen_help_event (Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object, ptrdiff_t);
extern void kbd_buffer_store_help_event (Lisp_Object, Lisp_Object);
extern Lisp_Object menu_item_eval_property (Lisp_Object);
extern int kbd_buffer_events_waiting (int);
extern bool kbd_buffer_events_waiting (void);
extern void add_user_signal (int, const char *);
extern int tty_read_avail_input (struct terminal *, struct input_event *);
extern EMACS_TIME timer_check (void);
extern void mark_kboards (void);
#ifdef WINDOWSNT
#ifdef HAVE_NTGUI
extern const char *const lispy_function_keys[];
#endif

View file

@ -99,12 +99,12 @@ static void describe_command (Lisp_Object, Lisp_Object);
static void describe_translation (Lisp_Object, Lisp_Object);
static void describe_map (Lisp_Object, Lisp_Object,
void (*) (Lisp_Object, Lisp_Object),
int, Lisp_Object, Lisp_Object*, int, int);
bool, Lisp_Object, Lisp_Object*, bool, bool);
static void describe_vector (Lisp_Object, Lisp_Object, Lisp_Object,
void (*) (Lisp_Object, Lisp_Object), int,
Lisp_Object, Lisp_Object, int, int);
void (*) (Lisp_Object, Lisp_Object), bool,
Lisp_Object, Lisp_Object, bool, bool);
static void silly_event_symbol_error (Lisp_Object);
static Lisp_Object get_keyelt (Lisp_Object, int);
static Lisp_Object get_keyelt (Lisp_Object, bool);
/* Keymap object support - constructors and predicates. */
@ -207,15 +207,12 @@ when reading a key-sequence to be looked-up in this keymap. */)
/* Check that OBJECT is a keymap (after dereferencing through any
symbols). If it is, return it.
If AUTOLOAD is non-zero and OBJECT is a symbol whose function value
If AUTOLOAD and if OBJECT is a symbol whose function value
is an autoload form, do the autoload and try again.
If AUTOLOAD is nonzero, callers must assume GC is possible.
If the map needs to be autoloaded, but AUTOLOAD is zero (and ERROR
is zero as well), return Qt.
If AUTOLOAD, callers must assume GC is possible.
ERROR_IF_NOT_KEYMAP controls how we respond if OBJECT isn't a keymap.
If ERROR_IF_NOT_KEYMAP is non-zero, signal an error; otherwise,
If ERROR_IF_NOT_KEYMAP, signal an error; otherwise,
just return Qnil.
Note that most of the time, we don't want to pursue autoloads.
@ -224,11 +221,11 @@ when reading a key-sequence to be looked-up in this keymap. */)
but it seems to me that only read_key_sequence, Flookup_key, and
Fdefine_key should cause keymaps to be autoloaded.
This function can GC when AUTOLOAD is non-zero, because it calls
This function can GC when AUTOLOAD is true, because it calls
Fautoload_do_load which can GC. */
Lisp_Object
get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload)
get_keymap (Lisp_Object object, bool error_if_not_keymap, bool autoload)
{
Lisp_Object tem;
@ -280,7 +277,7 @@ get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload)
We assume that KEYMAP is a valid keymap. */
static Lisp_Object
keymap_parent (Lisp_Object keymap, int autoload)
keymap_parent (Lisp_Object keymap, bool autoload)
{
Lisp_Object list;
@ -307,7 +304,7 @@ If KEYMAP has no parent, return nil. */)
}
/* Check whether MAP is one of MAPS parents. */
static int
static bool
keymap_memberp (Lisp_Object map, Lisp_Object maps)
{
if (NILP (map)) return 0;
@ -365,19 +362,20 @@ Return PARENT. PARENT should be nil or another keymap. */)
MAP must be a keymap or a list of keymaps.
If T_OK is non-zero, bindings for Qt are treated as default
If T_OK, bindings for Qt are treated as default
bindings; any key left unmentioned by other tables and bindings is
given the binding of Qt.
If T_OK is zero, bindings for Qt are not treated specially.
If not T_OK, bindings for Qt are not treated specially.
If NOINHERIT, don't accept a subkeymap found in an inherited keymap.
Returns Qunbound if no binding was found (and returns Qnil if a nil
Return Qunbound if no binding was found (and return Qnil if a nil
binding was found). */
static Lisp_Object
access_keymap_1 (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int autoload)
access_keymap_1 (Lisp_Object map, Lisp_Object idx,
bool t_ok, bool noinherit, bool autoload)
{
/* If idx is a list (some sort of mouse click, perhaps?),
the index we want to use is the car of the list, which
@ -547,7 +545,7 @@ access_keymap_1 (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int
Lisp_Object
access_keymap (Lisp_Object map, Lisp_Object idx,
int t_ok, int noinherit, int autoload)
bool t_ok, bool noinherit, bool autoload)
{
Lisp_Object val = access_keymap_1 (map, idx, t_ok, noinherit, autoload);
return EQ (val, Qunbound) ? Qnil : val;
@ -630,9 +628,10 @@ map_keymap_call (Lisp_Object key, Lisp_Object val, Lisp_Object fun, void *dummy)
}
/* Same as map_keymap_internal, but traverses parent keymaps as well.
A non-zero AUTOLOAD indicates that autoloaded keymaps should be loaded. */
AUTOLOAD indicates that autoloaded keymaps should be loaded. */
void
map_keymap (Lisp_Object map, map_keymap_function_t fun, Lisp_Object args, void *data, int autoload)
map_keymap (Lisp_Object map, map_keymap_function_t fun, Lisp_Object args,
void *data, bool autoload)
{
struct gcpro gcpro1;
GCPRO1 (args);
@ -711,13 +710,13 @@ usage: (map-keymap FUNCTION KEYMAP) */)
Also if OBJECT has a menu string as the first element,
remove that. Also remove a menu help string as second element.
If AUTOLOAD is nonzero, load autoloadable keymaps
If AUTOLOAD, load autoloadable keymaps
that are referred to with indirection.
This can GC because menu_item_eval_property calls Feval. */
static Lisp_Object
get_keyelt (Lisp_Object object, int autoload)
get_keyelt (Lisp_Object object, bool autoload)
{
while (1)
{
@ -1114,10 +1113,10 @@ binding is altered. If there is no binding for KEY, the new pair
binding KEY to DEF is added at the front of KEYMAP. */)
(Lisp_Object keymap, Lisp_Object key, Lisp_Object def)
{
register ptrdiff_t idx;
register Lisp_Object c;
register Lisp_Object cmd;
int metized = 0;
ptrdiff_t idx;
Lisp_Object c;
Lisp_Object cmd;
bool metized = 0;
int meta_bit;
ptrdiff_t length;
struct gcpro gcpro1, gcpro2, gcpro3;
@ -1271,11 +1270,11 @@ third optional argument ACCEPT-DEFAULT is non-nil, `lookup-key' will
recognize the default bindings, just as `read-key-sequence' does. */)
(Lisp_Object keymap, Lisp_Object key, Lisp_Object accept_default)
{
register ptrdiff_t idx;
register Lisp_Object cmd;
register Lisp_Object c;
ptrdiff_t idx;
Lisp_Object cmd;
Lisp_Object c;
ptrdiff_t length;
int t_ok = !NILP (accept_default);
bool t_ok = !NILP (accept_default);
struct gcpro gcpro1, gcpro2;
GCPRO2 (keymap, key);
@ -1887,7 +1886,7 @@ DEFUN ("current-minor-mode-maps", Fcurrent_minor_mode_maps, Scurrent_minor_mode_
struct accessible_keymaps_data {
Lisp_Object maps, tail, thisseq;
/* Does the current sequence end in the meta-prefix-char? */
int is_metized;
bool is_metized;
};
static void
@ -1898,7 +1897,7 @@ accessible_keymaps_1 (Lisp_Object key, Lisp_Object cmd, Lisp_Object args, void *
Lisp_Object maps = d->maps;
Lisp_Object tail = d->tail;
Lisp_Object thisseq = d->thisseq;
int is_metized = d->is_metized && INTEGERP (key);
bool is_metized = d->is_metized && INTEGERP (key);
Lisp_Object tem;
cmd = get_keymap (get_keyelt (cmd, 0), 0, 0);
@ -2060,7 +2059,7 @@ The `kbd' macro is an approximate inverse of this. */)
Lisp_Object sep = build_string (" ");
Lisp_Object key;
Lisp_Object result;
int add_meta = 0;
bool add_meta = 0;
USE_SAFE_ALLOCA;
if (!NILP (prefix))
@ -2155,9 +2154,10 @@ The `kbd' macro is an approximate inverse of this. */)
char *
push_key_description (EMACS_INT ch, char *p, int force_multibyte)
push_key_description (EMACS_INT ch, char *p)
{
int c, c2, tab_as_ci;
int c, c2;
bool tab_as_ci;
/* Clear all the meaningless bits above the meta bit. */
c = ch & (meta_modifier | ~ - meta_modifier);
@ -2256,21 +2256,12 @@ push_key_description (EMACS_INT ch, char *p, int force_multibyte)
*p++ = 'P';
*p++ = 'C';
}
else if (c < 128
|| (NILP (BVAR (current_buffer, enable_multibyte_characters))
&& SINGLE_BYTE_CHAR_P (c)
&& !force_multibyte))
{
*p++ = c;
}
else if (c < 128)
*p++ = c;
else
{
/* Now we are sure that C is a valid character code. */
if (NILP (BVAR (current_buffer, enable_multibyte_characters))
&& ! force_multibyte)
*p++ = multibyte_char_to_unibyte (c);
else
p += CHAR_STRING (c, (unsigned char *) p);
p += CHAR_STRING (c, (unsigned char *) p);
}
return p;
@ -2299,9 +2290,8 @@ around function keys and event symbols. */)
if (INTEGERP (key)) /* Normal character. */
{
char tem[KEY_DESCRIPTION_SIZE], *p;
p = push_key_description (XINT (key), tem, 1);
char tem[KEY_DESCRIPTION_SIZE];
char *p = push_key_description (XINT (key), tem);
*p = 0;
return make_specified_string (tem, -1, p - tem, 1);
}
@ -2429,7 +2419,7 @@ static void where_is_internal_1 (Lisp_Object key, Lisp_Object binding,
static Lisp_Object
shadow_lookup (Lisp_Object shadow, Lisp_Object key, Lisp_Object flag,
int remap)
bool remap)
{
Lisp_Object tail, value;
@ -2461,7 +2451,7 @@ static Lisp_Object Vmouse_events;
struct where_is_internal_data {
Lisp_Object definition, this, last;
int last_is_meta, noindirect;
bool last_is_meta, noindirect;
Lisp_Object sequences;
};
@ -2474,7 +2464,7 @@ struct where_is_internal_data {
static Lisp_Object
where_is_internal (Lisp_Object definition, Lisp_Object keymaps,
int noindirect, int nomenus)
bool noindirect, bool nomenus)
{
Lisp_Object maps = Qnil;
Lisp_Object found;
@ -2523,7 +2513,7 @@ where_is_internal (Lisp_Object definition, Lisp_Object keymaps,
[M-CHAR] sequences, check if last character of the sequence
is the meta-prefix char. */
Lisp_Object last;
int last_is_meta;
bool last_is_meta;
this = Fcar (XCAR (maps));
map = Fcdr (XCAR (maps));
@ -2606,7 +2596,7 @@ The optional 5th arg NO-REMAP alters how command remapping is handled:
/* Actually relevant bindings. */
Lisp_Object found = Qnil;
/* 1 means ignore all menu bindings entirely. */
int nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii);
bool nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii);
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
/* List of sequences found via remapping. Keep them in a separate
variable, so as to push them later, since we prefer
@ -2615,7 +2605,7 @@ The optional 5th arg NO-REMAP alters how command remapping is handled:
/* Whether or not we're handling remapped sequences. This is needed
because remapping is not done recursively by Fcommand_remapping: you
can't remap a remapped command. */
int remapped = 0;
bool remapped = 0;
Lisp_Object tem = Qnil;
/* Refresh the C version of the modifier preference. */
@ -2767,10 +2757,10 @@ where_is_internal_1 (Lisp_Object key, Lisp_Object binding, Lisp_Object args, voi
{
struct where_is_internal_data *d = data; /* Cast! */
Lisp_Object definition = d->definition;
int noindirect = d->noindirect;
bool noindirect = d->noindirect;
Lisp_Object this = d->this;
Lisp_Object last = d->last;
int last_is_meta = d->last_is_meta;
bool last_is_meta = d->last_is_meta;
Lisp_Object sequence;
/* Search through indirections unless that's not wanted. */
@ -2821,8 +2811,8 @@ The optional argument MENUS, if non-nil, says to mention menu bindings.
(Lisp_Object buffer, Lisp_Object prefix, Lisp_Object menus)
{
Lisp_Object outbuf, shadow;
int nomenu = NILP (menus);
register Lisp_Object start1;
bool nomenu = NILP (menus);
Lisp_Object start1;
struct gcpro gcpro1;
const char *alternate_heading
@ -2857,10 +2847,10 @@ You type Translation\n\
alternate_heading = 0;
}
bufend = push_key_description (translate[c], buf, 1);
bufend = push_key_description (translate[c], buf);
insert (buf, bufend - buf);
Findent_to (make_number (16), make_number (1));
bufend = push_key_description (c, buf, 1);
bufend = push_key_description (c, buf);
insert (buf, bufend - buf);
insert ("\n", 1);
@ -2977,34 +2967,34 @@ You type Translation\n\
/* Insert a description of the key bindings in STARTMAP,
followed by those of all maps reachable through STARTMAP.
If PARTIAL is nonzero, omit certain "uninteresting" commands
If PARTIAL, omit certain "uninteresting" commands
(such as `undefined').
If SHADOW is non-nil, it is a list of maps;
don't mention keys which would be shadowed by any of them.
PREFIX, if non-nil, says mention only keys that start with PREFIX.
TITLE, if not 0, is a string to insert at the beginning.
TITLE should not end with a colon or a newline; we supply that.
If NOMENU is not 0, then omit menu-bar commands.
If NOMENU, then omit menu-bar commands.
If TRANSL is nonzero, the definitions are actually key translations
If TRANSL, the definitions are actually key translations
so print strings and vectors differently.
If ALWAYS_TITLE is nonzero, print the title even if there are no maps
If ALWAYS_TITLE, print the title even if there are no maps
to look through.
If MENTION_SHADOW is nonzero, then when something is shadowed by SHADOW,
If MENTION_SHADOW, then when something is shadowed by SHADOW,
don't omit it; instead, mention it but say it is shadowed.
Any inserted text ends in two newlines (used by `help-make-xrefs'). */
void
describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow,
Lisp_Object prefix, const char *title, int nomenu, int transl,
int always_title, int mention_shadow)
describe_map_tree (Lisp_Object startmap, bool partial, Lisp_Object shadow,
Lisp_Object prefix, const char *title, bool nomenu,
bool transl, bool always_title, bool mention_shadow)
{
Lisp_Object maps, orig_maps, seen, sub_shadows;
struct gcpro gcpro1, gcpro2, gcpro3;
int something = 0;
bool something = 0;
const char *key_heading
= "\
key binding\n\
@ -3179,7 +3169,12 @@ describe_translation (Lisp_Object definition, Lisp_Object args)
into an array of `struct describe_map_elt',
then sorts them by the events. */
struct describe_map_elt { Lisp_Object event; Lisp_Object definition; int shadowed; };
struct describe_map_elt
{
Lisp_Object event;
Lisp_Object definition;
bool shadowed;
};
/* qsort comparison function for sorting `struct describe_map_elt' by
the event field. */
@ -3209,14 +3204,14 @@ describe_map_compare (const void *aa, const void *bb)
static void
describe_map (Lisp_Object map, Lisp_Object prefix,
void (*elt_describer) (Lisp_Object, Lisp_Object),
int partial, Lisp_Object shadow,
Lisp_Object *seen, int nomenu, int mention_shadow)
bool partial, Lisp_Object shadow,
Lisp_Object *seen, bool nomenu, bool mention_shadow)
{
Lisp_Object tail, definition, event;
Lisp_Object tem;
Lisp_Object suppress;
Lisp_Object kludge;
int first = 1;
bool first = 1;
struct gcpro gcpro1, gcpro2, gcpro3;
/* These accumulate the values from sparse keymap bindings,
@ -3258,7 +3253,7 @@ describe_map (Lisp_Object map, Lisp_Object prefix,
1, mention_shadow);
else if (CONSP (XCAR (tail)))
{
int this_shadowed = 0;
bool this_shadowed = 0;
event = XCAR (XCAR (tail));
@ -3428,7 +3423,7 @@ DESCRIBER is the output function used; nil means use `princ'. */)
of bytes that lead to the character set or portion of a character
set described by this chartable.
If PARTIAL is nonzero, it means do not mention suppressed commands
If PARTIAL, it means do not mention suppressed commands
(that assumes the vector is in a keymap).
SHADOW is a list of keymaps that shadow this map.
@ -3448,8 +3443,8 @@ DESCRIBER is the output function used; nil means use `princ'. */)
static void
describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
void (*elt_describer) (Lisp_Object, Lisp_Object),
int partial, Lisp_Object shadow, Lisp_Object entire_map,
int keymap_p, int mention_shadow)
bool partial, Lisp_Object shadow, Lisp_Object entire_map,
bool keymap_p, bool mention_shadow)
{
Lisp_Object definition;
Lisp_Object tem2;
@ -3457,7 +3452,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
int i;
Lisp_Object suppress;
Lisp_Object kludge;
int first = 1;
bool first = 1;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
/* Range of elements to be handled. */
int from, to, stop;
@ -3497,7 +3492,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
for (i = from; ; i++)
{
int this_shadowed = 0;
bool this_shadowed = 0;
int range_beg, range_end;
Lisp_Object val;

View file

@ -34,11 +34,11 @@ extern Lisp_Object Qkeymap, Qmenu_bar;
extern Lisp_Object Qremap;
extern Lisp_Object Qmenu_item;
extern Lisp_Object current_global_map;
extern char *push_key_description (EMACS_INT, char *, int);
extern Lisp_Object access_keymap (Lisp_Object, Lisp_Object, int, int, int);
extern Lisp_Object get_keymap (Lisp_Object, int, int);
extern void describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object,
const char *, int, int, int, int);
extern char *push_key_description (EMACS_INT, char *);
extern Lisp_Object access_keymap (Lisp_Object, Lisp_Object, bool, bool, bool);
extern Lisp_Object get_keymap (Lisp_Object, bool, bool);
extern void describe_map_tree (Lisp_Object, bool, Lisp_Object, Lisp_Object,
const char *, bool, bool, bool, bool);
extern ptrdiff_t current_minor_maps (Lisp_Object **, Lisp_Object **);
extern void initial_define_key (Lisp_Object, int, const char *);
extern void initial_define_lispy_key (Lisp_Object, const char *, const char *);
@ -47,7 +47,8 @@ extern void keys_of_keymap (void);
typedef void (*map_keymap_function_t)
(Lisp_Object key, Lisp_Object val, Lisp_Object args, void* data);
extern void map_keymap (Lisp_Object map, map_keymap_function_t fun, Lisp_Object largs, void* cargs, int autoload);
extern void map_keymap (Lisp_Object, map_keymap_function_t, Lisp_Object,
void *, bool);
extern void map_keymap_canonical (Lisp_Object map,
map_keymap_function_t fun,
Lisp_Object args, void *data);

View file

@ -345,15 +345,11 @@ static ptrdiff_t const PSEUDOVECTOR_FLAG
= PSEUDOVECTOR_FLAG;
/* In a pseudovector, the size field actually contains a word with one
PSEUDOVECTOR_FLAG bit set, and exactly one of the following bits to
indicate the actual type.
We use a bitset, even tho only one of the bits can be set at any
particular time just so as to be able to use micro-optimizations such as
testing membership of a particular subset of pseudovectors in Fequal.
It is not crucial, but there are plenty of bits here, so why not do it? */
PSEUDOVECTOR_FLAG bit set, and one of the following values extracted
with PVEC_TYPE_MASK to indicate the actual type. */
enum pvec_type
{
PVEC_NORMAL_VECTOR = 0, /* Unused! */
PVEC_NORMAL_VECTOR,
PVEC_FREE,
PVEC_PROCESS,
PVEC_FRAME,
@ -3202,9 +3198,9 @@ extern ptrdiff_t fast_string_match_ignore_case (Lisp_Object, Lisp_Object);
extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t,
ptrdiff_t, ptrdiff_t, Lisp_Object);
extern ptrdiff_t scan_buffer (int, ptrdiff_t, ptrdiff_t, ptrdiff_t,
ptrdiff_t *, int);
ptrdiff_t *, bool);
extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
EMACS_INT, int);
EMACS_INT, bool);
extern ptrdiff_t find_next_newline (ptrdiff_t, int);
extern ptrdiff_t find_next_newline_no_quit (ptrdiff_t, ptrdiff_t);
extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t);
@ -3247,7 +3243,7 @@ extern Lisp_Object Qdisabled, QCfilter;
extern Lisp_Object Qup, Qdown, Qbottom;
extern Lisp_Object Qtop;
extern Lisp_Object last_undo_boundary;
extern int input_pending;
extern bool input_pending;
extern Lisp_Object menu_bar_items (Lisp_Object);
extern Lisp_Object tool_bar_items (Lisp_Object, int *);
extern void discard_mouse_events (void);
@ -3255,9 +3251,9 @@ extern void discard_mouse_events (void);
void handle_input_available_signal (int);
#endif
extern Lisp_Object pending_funcalls;
extern int detect_input_pending (void);
extern int detect_input_pending_ignore_squeezables (void);
extern int detect_input_pending_run_timers (int);
extern bool detect_input_pending (void);
extern bool detect_input_pending_ignore_squeezables (void);
extern bool detect_input_pending_run_timers (bool);
extern void safe_run_hooks (Lisp_Object);
extern void cmd_error_internal (Lisp_Object, const char *);
extern Lisp_Object command_loop_1 (void);
@ -3336,7 +3332,7 @@ extern bool running_asynch_code;
extern Lisp_Object QCtype, Qlocal;
extern Lisp_Object Qprocessp;
extern void kill_buffer_processes (Lisp_Object);
extern int wait_reading_process_output (intmax_t, int, int, int,
extern int wait_reading_process_output (intmax_t, int, int, bool,
Lisp_Object,
struct Lisp_Process *,
int);
@ -3563,7 +3559,8 @@ extern char *emacs_root_dir (void);
Used during startup to detect startup of dumped Emacs. */
extern bool initialized;
extern int immediate_quit; /* Nonzero means ^G can quit instantly. */
/* True means ^G can quit instantly. */
extern bool immediate_quit;
extern void *xmalloc (size_t);
extern void *xzalloc (size_t);

View file

@ -27,7 +27,7 @@ EMACSLOADPATH=$(CURDIR)/../lisp
# Size in MBs of the static heap in temacs.exe.
HEAPSIZE = $(EMACS_HEAPSIZE)
LOCAL_FLAGS = -Demacs=1 -I../lib -I../nt/inc -DHAVE_NTGUI=1 $(EMACS_EXTRA_C_FLAGS)
LOCAL_FLAGS = -Demacs=1 -I../lib -I../nt/inc $(EMACS_EXTRA_C_FLAGS)
SRC = .
EMACS = $(BLD)/emacs.exe
@ -207,7 +207,7 @@ make-buildobj-SH:
GLOBAL_SOURCES = dosfns.c msdos.c \
xterm.c xfns.c xmenu.c xselect.c xrdb.c xsmfns.c fringe.c image.c \
fontset.c menu.c dbusbind.c \
w32.c w32console.c w32fns.c w32heap.c w32inevt.c \
w32.c w32console.c w32fns.c w32heap.c w32inevt.c cygw32.c \
w32menu.c w32proc.c w32reg.c w32select.c w32term.c w32xfns.c \
font.c w32font.c w32uniscribe.c \
dispnew.c frame.c scroll.c xdisp.c window.c bidi.c \
@ -423,10 +423,11 @@ DISPEXTERN_H = $(SRC)/dispextern.h \
$(W32GUI_H)
FILEMODE_H = $(GNU_LIB)/filemode.h \
$(NT_INC)/sys/stat.h
FONT_H = $(SRC)/font.h \
$(CCL_H)
FRAME_H = $(SRC)/frame.h \
$(DISPEXTERN_H)
FONT_H = $(SRC)/font.h \
$(CCL_H) \
$(FRAME_H)
FTOASTR_H = $(GNU_LIB)/ftoastr.h \
$(GNU_LIB)/intprops.h
GRP_H = $(NT_INC)/grp.h \
@ -476,6 +477,8 @@ TERMHOOKS_H = $(SRC)/termhooks.h \
W32FONT_H = $(SRC)/w32font.h \
$(FONT_H)
W32TERM_H = $(SRC)/w32term.h \
$(ATIMER_H) \
$(FRAME_H) \
$(W32GUI_H)
WINDOW_H = $(SRC)/window.h \
$(DISPEXTERN_H)
@ -732,7 +735,6 @@ $(BLD)/dispnew.$(O) : \
$(SRC)/disptab.h \
$(SRC)/indent.h \
$(SRC)/termchar.h \
$(SRC)/termopts.h \
$(NT_INC)/unistd.h \
$(BUFFER_H) \
$(CHARACTER_H) \
@ -796,6 +798,7 @@ $(BLD)/emacs.$(O) : \
$(SRC)/unexec.h \
$(SRC)/w32.h \
$(SRC)/w32heap.h \
$(SRC)/w32select.h \
$(NT_INC)/sys/file.h \
$(NT_INC)/unistd.h \
$(GNU_LIB)/ignore-value.h \
@ -811,6 +814,7 @@ $(BLD)/emacs.$(O) : \
$(SYSSIGNAL_H) \
$(SYSTTY_H) \
$(TERMHOOKS_H) \
$(W32FONT_H) \
$(W32TERM_H) \
$(WINDOW_H)
@ -1010,7 +1014,6 @@ $(BLD)/indent.$(O) : \
$(SRC)/indent.h \
$(SRC)/region-cache.h \
$(SRC)/termchar.h \
$(SRC)/termopts.h \
$(BUFFER_H) \
$(CHARACTER_H) \
$(CONFIG_H) \
@ -1167,6 +1170,7 @@ $(BLD)/w32.$(O) : \
$(SRC)/w32.c \
$(SRC)/ndir.h \
$(SRC)/w32.h \
$(SRC)/w32common.h \
$(SRC)/w32heap.h \
$(NT_INC)/pwd.h \
$(NT_INC)/sys/file.h \
@ -1184,6 +1188,7 @@ $(BLD)/w32.$(O) : \
$(BLD)/w32heap.$(O) : \
$(SRC)/w32heap.c \
$(SRC)/w32common.h \
$(SRC)/w32heap.h \
$(CONFIG_H) \
$(LISP_H)
@ -1207,6 +1212,7 @@ $(BLD)/w32proc.$(O) : \
$(SRC)/w32proc.c \
$(SRC)/syswait.h \
$(SRC)/w32.h \
$(SRC)/w32common.h \
$(SRC)/w32heap.h \
$(NT_INC)/nl_types.h \
$(NT_INC)/sys/file.h \
@ -1224,7 +1230,7 @@ $(BLD)/w32console.$(O) : \
$(SRC)/w32console.c \
$(SRC)/disptab.h \
$(SRC)/termchar.h \
$(SRC)/w32heap.h \
$(SRC)/w32common.h \
$(SRC)/w32inevt.h \
$(CHARACTER_H) \
$(CODING_H) \
@ -1233,6 +1239,7 @@ $(BLD)/w32console.$(O) : \
$(FRAME_H) \
$(LISP_H) \
$(TERMHOOKS_H) \
$(W32TERM_H) \
$(WINDOW_H)
$(BLD)/print.$(O) : \
@ -1403,7 +1410,6 @@ $(BLD)/term.$(O) : \
$(SRC)/disptab.h \
$(SRC)/keymap.h \
$(SRC)/termchar.h \
$(SRC)/termopts.h \
$(SRC)/tparam.h \
$(NT_INC)/sys/file.h \
$(NT_INC)/sys/time.h \
@ -1461,6 +1467,7 @@ $(BLD)/undo.$(O) : \
$(BLD)/unexw32.$(O) : \
$(SRC)/unexw32.c \
$(SRC)/unexec.h \
$(SRC)/w32common.h \
$(SRC)/w32heap.h \
$(CONFIG_H)
@ -1547,6 +1554,7 @@ $(BLD)/w32fns.$(O) : \
$(SRC)/epaths.h \
$(SRC)/fontset.h \
$(SRC)/w32.h \
$(SRC)/w32common.h \
$(SRC)/w32heap.h \
$(BUFFER_H) \
$(CCL_H) \
@ -1570,7 +1578,7 @@ $(BLD)/w32menu.$(O) : \
$(SRC)/w32menu.c \
$(SRC)/blockinput.h \
$(SRC)/keymap.h \
$(SRC)/w32heap.h \
$(SRC)/w32common.h \
$(BUFFER_H) \
$(CHARACTER_H) \
$(CHARSET_H) \
@ -1620,7 +1628,7 @@ $(BLD)/w32select.$(O) : \
$(SRC)/w32select.c \
$(SRC)/blockinput.h \
$(SRC)/composite.h \
$(SRC)/w32heap.h \
$(SRC)/w32common.h \
$(CHARSET_H) \
$(CODING_H) \
$(CONFIG_H) \

View file

@ -29,7 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
static ptrdiff_t cached_charpos;
static ptrdiff_t cached_bytepos;
static struct buffer *cached_buffer;
static int cached_modiff;
static EMACS_INT cached_modiff;
/* Juanma Barranquero <lekktu@gmail.com> reported ~3x increased
bootstrap time when byte_char_debug_check is enabled; so this

View file

@ -40,7 +40,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif /* HAVE_WINDOW_SYSTEM */
#ifdef HAVE_NTGUI
# ifdef NTGUI_UNICODE
# define unicode_append_menu AppendMenuW
# else /* !NTGUI_UNICODE */
extern AppendMenuW_Proc unicode_append_menu;
# endif /* NTGUI_UNICODE */
extern HMENU current_popup_menu;
#endif /* HAVE_NTGUI */
@ -327,7 +331,7 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
{
Lisp_Object map, item_string, enabled;
struct gcpro gcpro1, gcpro2;
int res;
bool res;
struct skp *skp = skp_v;
/* Parse the menu item and leave the result in item_properties. */

View file

@ -53,6 +53,7 @@
extern int ns_tmp_flags;
extern struct nsfont_info *ns_tmp_font;
/* font glyph and metrics caching functions, implemented at end */
static void ns_uni_to_glyphs (struct nsfont_info *font_info,
unsigned char block);
@ -799,8 +800,7 @@ when setting family in ns_spec_to_descriptor(). */
{
if (NSFONT_TRACE)
fprintf(stderr, "*** nsfont_open CACHE HIT!\n");
/* FIXME: Cast from (unsigned long) to Lisp_Object. */
XHASH (font_object) = [cached unsignedLongValue];
XHASH (font_object) = [cached unsignedLongLongValue];
return font_object;
}
else
@ -808,9 +808,12 @@ when setting family in ns_spec_to_descriptor(). */
font_object = font_make_object (VECSIZE (struct nsfont_info),
font_entity, pixel_size);
if (!synthItal)
[fontCache setObject: [NSNumber numberWithUnsignedLong:
(unsigned long) XHASH (font_object)]
forKey: nsfont];
{
[fontCache setObject: [NSNumber
numberWithUnsignedLongLong:
(unsigned long long) XHASH (font_object)]
forKey: nsfont];
}
}
font_info = (struct nsfont_info *) XFONT_OBJECT (font_object);

View file

@ -128,8 +128,7 @@
static EmacsMenu *last_submenu = nil;
BOOL needsSet = NO;
const char *submenuTitle = [[submenu title] UTF8String];
extern int waiting_for_input;
int owfi;
bool owfi;
Lisp_Object items;
widget_value *wv, *first_wv, *prev_wv = 0;
int i;

Some files were not shown because too many files have changed in this diff Show more