# HG changeset patch # User Karl Heuer # Date 783894628 0 # Node ID 433b0117220b0f1b4a2152f8abcfdcc9ff9fa802 # Parent cf81e1252f3081dea93afbaaa9ddbcda9303e964 (gud-gdb-complete-command): Add a trailing single quote to partially quoted unique completions. diff -r cf81e1252f30 -r 433b0117220b lisp/gud.el --- a/lisp/gud.el Thu Nov 03 20:24:53 1994 +0000 +++ b/lisp/gud.el Thu Nov 03 20:30:28 1994 +0000 @@ -317,6 +317,17 @@ (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)))