[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-24 r117474: * lisp/progmodes/gud.el (gud-gdb-complet
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] emacs-24 r117474: * lisp/progmodes/gud.el (gud-gdb-completion-at-point): Add hack. |
Date: |
Tue, 02 Sep 2014 18:16:40 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117474
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18282
committer: Stefan Monnier <address@hidden>
branch nick: emacs-24
timestamp: Tue 2014-09-02 14:16:32 -0400
message:
* lisp/progmodes/gud.el (gud-gdb-completion-at-point): Add hack.
(gud-gdb-completions): Remove obsolete workaround.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/progmodes/gud.el gud.el-20091113204419-o5vbwnq5f7feedwu-2927
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-09-02 15:16:42 +0000
+++ b/lisp/ChangeLog 2014-09-02 18:16:32 +0000
@@ -1,3 +1,8 @@
+2014-09-02 Stefan Monnier <address@hidden>
+
+ * progmodes/gud.el (gud-gdb-completion-at-point): Add hack (bug#18282).
+ (gud-gdb-completions): Remove obsolete workaround.
+
2014-09-02 Eli Zaretskii <address@hidden>
* subr.el (posn-col-row): Revert the change from commit
=== modified file 'lisp/progmodes/gud.el'
--- a/lisp/progmodes/gud.el 2014-02-10 01:34:22 +0000
+++ b/lisp/progmodes/gud.el 2014-09-02 18:16:32 +0000
@@ -809,18 +809,6 @@
(current-buffer)
;; From string-match above.
(length context))))
- ;; `gud-gdb-run-command-fetch-lines' has some nasty side-effects on the
- ;; buffer (via `gud-delete-prompt-marker'): it removes the prompt and then
- ;; re-adds it later, thus messing up markers and overlays along the way.
- ;; This is a problem for completion-in-region which uses an overlay to
- ;; create a field.
- ;; So we restore completion-in-region's field if needed.
- ;; FIXME: change gud-gdb-run-command-fetch-lines so it doesn't modify the
- ;; buffer at all.
- (when (/= start (- (point) (field-beginning)))
- (dolist (ol (overlays-at (1- (point))))
- (when (eq (overlay-get ol 'field) 'completion)
- (move-overlay ol (- (point) start) (overlay-end ol)))))
;; Protect against old versions of GDB.
(and complete-list
(string-match "^Undefined command: \"complete\"" (car complete-list))
@@ -859,7 +847,14 @@
(save-excursion
(skip-chars-backward "^ " (comint-line-beginning-position))
(point))))
- (list start end
+ ;; FIXME: `gud-gdb-run-command-fetch-lines' has some nasty side-effects on
+ ;; the buffer (via `gud-delete-prompt-marker'): it removes the prompt and
+ ;; then re-adds it later, thus messing up markers and overlays along the
+ ;; way (bug#18282).
+ ;; We use an "insert-before" marker for `start', since it's typically right
+ ;; after the prompt, which works around the problem, but is a hack (and
+ ;; comes with other downsides, e.g. if completion adds text at `start').
+ (list (copy-marker start t) end
(completion-table-dynamic
(apply-partially gud-gdb-completion-function
(buffer-substring (comint-line-beginning-position)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-24 r117474: * lisp/progmodes/gud.el (gud-gdb-completion-at-point): Add hack.,
Stefan Monnier <=