]>
Commit | Line | Data |
---|---|---|
1 | ;ELC\1c\0\0\0 | |
2 | ;;; Compiled | |
3 | ;;; in Emacs version 28.2 | |
4 | ;;; with all optimizations. | |
5 | ||
6 | ||
7 | ||
8 | (byte-code "\300\301!\210\302\303\304\305\306DD\307\310\311\312\313&\a\210\314\303\315\316#\210\302\317\304\305\320DD\321\310\311\312\313&\a\210\302\322\304\305\323DD\324\310\325\312\313&\a\210\302\326\304\305\327DD\330\310\311\312\313&\a\210\314\326\331\332#\210\302\333\304\305\334DD\335\310\311\312\313&\a\210\302\336\304\305\337DD\340\310\311\312\313&\a\210\302\341\304\305\342DD\343\310\344\312\313&\a\210\302\345\304\305\346DD\347\310\344\312\313&\a\210\302\350\304\305\351DD\352\310\353\312\313&\a\210\302\354\304\305\355DD\356\310\311\312\313&\a\210\314\354\350\357#\210\302\360\304\305\361DD\362\310\363\312\313&\a\210\302\364\304\305\365DD\366\310\363\312\313&\a\210\302\367\304\305\370DD\371\310\311\312\313&\a\210\302\372\304\305\373DD\374\310\311\312\313&\a\207" [require python custom-declare-variable elpy-dedicated-shells funcall function #[0 "\300\207" [nil] 1 #1=""] "Non-nil if Elpy should use dedicated shells.\n\nElpy can use a unique Python shell for all buffers and support\nmanually started dedicated shells. Setting this option to non-nil\nforce the creation of dedicated shells for each buffers." :type boolean :group elpy make-obsolete-variable "Dedicated shells are no longer supported by Elpy.\nYou can use `(add-hook 'elpy-mode-hook (lambda () (elpy-shell-toggle-dedicated-shell 1)))' to achieve the same result." "1.17.0" elpy-shell-display-buffer-after-send #[0 "\300\207" [nil] 1 #1#] "Whether to display the Python shell after sending something to it." elpy-shell-echo-output #[0 "\300\207" [when-shell-not-visible] 1 #1#] "Whether to echo the Python shell output in the echo area after input has been sent to the shell.\n\n Possible choices are nil (=never), `when-shell-not-visible', or\n t (=always)." (choice (const :tag "Never" nil) (const :tag "When shell not visible" when-shell-not-visible) (const :tag "Always" t)) elpy-shell-capture-last-multiline-output #[0 "\300\207" [t] 1 #1#] "Whether to capture the output of the last Python statement when sending multiple statements to the Python shell.\n\n If nil, no output is captured (nor echoed in the shell) when\n sending multiple statements. This is the default behavior of\n python.el. If non-nil and the last statement is an expression,\n captures its output so that it is echoed in the shell." "The last multiline output is now always captured." "February 2019" elpy-shell-echo-input #[0 "\300\207" [t] 1 #1#] "Whether to echo input sent to the Python shell as input in the\nshell buffer.\n\nTruncation of long inputs can be controlled via\n`elpy-shell-echo-input-lines-head' and\n`elpy-shell-echo-input-lines-tail'." elpy-shell-echo-input-cont-prompt #[0 "\300\207" [t] 1 #1#] "Whether to show a continuation prompt when echoing multi-line\ninput to the Python shell." elpy-shell-echo-input-lines-head #[0 "\300\207" [10] 1 #1#] "Maximum number of lines to show before truncating input echoed\nin the Python shell." integer elpy-shell-echo-input-lines-tail #[0 "\300\207" [10] 1 #1#] "Maximum number of lines to show after truncating input echoed\nin the Python shell." elpy-shell-starting-directory #[0 "\300\207" [project-root] 1 #1#] "Directory in which Python shells will be started.\n\nCan be `project-root' (default) to use the current project root,\n`current-directory' to use the buffer current directory, or a\nstring indicating a specific path.\n\n\\<elpy-mode-map>\nRunning python interpeters need to be restarted (with\n\\[elpy-shell-kill] followed by \\[elpy-shell-switch-to-shell]) for\nthis option to be taken into account." (choice (const :tag "Project root" project-root) (const :tag "Current directory" current-directory) (string :tag "Specific directory")) elpy-shell-use-project-root #[0 "\300\207" [t] 1 #1#] "Whether to use project root as default directory when starting a Python shells.\n\nThe project root is determined using `elpy-project-root`. If this\nvariable is set to nil, the current directory is used instead." "1.32.0" elpy-shell-cell-boundary-regexp #[0 "\300\207" ["^\\(?:##.*\\|#\\s-*<.+>\\|#\\s-*\\(?:In\\|Out\\)\\[.*\\]:\\)\\s-*$"] 1 #1#] "Regular expression for matching a line indicating the boundary\nof a cell (beginning or ending). By default, lines starting with\n``##`` are treated as a cell boundaries, as are the boundaries in\nPython files exported from IPython or Jupyter notebooks (e.g.,\n``# <markdowncell>``, ``# In[1]:'', or ``# Out[1]:``).\n\nNote that `elpy-shell-cell-beginning-regexp' must also match\nthe first boundary of the code cell." string elpy-shell-codecell-beginning-regexp #[0 "\300\207" ["^\\(?:##.*\\|#\\s-*<codecell>\\|#\\s-*In\\[.*\\]:\\)\\s-*$"] 1 #1#] "Regular expression for matching a line indicating the\nbeginning of a code cell. By default, lines starting with ``##``\nare treated as beginnings of a code cell, as are the code cell\nbeginnings (and only the code cell beginnings) in Python files\nexported from IPython or Jupyter notebooks (e.g., ``#\n<codecell>`` or ``# In[1]:``).\n\nNote that `elpy-shell-cell-boundary-regexp' must also match\nthe code cell beginnings defined here." elpy-shell-add-to-shell-history #[0 "\300\207" [nil] 1 #1#] "If Elpy should make the code sent to the shell available in the\nshell history. This allows to use `comint-previous-input' in the\npython shell to get back the pieces of code sent by Elpy. This affects\nthe following functions:\n- `elpy-shell-send-statement'\n- `elpy-shell-send-top-statement'\n- `elpy-shell-send-group'\n- `elpy-shell-send-codecell'\n- `elpy-shell-send-region-or-buffer'." elpy-shell-darwin-use-pty #[0 "\300\207" [nil] 1 #1#] "Whether to connect to the Python shell through pty on MacOS.\n\nIf nil, Elpy will connect to Python through a pipe. Any non-nil\nvalue will cause Elpy use a pseudo-terminal (pty) instead. This\nvalue should be set to nil when using a Python interpreter that\nuses the libedit version of Readline, such as the default MacOS\nPython interpreters. This value can be safely be set to true when\nusing a version of Python that uses GNU Readline.\n\nThis value is only used when `elpy-shell-get-or-create-process'\ncreates a new Python process."] 8) | |
9 | #@60 Help keep track of python buffer when changing to pyshell.\1f | |
10 | (defvar elpy--shell-last-py-buffer nil (#$ . 6192)) | |
11 | #@41 Display inferior Python process buffer.\1f | |
12 | (defalias 'elpy-shell-display-buffer #[0 "\300\301\302 !\303\304#\207" [display-buffer process-buffer elpy-shell-get-or-create-process nil visible] 4 (#$ . 6309)]) | |
13 | #@43 Switch to inferior Python process buffer.\1f | |
14 | (defalias 'elpy-shell-switch-to-shell #[0 "\301 \10\302\303\304 !!\207" [elpy--shell-last-py-buffer buffer-name pop-to-buffer process-buffer elpy-shell-get-or-create-process] 3 (#$ . 6519) nil]) | |
15 | #@69 Switch from inferior Python process buffer to recent Python buffer.\1f | |
16 | (defalias 'elpy-shell-switch-to-buffer #[0 "\301\b!\207" [elpy--shell-last-py-buffer pop-to-buffer] 2 (#$ . 6760) nil]) | |
17 | (defalias 'elpy-shell-switch-to-shell-in-current-window #[0 "\301 \10\302\303\304 !!\207" [elpy--shell-last-py-buffer buffer-name switch-to-buffer process-buffer elpy-shell-get-or-create-process] 3 nil nil]) | |
18 | (defalias 'elpy-shell-switch-to-buffer-in-current-window #[0 "\301\b!\207" [elpy--shell-last-py-buffer switch-to-buffer] 2 nil nil]) | |
19 | #@117 Kill the current python shell. | |
20 | ||
21 | If KILL-BUFF is non-nil, also kill the associated buffer. | |
22 | ||
23 | (fn &optional KILL-BUFF)\1f | |
24 | (defalias 'elpy-shell-kill #[256 "\300 \211\203\17\0\301\ 1!\210\ 1\203\12\0\302\ 1!\210\303\304\ 2\"\207\303\305!\207" [python-shell-get-buffer delete-process kill-buffer message "Killed %s shell" "No python shell to kill"] 5 (#$ . 7292) nil]) | |
25 | #@213 Kill all active python shells. | |
26 | ||
27 | If KILL-BUFFERS is non-nil, also kill the associated buffers. | |
28 | If ASK-FOR-EACH-ONE is non-nil, ask before killing each python process. | |
29 | ||
30 | (fn &optional KILL-BUFFERS ASK-FOR-EACH-ONE)\1f | |
31 | (defalias 'elpy-shell-kill-all #[512 "\300\301 \300\ 1:\2039\0\ 1@\262\ 1\302\ 1!\2032\0\303\304\302\ 3!\"\2032\0\305\ 1!\203*\0\211\ 3B\262\ 3\2022\0\ 4\2032\0\306\ 1!\210\ 1A\262\ 2\202\ 4\0\266\ 2\211\203n\0\ 1\203n\0\211\300\ 1:\203j\0\ 1@\262\ 1\307\310\311\ 3\"!\203c\0\312\ 1!\210\ 4\203c\0\306\ 1!\210\ 1A\262\ 2\202E\0\266\ 2\300\207\211\203\236\0\307\310\313\ 3G\"!\205\241\0\211\300\ 1:\203\232\0\ 1@\262\ 1\312\ 1!\210\ 4\203\223\0\306\ 1!\210\ 1A\262\ 2\202~\0\266\ 2\300\207\314\315!\207" [nil buffer-list buffer-name string-match "^\\*Python\\(?:\\[[^]]*]\\)?\\*$" get-buffer-process kill-buffer y-or-n-p format "Kill %s ? " delete-process "Kill %s python shells ? " message "No python shell to close"] 9 (#$ . 7646) nil]) | |
32 | #@160 Emulate 'executable-find' REMOTE. | |
33 | Since Emacs 27, 'executable-find' accepts the 2nd argument. | |
34 | REMOVE THIS when Elpy no longer supports Emacs 26. | |
35 | ||
36 | (fn COMMAND)\1f | |
37 | (defalias 'elpy-executable-find-remote #[257 "\302\303!A\203\f\0\303\ 1\304\"\207\305\b!\203%\0\306\ 1\307\310\311 \" \312$\211;\205$\0\313\ 1!\207\303\ 1!\207" [default-directory exec-suffixes help-function-arglist executable-find t file-remote-p locate-file mapcar #[257 "\301\b!\ 1P\207" [default-directory file-remote-p] 3 "\n\n(fn X)"] exec-path file-executable-p file-local-name] 6 (#$ . 8515)]) | |
38 | #@212 Get or create an inferior Python process for current buffer and return it. | |
39 | ||
40 | If SIT is non-nil, sit for that many seconds after creating a | |
41 | Python process. This allows the process to start up. | |
42 | ||
43 | (fn &optional SIT)\1f | |
44 | (defalias 'elpy-shell-get-or-create-process #[256 "\b\306\230\203\n\0 \202\v\0\307\1a\310\311\312\313!\"\314\ 1!\211\203\1d\0\211\202a\0\315\v!\204(\0\316\317\v\"\210\f\320\267\202;\0\321 \206K\0\r\202K\0\r\202K\0\f;\203H\0\322\323\f!!\202K\0\316\324!\1d\325\326 \312\313!\307#\210)\ 2\203^\0\327\ 3!\210\314\ 2!)\207" [system-type elpy-shell-darwin-use-pty process-connection-type python-shell-interpreter elpy-shell-starting-directory default-directory "darwin" t format "*%s*" python-shell-get-process-name nil get-buffer-process elpy-executable-find-remote error "Python shell interpreter `%s' cannot be found. Please set `python-shell-interpreter' to a valid python binary." #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (project-root 46 current-directory 55)) elpy-project-root file-name-as-directory expand-file-name "Wrong value for `elpy-shell-starting-directory', please check this variable documentation and set it to a proper value" python-shell-make-comint python-shell-parse-command sit-for] 7 (#$ . 9068)]) | |
45 | #@32 Send setup code for the shell.\1f | |
46 | (defalias 'elpy-shell--send-setup-code #[0 "\300 \301 \205\ f\0\302\303\304\301 \"\ 2\"\207" [python-shell-get-process elpy-project-root python-shell-send-string-no-output format "import sys;sys.path.append('%s');del sys"] 5 (#$ . 10314)]) | |
47 | #@209 Toggle the use of a dedicated python shell for the current buffer. | |
48 | ||
49 | if ARG is positive, enable the use of a dedicated shell. | |
50 | if ARG is negative or 0, disable the use of a dedicated shell. | |
51 | ||
52 | (fn &optional ARG)\1f | |
53 | (defalias 'elpy-shell-toggle-dedicated-shell #[256 "\211\206\ f\0\301\300!\203\ e\0\302\202\ f\0\303\211\302X\203\19\0\304\300!\207\305\300!\210\306\307\310 \"\211\10\207" [python-shell-buffer-name local-variable-p 0 1 kill-local-variable make-local-variable format "Python[%s]" buffer-name] 5 (#$ . 10587) nil]) | |
54 | #@332 Associate the current buffer to a specific shell. | |
55 | ||
56 | Meaning that the code from the current buffer will be sent to this shell. | |
57 | ||
58 | If SHELL-NAME is not specified, ask with completion for a shell name. | |
59 | ||
60 | If SHELL-NAME is "Global", associate the current buffer to the main python | |
61 | shell (often "*Python*" shell). | |
62 | ||
63 | (fn &optional SHELL-NAME)\1f | |
64 | (defalias 'elpy-shell-set-local-shell #[256 "\301\300!\203\12\0\302\303\b\"\210\304\305\b\"\202\13\0\306\307 \310\211\211\211\ 4:\203B\0\ 4@\262\ 4\311\312\ 5!!\262\ 3\302\313\ 4\"\2038\0\304\305\ 4\"\ 2B\262\ 2\ 4A\262\ 5\310\262\ 1\202\19\0\ 1\237\266\205\314\ 2\315\316\312 \306D\ 5\"!\"\317\320\ 4\"\ 4\206^\0\321\ 1\ 3\"\211\306\230\203h\0\322\300!\207\323\300!\210\317\324\ 2\"\211\10\207" [python-shell-buffer-name local-variable-p string-match "Python\\[\\(.*?\\)\\]" match-string 1 "Global" buffer-list nil substring-no-properties buffer-name "\\*Python\\[\\(.*?\\)\\]\\*" remove delete-dups append format "Shell name (current: %s): " completing-read kill-local-variable make-local-variable "Python[%s]"] 10 (#$ . 11101) nil]) | |
65 | #@174 Ensure that the Python shell for the current buffer is running. | |
66 | ||
67 | If the shell is not running, waits until the first prompt is visible and | |
68 | commands can be sent to the shell.\1f | |
69 | (defalias 'elpy-shell--ensure-shell-running #[0 "r\301\302 !q\210\303\304\300!\203$\0\b\204$\0\211\305W\203$\0\306\307!\210\211\307\\\262\ 1\202\b\0\210)\302 \207" [python-shell--first-prompt-received process-buffer elpy-shell-get-or-create-process 0 boundp 3 sleep-for 0.1] 3 (#$ . 12118)]) | |
70 | #@66 Return the current string, but without indentation. | |
71 | ||
72 | (fn STRING)\1f | |
73 | (defalias 'elpy-shell--string-without-indentation #[257 "\211\211\301\230\262\ 1\203\n\0\207\302\211\18\303\304\305\"r\211q\210\306\307\ 2\"\216\ 2c\210eb\210`dW\203U\0\310 \204O\0\311 \204O\0\ 1\204;\0\312 \262\ 2\202O\0\ 1\203O\0\312 \ 2W\203O\0\313\314\315\316\317!\"!\210\302y\210\202 \0\320ed\ 4[#\210\321ed\"\210\322 *\262\ 1)\207" [indent-tabs-mode "" nil generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] elpy-shell--current-line-only-whitespace-p python-info-current-line-comment-p current-indentation error message "X%sX" thing-at-point line indent-rigidly untabify buffer-string] 8 (#$ . 12581)]) | |
74 | #@316 Displays information about code fragments sent to the shell. | |
75 | ||
76 | BEGIN and END refer to the region of the current buffer | |
77 | containing the code being sent. Displays a message with the code | |
78 | on the first line of that region. If `eval-sexp-fu-flash-mode' is | |
79 | active, additionally flashes that region briefly. | |
80 | ||
81 | (fn BEGIN END)\1f | |
82 | (defalias 'elpy-shell--flash-and-message-region #[514 "\211\ 2V\205]\0\212\212\ 1b\210\301\302!)\ 2\ 1@]\ 2\ 2A^\303\ 2\ 2{!\ 2b\210\304\7f\210\ 1`X\2030\0\305\306\ 2\"\210\2025\0\305\307\ 2\"\210\310\300!\205Z\0\b\205Z\0\311\ 3\ 3B!\211@\210\304\ 1A@\312\ 38\313\ 48\210\304\314\315\ 4\ 4#\266\205\266\204)\207" [eval-sexp-fu-flash-mode bounds-of-thing-at-point line string-trim nil message "Sent: %s" "Sent: %s..." boundp eval-sexp-fu-flash 2 3 eval-sexp-fu-flash-doit #[0 "\300\207" [t] 1]] 15 (#$ . 13294)]) | |
83 | (defalias 'elpy-shell--current-line-else-or-elif-p #[0 "\301\302\303!\304\305\18\306\ 3\ 3\ 3#)\266\203\307=\207" [inhibit-changing-match-data "\\s-*el\\(?:se:\\|if[^w]\\)" thing-at-point line nil t string-match 0] 7]) | |
84 | (defalias 'elpy-shell--current-line-decorator-p #[0 "\301\302\303!\304\305\18\306\ 3\ 3\ 3#)\266\203\307=\207" [inhibit-changing-match-data "^\\s-*@[A-Za-z]" thing-at-point line nil t string-match 0] 7]) | |
85 | (defalias 'elpy-shell--current-line-decorated-defun-p #[0 "\212\300 \210\301 )\207" [python-nav-backward-statement elpy-shell--current-line-decorator-p] 1]) | |
86 | (defalias 'elpy-shell--current-line-indented-p #[0 "\301\302\303!\304\305\18\306\ 3\ 3\ 3#)\266\203\307=\207" [inhibit-changing-match-data "\\s-+[^\\s-]+" thing-at-point line nil t string-match 0] 7]) | |
87 | #@77 Whether the current line contains only whitespace characters (or is empty).\1f | |
88 | (defalias 'elpy-shell--current-line-only-whitespace-p #[0 "\301\302\303!\304\305\18\306\ 3\ 3\ 3#)\266\203\307=\207" [inhibit-changing-match-data "\\s-*$" thing-at-point line nil t string-match 0] 7 (#$ . 14838)]) | |
89 | (defalias 'elpy-shell--current-line-code-line-p #[0 "\300 ?\205 \0\301 ?\207" [elpy-shell--current-line-only-whitespace-p python-info-current-line-comment-p] 1]) | |
90 | #@59 Whether a function definition starts at the current line.\1f | |
91 | (defalias 'elpy-shell--current-line-defun-p #[0 "\301\302\303!\304\305\18\306\ 3\ 3\ 3#)\266\203\307=\207" [inhibit-changing-match-data "\\s-*\\(?:def\\|async\\s-+def\\)\\s-" thing-at-point line nil t string-match 0] 7 (#$ . 15287)]) | |
92 | #@56 Whether a class definition starts at the current line.\1f | |
93 | (defalias 'elpy-shell--current-line-defclass-p #[0 "\301\302\303!\304\305\18\306\ 3\ 3\ 3#)\266\203\307=\207" [inhibit-changing-match-data "\\s-*class\\s-" thing-at-point line nil t string-match 0] 7 (#$ . 15577)]) | |
94 | #@169 Move the point to the next line containing code. | |
95 | ||
96 | If the current line has code, point is not moved. If BACKWARDS is | |
97 | non-nil, skips backwards. | |
98 | ||
99 | (fn &optional BACKWARDS)\1f | |
100 | (defalias 'elpy-shell--skip-to-next-code-line #[256 "\211\203\18\0\300 ?\205\17\0`e=?\205+\0\301y\210\202\ 4\0\207\300 ?\205+\0`d=?\205+\0\302y\210\202\18\0\207" [elpy-shell--current-line-code-line-p -1 nil] 3 (#$ . 15846)]) | |
101 | #@121 Check if the associated python shell is available. | |
102 | ||
103 | Return non-nil is the shell is running and not busy, nil otherwise.\1f | |
104 | (defalias 'elpy-shell--check-if-shell-available #[0 "\301 \205\1a\0r\302\301 !q\210\212db\210\303\18\304\305 \306 {!+\207" [inhibit-field-text-motion python-shell-get-process process-buffer t python-shell-comint-end-of-output-p line-beginning-position line-end-position] 3 (#$ . 16231)]) | |
105 | #@13 | |
106 | ||
107 | (fn BODY)\1f | |
108 | (defalias 'elpy-shell--with-maybe-echo '(macro . #[257 "\301\bX\203\f\0\302\303\ 2DD\207\207" [emacs-major-version 25 elpy-shell--with-maybe-echo-output elpy-shell--with-maybe-echo-input] 4 (#$ . 16640)])) | |
109 | #@97 Run BODY so that it adheres `elpy-shell-echo-input' and `elpy-shell-display-buffer'. | |
110 | ||
111 | (fn BODY)\1f | |
112 | (defalias 'elpy-shell--with-maybe-echo-input '(macro . #[257 "\300\301\302\303\304\302\300\ 6\aD\305BB\306\307\300\ 6 DEF\310BBE\207" [progn (elpy-shell--enable-echo) prog1 if elpy-shell-display-buffer-after-send ((elpy-shell-display-buffer)) cl-flet ((elpy-shell-display-buffer nil nil)) ((elpy-shell--disable-echo))] 11 (#$ . 16860)])) | |
113 | #@83 Non-nil when the Python shell should capture output for display in the echo area.\1f | |
114 | (defvar elpy-shell--capture-output nil (#$ . 17295)) | |
115 | (make-variable-buffer-local 'elpy-shell--capture-output) | |
116 | #@46 Current captured output of the Python shell.\1f | |
117 | (defvar elpy-shell--captured-output nil (#$ . 17493)) | |
118 | (make-variable-buffer-local 'elpy-shell--captured-output) | |
119 | #@82 Run BODY and grab shell output according to `elpy-shell-echo-output'. | |
120 | ||
121 | (fn BODY)\1f | |
122 | (defalias 'elpy-shell--with-maybe-echo-output '(macro . #[257 "\300\301\302\303\304\305\ 6\ 6DFE\207" [cl-letf (((symbol-function 'python-shell-send-file) (if elpy-shell-echo-output (symbol-function 'elpy-shell-send-file) (symbol-function 'python-shell-send-file)))) let* ((process (elpy-shell--ensure-shell-running)) (process-buf (process-buffer process)) (shell-visible (or elpy-shell-display-buffer-after-send (get-buffer-window process-buf)))) (with-current-buffer process-buf (setq-local elpy-shell--capture-output (and elpy-shell-echo-output (or (not (eq elpy-shell-echo-output 'when-shell-not-visible)) (not shell-visible))))) progn] 8 (#$ . 17656)])) | |
123 | (defalias 'elpy-shell--enable-output-filter #[0 "\300\301\302\303\304$\207" [add-hook comint-output-filter-functions elpy-shell--output-filter nil t] 5]) | |
124 | #@313 Filter used in `elpy-shell--with-maybe-echo-output' to grab output. | |
125 | ||
126 | No actual filtering is performed. STRING is the output received | |
127 | to this point from the process. If `elpy-shell--capture-output' | |
128 | is set, captures and messages shell output in the echo area (once | |
129 | complete). Otherwise, does nothing. | |
130 | ||
131 | (fn STRING)\1f | |
132 | (defalias 'elpy-shell--output-filter #[257 "\b\203S\0\304\301!\210 \305\ 2!P\11\306 !\203S\0 \307\211\224O\310\1a\311\ 1\310\312\e\313\ 3\ 3\ 3#)\266\203\2032\0\314\315!\210\202K\0\211\211\316\230\262\ 1\203B\0\314\317!\210\202K\0\314\320\321\322\316\ 5#\"\210\304\301!\210\310\11)\210\207" [elpy-shell--capture-output elpy-shell--captured-output message-log-max inhibit-changing-match-data make-local-variable ansi-color-filter-apply python-shell-comint-end-of-output-p 0 nil "Traceback (most recent call last):" t string-match message "Exception during evaluation." "" "No output was produced." "%s" replace-regexp-in-string "\n\\'"] 9 (#$ . 18553)]) | |
133 | #@86 Inject STRING into the Python shell buffer. | |
134 | ||
135 | (fn STRING FACE &optional NO-FONT-LOCK)\1f | |
136 | (defalias 'elpy-shell--insert-and-font-lock #[770 "`\ 3c\210\ 1?\205\13\0\300\ 1`\301\302\303\ 6\bF#\207" [add-text-properties front-sticky t font-lock-face] 11 (#$ . 19496)]) | |
137 | #@244 Append the given STRING to the output of the Python shell buffer. | |
138 | ||
139 | Unless NO-FONT-LOCK is set, formats STRING as shell input. | |
140 | Prepends a continuation promt if PREPEND-CONT-PROMPT is set. | |
141 | ||
142 | (fn STRING &optional NO-FONT-LOCK PREPEND-CONT-PROMPT)\1f | |
143 | (defalias 'elpy-shell--append-to-shell-output #[769 "\ 2\211\301\230\262\ 1?\205\213\0\302 \303\ 1!\304\ 2!r\ 1q\210\212\211b\210\ 3\203z\0`\305\18\306y\210\307\7f\210`)ZT\310\311\ 2\312Z]\313\"\314P\315\ 6\b\316\"\ 3b\210\317\ 1@\320\ 6\n#\210\211A\203s\0\211A\211\203r\0\211@\316c\210`\317\ 5\321\ 6\r#\210\322\ 1`\323#\266\ 2\317\ 1\320\ 6\f#\210\ 1A\266\202\202L\0\210\316c\266\ 4\202\202\0\317\ 6\ 6\320\ 6\a#\210\304\ 3!`\307\223*\266\203\207" [inhibit-field-text-motion "" elpy-shell-get-or-create-process process-buffer process-mark t -1 nil make-string 0 6 32 "... " split-string "\n" elpy-shell--insert-and-font-lock comint-highlight-input comint-highlight-prompt add-text-properties (field output inhibit-line-move-field-capture t rear-nonsticky t)] 16 (#$ . 19752)]) | |
144 | #@55 Extract the first N lines from STRING. | |
145 | ||
146 | (fn STRING N)\1f | |
147 | (defalias 'elpy-shell--string-head-lines #[514 "\300\301\ 2!\302Q\303\ 1\304Q\305\ 1\ 5\"\203\16\0\306\307\ 5\"\207\ 3\207" ["\\(?:\\(?:.*\n\\)\\|\\(?:.+\\'\\)\\)\\{" number-to-string "\\}" "\\`\\(" "\\)" string-match match-string 1] 7 (#$ . 20721)]) | |
148 | #@54 Extract the last N lines from STRING. | |
149 | ||
150 | (fn STRING N)\1f | |
151 | (defalias 'elpy-shell--string-tail-lines #[514 "\300\301\ 2!\302Q\303\ 1\304Q\305\ 1\ 5\"\203\16\0\306\307\ 5\"\207\ 3\207" ["\\(?:\\(?:.*\n\\)\\|\\(?:.+\\'\\)\\)\\{" number-to-string "\\}" "\\(" "\\)\\'" string-match match-string 1] 7 (#$ . 21017)]) | |
152 | #@91 Advice to enable echoing of input in the Python shell. | |
153 | ||
154 | (fn STRING &optional PROCESS MSG)\1f | |
155 | (defalias 'elpy-shell--python-shell-send-string-echo-advice #[769 "\303\304\ 4\"\203\11\0\305\306\307\211\ 6\ 6$\202\12\0\ 2\303\310\ 2\"\203\"\0\305\306\307\211\ 4$\202#\0\211\303\311\ 2\"\2033\0\305\306\307\211\ 4$\2024\0\211\303\312\ 2\"\203D\0\305\306\307\211\ 4$\202E\0\211\313\303\314\ 3\"\203V\0\305\306\307\211\ 5$\202W\0\ 1!\315\ 1!\316\ 1\b\"\317\ 2 \"\ 2G\ 2G\ 2G\\V\203u\0\ 1\320\ 2Q\202v\0\ 2\n\203\200\0\321\ 1\307\322#\207\321\303\323\ 3\"\203\214\0\323\202\215\0\306\ 2\323Q!\207" [elpy-shell-echo-input-lines-head elpy-shell-echo-input-lines-tail elpy-shell-echo-input-cont-prompt string-match "import sys, codecs, os, ast;__pyfile = codecs.open.*$" replace-match "" nil "import codecs, os;__pyfile = codecs.open(.*;exec(compile(__code, .*$" "^# -\\*- coding: utf-8 -\\*-\n*$" "^if True:$" string-trim-right "\\`\n+" elpy-shell--string-without-indentation elpy-shell--string-head-lines elpy-shell--string-tail-lines "...\n" elpy-shell--append-to-shell-output t "\n"] 16 (#$ . 21312) nil]) | |
156 | #@59 Enable input echoing when `elpy-shell-echo-input' is set.\1f | |
157 | (defalias 'elpy-shell--enable-echo #[0 "\b\205 \0\301\302\303\304#\207" [elpy-shell-echo-input advice-add python-shell-send-string :before elpy-shell--python-shell-send-string-echo-advice] 4 (#$ . 22344)]) | |
158 | #@24 Disable input echoing.\1f | |
159 | (defalias 'elpy-shell--disable-echo #[0 "\300\301\302\"\207" [advice-remove python-shell-send-string elpy-shell--python-shell-send-string-echo-advice] 3 (#$ . 22612)]) | |
160 | #@475 Like `python-shell-send-file' but evaluates last expression separately. | |
161 | ||
162 | See `python-shell-send-file' for a description of the | |
163 | arguments. This function differs in that it breaks up the | |
164 | Python code in FILE-NAME into statements. If the last statement | |
165 | is a Python expression, it is evaluated separately in 'eval' | |
166 | mode. This way, the interactive python shell can capture (and | |
167 | print) the output of the last expression. | |
168 | ||
169 | (fn FILE-NAME &optional PROCESS TEMP-FILE-NAME DELETE MSG)\1f | |
170 | (defalias 'elpy-shell-send-file #[1281 "\ 3\206\a\0\300\ 1!\301\302\303\"r\211q\210\304\305\ 2\"\216\306\ 5\206\e\0\ 6\a!\210\307 *\262\ 1\310\311\ 6\b\312\"\206-\0\ 6\a!\ 5\205>\0\310\311\ 6\a\312\"\206=\0\ 6\ 6!\313\314\315\ 6\b\205N\0\ 3\205N\0\314\316\ 5\"\317Q\ 3\206U\0\ 4\ 6\ 6\211\ 6\a\211\211&\a\ 5\"\207" [python-shell-get-process-or-error generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents python-info-encoding expand-file-name file-remote-p localname python-shell-send-string format "import sys, codecs, os, ast;__pyfile = codecs.open('''%s''', encoding='''%s''');__code = __pyfile.read().encode('''%s''');__pyfile.close();" "os.remove('''%s''');" "__block = ast.parse(__code, '''%s''', mode='exec'); __block.body = (__block.body if not isinstance(__block.body[0], ast.If) else __block.body if not isinstance(__block.body[0].test, ast.Name) else __block.body if not __block.body[0].test.id == 'True' else __block.body[0].body) if sys.version_info[0] < 3 else (__block.body if not isinstance(__block.body[0], ast.If) else __block.body if not isinstance(__block.body[0].test, ast.NameConstant) else __block.body if not __block.body[0].test.value is True else __block.body[0].body);__last = __block.body[-1];__isexpr = isinstance(__last,ast.Expr);_ = __block.body.pop() if __isexpr else None;exec(compile(__block, '''%s''', mode='exec'));eval(compile(ast.Expression(__last.value), '''%s''', mode='eval')) if __isexpr else None"] 18 (#$ . 22810) (byte-code "\300\301!\302\211\211\303\257\ 5\207" [read-file-name "File to send: " nil t] 5)]) | |
171 | #@393 Move the point to the beginning of the current or next Python statement. | |
172 | ||
173 | If the current line starts with a statement, behaves exactly like | |
174 | `python-nav-beginning-of-statement'. If the line is part of a | |
175 | statement but not a statement itself, goes backwards to the | |
176 | beginning of the statement. If the current line is not a code | |
177 | line, skips forward to the next code line and navigates from | |
178 | there.\1f | |
179 | (defalias 'elpy-shell--nav-beginning-of-statement #[0 "\300 \210\301 \210\302\211`=?\205!\0\303 \204\18\0\304 \205!\0\305 \210`\262\ 1\202\a\0\207" [elpy-shell--skip-to-next-code-line python-nav-beginning-of-statement nil elpy-shell--current-line-else-or-elif-p elpy-shell--current-line-decorated-defun-p elpy-nav-backward-block] 3 (#$ . 24861)]) | |
180 | #@193 Move the point to the end of the current Python statement. | |
181 | ||
182 | Assumes that the point is precisely at the beginning of a | |
183 | statement (e.g., after calling | |
184 | `elpy-shell--nav-beginning-of-statement').\1f | |
185 | (defalias 'elpy-shell--nav-end-of-statement #[0 "\300\301\211`=\204;\0\ 1\203;\0\302 \203\14\0\303 \210`\262\ 1\303 \210\211`=\203)\0\304 \210\301\262\ 2\202\ 2\0\305 \204\ 2\0\306y\210\307\300!\210\301\262\ 2\202\ 2\0\266\ 2\301\7f\207" [t nil elpy-shell--current-line-decorator-p elpy-nav-forward-block python-nav-end-of-block elpy-shell--current-line-else-or-elif-p -1 elpy-shell--skip-to-next-code-line] 4 (#$ . 25598)]) | |
186 | #@215 Move the point to the beginning of the current or next top-level statement. | |
187 | ||
188 | If the point is within a top-level statement, moves to its | |
189 | beginning. Otherwise, moves to the beginning of the next top-level | |
190 | statement.\1f | |
191 | (defalias 'elpy-shell--nav-beginning-of-top-statement #[0 "\300 \210`??\205\e\0\301 \205\e\0\302y\210\303\304!\210\300 \210\202\ 3\0\207" [elpy-shell--nav-beginning-of-statement elpy-shell--current-line-indented-p -1 elpy-shell--skip-to-next-code-line t] 2 (#$ . 26195) nil]) | |
192 | #@559 Move point to the beginning of the current definition. | |
193 | ||
194 | DEF-P is a predicate function that decides whether the current | |
195 | line starts a definition. | |
196 | ||
197 | It the current line starts a definition, uses this definition. If | |
198 | the current line does not start a definition and is a code line, | |
199 | searches for the definition that contains the current line. | |
200 | Otherwise, searches for the definition that contains the next | |
201 | code line. | |
202 | ||
203 | If a definition is found, moves point to the start of the | |
204 | definition and returns t. Otherwise, retains point position and | |
205 | returns nil. | |
206 | ||
207 | (fn DEF-P)\1f | |
208 | (defalias 'elpy-shell--nav-beginning-of-def #[257 "\211 \203\n\0\300 \210\301\207\212\302\301!\210\303 \210`)`\212\302 \210\304 S)\305\211\204L\0`\ 4Y\203L\0\ 4 \203:\0\304 \ 2X\203:\0\301\262\ 1\202\1e\0\306 \203F\0\ 1\304 S^\262\ 2\307y\210\202\1e\0\211\203T\0\300 \210\207\ 2b\210\207" [python-nav-beginning-of-statement t elpy-shell--skip-to-next-code-line elpy-shell--nav-beginning-of-top-statement current-indentation nil elpy-shell--current-line-code-line-p -1] 7 (#$ . 26685)]) | |
209 | #@254 Move point to the beginning of the current function definition. | |
210 | ||
211 | If a definition is found, moves point to the start of the | |
212 | definition and returns t. Otherwise, retains point position and | |
213 | returns nil. | |
214 | ||
215 | See `elpy-shell--nav-beginning-of-def' for details.\1f | |
216 | (defalias 'elpy-shell--nav-beginning-of-defun #[0 "\300\301!\204\v\0\302 \205\14\0\303 \203\13\0\304 \210\305\207" [elpy-shell--nav-beginning-of-def elpy-shell--current-line-defun-p elpy-shell--current-line-decorator-p elpy-shell--current-line-decorated-defun-p python-nav-backward-statement t] 2 (#$ . 27709)]) | |
217 | #@251 Move point to the beginning of the current class definition. | |
218 | ||
219 | If a definition is found, moves point to the start of the | |
220 | definition and returns t. Otherwise, retains point position and | |
221 | returns nil. | |
222 | ||
223 | See `elpy-shell--nav-beginning-of-def' for details.\1f | |
224 | (defalias 'elpy-shell--nav-beginning-of-defclass #[0 "\300\301!\207" [elpy-shell--nav-beginning-of-def elpy-shell--current-line-defclass-p] 2 (#$ . 28273)]) | |
225 | #@402 Move point to the beginning of the current or next group of top-level statements. | |
226 | ||
227 | A sequence of top-level statements is a group if they are not | |
228 | separated by empty lines. Empty lines within each top-level | |
229 | statement are ignored. | |
230 | ||
231 | If the point is within a top-level statement, moves to the | |
232 | beginning of the group containing this statement. Otherwise, moves | |
233 | to the first top-level statement below point.\1f | |
234 | (defalias 'elpy-shell--nav-beginning-of-group #[0 "\300 \210\301 \204\1f\0`e=\204\1f\0\302 \204\16\0\300 \210\303y\210\304 \210\202\ 3\0\301 \205)\0\305y\210\304 \207" [elpy-shell--nav-beginning-of-top-statement elpy-shell--current-line-only-whitespace-p python-info-current-line-comment-p -1 beginning-of-line 1] 2 (#$ . 28687)]) | |
235 | #@211 Send current or next statement to Python shell and step. | |
236 | ||
237 | If the current line is part of a statement, sends this statement. | |
238 | Otherwise, skips forward to the next code line and sends the | |
239 | corresponding statement.\1f | |
240 | (defalias 'elpy-shell-send-statement-and-step #[0 "\304 \210\305 \210\306\307!?\205\225\0\b\204\15\0\310\311!\210\212\312 \210`)\313 \210`\ 1\ 1=\204\221\0\314\ 2\ 2\"\210\315\ 2\ 2{!\210 \2039\0\316K\202;\0\317K\317K\320\321\ 2\"\216\317\ 2M\210\304 \322\ 1!\n\206R\0\323\ 1!r\ 1q\210\324\303!\210 \205g\0 \325=?\206g\0\211?\13)\326 \210\n\203\7f\0\327\330\ 6\b\ 6\b\"!\210\331 \210\202\212\0\332\327\330\ 6 \ 6 \"!\266\ 2\333 \266\ 4)\266\ 2\266\ 2\334 \207" [elpy-shell-echo-input elpy-shell-echo-output elpy-shell-display-buffer-after-send elpy-shell--capture-output elpy-shell--ensure-shell-running elpy-shell--nav-beginning-of-statement looking-at "[[:space:]]*$" elpy-shell--append-to-shell-output "\n" beginning-of-line elpy-shell--nav-end-of-statement elpy-shell--flash-and-message-region elpy-shell--add-to-shell-history elpy-shell-send-file python-shell-send-file make-closure #[0 "\301\300M\207" [V0 python-shell-send-file] 2] process-buffer get-buffer-window make-local-variable when-shell-not-visible elpy-shell--enable-echo python-shell-send-string python-shell-buffer-substring elpy-shell-display-buffer nil elpy-shell--disable-echo python-nav-forward-statement] 12 (#$ . 29413) nil]) | |
241 | #@259 Send the current or next top-level statement to the Python shell and step. | |
242 | ||
243 | If the current line is part of a top-level statement, sends this | |
244 | top-level statement. Otherwise, skips forward to the next code | |
245 | line and sends the corresponding top-level statement.\1f | |
246 | (defalias 'elpy-shell-send-top-statement-and-step #[0 "\305 \210\306 \210`\307 \210`\310\ 2\ 2\"\210\311\ 2\ 2{\312\313\18\314\ 3\ 3\ 3#)\266\203\203%\0\315 \207\316\ 2\ 2{!\210 \2034\0\317K\2026\0\320K\320K\321\322\ 2\"\216\320\ 2M\210\305 \323\ 1!\n\206M\0\324\ 1!r\ 1q\210\325\303!\210 \205b\0 \326=?\206b\0\211?\13)\327 \210\n\203z\0\330\331\ 6\b\ 6\b\"!\210\332 \210\202\205\0\312\330\331\ 6 \ 6 \"!\266\ 2\333 \266\ 4)\266\ 2\312\14\334 \207" [inhibit-changing-match-data elpy-shell-echo-output elpy-shell-display-buffer-after-send elpy-shell--capture-output mark-active elpy-shell--ensure-shell-running elpy-shell--nav-beginning-of-top-statement elpy-shell--nav-end-of-statement elpy-shell--flash-and-message-region "\\`[^\n]*\\'" nil t string-match elpy-shell-send-statement-and-step elpy-shell--add-to-shell-history elpy-shell-send-file python-shell-send-file make-closure #[0 "\301\300M\207" [V0 python-shell-send-file] 2] process-buffer get-buffer-window make-local-variable when-shell-not-visible elpy-shell--enable-echo python-shell-send-string python-shell-buffer-substring elpy-shell-display-buffer elpy-shell--disable-echo python-nav-forward-statement] 12 (#$ . 30774) nil]) | |
247 | #@145 Send the function definition that contains the current line | |
248 | to the Python shell and steps. | |
249 | ||
250 | See `elpy-shell--nav-beginning-of-def' for details.\1f | |
251 | (defalias 'elpy-shell-send-defun-and-step #[0 "\300 \203\b\0\301 \207\302\303!\207" [elpy-shell--nav-beginning-of-defun elpy-shell-send-statement-and-step message "There is no function definition that includes the current line."] 2 (#$ . 32172) nil]) | |
252 | #@142 Send the class definition that contains the current line to | |
253 | the Python shell and steps. | |
254 | ||
255 | See `elpy-shell--nav-beginning-of-def' for details.\1f | |
256 | (defalias 'elpy-shell-send-defclass-and-step #[0 "\300 \203\b\0\301 \207\302\303!\207" [elpy-shell--nav-beginning-of-defclass elpy-shell-send-statement-and-step message "There is no class definition that includes the current line."] 2 (#$ . 32572) nil]) | |
257 | #@412 Send the current or next group of top-level statements to the Python shell and step. | |
258 | ||
259 | A sequence of top-level statements is a group if they are not | |
260 | separated by empty lines. Empty lines within each top-level | |
261 | statement are ignored. | |
262 | ||
263 | If the point is within a top-level statement, send the group | |
264 | around this statement. Otherwise, go to the top-level statement | |
265 | below point and send the group around this statement.\1f | |
266 | (defalias 'elpy-shell-send-group-and-step #[0 "\306 \210\307 \210`\310 \204\ f\0\311 \210\312\211`=\2042\0`\262\ 1\312y\210\313 \203'\0\211b\210\202\10\0\310 \204\10\0\311 \210\202\10\0\210`\211\ 2V\203\314\0\314\ 2\ 2\"\210\315\ 2\ 2{\312\316\18\317\ 3\ 3\ 3#)\266\203\203W\0\320 \210\202\317\0 \204_\0\321\322!\210\323\ 2\ 2{!\210\n\203n\0\324K\202p\0\325K\325K\326\327\ 2\"\216\325\ 2M\210\306 \330\ 1!\v\206\207\0\331\ 1!r\ 1q\210\332\304!\210\n\205\234\0\n\333=?\206\234\0\211?\14)\334 \210\v\203\264\0\335\336\ 6\b\ 6\b\"!\210\337 \210\202\277\0\312\335\336\ 6 \ 6 \"!\266\ 2\340 \266\ 4)\266\ 2\341 \210\202\317\0db\210\312\211\15\207" [inhibit-changing-match-data elpy-shell-echo-input elpy-shell-echo-output elpy-shell-display-buffer-after-send elpy-shell--capture-output mark-active elpy-shell--ensure-shell-running elpy-shell--nav-beginning-of-group python-info-current-line-comment-p elpy-shell--nav-end-of-statement nil elpy-shell--current-line-only-whitespace-p elpy-shell--flash-and-message-region "\\`[^\n]*\\'" t string-match elpy-shell-send-statement-and-step elpy-shell--append-to-shell-output "\n" elpy-shell--add-to-shell-history elpy-shell-send-file python-shell-send-file make-closure #[0 "\301\300M\207" [V0 python-shell-send-file] 2] process-buffer get-buffer-window make-local-variable when-shell-not-visible elpy-shell--enable-echo python-shell-send-string python-shell-buffer-substring elpy-shell-display-buffer elpy-shell--disable-echo python-nav-forward-statement] 12 (#$ . 32972) nil]) | |
267 | #@278 Send the current code cell to the Python shell and step. | |
268 | ||
269 | Signals an error if the point is not inside a code cell. | |
270 | ||
271 | Cell beginnings and cell boundaries can be customized via the | |
272 | variables `elpy-shell-cell-boundary-regexp' and | |
273 | `elpy-shell-codecell-beginning-regexp', which see.\1f | |
274 | (defalias 'elpy-shell-send-codecell-and-step #[0 "\212\306\7f\210\307\b\306\310#\210\311 \210 \312\313!\306\310\1a\314\ 3\ 3\ 3#)\266\203\205 \0`)\212\306y\210\315\b\306\310#\2033\0\316y\210\2026\0db\210\306\7f\210`)\ 1\203\272\0\317\ 2\ 2\"\210\v\204L\0\320\321!\210\322\ 2\ 2{!\210\f\203[\0\323K\202]\0\324K\324K\325\326\ 2\"\216\324\ 2M\210\327 \330\ 1!\r\206t\0\331\ 1!r\ 1q\210\332\333!\210\f\205\211\0\f\334=?\206\211\0\211?\16\e)\335 \210\r\203\242\0\336\337\ 6\b\ 6\b\"!\210\340 \210\202\255\0\306\336\337\ 6 \ 6 \"!\266\ 2\341 \266\ 4)\266\ 2\211b\210\342 \207\343\344!\207" [elpy-shell-cell-boundary-regexp elpy-shell-codecell-beginning-regexp inhibit-changing-match-data elpy-shell-echo-input elpy-shell-echo-output elpy-shell-display-buffer-after-send nil re-search-backward t beginning-of-line thing-at-point line string-match re-search-forward -1 elpy-shell--flash-and-message-region elpy-shell--append-to-shell-output "\n" elpy-shell--add-to-shell-history elpy-shell-send-file python-shell-send-file make-closure #[0 "\301\300M\207" [V0 python-shell-send-file] 2] elpy-shell--ensure-shell-running process-buffer get-buffer-window make-local-variable elpy-shell--capture-output when-shell-not-visible elpy-shell--enable-echo python-shell-send-string python-shell-buffer-substring elpy-shell-display-buffer elpy-shell--disable-echo python-nav-forward-statement message "Not in a codecell."] 12 (#$ . 34825) nil]) | |
275 | #@409 Send the active region or the buffer to the Python shell and step. | |
276 | ||
277 | If there is an active region, send that. Otherwise, send the | |
278 | whole buffer. | |
279 | ||
280 | In Emacs 24.3 and later, without prefix argument and when there | |
281 | is no active region, this will escape the Python idiom of if | |
282 | __name__ == '__main__' to be false to avoid accidental execution | |
283 | of code. With prefix argument, this code is executed. | |
284 | ||
285 | (fn &optional ARG)\1f | |
286 | (defalias 'elpy-shell-send-region-or-buffer-and-step #[256 "\303 \203\ f\0\304\305 \306 \"\210\202\14\0\304ed\"\210\b\203\1d\0\307K\202\1f\0\310K\310K\311\312\ 2\"\216\310\ 2M\210\313 \314\ 1! \2066\0\315\ 1!r\ 1q\210\316\302!\210\b\205K\0\b\317=?\206K\0\211?\12)\320 \210 \203_\0\321\ 6\ 6!\210\322 \210\202f\0\323\321\ 6\a!\266\ 2\324 \266\ 4)\266\ 2\303 \203v\0\306 b\207db\207" [elpy-shell-echo-output elpy-shell-display-buffer-after-send elpy-shell--capture-output use-region-p elpy-shell--flash-and-message-region region-beginning region-end elpy-shell-send-file python-shell-send-file make-closure #[0 "\301\300M\207" [V0 python-shell-send-file] 2] elpy-shell--ensure-shell-running process-buffer get-buffer-window make-local-variable when-shell-not-visible elpy-shell--enable-echo elpy-shell--send-region-or-buffer-internal elpy-shell-display-buffer nil elpy-shell--disable-echo] 9 (#$ . 36467) "P"]) | |
287 | #@409 Send the active region or the buffer to the Python shell and step. | |
288 | ||
289 | If there is an active region, send that. Otherwise, send the | |
290 | whole buffer. | |
291 | ||
292 | In Emacs 24.3 and later, without prefix argument and when there | |
293 | is no active region, this will escape the Python idiom of if | |
294 | __name__ == '__main__' to be false to avoid accidental execution | |
295 | of code. With prefix argument, this code is executed. | |
296 | ||
297 | (fn &optional ARG)\1f | |
298 | (defalias 'elpy-shell--send-region-or-buffer-internal #[256 "\301 \210\b\204\v\0\302\303!\210\304\305 \203f\0\306\307 \310 \"\307 \310 {\311\312\ 3\"\203'\0\313\314!\210\212\307 b\210\315\316!)\317\320\ 2@\ 3A\310 ^\"!\317\320\ 3@\307 ]\ 4A\310 ^\"!\321\322\323\ 4!\324Q\ 2\ 6\a\325\211\326&\ 6\262\ 5\327\ 4!\210\330\ 5!\266\ 6\202z\0\ 1\204v\0\212eb\210\331\332\304\325#\262\ 1)\333\ 2!\210\211\205\201\0\313\334!\207" [elpy-shell-echo-input elpy-shell--ensure-shell-running elpy-shell--append-to-shell-output "\n" nil use-region-p python-shell-buffer-substring region-beginning region-end string-match " " message "Region contained tabs, this might cause weird errors" bounds-of-thing-at-point line string-trim buffer-substring-no-properties replace-regexp-in-string "\\(" regexp-quote "\\)\\(?:.*\n?\\)*\\'" t 1 elpy-shell--add-to-shell-history python-shell-send-string re-search-forward "^if +__name__ +== +[\"']__main__[\"'] *:" python-shell-send-buffer "Removed if __name__ == '__main__' construct, use a prefix argument to evaluate."] 14 (#$ . 37745) "P"]) | |
299 | #@267 Send entire buffer to Python shell. | |
300 | ||
301 | In Emacs 24.3 and later, without prefix argument, this will | |
302 | escape the Python idiom of if __name__ == '__main__' to be false | |
303 | to avoid accidental execution of code. With prefix argument, this | |
304 | code is executed. | |
305 | ||
306 | (fn &optional ARG)\1f | |
307 | (defalias 'elpy-shell-send-buffer-and-step #[256 "\300\301 \302\303\ 2\"\216\212\304 \210\305\ 3!\210`\262\ 2*\210\211b\207" [nil save-mark-and-excursion--save make-closure #[0 "\301\300!\207" [V0 save-mark-and-excursion--restore] 2] deactivate-mark elpy-shell-send-region-or-buffer-and-step] 6 (#$ . 39184) "P"]) | |
308 | #@55 Add STRING to the shell command history. | |
309 | ||
310 | (fn STRING)\1f | |
311 | (defalias 'elpy-shell--add-to-shell-history #[257 "\b\205\11\0r\301\302 !q\210\303\304\ 2!!)\207" [elpy-shell-add-to-shell-history process-buffer elpy-shell-get-or-create-process comint-add-to-input-history string-trim] 4 (#$ . 39764)]) | |
312 | #@304 Run a function with STEP and/or GO. | |
313 | ||
314 | STEP-FUN should be a function that sends something to the shell | |
315 | and moves point to code position right after what has been sent. | |
316 | ||
317 | When STEP is nil, keeps point position. When GO is non-nil, | |
318 | switches focus to Python shell buffer. | |
319 | ||
320 | (fn STEP-FUN STEP GO MY-PREFIX-ARG)\1f | |
321 | (defalias 'elpy-shell--send-with-step-go #[1028 "`\ 1\10\301\ 5!\210\ 3\204\ e\0\211b\210\210\ 1\205\15\0\302 \207" [current-prefix-arg call-interactively elpy-shell-switch-to-shell] 7 (#$ . 40056)]) | |
322 | #@102 Defines fun, fun-and-go, fun-and-step-and-go for the given FUN-AND-STEP function. | |
323 | ||
324 | (fn FUN-AND-STEP)\1f | |
325 | (defalias 'elpy-shell--defun-step-go '(macro . #[257 "\300\301\ 2!\302\ 2\ 2\"\203\18\0\211\303\ 2G\ 4GZO\266\202\202\1a\0\262\ 1\304\305\ 2!\306\ 1\307\310\301\ 6\b!\311Q\312\313\314\ 6\nD\315BB\257\ 6\262\ 1\305\ 3\316P!\306\ 1\317\310\301\ 6 !\320Q\321\313\314\ 6\vD\322BB\257\ 6\262\ 1\305\ 4\323P!\306\ 1\324\310\301\ 6\n!\325Q\326\313\314\ 6\fD\327BB\257\ 6\262\ 1F\207" ["-and-step" symbol-name string-suffix-p 0 progn intern defun (&optional arg) "Run `" "' but retain point position." (interactive "P") elpy-shell--send-with-step-go quote (nil nil arg) "-and-go" (&optional arg) "' but retain point position and switch to Python shell." (interactive "P") (nil t arg) "-and-step-and-go" (&optional arg) "' and switch to Python shell." (interactive "P") (t t arg)] 14 (#$ . 40550)])) | |
326 | #@89 Run `elpy-shell-send-statement-and-step' but retain point position. | |
327 | ||
328 | (fn &optional ARG)\1f | |
329 | (defalias 'elpy-shell-send-statement #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-statement-and-step nil] 6 (#$ . 41392) "P"]) | |
330 | #@116 Run `elpy-shell-send-statement-and-step' but retain point position and switch to Python shell. | |
331 | ||
332 | (fn &optional ARG)\1f | |
333 | (defalias 'elpy-shell-send-statement-and-go #[256 "\300\301\302\303\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-statement-and-step nil t] 6 (#$ . 41647) "P"]) | |
334 | #@90 Run `elpy-shell-send-statement-and-step' and switch to Python shell. | |
335 | ||
336 | (fn &optional ARG)\1f | |
337 | (defalias 'elpy-shell-send-statement-and-step-and-go #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-statement-and-step t] 6 (#$ . 41937) "P"]) | |
338 | #@93 Run `elpy-shell-send-top-statement-and-step' but retain point position. | |
339 | ||
340 | (fn &optional ARG)\1f | |
341 | (defalias 'elpy-shell-send-top-statement #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-top-statement-and-step nil] 6 (#$ . 42206) "P"]) | |
342 | #@120 Run `elpy-shell-send-top-statement-and-step' but retain point position and switch to Python shell. | |
343 | ||
344 | (fn &optional ARG)\1f | |
345 | (defalias 'elpy-shell-send-top-statement-and-go #[256 "\300\301\302\303\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-top-statement-and-step nil t] 6 (#$ . 42473) "P"]) | |
346 | #@94 Run `elpy-shell-send-top-statement-and-step' and switch to Python shell. | |
347 | ||
348 | (fn &optional ARG)\1f | |
349 | (defalias 'elpy-shell-send-top-statement-and-step-and-go #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-top-statement-and-step t] 6 (#$ . 42775) "P"]) | |
350 | #@85 Run `elpy-shell-send-defun-and-step' but retain point position. | |
351 | ||
352 | (fn &optional ARG)\1f | |
353 | (defalias 'elpy-shell-send-defun #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-defun-and-step nil] 6 (#$ . 43056) "P"]) | |
354 | #@112 Run `elpy-shell-send-defun-and-step' but retain point position and switch to Python shell. | |
355 | ||
356 | (fn &optional ARG)\1f | |
357 | (defalias 'elpy-shell-send-defun-and-go #[256 "\300\301\302\303\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-defun-and-step nil t] 6 (#$ . 43299) "P"]) | |
358 | #@86 Run `elpy-shell-send-defun-and-step' and switch to Python shell. | |
359 | ||
360 | (fn &optional ARG)\1f | |
361 | (defalias 'elpy-shell-send-defun-and-step-and-go #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-defun-and-step t] 6 (#$ . 43577) "P"]) | |
362 | #@88 Run `elpy-shell-send-defclass-and-step' but retain point position. | |
363 | ||
364 | (fn &optional ARG)\1f | |
365 | (defalias 'elpy-shell-send-defclass #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-defclass-and-step nil] 6 (#$ . 43834) "P"]) | |
366 | #@115 Run `elpy-shell-send-defclass-and-step' but retain point position and switch to Python shell. | |
367 | ||
368 | (fn &optional ARG)\1f | |
369 | (defalias 'elpy-shell-send-defclass-and-go #[256 "\300\301\302\303\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-defclass-and-step nil t] 6 (#$ . 44086) "P"]) | |
370 | #@89 Run `elpy-shell-send-defclass-and-step' and switch to Python shell. | |
371 | ||
372 | (fn &optional ARG)\1f | |
373 | (defalias 'elpy-shell-send-defclass-and-step-and-go #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-defclass-and-step t] 6 (#$ . 44373) "P"]) | |
374 | #@85 Run `elpy-shell-send-group-and-step' but retain point position. | |
375 | ||
376 | (fn &optional ARG)\1f | |
377 | (defalias 'elpy-shell-send-group #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-group-and-step nil] 6 (#$ . 44639) "P"]) | |
378 | #@112 Run `elpy-shell-send-group-and-step' but retain point position and switch to Python shell. | |
379 | ||
380 | (fn &optional ARG)\1f | |
381 | (defalias 'elpy-shell-send-group-and-go #[256 "\300\301\302\303\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-group-and-step nil t] 6 (#$ . 44882) "P"]) | |
382 | #@86 Run `elpy-shell-send-group-and-step' and switch to Python shell. | |
383 | ||
384 | (fn &optional ARG)\1f | |
385 | (defalias 'elpy-shell-send-group-and-step-and-go #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-group-and-step t] 6 (#$ . 45160) "P"]) | |
386 | #@88 Run `elpy-shell-send-codecell-and-step' but retain point position. | |
387 | ||
388 | (fn &optional ARG)\1f | |
389 | (defalias 'elpy-shell-send-codecell #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-codecell-and-step nil] 6 (#$ . 45417) "P"]) | |
390 | #@115 Run `elpy-shell-send-codecell-and-step' but retain point position and switch to Python shell. | |
391 | ||
392 | (fn &optional ARG)\1f | |
393 | (defalias 'elpy-shell-send-codecell-and-go #[256 "\300\301\302\303\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-codecell-and-step nil t] 6 (#$ . 45669) "P"]) | |
394 | #@89 Run `elpy-shell-send-codecell-and-step' and switch to Python shell. | |
395 | ||
396 | (fn &optional ARG)\1f | |
397 | (defalias 'elpy-shell-send-codecell-and-step-and-go #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-codecell-and-step t] 6 (#$ . 45956) "P"]) | |
398 | #@96 Run `elpy-shell-send-region-or-buffer-and-step' but retain point position. | |
399 | ||
400 | (fn &optional ARG)\1f | |
401 | (defalias 'elpy-shell-send-region-or-buffer #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-region-or-buffer-and-step nil] 6 (#$ . 46222) "P"]) | |
402 | #@123 Run `elpy-shell-send-region-or-buffer-and-step' but retain point position and switch to Python shell. | |
403 | ||
404 | (fn &optional ARG)\1f | |
405 | (defalias 'elpy-shell-send-region-or-buffer-and-go #[256 "\300\301\302\303\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-region-or-buffer-and-step nil t] 6 (#$ . 46498) "P"]) | |
406 | #@97 Run `elpy-shell-send-region-or-buffer-and-step' and switch to Python shell. | |
407 | ||
408 | (fn &optional ARG)\1f | |
409 | (defalias 'elpy-shell-send-region-or-buffer-and-step-and-go #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-region-or-buffer-and-step t] 6 (#$ . 46809) "P"]) | |
410 | #@86 Run `elpy-shell-send-buffer-and-step' but retain point position. | |
411 | ||
412 | (fn &optional ARG)\1f | |
413 | (defalias 'elpy-shell-send-buffer #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-buffer-and-step nil] 6 (#$ . 47099) "P"]) | |
414 | #@113 Run `elpy-shell-send-buffer-and-step' but retain point position and switch to Python shell. | |
415 | ||
416 | (fn &optional ARG)\1f | |
417 | (defalias 'elpy-shell-send-buffer-and-go #[256 "\300\301\302\303\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-buffer-and-step nil t] 6 (#$ . 47345) "P"]) | |
418 | #@87 Run `elpy-shell-send-buffer-and-step' and switch to Python shell. | |
419 | ||
420 | (fn &optional ARG)\1f | |
421 | (defalias 'elpy-shell-send-buffer-and-step-and-go #[256 "\300\301\302\211\ 4$\207" [elpy-shell--send-with-step-go elpy-shell-send-buffer-and-step t] 6 (#$ . 47626) "P"]) | |
422 | (byte-code "\301\302\b\"\203[\0\303\304\305\"\210\303\306\307\"\210\303\310\311\"\210\303\312\313\"\210\303\314\315\"\210\303\316\317\"\210\320\321!\203:\0\321\322\323\324\325\326\211\211\211\325\324&\b\"\210\327\330\331\332\333DD\334\335\336\337\340&\a\210\341\330\342\334\337\340%\210\303\343\344\"\210\303\345\346\"\210\301\207" [emacs-version version<= "25" defalias elpy-pdb--refresh-breakpoints #[257 "\300\301!\210\300\302!\210\211\211\205\1f\0\211@\300\303\304\305 \ 4#!\210\ 1A\266\202\202 \0\207" [python-shell-send-string-no-output "import bdb as __bdb; __bdb.Breakpoint.bplist={}; __bdb.Breakpoint.next=1;__bdb.Breakpoint.bpbynumber=[None]" "import pdb; __pdbi = pdb.Pdb()" format "__pdbi.set_break('''%s''', %s)" buffer-file-name] 8 "Add new breakpoints at lines LINES of the current buffer.\n\n(fn LINES)"] elpy-pdb--start-pdb #[256 "\300\301\302 \"\ 1\203\r\0\303\ 1!\207\304\ 1!\207" [format "__pdbi._runscript('''%s''')" buffer-file-name python-shell-send-string python-shell-send-string-no-output] 4 "Start pdb on the current script.\n\nif OUTPUT is non-nil, display the prompt after execution.\n\n(fn &optional OUTPUT)"] elpy-pdb--get-breakpoint-positions #[0 "\300 \301\ 1@\ 2A\"\302\ 1\211\203'\0\211@\303\ 1\304\"\203 \0\305\306\ 2!!\ 3B\262\ 3\ 1A\266\202\202\n\0\210\207" [overlay-lists append nil overlay-get elpy-breakpoint line-number-at-pos overlay-start] 8 "Return a list of lines with breakpoints."] elpy-pdb-debug-buffer #[256 "\300 \204 \0\301\302!\207\303 \210\304 \210\305 \ 1\204\1c\0\211G\306U\203(\0\307\310!\210\311\312!\266\ 2\2024\0\307\ 1!\210\311 \210\313\314!\266\ 2\315 \207" [buffer-file-name error "Debugging only work for buffers visiting a file" elpy-shell--ensure-shell-running save-buffer elpy-pdb--get-breakpoint-positions 0 elpy-pdb--refresh-breakpoints nil elpy-pdb--start-pdb t python-shell-send-string "continue" elpy-shell-display-buffer] 4 "Run pdb on the current buffer.\n\nIf breakpoints are set in the current buffer, jump to the first one.\nIf no breakpoints are set, debug from the beginning of the script.\n\nWith a prefix argument, ignore the existing breakpoints.\n\n(fn &optional ARG)" "P"] elpy-pdb-break-at-point #[0 "\300 \204 \0\301\302!\207\303 \210\304 \210\305\306 C!\210\307 \210\310\311!\210\312 \207" [buffer-file-name error "Debugging only work for buffers visiting a file" elpy-shell--ensure-shell-running save-buffer elpy-pdb--refresh-breakpoints line-number-at-pos elpy-pdb--start-pdb python-shell-send-string "continue" elpy-shell-display-buffer] 2 "Run pdb on the current buffer and break at the current line.\n\nIgnore the existing breakpoints.\nPdb can directly exit if the current line is not a statement\nthat is actually run (blank line, comment line, ...)." nil] elpy-pdb-debug-last-exception #[0 "\300 \210r\301\302\303\304!\"q\210\212db\210\305\306\304\307#*\204 \0\310\311!\210\202$\0\312\313!\210\314 \207" [elpy-shell--ensure-shell-running format "*%s*" python-shell-get-process-name nil search-backward "Traceback (most recent call last):" t error "No traceback on the current shell" python-shell-send-string "import pdb as __pdb;__pdb.pm()" elpy-shell-display-buffer] 4 "Run post-mortem pdb on the last exception." nil] fboundp define-fringe-bitmap elpy-breakpoint-fringe-marker vector 0 60 126 custom-declare-variable elpy-breakpoint-fringe-face funcall function #[0 "\300\207" [elpy-breakpoint-fringe-face] 1 ""] "Face for breakpoint bitmaps appearing on the fringe." :type face :group elpy custom-declare-face ((t (:foreground "red" :box (:line-width 1 :color "red" :style released-button)))) elpy-pdb-toggle-breakpoint-at-point #[256 "\211\203\a\0\300 \207\301\302 \303 \"\304\ 1\203&\0\ 1\211A\262\ 3\242\305\ 1\306\"\203\"\0\307\262\ 2\210\202\ e\0\211\2033\0\310\302 \303 \306\307$\207\212\311 \210\312\313!)?\205d\0\314\302 \302 T\"\315\316\317\320\321\322\323E\324%\210\325\ 1\326\324#\210\325\ 1\327\330#\210\325\ 1\306\307#\262\ 1\207" [elpy-pdb-clear-breakpoints overlays-in line-beginning-position line-end-position nil overlay-get elpy-breakpoint t remove-overlays beginning-of-line looking-at "[[:space:]]*$" make-overlay put-text-property 0 14 display left-fringe elpy-breakpoint-fringe-marker elpy-breakpoint-fringe-face "*fringe-dummy*" overlay-put before-string priority 200] 11 "Add or remove a breakpoint at the current line.\n\nWith a prefix argument, remove all the breakpoints from the current\nregion or buffer.\n\n(fn &optional ARG)" "P"] elpy-pdb-clear-breakpoints #[0 "\300 \203\ e\0\301\302 \303 \304\305$\207\301ed\304\305$\207" [use-region-p remove-overlays region-beginning region-end elpy-breakpoint t] 5 "Remove the breakpoints in the current region or buffer."]] 11) | |
423 | #@106 Deprecated; see https://elpy.readthedocs.io/en/latest/ide.html#interpreter-setup | |
424 | ||
425 | (fn &optional IPYTHON)\1f | |
426 | (defalias 'elpy-use-ipython #[256 "\300\301!\207" [error "elpy-use-ipython is deprecated; see https://elpy.readthedocs.io/en/latest/ide.html#interpreter-setup"] 3 (#$ . 52497)]) | |
427 | (make-obsolete 'elpy-use-ipython nil "Jan 2017") | |
428 | #@106 Deprecated; see https://elpy.readthedocs.io/en/latest/ide.html#interpreter-setup | |
429 | ||
430 | (fn &optional CPYTHON)\1f | |
431 | (defalias 'elpy-use-cpython #[256 "\300\301!\207" [error "elpy-use-cpython is deprecated; see https://elpy.readthedocs.io/en/latest/ide.html#interpreter-setup"] 3 (#$ . 52836)]) | |
432 | (byte-code "\300\301\302\303#\210\304\305!\207" [make-obsolete elpy-use-cpython nil "Jan 2017" provide elpy-shell] 4) |