From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#8613: "mode:" for minor-mode breaks set-visited-file-name Date: Tue, 03 May 2011 19:00:14 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1304464024 20345 80.91.229.12 (3 May 2011 23:07:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 3 May 2011 23:07:04 +0000 (UTC) To: 8613@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 04 01:07:00 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QHOgG-0002X4-2p for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 May 2011 01:07:00 +0200 Original-Received: from localhost ([::1]:56256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHOgE-0004AL-Qo for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 May 2011 19:06:58 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHOgB-0004AC-MZ for bug-gnu-emacs@gnu.org; Tue, 03 May 2011 19:06:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHOgA-0000db-Ml for bug-gnu-emacs@gnu.org; Tue, 03 May 2011 19:06:55 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHOgA-0000dU-LS for bug-gnu-emacs@gnu.org; Tue, 03 May 2011 19:06:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QHOaV-00083X-0d; Tue, 03 May 2011 19:01:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 May 2011 23:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8613 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.130446362330913 (code B ref -1); Tue, 03 May 2011 23:01:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 May 2011 23:00:23 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QHOZr-00082Y-GW for submit@debbugs.gnu.org; Tue, 03 May 2011 19:00:23 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QHOZo-00082M-Ef for submit@debbugs.gnu.org; Tue, 03 May 2011 19:00:20 -0400 Original-Received: from localhost ([127.0.0.1]:51461) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHOZj-0007xr-6G; Tue, 03 May 2011 19:00:15 -0400 X-Spook: Area 51 terrorism UMTS Elvis SDI HAMASMOIS Etacs X-Ran: [YP0Z&'v?2\~ List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46172 Archived-At: Package: emacs Version: 23.3 The fact that "mode:" is allowed to indicate both major and minor modes in file local variables is problematic. Things would be much simpler if a different convention were used for minor modes. There is bug#2355 (specifying a minor-mode in the first line breaks major-mode detection); there is bug#5239 (major "mode:" specifications only work right if they are at the start of the local variables list. It might be nice to automatically move "mode:" to the front of the local variables list, so that people don't have to worry about this; but since "mode:" is also used for minor modes, and these probably need to come AFTER setting of their relevant variables, this cannot be done.); there is also bug#8586 (directory-local variables and files with "mode:" cookies; I cannot see how to solve this given that "mode:" might mean either a major or minor mode). Here's another issue, affecting set-visited-file-name, caused by the fact that the hack-local-variables MODE-ONLY feature cannot work right, because all it does is check for a "mode:" cookie, and it has no way to know if this is specifying a major-mode or a minor-mode: >| foo.el emacs -Q foo.el M-x set-visited-file-name RET foo.f90 RET -> buffer switches to f90 mode cat >| foo2.el < buffer stays in emacs-lisp-mode