فهرست منبع

org: Rename for more consistency

* lisp/org.el (org-get-previous-sibling): Rename from
  org-get-last-sibling to be more consistent with the rest of Emacs.
  org-get-last-sibling stays as obsolete alias.
Marco Wahl 3 سال پیش
والد
کامیت
4063d4c2d7
3فایلهای تغییر یافته به همراه12 افزوده شده و 4 حذف شده
  1. 6 0
      etc/ORG-NEWS
  2. 2 0
      lisp/org-compat.el
  3. 4 4
      lisp/org.el

+ 6 - 0
etc/ORG-NEWS

@@ -423,6 +423,12 @@ custom completion functions.
 
 
 *** Providing =directory-empty-p= from Emacs 28 as =org-directory-empty-p=
 *** Providing =directory-empty-p= from Emacs 28 as =org-directory-empty-p=
 
 
+*** =org-get-last-sibling= marked as obsolete
+
+Use =org-get-previous-sibling= instead.  This is just a rename to have
+a more consistent naming.  E.g. recall the pair of funtctions
+=next-line= / =previous-line=.
+
 * Version 9.4
 * Version 9.4
 ** Incompatible changes
 ** Incompatible changes
 *** Possibly broken internal file links: please check and fix
 *** Possibly broken internal file links: please check and fix

+ 2 - 0
lisp/org-compat.el

@@ -772,6 +772,8 @@ context.  See the individual commands for more information."
 
 
 (define-obsolete-function-alias 'org-copy 'org-refile-copy "9.4")
 (define-obsolete-function-alias 'org-copy 'org-refile-copy "9.4")
 
 
+(define-obsolete-function-alias 'org-get-last-sibling 'org-get-previous-sibling "9.4")
+
 ;;;; Obsolete link types
 ;;;; Obsolete link types
 
 
 (eval-after-load 'ol
 (eval-after-load 'ol

+ 4 - 4
lisp/org.el

@@ -6727,8 +6727,8 @@ This function is the default value of the hook `org-cycle-hook'."
   ;; First, find a reasonable region to look at:
   ;; First, find a reasonable region to look at:
   ;; Start two siblings above, end three below
   ;; Start two siblings above, end three below
   (let* ((beg (save-excursion
   (let* ((beg (save-excursion
-		(and (org-get-last-sibling)
-		     (org-get-last-sibling))
+		(and (org-get-previous-sibling)
+		     (org-get-previous-sibling))
 		(point)))
 		(point)))
 	 (end (save-excursion
 	 (end (save-excursion
 		(and (org-get-next-sibling)
 		(and (org-get-next-sibling)
@@ -7620,7 +7620,7 @@ case."
   (setq arg (prefix-numeric-value arg))
   (setq arg (prefix-numeric-value arg))
   (org-preserve-local-variables
   (org-preserve-local-variables
    (let ((movfunc (if (> arg 0) 'org-get-next-sibling
    (let ((movfunc (if (> arg 0) 'org-get-next-sibling
-		    'org-get-last-sibling))
+		    'org-get-previous-sibling))
 	 (ins-point (make-marker))
 	 (ins-point (make-marker))
 	 (cnt (abs arg))
 	 (cnt (abs arg))
 	 (col (current-column))
 	 (col (current-column))
@@ -20659,7 +20659,7 @@ This is like outline-next-sibling, but invisible headings are ok."
     (unless (or (eobp) (< (funcall outline-level) level))
     (unless (or (eobp) (< (funcall outline-level) level))
       (point))))
       (point))))
 
 
-(defun org-get-last-sibling ()
+(defun org-get-previous-sibling ()
   "Move to previous heading of the same level, and return point.
   "Move to previous heading of the same level, and return point.
 If there is no such heading, return nil."
 If there is no such heading, return nil."
   (let ((opoint (point))
   (let ((opoint (point))