all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [dann@ics.uci.edu: partial-completion-mode error]
@ 2006-08-07  5:00 Richard Stallman
  2006-08-07 18:06 ` Fwd: partial-completion-mode error Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Stallman @ 2006-08-07  5:00 UTC (permalink / raw)


Would someone please DTRT and ack?

------- Start of forwarded message -------
To: emacs-pretest-bug@gnu.org
From: Dan Nicolaescu <dann@ics.uci.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Fri, 04 Aug 2006 18:26:36 -0700
Subject: partial-completion-mode error
X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed 
	version=3.0.4


Doing:

emacs -q
M-x partial-completion-mode RET

C-x C-f /usr/share/X11/xkb/symbols/pc TAB TAB

I get an error: Wrong type argument: sequencep, t

The error seems to be thrown by the `aref' in the following code in
PC-do-completion because `prefix' is nil:

	    (if (and (not (eq mode 'help))
		     (setq prefix (try-completion (PC-chunk-after basestr skip) (mapcar 'list poss))))
		(let ((first t) i)
		  ;; Retain capitalization of user input even if
		  ;; completion-ignore-case is set.
		  (if (eq mode 'word)
		      (setq prefix (PC-chop-word prefix basestr)))
		  (goto-char (+ beg (length dirname)))
		  (while (and (progn
				(setq i 0) ; index into prefix string
				(while (< i (length prefix))
				  (if (and (< (point) end)
					   (eq (downcase (aref prefix i))
					       (downcase (following-char))))
				      ;; same char (modulo case); no action


The /usr/share/X11/xkb/symbols/ contains besides the "pc" file a "pc~"
file. If the "pc~" file is not present, no error is generated. 

Can somebody please take a look at this? 

Thanks
        --dan


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fwd: partial-completion-mode error
  2006-08-07  5:00 [dann@ics.uci.edu: partial-completion-mode error] Richard Stallman
@ 2006-08-07 18:06 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2006-08-07 18:06 UTC (permalink / raw)
  Cc: rms, emacs-devel

> Would someone please DTRT and ack?

> Doing:

> emacs -q
> M-x partial-completion-mode RET

> C-x C-f /usr/share/X11/xkb/symbols/pc TAB TAB

> I get an error: Wrong type argument: sequencep, t

> The error seems to be thrown by the `aref' in the following code in
> PC-do-completion because `prefix' is nil:

I believe the patch below fixes it.


        Stefan


--- complete.el	02 aoû 2006 10:06:29 -0400	1.56
+++ complete.el	07 aoû 2006 14:01:36 -0400	
@@ -553,28 +553,6 @@
 		   (setq poss (cons (car p) poss))))
 	    (setq p (cdr p)))))
 
-      ;; Now we have a list of possible completions
-      (cond
-
-       ;; No valid completions found
-       ((null poss)
-	(if (and (eq mode 'word)
-		 (not PC-word-failed-flag))
-	    (let ((PC-word-failed-flag t))
-	      (delete-backward-char 1)
-	      (PC-do-completion 'word))
-	  (beep)
-	  (PC-temp-minibuffer-message (if ambig
-					  " [Ambiguous dir name]"
-					(if (eq mode 'help)
-					    " [No completions]"
-					  " [No match]")))
-	  nil))
-
-       ;; More than one valid completion found
-       ((or (cdr (setq helpposs poss))
-	    (memq mode '(help word)))
-
 	;; Handle completion-ignored-extensions
 	(and filename
 	     (not (eq mode 'help))
@@ -603,6 +581,28 @@
 	       ;; If there are "good" names, use them
 	       (and p (setq poss p))))
 
+      ;; Now we have a list of possible completions
+      (cond
+
+       ;; No valid completions found
+       ((null poss)
+	(if (and (eq mode 'word)
+		 (not PC-word-failed-flag))
+	    (let ((PC-word-failed-flag t))
+	      (delete-backward-char 1)
+	      (PC-do-completion 'word))
+	  (beep)
+	  (PC-temp-minibuffer-message (if ambig
+					  " [Ambiguous dir name]"
+					(if (eq mode 'help)
+					    " [No completions]"
+					  " [No match]")))
+	  nil))
+
+       ;; More than one valid completion found
+       ((or (cdr (setq helpposs poss))
+	    (memq mode '(help word)))
+
 	;; Is the actual string one of the possible completions?
 	(setq p (and (not (eq mode 'help)) poss))
 	(while (and p
@@ -623,7 +623,8 @@
 
 	    ;; Check if next few letters are the same in all cases
 	    (if (and (not (eq mode 'help))
-		     (setq prefix (try-completion (PC-chunk-after basestr skip) (mapcar 'list poss))))
+		     (setq prefix (try-completion (PC-chunk-after basestr skip)
+                                                  poss)))
 		(let ((first t) i)
 		  ;; Retain capitalization of user input even if
 		  ;; completion-ignore-case is set.
@@ -669,13 +670,9 @@
 					      (+ beg (length dirname)) end)
 					     skip)
 					    (mapcar
-					     (function
 					      (lambda (x)
-						(list
-						 (and (string-match skip x)
-						      (substring
-						       x
-						       (match-end 0))))))
+                                               (when (string-match skip x)
+                                                 (substring x (match-end 0))))
 					     poss)))
 			      (or (> i 0) (> (length prefix) 0))
 			      (or (not (eq mode 'word))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-07 18:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-07  5:00 [dann@ics.uci.edu: partial-completion-mode error] Richard Stallman
2006-08-07 18:06 ` Fwd: partial-completion-mode error Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.