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: Tue, 30 Aug 2011 09:47:28 +0200 Message-ID: References: <4E5A2556.50106@gmail.com> <27177.1314551389@alphaville.dokosmarshall.org> <23342.1314604746@alphaville.dokosmarshall.org> <6210.1314657464@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyJ30-0007Qb-Dj for emacs-orgmode@gnu.org; Tue, 30 Aug 2011 03:47:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyJ2z-0003iK-8g for emacs-orgmode@gnu.org; Tue, 30 Aug 2011 03:47:50 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:53710) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyJ2z-0003hT-2j for emacs-orgmode@gnu.org; Tue, 30 Aug 2011 03:47:49 -0400 Received: by ewy9 with SMTP id 9so3054989ewy.0 for ; Tue, 30 Aug 2011 00:47:48 -0700 (PDT) In-Reply-To: <6210.1314657464@alphaville.americas.hpqcorp.net> 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: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org On Tue, Aug 30, 2011 at 00:37, 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). =A0That function does a million things to make sure that everythin= g > 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. > > Nick > Many thanks Nick for all your help and detailed explanations! I am doing the same thing as you do, I'm keeping the config for all the different Emacs modules in different config files. This allowed me to quickly find the issue and now I've removed that line from the generic config. S.