浏览代码

Backport commit 48aacbf29 from Emacs

* lisp/oc-basic.el (org-cite-basic--set-keymap): Adjust
buffer-substring generalized variable usage.

Make many seldom-used generalized variables obsolete
48aacbf292fbe8d4be7761f83bf87de93497df27
Lars Ingebrigtsen
Sun Aug 21 22:12:43 2022 +0200

[ km: This was independently covered on the main branch with
  a526ea6a3.  I'm applying it here too for bookkeeping/traceability
  purposes. ]
Lars Ingebrigtsen 2 年之前
父节点
当前提交
add8552b1d
共有 1 个文件被更改,包括 7 次插入6 次删除
  1. 7 6
      lisp/oc-basic.el

+ 7 - 6
lisp/oc-basic.el

@@ -460,12 +460,13 @@ 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))))))))
+           (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)