[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2def5fc 20/56: Customizable "search for this (relative) bp
From: |
Rocky Bernstein |
Subject: |
[elpa] master 2def5fc 20/56: Customizable "search for this (relative) bp file" |
Date: |
Sat, 27 May 2017 05:02:31 -0400 (EDT) |
branch: master
commit 2def5fc61562af6a1ff9a4172b2d7160b53bd322
Author: Felipe Lema <address@hidden>
Commit: Felipe Lema <address@hidden>
Customizable "search for this (relative) bp file"
I personally don't like `compilation-find-file` prompting me at
the start of every gdb session when it can't find a relative
breakpoint in a large code base at a separate folder.
---
realgud/common/file.el | 48 +++++++++++++++++++++++++++---------------------
1 file changed, 27 insertions(+), 21 deletions(-)
diff --git a/realgud/common/file.el b/realgud/common/file.el
index cd27057..82f4017 100644
--- a/realgud/common/file.el
+++ b/realgud/common/file.el
@@ -23,11 +23,15 @@
value is associated filesystem string presumably in the
filesystem")
+
(declare-function realgud:strip 'realgud)
(declare-function realgud-loc-goto 'realgud-loc)
(declare-function buffer-killed? 'helper)
(declare-function compilation-find-file 'compile)
+(defcustom realgud-file-find-function 'compilation-find-file
+ "Function to call when we can't easily find file")
+
(defun realgud:file-line-count(filename)
"Return the number of lines in file FILENAME, or nil FILENAME can't be
found"
@@ -76,30 +80,32 @@ problem as best as we can determine."
(unless (and filename (file-readable-p filename))
(if find-file-fn
- (setq filename (funcall find-file-fn filename))
+ (setq filename (funcall find-file-fn filename))
;; FIXME: Remove the below by refactoring to use the above find-file-fn
;; else
(if (and ignore-file-re (string-match ignore-file-re filename))
- (message "tracking ignored for psuedo-file %s" filename)
- ;; else
- (let ((remapped-filename))
- (if (gethash filename realgud-file-remap)
- (progn
- (setq remapped-filename (gethash filename realgud-file-remap))
- (if (file-exists-p remapped-filename)
- (setq filename remapped-filename)
- (remhash filename realgud-file-remap)))
- ;; else
- (progn
- (setq remapped-filename
- (buffer-file-name
- (compilation-find-file (point-marker) filename directory)))
- (when (and remapped-filename (file-exists-p remapped-filename))
- (puthash filename remapped-filename realgud-file-remap)
- (setq filename remapped-filename)
- )
- )))
- )
+ (message "tracking ignored for psuedo-file %s" filename)
+ ;; else
+ (let ((remapped-filename))
+ (if (gethash filename realgud-file-remap)
+ (progn
+ (setq remapped-filename (gethash filename realgud-file-remap))
+ (if (file-exists-p remapped-filename)
+ (setq filename remapped-filename)
+ (remhash filename realgud-file-remap)))
+ ;; else
+ (progn
+ (let ((found-file (funcall realgud-file-find-function
(point-marker) filename directory)))
+ (when found-file
+ (setq remapped-filename
+ (buffer-file-name
+ found-file))
+ (when (and remapped-filename (file-exists-p
remapped-filename))
+ (puthash filename remapped-filename realgud-file-remap)
+ (setq filename remapped-filename)
+ ))
+ ))))
+ )
;; FIXME: remove above -----------------------------------.
))
(if filename
- [elpa] master updated (a2383c7 -> a6701db), Rocky Bernstein, 2017/05/27
- [elpa] master 6d2a92e 01/56: configure.ac: default lispdir relative to prefix, Rocky Bernstein, 2017/05/27
- [elpa] master 8ee7a26 02/56: Merge pull request #145 from dunn/make_install, Rocky Bernstein, 2017/05/27
- [elpa] master 905216f 06/56: Bp tracking respects custom filename lookup ..., Rocky Bernstein, 2017/05/27
- [elpa] master 697daeb 13/56: Tidy code a little, Rocky Bernstein, 2017/05/27
- [elpa] master e62aed9 16/56: describe-variable links to cmd-buf non-nil value, Rocky Bernstein, 2017/05/27
- [elpa] master 1959804 10/56: Small docstring clarification, Rocky Bernstein, 2017/05/27
- [elpa] master 5faeb71 09/56: realgud:cmdbuf-buffers-describe shows field names, Rocky Bernstein, 2017/05/27
- [elpa] master 66abb81 14/56: Tidy code a little, Rocky Bernstein, 2017/05/27
- [elpa] master 2def5fc 20/56: Customizable "search for this (relative) bp file",
Rocky Bernstein <=
- [elpa] master bbdeb4e 19/56: Fixes issue #33, Rocky Bernstein, 2017/05/27
- [elpa] master 7323aa7 04/56: Fix up "make dist", Rocky Bernstein, 2017/05/27
- [elpa] master 70f8b03 05/56: Hoist remove-ansi-schmutz above just js, Rocky Bernstein, 2017/05/27
- [elpa] master 7e1db94 07/56: file remapping changes, Rocky Bernstein, 2017/05/27
- [elpa] master cd61c06 15/56: Tidy a bit, Rocky Bernstein, 2017/05/27
- [elpa] master 447ab36 08/56: host removing ansi-schmutz to mode setting., Rocky Bernstein, 2017/05/27
- [elpa] master 9df42fe 12/56: Towards tracking breakpoints more often, Rocky Bernstein, 2017/05/27
- [elpa] master 4246e34 17/56: Merge pull request #150 from realgud/breakpoint-display, Rocky Bernstein, 2017/05/27
- [elpa] master 0fd9f62 35/56: lint on test, Rocky Bernstein, 2017/05/27
- [elpa] master 52d6b82 23/56: Closer to getting column info used, Rocky Bernstein, 2017/05/27