diff options
| author | Fabián Ezequiel Gallina | 2014-07-27 04:05:13 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2014-07-27 04:05:13 -0300 |
| commit | c76059efc6e9a7545e46f12c03cd54a3060d63be (patch) | |
| tree | f58dd4d6334ce25a42c303a74e26656b98c0a8b6 /lisp/progmodes/python.el | |
| parent | 4b03be01ceaddfd010f1cacdb49662c34d691187 (diff) | |
| download | emacs-c76059efc6e9a7545e46f12c03cd54a3060d63be.tar.gz emacs-c76059efc6e9a7545e46f12c03cd54a3060d63be.zip | |
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
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 20 |
1 files changed, 6 insertions, 14 deletions
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." | |||
| 1111 | (while (< (point) end) | 1111 | (while (< (point) end) |
| 1112 | (if (and (< (current-indentation) count) | 1112 | (if (and (< (current-indentation) count) |
| 1113 | (not (looking-at "[ \t]*$"))) | 1113 | (not (looking-at "[ \t]*$"))) |
| 1114 | (error "Can't shift all lines enough")) | 1114 | (user-error "Can't shift all lines enough")) |
| 1115 | (forward-line)) | 1115 | (forward-line)) |
| 1116 | (indent-rigidly start end (- count)))))) | 1116 | (indent-rigidly start end (- count)))))) |
| 1117 | 1117 | ||
| 1118 | (add-to-list 'debug-ignored-errors "^Can't shift all lines enough") | ||
| 1119 | |||
| 1120 | (defun python-indent-shift-right (start end &optional count) | 1118 | (defun python-indent-shift-right (start end &optional count) |
| 1121 | "Shift lines contained in region START END by COUNT columns to the right. | 1119 | "Shift lines contained in region START END by COUNT columns to the right. |
| 1122 | COUNT defaults to `python-indent-offset'. If region isn't | 1120 | COUNT defaults to `python-indent-offset'. If region isn't |
| @@ -1935,7 +1933,9 @@ detection and just returns nil." | |||
| 1935 | nil))) | 1933 | nil))) |
| 1936 | (when (and (not prompts) | 1934 | (when (and (not prompts) |
| 1937 | python-shell-prompt-detect-failure-warning) | 1935 | python-shell-prompt-detect-failure-warning) |
| 1938 | (warn | 1936 | (lwarn |
| 1937 | '(python python-shell-prompt-regexp) | ||
| 1938 | :warning | ||
| 1939 | (concat | 1939 | (concat |
| 1940 | "Python shell prompts cannot be detected.\n" | 1940 | "Python shell prompts cannot be detected.\n" |
| 1941 | "If your emacs session hangs when starting python shells\n" | 1941 | "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 | |||
| 3029 | `python-shell-send-buffer' from time to time so context in | 3029 | `python-shell-send-buffer' from time to time so context in |
| 3030 | inferior Python process is updated properly." | 3030 | inferior Python process is updated properly." |
| 3031 | (let ((process (python-shell-get-process))) | 3031 | (let ((process (python-shell-get-process))) |
| 3032 | (if (not process) | 3032 | (when process |
| 3033 | (error "Completion needs an inferior Python process running") | ||
| 3034 | (python-shell-completion-complete-at-point process)))) | 3033 | (python-shell-completion-complete-at-point process)))) |
| 3035 | 3034 | ||
| 3036 | (add-to-list 'debug-ignored-errors | ||
| 3037 | "^Completion needs an inferior Python process running.") | ||
| 3038 | |||
| 3039 | 3035 | ||
| 3040 | ;;; Fill paragraph | 3036 | ;;; Fill paragraph |
| 3041 | 3037 | ||
| @@ -3552,8 +3548,7 @@ If not FORCE-INPUT is passed then what `python-info-current-symbol' | |||
| 3552 | returns will be used. If not FORCE-PROCESS is passed what | 3548 | returns will be used. If not FORCE-PROCESS is passed what |
| 3553 | `python-shell-get-process' returns is used." | 3549 | `python-shell-get-process' returns is used." |
| 3554 | (let ((process (or force-process (python-shell-get-process)))) | 3550 | (let ((process (or force-process (python-shell-get-process)))) |
| 3555 | (if (not process) | 3551 | (when process |
| 3556 | (error "Eldoc needs an inferior Python process running") | ||
| 3557 | (let ((input (or force-input | 3552 | (let ((input (or force-input |
| 3558 | (python-info-current-symbol t)))) | 3553 | (python-info-current-symbol t)))) |
| 3559 | (and input | 3554 | (and input |
| @@ -3580,9 +3575,6 @@ Interactively, prompt for symbol." | |||
| 3580 | nil nil symbol)))) | 3575 | nil nil symbol)))) |
| 3581 | (message (python-eldoc--get-doc-at-point symbol))) | 3576 | (message (python-eldoc--get-doc-at-point symbol))) |
| 3582 | 3577 | ||
| 3583 | (add-to-list 'debug-ignored-errors | ||
| 3584 | "^Eldoc needs an inferior Python process running.") | ||
| 3585 | |||
| 3586 | 3578 | ||
| 3587 | ;;; Imenu | 3579 | ;;; Imenu |
| 3588 | 3580 | ||