]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/analyze/debug.el
Merge from origin/emacs-24
[gnu-emacs] / lisp / cedet / semantic / analyze / debug.el
index 490b57bf83a09baeed2f126d367a0129f922f33a..9f9270f85432f5db6f80ccb5c6a52618b726c773 100644 (file)
@@ -1,6 +1,6 @@
 ;;; semantic/analyze/debug.el --- Debug the analyzer
 
-;;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+;;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -70,7 +70,7 @@
       (let ((pentry (nth idx pf))
            (ptentry (nth idx pft)))
        (if (or (stringp pentry) (not ptentry))
-           ;; Found someting ok.  stop
+           ;; Found something ok.  Stop.
            (setq stop t)
          (setq idx (1+ idx)))))
     ;; We found the first non-tag entry.  What is the situation?
@@ -443,7 +443,7 @@ or implementing a version specific to ")
                             (semanticdb-file-table-object fileinner t))))
          (cond ((not fileinner)
                 (setq unknown (1+ unknown)))
-               ((number-or-marker-p (oref tableinner pointmax))
+               ((and tableinner (number-or-marker-p (oref tableinner pointmax)))
                 (setq ok (1+ ok)))
                (t
                 (setq unparsed (1+ unparsed))))))
@@ -586,34 +586,28 @@ Look for key expressions, and add push-buttons near them."
     (set-marker orig-buffer (point) (current-buffer))
     ;; Get a buffer ready.
     (with-current-buffer "*Help*"
-      (toggle-read-only -1)
-      (goto-char (point-min))
-      (set (make-local-variable 'semantic-analyzer-debug-orig) orig-buffer)
-      ;; First, add do-in buttons to recommendations.
-      (while (re-search-forward "^\\s-*M-x \\(\\(\\w\\|\\s_\\)+\\) " nil t)
-       (let ((fcn (match-string 1)))
-         (when (not (fboundp (intern-soft fcn)))
-           (error "Help Err: Can't find %s" fcn))
-         (end-of-line)
-         (insert "   ")
-         (insert-button "[ Do It ]"
-                        'mouse-face 'custom-button-pressed-face
-                        'do-fcn fcn
-                        'action `(lambda (arg)
-                                   (let ((M semantic-analyzer-debug-orig))
-                                     (set-buffer (marker-buffer M))
-                                     (goto-char M))
-                                   (call-interactively (quote ,(intern-soft fcn))))
-                        )
-         ))
+      (let ((inhibit-read-only t))
+       (goto-char (point-min))
+       (set (make-local-variable 'semantic-analyzer-debug-orig) orig-buffer)
+       ;; First, add do-in buttons to recommendations.
+       (while (re-search-forward "^\\s-*M-x \\(\\(\\w\\|\\s_\\)+\\) " nil t)
+         (let ((fcn (match-string 1)))
+           (when (not (fboundp (intern-soft fcn)))
+             (error "Help Err: Can't find %s" fcn))
+           (end-of-line)
+           (insert "   ")
+           (insert-button "[ Do It ]"
+                          'mouse-face 'custom-button-pressed-face
+                          'do-fcn fcn
+                          'action `(lambda (arg)
+                                     (let ((M semantic-analyzer-debug-orig))
+                                       (set-buffer (marker-buffer M))
+                                       (goto-char M))
+                                     (call-interactively (quote ,(intern-soft fcn))))))))
       ;; Do something else?
-
       ;; Clean up the mess
-      (toggle-read-only 1)
-      (set-buffer-modified-p nil)
-      )))
+      (set-buffer-modified-p nil))))
 
 (provide 'semantic/analyze/debug)
 
-;; arch-tag: 943db1e5-47e6-4bec-9989-78ebfadf0358
 ;;; semantic/analyze/debug.el ends here