[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Org File Annotate
Org File Annotate
Sat, 12 Jan 2008 20:47:01 +0000
Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)
;;; org-annotate-file.el --- Annotate a file with org syntax
;; Copyright (C) 2008 Philip Jackson
;; Author: Philip Jackson <address@hidden>
;; Version: 0.1
;; This file is not currently part of GNU Emacs.
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program ; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;; This is yet another implementation to allow the annotation of a
;; file without modification of the file itself. The annotation is in
;; org syntax.
;; To use you might put the following in your .emacs:
;; (require 'org-annotate-file)
;; (global-set-key (kbd "C-c C-l") 'org-annotate-file)
;; To change the location of the annotation file:
;; (setq org-annotate-file-storage-file "~/annotated.org")
(defvar org-annotate-file-storage-file "~/.org-annotate-file.org"
(defvar org-annotate-file-always-open t
"non-nil means always expand the full tree when you visit
(defun org-annotate-file ()
"Associate any buffer with an underlying file with an org
(error "This buffer has no associated file."))
(defun org-annotate-file-show-section (&optional buffer)
(let* ((filename (abbreviate-file-name (or buffer (buffer-file-name))))
(link (concat "[[file://" filename "][" filename "]]")))
(with-current-buffer (find-file org-annotate-file-storage-file)
(concat "^* " (regexp-quote link)) nil t)
(unless (eq (current-column) 0)
(insert (concat "* " link "\n"))))
;;; org-annotate-file.el ends here
|[Prev in Thread]
||[Next in Thread]|
- Org File Annotate,
Phil Jackson <=