+2015-02-18 Kelly Dean <kelly@prtime.org>
+
+ * help-mode.el (help-go-back, help-go-forward, help-follow):
+ * simple.el (yank-pop, pop-to-mark-command, exchange-point-and-mark):
+ * winner.el (winner-redo):
+ * windmove.el (windmove-do-window-select):
+ * register.el (jump-to-register, increment-register, insert-register)
+ (append-to-register, prepend-to-register):
+ * files.el (find-alternate-file, abort-if-file-too-large, write-file)
+ (set-visited-file-name):
+ * emacs-lisp/lisp.el (kill-backward-up-list):
+ Use user-error instead of error. (Bug#14480)
+
2015-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/checkdoc.el (checkdoc-show-diagnostics): Don't make bogus
2015-02-16 Kelly Dean <kelly@prtime.org>
- * lisp/files.el (insert-file-contents-literally): Fix docstring typo.
+ * files.el (insert-file-contents-literally): Fix docstring typo.
2015-02-16 Kelly Dean <kelly@prtime.org>
(backward-up-list arg)
(kill-sexp)
(insert current-sexp))
- (error "Not at a sexp"))))
+ (user-error "Not at a sexp"))))
\f
(defvar beginning-of-defun-function nil
"If non-nil, function for `beginning-of-defun-raw' to call.
(confirm-nonexistent-file-or-buffer) file-name)
t)))
(unless (run-hook-with-args-until-failure 'kill-buffer-query-functions)
- (error "Aborted"))
+ (user-error "Aborted"))
(and (buffer-modified-p) buffer-file-name
(not (yes-or-no-p "Kill and replace the buffer without saving it? "))
- (error "Aborted"))
+ (user-error "Aborted"))
(let ((obuf (current-buffer))
(ofile buffer-file-name)
(onum buffer-file-number)
(not (y-or-n-p (format "File %s is large (%s), really %s? "
(file-name-nondirectory filename)
(file-size-human-readable size) op-type))))
- (error "Aborted")))
+ (user-error "Aborted")))
(defun warn-maybe-out-of-memory (size)
"Warn if an attempt to open file of SIZE bytes may run out of memory."
(not no-query)
(not (y-or-n-p (format "A buffer is visiting %s; proceed? "
filename)))
- (error "Aborted")))
+ (user-error "Aborted")))
(or (equal filename buffer-file-name)
(progn
(and filename (lock-buffer filename))
(listp last-nonmenu-event)
use-dialog-box))
(or (y-or-n-p (format "File `%s' exists; overwrite? " filename))
- (error "Canceled")))
+ (user-error "Canceled")))
(set-visited-file-name filename (not confirm))))
(set-buffer-modified-p t)
;; Make buffer writable if file is writable.
(interactive)
(if help-xref-stack
(help-xref-go-back (current-buffer))
- (error "No previous help buffer")))
+ (user-error "No previous help buffer")))
(defun help-go-forward ()
"Go back to next topic in this help buffer."
(interactive)
(if help-xref-forward-stack
(help-xref-go-forward (current-buffer))
- (error "No next help buffer")))
+ (user-error "No next help buffer")))
(defun help-do-xref (_pos function args)
"Call the help cross-reference function FUNCTION with args ARGS.
For the cross-reference format, see `help-make-xrefs'."
(interactive)
- (error "No cross-reference here"))
+ (user-error "No cross-reference here"))
(defun help-follow-symbol (&optional pos)
"In help buffer, show docs for symbol at POS, defaulting to point.
(goto-char (cadr val)))
((markerp val)
(or (marker-buffer val)
- (error "That register's buffer no longer exists"))
+ (user-error "That register's buffer no longer exists"))
(switch-to-buffer (marker-buffer val))
(goto-char val))
((and (consp val) (eq (car val) 'file))
((and (consp val) (eq (car val) 'file-query))
(or (find-buffer-visiting (nth 1 val))
(y-or-n-p (format "Visit file %s again? " (nth 1 val)))
- (error "Register access aborted"))
+ (user-error "Register access aborted"))
(find-file (nth 1 val))
(goto-char (nth 2 val)))
(t
- (error "Register doesn't contain a buffer position or configuration")))))
+ (user-error "Register doesn't contain a buffer position or configuration")))))
(defun register-swap-out ()
"Turn markers into file-query references when a buffer is killed."
(set-register register (+ number register-val))))
((or (not register-val) (stringp register-val))
(append-to-register register (region-beginning) (region-end) prefix))
- (t (error "Register does not contain a number or text")))))
+ (t (user-error "Register does not contain a number or text")))))
(defun view-register (register)
"Display what is contained in register named REGISTER.
((and (markerp val) (marker-position val))
(princ (marker-position val) (current-buffer)))
(t
- (error "Register does not contain text"))))
+ (user-error "Register does not contain text"))))
(if (not arg) (exchange-point-and-mark)))
(defun copy-to-register (register start end &optional delete-flag region)
(set-register
register (cond ((not reg) text)
((stringp reg) (concat reg separator text))
- (t (error "Register does not contain text")))))
+ (t (user-error "Register does not contain text")))))
(setq deactivate-mark t)
(cond (delete-flag
(delete-region start end))
(set-register
register (cond ((not reg) text)
((stringp reg) (concat text separator reg))
- (t (error "Register does not contain text")))))
+ (t (user-error "Register does not contain text")))))
(setq deactivate-mark t)
(cond (delete-flag
(delete-region start end))
doc string for `insert-for-yank-1', which see."
(interactive "*p")
(if (not (eq last-command 'yank))
- (error "Previous command was not a yank"))
+ (user-error "Previous command was not a yank"))
(setq this-command 'yank)
(unless arg (setq arg 1))
(let ((inhibit-read-only t)
\(Does not affect global mark ring)."
(interactive)
(if (null (mark t))
- (error "No mark set in this buffer")
+ (user-error "No mark set in this buffer")
(if (= (point) (mark t))
(message "Mark popped"))
(goto-char (mark t))
(let ((omark (mark t))
(temp-highlight (eq (car-safe transient-mark-mode) 'only)))
(if (null omark)
- (error "No mark set in this buffer"))
+ (user-error "No mark set in this buffer"))
(set-mark (point))
(goto-char omark)
(cond (temp-highlight
If no window is at direction DIR, an error is signaled."
(let ((other-window (windmove-find-other-window dir arg window)))
(cond ((null other-window)
- (error "No window %s from selected window" dir))
+ (user-error "No window %s from selected window" dir))
((and (window-minibuffer-p other-window)
(not (minibuffer-window-active-p other-window)))
- (error "Minibuffer is inactive"))
+ (user-error "Minibuffer is inactive"))
(t
(select-window other-window)))))
(ring-ref winner-pending-undo-ring 0)))
(unless (eq (selected-window) (minibuffer-window))
(message "Winner undid undo")))
- (t (error "Previous command was not a `winner-undo'"))))
+ (t (user-error "Previous command was not a `winner-undo'"))))
(provide 'winner)
;;; winner.el ends here