Mercurial > hg > xemacs-beta
comparison src/buffer.c @ 82:6a378aca36af r20-0b91
Import from CVS: tag r20-0b91
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:07:36 +0200 |
parents | c7528f8e288d |
children | 0d2f883870bc |
comparison
equal
deleted
inserted
replaced
81:ebca3d831cea | 82:6a378aca36af |
---|---|
1546 Lisp_Object valcontents = XSYMBOL (sym)->value; | 1546 Lisp_Object valcontents = XSYMBOL (sym)->value; |
1547 if (SYMBOL_VALUE_MAGIC_P (valcontents)) | 1547 if (SYMBOL_VALUE_MAGIC_P (valcontents)) |
1548 { | 1548 { |
1549 /* Just reference the variable | 1549 /* Just reference the variable |
1550 to cause it to become set for this buffer. */ | 1550 to cause it to become set for this buffer. */ |
1551 (void) find_symbol_value (sym); | 1551 /* Use find_symbol_value_quickly to avoid an unnecessary O(n) |
1552 lookup. */ | |
1553 (void) find_symbol_value_quickly (XCAR (tail), 1); | |
1552 } | 1554 } |
1553 } | 1555 } |
1554 | 1556 |
1555 /* Do the same with any others that were local to the previous buffer */ | 1557 /* Do the same with any others that were local to the previous buffer */ |
1556 | 1558 |
1557 if (old_buf) | 1559 if (old_buf) |
1558 { | 1560 { |
1559 for (tail = old_buf->local_var_alist; | 1561 LIST_LOOP (tail, old_buf->local_var_alist) |
1560 !NILP (tail); | |
1561 tail = XCDR (tail)) | |
1562 { | 1562 { |
1563 Lisp_Object sym = XCAR (XCAR (tail)); | 1563 Lisp_Object sym = XCAR (XCAR (tail)); |
1564 Lisp_Object valcontents = XSYMBOL (sym)->value; | 1564 Lisp_Object valcontents = XSYMBOL (sym)->value; |
1565 | 1565 |
1566 if (SYMBOL_VALUE_MAGIC_P (valcontents)) | 1566 if (SYMBOL_VALUE_MAGIC_P (valcontents)) |
1567 { | 1567 { |
1568 /* Just reference the variable | 1568 /* Just reference the variable |
1569 to cause it to become set for this buffer. */ | 1569 to cause it to become set for this buffer. */ |
1570 (void) find_symbol_value (sym); | 1570 /* Use find_symbol_value_quickly with find_it_p as 0 to avoid an |
1571 unnecessary O(n) lookup which is guaranteed to be worst case. | |
1572 Any symbols which are local are guaranteed to have been | |
1573 handled in the previous loop, above. */ | |
1574 (void) find_symbol_value_quickly (sym, 0); | |
1571 } | 1575 } |
1572 } | 1576 } |
1573 } | 1577 } |
1574 } | 1578 } |
1575 | 1579 |