On Mon, Aug 29, 2011 at 23:42, Stelian Iancu <stelian.ia...@gmail.com> wrote: > On Mon, Aug 29, 2011 at 09:59, Nick Dokos <nicholas.do...@hp.com> wrote: >> Stelian Iancu <stelian.ia...@gmail.com> wrote: >> >>> On Sun, Aug 28, 2011 at 19:09, Nick Dokos <nicholas.do...@hp.com> wrote: >>> > Stelian Iancu <stelian.ia...@gmail.com> wrote: >>> > >>> >> >>> >> I am trying to switch between TODO and DONE states with Shift-Right >>> >> Arrow and I get a (wrong-type-argument stringp nil) error. >>> >> >>> >> Please find attached the backtrace. >>> >> >>> >> >>> >> Emacs : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) >>> >> of 2010-12-11 on raven, modified by Debian >>> >> Package: Org-mode version 7.7 >>> >> >>> > >>> >> Debugger entered--Lisp error: (wrong-type-argument stringp nil) >>> >> looking-at(nil) >>> >> (save-excursion (beginning-of-line 1) (looking-at >>> >> org-todo-line-regexp)) >>> >> (and (outline-on-heading-p) (not (bolp)) (save-excursion >>> >> (beginning-of-line 1) (looking-at org-todo-line-regexp)) (< (point) (+ 2 >>> >> ...))) >>> >> (if (and (outline-on-heading-p) (not ...) (save-excursion ... ...) (< >>> >> ... ...)) (progn (goto-char ...) (and ... ...))) >>> >> (let* ...) >>> >> (catch (quote exit) ...) >>> >> (save-excursion (catch (quote exit)...) >>> >> (let ...) >>> >> org-todo(right) >>> >> call-interactively(org-todo) >>> >> (let ((current-prefix-arg arg)) (call-interactively command)) >>> >> org-call-with-arg(org-todo right) >>> >> (let ...) >>> >> (cond ...) >>> >> org-shiftright(nil) >>> >> call-interactively(org-shiftright nil nil) >>> > >>> > The problem is that org-todo-line-regexp is nil. This variable is >>> > made buffer-local and initialized when the buffer's mode is set >>> > to org-mode. >>> > >>> > Are you sure that your buffer's major mode is org-mode? >>> > >>> > Nick >>> > >>> >>> Yeah, the mode shows as org-mode. >> >> What happens if while visiting the buffer, you say >> >> C-h v org-todo-line-regexp RET >> >> Is the value reported nil? > > Yes, the value is nil. > >> >>> But now I get another weird one. >>> Everytime I open an org file, I see the following message in the >>> minibuffer: >>> >>> File mode specification error: (wrong-type-argument keymap nil) >>> >> >> That will require another backtrace but... >> >>> I'm lost ... >> >> When you get to the point of feeling lost, it's time to take a step >> back. Make yourself a minimal.emacs that contains just the basics to >> get org-mode loaded - assuming you get your org sources from git, then >> you need something like this (with pathnames changed appropriately): >> >> --8<---------------cut here---------------start------------->8--- >> ;;; -*- mode: emacs-lisp -*- >> ;;; constant part >> (add-to-list 'load-path (expand-file-name "~/src/emacs/org/org-mode/lisp")) >> (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . >> org-mode)) >> (require 'org-install) >> (global-set-key "\C-cl" 'org-store-link) >> (global-set-key "\C-ca" 'org-agenda) >> --8<---------------cut here---------------end--------------->8--- >> >> Then start up an emacs without any of your customizations, load the >> minimal.emacs >> file and visit an org file and try what you tried before: >> >> emacs -q -l /path/to/minimal.emacs /path/to/somefile.org >> >> and try changing a TODO as before. Does that work? > > Tried this one and indeed, it works now. Looking at the > org-todo-line-regexp variable I can see it's no longer reported nil. > >> If not, try -Q >> instead of -q: does *that* work? >> >> Assuming one of these works, then you have localized the problem to >> some customization (yours or the systems) and then there are various >> ways to proceed. >> > > 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? Thanks, S.