Remove redundant let, ensure the whole buffer is checked for auto-id
Redundant let was left over from past refactoring. This commit removes it. It also ensures the search for auto-id:t is made throughout the whole buffer.
This commit is contained in:
parent
c32fc49d3d
commit
81212e7c60
@ -128,13 +128,13 @@ This function executes `org-unique-id' when the buffer’s major
|
|||||||
mode is `org-mode', when the buffer is not read-only, and if
|
mode is `org-mode', when the buffer is not read-only, and if
|
||||||
\\='auto-id:t\\' is found in an #+OPTIONS line."
|
\\='auto-id:t\\' is found in an #+OPTIONS line."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((case-fold-search t))
|
|
||||||
(when (and (eq major-mode 'org-mode)
|
(when (and (eq major-mode 'org-mode)
|
||||||
(eq buffer-read-only nil)
|
(eq buffer-read-only nil)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
(goto-char (point-min))
|
||||||
(let ((case-fold-search t))
|
(let ((case-fold-search t))
|
||||||
(re-search-forward "^#\\+OPTIONS:.*auto-id:t" (point-max) t))))
|
(re-search-forward "^#\\+OPTIONS:.*auto-id:t" (point-max) t))))
|
||||||
(org-unique-id))))
|
(org-unique-id)))
|
||||||
|
|
||||||
(provide 'org-unique-id)
|
(provide 'org-unique-id)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user