Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
yantar92 committed Sep 20, 2022
1 parent be2246a commit a526ea6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
15 changes: 9 additions & 6 deletions lisp/oc-basic.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions lisp/org-agenda.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion lisp/org.el
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down

0 comments on commit a526ea6

Please sign in to comment.