From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: the code(convert the file to objc-mode) cause orgmode export to html file error Date: Tue, 26 Dec 2017 14:35:18 +0100 Message-ID: <87vagtzk6h.fsf@nicolasgoaziou.fr> References: <20171226.175404.1225205316275881747.chenpoyang@163.com> <87bmil20eo.fsf@nicolasgoaziou.fr> <20171226.211326.1380080767711170814.chenpoyang@163.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eTpO7-0006pT-Ta for emacs-orgmode@gnu.org; Tue, 26 Dec 2017 08:35:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eTpO7-0004jk-5a for emacs-orgmode@gnu.org; Tue, 26 Dec 2017 08:35:23 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:41472) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eTpO6-0004iV-UN for emacs-orgmode@gnu.org; Tue, 26 Dec 2017 08:35:23 -0500 In-Reply-To: <20171226.211326.1380080767711170814.chenpoyang@163.com> (=?utf-8?B?IumZiOazvOadqA==?= "'s message of "Tue, 26 Dec 2017 21:13:26 +0800 (CST)") 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" To: =?utf-8?B?6ZmI5rO85p2o?= Cc: emacs-orgmode@gnu.org =E9=99=88=E6=B3=BC=E6=9D=A8 writes: > -------------------------------------------------------------------------= ------- > (add-to-list 'magic-mode-alist > `(,(lambda () > (and (equal (file-name-extension buffer-file-name) "= h") > (re-search-forward "@\\"=20 > magic-mode-regexp-match-limit t))) > . objc-mode)) > -------------------------------------------------------------------------= ------- > > still unable to export org file to html: Your function doesn't handle buffers not associated to a file. You may want to try (and (stringp buffer-file-name) (equal "h" (file-name-extension buffer-file-name)) ...) Regards,