all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* New obsolete.el file for obsolete stuff?
@ 2020-08-18 12:10 Stefan Kangas
  2020-08-18 12:24 ` Andrea Corallo via Emacs development discussions.
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-08-18 12:10 UTC (permalink / raw)
  To: emacs-devel

I was investigating some XEmacs compat code the other day and stumbled
across their library obsolete.el, which they used to put all their
obsolete aliases.

You can find their library here:

    https://bitbucket.org/xemacs/xemacs/src/default/lisp/obsolete.el

Its Commentary says:

    The obsoleteness support used to be scattered throughout various
    source files.  We put the stuff in one place to remove the junkiness
    from other source files and to facilitate creating/updating things
    like sysdep.el.

I think this is a nice idea to basically move some cruft out of the way,
to where we don't need to see it.

Could we do something similar for Emacs?  I'm thinking that we don't
need to move all stuff at once, but if we create the file with a basic
structure, we could start using it little by little.

Best regards,
Stefan Kangas



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

* Re: New obsolete.el file for obsolete stuff?
  2020-08-18 12:10 New obsolete.el file for obsolete stuff? Stefan Kangas
@ 2020-08-18 12:24 ` Andrea Corallo via Emacs development discussions.
  2020-08-18 12:39   ` Stefan Kangas
  2020-08-18 12:38 ` Lars Ingebrigtsen
  2020-08-18 16:55 ` Stefan Monnier
  2 siblings, 1 reply; 8+ messages in thread
From: Andrea Corallo via Emacs development discussions. @ 2020-08-18 12:24 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: emacs-devel

Stefan Kangas <stefan@marxist.se> writes:

> I was investigating some XEmacs compat code the other day and stumbled
> across their library obsolete.el, which they used to put all their
> obsolete aliases.
>
> You can find their library here:
>
>     https://bitbucket.org/xemacs/xemacs/src/default/lisp/obsolete.el
>
> Its Commentary says:
>
>     The obsoleteness support used to be scattered throughout various
>     source files.  We put the stuff in one place to remove the junkiness
>     from other source files and to facilitate creating/updating things
>     like sysdep.el.
>
> I think this is a nice idea to basically move some cruft out of the way,
> to where we don't need to see it.
>
> Could we do something similar for Emacs?  I'm thinking that we don't
> need to move all stuff at once, but if we create the file with a basic
> structure, we could start using it little by little.

Am I wrong or the trouble is that such a file would require all
necessary dependencies for the functions moved into?  If that's the case
either only code with autoloaded or no dependency can be moved there or
a massive number of requires would be needed.  I'm not sure the solution
is not very practical in this respect.

Regards

  Andrea

-- 
akrl@sdf.org



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

* Re: New obsolete.el file for obsolete stuff?
  2020-08-18 12:10 New obsolete.el file for obsolete stuff? Stefan Kangas
  2020-08-18 12:24 ` Andrea Corallo via Emacs development discussions.
@ 2020-08-18 12:38 ` Lars Ingebrigtsen
  2020-08-18 12:44   ` Stefan Kangas
  2020-08-18 16:55 ` Stefan Monnier
  2 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-18 12:38 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: emacs-devel

Stefan Kangas <stefan@marxist.se> writes:

> I think this is a nice idea to basically move some cruft out of the way,
> to where we don't need to see it.

I don't think that would work...  We add the aliases and stuff so that
people's code will continue to work.  If somebody has out-of-tree code
that says

(require 'foo)
(foo-name)

that continues to work even if we've obsoleted foo-name.  Moving it to a
separate file would defeat the purpose of that...

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



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

* Re: New obsolete.el file for obsolete stuff?
  2020-08-18 12:24 ` Andrea Corallo via Emacs development discussions.
@ 2020-08-18 12:39   ` Stefan Kangas
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-08-18 12:39 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: emacs-devel

Andrea Corallo <akrl@sdf.org> writes:

> Am I wrong or the trouble is that such a file would require all
> necessary dependencies for the functions moved into?

I believe we could avoid that using `eval-after-load'.

Best regards,
Stefan Kangas



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

* Re: New obsolete.el file for obsolete stuff?
  2020-08-18 12:38 ` Lars Ingebrigtsen
@ 2020-08-18 12:44   ` Stefan Kangas
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-08-18 12:44 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I don't think that would work...  We add the aliases and stuff so that
> people's code will continue to work.  If somebody has out-of-tree code
> that says
>
> (require 'foo)
> (foo-name)
>
> that continues to work even if we've obsoleted foo-name.  Moving it to a
> separate file would defeat the purpose of that...

It would need to be dumped/pre-loaded (not sure what's the prefered
terminology here).  That's what they did in XEmacs.

(One could also use `eval-after-load' where it makes sense to do so.)

Best regards,
Stefan Kangas



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

* Re: New obsolete.el file for obsolete stuff?
  2020-08-18 12:10 New obsolete.el file for obsolete stuff? Stefan Kangas
  2020-08-18 12:24 ` Andrea Corallo via Emacs development discussions.
  2020-08-18 12:38 ` Lars Ingebrigtsen
@ 2020-08-18 16:55 ` Stefan Monnier
  2020-08-18 17:22   ` Eli Zaretskii
  2020-08-19 14:01   ` Stefan Kangas
  2 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2020-08-18 16:55 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: emacs-devel

> I think this is a nice idea to basically move some cruft out of the way,
> to where we don't need to see it.

This is the old problem of classification, and we know this is a problem
that doesn't have a perfect solution, so it's all a matter of weighing
the respective advantages and inconveniences.

I think it's easier to keep the obsolete aliases where they were, at the
cost of having to search for old such aliases when it is time to get rid
of them.

The actual obsolete aliases definitions are usually not the main problem
(i.e. having this "cruft" mixed in ("scattered") with the normal code
doesn't do much harm if any), the problem is usually in the consequences
of their existence, so moving them to a separate file would only help if
that file is usually not loaded.


        Stefan




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

* Re: New obsolete.el file for obsolete stuff?
  2020-08-18 16:55 ` Stefan Monnier
@ 2020-08-18 17:22   ` Eli Zaretskii
  2020-08-19 14:01   ` Stefan Kangas
  1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2020-08-18 17:22 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: stefan, emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Tue, 18 Aug 2020 12:55:59 -0400
> Cc: emacs-devel@gnu.org
> 
> I think it's easier to keep the obsolete aliases where they were, at the
> cost of having to search for old such aliases when it is time to get rid
> of them.

I tend to agree, FWIW.



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

* Re: New obsolete.el file for obsolete stuff?
  2020-08-18 16:55 ` Stefan Monnier
  2020-08-18 17:22   ` Eli Zaretskii
@ 2020-08-19 14:01   ` Stefan Kangas
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-08-19 14:01 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

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

> The actual obsolete aliases definitions are usually not the main problem
> (i.e. having this "cruft" mixed in ("scattered") with the normal code
> doesn't do much harm if any)

I sometimes find it mildly distracting to see obsolete definitions when
navigating code.  But this, of course, is a stylistic and highly
subjective point.  I just figured it was worth floating the idea to see
if it would catch on, and I'm perfectly happy either way.

Thanks for commenting.

Best regards,
Stefan Kangas



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

end of thread, other threads:[~2020-08-19 14:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-18 12:10 New obsolete.el file for obsolete stuff? Stefan Kangas
2020-08-18 12:24 ` Andrea Corallo via Emacs development discussions.
2020-08-18 12:39   ` Stefan Kangas
2020-08-18 12:38 ` Lars Ingebrigtsen
2020-08-18 12:44   ` Stefan Kangas
2020-08-18 16:55 ` Stefan Monnier
2020-08-18 17:22   ` Eli Zaretskii
2020-08-19 14:01   ` Stefan Kangas

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.