Browse Source

Move obsolete functions to "org-compat.el"

* lisp/org.el (org-sublist):
(org-table-recognize-table.el):
(org-minutes-to-hh:mm-string):
(org-remove-angle-brackets):
(org-remove-double-quotes): Move functions...
* lisp/org-compat.el: ... here.
Nicolas Goaziou 8 years ago
parent
commit
d1c1b7f8fa
2 changed files with 42 additions and 42 deletions
  1. 42 0
      lisp/org-compat.el
  2. 0 42
      lisp/org.el

+ 42 - 0
lisp/org-compat.el

@@ -33,6 +33,7 @@
 (require 'org-macs)
 
 (declare-function org-link-set-parameters "org" (type &rest rest))
+(declare-function table--at-cell-p "table" (position &optional object at-column))
 
 ;; As of Emacs 25.1, `outline-mode' functions are under the 'outline-'
 ;; prefix, `find-tag' is replaced with `xref-find-definition' and
@@ -86,6 +87,13 @@
 (define-obsolete-function-alias 'org-some 'cl-some "Org 9.0")
 (define-obsolete-function-alias 'org-floor* 'cl-floor "Org 9.0")
 
+(defun org-sublist (list start end)
+  "Return a section of LIST, from START to END.
+Counting starts at 1."
+  (cl-subseq list (1- start) end))
+(make-obsolete 'org-sublist "cl-subseq (note the 0-based counting)." "Org 9.0")
+
+
 ;;;; Functions available since Emacs 24.3
 (define-obsolete-function-alias 'org-buffer-narrowed-p 'buffer-narrowed-p "Org 9.0")
 (define-obsolete-function-alias 'org-called-interactively-p 'called-interactively-p "Org 9.0")
@@ -225,6 +233,40 @@ See `org-link-parameters' for documentation on the other parameters."
 
 (make-obsolete 'org-add-link-type "use `org-link-set-parameters' instead." "Org 9.0")
 
+(defun org-table-recognize-table.el ()
+  "If there is a table.el table nearby, recognize it and move into it."
+  (when (and org-table-tab-recognizes-table.el (org-at-table.el-p))
+    (beginning-of-line)
+    (unless (or (looking-at org-table-dataline-regexp)
+		(not (looking-at org-table1-hline-regexp)))
+      (forward-line)
+      (when (looking-at org-table-any-border-regexp)
+	(forward-line -2)))
+    (if (re-search-forward "|" (org-table-end t) t)
+	(progn
+	  (require 'table)
+	  (if (table--at-cell-p (point)) t
+	    (message "recognizing table.el table...")
+	    (table-recognize-table)
+	    (message "recognizing table.el table...done")))
+      (error "This should not happen"))))
+
+;; Not used by Org core since commit 6d1e3082, Feb 2010.
+(make-obsolete 'org-table-recognize-table.el
+	       "please notify the org mailing list if you use this function."
+	       "Org 9.0")
+
+(define-obsolete-function-alias
+  'org-minutes-to-hh:mm-string 'org-minutes-to-clocksum-string "Org 8.0")
+
+(defun org-remove-angle-brackets (s)
+  (org-unbracket-string "<" ">" s))
+(make-obsolete 'org-remove-angle-brackets 'org-unbracket-string "Org 9.0")
+
+(defun org-remove-double-quotes (s)
+  (org-unbracket-string "\"" "\"" s))
+(make-obsolete 'org-remove-double-quotes 'org-unbracket-string "Org 9.0")
+
 ;;;; Obsolete link types
 
 (eval-after-load 'org

+ 0 - 42
lisp/org.el

@@ -4591,9 +4591,6 @@ This is needed for font-lock setup.")
 (declare-function orgtbl-send-table "org-table" (&optional maybe))
 (declare-function parse-time-string "parse-time" (string))
 (declare-function speedbar-line-directory "speedbar" (&optional depth))
-(declare-function table--at-cell-p
-		  "table"
-		  (position &optional object at-column))
 
 (defvar align-mode-rules-list)
 (defvar calc-embedded-close-formula)
@@ -4631,28 +4628,6 @@ If `org-enable-table-editor' is nil, return nil unconditionally."
 	 (and (eq (org-element-type element) 'table)
 	      (eq (org-element-property :type element) 'table.el)))))
 
-(defun org-table-recognize-table.el ()
-  "If there is a table.el table nearby, recognize it and move into it."
-  (when (and org-table-tab-recognizes-table.el (org-at-table.el-p))
-    (beginning-of-line)
-    (unless (or (looking-at org-table-dataline-regexp)
-		(not (looking-at org-table1-hline-regexp)))
-      (forward-line)
-      (when (looking-at org-table-any-border-regexp)
-	(forward-line -2)))
-    (if (re-search-forward "|" (org-table-end t) t)
-	(progn
-	  (require 'table)
-	  (if (table--at-cell-p (point)) t
-	    (message "recognizing table.el table...")
-	    (table-recognize-table)
-	    (message "recognizing table.el table...done")))
-      (error "This should not happen"))))
-;;; This function is not used by org core since commit 6d1e3082, Feb 2010
-(make-obsolete 'org-table-recognize-table.el
-	       "please notify the org mailing list if you use this function."
-	       "Org 9.0")
-
 (defun org-at-table-hline-p ()
   "Non-nil when point is inside a hline in a table.
 Assume point is already in a table.  If `org-enable-table-editor'
@@ -11345,16 +11320,10 @@ or to another Org file, automatically push the old position onto the ring."
     (goto-char m)
     (when (or (outline-invisible-p) (org-invisible-p2)) (org-show-context 'mark-goto))))
 
-(defun org-remove-angle-brackets (s)
-  (org-unbracket-string "<" ">" s))
-(make-obsolete 'org-remove-angle-brackets 'org-unbracket-string "Org 9.0")
 (defun org-add-angle-brackets (s)
   (unless (equal (substring s 0 1) "<") (setq s (concat "<" s)))
   (unless (equal (substring s -1) ">") (setq s (concat s ">")))
   s)
-(defun org-remove-double-quotes (s)
-  (org-unbracket-string "\"" "\"" s))
-(make-obsolete 'org-remove-double-quotes 'org-unbracket-string "Org 9.0")
 
 ;;; Following specific links
 
@@ -18420,10 +18389,6 @@ The format is determined by `org-time-clocksum-format',
 	;; return formatted time duration
 	clocksum))))
 
-(defalias 'org-minutes-to-hh:mm-string 'org-minutes-to-clocksum-string)
-(make-obsolete 'org-minutes-to-hh:mm-string 'org-minutes-to-clocksum-string
-	       "Org mode version 8.0")
-
 (defun org-hours-to-clocksum-string (n)
   (org-minutes-to-clocksum-string (* n 60)))
 
@@ -22640,13 +22605,6 @@ so values can contain further %-escapes if they are define later in TABLE."
 	  (setq string (replace-match sref t t string)))))
     string))
 
-(defun org-sublist (list start end)
-  "Return a section of LIST, from START to END.
-
-Counting starts at 1."
-  (cl-subseq list (1- start) end))
-(make-obsolete 'org-sublist "cl-subseq (note the 0-based counting)." "Org 9.0")
-
 (defun org-find-base-buffer-visiting (file)
   "Like `find-buffer-visiting' but always return the base buffer and
 not an indirect buffer."