;;; which-func.el --- print current function in mode line
-;; Copyright (C) 1994, 1997-1998, 2001-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1997-1998, 2001-2014 Free Software Foundation,
+;; Inc.
;; Author: Alex Rezinsky <alexr@msil.sps.mot.com>
;; (doesn't seem to be responsive any more)
(defconst which-func-current
'(:eval (replace-regexp-in-string
"%" "%%"
- (gethash (selected-window) which-func-table which-func-unknown))))
+ (or (gethash (selected-window) which-func-table)
+ which-func-unknown))))
;;;###autoload (put 'which-func-current 'risky-local-variable t)
(defvar which-func-mode nil
(when (and (null name)
(boundp 'imenu--index-alist) (null imenu--index-alist)
(null which-function-imenu-failed))
- (imenu--make-index-alist t)
+ (ignore-errors (imenu--make-index-alist t))
(unless imenu--index-alist
(set (make-local-variable 'which-function-imenu-failed) t)))
;; If we have an index alist, use it.
namestack (cons (car pair) namestack)
alist (cdr pair)))
- ((number-or-marker-p (setq mark (cdr pair)))
+ ((or (number-or-marker-p (setq mark (cdr pair)))
+ (and (overlayp mark)
+ (setq mark (overlay-start mark))))
(when (and (>= (setq offset (- (point) mark)) 0)
(< offset minoffset)) ; Find the closest item.
(setq minoffset offset
\f
;;; Integration with other packages
+(defvar ediff-window-A)
+(defvar ediff-window-B)
+(defvar ediff-window-C)
+
(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'."