unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Adapting code to cl-lib
@ 2013-12-29 23:18 João Távora
  2013-12-30  7:15 ` Thierry Volpiatto
  0 siblings, 1 reply; 7+ messages in thread
From: João Távora @ 2013-12-29 23:18 UTC (permalink / raw)
  To: help-gnu-emacs

Does anyone know of a package or something that gets rid of these
warnings:

   foo.el:2266:57:Warning: function `find' from cl package called at runtime
   foo.el:2370:63:Warning: function `remove*' from cl package called at runtime
   foo.el:2370:63:Warning: function `gensym' from cl package called at runtime

by replacing them with their cl- counterpairs from cl-lib?

João
   




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

* Re: Adapting code to cl-lib
  2013-12-29 23:18 Adapting code to cl-lib João Távora
@ 2013-12-30  7:15 ` Thierry Volpiatto
  2013-12-30 12:39   ` João Távora
  0 siblings, 1 reply; 7+ messages in thread
From: Thierry Volpiatto @ 2013-12-30  7:15 UTC (permalink / raw)
  To: help-gnu-emacs

joaotavora@gmail.com (João Távora) writes:

> Does anyone know of a package or something that gets rid of these
> warnings:
>
>    foo.el:2266:57:Warning: function `find' from cl package called at runtime
>    foo.el:2370:63:Warning: function `remove*' from cl package called at runtime
>    foo.el:2370:63:Warning: function `gensym' from cl package called at runtime
>
> by replacing them with their cl- counterpairs from cl-lib?

Yes, or adding this at end of file if you want to keep using 'cl' package:

,----
| ;; Local Variables:
| ;; byte-compile-warnings: (not cl-functions obsolete)
| ;; End:
`----

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




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

* Re: Adapting code to cl-lib
  2013-12-30  7:15 ` Thierry Volpiatto
@ 2013-12-30 12:39   ` João Távora
  2013-12-30 13:21     ` Thierry Volpiatto
  0 siblings, 1 reply; 7+ messages in thread
From: João Távora @ 2013-12-30 12:39 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: help-gnu-emacs

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> joaotavora@gmail.com (João Távora) writes:
>
>> Does anyone know of a package or something that gets rid of these
>> warnings:
>>
>>    foo.el:2266:57:Warning: function `find' from cl package called at runtime
>>    foo.el:2370:63:Warning: function `remove*' from cl package called at runtime
>>    foo.el:2370:63:Warning: function `gensym' from cl package called at runtime
>>
>> by replacing them with their cl- counterpairs from cl-lib?
>
> Yes

Then can you tell me what it is?

>, or adding this at end of file if you want to keep using 'cl' package:
>
> ,----
> | ;; Local Variables:
> | ;; byte-compile-warnings: (not cl-functions obsolete)
> | ;; End:
> `----

Yes, thanks, I already knew I could do this, but it's precisely what I
wanted to avoid.

In case there was a misunderstanding. I was looking for some
command/package that replaces these in the buffer. I could roll my own,
searching for symbols with some 'obsolete property or sth that also have
cl- counterparts bound to some function, and then passing these to a
global replace-regexp...



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

* Re: Adapting code to cl-lib
  2013-12-30 12:39   ` João Távora
@ 2013-12-30 13:21     ` Thierry Volpiatto
  2013-12-30 21:48       ` João Távora
  0 siblings, 1 reply; 7+ messages in thread
From: Thierry Volpiatto @ 2013-12-30 13:21 UTC (permalink / raw)
  To: João Távora; +Cc: help-gnu-emacs

joaotavora@gmail.com (João Távora) writes:

> In case there was a misunderstanding. I was looking for some
> command/package that replaces these in the buffer. I could roll my own,
> searching for symbols with some 'obsolete property or sth that also have
> cl- counterparts bound to some function, and then passing these to a
> global replace-regexp...

So no I don't know any package doing this, I have converted code
recently to cl-lib using my own code similar to your code.
You can find a list of symbols to replace in cl.el#176.


-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

* Re: Adapting code to cl-lib
  2013-12-30 13:21     ` Thierry Volpiatto
@ 2013-12-30 21:48       ` João Távora
  2013-12-31  5:15         ` Thierry Volpiatto
  2013-12-31 10:33         ` Thien-Thi Nguyen
  0 siblings, 2 replies; 7+ messages in thread
From: João Távora @ 2013-12-30 21:48 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: help-gnu-emacs

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> You can find a list of symbols to replace in cl.el#176.

Thanks, I took that list and wrote a replace-regexp expression. But just
a regexp won't cut since it will think

   (let ((position 5))
      ...)

is a call to cl-position, which is quite wrong. I ended up fixing these
by hand. A real tool must use the byte-compiler's output, or hop on the
byte-compiler itself. Probably not worth it...

João



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

* Re: Adapting code to cl-lib
  2013-12-30 21:48       ` João Távora
@ 2013-12-31  5:15         ` Thierry Volpiatto
  2013-12-31 10:33         ` Thien-Thi Nguyen
  1 sibling, 0 replies; 7+ messages in thread
From: Thierry Volpiatto @ 2013-12-31  5:15 UTC (permalink / raw)
  To: João Távora; +Cc: help-gnu-emacs

joaotavora@gmail.com (João Távora) writes:

> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
>> You can find a list of symbols to replace in cl.el#176.
>
> Thanks, I took that list and wrote a replace-regexp expression. But just
> a regexp won't cut since it will think
>
>    (let ((position 5))
>       ...)
>
> is a call to cl-position, which is quite wrong. I ended up fixing these
> by hand.

Yes, I had same problem, and finished fixing these occurences by hand
like you, looking at the byte-compiler output.

> A real tool must use the byte-compiler's output, or hop on the
> byte-compiler itself. Probably not worth it...

Yes, I didn't improve my tool because it is something I used once,
and I probably will not use it anymore.
Fixing small elisp packages (one file) don't require such a tool.

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

* Re: Adapting code to cl-lib
  2013-12-30 21:48       ` João Távora
  2013-12-31  5:15         ` Thierry Volpiatto
@ 2013-12-31 10:33         ` Thien-Thi Nguyen
  1 sibling, 0 replies; 7+ messages in thread
From: Thien-Thi Nguyen @ 2013-12-31 10:33 UTC (permalink / raw)
  To: João Távora; +Cc: help-gnu-emacs

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

() joaotavora@gmail.com (João Távora)
() Mon, 30 Dec 2013 21:48:48 +0000

   A real tool must use the byte-compiler's output, or hop on the
   byte-compiler itself. Probably not worth it...

It would be cool to capture byte-compiler warnings, anyway, for the sake
of downstream toolsmithing.  Maybe this is already possible?

[cc trimmed]

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

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

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

end of thread, other threads:[~2013-12-31 10:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-29 23:18 Adapting code to cl-lib João Távora
2013-12-30  7:15 ` Thierry Volpiatto
2013-12-30 12:39   ` João Távora
2013-12-30 13:21     ` Thierry Volpiatto
2013-12-30 21:48       ` João Távora
2013-12-31  5:15         ` Thierry Volpiatto
2013-12-31 10:33         ` Thien-Thi Nguyen

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