; Use 'without-restriction'

* lisp/emacs-lisp/package.el (package--suggestion-applies-p):
Replace 'save-restriction'+'widen' with 'without-restriction'.
This commit is contained in:
Philip Kaludercic 2026-01-25 15:47:18 +01:00
parent 5a53e27748
commit c4dc5bc766
No known key found for this signature in database

View file

@ -4591,15 +4591,13 @@ SUG should be an element of `package-autosuggest-database'."
(and (string-match-p ext (buffer-name)) t))
((or `(,_ magic-mode-alist ,mag ,_)
`(,_ magic-mode-alist ,mag))
(save-restriction
(widen)
(without-restriction
(save-excursion
(goto-char (point-min))
(looking-at-p mag))))
((or `(,_ interpreter-mode-alist ,magic ,_)
`(,_ interpreter-mode-alist ,magic))
(save-restriction
(widen)
(without-restriction
(save-excursion
(goto-char (point-min))
(and (looking-at auto-mode-interpreter-regexp)