unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 43fded1: Add lisp-data-mode for editing non-code Lisp data
       [not found] ` <20200501111128.D311220B5B@vcs0.savannah.gnu.org>
@ 2020-05-01 17:52   ` Michael Albinus
  2020-05-01 18:18     ` Stefan Monnier
  2020-05-01 18:40     ` João Távora
  0 siblings, 2 replies; 10+ messages in thread
From: Michael Albinus @ 2020-05-01 17:52 UTC (permalink / raw)
  To: emacs-devel; +Cc: João Távora

João Távora <joaotavora@gmail.com> writes:

Hi João,

> diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
> index 09e30f0..6d87ce2 100644
> --- a/lisp/net/tramp-cache.el
> +++ b/lisp/net/tramp-cache.el
> @@ -472,7 +472,7 @@ used to cache connection properties of the local machine."
>  	;; Dump it.
>  	(with-temp-file tramp-persistency-file-name
>  	  (insert
> -	   ";; -*- emacs-lisp -*-"
> +	   ";; -*- lisp-data -*-"
>  	   ;; `time-stamp-string' might not exist in all Emacs flavors.
>  	   (condition-case nil
>  	       (progn

That's a problem. Tramp must be backward compatible with Emacs 25 and
later, which doesn't know of lisp-data-mode. Could you, pls, revert this
part of your commit?

Best regards, Michael.



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

* Re: master 43fded1: Add lisp-data-mode for editing non-code Lisp data
  2020-05-01 17:52   ` master 43fded1: Add lisp-data-mode for editing non-code Lisp data Michael Albinus
@ 2020-05-01 18:18     ` Stefan Monnier
  2020-05-02 10:32       ` Michael Albinus
  2020-05-01 18:40     ` João Távora
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2020-05-01 18:18 UTC (permalink / raw)
  To: Michael Albinus; +Cc: João Távora, emacs-devel

>> -	   ";; -*- emacs-lisp -*-"
>> +	   ";; -*- lisp-data -*-"
[...]
> That's a problem.  Tramp must be backward compatible with Emacs 25 and
> later, which doesn't know of lisp-data-mode.  Could you, pls, revert this
> part of your commit?

[ Do we also care about writing this file from Emacs-28 and then
  reading it in Emacs-25?  How 'bout restricting it so you can only use
  it with Emacs-25-but-using-a-recent-Tramp?  ]
[ Also, I assume the above problem appears because Tramp uses
  `find-file-noselect` to access this file, so it could be fixed by
  making it use `insert-file-contents` instead, right?  ]

Reminds me of similar problems I've encountered with files where I want
to use some home-made derived major mode and where they then fail
miserably when used without the rest of my config.

Clearly it's too late to fix the above problem with Emacs-25, but for
the future, I think we should provide a way to specify not just a single
mode but a list of modes by order of preference, so if `lisp-data` is
not available it falls back to `emacs-liso`.


        Stefan




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

* Re: master 43fded1: Add lisp-data-mode for editing non-code Lisp data
  2020-05-01 17:52   ` master 43fded1: Add lisp-data-mode for editing non-code Lisp data Michael Albinus
  2020-05-01 18:18     ` Stefan Monnier
@ 2020-05-01 18:40     ` João Távora
  2020-05-02 10:51       ` Michael Albinus
  1 sibling, 1 reply; 10+ messages in thread
From: João Távora @ 2020-05-01 18:40 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

On Fri, May 1, 2020, 18:52 Michael Albinus <michael.albinus@gmx.de> wrote:

> João Távora <joaotavora@gmail.com> writes:
>
> Hi João,
>
> > diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
> > index 09e30f0..6d87ce2 100644
> > --- a/lisp/net/tramp-cache.el
> > +++ b/lisp/net/tramp-cache.el
> > @@ -472,7 +472,7 @@ used to cache connection properties of the local
> machine."
> >       ;; Dump it.
> >       (with-temp-file tramp-persistency-file-name
> >         (insert
> > -        ";; -*- emacs-lisp -*-"
> > +        ";; -*- lisp-data -*-"
> >          ;; `time-stamp-string' might not exist in all Emacs flavors.
> >          (condition-case nil
> >              (progn
>
> That's a problem. Tramp must be backward compatible with Emacs 25 and
> later, which doesn't know of lisp-data-mode. Could you, pls, revert this
> part of your commit?
>

No problem.  Will do so asap.

João

>

[-- Attachment #2: Type: text/html, Size: 1696 bytes --]

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

* Re: master 43fded1: Add lisp-data-mode for editing non-code Lisp data
  2020-05-01 18:18     ` Stefan Monnier
@ 2020-05-02 10:32       ` Michael Albinus
  2020-05-02 10:45         ` João Távora
  2020-05-02 14:08         ` Stefan Monnier
  0 siblings, 2 replies; 10+ messages in thread
From: Michael Albinus @ 2020-05-02 10:32 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: João Távora, emacs-devel

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

Hi Stefan,

>> That's a problem.  Tramp must be backward compatible with Emacs 25 and
>> later, which doesn't know of lisp-data-mode.  Could you, pls, revert this
>> part of your commit?
>
> [ Do we also care about writing this file from Emacs-28 and then
>   reading it in Emacs-25?  How 'bout restricting it so you can only use
>   it with Emacs-25-but-using-a-recent-Tramp?  ]

Yes, we care. And no, I don't see a reason to restrict ourselves; using
lisp-data-mode in that file is not super important.

> [ Also, I assume the above problem appears because Tramp uses
>   `find-file-noselect` to access this file, so it could be fixed by
>   making it use `insert-file-contents` instead, right?  ]

It is not a problem reading the file in Tramp code; Tramp uses already
`insert-file-contents-literally`. The problem is rather when you want to
visit the file interactively in a buffer.

>         Stefan

Best regards, Michael.



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

* Re: master 43fded1: Add lisp-data-mode for editing non-code Lisp data
  2020-05-02 10:32       ` Michael Albinus
@ 2020-05-02 10:45         ` João Távora
  2020-05-02 11:20           ` Michael Albinus
  2020-05-02 14:08         ` Stefan Monnier
  1 sibling, 1 reply; 10+ messages in thread
From: João Távora @ 2020-05-02 10:45 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Stefan Monnier, emacs-devel

On Sat, May 2, 2020 at 11:32 AM Michael Albinus <michael.albinus@gmx.de> wrote:
>
> Stefan Monnier <monnier@iro.umontreal.ca> writes:

> It is not a problem reading the file in Tramp code; Tramp uses already
> `insert-file-contents-literally`. The problem is rather when you want to
> visit the file interactively in a buffer.

I think what Stefan is saying is that the probability that you are going
to use Emacs <28 to visit a file produced by Emacs 28 is low.  And the
adverse effects are an error message that I personally could live with
on those (presumably rare) occasions.
FWIW I think of lisp-data-mode as most useful in non-Emacs produced
files (i.e. complex data files produced by Lisp-y applications).

Anyway, haven't reverted it yet, but have no problem in doing so.
And won't mind if you beat me to it.

João



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

* Re: master 43fded1: Add lisp-data-mode for editing non-code Lisp data
  2020-05-01 18:40     ` João Távora
@ 2020-05-02 10:51       ` Michael Albinus
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Albinus @ 2020-05-02 10:51 UTC (permalink / raw)
  To: João Távora; +Cc: emacs-devel

João Távora <joaotavora@gmail.com> writes:

>     That's a problem. Tramp must be backward compatible with Emacs 25
>     and later, which doesn't know of lisp-data-mode. Could you, pls,
>     revert this part of your commit?
>
> No problem.  Will do so asap.

I've done that, adding also a comment that we could use the lisp-data
cookie once we support only Emacs 28 or higher.

> João

Best regards, Michael.



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

* Re: master 43fded1: Add lisp-data-mode for editing non-code Lisp data
  2020-05-02 10:45         ` João Távora
@ 2020-05-02 11:20           ` Michael Albinus
  2020-05-02 11:22             ` João Távora
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2020-05-02 11:20 UTC (permalink / raw)
  To: João Távora; +Cc: Stefan Monnier, emacs-devel

João Távora <joaotavora@gmail.com> writes:

Hi João,

> I think what Stefan is saying is that the probability that you are going
> to use Emacs <28 to visit a file produced by Emacs 28 is low.  And the
> adverse effects are an error message that I personally could live with
> on those (presumably rare) occasions.

At least I do it daily :-)

And the problem is not the error message. The emacs-lisp cookie is there
for a reason; I want to get syntax highlighting in that file.

> João

Best regards, Michael.



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

* Re: master 43fded1: Add lisp-data-mode for editing non-code Lisp data
  2020-05-02 11:20           ` Michael Albinus
@ 2020-05-02 11:22             ` João Távora
  0 siblings, 0 replies; 10+ messages in thread
From: João Távora @ 2020-05-02 11:22 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Stefan Monnier, emacs-devel

On Sat, May 2, 2020 at 12:20 PM Michael Albinus <michael.albinus@gmx.de> wrote:
>
> João Távora <joaotavora@gmail.com> writes:
>
> Hi João,
>
> > I think what Stefan is saying is that the probability that you are going
> > to use Emacs <28 to visit a file produced by Emacs 28 is low.  And the
> > adverse effects are an error message that I personally could live with
> > on those (presumably rare) occasions.
>
> At least I do it daily :-)

Makes sense to disable it, in that case.



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

* Re: master 43fded1: Add lisp-data-mode for editing non-code Lisp data
  2020-05-02 10:32       ` Michael Albinus
  2020-05-02 10:45         ` João Távora
@ 2020-05-02 14:08         ` Stefan Monnier
  2020-05-02 14:16           ` Michael Albinus
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2020-05-02 14:08 UTC (permalink / raw)
  To: Michael Albinus; +Cc: João Távora, emacs-devel

> It is not a problem reading the file in Tramp code; Tramp uses already
> `insert-file-contents-literally`. The problem is rather when you want to
> visit the file interactively in a buffer.

Thanks for clarifying.

IIUC you may want to visit that file even with an Emacs that doesn't
support Tramp at all, right?
So the "backward compatibility" desired here is not directly connected
to the backward compatibility needed for Tramp itself, right?


        Stefan




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

* Re: master 43fded1: Add lisp-data-mode for editing non-code Lisp data
  2020-05-02 14:08         ` Stefan Monnier
@ 2020-05-02 14:16           ` Michael Albinus
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Albinus @ 2020-05-02 14:16 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: João Távora, emacs-devel

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

> IIUC you may want to visit that file even with an Emacs that doesn't
> support Tramp at all, right?

In theory, yes. In practice, it won't happen. Emacs supports Tramp since
release 22 out-of-the-box.

>         Stefan

Best regards, Michael.



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

end of thread, other threads:[~2020-05-02 14:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200501111127.16683.2701@vcs0.savannah.gnu.org>
     [not found] ` <20200501111128.D311220B5B@vcs0.savannah.gnu.org>
2020-05-01 17:52   ` master 43fded1: Add lisp-data-mode for editing non-code Lisp data Michael Albinus
2020-05-01 18:18     ` Stefan Monnier
2020-05-02 10:32       ` Michael Albinus
2020-05-02 10:45         ` João Távora
2020-05-02 11:20           ` Michael Albinus
2020-05-02 11:22             ` João Távora
2020-05-02 14:08         ` Stefan Monnier
2020-05-02 14:16           ` Michael Albinus
2020-05-01 18:40     ` João Távora
2020-05-02 10:51       ` Michael Albinus

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).