Now on revision 107516. ------------------------------------------------------------ revno: 107516 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-03-05 22:02:44 -0500 message: Comment. diff: === modified file 'lisp/info.el' --- lisp/info.el 2012-03-06 03:00:52 +0000 +++ lisp/info.el 2012-03-06 03:02:44 +0000 @@ -1166,6 +1166,10 @@ (file-attributes file)) (progn (setq file (expand-file-name "DIR.INFO" truename)) (file-attributes file)) + ;; Shouldn't really happen, but sometimes does, + ;; eg on Debian systems with buggy packages; + ;; so may as well try it. + ;; http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00005.html (progn (setq file (expand-file-name "dir.gz" truename)) (file-attributes file))))) (setq dirs-done ------------------------------------------------------------ revno: 107515 author: Thien-Thi Nguyen committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-03-05 22:00:52 -0500 message: * lisp/info.el (Info-insert-dir): Also try "dir.gz". Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00005.html diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-06 02:50:28 +0000 +++ lisp/ChangeLog 2012-03-06 03:00:52 +0000 @@ -1,3 +1,7 @@ +2012-03-06 Thien-Thi Nguyen + + * info.el (Info-insert-dir): Also try "dir.gz". + 2012-03-06 Glenn Morris * files.el (dir-locals-find-file): === modified file 'lisp/info.el' --- lisp/info.el 2012-01-19 07:21:25 +0000 +++ lisp/info.el 2012-03-06 03:00:52 +0000 @@ -1165,6 +1165,8 @@ (progn (setq file (expand-file-name "dir.info" truename)) (file-attributes file)) (progn (setq file (expand-file-name "DIR.INFO" truename)) + (file-attributes file)) + (progn (setq file (expand-file-name "dir.gz" truename)) (file-attributes file))))) (setq dirs-done (cons truename ------------------------------------------------------------ revno: 107514 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-03-05 21:50:28 -0500 message: dir-locals-find-file tweak for "odd" .dir-locals.el (bug#10928) * lisp/files.el (dir-locals-find-file): Ignore non-readable or non-regular files. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-06 02:31:32 +0000 +++ lisp/ChangeLog 2012-03-06 02:50:28 +0000 @@ -1,5 +1,8 @@ 2012-03-06 Glenn Morris + * files.el (dir-locals-find-file): + Ignore non-readable or non-regular files. (Bug#10928) + * files.el (locate-dominating-file): Doc fix. 2012-03-06 Adam Spiers (tiny change) === modified file 'lisp/files.el' --- lisp/files.el 2012-03-06 02:31:32 +0000 +++ lisp/files.el 2012-03-06 02:50:28 +0000 @@ -910,6 +910,10 @@ ;; (setq user (nth 2 (file-attributes file))) ;; (and prev-user (not (equal user prev-user)))) (string-match locate-dominating-stop-dir-regexp file))) + ;; FIXME? maybe this function should (optionally?) + ;; use file-readable-p instead. In many cases, an unreadable + ;; FILE is no better than a non-existent one. + ;; See eg dir-locals-find-file. (setq try (file-exists-p (expand-file-name name file))) (cond (try (setq root file)) ((equal file (setq file (file-name-directory @@ -3569,8 +3573,14 @@ (locals-file (locate-dominating-file file dir-locals-file-name)) (dir-elt nil)) ;; `locate-dominating-file' may have abbreviated the name. - (if locals-file - (setq locals-file (expand-file-name dir-locals-file-name locals-file))) + (and locals-file + (setq locals-file (expand-file-name dir-locals-file-name locals-file)) + ;; FIXME? is it right to silently ignore an unreadable file? + ;; Maybe we'd want to keep searching in that case. + ;; That is a locate-dominating-file issue. + (or (not (file-readable-p locals-file)) + (not (file-regular-p locals-file))) + (setq locals-file nil)) ;; Find the best cached value in `dir-locals-directory-cache'. (dolist (elt dir-locals-directory-cache) (when (and (eq t (compare-strings file nil (length (car elt)) ------------------------------------------------------------ revno: 107513 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-03-05 21:31:32 -0500 message: * lisp/files.el (locate-dominating-file): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-06 02:18:29 +0000 +++ lisp/ChangeLog 2012-03-06 02:31:32 +0000 @@ -1,3 +1,7 @@ +2012-03-06 Glenn Morris + + * files.el (locate-dominating-file): Doc fix. + 2012-03-06 Adam Spiers (tiny change) * calendar/calendar.el (calendar-set-mode-line): === modified file 'lisp/files.el' --- lisp/files.el 2012-03-01 08:33:50 +0000 +++ lisp/files.el 2012-03-06 02:31:32 +0000 @@ -880,7 +880,10 @@ (defun locate-dominating-file (file name) "Look up the directory hierarchy from FILE for a file named NAME. Stop at the first parent directory containing a file NAME, -and return the directory. Return nil if not found." +and return the directory. Return nil if not found. + +This function only tests if FILE exists. If you care about whether +it is readable, regular, etc., you should test the result." ;; We used to use the above locate-dominating-files code, but the ;; directory-files call is very costly, so we're much better off doing ;; multiple calls using the code in here. ------------------------------------------------------------ revno: 107512 fixes bug(s): http://debbugs.gnu.org/10951 author: Adam Spiers committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-03-05 21:18:29 -0500 message: calendar-set-mode-line fix (tiny change) * lisp/calendar/calendar.el (calendar-set-mode-line): `getenv' returns a string. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-05 15:53:34 +0000 +++ lisp/ChangeLog 2012-03-06 02:18:29 +0000 @@ -1,3 +1,8 @@ +2012-03-06 Adam Spiers (tiny change) + + * calendar/calendar.el (calendar-set-mode-line): + `getenv' returns a string. (Bug#10951) + 2012-03-05 Leo Liu * simple.el (backward-delete-char-untabify): Constrain point to === modified file 'lisp/calendar/calendar.el' --- lisp/calendar/calendar.el 2012-02-18 03:08:15 +0000 +++ lisp/calendar/calendar.el 2012-03-06 02:18:29 +0000 @@ -2602,7 +2602,7 @@ ;; If no frame exists yet, we have no idea what width to use. (and (= width 10) (not window-system) - (setq width (or (getenv "COLUMNS") 80))) + (setq width (string-to-number (or (getenv "COLUMNS") "80")))) (setq mode-line-format (if buffer-file-name `("-" mode-line-modified ------------------------------------------------------------ revno: 107511 fixes bug(s): http://debbugs.gnu.org/10939 committer: Leo Liu branch nick: trunk timestamp: Mon 2012-03-05 23:53:34 +0800 message: * lisp/simple.el (backward-delete-char-untabify): Constrain point to field. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-05 10:44:31 +0000 +++ lisp/ChangeLog 2012-03-05 15:53:34 +0000 @@ -1,5 +1,8 @@ 2012-03-05 Leo Liu + * simple.el (backward-delete-char-untabify): Constrain point to + field (Bug#10939). + * eshell/em-cmpl.el (eshell-cmpl-initialize): Fix shift-tab key. 2012-03-05 Chong Yidong === modified file 'lisp/simple.el' --- lisp/simple.el 2012-03-05 06:10:11 +0000 +++ lisp/simple.el 2012-03-05 15:53:34 +0000 @@ -3463,8 +3463,10 @@ ((eq backward-delete-char-untabify-method 'all) " \t\n\r"))) (n (if skip - (let ((wh (- (point) (save-excursion (skip-chars-backward skip) - (point))))) + (let* ((oldpt (point)) + (wh (- oldpt (save-excursion + (skip-chars-backward skip) + (constrain-to-field nil oldpt))))) (+ arg (if (zerop wh) 0 (1- wh)))) arg))) ;; Avoid warning about delete-backward-char ------------------------------------------------------------ revno: 107510 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-03-05 06:17:41 -0500 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2012-02-27 19:59:12 +0000 +++ autogen/configure 2012-03-05 11:17:41 +0000 @@ -14265,68 +14265,76 @@ # It's better to believe a function is not available # than to expect to find it in ncurses. # Also we need tputs and friends to be able to build at all. -have_tputs_et_al=true +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tputs" >&5 +$as_echo_n "checking for library containing tputs... " >&6; } +# Run a test program that contains a call to tputs, a call that is +# never executed. This tests whether a pre-'main' dynamic linker +# works with the library. It's too much trouble to actually call +# tputs in the test program, due to portability hassles. When +# cross-compiling, assume the test program will run if it links. + # Maybe curses should be tried earlier? # See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tputs" >&5 -$as_echo_n "checking for library containing tputs... " >&6; } -if test "${ac_cv_search_tputs+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char tputs (); -int -main () -{ -return tputs (); - ; - return 0; -} -_ACEOF -for ac_lib in '' ncurses terminfo termcap curses; do - if test -z "$ac_lib"; then - ac_res="none required" +for tputs_library in '' ncurses terminfo termcap curses; do + OLIBS=$LIBS + if test -z "$tputs_library"; then + LIBS_TERMCAP= + msg='none required' else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" + LIBS_TERMCAP=-l$tputs_library + msg=$LIBS_TERMCAP + LIBS="$LIBS_TERMCAP $LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_tputs=$ac_res + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + extern void tputs (const char *, int, int (*)(int)); + int main (int argc, char **argv) + { + if (argc == 10000) + tputs (argv[0], 0, 0); + return 0; + } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +else + msg=no fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_tputs+set}" = set; then : - break -fi + conftest$ac_exeext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + extern void tputs (const char *, int, int (*)(int)); + int main (int argc, char **argv) + { + if (argc == 10000) + tputs (argv[0], 0, 0); + return 0; + } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + msg=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + LIBS=$OLIBS + if test "X$msg" != Xno; then + break + fi done -if test "${ac_cv_search_tputs+set}" = set; then : - -else - ac_cv_search_tputs=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tputs" >&5 -$as_echo "$ac_cv_search_tputs" >&6; } -ac_res=$ac_cv_search_tputs -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -else - have_tputs_et_al=false -fi - -if test "$have_tputs_et_al" != true; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $msg" >&5 +$as_echo "$msg" >&6; } +if test "X$msg" = Xno; then as_fn_error "The required function \`tputs' was not found in any library. These libraries were tried: libncurses, libterminfo, libtermcap, libcurses. Please try installing whichever of these libraries is most appropriate @@ -14346,7 +14354,6 @@ ## freebsd < 40000, ms-w32, msdos, netbsd < 599002500, and ## darwin|gnu without ncurses. TERMINFO=no -LIBS_TERMCAP= case "$opsys" in ## cygwin: Fewer environment variables to go wrong, more terminal types. ## hpux10-20: Use the system provided termcap(3) library. @@ -14435,10 +14442,6 @@ $as_echo "#define TERMINFO 1" >>confdefs.h - - ## Default used to be -ltermcap. Add a case above if need something else. - test "x$LIBS_TERMCAP" = "x" && LIBS_TERMCAP="-lcurses" - TERMCAP_OBJ=terminfo.o fi ------------------------------------------------------------ revno: 107509 committer: Leo Liu branch nick: trunk timestamp: Mon 2012-03-05 18:44:31 +0800 message: * lisp/eshell/em-cmpl.el (eshell-cmpl-initialize): Fix shift-tab key. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-05 06:10:11 +0000 +++ lisp/ChangeLog 2012-03-05 10:44:31 +0000 @@ -1,3 +1,7 @@ +2012-03-05 Leo Liu + + * eshell/em-cmpl.el (eshell-cmpl-initialize): Fix shift-tab key. + 2012-03-05 Chong Yidong * simple.el (count-words): If called from Lisp, return the word === modified file 'lisp/eshell/em-cmpl.el' --- lisp/eshell/em-cmpl.el 2012-01-19 07:21:25 +0000 +++ lisp/eshell/em-cmpl.el 2012-03-05 10:44:31 +0000 @@ -299,8 +299,7 @@ ;; jww (1999-10-19): Will this work on anything but X? (if (featurep 'xemacs) (define-key eshell-mode-map [iso-left-tab] 'pcomplete-reverse) - (define-key eshell-mode-map [(shift iso-lefttab)] 'pcomplete-reverse) - (define-key eshell-mode-map [(shift control ?i)] 'pcomplete-reverse)) + (define-key eshell-mode-map [backtab] 'pcomplete-reverse)) (define-key eshell-mode-map [(meta ??)] 'pcomplete-list)) (defun eshell-completion-command-name () ------------------------------------------------------------ revno: 107508 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-03-05 14:12:17 +0800 message: * doc/lispref/positions.texi (Text Lines): Document count-words. diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2012-03-04 06:50:18 +0000 +++ admin/FOR-RELEASE 2012-03-05 06:12:17 +0000 @@ -219,7 +219,7 @@ objects.texi cyd os.texi package.texi -positions.texi +positions.texi cyd processes.texi searching.texi sequences.texi cyd === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-04 06:50:18 +0000 +++ doc/lispref/ChangeLog 2012-03-05 06:12:17 +0000 @@ -1,3 +1,7 @@ +2012-03-05 Chong Yidong + + * positions.texi (Text Lines): Document count-words. + 2012-03-04 Chong Yidong * frames.texi (Frames): Remove little-used "terminal frame" and === modified file 'doc/lispref/positions.texi' --- doc/lispref/positions.texi 2012-01-19 07:21:25 +0000 +++ doc/lispref/positions.texi 2012-03-05 06:12:17 +0000 @@ -372,19 +372,18 @@ 1, even if @var{start} and @var{end} are on the same line. This is because the text between them, considered in isolation, must contain at least one line unless it is empty. - -Here is an example of using @code{count-lines}: - -@example -@group -(defun current-line () - "Return the vertical position of point@dots{}" - (+ (count-lines (window-start) (point)) - (if (= (current-column) 0) 1 0))) -@end group -@end example @end defun +@deffn Command count-words start end +@cindex words in region +This function returns the number of words between the positions +@var{start} and @var{end} in the current buffer. + +This function can also be called interactively. In that case, it +prints a message reporting the number of lines, words, and characters +in the buffer, or in the region if the region is active. +@end deffn + @defun line-number-at-pos &optional pos @cindex line number This function returns the line number in the current buffer