如何停止向 odt 导出添加content_flymake.xml



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

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

我的配置文件中的 copymake 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) 

一种可能性是在运行 org-export-as-odt 时禁用flymake-find-file-hook。以下行可能有效:

(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 下运行。

最新更新