[implementations-list] [PATCH] Small fixes
I have made a few fixes, attached to this e-mail as a patch (patch.txt). They are: * AUTOMATIC LOADING OF CL.EL: if cl.el isn't loaded already (Common Lisp extensions for Emacs), one gets error messages bemoaning undefined functions like `destructuring-bind'. Added (require 'cl) to fix this. * FIXED `TRAILING-NEWLINES' PARAMETER: corrected a small typo in the function `vimpulse-get-bounds-with-whitespace'. See http://www.emacswiki.org/emacs/vimpulse for details. I also took the liberty to remove any trailing whitespace (M-x delete-trailing-whitespace), which made the patch a bit larger than it otherwise would have been. The patch was made with the GnuWin32 version of diff, running on Windows XP, with the command diff vimpulse-old.el vimpulse.el> patch.txt where vimpulse-old.el is version 0.3.0 of Vimpulse, downloaded from http://www.emacswiki.org/emacs/vimpulse.el. Tested on GNU Emacs 23.1. Vegard Øye _________________________________________________________________ Nye Windows 7: PCen som passer for deg. Finn ut mer. http://windows.microsoft.com/shop
On Tue, Dec 01, 2009 at 07:09:37PM +0000, Vegard Øye wrote:
* AUTOMATIC LOADING OF CL.EL: if cl.el isn't loaded already (Common Lisp extensions for Emacs), one gets error messages bemoaning undefined functions like `destructuring-bind'. Added (require 'cl) to fix this.
Just a note about cl.el: I believe the GNU Emacs policy is still that cl.el is to be regarded as a compile-time emulation layer only, and it should never be loaded at runtime. They will not accept any code into official Emacs that requires cl.el at runtime. As an elisp coder myself, I have found that cl.el is occasionally convenient, rarely needed, and often over-used. When I write libraries I avoid it altogether not only because of the GNU policy, but also because it can introduce subtle bugs because of alternate definitions of functions like `push', and once one library has loaded cl.el at runtime, your Emacs is "infected" with it, and problems related to it in other libraries become harder to debug. Although I'm not directly involved in vimpulse, I would recommend looking at the situation where cl.el is used and evaluating whether it is truly necessary in the first place. -- John Foerch
Date: Tue, 1 Dec 2009 15:06:13 -0500 From: [email protected] To: [email protected] Subject: Re: [implementations-list] [PATCH] Small fixes
Although I'm not directly involved in vimpulse, I would recommend looking at the situation where cl.el is used and evaluating whether it is truly necessary in the first place.
The `destructuring-bind' messages are recent; I never had them with older versions of Vimpulse. So presumably, not much rewriting is necessary to revert to Vanilla Elisp. `M-x occur' lists 7 matches for `destructuring-bind' in vimpulse.el. It wouldn't make any difference to the Emacs maintainers if one purged (require 'cl) from the code and just included a reference to it in the installation instructions, right? _________________________________________________________________ Windows 7: Se direkte-TV fra den bærbare PCen. Finn ut mer. http://windows.microsoft.com/windows-7
On Tue, Dec 01, 2009 at 09:38:48PM +0000, Vegard Øye wrote:
Date: Tue, 1 Dec 2009 15:06:13 -0500 From: [email protected] To: [email protected] Subject: Re: [implementations-list] [PATCH] Small fixes
Although I'm not directly involved in vimpulse, I would recommend looking at the situation where cl.el is used and evaluating whether it is truly necessary in the first place.
The `destructuring-bind' messages are recent; I never had them with older versions of Vimpulse. So presumably, not much rewriting is necessary to revert to Vanilla Elisp.
`M-x occur' lists 7 matches for `destructuring-bind' in vimpulse.el.
It wouldn't make any difference to the Emacs maintainers if one purged (require 'cl) from the code and just included a reference to it in the installation instructions, right?
The right way to use cl.el is: (eval-when-compile (require 'cl)) -- John Foerch
Date: Tue, 1 Dec 2009 16:55:06 -0500 From: [email protected] To: [email protected] Subject: Re: [implementations-list] [PATCH] Small fixes
The right way to use cl.el is:
(eval-when-compile (require 'cl))
Ah, I see. So replace my (require 'cl) with that, and the problem is temporarily sorted. Here's what it says in the CL manual: *Please note:* the "CL" functions are not standard parts of the Emacs Lisp name space, so it is legitimate for users to define them with other, conflicting meanings. To avoid conflicting with those user activities, we have a policy that packages installed in Emacs must not load "CL" at run time. (It is ok for them to load "CL" at compile time only, with `eval-when-compile', and use the macros it provides.) If you are writing packages that you plan to distribute and invite widespread use for, you might want to observe the same rule. As one webpage puts it, "This sucks, because about half of the useful things in CL are functions and not macros." But as it happens, `destructuring-bind' is a macro. :) _________________________________________________________________ Windows 7: Se direkte-TV fra den bærbare PCen. Finn ut mer. http://windows.microsoft.com/windows-7
participants (2)
-
John J. Foerch -
Vegard Øye