aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorJoakim Verona2013-01-31 00:03:36 +0100
committerJoakim Verona2013-01-31 00:03:36 +0100
commit9658cee25c3e3f97d02f4fa05f9ee4f2f14fd76b (patch)
tree559caa9a4504175eb0d230f16c08251d56504072 /lisp/progmodes
parentde18b41154d227d8c7de62647008b73ca3a594c1 (diff)
parent5f9eccc4b6eb6d6a5fcf16b9ec3ee4d331c468cb (diff)
downloademacs-9658cee25c3e3f97d02f4fa05f9ee4f2f14fd76b.tar.gz
emacs-9658cee25c3e3f97d02f4fa05f9ee4f2f14fd76b.zip
auto upstream
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/make-mode.el41
-rw-r--r--lisp/progmodes/python.el26
2 files changed, 35 insertions, 32 deletions
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 8ab4c6f95b6..be718135f99 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -1213,26 +1213,23 @@ definition and conveniently use this command."
1213 (save-excursion 1213 (save-excursion
1214 (goto-char from) 1214 (goto-char from)
1215 (let ((column makefile-backslash-column) 1215 (let ((column makefile-backslash-column)
1216 (endmark (make-marker))) 1216 (endmark (copy-marker to)))
1217 (move-marker endmark to)
1218 ;; Compute the smallest column number past the ends of all the lines. 1217 ;; Compute the smallest column number past the ends of all the lines.
1219 (if makefile-backslash-align 1218 (when (and makefile-backslash-align (not delete-flag))
1220 (progn 1219 (while (< (point) to)
1221 (if (not delete-flag) 1220 (end-of-line)
1222 (while (< (point) to) 1221 (if (= (preceding-char) ?\\)
1223 (end-of-line) 1222 (progn (forward-char -1)
1224 (if (= (preceding-char) ?\\) 1223 (skip-chars-backward " \t")))
1225 (progn (forward-char -1) 1224 (setq column (max column (1+ (current-column))))
1226 (skip-chars-backward " \t"))) 1225 (forward-line 1))
1227 (setq column (max column (1+ (current-column)))) 1226 ;; Adjust upward to a tab column, if that doesn't push
1228 (forward-line 1))) 1227 ;; past the margin.
1229 ;; Adjust upward to a tab column, if that doesn't push 1228 (if (> (% column tab-width) 0)
1230 ;; past the margin. 1229 (let ((adjusted (* (/ (+ column tab-width -1) tab-width)
1231 (if (> (% column tab-width) 0) 1230 tab-width)))
1232 (let ((adjusted (* (/ (+ column tab-width -1) tab-width) 1231 (if (< adjusted (window-width))
1233 tab-width))) 1232 (setq column adjusted)))))
1234 (if (< adjusted (window-width))
1235 (setq column adjusted))))))
1236 ;; Don't modify blank lines at start of region. 1233 ;; Don't modify blank lines at start of region.
1237 (goto-char from) 1234 (goto-char from)
1238 (while (and (< (point) endmark) (eolp)) 1235 (while (and (< (point) endmark) (eolp))
@@ -1296,9 +1293,9 @@ Fill comments, backslashed lines, and variable definitions specially."
1296 (while (= (preceding-char) ?\\) 1293 (while (= (preceding-char) ?\\)
1297 (end-of-line 0)) 1294 (end-of-line 0))
1298 ;; Maybe we hit bobp, in which case we are not at EOL. 1295 ;; Maybe we hit bobp, in which case we are not at EOL.
1299 (if (eq (point) (line-end-position)) 1296 (if (eolp)
1300 (forward-char)) 1297 (1+ (point))
1301 (point))) 1298 (point))))
1302 (end 1299 (end
1303 (save-excursion 1300 (save-excursion
1304 (while (= (preceding-char) ?\\) 1301 (while (= (preceding-char) ?\\)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 2f353feb323..2cb108cc316 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1664,7 +1664,11 @@ uniqueness for different types of configurations."
1664 1664
1665(defun python-shell-parse-command () 1665(defun python-shell-parse-command ()
1666 "Calculate the string used to execute the inferior Python process." 1666 "Calculate the string used to execute the inferior Python process."
1667 (format "%s %s" python-shell-interpreter python-shell-interpreter-args)) 1667 (let ((process-environment (python-shell-calculate-process-environment))
1668 (exec-path (python-shell-calculate-exec-path)))
1669 (format "%s %s"
1670 (executable-find python-shell-interpreter)
1671 python-shell-interpreter-args)))
1668 1672
1669(defun python-shell-calculate-process-environment () 1673(defun python-shell-calculate-process-environment ()
1670 "Calculate process environment given `python-shell-virtualenv-path'." 1674 "Calculate process environment given `python-shell-virtualenv-path'."
@@ -2323,15 +2327,17 @@ Argument OUTPUT is a string with the output from the comint process."
2323 (file-name 2327 (file-name
2324 (with-temp-buffer 2328 (with-temp-buffer
2325 (insert full-output) 2329 (insert full-output)
2326 (goto-char (point-min)) 2330 ;; When the debugger encounters a pdb.set_trace()
2327 ;; OK, this sucked but now it became a cool hack. The 2331 ;; command, it prints a single stack frame. Sometimes
2328 ;; stacktrace information normally is on the first line 2332 ;; it prints a bit of extra information about the
2329 ;; but in some cases (like when doing a step-in) it is 2333 ;; arguments of the present function. When ipdb
2330 ;; on the second. 2334 ;; encounters an exception, it prints the _entire_ stack
2331 (when (or (looking-at python-pdbtrack-stacktrace-info-regexp) 2335 ;; trace. To handle all of these cases, we want to find
2332 (and 2336 ;; the _last_ stack frame printed in the most recent
2333 (forward-line) 2337 ;; batch of output, then jump to the corrsponding
2334 (looking-at python-pdbtrack-stacktrace-info-regexp))) 2338 ;; file/line number.
2339 (goto-char (point-max))
2340 (when (re-search-backward python-pdbtrack-stacktrace-info-regexp nil t)
2335 (setq line-number (string-to-number 2341 (setq line-number (string-to-number
2336 (match-string-no-properties 2))) 2342 (match-string-no-properties 2)))
2337 (match-string-no-properties 1))))) 2343 (match-string-no-properties 1)))))