Fix compiler warnings

* lisp/oc-basic.el (org-cite-basic--set-keymap): Do not use
`buffer-substring' generalized variable.  It is obsolete in Emacs 29.
Explicitly call `delete-region' + `insert'.
* lisp/org-agenda.el (org-element-lineage): Declare function.
* lisp/org.el (org--align-node-property): Use `delete-region' instead
of `buffer-substring' generalized variable.
This commit is contained in:
Ihor Radchenko 2022-09-20 11:26:50 +08:00
parent be2246a550
commit a526ea6a3e
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
3 changed files with 12 additions and 7 deletions

View File

@ -502,12 +502,15 @@ substitutes for the unknown key. Finally, it may be the symbol
(_
(lambda ()
(interactive)
(setf (buffer-substring beg end)
(concat "@"
(if (= 1 (length suggestions))
(car suggestions)
(completing-read "Did you mean: "
suggestions nil t))))))))
(save-excursion
(goto-char beg)
(delete-region beg end)
(insert
"@"
(if (= 1 (length suggestions))
(car suggestions)
(completing-read "Did you mean: "
suggestions nil t))))))))
(put-text-property beg end 'keymap km)))
(defun org-cite-basic-activate (citation)

View File

@ -83,6 +83,8 @@
(declare-function org-element-property "org-element" (property element))
(declare-function org-element--cache-active-p "org-element"
(&optional called-from-cache-change-func-p))
(declare-function org-element-lineage "org-element"
(datum &optional types with-self))
(declare-function org-habit-insert-consistency-graphs
"org-habit" (&optional line))
(declare-function org-is-habit-p "org-habit" (&optional pom))

View File

@ -18695,7 +18695,7 @@ Alignment is done according to `org-property-format', which see."
(format org-property-format (match-string 1) (match-string 3))))))
;; Do not use `replace-match' here as we want to inherit folding
;; properties if inside fold.
(setf (buffer-substring (match-beginning 0) (match-end 0)) "")
(delete-region (match-beginning 0) (match-end 0))
(insert-and-inherit newtext)))))
(defun org-indent-line ()