Fix apparently wrong delete and delq value discards (bug#61730)

* lisp/startup.el (normal-top-level):
Update process-environment in case the DISPLAY variable comes first.
Also stop iterating over initial-environment once the first DISPLAY
is found.
* lisp/allout.el (allout-get-configvar-values):
* lisp/org/org.el (org-display-inline-remove-overlay):
* lisp/progmodes/gdb-mi.el (gdb-get-location):
* lisp/progmodes/idlwave.el
(idlwave-convert-xml-clean-routine-aliases)
(idlwave-convert-xml-clean-sysvar-aliases):
* lisp/textmodes/reftex.el (reftex-ref-style-toggle):
Update the base variable after performing a destructive deletion,
where it was obvious that this was intended.
This commit is contained in:
Mattias Engdegård 2023-05-24 22:36:19 +02:00
parent e3987d7e1a
commit af4791b570
6 changed files with 19 additions and 13 deletions

View file

@ -6307,7 +6307,7 @@ not its value."
(if (yes-or-no-p (format-message
"%s entry `%s' is unbound -- remove it? "
configvar-name sym))
(delq sym (symbol-value configvar-name)))
(set configvar-name (delq sym (symbol-value configvar-name))))
(push (symbol-value sym) got)))
(reverse got)))
;;;_ : Topics:

View file

@ -16422,7 +16422,7 @@ buffer boundaries with possible narrowing."
(defun org-display-inline-remove-overlay (ov after _beg _end &optional _len)
"Remove inline-display overlay if a corresponding region is modified."
(when (and ov after)
(delete ov org-inline-image-overlays)
(setq org-inline-image-overlays (delete ov org-inline-image-overlays))
;; Clear image from cache to avoid image not updating upon
;; changing on disk. See Emacs bug#59902.
(when (overlay-get ov 'org-image-overlay)

View file

@ -3244,7 +3244,8 @@ Place breakpoint icon in its buffer."
(if (re-search-forward gdb-source-file-regexp nil t)
(progn
(setq source-file (gdb-mi--c-string-from-string (match-string 1)))
(delete (cons bptno "File not found") gdb-location-alist)
(setq gdb-location-alist
(delete (cons bptno "File not found") gdb-location-alist))
(push (cons bptno source-file) gdb-location-alist))
(gdb-resync)
(unless (assoc bptno gdb-location-alist)

View file

@ -4653,7 +4653,7 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.")
(setcar alias (car x))
(push alias idlwave-system-routines)))
(cl-loop for x in remove-list do
(delq x idlwave-system-routines))))
(setq idlwave-system-routines (delq x idlwave-system-routines)))))
(defun idlwave-convert-xml-clean-sysvar-aliases (aliases)
;; Duplicate and trim original routine aliases from rinfo list
@ -4666,7 +4666,8 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.")
(setcar alias (car x))
(push alias idlwave-system-variables-alist)))
(cl-loop for x in remove-list do
(delq x idlwave-system-variables-alist))))
(setq idlwave-system-variables-alist
(delq x idlwave-system-variables-alist)))))
(defun idlwave-xml-create-sysvar-alist (xml-entry)

View file

@ -837,12 +837,16 @@ It is the default value of the variable `top-level'."
(let ((display (frame-parameter nil 'display)))
;; Be careful which DISPLAY to remove from process-environment: follow
;; the logic of `callproc.c'.
(if (stringp display) (setq display (concat "DISPLAY=" display))
(dolist (varval initial-environment)
(if (string-match "\\`DISPLAY=" varval)
(setq display varval))))
(if (stringp display)
(setq display (concat "DISPLAY=" display))
(let ((env initial-environment))
(while (and env (or (not (string-match "\\`DISPLAY=" (car env)))
(progn
(setq display (car env))
nil)))
(setq env (cdr env)))))
(when display
(delete display process-environment))))
(setq process-environment (delete display process-environment)))))
(startup--honor-delayed-native-compilations))
;; Precompute the keyboard equivalents in the menu bar items.

View file

@ -477,9 +477,9 @@ will deactivate it."
changed t)
(setq list (delete style list))))
(t
(if (member style list)
(delete style list)
(setq list (append list (list style))))
(setq list (if (member style list)
(delete style list)
(append list (list style))))
(setq reftex-tables-dirty t
changed t)))
(when changed