changeset 105181:5d1a87e2a233

Don't require speedbar. (gdb-jsonify-buffer): Handle case where "=" is part of value string.
author Nick Roberts <nickrob@snap.net.nz>
date Thu, 24 Sep 2009 12:30:08 +0000
parents 112414938e89
children e77a0b956835
files lisp/progmodes/gdb-mi.el
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-mi.el	Thu Sep 24 12:29:39 2009 +0000
+++ b/lisp/progmodes/gdb-mi.el	Thu Sep 24 12:30:08 2009 +0000
@@ -102,9 +102,7 @@
 (require 'gud)
 (require 'json)
 (require 'bindat)
-(require 'speedbar)
-(eval-when-compile
-  (require 'cl))
+(eval-when-compile (require 'cl))
 
 (defvar tool-bar-map)
 (defvar speedbar-initial-expansion-list-name)
@@ -2066,7 +2064,6 @@
       (save-excursion
         (while (re-search-forward (concat "[\\[,]\\(" fix-key "=\\)") nil t)
           (replace-match "" nil nil nil 1))))
-    ;; Emacs bug #3794
     (when fix-list
       (save-excursion
         ;; Find positions of braces which enclose broken list
@@ -2084,9 +2081,9 @@
               (insert "]"))))))
     (goto-char (point-min))
     (insert "{")
-    ;; TODO: This breaks badly with foo= inside constants
-    (while (re-search-forward "\\([[:alpha:]-_]+\\)=" nil t)
-      (replace-match "\"\\1\":" nil nil))
+    (while (re-search-forward
+	    "\\([[:alnum:]-_]+\\)=\\({\\|\\[\\|\"\"\\|\".*?[^\\]\"\\)" nil t)
+      (replace-match "\"\\1\":\\2" nil nil))
     (goto-char (point-max))
     (insert "}")))