summaryrefslogtreecommitdiff
path: root/lisp/gud.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-11-03 20:30:28 +0000
committerKarl Heuer <kwzh@gnu.org>1994-11-03 20:30:28 +0000
commit6b947b18d75d9e2546ec0a3aa53eb468926eebb0 (patch)
treeb5628eb318cc230c06cf5180e908c5f65d9295a1 /lisp/gud.el
parent22563905c12d9aef070783fcad161ebd08057051 (diff)
downloademacs-6b947b18d75d9e2546ec0a3aa53eb468926eebb0.tar.gz
(gud-gdb-complete-command): Add a trailing single quote to partially quoted
unique completions.
Diffstat (limited to 'lisp/gud.el')
-rw-r--r--lisp/gud.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/gud.el b/lisp/gud.el
index 34e740bd50f..b8080e0ae72 100644
--- a/lisp/gud.el
+++ b/lisp/gud.el
@@ -317,6 +317,17 @@ available with older versions of GDB."
(setcdr first (setq second (cdr second)))
(setq first second
second (cdr second)))))
+ ;; Add a trailing single quote if there is a unique completion
+ ;; and it contains an odd number of unquoted single quotes.
+ (and (= (length gud-gdb-complete-list) 1)
+ (let ((str (car gud-gdb-complete-list))
+ (pos 0)
+ (count 0))
+ (while (string-match "\\([^'\\]\\|\\\\'\\)*'" str pos)
+ (setq count (1+ count)
+ pos (match-end 0)))
+ (and (= (mod count 2) 1)
+ (setq gud-gdb-complete-list (list (concat str "'"))))))
;; Let comint handle the rest.
(comint-dynamic-simple-complete command-word gud-gdb-complete-list)))