emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Make `org-contacts-message-complete-function' work with byte compilation
@ 2013-03-10  1:25 Frank Terbeck
  2013-03-10 23:24 ` Daimrod
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Terbeck @ 2013-03-10  1:25 UTC (permalink / raw)
  To: emacs-orgmode

Without this patch (when I am _byte-compiling_ org-contacts.el), I am
getting error messages like this (when attempting address completion via
`completion-at-point' and `org-contacts-message-complete-function'):

    Symbol's function definition is void: remove-duplicates
    Symbol's function definition is void: some

With this patch, it seems to be working as expected.
---

Disclaimer: I'm no Elisp expert. Maybe this should be solved
differently.

 contrib/lisp/org-contacts.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index ab44a7b..ac5ff6d 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -36,10 +36,8 @@
 ;;
 ;;; Code:
 
-(eval-when-compile
-  (require 'cl))
-
 (eval-and-compile
+  (require 'cl)
   (require 'org))
 (require 'gnus-util)
 (require 'gnus-art)
-- 
1.8.2.rc1

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

* Re: [PATCH] Make `org-contacts-message-complete-function' work with byte compilation
  2013-03-10  1:25 [PATCH] Make `org-contacts-message-complete-function' work with byte compilation Frank Terbeck
@ 2013-03-10 23:24 ` Daimrod
  2013-03-11  6:48   ` Achim Gratz
  0 siblings, 1 reply; 6+ messages in thread
From: Daimrod @ 2013-03-10 23:24 UTC (permalink / raw)
  To: Frank Terbeck; +Cc: emacs-orgmode

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

Frank Terbeck <ft@bewatermyfriend.org> writes:

Hi Frank,

Thank you for the report; however, I'm unsure about the right solution.

There is a problem with the current (eval-when-compile ...) but there
are still warnings when I compile it (with emacs -batch -f batch-byte-compile).

> In org-contacts-db-need-update-p:
> org-contacts.el:169:14:Warning: function `some' from cl package called at
>     runtime
> 
> In org-contacts-filter:
> org-contacts.el:211:37:Warning: function `some' from cl package called at
>     runtime
> 
> In org-contacts-test-completion-prefix:
> org-contacts.el:373:12:Warning: function `find-if' from cl package called at
>     runtime
> 
> In org-contacts-complete-name:
> org-contacts.el:445:71:Warning: function `remove-duplicates' from cl package
>     called at runtime

Those warnings disapear if I simply (require 'cl) at toplevel but it
triggers this warning:

> org-contacts.el:40:1:Warning: cl package required at runtime

@All: Can I use (require 'cl) and ignore the warning or is there better
solution?

-- 
Daimrod/Greg

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

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

* Re: [PATCH] Make `org-contacts-message-complete-function' work with byte compilation
  2013-03-10 23:24 ` Daimrod
@ 2013-03-11  6:48   ` Achim Gratz
  2013-03-11  9:21     ` Daimrod
  0 siblings, 1 reply; 6+ messages in thread
From: Achim Gratz @ 2013-03-11  6:48 UTC (permalink / raw)
  To: emacs-orgmode

Daimrod writes:
> @All: Can I use (require 'cl) and ignore the warning or is there better
> solution?

You could if this would never go into mainline, where it is not allowed
due to the namespace pollution that cl causes.  You could use cl-lib
instead, but then this would be an Emacs-24 only solution.  In general,
the stanza ((eval-when-compile (require 'cl)) only works as intended
when you are only using cl macros, but you seem to use defuns.  You
could check how hard it is to replace these with plain elisp, aside from
syntactical inconveniences this is usually not a big problem.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf Blofeld V1.15B11:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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

* Re: [PATCH] Make `org-contacts-message-complete-function' work with byte compilation
  2013-03-11  6:48   ` Achim Gratz
@ 2013-03-11  9:21     ` Daimrod
  2013-03-11 13:48       ` Frank Terbeck
  2013-03-11 15:55       ` Bastien
  0 siblings, 2 replies; 6+ messages in thread
From: Daimrod @ 2013-03-11  9:21 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

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

Achim Gratz <Stromeko@nexgo.de> writes:

> Daimrod writes:
>> @All: Can I use (require 'cl) and ignore the warning or is there better
>> solution?
>
> You could if this would never go into mainline, where it is not allowed
> due to the namespace pollution that cl causes.  You could use cl-lib
> instead, but then this would be an Emacs-24 only solution.  In general,
> the stanza ((eval-when-compile (require 'cl)) only works as intended
> when you are only using cl macros, but you seem to use defuns.  You
> could check how hard it is to replace these with plain elisp, aside from
> syntactical inconveniences this is usually not a big problem.

I've done this, thanks for the advice.

> Regards,
> Achim.

-- 
Daimrod/Greg

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

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

* Re: [PATCH] Make `org-contacts-message-complete-function' work with byte compilation
  2013-03-11  9:21     ` Daimrod
@ 2013-03-11 13:48       ` Frank Terbeck
  2013-03-11 15:55       ` Bastien
  1 sibling, 0 replies; 6+ messages in thread
From: Frank Terbeck @ 2013-03-11 13:48 UTC (permalink / raw)
  To: emacs-orgmode

Daimrod wrote:
> Achim Gratz <Stromeko@nexgo.de> writes:
>> Daimrod writes:
>>> @All: Can I use (require 'cl) and ignore the warning or is there better
>>> solution?
>>
>> You could if this would never go into mainline, where it is not allowed
>> due to the namespace pollution that cl causes.  You could use cl-lib
>> instead, but then this would be an Emacs-24 only solution.  In general,
>> the stanza ((eval-when-compile (require 'cl)) only works as intended
>> when you are only using cl macros, but you seem to use defuns.  You
>> could check how hard it is to replace these with plain elisp, aside from
>> syntactical inconveniences this is usually not a big problem.
>
> I've done this, thanks for the advice.


I've just given the latest git HEAD version a spin and it seems to work
as expected. Thanks for taking an interesting and fixing this so
promptly. ;)


Regards, Frank

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

* Re: [PATCH] Make `org-contacts-message-complete-function' work with byte compilation
  2013-03-11  9:21     ` Daimrod
  2013-03-11 13:48       ` Frank Terbeck
@ 2013-03-11 15:55       ` Bastien
  1 sibling, 0 replies; 6+ messages in thread
From: Bastien @ 2013-03-11 15:55 UTC (permalink / raw)
  To: Daimrod; +Cc: Achim Gratz, emacs-orgmode

Daimrod <daimrod@gmail.com> writes:

> I've done this, thanks for the advice.

Thanks for fixing this!  And to Achim for the useful directions.

-- 
 Bastien

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

end of thread, other threads:[~2013-03-11 15:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-10  1:25 [PATCH] Make `org-contacts-message-complete-function' work with byte compilation Frank Terbeck
2013-03-10 23:24 ` Daimrod
2013-03-11  6:48   ` Achim Gratz
2013-03-11  9:21     ` Daimrod
2013-03-11 13:48       ` Frank Terbeck
2013-03-11 15:55       ` Bastien

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