diff options
| author | Joakim Verona | 2013-04-20 08:30:34 +0200 |
|---|---|---|
| committer | Joakim Verona | 2013-04-20 08:30:34 +0200 |
| commit | 3381209e54b222a9cdd4fdfff9676137d042552c (patch) | |
| tree | 730030784d356600b6f2423fbd90fe763b4954ac | |
| parent | 4fe629bae8dac446053cacc1f10e4279df56d891 (diff) | |
| parent | 38ef2c8490eaa74e22504386beebc6d88d287094 (diff) | |
| download | emacs-3381209e54b222a9cdd4fdfff9676137d042552c.tar.gz emacs-3381209e54b222a9cdd4fdfff9676137d042552c.zip | |
auto upstream
| -rwxr-xr-x | autogen/configure | 25 | ||||
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/progmodes/gud.el | 30 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 9 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 4 | ||||
| -rw-r--r-- | test/ChangeLog | 4 | ||||
| -rw-r--r-- | test/automated/imenu-test.el | 87 |
7 files changed, 150 insertions, 19 deletions
diff --git a/autogen/configure b/autogen/configure index 8e69c9ceffc..7ddac01fb10 100755 --- a/autogen/configure +++ b/autogen/configure | |||
| @@ -4640,6 +4640,11 @@ case "${canonical}" in | |||
| 4640 | opsys=freebsd | 4640 | opsys=freebsd |
| 4641 | ;; | 4641 | ;; |
| 4642 | 4642 | ||
| 4643 | ## DragonFly ports | ||
| 4644 | *-*-dragonfly* ) | ||
| 4645 | opsys=dragonfly | ||
| 4646 | ;; | ||
| 4647 | |||
| 4643 | ## FreeBSD kernel + glibc based userland | 4648 | ## FreeBSD kernel + glibc based userland |
| 4644 | *-*-kfreebsd*gnu* ) | 4649 | *-*-kfreebsd*gnu* ) |
| 4645 | opsys=gnu-kfreebsd | 4650 | opsys=gnu-kfreebsd |
| @@ -8462,7 +8467,7 @@ esac | |||
| 8462 | 8467 | ||
| 8463 | LD_SWITCH_SYSTEM= | 8468 | LD_SWITCH_SYSTEM= |
| 8464 | case "$opsys" in | 8469 | case "$opsys" in |
| 8465 | freebsd) | 8470 | freebsd|dragonfly) |
| 8466 | ## Let `ld' find image libs and similar things in /usr/local/lib. | 8471 | ## Let `ld' find image libs and similar things in /usr/local/lib. |
| 8467 | ## The system compiler, GCC, has apparently been modified to not | 8472 | ## The system compiler, GCC, has apparently been modified to not |
| 8468 | ## look there, contrary to what a stock GCC would do. | 8473 | ## look there, contrary to what a stock GCC would do. |
| @@ -8552,7 +8557,7 @@ case "$opsys" in | |||
| 8552 | ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2. | 8557 | ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2. |
| 8553 | aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;; | 8558 | aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;; |
| 8554 | 8559 | ||
| 8555 | freebsd) LIBS_SYSTEM="-lutil" ;; | 8560 | freebsd|dragonfly) LIBS_SYSTEM="-lutil" ;; |
| 8556 | 8561 | ||
| 8557 | hpux*) LIBS_SYSTEM="-l:libdld.sl" ;; | 8562 | hpux*) LIBS_SYSTEM="-l:libdld.sl" ;; |
| 8558 | 8563 | ||
| @@ -8589,7 +8594,7 @@ case $opsys in | |||
| 8589 | ## Adding -lm confuses the dynamic linker, so omit it. | 8594 | ## Adding -lm confuses the dynamic linker, so omit it. |
| 8590 | LIB_MATH= | 8595 | LIB_MATH= |
| 8591 | ;; | 8596 | ;; |
| 8592 | freebsd ) | 8597 | freebsd | dragonfly ) |
| 8593 | SYSTEM_TYPE=berkeley-unix | 8598 | SYSTEM_TYPE=berkeley-unix |
| 8594 | ;; | 8599 | ;; |
| 8595 | gnu-linux | gnu-kfreebsd ) | 8600 | gnu-linux | gnu-kfreebsd ) |
| @@ -13783,7 +13788,7 @@ mail_lock=no | |||
| 13783 | case "$opsys" in | 13788 | case "$opsys" in |
| 13784 | aix4-2) mail_lock="lockf" ;; | 13789 | aix4-2) mail_lock="lockf" ;; |
| 13785 | 13790 | ||
| 13786 | gnu|freebsd|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;; | 13791 | gnu|freebsd|dragonfly|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;; |
| 13787 | 13792 | ||
| 13788 | ## On GNU/Linux systems, both methods are used by various mail programs. | 13793 | ## On GNU/Linux systems, both methods are used by various mail programs. |
| 13789 | ## I assume most people are using newer mailers that have heard of flock. | 13794 | ## I assume most people are using newer mailers that have heard of flock. |
| @@ -14150,7 +14155,7 @@ $as_echo "$emacs_cv_freebsd_terminfo" >&6; } | |||
| 14150 | fi | 14155 | fi |
| 14151 | ;; | 14156 | ;; |
| 14152 | 14157 | ||
| 14153 | openbsd) LIBS_TERMCAP="-lncurses" ;; | 14158 | openbsd | dragonfly) LIBS_TERMCAP="-lncurses" ;; |
| 14154 | 14159 | ||
| 14155 | ## hpux: Make sure we get select from libc rather than from libcurses | 14160 | ## hpux: Make sure we get select from libc rather than from libcurses |
| 14156 | ## because libcurses on HPUX 10.10 has a broken version of select. | 14161 | ## because libcurses on HPUX 10.10 has a broken version of select. |
| @@ -15527,7 +15532,7 @@ $as_echo "#define HAVE_PROCFS 1" >>confdefs.h | |||
| 15527 | esac | 15532 | esac |
| 15528 | 15533 | ||
| 15529 | case $opsys in | 15534 | case $opsys in |
| 15530 | darwin | freebsd | netbsd | openbsd ) | 15535 | darwin | dragonfly | freebsd | netbsd | openbsd ) |
| 15531 | 15536 | ||
| 15532 | $as_echo "#define DONT_REOPEN_PTY 1" >>confdefs.h | 15537 | $as_echo "#define DONT_REOPEN_PTY 1" >>confdefs.h |
| 15533 | 15538 | ||
| @@ -15609,7 +15614,7 @@ case $opsys in | |||
| 15609 | 15614 | ||
| 15610 | ;; | 15615 | ;; |
| 15611 | 15616 | ||
| 15612 | gnu-linux | gnu-kfreebsd | freebsd | netbsd ) | 15617 | gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd ) |
| 15613 | if test "x$ac_cv_func_grantpt" = xyes; then | 15618 | if test "x$ac_cv_func_grantpt" = xyes; then |
| 15614 | 15619 | ||
| 15615 | $as_echo "#define UNIX98_PTYS 1" >>confdefs.h | 15620 | $as_echo "#define UNIX98_PTYS 1" >>confdefs.h |
| @@ -15688,7 +15693,7 @@ esac | |||
| 15688 | 15693 | ||
| 15689 | 15694 | ||
| 15690 | case $opsys in | 15695 | case $opsys in |
| 15691 | aix4-2 | cygwin | gnu | irix6-5 | freebsd | netbsd | openbsd | darwin ) | 15696 | aix4-2 | cygwin | gnu | irix6-5 | dragonfly | freebsd | netbsd | openbsd | darwin ) |
| 15692 | $as_echo "#define SIGNALS_VIA_CHARACTERS 1" >>confdefs.h | 15697 | $as_echo "#define SIGNALS_VIA_CHARACTERS 1" >>confdefs.h |
| 15693 | 15698 | ||
| 15694 | ;; | 15699 | ;; |
| @@ -15752,7 +15757,7 @@ case $opsys in | |||
| 15752 | darwin) $as_echo "#define TAB3 OXTABS" >>confdefs.h | 15757 | darwin) $as_echo "#define TAB3 OXTABS" >>confdefs.h |
| 15753 | ;; | 15758 | ;; |
| 15754 | 15759 | ||
| 15755 | gnu | freebsd | netbsd | openbsd ) | 15760 | gnu | dragonfly | freebsd | netbsd | openbsd ) |
| 15756 | 15761 | ||
| 15757 | $as_echo "#define TABDLY OXTABS" >>confdefs.h | 15762 | $as_echo "#define TABDLY OXTABS" >>confdefs.h |
| 15758 | 15763 | ||
| @@ -15831,7 +15836,7 @@ if test x$GCC = xyes; then | |||
| 15831 | 15836 | ||
| 15832 | else | 15837 | else |
| 15833 | case $opsys in | 15838 | case $opsys in |
| 15834 | freebsd | netbsd | openbsd | irix6-5 | sol2* ) | 15839 | dragonfly | freebsd | netbsd | openbsd | irix6-5 | sol2* ) |
| 15835 | $as_echo "#define GC_SETJMP_WORKS 1" >>confdefs.h | 15840 | $as_echo "#define GC_SETJMP_WORKS 1" >>confdefs.h |
| 15836 | 15841 | ||
| 15837 | ;; | 15842 | ;; |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a09d37352f7..9bb155b74da 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2013-04-19 Masatake YAMATO <yamato@redhat.com> | ||
| 2 | |||
| 3 | * progmodes/sh-script.el (sh-imenu-generic-expression): Handle | ||
| 4 | function names with a single character. (Bug#11182) | ||
| 5 | |||
| 6 | 2013-04-19 Dima Kogan <dima@secretsauce.net> (tiny change) | ||
| 7 | |||
| 8 | * progmodes/gud.el (gud-perldb-marker-filter): Understand position info | ||
| 9 | for subroutines defined in an eval (bug#14182). | ||
| 10 | |||
| 1 | 2013-04-19 Thierry Volpiatto <thierry.volpiatto@gmail.com> | 11 | 2013-04-19 Thierry Volpiatto <thierry.volpiatto@gmail.com> |
| 2 | 12 | ||
| 3 | * bookmark.el (bookmark-completing-read): Improve handling of empty | 13 | * bookmark.el (bookmark-completing-read): Improve handling of empty |
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index d339495d76a..4e31c5e827c 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -1487,14 +1487,38 @@ into one that invokes an Emacs-enabled debugging session. | |||
| 1487 | (let ((output "")) | 1487 | (let ((output "")) |
| 1488 | 1488 | ||
| 1489 | ;; Process all the complete markers in this chunk. | 1489 | ;; Process all the complete markers in this chunk. |
| 1490 | (while (string-match "\032\032\\(\\([a-zA-Z]:\\)?[^:\n]*\\):\\([0-9]*\\):.*\n" | 1490 | ;; |
| 1491 | gud-marker-acc) | 1491 | ;; Here I match the string coming out of perldb. |
| 1492 | ;; The strings can look like any of | ||
| 1493 | ;; | ||
| 1494 | ;; "\032\032/tmp/tst.pl:6:0\n" | ||
| 1495 | ;; "\032\032(eval 5)[/tmp/tst.pl:6]:3:0\n" | ||
| 1496 | ;; "\032\032(eval 17)[Basic/Core/Core.pm.PL (i.e. PDL::Core.pm):2931]:1:0\n" | ||
| 1497 | ;; | ||
| 1498 | ;; From those I want the filename and the line number. First I look for | ||
| 1499 | ;; the eval case. If that doesn't match, I look for the "normal" case. | ||
| 1500 | (while | ||
| 1501 | (string-match | ||
| 1502 | (eval-when-compile | ||
| 1503 | (let ((file-re "\\(?:[a-zA-Z]:\\)?[^:\n]*")) | ||
| 1504 | (concat "\032\032\\(?:" | ||
| 1505 | (concat | ||
| 1506 | "(eval [0-9]+)\\[" | ||
| 1507 | "\\(" file-re "\\)" ; Filename. | ||
| 1508 | "\\(?: (i\\.e\\. [^)]*)\\)?" | ||
| 1509 | ":\\([0-9]*\\)\\]") ; Line number. | ||
| 1510 | "\\|" | ||
| 1511 | (concat | ||
| 1512 | "\\(?1:" file-re "\\)" ; Filename. | ||
| 1513 | ":\\(?2:[0-9]*\\)") ; Line number. | ||
| 1514 | "\\):.*\n"))) | ||
| 1515 | gud-marker-acc) | ||
| 1492 | (setq | 1516 | (setq |
| 1493 | 1517 | ||
| 1494 | ;; Extract the frame position from the marker. | 1518 | ;; Extract the frame position from the marker. |
| 1495 | gud-last-frame | 1519 | gud-last-frame |
| 1496 | (cons (match-string 1 gud-marker-acc) | 1520 | (cons (match-string 1 gud-marker-acc) |
| 1497 | (string-to-number (match-string 3 gud-marker-acc))) | 1521 | (string-to-number (match-string 2 gud-marker-acc))) |
| 1498 | 1522 | ||
| 1499 | ;; Append any text before the marker to the output we're going | 1523 | ;; Append any text before the marker to the output we're going |
| 1500 | ;; to return - we don't include the marker in this text. | 1524 | ;; to return - we don't include the marker in this text. |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 06d07d6ee3c..2165c835057 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -3176,6 +3176,7 @@ To this: | |||
| 3176 | (\"decorator\" . 173) | 3176 | (\"decorator\" . 173) |
| 3177 | (\"decorator.wrap\" . 353) | 3177 | (\"decorator.wrap\" . 353) |
| 3178 | (\"decorator.wrapped_f\" . 393))" | 3178 | (\"decorator.wrapped_f\" . 393))" |
| 3179 | ;; Inspired by imenu--flatten-index-alist removed in revno 21853. | ||
| 3179 | (apply | 3180 | (apply |
| 3180 | 'nconc | 3181 | 'nconc |
| 3181 | (mapcar | 3182 | (mapcar |
| @@ -3187,14 +3188,14 @@ To this: | |||
| 3187 | (cond ((or (numberp pos) (markerp pos)) | 3188 | (cond ((or (numberp pos) (markerp pos)) |
| 3188 | (list (cons name pos))) | 3189 | (list (cons name pos))) |
| 3189 | ((listp pos) | 3190 | ((listp pos) |
| 3190 | (message "%S" item) | ||
| 3191 | (cons | 3191 | (cons |
| 3192 | (cons name (cdar pos)) | 3192 | (cons name (cdar pos)) |
| 3193 | (python-imenu-create-flat-index (cddr item) name)))))) | 3193 | (python-imenu-create-flat-index (cddr item) name)))))) |
| 3194 | (or alist | 3194 | (or alist |
| 3195 | (let ((python-imenu-format-item-label-function (lambda (type name) name)) | 3195 | (let* ((fn (lambda (type name) name)) |
| 3196 | (python-imenu-format-parent-item-label-function (lambda (type name) name)) | 3196 | (python-imenu-format-item-label-function fn) |
| 3197 | (python-imenu-format-parent-item-jump-label-function (lambda (type name) name))) | 3197 | (python-imenu-format-parent-item-label-function fn) |
| 3198 | (python-imenu-format-parent-item-jump-label-function fn)) | ||
| 3198 | (python-imenu-create-index)))))) | 3199 | (python-imenu-create-index)))))) |
| 3199 | 3200 | ||
| 3200 | 3201 | ||
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index e197f9cfabe..07e9bb85c4e 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -335,11 +335,11 @@ shell it really is." | |||
| 335 | . ((nil | 335 | . ((nil |
| 336 | ;; function FOO | 336 | ;; function FOO |
| 337 | ;; function FOO() | 337 | ;; function FOO() |
| 338 | "^\\s-*function\\s-+\\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*\\(?:()\\)?" | 338 | "^\\s-*function\\s-+\\\([[:alpha:]_][[:alnum:]_]*\\)\\s-*\\(?:()\\)?" |
| 339 | 1) | 339 | 1) |
| 340 | ;; FOO() | 340 | ;; FOO() |
| 341 | (nil | 341 | (nil |
| 342 | "^\\s-*\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*()" | 342 | "^\\s-*\\([[:alpha:]_][[:alnum:]_]*\\)\\s-*()" |
| 343 | 1) | 343 | 1) |
| 344 | ))) | 344 | ))) |
| 345 | "Alist of regular expressions for recognizing shell function definitions. | 345 | "Alist of regular expressions for recognizing shell function definitions. |
diff --git a/test/ChangeLog b/test/ChangeLog index 0c240394c5c..52cc61bdc06 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-04-01 Masatake YAMATO <yamato@redhat.com> | ||
| 2 | |||
| 3 | * automated/imenu-tests.el: New file. (Bug#14112) | ||
| 4 | |||
| 1 | 2013-04-19 Fabián Ezequiel Gallina <fgallina@gnu.org> | 5 | 2013-04-19 Fabián Ezequiel Gallina <fgallina@gnu.org> |
| 2 | 6 | ||
| 3 | * automated/python-tests.el (python-imenu-prev-index-position-1): | 7 | * automated/python-tests.el (python-imenu-prev-index-position-1): |
diff --git a/test/automated/imenu-test.el b/test/automated/imenu-test.el new file mode 100644 index 00000000000..83e19ebd914 --- /dev/null +++ b/test/automated/imenu-test.el | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | ;;; imenu-tests.el --- Test suite for imenu. | ||
| 2 | |||
| 3 | ;; Copyright (C) 2013 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Masatake YAMATO <yamato@redhat.com> | ||
| 6 | ;; Keywords: tools convenience | ||
| 7 | |||
| 8 | ;; This file is part of GNU Emacs. | ||
| 9 | |||
| 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 11 | ;; it under the terms of the GNU General Public License as published by | ||
| 12 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 13 | ;; (at your option) any later version. | ||
| 14 | |||
| 15 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;; GNU General Public License for more details. | ||
| 19 | |||
| 20 | ;; You should have received a copy of the GNU General Public License | ||
| 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 22 | |||
| 23 | ;;; Code: | ||
| 24 | |||
| 25 | (require 'imenu) | ||
| 26 | |||
| 27 | ;; (imenu-simple-scan-deftest-gather-strings-from-list | ||
| 28 | ;; '(nil t 'a (0 . "x") ("c" . "d") ("a" 0 "b") )) | ||
| 29 | ;; => ("b" "a" "d" "c" "x") | ||
| 30 | (defun imenu-simple-scan-deftest-gather-strings-from-list(input) | ||
| 31 | "Gather strings from INPUT, a list." | ||
| 32 | (let ((result ())) | ||
| 33 | (while input | ||
| 34 | (cond | ||
| 35 | ((stringp input) | ||
| 36 | (setq result (cons input result) | ||
| 37 | input nil)) | ||
| 38 | ((atom input) | ||
| 39 | (setq input nil)) | ||
| 40 | ((listp (car input)) | ||
| 41 | (setq result (append | ||
| 42 | (imenu-simple-scan-deftest-gather-strings-from-list (car input)) | ||
| 43 | result) | ||
| 44 | input (cdr input))) | ||
| 45 | ((stringp (car input)) | ||
| 46 | (setq result (cons (car input) result) | ||
| 47 | input (cdr input))) | ||
| 48 | (t | ||
| 49 | (setq input (cdr input))))) | ||
| 50 | result)) | ||
| 51 | |||
| 52 | (defmacro imenu-simple-scan-deftest (name doc major-mode content expected-items) | ||
| 53 | "Generate an ert test for mode-own imenu expression. | ||
| 54 | Run `imenu-create-index-function' at the buffer which content is | ||
| 55 | CONTENT with MAJOR-MODE. A generated test runs `imenu-create-index-function' | ||
| 56 | at the buffer which content is CONTENT with MAJOR-MODE. Then it compares a list | ||
| 57 | of strings which are picked up from the result with EXPECTED-ITEMS." | ||
| 58 | (let ((xname (intern (concat "imenu-simple-scan-deftest-" (symbol-name name))))) | ||
| 59 | `(ert-deftest ,xname () | ||
| 60 | ,doc | ||
| 61 | (with-temp-buffer | ||
| 62 | (insert ,content) | ||
| 63 | (funcall ',major-mode) | ||
| 64 | (let ((result-items (sort (imenu-simple-scan-deftest-gather-strings-from-list | ||
| 65 | (funcall imenu-create-index-function)) | ||
| 66 | #'string-lessp)) | ||
| 67 | (expected-items (sort (copy-sequence ,expected-items) #'string-lessp))) | ||
| 68 | (should (equal result-items expected-items)) | ||
| 69 | ))))) | ||
| 70 | |||
| 71 | (imenu-simple-scan-deftest sh "Test imenu expression for sh-mode." sh-mode "a() | ||
| 72 | { | ||
| 73 | } | ||
| 74 | function b | ||
| 75 | { | ||
| 76 | } | ||
| 77 | function c() | ||
| 78 | { | ||
| 79 | } | ||
| 80 | function ABC_D() | ||
| 81 | { | ||
| 82 | } | ||
| 83 | " '("a" "b" "c" "ABC_D")) | ||
| 84 | |||
| 85 | (provide 'imenu-tests) | ||
| 86 | |||
| 87 | ;;; imenu-tests.el ends here | ||