emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/fns.c [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/fns.c [lexbind]
Date: Wed, 08 Dec 2004 19:34:01 -0500

Index: emacs/src/fns.c
diff -c emacs/src/fns.c:1.314.2.18 emacs/src/fns.c:1.314.2.19
*** emacs/src/fns.c:1.314.2.18  Fri Nov 12 04:21:15 2004
--- emacs/src/fns.c     Wed Dec  8 23:31:37 2004
***************
*** 741,747 ****
                  }
                else
                  {
!                   XSETFASTINT (elt, SREF (this, thisindex++));
                    if (some_multibyte
                        && (XINT (elt) >= 0240
                            || (XINT (elt) >= 0200
--- 741,747 ----
                  }
                else
                  {
!                   XSETFASTINT (elt, SREF (this, thisindex)); thisindex++;
                    if (some_multibyte
                        && (XINT (elt) >= 0240
                            || (XINT (elt) >= 0200
***************
*** 1997,2002 ****
--- 1997,2031 ----
    return Qnil;
  }
  
+ DEFUN ("safe-plist-get", Fsafe_plist_get, Ssafe_plist_get, 2, 2, 0,
+        doc: /* Extract a value from a property list.
+ PLIST is a property list, which is a list of the form
+ \(PROP1 VALUE1 PROP2 VALUE2...).  This function returns the value
+ corresponding to the given PROP, or nil if PROP is not
+ one of the properties on the list.
+ This function never signals an error.  */)
+      (plist, prop)
+      Lisp_Object plist;
+      Lisp_Object prop;
+ {
+   Lisp_Object tail, halftail;
+ 
+   /* halftail is used to detect circular lists.  */
+   tail = halftail = plist;
+   while (CONSP (tail) && CONSP (XCDR (tail)))
+     {
+       if (EQ (prop, XCAR (tail)))
+       return XCAR (XCDR (tail));
+ 
+       tail = XCDR (XCDR (tail));
+       halftail = XCDR (halftail);
+       if (EQ (tail, halftail))
+       break;
+     }
+ 
+   return Qnil;
+ }
+ 
  DEFUN ("get", Fget, Sget, 2, 2, 0,
         doc: /* Return the value of SYMBOL's PROPNAME property.
  This is the last value stored with `(put SYMBOL PROPNAME VALUE)'.  */)
***************
*** 5734,5739 ****
--- 5763,5769 ----
    defsubr (&Sreverse);
    defsubr (&Ssort);
    defsubr (&Splist_get);
+   defsubr (&Ssafe_plist_get);
    defsubr (&Sget);
    defsubr (&Splist_put);
    defsubr (&Sput);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]