Stephen Leake <[EMAIL PROTECTED]> writes: > Michael Olson <[EMAIL PROTECTED]> writes: > >>> That ties us permanently to Gnu Emacs 21. Or, if we ever decide to >>> abandon Gnu Emacs 21, we will either be left with a legacy of >>> unnecessary dvc- prefixes, or have to change them to the Emacs 22 >>> names. >> >> Nope. If we drop Emacs 21 support, all we have to do is simplify the >> compatibility wrapper to a single defalias statement. No need to >> massively go through the code base and rename everything back from >> "dvc-FUN" to "FUN". > > If I'm reading code, and I run across `dvc-ewoc-delete', I assume it > does something _other_ than just `ewoc-delete'. So it is better to > change the code once dvc-ewoc-delete. But it's a small point, and can > be argued later :). > > [snip] > > There are several dvc- functions that _add_ to the underlying > function. So it is confusing when a dvc- function is just an alias.
I think if such functions exist, they should be renamed, much like
dvc-funcall -> dvc-call. If something has a dvc- prefix and the name of
a common function, it should act at least very closely to the common
function, and preferably be a replicate.
That way as soon as we see something like dvc-ewoc-delete, we can think
"ah, compatibility wrapper for ewoc-delete".
>>>> I would like to eventually eliminate dvc-emacs.el and dvc-xemacs.el,
>>>> turn them into dvc-compat.el, and change every function definition
>>>> in these files to have the prefix "dvc-".
>>>
>>> It does seem like having everything in one file would help. There
>>> really isn't that much difference between Gnu Emacs version issues
>>> and XEmacs issues.
>>>
>>> A clear statement of policy in the comments would help. If you agree
>>> with what I've said above, I'll add it to both files. Then we can
>>> work on eliminating one, and renaming the other.
>>>
>>> And any other compatibility stuff should be moved to dvc-compat.el,
>>> as well.
>>
>> Agreed, having a statement of policy would be good. As long as it
>> takes into account the points I've made above, feel free to make a
>> new dvc-compat.el file and add the policy explanation to that, with a
>> quick mention of dvc-compat.el in both dvc-emacs.el and
>> dvc-xemacs.el.
>
> Actually, I think we should keep two files.
>
> dvc-utils.el has:
>
> (if (featurep 'xemacs)
> (require 'dvc-xemacs)
> (require 'dvc-emacs))
>
> The alternative is to preface everything in dvc-compat.el with either
> `dvc-do-in-gnu-emacs' or `dvc-do-in-xemacs'. I think two files is
> cleaner. If there is significant overlap, we could split it out into a
> third shared file.
dvc-do-in-gnu-emacs and dvc-do-in-xemacs are the wrong approach most of
the time. What you want to do is check for function names and variable
names, not whether we are running XEmacs or Emacs. The only exceptions
are for things like face definitions, which are variables that do not
have deducible parts.
> Also, it's less likely that changes for xemacs will break gnu emacs
> and vice versa if they are kept in separate files.
Completely disagree: as long as we use the dvc- prefix, we shouldn't
break anything, ever.
> For example, I just added dvc-redisplay in dvc-emacs.el. I have no
> idea what the proper implementation is in dvc-xemacs. I think it's
> better to provide none, rather than a possibly broken one. But I could
> be wrong. dvc-redisplay is only used in xmtn.
>
> I just looked thru the two files looking for overlap; the only one
> that I could see is dvc-emacs-make-temp-dir, which is the same in both
> files. That's not worth a third file. In fact, it doesn't seem to be a
> compatibility issue; it should be in dvc-utils?
Those functions should both be moved to dvc-compat.el. dvc-utils should
not contain compatibility wrappers. I only placed such a wrapper there
because we did not yet have anything like dvc-compat.el.
> Ah; ewoc-delete should be in both dvc-emacs.el and dvc-emacs.el;
> that's why you moved it to dvc-utils.el, to avoid duplicated code.
>
> I think it's better to have duplicated code in this case. It's already
> duplicated from the Gnu Emacs 22 ewoc.el source. It's possible that
> the XEmacs version would need to be different than the Gnu Emacs
> version. And XEmacs will implement ewoc-delete at a different time
> than we drop support for Gnu Emacs 21, so the implementation needs to
> be in both files at some point anyway.
Why would it be better to have a function defined in two places rather
than one? That makes it much harder to track down when changes need to
be made. I think it is far better to have it in just one place, with
the appropriate fboundp and boundp guards in place.
> But I would not object strongly to having a third file dvc-compat.el
> that contains code that is needed by both dvc-xemacs.el and
> dvc-emacs.el.
Good.
> One question; do we support previous releases of XEmacs?
I think we should only support the most recent stable release of XEmacs,
and the beta only if people ask us for it :^) . Which they have, in
this case.
As for Emacs 21, we basically already do not support it, due to the use
of [[:alpha:]] and [[:blank:]] in xgit.el. It is onerous enough to work
around the lack of these character classes (I have done so in Emacs
Muse, and it makes things very unwieldy) that I think we should not
focus on supporting Emacs 21.
> There is also stuff in xmtn--compat.el that should be moved/merged to
> dvc-emacs.el.
>
> However, there are _many_ defuns in dvc-xemacs.el that violate the
> policy. So either they need to be changed, or we need to amend the
> policy somehow, or they need comments explaining why they are
> exceptions. There were also a few in dvc-emacs; I've fixed those.
>
> There is another aspect to all of this; when we merge DVC into Gnu
> Emacs, I believe the policy is to have no "old emacs" compatibility
> code. I'm not sure about xemacs compatibility code.
If we have just dvc-compat.el, then we basically just have to remove the
unneeded boundp and fboundp guards and turn them into defaliases.
That's what I did for ERC.
I think I will be sending in a patch for erc-compat.el shortly, after
maybe one or two more email exchanges to think this out.
--
Michael Olson -- FSF Associate Member #652 |
http://mwolson.org/ -- Jabber: mwolson_at_hcoop.net | /` |\ | | |
Programmer -- Hobbies: Lisp, HCoop | |_] | \| |_|
Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |
pgpx7fhCD3pWt.pgp
Description: PGP signature
_______________________________________________ Dvc-dev mailing list [email protected] https://mail.gna.org/listinfo/dvc-dev
