LoginSignup
1
1

More than 5 years have passed since last update.

Tclのflymake と org-modeの併用

Last updated at Posted at 2012-11-08

tclのソースが含まれるorg-modeのテキストを、exportしようとするとflymake-get-file-name-mode-and-masksでエラーになります。
エラー発生箇所はここ

flymake.el
(defun flymake-get-file-name-mode-and-masks (file-name)
  "Return the corresponding entry from `flymake-allowed-file-name-masks'."
  (unless (stringp file-name)
    (error "Invalid file-name"))

Emacsのトレースはこれ

*Backtrace*
Debugger entered--Lisp error: (error "Invalid file-name")
  signal(error ("Invalid file-name"))
  error("Invalid file-name")
  (if (stringp file-name) nil (error "Invalid file-name"))
  (unless (stringp file-name) (error "Invalid file-name"))
  flymake-get-file-name-mode-and-masks(nil)
  (nth 0 (flymake-get-file-name-mode-and-masks file-name))
  (let* ((init-f ...)) init-f)

.emacsに以下のコード追加し、org-modeからtcl-modeが呼ばれた時はflymakeを無効にして対応しました。

.emacs
(defvar on-org-mode nil)
(defadvice org-export (around flymake-off activate)
    (setq on-org-mode t)
    ad-do-it
    (setq on-org-mode nil))

; org-modeから呼ばれていないときのみflymakeを有効にする。
(add-hook 'tcl-mode-hook
      (lambda ()
        (unless on-org-mode
          (flymake-mode t))))
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1