From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: Avoiding this byte compile warning Date: 11 Jan 2007 09:46:56 -0800 Organization: http://groups.google.com Message-ID: <1168537616.398058.252520@o58g2000hsb.googlegroups.com> References: <1168446868.216149.54390@k58g2000hse.googlegroups.com> <87sleidm5e.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1168540846 21953 80.91.229.12 (11 Jan 2007 18:40:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 11 Jan 2007 18:40:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 11 19:40:44 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H54qx-0003J5-QN for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Jan 2007 19:40:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H54qx-0003PZ-Ik for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Jan 2007 13:40:43 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!o58g2000hsb.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 61 Original-NNTP-Posting-Host: 168.208.215.220 Original-X-Trace: posting.google.com 1168537618 2427 127.0.0.1 (11 Jan 2007 17:46:58 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 11 Jan 2007 17:46:58 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: o58g2000hsb.googlegroups.com; posting-host=168.208.215.220; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:144638 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:40243 Archived-At: Tim X wrote: > "rgb" 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