unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* compiler warning "the function X might not be defined at runtime"
@ 2009-02-19 18:48 Samuel Wales
  2009-02-19 18:58 ` Drew Adams
  2009-02-20  4:33 ` Kevin Rodgers
  0 siblings, 2 replies; 7+ messages in thread
From: Samuel Wales @ 2009-02-19 18:48 UTC (permalink / raw)
  To: help-gnu-emacs

What more needs to be done to get rid of that warning?

Thanks.

;;(unless (functionp 'scroll-lock-mode) (defun ...
(require 'scroll-lock)
(eval-when-compile (require 'scroll-lock))
(eval-when (eval load compile) (require 'scroll-lock))
(defun alpha-1 ()
  "even more of a kludge to restore sanity after simultaneous scrolling."
  (interactive)
  (one-window)
  (require 'scroll-lock)
  (scroll-lock-mode 0))

-- 
Myalgic encephalomyelitis denialism is causing death (decades early;
Jason et al. 2006) and severe suffering, pain, and disability (worse
than most other serious diseases studied; Schweitzer et al. 1995) and
grossly corrupting science.
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm




^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: compiler warning "the function X might not be defined at runtime"
  2009-02-19 18:48 compiler warning "the function X might not be defined at runtime" Samuel Wales
@ 2009-02-19 18:58 ` Drew Adams
  2009-02-19 20:20   ` Samuel Wales
  2009-02-20  4:33 ` Kevin Rodgers
  1 sibling, 1 reply; 7+ messages in thread
From: Drew Adams @ 2009-02-19 18:58 UTC (permalink / raw)
  To: 'Samuel Wales', help-gnu-emacs

> From: Samuel Wales Sent: Thursday, February 19, 2009 10:48 AM
> What more needs to be done to get rid of that warning?

I believe that, starting with Emacs 23, you can use `declare-function' to tell
the byte-compiler which library the function is defined in (and what its
arguments are). See the Elisp manual, node Declaring Functions.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: compiler warning "the function X might not be defined at runtime"
  2009-02-19 18:58 ` Drew Adams
@ 2009-02-19 20:20   ` Samuel Wales
  0 siblings, 0 replies; 7+ messages in thread
From: Samuel Wales @ 2009-02-19 20:20 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

Thanks.

I should have mentioned that I use emacs 22, so I can't use
declare-function, because it says it does nothing.

I am curious why that function (only).




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: compiler warning "the function X might not be defined at runtime"
  2009-02-19 18:48 compiler warning "the function X might not be defined at runtime" Samuel Wales
  2009-02-19 18:58 ` Drew Adams
@ 2009-02-20  4:33 ` Kevin Rodgers
  2009-02-20  4:35   ` Kevin Rodgers
  2009-02-20  6:13   ` Samuel Wales
  1 sibling, 2 replies; 7+ messages in thread
From: Kevin Rodgers @ 2009-02-20  4:33 UTC (permalink / raw)
  To: help-gnu-emacs

Samuel Wales wrote:
> What more needs to be done to get rid of that warning?
> 
> Thanks.
> 
> ;;(unless (functionp 'scroll-lock-mode) (defun ...
> (require 'scroll-lock)
> (eval-when-compile (require 'scroll-lock))
> (eval-when (eval load compile) (require 'scroll-lock))
> (defun alpha-1 ()
>   "even more of a kludge to restore sanity after simultaneous scrolling."
>   (interactive)
>   (one-window)
>   (require 'scroll-lock)
>   (scroll-lock-mode 0))

How are you calling scroll-lock-mode and how are you compiling the file?

I don't get any warnings with M-x byte-compile-file in emacs 23.2,
started with -Q,  on this file:

-------- foo.el --------
(defun foo ()
   (scroll-lock-mode 0))
-------- foo.el --------

-- 
Kevin Rodgers
Denver, Colorado, USA





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: compiler warning "the function X might not be defined at runtime"
  2009-02-20  4:33 ` Kevin Rodgers
@ 2009-02-20  4:35   ` Kevin Rodgers
  2009-02-20  6:13   ` Samuel Wales
  1 sibling, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2009-02-20  4:35 UTC (permalink / raw)
  To: help-gnu-emacs

Kevin Rodgers wrote:
> Samuel Wales wrote:
>> What more needs to be done to get rid of that warning?
>>
>> Thanks.
>>
>> ;;(unless (functionp 'scroll-lock-mode) (defun ...
>> (require 'scroll-lock)
>> (eval-when-compile (require 'scroll-lock))
>> (eval-when (eval load compile) (require 'scroll-lock))
>> (defun alpha-1 ()
>>   "even more of a kludge to restore sanity after simultaneous scrolling."
>>   (interactive)
>>   (one-window)
>>   (require 'scroll-lock)
>>   (scroll-lock-mode 0))
> 
> How are you calling scroll-lock-mode and how are you compiling the file?
> 
> I don't get any warnings with M-x byte-compile-file in emacs 23.2,
> started with -Q,  on this file:
> 
> -------- foo.el --------
> (defun foo ()
>   (scroll-lock-mode 0))
> -------- foo.el --------

I meant emacs 22.3 of course.

-- 
Kevin Rodgers
Denver, Colorado, USA





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: compiler warning "the function X might not be defined at runtime"
  2009-02-20  4:33 ` Kevin Rodgers
  2009-02-20  4:35   ` Kevin Rodgers
@ 2009-02-20  6:13   ` Samuel Wales
  2009-02-20 11:10     ` Kevin Rodgers
  1 sibling, 1 reply; 7+ messages in thread
From: Samuel Wales @ 2009-02-20  6:13 UTC (permalink / raw)
  To: Kevin Rodgers; +Cc: help-gnu-emacs

On Thu, Feb 19, 2009 at 21:33, Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
> How are you calling scroll-lock-mode and how are you compiling the file?

I am not calling it except as above and with a similar function with
the argument 1 instead of 0.

Also this, but it should be irrelevant.

(define-key global-map [(control shift up)]
  'scroll-lock-previous-line)
(define-key global-map [(control shift down)] 'scroll-lock-next-line)

Same as you.

GNU Emacs 22.2.1 Carbon.

Thanks.

-- 
Myalgic encephalomyelitis denialism is causing death (decades early;
Jason et al. 2006) and severe suffering, pain, and disability (worse
than nearly all other serious diseases studied; Schweitzer et al.
1995) and grossly corrupting science.  *Anybody* can get the disease.
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: compiler warning "the function X might not be defined at runtime"
  2009-02-20  6:13   ` Samuel Wales
@ 2009-02-20 11:10     ` Kevin Rodgers
  0 siblings, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2009-02-20 11:10 UTC (permalink / raw)
  To: help-gnu-emacs

Samuel Wales wrote:
> On Thu, Feb 19, 2009 at 21:33, Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
>> How are you calling scroll-lock-mode and how are you compiling the file?
> 
> I am not calling it except as above and with a similar function with
> the argument 1 instead of 0.
> 
> Also this, but it should be irrelevant.
> 
> (define-key global-map [(control shift up)]
>   'scroll-lock-previous-line)
> (define-key global-map [(control shift down)] 'scroll-lock-next-line)
> 
> Same as you.
> 
> GNU Emacs 22.2.1 Carbon.

So is X (in your subject) scroll-lock-mode, scroll-lock-previous-line,
or scroll-lock-next-line?

If X is a scroll-lock-*-line function, do those define-key forms occur
at top level, or within a top level defun, or where?

-- 
Kevin Rodgers
Denver, Colorado, USA





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-02-20 11:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-19 18:48 compiler warning "the function X might not be defined at runtime" Samuel Wales
2009-02-19 18:58 ` Drew Adams
2009-02-19 20:20   ` Samuel Wales
2009-02-20  4:33 ` Kevin Rodgers
2009-02-20  4:35   ` Kevin Rodgers
2009-02-20  6:13   ` Samuel Wales
2009-02-20 11:10     ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).