a paid nerd
a paid nerd

Reputation: 31502

How do I hide Emacs' "obsolete variable" warnings?

I've upgraded to Emacs 23.3 and now the *Compile-Log* buffer opens constantly with errors like:

Warning: `font-lock-beginning-of-syntax-function' is an obsolete variable (as
    of Emacs 23.3); use `syntax-begin-function' instead.

I'm assuming the upstream authors will take care of these warnings in the future. Until then, how can I prevent these errors from appearing and opening a new window?

Upvotes: 19

Views: 6405

Answers (4)

sabof
sabof

Reputation: 8192

Phils's solution didn't work for me for some reason. Here's a more low-level way to do it.

(remprop 'flet 'byte-obsolete-info)
(remprop 'labels 'byte-obsolete-info)

Upvotes: 0

ftzdomino
ftzdomino

Reputation: 71

I fixed it by running this on the elisp:

sed -i.bak 's/font-lock-beginning-of-syntax-function/syntax-begin-function/g' `find . -name '*.el' -exec grep -l 'font-lock-beginning-of-syntax-function' {} \;` 

Upvotes: 4

phils
phils

Reputation: 73236

I'm currently back on 23.2 due to another issue, but I hacked a workaround for this issue while I was trying 23.3. It simply prevents the variable from being considered obsolete, but until Mumamo sorts itself out, that seemed preferable!

;; Mumamo is making emacs 23.3 freak out:
(when (and (equal emacs-major-version 23)
           (equal emacs-minor-version 3))
  (eval-after-load "bytecomp"
    '(add-to-list 'byte-compile-not-obsolete-vars
                  'font-lock-beginning-of-syntax-function))
  ;; tramp-compat.el clobbers this variable!
  (eval-after-load "tramp-compat"
    '(add-to-list 'byte-compile-not-obsolete-vars
                  'font-lock-beginning-of-syntax-function)))

Upvotes: 22

Sandro Munda
Sandro Munda

Reputation: 41030

There are four levels of options for the warnings :

  • warning-minimum-level
  • warning-minimum-log-level
  • warning-suppress-types
  • warning-suppress-log-types

There are more information on the Emacs Manual.

Upvotes: 7

Related Questions