# HG changeset patch # User Kai Grojohann # Date 1087145324 0 # Node ID efb98a4ceb2b43a63482641bdc28fe961ca69abf # Parent 90a064bbd8225c0289603078e197137982febfe2 (diff-current-defun): If at start of hunk, use position of first change. diff -r 90a064bbd822 -r efb98a4ceb2b lisp/ChangeLog --- a/lisp/ChangeLog Sun Jun 13 15:35:03 2004 +0000 +++ b/lisp/ChangeLog Sun Jun 13 16:48:44 2004 +0000 @@ -1,3 +1,8 @@ +2004-06-13 Kai Grossjohann + + * diff-mode.el (diff-current-defun): If at start of hunk, use + position of first change. + 2004-06-13 Lars Hansen * dired-x.el (dired-mark-omitted): Bind to "*O". diff -r 90a064bbd822 -r efb98a4ceb2b lisp/diff-mode.el --- a/lisp/diff-mode.el Sun Jun 13 15:35:03 2004 +0000 +++ b/lisp/diff-mode.el Sun Jun 13 16:48:44 2004 +0000 @@ -1248,9 +1248,12 @@ (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