Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103476. ------------------------------------------------------------ revno: 103476 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-03-01 23:59:02 -0800 message: Make dired-default-directory obsolete. As far as I can tell, it was never used outside of dired-smart-shell-command. It doesn't seem worth keeping around as a separate function. * lisp/dired-x.el (dired-default-directory-alist, dired-default-directory): Mark as obsolete. (dired-smart-shell-command): Just call dired-current-directory. * doc/misc/dired-x.texi (Multiple Dired Directories): Remove mentions of dired-default-directory-alist and dired-default-directory. Move dired-smart-shell-command here... (Miscellaneous Commands): ... from here. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-03-02 06:07:30 +0000 +++ doc/misc/ChangeLog 2011-03-02 07:59:02 +0000 @@ -1,3 +1,10 @@ +2011-03-02 Glenn Morris + + * dired-x.texi (Multiple Dired Directories): Remove mentions + of dired-default-directory-alist and dired-default-directory. + Move dired-smart-shell-command here... + (Miscellaneous Commands): ... from here. + 2011-03-02 Paul Eggert * texinfo.tex: Update to version 2011-02-24.09. === modified file 'doc/misc/dired-x.texi' --- doc/misc/dired-x.texi 2011-03-02 04:13:57 +0000 +++ doc/misc/dired-x.texi 2011-03-02 07:59:02 +0000 @@ -867,24 +867,12 @@ directory instead of @code{default-directory}, e.g., @code{find-file} and @code{compile}. -A general mechanism is provided for special handling of the working -directory in special major modes: - -@table @code -@item dired-default-directory-alist -@vindex dired-default-directory-alist -Default: @code{((dired-mode . (dired-current-directory)))} - -Alist of major modes and their notion of @code{default-directory}, as a -Lisp expression to evaluate. A resulting value of @code{nil} is ignored -in favor of @code{default-directory}. - -@item dired-default-directory -@findex dired-default-directory -Use this function like you would use the variable -@code{default-directory}, except that @code{dired-default-directory} -also consults the variable @code{dired-default-directory-alist}. -@end table +@findex dired-smart-shell-command +@findex shell-command +@kindex M-! +The command @code{dired-smart-shell-command}, bound to @kbd{M-!} in +Dired buffers, is like @code{shell-command}, but it runs with +@code{default-directory} bound to the current Dired directory. @node Find File At Point, Miscellaneous Commands, Multiple Dired Directories, Top @section Find File At Point @@ -993,12 +981,6 @@ @end table @table @code -@item dired-smart-shell-command -@findex dired-smart-shell-command -@findex shell-command -@kindex M-! -Like function @code{shell-command}, but in the current Dired directory. -Bound to @kbd{M-!} in Dired buffers. @item dired-jump @findex dired-jump === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-02 07:44:33 +0000 +++ lisp/ChangeLog 2011-03-02 07:59:02 +0000 @@ -1,5 +1,9 @@ 2011-03-02 Glenn Morris + * dired-x.el (dired-default-directory-alist, dired-default-directory): + Mark as obsolete. + (dired-smart-shell-command): Just call dired-current-directory. + * dired-x.el (dired-jump-other-window): Add autoload. (dired-default-directory-alist, dired-default-directory): Doc fixes. (dired-default-directory-alist): Mark as risky. === modified file 'lisp/dired-x.el' --- lisp/dired-x.el 2011-03-02 07:44:33 +0000 +++ lisp/dired-x.el 2011-03-02 07:59:02 +0000 @@ -710,6 +710,8 @@ determine a default directory.") (put 'dired-default-directory-alist 'risky-local-variable t) ; gets eval'd +(make-obsolete-variable 'dired-default-directory-alist + "this feature is due to be removed." "24.1") (defun dired-default-directory () "Return the `dired-default-directory-alist' entry for the current major-mode. @@ -717,6 +719,12 @@ (or (eval (cdr (assq major-mode dired-default-directory-alist))) default-directory)) +;; It looks like this was intended to be something of a "general" feature, +;; but it only ever seems to have been used in dired-smart-shell-command, +;; and does not seem worth keeping around (?). +(make-obsolete 'dired-default-directory + "this feature is due to be removed." "24.1") + (defun dired-smart-shell-command (command &optional output-buffer error-buffer) "Like function `shell-command', but in the current Virtual Dired directory." (interactive @@ -727,7 +735,9 @@ ((eq major-mode 'dired-mode) (dired-get-filename t t)))) current-prefix-arg shell-command-default-error-buffer)) - (let ((default-directory (dired-default-directory))) + (let ((default-directory (if (eq major-mode 'dired-mode) + (dired-current-directory) + default-directory))) (shell-command command output-buffer error-buffer))) ------------------------------------------------------------ revno: 103475 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-03-01 23:44:33 -0800 message: dired-x trivia. * lisp/dired-x.el (dired-jump-other-window): Add autoload. (dired-default-directory-alist, dired-default-directory): Doc fixes. (dired-default-directory-alist): Mark as risky. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-02 04:13:57 +0000 +++ lisp/ChangeLog 2011-03-02 07:44:33 +0000 @@ -1,5 +1,9 @@ 2011-03-02 Glenn Morris + * dired-x.el (dired-jump-other-window): Add autoload. + (dired-default-directory-alist, dired-default-directory): Doc fixes. + (dired-default-directory-alist): Mark as risky. + * dired-x.el (dired-omit-here-always): Make it obsolete. 2011-03-02 Chong Yidong === modified file 'lisp/dired-x.el' --- lisp/dired-x.el 2011-03-02 04:13:57 +0000 +++ lisp/dired-x.el 2011-03-02 07:44:33 +0000 @@ -436,6 +436,7 @@ (dired-omit-mode) (dired-goto-file file))))))) +;;;###autoload (defun dired-jump-other-window (&optional file-name) "Like \\[dired-jump] (`dired-jump') but in other window." (interactive @@ -704,12 +705,15 @@ (dired-current-directory) default-directory))) "Alist of major modes and their opinion on `default-directory'. -This is given as a Lisp expression to evaluate. A resulting value of -nil is ignored in favor of `default-directory'.") +Each element has the form (MAJOR . EXPRESSION). +The function `dired-default-directory' evaluates EXPRESSION to +determine a default directory.") + +(put 'dired-default-directory-alist 'risky-local-variable t) ; gets eval'd (defun dired-default-directory () - "Usage like variable `default-directory'. -Knows about the special cases in variable `dired-default-directory-alist'." + "Return the `dired-default-directory-alist' entry for the current major-mode. +If none, return `default-directory'." (or (eval (cdr (assq major-mode dired-default-directory-alist))) default-directory)) ------------------------------------------------------------ revno: 103474 committer: Paul Eggert branch nick: trunk timestamp: Tue 2011-03-01 22:07:30 -0800 message: * texinfo.tex: Update to version 2011-02-24.09. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-03-02 04:13:57 +0000 +++ doc/misc/ChangeLog 2011-03-02 06:07:30 +0000 @@ -1,3 +1,7 @@ +2011-03-02 Paul Eggert + + * texinfo.tex: Update to version 2011-02-24.09. + 2011-03-02 Glenn Morris * dired-x.texi (Omitting Variables): Refer to add-dir-local-variable === modified file 'doc/misc/texinfo.tex' --- doc/misc/texinfo.tex 2011-02-15 05:41:07 +0000 +++ doc/misc/texinfo.tex 2011-03-02 06:07:30 +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{2011-02-14.11} +\def\texinfoversion{2011-02-24.09} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -218,7 +218,7 @@ \tracingmacros2 \tracingrestores1 \showboxbreadth\maxdimen \showboxdepth\maxdimen - \ifx\eTeXversion\undefined\else % etex gives us more logging + \ifx\eTeXversion\thisisundefined\else % etex gives us more logging \tracingscantokens1 \tracingifs1 \tracinggroups1 @@ -611,7 +611,7 @@ \else\ifx\temp\offword \plainnonfrenchspacing \else \errhelp = \EMsimple - \errmessage{Unknown @frenchspacing option `\temp', must be on/off}% + \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% \fi\fi } @@ -1082,9 +1082,8 @@ \newif\ifpdfmakepagedest % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 -% can be set). So we test for \relax and 0 as well as \undefined, -% borrowed from ifpdf.sty. -\ifx\pdfoutput\undefined +% can be set). So we test for \relax and 0 as well as being undefined. +\ifx\pdfoutput\thisisundefined \else \ifx\pdfoutput\relax \else @@ -1516,7 +1515,7 @@ % if we are producing pdf, and we have \pdffontattr, then define cmaps. % (\pdffontattr was introduced many years ago, but people still run % older pdftex's; it's easy to conditionalize, so we do.) -\ifpdf \ifx\pdffontattr\undefined \else +\ifpdf \ifx\pdffontattr\thisisundefined \else \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap @@ -1783,7 +1782,7 @@ % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. -\ifx\fontprefix\undefined +\ifx\fontprefix\thisisundefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. @@ -2297,12 +2296,11 @@ \let\markupsetuplqkbd \markupsetnoligaturesquoteleft -% Allow an option to not replace quotes with a regular directed right -% quote/apostrophe (char 0x27), but instead use the undirected quote -% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it -% the default, but it works for pasting with more pdf viewers (at least -% evince), the lilypond developers report. xpdf does work with the -% regular 0x27. +% Allow an option to not use regular directed right quote/apostrophe +% (char 0x27), but instead the undirected quote from cmtt (char 0x0d). +% The undirected quote is ugly, so don't make it the default, but it +% works for pasting with more pdf viewers (at least evince), the +% lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax @@ -2326,6 +2324,36 @@ \else \char'22 \fi } +% Commands to set the quote options. +% +\parseargdef\codequoteundirected{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% + \fi\fi +} +% +\parseargdef\codequotebacktick{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% + \fi\fi +} + % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. \def\noligaturesquoteleft{\relax\lq} @@ -2527,7 +2555,7 @@ \allowcodebreaksfalse \else \errhelp = \EMsimple - \errmessage{Unknown @allowcodebreaks option `\txiarg'}% + \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% \fi\fi } @@ -3109,7 +3137,7 @@ % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. % -\ifx\Orb\undefined +\ifx\Orb\thisisundefined \def\Orb{\mathhexbox20D} \fi @@ -3384,7 +3412,7 @@ % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). -\ifx\today\undefined +\ifx\today\thisisundefined \def\today{% \number\day\space \ifcase\month @@ -6465,7 +6493,7 @@ % \def\Equotation{% \par - \ifx\quotationauthor\undefined\else + \ifx\quotationauthor\thisisundefined\else % indent a bit. \leftline{\kern 2\leftskip \sl ---\quotationauthor}% \fi @@ -7000,7 +7028,7 @@ % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. -\ifx\eTeXversion\undefined +\ifx\eTeXversion\thisisundefined \newwrite\macscribble \def\scantokens#1{% \toks0={#1}% @@ -7422,6 +7450,27 @@ \fi } +% @xrefautosectiontitle on|off says whether @section(ing) names are used +% automatically in xrefs, if the third arg is not explicitly specified. +% This was provided as a "secret" @set xref-automatic-section-title +% variable, now it's official. +% +\parseargdef\xrefautomaticsectiontitle{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \empty + \else\ifx\temp\offword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', + must be on|off}% + \fi\fi +} + + % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed @@ -7438,7 +7487,7 @@ \setbox0=\hbox{\printedrefname\unskip}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. - \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax % Use the node name inside the square brackets. \def\printedrefname{\ignorespaces #1}% \else @@ -7908,7 +7957,7 @@ it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% - \ifx\epsfbox\undefined + \ifx\epsfbox\thisiundefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% ------------------------------------------------------------ revno: 103473 [merge] committer: Paul Eggert branch nick: trunk timestamp: Tue 2011-03-01 21:25:09 -0800 message: Merge: Work around some portability problems with symlinks. diff: === modified file 'ChangeLog' --- ChangeLog 2011-02-28 01:07:29 +0000 +++ ChangeLog 2011-03-02 05:25:09 +0000 @@ -1,3 +1,16 @@ +2011-03-02 Paul Eggert + + Work around some portability problems with symlinks. + + * Makefile.in (GNULIB_MODULES): Add lstat, readlink, symlink. + * configure.in (lstat, HAVE_LSTAT): Remove special hack. + * lib/dosname.h, lib/lstat.c, lib/readlink.c, lib/stat.c: + * lib/symlink.c, m4/lstat.m4, m4/readlink.m4, m4/stat.m4: + * m4/symlink.m4: + New files, automatically generated from gnulib. + * aclocal.m4, configure, lib/Makefile.in, lib/gnulib.mk: + * m4/gl-comp.m4, src/config.in, config.sub: Regenerate. + 2011-02-26 Eli Zaretskii * .bzrignore: Ignore new lib/*.in-h files. === modified file 'Makefile.in' --- Makefile.in 2011-02-22 01:55:20 +0000 +++ Makefile.in 2011-02-22 19:30:07 +0000 @@ -332,7 +332,7 @@ # as per $(gnulib_srcdir)/DEPENDENCIES. GNULIB_MODULES = \ crypto/md5 dtoastr filemode getloadavg getopt-gnu \ - ignore-value mktime strftime sys_stat + ignore-value lstat mktime readlink strftime symlink sys_stat GNULIB_TOOL_FLAGS = \ --import --no-changelog --no-vc-files --makefile-name=gnulib.mk sync-from-gnulib: $(gnulib_srcdir) === modified file 'aclocal.m4' --- aclocal.m4 2011-02-20 10:51:50 +0000 +++ aclocal.m4 2011-02-25 20:05:36 +0000 @@ -994,15 +994,19 @@ m4_include([m4/gnulib-common.m4]) m4_include([m4/include_next.m4]) m4_include([m4/longlong.m4]) +m4_include([m4/lstat.m4]) m4_include([m4/md5.m4]) m4_include([m4/mktime.m4]) m4_include([m4/multiarch.m4]) +m4_include([m4/readlink.m4]) m4_include([m4/st_dm_mode.m4]) +m4_include([m4/stat.m4]) m4_include([m4/stdbool.m4]) m4_include([m4/stddef_h.m4]) m4_include([m4/stdint.m4]) m4_include([m4/stdlib_h.m4]) m4_include([m4/strftime.m4]) +m4_include([m4/symlink.m4]) m4_include([m4/sys_stat_h.m4]) m4_include([m4/time_h.m4]) m4_include([m4/time_r.m4]) === modified file 'config.sub' --- config.sub 2011-02-05 05:07:22 +0000 +++ config.sub 2011-03-02 05:25:09 +0000 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. -timestamp='2011-02-02' +timestamp='2011-02-24' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -76,7 +76,7 @@ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO === modified file 'configure' --- configure 2011-02-25 07:23:41 +0000 +++ configure 2011-03-02 05:25:09 +0000 @@ -679,38 +679,6 @@ NEXT_TIME_H NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H NEXT_SYS_STAT_H -REPLACE_UTIMENSAT -REPLACE_STAT -REPLACE_MKNOD -REPLACE_MKFIFO -REPLACE_MKDIR -REPLACE_LSTAT -REPLACE_FUTIMENS -REPLACE_FSTATAT -REPLACE_FSTAT -HAVE_UTIMENSAT -HAVE_MKNODAT -HAVE_MKNOD -HAVE_MKFIFOAT -HAVE_MKFIFO -HAVE_MKDIRAT -HAVE_LSTAT -HAVE_LCHMOD -HAVE_FUTIMENS -HAVE_FSTATAT -HAVE_FCHMODAT -GNULIB_UTIMENSAT -GNULIB_STAT -GNULIB_MKNODAT -GNULIB_MKNOD -GNULIB_MKFIFOAT -GNULIB_MKFIFO -GNULIB_MKDIRAT -GNULIB_LSTAT -GNULIB_LCHMOD -GNULIB_FUTIMENS -GNULIB_FSTATAT -GNULIB_FCHMODAT NEXT_AS_FIRST_DIRECTIVE_STDLIB_H NEXT_STDLIB_H STDINT_H @@ -758,6 +726,38 @@ GNULIB_STRPTIME GNULIB_NANOSLEEP GNULIB_MKTIME +REPLACE_UTIMENSAT +REPLACE_STAT +REPLACE_MKNOD +REPLACE_MKFIFO +REPLACE_MKDIR +REPLACE_LSTAT +REPLACE_FUTIMENS +REPLACE_FSTATAT +REPLACE_FSTAT +HAVE_UTIMENSAT +HAVE_MKNODAT +HAVE_MKNOD +HAVE_MKFIFOAT +HAVE_MKFIFO +HAVE_MKDIRAT +HAVE_LSTAT +HAVE_LCHMOD +HAVE_FUTIMENS +HAVE_FSTATAT +HAVE_FCHMODAT +GNULIB_UTIMENSAT +GNULIB_STAT +GNULIB_MKNODAT +GNULIB_MKNOD +GNULIB_MKFIFOAT +GNULIB_MKFIFO +GNULIB_MKDIRAT +GNULIB_LSTAT +GNULIB_LCHMOD +GNULIB_FUTIMENS +GNULIB_FSTATAT +GNULIB_FCHMODAT LTLIBINTL LIBINTL GETOPT_H @@ -1165,9 +1165,6 @@ LIBS CPPFLAGS CPP -CPPFLAGS -CPP -CPPFLAGS XMKMF' @@ -2960,14 +2957,16 @@ as_fn_append ac_header_list " sys/param.h" gl_getopt_required=GNU as_fn_append ac_header_list " getopt.h" +as_fn_append ac_func_list " lstat" as_fn_append ac_func_list " alarm" +as_fn_append ac_func_list " readlink" as_fn_append ac_header_list " wchar.h" as_fn_append ac_header_list " stdint.h" as_fn_append ac_func_list " tzset" +as_fn_append ac_func_list " symlink" as_fn_append ac_header_list " sys/stat.h" as_fn_append ac_header_list " sys/time.h" as_fn_append ac_func_list " localtime_r" -as_fn_append ac_func_list " lstat" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false @@ -6126,6 +6125,7 @@ # Code from module arg-nonnull: # Code from module c++defs: # Code from module crypto/md5: + # Code from module dosname: # Code from module dtoastr: # Code from module extensions: @@ -6137,13 +6137,17 @@ # Code from module ignore-value: # Code from module include_next: # Code from module intprops: + # Code from module lstat: # Code from module mktime: # Code from module multiarch: + # Code from module readlink: + # Code from module stat: # Code from module stdbool: # Code from module stddef: # Code from module stdint: # Code from module stdlib: # Code from module strftime: + # Code from module symlink: # Code from module sys_stat: # Code from module time: # Code from module time_r: @@ -14500,6 +14504,127 @@ + GNULIB_FCHMODAT=0; + GNULIB_FSTATAT=0; + GNULIB_FUTIMENS=0; + GNULIB_LCHMOD=0; + GNULIB_LSTAT=0; + GNULIB_MKDIRAT=0; + GNULIB_MKFIFO=0; + GNULIB_MKFIFOAT=0; + GNULIB_MKNOD=0; + GNULIB_MKNODAT=0; + GNULIB_STAT=0; + GNULIB_UTIMENSAT=0; + HAVE_FCHMODAT=1; + HAVE_FSTATAT=1; + HAVE_FUTIMENS=1; + HAVE_LCHMOD=1; + HAVE_LSTAT=1; + HAVE_MKDIRAT=1; + HAVE_MKFIFO=1; + HAVE_MKFIFOAT=1; + HAVE_MKNOD=1; + HAVE_MKNODAT=1; + HAVE_UTIMENSAT=1; + REPLACE_FSTAT=0; + REPLACE_FSTATAT=0; + REPLACE_FUTIMENS=0; + REPLACE_LSTAT=0; + REPLACE_MKDIR=0; + REPLACE_MKFIFO=0; + REPLACE_MKNOD=0; + REPLACE_STAT=0; + REPLACE_UTIMENSAT=0; + + + + + for ac_func in $ac_func_list +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } +if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.sym conftest.file + echo >conftest.file + if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then : + # When cross-compiling, be pessimistic so we will end up using the + # replacement version of lstat that checks for trailing slashes and + # calls lstat a second time when necessary. + ac_cv_func_lstat_dereferences_slashed_symlink=no + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail, as required by + POSIX. That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + else + # If the 'ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no + fi + rm -f conftest.sym conftest.file + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } + test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" + + fi + + GNULIB_MKTIME=0; GNULIB_NANOSLEEP=0; GNULIB_STRPTIME=0; @@ -14517,21 +14642,6 @@ - for ac_func in $ac_func_list -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - gl_cv_c_multiarch=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14573,6 +14683,8 @@ fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : @@ -14832,38 +14944,6 @@ - GNULIB_FCHMODAT=0; - GNULIB_FSTATAT=0; - GNULIB_FUTIMENS=0; - GNULIB_LCHMOD=0; - GNULIB_LSTAT=0; - GNULIB_MKDIRAT=0; - GNULIB_MKFIFO=0; - GNULIB_MKFIFOAT=0; - GNULIB_MKNOD=0; - GNULIB_MKNODAT=0; - GNULIB_STAT=0; - GNULIB_UTIMENSAT=0; - HAVE_FCHMODAT=1; - HAVE_FSTATAT=1; - HAVE_FUTIMENS=1; - HAVE_LCHMOD=1; - HAVE_LSTAT=1; - HAVE_MKDIRAT=1; - HAVE_MKFIFO=1; - HAVE_MKFIFOAT=1; - HAVE_MKNOD=1; - HAVE_MKNODAT=1; - HAVE_UTIMENSAT=1; - REPLACE_FSTAT=0; - REPLACE_FSTATAT=0; - REPLACE_FUTIMENS=0; - REPLACE_LSTAT=0; - REPLACE_MKDIR=0; - REPLACE_MKFIFO=0; - REPLACE_MKNOD=0; - REPLACE_STAT=0; - REPLACE_UTIMENSAT=0; { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 $as_echo_n "checking whether stat file-mode macros are broken... " >&6; } @@ -15169,6 +15249,7 @@ : + # Code from module dosname: # Code from module dtoastr: # Code from module extensions: @@ -15776,6 +15857,28 @@ # Code from module include_next: # Code from module intprops: + # Code from module lstat: + + + + if test $ac_cv_func_lstat = yes; then + + if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then + REPLACE_LSTAT=1 + fi + # Prerequisites of lib/lstat.c. + + else + HAVE_LSTAT=0 + fi + + + + + GNULIB_LSTAT=1 + + + # Code from module mktime: @@ -16033,6 +16136,246 @@ # Code from module multiarch: + # Code from module readlink: + + + + if test $ac_cv_func_readlink = no; then + HAVE_READLINK=0 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" + + + : + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5 +$as_echo_n "checking whether readlink signature is correct... " >&6; } +if ${gl_cv_decl_readlink_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Cause compilation failure if original declaration has wrong type. */ + ssize_t readlink (const char *, char *, size_t); +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_decl_readlink_works=yes +else + gl_cv_decl_readlink_works=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5 +$as_echo "$gl_cv_decl_readlink_works" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5 +$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; } +if ${gl_cv_func_readlink_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + # We have readlink, so assume ln -s works. + ln -s conftest.no-such conftest.link + ln -s conftest.link conftest.lnk2 + if test "$cross_compiling" = yes; then : + gl_cv_func_readlink_works="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +char buf[20]; + return readlink ("conftest.lnk2/", buf, sizeof buf) != -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_readlink_works=yes +else + gl_cv_func_readlink_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.link conftest.lnk2 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5 +$as_echo "$gl_cv_func_readlink_works" >&6; } + if test "$gl_cv_func_readlink_works" != yes; then + +$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h + + REPLACE_READLINK=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" + + elif test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINK=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" + + fi + fi + + + + + GNULIB_READLINK=1 + + + + # Code from module stat: + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on directories" >&5 +$as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; } +if ${gl_cv_func_stat_dir_slash+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case $host_os in + mingw*) gl_cv_func_stat_dir_slash="guessing no";; + *) gl_cv_func_stat_dir_slash="guessing yes";; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +struct stat st; return stat (".", &st) != stat ("./", &st); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_stat_dir_slash=yes +else + gl_cv_func_stat_dir_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_dir_slash" >&5 +$as_echo "$gl_cv_func_stat_dir_slash" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 +$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; } +if ${gl_cv_func_stat_file_slash+:} false; then : + $as_echo_n "(cached) " >&6 +else + touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes; then : + gl_cv_func_stat_file_slash="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_stat_file_slash=yes +else + gl_cv_func_stat_file_slash=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.tmp conftest.lnk +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 +$as_echo "$gl_cv_func_stat_file_slash" >&6; } + case $gl_cv_func_stat_dir_slash in + *no) REPLACE_STAT=1 + +$as_echo "#define REPLACE_FUNC_STAT_DIR 1" >>confdefs.h +;; + esac + case $gl_cv_func_stat_file_slash in + *no) REPLACE_STAT=1 + +$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h +;; + esac + if test $REPLACE_STAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" + + + fi + + + + + GNULIB_STAT=1 + + + # Code from module stdbool: @@ -16937,6 +17280,86 @@ + # Code from module symlink: + + + + if test $ac_cv_func_symlink = no; then + HAVE_SYMLINK=0 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS symlink.$ac_objext" + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5 +$as_echo_n "checking whether symlink handles trailing slash correctly... " >&6; } +if ${gl_cv_func_symlink_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_func_symlink_works="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +int result = 0; + if (!symlink ("a", "conftest.link/")) + result |= 1; + if (symlink ("conftest.f", "conftest.lnk2")) + result |= 2; + else if (!symlink ("a", "conftest.lnk2/")) + result |= 4; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_symlink_works=yes +else + gl_cv_func_symlink_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.f conftest.link conftest.lnk2 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5 +$as_echo "$gl_cv_func_symlink_works" >&6; } + if test "$gl_cv_func_symlink_works" != yes; then + REPLACE_SYMLINK=1 + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS symlink.$ac_objext" + + fi + fi + + + + + GNULIB_SYMLINK=1 + + + # Code from module sys_stat: @@ -17220,23 +17643,6 @@ -# Emacs does not care about lstat's behavior on files whose names end in -# trailing slashes, so it does not use the gnulib lstat module. -# However, Emacs does want the "#define lstat stat" in sys/stat.h -# when lstat does not exist, so it pretends to use the lstat module -# even though it implements only the lstat-checking part of that module. - - - -test $ac_cv_func_lstat = yes || HAVE_LSTAT=0 - - - - GNULIB_LSTAT=1 - - - - # UNIX98 PTYs. for ac_func in grantpt do : === modified file 'configure.in' --- configure.in 2011-02-24 04:28:17 +0000 +++ configure.in 2011-02-25 06:42:06 +0000 @@ -2661,15 +2661,6 @@ gl_ASSERT_NO_GNULIB_TESTS gl_INIT -# Emacs does not care about lstat's behavior on files whose names end in -# trailing slashes, so it does not use the gnulib lstat module. -# However, Emacs does want the "#define lstat stat" in sys/stat.h -# when lstat does not exist, so it pretends to use the lstat module -# even though it implements only the lstat-checking part of that module. -AC_CHECK_FUNCS_ONCE([lstat]) -test $ac_cv_func_lstat = yes || HAVE_LSTAT=0 -gl_SYS_STAT_MODULE_INDICATOR([lstat]) - # UNIX98 PTYs. AC_CHECK_FUNCS(grantpt) === modified file 'lib/Makefile.in' --- lib/Makefile.in 2011-02-25 07:23:41 +0000 +++ lib/Makefile.in 2011-02-25 20:05:36 +0000 @@ -24,7 +24,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value mktime strftime sys_stat +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value lstat mktime readlink strftime symlink sys_stat VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -55,11 +55,13 @@ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gl-comp.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/longlong.m4 \ - $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/mktime.m4 \ - $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/st_dm_mode.m4 \ - $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ - $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ + $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/md5.m4 \ + $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/multiarch.m4 \ + $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/st_dm_mode.m4 \ + $(top_srcdir)/m4/stat.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \ + $(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strftime.m4 \ + $(top_srcdir)/m4/symlink.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/configure.in @@ -602,10 +604,11 @@ $(STDDEF_H) $(STDINT_H) stdlib.h sys/stat.h time.h unistd.h \ warn-on-use.h EXTRA_DIST = $(top_srcdir)/./arg-nonnull.h $(top_srcdir)/./c++defs.h \ - md5.c md5.h ftoastr.c ftoastr.h filemode.c filemode.h \ - getloadavg.c getopt.c getopt.in.h getopt1.c getopt_int.h \ - intprops.h mktime-internal.h mktime.c stdbool.in.h stddef.in.h \ - stdint.in.h stdlib.in.h strftime.c strftime.h sys_stat.in.h \ + md5.c md5.h dosname.h ftoastr.c ftoastr.h filemode.c \ + filemode.h getloadavg.c getopt.c getopt.in.h getopt1.c \ + getopt_int.h intprops.h lstat.c mktime-internal.h mktime.c \ + readlink.c stat.c stdbool.in.h stddef.in.h stdint.in.h \ + stdlib.in.h strftime.c strftime.h symlink.c sys_stat.in.h \ time.in.h time_r.c unistd.in.h $(top_srcdir)/./warn-on-use.h MOSTLYCLEANDIRS = sys MOSTLYCLEANFILES = core *.stackdump arg-nonnull.h arg-nonnull.h-t \ @@ -619,7 +622,8 @@ libgnu_a_LIBADD = $(gl_LIBOBJS) libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) EXTRA_libgnu_a_SOURCES = md5.c ftoastr.c filemode.c getloadavg.c \ - getopt.c getopt1.c mktime.c strftime.c time_r.c + getopt.c getopt1.c lstat.c mktime.c readlink.c stat.c \ + strftime.c symlink.c time_r.c ARG_NONNULL_H = arg-nonnull.h CXXDEFS_H = c++defs.h WARN_ON_USE_H = warn-on-use.h @@ -678,9 +682,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getloadavg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strftime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_r.Po@am__quote@ .c.o: === added file 'lib/dosname.h' --- lib/dosname.h 1970-01-01 00:00:00 +0000 +++ lib/dosname.h 2011-02-25 20:05:36 +0000 @@ -0,0 +1,53 @@ +/* File names on MS-DOS/Windows systems. + + Copyright (C) 2000-2001, 2004-2006, 2009-2011 Free Software Foundation, Inc. + + This program 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. + + This program 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 this program. If not, see . + + From Paul Eggert and Jim Meyering. */ + +#ifndef _DOSNAME_H +#define _DOSNAME_H + +#if (defined _WIN32 || defined __WIN32__ || \ + defined __MSDOS__ || defined __CYGWIN__ || \ + defined __EMX__ || defined __DJGPP__) + /* This internal macro assumes ASCII, but all hosts that support drive + letters use ASCII. */ +# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \ + <= 'z' - 'a') +# define FILE_SYSTEM_PREFIX_LEN(Filename) \ + (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0) +# ifndef __CYGWIN__ +# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1 +# endif +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#else +# define FILE_SYSTEM_PREFIX_LEN(Filename) 0 +# define ISSLASH(C) ((C) == '/') +#endif + +#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE +# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0 +#endif + +#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE +# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)]) +# else +# define IS_ABSOLUTE_FILE_NAME(F) \ + (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0) +#endif +#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F)) + +#endif /* DOSNAME_H_ */ === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2011-02-25 07:23:41 +0000 +++ lib/gnulib.mk 2011-02-25 20:05:36 +0000 @@ -9,7 +9,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value mktime strftime sys_stat +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value lstat mktime readlink strftime symlink sys_stat MOSTLYCLEANFILES += core *.stackdump @@ -78,6 +78,13 @@ ## end gnulib module crypto/md5 +## begin gnulib module dosname + + +EXTRA_DIST += dosname.h + +## end gnulib module dosname + ## begin gnulib module dtoastr libgnu_a_SOURCES += dtoastr.c @@ -151,6 +158,15 @@ ## end gnulib module intprops +## begin gnulib module lstat + + +EXTRA_DIST += lstat.c + +EXTRA_libgnu_a_SOURCES += lstat.c + +## end gnulib module lstat + ## begin gnulib module mktime @@ -160,6 +176,24 @@ ## end gnulib module mktime +## begin gnulib module readlink + + +EXTRA_DIST += readlink.c + +EXTRA_libgnu_a_SOURCES += readlink.c + +## end gnulib module readlink + +## begin gnulib module stat + + +EXTRA_DIST += stat.c + +EXTRA_libgnu_a_SOURCES += stat.c + +## end gnulib module stat + ## begin gnulib module stdbool BUILT_SOURCES += $(STDBOOL_H) @@ -344,6 +378,15 @@ ## end gnulib module strftime +## begin gnulib module symlink + + +EXTRA_DIST += symlink.c + +EXTRA_libgnu_a_SOURCES += symlink.c + +## end gnulib module symlink + ## begin gnulib module sys_stat BUILT_SOURCES += sys/stat.h === added file 'lib/lstat.c' --- lib/lstat.c 1970-01-01 00:00:00 +0000 +++ lib/lstat.c 2011-02-22 19:30:07 +0000 @@ -0,0 +1,91 @@ +/* Work around a bug of lstat on some systems + + Copyright (C) 1997-2006, 2008-2011 Free Software Foundation, Inc. + + This program 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. + + This program 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 this program. If not, see . */ + +/* written by Jim Meyering */ + +#include + +#if !HAVE_LSTAT +/* On systems that lack symlinks, our replacement already + defined lstat as stat, so there is nothing further to do other than + avoid an empty file. */ +typedef int dummy; +#else /* HAVE_LSTAT */ + +/* Get the original definition of lstat. It might be defined as a macro. */ +# define __need_system_sys_stat_h +# include +# include +# undef __need_system_sys_stat_h + +static inline int +orig_lstat (const char *filename, struct stat *buf) +{ + return lstat (filename, buf); +} + +/* Specification. */ +# include + +# include +# include + +/* lstat works differently on Linux and Solaris systems. POSIX (see + `pathname resolution' in the glossary) requires that programs like + `ls' take into consideration the fact that FILE has a trailing slash + when FILE is a symbolic link. On Linux and Solaris 10 systems, the + lstat function already has the desired semantics (in treating + `lstat ("symlink/", sbuf)' just like `lstat ("symlink/.", sbuf)', + but on Solaris 9 and earlier it does not. + + If FILE has a trailing slash and specifies a symbolic link, + then use stat() to get more info on the referent of FILE. + If the referent is a non-directory, then set errno to ENOTDIR + and return -1. Otherwise, return stat's result. */ + +int +rpl_lstat (const char *file, struct stat *sbuf) +{ + size_t len; + int lstat_result = orig_lstat (file, sbuf); + + if (lstat_result != 0) + return lstat_result; + + /* This replacement file can blindly check against '/' rather than + using the ISSLASH macro, because all platforms with '\\' either + lack symlinks (mingw) or have working lstat (cygwin) and thus do + not compile this file. 0 len should have already been filtered + out above, with a failure return of ENOENT. */ + len = strlen (file); + if (file[len - 1] != '/' || S_ISDIR (sbuf->st_mode)) + return 0; + + /* At this point, a trailing slash is only permitted on + symlink-to-dir; but it should have found information on the + directory, not the symlink. Call stat() to get info about the + link's referent. Our replacement stat guarantees valid results, + even if the symlink is not pointing to a directory. */ + if (!S_ISLNK (sbuf->st_mode)) + { + errno = ENOTDIR; + return -1; + } + return stat (file, sbuf); +} + +#endif /* HAVE_LSTAT */ === added file 'lib/readlink.c' --- lib/readlink.c 1970-01-01 00:00:00 +0000 +++ lib/readlink.c 2011-02-22 19:30:07 +0000 @@ -0,0 +1,74 @@ +/* Stub for readlink(). + Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc. + + This program 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. + + This program 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 this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include +#include + +#if !HAVE_READLINK + +/* readlink() substitute for systems that don't have a readlink() function, + such as DJGPP 2.03 and mingw32. */ + +ssize_t +readlink (const char *name, char *buf _GL_UNUSED, + size_t bufsize _GL_UNUSED) +{ + struct stat statbuf; + + /* In general we should use lstat() here, not stat(). But on platforms + without symbolic links, lstat() - if it exists - would be equivalent to + stat(), therefore we can use stat(). This saves us a configure check. */ + if (stat (name, &statbuf) >= 0) + errno = EINVAL; + return -1; +} + +#else /* HAVE_READLINK */ + +# undef readlink + +/* readlink() wrapper that uses correct types, for systems like cygwin + 1.5.x where readlink returns int, and which rejects trailing slash, + for Solaris 9. */ + +ssize_t +rpl_readlink (const char *name, char *buf, size_t bufsize) +{ +# if READLINK_TRAILING_SLASH_BUG + size_t len = strlen (name); + if (len && name[len - 1] == '/') + { + /* Even if name without the slash is a symlink to a directory, + both lstat() and stat() must resolve the trailing slash to + the directory rather than the symlink. We can therefore + safely use stat() to distinguish between EINVAL and + ENOTDIR/ENOENT, avoiding extra overhead of rpl_lstat(). */ + struct stat st; + if (stat (name, &st) == 0) + errno = EINVAL; + return -1; + } +# endif /* READLINK_TRAILING_SLASH_BUG */ + return readlink (name, buf, bufsize); +} + +#endif /* HAVE_READLINK */ === added file 'lib/stat.c' --- lib/stat.c 1970-01-01 00:00:00 +0000 +++ lib/stat.c 2011-02-25 20:05:36 +0000 @@ -0,0 +1,105 @@ +/* Work around platform bugs in stat. + Copyright (C) 2009-2011 Free Software Foundation, Inc. + + This program 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. + + This program 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 this program. If not, see . */ + +/* written by Eric Blake */ + +#include + +/* Get the original definition of stat. It might be defined as a macro. */ +#define __need_system_sys_stat_h +#include +#include +#undef __need_system_sys_stat_h + +static inline int +orig_stat (const char *filename, struct stat *buf) +{ + return stat (filename, buf); +} + +/* Specification. */ +#include + +#include +#include +#include +#include +#include "dosname.h" + +/* Store information about NAME into ST. Work around bugs with + trailing slashes. Mingw has other bugs (such as st_ino always + being 0 on success) which this wrapper does not work around. But + at least this implementation provides the ability to emulate fchdir + correctly. */ + +int +rpl_stat (char const *name, struct stat *st) +{ + int result = orig_stat (name, st); +#if REPLACE_FUNC_STAT_FILE + /* Solaris 9 mistakenly succeeds when given a non-directory with a + trailing slash. */ + if (result == 0 && !S_ISDIR (st->st_mode)) + { + size_t len = strlen (name); + if (ISSLASH (name[len - 1])) + { + errno = ENOTDIR; + return -1; + } + } +#endif /* REPLACE_FUNC_STAT_FILE */ +#if REPLACE_FUNC_STAT_DIR + if (result == -1 && errno == ENOENT) + { + /* Due to mingw's oddities, there are some directories (like + c:\) where stat() only succeeds with a trailing slash, and + other directories (like c:\windows) where stat() only + succeeds without a trailing slash. But we want the two to be + synonymous, since chdir() manages either style. Likewise, Mingw also + reports ENOENT for names longer than PATH_MAX, when we want + ENAMETOOLONG, and for stat("file/"), when we want ENOTDIR. + Fortunately, mingw PATH_MAX is small enough for stack + allocation. */ + char fixed_name[PATH_MAX + 1] = {0}; + size_t len = strlen (name); + bool check_dir = false; + if (PATH_MAX <= len) + errno = ENAMETOOLONG; + else if (len) + { + strcpy (fixed_name, name); + if (ISSLASH (fixed_name[len - 1])) + { + check_dir = true; + while (len && ISSLASH (fixed_name[len - 1])) + fixed_name[--len] = '\0'; + if (!len) + fixed_name[0] = '/'; + } + else + fixed_name[len++] = '/'; + result = orig_stat (fixed_name, st); + if (result == 0 && check_dir && !S_ISDIR (st->st_mode)) + { + result = -1; + errno = ENOTDIR; + } + } + } +#endif /* REPLACE_FUNC_STAT_DIR */ + return result; +} === added file 'lib/symlink.c' --- lib/symlink.c 1970-01-01 00:00:00 +0000 +++ lib/symlink.c 2011-02-22 19:30:07 +0000 @@ -0,0 +1,57 @@ +/* Stub for symlink(). + Copyright (C) 2009-2011 Free Software Foundation, Inc. + + This program 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. + + This program 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 this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#include +#include +#include + + +#if HAVE_SYMLINK + +# undef symlink + +/* Create a symlink, but reject trailing slash. */ +int +rpl_symlink (char const *contents, char const *name) +{ + size_t len = strlen (name); + if (len && name[len - 1] == '/') + { + struct stat st; + if (lstat (name, &st) == 0) + errno = EEXIST; + return -1; + } + return symlink (contents, name); +} + +#else /* !HAVE_SYMLINK */ + +/* The system does not support symlinks. */ +int +symlink (char const *contents _GL_UNUSED, + char const *name _GL_UNUSED) +{ + errno = ENOSYS; + return -1; +} + +#endif /* !HAVE_SYMLINK */ === modified file 'm4/gl-comp.m4' --- m4/gl-comp.m4 2011-02-20 10:51:50 +0000 +++ m4/gl-comp.m4 2011-02-25 20:05:36 +0000 @@ -29,6 +29,7 @@ # Code from module arg-nonnull: # Code from module c++defs: # Code from module crypto/md5: + # Code from module dosname: # Code from module dtoastr: # Code from module extensions: AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -40,13 +41,17 @@ # Code from module ignore-value: # Code from module include_next: # Code from module intprops: + # Code from module lstat: # Code from module mktime: # Code from module multiarch: + # Code from module readlink: + # Code from module stat: # Code from module stdbool: # Code from module stddef: # Code from module stdint: # Code from module stdlib: # Code from module strftime: + # Code from module symlink: # Code from module sys_stat: # Code from module time: # Code from module time_r: @@ -74,6 +79,7 @@ # Code from module c++defs: # Code from module crypto/md5: gl_MD5 + # Code from module dosname: # Code from module dtoastr: AC_REQUIRE([gl_C99_STRTOLD]) # Code from module extensions: @@ -94,11 +100,20 @@ AC_REQUIRE([AC_C_INLINE]) # Code from module include_next: # Code from module intprops: + # Code from module lstat: + gl_FUNC_LSTAT + gl_SYS_STAT_MODULE_INDICATOR([lstat]) # Code from module mktime: gl_FUNC_MKTIME gl_TIME_MODULE_INDICATOR([mktime]) # Code from module multiarch: gl_MULTIARCH + # Code from module readlink: + gl_FUNC_READLINK + gl_UNISTD_MODULE_INDICATOR([readlink]) + # Code from module stat: + gl_FUNC_STAT + gl_SYS_STAT_MODULE_INDICATOR([stat]) # Code from module stdbool: AM_STDBOOL_H # Code from module stddef: @@ -109,6 +124,9 @@ gl_STDLIB_H # Code from module strftime: gl_FUNC_GNU_STRFTIME + # Code from module symlink: + gl_FUNC_SYMLINK + gl_UNISTD_MODULE_INDICATOR([symlink]) # Code from module sys_stat: gl_HEADER_SYS_STAT_H AC_PROG_MKDIR_P @@ -263,6 +281,7 @@ build-aux/arg-nonnull.h build-aux/c++defs.h build-aux/warn-on-use.h + lib/dosname.h lib/dtoastr.c lib/filemode.c lib/filemode.h @@ -276,16 +295,20 @@ lib/gettext.h lib/ignore-value.h lib/intprops.h + lib/lstat.c lib/md5.c lib/md5.h lib/mktime-internal.h lib/mktime.c + lib/readlink.c + lib/stat.c lib/stdbool.in.h lib/stddef.in.h lib/stdint.in.h lib/stdlib.in.h lib/strftime.c lib/strftime.h + lib/symlink.c lib/sys_stat.in.h lib/time.in.h lib/time_r.c @@ -299,15 +322,19 @@ m4/gnulib-common.m4 m4/include_next.m4 m4/longlong.m4 + m4/lstat.m4 m4/md5.m4 m4/mktime.m4 m4/multiarch.m4 + m4/readlink.m4 m4/st_dm_mode.m4 + m4/stat.m4 m4/stdbool.m4 m4/stddef_h.m4 m4/stdint.m4 m4/stdlib_h.m4 m4/strftime.m4 + m4/symlink.m4 m4/sys_stat_h.m4 m4/time_h.m4 m4/time_r.m4 === added file 'm4/lstat.m4' --- m4/lstat.m4 1970-01-01 00:00:00 +0000 +++ m4/lstat.m4 2011-02-22 19:30:07 +0000 @@ -0,0 +1,69 @@ +# serial 21 + +# Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering. + +AC_DEFUN([gl_FUNC_LSTAT], +[ + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + dnl If lstat does not exist, the replacement does + dnl "#define lstat stat", and lstat.c is a no-op. + AC_CHECK_FUNCS_ONCE([lstat]) + if test $ac_cv_func_lstat = yes; then + AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) + if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then + dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]). + REPLACE_LSTAT=1 + fi + # Prerequisites of lib/lstat.c. + AC_REQUIRE([AC_C_INLINE]) + else + HAVE_LSTAT=0 + fi +]) + +# Redefine AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, because it is no longer +# maintained in Autoconf. +AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], +[ + AC_CACHE_CHECK([whether lstat correctly handles trailing slash], + [ac_cv_func_lstat_dereferences_slashed_symlink], + [rm -f conftest.sym conftest.file + echo >conftest.file + if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT], + [[struct stat sbuf; + /* Linux will dereference the symlink and fail, as required by + POSIX. That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ]])], + [ac_cv_func_lstat_dereferences_slashed_symlink=yes], + [ac_cv_func_lstat_dereferences_slashed_symlink=no], + [# When cross-compiling, be pessimistic so we will end up using the + # replacement version of lstat that checks for trailing slashes and + # calls lstat a second time when necessary. + ac_cv_func_lstat_dereferences_slashed_symlink=no + ]) + else + # If the 'ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no + fi + rm -f conftest.sym conftest.file + ]) + test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1], + [Define to 1 if `lstat' dereferences a symlink specified + with a trailing slash.]) + if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then + AC_LIBOBJ([lstat]) + fi +]) === added file 'm4/readlink.m4' --- m4/readlink.m4 1970-01-01 00:00:00 +0000 +++ m4/readlink.m4 2011-02-22 19:30:07 +0000 @@ -0,0 +1,62 @@ +# readlink.m4 serial 9 +dnl Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_READLINK], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([readlink]) + if test $ac_cv_func_readlink = no; then + HAVE_READLINK=0 + AC_LIBOBJ([readlink]) + gl_PREREQ_READLINK + else + AC_CACHE_CHECK([whether readlink signature is correct], + [gl_cv_decl_readlink_works], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + /* Cause compilation failure if original declaration has wrong type. */ + ssize_t readlink (const char *, char *, size_t);]])], + [gl_cv_decl_readlink_works=yes], [gl_cv_decl_readlink_works=no])]) + dnl Solaris 9 ignores trailing slash. + dnl FreeBSD 7.2 dereferences only one level of links with trailing slash. + AC_CACHE_CHECK([whether readlink handles trailing slash correctly], + [gl_cv_func_readlink_works], + [# We have readlink, so assume ln -s works. + ln -s conftest.no-such conftest.link + ln -s conftest.link conftest.lnk2 + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include +]], [[char buf[20]; + return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])], + [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no], + [gl_cv_func_readlink_works="guessing no"]) + rm -f conftest.link conftest.lnk2]) + if test "$gl_cv_func_readlink_works" != yes; then + AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink + fails to recognize a trailing slash.]) + REPLACE_READLINK=1 + AC_LIBOBJ([readlink]) + elif test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINK=1 + AC_LIBOBJ([readlink]) + fi + fi +]) + +# Like gl_FUNC_READLINK, except prepare for separate compilation (no AC_LIBOBJ). +AC_DEFUN([gl_FUNC_READLINK_SEPARATE], +[ + AC_CHECK_FUNCS_ONCE([readlink]) + gl_PREREQ_READLINK +]) + +# Prerequisites of lib/readlink.c. +AC_DEFUN([gl_PREREQ_READLINK], +[ + : +]) === added file 'm4/stat.m4' --- m4/stat.m4 1970-01-01 00:00:00 +0000 +++ m4/stat.m4 2011-02-25 20:05:36 +0000 @@ -0,0 +1,66 @@ +# serial 7 + +# Copyright (C) 2009-2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STAT], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([lstat]) + dnl mingw is the only known platform where stat(".") and stat("./") differ + AC_CACHE_CHECK([whether stat handles trailing slashes on directories], + [gl_cv_func_stat_dir_slash], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include +]], [[struct stat st; return stat (".", &st) != stat ("./", &st);]])], + [gl_cv_func_stat_dir_slash=yes], [gl_cv_func_stat_dir_slash=no], + [case $host_os in + mingw*) gl_cv_func_stat_dir_slash="guessing no";; + *) gl_cv_func_stat_dir_slash="guessing yes";; + esac])]) + dnl AIX 7.1, Solaris 9 mistakenly succeed on stat("file/") + dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/") + AC_CACHE_CHECK([whether stat handles trailing slashes on files], + [gl_cv_func_stat_file_slash], + [touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include +]], [[int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + ]])], + [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no], + [gl_cv_func_stat_file_slash="guessing no"]) + rm -f conftest.tmp conftest.lnk]) + case $gl_cv_func_stat_dir_slash in + *no) REPLACE_STAT=1 + AC_DEFINE([REPLACE_FUNC_STAT_DIR], [1], [Define to 1 if stat needs + help when passed a directory name with a trailing slash]);; + esac + case $gl_cv_func_stat_file_slash in + *no) REPLACE_STAT=1 + AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs + help when passed a file name with a trailing slash]);; + esac + if test $REPLACE_STAT = 1; then + AC_LIBOBJ([stat]) + dnl Prerequisites of lib/stat.c. + AC_REQUIRE([AC_C_INLINE]) + fi +]) === added file 'm4/symlink.m4' --- m4/symlink.m4 1970-01-01 00:00:00 +0000 +++ m4/symlink.m4 2011-02-22 19:30:07 +0000 @@ -0,0 +1,45 @@ +# serial 4 +# See if we need to provide symlink replacement. + +dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Written by Eric Blake. + +AC_DEFUN([gl_FUNC_SYMLINK], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([symlink]) + dnl The best we can do on mingw is provide a dummy that always fails, so + dnl that compilation can proceed with fewer ifdefs. On FreeBSD 7.2, AIX 7.1, + dnl and Solaris 9, we want to fix a bug with trailing slash handling. + if test $ac_cv_func_symlink = no; then + HAVE_SYMLINK=0 + AC_LIBOBJ([symlink]) + else + AC_CACHE_CHECK([whether symlink handles trailing slash correctly], + [gl_cv_func_symlink_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[int result = 0; + if (!symlink ("a", "conftest.link/")) + result |= 1; + if (symlink ("conftest.f", "conftest.lnk2")) + result |= 2; + else if (!symlink ("a", "conftest.lnk2/")) + result |= 4; + return result; + ]])], + [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no], + [gl_cv_func_symlink_works="guessing no"]) + rm -f conftest.f conftest.link conftest.lnk2]) + if test "$gl_cv_func_symlink_works" != yes; then + REPLACE_SYMLINK=1 + AC_LIBOBJ([symlink]) + fi + fi +]) === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-28 01:07:29 +0000 +++ src/ChangeLog 2011-03-02 05:25:09 +0000 @@ -1,3 +1,16 @@ +2011-03-02 Paul Eggert + + Work around some portability problems with symlinks. + + * fileio.c (Fmake_symbolic_link): Treat ENOSYS specially, and + generate a special message for it. Suggested by Eli Zaretskii in + . + (Frename_file, Fmake_symbolic_link, Ffile_symlink_p): + Simplify the code by assuming that the readlink and symlink calls + exist, even if they always fail on this host. + (Ffile_readable_p): Likewise, for fifos. + * config.in: Regenerate. + 2011-02-27 Chong Yidong * frame.c (store_frame_param): Don't store value directly in === modified file 'src/config.in' --- src/config.in 2011-02-22 01:55:20 +0000 +++ src/config.in 2011-02-25 20:05:36 +0000 @@ -576,6 +576,9 @@ /* Define to 1 if you have the `random' function. */ #undef HAVE_RANDOM +/* Define to 1 if you have the `readlink' function. */ +#undef HAVE_READLINK + /* Define to 1 if you have the `recvfrom' function. */ #undef HAVE_RECVFROM @@ -696,6 +699,9 @@ /* Define if struct stat has an st_dm_mode member. */ #undef HAVE_ST_DM_MODE +/* Define to 1 if you have the `symlink' function. */ +#undef HAVE_SYMLINK + /* Define to 1 if you have the `sync' function. */ #undef HAVE_SYNC @@ -897,6 +903,10 @@ /* Define to 1 if localtime caches TZ. */ #undef LOCALTIME_CACHE +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +#undef LSTAT_FOLLOWS_SLASHED_SYMLINK + /* String giving fallback POP mail host. */ #undef MAILHOST @@ -968,10 +978,21 @@ 'ptrdiff_t'. */ #undef PTRDIFF_T_SUFFIX +/* Define to 1 if readlink fails to recognize a trailing slash. */ +#undef READLINK_TRAILING_SLASH_BUG + /* Define REL_ALLOC if you want to use the relocating allocator for buffer space. */ #undef REL_ALLOC +/* Define to 1 if stat needs help when passed a directory name with a trailing + slash */ +#undef REPLACE_FUNC_STAT_DIR + +/* Define to 1 if stat needs help when passed a file name with a trailing + slash */ +#undef REPLACE_FUNC_STAT_FILE + /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE === modified file 'src/fileio.c' --- src/fileio.c 2011-02-22 01:55:20 +0000 +++ src/fileio.c 2011-02-25 21:20:06 +0000 @@ -2178,14 +2178,11 @@ if (errno == EXDEV) { int count; -#ifdef S_IFLNK symlink_target = Ffile_symlink_p (file); if (! NILP (symlink_target)) Fmake_symbolic_link (symlink_target, newname, NILP (ok_if_already_exists) ? Qnil : Qt); - else -#endif - if (!NILP (Ffile_directory_p (file))) + else if (!NILP (Ffile_directory_p (file))) call4 (Qcopy_directory, file, newname, Qt, Qnil); else /* We have already prompted if it was an integer, so don't @@ -2197,11 +2194,7 @@ count = SPECPDL_INDEX (); specbind (Qdelete_by_moving_to_trash, Qnil); - if (!NILP (Ffile_directory_p (file)) -#ifdef S_IFLNK - && NILP (symlink_target) -#endif - ) + if (!NILP (Ffile_directory_p (file)) && NILP (symlink_target)) call2 (Qdelete_directory, file, Qt); else Fdelete_file (file, Qnil); @@ -2311,7 +2304,6 @@ RETURN_UNGCPRO (call4 (handler, Qmake_symbolic_link, filename, linkname, ok_if_already_exists)); -#ifdef S_IFLNK encoded_filename = ENCODE_FILE (filename); encoded_linkname = ENCODE_FILE (linkname); @@ -2333,17 +2325,17 @@ return Qnil; } } + if (errno == ENOSYS) + { + UNGCPRO; + xsignal1 (Qfile_error, + build_string ("Symbolic links are not supported")); + } report_file_error ("Making symbolic link", list2 (filename, linkname)); } UNGCPRO; return Qnil; - -#else - UNGCPRO; - xsignal1 (Qfile_error, build_string ("Symbolic links are not supported")); - -#endif /* S_IFLNK */ } @@ -2482,7 +2474,7 @@ return Qnil; #else /* not DOS_NT and not macintosh */ flags = O_RDONLY; -#if defined (S_IFIFO) && defined (O_NONBLOCK) +#ifdef O_NONBLOCK /* Opening a fifo without O_NONBLOCK can wait. We don't want to wait. But we don't want to mess wth O_NONBLOCK except in the case of a fifo, on a system which handles it. */ @@ -2584,6 +2576,10 @@ (Lisp_Object filename) { Lisp_Object handler; + char *buf; + int bufsize; + int valsize; + Lisp_Object val; CHECK_STRING (filename); filename = Fexpand_file_name (filename, Qnil); @@ -2594,13 +2590,6 @@ if (!NILP (handler)) return call2 (handler, Qfile_symlink_p, filename); -#ifdef S_IFLNK - { - char *buf; - int bufsize; - int valsize; - Lisp_Object val; - filename = ENCODE_FILE (filename); bufsize = 50; @@ -2635,10 +2624,6 @@ xfree (buf); val = DECODE_FILE (val); return val; - } -#else /* not S_IFLNK */ - return Qnil; -#endif /* not S_IFLNK */ } DEFUN ("file-directory-p", Ffile_directory_p, Sfile_directory_p, 1, 1, 0, ------------------------------------------------------------ revno: 103472 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-03-01 20:13:57 -0800 message: Make dired-omit-here-always obsolete, in favor of standard function. * lisp/dired-x.el (dired-omit-here-always): Make it obsolete. * doc/misc/dired-x.texi (Omitting Variables): Refer to add-dir-local-variable instead of the obsoleted dired-omit-here-always. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-02-28 11:10:06 +0000 +++ doc/misc/ChangeLog 2011-03-02 04:13:57 +0000 @@ -1,3 +1,8 @@ +2011-03-02 Glenn Morris + + * dired-x.texi (Omitting Variables): Refer to add-dir-local-variable + instead of the obsoleted dired-omit-here-always. + 2011-02-28 Michael Albinus * tramp.texi (Frequently Asked Questions): Add Emacs 24 to === modified file 'doc/misc/dired-x.texi' --- doc/misc/dired-x.texi 2011-02-23 04:19:28 +0000 +++ doc/misc/dired-x.texi 2011-03-02 04:13:57 +0000 @@ -345,17 +345,8 @@ @end example @noindent -to a @file{.dir-locals.el} file in that directory. - -@table @code -@findex dired-omit-here-always -@item dired-omit-here-always - -This is an interactive function that creates a local variables file exactly -like the example above (if it does not already exist) in the -@code{dir-locals-file} file in the current directory and then refreshes -the directory listing. -@end table +to a @file{.dir-locals.el} file in that directory. You can use the +command @code{add-dir-local-variable} to do this. @vindex dired-omit-files @item dired-omit-files === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-02 03:48:01 +0000 +++ lisp/ChangeLog 2011-03-02 04:13:57 +0000 @@ -1,3 +1,7 @@ +2011-03-02 Glenn Morris + + * dired-x.el (dired-omit-here-always): Make it obsolete. + 2011-03-02 Chong Yidong * textmodes/artist.el (artist-curr-go): Default to pen-line. === modified file 'lisp/dired-x.el' --- lisp/dired-x.el 2011-03-01 03:05:28 +0000 +++ lisp/dired-x.el 2011-03-02 04:13:57 +0000 @@ -785,7 +785,7 @@ (make-obsolete 'dired-hack-local-variables 'hack-dir-local-variables-non-file-buffer "24.1") -;; Not sure this is worth having a dedicated command for... +;; Does not seem worth a dedicated command. ;; See the more general features in files-x.el. (defun dired-omit-here-always () "Create `dir-locals-file' setting `dired-omit-mode' to t in `dired-mode'. @@ -809,6 +809,8 @@ (dired-extra-startup) (dired-revert)))) +(make-obsolete 'dired-omit-here-always 'add-dir-local-variable "24.1") + ;;; GUESS SHELL COMMAND. ------------------------------------------------------------ revno: 103471 committer: Chong Yidong branch nick: trunk timestamp: Tue 2011-03-01 22:48:01 -0500 message: Add a menu-bar entry for Artist mode. * lisp/textmodes/artist.el (artist-curr-go): Default to pen-line. (artist-select-op-pen-line): New function. (artist-menu-map): New variable. (artist-mode-map): Add a menu to the menu-bar. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-02 03:07:34 +0000 +++ lisp/ChangeLog 2011-03-02 03:48:01 +0000 @@ -1,3 +1,10 @@ +2011-03-02 Chong Yidong + + * textmodes/artist.el (artist-curr-go): Default to pen-line. + (artist-select-op-pen-line): New function. + (artist-menu-map): New variable. + (artist-mode-map): Add a menu to the menu-bar. + 2011-03-02 Jay Belanger * calc/calc-math.el (calcFunc-log10): Check for symbolic mode === modified file 'lisp/textmodes/artist.el' --- lisp/textmodes/artist.el 2011-01-25 04:08:28 +0000 +++ lisp/textmodes/artist.el 2011-03-02 03:48:01 +0000 @@ -422,7 +422,7 @@ (defvar artist-mode-name " Artist" "Name of Artist mode beginning with a space (appears in the mode-line).") -(defvar artist-curr-go 'pen-char +(defvar artist-curr-go 'pen-line "Current selected graphics operation.") (make-variable-buffer-local 'artist-curr-go) @@ -502,6 +502,49 @@ (defvar artist-arrow-point-1 nil) (defvar artist-arrow-point-2 nil) +(defvar artist-menu-map + (let ((map (make-sparse-keymap))) + (define-key map [spray-chars] + '(menu-item "Characters for Spray" artist-select-spray-chars + :help "Choose characters for sprayed by the spray-can")) + (define-key map [borders] + '(menu-item "Draw Shape Borders" artist-toggle-borderless-shapes + :help "Toggle whether shapes are drawn with borders" + :button (:toggle . (not artist-borderless-shapes)))) + (define-key map [trimming] + '(menu-item "Trim Line Endings" artist-toggle-trim-line-endings + :help "Toggle trimming of line-endings" + :button (:toggle . artist-trim-line-endings))) + (define-key map [rubber-band] + '(menu-item "Rubber-banding" artist-toggle-rubber-banding + :help "Toggle rubber-banding" + :button (:toggle . artist-rubber-banding))) + (define-key map [set-erase] + '(menu-item "Character to Erase..." artist-select-erase-char + :help "Choose a specific character to erase")) + (define-key map [set-line] + '(menu-item "Character for Line..." artist-select-line-char + :help "Choose the character to insert when drawing lines")) + (define-key map [set-fill] + '(menu-item "Character for Fill..." artist-select-fill-char + :help "Choose the character to insert when filling in shapes")) + (define-key map [artist-separator] '(menu-item "--")) + (dolist (op '(("Vaporize" artist-select-op-vaporize-lines vaporize-lines) + ("Erase" artist-select-op-erase-rectangle erase-rect) + ("Spray-can" artist-select-op-spray-set-size spray-get-size) + ("Text" artist-select-op-text-overwrite text-ovwrt) + ("Ellipse" artist-select-op-circle circle) + ("Poly-line" artist-select-op-straight-poly-line spolyline) + ("Rectangle" artist-select-op-square square) + ("Line" artist-select-op-straight-line s-line) + ("Pen" artist-select-op-pen-line pen-line))) + (define-key map (vector (nth 2 op)) + `(menu-item ,(nth 0 op) + ,(nth 1 op) + :help ,(format "Draw using the %s style" (nth 0 op)) + :button (:radio . (eq artist-curr-go ',(nth 2 op)))))) + map)) + (defvar artist-mode-map (let ((map (make-sparse-keymap))) (setq artist-mode-map (make-sparse-keymap)) @@ -554,6 +597,7 @@ (define-key map "\C-c\C-a\C-y" 'artist-select-op-paste) (define-key map "\C-c\C-af" 'artist-select-op-flood-fill) (define-key map "\C-c\C-a\C-b" 'artist-submit-bug-report) + (define-key map [menu-bar artist] (cons "Artist" artist-menu-map)) map) "Keymap for `artist-minor-mode'.") @@ -4601,6 +4645,10 @@ (artist-arrow-point-set-state artist-arrow-point-2 new-state))))) +(defun artist-select-op-pen-line () + "Select drawing pen lines." + (interactive) + (artist-select-operation "Pen Line")) (defun artist-select-op-line () "Select drawing lines." ------------------------------------------------------------ revno: 103470 committer: Jay Belanger branch nick: trunk timestamp: Tue 2011-03-01 21:07:34 -0600 message: * calc/calc-math.el (calcFunc-log10): Check for symbolic mode when evaluating. * calc/calc-units.el (math-conditional-apply, math-conditional-pow): New function. (math-logunits-add, math-logunits-mul, math-logunits-divide): (math-logunits-quant, math-logunits-level): Use `math-conditional-apply' and `math-conditional-pow' to evaluate functions. (math-logunits-level): Extract units from ratio. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-01 15:18:53 +0000 +++ lisp/ChangeLog 2011-03-02 03:07:34 +0000 @@ -1,3 +1,16 @@ +2011-03-02 Jay Belanger + + * calc/calc-math.el (calcFunc-log10): Check for symbolic mode + when evaluating. + + * calc/calc-units.el (math-conditional-apply, math-conditional-pow): + New function. + (math-logunits-add, math-logunits-mul, math-logunits-divide): + (math-logunits-quant, math-logunits-level): + Use `math-conditional-apply' and `math-conditional-pow' to evaluate + functions. + (math-logunits-level): Extract units from ratio. + 2011-03-01 Juanma Barranquero * emacs-lisp/cl-macs.el (lexical-let*): Fix argument name in docstring. === modified file 'lisp/calc/calc-math.el' --- lisp/calc/calc-math.el 2011-02-27 01:33:37 +0000 +++ lisp/calc/calc-math.el 2011-03-02 03:07:34 +0000 @@ -1574,7 +1574,7 @@ (if calc-infinite-mode '(neg (var inf var-inf)) (math-reject-arg x "*Logarithm of zero"))) - ;;(calc-symbolic-mode (signal 'inexact-result nil)) + (calc-symbolic-mode (signal 'inexact-result nil)) ((Math-numberp x) (math-with-extra-prec 2 (let ((xf (math-float x))) === modified file 'lisp/calc/calc-units.el' --- lisp/calc/calc-units.el 2011-02-07 22:25:31 +0000 +++ lisp/calc/calc-units.el 2011-03-02 03:07:34 +0000 @@ -1559,6 +1559,20 @@ (defvar math-logunits '((var dB var-dB) (var Np var-Np))) +(defun math-conditional-apply (fn &rest args) + "Evaluate f(args) unless in symbolic mode. +In symbolic mode, return the list (fn args)." + (if calc-symbolic-mode + (cons fn args) + (apply fn args))) + +(defun math-conditional-pow (a b) + "Evaluate a^b unless in symbolic mode. +In symbolic mode, return the list (^ a b)." + (if calc-symbolic-mode + (list '^ a b) + (math-pow a b))) + (defun math-extract-logunits (expr) (if (memq (car-safe expr) '(* /)) (cons (car expr) @@ -1585,24 +1599,24 @@ (if (equal aunit '(var dB var-dB)) (let ((coef (if power 10 20))) (math-mul coef - (calcFunc-log10 + (math-conditional-apply 'calcFunc-log10 (if neg (math-sub - (math-pow 10 (math-div acoeff coef)) - (math-pow 10 (math-div bcoeff coef))) + (math-conditional-pow 10 (math-div acoeff coef)) + (math-conditional-pow 10 (math-div bcoeff coef))) (math-add - (math-pow 10 (math-div acoeff coef)) - (math-pow 10 (math-div bcoeff coef))))))) + (math-conditional-pow 10 (math-div acoeff coef)) + (math-conditional-pow 10 (math-div bcoeff coef))))))) (let ((coef (if power 2 1))) (math-div - (calcFunc-ln + (math-conditional-apply 'calcFunc-ln (if neg (math-sub - (calcFunc-exp (math-mul coef acoeff)) - (calcFunc-exp (math-mul coef bcoeff))) + (math-conditional-apply 'calcFunc-exp (math-mul coef acoeff)) + (math-conditional-apply 'calcFunc-exp (math-mul coef bcoeff))) (math-add - (calcFunc-exp (math-mul coef acoeff)) - (calcFunc-exp (math-mul coef bcoeff))))) + (math-conditional-apply 'calcFunc-exp (math-mul coef acoeff)) + (math-conditional-apply 'calcFunc-exp (math-mul coef bcoeff))))) coef))) units))))))) @@ -1666,14 +1680,14 @@ (math-add coef (math-mul (if power 10 20) - (calcFunc-log10 number))) + (math-conditional-apply 'calcFunc-log10 number))) units))) (t (math-simplify (math-mul (math-add coef - (math-div (calcFunc-ln number) (if power 2 1))) + (math-div (math-conditional-apply 'calcFunc-ln number) (if power 2 1))) units)))) (calc-record-why "*Improper units" nil)))) @@ -1692,14 +1706,14 @@ (math-sub coef (math-mul (if power 10 20) - (calcFunc-log10 b))) + (math-conditional-apply 'calcFunc-log10 b))) units))) (t (math-simplify (math-mul (math-sub coef - (math-div (calcFunc-ln b) (if power 2 1))) + (math-div (math-conditional-apply 'calcFunc-ln b) (if power 2 1))) units))))))))) (defun calcFunc-lufieldtimes (a b) @@ -1747,14 +1761,14 @@ (if (equal lunit '(var dB var-dB)) (math-mul ref - (math-pow + (math-conditional-pow 10 (math-div coeff (if power 10 20)))) (math-mul ref - (calcFunc-exp + (math-conditional-apply 'calcFunc-exp (if power (math-mul 2 coeff) coeff)))) @@ -1787,15 +1801,16 @@ (defun math-logunits-level (val ref db power) "Compute the value of VAL in decibels or nepers." (let* ((ratio (math-simplify-units (math-div val ref))) + (ratiou (math-simplify-units (math-remove-units ratio))) (units (math-simplify (math-extract-units ratio)))) (math-mul (if db (math-mul (math-mul (if power 10 20) - (calcFunc-log10 ratio)) + (math-conditional-apply 'calcFunc-log10 ratiou)) '(var dB var-dB)) (math-mul - (math-div (calcFunc-ln ratio) (if power 2 1)) + (math-div (math-conditional-apply 'calcFunc-ln ratiou) (if power 2 1)) '(var Np var-Np))) units))) ------------------------------------------------------------ revno: 103469 committer: Michael Albinus branch nick: trunk timestamp: Tue 2011-03-01 16:18:53 +0100 message: Remove superfluous Tramp entries. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-01 04:20:37 +0000 +++ lisp/ChangeLog 2011-03-01 15:18:53 +0000 @@ -3117,7 +3117,6 @@ * net/tramp-cmds.el: Remove solved todo item. - * net/tramp-efs.el: * net/tramp-ftp.el: * net/tramp-gvfs.el: * net/tramp-gw.el: @@ -6362,8 +6361,8 @@ Use `tramp-compat-funcall'. * net/tramp.el (tramp-process-actions): - * net/tramp-gvfs.el (tramp-handle-vc-registered): - * net/tramp-sh.el (tramp-gvfs-handler-askquestion) + * net/tramp-gvfs.el (tramp-gvfs-handler-askquestion): + * net/tramp-sh.el (tramp-handle-vc-registered) (tramp-get-remote-stat, tramp-get-remote-readlink): Use `tramp-compat-with-temp-message'. @@ -7441,210 +7440,14 @@ Sync with Tramp 2.1.19. - * net/tramp-cmds.el (tramp-cleanup-all-connections) - (tramp-reporter-dump-variable, tramp-load-report-modules) - (tramp-append-tramp-buffers): Use `tramp-compat-funcall'. - (tramp-bug): Recommend setting of `tramp-verbose' to 9. - - * net/tramp-compat.el (top): Do not autoload - `tramp-handle-file-remote-p'. Load tramp-util.el and tramp-vc.el - only when `start-file-process' is not bound. - (byte-compile-not-obsolete-vars): Define if not bound. - (tramp-compat-funcall): New defmacro. - (tramp-compat-line-beginning-position) - (tramp-compat-line-end-position) - (tramp-compat-temporary-file-directory) - (tramp-compat-make-temp-file, tramp-compat-file-attributes) - (tramp-compat-copy-file, tramp-compat-copy-directory) - (tramp-compat-delete-file, tramp-compat-delete-directory) - (tramp-compat-number-sequence, tramp-compat-process-running-p): - Use it. - (tramp-advice-file-expand-wildcards): Do not use - `tramp-handle-file-remote-p'. - (tramp-compat-make-temp-file): Simplify fallback implementation. - (tramp-compat-copy-file): Add PRESERVE-SELINUX-CONTEXT. - (tramp-compat-copy-tree): Remove function. - (tramp-compat-delete-file): New defun. - (tramp-compat-delete-directory): Provide implementation for older - Emacsen. - (tramp-compat-file-attributes): Handle only - `wrong-number-of-arguments' error. - - * net/tramp-fish.el (tramp-fish-handle-copy-file): - Add PRESERVE_SELINUX_CONTEXT. - (tramp-fish-handle-delete-file): Add TRASH arg. - (tramp-fish-handle-directory-files-and-attributes): - Do not use `tramp-fish-handle-file-attributes. - (tramp-fish-handle-file-local-copy) - (tramp-fish-handle-insert-file-contents) - (tramp-fish-maybe-open-connection): Use `with-progress-reporter'. - - * net/tramp-gvfs.el (top): Require url-util. - (tramp-gvfs-mount-point): Remove. - (tramp-gvfs-file-name-handler-alist): Add `file-selinux-context' - and `set-file-selinux-context'. - (tramp-gvfs-stringify-dbus-message, tramp-gvfs-send-command) - (tramp-gvfs-handle-file-selinux-context) - (tramp-gvfs-handle-set-file-selinux-context): New defuns. - (with-tramp-dbus-call-method): Format trace message. - (tramp-gvfs-handle-copy-file): Handle PRESERVE-SELINUX-CONTEXT. - (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): - Implement backup call, when operation on local files fails. - Use progress reporter. Flush properties of changed files. - (tramp-gvfs-handle-delete-file): Add TRASH arg. - Use `tramp-compat-delete-file'. - (tramp-gvfs-handle-expand-file-name): Expand "~/". - (tramp-gvfs-handle-make-directory): Make more traces. - (tramp-gvfs-handle-write-region): Protect deleting tmpfile. - (tramp-gvfs-url-file-name): Hexify file name in url. - (tramp-gvfs-fuse-file-name): Take also prefix (like dav shares) - into account for the resulting file name. - (tramp-gvfs-handler-askquestion): Preserve current message, in - order to let progress reporter continue afterwards. (Bug#6257) - Return dummy mountpoint, when the answer is "no". - See `tramp-gvfs-maybe-open-connection'. - (tramp-gvfs-handler-mounted-unmounted) - (tramp-gvfs-connection-mounted-p): Test also for new mountspec - attribute "default_location". Set "prefix" property. - Handle default-location. - (tramp-gvfs-mount-spec): Return both prefix and mountspec. - (tramp-gvfs-maybe-open-connection): Test, whether mountpoint - exists. Raise an error, if not (due to a corresponding answer - "no" in interactive questions, for example). - Use `tramp-compat-funcall'. - - * net/tramp-imap.el (top): Autoload `epg-make-context'. - (tramp-imap-handle-copy-file): Add PRESERVE-SELINUX-CONTEXT. - (tramp-imap-do-copy-or-rename-file) - (tramp-imap-handle-insert-file-contents) - (tramp-imap-handle-file-local-copy): Use `with-progress-reporter'. - (tramp-imap-handle-delete-file): Add TRASH arg. - - * net/tramp-smb.el (tramp-smb-handle-copy-file): - Add PRESERVE-SELINUX-CONTEXT. - (tramp-smb-handle-copy-file) - (tramp-smb-handle-file-local-copy, tramp-smb-handle-rename-file) - (tramp-smb-handle-write-region, tramp-smb-maybe-open-connection): - Use `with-progress-reporter'. - (tramp-smb-handle-delete-file): Add TRASH arg. - - * net/tramp.el (tramp-methods): Move hostname to the end in all - ssh `tramp-login-args'. Add `tramp-async-args' attribute where - appropriate. - (tramp-verbose): Describe verbose level 9. - (tramp-completion-function-alist) - (tramp-file-name-regexp, tramp-chunksize) - (tramp-local-coding-commands, tramp-remote-coding-commands) - (with-connection-property, tramp-completion-mode-p) - (tramp-action-process-alive, tramp-action-out-of-band) - (tramp-check-for-regexp, tramp-file-name-p, tramp-equal-remote) - (tramp-exists-file-name-handler): Fix docstring. - (tramp-remote-process-environment): Use `format' instead of - `concat'. Protect version string by apostroph. - (tramp-shell-prompt-pattern): Do not use a shy group in case of - XEmacs. - (tramp-file-name-regexp-unified) - (tramp-completion-file-name-regexp-unified): On W32 systems, do - not regard the volume letter as remote filename. (Bug#5447) - (tramp-perl-file-attributes) - (tramp-perl-directory-files-and-attributes): Don't pass "$3". - (tramp-vc-registered-read-file-names): Read input as - here-document, otherwise the command could exceed maximum length - of command line. - (tramp-file-name-handler-alist): Add `file-selinux-context' and - `set-file-selinux-context'. - (tramp-debug-message): Add `tramp-compat-funcall' to ignored - backtrace functions. - (tramp-error-with-buffer): Don't show the connection buffer when - we are in completion mode. - (tramp-progress-reporter-update, tramp-remote-selinux-p) - (tramp-handle-file-selinux-context) - (tramp-handle-set-file-selinux-context, tramp-process-sentinel) - (tramp-connectable-p, tramp-open-shell, tramp-get-remote-trash): - New defuns. - (with-progress-reporter): New defmacro. - (tramp-debug-outline-regexp): New defconst. - (top, tramp-rfn-eshadow-setup-minibuffer) - (tramp-rfn-eshadow-update-overlay, tramp-handle-set-file-times) - (tramp-handle-dired-compress-file, tramp-handle-shell-command) - (tramp-completion-mode-p, tramp-check-for-regexp) - (tramp-open-connection-setup-interactive-shell) - (tramp-compute-multi-hops, tramp-read-passwd, tramp-clear-passwd) - (tramp-time-diff, tramp-coding-system-change-eol-conversion) - (tramp-set-process-query-on-exit-flag, tramp-unload-tramp): - Use `tramp-compat-funcall'. - (tramp-handle-make-symbolic-link): Flush file properties. - (tramp-handle-load, tramp-handle-file-local-copy) - (tramp-handle-insert-file-contents, tramp-handle-write-region) - (tramp-handle-vc-registered, tramp-maybe-send-script) - (tramp-find-shell): Use `with-progress-reporter'. - (tramp-do-file-attributes-with-stat): Add space in format string, - in order to work around a bug in pdksh. Reported by Gilles Pion - . - (tramp-handle-verify-visited-file-modtime): Do not send a command - when the connection is not established. - (tramp-handle-set-file-times): Simplify the check for utc. - (tramp-handle-directory-files-and-attributes) - (tramp-get-remote-path): Use `copy-tree'. - (tramp-completion-handle-file-name-all-completions): Ensure, that - non remote files are still checked. Oops. - (tramp-handle-copy-file, tramp-do-copy-or-rename-file): - Handle PRESERVE-SELINUX-CONTEXT. - (tramp-do-copy-or-rename-file): Add progress reporter. - (tramp-do-copy-or-rename-file-directly): Do not use - `tramp-handle-file-remote-p'. - (tramp-do-copy-or-rename-file-out-of-band): - Use `tramp-compat-delete-directory'. - (tramp-do-copy-or-rename-file-out-of-band) - (tramp-compute-multi-hops, tramp-maybe-open-connection): - Use `format-spec-make'. - (tramp-handle-delete-file): Add TRASH arg. - (tramp-handle-dired-uncache): Flush directory cache, not only file - cache. - (tramp-handle-expand-file-name) + * net/tramp-gvfs.el (tramp-gvfs-handle-write-region): Protect + deleting tmpfile. + (tramp-gvfs-maybe-open-connection): Use `tramp-compat-funcall'. + + * net/tramp.el (tramp-handle-expand-file-name) (tramp-completion-handle-file-name-all-completions) (tramp-completion-handle-file-name-completion): Use `tramp-connectable-p'. - (tramp-handle-start-file-process): Set connection property "vec". - Use it, in order to invalidate file caches. Check only for - `remote-tty' process property. - Implement tty setting. (Bug#4604, Bug#6360) - (tramp-file-name-for-operation): Add `call-process-region' and - `set-file-selinux-context'. - (tramp-find-foreign-file-name-handler) - (tramp-advice-make-auto-save-file-name) - (tramp-set-auto-save-file-modes): Remove superfluous check for - `stringp'. This is done inside `tramp-tramp-file-p'. - (tramp-file-name-handler): Trace 'quit. Catch the error for some - operations when we are in completion mode. This gives the user - the chance to correct the file name in the minibuffer. - (tramp-completion-mode-p): Use `non-essential'. - (tramp-handle-file-name-all-completions): Backward/ XEmacs - compatibility: Use `completion-ignore-case' if - `read-file-name-completion-ignore-case' does not exist. - (tramp-get-debug-buffer): Use `tramp-debug-outline-regexp'. - (tramp-find-shell, tramp-open-connection-setup-interactive-shell): - `tramp-open-shell'. - (tramp-action-password): Hide password prompt before next run. - (tramp-process-actions): Widen connection buffer for the trace. - (tramp-open-connection-setup-interactive-shell): Set `remote-tty' - process property. Trace stty settings if `tramp-verbose' >= 9. - Apply workaround for IRIX64 bug. Move argument of last - `tramp-send-command' where it belongs to. - (tramp-maybe-open-connection): Use `async-args' and `gw-args' in - front of `login-args'. - (tramp-get-ls-command, tramp-get-ls-command-with-dired): Run tests - on "/dev/null" instead of "/". - (tramp-get-ls-command-with-dired): Make test for "--dired" - stronger. - (tramp-set-auto-save-file-modes): Adapt version check. - (tramp-set-process-query-on-exit-flag): Fix wrong parentheses. - (tramp-handle-process-file): Call the program in a subshell, in - order to preserve working directory. - (tramp-handle-shell-command): Don't use hard-wired "/bin/sh" but - `tramp-remote-sh' from `tramp-methods'. - (tramp-get-ls-command): Make test for "--color=never" stronger. - (tramp-check-for-regexp): Use (forward-line 1). * net/trampver.el: Update release number. @@ -9916,9 +9719,8 @@ * net/tramp-ftp.el (tramp-ftp-file-name-handler): Use `delete-file' instead of `tramp-compat-delete-file'. - * net/tramp-gvfs.el (tramp-gvfs-handle-delete-file): Rename arg. - (tramp-gvfs-handle-write-region): Use `delete-file' instead of - `tramp-compat-delete-file'. + * net/tramp-gvfs.el (tramp-gvfs-handle-write-region): Use + `delete-file' instead of `tramp-compat-delete-file'. * net/tramp-imap.el (tramp-imap-do-copy-or-rename-file): Use `delete-file' instead of `tramp-compat-delete-file'. === modified file 'lisp/ChangeLog.12' --- lisp/ChangeLog.12 2011-02-28 01:07:29 +0000 +++ lisp/ChangeLog.12 2011-03-01 15:18:53 +0000 @@ -10699,9 +10699,6 @@ output of the next command. Reported by M Jared Finder . - * net/tramp-vc.el (vc-user-login-name): Wrap defadvice with a test - for `process-file', in order to let it work for older Emacsen too. - 2006-04-17 Ralf Angeli * textmodes/tex-mode.el (tex-font-lock-match-suscript): New function. ------------------------------------------------------------ revno: 103468 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2011-03-01 14:32:24 +0000 message: gnus-art.el (list-identifier): Add list-identifier as a parameter group. (article-hide-list-identifiers): Use list-identifier group parameter. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-03-01 12:20:17 +0000 +++ lisp/gnus/ChangeLog 2011-03-01 14:32:24 +0000 @@ -1,3 +1,9 @@ +2011-03-01 Julien Danjou + + * gnus-art.el (list-identifier): Add list-identifier as a parameter + group. + (article-hide-list-identifiers): Use list-identifier group parameter. + 2011-02-28 Julien Danjou * sieve.el (sieve-buffer-script-name): New local variable to store === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2011-03-01 12:20:17 +0000 +++ lisp/gnus/gnus-art.el 2011-03-01 14:32:24 +0000 @@ -1253,6 +1253,24 @@ :link '(custom-manual "(gnus)Customizing Articles") :type gnus-article-treat-custom) +(gnus-define-group-parameter + list-identifier + :variable-document + "Alist of regexps and correspondent identifiers." + :variable-group gnus-article-washing + :parameter-type + '(choice :tag "Identifier" + :value nil + (symbol :tag "Item in `gnus-list-identifiers'" none) + regexp + (const :tag "None" nil)) + :parameter-document + "If non-nil, specify how to remove `identifiers' from articles' subject. + +Any symbol is used to look up a regular expression to match the +banner in `gnus-list-identifiers'. A string is used as a regular +expression to match the identifier directly.") + (make-obsolete-variable 'gnus-treat-strip-pgp nil "Gnus 5.10 (Emacs 22.1)") @@ -3056,10 +3074,11 @@ The `gnus-list-identifiers' variable specifies what to do." (interactive) (let ((inhibit-point-motion-hooks t) - (regexp (if (consp gnus-list-identifiers) - (mapconcat 'identity gnus-list-identifiers " *\\|") - gnus-list-identifiers)) - (inhibit-read-only t)) + (regexp (or (gnus-parameter-list-identifier gnus-newsgroup-name) + (if (consp gnus-list-identifiers) + (mapconcat 'identity gnus-list-identifiers " *\\|") + gnus-list-identifiers))) + (inhibit-read-only t)) (when regexp (save-excursion (save-restriction ------------------------------------------------------------ revno: 103467 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2011-03-01 12:20:17 +0000 message: Merge changes made in Gnus trunk. sieve.el (sieve-buffer-script-name): New local variable to store sieve script name. (sieve-edit-script): Store sieve script name. (sieve-upload): Use sieve script name when uploading. (sieve-upload): Use substitute-command-keys. (sieve-edit-script): Use substitute-command-keys. (sieve-refresh-scriptlist): Use substitute-command-keys. (sieve-manage-mode-map): Define keymap properly. (sieve-manage-mode): Do not set mode name manually, change mode-name to (sieve-refresh-scriptlist): Use substitute-command-keys."Sieve-manage". Remove commented code about cvs. (sieve-manage-quit): New function. (sieve-manage-mode-map): Bind 'q' to sieve-manage-quit. gnus-gravatar.el: Use gnus-with-article-buffer. gnus-art.el (gnus-with-article-buffer): Check that the gnus-article-buffer is alive. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-27 08:20:21 +0000 +++ lisp/gnus/ChangeLog 2011-03-01 12:20:17 +0000 @@ -1,3 +1,19 @@ +2011-02-28 Julien Danjou + + * sieve.el (sieve-buffer-script-name): New local variable to store + sieve script name. + (sieve-edit-script): Store sieve script name. + (sieve-upload): Use sieve script name when uploading. + (sieve-upload): Use substitute-command-keys. + (sieve-edit-script): Use substitute-command-keys. + (sieve-refresh-scriptlist): Use substitute-command-keys. + (sieve-manage-mode-map): Define keymap properly. + (sieve-manage-mode): Do not set mode name manually, change mode-name to + (sieve-refresh-scriptlist): Use substitute-command-keys."Sieve-manage". + Remove commented code about cvs. + (sieve-manage-quit): New function. + (sieve-manage-mode-map): Bind 'q' to sieve-manage-quit. + 2011-02-27 Lars Magne Ingebrigtsen * gnus-group.el (gnus-import-other-newsrc-file): New function. @@ -23,6 +39,13 @@ * gnus-demon.el (gnus-demon-init): run-with-timer should be called with numerical parameters. +2011-02-25 Julien Danjou + + * gnus-gravatar.el: Use gnus-with-article-buffer. + + * gnus-art.el (gnus-with-article-buffer): Check that the + gnus-article-buffer is alive. + 2011-02-24 Teodor Zlatanov * auth-source.el (auth-source-creation-prompts): New variable to manage === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2011-02-23 22:59:34 +0000 +++ lisp/gnus/gnus-art.el 2011-03-01 12:20:17 +0000 @@ -1725,9 +1725,10 @@ (put 'gnus-with-article-headers 'edebug-form-spec '(body)) (defmacro gnus-with-article-buffer (&rest forms) - `(with-current-buffer gnus-article-buffer - (let ((inhibit-read-only t)) - ,@forms))) + `(when (buffer-live-p gnus-article-buffer) + (with-current-buffer gnus-article-buffer + (let ((inhibit-read-only t)) + ,@forms)))) (put 'gnus-with-article-buffer 'lisp-indent-function 0) (put 'gnus-with-article-buffer 'edebug-form-spec '(body)) === modified file 'lisp/gnus/gnus-gravatar.el' --- lisp/gnus/gnus-gravatar.el 2011-01-25 04:08:28 +0000 +++ lisp/gnus/gnus-gravatar.el 2011-03-01 12:20:17 +0000 @@ -80,9 +80,8 @@ "Insert GRAVATAR for ADDRESS in HEADER in current article buffer. Set image category to CATEGORY." (unless (eq gravatar 'error) - (with-current-buffer gnus-article-buffer + (gnus-with-article-buffer (let ((mark (point-marker)) - (inhibit-read-only t) (inhibit-point-motion-hooks t) (case-fold-search t)) (save-restriction === modified file 'lisp/gnus/sieve.el' --- lisp/gnus/sieve.el 2011-01-25 04:08:28 +0000 +++ lisp/gnus/sieve.el 2011-03-01 12:20:17 +0000 @@ -98,39 +98,40 @@ (defvar sieve-manage-buffer nil) (defvar sieve-buffer-header-end nil) +(defvar sieve-buffer-script-name nil + "The real script name of the buffer.") +(make-local-variable 'sieve-buffer-script-name) ;; Sieve-manage mode: -(defvar sieve-manage-mode-map nil +(defvar sieve-manage-mode-map + (let ((map (make-sparse-keymap))) + ;; various + (define-key map "?" 'sieve-help) + (define-key map "h" 'sieve-help) + (define-key map "q" 'sieve-bury-buffer) + ;; activating + (define-key map "m" 'sieve-activate) + (define-key map "u" 'sieve-deactivate) + (define-key map "\M-\C-?" 'sieve-deactivate-all) + ;; navigation keys + (define-key map "\C-p" 'sieve-prev-line) + (define-key map [up] 'sieve-prev-line) + (define-key map "\C-n" 'sieve-next-line) + (define-key map [down] 'sieve-next-line) + (define-key map " " 'sieve-next-line) + (define-key map "n" 'sieve-next-line) + (define-key map "p" 'sieve-prev-line) + (define-key map "\C-m" 'sieve-edit-script) + (define-key map "f" 'sieve-edit-script) + (define-key map "o" 'sieve-edit-script-other-window) + (define-key map "r" 'sieve-remove) + (define-key map "q" 'sieve-manage-quit) + (define-key map [(down-mouse-2)] 'sieve-edit-script) + (define-key map [(down-mouse-3)] 'sieve-manage-mode-menu) + map) "Keymap for `sieve-manage-mode'.") -(if sieve-manage-mode-map - () - (setq sieve-manage-mode-map (make-sparse-keymap)) - (suppress-keymap sieve-manage-mode-map) - ;; various - (define-key sieve-manage-mode-map "?" 'sieve-help) - (define-key sieve-manage-mode-map "h" 'sieve-help) - (define-key sieve-manage-mode-map "q" 'sieve-bury-buffer) - ;; activating - (define-key sieve-manage-mode-map "m" 'sieve-activate) - (define-key sieve-manage-mode-map "u" 'sieve-deactivate) - (define-key sieve-manage-mode-map "\M-\C-?" 'sieve-deactivate-all) - ;; navigation keys - (define-key sieve-manage-mode-map "\C-p" 'sieve-prev-line) - (define-key sieve-manage-mode-map [up] 'sieve-prev-line) - (define-key sieve-manage-mode-map "\C-n" 'sieve-next-line) - (define-key sieve-manage-mode-map [down] 'sieve-next-line) - (define-key sieve-manage-mode-map " " 'sieve-next-line) - (define-key sieve-manage-mode-map "n" 'sieve-next-line) - (define-key sieve-manage-mode-map "p" 'sieve-prev-line) - (define-key sieve-manage-mode-map "\C-m" 'sieve-edit-script) - (define-key sieve-manage-mode-map "f" 'sieve-edit-script) - (define-key sieve-manage-mode-map "o" 'sieve-edit-script-other-window) - (define-key sieve-manage-mode-map "r" 'sieve-remove) - (define-key sieve-manage-mode-map [(down-mouse-2)] 'sieve-edit-script) - (define-key sieve-manage-mode-map [(down-mouse-3)] 'sieve-manage-mode-menu)) - (easy-menu-define sieve-manage-mode-menu sieve-manage-mode-map "Sieve Menu." '("Manage Sieve" @@ -138,21 +139,21 @@ ["Activate script" sieve-activate t] ["Deactivate script" sieve-deactivate t])) -(define-derived-mode sieve-manage-mode fundamental-mode "SIEVE" +(define-derived-mode sieve-manage-mode fundamental-mode "Sieve-manage" "Mode used for sieve script management." - (setq mode-name "SIEVE") (buffer-disable-undo (current-buffer)) (setq truncate-lines t) (easy-menu-add sieve-manage-mode-menu sieve-manage-mode-map)) (put 'sieve-manage-mode 'mode-class 'special) -;; This is necessary to allow correct handling of \\[cvs-mode-diff-map] -;; in substitute-command-keys. -;(fset 'sieve-manage-mode-map sieve-manage-mode-map) - ;; Commands used in sieve-manage mode: +(defun sieve-manage-quit () + "Quit." + (interactive) + (kill-buffer (current-buffer))) + (defun sieve-activate (&optional pos) (interactive "d") (let ((name (sieve-script-at-point)) err) @@ -204,7 +205,10 @@ (switch-to-buffer (get-buffer-create "template.siv")) (insert sieve-template)) (sieve-mode) - (message "Press C-c C-l to upload script to server."))) + (setq sieve-buffer-script-name name) + (message + (substitute-command-keys + "Press \\[sieve-upload] to upload script to server.")))) (defmacro sieve-change-region (&rest body) "Turns off sieve-region before executing BODY, then re-enables it after. @@ -337,13 +341,18 @@ ;; get list of script names and print them (let ((scripts (sieve-manage-listscripts sieve-manage-buffer))) (if (null scripts) - (insert (format (concat "No scripts on server, press RET on %s to " - "create a new script.\n") sieve-new-script)) - (insert (format (concat "%d script%s on server, press RET on a script " - "name edits it, or\npress RET on %s to create " - "a new script.\n") (length scripts) - (if (eq (length scripts) 1) "" "s") - sieve-new-script))) + (insert + (substitute-command-keys + (format + "No scripts on server, press \\[sieve-edit-script] on %s to create a new script.\n" + sieve-new-script))) + (insert + (substitute-command-keys + (format (concat "%d script%s on server, press \\[sieve-edit-script] on a script " + "name edits it, or\npress \\[sieve-edit-script] on %s to create " + "a new script.\n") (length scripts) + (if (eq (length scripts) 1) "" "s") + sieve-new-script)))) (save-excursion (sieve-insert-scripts (list sieve-new-script)) (sieve-insert-scripts scripts))) @@ -363,15 +372,15 @@ ;;;###autoload (defun sieve-upload (&optional name) (interactive) - (unless name - (setq name (buffer-name))) (when (or (get-buffer sieve-buffer) (call-interactively 'sieve-manage)) (let ((script (buffer-string)) err) (with-current-buffer (get-buffer sieve-buffer) - (setq err (sieve-manage-putscript name script sieve-manage-buffer)) + (setq err (sieve-manage-putscript + (or name sieve-buffer-script-name (buffer-name)) + script sieve-manage-buffer)) (if (sieve-manage-ok-p err) - (message (concat - "Sieve upload done. Use `C-c RET' to manage scripts.")) + (message (substitute-command-keys + "Sieve upload done. Use \\[sieve-manage] to manage scripts.")) (message "Sieve upload failed: %s" (nth 2 err))))))) ;;;###autoload ------------------------------------------------------------ revno: 103466 committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-02-28 20:26:38 -0800 message: * lisp/files: Fix comment typo. diff: === modified file 'lisp/files.el' --- lisp/files.el 2011-03-01 03:43:14 +0000 +++ lisp/files.el 2011-03-01 04:26:38 +0000 @@ -3400,7 +3400,7 @@ (progn (setq alist (delq subdirs alist)) (cdr-safe subdirs)) - ;; TODO someone might want to extent this to allow + ;; TODO someone might want to extend this to allow ;; integer values for subdir, where N means ;; variables apply to this directory and N levels ;; below it (0 == nil). ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.