unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* TUTORIAL.gz
@ 2005-10-11 23:39 David Reitter
  2005-10-13 20:11 ` TUTORIAL.gz Richard M. Stallman
  0 siblings, 1 reply; 21+ messages in thread
From: David Reitter @ 2005-10-11 23:39 UTC (permalink / raw)


I would like to suggest to enable help-with-tutorial to load .gz  
files. This would allow site maintainers to compress the files,  
saving around 600K in installs of binary distributions. (info has no  
problems with gzipped files, which is very nice.)

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

* Re: TUTORIAL.gz
  2005-10-11 23:39 TUTORIAL.gz David Reitter
@ 2005-10-13 20:11 ` Richard M. Stallman
  2005-10-14  9:16   ` TUTORIAL.gz Werner LEMBERG
  2005-10-16 14:52   ` TUTORIAL.gz David Reitter
  0 siblings, 2 replies; 21+ messages in thread
From: Richard M. Stallman @ 2005-10-13 20:11 UTC (permalink / raw)
  Cc: emacs-devel

    I would like to suggest to enable help-with-tutorial to load .gz  
    files. This would allow site maintainers to compress the files,  
    saving around 600K in installs of binary distributions. (info has no  
    problems with gzipped files, which is very nice.)

It sounds good to me.  Would you like to write the patch?

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

* Re: TUTORIAL.gz
  2005-10-13 20:11 ` TUTORIAL.gz Richard M. Stallman
@ 2005-10-14  9:16   ` Werner LEMBERG
  2005-10-14 10:07     ` TUTORIAL.gz David Kastrup
  2005-10-16 14:52   ` TUTORIAL.gz David Reitter
  1 sibling, 1 reply; 21+ messages in thread
From: Werner LEMBERG @ 2005-10-14  9:16 UTC (permalink / raw)
  Cc: david.reitter, emacs-devel


>     I would like to suggest to enable help-with-tutorial to load .gz
>     files.  This would allow site maintainers to compress the files,
>     saving around 600K in installs of binary distributions.  (info
>     has no problems with gzipped files, which is very nice.)
> 
> It sounds good to me.  Would you like to write the patch?

Hmm, what about making Emacs install the tutorials compressed by
default?


    Werner

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

* Re: TUTORIAL.gz
  2005-10-14  9:16   ` TUTORIAL.gz Werner LEMBERG
@ 2005-10-14 10:07     ` David Kastrup
  2005-10-14 10:51       ` TUTORIAL.gz Werner LEMBERG
  0 siblings, 1 reply; 21+ messages in thread
From: David Kastrup @ 2005-10-14 10:07 UTC (permalink / raw)
  Cc: david.reitter, rms, emacs-devel

Werner LEMBERG <wl@gnu.org> writes:

>>     I would like to suggest to enable help-with-tutorial to load .gz
>>     files.  This would allow site maintainers to compress the files,
>>     saving around 600K in installs of binary distributions.  (info
>>     has no problems with gzipped files, which is very nice.)
>> 
>> It sounds good to me.  Would you like to write the patch?
>
> Hmm, what about making Emacs install the tutorials compressed by
> default?

I don't see the point in doing that when the info manuals remain
uncompressed at the same time.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: TUTORIAL.gz
  2005-10-14 10:07     ` TUTORIAL.gz David Kastrup
@ 2005-10-14 10:51       ` Werner LEMBERG
  2005-10-15 16:13         ` TUTORIAL.gz Richard M. Stallman
  0 siblings, 1 reply; 21+ messages in thread
From: Werner LEMBERG @ 2005-10-14 10:51 UTC (permalink / raw)
  Cc: david.reitter, rms, emacs-devel

> > Hmm, what about making Emacs install the tutorials compressed by
> > default?
> 
> I don't see the point in doing that when the info manuals remain
> uncompressed at the same time.

Well, then let's compress the info files too.


    Werner

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

* Re: TUTORIAL.gz
@ 2005-10-14 11:25 LENNART BORGMAN
  2005-10-15 12:43 ` TUTORIAL.gz Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: LENNART BORGMAN @ 2005-10-14 11:25 UTC (permalink / raw)
  Cc: david.reitter, rms, emacs-devel

From: David Kastrup <dak@gnu.org>

> Werner LEMBERG <wl@gnu.org> writes:
> 
> >>     I would like to suggest to enable help-with-tutorial to 
> load .gz
> >>     files.  This would allow site maintainers to compress the 
> files,>>     saving around 600K in installs of binary 
> distributions.  (info
> >>     has no problems with gzipped files, which is very nice.)
> >> 
> >> It sounds good to me.  Would you like to write the patch?
> >
> > Hmm, what about making Emacs install the tutorials compressed by
> > default?
> 
> I don't see the point in doing that when the info manuals remain
> uncompressed at the same time.

Does not compression create some difficulties for w32 users?

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

* Re: TUTORIAL.gz
  2005-10-14 11:25 TUTORIAL.gz LENNART BORGMAN
@ 2005-10-15 12:43 ` Eli Zaretskii
  2005-10-15 19:19   ` TUTORIAL.gz David Kastrup
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2005-10-15 12:43 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Fri, 14 Oct 2005 13:25:57 +0200
> From: LENNART BORGMAN <lennart.borgman.073@student.lu.se>
> Cc: david.reitter@gmail.com, rms@gnu.org, emacs-devel@gnu.org
> 
> Does not compression create some difficulties for w32 users?

They need gzip to be installed.  So yes, it does add a difficulty,
since stock Windows systems don't have gzip.

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

* Re: TUTORIAL.gz
  2005-10-14 10:51       ` TUTORIAL.gz Werner LEMBERG
@ 2005-10-15 16:13         ` Richard M. Stallman
  0 siblings, 0 replies; 21+ messages in thread
From: Richard M. Stallman @ 2005-10-15 16:13 UTC (permalink / raw)
  Cc: david.reitter, emacs-devel

    > I don't see the point in doing that when the info manuals remain
    > uncompressed at the same time.

    Well, then let's compress the info files too.

It is not crucial whether we do this.  (That is not just an Emacs
question.)  The point is, accessing compressed info files works; if
the sysadmin compresses them, it works.

The proposal here is that accessing compresses tutorial files should
work too.  But since that is just an Emacs question, we might then
want to distribute them compressed.

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

* Re: TUTORIAL.gz
  2005-10-15 12:43 ` TUTORIAL.gz Eli Zaretskii
@ 2005-10-15 19:19   ` David Kastrup
  0 siblings, 0 replies; 21+ messages in thread
From: David Kastrup @ 2005-10-15 19:19 UTC (permalink / raw)
  Cc: LENNART BORGMAN, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Fri, 14 Oct 2005 13:25:57 +0200
>> From: LENNART BORGMAN <lennart.borgman.073@student.lu.se>
>> Cc: david.reitter@gmail.com, rms@gnu.org, emacs-devel@gnu.org
>> 
>> Does not compression create some difficulties for w32 users?
>
> They need gzip to be installed.  So yes, it does add a difficulty,
> since stock Windows systems don't have gzip.

Anybody want to try his hand at a CCL-Program for gunzipping?

Just kidding.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: TUTORIAL.gz
  2005-10-13 20:11 ` TUTORIAL.gz Richard M. Stallman
  2005-10-14  9:16   ` TUTORIAL.gz Werner LEMBERG
@ 2005-10-16 14:52   ` David Reitter
  2005-10-17  8:34     ` TUTORIAL.gz Juri Linkov
  2005-10-17 14:59     ` TUTORIAL.gz Eli Zaretskii
  1 sibling, 2 replies; 21+ messages in thread
From: David Reitter @ 2005-10-16 14:52 UTC (permalink / raw)
  Cc: emacs-devel

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

On 13 Oct 2005, at 21:11, Richard M. Stallman wrote:

>     I would like to suggest to enable help-with-tutorial to load .gz
>     files. This would allow site maintainers to compress the files,
>     saving around 600K in installs of binary distributions. (info  
> has no
>     problems with gzipped files, which is very nice.)
>
> It sounds good to me.  Would you like to write the patch?
>

OK. In addition to applying the patch below, someone might want to  
change the Makefile to gzip the appropriate files on non-Windows  
machines. I have no intuition about how to do that.


2005-10-15  David Reitter <david.reitter@gmail.com>

     * help-fns.el (help-with-tutorial): Allow tutorial files to be
     compressed with gzip.
     * help.el (describe-*): Allow read files to be compressed with  
gzip.
     (view-possibly-compressed-file): new function to read a compressed
     file.
     (describe-extra-packages): moved here from menu-bar.el
     * menu-bar.el (menu-bar-help-extra-packages): moved to help.el.



[-- Attachment #2: compress-help.patch --]
[-- Type: application/octet-stream, Size: 9230 bytes --]

Index: lisp/help.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/help.el,v
retrieving revision 1.284
diff -c -r1.284 help.el
*** lisp/help.el	6 Aug 2005 22:13:43 -0000	1.284
--- lisp/help.el	16 Oct 2005 14:50:25 -0000
***************
*** 282,305 ****
  	      (setq sym (intern-soft (match-string 1 str)))
  	      (and (fboundp sym) sym)))))))
  
  \f
  ;;; `User' help functions
  
  (defun describe-distribution ()
    "Display info on how to obtain the latest version of GNU Emacs."
    (interactive)
!   (view-file (expand-file-name "DISTRIB" data-directory)))
  
  (defun describe-copying ()
    "Display info on how you may redistribute copies of GNU Emacs."
    (interactive)
!   (view-file (expand-file-name "COPYING" data-directory))
    (goto-char (point-min)))
  
  (defun describe-project ()
    "Display info on the GNU project."
    (interactive)
!   (view-file (expand-file-name "THE-GNU-PROJECT" data-directory))
    (goto-char (point-min)))
  
  (defun describe-no-warranty ()
--- 282,321 ----
  	      (setq sym (intern-soft (match-string 1 str)))
  	      (and (fboundp sym) sym)))))))
  
+ (defun view-possibly-compressed-file (file)
+   (let ((auto-compression-mode t))
+     (view-file
+      (if (and
+ 	  (not (file-exists-p file))
+ 	  (file-exists-p (concat file ".gz")))
+ 	 (concat file ".gz")
+        file))))
+ 
  \f
  ;;; `User' help functions
  
  (defun describe-distribution ()
    "Display info on how to obtain the latest version of GNU Emacs."
    (interactive)
!   (view-possibly-compressed-file (expand-file-name "DISTRIB" data-directory)))
  
+ (defun describe-extra-packages ()
+   "Display info on some additional packages available for GNU Emacs."
+   (interactive)
+   (let (enable-local-variables)
+     (view-possibly-compressed-file (expand-file-name "MORE.STUFF" data-directory))
+     (goto-address)))
+  
  (defun describe-copying ()
    "Display info on how you may redistribute copies of GNU Emacs."
    (interactive)
!   (view-possibly-compressed-file (expand-file-name "COPYING" data-directory))
    (goto-char (point-min)))
  
  (defun describe-project ()
    "Display info on the GNU project."
    (interactive)
!   (view-possibly-compressed-file (expand-file-name "THE-GNU-PROJECT" data-directory))
    (goto-char (point-min)))
  
  (defun describe-no-warranty ()
***************
*** 329,340 ****
  ;; run describe-prefix-bindings.
  (setq prefix-help-command 'describe-prefix-bindings)
  
  (defun view-emacs-news (&optional arg)
    "Display info on recent changes to Emacs.
  With argument, display info only for the selected version."
    (interactive "P")
    (if (not arg)
!       (view-file (expand-file-name "NEWS" data-directory))
      (let* ((map (sort
                   (delete-dups
                    (apply
--- 345,357 ----
  ;; run describe-prefix-bindings.
  (setq prefix-help-command 'describe-prefix-bindings)
  
+ 
  (defun view-emacs-news (&optional arg)
    "Display info on recent changes to Emacs.
  With argument, display info only for the selected version."
    (interactive "P")
    (if (not arg)
!       (view-possibly-compressed-file (expand-file-name "NEWS" data-directory))
      (let* ((map (sort
                   (delete-dups
                    (apply
***************
*** 365,371 ****
             res)
        (if (not file)
            (error "No news is good news")
!         (view-file (expand-file-name file data-directory))
          (widen)
          (goto-char (point-min))
          (when (re-search-forward
--- 382,388 ----
             res)
        (if (not file)
            (error "No news is good news")
!         (view-fileview-possibly-compressed-file (expand-file-name file data-directory))
          (widen)
          (goto-char (point-min))
          (when (re-search-forward
***************
*** 390,396 ****
  (defun view-todo (&optional arg)
    "Display the Emacs TODO list."
    (interactive "P")
!   (view-file (expand-file-name "TODO" data-directory)))
  
  (defun view-echo-area-messages ()
    "View the log of recent echo-area messages: the `*Messages*' buffer.
--- 407,413 ----
  (defun view-todo (&optional arg)
    "Display the Emacs TODO list."
    (interactive "P")
!   (view-possibly-compressed-file (expand-file-name "TODO" data-directory)))
  
  (defun view-echo-area-messages ()
    "View the log of recent echo-area messages: the `*Messages*' buffer.
***************
*** 402,408 ****
  (defun view-order-manuals ()
    "Display the Emacs ORDERS file."
    (interactive)
!   (view-file (expand-file-name "ORDERS" data-directory))
    (goto-address))
  
  (defun view-emacs-FAQ ()
--- 419,425 ----
  (defun view-order-manuals ()
    "Display the Emacs ORDERS file."
    (interactive)
!   (view-possibly-compressed-file (expand-file-name "ORDERS" data-directory))
    (goto-address))
  
  (defun view-emacs-FAQ ()
***************
*** 414,420 ****
  (defun view-emacs-problems ()
    "Display info on known problems with Emacs and possible workarounds."
    (interactive)
!   (view-file (expand-file-name "PROBLEMS" data-directory)))
  
  (defun view-lossage ()
    "Display last 100 input keystrokes.
--- 431,437 ----
  (defun view-emacs-problems ()
    "Display info on known problems with Emacs and possible workarounds."
    (interactive)
!   (view-possibly-compressed-file (expand-file-name "PROBLEMS" data-directory)))
  
  (defun view-lossage ()
    "Display last 100 input keystrokes.
Index: lisp/help-fns.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/help-fns.el,v
retrieving revision 1.75
diff -c -r1.75 help-fns.el
*** lisp/help-fns.el	13 Sep 2005 14:58:35 -0000	1.75
--- lisp/help-fns.el	16 Oct 2005 14:50:25 -0000
***************
*** 52,68 ****
  		(if (get-language-info current-language-environment 'tutorial)
  		    current-language-environment
  		  "English")))
! 	file filename)
      (setq filename (get-language-info lang 'tutorial))
      (setq file (expand-file-name (concat "~/" filename)))
      (delete-other-windows)
      (if (get-file-buffer file)
  	(switch-to-buffer (get-file-buffer file))
!       (switch-to-buffer (create-file-buffer file))
        (setq buffer-file-name file)
        (setq default-directory (expand-file-name "~/"))
        (setq buffer-auto-save-file-name nil)
-       (insert-file-contents (expand-file-name filename data-directory))
        (hack-local-variables)
        (goto-char (point-min))
        (search-forward "\n<<")
--- 52,73 ----
  		(if (get-language-info current-language-environment 'tutorial)
  		    current-language-environment
  		  "English")))
! 	file filename) 
      (setq filename (get-language-info lang 'tutorial))
      (setq file (expand-file-name (concat "~/" filename)))
      (delete-other-windows)
      (if (get-file-buffer file)
  	(switch-to-buffer (get-file-buffer file))
!       (setq file (expand-file-name filename data-directory))
!       (unless (file-exists-p file) 
! 	(if (file-exists-p (concat file ".gz"))
! 	    (setq file (concat file ".gz"))
! 	  (error "%s does not exist" file)))
!       (let ((auto-compression-mode t))
! 	(find-file file))
        (setq buffer-file-name file)
        (setq default-directory (expand-file-name "~/"))
        (setq buffer-auto-save-file-name nil)
        (hack-local-variables)
        (goto-char (point-min))
        (search-forward "\n<<")
Index: lisp/menu-bar.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/menu-bar.el,v
retrieving revision 1.273
diff -c -r1.273 menu-bar.el
*** lisp/menu-bar.el	10 Sep 2005 10:55:14 -0000	1.273
--- lisp/menu-bar.el	16 Oct 2005 14:50:28 -0000
***************
*** 1356,1371 ****
    '(menu-item "Getting New Versions" describe-distribution
  	      :help "How to get latest versions of Emacs"))
  (define-key menu-bar-help-menu [more]
!   '(menu-item "Find Extra Packages"
! 	      menu-bar-help-extra-packages
  	      :help "Where to find some extra packages and possible updates"))
- (defun menu-bar-help-extra-packages ()
-   "Display help about some additional packages available for Emacs."
-   (interactive)
-   (let (enable-local-variables)
-     (view-file (expand-file-name "MORE.STUFF"
- 				 data-directory))
-     (goto-address)))
  (define-key menu-bar-help-menu [about]
    '(menu-item "About Emacs" display-splash-screen
  	      :help "Display version number, copyright info, and basic help"))
--- 1356,1363 ----
    '(menu-item "Getting New Versions" describe-distribution
  	      :help "How to get latest versions of Emacs"))
  (define-key menu-bar-help-menu [more]
!   '(menu-item "Find Extra Packages" describe-extra-packages
  	      :help "Where to find some extra packages and possible updates"))
  (define-key menu-bar-help-menu [about]
    '(menu-item "About Emacs" display-splash-screen
  	      :help "Display version number, copyright info, and basic help"))

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: TUTORIAL.gz
  2005-10-16 14:52   ` TUTORIAL.gz David Reitter
@ 2005-10-17  8:34     ` Juri Linkov
  2005-10-17 14:46       ` TUTORIAL.gz Stefan Monnier
  2005-10-17 14:59     ` TUTORIAL.gz Eli Zaretskii
  1 sibling, 1 reply; 21+ messages in thread
From: Juri Linkov @ 2005-10-17  8:34 UTC (permalink / raw)
  Cc: rms, emacs-devel

-       (insert-file-contents (expand-file-name filename data-directory))
        (hack-local-variables)
        (goto-char (point-min))
        (search-forward "\n<<")
--- 52,73 ----
  		(if (get-language-info current-language-environment 'tutorial)
  		    current-language-environment
  		  "English")))
! 	file filename) 
      (setq filename (get-language-info lang 'tutorial))
      (setq file (expand-file-name (concat "~/" filename)))
      (delete-other-windows)
      (if (get-file-buffer file)
  	(switch-to-buffer (get-file-buffer file))
!       (setq file (expand-file-name filename data-directory))
!       (unless (file-exists-p file) 
! 	(if (file-exists-p (concat file ".gz"))
! 	    (setq file (concat file ".gz"))
! 	  (error "%s does not exist" file)))
!       (let ((auto-compression-mode t))
! 	(find-file file))
         =========

Note that insert-file-contents on a special buffer was used to protect
novices for accidently overwriting the original TUTORIAL file while
trying different editing commands.  So replacing it with find-file is
not a good idea.   But you can still leave insert-file-contents with
let-binding ((auto-compression-mode t)) around it, because compression
mode can handle compressed files on low-level file functions (including
insert-file-contents).

-- 
Juri Linkov
http://www.jurta.org/emacs/

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

* Re: TUTORIAL.gz
  2005-10-17  8:34     ` TUTORIAL.gz Juri Linkov
@ 2005-10-17 14:46       ` Stefan Monnier
  2005-10-17 16:03         ` TUTORIAL.gz David Reitter
  0 siblings, 1 reply; 21+ messages in thread
From: Stefan Monnier @ 2005-10-17 14:46 UTC (permalink / raw)
  Cc: David Reitter, rms, emacs-devel

> !       (setq file (expand-file-name filename data-directory))
> !       (unless (file-exists-p file) 
> ! 	(if (file-exists-p (concat file ".gz"))
> ! 	    (setq file (concat file ".gz"))
> ! 	  (error "%s does not exist" file)))
> !       (let ((auto-compression-mode t))
> ! 	(find-file file))
>          =========

> Note that insert-file-contents on a special buffer was used to protect
> novices for accidently overwriting the original TUTORIAL file while
> trying different editing commands.  So replacing it with find-file is
> not a good idea.   But you can still leave insert-file-contents with
> let-binding ((auto-compression-mode t)) around it, because compression
> mode can handle compressed files on low-level file functions (including
> insert-file-contents).

Agreed.  Except that let-binding auto-compression-mode doesn't do much
if anything.  Better just check whether auto-compression-mode is nil and if
so don't try to load the .gz file.

Actually, jka-compr.el should provide a list of extensions it understands,
so we wouldn't have to hard-code .gz here.  I guess jka-compr-load-suffixes
could be used for that.  The code in info.el that handles compressed files
could/should also be merged in.


        Stefan

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

* Re: TUTORIAL.gz
  2005-10-16 14:52   ` TUTORIAL.gz David Reitter
  2005-10-17  8:34     ` TUTORIAL.gz Juri Linkov
@ 2005-10-17 14:59     ` Eli Zaretskii
  2005-10-17 15:22       ` TUTORIAL.gz Romain Francoise
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2005-10-17 14:59 UTC (permalink / raw)
  Cc: rms, emacs-devel

> From: David Reitter <david.reitter@gmail.com>
> Date: Sun, 16 Oct 2005 15:52:57 +0100
> Cc: emacs-devel@gnu.org
> 
> someone might want to change the Makefile to gzip the appropriate
> files on non-Windows machines.

FWIW, I find no compelling reason to do that.  TUTORIAL.* files are
relatively small (circa 50KB), so the disk space reclaimed by
compressing them would be minimal.

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

* Re: TUTORIAL.gz
  2005-10-17 14:59     ` TUTORIAL.gz Eli Zaretskii
@ 2005-10-17 15:22       ` Romain Francoise
  0 siblings, 0 replies; 21+ messages in thread
From: Romain Francoise @ 2005-10-17 15:22 UTC (permalink / raw)


Eli Zaretskii <eliz@gnu.org> writes:

> FWIW, I find no compelling reason to do that.  TUTORIAL.* files are
> relatively small (circa 50KB), so the disk space reclaimed by
> compressing them would be minimal.

Yup.

(A much larger gain is to compress .el files at install time.  Since
they're usually installed in a read-only location users can't edit them
anyway, and thanks to auto-compression-mode Emacs can find them without
problems.  In Debian, this resulted in a size decrease of about 28MB.
But this is obviously very system-specific and not desirable by
default.)

-- 
Romain Francoise <romain@orebokech.com> | I used to think there is no
it's a miracle -- http://orebokech.com/ | future left at all.

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

* Re: TUTORIAL.gz
  2005-10-17 14:46       ` TUTORIAL.gz Stefan Monnier
@ 2005-10-17 16:03         ` David Reitter
  2005-10-17 16:20           ` TUTORIAL.gz David Kastrup
  2005-10-17 17:48           ` TUTORIAL.gz Stefan Monnier
  0 siblings, 2 replies; 21+ messages in thread
From: David Reitter @ 2005-10-17 16:03 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

On 17 Oct 2005, at 15:46, Stefan Monnier wrote:
>
> Agreed.  Except that let-binding auto-compression-mode doesn't do much
> if anything.  Better just check whether auto-compression-mode is  
> nil and if
> so don't try to load the .gz file.

Seems like I got confused by instructions from jka-compr.el:

;; To use jka-compr, invoke the command `auto-compression-mode' (which
;; see), or customize the variable of the same name.  Its operation
;; should be transparent to the user (except for messages appearing when
;; a file is being compressed or uncompressed).

The DOC strings are much clearer regarding this issue.

Shouldn't we better enable auto-compression-mode temporarily if it is  
switched off? I mean, if a site-wide installation (or distribution)  
compresses stuff like tutorials and, more importantly, things like  
NEWS, then Emacs should load these files on request no matter whether  
the user has turned off auto-compression-mode. It would be seen as a  
bug if it didn't.


> Actually, jka-compr.el should provide a list of extensions it  
> understands,
> so we wouldn't have to hard-code .gz here.  I guess jka-compr-load- 
> suffixes
> could be used for that.

Isn't it more than enough to support distribution-wide .gz compression?

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

* Re: TUTORIAL.gz
  2005-10-17 16:03         ` TUTORIAL.gz David Reitter
@ 2005-10-17 16:20           ` David Kastrup
  2005-10-17 17:48           ` TUTORIAL.gz Stefan Monnier
  1 sibling, 0 replies; 21+ messages in thread
From: David Kastrup @ 2005-10-17 16:20 UTC (permalink / raw)
  Cc: Juri Linkov, emacs-devel, Stefan Monnier, rms

David Reitter <david.reitter@gmail.com> writes:

> On 17 Oct 2005, at 15:46, Stefan Monnier wrote:
>>
>> Agreed.  Except that let-binding auto-compression-mode doesn't do much
>> if anything.  Better just check whether auto-compression-mode is
>> nil and if
>> so don't try to load the .gz file.
>
> Seems like I got confused by instructions from jka-compr.el:
>
> ;; To use jka-compr, invoke the command `auto-compression-mode' (which
> ;; see), or customize the variable of the same name.  Its operation
> ;; should be transparent to the user (except for messages appearing when
> ;; a file is being compressed or uncompressed).
>
> The DOC strings are much clearer regarding this issue.
>
> Shouldn't we better enable auto-compression-mode temporarily if it is
> switched off?

Maybe buffer-local is somehow workable?  This would have the added
advantage that if the user managed to edit and save the buffer, it
would get recompressed even if global auto-compression-mode was off.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: TUTORIAL.gz
  2005-10-17 16:03         ` TUTORIAL.gz David Reitter
  2005-10-17 16:20           ` TUTORIAL.gz David Kastrup
@ 2005-10-17 17:48           ` Stefan Monnier
  2005-10-17 18:47             ` TUTORIAL.gz Lennart Borgman
  1 sibling, 1 reply; 21+ messages in thread
From: Stefan Monnier @ 2005-10-17 17:48 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

> Shouldn't we better enable auto-compression-mode temporarily if it is
> switched off? I mean, if a site-wide installation (or distribution)
> compresses stuff like tutorials and, more importantly, things like  NEWS,
> then Emacs should load these files on request no matter whether  the user
> has turned off auto-compression-mode. It would be seen as a  bug if it
> didn't.

I don't think we should worry about this.


        Stefan

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

* Re: TUTORIAL.gz
  2005-10-17 17:48           ` TUTORIAL.gz Stefan Monnier
@ 2005-10-17 18:47             ` Lennart Borgman
  2005-10-17 19:08               ` TUTORIAL.gz Stefan Monnier
  0 siblings, 1 reply; 21+ messages in thread
From: Lennart Borgman @ 2005-10-17 18:47 UTC (permalink / raw)
  Cc: Juri Linkov, David Reitter, rms, emacs-devel

Stefan Monnier wrote:

>>Shouldn't we better enable auto-compression-mode temporarily if it is
>>switched off? I mean, if a site-wide installation (or distribution)
>>compresses stuff like tutorials and, more importantly, things like  NEWS,
>>then Emacs should load these files on request no matter whether  the user
>>has turned off auto-compression-mode. It would be seen as a  bug if it
>>didn't.
>>    
>>
>
>I don't think we should worry about this.
>
>
>        Stefan
>  
>
Can you explain why not?

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

* Re: TUTORIAL.gz
  2005-10-17 18:47             ` TUTORIAL.gz Lennart Borgman
@ 2005-10-17 19:08               ` Stefan Monnier
  2005-10-17 19:33                 ` TUTORIAL.gz Lennart Borgman
  0 siblings, 1 reply; 21+ messages in thread
From: Stefan Monnier @ 2005-10-17 19:08 UTC (permalink / raw)
  Cc: Juri Linkov, David Reitter, rms, emacs-devel

>>> Shouldn't we better enable auto-compression-mode temporarily if it is
>>> switched off? I mean, if a site-wide installation (or distribution)
>>> compresses stuff like tutorials and, more importantly, things like  NEWS,
>>> then Emacs should load these files on request no matter whether  the user
>>> has turned off auto-compression-mode. It would be seen as a  bug if it
>>> didn't.
>> I don't think we should worry about this.
> Can you explain why not?

Because it's unlikely (how many people are going to disable
auto-compression-mode, really?  how many of those will run in an
environment where the TUTORIAL files are compressed?  how many of those
will want to read the tutorial?), and even if it ever happens I don't think
it'll be terrible.  Rather than force auto-compression-mode ON temporarily,
if you really insist on handling this case, just detect it and output
a warning like "can't read it 'cause you foolishly disabled
auto-compression-mode".


        Stefan

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

* Re: TUTORIAL.gz
  2005-10-17 19:08               ` TUTORIAL.gz Stefan Monnier
@ 2005-10-17 19:33                 ` Lennart Borgman
  2005-10-18  8:04                   ` TUTORIAL.gz Juri Linkov
  0 siblings, 1 reply; 21+ messages in thread
From: Lennart Borgman @ 2005-10-17 19:33 UTC (permalink / raw)
  Cc: Juri Linkov, David Reitter, rms, emacs-devel

Stefan Monnier wrote:

>Because it's unlikely (how many people are going to disable
>auto-compression-mode, really?  how many of those will run in an
>environment where the TUTORIAL files are compressed?  how many of those
>will want to read the tutorial?), and even if it ever happens I don't think
>it'll be terrible.  Rather than force auto-compression-mode ON temporarily,
>if you really insist on handling this case, just detect it and output
>a warning like "can't read it 'cause you foolishly disabled
>auto-compression-mode".
>  
>
I think the warning is a good alternative. It would be very good if this 
also could handle the case when there is no software available to handle 
the compression (as might be the case on w32) in other situations (than 
accessing tutorials etc).

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

* Re: TUTORIAL.gz
  2005-10-17 19:33                 ` TUTORIAL.gz Lennart Borgman
@ 2005-10-18  8:04                   ` Juri Linkov
  0 siblings, 0 replies; 21+ messages in thread
From: Juri Linkov @ 2005-10-18  8:04 UTC (permalink / raw)
  Cc: david.reitter, emacs-devel, monnier, rms

> I think the warning is a good alternative. It would be very good if this
> also could handle the case when there is no software available to handle
> the compression (as might be the case on w32) in other situations (than
> accessing tutorials etc).

The warning it currently gives on Debian GNU/Linux after removing gzip and
trying to open a compressed file looks like:

    Error while executing "gzip -c -q -d < filename.gz"
    /bin/sh: gzip: command not found

It seems it is already quite informative.

-- 
Juri Linkov
http://www.jurta.org/emacs/

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

end of thread, other threads:[~2005-10-18  8:04 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-11 23:39 TUTORIAL.gz David Reitter
2005-10-13 20:11 ` TUTORIAL.gz Richard M. Stallman
2005-10-14  9:16   ` TUTORIAL.gz Werner LEMBERG
2005-10-14 10:07     ` TUTORIAL.gz David Kastrup
2005-10-14 10:51       ` TUTORIAL.gz Werner LEMBERG
2005-10-15 16:13         ` TUTORIAL.gz Richard M. Stallman
2005-10-16 14:52   ` TUTORIAL.gz David Reitter
2005-10-17  8:34     ` TUTORIAL.gz Juri Linkov
2005-10-17 14:46       ` TUTORIAL.gz Stefan Monnier
2005-10-17 16:03         ` TUTORIAL.gz David Reitter
2005-10-17 16:20           ` TUTORIAL.gz David Kastrup
2005-10-17 17:48           ` TUTORIAL.gz Stefan Monnier
2005-10-17 18:47             ` TUTORIAL.gz Lennart Borgman
2005-10-17 19:08               ` TUTORIAL.gz Stefan Monnier
2005-10-17 19:33                 ` TUTORIAL.gz Lennart Borgman
2005-10-18  8:04                   ` TUTORIAL.gz Juri Linkov
2005-10-17 14:59     ` TUTORIAL.gz Eli Zaretskii
2005-10-17 15:22       ` TUTORIAL.gz Romain Francoise
  -- strict thread matches above, loose matches on Subject: below --
2005-10-14 11:25 TUTORIAL.gz LENNART BORGMAN
2005-10-15 12:43 ` TUTORIAL.gz Eli Zaretskii
2005-10-15 19:19   ` TUTORIAL.gz David Kastrup

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