[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/realgud 4d9c31b 119/140: Improve realgud:attach-cmd-buf
From: |
Rocky Bernstein |
Subject: |
[elpa] externals/realgud 4d9c31b 119/140: Improve realgud:attach-cmd-buffer... |
Date: |
Sat, 25 May 2019 19:35:47 -0400 (EDT) |
branch: externals/realgud
commit 4d9c31b9eef5db339fc0769fbdec3fbbb1191d82
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Improve realgud:attach-cmd-buffer...
And add %U specifier for url's
---
realgud/common/attach.el | 19 +++++++++++++++++--
realgud/common/send.el | 10 +++++++++-
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/realgud/common/attach.el b/realgud/common/attach.el
index 971da46..91ee8ee 100644
--- a/realgud/common/attach.el
+++ b/realgud/common/attach.el
@@ -17,6 +17,8 @@
;;; Emacs Commands to associate or attach a source buffer to a command
;;; buffer and vice versa.
+(eval-when-compile (require 'cl-seq)) ;For cl-remove-if-not.
+
(require 'load-relative)
(require-relative-list '("buffer/command" "buffer/source")
"realgud-buffer-")
@@ -27,6 +29,9 @@
(declare-function realgud-srcbuf-init-or-update 'realgud-source)
(declare-function realgud-short-key-mode-setup 'realgud-shortkey)
+;; (defvar realgud:attach-cmdbuf-history nil "minibuffer command buffer
history list'.")
+
+
;;;###autoload
(defun realgud:attach-source-buffer(srcbuf)
"Associate a source buffer with the current command buffer"
@@ -49,10 +54,15 @@
)
;;;###autoload
-(defun realgud:attach-command-buffer(cmdbuf)
+(defun realgud:attach-cmd-buffer(cmdbuf)
"Associate a command buffer with the current source buffer"
- (interactive "bcommand buffer: ")
+ (interactive
+ (list
+ (completing-read "Choose a realgud command buffer: "
+ (realgud:attach-list-command-buffers) nil t nil
+ nil nil)))
+ ;; realgud:attach-cmdbuf-history (car-safe
realgud:attach-cmdbuf-history))))
(if (stringp cmdbuf) (setq cmdbuf (get-buffer cmdbuf)))
(let* ((srcbuf (current-buffer))
(shortkey-mode?))
@@ -62,9 +72,14 @@
(unless (get-buffer-process (current-buffer))
(warn "Can't find a process for command buffer %s" (current-buffer)))
(setq shortkey-mode? (realgud-sget 'cmdbuf-info 'src-shortkey?)))
+ ;; (add-to-list 'realgud:attach-cmdbuf-history (buffer-name cmdbuf))
(realgud-cmdbuf-add-srcbuf srcbuf)
(realgud-srcbuf-init-or-update srcbuf cmdbuf)
(if shortkey-mode? (realgud-short-key-mode-setup 't)))
)
+(defun realgud:attach-list-command-buffers()
+ (mapcar 'buffer-name (cl-remove-if-not 'realgud-cmdbuf? (buffer-list))))
+
+
(provide-me "realgud-")
diff --git a/realgud/common/send.el b/realgud/common/send.el
index 4c112c1..f1c6659 100644
--- a/realgud/common/send.el
+++ b/realgud/common/send.el
@@ -135,6 +135,7 @@ taken from current buffer, or OPT-BUFFER if non-nil. Some
%F -- Name without directory or extension of current source file.
%x -- Name of current source file.
%X -- Expanded name of current source file.
+ %U -- Expanded name of current source file stripping file://.
%d -- Directory of current source file.
%l -- Number of current source line.
%c -- Fully qualified class name derived from the expression
@@ -150,7 +151,7 @@ taken from current buffer, or OPT-BUFFER if non-nil. Some
result)
(while (and fmt-str
(let ((case-fold-search nil))
- (string-match "\\([^%]*\\)%\\([dfFlpqxXs]\\)" fmt-str)))
+ (string-match "\\([^%]*\\)%\\([dfFlpqxUXs]\\)" fmt-str)))
(let* ((key-str (match-string 2 fmt-str))
(key (string-to-char key-str)))
(setq result
@@ -197,10 +198,17 @@ taken from current buffer, or OPT-BUFFER if non-nil. Some
((eq key ?x)
(or (and src-file-name src-file-name)
"*source-file-not-found-for-%x"))
+
((eq key ?X)
(or (and src-file-name (expand-file-name src-file-name))
"*source-file-not-found-for-%X"))
+ ((eq key ?U)
+ (if (string-match src-file-name "^file://")
+ (setq src-file-name (substring 7)))
+ (or (and src-file-name (expand-file-name src-file-name))
+ "*source-file-not-found-for-%X"))
+
;; ((eq key ?e)
;; (gud-find-expr))
;; ((eq key ?a)
- [elpa] externals/realgud 565ac78 112/140: Adjust for v8 tracebacks inside a debugger console, (continued)
- [elpa] externals/realgud 565ac78 112/140: Adjust for v8 tracebacks inside a debugger console, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 2ae8fbf 111/140: Merge pull request #230 from cranechu/master, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud fa2d601 120/140: cl-seq -> cl-lib, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 5631fa2 115/140: Fix wiki links in README, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud a6783f5 129/140: Add breakpoint buffer tracking to source window, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 3630fef 121/140: keep history in attaching command-buffers ..., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 2a46513 134/140: Some small tweaks, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 2987c80 136/140: Compile linting, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 06d73e1 130/140: remake and gdb breakpoint buffers + add to menu, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 096bd87 088/140: Merge pull request #212 from realgud/filter-lists, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 4d9c31b 119/140: Improve realgud:attach-cmd-buffer...,
Rocky Bernstein <=
- [elpa] externals/realgud 79c982d 124/140: Add a comment, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 0821db0 137/140: Get ready for release 1.4.6, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud c5d52ff 131/140: Add breakpoint-all regexps for most debuggers, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 7c0acdc 140/140: Another pass over function declarations, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 807c066 128/140: Initialize more debuggers with breakpoint buffer information, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 57a8fc1 126/140: Merge pull request #244 from realgud/add-brpt-buffer, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 1cfadb2 123/140: Lots of small changes..., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud d79a090 133/140: Handle location not found in bp-list for breakpoint buffer, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 1ccd8cd 139/140: buffer info org-mode tweaks, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 8028bfb 125/140: Add a breakpoint buffer analogous to backtrace, Rocky Bernstein, 2019/05/25