renard / o-blog

Standalone orgmode blog exporter. DEPECATED, NOT MAINTAINED
http://renard.github.com/o-blog-v2
260 stars 58 forks source link

#+O_BLOG_SOURCE can't auto detect buffer mode #69

Closed ghost closed 9 years ago

ghost commented 11 years ago

file: o-blog-source.el fun: o-blog-publish-source

         (with-temp-buffer
           (insert-file-contents src-file)
           (if mode
               (let ((func (intern (format "%s-mode" mode))))
                 (if (functionp func)
                 (funcall func)
                   (warn (concat "Mode %s not found for %s. "
                         "Consider installing it. "
                         "No syntax highlight would be bone this time.")
                     mode src-file)))
             (set-auto-mode))

This can not auto detect the major of src-file, may be you can add this:

               (or mode
                   (setq mode (assoc-default src-file auto-mode-alist
                                             'string-match)))
               (funcall mode)