From: Karl Heuer Date: Thu, 3 Nov 1994 20:30:28 +0000 (+0000) Subject: (gud-gdb-complete-command): Add a trailing single quote to partially quoted X-Git-Tag: emacs-19.34~6039 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fd63b4f4d86e523f6372b356f991358bfc7e866c;p=emacs.git (gud-gdb-complete-command): Add a trailing single quote to partially quoted unique completions. --- 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)))