From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Putting auto-image-file-mode in Options menu Date: Wed, 23 Mar 2005 01:21:59 -0500 Message-ID: References: <87acp8i6f1.fsf@jurta.org> <87wtsbbrlt.fsf-monnier+emacs@gnu.org> <87ll8qap2h.fsf@jurta.org> <87mzt3h43k.fsf@jurta.org> <87eke79zy8.fsf@jurta.org> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1111559469 18709 80.91.229.2 (23 Mar 2005 06:31:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 23 Mar 2005 06:31:09 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 23 07:31:09 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DDzOP-0003kf-27 for ged-emacs-devel@m.gmane.org; Wed, 23 Mar 2005 07:31:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DDzfq-0007rI-IL for ged-emacs-devel@m.gmane.org; Wed, 23 Mar 2005 01:49:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DDzea-0007bA-5M for emacs-devel@gnu.org; Wed, 23 Mar 2005 01:47:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DDzeR-0007V1-3N for emacs-devel@gnu.org; Wed, 23 Mar 2005 01:47:35 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DDzeP-0007Sg-9T for emacs-devel@gnu.org; Wed, 23 Mar 2005 01:47:33 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DDzFg-0005qC-ME for emacs-devel@gnu.org; Wed, 23 Mar 2005 01:22:00 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DDzFf-0005zo-VZ; Wed, 23 Mar 2005 01:22:00 -0500 Original-To: Juri Linkov In-reply-to: <87eke79zy8.fsf@jurta.org> (message from Juri Linkov on Tue, 22 Mar 2005 22:43:34 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:35025 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35025 Your code looks good to me, except for one point: every major mode's symbol name should be a function that *unconditionally* switches to that mode. You've set it up so that `image-mode' is a function that usually switches to Image mode, but not always. That's not right. So I think you should leave the function `image-mode' unchanged and define a new function `image-mode-maybe' which does the new job. Then the entries in auto-mode-alist can call `image-mode-maybe' and `image-mode-maybe' can conditionally call `image-mode'. Want to try it that way?