Now on revision 114405. ------------------------------------------------------------ revno: 114405 committer: Xue Fuqiao branch nick: trunk timestamp: Fri 2013-09-20 13:52:34 +0800 message: * admin/FOR-RELEASE: Remove outdated info. diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2013-08-13 07:04:10 +0000 +++ admin/FOR-RELEASE 2013-09-20 05:52:34 +0000 @@ -68,7 +68,6 @@ emacs.pdf' (e.g., enable "smallbook"). ** Check the keybindings in the refcards are correct, and add any new ones. -Regenerate the pdf versions in etc/refcards/. What paper size are the English versions supposed to be on? On Debian testing, the packages texlive-lang-czechslovak and texlive-lang-polish will let you generate the cs-* and sk-* pdfs. ------------------------------------------------------------ revno: 114404 committer: Xue Fuqiao branch nick: trunk timestamp: Fri 2013-09-20 13:39:53 +0800 message: Rename cvs-append-to-ignore to vc-cvs-append-to-ignore. 2013-09-20 Xue Fuqiao * lisp/vc/pcvs.el (cvs-mode-ignore): * lisp/vc/vc-cvs.el (vc-cvs-ignore, vc-cvs-append-to-ignore): Rename cvs-append-to-ignore to vc-cvs-append-to-ignore. If/when someone complains about her package calling that function we can add an obsolete alias at that point. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-09-17 07:39:54 +0000 +++ etc/NEWS 2013-09-20 05:39:53 +0000 @@ -279,6 +279,9 @@ under current version control system. When called with a prefix argument, you can remove a file from the ignored file list. +*** `cvs-append-to-ignore' has been renamed to `vc-cvs-append-to-ignore' +because it is moved to vc-cvs.el. + ** cl-lib *** New macro cl-tagbody. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-19 20:51:33 +0000 +++ lisp/ChangeLog 2013-09-20 05:39:53 +0000 @@ -1,3 +1,9 @@ +2013-09-20 Xue Fuqiao + + * vc/pcvs.el (cvs-mode-ignore): + * vc/vc-cvs.el (vc-cvs-ignore, vc-cvs-append-to-ignore): Rename + cvs-append-to-ignore to vc-cvs-append-to-ignore. + 2013-09-19 Stefan Monnier * eshell/em-ls.el: Use advice. Remove redundant :group keywords. === modified file 'lisp/vc/pcvs.el' --- lisp/vc/pcvs.el 2013-09-05 03:30:07 +0000 +++ lisp/vc/pcvs.el 2013-09-20 05:39:53 +0000 @@ -1963,7 +1963,7 @@ This command ignores files that are not flagged as `Unknown'." (interactive) (dolist (fi (cvs-mode-marked 'ignore)) - (cvs-append-to-ignore (cvs-fileinfo->dir fi) (cvs-fileinfo->file fi) + (vc-cvs-append-to-ignore (cvs-fileinfo->dir fi) (cvs-fileinfo->file fi) (eq (cvs-fileinfo->subtype fi) 'NEW-DIR)) (setf (cvs-fileinfo->type fi) 'DEAD)) (cvs-cleanup-collection cvs-cookies nil nil nil)) === modified file 'lisp/vc/vc-cvs.el' --- lisp/vc/vc-cvs.el 2013-09-11 18:40:06 +0000 +++ lisp/vc/vc-cvs.el 2013-09-20 05:39:53 +0000 @@ -1228,10 +1228,9 @@ (defun vc-cvs-ignore (file &optional _directory _remove) "Ignore FILE under CVS." - (cvs-append-to-ignore (file-name-directory file) file)) + (vc-cvs-append-to-ignore (file-name-directory file) file)) -;; FIXME This should be in the vc-cvs- namespace if it is to live here. -(defun cvs-append-to-ignore (dir str &optional old-dir) +(defun vc-cvs-append-to-ignore (dir str &optional old-dir) "In DIR, add STR to the .cvsignore file. If OLD-DIR is non-nil, then this is a directory that we don't want to hear about anymore." ------------------------------------------------------------ revno: 114403 committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-09-19 20:41:37 -0700 message: Work around performance bug on OS X 10.8 and earlier. Perhaps Apple will fix this bug some day. See the thread starting with Daniel Colascione's email in: http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00343.html * configure.ac (FORTIFY_SOUR): New verbatim section. diff: === modified file 'ChangeLog' --- ChangeLog 2013-09-19 21:40:08 +0000 +++ ChangeLog 2013-09-20 03:41:37 +0000 @@ -1,3 +1,11 @@ +2013-09-20 Paul Eggert + + Work around performance bug on OS X 10.8 and earlier. + Perhaps Apple will fix this bug some day. + See the thread starting with Daniel Colascione's email in: + http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00343.html + * configure.ac (FORTIFY_SOUR): New verbatim section. + 2013-09-19 Paul Eggert Merge from gnulib, incorporating: === modified file 'configure.ac' --- configure.ac 2013-09-19 08:43:01 +0000 +++ configure.ac 2013-09-20 03:41:37 +0000 @@ -4703,6 +4703,24 @@ AC_SUBST(PRE_ALLOC_OBJ) AC_SUBST(POST_ALLOC_OBJ) +dnl Call this 'FORTIFY_SOUR' so that it sorts before the 'FORTIFY_SOURCE' +dnl verbatim defined above. The tricky name is apropos, as this hack +dnl makes Fortify go sour! +AH_VERBATIM([FORTIFY_SOUR], +[/* Without the following workaround, Emacs runs slowly on OS X 10.8. + The workaround disables some useful run-time checking, so it + should be conditional to the platforms with the performance bug. + Perhaps Apple will fix this some day; also see m4/extern-inline.m4. */ +#if defined __APPLE__ && defined __GNUC__ +# ifndef _DONT_USE_CTYPE_INLINE_ +# define _DONT_USE_CTYPE_INLINE_ +# endif +# ifndef _FORTIFY_SOURCE +# define _FORTIFY_SOURCE 0 +# endif +#endif +]) + # Configure gnulib. Although this does not affect CFLAGS or LIBS permanently. # it temporarily reverts them to their pre-pkg-config values, # because gnulib needs to work with both src (which uses the ------------------------------------------------------------ revno: 114402 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2013-09-20 07:30:50 +0400 message: * xterm.c (handle_one_xevent): Revert part of 2013-09-17 change to avoid Bug#15398. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-19 08:25:43 +0000 +++ src/ChangeLog 2013-09-20 03:30:50 +0000 @@ -1,3 +1,8 @@ +2013-09-20 Dmitry Antipov + + * xterm.c (handle_one_xevent): Revert part of 2013-09-17 change + to avoid Bug#15398. + 2013-09-19 Eli Zaretskii * w32reg.c (w32_get_string_resource): Make the first 2 arguments === modified file 'src/xterm.c' --- src/xterm.c 2013-09-19 07:48:53 +0000 +++ src/xterm.c 2013-09-20 03:30:50 +0000 @@ -6101,13 +6101,6 @@ f = x_window_to_frame (dpyinfo, event->xexpose.window); if (f) { -#if ! GTK_CHECK_VERSION (2, 7, 0) - /* This seems to be needed for GTK 2.6. */ - x_clear_area (event->xexpose.display, - event->xexpose.window, - event->xexpose.x, event->xexpose.y, - event->xexpose.width, event->xexpose.height); -#endif if (!FRAME_VISIBLE_P (f)) { SET_FRAME_VISIBLE (f, 1); @@ -6116,8 +6109,18 @@ SET_FRAME_GARBAGED (f); } else - expose_frame (f, event->xexpose.x, event->xexpose.y, - event->xexpose.width, event->xexpose.height); + { +#ifdef USE_GTK + /* This seems to be needed for GTK 2.6 and later, see + http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15398. */ + x_clear_area (event->xexpose.display, + event->xexpose.window, + event->xexpose.x, event->xexpose.y, + event->xexpose.width, event->xexpose.height); +#endif + expose_frame (f, event->xexpose.x, event->xexpose.y, + event->xexpose.width, event->xexpose.height); + } } else { ------------------------------------------------------------ revno: 114401 committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-09-19 14:40:08 -0700 message: Merge from gnulib. This incorporates the following changes: 2013-09-19 stdio: OS X port of putc_unlocked + extern inline 2013-09-19 signal: OS X port of sigaddset etc. + extern inline 2013-09-19 extern-inline: do not always suppress extern inline on OS X 2013-09-17 getgroups: statement without effect 2013-08-28 headers: check that _GL_INLINE_HEADER_BEGIN is defined diff: === modified file 'ChangeLog' --- ChangeLog 2013-09-19 08:43:01 +0000 +++ ChangeLog 2013-09-19 21:40:08 +0000 @@ -1,3 +1,12 @@ +2013-09-19 Paul Eggert + + Merge from gnulib, incorporating: + 2013-09-19 stdio: OS X port of putc_unlocked + extern inline + 2013-09-19 signal: OS X port of sigaddset etc. + extern inline + 2013-09-19 extern-inline: do not always suppress extern inline on OS X + 2013-09-17 getgroups: statement without effect + 2013-08-28 headers: check that _GL_INLINE_HEADER_BEGIN is defined + 2013-09-19 Eli Zaretskii * configure.ac [MINGW32]: Make sure the value of 'srcdir' === modified file 'doc/misc/texinfo.tex' --- doc/misc/texinfo.tex 2013-08-26 22:17:31 +0000 +++ doc/misc/texinfo.tex 2013-09-19 21:40:08 +0000 @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2013-08-20.10} +\def\texinfoversion{2013-09-11.11} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -322,10 +322,13 @@ % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). + \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars} + % \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi - \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% + % \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi - \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% + \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to @@ -2891,6 +2894,15 @@ \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi } +% +% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if +% FMTNAME is tex, else ELSE-TEXT. +\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} +\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{% + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi +} +% % For raw, must switch into @tex before parsing the argument, to avoid % setting catcodes prematurely. Doing it this way means that, for % example, @inlineraw{html, foo{bar} gets a parse error instead of being @@ -2907,6 +2919,23 @@ \endgroup % close group opened by \tex. } +% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set. +% +\long\def\inlineifset#1{\doinlineifset #1,\finish} +\long\def\doinlineifset#1,#2,\finish{% + \def\inlinevarname{#1}% + \expandafter\ifx\csname SET\inlinevarname\endcsname\relax + \else\ignorespaces#2\fi +} + +% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set. +% +\long\def\inlineifclear#1{\doinlineifclear #1,\finish} +\long\def\doinlineifclear#1,#2,\finish{% + \def\inlinevarname{#1}% + \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi +} + \message{glyphs,} % and logos. @@ -4202,7 +4231,7 @@ \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { - \catcode`\- = \active \catcode`\_ = \active + \catcode`\-=\active \catcode`\_=\active % \gdef\makevalueexpandable{% \let\value = \expandablevalue @@ -4222,7 +4251,12 @@ % variable's value contains other Texinfo commands, it's almost certain % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). -% +% +% Unfortunately, this has the consequence that when _ is in the *value* +% of an @set, it does not print properly in the roman fonts (get the cmr +% dot accent at position 126 instead). No fix comes to mind, and it's +% been this way since 2003 or earlier, so just ignore it. +% \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% @@ -6276,8 +6310,8 @@ \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other - \catcode`\`=\other - \catcode`\'=\other + \catcode `\`=\other + \catcode `\'=\other \escapechar=`\\ % % ' is active in math mode (mathcode"8000). So reset it, and all our @@ -6301,7 +6335,7 @@ \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext - \expandafter \let\csname top\endcsname=\ptextop % outer + \expandafter \let\csname top\endcsname=\ptextop % we've made it outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% @@ -9944,11 +9978,9 @@ \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote -\catcode`\~=\active -\def~{{\tt\char126}} +\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde \chardef\hat=`\^ -\catcode`\^=\active -\def^{{\tt \hat}} +\catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} @@ -9958,16 +9990,26 @@ \catcode`\|=\active \def|{{\tt\char124}} + \chardef \less=`\< -\catcode`\<=\active -\def<{{\tt \less}} +\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless \chardef \gtr=`\> -\catcode`\>=\active -\def>{{\tt \gtr}} -\catcode`\+=\active -\def+{{\tt \char 43}} -\catcode`\$=\active -\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix +\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr +\catcode`\+=\active \def+{{\tt \char 43}} +\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix + +% used for headline/footline in the output routine, in case the page +% breaks in the middle of an @tex block. +\def\texinfochars{% + \let< = \activeless + \let> = \activegtr + \let~ = \activetilde + \let^ = \activehat + \markupsetuplqdefault \markupsetuprqdefault + \let\b = \strong + \let\i = \smartitalic + % in principle, all other definitions in \tex have to be undone too. +} % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. === modified file 'lib/acl-internal.h' --- lib/acl-internal.h 2013-05-07 21:34:03 +0000 +++ lib/acl-internal.h 2013-09-19 21:40:08 +0000 @@ -60,6 +60,9 @@ # define fchmod(fd, mode) (-1) #endif +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif _GL_INLINE_HEADER_BEGIN #ifndef ACL_INTERNAL_INLINE # define ACL_INTERNAL_INLINE _GL_INLINE === modified file 'lib/binary-io.h' --- lib/binary-io.h 2013-07-09 17:16:21 +0000 +++ lib/binary-io.h 2013-09-19 21:40:08 +0000 @@ -25,6 +25,9 @@ so we include it here first. */ #include +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif _GL_INLINE_HEADER_BEGIN #ifndef BINARY_IO_INLINE # define BINARY_IO_INLINE _GL_INLINE === modified file 'lib/dtotimespec.c' --- lib/dtotimespec.c 2013-01-01 09:11:05 +0000 +++ lib/dtotimespec.c 2013-09-19 21:40:08 +0000 @@ -29,41 +29,31 @@ struct timespec dtotimespec (double sec) { - enum { BILLION = 1000 * 1000 * 1000 }; double min_representable = TYPE_MINIMUM (time_t); double max_representable = - ((TYPE_MAXIMUM (time_t) * (double) BILLION + (BILLION - 1)) - / BILLION); - struct timespec r; + ((TYPE_MAXIMUM (time_t) * (double) TIMESPEC_RESOLUTION + + (TIMESPEC_RESOLUTION - 1)) + / TIMESPEC_RESOLUTION); if (! (min_representable < sec)) - { - r.tv_sec = TYPE_MINIMUM (time_t); - r.tv_nsec = 0; - } + return make_timespec (TYPE_MINIMUM (time_t), 0); else if (! (sec < max_representable)) - { - r.tv_sec = TYPE_MAXIMUM (time_t); - r.tv_nsec = BILLION - 1; - } + return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_RESOLUTION - 1); else { time_t s = sec; - double frac = BILLION * (sec - s); + double frac = TIMESPEC_RESOLUTION * (sec - s); long ns = frac; ns += ns < frac; - s += ns / BILLION; - ns %= BILLION; + s += ns / TIMESPEC_RESOLUTION; + ns %= TIMESPEC_RESOLUTION; if (ns < 0) { s--; - ns += BILLION; + ns += TIMESPEC_RESOLUTION; } - r.tv_sec = s; - r.tv_nsec = ns; + return make_timespec (s, ns); } - - return r; } === modified file 'lib/execinfo.in.h' --- lib/execinfo.in.h 2013-01-01 09:11:05 +0000 +++ lib/execinfo.in.h 2013-09-19 21:40:08 +0000 @@ -20,6 +20,9 @@ #ifndef _GL_EXECINFO_H #define _GL_EXECINFO_H +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif _GL_INLINE_HEADER_BEGIN #ifndef _GL_EXECINFO_INLINE # define _GL_EXECINFO_INLINE _GL_INLINE === modified file 'lib/getgroups.c' --- lib/getgroups.c 2013-01-02 16:37:04 +0000 +++ lib/getgroups.c 2013-09-19 21:40:08 +0000 @@ -86,7 +86,7 @@ } saved_errno = errno; free (gbuf); - errno == saved_errno; + errno = saved_errno; return result; } === modified file 'lib/openat.h' --- lib/openat.h 2013-02-01 06:30:51 +0000 +++ lib/openat.h 2013-09-19 21:40:08 +0000 @@ -26,6 +26,9 @@ #include #include +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif _GL_INLINE_HEADER_BEGIN #if !HAVE_OPENAT === modified file 'lib/signal.in.h' --- lib/signal.in.h 2013-01-01 09:11:05 +0000 +++ lib/signal.in.h 2013-09-19 21:40:08 +0000 @@ -195,6 +195,20 @@ # endif +/* When also using extern inline, suppress the use of static inline in + standard headers of problematic Apple configurations, as Libc at + least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., + . + Perhaps Apple will fix this some day. */ +#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ + && (defined __i386__ || defined __x86_64__)) +# undef sigaddset +# undef sigdelset +# undef sigemptyset +# undef sigfillset +# undef sigismember +#endif + /* Test whether a given signal is contained in a signal set. */ # if @HAVE_POSIX_SIGNALBLOCKING@ /* This function is defined as a macro on Mac OS X. */ === modified file 'lib/stat-time.h' --- lib/stat-time.h 2013-01-01 09:11:05 +0000 +++ lib/stat-time.h 2013-09-19 21:40:08 +0000 @@ -23,6 +23,9 @@ #include #include +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif _GL_INLINE_HEADER_BEGIN #ifndef _GL_STAT_TIME_INLINE # define _GL_STAT_TIME_INLINE _GL_INLINE === modified file 'lib/stdio.in.h' --- lib/stdio.in.h 2013-05-16 07:10:39 +0000 +++ lib/stdio.in.h 2013-09-19 21:40:08 +0000 @@ -124,6 +124,15 @@ #define _GL_STDIO_STRINGIZE(token) #token #define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token) +/* When also using extern inline, suppress the use of static inline in + standard headers of problematic Apple configurations, as Libc at + least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., + . + Perhaps Apple will fix this some day. */ +#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ + && defined __GNUC__ && defined __STDC__) +# undef putc_unlocked +#endif #if @GNULIB_DPRINTF@ # if @REPLACE_DPRINTF@ === modified file 'lib/timespec-add.c' --- lib/timespec-add.c 2013-01-01 09:11:05 +0000 +++ lib/timespec-add.c 2013-09-19 21:40:08 +0000 @@ -28,11 +28,10 @@ struct timespec timespec_add (struct timespec a, struct timespec b) { - struct timespec r; time_t rs = a.tv_sec; time_t bs = b.tv_sec; int ns = a.tv_nsec + b.tv_nsec; - int nsd = ns - 1000000000; + int nsd = ns - TIMESPEC_RESOLUTION; int rns = ns; if (0 <= nsd) @@ -65,7 +64,5 @@ else rs += bs; - r.tv_sec = rs; - r.tv_nsec = rns; - return r; + return make_timespec (rs, rns); } === modified file 'lib/timespec-sub.c' --- lib/timespec-sub.c 2013-01-01 09:11:05 +0000 +++ lib/timespec-sub.c 2013-09-19 21:40:08 +0000 @@ -29,7 +29,6 @@ struct timespec timespec_sub (struct timespec a, struct timespec b) { - struct timespec r; time_t rs = a.tv_sec; time_t bs = b.tv_sec; int ns = a.tv_nsec - b.tv_nsec; @@ -37,7 +36,7 @@ if (ns < 0) { - rns = ns + 1000000000; + rns = ns + TIMESPEC_RESOLUTION; if (rs == TYPE_MINIMUM (time_t)) { if (bs <= 0) @@ -65,7 +64,5 @@ else rs -= bs; - r.tv_sec = rs; - r.tv_nsec = rns; - return r; + return make_timespec (rs, rns); } === modified file 'lib/timespec.h' --- lib/timespec.h 2013-08-27 18:47:55 +0000 +++ lib/timespec.h 2013-09-19 21:40:08 +0000 @@ -21,6 +21,9 @@ # include +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif _GL_INLINE_HEADER_BEGIN #ifndef _GL_TIMESPEC_INLINE # define _GL_TIMESPEC_INLINE _GL_INLINE === modified file 'lib/u64.h' --- lib/u64.h 2013-01-01 09:11:05 +0000 +++ lib/u64.h 2013-09-19 21:40:08 +0000 @@ -19,6 +19,9 @@ #include +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif _GL_INLINE_HEADER_BEGIN #ifndef _GL_U64_INLINE # define _GL_U64_INLINE _GL_INLINE === modified file 'lib/unistd.in.h' --- lib/unistd.in.h 2013-03-13 00:38:42 +0000 +++ lib/unistd.in.h 2013-09-19 21:40:08 +0000 @@ -116,6 +116,9 @@ # include #endif +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif _GL_INLINE_HEADER_BEGIN #ifndef _GL_UNISTD_INLINE # define _GL_UNISTD_INLINE _GL_INLINE === modified file 'lib/utimens.c' --- lib/utimens.c 2013-05-06 13:37:42 +0000 +++ lib/utimens.c 2013-09-19 21:40:08 +0000 @@ -90,10 +90,12 @@ assert (timespec); if ((timespec[0].tv_nsec != UTIME_NOW && timespec[0].tv_nsec != UTIME_OMIT - && (timespec[0].tv_nsec < 0 || 1000000000 <= timespec[0].tv_nsec)) + && ! (0 <= timespec[0].tv_nsec + && timespec[0].tv_nsec < TIMESPEC_RESOLUTION)) || (timespec[1].tv_nsec != UTIME_NOW && timespec[1].tv_nsec != UTIME_OMIT - && (timespec[1].tv_nsec < 0 || 1000000000 <= timespec[1].tv_nsec))) + && ! (0 <= timespec[1].tv_nsec + && timespec[1].tv_nsec < TIMESPEC_RESOLUTION))) { errno = EINVAL; return -1; === modified file 'lib/utimens.h' --- lib/utimens.h 2013-01-01 09:11:05 +0000 +++ lib/utimens.h 2013-09-19 21:40:08 +0000 @@ -26,6 +26,9 @@ # include # include +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif _GL_INLINE_HEADER_BEGIN #ifndef _GL_UTIMENS_INLINE # define _GL_UTIMENS_INLINE _GL_INLINE === modified file 'm4/extern-inline.m4' --- m4/extern-inline.m4 2013-07-01 23:43:19 +0000 +++ m4/extern-inline.m4 2013-09-19 21:40:08 +0000 @@ -19,20 +19,28 @@ 'reference to static identifier "f" in extern inline function'. This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. - Suppress the use of extern inline on Apple's platforms, as Libc at least - through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g., + Suppress the use of extern inline on problematic Apple configurations, as + Libc at least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., . Perhaps Apple will fix this some day. */ +#if (defined __APPLE__ \ + && ((! defined _DONT_USE_CTYPE_INLINE_ \ + && (defined __GNUC__ || defined __cplusplus)) \ + || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ + && defined __GNUC__ && ! defined __cplusplus))) +# define _GL_EXTERN_INLINE_APPLE_BUG +#endif #if ((__GNUC__ \ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ : (199901L <= __STDC_VERSION__ \ && !defined __HP_cc \ && !(defined __SUNPRO_C && __STDC__))) \ - && !defined __APPLE__) + && !defined _GL_EXTERN_INLINE_APPLE_BUG) # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline +# define _GL_EXTERN_INLINE_IN_USE #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ - && !defined __APPLE__) + && !defined _GL_EXTERN_INLINE_APPLE_BUG) # if __GNUC_GNU_INLINE__ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) @@ -40,6 +48,7 @@ # define _GL_INLINE extern inline # endif # define _GL_EXTERN_INLINE extern +# define _GL_EXTERN_INLINE_IN_USE #else # define _GL_INLINE static _GL_UNUSED # define _GL_EXTERN_INLINE static _GL_UNUSED ------------------------------------------------------------ revno: 114400 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-09-19 16:51:33 -0400 message: * lisp/eshell/em-ls.el: Use advice. Remove redundant :group keywords. (eshell-ls-orig-insert-directory): Remove. (eshell-ls-unload-hook): Not a defcustom any more. Use advice-remove. (eshell-ls-use-in-dired): Use advice-add/remove. (eshell-ls--insert-directory): Rename from eshell-ls-insert-directory. Add `orig-fun' arg for use in :around advice. Make it check (redundantly) eshell-ls-use-in-dired. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-19 20:31:54 +0000 +++ lisp/ChangeLog 2013-09-19 20:51:33 +0000 @@ -1,3 +1,13 @@ +2013-09-19 Stefan Monnier + + * eshell/em-ls.el: Use advice. Remove redundant :group keywords. + (eshell-ls-orig-insert-directory): Remove. + (eshell-ls-unload-hook): Not a defcustom any more. Use advice-remove. + (eshell-ls-use-in-dired): Use advice-add/remove. + (eshell-ls--insert-directory): Rename from eshell-ls-insert-directory. + Add `orig-fun' arg for use in :around advice. + Make it check (redundantly) eshell-ls-use-in-dired. + 2013-09-19 Glenn Morris * emacs-lisp/cl-macs.el (cl-defsubst): Remove unused local `pbody'. === modified file 'lisp/eshell/em-ls.el' --- lisp/eshell/em-ls.el 2013-09-19 02:28:20 +0000 +++ lisp/eshell/em-ls.el 2013-09-19 20:51:33 +0000 @@ -44,125 +44,102 @@ ;;; User Variables: -(defvar eshell-ls-orig-insert-directory - (symbol-function 'insert-directory) - "Preserve the original definition of `insert-directory'.") - -(defcustom eshell-ls-unload-hook - (list - (lambda () (fset 'insert-directory eshell-ls-orig-insert-directory))) - "When unloading `eshell-ls', restore the definition of `insert-directory'." - :type 'hook - :group 'eshell-ls) - (defcustom eshell-ls-date-format "%Y-%m-%d" "How to display time information in `eshell-ls-file'. This is passed to `format-time-string' as a format string. To display the date using the current locale, use \"%b \%e\"." :version "24.1" - :type 'string - :group 'eshell-ls) + :type 'string) (defcustom eshell-ls-initial-args nil "If non-nil, this list of args is included before any call to `ls'. This is useful for enabling human-readable format (-h), for example." - :type '(repeat :tag "Arguments" string) - :group 'eshell-ls) + :type '(repeat :tag "Arguments" string)) (defcustom eshell-ls-dired-initial-args nil "If non-nil, args is included before any call to `ls' in Dired. This is useful for enabling human-readable format (-h), for example." - :type '(repeat :tag "Arguments" string) - :group 'eshell-ls) + :type '(repeat :tag "Arguments" string)) -;; FIXME should use advice, like ls-lisp.el does now. (defcustom eshell-ls-use-in-dired nil "If non-nil, use `eshell-ls' to read directories in Dired. Changing this without using customize has no effect." :set (lambda (symbol value) (if value - (or (bound-and-true-p eshell-ls-use-in-dired) - (fset 'insert-directory 'eshell-ls-insert-directory)) - (and (fboundp 'eshell-ls-insert-directory) eshell-ls-use-in-dired - (fset 'insert-directory eshell-ls-orig-insert-directory))) - (set symbol value)) + (advice-add 'insert-directory :around + #'eshell-ls--insert-directory) + (advice-remove 'insert-directory + #'eshell-ls--insert-directory)) + (set symbol value)) :type 'boolean - :require 'em-ls - :group 'eshell-ls) + :require 'em-ls) +(add-hook 'eshell-ls-unload-hook + (lambda () (advice-remove 'insert-directory + #'eshell-ls--insert-directory))) + (defcustom eshell-ls-default-blocksize 1024 "The default blocksize to use when display file sizes with -s." - :type 'integer - :group 'eshell-ls) + :type 'integer) (defcustom eshell-ls-exclude-regexp nil "Unless -a is specified, files matching this regexp will not be shown." - :type '(choice regexp (const nil)) - :group 'eshell-ls) + :type '(choice regexp (const nil))) (defcustom eshell-ls-exclude-hidden t "Unless -a is specified, files beginning with . will not be shown. Using this boolean, instead of `eshell-ls-exclude-regexp', is both faster and conserves more memory." - :type 'boolean - :group 'eshell-ls) + :type 'boolean) (defcustom eshell-ls-use-colors t "If non-nil, use colors in file listings." - :type 'boolean - :group 'eshell-ls) + :type 'boolean) (defface eshell-ls-directory '((((class color) (background light)) (:foreground "Blue" :weight bold)) (((class color) (background dark)) (:foreground "SkyBlue" :weight bold)) (t (:weight bold))) - "The face used for highlight directories." - :group 'eshell-ls) + "The face used for highlight directories.") (define-obsolete-face-alias 'eshell-ls-directory-face 'eshell-ls-directory "22.1") (defface eshell-ls-symlink '((((class color) (background light)) (:foreground "Dark Cyan" :weight bold)) (((class color) (background dark)) (:foreground "Cyan" :weight bold))) - "The face used for highlight symbolic links." - :group 'eshell-ls) + "The face used for highlight symbolic links.") (define-obsolete-face-alias 'eshell-ls-symlink-face 'eshell-ls-symlink "22.1") (defface eshell-ls-executable '((((class color) (background light)) (:foreground "ForestGreen" :weight bold)) (((class color) (background dark)) (:foreground "Green" :weight bold))) - "The face used for highlighting executables (not directories, though)." - :group 'eshell-ls) + "The face used for highlighting executables (not directories, though).") (define-obsolete-face-alias 'eshell-ls-executable-face 'eshell-ls-executable "22.1") (defface eshell-ls-readonly '((((class color) (background light)) (:foreground "Brown")) (((class color) (background dark)) (:foreground "Pink"))) - "The face used for highlighting read-only files." - :group 'eshell-ls) + "The face used for highlighting read-only files.") (define-obsolete-face-alias 'eshell-ls-readonly-face 'eshell-ls-readonly "22.1") (defface eshell-ls-unreadable '((((class color) (background light)) (:foreground "Grey30")) (((class color) (background dark)) (:foreground "DarkGrey"))) - "The face used for highlighting unreadable files." - :group 'eshell-ls) + "The face used for highlighting unreadable files.") (define-obsolete-face-alias 'eshell-ls-unreadable-face 'eshell-ls-unreadable "22.1") (defface eshell-ls-special '((((class color) (background light)) (:foreground "Magenta" :weight bold)) (((class color) (background dark)) (:foreground "Magenta" :weight bold))) - "The face used for highlighting non-regular files." - :group 'eshell-ls) + "The face used for highlighting non-regular files.") (define-obsolete-face-alias 'eshell-ls-special-face 'eshell-ls-special "22.1") (defface eshell-ls-missing '((((class color) (background light)) (:foreground "Red" :weight bold)) (((class color) (background dark)) (:foreground "Red" :weight bold))) - "The face used for highlighting non-existent file names." - :group 'eshell-ls) + "The face used for highlighting non-existent file names.") (define-obsolete-face-alias 'eshell-ls-missing-face 'eshell-ls-missing "22.1") (defcustom eshell-ls-archive-regexp @@ -172,27 +149,23 @@ This typically includes both traditional archives and compressed files." :version "24.1" ; added xz - :type 'regexp - :group 'eshell-ls) + :type 'regexp) (defface eshell-ls-archive '((((class color) (background light)) (:foreground "Orchid" :weight bold)) (((class color) (background dark)) (:foreground "Orchid" :weight bold))) - "The face used for highlighting archived and compressed file names." - :group 'eshell-ls) + "The face used for highlighting archived and compressed file names.") (define-obsolete-face-alias 'eshell-ls-archive-face 'eshell-ls-archive "22.1") (defcustom eshell-ls-backup-regexp "\\(\\`\\.?#\\|\\(\\.bak\\|~\\)\\'\\)" "A regular expression that matches names of backup files." - :type 'regexp - :group 'eshell-ls) + :type 'regexp) (defface eshell-ls-backup '((((class color) (background light)) (:foreground "OrangeRed")) (((class color) (background dark)) (:foreground "LightSalmon"))) - "The face used for highlighting backup file names." - :group 'eshell-ls) + "The face used for highlighting backup file names.") (define-obsolete-face-alias 'eshell-ls-backup-face 'eshell-ls-backup "22.1") (defcustom eshell-ls-product-regexp @@ -200,14 +173,12 @@ "A regular expression that matches names of product files. Products are files that get generated from a source file, and hence ought to be recreatable if they are deleted." - :type 'regexp - :group 'eshell-ls) + :type 'regexp) (defface eshell-ls-product '((((class color) (background light)) (:foreground "OrangeRed")) (((class color) (background dark)) (:foreground "LightSalmon"))) - "The face used for highlighting files that are build products." - :group 'eshell-ls) + "The face used for highlighting files that are build products.") (define-obsolete-face-alias 'eshell-ls-product-face 'eshell-ls-product "22.1") (defcustom eshell-ls-clutter-regexp @@ -215,14 +186,12 @@ "A regular expression that matches names of junk files. These are mainly files that get created for various reasons, but don't really need to stick around for very long." - :type 'regexp - :group 'eshell-ls) + :type 'regexp) (defface eshell-ls-clutter '((((class color) (background light)) (:foreground "OrangeRed" :weight bold)) (((class color) (background dark)) (:foreground "OrangeRed" :weight bold))) - "The face used for highlighting junk file names." - :group 'eshell-ls) + "The face used for highlighting junk file names.") (define-obsolete-face-alias 'eshell-ls-clutter-face 'eshell-ls-clutter "22.1") (defsubst eshell-ls-filetype-p (attrs type) @@ -263,8 +232,7 @@ If TEST-SEXP evals to non-nil, that face will be used to highlight the name of the file. The first match wins. `file' and `attrs' are in scope during the evaluation of TEST-SEXP." - :type '(repeat (cons function face)) - :group 'eshell-ls) + :type '(repeat (cons function face))) (defvar block-size) (defvar dereference-links) @@ -287,8 +255,8 @@ ;;; Functions: -(defun eshell-ls-insert-directory - (file switches &optional wildcard full-directory-p) +(defun eshell-ls--insert-directory + (orig-fun file switches &optional wildcard full-directory-p) "Insert directory listing for FILE, formatted according to SWITCHES. Leaves point after the inserted text. SWITCHES may be a string of options, or a list of strings. @@ -299,29 +267,31 @@ This version of the function uses `eshell/ls'. If any of the switches passed are not recognized, the operating system's version will be used instead." - (let ((handler (find-file-name-handler file 'insert-directory))) - (if handler - (funcall handler 'insert-directory file switches - wildcard full-directory-p) - (if (stringp switches) - (setq switches (split-string switches))) - (let (eshell-current-handles - eshell-current-subjob-p - font-lock-mode) - ;; use the fancy highlighting in `eshell-ls' rather than font-lock - (when (and eshell-ls-use-colors - (featurep 'font-lock)) - (font-lock-mode -1) - (setq font-lock-defaults nil) - (if (boundp 'font-lock-buffers) - (set 'font-lock-buffers - (delq (current-buffer) - (symbol-value 'font-lock-buffers))))) - (let ((insert-func 'insert) - (error-func 'insert) - (flush-func 'ignore) - eshell-ls-dired-initial-args) - (eshell-do-ls (append switches (list file)))))))) + (if (not eshell-ls-use-in-dired) + (funcall orig-fun file switches wildcard full-directory-p) + (let ((handler (find-file-name-handler file 'insert-directory))) + (if handler + (funcall handler 'insert-directory file switches + wildcard full-directory-p) + (if (stringp switches) + (setq switches (split-string switches))) + (let (eshell-current-handles + eshell-current-subjob-p + font-lock-mode) + ;; use the fancy highlighting in `eshell-ls' rather than font-lock + (when (and eshell-ls-use-colors + (featurep 'font-lock)) + (font-lock-mode -1) + (setq font-lock-defaults nil) + (if (boundp 'font-lock-buffers) + (set 'font-lock-buffers + (delq (current-buffer) + (symbol-value 'font-lock-buffers))))) + (let ((insert-func 'insert) + (error-func 'insert) + (flush-func 'ignore) + eshell-ls-dired-initial-args) + (eshell-do-ls (append switches (list file))))))))) (defsubst eshell/ls (&rest args) "An alias version of `eshell-do-ls'." ------------------------------------------------------------ revno: 114399 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-09-19 16:31:54 -0400 message: * lisp/emacs-lisp/cl-macs.el (cl-defsubst): Remove unused local `pbody'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-19 20:31:26 +0000 +++ lisp/ChangeLog 2013-09-19 20:31:54 +0000 @@ -1,5 +1,7 @@ 2013-09-19 Glenn Morris + * emacs-lisp/cl-macs.el (cl-defsubst): Remove unused local `pbody'. + * simple.el (x-selection-owner-p, x-selection-exists-p): Declare. * emacs-lisp/eieio.el (class-parent): Undo previous change. === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2013-08-29 03:49:10 +0000 +++ lisp/emacs-lisp/cl-macs.el 2013-09-19 20:31:54 +0000 @@ -2701,8 +2701,10 @@ \(fn NAME ARGLIST [DOCSTRING] BODY...)" (declare (debug cl-defun) (indent 2)) - (let* ((argns (cl--arglist-args args)) (p argns) - (pbody (cons 'progn body))) + (let* ((argns (cl--arglist-args args)) + (p argns) + ;; (pbody (cons 'progn body)) + ) (while (and p (eq (cl--expr-contains args (car p)) 1)) (pop p)) `(progn ,(if p nil ; give up if defaults refer to earlier args ------------------------------------------------------------ revno: 114398 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-09-19 16:31:26 -0400 message: * lisp/simple.el (x-selection-owner-p, x-selection-exists-p): Declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-19 20:11:48 +0000 +++ lisp/ChangeLog 2013-09-19 20:31:26 +0000 @@ -1,5 +1,7 @@ 2013-09-19 Glenn Morris + * simple.el (x-selection-owner-p, x-selection-exists-p): Declare. + * emacs-lisp/eieio.el (class-parent): Undo previous change. 2013-09-19 Michael Albinus === modified file 'lisp/simple.el' --- lisp/simple.el 2013-09-18 02:50:04 +0000 +++ lisp/simple.el 2013-09-19 20:31:26 +0000 @@ -4159,6 +4159,12 @@ (marker-position (mark-marker)) (signal 'mark-inactive nil))) +;; Behind display-selections-p. +(declare-function x-selection-owner-p "xselect.c" + (&optional selection terminal)) +(declare-function x-selection-exists-p "xselect.c" + (&optional selection terminal)) + (defun deactivate-mark (&optional force) "Deactivate the mark. If Transient Mark mode is disabled, this function normally does ------------------------------------------------------------ revno: 114397 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-09-19 16:11:48 -0400 message: * lisp/emacs-lisp/eieio.el (class-parent): Undo previous change. Ref: http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00354.html diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-19 11:08:01 +0000 +++ lisp/ChangeLog 2013-09-19 20:11:48 +0000 @@ -1,3 +1,7 @@ +2013-09-19 Glenn Morris + + * emacs-lisp/eieio.el (class-parent): Undo previous change. + 2013-09-19 Michael Albinus * net/tramp-sh.el (tramp-get-remote-id): Do not raise an error. === modified file 'lisp/emacs-lisp/eieio.el' --- lisp/emacs-lisp/eieio.el 2013-09-19 07:14:53 +0000 +++ lisp/emacs-lisp/eieio.el 2013-09-19 20:11:48 +0000 @@ -322,10 +322,7 @@ (defmacro eieio-class-parent (class) "Return first parent class to CLASS. (overload of variable)." `(car (eieio-class-parents ,class))) - -(defmacro class-parent (class) - (declare (obsolete eieio-class-parent "24.4")) - '(eieio-class-parent class)) +(define-obsolete-function-alias 'class-parent 'eieio-class-parent "24.4") (defun same-class-p (obj class) "Return t if OBJ is of class-type CLASS." (eieio--check-type class-p class) ------------------------------------------------------------ revno: 114396 committer: Michael Albinus branch nick: trunk timestamp: Thu 2013-09-19 21:14:26 +0200 message: Fix previous patch. diff: === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2013-09-19 11:08:01 +0000 +++ lisp/net/tramp-sh.el 2013-09-19 19:14:26 +0000 @@ -5000,7 +5000,8 @@ (tramp-get-remote-uid-with-perl vec id-format)) ((tramp-get-remote-python vec) (tramp-get-remote-uid-with-python vec id-format)) - (t (tramp-error vec "Cannot determine remote uid"))))) + (t (tramp-error + vec 'file-error "Cannot determine remote uid"))))) ;; The command might not always return a number. (if (and (equal id-format 'integer) (not (integerp res))) -1 res)))) @@ -5040,7 +5041,8 @@ (tramp-get-remote-gid-with-perl vec id-format)) ((tramp-get-remote-python vec) (tramp-get-remote-gid-with-python vec id-format)) - (t (tramp-error vec "Cannot determine remote gid"))))) + (t (tramp-error + vec 'file-error "Cannot determine remote gid"))))) ;; The command might not always return a number. (if (and (equal id-format 'integer) (not (integerp res))) -1 res)))) ------------------------------------------------------------ revno: 114395 committer: Michael Albinus branch nick: trunk timestamp: Thu 2013-09-19 13:08:01 +0200 message: * net/tramp-sh.el (tramp-get-remote-id): Do not raise an error. (tramp-get-remote-uid-with-id, tramp-get-remote-gid-with-id) (tramp-get-remote-python): New defuns. (tramp-get-remote-uid-with-perl) (tramp-get-remote-gid-with-perl): New defuns. Perl code contributed by yary (tiny change). (tramp-get-remote-uid-with-python) (tramp-get-remote-gid-with-python): New defuns. Python code contributed by Andrey Tykhonov (tiny change). (tramp-get-remote-uid, tramp-get-remote-gid): Use new defuns. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-19 07:14:53 +0000 +++ lisp/ChangeLog 2013-09-19 11:08:01 +0000 @@ -1,3 +1,16 @@ +2013-09-19 Michael Albinus + + * net/tramp-sh.el (tramp-get-remote-id): Do not raise an error. + (tramp-get-remote-uid-with-id, tramp-get-remote-gid-with-id) + (tramp-get-remote-python): New defuns. + (tramp-get-remote-uid-with-perl) + (tramp-get-remote-gid-with-perl): New defuns. Perl code + contributed by yary (tiny change). + (tramp-get-remote-uid-with-python) + (tramp-get-remote-gid-with-python): New defuns. Python code + contributed by Andrey Tykhonov (tiny change). + (tramp-get-remote-uid, tramp-get-remote-gid): Use new defuns. + 2013-09-19 Glenn Morris * emacs-lisp/eieio.el (class-parent): Don't use defalias with macros. === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2013-09-13 06:03:06 +0000 +++ lisp/net/tramp-sh.el 2013-09-19 11:08:01 +0000 @@ -4950,38 +4950,97 @@ (defun tramp-get-remote-id (vec) (with-tramp-connection-property vec "id" (tramp-message vec 5 "Finding POSIX `id' command") - (or - (catch 'id-found - (let ((dl (tramp-get-remote-path vec)) - result) - (while (and dl (setq result (tramp-find-executable vec "id" dl t t))) - ;; Check POSIX parameter. - (when (tramp-send-command-and-check vec (format "%s -u" result)) - (throw 'id-found result)) - (setq dl (cdr dl))))) - (tramp-error vec 'file-error "Couldn't find a POSIX `id' command")))) + (catch 'id-found + (let ((dl (tramp-get-remote-path vec)) + result) + (while (and dl (setq result (tramp-find-executable vec "id" dl t t))) + ;; Check POSIX parameter. + (when (tramp-send-command-and-check vec (format "%s -u" result)) + (throw 'id-found result)) + (setq dl (cdr dl))))))) + +(defun tramp-get-remote-uid-with-id (vec id-format) + (tramp-send-command-and-read + vec + (format "%s -u%s %s" + (tramp-get-remote-id vec) + (if (equal id-format 'integer) "" "n") + (if (equal id-format 'integer) + "" "| sed -e s/^/\\\"/ -e s/\$/\\\"/")))) + +(defun tramp-get-remote-uid-with-perl (vec id-format) + (tramp-send-command-and-read + vec + (format "%s -le '%s'" + (tramp-get-remote-perl vec) + (if (equal id-format 'integer) + "print $>" + "print \"\\\"\", scalar getpwuid($>), \"\\\"\"")))) + +(defun tramp-get-remote-python (vec) + (with-tramp-connection-property vec "python" + (tramp-message vec 5 "Finding a suitable `python' command") + (tramp-find-executable vec "python" (tramp-get-remote-path vec)))) + +(defun tramp-get-remote-uid-with-python (vec id-format) + (tramp-send-command-and-read + vec + (format "%s -c \"%s\"" + (tramp-get-remote-python vec) + (if (equal id-format 'integer) + "import os; print os.getuid()" + "import os, pwd; print '\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"'")))) (defun tramp-get-remote-uid (vec 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" - (tramp-get-remote-id vec) - (if (equal id-format 'integer) "" "n") - (if (equal id-format 'integer) - "" "| sed -e s/^/\\\"/ -e s/\$/\\\"/"))))) + (let ((res (cond + ((tramp-get-remote-id vec) + (tramp-get-remote-uid-with-id vec id-format)) + ((tramp-get-remote-perl vec) + (tramp-get-remote-uid-with-perl vec id-format)) + ((tramp-get-remote-python vec) + (tramp-get-remote-uid-with-python vec id-format)) + (t (tramp-error vec "Cannot determine remote uid"))))) ;; The command might not always return a number. (if (and (equal id-format 'integer) (not (integerp res))) -1 res)))) +(defun tramp-get-remote-gid-with-id (vec id-format) + (tramp-send-command-and-read + vec + (format "%s -g%s %s" + (tramp-get-remote-id vec) + (if (equal id-format 'integer) "" "n") + (if (equal id-format 'integer) + "" "| sed -e s/^/\\\"/ -e s/\$/\\\"/")))) + +(defun tramp-get-remote-gid-with-perl (vec id-format) + (tramp-send-command-and-read + vec + (format "%s -le '%s'" + (tramp-get-remote-perl vec) + (if (equal id-format 'integer) + "print ($)=~/(\\d+)/)" + "print \"\\\"\", scalar getgrgid($)), \"\\\"\"")))) + +(defun tramp-get-remote-gid-with-python (vec id-format) + (tramp-send-command-and-read + vec + (format "%s -c \"%s\"" + (tramp-get-remote-python vec) + (if (equal id-format 'integer) + "import os; print os.getgid()" + "import os, grp; print '\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"'")))) + (defun tramp-get-remote-gid (vec 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" - (tramp-get-remote-id vec) - (if (equal id-format 'integer) "" "n") - (if (equal id-format 'integer) - "" "| sed -e s/^/\\\"/ -e s/\$/\\\"/"))))) + (let ((res (cond + ((tramp-get-remote-id vec) + (tramp-get-remote-gid-with-id vec id-format)) + ((tramp-get-remote-perl vec) + (tramp-get-remote-gid-with-perl vec id-format)) + ((tramp-get-remote-python vec) + (tramp-get-remote-gid-with-python vec id-format)) + (t (tramp-error vec "Cannot determine remote gid"))))) ;; The command might not always return a number. (if (and (equal id-format 'integer) (not (integerp res))) -1 res)))) ------------------------------------------------------------ revno: 114394 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-09-19 06:17:39 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2013-09-17 10:17:44 +0000 +++ autogen/configure 2013-09-19 10:17:39 +0000 @@ -4623,6 +4623,17 @@ * ) srcdir=`(cd "$srcdir"; pwd)` ;; esac +#### When building with MinGW inside the MSYS tree, 'pwd' produces +#### directories relative to the root of the MSYS tree, +#### e.g. '/home/user/foo' instead of '/d/MSYS/home/user/foo'. When +#### such a value of srcdir is written to the top-level Makefile, it +#### gets propagated to src/epaths.h, and that causes temacs to fail, +#### because, being a MinGW program that knows nothing of MSYS root +#### substitution, it cannot find the data directory. "pwd -W" +#### produces Windows-style 'd:/foo/bar' absolute directory names, so +#### we use it here to countermand that lossage. +test "$MSYSTEM" = "MINGW32" && srcdir=`(cd "$srcdir"; pwd -W | sed -e 's,^\([A-Za-z]\):,/\1,')` + ### Canonicalize the configuration name. # Make sure we can run config.sub. ------------------------------------------------------------ revno: 114393 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2013-09-19 11:43:01 +0300 message: Fix MinGW builds from inside the MSYS installation tree. configure.ac [MINGW32]: Make sure the value of 'srcdir' is in the full /d/foo/bar form. See the discussion in http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00210.html, and in particular http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00252.html and its followups, for the details. diff: === modified file 'ChangeLog' --- ChangeLog 2013-09-17 06:33:24 +0000 +++ ChangeLog 2013-09-19 08:43:01 +0000 @@ -1,3 +1,12 @@ +2013-09-19 Eli Zaretskii + + * configure.ac [MINGW32]: Make sure the value of 'srcdir' + is in the full /d/foo/bar form. See the discussion in + http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00210.html, + and in particular + http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00252.html + and its followups, for the details. + 2013-09-17 Dmitry Antipov * configure.ac: Do not check for g_type_init because we === modified file 'configure.ac' --- configure.ac 2013-09-17 06:33:24 +0000 +++ configure.ac 2013-09-19 08:43:01 +0000 @@ -443,6 +443,17 @@ * ) srcdir=`(cd "$srcdir"; pwd)` ;; esac +#### When building with MinGW inside the MSYS tree, 'pwd' produces +#### directories relative to the root of the MSYS tree, +#### e.g. '/home/user/foo' instead of '/d/MSYS/home/user/foo'. When +#### such a value of srcdir is written to the top-level Makefile, it +#### gets propagated to src/epaths.h, and that causes temacs to fail, +#### because, being a MinGW program that knows nothing of MSYS root +#### substitution, it cannot find the data directory. "pwd -W" +#### produces Windows-style 'd:/foo/bar' absolute directory names, so +#### we use it here to countermand that lossage. +test "$MSYSTEM" = "MINGW32" && srcdir=`(cd "$srcdir"; pwd -W | sed -e 's,^\([[A-Za-z]]\):,/\1,')` + ### Canonicalize the configuration name. AC_CANONICAL_HOST ------------------------------------------------------------ revno: 114392 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2013-09-19 11:25:43 +0300 message: Fix a compiler warning on MS-Windows due to recent changes. src/w32reg.c (w32_get_string_resource): Make the first 2 arguments 'const char *' to avoid compiler warnings due to similar change in the prototype of x_get_string_resource. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-19 07:48:53 +0000 +++ src/ChangeLog 2013-09-19 08:25:43 +0000 @@ -1,3 +1,9 @@ +2013-09-19 Eli Zaretskii + + * w32reg.c (w32_get_string_resource): Make the first 2 arguments + 'const char *' to avoid compiler warnings due to similar change in + the prototype of x_get_string_resource. + 2013-09-19 Dmitry Antipov * xterm.h (struct x_display_info): New members last_mouse_glyph_frame, === modified file 'src/w32reg.c' --- src/w32reg.c 2013-09-17 12:27:21 +0000 +++ src/w32reg.c 2013-09-19 08:25:43 +0000 @@ -74,7 +74,7 @@ } static LPBYTE -w32_get_string_resource (char *name, char *class, DWORD dwexptype) +w32_get_string_resource (const char *name, const char *class, DWORD dwexptype) { LPBYTE lpvalue = NULL; HKEY hrootkey = NULL; @@ -92,7 +92,7 @@ if (RegOpenKeyEx (hive, REG_ROOT, 0, KEY_READ, &hrootkey) == ERROR_SUCCESS) { - char *keyname; + const char *keyname; if (RegQueryValueEx (hrootkey, name, NULL, &dwType, NULL, &cbData) == ERROR_SUCCESS && dwType == dwexptype) ------------------------------------------------------------ revno: 114391 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2013-09-19 11:48:53 +0400 message: * xterm.h (struct x_display_info): New members last_mouse_glyph_frame, last_mouse_scroll_bar, last_mouse_glyph and last_mouse_movement_time, going to replace static variables below. Adjust comments. * xterm.c (last_mouse_glyph, last_mouse_glyph_frame) (last_mouse_scroll_bar, last_mouse_movement_time): Remove. (note_mouse_movement, XTmouse_position, x_scroll_bar_note_movement) (x_scroll_bar_report_motion, handle_one_xevent, syms_of_xterm): Related users changed. * w32term.h (struct w32_display_info): New members last_mouse_glyph_frame, last_mouse_scroll_bar, last_mouse_scroll_bar_pos, last_mouse_glyph and last_mouse_movement_time, going to replace static variables below. Adjust comments. * w32term.c (last_mouse_glyph_frame, last_mouse_scroll_bar) (last_mouse_scroll_bar_pos, last_mouse_glyph, last_mouse_movement_time): Remove. (note_mouse_movement, w32_mouse_position, w32_scroll_bar_handle_click) (x_scroll_bar_report_motion, syms_of_w32term): Related users changed. * nsterm.h (struct ns_display_info): New members last_mouse_glyph, last_mouse_movement_time and last_mouse_scroll_bar, going to replace static variables below. * nsterm.m (last_mouse_glyph, last_mouse_movement_time) (last_mouse_scroll_bar): Remove. (note_mouse_movement, ns_mouse_position, mouseMoved, mouseEntered) (mouseExited): Related users changed. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-19 05:21:32 +0000 +++ src/ChangeLog 2013-09-19 07:48:53 +0000 @@ -1,5 +1,32 @@ 2013-09-19 Dmitry Antipov + * xterm.h (struct x_display_info): New members last_mouse_glyph_frame, + last_mouse_scroll_bar, last_mouse_glyph and last_mouse_movement_time, + going to replace static variables below. Adjust comments. + * xterm.c (last_mouse_glyph, last_mouse_glyph_frame) + (last_mouse_scroll_bar, last_mouse_movement_time): Remove. + (note_mouse_movement, XTmouse_position, x_scroll_bar_note_movement) + (x_scroll_bar_report_motion, handle_one_xevent, syms_of_xterm): + Related users changed. + * w32term.h (struct w32_display_info): New members last_mouse_glyph_frame, + last_mouse_scroll_bar, last_mouse_scroll_bar_pos, last_mouse_glyph and + last_mouse_movement_time, going to replace static variables below. + Adjust comments. + * w32term.c (last_mouse_glyph_frame, last_mouse_scroll_bar) + (last_mouse_scroll_bar_pos, last_mouse_glyph, last_mouse_movement_time): + Remove. + (note_mouse_movement, w32_mouse_position, w32_scroll_bar_handle_click) + (x_scroll_bar_report_motion, syms_of_w32term): Related users changed. + * nsterm.h (struct ns_display_info): New members last_mouse_glyph, + last_mouse_movement_time and last_mouse_scroll_bar, going to replace + static variables below. + * nsterm.m (last_mouse_glyph, last_mouse_movement_time) + (last_mouse_scroll_bar): Remove. + (note_mouse_movement, ns_mouse_position, mouseMoved, mouseEntered) + (mouseExited): Related users changed. + +2013-09-19 Dmitry Antipov + Do not use external array to process X scroll bar messages. * xterm.c (scroll_bar_windows, scroll_bar_windows_size): Remove. (x_send_scroll_bar_event): Pack window pointer into two slots === modified file 'src/nsterm.h' --- src/nsterm.h 2013-09-18 09:23:10 +0000 +++ src/nsterm.h 2013-09-19 07:48:53 +0000 @@ -608,6 +608,19 @@ This is a position on last_mouse_motion_frame. */ int last_mouse_motion_x; int last_mouse_motion_y; + + /* Where the mouse was last time we reported a mouse position. */ + NSRect last_mouse_glyph; + + /* Time of last mouse movement. */ + Time last_mouse_movement_time; + + /* The scroll bar in which the last motion event occurred. */ +#ifdef __OBJC__ + EmacsScroller *last_mouse_scroll_bar; +#else + void *last_mouse_scroll_bar; +#endif }; /* This is a chain of structures for all the NS displays currently in use. */ === modified file 'src/nsterm.m' --- src/nsterm.m 2013-09-18 09:23:10 +0000 +++ src/nsterm.m 2013-09-19 07:48:53 +0000 @@ -191,9 +191,6 @@ long context_menu_value = 0; /* display update */ -static NSRect last_mouse_glyph; -static Time last_mouse_movement_time = 0; -static EmacsScroller *last_mouse_scroll_bar = nil; static struct frame *ns_updating_frame; static NSView *focus_view = NULL; static int ns_window_num = 0; @@ -1738,24 +1735,26 @@ known as last_mouse_glyph. ------------------------------------------------------------------------ */ { + struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame); + NSRect *r; + // NSTRACE (note_mouse_movement); - FRAME_DISPLAY_INFO (frame)->last_mouse_motion_frame = frame; + dpyinfo->last_mouse_motion_frame = frame; + r = &dpyinfo->last_mouse_glyph; /* Note, this doesn't get called for enter/leave, since we don't have a position. Those are taken care of in the corresponding NSView methods. */ /* has movement gone beyond last rect we were tracking? */ - if (x < last_mouse_glyph.origin.x || - x >= (last_mouse_glyph.origin.x + last_mouse_glyph.size.width) || - y < last_mouse_glyph.origin.y || - y >= (last_mouse_glyph.origin.y + last_mouse_glyph.size.height)) + if (x < r->origin.x || x >= r->origin.x + r->size.width + || y < r->origin.y || y >= r->origin.y + r->size.height) { - ns_update_begin(frame); + ns_update_begin (frame); frame->mouse_moved = 1; note_mouse_highlight (frame, x, y); - remember_mouse_glyph (frame, x, y, &last_mouse_glyph); - ns_update_end(frame); + remember_mouse_glyph (frame, x, y, r); + ns_update_end (frame); return 1; } @@ -1792,14 +1791,15 @@ block_input (); - if (last_mouse_scroll_bar != nil && insist == 0) + if (dpyinfo->last_mouse_scroll_bar != nil && insist == 0) { /* TODO: we do not use this path at the moment because drag events will go directly to the EmacsScroller. Leaving code in for now. */ - [last_mouse_scroll_bar getMouseMotionPart: (int *)part window: bar_window - x: x y: y]; - if (time) *time = last_mouse_movement_time; - last_mouse_scroll_bar = nil; + [dpyinfo->last_mouse_scroll_bar + getMouseMotionPart: (int *)part window: bar_window x: x y: y]; + if (time) + *time = dpyinfo->last_mouse_movement_time; + dpyinfo->last_mouse_scroll_bar = nil; } else { @@ -1809,7 +1809,7 @@ && FRAME_NS_DISPLAY (XFRAME (frame)) == FRAME_NS_DISPLAY (*fp)) XFRAME (frame)->mouse_moved = 0; - last_mouse_scroll_bar = nil; + dpyinfo->last_mouse_scroll_bar = nil; if (dpyinfo->last_mouse_frame && FRAME_LIVE_P (dpyinfo->last_mouse_frame)) f = dpyinfo->last_mouse_frame; @@ -1823,7 +1823,8 @@ position = [[view window] mouseLocationOutsideOfEventStream]; position = [view convertPoint: position fromView: nil]; - remember_mouse_glyph (f, position.x, position.y, &last_mouse_glyph); + remember_mouse_glyph (f, position.x, position.y, + &dpyinfo->last_mouse_glyph); /*fprintf (stderr, "ns_mouse_position: %.0f, %.0f\n", position.x, position.y); */ if (bar_window) *bar_window = Qnil; @@ -1831,7 +1832,8 @@ if (x) XSETINT (*x, lrint (position.x)); if (y) XSETINT (*y, lrint (position.y)); - if (time) *time = last_mouse_movement_time; + if (time) + *time = dpyinfo->last_mouse_movement_time; *fp = f; } } @@ -5452,7 +5454,7 @@ // NSTRACE (mouseMoved); - last_mouse_movement_time = EV_TIMESTAMP (e); + dpyinfo->last_mouse_movement_time = EV_TIMESTAMP (e); pt = [self convertPoint: [e locationInWindow] fromView: nil]; dpyinfo->last_mouse_motion_x = pt.x; dpyinfo->last_mouse_motion_y = pt.y; @@ -6336,7 +6338,9 @@ - (void)mouseEntered: (NSEvent *)theEvent { NSTRACE (mouseEntered); - last_mouse_movement_time = EV_TIMESTAMP (theEvent); + if (emacsframe) + FRAME_DISPLAY_INFO (emacsframe)->last_mouse_movement_time + = EV_TIMESTAMP (theEvent); } @@ -6349,7 +6353,8 @@ if (!hlinfo) return; - last_mouse_movement_time = EV_TIMESTAMP (theEvent); + FRAME_DISPLAY_INFO (emacsframe)->last_mouse_movement_time + = EV_TIMESTAMP (theEvent); if (emacsframe == hlinfo->mouse_face_mouse_frame) { === modified file 'src/w32term.c' --- src/w32term.c 2013-09-18 13:18:39 +0000 +++ src/w32term.c 2013-09-19 07:48:53 +0000 @@ -171,31 +171,6 @@ /* Keyboard code page - may be changed by language-change events. */ int w32_keyboard_codepage; -/* Mouse movement. */ - -/* Where the mouse was last time we reported a mouse event. */ -static RECT last_mouse_glyph; -static struct frame *last_mouse_glyph_frame; - -/* The scroll bar in which the last motion event occurred. - - If the last motion event occurred in a scroll bar, we set this - so w32_mouse_position can know whether to report a scroll bar motion or - an ordinary motion. - - If the last motion event didn't occur in a scroll bar, we set this - to Qnil, to tell w32_mouse_position to return an ordinary motion event. */ -static Lisp_Object last_mouse_scroll_bar; -static int last_mouse_scroll_bar_pos; - -/* This is a hack. We would really prefer that w32_mouse_position would - return the time associated with the position it returns, but there - doesn't seem to be any way to wrest the time-stamp from the server - along with the position query. So, we just keep track of the time - of the last movement we received, and return that in hopes that - it's somewhat accurate. */ -static Time last_mouse_movement_time; - /* Incremented by w32_read_socket whenever it really tries to read events. */ static int volatile input_signal_count; @@ -3310,12 +3285,13 @@ struct w32_display_info *dpyinfo; int mouse_x = LOWORD (msg->lParam); int mouse_y = HIWORD (msg->lParam); + RECT *r; if (!FRAME_X_OUTPUT (frame)) return 0; dpyinfo = FRAME_DISPLAY_INFO (frame); - last_mouse_movement_time = msg->time; + dpyinfo->last_mouse_movement_time = msg->time; dpyinfo->last_mouse_motion_frame = frame; dpyinfo->last_mouse_motion_x = mouse_x; dpyinfo->last_mouse_motion_y = mouse_y; @@ -3323,28 +3299,27 @@ if (msg->hwnd != FRAME_W32_WINDOW (frame)) { frame->mouse_moved = 1; - last_mouse_scroll_bar = Qnil; + dpyinfo->last_mouse_scroll_bar = NULL; note_mouse_highlight (frame, -1, -1); - last_mouse_glyph_frame = 0; + dpyinfo->last_mouse_glyph_frame = NULL; return 1; } /* Has the mouse moved off the glyph it was on at the last sighting? */ - if (frame != last_mouse_glyph_frame - || mouse_x < last_mouse_glyph.left - || mouse_x >= last_mouse_glyph.right - || mouse_y < last_mouse_glyph.top - || mouse_y >= last_mouse_glyph.bottom) + r = &dpyinfo->last_mouse_glyph; + if (frame != dpyinfo->last_mouse_glyph_frame + || mouse_x < r->left || mouse_x >= r->right + || mouse_y < r->top || mouse_y >= r->bottom) { frame->mouse_moved = 1; - last_mouse_scroll_bar = Qnil; + dpyinfo->last_mouse_scroll_bar = NULL; note_mouse_highlight (frame, mouse_x, mouse_y); /* Remember the mouse position here, as w32_mouse_position only gets called when mouse tracking is enabled but we also need to keep track of the mouse for help_echo and highlighting at other times. */ - remember_mouse_glyph (frame, mouse_x, mouse_y, &last_mouse_glyph); - last_mouse_glyph_frame = frame; + remember_mouse_glyph (frame, mouse_x, mouse_y, r); + dpyinfo->last_mouse_glyph_frame = frame; return 1; } @@ -3398,7 +3373,7 @@ block_input (); - if (! NILP (last_mouse_scroll_bar) && insist == 0) + if (dpyinfo->last_mouse_scroll_bar && insist == 0) x_scroll_bar_report_motion (fp, bar_window, part, x, y, time); else { @@ -3410,7 +3385,7 @@ FOR_EACH_FRAME (tail, frame) XFRAME (frame)->mouse_moved = 0; - last_mouse_scroll_bar = Qnil; + dpyinfo->last_mouse_scroll_bar = NULL; GetCursorPos (&pt); @@ -3448,16 +3423,17 @@ on it, i.e. into the same rectangles that matrices on the frame are divided into. */ + dpyinfo = FRAME_DISPLAY_INFO (f1); ScreenToClient (FRAME_W32_WINDOW (f1), &pt); - remember_mouse_glyph (f1, pt.x, pt.y, &last_mouse_glyph); - last_mouse_glyph_frame = f1; + remember_mouse_glyph (f1, pt.x, pt.y, &dpyinfo->last_mouse_glyph); + dpyinfo->last_mouse_glyph_frame = f1; *bar_window = Qnil; *part = 0; *fp = f1; XSETINT (*x, pt.x); XSETINT (*y, pt.y); - *time = last_mouse_movement_time; + *time = dpyinfo->last_mouse_movement_time; } } } @@ -4005,6 +3981,7 @@ { int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); + struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); int y; int dragging = !NILP (bar->dragging); SCROLLINFO si; @@ -4016,9 +3993,7 @@ y = si.nPos; bar->dragging = Qnil; - - - last_mouse_scroll_bar_pos = msg->msg.wParam; + FRAME_DISPLAY_INFO (f)->last_mouse_scroll_bar_pos = msg->msg.wParam; switch (LOWORD (msg->msg.wParam)) { @@ -4101,7 +4076,8 @@ Lisp_Object *x, Lisp_Object *y, unsigned long *time) { - struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); + struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (*fp); + struct scroll_bar *bar = dpyinfo->last_mouse_scroll_bar; Window w = SCROLL_BAR_W32_WINDOW (bar); struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); int pos; @@ -4120,13 +4096,13 @@ pos = si.nPos; top_range = si.nMax - si.nPage + 1; - switch (LOWORD (last_mouse_scroll_bar_pos)) + switch (LOWORD (dpyinfo->last_mouse_scroll_bar_pos)) { case SB_THUMBPOSITION: case SB_THUMBTRACK: *part = scroll_bar_handle; if (VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)) <= 0xffff) - pos = HIWORD (last_mouse_scroll_bar_pos); + pos = HIWORD (dpyinfo->last_mouse_scroll_bar_pos); break; case SB_LINEDOWN: *part = scroll_bar_handle; @@ -4141,9 +4117,9 @@ XSETINT (*y, top_range); f->mouse_moved = 0; - last_mouse_scroll_bar = Qnil; + dpyinfo->last_mouse_scroll_bar = NULL; - *time = last_mouse_movement_time; + *time = dpyinfo->last_mouse_movement_time; unblock_input (); } @@ -6553,9 +6529,6 @@ staticpro (&w32_display_name_list); w32_display_name_list = Qnil; - staticpro (&last_mouse_scroll_bar); - last_mouse_scroll_bar = Qnil; - DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms"); DEFSYM (Qadded, "added"); === modified file 'src/w32term.h' --- src/w32term.h 2013-09-18 09:23:10 +0000 +++ src/w32term.h 2013-09-19 07:48:53 +0000 @@ -189,10 +189,27 @@ /* The frame where the mouse was last time we reported a mouse motion. */ struct frame *last_mouse_motion_frame; + /* The frame where the mouse was last time we reported a mouse position. */ + struct frame *last_mouse_glyph_frame; + /* Position where the mouse was last time we reported a motion. This is a position on last_mouse_motion_frame. */ int last_mouse_motion_x; int last_mouse_motion_y; + + /* Where the mouse was last time we reported a mouse position. + This is a rectangle on last_mouse_glyph_frame. */ + RECT last_mouse_glyph; + + /* The scroll bar in which the last motion event occurred. */ + struct scroll_bar *last_mouse_scroll_bar; + + /* Mouse position on the scroll bar above. + FIXME: shouldn't it be a member of struct scroll_bar? */ + int last_mouse_scroll_bar_pos; + + /* Time of last mouse movement. */ + Time last_mouse_movement_time; }; /* This is a chain of structures for all the displays currently in use. */ === modified file 'src/xterm.c' --- src/xterm.c 2013-09-19 05:21:32 +0000 +++ src/xterm.c 2013-09-19 07:48:53 +0000 @@ -172,52 +172,6 @@ static Time ignore_next_mouse_click_timeout; -/* Mouse movement. - - Formerly, we used PointerMotionHintMask (in standard_event_mask) - so that we would have to call XQueryPointer after each MotionNotify - event to ask for another such event. However, this made mouse tracking - slow, and there was a bug that made it eventually stop. - - Simply asking for MotionNotify all the time seems to work better. - - In order to avoid asking for motion events and then throwing most - of them away or busy-polling the server for mouse positions, we ask - the server for pointer motion hints. This means that we get only - one event per group of mouse movements. "Groups" are delimited by - other kinds of events (focus changes and button clicks, for - example), or by XQueryPointer calls; when one of these happens, we - get another MotionNotify event the next time the mouse moves. This - is at least as efficient as getting motion events when mouse - tracking is on, and I suspect only negligibly worse when tracking - is off. */ - -/* Where the mouse was last time we reported a mouse event. */ - -static XRectangle last_mouse_glyph; -static struct frame *last_mouse_glyph_frame; - -/* The scroll bar in which the last X motion event occurred. - - If the last X motion event occurred in a scroll bar, we set this so - XTmouse_position can know whether to report a scroll bar motion or - an ordinary motion. - - If the last X motion event didn't occur in a scroll bar, we set - this to Qnil, to tell XTmouse_position to return an ordinary motion - event. */ - -static Lisp_Object last_mouse_scroll_bar; - -/* This is a hack. We would really prefer that XTmouse_position would - return the time associated with the position it returns, but there - doesn't seem to be any way to wrest the time-stamp from the server - along with the position query. So, we just keep track of the time - of the last movement we received, and return that in hopes that - it's somewhat accurate. */ - -static Time last_mouse_movement_time; - /* Incremented by XTread_socket whenever it really tries to read events. */ @@ -3820,9 +3774,25 @@ return value; } - - -/* Mouse clicks and mouse movement. Rah. */ +/* Mouse clicks and mouse movement. Rah. + + Formerly, we used PointerMotionHintMask (in standard_event_mask) + so that we would have to call XQueryPointer after each MotionNotify + event to ask for another such event. However, this made mouse tracking + slow, and there was a bug that made it eventually stop. + + Simply asking for MotionNotify all the time seems to work better. + + In order to avoid asking for motion events and then throwing most + of them away or busy-polling the server for mouse positions, we ask + the server for pointer motion hints. This means that we get only + one event per group of mouse movements. "Groups" are delimited by + other kinds of events (focus changes and button clicks, for + example), or by XQueryPointer calls; when one of these happens, we + get another MotionNotify event the next time the mouse moves. This + is at least as efficient as getting motion events when mouse + tracking is on, and I suspect only negligibly worse when tracking + is off. */ /* Prepare a mouse-event in *RESULT for placement in the input queue. @@ -3863,13 +3833,14 @@ static int note_mouse_movement (struct frame *frame, const XMotionEvent *event) { + XRectangle *r; struct x_display_info *dpyinfo; if (!FRAME_X_OUTPUT (frame)) return 0; dpyinfo = FRAME_DISPLAY_INFO (frame); - last_mouse_movement_time = event->time; + dpyinfo->last_mouse_movement_time = event->time; dpyinfo->last_mouse_motion_frame = frame; dpyinfo->last_mouse_motion_x = event->x; dpyinfo->last_mouse_motion_y = event->y; @@ -3877,26 +3848,25 @@ if (event->window != FRAME_X_WINDOW (frame)) { frame->mouse_moved = 1; - last_mouse_scroll_bar = Qnil; + dpyinfo->last_mouse_scroll_bar = NULL; note_mouse_highlight (frame, -1, -1); - last_mouse_glyph_frame = 0; + dpyinfo->last_mouse_glyph_frame = NULL; return 1; } /* Has the mouse moved off the glyph it was on at the last sighting? */ - if (frame != last_mouse_glyph_frame - || event->x < last_mouse_glyph.x - || event->x >= last_mouse_glyph.x + last_mouse_glyph.width - || event->y < last_mouse_glyph.y - || event->y >= last_mouse_glyph.y + last_mouse_glyph.height) + r = &dpyinfo->last_mouse_glyph; + if (frame != dpyinfo->last_mouse_glyph_frame + || event->x < r->x || event->x >= r->x + r->width + || event->y < r->y || event->y >= r->y + r->height) { frame->mouse_moved = 1; - last_mouse_scroll_bar = Qnil; + dpyinfo->last_mouse_scroll_bar = NULL; note_mouse_highlight (frame, event->x, event->y); /* Remember which glyph we're now on. */ - remember_mouse_glyph (frame, event->x, event->y, &last_mouse_glyph); - last_mouse_glyph_frame = frame; + remember_mouse_glyph (frame, event->x, event->y, r); + dpyinfo->last_mouse_glyph_frame = frame; return 1; } @@ -3933,7 +3903,7 @@ block_input (); - if (! NILP (last_mouse_scroll_bar) && insist == 0) + if (dpyinfo->last_mouse_scroll_bar && insist == 0) x_scroll_bar_report_motion (fp, bar_window, part, x, y, timestamp); else { @@ -3951,7 +3921,7 @@ && FRAME_X_DISPLAY (XFRAME (frame)) == FRAME_X_DISPLAY (*fp)) XFRAME (frame)->mouse_moved = 0; - last_mouse_scroll_bar = Qnil; + dpyinfo->last_mouse_scroll_bar = NULL; /* Figure out which root window we're on. */ XQueryPointer (FRAME_X_DISPLAY (*fp), @@ -4101,15 +4071,17 @@ on it, i.e. into the same rectangles that matrices on the frame are divided into. */ - remember_mouse_glyph (f1, win_x, win_y, &last_mouse_glyph); - last_mouse_glyph_frame = f1; + /* FIXME: what if F1 is not an X frame? */ + dpyinfo = FRAME_DISPLAY_INFO (f1); + remember_mouse_glyph (f1, win_x, win_y, &dpyinfo->last_mouse_glyph); + dpyinfo->last_mouse_glyph_frame = f1; *bar_window = Qnil; *part = 0; *fp = f1; XSETINT (*x, win_x); XSETINT (*y, win_y); - *timestamp = last_mouse_movement_time; + *timestamp = dpyinfo->last_mouse_movement_time; } } } @@ -5589,11 +5561,11 @@ const XMotionEvent *event) { struct frame *f = XFRAME (XWINDOW (bar->window)->frame); - - last_mouse_movement_time = event->time; - + struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); + + dpyinfo->last_mouse_movement_time = event->time; + dpyinfo->last_mouse_scroll_bar = bar; f->mouse_moved = 1; - XSETVECTOR (last_mouse_scroll_bar, bar); /* If we're dragging the bar, display it. */ if (bar->dragging != -1) @@ -5620,7 +5592,8 @@ enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, Time *timestamp) { - struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); + struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (*fp); + struct scroll_bar *bar = dpyinfo->last_mouse_scroll_bar; Window w = bar->x_window; struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); int win_x, win_y; @@ -5632,22 +5605,19 @@ /* Get the mouse's position relative to the scroll bar window, and report that. */ - if (! XQueryPointer (FRAME_X_DISPLAY (f), w, - - /* Root, child, root x and root y. */ - &dummy_window, &dummy_window, - &dummy_coord, &dummy_coord, - - /* Position relative to scroll bar. */ - &win_x, &win_y, - - /* Mouse buttons and modifier keys. */ - &dummy_mask)) - ; - else + if (XQueryPointer (FRAME_X_DISPLAY (f), w, + + /* Root, child, root x and root y. */ + &dummy_window, &dummy_window, + &dummy_coord, &dummy_coord, + + /* Position relative to scroll bar. */ + &win_x, &win_y, + + /* Mouse buttons and modifier keys. */ + &dummy_mask)) { - int top_range - = VERTICAL_SCROLL_BAR_TOP_RANGE (f, bar->height); + int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, bar->height); win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER; @@ -5675,11 +5645,10 @@ XSETINT (*y, top_range); f->mouse_moved = 0; - last_mouse_scroll_bar = Qnil; + dpyinfo->last_mouse_scroll_bar = NULL; + *timestamp = dpyinfo->last_mouse_movement_time; } - *timestamp = last_mouse_movement_time; - unblock_input (); } @@ -6644,8 +6613,8 @@ #ifdef USE_GTK /* We may get an EnterNotify on the buttons in the toolbar. In that case we moved out of any highlighted area and need to note this. */ - if (!f && last_mouse_glyph_frame) - note_mouse_movement (last_mouse_glyph_frame, &event->xmotion); + if (!f && dpyinfo->last_mouse_glyph_frame) + note_mouse_movement (dpyinfo->last_mouse_glyph_frame, &event->xmotion); #endif goto OTHER; @@ -6677,8 +6646,8 @@ } #ifdef USE_GTK /* See comment in EnterNotify above */ - else if (last_mouse_glyph_frame) - note_mouse_movement (last_mouse_glyph_frame, &event->xmotion); + else if (dpyinfo->last_mouse_glyph_frame) + note_mouse_movement (dpyinfo->last_mouse_glyph_frame, &event->xmotion); #endif goto OTHER; @@ -6827,7 +6796,7 @@ bool tool_bar_p = 0; memset (&compose_status, 0, sizeof (compose_status)); - last_mouse_glyph_frame = 0; + dpyinfo->last_mouse_glyph_frame = NULL; dpyinfo->last_user_time = event->xbutton.time; f = (x_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame @@ -10629,9 +10598,6 @@ staticpro (&x_display_name_list); x_display_name_list = Qnil; - staticpro (&last_mouse_scroll_bar); - last_mouse_scroll_bar = Qnil; - DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms"); DEFSYM (Qlatin_1, "latin-1"); === modified file 'src/xterm.h' --- src/xterm.h 2013-09-18 09:23:10 +0000 +++ src/xterm.h 2013-09-19 07:48:53 +0000 @@ -305,12 +305,18 @@ /* The frame waiting to be auto-raised in XTread_socket. */ struct frame *x_pending_autoraise_frame; - /* The frame where the mouse was last time we reported a mouse event. */ + /* The frame where the mouse was last time we reported a ButtonPress event. */ struct frame *last_mouse_frame; + /* The frame where the mouse was last time we reported a mouse position. */ + struct frame *last_mouse_glyph_frame; + /* The frame where the mouse was last time we reported a mouse motion. */ struct frame *last_mouse_motion_frame; + /* The scroll bar in which the last X motion event occurred. */ + struct scroll_bar *last_mouse_scroll_bar; + /* Time of last user interaction as returned in X events on this display. */ Time last_user_time; @@ -319,6 +325,18 @@ int last_mouse_motion_x; int last_mouse_motion_y; + /* Where the mouse was last time we reported a mouse position. + This is a rectangle on last_mouse_glyph_frame. */ + XRectangle last_mouse_glyph; + + /* Time of last mouse movement on this display. This is a hack because + we would really prefer that XTmouse_position would return the time + associated with the position it returns, but there doesn't seem to be + any way to wrest the time-stamp from the server along with the position + query. So, we just keep track of the time of the last movement we + received, and return that in hopes that it's somewhat accurate. */ + Time last_mouse_movement_time; + /* The gray pixmap. */ Pixmap gray; ------------------------------------------------------------ revno: 114390 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-09-19 00:14:53 -0700 message: * emacs-lisp/eieio.el (class-parent): Don't use defalias with macros. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-19 06:56:47 +0000 +++ lisp/ChangeLog 2013-09-19 07:14:53 +0000 @@ -1,5 +1,7 @@ 2013-09-19 Glenn Morris + * emacs-lisp/eieio.el (class-parent): Don't use defalias with macros. + * eshell/em-unix.el (eshell-remove-entries): Rename argument to avoid name-clash with global `top-level'. === modified file 'lisp/emacs-lisp/eieio.el' --- lisp/emacs-lisp/eieio.el 2013-06-19 20:27:49 +0000 +++ lisp/emacs-lisp/eieio.el 2013-09-19 07:14:53 +0000 @@ -322,7 +322,10 @@ (defmacro eieio-class-parent (class) "Return first parent class to CLASS. (overload of variable)." `(car (eieio-class-parents ,class))) -(define-obsolete-function-alias 'class-parent #'eieio-class-parent "24.4") + +(defmacro class-parent (class) + (declare (obsolete eieio-class-parent "24.4")) + '(eieio-class-parent class)) (defun same-class-p (obj class) "Return t if OBJ is of class-type CLASS." (eieio--check-type class-p class) ------------------------------------------------------------ revno: 114389 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-18 23:56:47 -0700 message: * eshell/em-unix.el (eshell-remove-entries): Rename argument to avoid name-clash with global `top-level'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-19 03:44:55 +0000 +++ lisp/ChangeLog 2013-09-19 06:56:47 +0000 @@ -1,5 +1,8 @@ 2013-09-19 Glenn Morris + * eshell/em-unix.el (eshell-remove-entries): + Rename argument to avoid name-clash with global `top-level'. + * eshell/esh-proc.el (eshell-kill-process-function): Remove eshell-reset-after-proc from eshell-kill-hook if present. (eshell-reset-after-proc): Remove unused arg `proc'. === modified file 'lisp/eshell/em-unix.el' --- lisp/eshell/em-unix.el 2013-09-19 02:42:36 +0000 +++ lisp/eshell/em-unix.el 2013-09-19 06:56:47 +0000 @@ -195,12 +195,12 @@ (Info-menu (car args)) (setq args (cdr args))))) -(defun eshell-remove-entries (files &optional top-level) +(defun eshell-remove-entries (files &optional toplevel) "Remove all of the given FILES, perhaps interactively." (while files (if (string-match "\\`\\.\\.?\\'" (file-name-nondirectory (car files))) - (if top-level + (if toplevel (eshell-error "rm: cannot remove `.' or `..'\n")) (if (and (file-directory-p (car files)) (not (file-symlink-p (car files))))