From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Schoepe Newsgroups: gmane.emacs.help Subject: Re: Major mode weirdness. Date: Wed, 13 Jul 2011 19:15:31 +0200 Message-ID: <87pqle14r0.fsf@gilead.invalid> References: <87d3hejj8p.fsf@UlanBator.myhome.westell.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: dough.gmane.org 1310584512 31745 80.91.229.12 (13 Jul 2011 19:15:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 19:15:12 +0000 (UTC) To: "R. Clayton" , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 13 21:15:04 2011 Return-path: Envelope-to: geh-help-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 1Qh4tf-00026H-4b for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jul 2011 21:14:59 +0200 Original-Received: from localhost ([::1]:36237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh4td-00031r-UM for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jul 2011 15:14:58 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh32I-0005jN-JQ for help-gnu-emacs@gnu.org; Wed, 13 Jul 2011 13:15:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qh32G-0006nw-LC for help-gnu-emacs@gnu.org; Wed, 13 Jul 2011 13:15:46 -0400 Original-Received: from mail-fx0-f52.google.com ([209.85.161.52]:42568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh32G-0006ni-0Y for help-gnu-emacs@gnu.org; Wed, 13 Jul 2011 13:15:44 -0400 Original-Received: by fxd18 with SMTP id 18so2261343fxd.39 for ; Wed, 13 Jul 2011 10:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=kpSPvA/hRxYs8VuBYFzGvxNJUCM/YpvijduzJEtqG9k=; b=rvkgWANf1/a/8DOUoWxMudgKK05GmK4gWf2tQlBQ6W4RXlgRVpXmxw+B/VR2iIb2ht 4oXMEW4+YQ75Sw/Y9npOHbsa0QyVxWStp4bUXQKRguGQQhwF38St63+tlnY76NCsq2Zm 6c0mftTW+qGPNeAENLgMosAlQUO7NyKVbD0dk= Original-Received: by 10.223.79.139 with SMTP id p11mr1964731fak.118.1310577342492; Wed, 13 Jul 2011 10:15:42 -0700 (PDT) Original-Received: from localhost (dslb-088-068-022-056.pools.arcor-ip.net [88.68.22.56]) by mx.google.com with ESMTPS id n27sm10622287faa.4.2011.07.13.10.15.39 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jul 2011 10:15:40 -0700 (PDT) In-Reply-To: <87d3hejj8p.fsf@UlanBator.myhome.westell.com> User-Agent: Notmuch/0.5-329-g0b5d38d (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.52 X-Mailman-Approved-At: Wed, 13 Jul 2011 14:51:18 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81573 Archived-At: --=-=-= Content-Transfer-Encoding: quoted-printable On Wed, 13 Jul 2011 11:25:10 -0400, rvclayton@verizon.net (R. Clayton) wrot= e: > I am running GNU Emacs 23.3.1 (i486-pc-linux-gnu, GTK+ Version 2.24.3) of > 2011-04-10 on raven, modified by Debian on a debian testing system updated > weekly. >=20 > I have noticed that the initial scratch buffer, the one you get when you = just > run emacs with no command-line arguments, is in fundamental mode, even th= ough > .emacs contains, in custom-set-variables, '(initial-major-mode (quote > text-mode)) and help-variable in *scratch* reports initial-major-mode's v= alue > is text-mode. For me, using a ~/.emacs containing only this, works as expected: (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(initial-major-mode (quote text-mode))) So, your problem might be caused by something else in your configuration. > I have also noticed that doing (setq major-mode 'text-mode) in .emacs has= no > effect: new buffers are set to fundamental mode rather than text mode. T= he > help-variable documentation for major-mode indicates that setting help-mo= de > makes it buffer local, which seems like strange behavior for a variable t= hat's > supposed to provide a global value. [..] major-mode is not supposed to provide a global value. The idea is that every buffer has its own major-mode, otherwise you couldn't have buffers open for both C and lisp files and have them highlighted differently for example. So it makes perfect sense for major-mode to be buffer-local. If you want to set a default for a buffer-local variable, you can use setq-default, like so: (setq-default major-mode 'text-mode) But because some functions that create a new buffers directly set the major-mode of the buffer (e.g. mail clients creating a buffer to display a message), it is doubtful what that line would actually accomplish. >=20 > Although I expect I know the answer to this one, I'll ask it anyway: why = is it > that a "top-level" setq on major-mode in .emacs doesn't work? Since major-mode is buffer-local, that only changes the major-mode for the currently selected buffer when that code is executed (depending on your configuration, that might be the Emacs welcome buffer). > Also, top-level setqs on initial-major-mode and major-mode used to work as > expected up until a few weeks ago. What has changed since then? Searchi= ng > around in the /usr/share/doc/emacs23 change files doesn't produce anythin= g I > can recognize as an explanation. What exactly do you mean by work as expected? If you mean that (setq major-mode 'text-mode) used to set the major-mode for the scratch-buffer, then this only could have worked if *scratch* was the current buffer when .emacs was run. I think this is an implementation detail that you should not rely on anyway. About initial-major-mode not working: As I said, I can't reproduce that. (I'm also using Emacs 23.3.1, but from debian unstable). Cheers, Daniel --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJOHdK0AAoJEIaTAtce+Z+JP5UP/1W53CprkVmmovTpE6YsCdsS L+wj7xj9CM2qlbAAM75Ip5iNv6ii6zVy2TXEyg+Niw5h0ziA8u8yV/rBNNeNG4fL yUIZBK0XGmZTfZVw62wInJFiYjfEPxUP4QnOLs1Ixhm9pUzMwOHvoWs2MVW9bbSq 6SjAidCR1izF73QDgGBhCKKNM5Y2sP4bqKG7IfRceuh8+CRNV06bXWMnoGAzdeUs JhNPntUpT92R2Ehq5PZKd/PfP6r0keoFbxJRmCqziJH56bdADJ+H/uU+izIYtvdB aRqJuDWIf5Kc37PevTKAjYFKvRLmHM2z4wc2vMdlA+rVSqJ3r+P46V0rmcLvlPoV 6YWQpansHlewPatNG0rVmsgVE+jIrgYNTjr/uVfIaTkStOOqejd+XjfMg2xmHfFG MvTQgR9zLo+VoJ5b1ixfvw7BoflfeCxKUPu96nH+JRfTHsUXIZdyRooAGLwgxdpt VTeUh3VhGqz461rbPdnz9KYIkH7B9K25ZcsYuHFAgVZHgmpYFzBopF7EH5fpIRLI 32jF5S84U67PfJg/8e6naFU9XzYs0z6oaKV1pqRN2SeTL8kT/WKrAcF1qKe9WjbD uNQSHY4CN5FNIF/jzOoWBBrH8BXXax0MBDF2XZCDNFqiNSELmDetLOMzi/KEiw8s XMMPMnklTJNK+gqv89vw =7m+z -----END PGP SIGNATURE----- --=-=-=--