emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH]: New Add defun org-mode-or-derived-mode-p
@ 2011-09-02 11:09 Stefan Reichör
  2011-09-02 14:59 ` Tassilo Horn
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Reichör @ 2011-09-02 11:09 UTC (permalink / raw)
  To: emacs-orgmode

2011-09-02  Stefan Reichoer  <stefan@xsteve.at>

    Add org-mode-or-derived-mode-p to support org-mode derived modes

	* org-macs.el (org-mode-or-derived-mode-p): New defun

	* org-src.el (org-edit-src-code): Use org-mode-or-derived-mode-p

	* org.el (org-entry-properties): Use org-mode-or-derived-mode-p instead of org-mode-p


git diff -M  HEAD
                                                                        
  M lisp/org-macs.el 
  M lisp/org-src.el 
  M lisp/org.el 
                                                                        

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 13aff02..7603b42 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -276,6 +276,10 @@ we turn off invisibility temporarily.  Use this in a `let' form."
   "Check if the current buffer is in Org-mode."
   (eq major-mode 'org-mode))
 
+(defun org-mode-or-derived-mode-p ()
+  "Check if the current buffer is in Org-mode or a derived mode."
+  (if (derived-mode-p 'org-mode) t nil))
+
 (defsubst org-last (list)
   "Return the last element of LIST."
   (car (last list)))
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 0e8b1b1..a62f8da 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -215,7 +215,7 @@ buffer."
 	(case-fold-search t)
 	(info (org-edit-src-find-region-and-lang))
 	(full-info (org-babel-get-src-block-info))
-	(org-mode-p (or (org-mode-p) (derived-mode-p 'org-mode)))
+	(org-mode-p (org-mode-or-derived-mode-p))
 	(beg (make-marker))
 	(end (make-marker))
 	(allow-write-back-p (null code))
diff --git a/lisp/org.el b/lisp/org.el
index d63b854..d82425c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13828,7 +13828,7 @@ things up because then unnecessary parsing is avoided."
 	  beg end range props sum-props key key1 value string clocksum)
       (save-excursion
 	(when (condition-case nil
-		  (and (org-mode-p) (org-back-to-heading t))
+		  (and (org-mode-or-derived-mode-p) (org-back-to-heading t))
 		(error nil))
 	  (setq beg (point))
 	  (setq sum-props (get-text-property (point) 'org-summaries))

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-11-06 15:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-02 11:09 [PATCH]: New Add defun org-mode-or-derived-mode-p Stefan Reichör
2011-09-02 14:59 ` Tassilo Horn
2011-09-05  6:50   ` Stefan Reichör
2011-09-05  7:36     ` Tassilo Horn
2011-10-06  8:20       ` Carsten Dominik
2011-10-11  7:18         ` Tassilo Horn
2011-10-22  9:31           ` Bastien
2011-11-03 21:35             ` Cassio Koshikumo
2011-11-06 15:11               ` David Maus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).