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)) )
8

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.