diff options
| author | Joakim Verona | 2012-07-31 00:00:41 +0200 |
|---|---|---|
| committer | Joakim Verona | 2012-07-31 00:00:41 +0200 |
| commit | 55fa71b3d9bb8609ca3cbb56f92c776ad8724a69 (patch) | |
| tree | b002fe941cc8636f8bd735717e440014359839dd /lisp/progmodes | |
| parent | 5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f (diff) | |
| parent | b429a4eee4e09b1ba09e17ced5091d042955d84f (diff) | |
| download | emacs-55fa71b3d9bb8609ca3cbb56f92c776ad8724a69.tar.gz emacs-55fa71b3d9bb8609ca3cbb56f92c776ad8724a69.zip | |
upstream
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/cc-menus.el | 8 | ||||
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 29 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 39 |
3 files changed, 38 insertions, 38 deletions
diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index a53d65f6307..76e3002abd2 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el | |||
| @@ -399,14 +399,10 @@ Example: | |||
| 399 | str2 "@protocol"))) | 399 | str2 "@protocol"))) |
| 400 | (setq str (cc-imenu-objc-remove-white-space str)) | 400 | (setq str (cc-imenu-objc-remove-white-space str)) |
| 401 | (setq methodlist (cons (cons str2 | 401 | (setq methodlist (cons (cons str2 |
| 402 | (match-beginning langnum)) | 402 | (match-beginning langnum)) |
| 403 | methodlist)) | 403 | methodlist)) |
| 404 | (setq toplist (cons nil (cons (cons str | 404 | (setq toplist (cons (cons str methodlist) toplist) |
| 405 | methodlist) toplist)) | ||
| 406 | methodlist nil)))) | 405 | methodlist nil)))) |
| 407 | ;; | ||
| 408 | (if (eq (car toplist) nil) | ||
| 409 | (setq toplist (cdr toplist))) | ||
| 410 | 406 | ||
| 411 | ;; In this buffer, there is only one or zero @{interface|implementation|protocol}. | 407 | ;; In this buffer, there is only one or zero @{interface|implementation|protocol}. |
| 412 | (if (< classcount 2) | 408 | (if (< classcount 2) |
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 23a34b85194..80afdc0bedf 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -2487,20 +2487,23 @@ HANDLER-NAME handler uses customization of CUSTOM-DEFUN. See | |||
| 2487 | (let ((file (bindat-get-field breakpoint 'fullname)) | 2487 | (let ((file (bindat-get-field breakpoint 'fullname)) |
| 2488 | (flag (bindat-get-field breakpoint 'enabled)) | 2488 | (flag (bindat-get-field breakpoint 'enabled)) |
| 2489 | (bptno (bindat-get-field breakpoint 'number))) | 2489 | (bptno (bindat-get-field breakpoint 'number))) |
| 2490 | (unless (file-exists-p file) | 2490 | (unless (and file (file-exists-p file)) |
| 2491 | (setq file (cdr (assoc bptno gdb-location-alist)))) | 2491 | (setq file (cdr (assoc bptno gdb-location-alist)))) |
| 2492 | (if (and file | 2492 | (if (or (null file) |
| 2493 | (not (string-equal file "File not found"))) | 2493 | (string-equal file "File not found")) |
| 2494 | (with-current-buffer | 2494 | ;; If the full filename is not recorded in the |
| 2495 | (find-file-noselect file 'nowarn) | 2495 | ;; breakpoint structure or in `gdb-location-alist', use |
| 2496 | (gdb-init-buffer) | 2496 | ;; -file-list-exec-source-file to extract it. |
| 2497 | ;; Only want one breakpoint icon at each location. | 2497 | (when (setq file (bindat-get-field breakpoint 'file)) |
| 2498 | (gdb-put-breakpoint-icon (string-equal flag "y") bptno | 2498 | (gdb-input (concat "list " file ":1") 'ignore) |
| 2499 | (string-to-number line))) | 2499 | (gdb-input "-file-list-exec-source-file" |
| 2500 | (gdb-input (concat "list " file ":1") 'ignore) | 2500 | `(lambda () (gdb-get-location |
| 2501 | (gdb-input "-file-list-exec-source-file" | 2501 | ,bptno ,line ,flag)))) |
| 2502 | `(lambda () (gdb-get-location | 2502 | (with-current-buffer (find-file-noselect file 'nowarn) |
| 2503 | ,bptno ,line ,flag))))))))) | 2503 | (gdb-init-buffer) |
| 2504 | ;; Only want one breakpoint icon at each location. | ||
| 2505 | (gdb-put-breakpoint-icon (string-equal flag "y") bptno | ||
| 2506 | (string-to-number line))))))))) | ||
| 2504 | 2507 | ||
| 2505 | (defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"") | 2508 | (defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"") |
| 2506 | 2509 | ||
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 132951aedc8..4617ecc420d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -250,6 +250,7 @@ | |||
| 250 | (define-key map "\C-c\C-tt" 'python-skeleton-try) | 250 | (define-key map "\C-c\C-tt" 'python-skeleton-try) |
| 251 | (define-key map "\C-c\C-tw" 'python-skeleton-while) | 251 | (define-key map "\C-c\C-tw" 'python-skeleton-while) |
| 252 | ;; Shell interaction | 252 | ;; Shell interaction |
| 253 | (define-key map "\C-c\C-p" 'run-python) | ||
| 253 | (define-key map "\C-c\C-s" 'python-shell-send-string) | 254 | (define-key map "\C-c\C-s" 'python-shell-send-string) |
| 254 | (define-key map "\C-c\C-r" 'python-shell-send-region) | 255 | (define-key map "\C-c\C-r" 'python-shell-send-region) |
| 255 | (define-key map "\C-\M-x" 'python-shell-send-defun) | 256 | (define-key map "\C-\M-x" 'python-shell-send-defun) |
| @@ -1544,7 +1545,7 @@ variable. | |||
| 1544 | 'python-shell-completion-complete-at-point nil 'local) | 1545 | 'python-shell-completion-complete-at-point nil 'local) |
| 1545 | (add-to-list (make-local-variable 'comint-dynamic-complete-functions) | 1546 | (add-to-list (make-local-variable 'comint-dynamic-complete-functions) |
| 1546 | 'python-shell-completion-complete-at-point) | 1547 | 'python-shell-completion-complete-at-point) |
| 1547 | (define-key inferior-python-mode-map (kbd "<tab>") | 1548 | (define-key inferior-python-mode-map "\t" |
| 1548 | 'python-shell-completion-complete-or-indent) | 1549 | 'python-shell-completion-complete-or-indent) |
| 1549 | (when python-shell-enable-font-lock | 1550 | (when python-shell-enable-font-lock |
| 1550 | (set (make-local-variable 'font-lock-defaults) | 1551 | (set (make-local-variable 'font-lock-defaults) |
| @@ -1571,30 +1572,33 @@ non-nil the buffer is shown." | |||
| 1571 | (with-current-buffer buffer | 1572 | (with-current-buffer buffer |
| 1572 | (inferior-python-mode) | 1573 | (inferior-python-mode) |
| 1573 | (python-util-clone-local-variables current-buffer)))) | 1574 | (python-util-clone-local-variables current-buffer)))) |
| 1574 | (when pop | 1575 | (and pop (pop-to-buffer proc-buffer-name t)) |
| 1575 | (pop-to-buffer proc-buffer-name)) | ||
| 1576 | proc-buffer-name))) | 1576 | proc-buffer-name))) |
| 1577 | 1577 | ||
| 1578 | (defun run-python (dedicated cmd) | 1578 | ;;;###autoload |
| 1579 | (defun run-python (cmd &optional dedicated show) | ||
| 1579 | "Run an inferior Python process. | 1580 | "Run an inferior Python process. |
| 1580 | Input and output via buffer named after | 1581 | Input and output via buffer named after |
| 1581 | `python-shell-buffer-name'. If there is a process already | 1582 | `python-shell-buffer-name'. If there is a process already |
| 1582 | running in that buffer, just switch to it. | 1583 | running in that buffer, just switch to it. |
| 1583 | With argument, allows you to define DEDICATED, so a dedicated | 1584 | |
| 1584 | process for the current buffer is open, and define CMD so you can | 1585 | With argument, allows you to define CMD so you can edit the |
| 1585 | edit the command used to call the interpreter (default is value | 1586 | command used to call the interpreter and define DEDICATED, so a |
| 1586 | of `python-shell-interpreter' and arguments defined in | 1587 | dedicated process for the current buffer is open. When numeric |
| 1587 | `python-shell-interpreter-args'). Runs the hook | 1588 | prefix arg is other than 0 or 4 do not SHOW. |
| 1588 | `inferior-python-mode-hook' (after the `comint-mode-hook' is | 1589 | |
| 1589 | run). | 1590 | Runs the hook `inferior-python-mode-hook' (after the |
| 1590 | \(Type \\[describe-mode] in the process buffer for a list of commands.)" | 1591 | `comint-mode-hook' is run). \(Type \\[describe-mode] in the |
| 1592 | process buffer for a list of commands.)" | ||
| 1591 | (interactive | 1593 | (interactive |
| 1592 | (if current-prefix-arg | 1594 | (if current-prefix-arg |
| 1593 | (list | 1595 | (list |
| 1596 | (read-string "Run Python: " (python-shell-parse-command)) | ||
| 1594 | (y-or-n-p "Make dedicated process? ") | 1597 | (y-or-n-p "Make dedicated process? ") |
| 1595 | (read-string "Run Python: " (python-shell-parse-command))) | 1598 | (= (prefix-numeric-value current-prefix-arg) 4)) |
| 1596 | (list nil (python-shell-parse-command)))) | 1599 | (list (python-shell-parse-command) nil t))) |
| 1597 | (python-shell-make-comint cmd (python-shell-get-process-name dedicated)) | 1600 | (python-shell-make-comint |
| 1601 | cmd (python-shell-get-process-name dedicated) show) | ||
| 1598 | dedicated) | 1602 | dedicated) |
| 1599 | 1603 | ||
| 1600 | (defun run-python-internal () | 1604 | (defun run-python-internal () |
| @@ -1611,7 +1615,6 @@ with user shells. Runs the hook | |||
| 1611 | `inferior-python-mode-hook' (after the `comint-mode-hook' is | 1615 | `inferior-python-mode-hook' (after the `comint-mode-hook' is |
| 1612 | run). \(Type \\[describe-mode] in the process buffer for a list | 1616 | run). \(Type \\[describe-mode] in the process buffer for a list |
| 1613 | of commands.)" | 1617 | of commands.)" |
| 1614 | (interactive) | ||
| 1615 | (set-process-query-on-exit-flag | 1618 | (set-process-query-on-exit-flag |
| 1616 | (get-buffer-process | 1619 | (get-buffer-process |
| 1617 | (python-shell-make-comint | 1620 | (python-shell-make-comint |
| @@ -1638,7 +1641,7 @@ of commands.)" | |||
| 1638 | (global-proc-buffer-name (format "*%s*" global-proc-name)) | 1641 | (global-proc-buffer-name (format "*%s*" global-proc-name)) |
| 1639 | (dedicated-running (comint-check-proc dedicated-proc-buffer-name)) | 1642 | (dedicated-running (comint-check-proc dedicated-proc-buffer-name)) |
| 1640 | (global-running (comint-check-proc global-proc-buffer-name)) | 1643 | (global-running (comint-check-proc global-proc-buffer-name)) |
| 1641 | (current-prefix-arg 4)) | 1644 | (current-prefix-arg 16)) |
| 1642 | (when (and (not dedicated-running) (not global-running)) | 1645 | (when (and (not dedicated-running) (not global-running)) |
| 1643 | (if (call-interactively 'run-python) | 1646 | (if (call-interactively 'run-python) |
| 1644 | (setq dedicated-running t) | 1647 | (setq dedicated-running t) |
| @@ -1945,7 +1948,6 @@ completions on the current context." | |||
| 1945 | 1948 | ||
| 1946 | (defun python-shell-completion-complete-at-point () | 1949 | (defun python-shell-completion-complete-at-point () |
| 1947 | "Perform completion at point in inferior Python process." | 1950 | "Perform completion at point in inferior Python process." |
| 1948 | (interactive) | ||
| 1949 | (and comint-last-prompt-overlay | 1951 | (and comint-last-prompt-overlay |
| 1950 | (> (point-marker) (overlay-end comint-last-prompt-overlay)) | 1952 | (> (point-marker) (overlay-end comint-last-prompt-overlay)) |
| 1951 | (python-shell-completion--do-completion-at-point | 1953 | (python-shell-completion--do-completion-at-point |
| @@ -2060,7 +2062,6 @@ Argument OUTPUT is a string with the output from the comint process." | |||
| 2060 | For this to work the best as possible you should call | 2062 | For this to work the best as possible you should call |
| 2061 | `python-shell-send-buffer' from time to time so context in | 2063 | `python-shell-send-buffer' from time to time so context in |
| 2062 | inferior python process is updated properly." | 2064 | inferior python process is updated properly." |
| 2063 | (interactive) | ||
| 2064 | (let ((process (python-shell-get-process))) | 2065 | (let ((process (python-shell-get-process))) |
| 2065 | (if (not process) | 2066 | (if (not process) |
| 2066 | (error "Completion needs an inferior Python process running") | 2067 | (error "Completion needs an inferior Python process running") |