]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve ediff and which-func integration.
authorJack Duthen <duthen.mac.01@gmail.com>
Sun, 3 Jun 2012 11:10:44 +0000 (19:10 +0800)
committerChong Yidong <cyd@gnu.org>
Sun, 3 Jun 2012 11:10:44 +0000 (19:10 +0800)
* lisp/progmodes/which-func.el (which-func-update-ediff-windows): New
function.  Use it in ediff-select-hook.

Fixes: debbugs:11478
lisp/ChangeLog
lisp/progmodes/which-func.el

index 0efca43be1e91fbf9354c8dd0a82af4df443c7ab..4794fbe25958771a078575288d8089da8622a941 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-03  Jack Duthen  <duthen.mac.01@gmail.com>  (tiny change)
+
+       * progmodes/which-func.el (which-func-update-ediff-windows): New
+       function.  Use it in ediff-select-hook (Bug#11478).
+
 2012-06-03  Chong Yidong  <cyd@gnu.org>
 
        * bindings.el: Remove explicit help text from format-mode-line.
index 1c3c6a95774523edea67662475cb421655355225..d5c8a1c6792d69d4a67ffa4295cb19675fe39a96 100644 (file)
@@ -337,6 +337,22 @@ If no function name is found, return nil."
          (funcall which-func-cleanup-function name)
        name))))
 
+\f
+;;; Integration with other packages
+
+(defun which-func-update-ediff-windows ()
+  "Update Which-Function mode display for Ediff windows.
+This function is meant to be called from `ediff-select-hook'."
+  (when (eq major-mode 'ediff-mode)
+    (when ediff-window-A
+      (which-func-update-1 ediff-window-A))
+    (when ediff-window-B
+      (which-func-update-1 ediff-window-B))
+    (when ediff-window-C
+      (which-func-update-1 ediff-window-C))))
+
+(add-hook 'ediff-select-hook 'which-func-update-ediff-windows)
+
 (provide 'which-func)
 
 ;;; which-func.el ends here