Browse Source

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.
Ihor Radchenko 1 year ago
parent
commit
a526ea6a3e
3 changed files with 12 additions and 7 deletions
  1. 9 6
      lisp/oc-basic.el
  2. 2 0
      lisp/org-agenda.el
  3. 1 1
      lisp/org.el

+ 9 - 6
lisp/oc-basic.el

@@ -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)

+ 2 - 0
lisp/org-agenda.el

@@ -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))

+ 1 - 1
lisp/org.el

@@ -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 ()