emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: 陈泼杨 <chenpoyang@163.com>
To: mail@nicolasgoaziou.fr
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: the code(convert the file to objc-mode) cause orgmode export to html file error
Date: Tue, 26 Dec 2017 21:13:26 +0800 (CST)	[thread overview]
Message-ID: <20171226.211326.1380080767711170814.chenpoyang@163.com> (raw)
In-Reply-To: <87bmil20eo.fsf@nicolasgoaziou.fr>

From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: Re: Bug: the code(convert the file to objc-mode) cause orgmode export to html file error
Date: Tue, 26 Dec 2017 12:28:47 +0100

> Hello,
> 
> =E9=99=88=E6=B3=BC=E6=9D=A8 <chenpoyang@163.com> writes:
> 
>> .h file use c/c++ mode or objc-mode base on it's content, so there is ema=
> cswiki solution there:
>> https://www.emacswiki.org/emacs/ObjectiveCMode, so i put the the code in =
> my configuration:
>>
>> ;; header .h add to objc-mode, this cause org unable to export to html fi=
> le
>> (add-to-list 'magic-mode-alist
>> 	     `(,(lambda ()
>> 		  (and (string=3D (file-name-extension buffer-file-name) "h")
>> 		       (re-search-forward "@\\<interface\\>"
>> 					  magic-mode-regexp-match-limit t)))
>> 	       . objc-mode))
> 
> Try to use `equal' instead of `string=3D'.
> 
> Regards,
> 
> --=20
> Nicolas Goaziou

follow your tips, i change to code, use equal, and the code is:

--------------------------------------------------------------------------------
(add-to-list 'magic-mode-alist
                `(,(lambda ()
                     (and (equal (file-name-extension buffer-file-name) "h")
                          (re-search-forward "@\\<interface\\>" 
					     magic-mode-regexp-match-limit t)))
                  . objc-mode))
--------------------------------------------------------------------------------

still unable to export org file to html:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-name-nondirectory(nil)
  file-name-extension(nil)
  (equal (file-name-extension buffer-file-name) "h")
  (and (equal (file-name-extension buffer-file-name) "h") (re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t))
  (lambda nil (and (equal (file-name-extension buffer-file-name) "h") (re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t)))()
  #[514 "\300\x02!\203	\0\x01 \207\301\x02!\207" [functionp looking-at] 4 "\n\n(fn RE DUMMY)"]((lambda nil (and (equal (file-name-extension buffer-file-name) "h") (re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t))) nil)
  assoc-default(nil (((lambda nil (and (equal (file-name-extension buffer-file-name) "h") (re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t))) . objc-mode) ("^[{[]$" . json-mode)) #[514 "\300\x02!\203	\0\x01 \207\301\x02!\207" [functionp looking-at] 4 "\n\n(fn RE DUMMY)"])
  set-auto-mode(t)
  org-html-final-function(...)
  org-export-filter-apply-functions(...)
  org-export-as(html nil nil nil (:output-file "note.html"))
  org-export-to-file(html "note.html" nil nil nil nil nil)
  org-html-export-to-html(nil nil nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)


--
Best regards
Peck Chen / 陈泼杨

  reply	other threads:[~2017-12-26 13:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-26  9:54 Bug: the code(convert the file to objc-mode) cause orgmode export to html file error 陈泼杨
2017-12-26 11:28 ` Nicolas Goaziou
2017-12-26 13:13   ` 陈泼杨 [this message]
2017-12-26 13:35     ` Nicolas Goaziou
2017-12-26 14:05       ` 陈泼杨

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171226.211326.1380080767711170814.chenpoyang@163.com \
    --to=chenpoyang@163.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).