]> git.eshelyaron.com Git - emacs.git/commitdiff
(diff-current-defun): If at start of hunk, use
authorKai Großjohann <kgrossjo@eu.uu.net>
Sun, 13 Jun 2004 16:48:44 +0000 (16:48 +0000)
committerKai Großjohann <kgrossjo@eu.uu.net>
Sun, 13 Jun 2004 16:48:44 +0000 (16:48 +0000)
position of first change.

lisp/ChangeLog
lisp/diff-mode.el

index 10376008292b74fb201ff1652fd3fe931eac9066..b810f87a565b8265cc30fc084818fd523d093d46 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-13  Kai Grossjohann  <kai.grossjohann@gmx.net>
+
+       * diff-mode.el (diff-current-defun): If at start of hunk, use
+       position of first change.
+
 2004-06-13  Lars Hansen  <larsh@math.ku.dk>
 
        * dired-x.el (dired-mark-omitted): Bind to "*O".
index 9b00eae050d99fe958d9339fbb3e4c82a6b02c7a..3e6d1b7ac572b4b8daacdc02d3c59a0f7dde5eb1 100644 (file)
@@ -1248,9 +1248,12 @@ If the prefix arg is bigger than 8 (for example with \\[universal-argument] \\[u
 (defun diff-current-defun ()
   "Find the name of function at point.
 For use in `add-log-current-defun-function'."
+    (save-excursion
+      (when (looking-at diff-hunk-header-re)
+       (forward-line 1)
+       (while (and (looking-at " ") (not (zerop (forward-line 1))))))
   (destructuring-bind (buf line-offset pos src dst &optional switched)
       (diff-find-source-location)
-    (save-excursion
       (beginning-of-line)
       (or (when (memq (char-after) '(?< ?-))
            ;; Cursor is pointing at removed text.  This could be a removed