summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-04-20 11:01:06 +0300
committerEli Zaretskii <eliz@gnu.org>2013-04-20 11:01:06 +0300
commit47ec731ececec750654e12cbd649e2cd90e069e8 (patch)
treeae1f5c33a4a1c4e95a1b920dd29d882e31ddb020 /lisp
parent373b3ea63375d70183e90ce4a1fb7895336813cd (diff)
parent806bda47ddb469f6206ecc533458eadae6a5b575 (diff)
downloademacs-47ec731ececec750654e12cbd649e2cd90e069e8.tar.gz
emacs-47ec731ececec750654e12cbd649e2cd90e069e8.tar.bz2
emacs-47ec731ececec750654e12cbd649e2cd90e069e8.zip
Merge from trunk.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/progmodes/gud.el30
-rw-r--r--lisp/progmodes/python.el9
-rw-r--r--lisp/progmodes/sh-script.el4
4 files changed, 44 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a09d37352f7..9bb155b74da 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
+2013-04-19 Masatake YAMATO <yamato@redhat.com>
+
+ * progmodes/sh-script.el (sh-imenu-generic-expression): Handle
+ function names with a single character. (Bug#11182)
+
+2013-04-19 Dima Kogan <dima@secretsauce.net> (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 <thierry.volpiatto@gmail.com>
* 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.
(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.
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:
(\"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 @@ To this:
(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))))))
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."
. ((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.