changeset 19763:ab2fd2c85986

(Ffind_operation_coding_system): If a function in XXX-coding-system-alist returns a coding system (instead of cons of coding systems), return cons of it.
author Kenichi Handa <handa@m17n.org>
date Fri, 05 Sep 1997 08:07:44 +0000
parents f6ca32374b0b
children 427a68b553db
files src/coding.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/coding.c	Fri Sep 05 06:15:33 1997 +0000
+++ b/src/coding.c	Fri Sep 05 08:07:44 1997 +0000
@@ -3788,14 +3788,22 @@
 	      || (INTEGERP (target) && EQ (target, XCONS (elt)->car))))
 	{
 	  val = XCONS (elt)->cdr;
+	  /* Here, if VAL is both a valid coding system and a valid
+             function symbol, we return VAL as a coding system.  */
 	  if (CONSP (val))
 	    return val;
 	  if (! SYMBOLP (val))
 	    return Qnil;
 	  if (! NILP (Fcoding_system_p (val)))
 	    return Fcons (val, val);
-	  if (!NILP (Ffboundp (val)))
-	    return call1 (val, Flist (nargs, args));
+	  if (! NILP (Ffboundp (val)))
+	    {
+	      val = call1 (val, Flist (nargs, args));
+	      if (CONSP (val))
+		return val;
+	      if (SYMBOLP (val) && ! NILP (Fcoding_system_p (val)))
+		return Fcons (val, val);
+	    }
 	  return Qnil;
 	}
     }