Chinaunix首页 | 论坛 | 博客
  • 博客访问: 183963
  • 博文数量: 43
  • 博客积分: 1150
  • 博客等级: 少尉
  • 技术积分: 450
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-29 15:52
文章分类

全部博文(43)

文章存档

2012年(18)

2011年(24)

2008年(1)

分类:

2011-08-01 09:17:53

;;(setq org-agenda-files `org-publish-files-alist)

(require 'org-publish)


(setq note-root-dir
      (file-name-directory (or load-file-name (buffer-file-name))))

(setq note-publish-dir
      (expand-file-name "public_html" (directory-file-name
                                       (file-name-directory
                                        (directory-file-name note-root-dir)))))

(setq org-publish-project-alist
      `(("note-org"
         :base-directory ,note-root-dir
         :publishing-directory ,note-publish-dir
         :base-extension "org"
         :recursive t
         :publishing-function org-publish-org-to-html
         :auto-index t
         :index-filename "index.org"
         :index-title "index"
         :link-home "index.html")
        ("note-static"
         :base-directory ,note-root-dir
         :publishing-directory ,note-publish-dir
         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|swf\\|zip\\|gz\\|txt\\|el"
         :recursive t
         :publishing-function org-publish-attachment)
        ("note" :components ("note-org" "note-static"))))

;;   "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"

(defcustom org-export-html-style
"" ""
  :group 'org-export-html
  :type 'string)

(defvar org-todo-files nil)
(setq org-agenda-files nil)

(defun org-get-todo-files-1 (base-dir &optional recurse match skip-file skip-dir)
  (mapc (lambda (f)
   (let ((fd-p (file-directory-p f))
  (fnd (file-name-nondirectory f)))
     (if (and fd-p recurse
       (not (string-match "^\\.+$" fnd))
       (if skip-dir (not (string-match skip-dir fnd)) t))
  (org-get-todo-files-1 f recurse match skip-file skip-dir)
       (unless (or fd-p ;; this is a directory
     (and skip-file (string-match skip-file fnd))
     (not (file-exists-p (file-truename f)))
     (not (string-match match fnd)))
  (pushnew f org-agenda-files)))))
 (directory-files base-dir t (unless recurse match))))

(org-get-todo-files-1 note-root-dir t (concat "^[^\\.].*\\.\\(" "org" "") )

(list org-agenda-files)

阅读(1051) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~