1

当我尝试将 org-mode 文件导出到 odf 时,我最终得到了一个损坏的输出文件。我将问题缩小到 odt 文件(实际上是一个 zip 文件)包含一个名为 content_flymake.xml 的文件。如果我删除该文件,我可以毫无问题地打开它。

现在我被困住了。我不知道下一步该做什么。

我的配置文件中的 flymake grep:

nine@nine-laptop:~/.emacs.d/configfile$ grep -A 5 -B 5 -R "flymake" *
blocks/python.el-
blocks/python.el-(add-to-list 'load-path "~/.emacs.d/vendor")
blocks/python.el-
blocks/python.el-; Make Flymake work with python
blocks/python.el-(add-to-list 'load-path "~/.emacs.d/plugins")
blocks/python.el:(add-hook 'find-file-hook 'flymake-find-file-hook)
blocks/python.el-
blocks/python.el:(when (load "flymake" t)
blocks/python.el:  (defun flymake-pyflakes-init ()
blocks/python.el:    (let* ((temp-file (flymake-init-create-temp-buffer-copy
blocks/python.el:               'flymake-create-temp-inplace))
blocks/python.el-       (local-file (file-relative-name
blocks/python.el-            temp-file
blocks/python.el-            (file-name-directory buffer-file-name))))
blocks/python.el-      (list "pycheckers"  (list local-file))))
blocks/python.el:   (add-to-list 'flymake-allowed-file-name-masks
blocks/python.el:             '("\\.py\\'" flymake-pyflakes-init)))
blocks/python.el:(load-library "flymake-cursor")
blocks/python.el:(global-set-key [f10] 'flymake-goto-prev-error)
blocks/python.el:(global-set-key [f11] 'flymake-goto-next-error)
blocks/python.el-
blocks/python.el-(require 'ipython)
blocks/python.el-
blocks/python.el-;(define-key py-mode-map (kbd "M-TAB") 'anything-ipython-complete)
blocks/python.el-;(define-key py-shell-map (kbd "M-TAB") 'anything-ipython-complete)
--
emacs- ;; If you edit it by hand, you could mess it up, so be careful.
emacs- ;; Your init file should contain only one such instance.
emacs- ;; If there is more than one, they won't work right.
emacs- )
emacs-
emacs:; Workaround for broken flymake configuration (Might be fixed in future versions)
emacs:(defun flymake-xml-init ()
emacs:  (list "xmlstarlet" (list "val" "-e" (flymake-init-create-temp-buffer-copy 'flymake-create-temp-inplace)))) 
emacs-
emacs-;;;;;;;;;;;;;;;;;;
emacs-; Mutt mail-mode ;
emacs-;;;;;;;;;;;;;;;;;;
emacs-(add-to-list 'auto-mode-alist '(".*mutt.*" . message-mode))       

还有我的组织模式配置

nine@nine-laptop:~/.emacs.d/configfile$ cat blocks/orgmode.el 
;; Org mode
(add-to-list 'load-path "~/.emacs.d/plugins/org-mode/lisp/")

;; odt-support
(require 'ox-odt)

;(require 'org-mode)
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(add-hook 'org-mode-hook 'turn-on-font-lock) ; not needed when global-font-lock-mode is on
(setq org-agenda-files (list "~/Dokument/org/arbete.org"
                 "~/Dokument/org/calendar.org"))
(setq org-startup-indented t)

;; Default ODF style
;(setq org-export-odt-styles-file "~/.emacs.d/org-mode-odtconv/predikan-style.xml")

;(setq org-default-notes-file (concat org-directory "/anteckningar.org"))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
;; Automatic Org mode pull and push
;(add-hook 'after-init-hook 'org-mobile-pull)
;(add-hook 'kill-emacs-hook 'org-mobile-push) 
4

1 回答 1

2

一种可能性是禁用flymake-find-file-hookwhile running org-export-as-odt。以下几行可能有效:

(defadvice org-export-as-odt (around remove-flymake-hook first act)
  (let ((find-file-hook find-file-hook))
    (remove-hook 'find-file-hook 'flymake-find-file-hook)
    ad-do-it))

您也可以尝试在那里自定义flymake-allowed-file-name-masks和删除.xml绑定。但这意味着默认情况下,没有 xml 文件将在 flymake 下运行。

于 2013-09-10T12:55:11.787 回答