unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to disable file extension auto-detection or auto-action?
@ 2011-03-21  8:12 Tadeus (Eus) Prastowo
  2011-03-22 12:17 ` Andrea Crotti
  0 siblings, 1 reply; 8+ messages in thread
From: Tadeus (Eus) Prastowo @ 2011-03-21  8:12 UTC (permalink / raw)
  To: help-gnu-emacs

Hi!

When working on a bug in apt-cacher[1], I needed to read the content
of *.bz2 files that actually were only text files. But, every time I
open a .bz2 file, Emacs sees the extension and does auto-decompression
resulting in an empty buffer.

Is there a way to open a file dumbly without any sort of auto-action?

Thank you.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=618996

-- 
Best regards,
Eus (FSF member #4445)

In this digital era, where computing technology is pervasive, your
freedom depends on the software controlling those computing devices.

Join free software movement today! It is free as in freedom, not as in
free beer!

Join: http://www.fsf.org/



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

* Re: How to disable file extension auto-detection or auto-action?
       [not found] <mailman.1.1300728119.14572.help-gnu-emacs@gnu.org>
@ 2011-03-22  1:30 ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2011-03-22  1:30 UTC (permalink / raw)
  To: help-gnu-emacs

> Is there a way to open a file dumbly without any sort of auto-action?

M-x find-file-literally


        Stefan


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

* Re: How to disable file extension auto-detection or auto-action?
  2011-03-21  8:12 How to disable file extension auto-detection or auto-action? Tadeus (Eus) Prastowo
@ 2011-03-22 12:17 ` Andrea Crotti
  2011-03-22 15:59   ` Tadeus (Eus) Prastowo
       [not found]   ` <mailman.1.1300809590.31145.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Andrea Crotti @ 2011-03-22 12:17 UTC (permalink / raw)
  To: Tadeus (Eus) Prastowo; +Cc: help-gnu-emacs

"Tadeus (Eus) Prastowo" <0x657573@googlemail.com> writes:

> Hi!
>
> When working on a bug in apt-cacher[1], I needed to read the content
> of *.bz2 files that actually were only text files. But, every time I
> open a .bz2 file, Emacs sees the extension and does auto-decompression
> resulting in an empty buffer.
>
> Is there a way to open a file dumbly without any sort of auto-action?
>
> Thank you.
>
> [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=618996

Hi Tadeus (I think you know me :))

If the files .bz2 that you want to modify have something unique (like a
path prefix) you might also add an entry to auto-mode-alist with a
matching regexp.

For example
"bugs.*.bz2$" . fundamental-mode

In this way you get automatically the desired behaviour locally.
If they're all in the same directory you might even use some
dir-local-variable.

Hope it helps!
-- 
GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0)
 of 2011-03-04 on plaetekopp



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

* Re: How to disable file extension auto-detection or auto-action?
  2011-03-22 12:17 ` Andrea Crotti
@ 2011-03-22 15:59   ` Tadeus (Eus) Prastowo
       [not found]   ` <mailman.1.1300809590.31145.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Tadeus (Eus) Prastowo @ 2011-03-22 15:59 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: help-gnu-emacs

Hi Andrea!

On Tue, 2011-03-22 at 13:17 +0100, Andrea Crotti wrote:

> Hi Tadeus (I think you know me :))

Long time no see! :-)

> If the files .bz2 that you want to modify have something unique (like a
> path prefix) you might also add an entry to auto-mode-alist with a
> matching regexp.
> 
> For example
> "bugs.*.bz2$" . fundamental-mode

I put the following in my ~/.emacs as per Emacs wiki[1] and do M-x
load-file ~/.emacs:

(add-to-list 'auto-mode-alist '("\\.bz2\\'" . fundamental-mode))

But, Emacs still decompresses the fake .bz2 file resulting in a blank
screen. So, I think the decompression happens before auto-mode can even
do something.

Thanks.

[1] http://www.emacswiki.org/emacs/AutoModeAlist

-- 
Best regards,
Eus (FSF member #4445)

In this digital era, where computing technology is pervasive, your
freedom depends on the software controlling those computing devices.

Join free software movement today! It is free as in freedom, not as in
free beer!

Join: http://www.fsf.org/




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

* Re: How to disable file extension auto-detection or auto-action?
       [not found]   ` <mailman.1.1300809590.31145.help-gnu-emacs@gnu.org>
@ 2011-03-22 19:31     ` Ralf Fassel
  2011-03-23 18:34       ` Tadeus (Eus) Prastowo
  0 siblings, 1 reply; 8+ messages in thread
From: Ralf Fassel @ 2011-03-22 19:31 UTC (permalink / raw)
  To: help-gnu-emacs

* "Tadeus (Eus) Prastowo" <0x657573@googlemail.com>
| But, Emacs still decompresses the fake .bz2 file resulting in a blank
| screen. So, I think the decompression happens before auto-mode can
| even do something.

M-x find-file-literally RET filename.bz2 RET

?

HTH
R'


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

* Re: How to disable file extension auto-detection or auto-action?
@ 2011-03-22 21:27 Andrea Crotti
  0 siblings, 0 replies; 8+ messages in thread
From: Andrea Crotti @ 2011-03-22 21:27 UTC (permalink / raw)
  To: 0x657573; +Cc: help-gnu-emacs

"Tadeus (Eus) Prastowo" <0x657573@googlemail.com> writes:
>
> I put the following in my ~/.emacs as per Emacs wiki[1] and do M-x
> load-file ~/.emacs:
>
> (add-to-list 'auto-mode-alist '("\\.bz2\\'" . fundamental-mode))
>
> But, Emacs still decompresses the fake .bz2 file resulting in a blank
> screen. So, I think the decompression happens before auto-mode can even
> do something.

Try with:
(add-to-list 'auto-mode-alist '("\\.bz2$" . fundamental-mode))
(it works for me), the other regexp was not correct...

Hope it helped,
bye ;)

-- 
GNU Emacs 24.0.50.3 (x86_64-apple-darwin10.6.0, NS apple-appkit-1038.35)
of 2011-03-05 on ip1-201.halifax.rwth-aachen.de



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

* Re: How to disable file extension auto-detection or auto-action?
       [not found] <mailman.5.1300829265.13753.help-gnu-emacs@gnu.org>
@ 2011-03-23  1:47 ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2011-03-23  1:47 UTC (permalink / raw)
  To: help-gnu-emacs

> (add-to-list 'auto-mode-alist '("\\.bz2$" . fundamental-mode))
> (it works for me), the other regexp was not correct...

While $ will work, \\' is better since it only matches the end of the
file name, whereas $ also matches the end of a line within a multiline
file names.


        Stefan


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

* Re: How to disable file extension auto-detection or auto-action?
  2011-03-22 19:31     ` Ralf Fassel
@ 2011-03-23 18:34       ` Tadeus (Eus) Prastowo
  0 siblings, 0 replies; 8+ messages in thread
From: Tadeus (Eus) Prastowo @ 2011-03-23 18:34 UTC (permalink / raw)
  To: Ralf Fassel; +Cc: help-gnu-emacs

Hi!

On Tue, 2011-03-22 at 20:31 +0100, Ralf Fassel wrote:
> * "Tadeus (Eus) Prastowo" <0x657573@googlemail.com>
> | But, Emacs still decompresses the fake .bz2 file resulting in a blank
> | screen. So, I think the decompression happens before auto-mode can
> | even do something.
> 
> M-x find-file-literally RET filename.bz2 RET
> 
> ?

Yeah! Perfect! That's what I want :-D

Thank you very much.

> HTH
> R'

-- 
Best regards,
Eus (FSF member #4445)

In this digital era, where computing technology is pervasive, your
freedom depends on the software controlling those computing devices.

Join free software movement today! It is free as in freedom, not as in
free beer!

Join: http://www.fsf.org/




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

end of thread, other threads:[~2011-03-23 18:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-21  8:12 How to disable file extension auto-detection or auto-action? Tadeus (Eus) Prastowo
2011-03-22 12:17 ` Andrea Crotti
2011-03-22 15:59   ` Tadeus (Eus) Prastowo
     [not found]   ` <mailman.1.1300809590.31145.help-gnu-emacs@gnu.org>
2011-03-22 19:31     ` Ralf Fassel
2011-03-23 18:34       ` Tadeus (Eus) Prastowo
     [not found] <mailman.1.1300728119.14572.help-gnu-emacs@gnu.org>
2011-03-22  1:30 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2011-03-22 21:27 Andrea Crotti
     [not found] <mailman.5.1300829265.13753.help-gnu-emacs@gnu.org>
2011-03-23  1:47 ` Stefan Monnier

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