diff options
| author | Stefan Monnier | 2014-09-02 14:16:32 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-09-02 14:16:32 -0400 |
| commit | 9de3064db6370972998737a9aa7cce7856c42aef (patch) | |
| tree | 1dcc365f885cbb3101cf6219a89a00e25b3cfab2 | |
| parent | 5735a30d59af16ba004a151b6e0a4c18ba1d481e (diff) | |
| download | emacs-9de3064db6370972998737a9aa7cce7856c42aef.tar.gz emacs-9de3064db6370972998737a9aa7cce7856c42aef.zip | |
* lisp/progmodes/gud.el (gud-gdb-completion-at-point): Add hack.
(gud-gdb-completions): Remove obsolete workaround.
Fixes: debbugs:18282
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/gud.el | 21 |
2 files changed, 13 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f729f42da87..c91f43cafa0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-09-02 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * progmodes/gud.el (gud-gdb-completion-at-point): Add hack (bug#18282). | ||
| 4 | (gud-gdb-completions): Remove obsolete workaround. | ||
| 5 | |||
| 1 | 2014-09-02 Eli Zaretskii <eliz@gnu.org> | 6 | 2014-09-02 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * subr.el (posn-col-row): Revert the change from commit | 8 | * subr.el (posn-col-row): Revert the change from commit |
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index c6fc944bc13..98912ca5acb 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -809,18 +809,6 @@ CONTEXT is the text before COMMAND on the line." | |||
| 809 | (current-buffer) | 809 | (current-buffer) |
| 810 | ;; From string-match above. | 810 | ;; From string-match above. |
| 811 | (length context)))) | 811 | (length context)))) |
| 812 | ;; `gud-gdb-run-command-fetch-lines' has some nasty side-effects on the | ||
| 813 | ;; buffer (via `gud-delete-prompt-marker'): it removes the prompt and then | ||
| 814 | ;; re-adds it later, thus messing up markers and overlays along the way. | ||
| 815 | ;; This is a problem for completion-in-region which uses an overlay to | ||
| 816 | ;; create a field. | ||
| 817 | ;; So we restore completion-in-region's field if needed. | ||
| 818 | ;; FIXME: change gud-gdb-run-command-fetch-lines so it doesn't modify the | ||
| 819 | ;; buffer at all. | ||
| 820 | (when (/= start (- (point) (field-beginning))) | ||
| 821 | (dolist (ol (overlays-at (1- (point)))) | ||
| 822 | (when (eq (overlay-get ol 'field) 'completion) | ||
| 823 | (move-overlay ol (- (point) start) (overlay-end ol))))) | ||
| 824 | ;; Protect against old versions of GDB. | 812 | ;; Protect against old versions of GDB. |
| 825 | (and complete-list | 813 | (and complete-list |
| 826 | (string-match "^Undefined command: \"complete\"" (car complete-list)) | 814 | (string-match "^Undefined command: \"complete\"" (car complete-list)) |
| @@ -859,7 +847,14 @@ CONTEXT is the text before COMMAND on the line." | |||
| 859 | (save-excursion | 847 | (save-excursion |
| 860 | (skip-chars-backward "^ " (comint-line-beginning-position)) | 848 | (skip-chars-backward "^ " (comint-line-beginning-position)) |
| 861 | (point)))) | 849 | (point)))) |
| 862 | (list start end | 850 | ;; FIXME: `gud-gdb-run-command-fetch-lines' has some nasty side-effects on |
| 851 | ;; the buffer (via `gud-delete-prompt-marker'): it removes the prompt and | ||
| 852 | ;; then re-adds it later, thus messing up markers and overlays along the | ||
| 853 | ;; way (bug#18282). | ||
| 854 | ;; We use an "insert-before" marker for `start', since it's typically right | ||
| 855 | ;; after the prompt, which works around the problem, but is a hack (and | ||
| 856 | ;; comes with other downsides, e.g. if completion adds text at `start'). | ||
| 857 | (list (copy-marker start t) end | ||
| 863 | (completion-table-dynamic | 858 | (completion-table-dynamic |
| 864 | (apply-partially gud-gdb-completion-function | 859 | (apply-partially gud-gdb-completion-function |
| 865 | (buffer-substring (comint-line-beginning-position) | 860 | (buffer-substring (comint-line-beginning-position) |