all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Cleaning up further compat code
@ 2016-04-03 16:29 Lars Magne Ingebrigtsen
  2016-04-03 16:33 ` Lars Magne Ingebrigtsen
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-04-03 16:29 UTC (permalink / raw)
  To: emacs-devel

I was looking at the erc code to fix a coding related bug, and I noticed
all the compat code (both for older versions of Emacs and XEmacs)...  It
might be nice to clean some of that stuff up to make maintenance easier.

But we should, of course, not do that with code that's maintained
outside of Emacs (where the maintainers want to keep the compat code
in).

So I'm wondering: Is there an overview somewhere of which .el files are
externally maintained?  That would be very handy...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* Re: Cleaning up further compat code
  2016-04-03 16:29 Cleaning up further compat code Lars Magne Ingebrigtsen
@ 2016-04-03 16:33 ` Lars Magne Ingebrigtsen
  2016-04-03 19:09   ` Lars Magne Ingebrigtsen
  2016-04-03 16:54 ` Michael Albinus
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 14+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-04-03 16:33 UTC (permalink / raw)
  To: emacs-devel

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> I was looking at the erc code to fix a coding related bug, and I noticed
> all the compat code (both for older versions of Emacs and XEmacs)...  It
> might be nice to clean some of that stuff up to make maintenance easier.

(I did a quick grep for code that could be "mechanically" cleaned up,
and there are about 850 instances of (featurep 'x?emacs).  From my
experience with cleaning up the Gnus compat code, I would guesstimate
cleaning up this would get rid of more than 10K lines of code.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: Cleaning up further compat code
  2016-04-03 16:29 Cleaning up further compat code Lars Magne Ingebrigtsen
  2016-04-03 16:33 ` Lars Magne Ingebrigtsen
@ 2016-04-03 16:54 ` Michael Albinus
  2016-04-04  7:06 ` Lars Magne Ingebrigtsen
  2016-04-05  0:16 ` Xue Fuqiao
  3 siblings, 0 replies; 14+ messages in thread
From: Michael Albinus @ 2016-04-03 16:54 UTC (permalink / raw)
  To: emacs-devel

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

Hi Lars,

> So I'm wondering: Is there an overview somewhere of which .el files are
> externally maintained?  That would be very handy...

Be my guest: tramp*.el is maintained outside the Emacs repo, but it
supports only Emacs 23 and 24. If you find compat code for older Emacs
versions, or still for XEmacs, you could remove it.

(I did a cleanup in January, but maybe I've overlooked something)

Thanks, and best regards, Michael.



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

* Re: Cleaning up further compat code
  2016-04-03 16:33 ` Lars Magne Ingebrigtsen
@ 2016-04-03 19:09   ` Lars Magne Ingebrigtsen
  2016-04-03 23:21     ` John Wiegley
  0 siblings, 1 reply; 14+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-04-03 19:09 UTC (permalink / raw)
  To: emacs-devel

I guess we should put off doing cleanups until Emacs 25.1 has been
released, because merging between the branches get kinda hairy if you
change the trunk a lot.

But anyway, I thought I'd just post the two functions that I was using
to do

(if (featurep 'xemacs)
    (something)
  (something)
  (else))

cleanup, in case somebody wants to do some cleanup.  The first deletes
the "then" part, and the second deletes the "else" part (which is useful
when it's (if (featurep 'emacs) ...)  instead).

Of course, you have to see whether the code makes sense afterwards.
Which is might not if the code is (setq foo (if ...)), for instance.

(defun lars-delete-then ()
  "Delete the if statement and the then statement."
  (interactive)
  (if (looking-at " *(if")
      (delete-region (point) (match-end 0))
    (search-backward "(if" (line-beginning-position))
    (delete-region (point) (+ (point) 3)))
  (kill-sexp 2)
  (save-excursion
    (while (ignore-errors
	     (forward-sexp 1)
	     t))
    ;; Delete the final ")".
    (delete-region (point) (1+ (point))))
  (save-excursion
    (beginning-of-line)
    (when (looking-at "\\s-*$")
      (delete-region (point) (line-beginning-position 2))))
  (save-excursion
    (search-backward "(")
    (indent-sexp)))

(defun lars-delete-else ()
  "Delete the if statement and the else statement."
  (interactive)
  (if (looking-at " *(if")
      (delete-region (point) (match-end 0))
    (search-backward "(if" (line-beginning-position))
    (delete-region (point) (+ (point) 3)))
  (kill-sexp 1)
  (let ((start (point)))
    (forward-sexp 1)
    (while (ignore-errors
	     (kill-sexp 1)
	     t))
    ;; Delete the final ")".
    (delete-region (point) (1+ (point)))
    (goto-char start)
    (save-excursion
      (beginning-of-line)
      (when (looking-at "\\s-*$")
	(delete-region (point) (line-beginning-position 2))))
    (save-excursion
      (search-backward "(")
      (indent-sexp))))

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

* Re: Cleaning up further compat code
  2016-04-03 19:09   ` Lars Magne Ingebrigtsen
@ 2016-04-03 23:21     ` John Wiegley
  0 siblings, 0 replies; 14+ messages in thread
From: John Wiegley @ 2016-04-03 23:21 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> I guess we should put off doing cleanups until Emacs 25.1 has been released,
> because merging between the branches get kinda hairy if you change the trunk
> a lot.

Yes, please. :)

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



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

* Re: Cleaning up further compat code
  2016-04-03 16:29 Cleaning up further compat code Lars Magne Ingebrigtsen
  2016-04-03 16:33 ` Lars Magne Ingebrigtsen
  2016-04-03 16:54 ` Michael Albinus
@ 2016-04-04  7:06 ` Lars Magne Ingebrigtsen
  2016-04-04  7:31   ` Michael Albinus
  2016-04-04 12:35   ` Stefan Monnier
  2016-04-05  0:16 ` Xue Fuqiao
  3 siblings, 2 replies; 14+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-04-04  7:06 UTC (permalink / raw)
  To: emacs-devel

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> So I'm wondering: Is there an overview somewhere of which .el files are
> externally maintained?  That would be very handy...

From the non-response here I'm assuming the answer is "no".  Would it be
an idea to create such a file?  That way it would be easier to know
which files we can do janitorial stuff on, and which ones we should ask
first...

I'm thinking something simple a la

net/tramp*.el
progmodes/cc-*.el
org/*.el

...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: Cleaning up further compat code
  2016-04-04  7:06 ` Lars Magne Ingebrigtsen
@ 2016-04-04  7:31   ` Michael Albinus
  2016-04-04  7:56     ` Lars Magne Ingebrigtsen
  2016-04-04 12:35   ` Stefan Monnier
  1 sibling, 1 reply; 14+ messages in thread
From: Michael Albinus @ 2016-04-04  7:31 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
>> So I'm wondering: Is there an overview somewhere of which .el files are
>> externally maintained?  That would be very handy...
>
> From the non-response here I'm assuming the answer is "no".  Would it be
> an idea to create such a file?  That way it would be easier to know
> which files we can do janitorial stuff on, and which ones we should ask
> first...

Maybe we could use an extra flag in admin/MAINTAINERS?

Best regards, Michael.



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

* Re: Cleaning up further compat code
  2016-04-04  7:31   ` Michael Albinus
@ 2016-04-04  7:56     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 14+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-04-04  7:56 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel

Michael Albinus <michael.albinus@gmx.de> writes:

> Maybe we could use an extra flag in admin/MAINTAINERS?

Ah, yes, that would be nice.  And that file is kinda machine-readable,
too, so it would be possible to create a `externally-maintained-p'
predicate function.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: Cleaning up further compat code
  2016-04-04  7:06 ` Lars Magne Ingebrigtsen
  2016-04-04  7:31   ` Michael Albinus
@ 2016-04-04 12:35   ` Stefan Monnier
  2016-04-04 15:04     ` Eli Zaretskii
  2016-04-04 18:13     ` Lars Magne Ingebrigtsen
  1 sibling, 2 replies; 14+ messages in thread
From: Stefan Monnier @ 2016-04-04 12:35 UTC (permalink / raw)
  To: emacs-devel

> From the non-response here I'm assuming the answer is "no".  Would it be
> an idea to create such a file?  That way it would be easier to know

No, please don't.  If you want to keep that data, keep it in the
affected files, not in a separate file.

How 'bout a pseudo-header like

   Should-work-in: Emacs-trunk

This way it can also be used for other cases such as

   Should-work-in: XEmacs

or

   Should-work-in: Emacs≥23

For multifile packages, we could put that pseudo-header only in the
main file.  And arguably, it would be good to associate a date with this
info, like

   Should-work-in: Emacs≥20  (Nov 2006)

so as to get some vague idea of whether maybe it's time to update the
"Should-work-in".


        Stefan


PS: I recently bumped into:

 ((and (not (featurep 'xemacs))
       (string-equal "19" (substring emacs-version 0 2))
       (or window-system
	   (fboundp 'tmm-menubar)))     ; 19.30 - Will autoload if necessary

Does AUCTeX really still care about Emacs-19.30?




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

* Re: Cleaning up further compat code
  2016-04-04 12:35   ` Stefan Monnier
@ 2016-04-04 15:04     ` Eli Zaretskii
  2016-04-04 18:13     ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2016-04-04 15:04 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Mon, 04 Apr 2016 08:35:58 -0400
> 
> > From the non-response here I'm assuming the answer is "no".  Would it be
> > an idea to create such a file?  That way it would be easier to know
> 
> No, please don't.  If you want to keep that data, keep it in the
> affected files, not in a separate file.

I agree.



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

* Re: Cleaning up further compat code
  2016-04-04 12:35   ` Stefan Monnier
  2016-04-04 15:04     ` Eli Zaretskii
@ 2016-04-04 18:13     ` Lars Magne Ingebrigtsen
  2016-04-05  0:20       ` Stefan Monnier
  1 sibling, 1 reply; 14+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-04-04 18:13 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> No, please don't.  If you want to keep that data, keep it in the
> affected files, not in a separate file.
>
> How 'bout a pseudo-header like
>
>    Should-work-in: Emacs-trunk
>
> This way it can also be used for other cases such as
>
>    Should-work-in: XEmacs
>
> or
>
>    Should-work-in: Emacs≥23

I like it, but I assumed that was off the table, since these files are
maintained outside Emacs.  :-)  If we can do janitorial changes to files
to clarify that we shouldn't do janitorial changes in them, then things
get easier to handle.

> For multifile packages, we could put that pseudo-header only in the
> main file.

Well...  then this no longer can be automated.  I'd really like to have
a mode line thing stating the maintainability status of the file when
doing cleanups...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: Cleaning up further compat code
  2016-04-03 16:29 Cleaning up further compat code Lars Magne Ingebrigtsen
                   ` (2 preceding siblings ...)
  2016-04-04  7:06 ` Lars Magne Ingebrigtsen
@ 2016-04-05  0:16 ` Xue Fuqiao
  3 siblings, 0 replies; 14+ messages in thread
From: Xue Fuqiao @ 2016-04-05  0:16 UTC (permalink / raw)
  To: Emacs-devel

On Mon, Apr 4, 2016 at 12:29 AM, Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:

> So I'm wondering: Is there an overview somewhere of which .el files are
> externally maintained?  That would be very handy...

An old version of the etc/MORE.STUFF file[1] might be helpful, although
it isn't what you described exactly.

[1] http://git.savannah.gnu.org/cgit/emacs.git/commit/etc/MORE.STUFF?id=30b3bce202302800bee253d4f8a9eff801c8c81f



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

* Re: Cleaning up further compat code
  2016-04-04 18:13     ` Lars Magne Ingebrigtsen
@ 2016-04-05  0:20       ` Stefan Monnier
  2016-04-06 11:30         ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2016-04-05  0:20 UTC (permalink / raw)
  To: emacs-devel

>> Should-work-in: Emacs≥23
> I like it, but I assumed that was off the table, since these files are
> maintained outside Emacs.  :-)

Not all of them are.  Some are maintained inside Emacs but also
released separately.  Others are maintained both inside and outside.
And some are primarily maintained outside.
But in either case, we can install local changes (and hope to see them
integrated in the external upstream source if any).

>> For multifile packages, we could put that pseudo-header only in the
>> main file.
> Well...  then this no longer can be automated.

Of course it can.  We have the "Package:" pseudo header that lets us
find the main file automatically.


        Stefan




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

* Re: Cleaning up further compat code
  2016-04-05  0:20       ` Stefan Monnier
@ 2016-04-06 11:30         ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 14+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-04-06 11:30 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Of course it can.  We have the "Package:" pseudo header that lets us
> find the main file automatically.

That's true.

Then I think that somebody who knows what the maintainability status of
files should do these changes.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

end of thread, other threads:[~2016-04-06 11:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-03 16:29 Cleaning up further compat code Lars Magne Ingebrigtsen
2016-04-03 16:33 ` Lars Magne Ingebrigtsen
2016-04-03 19:09   ` Lars Magne Ingebrigtsen
2016-04-03 23:21     ` John Wiegley
2016-04-03 16:54 ` Michael Albinus
2016-04-04  7:06 ` Lars Magne Ingebrigtsen
2016-04-04  7:31   ` Michael Albinus
2016-04-04  7:56     ` Lars Magne Ingebrigtsen
2016-04-04 12:35   ` Stefan Monnier
2016-04-04 15:04     ` Eli Zaretskii
2016-04-04 18:13     ` Lars Magne Ingebrigtsen
2016-04-05  0:20       ` Stefan Monnier
2016-04-06 11:30         ` Lars Magne Ingebrigtsen
2016-04-05  0:16 ` Xue Fuqiao

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.