emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: 陈泼杨 <chenpoyang@163.com>
To: emacs-orgmode@gnu.org
Subject: Bug: the code(convert the file to objc-mode) cause orgmode export to html file error
Date: Tue, 26 Dec 2017 17:54:04 +0800 (CST)	[thread overview]
Message-ID: <20171226.175404.1225205316275881747.chenpoyang@163.com> (raw)

.h file use c/c++ mode or objc-mode base on it's content, so there is emacswiki 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 file
(add-to-list 'magic-mode-alist
	     `(,(lambda ()
		  (and (string= (file-name-extension buffer-file-name) "h")
		       (re-search-forward "@\\<interface\\>"
					  magic-mode-regexp-match-limit t)))
	       . objc-mode))

i turn on debug-on-error options:(setq debug-on-error t),
and export org file to html by typing: C-c C-e h h, and there is error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-name-nondirectory(nil)
  file-name-extension(nil)
  (string= (file-name-extension buffer-file-name) "h")
  (and (string= (file-name-extension buffer-file-name) "h") (re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t))
  (lambda nil (and (string= (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 (string= (file-name-extension buffer-file-name) "h") (re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t))) nil)
  assoc-default(nil (((lambda nil (and (string= (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(...) ;; some long text i delete to make the mail clean
  org-export-filter-apply-functions(...) ;; some long text i delete to make the mail clean
  org-export-as(html nil nil nil (:output-file "study.html"))
  org-export-to-file(html "study.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)

may be it cause org file unable to convert to other format files too.
------------------------------------------------------------------------



Emacs  : GNU Emacs 25.3.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911))
 of 2017-09-13
Package: Org mode version 9.1.5 (9.1.5-1-gb3ddb0-elpa @ /Users/peck/.emacs.d/elpa/org-20171225/)

current state:
==============
(setq
 org-hide-leading-stars t
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-log-done t
 org-confirm-shell-link-function 'yes-or-no-p
 org-agenda-custom-commands '(("h" "Daily habits" ((agenda ""))
                               ((org-agenda-show-log t) (org-agenda-ndays-to-span 7)
                                (org-agenda-log-mode-items (quote (state)))
                                (org-agenda-skip-function
                                 (quote (org-agenda-skip-entry-if (quote notregexp) ":DAILY:")))
                                )
                               )
                              ("w" . "Task schedule")
                              ("wa" "Important and urgent task" tags-todo "+PRIORITY=\"A\"")
                              ("wb" "Important but not urgent task" tags-todo
                               "-Weekly-Monthly-Daily+PRIORITY=\"B\"")
                              ("wc" "Unimportant and not urgent task" tags-todo "+PRIORITY=\"C\"")
                              ("p" . "Project schedule")
                              ("pw" tags-todo "PROJECT+WORK+CATEGORY=\"c/c++/objc\"")
                              ("pl" tags-todo "PROJECT+DREAM+CATEGORY=\"peckchen\"")
                              ("W" "Weekly Review" ((stuck "") (tags-todo "PROJECT"))))
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-font-lock-set-keywords-hook '(doom-org-custom-fontification)
 org-mode-hook '((lambda nil (org-bullets-mode 1))
                 (lambda nil (company-mode) (local-set-key "\x03w" (quote org-pomodoro)))
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-show-block-all append local] 5]
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-fontify-done-headline t
 org-bibtex-headline-format-function #[257 "\300\x01\236A\207" [:title] 3 "\n\n(fn ENTRY)"]
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-pomodoro-ticking-sound "/Users/peck/.emacs.d/elpa/org-pomodoro-20171108.1314/resources/tick.wav"
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
                  org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
 org-load-hook '(doom-org-default-settings)
 org-fontify-quote-and-verse-blocks t
 org-pomodoro-start-sound "/Users/peck/.emacs.d/elpa/org-pomodoro-20171108.1314/resources/bell.wav"
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("id" :follow org-id-open)
                       ("rmail" :follow org-rmail-open :store org-rmail-store-link)
                       ("mhe" :follow org-mhe-open :store org-mhe-store-link)
                       ("irc" :follow org-irc-visit :store org-irc-store-link)
                       ("info" :follow org-info-open :export org-info-export :store
                        org-info-store-link)
                       ("gnus" :follow org-gnus-open :store org-gnus-store-link)
                       ("docview" :follow org-docview-open :export org-docview-export :store
                        org-docview-store-link)
                       ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
                       ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete
                        org-bbdb-complete-link :store org-bbdb-store-link)
                       ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs")
                       ("doi" :follow org--open-doi-link) ("elisp" :follow org--open-elisp-link)
                       ("file" :complete org-file-complete-link)
                       ("ftp" :follow (lambda (path) (browse-url (concat "ftp:" path))))
                       ("help" :follow org--open-help-link)
                       ("http" :follow (lambda (path) (browse-url (concat "http:" path))))
                       ("https" :follow (lambda (path) (browse-url (concat "https:" path))))
                       ("mailto" :follow (lambda (path) (browse-url (concat "mailto:" path))))
                       ("news" :follow (lambda (path) (browse-url (concat "news:" path))))
                       ("shell" :follow org--open-shell-link))
 org-pomodoro-long-break-sound "/Users/peck/.emacs.d/elpa/org-pomodoro-20171108.1314/resources/bell_multiple.wav"
 org-pomodoro-finished-sound "/Users/peck/.emacs.d/elpa/org-pomodoro-20171108.1314/resources/bell.wav"
 org-pomodoro-short-break-sound "/Users/peck/.emacs.d/elpa/org-pomodoro-20171108.1314/resources/bell.wav"
 org-fontify-whole-heading-line t
 org-agenda-files '("~/org/study.org" "~/org/work.org" "~/org/daily.org" "~/org/issue.org")
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )

--
Best regards
Peck Chen / 陈泼杨

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-26  9:54 陈泼杨 [this message]
2017-12-26 11:28 ` Bug: the code(convert the file to objc-mode) cause orgmode export to html file error Nicolas Goaziou
2017-12-26 13:13   ` 陈泼杨
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.175404.1225205316275881747.chenpoyang@163.com \
    --to=chenpoyang@163.com \
    --cc=emacs-orgmode@gnu.org \
    /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).