Now on revision 109527. ------------------------------------------------------------ revno: 109527 committer: Chong Yidong branch nick: trunk timestamp: Thu 2012-08-09 13:25:21 +0800 message: * etc/images/splash.svg, etc/images/splash.png: Tweak SVG paths to improve legibility. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-08-08 16:17:15 +0000 +++ etc/ChangeLog 2012-08-09 05:25:21 +0000 @@ -1,3 +1,8 @@ +2012-08-09 Chong Yidong + + * images/splash.svg, images/splash.png: Tweak SVG paths to improve + legibility. + 2012-08-08 Dmitry Antipov * NEWS: Mention --without-all and --enable-link-time-optimization. === modified file 'etc/images/splash.png' Binary files etc/images/splash.png 2008-07-02 01:49:03 +0000 and etc/images/splash.png 2012-08-09 05:25:21 +0000 differ === modified file 'etc/images/splash.svg' --- etc/images/splash.svg 2012-01-19 07:21:25 +0000 +++ etc/images/splash.svg 2012-08-09 05:25:21 +0000 @@ -22,7 +22,7 @@ along with GNU Emacs. If not, see . --> - + @@ -51,7 +43,7 @@ image/svg+xml - splash + 2008/06/28 @@ -76,59 +68,29 @@ - - - - - - - - - - + id="stop2552" + style="stop-color:#4c94f1;stop-opacity:0.78431374" + offset="0" /> + + id="stop7898" + style="stop-color:#fc644b;stop-opacity:0.78431374" + offset="0" /> + id="stop7900" + style="stop-color:#fc644b;stop-opacity:0.78431374" + offset="1" /> - - - - - - - - - - - - - - - + d="M -0.54734668,196.72853 C -10.238062,181.78405 5.3965305,167.92976 14.809201,161.97512 c 6.963497,-4.40524 14.224571,-9.82272 13.070957,-9.82483 -0.996579,-0.002 -3.28511,-0.79177 -5.085617,-1.75545 -6.217876,-3.328 -7.955628,-16.0503 7.055337,-28.37575 16.709358,-12.01621 42.570706,-26.817295 64.900729,-20.35237 3.972323,1.58882 2.904483,4.42259 -3.766368,9.99493 -5.675178,4.74062 -17.792772,11.85728 -18.753492,11.01391 -0.233326,-0.20481 2.490068,-2.19795 6.051979,-4.42919 3.551812,-2.45188 6.827,-5.57228 6.234589,-9.02517 -1.977492,-3.21848 -14.566202,0.87624 -19.657994,3.11812 -8.980399,3.95401 -30.419617,17.3969 -29.389287,24.77996 0.719552,5.15612 9.095912,7.16542 19.107524,2.72826 7.005023,-3.10464 12.660323,-6.60409 12.285323,-4.56715 -0.365454,1.98509 -12.574667,10.22701 -19.359801,12.99119 -10.773868,4.38916 -18.049435,9.35351 -26.510163,16.40859 -7.801376,6.50528 -6.794788,9.58593 -6.794788,14.18989 0,3.11466 2.974668,5.51843 6.829021,5.51843 7.964514,0 8.895804,0.12074 32.270578,-16.56369 5.162282,-3.68473 10.228089,-7.76323 13.653652,-9.77045 4.326017,-2.53484 9.463124,-4.13198 8.976988,-1.65526 -3.779364,7.61077 -5.74585,10.67934 -9.167556,16.15546 8.11118,-6.33235 15.840916,-14.71763 24.306604,-15.7298 2.101063,-0.25121 7.741174,-0.49516 8.636184,0.99596 0.66736,1.11183 -0.45512,5.1162 -2.21368,8.92266 -0.53908,1.16685 1.05142,0.38368 4.67533,-2.30213 7.4413,-5.51505 14.07911,-8.75072 17.95157,-8.75072 4.57712,0 4.83279,1.74832 1.24097,8.48622 -3.75741,7.04855 -6.75962,17.21422 -4.65148,19.88378 1.46622,1.85669 7.96734,-2.91147 10.3276,-4.31865 2.42293,-1.44454 6.05649,-3.67201 7.44149,-4.72955 10.37298,-7.92039 39.1617,-23.15505 40.99851,-21.53603 0.82449,0.72672 -1.6928,2.43145 -10.4509,7.07749 -14.25554,7.56231 -22.59862,14.9854 -22.60932,20.11619 -0.006,2.71011 4.1743,2.15203 7.26381,1.4275 4.40695,-1.03349 12.41622,-3.9676 -0.1736,3.14023 -13.16001,7.42973 -22.48474,6.17812 -16.63437,-3.95665 l 3.73574,-6.16441 -9.13253,6.55379 c -13.1916,9.46671 -19.35595,10.10807 -22.76505,7.11544 -2.6121,-2.29301 -1.99116,-8.56165 1.43897,-14.5266 2.74703,-4.77707 3.88176,-8.84229 2.46817,-8.84229 -2.38604,0 -7.35931,4.53611 -13.269938,10.69747 -9.974903,10.39803 -8.541011,15.10079 -10.591215,15.36937 -1.2597,0.16503 -6.977484,-1.59412 -4.555892,-8.64067 1.80805,-5.26122 4.692881,-8.68747 6.822262,-11.55279 3.866732,-5.2031 1.480467,-5.97342 -3.790272,-3.77097 -3.05613,1.27704 -5.350157,4.83814 -17.152826,15.01371 -13.804895,11.90177 -18.199091,17.31988 -20.790434,11.99663 -1.273249,-2.61557 1.017602,-5.97434 3.23361,-9.57032 4.367498,-7.21552 10.687821,-13.92473 8.632844,-16.40082 -2.050191,0.66573 -5.701417,3.94706 -7.917424,5.72051 -2.216008,1.77344 -5.216905,3.98662 -6.668674,4.91816 -1.451757,0.93154 -5.757863,3.9162 -9.569125,6.63254 -3.811251,2.71637 -10.546273,6.79489 -14.966706,9.06335 -9.584043,4.91833 -13.8359278,5.33836 -18.57838668,1.83533 z M 159.75643,187.9147 c -4.88506,-3.00364 -1.44968,-15.28517 5.948,-21.2642 3.32796,-2.68976 12.33843,-8.3073 13.32481,-8.3073 0.27463,0 -1.05354,2.61529 -2.9515,5.81174 -5.51025,9.28008 -4.30612,16.29397 2.79731,16.29397 5.95677,0 10.60291,-1.935 15.24759,-9.21089 3.95762,-6.19961 10.07679,-10.04817 15.75277,-13.07984 4.88528,-2.60934 15.49103,-5.23799 19.83723,-4.00272 6.01532,1.70966 5.07061,0.66399 -3.766,4.03459 -9.35359,3.5678 -12.15223,5.23437 -15.80579,9.41222 -4.62835,5.29254 -5.17979,8.5948 -1.91397,11.46168 2.05902,1.80749 3.56776,2.26807 7.41531,2.26374 2.65669,-0.003 5.81168,-1.7253 7.33518,-2.42296 1.52351,-0.69765 3.03519,0.21321 3.03519,0.61971 -5.88638,3.94569 -11.44839,6.45882 -14.00234,7.27145 -2.61375,0.96599 -7.35132,2.03318 -10.23523,1.93803 -5.03631,0.0339 -9.16147,-1.48631 -10.57379,-3.37846 -0.79608,-1.43217 -1.3268,-2.70381 -0.96262,-3.97903 1.0679,-3.73939 0.16517,-2.52343 -4.28527,0.23044 -13.102,8.10733 -21.40719,9.25285 -26.19688,6.30784 z m 75.29251,0.53861 c -1.38501,-0.41487 -3.99134,-0.79396 -5.79185,-0.84243 -5.99934,-0.16153 -3.6372,-2.26466 5.12716,-4.56493 2.24719,-0.58979 2.74693,-0.49039 2.32997,0.46346 -1.0714,2.45099 8.09297,3.14024 13.72804,1.0325 5.4798,-2.04969 7.70684,-5.31293 8.2153,-10.06119 0.16756,-8.34719 -12.6158,-6.31988 -18.32043,-6.36109 -12.98146,-0.0572 -14.34396,-1.01124 -7.14295,-5.00172 9.56822,-5.3023 20.88185,-11.1336 25.8426,-10.44585 5.86061,0.8125 5.42599,3.39743 -0.5575,3.43312 -3.92889,0.0234 -13.80136,5.14348 -14.97622,6.81223 -1.22979,1.74676 2.12319,2.47254 11.4854,2.48607 8.58743,0.0125 9.56792,0.19334 11.8355,2.18392 3.81332,3.3475 3.46341,8.67923 -0.80123,12.20836 -7.5132,6.21743 -19.30064,10.28748 -30.97375,8.65755 z" + style="opacity:1;fill:#000000;display:inline" /> + d="m 55.834396,197.41294 c 2.448659,-7.38073 7.446723,-16.72109 12.277833,-22.94475 5.710592,-7.35667 7.378339,-9.3856 28.689891,-34.90319 16.87202,-20.20188 19.22296,-23.17964 22.55476,-28.56842 1.5428,-2.49527 3.17766,-4.53686 3.63304,-4.53686 1.18186,0 1.10043,0.30992 -1.63307,6.21531 -1.35357,2.92423 -2.46105,5.64532 -2.46105,6.04685 0,0.40153 -2.97647,4.90375 -6.6144,10.00493 -8.98843,12.60381 -10.76025,14.97182 -13.0823,17.48445 -1.0981,1.18822 -3.8535,4.49366 -6.123108,7.34539 -2.269606,2.85173 -4.587188,5.62332 -5.150194,6.15909 -0.562997,0.53575 -2.795585,3.19769 -4.961309,5.91542 -6.691216,8.39667 -16.095209,19.83397 -17.431654,21.20066 -0.699773,0.71561 -3.044271,3.91702 -5.209995,7.11426 -4.16128,6.14322 -5.795033,7.40513 -4.488444,3.46686 z m 66.481544,-23.7645 c 0.22279,-0.5941 1.5292,-4.28446 2.90315,-8.20081 3.44555,-9.82127 13.66236,-27.15831 19.73886,-33.49506 l 2.48602,-2.59251 2.25191,2.37646 c 2.67739,2.82544 3.88298,2.92759 8.02572,0.68 3.08741,-1.67502 7.69643,-8.22076 20.10229,-28.54928 4.55053,-7.456586 5.01229,-7.939498 5.0346,-5.26516 0.0415,4.9808 -22.21528,41.2544 -29.34472,47.82522 -4.11732,3.7947 -6.18823,4.04757 -8.84718,1.0802 -1.06473,-1.18822 -2.3151,-2.15972 -2.77861,-2.15886 -1.62142,0.003 -12.08302,16.59943 -16.47702,26.13939 -0.82094,1.78235 -1.9443,3.24062 -2.49635,3.24062 -0.55207,0 -0.82147,-0.48609 -0.59867,-1.08021 z m 84.19319,-24.88787 c 0,-7.49007 7.66313,-38.06798 12.33356,-49.21415 3.04458,-7.266009 7.33463,-20.847085 8.32578,-26.356986 0.42748,-2.376449 1.49075,-7.626245 2.36285,-11.666209 0.87207,-4.039964 1.5862,-11.563 1.58694,-16.717855 0.002,-10.935036 -1.20271,-13.589976 -7.10476,-15.663026 -7.62736,-2.67905 -10.16765,-1.47291 -13.00198,6.173428 -1.74243,4.700723 -3.72352,6.856253 -5.44369,5.923006 -1.89626,-1.028794 -1.05403,-4.387566 2.90016,-11.565454 8.13973,-14.77576 14.55936,-18.45654 24.45815,-14.02345 5.65324,2.53175 9.02208,8.60392 9.02208,16.2618 0,9.333563 -7.01946,35.141105 -14.28285,52.511886 -4.47563,10.703728 -11.5668,35.30103 -14.85507,51.5282 -2.1002,10.36421 -3.15113,13.73222 -4.51891,14.48205 -1.5746,0.86323 -1.78226,0.66827 -1.78226,-1.67324 z M 110.03525,94.607887 c -7.1e-4,-8.464568 -0.25892,-9.796146 -2.81265,-14.505144 -2.66535,-4.914782 -7.28206,-9.937882 -9.13385,-9.937882 -0.4676,0 -0.85017,-0.490243 -0.85017,-1.08943 0,-1.557732 8.70129,-12.737188 9.91372,-12.737188 1.73907,0 7.4566,5.456815 9.50728,9.073719 2.60567,4.595744 3.35771,11.337596 2.2795,20.434785 -0.9601,8.100583 -4.13995,15.843563 -7.07234,17.221213 -1.73206,0.81373 -1.83075,0.3578 -1.83149,-8.460073 z m -69.268036,2.283327 c -3.977291,-2.746359 -3.44557,-6.261434 2.439644,-16.127646 4.970535,-8.33282 10.094017,-15.38029 21.43897,-29.489855 6.601357,-8.209992 8.637667,-10.20312 9.579511,-9.376336 0.799394,0.701746 -2.618999,5.390153 -11.474198,15.737111 -16.940162,19.79395 -18.734332,27.221155 -6.575701,27.221155 3.304542,0 6.058837,-0.617002 8.461092,-1.895408 6.360466,-3.38485 18.203678,-11.286415 23.507089,-15.683501 2.848527,-2.361722 5.456729,-4.05036 5.795999,-3.752528 1.04524,0.917548 -4.907057,10.147668 -7.816978,12.121655 -1.511589,1.025416 -5.874113,4.197632 -9.69449,7.049372 -3.820388,2.85174 -8.563965,6.157166 -10.541309,7.345392 -1.977334,1.188224 -4.400156,2.796969 -5.384044,3.574986 -2.248219,1.777799 -11.920783,5.066639 -14.901091,5.066639 -1.232383,0 -3.407898,-0.80597 -4.834494,-1.791036 z M 167.35901,63.639316 c -4.35468,-2.677534 -4.37646,-3.982873 -0.1931,-11.57676 l 3.90554,-7.089571 2.54785,2.658058 c 3.02363,3.154415 6.72598,3.451472 12.70923,1.019721 4.8079,-1.95406 8.30397,-5.194275 11.75211,-10.892036 l 2.61484,-4.320814 -0.49413,3.334678 c -0.73833,4.982504 -10.09007,19.207325 -14.90376,22.669936 -7.26038,5.222576 -13.78694,6.749482 -17.93858,4.196788 z m -32.7125,-5.536491 c -1.89501,-0.888629 -8.4802,-6.332726 -14.63377,-12.09799 -11.53272,-10.804983 -19.30559,-15.591501 -25.31921,-15.591501 -4.300218,0 -9.890682,3.33457 -11.790334,7.032628 -2.74495,5.343604 -3.950075,5.711001 -6.196765,1.88915 -3.156098,-5.368868 -12.746669,-12.378428 -16.936324,-12.378428 -0.628489,0 -6.188212,4.49121 -12.354949,9.980456 -11.483232,10.221671 -16.718945,13.296629 -22.701995,13.33298 -3.490867,0.0212 -7.744061,-2.699113 -10.336357,-6.611093 -1.586521,-2.394192 -1.546221,-2.69169 1.094758,-8.081731 1.508064,-3.077822 3.079193,-6.373792 3.491421,-7.324372 0.652211,-1.50398 0.990788,-1.25829 2.608443,1.8928 1.911186,3.72288 6.321032,7.180923 9.157411,7.180923 4.150835,0 11.504527,-4.724593 21.3988,-13.748293 9.555236,-8.71448 10.829873,-9.58412 14.047538,-9.58412 4.293595,0 9.556372,2.77633 14.656374,7.73182 2.069449,2.0108 3.86226,3.5242 3.984029,3.36311 0.12178,-0.16109 0.945137,-1.31084 1.829667,-2.55499 0.88453,-1.24416 3.685604,-3.3308 6.224606,-4.63699 3.686737,-1.89664 5.463317,-2.29109 8.822097,-1.95876 6.8491,0.67769 15.00978,5.73859 25.22338,15.64246 9.22954,8.949677 17.70147,14.387397 22.41549,14.387397 3.79377,0 9.50175,-3.242454 12.44138,-7.067419 2.42259,-3.152211 2.91825,-3.453173 3.17838,-1.929873 0.1695,0.992615 -1.28406,4.871896 -3.23015,8.620627 -3.35987,6.472087 -6.91202,10.130201 -12.7132,13.092455 -3.04983,1.557333 -10.43785,1.258306 -14.36072,-0.581246 z" + style="opacity:1;fill:#000000;display:inline" /> + style="display:inline"> + d="m 57.534816,196.31319 c 2.448659,-7.38073 7.446723,-16.72109 12.277833,-22.94475 5.710592,-7.35667 7.378339,-9.3856 28.689891,-34.90319 16.87202,-20.20188 19.22296,-23.17964 22.55476,-28.56842 1.5428,-2.49527 3.17766,-4.53686 3.63304,-4.53686 1.18186,0 1.10043,0.30992 -1.63307,6.21531 -1.35357,2.92423 -2.46105,5.64532 -2.46105,6.04685 0,0.40153 -2.97647,4.90375 -6.6144,10.00493 -8.98843,12.60381 -10.76025,14.97182 -13.0823,17.48445 -1.0981,1.18822 -3.8535,4.49366 -6.123108,7.34539 -2.269606,2.85173 -4.587188,5.62332 -5.150194,6.15909 -0.562997,0.53575 -2.795585,3.19769 -4.961309,5.91542 -6.691216,8.39667 -16.095209,19.83397 -17.431654,21.20066 -0.699773,0.71561 -3.044271,3.91702 -5.209995,7.11426 -4.16128,6.14322 -5.795033,7.40513 -4.488444,3.46686 z m 66.481544,-23.7645 c 0.22279,-0.5941 1.5292,-4.28446 2.90315,-8.20081 3.44555,-9.82127 13.66236,-27.15831 19.73886,-33.49506 l 2.48602,-2.59251 2.25191,2.37646 c 2.67739,2.82544 3.88298,2.92759 8.02572,0.68 3.08741,-1.67502 7.69643,-8.22076 20.10229,-28.54928 4.55053,-7.45659 5.01229,-7.939502 5.0346,-5.26516 0.0415,4.9808 -22.21528,41.2544 -29.34472,47.82522 -4.11732,3.7947 -6.18823,4.04757 -8.84718,1.0802 -1.06473,-1.18822 -2.3151,-2.15972 -2.77861,-2.15886 -1.62142,0.003 -12.08302,16.59943 -16.47702,26.13939 -0.82094,1.78235 -1.9443,3.24062 -2.49635,3.24062 -0.55207,0 -0.82147,-0.48609 -0.59867,-1.08021 z m 84.19319,-24.88787 c 0,-7.49007 7.66313,-38.06798 12.33356,-49.21415 3.04458,-7.266013 7.33463,-20.847089 8.32578,-26.35699 0.42748,-2.376449 1.49075,-7.626245 2.36285,-11.666209 0.87207,-4.039964 1.5862,-11.563 1.58694,-16.717855 0.002,-10.935036 -1.20271,-13.589976 -7.10476,-15.663026 -7.62736,-2.67905 -10.16765,-1.47291 -13.00198,6.173428 -1.74243,4.700723 -3.72352,6.856253 -5.44369,5.923006 -1.89626,-1.028794 -1.05403,-4.387566 2.90016,-11.565454 8.13973,-14.77576 14.55936,-18.45654 24.45815,-14.02345 5.65324,2.53175 9.02208,8.60392 9.02208,16.2618 0,9.333563 -7.01946,35.141105 -14.28285,52.511886 -4.47563,10.703728 -11.5668,35.301034 -14.85507,51.528204 -2.1002,10.36421 -3.15113,13.73222 -4.51891,14.48205 -1.5746,0.86323 -1.78226,0.66827 -1.78226,-1.67324 z M 111.73567,93.508133 c -7.1e-4,-8.464568 -0.25892,-9.796146 -2.81265,-14.505144 -2.66535,-4.914782 -7.28206,-9.937882 -9.13385,-9.937882 -0.4676,0 -0.85017,-0.490243 -0.85017,-1.08943 0,-1.557732 8.70129,-12.737188 9.91372,-12.737188 1.73907,0 7.4566,5.456815 9.50728,9.073719 2.60567,4.595744 3.35771,11.337596 2.2795,20.434785 -0.9601,8.100583 -4.13995,15.843567 -7.07234,17.221217 -1.73206,0.81373 -1.83075,0.3578 -1.83149,-8.460077 z M 42.467634,95.79146 c -3.977291,-2.746359 -3.44557,-6.261434 2.439644,-16.127646 4.970535,-8.33282 10.094017,-15.38029 21.43897,-29.489855 6.601357,-8.209992 8.637667,-10.20312 9.579511,-9.376336 0.799394,0.701746 -2.618999,5.390153 -11.474198,15.737111 -16.940162,19.79395 -18.734332,27.221155 -6.575701,27.221155 3.304542,0 6.058837,-0.617002 8.461092,-1.895408 6.360466,-3.38485 18.203678,-11.286415 23.507089,-15.683501 2.848527,-2.361722 5.456729,-4.05036 5.795999,-3.752528 1.04524,0.917548 -4.907057,10.147668 -7.816978,12.121655 -1.511589,1.025416 -5.874113,4.197632 -9.69449,7.049372 -3.820388,2.85174 -8.563965,6.157166 -10.541309,7.345392 -1.977334,1.188224 -4.400156,2.796969 -5.384044,3.574986 C 59.955,94.293656 50.282436,97.5825 47.302128,97.5825 c -1.232383,0 -3.407898,-0.80597 -4.834494,-1.79104 z M 169.05943,62.539562 c -4.35468,-2.677534 -4.37646,-3.982873 -0.1931,-11.57676 l 3.90554,-7.089571 2.54785,2.658058 c 3.02363,3.154415 6.72598,3.451472 12.70923,1.019721 4.8079,-1.95406 8.30397,-5.194275 11.75211,-10.892036 l 2.61484,-4.320814 -0.49413,3.334678 c -0.73833,4.982504 -10.09007,19.207325 -14.90376,22.669936 -7.26038,5.222576 -13.78694,6.749482 -17.93858,4.196788 z m -32.7125,-5.536491 c -1.89501,-0.888629 -8.4802,-6.332726 -14.63377,-12.09799 C 110.18044,34.100098 102.40757,29.31358 96.39395,29.31358 c -4.300218,0 -9.890682,3.33457 -11.790334,7.032628 -2.74495,5.343604 -3.950075,5.711001 -6.196765,1.88915 C 75.250753,32.86649 65.660182,25.85693 61.470527,25.85693 c -0.628489,0 -6.188212,4.49121 -12.354949,9.980456 -11.483232,10.221671 -16.718945,13.296629 -22.701995,13.33298 -3.490867,0.0212 -7.744061,-2.699113 -10.336357,-6.611093 -1.586521,-2.394192 -1.546221,-2.69169 1.094758,-8.081731 1.508064,-3.077822 3.079193,-6.373792 3.491421,-7.324372 0.652211,-1.50398 0.990788,-1.25829 2.608443,1.8928 1.911186,3.72288 6.321032,7.180923 9.157411,7.180923 4.150835,0 11.504527,-4.724593 21.3988,-13.748293 9.555236,-8.71448 10.829873,-9.58412 14.047538,-9.58412 4.293595,0 9.556372,2.77633 14.656374,7.73182 2.069449,2.0108 3.86226,3.5242 3.984029,3.36311 0.12178,-0.16109 0.945137,-1.31084 1.829667,-2.55499 0.88453,-1.24416 3.685604,-3.3308 6.224606,-4.63699 3.686737,-1.89664 5.463317,-2.29109 8.822097,-1.95876 6.8491,0.67769 15.00978,5.73859 25.22338,15.64246 9.22954,8.949677 17.70147,14.387397 22.41549,14.387397 3.79377,0 9.50175,-3.242454 12.44138,-7.067419 2.42259,-3.152211 2.91825,-3.453173 3.17838,-1.929873 0.1695,0.992615 -1.28406,4.871896 -3.23015,8.620627 -3.35987,6.472087 -6.91202,10.130201 -12.7132,13.092455 -3.04983,1.557333 -10.43785,1.258306 -14.36072,-0.581246 z" + style="fill:url(#linearGradient2425);fill-opacity:1;stroke:#000000;stroke-width:0.97730815" /> + ------------------------------------------------------------ revno: 109526 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2012-08-09 09:14:23 +0400 message: Use TSET for write access to Lisp_Object slots of struct terminal. * termhooks.h (TSET): New macro. * coding.c, terminal.c, xselect.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-08 19:53:44 +0000 +++ src/ChangeLog 2012-08-09 05:14:23 +0000 @@ -1,3 +1,9 @@ +2012-08-09 Dmitry Antipov + + Use TSET for write access to Lisp_Object slots of struct terminal. + * termhooks.h (TSET): New macro. + * coding.c, terminal.c, xselect.c: Adjust users. + 2012-08-08 Stefan Monnier * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing === modified file 'src/coding.c' --- src/coding.c 2012-08-01 20:51:44 +0000 +++ src/coding.c 2012-08-09 05:14:23 +0000 @@ -9294,9 +9294,9 @@ terminal_coding->src_multibyte = 1; terminal_coding->dst_multibyte = 0; if (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK) - term->charset_list = coding_charset_list (terminal_coding); + TSET (term, charset_list, coding_charset_list (terminal_coding)); else - term->charset_list = Fcons (make_number (charset_ascii), Qnil); + TSET (term, charset_list, Fcons (make_number (charset_ascii), Qnil)); return Qnil; } === modified file 'src/termhooks.h' --- src/termhooks.h 2012-02-10 18:58:48 +0000 +++ src/termhooks.h 2012-08-09 05:14:23 +0000 @@ -321,6 +321,10 @@ struct x_display_info; struct w32_display_info; +/* Most code should use this macro to set Lisp field in struct terminal. */ + +#define TSET(f, field, value) ((f)->field = (value)) + /* Terminal-local parameters. */ struct terminal { === modified file 'src/terminal.c' --- src/terminal.c 2012-07-05 06:32:41 +0000 +++ src/terminal.c 2012-08-09 05:14:23 +0000 @@ -446,7 +446,7 @@ Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist); if (EQ (old_alist_elt, Qnil)) { - t->param_alist = Fcons (Fcons (parameter, value), t->param_alist); + TSET (t, param_alist, Fcons (Fcons (parameter, value), t->param_alist)); return Qnil; } else === modified file 'src/xselect.c' --- src/xselect.c 2012-08-03 23:36:11 +0000 +++ src/xselect.c 2012-08-09 05:14:23 +0000 @@ -353,8 +353,8 @@ INTEGER_TO_CONS (timestamp), frame); prev_value = LOCAL_SELECTION (selection_name, dpyinfo); - dpyinfo->terminal->Vselection_alist - = Fcons (selection_data, dpyinfo->terminal->Vselection_alist); + TSET (dpyinfo->terminal, Vselection_alist, + Fcons (selection_data, dpyinfo->terminal->Vselection_alist)); /* If we already owned the selection, remove the old selection data. Don't use Fdelq as that may QUIT. */ @@ -989,7 +989,7 @@ break; } } - dpyinfo->terminal->Vselection_alist = Vselection_alist; + TSET (dpyinfo->terminal, Vselection_alist, Vselection_alist); /* Run the `x-lost-selection-functions' abnormal hook. */ { @@ -1039,7 +1039,7 @@ args[1] = Fcar (Fcar (t->Vselection_alist)); Frun_hook_with_args (2, args); - t->Vselection_alist = XCDR (t->Vselection_alist); + TSET (t, Vselection_alist, XCDR (t->Vselection_alist)); } /* Delete elements after the beginning of Vselection_alist. */ ------------------------------------------------------------ revno: 109525 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Thu 2012-08-09 01:08:29 -0300 message: * progmodes/python.el (python-pdbtrack-tracked-buffer) (python-pdbtrack-buffers-to-kill, python-shell-internal-buffer) (python-shell-internal-last-output): Use make-local-variable instead of make-variable-buffer-local. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-09 03:30:37 +0000 +++ lisp/ChangeLog 2012-08-09 04:08:29 +0000 @@ -1,5 +1,12 @@ 2012-08-09 Fabián Ezequiel Gallina + * progmodes/python.el (python-pdbtrack-tracked-buffer) + (python-pdbtrack-buffers-to-kill, python-shell-internal-buffer) + (python-shell-internal-last-output): Use make-local-variable + instead of make-variable-buffer-local. + +2012-08-09 Fabián Ezequiel Gallina + * progmodes/python.el: Enhancements to forward-sexp. (python-nav-forward-sexp): Rename from python-nav-forward-sexp-function. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-08-09 03:30:37 +0000 +++ lisp/progmodes/python.el 2012-08-09 04:08:29 +0000 @@ -1668,6 +1668,9 @@ 'python-shell-completion-complete-at-point) (define-key inferior-python-mode-map "\t" 'python-shell-completion-complete-or-indent) + (make-local-variable 'python-pdbtrack-buffers-to-kill) + (make-local-variable 'python-pdbtrack-tracked-buffer) + (make-local-variable 'python-shell-internal-last-output) (when python-shell-enable-font-lock (set (make-local-variable 'font-lock-defaults) '(python-font-lock-keywords nil nil nil nil)) @@ -1787,13 +1790,11 @@ "Current internal shell buffer for the current buffer. This is really not necessary at all for the code to work but it's there for compatibility with CEDET.") -(make-variable-buffer-local 'python-shell-internal-buffer) (defvar python-shell-internal-last-output nil "Last output captured by the internal shell. This is really not necessary at all for the code to work but it's there for compatibility with CEDET.") -(make-variable-buffer-local 'python-shell-internal-last-output) (defun python-shell-internal-get-or-create-process () "Get or create an inferior Internal Python process." @@ -2135,11 +2136,9 @@ "Variable containing the value of the current tracked buffer. Never set this variable directly, use `python-pdbtrack-set-tracked-buffer' instead.") -(make-variable-buffer-local 'python-pdbtrack-tracked-buffer) (defvar python-pdbtrack-buffers-to-kill nil "List of buffers to be deleted after tracking finishes.") -(make-variable-buffer-local 'python-pdbtrack-buffers-to-kill) (defun python-pdbtrack-set-tracked-buffer (file-name) "Set the buffer for FILE-NAME as the tracked buffer. @@ -3004,6 +3003,8 @@ (python-skeleton-add-menu-items) + (make-local-variable 'python-shell-internal-buffer) + (when python-indent-guess-indent-offset (python-indent-guess-indent-offset))) ------------------------------------------------------------ revno: 109524 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Thu 2012-08-09 00:30:37 -0300 message: * progmodes/python.el: Enhancements to forward-sexp. (python-nav-forward-sexp): Rename from python-nav-forward-sexp-function. (python-nav--forward-sexp, python-nav--backward-sexp): New functions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-09 02:51:58 +0000 +++ lisp/ChangeLog 2012-08-09 03:30:37 +0000 @@ -1,3 +1,11 @@ +2012-08-09 Fabián Ezequiel Gallina + + * progmodes/python.el: Enhancements to forward-sexp. + (python-nav-forward-sexp): Rename from + python-nav-forward-sexp-function. + (python-nav--forward-sexp, python-nav--backward-sexp): New + functions. + 2012-08-09 Jay Belanger * calc/calc-menu.el (calc-modes-menu): Add entries for matrix === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-08-08 02:30:08 +0000 +++ lisp/progmodes/python.el 2012-08-09 03:30:37 +0000 @@ -54,7 +54,7 @@ ;; `python-nav-beginning-of-statement', `python-nav-end-of-statement', ;; `python-nav-beginning-of-block' and `python-nav-end-of-block' are ;; included but no bound to any key. At last but not least the -;; specialized `python-nav-forward-sexp-function' allows easy +;; specialized `python-nav-forward-sexp' allows easy ;; navigation between code blocks. ;; Shell interaction: is provided and allows you to execute easily any @@ -1249,83 +1249,178 @@ (and (goto-char starting-pos) nil) (and (not (= (point) starting-pos)) (point-marker))))) -(defun python-nav-forward-sexp-function (&optional arg) +(defun python-nav-lisp-forward-sexp-safe (&optional arg) + "Safe version of standard `forward-sexp'. +When ARG > 0 move forward, else if ARG is < 0." + (or arg (setq arg 1)) + (let ((forward-sexp-function nil) + (paren-regexp + (if (> arg 0) (python-rx close-paren) (python-rx open-paren))) + (search-fn + (if (> arg 0) #'re-search-forward #'re-search-backward))) + (condition-case nil + (forward-sexp arg) + (error + (while (and (funcall search-fn paren-regexp nil t) + (python-syntax-context 'paren))))))) + +(defun python-nav--forward-sexp () + "Move to forward sexp." + (case (python-syntax-context-type) + (string + ;; Inside of a string, get out of it. + (while (and (re-search-forward "[\"']" nil t) + (python-syntax-context 'string)))) + (comment + ;; Inside of a comment, just move forward. + (python-util-forward-comment)) + (paren + (python-nav-lisp-forward-sexp-safe 1)) + (t + (if (and (not (eobp)) + (= (syntax-class (syntax-after (point))) 4)) + ;; Looking an open-paren + (python-nav-lisp-forward-sexp-safe 1) + (let ((block-starting-pos + (save-excursion (python-nav-beginning-of-block))) + (block-ending-pos + (save-excursion (python-nav-end-of-block))) + (next-block-starting-pos + (save-excursion (python-nav-forward-block)))) + (cond + ((not block-starting-pos) + ;; Not inside a block, move to closest one. + (and next-block-starting-pos + (goto-char next-block-starting-pos))) + ((= (point) block-starting-pos) + ;; Point is at beginning of block + (if (and next-block-starting-pos + (< next-block-starting-pos block-ending-pos)) + ;; Beginning of next block is closer than current's + ;; end, move to it. + (goto-char next-block-starting-pos) + (goto-char block-ending-pos))) + ((= block-ending-pos (point)) + ;; Point is at end of current block + (let ((parent-block-end-pos + (save-excursion + (python-util-forward-comment) + (python-nav-beginning-of-block) + (python-nav-end-of-block)))) + (if (and parent-block-end-pos + (or (not next-block-starting-pos) + (> next-block-starting-pos parent-block-end-pos))) + ;; If the parent block ends before next block + ;; starts move to it. + (goto-char parent-block-end-pos) + (and next-block-starting-pos + (goto-char next-block-starting-pos))))) + (t (python-nav-end-of-block)))))))) + +(defun python-nav--backward-sexp () + "Move to backward sexp." + (case (python-syntax-context-type) + (string + ;; Inside of a string, get out of it. + (while (and (re-search-backward "[\"']" nil t) + (python-syntax-context 'string)))) + (comment + ;; Inside of a comment, just move backward. + (python-util-forward-comment -1)) + (paren + ;; Handle parens like we are lisp. + (python-nav-lisp-forward-sexp-safe -1)) + (t + (let* ((block-starting-pos + (save-excursion (python-nav-beginning-of-block))) + (block-ending-pos + (save-excursion (python-nav-end-of-block))) + (prev-block-ending-pos + (save-excursion (when (python-nav-backward-block) + (python-nav-end-of-block)))) + (prev-block-parent-ending-pos + (save-excursion + (when prev-block-ending-pos + (goto-char prev-block-ending-pos) + (python-util-forward-comment) + (python-nav-beginning-of-block) + (python-nav-end-of-block))))) + (if (and (not (bobp)) + (= (syntax-class (syntax-after (1- (point)))) 5)) + ;; Char before point is a paren closing char, handle it + ;; like we are lisp. + (python-nav-lisp-forward-sexp-safe -1) + (cond + ((not block-ending-pos) + ;; Not in and ending pos, move to end of previous block. + (and (python-nav-backward-block) + (python-nav-end-of-block))) + ((= (point) block-ending-pos) + ;; In ending pos, we need to search backwards for the + ;; closest point looking the list of candidates from here. + (let ((candidates)) + (dolist (name + '(prev-block-parent-ending-pos + prev-block-ending-pos + block-ending-pos + block-starting-pos)) + (when (and (symbol-value name) + (< (symbol-value name) (point))) + (add-to-list 'candidates (symbol-value name)))) + (goto-char (apply 'max candidates)))) + ((> (point) block-ending-pos) + ;; After an ending position, move to it. + (goto-char block-ending-pos)) + ((= (point) block-starting-pos) + ;; On a block starting position. + (if (not (> (point) (or prev-block-ending-pos (point)))) + ;; Point is after the end position of the block that + ;; wraps the current one, just move a block backward. + (python-nav-backward-block) + ;; If we got here we are facing a case like this one: + ;; + ;; try: + ;; return here() + ;; except Exception as e: + ;; + ;; Where point is on the "except" and must move to the + ;; end of "here()". + (goto-char prev-block-ending-pos) + (let ((parent-block-ending-pos + (save-excursion + (python-nav-forward-sexp) + (and (not (looking-at (python-rx block-start))) + (point))))) + (when (and parent-block-ending-pos + (> parent-block-ending-pos prev-block-ending-pos)) + ;; If we got here we are facing a case like this one: + ;; + ;; except ImportError: + ;; if predicate(): + ;; processing() + ;; here() + ;; except AttributeError: + ;; + ;; Where point is on the "except" and must move to + ;; the end of "here()". Without this extra step we'd + ;; just get to the end of processing(). + (goto-char parent-block-ending-pos))))) + (t + (if (and prev-block-ending-pos (< prev-block-ending-pos (point))) + (goto-char prev-block-ending-pos) + (python-nav-beginning-of-block))))))))) + +(defun python-nav-forward-sexp (&optional arg) "Move forward across one block of code. With ARG, do it that many times. Negative arg -N means move backward N times." (interactive "^p") (or arg (setq arg 1)) (while (> arg 0) - (let ((block-starting-pos - (save-excursion (python-nav-beginning-of-block))) - (block-ending-pos - (save-excursion (python-nav-end-of-block))) - (next-block-starting-pos - (save-excursion (python-nav-forward-block)))) - (cond ((not block-starting-pos) - (python-nav-forward-block)) - ((= (point) block-starting-pos) - (if (or (not next-block-starting-pos) - (< block-ending-pos next-block-starting-pos)) - (python-nav-end-of-block) - (python-nav-forward-block))) - ((= block-ending-pos (point)) - (let ((parent-block-end-pos - (save-excursion - (python-util-forward-comment) - (python-nav-beginning-of-block) - (python-nav-end-of-block)))) - (if (and parent-block-end-pos - (or (not next-block-starting-pos) - (> next-block-starting-pos parent-block-end-pos))) - (goto-char parent-block-end-pos) - (python-nav-forward-block)))) - (t (python-nav-end-of-block)))) - (setq arg (1- arg))) + (python-nav--forward-sexp) + (setq arg (1- arg))) (while (< arg 0) - (let* ((block-starting-pos - (save-excursion (python-nav-beginning-of-block))) - (block-ending-pos - (save-excursion (python-nav-end-of-block))) - (prev-block-ending-pos - (save-excursion (when (python-nav-backward-block) - (python-nav-end-of-block)))) - (prev-block-parent-ending-pos - (save-excursion - (when prev-block-ending-pos - (goto-char prev-block-ending-pos) - (python-util-forward-comment) - (python-nav-beginning-of-block) - (python-nav-end-of-block))))) - (cond ((not block-ending-pos) - (and (python-nav-backward-block) - (python-nav-end-of-block))) - ((= (point) block-ending-pos) - (let ((candidates)) - (dolist (name - '(prev-block-parent-ending-pos - prev-block-ending-pos - block-ending-pos - block-starting-pos)) - (when (and (symbol-value name) - (< (symbol-value name) (point))) - (add-to-list 'candidates (symbol-value name)))) - (goto-char (apply 'max candidates)))) - ((> (point) block-ending-pos) - (python-nav-end-of-block)) - ((= (point) block-starting-pos) - (if (not (> (point) (or prev-block-ending-pos (point)))) - (python-nav-backward-block) - (goto-char prev-block-ending-pos) - (let ((parent-block-ending-pos - (save-excursion - (python-nav-forward-sexp-function) - (and (not (looking-at (python-rx block-start))) - (point))))) - (when (and parent-block-ending-pos - (> parent-block-ending-pos prev-block-ending-pos)) - (goto-char parent-block-ending-pos))))) - (t (python-nav-beginning-of-block)))) + (python-nav--backward-sexp) (setq arg (1+ arg)))) @@ -2848,7 +2943,7 @@ (set (make-local-variable 'parse-sexp-ignore-comments) t) (set (make-local-variable 'forward-sexp-function) - 'python-nav-forward-sexp-function) + 'python-nav-forward-sexp) (set (make-local-variable 'font-lock-defaults) '(python-font-lock-keywords nil nil nil nil)) ------------------------------------------------------------ revno: 109523 committer: Jay Belanger branch nick: trunk timestamp: Wed 2012-08-08 22:19:34 -0500 message: calc/calc-menu.el (calc-modes-menu): Fix menu item. diff: === modified file 'lisp/calc/calc-menu.el' --- lisp/calc/calc-menu.el 2012-08-09 02:51:58 +0000 +++ lisp/calc/calc-menu.el 2012-08-09 03:19:34 +0000 @@ -1501,7 +1501,7 @@ :style radio :selected (and (integerp calc-matrix-mode) (> calc-matrix-mode 0)) :help "Variables are assumed to be NxN matrices"] - ["Scalar" + ["Scalar mode" (progn (require 'calc-mode) (calc-matrix-mode 0)) ------------------------------------------------------------ revno: 109522 committer: Jay Belanger branch nick: trunk timestamp: Wed 2012-08-08 21:51:58 -0500 message: calc-menu.el (calc-modes-menu): Add entries for matrix modes and simplification modes. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-09 02:18:50 +0000 +++ lisp/ChangeLog 2012-08-09 02:51:58 +0000 @@ -1,3 +1,8 @@ +2012-08-09 Jay Belanger + + * calc/calc-menu.el (calc-modes-menu): Add entries for matrix + modes and simplification modes. + 2012-08-09 Stefan Monnier * delsel.el (delete-selection-pre-hook): Don't propagate the === modified file 'lisp/calc/calc-menu.el' --- lisp/calc/calc-menu.el 2012-01-19 07:21:25 +0000 +++ lisp/calc/calc-menu.el 2012-08-09 02:51:58 +0000 @@ -1201,6 +1201,63 @@ :keys "v ." :style toggle :selected (not calc-full-vectors)] + (list "Simplification" + ["No simplification mode" + (progn + (require 'calc-mode) + (calc-no-simplify-mode t)) + :keys "m O" + :style radio + :selected (eq calc-simplify-mode 'none) + :help "No simplifications are done automatically"] + ["Numeric simplification mode" + (progn + (require 'calc-mode) + (calc-num-simplify-mode t)) + :keys "m N" + :style radio + :selected (eq calc-simplify-mode 'num) + :help "Only numeric simplifications are done automatically"] + ["Basic simplification mode" + (progn + (require 'calc-mode) + (calc-basic-simplify-mode t)) + :keys "m I" + :style radio + :selected (eq calc-simplify-mode nil) + :help "Only basic simplifications are done automatically"] + ["Binary simplification mode" + (progn + (require 'calc-mode) + (calc-bin-simplify-mode t)) + :keys "m B" + :style radio + :selected (eq calc-simplify-mode 'binary) + :help "Basic simplifications with binary clipping are done automatically"] + ["Algebraic simplification mode" + (progn + (require 'calc-mode) + (calc-alg-simplify-mode t)) + :keys "m A" + :style radio + :selected (eq calc-simplify-mode 'alg) + :help "Standard algebraic simplifications are done automatically"] + ["Extended simplification mode" + (progn + (require 'calc-mode) + (calc-ext-simplify-mode t)) + :keys "m E" + :style radio + :selected (eq calc-simplify-mode 'ext) + :help "Extended (unsafe) simplifications are done automatically"] + ["Units simplification mode" + (progn + (require 'calc-mode) + (calc-units-simplify-mode t)) + :keys "m U" + :style radio + :selected (eq calc-simplify-mode 'units) + :help "Algebraic and unit simplifications are done automatically"]) (list "Angle Measure" ["Radians" (progn @@ -1412,6 +1469,45 @@ :style radio :selected (eq calc-algebraic-mode 'total) :help "All regular letters and punctuation begin algebraic entry"]) + (list "Matrix" + ["Off" + (progn + (require 'calc-mode) + (calc-matrix-mode -1)) + :style radio + :selected (eq calc-matrix-mode nil) + :help "Variables are not assumed to be matrix or scalar"] + ["Matrix mode" + (progn + (require 'calc-mode) + (calc-matrix-mode -2)) + :style radio + :selected (eq calc-matrix-mode 'matrix) + :help "Variables are assumed to be matrices"] + ["Square matrix mode" + (progn + (require 'calc-mode) + (calc-matrix-mode '(4))) + :style radio + :selected (eq calc-matrix-mode 'sqmatrix) + :help "Variables are assumed to be square matrices"] + ["Dimensioned matrix mode" + (let ((dim (string-to-number (read-from-minibuffer "Dimension: ")))) + (if (natnump dim) + (progn + (require 'calc-mode) + (calc-matrix-mode dim)) + (error "The dimension must be a positive integer"))) + :style radio + :selected (and (integerp calc-matrix-mode) (> calc-matrix-mode 0)) + :help "Variables are assumed to be NxN matrices"] + ["Scalar" + (progn + (require 'calc-mode) + (calc-matrix-mode 0)) + :style radio + :selected (eq calc-matrix-mode 'scalar) + :help "Variables are assumed to be scalars"]) (list "Language" ["Normal" (progn ------------------------------------------------------------ revno: 109521 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12161 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-08-08 22:18:50 -0400 message: * lisp/delsel.el (delete-selection-pre-hook): Don't propagate the file-supersession signals. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-08 18:56:01 +0000 +++ lisp/ChangeLog 2012-08-09 02:18:50 +0000 @@ -1,3 +1,8 @@ +2012-08-09 Stefan Monnier + + * delsel.el (delete-selection-pre-hook): Don't propagate the + file-supersession signals (bug#12161). + 2012-08-08 Stefan Monnier * emacs-lisp/cl.el (cl-map-keymap-recursively, cl-map-intervals) === modified file 'lisp/delsel.el' --- lisp/delsel.el 2012-01-19 07:21:25 +0000 +++ lisp/delsel.el 2012-08-09 02:18:50 +0000 @@ -89,7 +89,8 @@ ;; head of the kill-ring that really comes from the ;; currently active region we are going to delete. ;; That would make yank a no-op. - (when (and (string= (buffer-substring-no-properties (point) (mark)) + (when (and (string= (buffer-substring-no-properties + (point) (mark)) (car kill-ring)) (fboundp 'mouse-region-match) (mouse-region-match)) @@ -102,16 +103,15 @@ (setq this-command 'ignore)))) (type (delete-active-region) - (if (and overwrite-mode (eq this-command 'self-insert-command)) + (if (and overwrite-mode + (eq this-command 'self-insert-command)) (let ((overwrite-mode nil)) - (self-insert-command (prefix-numeric-value current-prefix-arg)) + (self-insert-command + (prefix-numeric-value current-prefix-arg)) (setq this-command 'ignore))))) - (file-supersession ;; If ask-user-about-supersession-threat signals an error, ;; stop safe_run_hooks from clearing out pre-command-hook. - (and (eq inhibit-quit 'pre-command-hook) - (setq inhibit-quit 'delete-selection-dummy)) - (signal 'file-supersession (cdr data))) + (file-supersession (message "%s" (cadr data)) (ding)) (text-read-only ;; This signal may come either from `delete-active-region' or ;; `self-insert-command' (when `overwrite-mode' is non-nil). ------------------------------------------------------------ revno: 109520 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-08-08 15:53:44 -0400 message: * src/xdisp.c (safe_eval_handler): Remove prototype. Receive args describing the failing expression, include them in the error message. * src/eval.c (internal_condition_case_n): Pass nargs and args to hfun. * src/lisp.h (internal_condition_case_n): Update declaration. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-08 14:47:11 +0000 +++ src/ChangeLog 2012-08-08 19:53:44 +0000 @@ -1,3 +1,10 @@ +2012-08-08 Stefan Monnier + + * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing + the failing expression, include them in the error message. + * eval.c (internal_condition_case_n): Pass nargs and args to hfun. + * lisp.h (internal_condition_case_n): Update declaration. + 2012-08-08 Dmitry Antipov Inline functions to examine and change buffer overlays. === modified file 'src/eval.c' --- src/eval.c 2012-08-07 13:37:21 +0000 +++ src/eval.c 2012-08-08 19:53:44 +0000 @@ -1399,7 +1399,9 @@ ptrdiff_t nargs, Lisp_Object *args, Lisp_Object handlers, - Lisp_Object (*hfun) (Lisp_Object)) + Lisp_Object (*hfun) (Lisp_Object err, + ptrdiff_t nargs, + Lisp_Object *args)) { Lisp_Object val; struct catchtag c; @@ -1417,7 +1419,7 @@ c.byte_stack = byte_stack_list; if (_setjmp (c.jmp)) { - return (*hfun) (c.val); + return (*hfun) (c.val, nargs, args); } c.next = catchlist; catchlist = &c; === modified file 'src/lisp.h' --- src/lisp.h 2012-08-08 10:23:04 +0000 +++ src/lisp.h 2012-08-08 19:53:44 +0000 @@ -2952,7 +2952,9 @@ extern Lisp_Object internal_condition_case (Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object)); extern Lisp_Object internal_condition_case_1 (Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)); extern Lisp_Object internal_condition_case_2 (Lisp_Object (*) (Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)); -extern Lisp_Object internal_condition_case_n (Lisp_Object (*) (ptrdiff_t, Lisp_Object *), ptrdiff_t, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object)); +extern Lisp_Object internal_condition_case_n + (Lisp_Object (*) (ptrdiff_t, Lisp_Object *), ptrdiff_t, Lisp_Object *, + Lisp_Object, Lisp_Object (*) (Lisp_Object, ptrdiff_t, Lisp_Object *)); extern void specbind (Lisp_Object, Lisp_Object); extern void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object); extern Lisp_Object unbind_to (ptrdiff_t, Lisp_Object); === modified file 'src/w32term.c' --- src/w32term.c 2012-08-07 07:33:18 +0000 +++ src/w32term.c 2012-08-08 19:53:44 +0000 @@ -5493,7 +5493,7 @@ /* Check if we need to resize the frame due to a fullscreen request. - If so needed, resize the frame. */ + If so needed, resize the frame. */ static void x_check_fullscreen (struct frame *f) { @@ -5513,7 +5513,7 @@ SET_FRAME_GARBAGED (f); cancel_mouse_face (f); - /* Wait for the change of frame size to occur */ + /* Wait for the change of frame size to occur. */ f->want_fullscreen |= FULLSCREEN_WAIT; } } === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-08 14:47:11 +0000 +++ src/xdisp.c 2012-08-08 19:53:44 +0000 @@ -838,7 +838,6 @@ static struct text_pos display_prop_end (struct it *, Lisp_Object, struct text_pos); static int compute_window_start_on_continuation_line (struct window *); -static Lisp_Object safe_eval_handler (Lisp_Object); static void insert_left_trunc_glyphs (struct it *); static struct glyph_row *get_overlay_arrow_glyph_row (struct window *, Lisp_Object); @@ -2397,9 +2396,10 @@ /* Error handler for safe_eval and safe_call. */ static Lisp_Object -safe_eval_handler (Lisp_Object arg) +safe_eval_handler (Lisp_Object arg, ptrdiff_t nargs, Lisp_Object *args) { - add_to_log ("Error during redisplay: %S", arg, Qnil); + add_to_log ("Error during redisplay: %S signalled %S", + Flist (nargs, args), arg); return Qnil; } ------------------------------------------------------------ revno: 109519 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12135 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-08-08 14:56:01 -0400 message: * lisp/emacs-lisp/cl.el (cl-map-keymap-recursively, cl-map-intervals) (cl-map-extents): Add compatibility aliases. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-08 15:47:21 +0000 +++ lisp/ChangeLog 2012-08-08 18:56:01 +0000 @@ -1,3 +1,8 @@ +2012-08-08 Stefan Monnier + + * emacs-lisp/cl.el (cl-map-keymap-recursively, cl-map-intervals) + (cl-map-extents): Add compatibility aliases (bug#12135). + 2012-08-08 Michael Albinus * net/tramp-sh.el (tramp-find-file-exists-command): Protect the @@ -62,8 +67,8 @@ * emacs-lisp/lisp-mode.el (eval-defun-1): Handle standard value of a defcustom that is quoted with backquote. - * calc/calc-prog.el (math-do-defmath): Use backquote forms. Fix - handling of interactive spec when the body uses return. + * calc/calc-prog.el (math-do-defmath): Use backquote forms. + Fix handling of interactive spec when the body uses return. (math-do-arg-check, math-define-function-body): Use backquote forms. * calc/calc-ext.el (math-defcache): Likewise. * calc/calc-rewr.el (math-rwfail, math-rweval): Likewise. @@ -75,8 +80,8 @@ * menu-bar.el (menu-bar-make-mm-toggle, menu-bar-make-toggle): Construct menu-item directly. - * progmodes/autoconf.el (font-lock-syntactic-keywords): Don't - declare. + * progmodes/autoconf.el (font-lock-syntactic-keywords): + Don't declare. 2012-08-07 Chong Yidong @@ -142,8 +147,8 @@ * proced.el (proced): Add substitution string to docstring to trigger autoloading of the proced library on C-h f (Bug#1768). - * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Don't - show defvars which have no second argument (Bug#8638). + * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): + Don't show defvars which have no second argument (Bug#8638). * imenu.el (imenu-generic-expression): Move documentation here from imenu--generic-function. @@ -221,8 +226,8 @@ * files.el (file-truename): Don't skip symlink-chasing part on windows-nt. Incorporate the resolution of 8+3 short aliases on - Windows into the loop that recursively chases symlinks. Compare - directory and its parent case-insensitively on MS-Windows and + Windows into the loop that recursively chases symlinks. + Compare directory and its parent case-insensitively on MS-Windows and MS-DOS. 2012-08-03 Chong Yidong @@ -500,7 +505,7 @@ 2012-07-27 Fabián Ezequiel Gallina - * progmodes/python.el (python-mode-map): Added keybinding for + * progmodes/python.el (python-mode-map): Add keybinding for run-python. (python-shell-make-comint): Fix pop-to-buffer call. (run-python): Autoload. New arg SHOW. @@ -516,8 +521,8 @@ 2012-07-27 Tassilo Horn - * textmodes/reftex-vars.el (reftex-label-alist-builtin): Add - support for the lstlisting and minted environments, and for the + * textmodes/reftex-vars.el (reftex-label-alist-builtin): + Add support for the lstlisting and minted environments, and for the ctable macro. * textmodes/reftex.el (reftex-compile-variables): Also recognize labels written in keyvals syntax. @@ -532,8 +537,8 @@ * makefile.w32-in ($(lisp)/calendar/cal-loaddefs.el) ($(lisp)/calendar/diary-loaddefs.el) ($(lisp)/calendar/hol-loaddefs.el, $(lisp)/mh-e/mh-loaddefs.el) - ($(lisp)/net/tramp-loaddefs.el): Depend on update-subdirs. Fixes - failures in parallel bootstrap because subdirs.el is being + ($(lisp)/net/tramp-loaddefs.el): Depend on update-subdirs. + Fixes failures in parallel bootstrap because subdirs.el is being rewritten while the autoload files are built at the same time, which needs to load subdirs.el. === modified file 'lisp/emacs-lisp/cl.el' --- lisp/emacs-lisp/cl.el 2012-07-26 01:27:33 +0000 +++ lisp/emacs-lisp/cl.el 2012-08-08 18:56:01 +0000 @@ -686,6 +686,11 @@ (define-obsolete-function-alias 'cl-hash-table-p 'hash-table-p "24.2") (define-obsolete-function-alias 'cl-hash-table-count 'hash-table-count "24.2") +(define-obsolete-function-alias 'cl-map-keymap-recursively + 'cl--map-keymap-recursively "24.2") +(define-obsolete-function-alias 'cl-map-intervals 'cl--map-intervals "24.2") +(define-obsolete-function-alias 'cl-map-extents 'cl--map-overlays "24.2") + (defun cl-maclisp-member (item list) (declare (obsolete member "24.2")) (while (and list (not (equal item (car list)))) (setq list (cdr list))) === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2012-08-07 21:52:54 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2012-08-08 18:56:01 +0000 @@ -776,9 +776,12 @@ (default-boundp (eval (nth 1 form) lexical-binding))) ;; Force variable to be bound. (set-default (eval (nth 1 form) lexical-binding) - ;; The value may be quoted with quote or backquote. - (eval (eval (nth 2 form) lexical-binding) - lexical-binding)) + ;; The second arg is an expression that evaluates to + ;; an expression. The second evaluation is the one + ;; normally performed not be normal execution but by + ;; custom-initialize-set (for example), which does not + ;; use lexical-binding. + (eval (eval (nth 2 form) lexical-binding))) form) ;; `defface' is macroexpanded to `custom-declare-face'. ((eq (car form) 'custom-declare-face) ------------------------------------------------------------ revno: 109518 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-08-08 20:17:15 +0400 message: Fix and document recently introduced configuration options. * configure.ac (--disable-features): Rename to --without-all. (OPTION_DEFAULT_ON): Change to use with_features. * INSTALL: Fix description. * etc/NEWS: Mention --without-all and --enable-link-time-optimization. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-07 04:16:47 +0000 +++ ChangeLog 2012-08-08 16:17:15 +0000 @@ -1,3 +1,9 @@ +2012-08-08 Dmitry Antipov + + * configure.ac (--disable-features): Rename to --without-all. + (OPTION_DEFAULT_ON): Change to use with_features. + * INSTALL: Fix description. + 2012-08-07 Dmitry Antipov * configure.ac: New option --disable-features. === modified file 'INSTALL' --- INSTALL 2012-08-07 06:56:08 +0000 +++ INSTALL 2012-08-08 16:17:15 +0000 @@ -319,19 +319,21 @@ Use --without-sound to disable sound support. -Use --disable-features if you want to build a small executable with -the minimal dependencies on external libraries, at the cost -of disabling most of the features that are normally enabled by default. -Using --disable-features is equivalent to: --without-sound --without-dbus ---without-libotf --without-selinux --without-xft --without-gsettings ---without-gnutls --without-rsvg --without-xml2 --without-gconf ---without-imagemagick --without-m17n-flt --without-jpeg --without-tiff ---without-gif --without-png --without-gpm. Note that --disable-features -leaves X support enabled, and using the GTK2 or GTK3 toolkit creates a lot -of library dependencies. So if you want to build a small executable with -very basic X support, use --disable-features --with-x-toolkit=no. -For the smallest possible executable without X, use --disable-features ---without-x. +Use --without-all if you want to build a small executable with the minimal +dependencies on external libraries, at the cost of disabling most of the +features that are normally enabled by default. Using --without-all is +equivalent to --without-sound --without-dbus --without-libotf +--without-selinux --without-xft --without-gsettings --without-gnutls +--without-rsvg --without-xml2 --without-gconf --without-imagemagick +--without-m17n-flt --without-jpeg --without-tiff --without-gif +--without-png --without-gpm. Note that --without-all leaves X support +enabled, and using the GTK2 or GTK3 toolkit creates a lot of library +dependencies. So if you want to build a small executable with very basic +X support, use --without-all --with-x-toolkit=no. For the smallest possible +executable without X, use --without-all --without-x. If you want to build +with just a few features enabled, you can combine --without-all with +--with-FEATURE. For example, you can use --without-all --with-dbus +to build with DBus support and nothing more. Use --with-wide-int to implement Emacs values with the type 'long long', even on hosts where a narrower type would do. With this option, on a === modified file 'configure.ac' --- configure.ac 2012-08-08 16:01:28 +0000 +++ configure.ac 2012-08-08 16:17:15 +0000 @@ -48,13 +48,13 @@ docdir='${datadir}/emacs/${version}/etc' gamedir='${localstatedir}/games/emacs' -dnl Do not omit a lot of the nice features by default. -AC_ARG_ENABLE(features, -[AS_HELP_STRING([--disable-features], +dnl Special option to disable the most of other options. +AC_ARG_WITH(all, +[AS_HELP_STRING([--without-all], [omit almost all features and build small executable with minimal dependencies])], - enable_features=$enableval, - enable_features=yes) + with_features=$withval, + with_features=yes) dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING) dnl Create a new --with option that defaults to being disabled. @@ -80,7 +80,7 @@ dnl HELP-STRING is the help text for the option. AC_DEFUN([OPTION_DEFAULT_ON], [dnl AC_ARG_WITH([$1],[AS_HELP_STRING([--without-$1],[$2])],[],[dnl - m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=$enable_features])dnl + m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=$with_features])dnl ])dnl OPTION_DEFAULT_ON([pop],[don't support POP mail retrieval with movemail]) === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-07-31 19:23:33 +0000 +++ etc/ChangeLog 2012-08-08 16:17:15 +0000 @@ -1,3 +1,7 @@ +2012-08-08 Dmitry Antipov + + * NEWS: Mention --without-all and --enable-link-time-optimization. + 2012-07-31 Jan Djärv * TODO (NS port): Add text about event loop. === modified file 'etc/NEWS' --- etc/NEWS 2012-08-08 07:19:58 +0000 +++ etc/NEWS 2012-08-08 16:17:15 +0000 @@ -23,6 +23,12 @@ * Installation Changes in Emacs 24.2 +** New configure option '--without-all' to disable additonal features. +This disables most of the features that are normally enabled by default. + +** New configure option '--enable-link-time-optimization' to utilize +an appropriate feature provided by GCC since version 4.5.0. + ** New configure option '--enable-gcc-warnings', intended for developers. If building with GCC, this enables compile-time checks that warn about possibly-questionable C code. On a recent GNU system there should be ------------------------------------------------------------ revno: 109517 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-08-08 09:07:24 -0700 message: Remove reference to src/s file diff: === modified file 'etc/PROBLEMS' --- etc/PROBLEMS 2012-07-31 06:58:54 +0000 +++ etc/PROBLEMS 2012-08-08 16:07:24 +0000 @@ -443,8 +443,8 @@ #define LIBS_SYSTEM -lresolv Then if this gives you an error for redefining a macro, and you see that -the s- file defines LIBS_SYSTEM as -lfoo -lbar, you could change config.h -again to say this: +config.h already defines LIBS_SYSTEM as -lfoo -lbar at some other point +(possibly in an included file) you could change it to say this: #define LIBS_SYSTEM -lresolv -lfoo -lbar ------------------------------------------------------------ revno: 109516 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-08-08 09:03:04 -0700 message: Refill comment diff: === modified file 'lib-src/movemail.c' --- lib-src/movemail.c 2012-08-08 16:01:28 +0000 +++ lib-src/movemail.c 2012-08-08 16:03:04 +0000 @@ -290,14 +290,13 @@ On systems that use a lock file, extracting the mail without locking WILL occasionally cause loss of mail due to timing errors! - So, if creation of the lock file fails - due to access permission on the mail spool directory, - you simply MUST change the permission - and/or make movemail a setgid program + So, if creation of the lock file fails due to access + permission on the mail spool directory, you simply MUST + change the permission and/or make movemail a setgid program so it can create lock files properly. - You might also wish to verify that your system is one - which uses lock files for this purpose. Some systems use other methods. + You might also wish to verify that your system is one which + uses lock files for this purpose. Some systems use other methods. If your system uses the `flock' system call for mail locking, define MAIL_USE_SYSTEM_LOCK in config.h and recompile movemail. ------------------------------------------------------------ revno: 109515 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-08-08 09:01:28 -0700 message: Comments diff: === modified file 'configure.ac' --- configure.ac 2012-08-07 04:16:47 +0000 +++ configure.ac 2012-08-08 16:01:28 +0000 @@ -2709,6 +2709,9 @@ ;; esac +dnl FIXME? If using FLOCK, also define MAIL_USE_SYSTEM_LOCK? +dnl Only win32 seems to use that. +dnl See comments in lib-src/movemail.c. BLESSMAIL_TARGET= case "$mail_lock" in flock) AC_DEFINE(MAIL_USE_FLOCK, 1, [Define if the mailer uses flock to interlock the mail spool.]) ;; === modified file 'lib-src/movemail.c' --- lib-src/movemail.c 2012-08-02 04:14:48 +0000 +++ lib-src/movemail.c 2012-08-08 16:01:28 +0000 @@ -300,10 +300,10 @@ which uses lock files for this purpose. Some systems use other methods. If your system uses the `flock' system call for mail locking, - define MAIL_USE_SYSTEM_LOCK in config.h or the s-*.h file - and recompile movemail. If the s- file for your system - should define MAIL_USE_SYSTEM_LOCK but does not, send a bug report - to bug-gnu-emacs@prep.ai.mit.edu so we can fix it. */ + define MAIL_USE_SYSTEM_LOCK in config.h and recompile movemail. + If your system type should always define MAIL_USE_SYSTEM_LOCK + but does not, send a bug report to bug-gnu-emacs@gnu.org so we + can change the default in configure. */ inname_len = strlen (inname); lockname = xmalloc (inname_len + sizeof ".lock"); ------------------------------------------------------------ revno: 109514 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-08-08 08:53:52 -0700 message: Tiny comment updates diff: === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-07 13:37:21 +0000 +++ src/keyboard.c 2012-08-08 15:53:52 +0000 @@ -392,7 +392,7 @@ /* Nonzero while interrupts are temporarily deferred during redisplay. */ int interrupts_deferred; -/* Allow m- file to inhibit use of FIONREAD. */ +/* Allow configure to inhibit use of FIONREAD. */ #ifdef BROKEN_FIONREAD #undef FIONREAD #endif === modified file 'src/systty.h' --- src/systty.h 2012-01-19 07:21:25 +0000 +++ src/systty.h 2012-08-08 15:53:52 +0000 @@ -41,7 +41,7 @@ /* Special cases - inhibiting the use of certain features. */ -/* Allow m- file to inhibit use of FIONREAD. */ +/* Allow configure to inhibit use of FIONREAD. */ #ifdef BROKEN_FIONREAD #undef FIONREAD #undef ASYNC ------------------------------------------------------------ revno: 109513 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-08-08 08:47:21 -0700 message: ChangeLog fix diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-08 13:40:45 +0000 +++ lisp/ChangeLog 2012-08-08 15:47:21 +0000 @@ -37,7 +37,7 @@ 2012-08-08 Glenn Morris * language/persian.el: Remove file. - * language/misc-lang.el: Move non-unique part of persian.el here. + * language/misc-lang.el: Move unique part of persian.el here. * loadup.el: Remove language/persian. 2012-08-08 Óscar Fuentes ------------------------------------------------------------ revno: 109512 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-08-08 18:47:11 +0400 message: Inline functions to examine and change buffer overlays. * buffer.c (unchain_both): New function. * buffer.h (buffer_get_overlays, buffer_set_overlays): (buffer_has_overlays): New function. (enum overlay_type): New enum. * alloc.c, buffer.c, editfns.c, fileio.c, indent.c: * insdel.c, intervals.c, print.c, xdisp.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-08 12:12:40 +0000 +++ src/ChangeLog 2012-08-08 14:47:11 +0000 @@ -1,5 +1,15 @@ 2012-08-08 Dmitry Antipov + Inline functions to examine and change buffer overlays. + * buffer.c (unchain_both): New function. + * buffer.h (buffer_get_overlays, buffer_set_overlays): + (buffer_has_overlays): New function. + (enum overlay_type): New enum. + * alloc.c, buffer.c, editfns.c, fileio.c, indent.c: + * insdel.c, intervals.c, print.c, xdisp.c: Adjust users. + +2012-08-08 Dmitry Antipov + Inline functions to examine and change buffer intervals. * alloc.c (mark_interval_tree): Remove. (MARK_INTERVAL_TREE): Simplify. === modified file 'src/alloc.c' --- src/alloc.c 2012-08-08 12:12:40 +0000 +++ src/alloc.c 2012-08-08 14:47:11 +0000 @@ -5831,8 +5831,8 @@ a special way just before the sweep phase, and after stripping some of its elements that are not needed any more. */ - mark_overlay (buffer->overlays_before); - mark_overlay (buffer->overlays_after); + mark_overlay (buffer_get_overlays (buffer, OV_BEFORE)); + mark_overlay (buffer_get_overlays (buffer, OV_AFTER)); /* If this is an indirect buffer, mark its base buffer. */ if (buffer->base_buffer && !VECTOR_MARKED_P (buffer->base_buffer)) === modified file 'src/buffer.c' --- src/buffer.c 2012-08-08 12:12:40 +0000 +++ src/buffer.c 2012-08-08 14:47:11 +0000 @@ -474,8 +474,10 @@ memcpy (to->local_flags, from->local_flags, sizeof to->local_flags); - to->overlays_before = copy_overlays (to, from->overlays_before); - to->overlays_after = copy_overlays (to, from->overlays_after); + buffer_set_overlays + (to, copy_overlays (to, buffer_get_overlays (from, OV_BEFORE)), OV_BEFORE); + buffer_set_overlays + (to, copy_overlays (to, buffer_get_overlays (from, OV_AFTER)), OV_AFTER); /* Get (a copy of) the alist of Lisp-level local variables of FROM and install that in TO. */ @@ -674,21 +676,22 @@ { struct Lisp_Overlay *ov, *next; - for (ov = b->overlays_before; ov; ov = next) - { - drop_overlay (b, ov); - next = ov->next; - ov->next = NULL; - } - - for (ov = b->overlays_after; ov; ov = next) - { - drop_overlay (b, ov); - next = ov->next; - ov->next = NULL; - } - - b->overlays_before = b->overlays_after = NULL; + for (ov = buffer_get_overlays (b, OV_BEFORE); ov; ov = next) + { + drop_overlay (b, ov); + next = ov->next; + ov->next = NULL; + } + + for (ov = buffer_get_overlays (b, OV_AFTER); ov; ov = next) + { + drop_overlay (b, ov); + next = ov->next; + ov->next = NULL; + } + + buffer_set_overlays (b, NULL, OV_BEFORE); + buffer_set_overlays (b, NULL, OV_AFTER); } /* Reinitialize everything about a buffer except its name and contents @@ -716,8 +719,8 @@ b->auto_save_failure_time = 0; BVAR (b, auto_save_file_name) = Qnil; BVAR (b, read_only) = Qnil; - b->overlays_before = NULL; - b->overlays_after = NULL; + buffer_set_overlays (b, NULL, OV_BEFORE); + buffer_set_overlays (b, NULL, OV_AFTER); b->overlay_center = BEG; BVAR (b, mark_active) = Qnil; BVAR (b, point_before_scroll) = Qnil; @@ -2602,7 +2605,7 @@ ptrdiff_t prev = BEGV; int inhibit_storing = 0; - for (tail = current_buffer->overlays_before; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) { ptrdiff_t startpos, endpos; @@ -2650,7 +2653,7 @@ next = startpos; } - for (tail = current_buffer->overlays_after; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) { ptrdiff_t startpos, endpos; @@ -2737,7 +2740,7 @@ int inhibit_storing = 0; int end_is_Z = end == Z; - for (tail = current_buffer->overlays_before; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) { ptrdiff_t startpos, endpos; @@ -2784,7 +2787,7 @@ next = startpos; } - for (tail = current_buffer->overlays_after; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) { ptrdiff_t startpos, endpos; @@ -2874,7 +2877,7 @@ Lisp_Object overlay; struct Lisp_Overlay *tail; - for (tail = current_buffer->overlays_before; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) { ptrdiff_t endpos; @@ -2888,7 +2891,7 @@ return 1; } - for (tail = current_buffer->overlays_after; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) { ptrdiff_t startpos; @@ -3089,7 +3092,7 @@ overlay_heads.used = overlay_heads.bytes = 0; overlay_tails.used = overlay_tails.bytes = 0; - for (ov = current_buffer->overlays_before; ov; ov = ov->next) + for (ov = buffer_get_overlays (NULL, OV_BEFORE); ov; ov = ov->next) { XSETMISC (overlay, ov); eassert (OVERLAYP (overlay)); @@ -3117,7 +3120,7 @@ Foverlay_get (overlay, Qpriority), endpos - startpos); } - for (ov = current_buffer->overlays_after; ov; ov = ov->next) + for (ov = buffer_get_overlays (NULL, OV_AFTER); ov; ov = ov->next) { XSETMISC (overlay, ov); eassert (OVERLAYP (overlay)); @@ -3215,7 +3218,7 @@ But we use it for symmetry and in case that should cease to be true with some future change. */ prev = NULL; - for (tail = buf->overlays_before; tail; prev = tail, tail = next) + for (tail = buffer_get_overlays (buf, OV_BEFORE); tail; prev = tail, tail = next) { next = tail->next; XSETMISC (overlay, tail); @@ -3234,11 +3237,11 @@ if (prev) prev->next = next; else - buf->overlays_before = next; + buffer_set_overlays (buf, next, OV_BEFORE); /* Search thru overlays_after for where to put it. */ other_prev = NULL; - for (other = buf->overlays_after; other; + for (other = buffer_get_overlays (buf, OV_AFTER); other; other_prev = other, other = other->next) { Lisp_Object otherbeg, otheroverlay; @@ -3256,7 +3259,7 @@ if (other_prev) other_prev->next = tail; else - buf->overlays_after = tail; + buffer_set_overlays (buf, tail, OV_AFTER); tail = prev; } else @@ -3268,7 +3271,7 @@ /* See if anything in overlays_after should be in overlays_before. */ prev = NULL; - for (tail = buf->overlays_after; tail; prev = tail, tail = next) + for (tail = buffer_get_overlays (buf, OV_AFTER); tail; prev = tail, tail = next) { next = tail->next; XSETMISC (overlay, tail); @@ -3292,11 +3295,11 @@ if (prev) prev->next = next; else - buf->overlays_after = next; + buffer_set_overlays (buf, next, OV_AFTER); /* Search thru overlays_before for where to put it. */ other_prev = NULL; - for (other = buf->overlays_before; other; + for (other = buffer_get_overlays (buf, OV_BEFORE); other; other_prev = other, other = other->next) { Lisp_Object otherend, otheroverlay; @@ -3314,7 +3317,7 @@ if (other_prev) other_prev->next = tail; else - buf->overlays_before = tail; + buffer_set_overlays (buf, tail, OV_BEFORE); tail = prev; } } @@ -3367,7 +3370,7 @@ assigned. */ struct Lisp_Overlay *beforep = NULL, *afterp = NULL; /* 'Parent', likewise, indicates a cons cell or - current_buffer->overlays_before or overlays_after, depending + before or after overlays list, depending which loop we're in. */ struct Lisp_Overlay *tail, *parent; ptrdiff_t startpos, endpos; @@ -3379,7 +3382,7 @@ (after_list) if it is, is still uninitialized. So it's not a bug that before_list isn't initialized, although it may look strange. */ - for (parent = NULL, tail = current_buffer->overlays_before; tail;) + for (parent = NULL, tail = buffer_get_overlays (NULL, OV_BEFORE); tail;) { XSETMISC (overlay, tail); @@ -3419,7 +3422,7 @@ beforep = tail; } if (!parent) - current_buffer->overlays_before = tail->next; + buffer_set_overlays (NULL, tail->next, OV_BEFORE); else parent->next = tail->next; tail = tail->next; @@ -3427,7 +3430,7 @@ else parent = tail, tail = parent->next; } - for (parent = NULL, tail = current_buffer->overlays_after; tail;) + for (parent = NULL, tail = buffer_get_overlays (NULL, OV_AFTER); tail;) { XSETMISC (overlay, tail); @@ -3465,7 +3468,7 @@ beforep = tail; } if (!parent) - current_buffer->overlays_after = tail->next; + buffer_set_overlays (NULL, tail->next, OV_AFTER); else parent->next = tail->next; tail = tail->next; @@ -3478,15 +3481,15 @@ and let the recenter function make it sane again. */ if (beforep) { - beforep->next = current_buffer->overlays_before; - current_buffer->overlays_before = before_list; + beforep->next = buffer_get_overlays (NULL, OV_BEFORE); + buffer_set_overlays (NULL, before_list, OV_BEFORE); } recenter_overlay_lists (current_buffer, current_buffer->overlay_center); if (afterp) { - afterp->next = current_buffer->overlays_after; - current_buffer->overlays_after = after_list; + afterp->next = buffer_get_overlays (NULL, OV_AFTER); + buffer_set_overlays (NULL, after_list, OV_AFTER); } recenter_overlay_lists (current_buffer, current_buffer->overlay_center); } @@ -3507,7 +3510,8 @@ fix_overlays_before (struct buffer *bp, ptrdiff_t prev, ptrdiff_t pos) { /* If parent is nil, replace overlays_before; otherwise, parent->next. */ - struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; + struct Lisp_Overlay *tail = buffer_get_overlays (bp, OV_BEFORE); + struct Lisp_Overlay *parent = NULL, *right_pair; Lisp_Object tem; ptrdiff_t end IF_LINT (= 0); @@ -3562,8 +3566,8 @@ and link it into the right place. */ if (!right_pair) { - found->next = bp->overlays_before; - bp->overlays_before = found; + found->next = buffer_get_overlays (bp, OV_BEFORE); + buffer_set_overlays (bp, found, OV_BEFORE); } else { @@ -3639,15 +3643,15 @@ end = OVERLAY_END (overlay); if (OVERLAY_POSITION (end) < b->overlay_center) { - if (b->overlays_after) - XOVERLAY (overlay)->next = b->overlays_after; - b->overlays_after = XOVERLAY (overlay); + if (buffer_get_overlays (b, OV_AFTER)) + XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_AFTER); + buffer_set_overlays (b, XOVERLAY (overlay), OV_AFTER); } else { - if (b->overlays_before) - XOVERLAY (overlay)->next = b->overlays_before; - b->overlays_before = XOVERLAY (overlay); + if (buffer_get_overlays (b, OV_BEFORE)) + XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_BEFORE); + buffer_set_overlays (b, XOVERLAY (overlay), OV_BEFORE); } /* This puts it in the right list, and in the right order. */ @@ -3705,6 +3709,19 @@ return list; } +/* Remove OVERLAY from both overlay lists of B. */ + +static void +unchain_both (struct buffer *b, Lisp_Object overlay) +{ + struct Lisp_Overlay *ov = XOVERLAY (overlay); + + buffer_set_overlays + (b, unchain_overlay (buffer_get_overlays (b, OV_BEFORE), ov), OV_BEFORE); + buffer_set_overlays + (b, unchain_overlay (buffer_get_overlays (b, OV_AFTER), ov), OV_AFTER); +} + DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0, doc: /* Set the endpoints of OVERLAY to BEG and END in BUFFER. If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now. @@ -3755,10 +3772,7 @@ o_beg = OVERLAY_POSITION (OVERLAY_START (overlay)); o_end = OVERLAY_POSITION (OVERLAY_END (overlay)); - ob->overlays_before = - unchain_overlay (ob->overlays_before, XOVERLAY (overlay)); - ob->overlays_after = - unchain_overlay (ob->overlays_after, XOVERLAY (overlay)); + unchain_both (ob, overlay); eassert (XOVERLAY (overlay)->next == NULL); } @@ -3799,13 +3813,13 @@ wrong list. */ if (n_end < b->overlay_center) { - XOVERLAY (overlay)->next = b->overlays_after; - b->overlays_after = XOVERLAY (overlay); + XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_AFTER); + buffer_set_overlays (b, XOVERLAY (overlay), OV_AFTER); } else { - XOVERLAY (overlay)->next = b->overlays_before; - b->overlays_before = XOVERLAY (overlay); + XOVERLAY (overlay)->next = buffer_get_overlays (b, OV_BEFORE); + buffer_set_overlays (b, XOVERLAY (overlay), OV_BEFORE); } /* This puts it in the right list, and in the right order. */ @@ -3831,10 +3845,7 @@ b = XBUFFER (buffer); specbind (Qinhibit_quit, Qt); - b->overlays_before - = unchain_overlay (b->overlays_before, XOVERLAY (overlay)); - b->overlays_after - = unchain_overlay (b->overlays_after, XOVERLAY (overlay)); + unchain_both (b, overlay); eassert (XOVERLAY (overlay)->next == NULL); drop_overlay (b, XOVERLAY (overlay)); @@ -4033,16 +4044,19 @@ { struct Lisp_Overlay *ol; Lisp_Object before = Qnil, after = Qnil, tmp; - for (ol = current_buffer->overlays_before; ol; ol = ol->next) + + for (ol = buffer_get_overlays (NULL, OV_BEFORE); ol; ol = ol->next) { XSETMISC (tmp, ol); before = Fcons (tmp, before); } - for (ol = current_buffer->overlays_after; ol; ol = ol->next) + + for (ol = buffer_get_overlays (NULL, OV_AFTER); ol; ol = ol->next) { XSETMISC (tmp, ol); after = Fcons (tmp, after); } + return Fcons (Fnreverse (before), Fnreverse (after)); } @@ -4182,7 +4196,7 @@ /* We are being called before a change. Scan the overlays to find the functions to call. */ last_overlay_modification_hooks_used = 0; - for (tail = current_buffer->overlays_before; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) { ptrdiff_t startpos, endpos; Lisp_Object ostart, oend; @@ -4219,7 +4233,7 @@ } } - for (tail = current_buffer->overlays_after; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) { ptrdiff_t startpos, endpos; Lisp_Object ostart, oend; @@ -4311,7 +4325,7 @@ hit_list = Qnil; if (pos <= current_buffer->overlay_center) - for (tail = current_buffer->overlays_before; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) { ptrdiff_t endpos; XSETMISC (overlay, tail); @@ -4323,7 +4337,7 @@ hit_list = Fcons (overlay, hit_list); } else - for (tail = current_buffer->overlays_after; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) { ptrdiff_t startpos; XSETMISC (overlay, tail); === modified file 'src/buffer.h' --- src/buffer.h 2012-08-08 12:12:40 +0000 +++ src/buffer.h 2012-08-08 14:47:11 +0000 @@ -945,6 +945,52 @@ } \ } while (0) +enum overlay_type +{ + OV_BEFORE, + OV_AFTER +}; + +/* Get overlay list of type T and belonging to B. */ + +BUFFER_INLINE struct Lisp_Overlay * +buffer_get_overlays (struct buffer *b, enum overlay_type t) +{ + if (!b) + b = current_buffer; + if (t == OV_BEFORE) + return b->overlays_before; + else if (t == OV_AFTER) + return b->overlays_after; + else + abort (); +} + +/* Set overlay list of type T as belonging to B. */ + +BUFFER_INLINE void +buffer_set_overlays (struct buffer *b, struct Lisp_Overlay *o, + enum overlay_type t) +{ + if (!b) + b = current_buffer; + if (t == OV_BEFORE) + b->overlays_before = o; + else if (t == OV_AFTER) + b->overlays_after = o; + else + abort (); +} + +/* Non-zero if current buffer has overlays. */ + +BUFFER_INLINE int +buffer_has_overlays (void) +{ + return buffer_get_overlays (current_buffer, OV_BEFORE) + || buffer_get_overlays (current_buffer, OV_AFTER); +} + extern Lisp_Object Qbefore_change_functions; extern Lisp_Object Qafter_change_functions; extern Lisp_Object Qfirst_change_hook; === modified file 'src/editfns.c' --- src/editfns.c 2012-08-08 12:12:40 +0000 +++ src/editfns.c 2012-08-08 14:47:11 +0000 @@ -310,7 +310,7 @@ ptrdiff_t startpos, endpos; ptrdiff_t idx = 0; - for (tail = current_buffer->overlays_before; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_BEFORE); tail; tail = tail->next) { XSETMISC (overlay, tail); @@ -329,7 +329,7 @@ } } - for (tail = current_buffer->overlays_after; tail; tail = tail->next) + for (tail = buffer_get_overlays (NULL, OV_AFTER); tail; tail = tail->next) { XSETMISC (overlay, tail); === modified file 'src/fileio.c' --- src/fileio.c 2012-08-08 12:12:40 +0000 +++ src/fileio.c 2012-08-08 14:47:11 +0000 @@ -3490,8 +3490,8 @@ BVAR (buf, read_only) = Qnil; BVAR (buf, filename) = Qnil; BVAR (buf, undo_list) = Qt; - eassert (buf->overlays_before == NULL); - eassert (buf->overlays_after == NULL); + eassert (buffer_get_overlays (buf, OV_BEFORE) == NULL); + eassert (buffer_get_overlays (buf, OV_AFTER) == NULL); set_buffer_internal (buf); Ferase_buffer (); === modified file 'src/indent.c' --- src/indent.c 2012-08-08 12:12:40 +0000 +++ src/indent.c 2012-08-08 14:47:11 +0000 @@ -337,8 +337,7 @@ /* If the buffer has overlays, text properties, or multibyte characters, use a more general algorithm. */ if (buffer_get_intervals (current_buffer) - || current_buffer->overlays_before - || current_buffer->overlays_after + || buffer_has_overlays () || Z != Z_BYTE) return current_column_1 (); === modified file 'src/insdel.c' --- src/insdel.c 2012-08-08 12:12:40 +0000 +++ src/insdel.c 2012-08-08 14:47:11 +0000 @@ -1993,7 +1993,7 @@ XSETCDR (rvoe_arg, Qt); } - if (current_buffer->overlays_before || current_buffer->overlays_after) + if (buffer_has_overlays ()) { PRESERVE_VALUE; report_overlay_modification (FETCH_START, FETCH_END, 0, @@ -2029,8 +2029,7 @@ just record the args that we were going to use. */ if (! NILP (Vcombine_after_change_calls) && NILP (Vbefore_change_functions) - && !current_buffer->overlays_before - && !current_buffer->overlays_after) + && !buffer_has_overlays ()) { Lisp_Object elt; @@ -2072,7 +2071,7 @@ XSETCDR (rvoe_arg, Qt); } - if (current_buffer->overlays_before || current_buffer->overlays_after) + if (buffer_has_overlays ()) report_overlay_modification (make_number (charpos), make_number (charpos + lenins), 1, === modified file 'src/intervals.c' --- src/intervals.c 2012-08-08 12:12:40 +0000 +++ src/intervals.c 2012-08-08 14:47:11 +0000 @@ -1870,8 +1870,7 @@ whether or not there are intervals in the buffer. */ eassert (charpos <= ZV && charpos >= BEGV); - have_overlays = (current_buffer->overlays_before - || current_buffer->overlays_after); + have_overlays = buffer_has_overlays (); /* If we have no text properties and overlays, then we can do it quickly. */ === modified file 'src/print.c' --- src/print.c 2012-08-08 10:23:04 +0000 +++ src/print.c 2012-08-08 14:47:11 +0000 @@ -498,8 +498,8 @@ BVAR (current_buffer, read_only) = Qnil; BVAR (current_buffer, filename) = Qnil; BVAR (current_buffer, undo_list) = Qt; - eassert (current_buffer->overlays_before == NULL); - eassert (current_buffer->overlays_after == NULL); + eassert (buffer_get_overlays (NULL, OV_BEFORE) == NULL); + eassert (buffer_get_overlays (NULL, OV_AFTER) == NULL); BVAR (current_buffer, enable_multibyte_characters) = BVAR (&buffer_defaults, enable_multibyte_characters); specbind (Qinhibit_read_only, Qt); === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-08 06:11:29 +0000 +++ src/xdisp.c 2012-08-08 14:47:11 +0000 @@ -5445,7 +5445,7 @@ while (0) /* Process overlay before the overlay center. */ - for (ov = current_buffer->overlays_before; ov; ov = ov->next) + for (ov = buffer_get_overlays (NULL, OV_BEFORE); ov; ov = ov->next) { XSETMISC (overlay, ov); eassert (OVERLAYP (overlay)); @@ -5485,7 +5485,7 @@ } /* Process overlays after the overlay center. */ - for (ov = current_buffer->overlays_after; ov; ov = ov->next) + for (ov = buffer_get_overlays (NULL, OV_AFTER); ov; ov = ov->next) { XSETMISC (overlay, ov); eassert (OVERLAYP (overlay)); ------------------------------------------------------------ revno: 109511 committer: Michael Albinus . (Bug#12148) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-08 08:48:57 +0000 +++ lisp/ChangeLog 2012-08-08 13:40:45 +0000 @@ -1,3 +1,10 @@ +2012-08-08 Michael Albinus + + * net/tramp-sh.el (tramp-find-file-exists-command): Protect the + tests by `ignore-error'. + (tramp-find-shell): Open also a new shell, when cache is already + set. Reported by Carsten Bormann . (Bug#12148) + 2012-08-08 Juri Linkov * bookmark.el: Add `defaults' property to the bookmark record. === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2012-07-06 13:16:13 +0000 +++ lisp/net/tramp-sh.el 2012-08-08 13:40:45 +0000 @@ -3559,26 +3559,30 @@ ;; `/usr/bin/test'. ;; `/usr/bin/test -e' In case `/bin/test' does not exist. (unless (or - (and (setq result (format "%s -e" (tramp-get-test-command vec))) - (tramp-send-command-and-check - vec (format "%s %s" result existing)) - (not (tramp-send-command-and-check - vec (format "%s %s" result nonexistent)))) - (and (setq result "/bin/test -e") - (tramp-send-command-and-check - vec (format "%s %s" result existing)) - (not (tramp-send-command-and-check - vec (format "%s %s" result nonexistent)))) - (and (setq result "/usr/bin/test -e") - (tramp-send-command-and-check - vec (format "%s %s" result existing)) - (not (tramp-send-command-and-check - vec (format "%s %s" result nonexistent)))) - (and (setq result (format "%s -d" (tramp-get-ls-command vec))) - (tramp-send-command-and-check - vec (format "%s %s" result existing)) - (not (tramp-send-command-and-check - vec (format "%s %s" result nonexistent))))) + (ignore-errors + (and (setq result (format "%s -e" (tramp-get-test-command vec))) + (tramp-send-command-and-check + vec (format "%s %s" result existing)) + (not (tramp-send-command-and-check + vec (format "%s %s" result nonexistent))))) + (ignore-errors + (and (setq result "/bin/test -e") + (tramp-send-command-and-check + vec (format "%s %s" result existing)) + (not (tramp-send-command-and-check + vec (format "%s %s" result nonexistent))))) + (ignore-errors + (and (setq result "/usr/bin/test -e") + (tramp-send-command-and-check + vec (format "%s %s" result existing)) + (not (tramp-send-command-and-check + vec (format "%s %s" result nonexistent))))) + (ignore-errors + (and (setq result (format "%s -d" (tramp-get-ls-command vec))) + (tramp-send-command-and-check + vec (format "%s %s" result existing)) + (not (tramp-send-command-and-check + vec (format "%s %s" result nonexistent)))))) (tramp-error vec 'file-error "Couldn't find command to check if file exists")) result)) @@ -3609,48 +3613,50 @@ (defun tramp-find-shell (vec) "Opens a shell on the remote host which groks tilde expansion." - (with-connection-property vec "remote-shell" - (let ((shell (tramp-get-method-parameter - (tramp-file-name-method vec) 'tramp-remote-shell))) - (with-current-buffer (tramp-get-buffer vec) - ;; CCC: "root" does not exist always, see QNAP 459. Which - ;; check could we apply instead? - (tramp-send-command vec "echo ~root" t) - (when (or (string-match "^~root$" (buffer-string)) - ;; The default shell (ksh93) of OpenSolaris and - ;; Solaris is buggy. We've got reports for "SunOS - ;; 5.10" and "SunOS 5.11" so far. - (string-match (regexp-opt '("SunOS 5.10" "SunOS 5.11")) - (tramp-get-connection-property vec "uname" ""))) - (if (setq shell - (or (tramp-find-executable - vec "bash" (tramp-get-remote-path vec) t t) - (tramp-find-executable - vec "ksh" (tramp-get-remote-path vec) t t))) - (progn - (tramp-message - vec 5 "Starting remote shell `%s' for tilde expansion" shell) - (tramp-open-shell vec shell)) - - ;; Maybe it works at least for some other commands. - (setq shell - (tramp-get-method-parameter - (tramp-file-name-method vec) 'tramp-remote-shell)) - (tramp-message - vec 2 - (concat - "Couldn't find a remote shell which groks tilde expansion, " - "using `%s'") - shell))) - - ;; Busyboxes tend to behave strange. We check for the existence. - (with-connection-property vec "busybox" - (tramp-send-command vec (format "%s --version" shell) t) - (let ((case-fold-search t)) - (and (string-match "busybox" (buffer-string)) t))) - - ;; Return the shell. - shell)))) + (with-current-buffer (tramp-get-buffer vec) + (let ((default-shell (tramp-get-method-parameter + (tramp-file-name-method vec) 'tramp-remote-shell)) + shell) + (setq shell + (with-connection-property vec "remote-shell" + ;; CCC: "root" does not exist always, see QNAP 459. + ;; Which check could we apply instead? + (tramp-send-command vec "echo ~root" t) + (if (or (string-match "^~root$" (buffer-string)) + ;; The default shell (ksh93) of OpenSolaris and + ;; Solaris is buggy. We've got reports for + ;; "SunOS 5.10" and "SunOS 5.11" so far. + (string-match (regexp-opt '("SunOS 5.10" "SunOS 5.11")) + (tramp-get-connection-property + vec "uname" ""))) + + (or (tramp-find-executable + vec "bash" (tramp-get-remote-path vec) t t) + (tramp-find-executable + vec "ksh" (tramp-get-remote-path vec) t t) + ;; Maybe it works at least for some other commands. + (prog1 + default-shell + (tramp-message + vec 2 + (concat + "Couldn't find a remote shell which groks tilde " + "expansion, using `%s'") + default-shell))) + + default-shell))) + + ;; Open a new shell if needed. + (unless (string-equal shell default-shell) + (tramp-message + vec 5 "Starting remote shell `%s' for tilde expansion" shell) + (tramp-open-shell vec shell)) + + ;; Busyboxes tend to behave strange. We check for the existence. + (with-connection-property vec "busybox" + (tramp-send-command vec (format "%s --version" shell) t) + (let ((case-fold-search t)) + (and (string-match "busybox" (buffer-string)) t)))))) ;; Utility functions. @@ -3786,7 +3792,7 @@ (tramp-set-remote-path vec) ;; Search for a good shell before searching for a command which - ;; checks if a file exists. This is done because Tramp wants to use + ;; checks if a file exists. This is done because Tramp wants to use ;; "test foo; echo $?" to check if various conditions hold, and ;; there are buggy /bin/sh implementations which don't execute the ;; "echo $?" part if the "test" part has an error. In particular, ------------------------------------------------------------ revno: 109510 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-08-08 16:12:40 +0400 message: Inline functions to examine and change buffer intervals. * alloc.c (mark_interval_tree): Remove. (MARK_INTERVAL_TREE): Simplify. (UNMARK_BALANCE_INTERVALS): Remove. Adjust users. * intervals.c (buffer_balance_intervals): New function. (graft_intervals_into_buffer): Adjust indentation. (set_intervals_multibyte): Simplify. * buffer.h (BUF_INTERVALS): Remove. (buffer_get_intervals, buffer_set_intervals): New function. * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c: * intervals.c, textprop.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-08 10:23:04 +0000 +++ src/ChangeLog 2012-08-08 12:12:40 +0000 @@ -1,5 +1,19 @@ 2012-08-08 Dmitry Antipov + Inline functions to examine and change buffer intervals. + * alloc.c (mark_interval_tree): Remove. + (MARK_INTERVAL_TREE): Simplify. + (UNMARK_BALANCE_INTERVALS): Remove. Adjust users. + * intervals.c (buffer_balance_intervals): New function. + (graft_intervals_into_buffer): Adjust indentation. + (set_intervals_multibyte): Simplify. + * buffer.h (BUF_INTERVALS): Remove. + (buffer_get_intervals, buffer_set_intervals): New function. + * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c: + * intervals.c, textprop.c: Adjust users. + +2012-08-08 Dmitry Antipov + Inline functions to examine and change string intervals. * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove. (string_get_intervals, string_set_intervals): New function. === modified file 'src/alloc.c' --- src/alloc.c 2012-08-08 10:23:04 +0000 +++ src/alloc.c 2012-08-08 12:12:40 +0000 @@ -1542,35 +1542,12 @@ mark_object (i->plist); } - -/* Mark the interval tree rooted in TREE. Don't call this directly; - use the macro MARK_INTERVAL_TREE instead. */ - -static void -mark_interval_tree (register INTERVAL tree) -{ - /* No need to test if this tree has been marked already; this - function is always called through the MARK_INTERVAL_TREE macro, - which takes care of that. */ - - traverse_intervals_noorder (tree, mark_interval, Qnil); -} - - /* Mark the interval tree rooted in I. */ -#define MARK_INTERVAL_TREE(i) \ - do { \ - if (i && !i->gcmarkbit) \ - mark_interval_tree (i); \ - } while (0) - -/* Unmark and rebalance interval tree rooted in I. */ - -#define UNMARK_BALANCE_INTERVALS(i) \ - do { \ - if (i) \ - (i) = balance_intervals (i); \ +#define MARK_INTERVAL_TREE(i) \ + do { \ + if (i && !i->gcmarkbit) \ + traverse_intervals_noorder (i, mark_interval, Qnil); \ } while (0) /*********************************************************************** @@ -2101,8 +2078,8 @@ /* String is live; unmark it and its intervals. */ UNMARK_STRING (s); - if (s->intervals) - UNMARK_BALANCE_INTERVALS (s->intervals); + /* Do not use string_(set|get)_intervals here. */ + s->intervals = balance_intervals (s->intervals); ++total_strings; total_string_bytes += STRING_BYTES (s); @@ -5848,7 +5825,7 @@ /* ...but there are some buffer-specific things. */ - MARK_INTERVAL_TREE (BUF_INTERVALS (buffer)); + MARK_INTERVAL_TREE (buffer_get_intervals (buffer)); /* For now, we just don't mark the undo_list. It's done later in a special way just before the sweep phase, and after stripping @@ -6587,7 +6564,8 @@ else { VECTOR_UNMARK (buffer); - UNMARK_BALANCE_INTERVALS (BUF_INTERVALS (buffer)); + /* Do not use buffer_(set|get)_intervals here. */ + buffer->text->intervals = balance_intervals (buffer->text->intervals); total_buffers++; prev = buffer, buffer = buffer->header.next.buffer; } === modified file 'src/buffer.c' --- src/buffer.c 2012-08-08 10:23:04 +0000 +++ src/buffer.c 2012-08-08 12:12:40 +0000 @@ -360,7 +360,7 @@ BUF_CHARS_MODIFF (b) = 1; BUF_OVERLAY_MODIFF (b) = 1; BUF_SAVE_MODIFF (b) = 1; - BUF_INTERVALS (b) = NULL; + buffer_set_intervals (b, NULL); BUF_UNCHANGED_MODIFIED (b) = 1; BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1; BUF_END_UNCHANGED (b) = 0; @@ -1688,7 +1688,7 @@ m = next; } BUF_MARKERS (b) = NULL; - BUF_INTERVALS (b) = NULL; + buffer_set_intervals (b, NULL); /* Perhaps we should explicitly free the interval tree here... */ } @@ -4904,8 +4904,8 @@ /* No one will share the text with these buffers, but let's play it safe. */ buffer_defaults.indirections = 0; buffer_local_symbols.indirections = 0; - BUF_INTERVALS (&buffer_defaults) = NULL; - BUF_INTERVALS (&buffer_local_symbols) = NULL; + buffer_set_intervals (&buffer_defaults, NULL); + buffer_set_intervals (&buffer_local_symbols, NULL); XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); XSETBUFFER (Vbuffer_defaults, &buffer_defaults); XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize); === modified file 'src/buffer.h' --- src/buffer.h 2012-08-07 13:37:21 +0000 +++ src/buffer.h 2012-08-08 12:12:40 +0000 @@ -193,9 +193,6 @@ /* FIXME: should we move this into ->text->auto_save_modiff? */ #define BUF_AUTOSAVE_MODIFF(buf) ((buf)->auto_save_modified) -/* Interval tree of buffer. */ -#define BUF_INTERVALS(buf) ((buf)->text->intervals) - /* Marker chain of buffer. */ #define BUF_MARKERS(buf) ((buf)->text->markers) @@ -951,7 +948,25 @@ extern Lisp_Object Qbefore_change_functions; extern Lisp_Object Qafter_change_functions; extern Lisp_Object Qfirst_change_hook; - + +/* Get text properties of B. */ + +BUFFER_INLINE INTERVAL +buffer_get_intervals (struct buffer *b) +{ + eassert (b->text != NULL); + return b->text->intervals; +} + +/* Set text properties of B to I. */ + +BUFFER_INLINE void +buffer_set_intervals (struct buffer *b, INTERVAL i) +{ + eassert (b->text != NULL); + b->text->intervals = i; +} + /* Return character code of multi-byte form at byte position POS. If POS doesn't point the head of valid multi-byte form, only the byte at POS is returned. No range checking. === modified file 'src/editfns.c' --- src/editfns.c 2012-08-08 10:23:04 +0000 +++ src/editfns.c 2012-08-08 12:12:40 +0000 @@ -4527,7 +4527,7 @@ Lisp_Object buf; XSETBUFFER (buf, current_buffer); - cur_intv = BUF_INTERVALS (current_buffer); + cur_intv = buffer_get_intervals (current_buffer); validate_region (&startr1, &endr1); validate_region (&startr2, &endr2); === modified file 'src/fileio.c' --- src/fileio.c 2012-08-08 06:11:29 +0000 +++ src/fileio.c 2012-08-08 12:12:40 +0000 @@ -3145,7 +3145,7 @@ set_buffer_internal (XBUFFER (buffer)); adjust_markers_for_delete (BEG, BEG_BYTE, Z, Z_BYTE); adjust_overlays_for_delete (BEG, Z - BEG); - BUF_INTERVALS (current_buffer) = NULL; + buffer_set_intervals (current_buffer, NULL); TEMP_SET_PT_BOTH (BEG, BEG_BYTE); /* Now we are safe to change the buffer's multibyteness directly. */ === modified file 'src/indent.c' --- src/indent.c 2012-08-07 07:33:18 +0000 +++ src/indent.c 2012-08-08 12:12:40 +0000 @@ -336,7 +336,7 @@ /* If the buffer has overlays, text properties, or multibyte characters, use a more general algorithm. */ - if (BUF_INTERVALS (current_buffer) + if (buffer_get_intervals (current_buffer) || current_buffer->overlays_before || current_buffer->overlays_after || Z != Z_BYTE) === modified file 'src/insdel.c' --- src/insdel.c 2012-08-08 10:23:04 +0000 +++ src/insdel.c 2012-08-08 12:12:40 +0000 @@ -844,10 +844,10 @@ PT + nchars, PT_BYTE + nbytes, before_markers); - if (BUF_INTERVALS (current_buffer)) + if (buffer_get_intervals (current_buffer)) offset_intervals (current_buffer, PT, nchars); - if (!inherit && BUF_INTERVALS (current_buffer)) + if (!inherit && buffer_get_intervals (current_buffer)) set_text_properties (make_number (PT), make_number (PT + nchars), Qnil, Qnil, Qnil); @@ -1017,7 +1017,7 @@ adjust_markers_for_insert (GPT - nchars, GPT_BYTE - nbytes, GPT, GPT_BYTE, 0); - if (BUF_INTERVALS (current_buffer)) + if (buffer_get_intervals (current_buffer)) { offset_intervals (current_buffer, GPT - nchars, nchars); graft_intervals_into_buffer (NULL, GPT - nchars, nchars, @@ -1157,11 +1157,11 @@ PT_BYTE + outgoing_nbytes, 0); - if (BUF_INTERVALS (current_buffer)) + if (buffer_get_intervals (current_buffer)) offset_intervals (current_buffer, PT, nchars); /* Get the intervals for the part of the string we are inserting. */ - intervals = BUF_INTERVALS (buf); + intervals = buffer_get_intervals (buf); if (nchars < BUF_Z (buf) - BUF_BEG (buf)) { if (buf == current_buffer && PT <= from) @@ -1225,10 +1225,9 @@ adjust_overlays_for_insert (from, len - nchars_del); else if (len < nchars_del) adjust_overlays_for_delete (from, nchars_del - len); - if (BUF_INTERVALS (current_buffer)) - { - offset_intervals (current_buffer, from, len - nchars_del); - } + + if (buffer_get_intervals (current_buffer)) + offset_intervals (current_buffer, from, len - nchars_del); if (from < PT) adjust_point (len - nchars_del, len_byte - nbytes_del); @@ -1823,7 +1822,7 @@ if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) ++windows_or_buffers_changed; - if (BUF_INTERVALS (current_buffer)) + if (buffer_get_intervals (current_buffer)) { if (preserve_ptr) { === modified file 'src/intervals.c' --- src/intervals.c 2012-08-08 10:23:04 +0000 +++ src/intervals.c 2012-08-08 12:12:40 +0000 @@ -77,7 +77,7 @@ new->total_length = (BUF_Z (XBUFFER (parent)) - BUF_BEG (XBUFFER (parent))); eassert (0 <= TOTAL_LENGTH (new)); - BUF_INTERVALS (XBUFFER (parent)) = new; + buffer_set_intervals (XBUFFER (parent), new); new->position = BEG; } else if (STRINGP (parent)) @@ -453,7 +453,7 @@ if (have_parent) { if (BUFFERP (parent)) - BUF_INTERVALS (XBUFFER (parent)) = interval; + buffer_set_intervals (XBUFFER (parent), interval); else if (STRINGP (parent)) string_set_intervals (parent, interval); } @@ -483,6 +483,19 @@ return tree ? balance_intervals_internal (tree) : NULL; } +/* Rebalance text properties of B. */ + +static void +buffer_balance_intervals (struct buffer *b) +{ + INTERVAL i; + + eassert (b != NULL); + i = buffer_get_intervals (b); + if (i) + buffer_set_intervals (b, balance_an_interval (i)); +} + /* Split INTERVAL into two pieces, starting the second piece at character position OFFSET (counting from 0), relative to INTERVAL. INTERVAL becomes the left-hand piece, and the right-hand piece @@ -1204,7 +1217,7 @@ interval_set_object (parent, owner); if (BUFFERP (owner)) - BUF_INTERVALS (XBUFFER (owner)) = parent; + buffer_set_intervals (XBUFFER (owner), parent); else if (STRINGP (owner)) string_set_intervals (owner, parent); else @@ -1306,7 +1319,7 @@ ptrdiff_t start, ptrdiff_t length) { register ptrdiff_t left_to_delete = length; - register INTERVAL tree = BUF_INTERVALS (buffer); + register INTERVAL tree = buffer_get_intervals (buffer); Lisp_Object parent; ptrdiff_t offset; @@ -1321,7 +1334,7 @@ if (length == TOTAL_LENGTH (tree)) { - BUF_INTERVALS (buffer) = NULL; + buffer_set_intervals (buffer, NULL); return; } @@ -1338,10 +1351,10 @@ { left_to_delete -= interval_deletion_adjustment (tree, start - offset, left_to_delete); - tree = BUF_INTERVALS (buffer); + tree = buffer_get_intervals (buffer); if (left_to_delete == tree->total_length) { - BUF_INTERVALS (buffer) = NULL; + buffer_set_intervals (buffer, NULL); return; } } @@ -1359,11 +1372,12 @@ void offset_intervals (struct buffer *buffer, ptrdiff_t start, ptrdiff_t length) { - if (!BUF_INTERVALS (buffer) || length == 0) + if (!buffer_get_intervals (buffer) || length == 0) return; if (length > 0) - adjust_intervals_for_insertion (BUF_INTERVALS (buffer), start, length); + adjust_intervals_for_insertion (buffer_get_intervals (buffer), + start, length); else { IF_LINT (if (length < - TYPE_MAXIMUM (ptrdiff_t)) abort ();) @@ -1570,7 +1584,7 @@ register INTERVAL tree; ptrdiff_t over_used; - tree = BUF_INTERVALS (buffer); + tree = buffer_get_intervals (buffer); /* If the new text has no properties, then with inheritance it becomes part of whatever interval it was inserted into. @@ -1586,31 +1600,34 @@ make_number (position + length), Qnil, buf, 0); } - if (BUF_INTERVALS (buffer)) - /* Shouldn't be necessary. --Stef */ - BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer)); + /* Shouldn't be necessary. --Stef */ + buffer_balance_intervals (buffer); return; } eassert (length == TOTAL_LENGTH (source)); if ((BUF_Z (buffer) - BUF_BEG (buffer)) == length) - { /* The inserted text constitutes the whole buffer, so + { + /* The inserted text constitutes the whole buffer, so simply copy over the interval structure. */ - Lisp_Object buf; - XSETBUFFER (buf, buffer); - BUF_INTERVALS (buffer) = reproduce_tree_obj (source, buf); - BUF_INTERVALS (buffer)->position = BUF_BEG (buffer); - eassert (BUF_INTERVALS (buffer)->up_obj == 1); - return; - } + Lisp_Object buf; + + XSETBUFFER (buf, buffer); + buffer_set_intervals (buffer, reproduce_tree_obj (source, buf)); + buffer_get_intervals (buffer)->position = BUF_BEG (buffer); + eassert (buffer_get_intervals (buffer)->up_obj == 1); + return; + } else if (!tree) - { /* Create an interval tree in which to place a copy + { + /* Create an interval tree in which to place a copy of the intervals of the inserted string. */ Lisp_Object buf; + XSETBUFFER (buf, buffer); tree = create_root_interval (buf); - } + } /* Paranoia -- the text has already been added, so this buffer should be of non-zero length. */ eassert (TOTAL_LENGTH (tree) > 0); @@ -1691,9 +1708,7 @@ under = next_interval (this); } - if (BUF_INTERVALS (buffer)) - BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer)); - return; + buffer_balance_intervals (buffer); } /* Get the value of property PROP from PLIST, @@ -1860,7 +1875,7 @@ /* If we have no text properties and overlays, then we can do it quickly. */ - if (!BUF_INTERVALS (current_buffer) && ! have_overlays) + if (!buffer_get_intervals (current_buffer) && ! have_overlays) { temp_set_point_both (current_buffer, charpos, bytepos); return; @@ -1869,7 +1884,7 @@ /* Set TO to the interval containing the char after CHARPOS, and TOPREV to the interval containing the char before CHARPOS. Either one may be null. They may be equal. */ - to = find_interval (BUF_INTERVALS (current_buffer), charpos); + to = find_interval (buffer_get_intervals (current_buffer), charpos); if (charpos == BEGV) toprev = 0; else if (to && to->position == charpos) @@ -1883,7 +1898,7 @@ and FROMPREV to the interval containing the char before PT. Either one may be null. They may be equal. */ /* We could cache this and save time. */ - from = find_interval (BUF_INTERVALS (current_buffer), buffer_point); + from = find_interval (buffer_get_intervals (current_buffer), buffer_point); if (buffer_point == BEGV) fromprev = 0; else if (from && from->position == PT) @@ -1989,7 +2004,7 @@ /* Set TO to the interval containing the char after CHARPOS, and TOPREV to the interval containing the char before CHARPOS. Either one may be null. They may be equal. */ - to = find_interval (BUF_INTERVALS (current_buffer), charpos); + to = find_interval (buffer_get_intervals (current_buffer), charpos); if (charpos == BEGV) toprev = 0; else if (to && to->position == charpos) @@ -2122,9 +2137,9 @@ INTERVAL i, prev, next; if (NILP (object)) - i = find_interval (BUF_INTERVALS (current_buffer), pos); + i = find_interval (buffer_get_intervals (current_buffer), pos); else if (BUFFERP (object)) - i = find_interval (BUF_INTERVALS (XBUFFER (object)), pos); + i = find_interval (buffer_get_intervals (XBUFFER (object)), pos); else if (STRINGP (object)) i = find_interval (string_get_intervals (object), pos); else @@ -2253,7 +2268,7 @@ copy_intervals_to_string (Lisp_Object string, struct buffer *buffer, ptrdiff_t position, ptrdiff_t length) { - INTERVAL interval_copy = copy_intervals (BUF_INTERVALS (buffer), + INTERVAL interval_copy = copy_intervals (buffer_get_intervals (buffer), position, length); if (!interval_copy) return; @@ -2418,7 +2433,8 @@ void set_intervals_multibyte (int multi_flag) { - if (BUF_INTERVALS (current_buffer)) - set_intervals_multibyte_1 (BUF_INTERVALS (current_buffer), multi_flag, - BEG, BEG_BYTE, Z, Z_BYTE); + INTERVAL i = buffer_get_intervals (current_buffer); + + if (i) + set_intervals_multibyte_1 (i, multi_flag, BEG, BEG_BYTE, Z, Z_BYTE); } === modified file 'src/textprop.c' --- src/textprop.c 2012-08-08 10:23:04 +0000 +++ src/textprop.c 2012-08-08 12:12:40 +0000 @@ -143,7 +143,7 @@ if (!(BUF_BEGV (b) <= XINT (*begin) && XINT (*begin) <= XINT (*end) && XINT (*end) <= BUF_ZV (b))) args_out_of_range (*begin, *end); - i = BUF_INTERVALS (b); + i = buffer_get_intervals (b); /* If there's no text, there are no properties. */ if (BUF_BEGV (b) == BUF_ZV (b)) @@ -510,7 +510,7 @@ beg = BUF_BEGV (b); end = BUF_ZV (b); - i = BUF_INTERVALS (b); + i = buffer_get_intervals (b); } else { @@ -1338,8 +1338,8 @@ else return; - if (i == 0) - i = find_interval (BUF_INTERVALS (XBUFFER (buffer)), s); + if (i == NULL) + i = find_interval (buffer_get_intervals (XBUFFER (buffer)), s); if (i->position != s) { @@ -1993,7 +1993,7 @@ verify_interval_modification (struct buffer *buf, ptrdiff_t start, ptrdiff_t end) { - register INTERVAL intervals = BUF_INTERVALS (buf); + register INTERVAL intervals = buffer_get_intervals (buf); register INTERVAL i; Lisp_Object hooks; register Lisp_Object prev_mod_hooks; ------------------------------------------------------------ revno: 109509 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-08-08 14:23:04 +0400 message: Inline functions to examine and change string intervals. * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove. (string_get_intervals, string_set_intervals): New function. * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c: * lread.c, print.c, textprop.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-08 07:19:58 +0000 +++ src/ChangeLog 2012-08-08 10:23:04 +0000 @@ -1,3 +1,11 @@ +2012-08-08 Dmitry Antipov + + Inline functions to examine and change string intervals. + * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove. + (string_get_intervals, string_set_intervals): New function. + * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c: + * lread.c, print.c, textprop.c: Adjust users. + 2012-08-08 Glenn Morris * lisp.mk (lisp): Remove language/persian.elc. === modified file 'src/alloc.c' --- src/alloc.c 2012-08-08 06:11:29 +0000 +++ src/alloc.c 2012-08-08 10:23:04 +0000 @@ -6102,7 +6102,7 @@ } if (!PURE_POINTER_P (XSTRING (ptr->name))) MARK_STRING (XSTRING (ptr->name)); - MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->name)); + MARK_INTERVAL_TREE (string_get_intervals (ptr->name)); ptr = ptr->next; if (ptr) === modified file 'src/buffer.c' --- src/buffer.c 2012-08-08 06:11:29 +0000 +++ src/buffer.c 2012-08-08 10:23:04 +0000 @@ -384,7 +384,7 @@ BVAR (b, zv_marker) = Qnil; name = Fcopy_sequence (buffer_or_name); - STRING_SET_INTERVALS (name, NULL); + string_set_intervals (name, NULL); BVAR (b, name) = name; BVAR (b, undo_list) = (SREF (name, 0) != ' ') ? Qnil : Qt; @@ -589,7 +589,7 @@ all_buffers = b; name = Fcopy_sequence (name); - STRING_SET_INTERVALS (name, NULL); + string_set_intervals (name, NULL); BVAR (b, name) = name; reset_buffer (b); === modified file 'src/editfns.c' --- src/editfns.c 2012-08-08 06:11:29 +0000 +++ src/editfns.c 2012-08-08 10:23:04 +0000 @@ -3933,7 +3933,7 @@ /* If this argument has text properties, record where in the result string it appears. */ - if (STRING_INTERVALS (args[n])) + if (string_get_intervals (args[n])) info[n].intervals = arg_intervals = 1; continue; @@ -4277,7 +4277,7 @@ arguments has text properties, set up text properties of the result string. */ - if (STRING_INTERVALS (args[0]) || arg_intervals) + if (string_get_intervals (args[0]) || arg_intervals) { Lisp_Object len, new_len, props; struct gcpro gcpro1; === modified file 'src/fns.c' --- src/fns.c 2012-08-08 06:11:29 +0000 +++ src/fns.c 2012-08-08 10:23:04 +0000 @@ -628,7 +628,7 @@ ptrdiff_t thislen_byte = SBYTES (this); memcpy (SDATA (val) + toindex_byte, SDATA (this), SBYTES (this)); - if (STRING_INTERVALS (this)) + if (string_get_intervals (this)) { textprops[num_textprops].argnum = argnum; textprops[num_textprops].from = 0; @@ -640,7 +640,7 @@ /* Copy a single-byte string to a multibyte string. */ else if (STRINGP (this) && STRINGP (val)) { - if (STRING_INTERVALS (this)) + if (string_get_intervals (this)) { textprops[num_textprops].argnum = argnum; textprops[num_textprops].from = 0; @@ -1060,7 +1060,7 @@ str_as_multibyte (SDATA (new_string), nbytes, SBYTES (string), NULL); string = new_string; - STRING_SET_INTERVALS (string, NULL); + string_set_intervals (string, NULL); } return string; } === modified file 'src/insdel.c' --- src/insdel.c 2012-08-08 06:11:29 +0000 +++ src/insdel.c 2012-08-08 10:23:04 +0000 @@ -976,7 +976,7 @@ offset_intervals (current_buffer, PT, nchars); - intervals = STRING_INTERVALS (string); + intervals = string_get_intervals (string); /* Get the intervals for the part of the string we are inserting. */ if (nbytes < SBYTES (string)) intervals = copy_intervals (intervals, pos, nchars); @@ -1413,7 +1413,7 @@ /* Get the intervals for the part of the string we are inserting-- not including the combined-before bytes. */ - intervals = STRING_INTERVALS (new); + intervals = string_get_intervals (new); /* Insert those intervals. */ graft_intervals_into_buffer (intervals, from, inschars, current_buffer, inherit); === modified file 'src/intervals.c' --- src/intervals.c 2012-08-08 06:11:29 +0000 +++ src/intervals.c 2012-08-08 10:23:04 +0000 @@ -84,7 +84,7 @@ { new->total_length = SCHARS (parent); eassert (0 <= TOTAL_LENGTH (new)); - STRING_SET_INTERVALS (parent, new); + string_set_intervals (parent, new); new->position = 0; } @@ -455,7 +455,7 @@ if (BUFFERP (parent)) BUF_INTERVALS (XBUFFER (parent)) = interval; else if (STRINGP (parent)) - STRING_SET_INTERVALS (parent, interval); + string_set_intervals (parent, interval); } return interval; @@ -1206,7 +1206,7 @@ if (BUFFERP (owner)) BUF_INTERVALS (XBUFFER (owner)) = parent; else if (STRINGP (owner)) - STRING_SET_INTERVALS (owner, parent); + string_set_intervals (owner, parent); else abort (); @@ -2126,7 +2126,7 @@ else if (BUFFERP (object)) i = find_interval (BUF_INTERVALS (XBUFFER (object)), pos); else if (STRINGP (object)) - i = find_interval (STRING_INTERVALS (object), pos); + i = find_interval (string_get_intervals (object), pos); else abort (); @@ -2259,7 +2259,7 @@ return; interval_set_object (interval_copy, string); - STRING_SET_INTERVALS (string, interval_copy); + string_set_intervals (string, interval_copy); } /* Return 1 if strings S1 and S2 have identical properties; 0 otherwise. @@ -2272,8 +2272,8 @@ ptrdiff_t pos = 0; ptrdiff_t end = SCHARS (s1); - i1 = find_interval (STRING_INTERVALS (s1), 0); - i2 = find_interval (STRING_INTERVALS (s2), 0); + i1 = find_interval (string_get_intervals (s1), 0); + i2 = find_interval (string_get_intervals (s2), 0); while (pos < end) { === modified file 'src/lisp.h' --- src/lisp.h 2012-08-07 13:37:21 +0000 +++ src/lisp.h 2012-08-08 10:23:04 +0000 @@ -752,12 +752,6 @@ (STR) = empty_multibyte_string; \ else XSTRING (STR)->size_byte = XSTRING (STR)->size; } while (0) -/* Get text properties. */ -#define STRING_INTERVALS(STR) (XSTRING (STR)->intervals + 0) - -/* Set text properties. */ -#define STRING_SET_INTERVALS(STR, INT) (XSTRING (STR)->intervals = (INT)) - /* In a string or vector, the sign bit of the `size' is the gc mark bit. */ struct Lisp_String @@ -2420,6 +2414,22 @@ XOVERLAY (overlay)->plist = plist; } +/* Get text properties of S. */ + +LISP_INLINE INTERVAL +string_get_intervals (Lisp_Object s) +{ + return XSTRING (s)->intervals; +} + +/* Set text properties of S to I. */ + +LISP_INLINE void +string_set_intervals (Lisp_Object s, INTERVAL i) +{ + XSTRING (s)->intervals = i; +} + /* Defined in data.c. */ extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; extern Lisp_Object Qerror_conditions, Qerror_message, Qtop_level; === modified file 'src/lread.c' --- src/lread.c 2012-08-07 13:37:21 +0000 +++ src/lread.c 2012-08-08 10:23:04 +0000 @@ -3189,7 +3189,7 @@ /* Check for text properties in each interval. substitute_in_interval contains part of the logic. */ - INTERVAL root_interval = STRING_INTERVALS (subtree); + INTERVAL root_interval = string_get_intervals (subtree); Lisp_Object arg = Fcons (object, placeholder); traverse_intervals_noorder (root_interval, === modified file 'src/print.c' --- src/print.c 2012-08-08 06:11:29 +0000 +++ src/print.c 2012-08-08 10:23:04 +0000 @@ -1194,7 +1194,7 @@ { case Lisp_String: /* A string may have text properties, which can be circular. */ - traverse_intervals_noorder (STRING_INTERVALS (obj), + traverse_intervals_noorder (string_get_intervals (obj), print_preprocess_string, Qnil); break; @@ -1297,7 +1297,7 @@ print_prune_string_charset (Lisp_Object string) { print_check_string_result = 0; - traverse_intervals (STRING_INTERVALS (string), 0, + traverse_intervals (string_get_intervals (string), 0, print_check_string_charset_prop, string); if (! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND)) { @@ -1408,7 +1408,7 @@ if (! EQ (Vprint_charset_text_property, Qt)) obj = print_prune_string_charset (obj); - if (STRING_INTERVALS (obj)) + if (string_get_intervals (obj)) { PRINTCHAR ('#'); PRINTCHAR ('('); @@ -1499,9 +1499,9 @@ } PRINTCHAR ('\"'); - if (STRING_INTERVALS (obj)) + if (string_get_intervals (obj)) { - traverse_intervals (STRING_INTERVALS (obj), + traverse_intervals (string_get_intervals (obj), 0, print_interval, printcharfun); PRINTCHAR (')'); } === modified file 'src/textprop.c' --- src/textprop.c 2012-08-08 06:11:29 +0000 +++ src/textprop.c 2012-08-08 10:23:04 +0000 @@ -161,7 +161,7 @@ XSETFASTINT (*begin, XFASTINT (*begin)); if (begin != end) XSETFASTINT (*end, XFASTINT (*end)); - i = STRING_INTERVALS (object); + i = string_get_intervals (object); if (len == 0) return NULL; @@ -516,7 +516,7 @@ { beg = 0; end = SCHARS (object); - i = STRING_INTERVALS (object); + i = string_get_intervals (object); } if (!(beg <= position && position <= end)) @@ -1274,10 +1274,10 @@ && XFASTINT (start) == 0 && XFASTINT (end) == SCHARS (object)) { - if (! STRING_INTERVALS (object)) + if (!string_get_intervals (object)) return Qnil; - STRING_SET_INTERVALS (object, NULL); + string_set_intervals (object, NULL); return Qt; } ------------------------------------------------------------ revno: 109508 fixes bug: http://debbugs.gnu.org/12107 committer: Juri Linkov branch nick: trunk timestamp: Wed 2012-08-08 11:48:57 +0300 message: * lisp/bookmark.el: Add `defaults' property to the bookmark record. (bookmark-current-buffer): Doc fix. (bookmark-make-record): Add `defaults' property with default values to the bookmark record. (bookmark-minibuffer-read-name-map): Remove key binding "\C-u" with `bookmark-insert-current-bookmark'. (bookmark-set): Get `defaults' property from the bookmark record and use it in `read-from-minibuffer'. (bookmark-insert-current-bookmark): Remove function. * lisp/info.el (Info-bookmark-make-record): Add `defaults' property with values of canonical Info node name, the current Info file name and the current Info node name. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-08 08:17:13 +0000 +++ lisp/ChangeLog 2012-08-08 08:48:57 +0000 @@ -1,5 +1,21 @@ 2012-08-08 Juri Linkov + * bookmark.el: Add `defaults' property to the bookmark record. + (bookmark-current-buffer): Doc fix. + (bookmark-make-record): Add `defaults' property with default values + to the bookmark record. + (bookmark-minibuffer-read-name-map): Remove key binding "\C-u" + with `bookmark-insert-current-bookmark'. + (bookmark-set): Get `defaults' property from the bookmark record + and use it in `read-from-minibuffer'. + (bookmark-insert-current-bookmark): Remove function. + + * info.el (Info-bookmark-make-record): Add `defaults' property + with values of canonical Info node name, the current Info file + name and the current Info node name. (Bug#12107) + +2012-08-08 Juri Linkov + * files.el (basic-save-buffer): Use `buffer-name' as the default of `read-file-name' when buffer is not visiting a file (bug#12128). === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2012-07-10 11:51:54 +0000 +++ lisp/bookmark.el 2012-08-08 08:48:57 +0000 @@ -277,8 +277,8 @@ (defvar bookmark-current-buffer nil "The buffer in which a bookmark is currently being set or renamed. Functions that insert strings into the minibuffer use this to know -the source buffer for that information; see `bookmark-yank-word' and -`bookmark-insert-current-bookmark' for example.") +the source buffer for that information; see `bookmark-yank-word' +for example.") (defvar bookmark-yank-point 0 @@ -473,6 +473,12 @@ (defun bookmark-make-record () "Return a new bookmark record (NAME . ALIST) for the current location." (let ((record (funcall bookmark-make-record-function))) + ;; Set up defaults. + (bookmark-prop-set + record 'defaults + (delq nil (delete-dups (append (bookmark-prop-get record 'defaults) + (list bookmark-current-bookmark + (bookmark-buffer-name)))))) ;; Set up default name. (if (stringp (car record)) ;; The function already provided a default name. @@ -738,10 +744,6 @@ (let ((map (make-sparse-keymap))) (set-keymap-parent map minibuffer-local-map) (define-key map "\C-w" 'bookmark-yank-word) - ;; This C-u binding might not be very useful any more now that we - ;; provide access to the default via the standard M-n binding. - ;; Maybe we should just remove it? --Stef-08 - (define-key map "\C-u" 'bookmark-insert-current-bookmark) map)) ;;;###autoload @@ -772,7 +774,19 @@ (interactive (list nil current-prefix-arg)) (unwind-protect (let* ((record (bookmark-make-record)) - (default (car record))) + ;; `defaults' is a transient element of the + ;; extensible format described above in the section + ;; `File format stuff'. Bookmark record functions + ;; can use it to specify a list of default values + ;; accessible via M-n while reading a bookmark name. + (defaults (bookmark-prop-get record 'defaults)) + (default (if (consp defaults) (car defaults) defaults))) + + (if defaults + ;; Don't store default values in the record. + (setq record (assq-delete-all 'defaults record)) + ;; When no defaults in the record, use its first element. + (setq defaults (car record) default defaults)) (bookmark-maybe-load-default-file) ;; Don't set `bookmark-yank-point' and `bookmark-current-buffer' @@ -788,7 +802,7 @@ (format "Set bookmark (%s): " default) nil bookmark-minibuffer-read-name-map - nil nil default)))) + nil nil defaults)))) (and (string-equal str "") (setq str default)) (bookmark-store str (cdr record) no-overwrite) @@ -888,18 +902,6 @@ (bookmark-edit-annotation-mode bookmark-name-or-record)) -(defun bookmark-insert-current-bookmark () - "Insert into the bookmark name currently being set the value of -`bookmark-current-bookmark' in `bookmark-current-buffer', defaulting -to the buffer's file name if `bookmark-current-bookmark' is nil." - (interactive) - (let ((str - (with-current-buffer bookmark-current-buffer - (or bookmark-current-bookmark - (bookmark-buffer-name))))) - (insert str))) - - (defun bookmark-buffer-name () "Return the name of the current buffer in a form usable as a bookmark name. If the buffer is associated with a file or directory, use that name." === modified file 'lisp/info.el' --- lisp/info.el 2012-08-08 08:05:58 +0000 +++ lisp/info.el 2012-08-08 08:48:57 +0000 @@ -5020,11 +5020,18 @@ (defun Info-bookmark-make-record () "This implements the `bookmark-make-record-function' type (which see) for Info nodes." - `(,Info-current-node - ,@(bookmark-make-record-default 'no-file) - (filename . ,Info-current-file) - (info-node . ,Info-current-node) - (handler . Info-bookmark-jump))) + (let* ((file (and (stringp Info-current-file) + (file-name-nondirectory Info-current-file))) + (bookmark-name (if file + (concat "(" file ") " Info-current-node) + Info-current-node)) + (defaults (delq nil (list bookmark-name file Info-current-node)))) + `(,bookmark-name + ,@(bookmark-make-record-default 'no-file) + (filename . ,Info-current-file) + (info-node . ,Info-current-node) + (handler . Info-bookmark-jump) + (defaults . ,defaults)))) ;;;###autoload (defun Info-bookmark-jump (bmk) ------------------------------------------------------------ revno: 109507 fixes bug: http://debbugs.gnu.org/12128 committer: Juri Linkov branch nick: trunk timestamp: Wed 2012-08-08 11:17:13 +0300 message: * lisp/files.el (basic-save-buffer): Use `buffer-name' as the default of `read-file-name' when buffer is not visiting a file. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-08 08:05:58 +0000 +++ lisp/ChangeLog 2012-08-08 08:17:13 +0000 @@ -1,5 +1,10 @@ 2012-08-08 Juri Linkov + * files.el (basic-save-buffer): Use `buffer-name' as the default + of `read-file-name' when buffer is not visiting a file (bug#12128). + +2012-08-08 Juri Linkov + * info.el (Info-isearch-search): Doc fix. (Info-search): Change search-failed message from "initial node" to "end of node" (bug#12078). === modified file 'lisp/files.el' --- lisp/files.el 2012-08-05 07:45:12 +0000 +++ lisp/files.el 2012-08-08 08:17:13 +0000 @@ -4488,7 +4488,8 @@ (or buffer-file-name (let ((filename (expand-file-name - (read-file-name "File to save in: ") nil))) + (read-file-name "File to save in: " + nil (expand-file-name (buffer-name)))))) (if (file-exists-p filename) (if (file-directory-p filename) ;; Signal an error if the user specified the name of an ------------------------------------------------------------ revno: 109506 fixes bug: http://debbugs.gnu.org/12078 committer: Juri Linkov branch nick: trunk timestamp: Wed 2012-08-08 11:05:58 +0300 message: * lisp/info.el (Info-isearch-search): Doc fix. (Info-search): Change search-failed message from "initial node" to "end of node". (Info-isearch-search): Change `isearch-string-state' to `isearch--state-string'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-08 07:19:58 +0000 +++ lisp/ChangeLog 2012-08-08 08:05:58 +0000 @@ -1,3 +1,11 @@ +2012-08-08 Juri Linkov + + * info.el (Info-isearch-search): Doc fix. + (Info-search): Change search-failed message from "initial node" to + "end of node" (bug#12078). + (Info-isearch-search): Change `isearch-string-state' to + `isearch--state-string'. + 2012-08-08 Glenn Morris * language/persian.el: Remove file. === modified file 'lisp/info.el' --- lisp/info.el 2012-08-07 16:12:20 +0000 +++ lisp/info.el 2012-08-08 08:05:58 +0000 @@ -342,12 +342,12 @@ (defcustom Info-isearch-search t "If non-nil, isearch in Info searches through multiple nodes. Before leaving the initial Info node, where isearch was started, -it fails once with the error message [initial node], and with +it fails once with the error message [end of node], and with subsequent C-s/C-r continues through other nodes without failing with this error message in other nodes. When isearch fails for -the rest of the manual, it wraps around the whole manual and -restarts the search from the top/final node depending on -search direction. +the rest of the manual, it displays the error message [end of manual], +wraps around the whole manual and restarts the search from the top/final +node depending on search direction. Setting this option to nil restores the default isearch behavior with wrapping around the current Info node." @@ -1863,7 +1863,7 @@ (not bound) (or give-up (and found (not (and (> found opoint-min) (< found opoint-max)))))) - (signal 'search-failed (list regexp "initial node"))) + (signal 'search-failed (list regexp "end of node"))) ;; If no subfiles, give error now. (if give-up @@ -2006,7 +2006,7 @@ ;; Lax version of word search (let ((lax (not (or isearch-nonincremental (eq (length string) - (length (isearch-string-state + (length (isearch--state-string (car isearch-cmds)))))))) (if (functionp isearch-word) (funcall isearch-word string lax) ------------------------------------------------------------ revno: 109505 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-08-08 00:19:58 -0700 message: Merge language/persian.el into language/misc-lang.el * lisp/language/persian.el: Remove file. * lisp/language/misc-lang.el: Move non-unique part of persian.el here. * lisp/loadup.el: Remove language/persian. * src/lisp.mk (lisp): Remove language/persian.elc. * etc/NEWS: Improve entry. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-08-07 03:31:53 +0000 +++ etc/NEWS 2012-08-08 07:19:58 +0000 @@ -112,7 +112,7 @@ ** Internationalization changes -*** Added language support for Persian. +*** New language environment: Persian. ** Face underlining can now use a wave. See the "Face Attributes" section of the Elisp manual. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-08 04:41:35 +0000 +++ lisp/ChangeLog 2012-08-08 07:19:58 +0000 @@ -1,3 +1,9 @@ +2012-08-08 Glenn Morris + + * language/persian.el: Remove file. + * language/misc-lang.el: Move non-unique part of persian.el here. + * loadup.el: Remove language/persian. + 2012-08-08 Óscar Fuentes * vc/diff-mode.el (diff-remove-trailing-whitespace): New function. === modified file 'lisp/language/misc-lang.el' --- lisp/language/misc-lang.el 2012-05-08 01:50:17 +0000 +++ lisp/language/misc-lang.el 2012-08-08 07:19:58 +0000 @@ -67,6 +67,14 @@ (sample-text . "Arabic السّلام عليكم") (documentation . "Bidirectional editing is supported."))) +(set-language-info-alist + "Persian" '((charset unicode) + (coding-system utf-8 iso-8859-6 windows-1256) + (coding-priority utf-8 iso-8859-6 windows-1256) + (input-method . "farsi-transliterate-banan") + (sample-text . "Persian فارسی") + (documentation . "Bidirectional editing is supported."))) + (set-char-table-range composition-function-table '(#x600 . #x6FF) === removed file 'lisp/language/persian.el' --- lisp/language/persian.el 2012-08-06 07:31:31 +0000 +++ lisp/language/persian.el 1970-01-01 00:00:00 +0000 @@ -1,62 +0,0 @@ -;;; persian.el --- support for Persian -*- coding: utf-8;-*- - -;; Copyright (C) 2012 Free Software Foundation, Inc. - -;; Author: Mohsen BANAN -;; X-URL: http://mohsen.1.banan.byname.net/contact - -;; Keywords: multilingual, Farsi, Persian - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;; For Persian, the character set ISO8859-6 is supported. (Same as Arabic) - -;;; Code: - -(define-coding-system 'iso-8859-6 - "ISO-8859-6 based encoding (MIME:ISO-8859-6)." - :coding-type 'charset - :mnemonic ?6 - :charset-list '(iso-8859-6) - :mime-charset 'iso-8859-6) - -(define-coding-system 'windows-1256 - "windows-1256 (Arabic) encoding (MIME: WINDOWS-1256)" - :coding-type 'charset - :mnemonic ?A - :charset-list '(windows-1256) - :mime-charset 'windows-1256) - -(define-coding-system-alias 'cp1256 'windows-1256) - -(set-language-info-alist - "Persian" '((charset unicode) - (coding-system utf-8 iso-8859-6 windows-1256) - (coding-priority utf-8 iso-8859-6 windows-1256) - (input-method . "farsi-transliterate-banan") - (sample-text . "Persian فارسی") - (documentation . "Bidirectional editing is supported."))) - -(set-char-table-range - composition-function-table - '(#x600 . #x6FF) - (list ["[\u0600-\u06FF]+" 0 font-shape-gstring])) - -(provide 'persian) - -;;; persian.el ends here === modified file 'lisp/loadup.el' --- lisp/loadup.el 2012-08-06 07:31:31 +0000 +++ lisp/loadup.el 2012-08-08 07:19:58 +0000 @@ -159,7 +159,6 @@ (load "language/japanese") (load "language/korean") (load "language/lao") -(load "language/persian") (load "language/tai-viet") (load "language/thai") (load "language/tibetan") === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-08 06:11:29 +0000 +++ src/ChangeLog 2012-08-08 07:19:58 +0000 @@ -1,3 +1,7 @@ +2012-08-08 Glenn Morris + + * lisp.mk (lisp): Remove language/persian.elc. + 2012-08-08 Dmitry Antipov Cleanup intervals. === modified file 'src/lisp.mk' --- src/lisp.mk 2012-08-06 07:37:26 +0000 +++ src/lisp.mk 2012-08-08 07:19:58 +0000 @@ -95,7 +95,6 @@ $(lispsource)/language/japanese.elc \ $(lispsource)/language/korean.elc \ $(lispsource)/language/lao.elc \ - $(lispsource)/language/persian.elc \ $(lispsource)/language/tai-viet.elc \ $(lispsource)/language/thai.elc \ $(lispsource)/language/tibetan.elc \ ------------------------------------------------------------ revno: 109504 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-08-08 10:11:29 +0400 message: Cleanup intervals. * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove. (NULL_INTERVAL_P): Likewise. Adjust users. (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P): Adjust comment. Move under #if 0. * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c: * print.c, syntax.c, textprop.c, xdisp.c: Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-08 05:23:02 +0000 +++ src/ChangeLog 2012-08-08 06:11:29 +0000 @@ -1,5 +1,15 @@ 2012-08-08 Dmitry Antipov + Cleanup intervals. + * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove. + (NULL_INTERVAL_P): Likewise. Adjust users. + (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P): Adjust + comment. Move under #if 0. + * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c: + * print.c, syntax.c, textprop.c, xdisp.c: Adjust users. + +2012-08-08 Dmitry Antipov + Check total length of intervals with eassert. * intervals.h (CHECK_TOTAL_LENGTH): Remove. * intervals.c: Change all users to eassert. === modified file 'src/alloc.c' --- src/alloc.c 2012-08-07 13:37:21 +0000 +++ src/alloc.c 2012-08-08 06:11:29 +0000 @@ -1559,19 +1559,20 @@ /* Mark the interval tree rooted in I. */ -#define MARK_INTERVAL_TREE(i) \ - do { \ - if (!NULL_INTERVAL_P (i) && !i->gcmarkbit) \ - mark_interval_tree (i); \ - } while (0) - - -#define UNMARK_BALANCE_INTERVALS(i) \ - do { \ - if (! NULL_INTERVAL_P (i)) \ - (i) = balance_intervals (i); \ - } while (0) - +#define MARK_INTERVAL_TREE(i) \ + do { \ + if (i && !i->gcmarkbit) \ + mark_interval_tree (i); \ + } while (0) + +/* Unmark and rebalance interval tree rooted in I. */ + +#define UNMARK_BALANCE_INTERVALS(i) \ + do { \ + if (i) \ + (i) = balance_intervals (i); \ + } while (0) + /*********************************************************************** String Allocation ***********************************************************************/ @@ -2100,7 +2101,7 @@ /* String is live; unmark it and its intervals. */ UNMARK_STRING (s); - if (!NULL_INTERVAL_P (s->intervals)) + if (s->intervals) UNMARK_BALANCE_INTERVALS (s->intervals); ++total_strings; @@ -2502,7 +2503,7 @@ return empty_multibyte_string; s = allocate_string (); - s->intervals = NULL_INTERVAL; + s->intervals = NULL; allocate_string_data (s, nchars, nbytes); XSETSTRING (string, s); string_chars_consed += nbytes; @@ -5221,7 +5222,7 @@ } s->size = nchars; s->size_byte = multibyte ? nbytes : -1; - s->intervals = NULL_INTERVAL; + s->intervals = NULL; XSETSTRING (string, s); return string; } @@ -5237,7 +5238,7 @@ s->size = nchars; s->size_byte = -1; s->data = (unsigned char *) data; - s->intervals = NULL_INTERVAL; + s->intervals = NULL; XSETSTRING (string, s); return string; } === modified file 'src/buffer.c' --- src/buffer.c 2012-08-07 13:37:21 +0000 +++ src/buffer.c 2012-08-08 06:11:29 +0000 @@ -360,7 +360,7 @@ BUF_CHARS_MODIFF (b) = 1; BUF_OVERLAY_MODIFF (b) = 1; BUF_SAVE_MODIFF (b) = 1; - BUF_INTERVALS (b) = 0; + BUF_INTERVALS (b) = NULL; BUF_UNCHANGED_MODIFIED (b) = 1; BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1; BUF_END_UNCHANGED (b) = 0; @@ -384,7 +384,7 @@ BVAR (b, zv_marker) = Qnil; name = Fcopy_sequence (buffer_or_name); - STRING_SET_INTERVALS (name, NULL_INTERVAL); + STRING_SET_INTERVALS (name, NULL); BVAR (b, name) = name; BVAR (b, undo_list) = (SREF (name, 0) != ' ') ? Qnil : Qt; @@ -589,7 +589,7 @@ all_buffers = b; name = Fcopy_sequence (name); - STRING_SET_INTERVALS (name, NULL_INTERVAL); + STRING_SET_INTERVALS (name, NULL); BVAR (b, name) = name; reset_buffer (b); @@ -1688,7 +1688,7 @@ m = next; } BUF_MARKERS (b) = NULL; - BUF_INTERVALS (b) = NULL_INTERVAL; + BUF_INTERVALS (b) = NULL; /* Perhaps we should explicitly free the interval tree here... */ } @@ -4904,8 +4904,8 @@ /* No one will share the text with these buffers, but let's play it safe. */ buffer_defaults.indirections = 0; buffer_local_symbols.indirections = 0; - BUF_INTERVALS (&buffer_defaults) = 0; - BUF_INTERVALS (&buffer_local_symbols) = 0; + BUF_INTERVALS (&buffer_defaults) = NULL; + BUF_INTERVALS (&buffer_local_symbols) = NULL; XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); XSETBUFFER (Vbuffer_defaults, &buffer_defaults); XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize); === modified file 'src/editfns.c' --- src/editfns.c 2012-08-07 07:33:18 +0000 +++ src/editfns.c 2012-08-08 06:11:29 +0000 @@ -4637,7 +4637,7 @@ /* Don't use Fset_text_properties: that can cause GC, which can clobber objects stored in the tmp_intervals. */ tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0); - if (!NULL_INTERVAL_P (tmp_interval3)) + if (tmp_interval3) set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3); /* First region smaller than second. */ @@ -4696,11 +4696,11 @@ tmp_interval2 = copy_intervals (cur_intv, start2, len2); tmp_interval3 = validate_interval_range (buf, &startr1, &endr1, 0); - if (!NULL_INTERVAL_P (tmp_interval3)) + if (tmp_interval3) set_text_properties_1 (startr1, endr1, Qnil, buf, tmp_interval3); tmp_interval3 = validate_interval_range (buf, &startr2, &endr2, 0); - if (!NULL_INTERVAL_P (tmp_interval3)) + if (tmp_interval3) set_text_properties_1 (startr2, endr2, Qnil, buf, tmp_interval3); temp = SAFE_ALLOCA (len1_byte); @@ -4729,7 +4729,7 @@ tmp_interval2 = copy_intervals (cur_intv, start2, len2); tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0); - if (!NULL_INTERVAL_P (tmp_interval3)) + if (tmp_interval3) set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3); /* holds region 2 */ @@ -4762,7 +4762,7 @@ tmp_interval2 = copy_intervals (cur_intv, start2, len2); tmp_interval3 = validate_interval_range (buf, &startr1, &endr2, 0); - if (!NULL_INTERVAL_P (tmp_interval3)) + if (tmp_interval3) set_text_properties_1 (startr1, endr2, Qnil, buf, tmp_interval3); /* holds region 1 */ === modified file 'src/fileio.c' --- src/fileio.c 2012-08-07 07:33:18 +0000 +++ src/fileio.c 2012-08-08 06:11:29 +0000 @@ -3145,7 +3145,7 @@ set_buffer_internal (XBUFFER (buffer)); adjust_markers_for_delete (BEG, BEG_BYTE, Z, Z_BYTE); adjust_overlays_for_delete (BEG, Z - BEG); - BUF_INTERVALS (current_buffer) = 0; + BUF_INTERVALS (current_buffer) = NULL; TEMP_SET_PT_BOTH (BEG, BEG_BYTE); /* Now we are safe to change the buffer's multibyteness directly. */ === modified file 'src/fns.c' --- src/fns.c 2012-08-07 13:37:21 +0000 +++ src/fns.c 2012-08-08 06:11:29 +0000 @@ -628,7 +628,7 @@ ptrdiff_t thislen_byte = SBYTES (this); memcpy (SDATA (val) + toindex_byte, SDATA (this), SBYTES (this)); - if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) + if (STRING_INTERVALS (this)) { textprops[num_textprops].argnum = argnum; textprops[num_textprops].from = 0; @@ -640,7 +640,7 @@ /* Copy a single-byte string to a multibyte string. */ else if (STRINGP (this) && STRINGP (val)) { - if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) + if (STRING_INTERVALS (this)) { textprops[num_textprops].argnum = argnum; textprops[num_textprops].from = 0; @@ -1060,7 +1060,7 @@ str_as_multibyte (SDATA (new_string), nbytes, SBYTES (string), NULL); string = new_string; - STRING_SET_INTERVALS (string, NULL_INTERVAL); + STRING_SET_INTERVALS (string, NULL); } return string; } === modified file 'src/insdel.c' --- src/insdel.c 2012-08-07 07:33:18 +0000 +++ src/insdel.c 2012-08-08 06:11:29 +0000 @@ -844,10 +844,10 @@ PT + nchars, PT_BYTE + nbytes, before_markers); - if (BUF_INTERVALS (current_buffer) != 0) + if (BUF_INTERVALS (current_buffer)) offset_intervals (current_buffer, PT, nchars); - if (!inherit && BUF_INTERVALS (current_buffer) != 0) + if (!inherit && BUF_INTERVALS (current_buffer)) set_text_properties (make_number (PT), make_number (PT + nchars), Qnil, Qnil, Qnil); @@ -1017,10 +1017,10 @@ adjust_markers_for_insert (GPT - nchars, GPT_BYTE - nbytes, GPT, GPT_BYTE, 0); - if (BUF_INTERVALS (current_buffer) != 0) + if (BUF_INTERVALS (current_buffer)) { offset_intervals (current_buffer, GPT - nchars, nchars); - graft_intervals_into_buffer (NULL_INTERVAL, GPT - nchars, nchars, + graft_intervals_into_buffer (NULL, GPT - nchars, nchars, current_buffer, 0); } @@ -1157,7 +1157,7 @@ PT_BYTE + outgoing_nbytes, 0); - if (BUF_INTERVALS (current_buffer) != 0) + if (BUF_INTERVALS (current_buffer)) offset_intervals (current_buffer, PT, nchars); /* Get the intervals for the part of the string we are inserting. */ @@ -1225,7 +1225,7 @@ adjust_overlays_for_insert (from, len - nchars_del); else if (len < nchars_del) adjust_overlays_for_delete (from, nchars_del - len); - if (BUF_INTERVALS (current_buffer) != 0) + if (BUF_INTERVALS (current_buffer)) { offset_intervals (current_buffer, from, len - nchars_del); } @@ -1823,7 +1823,7 @@ if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) ++windows_or_buffers_changed; - if (BUF_INTERVALS (current_buffer) != 0) + if (BUF_INTERVALS (current_buffer)) { if (preserve_ptr) { === modified file 'src/intervals.c' --- src/intervals.c 2012-08-08 05:23:02 +0000 +++ src/intervals.c 2012-08-08 06:11:29 +0000 @@ -207,10 +207,10 @@ traverse_intervals_noorder (INTERVAL tree, void (*function) (INTERVAL, Lisp_Object), Lisp_Object arg) { /* Minimize stack usage. */ - while (!NULL_INTERVAL_P (tree)) + while (tree) { (*function) (tree, arg); - if (NULL_INTERVAL_P (tree->right)) + if (!tree->right) tree = tree->left; else { @@ -227,7 +227,7 @@ traverse_intervals (INTERVAL tree, ptrdiff_t position, void (*function) (INTERVAL, Lisp_Object), Lisp_Object arg) { - while (!NULL_INTERVAL_P (tree)) + while (tree) { traverse_intervals (tree->left, position, function, arg); position += LEFT_TOTAL_LENGTH (tree); @@ -262,7 +262,7 @@ { icount = 0; search_interval = i; - found_interval = NULL_INTERVAL; + found_interval = NULL; traverse_intervals_noorder (tree, &check_for_interval, Qnil); return found_interval; } @@ -333,7 +333,7 @@ /* Make A point to c */ interval_set_left (interval, i); - if (! NULL_INTERVAL_P (i)) + if (i) interval_set_parent (i, interval); /* A's total length is decreased by the length of B and its left child. */ @@ -380,7 +380,7 @@ /* Make A point to c */ interval_set_right (interval, i); - if (! NULL_INTERVAL_P (i)) + if (i) interval_set_parent (i, interval); /* A's total length is decreased by the length of B and its right child. */ @@ -480,12 +480,9 @@ INTERVAL balance_intervals (INTERVAL tree) { - if (tree == NULL_INTERVAL) - return NULL_INTERVAL; + return tree ? balance_intervals_internal (tree) : NULL; +} - return balance_intervals_internal (tree); -} - /* Split INTERVAL into two pieces, starting the second piece at character position OFFSET (counting from 0), relative to INTERVAL. INTERVAL becomes the left-hand piece, and the right-hand piece @@ -589,7 +586,7 @@ { Lisp_Object parent; - if (NULL_INTERVAL_P (source)) + if (!source) return 0; if (! INTERVAL_HAS_OBJECT (source)) @@ -617,8 +614,8 @@ to POSITION. */ register ptrdiff_t relative_position; - if (NULL_INTERVAL_P (tree)) - return NULL_INTERVAL; + if (!tree) + return NULL; relative_position = position; if (INTERVAL_HAS_OBJECT (tree)) @@ -669,8 +666,8 @@ register INTERVAL i = interval; register ptrdiff_t next_position; - if (NULL_INTERVAL_P (i)) - return NULL_INTERVAL; + if (!i) + return NULL; next_position = interval->position + LENGTH (interval); if (! NULL_RIGHT_CHILD (i)) @@ -695,7 +692,7 @@ i = INTERVAL_PARENT (i); } - return NULL_INTERVAL; + return NULL; } /* Find the preceding interval (lexicographically) to INTERVAL. @@ -707,8 +704,8 @@ { register INTERVAL i; - if (NULL_INTERVAL_P (interval)) - return NULL_INTERVAL; + if (!interval) + return NULL; if (! NULL_LEFT_CHILD (interval)) { @@ -733,7 +730,7 @@ i = INTERVAL_PARENT (i); } - return NULL_INTERVAL; + return NULL; } /* Find the interval containing POS given some non-NULL INTERVAL @@ -744,8 +741,8 @@ INTERVAL update_interval (register INTERVAL i, ptrdiff_t pos) { - if (NULL_INTERVAL_P (i)) - return NULL_INTERVAL; + if (!i) + return NULL; while (1) { @@ -938,8 +935,8 @@ struct interval newi; RESET_INTERVAL (&newi); - pleft = NULL_INTERVAL_P (prev) ? Qnil : prev->plist; - pright = NULL_INTERVAL_P (i) ? Qnil : i->plist; + pleft = prev ? prev->plist : Qnil; + pright = i ? i->plist : Qnil; interval_set_plist (&newi, merge_properties_sticky (pleft, pright)); if (! prev) /* i.e. position == BEG */ @@ -954,8 +951,7 @@ { prev = split_interval_right (prev, position - prev->position); interval_set_plist (prev, newi.plist); - if (! NULL_INTERVAL_P (i) - && intervals_equal (prev, i)) + if (i && intervals_equal (prev, i)) merge_interval_right (prev); } @@ -1164,16 +1160,16 @@ register INTERVAL migrate, this; register ptrdiff_t migrate_amt; - if (NULL_INTERVAL_P (i->left)) + if (!i->left) return i->right; - if (NULL_INTERVAL_P (i->right)) + if (!i->right) return i->left; migrate = i->left; migrate_amt = i->left->total_length; this = i->right; this->total_length += migrate_amt; - while (! NULL_INTERVAL_P (this->left)) + while (this->left) { this = this->left; this->total_length += migrate_amt; @@ -1204,7 +1200,7 @@ Lisp_Object owner; GET_INTERVAL_OBJECT (owner, i); parent = delete_node (i); - if (! NULL_INTERVAL_P (parent)) + if (parent) interval_set_object (parent, owner); if (BUFFERP (owner)) @@ -1221,13 +1217,13 @@ if (AM_LEFT_CHILD (i)) { interval_set_left (parent, delete_node (i)); - if (! NULL_INTERVAL_P (parent->left)) + if (parent->left) interval_set_parent (parent->left, parent); } else { interval_set_right (parent, delete_node (i)); - if (! NULL_INTERVAL_P (parent->right)) + if (parent->right) interval_set_parent (parent->right, parent); } } @@ -1250,7 +1246,7 @@ { register ptrdiff_t relative_position = from; - if (NULL_INTERVAL_P (tree)) + if (!tree) return 0; /* Left branch. */ @@ -1317,7 +1313,7 @@ GET_INTERVAL_OBJECT (parent, tree); offset = (BUFFERP (parent) ? BUF_BEG (XBUFFER (parent)) : 0); - if (NULL_INTERVAL_P (tree)) + if (!tree) return; eassert (start <= offset + TOTAL_LENGTH (tree) @@ -1325,7 +1321,7 @@ if (length == TOTAL_LENGTH (tree)) { - BUF_INTERVALS (buffer) = NULL_INTERVAL; + BUF_INTERVALS (buffer) = NULL; return; } @@ -1345,7 +1341,7 @@ tree = BUF_INTERVALS (buffer); if (left_to_delete == tree->total_length) { - BUF_INTERVALS (buffer) = NULL_INTERVAL; + BUF_INTERVALS (buffer) = NULL; return; } } @@ -1363,7 +1359,7 @@ void offset_intervals (struct buffer *buffer, ptrdiff_t start, ptrdiff_t length) { - if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) + if (!BUF_INTERVALS (buffer) || length == 0) return; if (length > 0) @@ -1580,17 +1576,17 @@ becomes part of whatever interval it was inserted into. To prevent inheritance, we must clear out the properties of the newly inserted text. */ - if (NULL_INTERVAL_P (source)) + if (!source) { Lisp_Object buf; - if (!inherit && !NULL_INTERVAL_P (tree) && length > 0) + if (!inherit && tree && length > 0) { XSETBUFFER (buf, buffer); set_text_properties_1 (make_number (position), make_number (position + length), Qnil, buf, 0); } - if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer))) + if (BUF_INTERVALS (buffer)) /* Shouldn't be necessary. --Stef */ BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer)); return; @@ -1608,7 +1604,7 @@ eassert (BUF_INTERVALS (buffer)->up_obj == 1); return; } - else if (NULL_INTERVAL_P (tree)) + else if (!tree) { /* Create an interval tree in which to place a copy of the intervals of the inserted string. */ Lisp_Object buf; @@ -1620,7 +1616,7 @@ eassert (TOTAL_LENGTH (tree) > 0); this = under = find_interval (tree, position); - eassert (!NULL_INTERVAL_P (under)); + eassert (under); over = find_interval (source, interval_start_pos (source)); /* Here for insertion in the middle of an interval. @@ -1662,7 +1658,7 @@ have already been copied into target intervals. UNDER is the next interval in the target. */ over_used = 0; - while (! NULL_INTERVAL_P (over)) + while (over) { /* If UNDER is longer than OVER, split it. */ if (LENGTH (over) - over_used < LENGTH (under)) @@ -1695,7 +1691,7 @@ under = next_interval (this); } - if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer))) + if (BUF_INTERVALS (buffer)) BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer)); return; } @@ -1864,7 +1860,7 @@ /* If we have no text properties and overlays, then we can do it quickly. */ - if (NULL_INTERVAL_P (BUF_INTERVALS (current_buffer)) && ! have_overlays) + if (!BUF_INTERVALS (current_buffer) && ! have_overlays) { temp_set_point_both (current_buffer, charpos, bytepos); return; @@ -1911,7 +1907,7 @@ with the same intangible property value, move forward or backward until a change in that property. */ if (NILP (Vinhibit_point_motion_hooks) - && ((! NULL_INTERVAL_P (to) && ! NULL_INTERVAL_P (toprev)) + && ((to && toprev) || have_overlays) /* Intangibility never stops us from positioning at the beginning or end of the buffer, so don't bother checking in that case. */ @@ -2134,7 +2130,7 @@ else abort (); - if (NULL_INTERVAL_P (i) || (i->position + LENGTH (i) <= pos)) + if (!i || (i->position + LENGTH (i) <= pos)) return 0; *val = textget (i->plist, prop); if (NILP (*val)) @@ -2142,14 +2138,13 @@ next = i; /* remember it in advance */ prev = previous_interval (i); - while (! NULL_INTERVAL_P (prev) + while (prev && EQ (*val, textget (prev->plist, prop))) i = prev, prev = previous_interval (prev); *start = i->position; next = next_interval (i); - while (! NULL_INTERVAL_P (next) - && EQ (*val, textget (next->plist, prop))) + while (next && EQ (*val, textget (next->plist, prop))) i = next, next = next_interval (next); *end = i->position + LENGTH (i); @@ -2220,16 +2215,16 @@ register INTERVAL i, new, t; register ptrdiff_t got, prevlen; - if (NULL_INTERVAL_P (tree) || length <= 0) - return NULL_INTERVAL; + if (!tree || length <= 0) + return NULL; i = find_interval (tree, start); - eassert (!NULL_INTERVAL_P (i) && LENGTH (i) > 0); + eassert (i && LENGTH (i) > 0); /* If there is only one interval and it's the default, return nil. */ if ((start - i->position + 1 + length) < LENGTH (i) && DEFAULT_INTERVAL_P (i)) - return NULL_INTERVAL; + return NULL; new = make_interval (); new->position = 0; @@ -2260,7 +2255,7 @@ { INTERVAL interval_copy = copy_intervals (BUF_INTERVALS (buffer), position, length); - if (NULL_INTERVAL_P (interval_copy)) + if (!interval_copy) return; interval_set_object (interval_copy, string); === modified file 'src/intervals.h' --- src/intervals.h 2012-08-08 05:23:02 +0000 +++ src/intervals.h 2012-08-08 06:11:29 +0000 @@ -20,9 +20,6 @@ INLINE_HEADER_BEGIN -#define NULL_INTERVAL ((INTERVAL)0) -#define INTERVAL_DEFAULT NULL_INTERVAL - /* Basic data type for use of intervals. */ struct interval @@ -63,28 +60,25 @@ /* These are macros for dealing with the interval tree. */ -#define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL) - /* True if this interval has no right child. */ -#define NULL_RIGHT_CHILD(i) ((i)->right == NULL_INTERVAL) +#define NULL_RIGHT_CHILD(i) ((i)->right == NULL) /* True if this interval has no left child. */ -#define NULL_LEFT_CHILD(i) ((i)->left == NULL_INTERVAL) +#define NULL_LEFT_CHILD(i) ((i)->left == NULL) /* True if this interval has no parent. */ #define NULL_PARENT(i) ((i)->up_obj || (i)->up.interval == 0) /* True if this interval is the left child of some other interval. */ -#define AM_LEFT_CHILD(i) (! NULL_PARENT (i) \ - && INTERVAL_PARENT (i)->left == (i)) +#define AM_LEFT_CHILD(i) \ + (! NULL_PARENT (i) && INTERVAL_PARENT (i)->left == (i)) /* True if this interval is the right child of some other interval. */ -#define AM_RIGHT_CHILD(i) (! NULL_PARENT (i) \ - && INTERVAL_PARENT (i)->right == (i)) +#define AM_RIGHT_CHILD(i) \ + (! NULL_PARENT (i) && INTERVAL_PARENT (i)->right == (i)) /* True if this interval has no children. */ -#define LEAF_INTERVAL_P(i) ((i)->left == NULL_INTERVAL \ - && (i)->right == NULL_INTERVAL) +#define LEAF_INTERVAL_P(i) ((i)->left == NULL && (i)->right == NULL) /* True if this interval has no parent and is therefore the root. */ #define ROOT_INTERVAL_P(i) (NULL_PARENT (i)) @@ -93,17 +87,16 @@ #define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P ((i)) && LEAF_INTERVAL_P ((i))) /* True if this interval has both left and right children. */ -#define BOTH_KIDS_P(i) ((i)->left != NULL_INTERVAL \ - && (i)->right != NULL_INTERVAL) +#define BOTH_KIDS_P(i) ((i)->left != NULL && (i)->right != NULL) /* The total size of all text represented by this interval and all its children in the tree. This is zero if the interval is null. */ -#define TOTAL_LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (i)->total_length) +#define TOTAL_LENGTH(i) ((i) == NULL ? 0 : (i)->total_length) /* The size of text represented by this interval alone. */ -#define LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (TOTAL_LENGTH ((i)) \ - - TOTAL_LENGTH ((i)->right) \ - - TOTAL_LENGTH ((i)->left))) +#define LENGTH(i) ((i) == NULL ? 0 : (TOTAL_LENGTH ((i)) \ + - TOTAL_LENGTH ((i)->right) \ + - TOTAL_LENGTH ((i)->left))) /* The position of the character just past the end of I. Note that the position cache i->position must be valid for this to work. */ @@ -115,15 +108,14 @@ /* The total size of the right subtree of this interval. */ #define RIGHT_TOTAL_LENGTH(i) ((i)->right ? (i)->right->total_length : 0) - /* These macros are for dealing with the interval properties. */ /* True if this is a default interval, which is the same as being null or having no properties. */ -#define DEFAULT_INTERVAL_P(i) (NULL_INTERVAL_P (i) || EQ ((i)->plist, Qnil)) +#define DEFAULT_INTERVAL_P(i) (!i || EQ ((i)->plist, Qnil)) /* Test what type of parent we have. Three possibilities: another - interval, a buffer or string object, or NULL_INTERVAL. */ + interval, a buffer or string object, or NULL. */ #define INTERVAL_HAS_PARENT(i) ((i)->up_obj == 0 && (i)->up.interval != 0) #define INTERVAL_HAS_OBJECT(i) ((i)->up_obj) @@ -187,7 +179,7 @@ /* Get the parent interval, if any, otherwise a null pointer. Useful for walking up to the root in a "for" loop; use this to get the - "next" value, and test the result to see if it's NULL_INTERVAL. */ + "next" value, and test the result to see if it's NULL. */ #define INTERVAL_PARENT_OR_NULL(i) \ (INTERVAL_HAS_PARENT (i) ? INTERVAL_PARENT (i) : 0) @@ -195,8 +187,8 @@ #define RESET_INTERVAL(i) \ { \ (i)->total_length = (i)->position = 0; \ - (i)->left = (i)->right = NULL_INTERVAL; \ - interval_set_parent (i, NULL_INTERVAL); \ + (i)->left = (i)->right = NULL; \ + interval_set_parent (i, NULL); \ (i)->write_protect = 0; \ (i)->visible = 0; \ (i)->front_sticky = (i)->rear_sticky = 0; \ @@ -232,39 +224,36 @@ /* Is this interval visible? Replace later with cache access. */ #define INTERVAL_VISIBLE_P(i) \ - (! NULL_INTERVAL_P (i) && NILP (textget ((i)->plist, Qinvisible))) + (i && NILP (textget ((i)->plist, Qinvisible))) /* Is this interval writable? Replace later with cache access. */ #define INTERVAL_WRITABLE_P(i) \ - (! NULL_INTERVAL_P (i) \ - && (NILP (textget ((i)->plist, Qread_only)) \ - || ((CONSP (Vinhibit_read_only) \ - ? !NILP (Fmemq (textget ((i)->plist, Qread_only), \ - Vinhibit_read_only)) \ - : !NILP (Vinhibit_read_only))))) \ + (i && (NILP (textget ((i)->plist, Qread_only)) \ + || ((CONSP (Vinhibit_read_only) \ + ? !NILP (Fmemq (textget ((i)->plist, Qread_only), \ + Vinhibit_read_only)) \ + : !NILP (Vinhibit_read_only))))) \ /* Macros to tell whether insertions before or after this interval - should stick to it. */ -/* Replace later with cache access */ -/*#define FRONT_STICKY_P(i) ((i)->front_sticky != 0) - #define END_STICKY_P(i) ((i)->rear_sticky != 0)*/ -/* As we now have Vtext_property_default_nonsticky, these macros are - unreliable now. Currently, they are never used. */ -#define FRONT_STICKY_P(i) \ - (! NULL_INTERVAL_P (i) && ! NILP (textget ((i)->plist, Qfront_sticky))) -#define END_NONSTICKY_P(i) \ - (! NULL_INTERVAL_P (i) && ! NILP (textget ((i)->plist, Qrear_nonsticky))) -#define FRONT_NONSTICKY_P(i) \ - (! NULL_INTERVAL_P (i) && ! EQ (Qt, textget ((i)->plist, Qfront_sticky))) + should stick to it. Now we have Vtext_property_default_nonsticky, + so these macros are unreliable now and never used. */ +#if 0 +#define FRONT_STICKY_P(i) \ + (i && ! NILP (textget ((i)->plist, Qfront_sticky))) +#define END_NONSTICKY_P(i) \ + (i && ! NILP (textget ((i)->plist, Qrear_nonsticky))) +#define FRONT_NONSTICKY_P(i) \ + (i && ! EQ (Qt, textget ((i)->plist, Qfront_sticky))) +#endif /* If PROP is the `invisible' property of a character, this is 1 if the character should be treated as invisible, and 2 if it is invisible but with an ellipsis. */ -#define TEXT_PROP_MEANS_INVISIBLE(prop) \ +#define TEXT_PROP_MEANS_INVISIBLE(prop) \ (EQ (BVAR (current_buffer, invisibility_spec), Qt) \ - ? !NILP (prop) \ + ? !NILP (prop) \ : invisible_p (prop, BVAR (current_buffer, invisibility_spec))) /* Declared in alloc.c. */ === modified file 'src/print.c' --- src/print.c 2012-08-07 07:42:34 +0000 +++ src/print.c 2012-08-08 06:11:29 +0000 @@ -1408,7 +1408,7 @@ if (! EQ (Vprint_charset_text_property, Qt)) obj = print_prune_string_charset (obj); - if (!NULL_INTERVAL_P (STRING_INTERVALS (obj))) + if (STRING_INTERVALS (obj)) { PRINTCHAR ('#'); PRINTCHAR ('('); @@ -1499,7 +1499,7 @@ } PRINTCHAR ('\"'); - if (!NULL_INTERVAL_P (STRING_INTERVALS (obj))) + if (STRING_INTERVALS (obj)) { traverse_intervals (STRING_INTERVALS (obj), 0, print_interval, printcharfun); === modified file 'src/syntax.c' --- src/syntax.c 2012-08-04 14:33:00 +0000 +++ src/syntax.c 2012-08-08 06:11:29 +0000 @@ -171,7 +171,7 @@ direction than the intervals - or in an interval. We update the current syntax-table basing on the property of this interval, and update the interval to start further than CHARPOS - or be - NULL_INTERVAL. We also update lim_property to be the next value of + NULL. We also update lim_property to be the next value of charpos to call this subroutine again - or be before/after the start/end of OBJECT. */ @@ -192,7 +192,7 @@ i = interval_of (charpos, object); gl_state.backward_i = gl_state.forward_i = i; invalidate = 0; - if (NULL_INTERVAL_P (i)) + if (!i) return; /* interval_of updates only ->position of the return value, so update the parents manually to speed up update_interval. */ @@ -217,7 +217,7 @@ /* We are guaranteed to be called with CHARPOS either in i, or further off. */ - if (NULL_INTERVAL_P (i)) + if (!i) error ("Error in syntax_table logic for to-the-end intervals"); else if (charpos < i->position) /* Move left. */ { @@ -287,7 +287,7 @@ } } - while (!NULL_INTERVAL_P (i)) + while (i) { if (cnt && !EQ (tmp_table, textget (i->plist, Qsyntax_table))) { @@ -313,7 +313,7 @@ /* e_property at EOB is not set to ZV but to ZV+1, so that we can do INC(from);UPDATE_SYNTAX_TABLE_FORWARD without having to check eob between the two. */ - + (NULL_INTERVAL_P (next_interval (i)) ? 1 : 0); + + (next_interval (i) ? 0 : 1); gl_state.forward_i = i; } else @@ -326,7 +326,7 @@ cnt++; i = count > 0 ? next_interval (i) : previous_interval (i); } - eassert (NULL_INTERVAL_P (i)); /* This property goes to the end. */ + eassert (i == NULL); /* This property goes to the end. */ if (count > 0) gl_state.e_property = gl_state.stop; else === modified file 'src/textprop.c' --- src/textprop.c 2012-08-07 11:28:41 +0000 +++ src/textprop.c 2012-08-08 06:11:29 +0000 @@ -105,7 +105,7 @@ Fprevious_property_change which call this function with BEGIN == END. Handle this case specially. - If FORCE is soft (0), it's OK to return NULL_INTERVAL. Otherwise, + If FORCE is soft (0), it's OK to return NULL. Otherwise, create an interval tree for OBJECT if one doesn't exist, provided the object actually contains text. In the current design, if there is no text, there can be no text properties. */ @@ -126,7 +126,7 @@ /* If we are asked for a point, but from a subr which operates on a range, then return nothing. */ if (EQ (*begin, *end) && begin != end) - return NULL_INTERVAL; + return NULL; if (XINT (*begin) > XINT (*end)) { @@ -147,7 +147,7 @@ /* If there's no text, there are no properties. */ if (BUF_BEGV (b) == BUF_ZV (b)) - return NULL_INTERVAL; + return NULL; searchpos = XINT (*begin); } @@ -164,12 +164,12 @@ i = STRING_INTERVALS (object); if (len == 0) - return NULL_INTERVAL; + return NULL; searchpos = XINT (*begin); } - if (NULL_INTERVAL_P (i)) + if (!i) return (force ? create_root_interval (object) : i); return find_interval (i, searchpos); @@ -500,7 +500,7 @@ if (NILP (object)) XSETBUFFER (object, current_buffer); else if (EQ (object, Qt)) - return NULL_INTERVAL; + return NULL; CHECK_STRING_OR_BUFFER (object); @@ -521,8 +521,8 @@ if (!(beg <= position && position <= end)) args_out_of_range (make_number (position), make_number (position)); - if (beg == end || NULL_INTERVAL_P (i)) - return NULL_INTERVAL; + if (beg == end || !i) + return NULL; return find_interval (i, position); } @@ -542,7 +542,7 @@ XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &position, &position, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; /* If POSITION is at the end of the interval, it means it's the end of OBJECT. @@ -922,12 +922,12 @@ bother checking further intervals. */ if (EQ (limit, Qt)) { - if (NULL_INTERVAL_P (i)) + if (!i) next = i; else next = next_interval (i); - if (NULL_INTERVAL_P (next)) + if (!next) XSETFASTINT (position, (STRINGP (object) ? SCHARS (object) : BUF_ZV (XBUFFER (object)))); @@ -936,16 +936,16 @@ return position; } - if (NULL_INTERVAL_P (i)) + if (!i) return limit; next = next_interval (i); - while (!NULL_INTERVAL_P (next) && intervals_equal (i, next) + while (next && intervals_equal (i, next) && (NILP (limit) || next->position < XFASTINT (limit))) next = next_interval (next); - if (NULL_INTERVAL_P (next) + if (!next || (next->position >= (INTEGERP (limit) ? XFASTINT (limit) @@ -983,17 +983,17 @@ CHECK_NUMBER_COERCE_MARKER (limit); i = validate_interval_range (object, &position, &position, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return limit; here_val = textget (i->plist, prop); next = next_interval (i); - while (! NULL_INTERVAL_P (next) + while (next && EQ (here_val, textget (next->plist, prop)) && (NILP (limit) || next->position < XFASTINT (limit))) next = next_interval (next); - if (NULL_INTERVAL_P (next) + if (!next || (next->position >= (INTEGERP (limit) ? XFASTINT (limit) @@ -1029,7 +1029,7 @@ CHECK_NUMBER_COERCE_MARKER (limit); i = validate_interval_range (object, &position, &position, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return limit; /* Start with the interval containing the char before point. */ @@ -1037,12 +1037,12 @@ i = previous_interval (i); previous = previous_interval (i); - while (!NULL_INTERVAL_P (previous) && intervals_equal (previous, i) + while (previous && intervals_equal (previous, i) && (NILP (limit) || (previous->position + LENGTH (previous) > XFASTINT (limit)))) previous = previous_interval (previous); - if (NULL_INTERVAL_P (previous) + if (!previous || (previous->position + LENGTH (previous) <= (INTEGERP (limit) ? XFASTINT (limit) @@ -1080,21 +1080,21 @@ i = validate_interval_range (object, &position, &position, soft); /* Start with the interval containing the char before point. */ - if (!NULL_INTERVAL_P (i) && i->position == XFASTINT (position)) + if (i && i->position == XFASTINT (position)) i = previous_interval (i); - if (NULL_INTERVAL_P (i)) + if (!i) return limit; here_val = textget (i->plist, prop); previous = previous_interval (i); - while (!NULL_INTERVAL_P (previous) + while (previous && EQ (here_val, textget (previous->plist, prop)) && (NILP (limit) || (previous->position + LENGTH (previous) > XFASTINT (limit)))) previous = previous_interval (previous); - if (NULL_INTERVAL_P (previous) + if (!previous || (previous->position + LENGTH (previous) <= (INTEGERP (limit) ? XFASTINT (limit) @@ -1130,7 +1130,7 @@ XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &start, &end, hard); - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; s = XINT (start); @@ -1277,13 +1277,13 @@ if (! STRING_INTERVALS (object)) return Qnil; - STRING_SET_INTERVALS (object, NULL_INTERVAL); + STRING_SET_INTERVALS (object, NULL); return Qt; } i = validate_interval_range (object, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) { /* If buffer has no properties, and we want none, return now. */ if (NILP (properties)) @@ -1296,7 +1296,7 @@ i = validate_interval_range (object, &start, &end, hard); /* This can return if start == end. */ - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; } @@ -1321,7 +1321,7 @@ void set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i) { - register INTERVAL prev_changed = NULL_INTERVAL; + register INTERVAL prev_changed = NULL; register ptrdiff_t s, len; INTERVAL unchanged; @@ -1378,7 +1378,7 @@ merge the intervals, so as to make the undo records and cause redisplay to happen. */ set_properties (properties, i, buffer); - if (!NULL_INTERVAL_P (prev_changed)) + if (prev_changed) merge_interval_left (i); return; } @@ -1389,7 +1389,7 @@ merge the intervals, so as to make the undo records and cause redisplay to happen. */ set_properties (properties, i, buffer); - if (NULL_INTERVAL_P (prev_changed)) + if (!prev_changed) prev_changed = i; else prev_changed = i = merge_interval_left (i); @@ -1421,7 +1421,7 @@ XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; s = XINT (start); @@ -1508,7 +1508,7 @@ XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; s = XINT (start); @@ -1613,11 +1613,11 @@ if (NILP (object)) XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return (!NILP (value) || EQ (start, end) ? Qnil : start); e = XINT (end); - while (! NULL_INTERVAL_P (i)) + while (i) { if (i->position >= e) break; @@ -1649,12 +1649,12 @@ if (NILP (object)) XSETBUFFER (object, current_buffer); i = validate_interval_range (object, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return (NILP (value) || EQ (start, end)) ? Qnil : start; s = XINT (start); e = XINT (end); - while (! NULL_INTERVAL_P (i)) + while (i) { if (i->position >= e) break; @@ -1759,7 +1759,7 @@ struct gcpro gcpro1, gcpro2; i = validate_interval_range (src, &start, &end, soft); - if (NULL_INTERVAL_P (i)) + if (!i) return Qnil; CHECK_NUMBER_COERCE_MARKER (pos); @@ -1811,7 +1811,7 @@ } i = next_interval (i); - if (NULL_INTERVAL_P (i)) + if (!i) break; p += len; @@ -1852,7 +1852,7 @@ result = Qnil; i = validate_interval_range (object, &start, &end, soft); - if (!NULL_INTERVAL_P (i)) + if (i) { ptrdiff_t s = XINT (start); ptrdiff_t e = XINT (end); @@ -1884,7 +1884,7 @@ result); i = next_interval (i); - if (NULL_INTERVAL_P (i)) + if (!i) break; s = i->position; } @@ -2007,7 +2007,7 @@ interval_insert_behind_hooks = Qnil; interval_insert_in_front_hooks = Qnil; - if (NULL_INTERVAL_P (intervals)) + if (!intervals) return; if (start > end) @@ -2048,7 +2048,7 @@ indirectly defined via the category property. */ if (i != prev) { - if (! NULL_INTERVAL_P (i)) + if (i) { after = textget (i->plist, Qread_only); @@ -2068,7 +2068,7 @@ } } - if (! NULL_INTERVAL_P (prev)) + if (prev) { before = textget (prev->plist, Qread_only); @@ -2088,7 +2088,7 @@ } } } - else if (! NULL_INTERVAL_P (i)) + else if (i) { after = textget (i->plist, Qread_only); @@ -2115,10 +2115,10 @@ } /* Run both insert hooks (just once if they're the same). */ - if (!NULL_INTERVAL_P (prev)) + if (prev) interval_insert_behind_hooks = textget (prev->plist, Qinsert_behind_hooks); - if (!NULL_INTERVAL_P (i)) + if (i) interval_insert_in_front_hooks = textget (i->plist, Qinsert_in_front_hooks); } @@ -2146,7 +2146,7 @@ i = next_interval (i); } /* Keep going thru the interval containing the char before END. */ - while (! NULL_INTERVAL_P (i) && i->position < end); + while (i && i->position < end); if (!inhibit_modification_hooks) { === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-07 07:42:34 +0000 +++ src/xdisp.c 2012-08-08 06:11:29 +0000 @@ -3321,7 +3321,7 @@ interval if there isn't such an interval. */ position = make_number (charpos); iv = validate_interval_range (object, &position, &position, 0); - if (!NULL_INTERVAL_P (iv)) + if (iv) { Lisp_Object values_here[LAST_PROP_IDX]; struct props *p; @@ -3333,7 +3333,7 @@ /* Look for an interval following iv that has different properties. */ for (next_iv = next_interval (iv); - (!NULL_INTERVAL_P (next_iv) + (next_iv && (NILP (limit) || XFASTINT (limit) > next_iv->position)); next_iv = next_interval (next_iv)) @@ -3351,7 +3351,7 @@ break; } - if (!NULL_INTERVAL_P (next_iv)) + if (next_iv) { if (INTEGERP (limit) && next_iv->position >= XFASTINT (limit))