emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-plist-delete rewrite
@ 2010-12-24 16:46 Julien Danjou
  2010-12-24 17:58 ` Julien Danjou
  2011-01-03 12:22 ` Carsten Dominik
  0 siblings, 2 replies; 3+ messages in thread
From: Julien Danjou @ 2010-12-24 16:46 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Julien Danjou

* org-macs.el (org-plist-delete): Rewrite faster.

* org.el (org-plist-delete): Remove duplicate from org-macs.el.

Signed-off-by: Julien Danjou <julien@danjou.info>
---
 lisp/org-macs.el |   16 +++++++---------
 lisp/org.el      |   10 ----------
 2 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 97a8fdc..608c0d7 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -289,15 +289,13 @@ we turn off invisibility temporarily.  Use this in a `let' form."
     (goto-char (point-at-bol))
     (looking-at re)))
 
-(defun org-plist-delete (plist property)
-  "Delete PROPERTY from PLIST.
-This is in contrast to merely setting it to 0."
-  (let (p)
-    (while plist
-      (if (not (eq property (car plist)))
-	  (setq p (plist-put p (car plist) (nth 1 plist))))
-      (setq plist (cddr plist)))
-    p))
+(defun org-plist-delete (plist prop)
+    "Delete PROPERTY from PLIST."
+  (let ((p (memq prop plist)))
+    (if (not p)
+        plist
+      (setcdr p (cddr p))
+      (delq prop plist))))
 
 (defun org-replace-match-keep-properties (newtext &optional fixedcase
 						  literal string)
diff --git a/lisp/org.el b/lisp/org.el
index 5fb2ba4..dd18189 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17995,16 +17995,6 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
       (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\"")
     s))
 
-(defun org-plist-delete (plist property)
-  "Delete PROPERTY from PLIST.
-This is in contrast to merely setting it to 0."
-  (let (p)
-    (while plist
-      (if (not (eq property (car plist)))
-	  (setq p (plist-put p (car plist) (nth 1 plist))))
-      (setq plist (cddr plist)))
-    p))
-
 (defun org-force-self-insert (N)
   "Needed to enforce self-insert under remapping."
   (interactive "p")
-- 
1.7.2.3

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

end of thread, other threads:[~2011-01-03 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-24 16:46 [PATCH] org-plist-delete rewrite Julien Danjou
2010-12-24 17:58 ` Julien Danjou
2011-01-03 12:22 ` Carsten Dominik

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).