From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Mitchell Subject: Re: Export error. Have a look at my backtrace? Date: Tue, 08 Feb 2011 16:55:34 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=56580 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pmqr1-00035H-Re for emacs-orgmode@gnu.org; Tue, 08 Feb 2011 11:55:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pmqr0-0005IQ-KV for emacs-orgmode@gnu.org; Tue, 08 Feb 2011 11:55:51 -0500 Received: from lo.gmane.org ([80.91.229.12]:59838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pmqr0-0005ID-7w for emacs-orgmode@gnu.org; Tue, 08 Feb 2011 11:55:50 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pmqqx-0001op-Oj for emacs-orgmode@gnu.org; Tue, 08 Feb 2011 17:55:47 +0100 Received: from e4300lm.epcc.ed.ac.uk ([129.215.63.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Feb 2011 17:55:47 +0100 Received: from wence by e4300lm.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Feb 2011 17:55:47 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Jeff Horn wrote: > Hey orgsters, > Export started behaving weirdly for me earlier this week. When I > export to HTML or ASCII to a temporary buffer, I get the attached > backtrace. This occurs in emacs 24 (Aquamacs) with org-mode 7.4. The > error does not occur if I export to file. > Also, exporting to a temporary buffer works as expected in emacs 23.2 > with org-mode 7.4 in terminal emacs. > Error occurs with every file I have tried in the past few days. Can > anyone else reproduce? I'll come up with a minimal working example if > needed. This is an Aquamacs specific issue, I believe. What happens is that Emacs tries to guess the major mode of the temporary buffer. Aquamacs has the following entry in either magic-mode-alist, or magic-fallback-mode-alist. (objc-mode-buffer-check . objc-mode) So it calls the objc-mode-buffer-check function, and puts the buffer in objc-mode if the former returns non-nil. Here's the definition of said function: (defun objc-mode-buffer-check () (if (string-match "\\.m$" buffer-file-name) (save-restriction (narrow-to-region (point-min) (min (point-max) (+ (point-min) magic-mode-regexp-match-limit))) (looking-at "\\(.\\|\n\\)*#\\(include\\|define\\|import\\)")))) The culprit is the first line, this function should first check that buffer-file-name is a string before trying to match against it. So you should probably shout at the Aquamacs developers :P. Lawrence -- Lawrence Mitchell