From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stelian Iancu Subject: Re: Bug: wrong-type-argument when changing TODO state [7.7] Date: Wed, 31 Aug 2011 13:03:37 +0200 Message-ID: <4E5E1509.8090701@siancu.net> References: <4E5A2556.50106@gmail.com> <27177.1314551389@alphaville.dokosmarshall.org> <23342.1314604746@alphaville.dokosmarshall.org> <6210.1314657464@alphaville.americas.hpqcorp.net> <6392.1314658968@alphaville.americas.hpqcorp.net> <13189.1314724911@alphaville.dokosmarshall.org> Reply-To: lists@siancu.net Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:45365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyibW-0006gi-0s for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 07:05:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyibU-00056d-R3 for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 07:05:09 -0400 Received: from lo.gmane.org ([80.91.229.12]:54575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyibU-000560-EH for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 07:05:08 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QyibR-0004tP-HW for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 13:05:05 +0200 Received: from 62-2-90-130.static.cablecom.ch ([62.2.90.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 31 Aug 2011 13:05:05 +0200 Received: from lists by 62-2-90-130.static.cablecom.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 31 Aug 2011 13:05:05 +0200 In-Reply-To: <13189.1314724911@alphaville.dokosmarshall.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: nicholas.dokos@hp.com On 30.08.2011 19:21, Nick Dokos wrote: > Nick Dokos wrote: > >> I'm pretty tired and I might have misunderstood what is happening here, >> so don't put too much weight on the following. I'll need some sleep >> before I can take a whack at it again however. >> >> Nick >> >> Nick Dokos wrote: >> >>> Stelian Iancu wrote: >>> >>> >>>>> So it is a customization issue. Now the question is what :-). I should >>>>> mention that I am using both dev versions for Emacs and org-mode >>>>> (Emacs from bzr from a few days ago and org-mode from git from a few >>>>> days ago) on Mac OS X 10.7. Emacs is installed using homebrew. >>>>> >>>> >>>> Ok, it seems like I've found the culprit. It's this line: >>>> >>>> ;; Make org-mode default for all the new files >>>> (setq major-mode 'org-mode) >>>> >>>> If I comment it out, it all works beautifully. I thought it was >>>> because I was executing it before loading org-mode, but I've made sure >>>> org-mode is loaded before executing that line and I still get the same >>>> error. >>>> >>>> Any ideas why it happens? >>>> >>> >>> Yes - don't ever do that. The major mode of a buffer is set by calling a >>> function (e.g. the org-mode function for buffers that should be in org >>> mode). That function does a million things to make sure that everything >>> works properly: your setting a single variable does none of that and all >>> you end up doing is confusing emacs. >>> >>> In most cases, you don't even call the mode function explicitly: it is >>> called for you automatically, e.g. through the setting of auto-mode-alist. >>> I have the following in my basic customizations: >>> >>> (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) >>> >>> That says to emacs: when find-file is called to open a file whose name >>> ends in `.org' arrange to call the function org-mode on it. The function >>> takes care of the setting of major-mode. >>> >>> Be sure to read Ch.23 of the emacs manual on major modes. >>> > > This is all correct I think (except for the ominous first > sentence). But having > > (setq major-mode 'org-mode) > > in one's .emacs should not have any effect: major-mode is > buffer local, so the setting above should not have any > effect on *anything*, afaict. To make org-mode the > default mode for new buffers, you'd have to say > > (setq-default major-mode 'org-mode) > > I've added each of those to my minimal .emacs and I have > no problem using S-{right,left} to change the TODO state > in a .org file. When I set org-mode to be the default > major mode and I open an unrelated file, its major mode > is set to org-mode, but when I S-{right,left} at some > arbitrary place, I get a message: > > To use shift-selection with Org-mode, customize > `org-support-shift-select' > > and the corresponding message in the *Messages* buffer > is: > > if: To use shift-selection with Org-mode, customize > `org-support-shift-select' > > That's an error, but it's a "reasonable" error: not right > but not too bad. > > And when I ``find-file foo.bar'' which would normally > open it in fundamental mode, I do get it in org-mode and > everything works as it should: I can add headlines and > change TODO states normally. > > So to summarize: no idea why that setting should have any > effect at all. > > Nick > > PS. The only possible explanation I can think of is > version differences: > > Org-mode version 7.7 (release_7.7.205.gce02a) > > GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ > Version 2.22.0) of 2011-07-30 > > I have not tried with emacs 23. > > You are right, adding either of the two settings to the minimal .emacs doesn't change anything, it still works. I'm on: GNU Emacs 24.0.50.1 (i386-apple-darwin11.1.0, NS apple-appkit-1138.00) of 2011-08-24 on iancumac.local Org-mode version 7.7 (release_7.4.1639.gd203.dirty) The interesting thing though is that it works now with the normal configuration, after removing the setting, even though it shouldn't have any effect. Thanks, S.