Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
13d914ed
Commit
13d914ed
authored
May 17, 2012
by
Fabián Ezequiel Gallina
Committed by
Fabián Ezequiel Gallina
May 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed shell region sending
parent
4e531f7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
lisp/progmodes/python.el
lisp/progmodes/python.el
+8
-13
No files found.
lisp/progmodes/python.el
View file @
13d914ed
...
...
@@ -1018,11 +1018,12 @@ commands.)"
dedicated-proc-buffer-name
global-proc-buffer-name
))))
(
defun
python-shell-send-string
(
string
)
(
defun
python-shell-send-string
(
string
&optional
process
)
"Send STRING to inferior Python process."
(
interactive
"sPython command: "
)
(
let
((
process
(
python-shell-get-or-create-process
)))
(
message
(
format
"Sent: %s..."
string
))
(
let
((
process
(
or
process
(
python-shell-get-or-create-process
))))
(
when
(
called-interactively-p
)
(
message
(
format
"Sent: %s..."
string
)))
(
comint-send-string
process
string
)
(
when
(
or
(
not
(
string-match
"\n$"
string
))
(
string-match
"\n[ \t].*\n?$"
string
))
...
...
@@ -1073,17 +1074,11 @@ When argument ARG is non-nil sends the innermost defun."
(
interactive
"fFile to send: "
)
(
let
((
process
(
or
process
(
python-shell-get-or-create-process
)))
(
full-file-name
(
expand-file-name
file-name
)))
(
accept-process-output
process
)
(
with-current-buffer
(
process-buffer
process
)
(
delete-region
(
save-excursion
(
move-to-column
0
)
(
point-marker
))
(
line-end-position
)))
(
comint-send-string
process
(
python-shell-send-string
(
format
"with open('%s') as __pyfile: exec(compile(__pyfile.read(), '%s', 'exec'))\n\n"
full-file-name
full-file-name
))))
"__pyfile = open('%s'); exec(compile(__pyfile.read(), '%s', 'exec')); __pyfile.close()"
full-file-name
full-file-name
)
process
)))
(
defun
python-shell-switch-to-shell
()
"Switch to inferior Python process buffer."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment