Browse Source

Alias `org-get-valid-level' for obsolete `org-get-legal-level'.

Also replace "legal" by "valid" in other places as well.
This was committed in Emacs CVS by Juanma Barranquero.
See <E1JXHdN-0002Ov-J5@cvs.savannah.gnu.org> in emacs-commit
mailing list.
Bastien Guerry 17 years ago
parent
commit
cc3fea002c
1 changed files with 12 additions and 9 deletions
  1. 12 9
      org.el

+ 12 - 9
org.el

@@ -3549,7 +3549,7 @@ Org-mode file."
 Since there are different ways of setting style information, this variable
 needs to contain the full HTML structure to provide a style, including the
 surrounding HTML tags.  The style specifications should include definitions
-for new classes todo, done, title, and deadline.  For example, legal values
+for new classes todo, done, title, and deadline.  For example, valid values
 would be:
 
    <style type=\"text/css\">
@@ -6481,7 +6481,7 @@ in the region."
 (defun org-reduced-level (l)
   (if org-odd-levels-only (1+ (floor (/ l 2))) l))
 
-(defun org-get-legal-level (level &optional change)
+(defun org-get-valid-level (level &optional change)
   "Rectify a level change under the influence of `org-odd-levels-only'
 LEVEL is a current level, CHANGE is by how much the level should be
 modified.  Even if CHANGE is nil, LEVEL may be returned modified because
@@ -6492,13 +6492,16 @@ even level numbers will become the next higher odd number."
 	    ((< change 0) (max 1 (1+ (* 2 (/ (+ level (* 2 change)) 2))))))
     (max 1 (+ level change))))
 
+(define-obsolete-function-alias 'org-get-legal-level
+    'org-get-valid-level "23.1")
+
 (defun org-promote ()
   "Promote the current heading higher up the tree.
 If the region is active in `transient-mark-mode', promote all headings
 in the region."
   (org-back-to-heading t)
   (let* ((level (save-match-data (funcall outline-level)))
-	 (up-head (concat (make-string (org-get-legal-level level -1) ?*) " "))
+	 (up-head (concat (make-string (org-get-valid-level level -1) ?*) " "))
 	 (diff (abs (- level (length up-head) -1))))
     (if (= level 1) (error "Cannot promote to level 0. UNDO to recover if necessary"))
     (replace-match up-head nil t)
@@ -6512,7 +6515,7 @@ If the region is active in `transient-mark-mode', demote all headings
 in the region."
   (org-back-to-heading t)
   (let* ((level (save-match-data (funcall outline-level)))
-	 (down-head (concat (make-string (org-get-legal-level level 1) ?*) " "))
+	 (down-head (concat (make-string (org-get-valid-level level 1) ?*) " "))
 	 (diff (abs (- level (length down-head) -1))))
     (replace-match down-head nil t)
     ;; Fixup tag positioning
@@ -8117,7 +8120,7 @@ this heading."
 	    ;; No specific heading, just go to end of file.
 	    (goto-char (point-max)) (insert "\n"))
 	  ;; Paste
-	  (org-paste-subtree (org-get-legal-level level 1))
+	  (org-paste-subtree (org-get-valid-level level 1))
 
 	  ;; Mark the entry as done
 	  (when (and org-archive-mark-done
@@ -14103,7 +14106,7 @@ See also the variable `org-reverse-note-order'."
 			     (end-of-line 1)
 			     (insert "\n"))))
 		     (bookmark-set "org-remember-last-stored")
-		     (org-paste-subtree (org-get-legal-level level 1) txt))
+		     (org-paste-subtree (org-get-valid-level level 1) txt))
 		    ((eq exitcmd 'left)
 		     ;; before current
 		     (bookmark-set "org-remember-last-stored")
@@ -14122,7 +14125,7 @@ See also the variable `org-reverse-note-order'."
 		     (goto-char (point-max))
 		     (if (not (bolp)) (newline))
 		     (bookmark-set "org-remember-last-stored")
-		     (org-paste-subtree (org-get-legal-level 1 1) txt)))
+		     (org-paste-subtree (org-get-valid-level 1 1) txt)))
 
 		  ((and (bobp) reversed)
 		   ;; Put it at the start, as level 1
@@ -14303,7 +14306,7 @@ heading in the current buffer."
 		(widen)
 		(goto-char pos)
 		(looking-at outline-regexp)
-		(setq level (org-get-legal-level (funcall outline-level) 1))
+		(setq level (org-get-valid-level (funcall outline-level) 1))
 		(goto-char
 		 (if reversed
 		     (outline-next-heading)
@@ -19081,7 +19084,7 @@ If LEVEL is given, prefix time with a corresponding number of stars.
 This creates a new overlay and stores it in `org-clock-overlays', so that it
 will be easy to remove."
   (let* ((c 60) (h (floor (/ time 60))) (m (- time (* 60 h)))
-	 (l (if level (org-get-legal-level level 0) 0))
+	 (l (if level (org-get-valid-level level 0) 0))
 	 (off 0)
 	 ov tx)
     (move-to-column c)