X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/4a47c2757309e338321da1e7a2f6d399a306ce7d..a64bfdfa5a90731b804c057f2bcc74a8ba02937c:/lisp/org/org-compat.el diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index 324464803f..896acc5aea 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -1,12 +1,11 @@ ;;; org-compat.el --- Compatibility code for Org-mode -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 2004-2011 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 7.3 +;; Version: 7.7 ;; ;; This file is part of GNU Emacs. ;; @@ -247,6 +246,15 @@ Works on both Emacs and XEmacs." (> (point) (region-beginning))) (exchange-point-and-mark))) +;; Emacs 22 misses `activate-mark' +(if (fboundp 'activate-mark) + (defalias 'org-activate-mark 'activate-mark) + (defun org-activate-mark () + (when (mark t) + (setq mark-active t) + (unless transient-mark-mode + (setq transient-mark-mode 'lambda))))) + ;; Invisibility compatibility (defun org-remove-from-invisibility-spec (arg) @@ -372,15 +380,15 @@ TIME defaults to the current time." (time-to-seconds (or time (current-time))) (float-time time))) -(defun org-string-match-p (&rest args) - (if (fboundp 'string-match-p) - (apply 'string-match-p args) +(if (fboundp 'string-match-p) + (defalias 'org-string-match-p 'string-match-p) + (defun org-string-match-p (regexp string &optional start) (save-match-data - (apply 'string-match args)))) + (funcall 'string-match regexp string start)))) -(defun org-looking-at-p (&rest args) - (if (fboundp 'looking-at-p) - (apply 'looking-at-p args) +(if (fboundp 'looking-at-p) + (defalias 'org-looking-at-p 'looking-at-p) + (defun org-looking-at-p (&rest args) (save-match-data (apply 'looking-at args)))) @@ -418,8 +426,14 @@ LIMIT." (looking-at (concat "\\(?:" regexp "\\)\\'"))))) (not (null pos))))) +(defun org-floor* (x &optional y) + "Return a list of the floor of X and the fractional part of X. +With two arguments, return floor and remainder of their quotient." + (let ((q (floor x y))) + (list q (- x (if y (* y q) q))))) + (provide 'org-compat) -;; arch-tag: a0a0579f-e68c-4bdf-9e55-93768b846bbe + ;;; org-compat.el ends here