unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Support for a new file format
@ 2021-12-04 11:40 Peter Dyballa
  2021-12-04 19:06 ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Dyballa @ 2021-12-04 11:40 UTC (permalink / raw)
  To: help-gnu-emacs

Hello!

Rust, https://www.rust-lang.org, has additional files that have file names ending in .crate. The file command says they are GZipped. So I created a hard-link file.gz from a crate file and looked in GNU Emacs 27.2 into it. It looked like a TAR file, so a CRATE file must be a GZipped TAR file:

	pete 65 /\ tar -vtf yansi-term-0.1.2.crate
	-rw-r--r--  0 0      0          74 31 Mai  2020 yansi-term-0.1.2/.cargo_vcs_info.json
	-rw-r--r--  0 1000   1000      860 31 Mai  2020 yansi-term-0.1.2/.github/workflows/checks.yml
	-rw-r--r--  0 1000   1000     1629 31 Mai  2020 yansi-term-0.1.2/.github/workflows/linux.yml
	-rw-r--r--  0 1000   1000     1469 31 Mai  2020 yansi-term-0.1.2/.github/workflows/osx.yml
	-rw-r--r--  0 1000   1000       25 31 Mai  2020 yansi-term-0.1.2/.gitignore
	-rw-r--r--  0 1000   1000      529 31 Mai  2020 yansi-term-0.1.2/.travis.yml
	-rw-r--r--  0 0      0        4415 31 Mai  2020 yansi-term-0.1.2/Cargo.lock
	-rw-r--r--  0 0      0        1549 31 Mai  2020 yansi-term-0.1.2/Cargo.toml
	-rw-r--r--  0 1000   1000      983 31 Mai  2020 yansi-term-0.1.2/Cargo.toml.orig
	-rw-r--r--  0 1000   1000     1080 31 Mai  2020 yansi-term-0.1.2/LICENCE
	-rw-r--r--  0 1000   1000     4203 31 Mai  2020 yansi-term-0.1.2/README.md
	-rw-r--r--  0 1000   1000     1626 31 Mai  2020 yansi-term-0.1.2/examples/256_colours.rs
	-rw-r--r--  0 1000   1000      816 31 Mai  2020 yansi-term-0.1.2/examples/basic_colours.rs
	-rw-r--r--  0 1000   1000      425 31 Mai  2020 yansi-term-0.1.2/examples/overwrite.rs
	-rw-r--r--  0 1000   1000      592 31 Mai  2020 yansi-term-0.1.2/examples/rgb_colours.rs
	-rw-r--r--  0 1000   1000    12938 31 Mai  2020 yansi-term-0.1.2/src/ansi.rs
	-rw-r--r--  0 1000   1000     2103 31 Mai  2020 yansi-term-0.1.2/src/display.rs
	-rw-r--r--  0 1000   1000     5999 31 Mai  2020 yansi-term-0.1.2/src/lib.rs
	-rw-r--r--  0 1000   1000    14209 31 Mai  2020 yansi-term-0.1.2/src/style.rs
	-rw-r--r--  0 1000   1000     2375 31 Mai  2020 yansi-term-0.1.2/src/windows.rs

Could next version of GNU Emacs support this for dired-mode/jka-compression-mode?

--
Greetings

  Pete

It is so hot in some places that the people there have to live in other places.




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

* Re: Support for a new file format
  2021-12-04 11:40 Support for a new file format Peter Dyballa
@ 2021-12-04 19:06 ` Michael Albinus
  2021-12-04 20:02   ` Peter Dyballa
  2021-12-04 22:14   ` Peter Dyballa
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Albinus @ 2021-12-04 19:06 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Hello!

Hi Peter,

> Rust, https://www.rust-lang.org, has additional files that have file
> names ending in .crate.
>
> Could next version of GNU Emacs support this for dired-mode/jka-compression-mode?

I've added this to Tramp archives. That is, if you have a file "/path/to/file.crate",
open it with "C-x C-f /path/to/file.crate/" (the trailing slash matters).
Works on GNU/Linux systems only.

Pushed to Emacs master. Will also be part of Tramp 2.6 on GNU ELPA, but
this isn't ready yet for distribution.

> Greetings
>
>   Pete

Best regards, Michael.



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

* Re: Support for a new file format
  2021-12-04 19:06 ` Michael Albinus
@ 2021-12-04 20:02   ` Peter Dyballa
  2021-12-05  8:04     ` Michael Albinus
  2021-12-07 22:43     ` Peter Dyballa
  2021-12-04 22:14   ` Peter Dyballa
  1 sibling, 2 replies; 7+ messages in thread
From: Peter Dyballa @ 2021-12-04 20:02 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs


> Am 4.12.2021 um 20:06 schrieb Michael Albinus <michael.albinus@gmx.de>:
> 
> Pushed to Emacs master. Will also be part of Tramp 2.6 on GNU ELPA, but
> this isn't ready yet for distribution.

Just made a test: adding this file extension as belonging to tar-mode into auto-mode-alist isn't sufficient! The archive is opened, but it is close to nonsense, a one-liner, that is displayed. Alright, I'll dig a bit deeper…

Recently I received the message that GNU Emacs 28.0.90 is out. Is the time already too short to add this particle?

--
Mit friedvollen Grüßen

  Pete

UNIX is user friendly, it's just picky about who its friends are.




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

* Re: Support for a new file format
  2021-12-04 19:06 ` Michael Albinus
  2021-12-04 20:02   ` Peter Dyballa
@ 2021-12-04 22:14   ` Peter Dyballa
  2021-12-04 22:52     ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Dyballa @ 2021-12-04 22:14 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

It worked for me to interactively edit jka-compr-compression-info-list to contain

     ["\\.crate\\'" "" "" nil "decompressing CRATE archive" "gzip"
      ("-c" "-q" "-d" "-S crate")
      t nil "\x1f\213"]

and to augment with

     (add-to-list 'auto-mode-alist '("\\.crate\\'" . tar-mode))


For me creating a CRATE archive is not important, I just want to know what is inside. I even do not know whether there is a way to create a TAR archive in dire-mode…

--
Mit friedvollen Grüßen

  Pete

I wouldn't recommend sex, drugs or insanity for everyone, but they've always worked for me.
				– Hunter S. Thompson




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

* Re: Support for a new file format
  2021-12-04 22:14   ` Peter Dyballa
@ 2021-12-04 22:52     ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 7+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-12-04 22:52 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa wrote:

> For me creating a CRATE archive is not important, I just
> want to know what is inside.

Okay ...

> I even do not know whether there is a way to create a TAR
> archive in dire-mode ...

`shell-command'. Set up a defun specifically for tar.

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Support for a new file format
  2021-12-04 20:02   ` Peter Dyballa
@ 2021-12-05  8:04     ` Michael Albinus
  2021-12-07 22:43     ` Peter Dyballa
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Albinus @ 2021-12-05  8:04 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

Hi Peter,

> Recently I received the message that GNU Emacs 28.0.90 is out. Is the time already too short to add this particle?

Likely yes (but it is up to the maintainers to decide). Perhaps it could
be added after the release, for Emacs 28.2.

> Mit friedvollen Grüßen
>
>   Pete

Best regards, Michael.



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

* Re: Support for a new file format
  2021-12-04 20:02   ` Peter Dyballa
  2021-12-05  8:04     ` Michael Albinus
@ 2021-12-07 22:43     ` Peter Dyballa
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Dyballa @ 2021-12-07 22:43 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Michael Albinus

While trying to compile GNU Emacs 28.0.90 I patched it, and adding the addition to auto-mode-alist GNU Emacs 28.0.90 could easily open CRATE archive files and walk me though the archive members:


--- lisp/jka-cmpr-hook.el~	2021-12-01 21:37:09.000000000 +0100
+++ lisp/jka-cmpr-hook.el	2021-12-07 22:43:15.000000000 +0100
@@ -261,7 +261,11 @@
     ["\\.tzst\\'"
      "zstd compressing"   "zstd"         ("-c" "-q")
      "zstd uncompressing" "zstd"         ("-c" "-q" "-d")
-     t nil "\050\265\057\375"]))
+     t nil "\050\265\057\375"]
+    ["\\.crate\\'"
+     "" "" nil
+     "decompressing CRATE archive" "gzip" ("-c" "-q" "-d" "-S .crate")
+      t nil "\x1f\213"]))
 
   "List of vectors that describe available compression techniques.
 Each element, which describes a compression technique, is a vector of



It works very fine: PNG archive members are displayed graphically and YAML files are displayed in yaml-mode. Ordinary TAR files are still handled as usual.

--
Greetings

  Pete

Film is a dog: the head is commerce, the tail is art. And only rarely does the tail wag the dog.
				– Joseph Losey




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

end of thread, other threads:[~2021-12-07 22:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-04 11:40 Support for a new file format Peter Dyballa
2021-12-04 19:06 ` Michael Albinus
2021-12-04 20:02   ` Peter Dyballa
2021-12-05  8:04     ` Michael Albinus
2021-12-07 22:43     ` Peter Dyballa
2021-12-04 22:14   ` Peter Dyballa
2021-12-04 22:52     ` Emanuel Berg via Users list for the GNU Emacs text editor

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).