From: Stefan Monnier Date: Mon, 17 Jan 2022 21:28:02 +0000 (-0500) Subject: (hack-local-variables--find-variables): Use `user-error` X-Git-Tag: emacs-29.0.90~2981 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2dad332a1439b59a62cd5ed0d8e3626d9e91e3e5;p=emacs.git (hack-local-variables--find-variables): Use `user-error` * lisp/files.el (hack-local-variables--find-variables): Incorrect formatting are not coding errors. --- 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))