summaryrefslogtreecommitdiff
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-05-04 19:16:47 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-05-04 19:16:47 -0400
commit71873e2b335b721e0b3c585e88211c9564f4c743 (patch)
tree1a8cbd541abed3098018185e3b84301eed2966d4 /lisp/cus-edit.el
parent956cceb9b1ffb4117fd1ad556e782de281ee68e3 (diff)
downloademacs-71873e2b335b721e0b3c585e88211c9564f4c743.tar.gz
Add new error and function `user-error'.
* lisp/subr.el (user-error): New function. * lisp/window.el (switch-to-buffer): * lisp/vc/smerge-mode.el (smerge-resolve-function, smerge-resolve) (smerge-match-conflict): * lisp/simple.el (previous-matching-history-element) (next-matching-history-element, goto-history-element, undo-more) (undo-start): * lisp/progmodes/etags.el (visit-tags-table-buffer, find-tag-tag) (find-tag-noselect, find-tag-in-order, etags-goto-tag-location) (next-file, tags-loop-scan, list-tags, complete-tag): * lisp/progmodes/compile.el (compilation-loop): * lisp/mouse.el (mouse-minibuffer-check): * lisp/man.el (Man-bgproc-sentinel, Man-goto-page): * lisp/info.el (Info-find-node-2, Info-extract-pointer, Info-history-back) (Info-history-forward, Info-follow-reference, Info-menu) (Info-extract-menu-item, Info-extract-menu-counting) (Info-forward-node, Info-backward-node, Info-next-menu-item) (Info-last-menu-item, Info-next-preorder, Info-last-preorder) (Info-next-reference, Info-prev-reference, Info-index) (Info-index-next, Info-follow-nearest-node) (Info-copy-current-node-name): * lisp/imenu.el (imenu--make-index-alist) (imenu-default-create-index-function, imenu-add-to-menubar): * lisp/files.el (basic-save-buffer, recover-file): * lisp/emacs-lisp/easy-mmode.el (easy-mmode-define-navigation): * lisp/emacs-lisp/checkdoc.el (checkdoc-continue, checkdoc-comments) (checkdoc-message-text, checkdoc-defun): * lisp/dabbrev.el (dabbrev-completion, dabbrev--abbrev-at-point): * lisp/cus-edit.el (customize-changed-options, customize-rogue) (customize-saved, custom-variable-set, custom-variable-mark-to-save) (custom-variable-mark-to-reset-standard) (custom-variable-reset-backup, custom-face-mark-to-reset-standard) (custom-file): * lisp/completion.el (check-completion-length): * lisp/comint.el (comint-search-arg) (comint-previous-matching-input-string-position) (comint-previous-matching-input) (comint-replace-by-expanded-history-before-point, comint-send-input) (comint-copy-old-input, comint-backward-matching-input) (comint-goto-process-mark, comint-set-process-mark): * lisp/calendar/calendar.el (calendar-cursor-to-date): Use it. * lisp/bindings.el (debug-ignored-errors): Remove regexps, add `user-error'. * src/data.c (PUT_ERROR): New macro. (syms_of_data): Use it. Add new error type `user-error'. * src/undo.c (user_error): New function. (Fprimitive_undo): Use it. * src/print.c (print_error_message): Adjust print style for `user-error'. * src/keyboard.c (user_error): New function. (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el35
1 files changed, 12 insertions, 23 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 4458bb7b56f..52308319f15 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1254,8 +1254,8 @@ that were added or redefined since that version."
(if found
(custom-buffer-create (custom-sort-items found t 'first)
"*Customize Changed Options*")
- (error "No user option defaults have been changed since Emacs %s"
- since-version))))
+ (user-error "No user option defaults have been changed since Emacs %s"
+ since-version))))
(defun customize-package-emacs-version (symbol package-version)
"Return the Emacs version in which SYMBOL's meaning last changed.
@@ -1386,7 +1386,7 @@ suggest to customize that face, if it's customizable."
(default-value symbol))))
(push (list symbol 'custom-variable) found)))))
(if (not found)
- (error "No rogue user options")
+ (user-error "No rogue user options")
(custom-buffer-create (custom-sort-items found t nil)
"*Customize Rogue*"))))
;;;###autoload
@@ -1403,8 +1403,8 @@ suggest to customize that face, if it's customizable."
(get symbol 'saved-variable-comment))
(boundp symbol)
(push (list symbol 'custom-variable) found))))
- (if (not found )
- (error "No saved user options")
+ (if (not found)
+ (user-error "No saved user options")
(custom-buffer-create (custom-sort-items found t nil)
"*Customize Saved*"))))
@@ -2879,7 +2879,7 @@ Optional EVENT is the location for the menu."
(comment (widget-value comment-widget))
val)
(cond ((eq state 'hidden)
- (error "Cannot set hidden variable"))
+ (user-error "Cannot set hidden variable"))
((setq val (widget-apply child :validate))
(goto-char (widget-get val :from))
(error "%s" (widget-get val :error)))
@@ -2921,7 +2921,7 @@ Optional EVENT is the location for the menu."
(comment (widget-value comment-widget))
val)
(cond ((eq state 'hidden)
- (error "Cannot set hidden variable"))
+ (user-error "Cannot set hidden variable"))
((setq val (widget-apply child :validate))
(goto-char (widget-get val :from))
(error "Saving %s: %s" symbol (widget-get val :error)))
@@ -2995,7 +2995,7 @@ redraw the widget immediately."
(let* ((symbol (widget-value widget)))
(if (get symbol 'standard-value)
(custom-variable-backup-value widget)
- (error "No standard setting known for %S" symbol))
+ (user-error "No standard setting known for %S" symbol))
(put symbol 'variable-comment nil)
(put symbol 'customized-value nil)
(put symbol 'customized-variable-comment nil)
@@ -3057,7 +3057,7 @@ to switch between two values."
(condition-case nil
(funcall set symbol (car value))
(error nil)))
- (error "No backup value for %s" symbol))
+ (user-error "No backup value for %s" symbol))
(put symbol 'customized-value (list (custom-quote (car value))))
(put symbol 'variable-comment comment)
(put symbol 'customized-variable-comment comment)
@@ -3795,7 +3795,7 @@ redraw the widget immediately."
(value (get symbol 'face-defface-spec))
(comment-widget (widget-get widget :comment-widget)))
(unless value
- (error "No standard setting for this face"))
+ (user-error "No standard setting for this face"))
(put symbol 'customized-face nil)
(put symbol 'customized-face-comment nil)
(custom-push-theme 'theme-face symbol 'user 'reset)
@@ -4414,7 +4414,7 @@ if only the first line of the docstring is shown."))
;; sense.
(if no-error
nil
- (error "Saving settings from \"emacs -q\" would overwrite existing customizations"))
+ (user-error "Saving settings from \"emacs -q\" would overwrite existing customizations"))
(file-chase-links (or custom-file user-init-file))))
;; If recentf-mode is non-nil, this is defined.
@@ -4875,18 +4875,7 @@ if that value is non-nil."
(put 'custom-mode 'mode-class 'special)
(define-obsolete-variable-alias 'custom-mode-hook 'Custom-mode-hook "23.1")
-(dolist (regexp
- '("^No user option defaults have been changed since Emacs "
- "^Invalid face:? "
- "^No \\(?:customized\\|rogue\\|saved\\) user options"
- "^No customizable items matching "
- "^There are unset changes"
- "^Cannot set hidden variable"
- "^No \\(?:saved\\|backup\\) value for "
- "^No standard setting known for "
- "^No standard setting for this face"
- "^Saving settings from \"emacs -q\" would overwrite existing customizations"))
- (add-to-list 'debug-ignored-errors regexp))
+(add-to-list 'debug-ignored-errors "^Invalid face:? ")
;;; The End.