aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-11-03 20:30:28 +0000
committerKarl Heuer1994-11-03 20:30:28 +0000
commitfd63b4f4d86e523f6372b356f991358bfc7e866c (patch)
tree51b18548072d65c331157a79cb9184520d429c09
parent6b356ee89a985db74642e3cbc833da104ec82998 (diff)
downloademacs-fd63b4f4d86e523f6372b356f991358bfc7e866c.tar.gz
emacs-fd63b4f4d86e523f6372b356f991358bfc7e866c.zip
(gud-gdb-complete-command): Add a trailing single quote to partially quoted
unique completions.
-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."
317 (setcdr first (setq second (cdr second))) 317 (setcdr first (setq second (cdr second)))
318 (setq first second 318 (setq first second
319 second (cdr second))))) 319 second (cdr second)))))
320 ;; Add a trailing single quote if there is a unique completion
321 ;; and it contains an odd number of unquoted single quotes.
322 (and (= (length gud-gdb-complete-list) 1)
323 (let ((str (car gud-gdb-complete-list))
324 (pos 0)
325 (count 0))
326 (while (string-match "\\([^'\\]\\|\\\\'\\)*'" str pos)
327 (setq count (1+ count)
328 pos (match-end 0)))
329 (and (= (mod count 2) 1)
330 (setq gud-gdb-complete-list (list (concat str "'"))))))
320 ;; Let comint handle the rest. 331 ;; Let comint handle the rest.
321 (comint-dynamic-simple-complete command-word gud-gdb-complete-list))) 332 (comint-dynamic-simple-complete command-word gud-gdb-complete-list)))
322 333