Now on revision 112336. ------------------------------------------------------------ revno: 112336 committer: Masatake YAMATO branch nick: trunk timestamp: Sat 2013-04-20 04:56:16 +0900 message: Added bug number (Bug#14112) to my last ChangeLog entries. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-19 18:50:28 +0000 +++ lisp/ChangeLog 2013-04-19 19:56:16 +0000 @@ -1,7 +1,7 @@ 2013-04-19 Masatake YAMATO * progmodes/sh-script.el (sh-imenu-generic-expression): Handle - function names with a single character. + function names with a single character. (Bug#11182) 2013-04-19 Dima Kogan (tiny change) === modified file 'test/ChangeLog' --- test/ChangeLog 2013-04-19 19:02:55 +0000 +++ test/ChangeLog 2013-04-19 19:56:16 +0000 @@ -1,6 +1,6 @@ 2013-04-01 Masatake YAMATO - * automated/imenu-tests.el: New file. + * automated/imenu-tests.el: New file. (Bug#14112) 2013-04-19 Fabián Ezequiel Gallina ------------------------------------------------------------ revno: 112335 committer: Masatake YAMATO branch nick: trunk timestamp: Sat 2013-04-20 04:02:55 +0900 message: * automated/imenu-tests.el: New file. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-04-19 02:31:09 +0000 +++ test/ChangeLog 2013-04-19 19:02:55 +0000 @@ -1,3 +1,7 @@ +2013-04-01 Masatake YAMATO + + * automated/imenu-tests.el: New file. + 2013-04-19 Fabián Ezequiel Gallina * automated/python-tests.el (python-imenu-prev-index-position-1): === added file 'test/automated/imenu-test.el' --- test/automated/imenu-test.el 1970-01-01 00:00:00 +0000 +++ test/automated/imenu-test.el 2013-04-19 19:02:55 +0000 @@ -0,0 +1,87 @@ +;;; imenu-tests.el --- Test suite for imenu. + +;; Copyright (C) 2013 Free Software Foundation, Inc. + +;; Author: Masatake YAMATO +;; Keywords: tools convenience + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'imenu) + +;; (imenu-simple-scan-deftest-gather-strings-from-list +;; '(nil t 'a (0 . "x") ("c" . "d") ("a" 0 "b") )) +;; => ("b" "a" "d" "c" "x") +(defun imenu-simple-scan-deftest-gather-strings-from-list(input) + "Gather strings from INPUT, a list." + (let ((result ())) + (while input + (cond + ((stringp input) + (setq result (cons input result) + input nil)) + ((atom input) + (setq input nil)) + ((listp (car input)) + (setq result (append + (imenu-simple-scan-deftest-gather-strings-from-list (car input)) + result) + input (cdr input))) + ((stringp (car input)) + (setq result (cons (car input) result) + input (cdr input))) + (t + (setq input (cdr input))))) + result)) + +(defmacro imenu-simple-scan-deftest (name doc major-mode content expected-items) + "Generate an ert test for mode-own imenu expression. +Run `imenu-create-index-function' at the buffer which content is +CONTENT with MAJOR-MODE. A generated test runs `imenu-create-index-function' +at the buffer which content is CONTENT with MAJOR-MODE. Then it compares a list +of strings which are picked up from the result with EXPECTED-ITEMS." + (let ((xname (intern (concat "imenu-simple-scan-deftest-" (symbol-name name))))) + `(ert-deftest ,xname () + ,doc + (with-temp-buffer + (insert ,content) + (funcall ',major-mode) + (let ((result-items (sort (imenu-simple-scan-deftest-gather-strings-from-list + (funcall imenu-create-index-function)) + #'string-lessp)) + (expected-items (sort (copy-sequence ,expected-items) #'string-lessp))) + (should (equal result-items expected-items)) + ))))) + +(imenu-simple-scan-deftest sh "Test imenu expression for sh-mode." sh-mode "a() +{ +} +function b +{ +} +function c() +{ +} +function ABC_D() +{ +} +" '("a" "b" "c" "ABC_D")) + +(provide 'imenu-tests) + +;;; imenu-tests.el ends here ------------------------------------------------------------ revno: 112334 committer: Masatake YAMATO branch nick: trunk timestamp: Sat 2013-04-20 03:50:28 +0900 message: * lisp/progmodes/sh-script.el (sh-imenu-generic-expression): Handle function names with a single character. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-19 15:58:07 +0000 +++ lisp/ChangeLog 2013-04-19 18:50:28 +0000 @@ -1,3 +1,8 @@ +2013-04-19 Masatake YAMATO + + * progmodes/sh-script.el (sh-imenu-generic-expression): Handle + function names with a single character. + 2013-04-19 Dima Kogan (tiny change) * progmodes/gud.el (gud-perldb-marker-filter): Understand position info === modified file 'lisp/progmodes/sh-script.el' --- lisp/progmodes/sh-script.el 2013-04-09 17:31:17 +0000 +++ lisp/progmodes/sh-script.el 2013-04-19 18:50:28 +0000 @@ -335,11 +335,11 @@ . ((nil ;; function FOO ;; function FOO() - "^\\s-*function\\s-+\\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*\\(?:()\\)?" + "^\\s-*function\\s-+\\\([[:alpha:]_][[:alnum:]_]*\\)\\s-*\\(?:()\\)?" 1) ;; FOO() (nil - "^\\s-*\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*()" + "^\\s-*\\([[:alpha:]_][[:alnum:]_]*\\)\\s-*()" 1) ))) "Alist of regular expressions for recognizing shell function definitions. ------------------------------------------------------------ revno: 112333 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14182 author: Dima Kogan committer: Stefan Monnier branch nick: trunk timestamp: Fri 2013-04-19 11:58:07 -0400 message: * lisp/progmodes/gud.el (gud-perldb-marker-filter): Understand position info for subroutines defined in an eval. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-19 05:11:16 +0000 +++ lisp/ChangeLog 2013-04-19 15:58:07 +0000 @@ -1,3 +1,8 @@ +2013-04-19 Dima Kogan (tiny change) + + * progmodes/gud.el (gud-perldb-marker-filter): Understand position info + for subroutines defined in an eval (bug#14182). + 2013-04-19 Thierry Volpiatto * bookmark.el (bookmark-completing-read): Improve handling of empty === modified file 'lisp/progmodes/gud.el' --- lisp/progmodes/gud.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/gud.el 2013-04-19 15:58:07 +0000 @@ -1487,14 +1487,38 @@ (let ((output "")) ;; Process all the complete markers in this chunk. - (while (string-match "\032\032\\(\\([a-zA-Z]:\\)?[^:\n]*\\):\\([0-9]*\\):.*\n" - gud-marker-acc) + ;; + ;; Here I match the string coming out of perldb. + ;; The strings can look like any of + ;; + ;; "\032\032/tmp/tst.pl:6:0\n" + ;; "\032\032(eval 5)[/tmp/tst.pl:6]:3:0\n" + ;; "\032\032(eval 17)[Basic/Core/Core.pm.PL (i.e. PDL::Core.pm):2931]:1:0\n" + ;; + ;; From those I want the filename and the line number. First I look for + ;; the eval case. If that doesn't match, I look for the "normal" case. + (while + (string-match + (eval-when-compile + (let ((file-re "\\(?:[a-zA-Z]:\\)?[^:\n]*")) + (concat "\032\032\\(?:" + (concat + "(eval [0-9]+)\\[" + "\\(" file-re "\\)" ; Filename. + "\\(?: (i\\.e\\. [^)]*)\\)?" + ":\\([0-9]*\\)\\]") ; Line number. + "\\|" + (concat + "\\(?1:" file-re "\\)" ; Filename. + ":\\(?2:[0-9]*\\)") ; Line number. + "\\):.*\n"))) + gud-marker-acc) (setq ;; Extract the frame position from the marker. gud-last-frame (cons (match-string 1 gud-marker-acc) - (string-to-number (match-string 3 gud-marker-acc))) + (string-to-number (match-string 2 gud-marker-acc))) ;; Append any text before the marker to the output we're going ;; to return - we don't include the marker in this text. ------------------------------------------------------------ revno: 112332 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Fri 2013-04-19 10:29:41 -0300 message: Small fixes to revno 112328 * lisp/ChangeLog: Fix Changelog Entry. * progmodes/python.el (python-imenu-create-flat-index): Remove leftover `message' call and give credit to old imenu--flatten-index-alist. diff: === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2013-04-19 02:31:09 +0000 +++ lisp/progmodes/python.el 2013-04-19 13:29:41 +0000 @@ -3176,6 +3176,7 @@ (\"decorator\" . 173) (\"decorator.wrap\" . 353) (\"decorator.wrapped_f\" . 393))" + ;; Inspired by imenu--flatten-index-alist removed in revno 21853. (apply 'nconc (mapcar @@ -3187,14 +3188,14 @@ (cond ((or (numberp pos) (markerp pos)) (list (cons name pos))) ((listp pos) - (message "%S" item) (cons (cons name (cdar pos)) (python-imenu-create-flat-index (cddr item) name)))))) (or alist - (let ((python-imenu-format-item-label-function (lambda (type name) name)) - (python-imenu-format-parent-item-label-function (lambda (type name) name)) - (python-imenu-format-parent-item-jump-label-function (lambda (type name) name))) + (let* ((fn (lambda (type name) name)) + (python-imenu-format-item-label-function fn) + (python-imenu-format-parent-item-label-function fn) + (python-imenu-format-parent-item-jump-label-function fn)) (python-imenu-create-index)))))) ------------------------------------------------------------ revno: 112331 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-04-19 06:17:40 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2013-04-18 10:17:38 +0000 +++ autogen/configure 2013-04-19 10:17:40 +0000 @@ -4640,6 +4640,11 @@ opsys=freebsd ;; + ## DragonFly ports + *-*-dragonfly* ) + opsys=dragonfly + ;; + ## FreeBSD kernel + glibc based userland *-*-kfreebsd*gnu* ) opsys=gnu-kfreebsd @@ -8462,7 +8467,7 @@ LD_SWITCH_SYSTEM= case "$opsys" in - freebsd) + freebsd|dragonfly) ## Let `ld' find image libs and similar things in /usr/local/lib. ## The system compiler, GCC, has apparently been modified to not ## look there, contrary to what a stock GCC would do. @@ -8552,7 +8557,7 @@ ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2. aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;; - freebsd) LIBS_SYSTEM="-lutil" ;; + freebsd|dragonfly) LIBS_SYSTEM="-lutil" ;; hpux*) LIBS_SYSTEM="-l:libdld.sl" ;; @@ -8589,7 +8594,7 @@ ## Adding -lm confuses the dynamic linker, so omit it. LIB_MATH= ;; - freebsd ) + freebsd | dragonfly ) SYSTEM_TYPE=berkeley-unix ;; gnu-linux | gnu-kfreebsd ) @@ -13783,7 +13788,7 @@ case "$opsys" in aix4-2) mail_lock="lockf" ;; - gnu|freebsd|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;; + gnu|freebsd|dragonfly|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;; ## On GNU/Linux systems, both methods are used by various mail programs. ## I assume most people are using newer mailers that have heard of flock. @@ -14150,7 +14155,7 @@ fi ;; - openbsd) LIBS_TERMCAP="-lncurses" ;; + openbsd | dragonfly) LIBS_TERMCAP="-lncurses" ;; ## hpux: Make sure we get select from libc rather than from libcurses ## because libcurses on HPUX 10.10 has a broken version of select. @@ -15527,7 +15532,7 @@ esac case $opsys in - darwin | freebsd | netbsd | openbsd ) + darwin | dragonfly | freebsd | netbsd | openbsd ) $as_echo "#define DONT_REOPEN_PTY 1" >>confdefs.h @@ -15609,7 +15614,7 @@ ;; - gnu-linux | gnu-kfreebsd | freebsd | netbsd ) + gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd ) if test "x$ac_cv_func_grantpt" = xyes; then $as_echo "#define UNIX98_PTYS 1" >>confdefs.h @@ -15688,7 +15693,7 @@ case $opsys in - aix4-2 | cygwin | gnu | irix6-5 | freebsd | netbsd | openbsd | darwin ) + aix4-2 | cygwin | gnu | irix6-5 | dragonfly | freebsd | netbsd | openbsd | darwin ) $as_echo "#define SIGNALS_VIA_CHARACTERS 1" >>confdefs.h ;; @@ -15752,7 +15757,7 @@ darwin) $as_echo "#define TAB3 OXTABS" >>confdefs.h ;; - gnu | freebsd | netbsd | openbsd ) + gnu | dragonfly | freebsd | netbsd | openbsd ) $as_echo "#define TABDLY OXTABS" >>confdefs.h @@ -15831,7 +15836,7 @@ else case $opsys in - freebsd | netbsd | openbsd | irix6-5 | sol2* ) + dragonfly | freebsd | netbsd | openbsd | irix6-5 | sol2* ) $as_echo "#define GC_SETJMP_WORKS 1" >>confdefs.h ;; ------------------------------------------------------------ revno: 112330 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14176 author: Thierry Volpiatto committer: Stefan Monnier branch nick: trunk timestamp: Fri 2013-04-19 01:11:16 -0400 message: * lisp/bookmark.el (bookmark-completing-read): Improve handling of empty string. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-04-19 04:09:08 +0000 +++ lisp/ChangeLog 2013-04-19 05:11:16 +0000 @@ -1,3 +1,8 @@ +2013-04-19 Thierry Volpiatto + + * bookmark.el (bookmark-completing-read): Improve handling of empty + string (bug#14176). + 2013-04-19 Stefan Monnier * vc/vc-dispatcher.el (vc-do-command): Get rid of default sentinel msg. === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2013-04-04 01:59:09 +0000 +++ lisp/bookmark.el 2013-04-19 05:11:16 +0000 @@ -427,8 +427,8 @@ "Prompting with PROMPT, read a bookmark name in completion. PROMPT will get a \": \" stuck on the end no matter what, so you probably don't want to include one yourself. -Optional second arg DEFAULT is a string to return if the user enters -the empty string." +Optional arg DEFAULT is a string to return if the user input is empty. +If DEFAULT is nil then return empty string for empty input." (bookmark-maybe-load-default-file) ; paranoia (if (listp last-nonmenu-event) (bookmark-menu-popup-paned-menu t prompt @@ -437,22 +437,17 @@ 'string-lessp) (bookmark-all-names))) (let* ((completion-ignore-case bookmark-completion-ignore-case) - (default default) + (default (unless (equal "" default) default)) (prompt (concat prompt (if default (format " (%s): " default) - ": "))) - (str - (completing-read prompt - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (category . bookmark)) - (complete-with-action - action bookmark-alist string pred))) - nil - 0 - nil - 'bookmark-history))) - (if (string-equal "" str) default str)))) + ": ")))) + (completing-read prompt + (lambda (string pred action) + (if (eq action 'metadata) + '(metadata (category . bookmark)) + (complete-with-action + action bookmark-alist string pred))) + nil 0 nil 'bookmark-history default)))) (defmacro bookmark-maybe-historicize-string (string)