mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-24 06:20:43 -08:00
Handle the case where 'vtable-update-object' doesn't find old object
* lisp/emacs-lisp/vtable.el (vtable-update-object): If OLD-OBJECT is not found, don't call ELT, since SEQ-POSITION may return nil. (Bug#69664)
This commit is contained in:
parent
6d1c1fca0a
commit
c94d680f6e
1 changed files with 22 additions and 22 deletions
|
|
@ -300,12 +300,11 @@ If it can't be found, return nil and don't move point."
|
|||
(error "Can't find the old object"))
|
||||
(setcar (cdr objects) object))
|
||||
;; Then update the cache...
|
||||
(let* ((line-number (seq-position (car (vtable--cache table)) old-object
|
||||
(if-let ((line-number (seq-position (car (vtable--cache table)) old-object
|
||||
(lambda (a b)
|
||||
(equal (car a) b))))
|
||||
(line (elt (car (vtable--cache table)) line-number)))
|
||||
(unless line
|
||||
(error "Can't find cached object"))
|
||||
(progn
|
||||
(setcar line object)
|
||||
(setcdr line (vtable--compute-cached-line table object))
|
||||
;; ... and redisplay the line in question.
|
||||
|
|
@ -321,7 +320,8 @@ If it can't be found, return nil and don't move point."
|
|||
'vtable table))))
|
||||
;; We may have inserted a non-numerical value into a previously
|
||||
;; all-numerical table, so recompute.
|
||||
(vtable--recompute-numerical table (cdr line)))))
|
||||
(vtable--recompute-numerical table (cdr line)))
|
||||
(error "Can't find cached object in vtable"))))
|
||||
|
||||
(defun vtable-remove-object (table object)
|
||||
"Remove OBJECT from TABLE.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue