Subject: bug#8941: which-func-ff-hook should be less noisy

From: Juanma Barranquero <[email-masked]>
Date: Mon, 27 Jun 2011 14:03:16 +0200

In this change,

revno: 102581
committer: Stefan Monnier <[email-masked]>
branch nick: trunk
timestamp: Fri 2010-12-03 19:49:49 -0500
message:
  * lisp/progmodes/which-func.el (which-func-ff-hook): Log the error message.
  (which-func-update-1): Distinguish symbols from strings.
  (which-function): Stay within 80 columns.

there was added this bit

@@ -207,6 +207,7 @@
          (setq imenu--index-alist
                (save-excursion (funcall imenu-create-index-function))))
     (error
+     (message "which-func-ff-hook error: %S" err)
      (setq which-func-mode nil))))

which "logs" the error message. Unfortunately, when you have
`which-func-modes' set to t, you receive that message a lot for what
it is not an error (which-func-mode is simply unsupported in that
buffer / mode).

I don't want to remove it, because I suppose Stefan put it for a
reason. Now, if the reason is simply to log the error in *Messages*,
either doing it directly, or conditionalizing it somehow according to
(eq which-func-modes t) would be better.

If, on the other hand, the intent is to warn the user so s/he adds the
mode to which-func-non-auto-modes (which, IMHO, runs counter to
allowing which-func-modes = t), then I'd suggest to use a delayed
warning

     (push (list 'which-func (error-message-string err) :error)
delayed-warnings-list)

which has the double advantage that it is more visible and can be filtered out.

    Juanma