瀏覽代碼

Move the org-before-first-heading-p function to org.el.

This function was defined in org-registry.el, but it is generally useful.
Carsten Dominik 16 年之前
父節點
當前提交
acfdd25581
共有 3 個文件被更改,包括 12 次插入9 次删除
  1. 2 8
      contrib/lisp/org-registry.el
  2. 4 0
      lisp/ChangeLog
  3. 6 1
      lisp/org.el

+ 2 - 8
contrib/lisp/org-registry.el

@@ -1,6 +1,6 @@
 ;;; org-registry.el --- a registry for Org links
 ;;
-;; Copyright 2007 2008 Bastien Guerry
+;; Copyright 2007, 2008 Bastien Guerry
 ;;
 ;; Emacs Lisp Archive Entry
 ;; Filename: org-registry.el
@@ -83,12 +83,6 @@
 (defvar org-registry-alist nil
   "An alist containing the Org registry.")
 
-;; FIXME name this org-before-first-heading-p?
-(defun org-registry-before-first-heading-p ()
-  "Before first heading?"
-  (save-excursion
-    (null (re-search-backward "^\\*+ " nil t))))
-
 ;;;###autoload
 (defun org-registry-show (&optional visit)
   "Show Org files where there are links pointing to the current
@@ -123,7 +117,7 @@ buffer."
 	   ;; visit the (selected) file
 	   (funcall org-registry-find-file file)
 	   (goto-char point)
-	   (unless (org-registry-before-first-heading-p)
+	   (unless (org-before-first-heading-p)
 	     (org-show-context)))
 	  ((and files (not visit))
 	   ;; result(s) to display

+ 4 - 0
lisp/ChangeLog

@@ -1,3 +1,7 @@
+2008-12-08  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-before-first-heading-p): New function.
+
 2008-12-07  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-exp.el (org-export-as-html): Do not add a space before

+ 6 - 1
lisp/org.el

@@ -178,13 +178,13 @@ to add the symbol `xyz', and the package must have a call to
 	(const :tag "C  annotate-file:     Annotate a file with org syntax" org-annotate-file)
 	(const :tag "C  annotation-helper: Call Remeber directly from Browser" org-annotation-helper)
 	(const :tag "C  bookmark:          Org links to bookmarks" org-bookmark)
+	(const :tag "C  browser-url:       Store link, directly from Browser" org-browser-url)
 	(const :tag "C  depend:            TODO dependencies for Org-mode" org-depend)
 	(const :tag "C  elisp-symbol:      Org links to emacs-lisp symbols" org-elisp-symbol)
 	(const :tag "C  eval:              Include command output as text" org-eval)
 	(const :tag "C  eval-light:        Evaluate inbuffer-code on demand" org-eval-light)
 	(const :tag "C  expiry:            Expiry mechanism for Org entries" org-expiry)
 	(const :tag "C  exp-blocks:        Pre-process blocks for export" org-exp-blocks)
-	(const :tag "C  id:                Global id's for identifying entries" org-id)
 	(const :tag "C  interactive-query: Interactive modification of tags query" org-interactive-query)
 	(const :tag "C  mairix:            Hook mairix search into Org for different MUAs" org-mairix)
 	(const :tag "C  man:               Support for links to manpages in Org-mode" org-man)
@@ -14308,6 +14308,11 @@ plainly yank the text as it is.
     (error (error "Before first headline at position %d in buffer %s"
 		  (point) (current-buffer)))))
 
+(defun org-before-first-heading-p ()
+  "Before first heading?"
+  (save-excursion
+    (null (re-search-backward "^\\*+ " nil t))))
+
 (defalias 'org-on-heading-p 'outline-on-heading-p)
 (defalias 'org-at-heading-p 'outline-on-heading-p)
 (defun org-at-heading-or-item-p ()