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 :).
>> When we finally drop support for versions of Gnu Emacs and XEmacs that
>> do not provide ewoc-delete, it would be best to delete
>> dvc-ewoc-delete, so the code will then be more understandable. The
>> same goes for other compatibility functions; they should be reviewed
>> at each release of Gnu Emacs and XEmacs to see if they can be deleted.
>> That is much easier to do if they are declared in only one or two
>> files.
>
> I think there is no need to delete dvc-ewoc-delete in this case. It is
> obvious from the name of the function which other function it is
> supposed to emulate.
There are several dvc- functions that _add_ to the underlying
function. So it is confusing when a dvc- function is just an alias.
>>> 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.
Also, it's less likely that changes for xemacs will break gnu emacs
and vice versa if they are kept in separate files.
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?
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.
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.
I've put the policy in dvc-emacs and referenced it from dvc-xemacs.
One question; do we support previous releases of XEmacs?
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.
--
-- Stephe
_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev