[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Avoiding this byte compile warning
From: |
rgb |
Subject: |
Re: Avoiding this byte compile warning |
Date: |
11 Jan 2007 09:46:56 -0800 |
User-agent: |
G2/1.0 |
Tim X wrote:
> "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)))
>
Thanks, yes, I did try
I changed it to look like this:
(eval-when-compile (require 'column-marker () t))
(defun tal-setup-column-markers ()
"Turns on column markers if configured and available.
See `tal-column-marker-1' and `tal-column-marker-2' "
(unless (and (zerop tal-column-marker-1)
(zerop tal-column-marker-2))
(if (featurep 'column-marker)
(progn (setq indent-tabs-mode nil) ;documented as buffer local
(column-marker-1 tal-column-marker-1)
(column-marker-2 tal-column-marker-2))
(message "column markers are configured but %s"
" column-marker feature is not available."))))
But that just results in a different warning
tal-mode.el:1366:26:Warning: the following functions might not be
defined at runtime: column-marker-1, column-marker-2