From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: Bug: symbol function's definition is null : signum [7.5] Date: Sun, 26 Jun 2011 21:32:24 +0200 Message-ID: <87zkl4l77b.wl%dmaus@ictsoc.de> References: <20110413080410.GA3112@perso.beuc.net> <20159.1302907251@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Sun_Jun_26_21:32:22_2011-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:42492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qav4L-0000wG-2K for emacs-orgmode@gnu.org; Sun, 26 Jun 2011 15:32:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qav4J-00037n-PE for emacs-orgmode@gnu.org; Sun, 26 Jun 2011 15:32:33 -0400 Received: from app1a.xlhost.de ([213.202.242.161]:38440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qav4J-00037d-84 for emacs-orgmode@gnu.org; Sun, 26 Jun 2011 15:32:31 -0400 In-Reply-To: <20159.1302907251@alphaville.americas.hpqcorp.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org, Sylvain Beucler , bzg@altern.org --pgp-sign-Multipart_Sun_Jun_26_21:32:22_2011-1 Content-Type: text/plain; charset=US-ASCII At Fri, 15 Apr 2011 18:40:51 -0400, Nick Dokos wrote: > > Sylvain Beucler wrote: > > > When using S- 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 --pgp-sign-Multipart_Sun_Jun_26_21:32:22_2011-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAk4HiUYACgkQma24O1pEeOaq2AD8C6z4iUX4SLzKdDua5PpFvsEd BXFmecuPhdfhd9gokOEBAIDZgZz8ERITPK4Pwpib8xxa7CWqmf00v59fjG4eaySR =5yfS -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sun_Jun_26_21:32:22_2011-1--