emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 66abb81 14/56: Tidy code a little


From: Rocky Bernstein
Subject: [elpa] master 66abb81 14/56: Tidy code a little
Date: Sat, 27 May 2017 05:02:30 -0400 (EDT)

branch: master
commit 66abb81ba82300467864d12a11f8b13e9a06ce2a
Author: rocky <address@hidden>
Commit: rocky <address@hidden>

    Tidy code a little
---
 realgud/common/file.el   | 9 ++++-----
 realgud/common/helper.el | 5 +++--
 realgud/common/track.el  | 2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/realgud/common/file.el b/realgud/common/file.el
index 2bcefde..cd27057 100644
--- a/realgud/common/file.el
+++ b/realgud/common/file.el
@@ -106,7 +106,7 @@ problem as best as we can determine."
       (if (file-readable-p filename)
          (if (integerp line-number)
              (if (> line-number 0)
-                 (lexical-let ((line-count))
+                 (let ((line-count))
                    (if (setq line-count (realgud:file-line-count filename))
                        (if (> line-count line-number)
                            (let* ((column-number
@@ -114,7 +114,6 @@ problem as best as we can determine."
                                                                    line-number
                                                                    
source-text))
                                   (source-buffer (find-file-noselect filename))
-                                  (loc)
                                   (source-mark))
 
                              ;; And you thought we'd never get around to
@@ -123,7 +122,6 @@ problem as best as we can determine."
                                (goto-char (point-min))
                                ;; FIXME also allow column number and byte 
offset
                                (forward-line (1- line-number))
-                               (setq source-mark (point-marker))
                                (make-realgud-loc
                                      :num           bp-num
                                      :cmd-marker    cmd-marker
@@ -131,8 +129,9 @@ problem as best as we can determine."
                                      :line-number   line-number
                                      :column-number column-number
                                      :source-text   source-text
-                                     :marker        source-mark)
-                                    ))
+                                     :marker        (point-marker)
+                                     )
+                               ))
                          ;; else
                          (format "File %s has only %d lines. (Line %d 
requested.)"
                                  filename line-count line-number))
diff --git a/realgud/common/helper.el b/realgud/common/helper.el
index 7467b2b..95c61ec 100644
--- a/realgud/common/helper.el
+++ b/realgud/common/helper.el
@@ -55,8 +55,9 @@ function FN-SYM."
   (not (buffer-live-p buffer)))
 
 (defmacro with-current-buffer-safe (buffer &rest body)
-  "Check that BUFFER has not been deleted before calling
-`with-current-buffer'. If it has been deleted return nil."
+  "Check that BUFFER is not nil and has not been deleted before
+calling `with-current-buffer'. If it has been deleted return
+nil."
   (declare (indent 1) (debug t))
   `(if (or (not ,buffer) (buffer-killed? ,buffer))
        nil
diff --git a/realgud/common/track.el b/realgud/common/track.el
index 17d0341..f26a0ed 100644
--- a/realgud/common/track.el
+++ b/realgud/common/track.el
@@ -506,7 +506,7 @@ Otherwise return nil. CMD-MARK is set in the realgud-loc 
object created.
                                         ;; else
                                         (let ((loc loc-or-error))
                                           ;; Add breakpoint to list of 
breakpoints
-                                          (with-current-buffer (marker-buffer 
(realgud-loc-marker loc))
+                                          (with-current-buffer-safe 
(marker-buffer (realgud-loc-marker loc))
                                             (realgud-bp-add-info loc))
 
                                           (realgud-cmdbuf-info-bp-list=



reply via email to

[Prev in Thread] Current Thread [Next in Thread]