branch: externals/vundo commit 9692bde8e2f1c2826871edb5588bbe3892527e63 Author: Philip Kaludercic <phil...@posteo.net> Commit: Yuan Fu <caso...@gmail.com>
* vundo.el: Use ASCII syntax for quoting variable names. --- vundo.el | 70 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/vundo.el b/vundo.el index a4e874d532..1aae18b222 100644 --- a/vundo.el +++ b/vundo.el @@ -54,7 +54,7 @@ ;; ;; By default, you need to press RET to “commit” your change and if you ;; quit with q or C-g, the changes made by vundo are rolled back. You can -;; set ‘vundo-roll-back-on-quit’ to nil to disable rolling back. +;; set `vundo-roll-back-on-quit' to nil to disable rolling back. ;; ;; Note: vundo.el requires Emacs 28. ;; @@ -79,7 +79,7 @@ ;; ;; Your default font needs to contain these Unicode characters, otherwise ;; they look terrible and don’t align. You can find a font that covers -;; these characters (eg, Symbola, Unifont), and set ‘vundo-default’ face +;; these characters (eg, Symbola, Unifont), and set `vundo-default' face ;; to use that font: ;; ;; (set-face-attribute 'vundo-default nil :family "Symbola") @@ -134,21 +134,21 @@ ;; ;; Position-only records ;; -;; We know how undo works: when undoing, ‘primitive-undo’ looks at -;; each record in ‘pending-undo-list’ and modifies the buffer +;; We know how undo works: when undoing, `primitive-undo' looks at +;; each record in `pending-undo-list' and modifies the buffer ;; accordingly, and that modification itself pushes new undo records -;; into ‘buffer-undo-list’. However, not all undo records introduce -;; modification, if the record is an integer, ‘primitive-undo’ simply -;; ‘goto’ that position, which introduces no modification to the -;; buffer and pushes no undo record to ‘buffer-undo-list’. Normally +;; into `buffer-undo-list'. However, not all undo records introduce +;; modification, if the record is an integer, `primitive-undo' simply +;; `goto' that position, which introduces no modification to the +;; buffer and pushes no undo record to `buffer-undo-list'. Normally ;; position records accompany other buffer-modifying records, but if a ;; particular record consists of only position records, we have -;; trouble: after an undo step, ‘buffer-undo-list’ didn’t grow, as far +;; trouble: after an undo step, `buffer-undo-list' didn’t grow, as far ;; as vundo tree-folding algorithm is concerned, we didn’t move. -;; Assertions expecting to see new undo records in ‘buffer-undo-list’ +;; Assertions expecting to see new undo records in `buffer-undo-list' ;; are also violated. To avoid all these complications, we ignore ;; position-only records when generating mod-list in -;; ‘vundo--mod-list-from’. These records are not removed, but they +;; `vundo--mod-list-from'. These records are not removed, but they ;; can’t harm us now. ;;; Code: @@ -246,7 +246,7 @@ By default, the tree is drawn with ASCII characters like this: |--o \\=`--o -Set this variable to ‘vundo-unicode-symbols’ to use Unicode +Set this variable to `vundo-unicode-symbols' to use Unicode characters." :type `(alist :tag "Translation alist" :key-type (symbol :tag "Part of tree") @@ -306,7 +306,7 @@ modification." "Check if the records at the start of UNDO-LIST are position-only. Position-only means all records until to the next undo boundary are position records. Position record is just an -integer (see ‘buffer-undo-list’). Assumes the first element +integer (see `buffer-undo-list'). Assumes the first element of UNDO-LIST is not nil." (let ((pos-only t)) (while (car undo-list) @@ -500,7 +500,7 @@ If FROM non-nil, build from FORM-th modification in MOD-LIST." (defun vundo--translate (text) "Translate each character in TEXT and return translated TEXT. -Translate according to ‘vundo-glyph-alist’." +Translate according to `vundo-glyph-alist'." (seq-mapcat (lambda (ch) (char-to-string (alist-get @@ -606,7 +606,7 @@ WINDOW is the window that was/is displaying the vundo buffer." (define-key map (kbd "i") #'vundo--inspect) (define-key map (kbd "d") #'vundo--debug) map) - "Keymap for ‘vundo-mode’.") + "Keymap for `vundo-mode'.") (define-derived-mode vundo-mode special-mode "Vundo" "Mode for displaying the undo tree." @@ -623,9 +623,9 @@ WINDOW is the window that was/is displaying the vundo buffer." (push 'vundo-mode evil-emacs-state-modes))) (defvar-local vundo--prev-mod-list nil - "Modification list generated by ‘vundo--mod-list-from’.") + "Modification list generated by `vundo--mod-list-from'.") (defvar-local vundo--prev-mod-hash nil - "Modification hash table generated by ‘vundo--update-mapping’.") + "Modification hash table generated by `vundo--update-mapping'.") (defvar-local vundo--prev-undo-list nil "Original buffer's `buffer-undo-list'.") (defvar-local vundo--orig-buffer nil @@ -659,9 +659,9 @@ INCREMENTAL is only applicable when entries are either added or removed from undo-list. On the other hand, if some entries are removed and some added, do not use INCREMENTAL. -This function modifies ‘vundo--prev-mod-list’, -‘vundo--prev-mod-hash’, ‘vundo--prev-undo-list’, -‘vundo--orig-buffer’." +This function modifies `vundo--prev-mod-list', +`vundo--prev-mod-hash', `vundo--prev-undo-list', +`vundo--orig-buffer'." (with-current-buffer vundo-buffer ;; 1. Setting these to nil makes `vundo--mod-list-from', ;; `vundo--update-mapping' and `vundo--build-tree' starts from @@ -897,7 +897,7 @@ Basically, return the latest non-undo modification in MOD-LIST." (defun vundo--move-to-node (current dest orig-buffer mod-list) "Move from CURRENT node to DEST node by undoing in ORIG-BUFFER. ORIG-BUFFER must be at CURRENT state. MOD-LIST is the list you -get from ‘vundo--mod-list-from’. You should refresh vundo buffer +get from `vundo--mod-list-from'. You should refresh vundo buffer after calling this function. This function modifies the content of ORIG-BUFFER." @@ -920,7 +920,7 @@ This function modifies the content of ORIG-BUFFER." (with-current-buffer orig-buffer (setq-local buffer-read-only t) ;; 2. Undo. This will undo modifications in PLANNED-UNDO and - ;; add new entries to ‘buffer-undo-list’. + ;; add new entries to `buffer-undo-list'. (let ((undo-in-progress t)) (cl-loop for step = (- source-idx dest-idx) @@ -957,29 +957,29 @@ This function modifies the content of ORIG-BUFFER." (error "No possible route"))) (defun vundo--trim-undo-list (buffer current mod-list) - "Trim ‘buffer-undo-list’ in BUFFER according to CURRENT and MOD-LIST. + "Trim `buffer-undo-list' in BUFFER according to CURRENT and MOD-LIST. CURRENT is the current mod, MOD-LIST is the current mod-list. -This function modifies ‘buffer-undo-list’ of BUFFER. +This function modifies `buffer-undo-list' of BUFFER. -IMPORTANT Relationship between ‘vundo--move-to-node’, -‘vundo--refresh-buffer’, ‘vundo--trim-undo-list’: +IMPORTANT Relationship between `vundo--move-to-node', +`vundo--refresh-buffer', `vundo--trim-undo-list': Each vundo command cycle roughly works like this: -1. ‘vundo--refresh-buffer’: ‘buffer-undo-list’ -> mod-list -2. ‘vundo--move-to-node’: read mod-list, modify ‘buffer-undo-list’ -3. ‘vundo--trim-undo-list’: trim ‘buffer-undo-list’ -1. ‘vundo--refresh-buffer’: ‘buffer-undo-list’ -> mod-list +1. `vundo--refresh-buffer': `buffer-undo-list' -> mod-list +2. `vundo--move-to-node': read mod-list, modify `buffer-undo-list' +3. `vundo--trim-undo-list': trim `buffer-undo-list' +1. `vundo--refresh-buffer': `buffer-undo-list' -> mod-list ... -We can call ‘vundo--move-to-node’ multiple times between two -‘vundo--refresh-buffer’. But we should only call -‘vundo--trim-undo-list’ once between two ‘vundo--refresh-buffer’. -Because if we only trim once, ‘buffer-undo-list’ either shrinks +We can call `vundo--move-to-node' multiple times between two +`vundo--refresh-buffer'. But we should only call +`vundo--trim-undo-list' once between two `vundo--refresh-buffer'. +Because if we only trim once, `buffer-undo-list' either shrinks or expands. But if we trim multiple times after multiple movements, it could happen that the undo-list first shrinks (trimmed) then expands. In that situation we cannot use -the INCREMENTAL option in ‘vundo--refresh-buffer’ anymore." +the INCREMENTAL option in `vundo--refresh-buffer' anymore." (let ((latest-buffer-state-idx ;; Among all the MODs that represents a unique buffer ;; state, we find the latest one. Because any node