Commit 71873e2b authored by Stefan Monnier's avatar Stefan Monnier

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.
parent 956cceb9
......@@ -438,7 +438,7 @@
2012-01-09 Chong Yidong <cyd@gnu.org>
* custom.texi (Custom Themes): Switched custom-safe-themes to use
* custom.texi (Custom Themes): Switch custom-safe-themes to use
SHA-256.
2012-01-07 Chong Yidong <cyd@gnu.org>
......@@ -455,8 +455,8 @@
(Screen Garbled): Don't refer to terminal "manufacturers".
(Total Frustration): Node deleted. Eliza is documented in
Amusements now.
(Known Problems): More info about using the bug tracker. Mention
debbugs package.
(Known Problems): More info about using the bug tracker.
Mention debbugs package.
(Bug Criteria): Copyedits.
(Understanding Bug Reporting): Mention emacs -Q.
......@@ -519,8 +519,8 @@
Document browse-url-mailto-function.
(Goto Address mode): Add index entries. Add xref to Browse-URL.
(FFAP): FFAP is not a minor mode.
(Amusements): M-x lm was renamed to M-x landmark. Document
nato-region.
(Amusements): M-x lm was renamed to M-x landmark.
Document nato-region.
2012-01-01 Chong Yidong <cyd@gnu.org>
......@@ -558,8 +558,8 @@
2011-12-26 Chong Yidong <cyd@gnu.org>
* dired.texi (Dired Enter, Misc Dired Features): Document
dired-use-ls-dired changes. Mention quit-window.
* dired.texi (Dired Enter, Misc Dired Features):
Document dired-use-ls-dired changes. Mention quit-window.
(Dired Navigation): Add index entries.
(Dired Visiting): Fix View Mode xref.
(Marks vs Flags): Prefer C-/ binding for undo.
......@@ -602,8 +602,8 @@
* vc1-xtra.texi (Version Headers): Note that these are for
Subversion, CVS, etc. only.
(General VC Options): De-document vc-keep-workfiles. Fix
RCS-isms.
(General VC Options): De-document vc-keep-workfiles.
Fix RCS-isms.
2011-12-22 Eli Zaretskii <eliz@gnu.org>
......@@ -619,8 +619,8 @@
* vc1-xtra.texi (Remote Repositories): Update introduction.
(Local Version Control): Node deleted (obsolete with DVCSes).
(Remote Repositories, Version Backups): Node deleted. Move
documentation of vc-cvs-stay-local to CVS Options.
(Remote Repositories, Version Backups): Node deleted.
Move documentation of vc-cvs-stay-local to CVS Options.
(CVS Options): Reduce verbosity of description of obscure CVS
locking feature.
(Making Revision Tags, Revision Tag Caveats): Merge into Revision
......@@ -673,11 +673,11 @@
less CVS-specific.
(VC With A Merging VCS, VC With A Locking VCS): Add xref to
Registering node.
(Secondary VC Commands): Deleted. Promote subnodes.
(Secondary VC Commands): Delete. Promote subnodes.
(Log Buffer): Add command name for C-c C-c. Fix the name of the
log buffer. Add index entries.
(VCS Changesets, Types of Log File, VC With A Merging VCS): Use
"commit" terminology.
(VCS Changesets, Types of Log File, VC With A Merging VCS):
Use "commit" terminology.
(Old Revisions): Move it to just before VC Change Log. "Tag" here
doesn't refer to tags tables. Note other possible forms of the
revision ID. C-x v = does not save.
......@@ -702,8 +702,8 @@
(Lisp Eval): Note that listed commands are available globally.
Explain the meaning of "defun" in the C-M-x context.
(Lisp Interaction): Copyedits.
(External Lisp): Fix name of inferior Lisp buffer. Mention
Scheme.
(External Lisp): Fix name of inferior Lisp buffer.
Mention Scheme.
(Compilation): Define "inferior process".
2011-12-10 Eli Zaretskii <eliz@gnu.org>
......@@ -718,8 +718,8 @@
(Compilation Mode): Add xref for grep, occur, and mouse
references. Define "locus".
(Grep Searching): Use @command.
(Debuggers, Commands of GUD, GDB Graphical Interface): Clarify
intro.
(Debuggers, Commands of GUD, GDB Graphical Interface):
Clarify intro.
(Starting GUD): Clarify how arguments are specified.
(Debugger Operation): Index entry for "GUD interaction buffer",
and move basic description here from Commands of GUD node.
......@@ -727,8 +727,8 @@
(Source Buffers): Remove gdb-find-source-frame, which is not in
gdb-mi.el.
(Other GDB Buffers): Remove gdb-use-separate-io-buffer and
toggle-gdb-all-registers, which are not in gdb-mi.el. Don't
re-document GUD interaction buffers.
toggle-gdb-all-registers, which are not in gdb-mi.el.
Don't re-document GUD interaction buffers.
* programs.texi (Symbol Completion): M-TAB can now use Semantic.
(Semantic): Add cindex entries for Semantic.
......@@ -758,8 +758,8 @@
* programs.texi (Program Modes): Mention modes that are not
included with Emacs. Fix references to other manuals for tex.
Add index entry for backward-delete-char-untabify. Mention
prog-mode-hook.
Add index entry for backward-delete-char-untabify.
Mention prog-mode-hook.
(Which Function): Use "global minor mode" terminology.
(Basic Indent, Multi-line Indent): Refer to previous descriptions
in Indentation chapter to avoid duplication.
......@@ -791,12 +791,12 @@
(TeX Editing): Add xref to documentation for Occur.
(LaTeX Editing): Add xref to Completion node.
(TeX Print): Fix description of tex-directory.
(Enriched Text): Renamed from Formatted Text. Make this node and
(Enriched Text): Rename from Formatted Text. Make this node and
its subnodes less verbose, since text/enriched files are
practically unused.
(Enriched Mode): Renamed from Requesting Formatted Text.
(Enriched Mode): Rename from Requesting Formatted Text.
(Format Colors): Node deleted.
(Enriched Faces): Renamed from Format Faces. Describe commands
(Enriched Faces): Rename from Format Faces. Describe commands
for applying colors too.
(Forcing Enriched Mode): Node deleted; merged into Enriched Mode.
......@@ -1031,12 +1031,12 @@
2011-10-18 Chong Yidong <cyd@gnu.org>
* display.texi (Faces): Simplify discussion. Move documentation
of list-faces-display here, from Standard Faces node. Note
special role of `default' background.
(Standard Faces): Note special role of `default' background. Note
that region face may be taken fom GTK. Add xref to Text Display.
(Text Scale): Rename from "Temporary Face Changes". Callers
changed. Don't bother documenting variable-pitch-mode.
of list-faces-display here, from Standard Faces node.
Note special role of `default' background.
(Standard Faces): Note special role of `default' background.
Note that region face may be taken fom GTK. Add xref to Text Display.
(Text Scale): Rename from "Temporary Face Changes".
Callers changed. Don't bother documenting variable-pitch-mode.
(Font Lock): Copyedits. Remove font-lock-maximum-size.
(Useless Whitespace): Simplify description of
delete-trailing-whitespace. Note active region case.
......@@ -1058,8 +1058,8 @@
2011-10-13 Chong Yidong <cyd@stupidchicken.com>
* killing.texi (Deletion): Add xref to Using Region. Document
delete-forward-char.
* killing.texi (Deletion): Add xref to Using Region.
Document delete-forward-char.
(Yanking): Move yank-excluded-properties to Lisp manual. Move C-y
description here. Recommend C-u C-SPC for jumping to mark.
(Kill Ring): Move kill ring variable documentation here.
......@@ -1079,10 +1079,10 @@
selection changes. Mention that commands like C-y set the mark.
(Marking Objects): Add xref to Words node. Note that mark-word
and mark-sexp also have the "extend region" behavior.
(Using Region): Mention M-$ in the table. Document
mark-even-if-inactive here instead of in Mark Ring.
(Mark Ring): Move mark-even-if-inactive to Using Region. Take
note of the "Mark Set" behavior.
(Using Region): Mention M-$ in the table.
Document mark-even-if-inactive here instead of in Mark Ring.
(Mark Ring): Move mark-even-if-inactive to Using Region.
Take note of the "Mark Set" behavior.
(Disabled Transient Mark): Rename from "Persistent Mark"
(Bug#9688). Callers changed.
......@@ -1097,8 +1097,8 @@
(Name Help): Remove an over-long joke.
(Apropos): Document prefix args. Remove duplicated descriptions.
(Help Mode): Add C-c C-b to table. Update TAB binding.
(Package Keywords): Rename from "Library by Keyword". Describe
new package menu interface.
(Package Keywords): Rename from "Library by Keyword".
Describe new package menu interface.
(Help Files, Help Echo): Tweak description.
* mini.texi (Completion Options): Add completion-cycle-threshold.
......@@ -1110,8 +1110,8 @@
2011-10-08 Chong Yidong <cyd@stupidchicken.com>
* basic.texi (Position Info): Omit page commands. Document
count-words-region and count-words.
* basic.texi (Position Info): Omit page commands.
Document count-words-region and count-words.
* text.texi (Pages): Move what-page documentation here.
......@@ -1134,8 +1134,8 @@
2011-10-07 Chong Yidong <cyd@stupidchicken.com>
* basic.texi (Inserting Text): Add xref to Completion. Add
ucs-insert example, and document prefix argument.
* basic.texi (Inserting Text): Add xref to Completion.
Add ucs-insert example, and document prefix argument.
(Moving Point): Fix introduction; C-f/C-b are no longer equivalent
to left/right. Tweak left-char and right-char descriptions.
M-left and M-right are now bound to left-word/right-word.
......@@ -1539,8 +1539,8 @@
2011-04-24 Chong Yidong <cyd@stupidchicken.com>
* maintaining.texi (List Tags): Document next-file. Suggested by
Uday S Reddy.
* maintaining.texi (List Tags): Document next-file.
Suggested by Uday S Reddy.
2011-04-23 Juanma Barranquero <lekktu@gmail.com>
......
......@@ -199,6 +199,7 @@ still be supported for Emacs 24.x.
* Lisp changes in Emacs 24.2
** New error type and new function `user-error'. Doesn't trigger the debugger.
** Completion
*** New function `completion-table-with-quoting' to handle completion
......
2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (user-error): New function.
* window.el (switch-to-buffer):
* vc/smerge-mode.el (smerge-resolve-function, smerge-resolve)
(smerge-match-conflict):
* simple.el (previous-matching-history-element)
(next-matching-history-element, goto-history-element, undo-more)
(undo-start):
* 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):
* progmodes/compile.el (compilation-loop):
* mouse.el (mouse-minibuffer-check):
* man.el (Man-bgproc-sentinel, Man-goto-page):
* 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):
* imenu.el (imenu--make-index-alist)
(imenu-default-create-index-function, imenu-add-to-menubar):
* files.el (basic-save-buffer, recover-file):
* emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
* emacs-lisp/checkdoc.el (checkdoc-continue, checkdoc-comments)
(checkdoc-message-text, checkdoc-defun):
* dabbrev.el (dabbrev-completion, dabbrev--abbrev-at-point):
* 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):
* completion.el (check-completion-length):
* 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):
* calendar/calendar.el (calendar-cursor-to-date): Use it.
* bindings.el (debug-ignored-errors): Remove regexps, add `user-error'.
2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
* dabbrev.el (dabbrev--ignore-case-p): New function.
......
......@@ -623,24 +623,13 @@ is okay. See `mode-line-format'.")
;; Packages should add to this list appropriately when they are
;; loaded, rather than listing everything here.
(setq debug-ignored-errors
;; FIXME: Maybe beginning-of-line, beginning-of-buffer, end-of-line,
;; end-of-buffer, end-of-file, buffer-read-only, and
;; file-supersession should all be user-errors!
`(beginning-of-line beginning-of-buffer end-of-line
end-of-buffer end-of-file buffer-read-only
file-supersession
,(purecopy "^Previous command was not a yank$")
,(purecopy "^Minibuffer window is not active$")
,(purecopy "^No previous history search regexp$")
,(purecopy "^No later matching history item$")
,(purecopy "^No earlier matching history item$")
,(purecopy "^End of history; no default available$")
,(purecopy "^End of defaults; no next item$")
,(purecopy "^Beginning of history; no preceding item$")
,(purecopy "^No recursive edit is in progress$")
,(purecopy "^Changes to be undone are outside visible portion of buffer$")
,(purecopy "^No undo information in this buffer$")
,(purecopy "^No further undo information")
,(purecopy "^Save not confirmed$")
,(purecopy "^Recover-file cancelled\\.$")
,(purecopy "^Cannot switch buffers in a dedicated window$")
user-error ;; That's the main one!
))
......
......@@ -1888,7 +1888,7 @@ use instead of point."
;; or on or before the digit of a 1-digit date.
(if (not (and (looking-at "[ 0-9]?[0-9][^0-9]")
(get-text-property (point) 'date)))
(if error (error "Not on a date!"))
(if error (user-error "Not on a date!"))
;; Convert segment to real month and year.
(if (zerop month) (setq month 12))
;; Go back to before the first date digit.
......@@ -1903,8 +1903,6 @@ use instead of point."
((and (= 1 month) (= segment 2)) (1+ displayed-year))
(t displayed-year))))))))
(add-to-list 'debug-ignored-errors "Not on a date!")
;; The following version of calendar-gregorian-from-absolute is preferred for
;; reasons of clarity, BUT it's much slower than the version that follows it.
......
......@@ -1076,10 +1076,10 @@ See also `comint-read-input-ring'."
(defun comint-search-arg (arg)
;; First make sure there is a ring and that we are after the process mark
(cond ((not (comint-after-pmark-p))
(error "Not at command line"))
(user-error "Not at command line"))
((or (null comint-input-ring)
(ring-empty-p comint-input-ring))
(error "Empty input ring"))
(user-error "Empty input ring"))
((zerop arg)
;; arg of zero resets search from beginning, and uses arg of 1
(setq comint-input-ring-index nil)
......@@ -1146,7 +1146,7 @@ Moves relative to `comint-input-ring-index'."
Moves relative to START, or `comint-input-ring-index'."
(if (or (not (ring-p comint-input-ring))
(ring-empty-p comint-input-ring))
(error "No history"))
(user-error "No history"))
(let* ((len (ring-length comint-input-ring))
(motion (if (> arg 0) 1 -1))
(n (mod (- (or start (comint-search-start arg)) motion) len))
......@@ -1186,7 +1186,7 @@ If N is negative, find the next or Nth next match."
(let ((pos (comint-previous-matching-input-string-position regexp n)))
;; Has a match been found?
(if (null pos)
(error "Not found")
(user-error "Not found")
;; If leaving the edit line, save partial input
(if (null comint-input-ring-index) ;not yet on ring
(setq comint-stored-incomplete-input
......@@ -1372,7 +1372,7 @@ actual side-effect."
(goto-char (match-beginning 0))
(if (not (search-forward old pos t))
(or silent
(error "Not found"))
(user-error "Not found"))
(replace-match new t t)
(message "History item: substituted"))))
(t
......@@ -1777,7 +1777,7 @@ Similarly for Soar, Scheme, etc."
(interactive)
;; Note that the input string does not include its terminal newline.
(let ((proc (get-buffer-process (current-buffer))))
(if (not proc) (error "Current buffer has no process")
(if (not proc) (user-error "Current buffer has no process")
(widen)
(let* ((pmark (process-mark proc))
(intxt (if (>= (point) (marker-position pmark))
......@@ -2201,7 +2201,7 @@ Calls `comint-get-old-input' to get old input."
(let ((input (funcall comint-get-old-input))
(process (get-buffer-process (current-buffer))))
(if (not process)
(error "Current buffer has no process")
(user-error "Current buffer has no process")
(goto-char (process-mark process))
(insert input))))
......@@ -2508,7 +2508,7 @@ If N is negative, find the next or Nth next match."
(save-excursion
(while (/= n 0)
(unless (re-search-backward regexp nil t dir)
(error "Not found"))
(user-error "Not found"))
(unless (get-char-property (point) 'field)
(setq n (- n dir))))
(field-beginning))))
......@@ -3364,7 +3364,7 @@ The process mark separates output, and input already sent,
from input that has not yet been sent."
(interactive)
(let ((proc (or (get-buffer-process (current-buffer))
(error "Current buffer has no process"))))
(user-error "Current buffer has no process"))))
(goto-char (process-mark proc))
(when (called-interactively-p 'interactive)
(message "Point is now at the process mark"))))
......@@ -3389,7 +3389,7 @@ the process mark is at the beginning of the accumulated input."
"Set the process mark at point."
(interactive)
(let ((proc (or (get-buffer-process (current-buffer))
(error "Current buffer has no process"))))
(user-error "Current buffer has no process"))))
(set-marker (process-mark proc) (point))
(message "Process mark set")))
......@@ -3741,14 +3741,6 @@ REGEXP-GROUP is the regular expression group in REGEXP to use."
(match-end regexp-group))
results))
results)))
(dolist (x '("^Not at command line$"
"^Empty input ring$"
"^No history$"
"^Not found$" ; Too common?
"^Current buffer has no process$"))
(add-to-list 'debug-ignored-errors x))
;; Converting process modes to use comint mode
;; ===========================================================================
......
......@@ -1301,8 +1301,8 @@ String must be longer than `completion-prefix-min-length'."
(defun check-completion-length (string)
(if (< (length string) completion-min-length)
(error "The string `%s' is too short to be saved as a completion"
string)
(user-error "The string `%s' is too short to be saved as a completion"
string)
(list string)))
(defun add-completion (string &optional num-uses last-use-time)
......@@ -2467,10 +2467,6 @@ if ARG is omitted or nil."
(defvaralias 'cmpl-syntax-table 'completion-syntax-table)
(defalias 'initialize-completions 'completion-initialize)
(dolist (x '("^To complete, the point must be after a symbol at least [0-9]* character long\\.$"
"^The string \".*\" is too short to be saved as a completion\\.$"))
(add-to-list 'debug-ignored-errors x))
(provide 'completion)
;;; completion.el ends here
......@@ -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.
......
......@@ -406,10 +406,10 @@ then it searches *all* buffers."
(dabbrev--find-all-expansions abbrev ignore-case-p))
(completion-ignore-case ignore-case-p))
(or (consp completion-list)
(error "No dynamic expansion for \"%s\" found%s"
abbrev
(if dabbrev--check-other-buffers
"" " in this-buffer")))
(user-error "No dynamic expansion for \"%s\" found%s"
abbrev
(if dabbrev--check-other-buffers
"" " in this-buffer")))
(setq list
(cond
((not (and ignore-case-p dabbrev-case-replace))
......@@ -585,7 +585,7 @@ all skip characters."
"Extract the symbol at point to serve as abbreviation."
;; Check for error
(if (bobp)
(error "No possible abbreviation preceding point"))
(user-error "No possible abbreviation preceding point"))
;; Return abbrev at point
(save-excursion
;; Record the end of the abbreviation.
......@@ -603,7 +603,7 @@ all skip characters."
"\\sw\\|\\s_")
nil t)
(forward-char 1)
(error "No possible abbreviation preceding point"))))
(user-error "No possible abbreviation preceding point"))))
;; Now find the beginning of that one.
(dabbrev--goto-start-of-abbrev)
(buffer-substring-no-properties
......@@ -974,11 +974,6 @@ Leaves point at the location of the start of the expansion."
(cons found-string dabbrev--last-table))
result)))))
(dolist (mess '("^No dynamic expansion for .* found"
"^No further dynamic expansion for .* found$"
"^No possible abbreviation preceding point$"))
(add-to-list 'debug-ignored-errors mess))
(provide 'dabbrev)
;;; dabbrev.el ends here
......@@ -916,7 +916,7 @@ is the starting location. If this is nil, `point-min' is used instead."
(progn
(goto-char wrong)
(if (not take-notes)
(error "%s" (checkdoc-error-text msg)))))
(user-error "%s" (checkdoc-error-text msg)))))
(checkdoc-show-diagnostics)
(if (called-interactively-p 'interactive)
(message "No style warnings."))))
......@@ -949,7 +949,7 @@ if there is one."
(e (checkdoc-file-comments-engine))
(checkdoc-generate-compile-warnings-flag
(or take-notes checkdoc-generate-compile-warnings-flag)))
(if e (error "%s" (checkdoc-error-text e)))
(if e (user-error "%s" (checkdoc-error-text e)))
(checkdoc-show-diagnostics)
e))
......@@ -987,7 +987,7 @@ Optional argument TAKE-NOTES causes all errors to be logged."
(if (not (called-interactively-p 'interactive))
e
(if e
(error "%s" (checkdoc-error-text e))
(user-error "%s" (checkdoc-error-text e))
(checkdoc-show-diagnostics)))
(goto-char p))
(if (called-interactively-p 'interactive)
......@@ -1027,19 +1027,14 @@ space at the end of each line."
(car (memq checkdoc-spellcheck-documentation-flag
'(defun t))))
(beg (save-excursion (beginning-of-defun) (point)))
(end (save-excursion (end-of-defun) (point)))
(msg (checkdoc-this-string-valid)))
(if msg (if no-error
(message "%s" (checkdoc-error-text msg))
(error "%s" (checkdoc-error-text msg)))
(setq msg (checkdoc-message-text-search beg end))
(if msg (if no-error
(message "%s" (checkdoc-error-text msg))
(error "%s" (checkdoc-error-text msg)))
(setq msg (checkdoc-rogue-space-check-engine beg end))
(if msg (if no-error
(message "%s" (checkdoc-error-text msg))
(error "%s" (checkdoc-error-text msg))))))
(end (save-excursion (end-of-defun) (point))))
(dolist (fun (list #'checkdoc-this-string-valid
(lambda () (checkdoc-message-text-search beg end))
(lambda () (checkdoc-rogue-space-check-engine beg end))))
(let ((msg (funcall fun)))
(if msg (if no-error
(message "%s" (checkdoc-error-text msg))
(user-error "%s" (checkdoc-error-text msg))))))
(if (called-interactively-p 'interactive)
(message "Checkdoc: done."))))))
......@@ -2644,12 +2639,6 @@ function called to create the messages."
(custom-add-option 'emacs-lisp-mode-hook 'checkdoc-minor-mode)
(add-to-list 'debug-ignored-errors
"Argument `.*' should appear (as .*) in the doc string")
(add-to-list 'debug-ignored-errors
"Lisp symbol `.*' should appear in quotes")
(add-to-list 'debug-ignored-errors "Disambiguate .* by preceding .*")
(provide 'checkdoc)
;;; checkdoc.el ends here
......@@ -572,8 +572,6 @@ BODY is executed after moving to the destination location."
(when was-narrowed (,narrowfun)))))))
(unless name (setq name base-name))
`(progn
(add-to-list 'debug-ignored-errors
,(concat "^No \\(previous\\|next\\) " (regexp-quote name)))
(defun ,next-sym (&optional count)
,(format "Go to the next COUNT'th %s." name)
(interactive "p")
......@@ -584,7 +582,7 @@ BODY is executed after moving to the destination location."
`(if (not (re-search-forward ,re nil t count))
(if (looking-at ,re)
(goto-char (or ,(if endfun `(,endfun)) (point-max)))