* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
@ 2010-02-28 19:28 usr.gentoo
2010-03-02 21:11 ` Juri Linkov
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: usr.gentoo @ 2010-02-28 19:28 UTC (permalink / raw)
To: 5658
Hi,
when visiting .info files in Emacs via find-file Emacs opens the file in the
default major-mode instead of Emacs' info-mode. I suggest therefore to add the
following default-association:
(add-to-list 'auto-mode-alist '("\\.info\\'" . info))
HTH,
Geralt.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
2010-02-28 19:28 bug#5658: 23.1; Viewing .info files in Emacs' info-viewer usr.gentoo
@ 2010-03-02 21:11 ` Juri Linkov
2010-03-03 6:05 ` Kevin Rodgers
2012-12-08 3:37 ` Chong Yidong
2 siblings, 0 replies; 12+ messages in thread
From: Juri Linkov @ 2010-03-02 21:11 UTC (permalink / raw)
To: usr.gentoo; +Cc: 5658
> when visiting .info files in Emacs via find-file Emacs opens the file in the
> default major-mode instead of Emacs' info-mode. I suggest therefore to add the
> following default-association:
>
> (add-to-list 'auto-mode-alist '("\\.info\\'" . info))
This doesn't work for me. However, the following does:
(add-to-list 'auto-mode-alist '("\\.info\\'" .
(lambda () (interactive)
(info (buffer-file-name)))))
I think this has too bad consequences: it visits the Info file,
but doesn't display it. Instead, it displays another buffer
with the Info manual.
Maybe `dired-info' from `dired-x.el' is more suitable for your needs?
At least, it doesn't visit the Info file.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
2010-02-28 19:28 bug#5658: 23.1; Viewing .info files in Emacs' info-viewer usr.gentoo
2010-03-02 21:11 ` Juri Linkov
@ 2010-03-03 6:05 ` Kevin Rodgers
2010-03-03 19:30 ` Juri Linkov
2012-12-08 3:37 ` Chong Yidong
2 siblings, 1 reply; 12+ messages in thread
From: Kevin Rodgers @ 2010-03-03 6:05 UTC (permalink / raw)
To: bug-gnu-emacs
usr.gentoo@googlemail.com wrote:
> when visiting .info files in Emacs via find-file Emacs opens the file in the
> default major-mode instead of Emacs' info-mode. I suggest therefore to add the
> following default-association:
>
> (add-to-list 'auto-mode-alist '("\\.info\\'" . info))
The value of major-mode in an Info buffer is Info-mode:
(add-to-list 'auto-mode-alist '("\\.info\\'" . Info-mode))
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
2010-03-03 6:05 ` Kevin Rodgers
@ 2010-03-03 19:30 ` Juri Linkov
2010-03-04 2:45 ` Stefan Monnier
2010-03-04 7:10 ` Kevin Rodgers
0 siblings, 2 replies; 12+ messages in thread
From: Juri Linkov @ 2010-03-03 19:30 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: bug-gnu-emacs
>> when visiting .info files in Emacs via find-file Emacs opens the file in the
>> default major-mode instead of Emacs' info-mode. I suggest therefore to add the
>> following default-association:
>>
>> (add-to-list 'auto-mode-alist '("\\.info\\'" . info))
>
> The value of major-mode in an Info buffer is Info-mode:
>
> (add-to-list 'auto-mode-alist '("\\.info\\'" . Info-mode))
This doesn't work too. It seems `Info-on-current-buffer' was created
exactly for the purpose to be associated with .info in auto-mode-alist.
It is not used anywhere else.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
2010-03-03 19:30 ` Juri Linkov
@ 2010-03-04 2:45 ` Stefan Monnier
2010-03-06 17:55 ` Juri Linkov
2010-03-04 7:10 ` Kevin Rodgers
1 sibling, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2010-03-04 2:45 UTC (permalink / raw)
To: Juri Linkov; +Cc: bug-gnu-emacs, Kevin Rodgers
> This doesn't work too. It seems `Info-on-current-buffer' was created
> exactly for the purpose to be associated with .info in auto-mode-alist.
> It is not used anywhere else.
Yes, I wrote Info-on-current-buffer specifically for this kind of use,
but no it doesn't work for the auto-mode-alist, really.
There is no good reason why it can't work for auto-mode-alist, but it's
the way it currently is. Patches welcome,
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
2010-03-03 19:30 ` Juri Linkov
2010-03-04 2:45 ` Stefan Monnier
@ 2010-03-04 7:10 ` Kevin Rodgers
2010-03-04 21:18 ` Juri Linkov
2010-03-05 20:23 ` Stefan Monnier
1 sibling, 2 replies; 12+ messages in thread
From: Kevin Rodgers @ 2010-03-04 7:10 UTC (permalink / raw)
To: bug-gnu-emacs
Juri Linkov wrote:
>>> when visiting .info files in Emacs via find-file Emacs opens the file in the
>>> default major-mode instead of Emacs' info-mode. I suggest therefore to add the
>>> following default-association:
>>>
>>> (add-to-list 'auto-mode-alist '("\\.info\\'" . info))
>> The value of major-mode in an Info buffer is Info-mode:
>>
>> (add-to-list 'auto-mode-alist '("\\.info\\'" . Info-mode))
>
> This doesn't work too. It seems `Info-on-current-buffer' was created
> exactly for the purpose to be associated with .info in auto-mode-alist.
> It is not used anywhere else.
That doesn't work either: even if the file is editable, the buffer is read-only.
It should be something like:
(lambda ()
(let ((Info-enable-edit buffer-read-only))
(Info-on-current-buffer)
(when Info-enable-edit
(Info-edit))))
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
2010-03-04 7:10 ` Kevin Rodgers
@ 2010-03-04 21:18 ` Juri Linkov
2010-03-05 5:29 ` Kevin Rodgers
2010-03-05 20:23 ` Stefan Monnier
1 sibling, 1 reply; 12+ messages in thread
From: Juri Linkov @ 2010-03-04 21:18 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: bug-gnu-emacs
> That doesn't work either: even if the file is editable,
> the buffer is read-only.
>
> It should be something like:
>
> (lambda ()
> (let ((Info-enable-edit buffer-read-only))
> (Info-on-current-buffer)
> (when Info-enable-edit
> (Info-edit))))
Definitely not. `Info-edit' is not recommended to use according
to the docstring of `Info-enable-edit'. It is disabled by default.
Your code overrides its default value.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
2010-03-04 21:18 ` Juri Linkov
@ 2010-03-05 5:29 ` Kevin Rodgers
0 siblings, 0 replies; 12+ messages in thread
From: Kevin Rodgers @ 2010-03-05 5:29 UTC (permalink / raw)
To: bug-gnu-emacs
Juri Linkov wrote:
>> That doesn't work either: even if the file is editable,
>> the buffer is read-only.
>>
>> It should be something like:
>>
>> (lambda ()
>> (let ((Info-enable-edit buffer-read-only))
>> (Info-on-current-buffer)
>> (when Info-enable-edit
>> (Info-edit))))
Oops, I meant (let ((Info-enable-edit (not buffer-read-only)) ...)
> Definitely not. `Info-edit' is not recommended to use according
> to the docstring of `Info-enable-edit'. It is disabled by default.
That is a good default, because normally one is viewing an Info file via
`C-h i' (including `C-u C-h i'). But if one has explicitly visited a file
via `find-file' and friends, then The Full Power of Emacs Shall Be at Your
Fingertips. :-)
> Your code overrides its default value.
Only temporarily.
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
2010-03-04 7:10 ` Kevin Rodgers
2010-03-04 21:18 ` Juri Linkov
@ 2010-03-05 20:23 ` Stefan Monnier
1 sibling, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2010-03-05 20:23 UTC (permalink / raw)
To: Kevin Rodgers; +Cc: bug-gnu-emacs
> That doesn't work either: even if the file is editable, the buffer is
> read-only.
That's not necessarily a problem. Several major modes put their buffer
in a read-only mode even if the underlying file is writable. This is
typically the case for modes that change the appearance of the buffer
(use things like after-string and display properties).
I think in the case of Info buffers, it's perfectly OK to open them in
read-only mode even if the file is writable.
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
2010-03-04 2:45 ` Stefan Monnier
@ 2010-03-06 17:55 ` Juri Linkov
0 siblings, 0 replies; 12+ messages in thread
From: Juri Linkov @ 2010-03-06 17:55 UTC (permalink / raw)
To: Stefan Monnier; +Cc: bug-gnu-emacs, Kevin Rodgers
>> This doesn't work too. It seems `Info-on-current-buffer' was created
>> exactly for the purpose to be associated with .info in auto-mode-alist.
>> It is not used anywhere else.
>
> Yes, I wrote Info-on-current-buffer specifically for this kind of use,
> but no it doesn't work for the auto-mode-alist, really.
> There is no good reason why it can't work for auto-mode-alist, but it's
> the way it currently is. Patches welcome,
I see only one problem with using Info-on-current-buffer for the
auto-mode-alist. Since it can't read the node name interactively,
it defaults to `Top' that may be missing in the current file of the
multi-file Info manual. Perhaps it should default to the first node of
the current file.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
2010-02-28 19:28 bug#5658: 23.1; Viewing .info files in Emacs' info-viewer usr.gentoo
2010-03-02 21:11 ` Juri Linkov
2010-03-03 6:05 ` Kevin Rodgers
@ 2012-12-08 3:37 ` Chong Yidong
2012-12-08 9:07 ` Eli Zaretskii
2 siblings, 1 reply; 12+ messages in thread
From: Chong Yidong @ 2012-12-08 3:37 UTC (permalink / raw)
To: usr.gentoo; +Cc: 5658
usr.gentoo@googlemail.com writes:
> when visiting .info files in Emacs via find-file Emacs opens the file
> in the default major-mode instead of Emacs' info-mode.
I think it would be a bad idea to open in Info mode, since one
occasionally comes across plain text files with the .info extension.
Anyway, we have the `info-display-manual' command for this now.
Closing.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#5658: 23.1; Viewing .info files in Emacs' info-viewer
2012-12-08 3:37 ` Chong Yidong
@ 2012-12-08 9:07 ` Eli Zaretskii
0 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2012-12-08 9:07 UTC (permalink / raw)
To: Chong Yidong; +Cc: usr.gentoo, 5658
> From: Chong Yidong <cyd@gnu.org>
> Date: Sat, 08 Dec 2012 11:37:07 +0800
> Cc: 5658@debbugs.gnu.org
>
> Anyway, we have the `info-display-manual' command for this now.
To say nothing about "C-u C-h i", which we had for ages.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2012-12-08 9:07 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-28 19:28 bug#5658: 23.1; Viewing .info files in Emacs' info-viewer usr.gentoo
2010-03-02 21:11 ` Juri Linkov
2010-03-03 6:05 ` Kevin Rodgers
2010-03-03 19:30 ` Juri Linkov
2010-03-04 2:45 ` Stefan Monnier
2010-03-06 17:55 ` Juri Linkov
2010-03-04 7:10 ` Kevin Rodgers
2010-03-04 21:18 ` Juri Linkov
2010-03-05 5:29 ` Kevin Rodgers
2010-03-05 20:23 ` Stefan Monnier
2012-12-08 3:37 ` Chong Yidong
2012-12-08 9:07 ` Eli Zaretskii
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).