Fix `org-up-heading-safe'
* lisp/org.el (org-up-heading-safe): Do not throw any error, as advertised in the docstring.
This commit is contained in:
parent
a927894d12
commit
9ba9f916e8
11
lisp/org.el
11
lisp/org.el
|
@ -23702,13 +23702,10 @@ headline found, or nil if no higher level is found.
|
||||||
Also, this function will be a lot faster than `outline-up-heading',
|
Also, this function will be a lot faster than `outline-up-heading',
|
||||||
because it relies on stars being the outline starters. This can really
|
because it relies on stars being the outline starters. This can really
|
||||||
make a significant difference in outlines with very many siblings."
|
make a significant difference in outlines with very many siblings."
|
||||||
(let (start-level re)
|
(when (ignore-errors (org-back-to-heading t))
|
||||||
(org-back-to-heading t)
|
(let ((level-up (1- (funcall outline-level))))
|
||||||
(setq start-level (funcall outline-level))
|
(and (> level-up 0)
|
||||||
(if (equal start-level 1)
|
(re-search-backward (format "^\\*\\{1,%d\\} " level-up) nil t)
|
||||||
nil
|
|
||||||
(setq re (concat "^\\*\\{1," (number-to-string (1- start-level)) "\\} "))
|
|
||||||
(if (re-search-backward re nil t)
|
|
||||||
(funcall outline-level)))))
|
(funcall outline-level)))))
|
||||||
|
|
||||||
(defun org-first-sibling-p ()
|
(defun org-first-sibling-p ()
|
||||||
|
|
Loading…
Reference in New Issue