From: Eshel Yaron Date: Thu, 17 Aug 2023 21:39:58 +0000 (+0200) Subject: Use 'without-restriction'. X-Git-Tag: V9.1.14-sweep-0.23.0~2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=03cfe0c92472be4a234fd155160e5d4f7c9ea89e;p=sweep.git Use 'without-restriction'. * sweeprolog.el (sweeprolog-analyze-buffer) (sweeprolog--buffer-string) (sweeprolog-export-predicate): Use 'without-restriction' instead of 'save-restriction' and 'widen'. --- diff --git a/sweeprolog.el b/sweeprolog.el index a287230..0968365 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -3017,17 +3017,15 @@ modified." (interactive (list t)) (when (or force sweeprolog--buffer-modified) (sweeprolog-xref-buffer) - (save-restriction - (widen) - (let ((sweeprolog--analyze-point (point))) + (without-restriction + (let ((sweeprolog--analyze-point (point))) (sweeprolog-analyze-region (point-min) (point-max)))) (setq sweeprolog--buffer-modified nil))) (defun sweeprolog--buffer-string (filename) (when-let ((buf (find-buffer-visiting filename))) (with-current-buffer buf - (save-restriction - (widen) + (without-restriction (buffer-substring-no-properties (point-min) (point-max)))))) @@ -4593,8 +4591,7 @@ non-exported predicates defined in the current buffer." (sweeprolog-read-exportable-predicate) (read-string "Export comment: "))) sweeprolog-mode) - (save-restriction - (widen) + (without-restriction (save-excursion (goto-char (point-min)) (unless (or (sweeprolog-at-beginning-of-top-term-p)