git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-blame.el: Fix compilation warnings.
@ 2012-01-12 15:44 Rüdiger Sonderfeld
  2012-01-12 16:26 ` Jonathan Nieder
  2012-06-10  7:38 ` [PATCH] git-blame.el: use mapc instead of mapcar Jonathan Nieder
  0 siblings, 2 replies; 18+ messages in thread
From: Rüdiger Sonderfeld @ 2012-01-12 15:44 UTC (permalink / raw)
  To: git; +Cc: davidk

From 4958c1b43d7a66654e15c92cbb878b38533d626e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=BCdiger=20Sonderfeld?= <ruediger@c-plusplus.de>
Date: Thu, 12 Jan 2012 16:37:06 +0100
Subject: [PATCH] git-blame.el: Fix compilation warnings.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Replace mapcar with mapc because accumulation of the results was not
needed. (git-blame-cleanup)

Replace two occurrences of (save-excursion (set-buffer buf) ...)
with (with-current-buffer buf ...). (git-blame-filter and
git-blame-create-overlay)

Replace goto-line with (goto-char (point-min)) (forward-line (1-
start-line)). According to the documentation of goto-line it should
not be called from elisp code. (git-blame-create-overlay)

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
---
 contrib/emacs/git-blame.el |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el
index d351cfb..2e53fc6 100644
--- a/contrib/emacs/git-blame.el
+++ b/contrib/emacs/git-blame.el
@@ -304,7 +304,7 @@ See also function `git-blame-mode'."
 
 (defun git-blame-cleanup ()
   "Remove all blame properties"
-    (mapcar 'delete-overlay git-blame-overlays)
+    (mapc 'delete-overlay git-blame-overlays)
     (setq git-blame-overlays nil)
     (remove-git-blame-text-properties (point-min) (point-max)))
 
@@ -337,8 +337,7 @@ See also function `git-blame-mode'."
 (defvar in-blame-filter nil)
 
 (defun git-blame-filter (proc str)
-  (save-excursion
-    (set-buffer (process-buffer proc))
+  (with-current-buffer (process-buffer proc)
     (goto-char (process-mark proc))
     (insert-before-markers str)
     (goto-char 0)
@@ -385,11 +384,10 @@ See also function `git-blame-mode'."
           info))))
 
 (defun git-blame-create-overlay (info start-line num-lines)
-  (save-excursion
-    (set-buffer git-blame-file)
+  (with-current-buffer git-blame-file
     (let ((inhibit-point-motion-hooks t)
           (inhibit-modification-hooks t))
-      (goto-line start-line)
+      (goto-char (point-min)) (forward-line (1- start-line))
       (let* ((start (point))
              (end (progn (forward-line num-lines) (point)))
              (ovl (make-overlay start end))
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-06-14  9:38 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-12 15:44 [PATCH] git-blame.el: Fix compilation warnings Rüdiger Sonderfeld
2012-01-12 16:26 ` Jonathan Nieder
2012-01-12 17:08   ` Rüdiger Sonderfeld
2012-01-13 23:31     ` Sending patches with KMail (Re: [PATCH] git-blame.el: Fix compilation warnings.) Jonathan Nieder
2012-01-14  0:59       ` Junio C Hamano
2012-01-14 18:31         ` Sending patches with KMail Jonathan Nieder
2012-01-14 18:34           ` Jonathan Nieder
2012-01-15  2:14           ` Junio C Hamano
2012-01-14 19:18         ` Sending patches with KMail (Re: [PATCH] git-blame.el: Fix compilation warnings.) Rüdiger Sonderfeld
2012-06-10  7:38 ` [PATCH] git-blame.el: use mapc instead of mapcar Jonathan Nieder
2012-06-10 11:58   ` [PATCH 1/3] git-blame.el: Do not use goto-line in lisp code Lawrence Mitchell
2012-06-10 11:58     ` [PATCH 2/3] git-blame.el: Use with-current-buffer where appropriate Lawrence Mitchell
2012-06-10 11:58       ` [PATCH 3/3] git-blame.el: Do not use bare 0 to mean (point-min) Lawrence Mitchell
2012-06-14  5:08     ` [PATCH 1/3] git-blame.el: Do not use goto-line in lisp code Jonathan Nieder
2012-06-14  9:14       ` Lawrence Mitchell
2012-06-14  9:37         ` [PATCH v2 " Lawrence Mitchell
2012-06-14  9:37           ` [PATCH v2 2/3] git-blame.el: Use with-current-buffer where appropriate Lawrence Mitchell
2012-06-14  9:38             ` [PATCH v2 3/3] git-blame.el: Do not use bare 0 to mean (point-min) Lawrence Mitchell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).