help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoiding this byte compile warning


From: Tim X
Subject: Re: Avoiding this byte compile warning
Date: Thu, 11 Jan 2007 19:04:45 +1100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux)

"rgb" <rbielaws@i1.net> writes:

> I get the following message if the column-marker feature isn't
> available.
>
> tal-mode.el:1367:26:Warning: the following functions are not known to
> be defined: column-marker-1,  column-marker-2
>
> What's the proper way to code the function below so that it works the
> way I want but doesn't cause a warning?
>
> Thanks.
>
>
> (defun tal-setup-column-markers ()
>   "Turns on column markers if configured and available.
> See `tal-column-marker-1' and `tal-column-marker-2' "
>   (if (condition-case ()
>           (progn (require 'column-marker) nil)
>         (error t))
>       (if (not (and (zerop tal-column-marker-1)
>                     (zerop tal-column-marker-2)))
>           (message "column markers are configured but %s"
>                    " column-marker feature not available."))
>     (setq indent-tabs-mode nil)      ;documented as buffer local
>     (column-marker-1 tal-column-marker-1)
>     (column-marker-2 tal-column-marker-2)))
>

You could try a combination of eval-when-compile and condition-case at the
beginning of your file. e.g. (not tested)

(eval-when-compile
  (condition-case nil
    (require 'blah)
   (error nil)))

Tim

-- 
tcross (at) rapttech dot com dot au


reply via email to

[Prev in Thread] Current Thread [Next in Thread]