From 2dad332a1439b59a62cd5ed0d8e3626d9e91e3e5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 17 Jan 2022 16:28:02 -0500 Subject: [PATCH] (hack-local-variables--find-variables): Use `user-error` * lisp/files.el (hack-local-variables--find-variables): Incorrect formatting are not coding errors. --- lisp/files.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index 1d9d450e4d3..51c6968cffd 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3968,12 +3968,12 @@ major-mode." ;; Discard the prefix. (if (looking-at prefix) (delete-region (point) (match-end 0)) - (error "Local variables entry is missing the prefix")) + (user-error "Local variables entry is missing the prefix")) (end-of-line) ;; Discard the suffix. (if (looking-back suffix (line-beginning-position)) (delete-region (match-beginning 0) (point)) - (error "Local variables entry is missing the suffix")) + (user-error "Local variables entry is missing the suffix")) (forward-line 1)) (goto-char (point-min)) @@ -3981,9 +3981,9 @@ major-mode." (and (eq handle-mode t) result))) ;; Find the variable name; (unless (looking-at hack-local-variable-regexp) - (error "Malformed local variable line: %S" - (buffer-substring-no-properties - (point) (line-end-position)))) + (user-error "Malformed local variable line: %S" + (buffer-substring-no-properties + (point) (line-end-position)))) (goto-char (match-end 1)) (let* ((str (match-string 1)) (var (intern str)) -- 2.39.2