emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: symbol function's definition is null : signum [7.5]
@ 2011-04-13  8:04 Sylvain Beucler
  2011-04-15 22:40 ` Nick Dokos
  0 siblings, 1 reply; 6+ messages in thread
From: Sylvain Beucler @ 2011-04-13  8:04 UTC (permalink / raw)
  To: emacs-orgmode

When using S-<up> to modify a date with an our range in Org 7.5, I get
"symbol function's definition is null : signum".

E.g. <2011-03-10 jeu. 10:30-11:30>

It appears that (org-modify-ts-extra) is using this function, but
unlike in CL isn't not an elisp built-in :)

As a work-around I added an internal defun:
(defun org-modify-ts-extra (s pos n dm)
  "Change the different parts of the lead-time and repeat fields in timestamp."
  (defun signum (x) 
    (cond
     ((> x 0)  1)
     ((< x 0) -1)
     ((= x 0)  0)))
[...]

-- 
Sylvain

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

* Re: Bug: symbol function's definition is null : signum [7.5]
  2011-04-13  8:04 Sylvain Beucler
@ 2011-04-15 22:40 ` Nick Dokos
  2011-04-16  9:30   ` Sylvain Beucler
  2011-06-26 19:32   ` David Maus
  0 siblings, 2 replies; 6+ messages in thread
From: Nick Dokos @ 2011-04-15 22:40 UTC (permalink / raw)
  To: Sylvain Beucler; +Cc: nicholas.dokos, emacs-orgmode

Sylvain Beucler <beuc@beuc.net> wrote:

> When using S-<up> to modify a date with an our range in Org 7.5, I get
> "symbol function's definition is null : signum".
> 
> E.g. <2011-03-10 jeu. 10:30-11:30>
> 
> It appears that (org-modify-ts-extra) is using this function, but
> unlike in CL isn't not an elisp built-in :)
> 
> As a work-around I added an internal defun:
> (defun org-modify-ts-extra (s pos n dm)
>   "Change the different parts of the lead-time and repeat fields in timestamp."
>   (defun signum (x) 
>     (cond
>      ((> x 0)  1)
>      ((< x 0) -1)
>      ((= x 0)  0)))
> [...]
> 

What version of emacs are you using?

For emacs 24 at least, it's defined in cl-extra.el (which is distributed
with emacs itself).  That in turn is loaded when cl is loaded and there
are plenty of places where org does a (require 'cl), e.g. when loading
org.el or org-agenda.el; but it may be that you have found a path in
that does not do so, however unlikely that scenario is.

So you can probably resolve the problem by adding a (require 'cl)
somewhere in your .emacs. But if you can, it would be worthwhile to
figure out how you end up in that situation, so the (require 'cl) can be
added to the appropriate place.

If you are using emacs 23 or earlier, the above might not be applicable,
but you probably can still resolve the problem the same way: adding a
(require 'cl) in your .emacs. If that does not resolve it, then adding a
(require 'cl-extra) as well should certainly do so.

Nick

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

* Re: Bug: symbol function's definition is null : signum [7.5]
  2011-04-15 22:40 ` Nick Dokos
@ 2011-04-16  9:30   ` Sylvain Beucler
  2011-06-26 19:32   ` David Maus
  1 sibling, 0 replies; 6+ messages in thread
From: Sylvain Beucler @ 2011-04-16  9:30 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

On Fri, Apr 15, 2011 at 06:40:51PM -0400, Nick Dokos wrote:
> Sylvain Beucler <beuc@beuc.net> wrote:
> 
> > When using S-<up> to modify a date with an our range in Org 7.5, I get
> > "symbol function's definition is null : signum".
> > 
> > E.g. <2011-03-10 jeu. 10:30-11:30>
> > 
> > It appears that (org-modify-ts-extra) is using this function, but
> > unlike in CL isn't not an elisp built-in :)
> > 
> > As a work-around I added an internal defun:
> > (defun org-modify-ts-extra (s pos n dm)
> >   "Change the different parts of the lead-time and repeat fields in timestamp."
> >   (defun signum (x) 
> >     (cond
> >      ((> x 0)  1)
> >      ((< x 0) -1)
> >      ((= x 0)  0)))
> > [...]
> > 
> 
> What version of emacs are you using?
> 
> For emacs 24 at least, it's defined in cl-extra.el (which is distributed
> with emacs itself).  That in turn is loaded when cl is loaded and there
> are plenty of places where org does a (require 'cl), e.g. when loading
> org.el or org-agenda.el; but it may be that you have found a path in
> that does not do so, however unlikely that scenario is.
> 
> So you can probably resolve the problem by adding a (require 'cl)
> somewhere in your .emacs. But if you can, it would be worthwhile to
> figure out how you end up in that situation, so the (require 'cl) can be
> added to the appropriate place.
> 
> If you are using emacs 23 or earlier, the above might not be applicable,
> but you probably can still resolve the problem the same way: adding a
> (require 'cl) in your .emacs. If that does not resolve it, then adding a
> (require 'cl-extra) as well should certainly do so.

I use 23.2.1 (http://packages.debian.org/squeeze/emacs).  Adding
(require 'el) works.

I tried on another box with the same Emacs (23.2.1 -
http://packages.debian.org/wheezy/emacs) and Org, roughly the same
configuration, and I can't reproduce the problem, so it's a bit of a
mystery for me.

Thanks for your answer.

-- 
Sylvain

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

* Re: Bug: symbol function's definition is null : signum [7.5]
  2011-04-15 22:40 ` Nick Dokos
  2011-04-16  9:30   ` Sylvain Beucler
@ 2011-06-26 19:32   ` David Maus
  1 sibling, 0 replies; 6+ messages in thread
From: David Maus @ 2011-06-26 19:32 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, Sylvain Beucler, bzg

[-- Attachment #1: Type: text/plain, Size: 2860 bytes --]

At Fri, 15 Apr 2011 18:40:51 -0400,
Nick Dokos wrote:
>
> Sylvain Beucler <beuc@beuc.net> wrote:
>
> > When using S-<up> to modify a date with an our range in Org 7.5, I get
> > "symbol function's definition is null : signum".
> >
> > E.g. <2011-03-10 jeu. 10:30-11:30>
> >
> > It appears that (org-modify-ts-extra) is using this function, but
> > unlike in CL isn't not an elisp built-in :)
> >
> > As a work-around I added an internal defun:
> > (defun org-modify-ts-extra (s pos n dm)
> >   "Change the different parts of the lead-time and repeat fields in timestamp."
> >   (defun signum (x)
> >     (cond
> >      ((> x 0)  1)
> >      ((< x 0) -1)
> >      ((= x 0)  0)))
> > [...]
> >
>
> What version of emacs are you using?
>
> For emacs 24 at least, it's defined in cl-extra.el (which is distributed
> with emacs itself).  That in turn is loaded when cl is loaded and there
> are plenty of places where org does a (require 'cl), e.g. when loading
> org.el or org-agenda.el; but it may be that you have found a path in
> that does not do so, however unlikely that scenario is.
>
> So you can probably resolve the problem by adding a (require 'cl)
> somewhere in your .emacs. But if you can, it would be worthwhile to
> figure out how you end up in that situation, so the (require 'cl) can be
> added to the appropriate place.

I can confirm this problem with

Org-mode version 7.5 (release_7.5.456.g4e038)
GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-12-11 on raven, modified by Debian

But only when running byte-compiled code.

The problem is, that signum is called at runtime, but not compile time
but the compiler warning is suppressed by the `org-no-warnings'
macro. For the problem with signum see

commit e144f53c9a7362a65f7f3e924a965da70c9bfd58

The function is not declared inline by cl -- we /could/ override cl's
setting and declare the function inline when compiling:

(eval-when (compile) (proclaim '(inline signum)))

But [[info:cl#Declarations]] states:


         The following declarations are all equivalent.  Note that the
         `defsubst' form is a convenient way to define a function and
         declare it inline all at once.

              (declaim (inline foo bar))
              (eval-when (compile load eval) (proclaim '(inline foo bar)))
              (defsubst foo (...) ...)       ; instead of defun

         *Please note:*  this declaration remains in effect after the
         containing source file is done.  It is correct to use it to
         request that a function you have defined should be inlined, but it
         is impolite to use it to request inlining of an external function.
	 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

So this would be "inpolite".

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]

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

* Re: Bug: symbol function's definition is null : signum [7.5]
@ 2018-10-31 16:09 Jared Windover
  2018-11-01 21:27 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Jared Windover @ 2018-10-31 16:09 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 89 bytes --]

I was still seeing this error. Switching signum to cl-signum in org.el
fixed it.

-Jared

[-- Attachment #2: Type: text/html, Size: 134 bytes --]

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

* Re: Bug: symbol function's definition is null : signum [7.5]
  2018-10-31 16:09 Bug: symbol function's definition is null : signum [7.5] Jared Windover
@ 2018-11-01 21:27 ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2018-11-01 21:27 UTC (permalink / raw)
  To: Jared Windover; +Cc: emacs-orgmode

Hello,

Jared Windover <jaredwindover@gmail.com> writes:

> I was still seeing this error. Switching signum to cl-signum in org.el
> fixed it.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2018-11-01 22:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-31 16:09 Bug: symbol function's definition is null : signum [7.5] Jared Windover
2018-11-01 21:27 ` Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2011-04-13  8:04 Sylvain Beucler
2011-04-15 22:40 ` Nick Dokos
2011-04-16  9:30   ` Sylvain Beucler
2011-06-26 19:32   ` David Maus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).