Sfoglia il codice sorgente

org-element--parse-to: Simplify code

Ihor Radchenko 3 anni fa
parent
commit
e29fea256d
1 ha cambiato i file con 11 aggiunte e 12 eliminazioni
  1. 11 12
      lisp/org-element.el

+ 11 - 12
lisp/org-element.el

@@ -6475,18 +6475,17 @@ If you observe Emacs hangs frequently, please report this to Org mode mailing li
                        ;; may exist though.  Parse starting from the
                        ;; last sibling or from ELEM-END if there are
                        ;; no other siblings.
-                       (let ((p (point)))
-                         (goto-char pos)
-                         (unless
-                             (re-search-backward
-                              (rx-to-string
-                               `(and bol (repeat ,(let ((level (org-element-property :level element)))
-                                                    (if org-odd-levels-only (1- (* level 2)) level))
-                                                 "*")
-                                     " "))
-                              elem-end t)
-                           ;; Roll-back to normal parsing.
-                           (goto-char p))))))
+                       (goto-char pos)
+                       (unless
+                           (re-search-backward
+                            (rx-to-string
+                             `(and bol (repeat ,(let ((level (org-element-property :level element)))
+                                                  (if org-odd-levels-only (1- (* level 2)) level))
+                                               "*")
+                                   " "))
+                            elem-end t)
+                         ;; Roll-back to normal parsing.
+                         (goto-char elem-end)))))
 	         (setq mode (org-element--next-mode mode type nil)))
 	        ;; A non-greater element contains point: return it.
 	        ((not (memq type org-element-greater-elements))