summaryrefslogtreecommitdiff
path: root/lisp/comint.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/comint.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/comint.el')
-rw-r--r--lisp/comint.el28
1 files changed, 10 insertions, 18 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 8103db0e9bb..43e42c87be7 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -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
;; ===========================================================================