2

I am having trouble understanding why two apparently different overlay strings are equal. The following test results positive -- i.e., t. The colors are different and the :data identification names are different -- i.e., the first name is pilcrow_plain_xpm; whereas the second name is pilcrow_active_region_xpm.

Q: Why are they equal?

(equal

  #(" " 0 1
    (display
      (image :type xpm :mask nil :ascent center :data
        "/* XPM */
        static char * pilcrow_plain_xpm[] = {
        \"11 20 4 1\",
        \". c #000000\",
        \"+ c #555555\",
        \"@ c #7F0000\",
        \"% c yellow\",
        \"...........\",
        \"...........\",
        \"...........\",
        \"...........\",
        \"...++++++..\",
        \"..++++.+...\",
        \"..++++.+...\",
        \"..++++.+...\",
        \"...+++.+...\",
        \".....+.+...\",
        \".....+.+...\",
        \".....+.+...\",
        \".....+.+...\",
        \".....+.+...\",
        \"...........\",
        \"...........\",
        \"...........\",
        \"...........\",
        \"...........\",
        \"...........\"};")
           cursor t))

  #(" " 0 1
    (display
      (image :type xpm :mask nil :ascent center :data
       "/* XPM */
       static char * pilcrow_active_region_xpm[] = {
       \"11 20 4 1\",
       \". c #3c3c3c\",
       \"+ c #555555\",
       \"@ c #7F0000\",
       \"% c yellow\",
       \"%..........\",
       \"%..........\",
       \"%..........\",
       \"%..........\",
       \"%..++++++..\",
       \"%.++++.+...\",
       \"%.++++.+...\",
       \"%.++++.+...\",
       \"%..+++.+...\",
       \"%....+.+...\",
       \"%....+.+...\",
       \"%....+.+...\",
       \"%....+.+...\",
       \"%....+.+...\",
       \"%..........\",
       \"%..........\",
       \"%..........\",
       \"%..........\",
       \"%..........\",
       \"%..........\"};")
          cursor t)) )
lawlist
  • 19,106
  • 5
  • 38
  • 120

1 Answers1

8

equal compares by string content and ignores text properties. If you wish to include properties into your check, use equal-including-properties.

wasamasa
  • 22,178
  • 1
  • 66
  • 99