[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/realgud ecc78f1 012/140: Fix up breakpoint display
From: |
Rocky Bernstein |
Subject: |
[elpa] externals/realgud ecc78f1 012/140: Fix up breakpoint display |
Date: |
Sat, 25 May 2019 19:35:21 -0400 (EDT) |
branch: externals/realgud
commit ecc78f1076ae9cc55d9eb0903e3c136597d4bc01
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Fix up breakpoint display
---
realgud/common/buffer/command.el | 52 +++++++++++++++++++++++-----------------
realgud/common/loc.el | 27 +++++++++++++++------
realgud/common/track.el | 2 +-
3 files changed, 51 insertions(+), 30 deletions(-)
diff --git a/realgud/common/buffer/command.el b/realgud/common/buffer/command.el
index 7316c89..2ccdafd 100644
--- a/realgud/common/buffer/command.el
+++ b/realgud/common/buffer/command.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015-2016 Free Software Foundation, Inc
+;; Copyright (C) 2015-2017 Free Software Foundation, Inc
;; Author: Rocky Bernstein <address@hidden>
;; This program is free software; you can redistribute it and/or modify
@@ -156,19 +156,33 @@
(insert "\n")
)))
-;;; JSON encoder
+;; FIXME: this is a cheat. We are inserting
+;; and afterwards inserting ""
+(defun realgud:cmdbuf-bp-list-describe (info)
+ (let ((bp-list (realgud-cmdbuf-info-bp-list info)))
+ (cond (bp-list
+ (insert "** Breakpoint list (bp-list)\n")
+ (dolist (loc bp-list "")
+ (let ((bp-num (realgud-loc-num loc)))
+ (insert (format "*** Breakpoint %d\n" bp-num))
+ (realgud:org-mode-append-loc loc))))
+ ;; Since we are inserting, the below in fact
+ ;; inserts nothing. The string return is
+ ;; aspirational for when this is fixed
+ (t "\n")
+ )))
(defun realgud:org-mode-encode (header object)
"Return an org-mode representation of OBJECT as an org-mode string."
- (format "%s\n%s" header
+ (format "%s%s" header
(cond ((not object) "nil\n")
- ;; ((stringp object) (realgud:org-mode-encodestring
object))
- ;; ((keywordp object) (realgud:org-mode-encodestring
- ;; (substring (symbol-name object) 1)))
- ;;((symbolp object) (realgud:org-mode-encodestring
- ;; (symbol-name object)))
- ;; ((numberp object) (realgud:org-mode-encodenumber
object))
- ;; ((arrayp object) (realgud:org-mode-encodearray object))
+ ((stringp object) (format "%s\n" object))
+ ((keywordp object) (json-encode-string
+ (substring (symbol-name object) 1)))
+ ((symbolp object) (json-encode-string
+ (symbol-name object)))
+ ((numberp object) (json-encode-number object))
+ ((arrayp object) (json-encode-array object))
((hash-table-p object) (realgud:org-mode-encode-htable object))
;; ((listp object) (realgud:org-mode-encodelist object))
(t (signal 'error (list object))))))
@@ -181,14 +195,11 @@
(maphash
(lambda (k v)
(push (format
- " - %s\t: %s" k v)
+ " - %s\t: %s" k (realgud:org-mode-encode v ""))
r))
hash-table)
r)
- "\n")))
-
-
-
+ "")))
(defun realgud:cmdbuf-info-describe (&optional buffer)
"Display realgud-cmdcbuf-info fields of BUFFER.
@@ -235,24 +246,21 @@ This is based on an org-mode buffer. Hit tab to
expand/contract sections.
(realgud-cmdbuf-info-last-input-end info))
(format " - Source should go into short-key mode? ::
%s\n"
(realgud-cmdbuf-info-src-shortkey? info))
-
(format " - In debugger? ::\t%s\n"
(realgud-cmdbuf-info-in-debugger? info))
- ;; FIXME populate bp-list!
- ;; (format " - Breakpoint list ::\t %s\n"
- ;; (realgud-cmdbuf-info-bp-list info))
- (realgud:org-mode-encode "\n*** Remap table for debugger
commands"
+ (realgud:org-mode-encode "\n*** Remap table for debugger
commands\n"
(realgud-cmdbuf-info-cmd-hash info))
- ;; (format " - Remap table for debugger commands
::\n\t%s\n"
- ;; (json-encode (realgud-cmdbuf-info-cmd-hash info)))
;; (realgud:org-mode-encode "\n*** Backtrace buffer"
;;
(realgud-cmdbuf-info-bt-buf info))
;; (format " - Backtrace buffer ::\t%s\n"
;; (realgud-cmdbuf-info-bt-buf info))
))
(insert "\n")
+ (realgud:cmdbuf-bp-list-describe info)
+ (insert "\n")
(realgud:cmdbuf-buffers-describe info)
+ (insert "\n")
(realgud:loc-hist-describe (realgud-cmdbuf-info-loc-hist info))
(insert "
#+STARTUP: overview
diff --git a/realgud/common/loc.el b/realgud/common/loc.el
index 76584c0..f90436f 100644
--- a/realgud/common/loc.el
+++ b/realgud/common/loc.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015-2016 Free Software Foundation, Inc
+;; Copyright (C) 2015-2017 Free Software Foundation, Inc
;; Author: Rocky Bernstein <address@hidden>
@@ -62,9 +62,16 @@ without buffer properties."
Information is put in an internal buffer called *Describe*."
(interactive "")
(switch-to-buffer (get-buffer-create "*Describe*"))
- (let ((link-start) (link-end) (map) (filename))
+ (realgud:org-mode-append-loc loc))
+
+(defun realgud:org-mode-append-loc (loc)
+ "Display realgud-cmdcbuf-info.
+Information is put in an internal buffer called *Describe*."
+ (let ((column-number (realgud-loc-column-number loc))
+ (bp-num (realgud-loc-num loc))
+ (source-text (realgud-loc-source-text loc))
+ (filename (realgud-loc-filename loc)))
(insert " - filename :: ")
- (setq filename (realgud-loc-filename loc))
(put-text-property
(insert-text-button filename
'action 'realgud:follow-event
@@ -75,10 +82,16 @@ Information is put in an internal buffer called *Describe*."
(mapc 'insert
(list
(format " - line number :: %s\n" (realgud-loc-line-number loc))
- (format " - brkpt num :: %s\n" (realgud-loc-num loc))
- (format " - column number :: %s\n"
- (realgud-loc-column-number loc))
- (format " - source text :: %s\n" (realgud-loc-source-text loc))
+ (if bp-num
+ (format " - brkpt num :: %s\n" (realgud-loc-num loc))
+ "")
+ (if column-number
+ (format " - column number :: %s\n"
+ (realgud-loc-column-number loc))
+ "")
+ (if source-text
+ (format " - source text :: %s\n" (realgud-loc-source-text
loc))
+ "")
))
;; Make locations clickable
(insert " - source marker :: ")
diff --git a/realgud/common/track.el b/realgud/common/track.el
index f26a0ed..174cb6a 100644
--- a/realgud/common/track.el
+++ b/realgud/common/track.el
@@ -510,7 +510,7 @@ Otherwise return nil. CMD-MARK is set in the realgud-loc
object created.
(realgud-bp-add-info loc))
(realgud-cmdbuf-info-bp-list=
- (cons loc (realgud-sget
'cmdbuf-info 'bp-list)))
+ (add-to-list loc (realgud-sget
'cmdbuf-info 'bp-list)))
;; Set to return location
loc-or-error))))
nil))))
- [elpa] externals/realgud 50dc7db 022/140: Info ..., (continued)
- [elpa] externals/realgud 50dc7db 022/140: Info ..., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud c7594f0 032/140: wrong 'let' syntax - caught thanks to the jodonnell's test!, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 37ba671 037/140: Comment better a track test, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud eeb4c2f 013/140: Bug in last commit., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 811e7b9 036/140: < -> <=. See comment before, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 2295d94 024/140: making eval print to the message area, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 83d471f 008/140: return the set of features removed, in realgud:unload-features(), Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud f41b7a7 017/140: When a breakpoint is seen, add source..., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 1f59502 021/140: Merge pull request #192 from dvzubarev/master, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud da2f39d 011/140: Improve Debugger Info org-mode buffer, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud ecc78f1 012/140: Fix up breakpoint display,
Rocky Bernstein <=
- [elpa] externals/realgud 4a7f6ef 019/140: Fix infinite loop in realgud:backtrace-init, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 081f7ed 018/140: Expand script path where appropriate, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 1180d9f 028/140: add eval at point and bind it to E in shortkey mode, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud f20f1e3 043/140: change E to put the thing at point in the eval buffer, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud e47abfb 044/140: Merge pull request #197 from jodonnell/eval-command, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud ce45b16 025/140: making join string not emacs 25 only, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud dc0e131 031/140: Guard against nil (realgud:get-command-name "eval"), Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud c64a4fd 039/140: Merge branch 'print', Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 2327213 026/140: adding tests for print to message area, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 7242eea 048/140: whitespace, Rocky Bernstein, 2019/05/25