From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ams@gnu.org (Alfred M. Szmidt) Newsgroups: gmane.emacs.devel Subject: Re: .info files Date: Thu, 12 Apr 2012 12:49:19 -0400 Message-ID: References: Reply-To: ams@gnu.org NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1334249375 23516 80.91.229.3 (12 Apr 2012 16:49:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 12 Apr 2012 16:49:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 12 18:49:34 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SIND9-0002nC-5I for ged-emacs-devel@m.gmane.org; Thu, 12 Apr 2012 18:49:31 +0200 Original-Received: from localhost ([::1]:41443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIND8-0001vg-C9 for ged-emacs-devel@m.gmane.org; Thu, 12 Apr 2012 12:49:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIND0-0001tQ-SM for emacs-devel@gnu.org; Thu, 12 Apr 2012 12:49:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SINCz-0008Rc-6x for emacs-devel@gnu.org; Thu, 12 Apr 2012 12:49:22 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:50885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SINCz-0008RV-40 for emacs-devel@gnu.org; Thu, 12 Apr 2012 12:49:21 -0400 Original-Received: from ams by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1SINCx-0006Ja-Lp; Thu, 12 Apr 2012 12:49:19 -0400 In-reply-to: (message from Stefan Monnier on Thu, 12 Apr 2012 12:12:38 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149614 Archived-At: > It would be nice if .info files opened up in Info-mode automatically. > E.g. something like, > (add-to-list 'auto-mode-alist > '("\\.info\\'" . (lambda () (interactive) > (let ((file-name (buffer-file-name))) > (kill-buffer (current-buffer)) > (info file-name))))) Agreed. I wrote Info-on-current-buffer a long time ago to try and address this need, but it's clearly not good enough. Your code above is (sadly) not quite good enough either since its use of kill-buffer+info will likely introduce misbehaviors in various cases. True that, what about the following: (add-to-list 'auto-mode-alist '("\\.info\\'" . (lambda () (interactive) (require 'info) (info-setup (buffer-file-name) (current-buffer)))))