Subject: bug#1702: [PATCH]: feature request: correctly display single file zip archive

From: Eli Zaretskii <[email-masked]>
Date: Thu, 13 Nov 2014 20:50:26 +0200

> From: Matthew Leach <[email-masked]>
> Date: Thu, 13 Nov 2014 18:39:43 +0000
> Cc: [email-masked], Chong Yidong <[email-masked]>
> 
> xah lee <[email-masked]> writes:
> 
> > When opening a zip archive of a single file, emacs displays the zip
> > archive's index (which is just a single file), as opposed to the
> > decompressed file content.
> >
> > I think when the zip file is a single file, it is more useful to
> > display file content and allow transparent editing.
> 
> Please see the attached patch to implement this.

Thanks.

> Any comments welcome!

A comment: if the default is indeed going to be to automatically visit
such a compressed file (and I personally am not convinced it should),
then this is a user-visible change in behavior, so it should be
mentioned in NEWS, and the entry should describe how to get the old
behavior back.

> +(defcustom singular-file-archive-action 'visit-file
> +  "When opening an archive that contains a single file choose
> +whether to open the file or display the archive summary."

We use a certain style in doc strings of options: the first line
should be a complete sentence.  In addition, option names should begin
with the name of the package.

Also, this is just a boolean yes/no option, so no need to use a symbol
as its value.  Therefor, I suggest:

  (defcustom archive-visit-single-files t
    "If non-nil, opening an archive with a single file visits that file.

  If this option's value is nil, visiting such archives will display
  the archive summary."

(and the corresponding change in the code).