X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/ce1d7b61f12dcc1b67535b68d9b0655b45fcadb6..249635f0dfb22bcae4c7134e95f01640a6a0d149:/lisp/org/org-compat.el diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index a3eb960e13..4466b0be80 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -1,6 +1,6 @@ ;;; org-compat.el --- Compatibility code for Org-mode -;; Copyright (C) 2004-2013 Free Software Foundation, Inc. +;; Copyright (C) 2004-2014 Free Software Foundation, Inc. ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp @@ -260,6 +260,12 @@ ignored in this case." next (+ from (* n inc))))) (nreverse seq))))) +;; `set-transient-map' is only in Emacs >= 24.4 +(defalias 'org-set-transient-map + (if (fboundp 'set-transient-map) + 'set-transient-map + 'set-temporary-overlay-map)) + ;; Region compatibility (defvar org-ignore-region nil @@ -289,7 +295,7 @@ Works on both Emacs and XEmacs." (setq mark-active t) (when (and (boundp 'transient-mark-mode) (not transient-mark-mode)) - (setq transient-mark-mode 'lambda)) + (set (make-local-variable 'transient-mark-mode) 'lambda)) (when (boundp 'zmacs-regions) (setq zmacs-regions t))))) @@ -306,8 +312,7 @@ Works on both Emacs and XEmacs." (defun org-in-invisibility-spec-p (arg) "Is ARG a member of `buffer-invisibility-spec'?" (if (consp buffer-invisibility-spec) - (member arg buffer-invisibility-spec) - nil)) + (member arg buffer-invisibility-spec))) (defmacro org-xemacs-without-invisibility (&rest body) "Turn off extents with invisibility while executing BODY." @@ -337,10 +342,15 @@ Works on both Emacs and XEmacs." (org-xemacs-without-invisibility (indent-line-to column)) (indent-line-to column))) -(defun org-move-to-column (column &optional force buffer ignore-invisible) - (let ((buffer-invisibility-spec ignore-invisible)) +(defun org-move-to-column (column &optional force buffer) + "Move to column COLUMN. +Pass COLUMN and FORCE to `move-to-column'. +Pass BUFFER to the XEmacs version of `move-to-column'." + (let ((buffer-invisibility-spec + (remove '(org-filtered) buffer-invisibility-spec))) (if (featurep 'xemacs) - (org-xemacs-without-invisibility (move-to-column column force buffer)) + (org-xemacs-without-invisibility + (move-to-column column force buffer)) (move-to-column column force)))) (defun org-get-x-clipboard-compat (value) @@ -468,6 +478,11 @@ LIMIT." (looking-at (concat "\\(?:" regexp "\\)\\'"))))) (not (null pos))))) +(defalias 'org-font-lock-ensure + (if (fboundp 'org-font-lock-ensure) + #'font-lock-ensure + (lambda (_beg _end) (font-lock-fontify-buffer)))) + (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."