changeset 9816:433b0117220b

(gud-gdb-complete-command): Add a trailing single quote to partially quoted unique completions.
author Karl Heuer <kwzh@gnu.org>
date Thu, 03 Nov 1994 20:30:28 +0000
parents cf81e1252f30
children cf4658356724
files lisp/gud.el
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)))