From: Fabián Ezequiel Gallina Date: Sun, 27 Jul 2014 07:05:13 +0000 (-0300) Subject: Cleanup error signals. X-Git-Tag: emacs-25.0.90~2636^3~31 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c76059efc6e9a7545e46f12c03cd54a3060d63be;p=emacs.git Cleanup error signals. * lisp/progmodes/python.el (python-indent-shift-left): Use user-error instead. (python-shell-prompt-detect): Use lwarn with python group. (python-completion-complete-at-point) (python-eldoc--get-doc-at-point): Don't signal error. Fixes: debbugs:18067 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0b9edd3dcf6..1a272725b9e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2014-07-27 Fabián Ezequiel Gallina + + Cleanup error signals. (Bug#18067) + * progmodes/python.el + (python-indent-shift-left): Use user-error instead. + (python-shell-prompt-detect): Use lwarn with python group. + (python-completion-complete-at-point) + (python-eldoc--get-doc-at-point): Don't signal error. + 2014-07-27 Fabián Ezequiel Gallina Support for packages in Python shell. (Bug#13570) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 50dc293a955..d39d7a3aa41 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1111,12 +1111,10 @@ any lines in the region are indented less than COUNT columns." (while (< (point) end) (if (and (< (current-indentation) count) (not (looking-at "[ \t]*$"))) - (error "Can't shift all lines enough")) + (user-error "Can't shift all lines enough")) (forward-line)) (indent-rigidly start end (- count)))))) -(add-to-list 'debug-ignored-errors "^Can't shift all lines enough") - (defun python-indent-shift-right (start end &optional count) "Shift lines contained in region START END by COUNT columns to the right. COUNT defaults to `python-indent-offset'. If region isn't @@ -1935,7 +1933,9 @@ detection and just returns nil." nil))) (when (and (not prompts) python-shell-prompt-detect-failure-warning) - (warn + (lwarn + '(python python-shell-prompt-regexp) + :warning (concat "Python shell prompts cannot be detected.\n" "If your emacs session hangs when starting python shells\n" @@ -3029,13 +3029,9 @@ For this to work as best as possible you should call `python-shell-send-buffer' from time to time so context in inferior Python process is updated properly." (let ((process (python-shell-get-process))) - (if (not process) - (error "Completion needs an inferior Python process running") + (when process (python-shell-completion-complete-at-point process)))) -(add-to-list 'debug-ignored-errors - "^Completion needs an inferior Python process running.") - ;;; Fill paragraph @@ -3552,8 +3548,7 @@ If not FORCE-INPUT is passed then what `python-info-current-symbol' returns will be used. If not FORCE-PROCESS is passed what `python-shell-get-process' returns is used." (let ((process (or force-process (python-shell-get-process)))) - (if (not process) - (error "Eldoc needs an inferior Python process running") + (when process (let ((input (or force-input (python-info-current-symbol t)))) (and input @@ -3580,9 +3575,6 @@ Interactively, prompt for symbol." nil nil symbol)))) (message (python-eldoc--get-doc-at-point symbol))) -(add-to-list 'debug-ignored-errors - "^Eldoc needs an inferior Python process running.") - ;;; Imenu