aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2012-01-14 22:41:53 -0800
committerPaul Eggert2012-01-14 22:41:53 -0800
commit807f82fcebc7d946baa23f1d29ff5b0cf336f08e (patch)
treefa41cebf5b9c6d3bb6a22517a7002fe3a398588f /src
parent35cf62d95cdcd5323dcea4a5385942c342ff1d9c (diff)
parent861df977526140af8147bef4950e8863655c203d (diff)
downloademacs-807f82fcebc7d946baa23f1d29ff5b0cf336f08e.tar.gz
emacs-807f82fcebc7d946baa23f1d29ff5b0cf336f08e.zip
Merge from trunk.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog46
-rw-r--r--src/ChangeLog.115
-rw-r--r--src/bidi.c2
-rw-r--r--src/dispnew.c2
-rw-r--r--src/emacs.c8
-rw-r--r--src/epaths.in29
-rw-r--r--src/keyboard.c6
-rw-r--r--src/lread.c205
-rw-r--r--src/w32fns.c5
-rw-r--r--src/xdisp.c63
10 files changed, 258 insertions, 113 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 00202258d02..a989246335d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,4 @@
12012-01-09 Paul Eggert <eggert@cs.ucla.edu> 12012-01-15 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Fix integer width and related bugs (Bug#9874). 3 Fix integer width and related bugs (Bug#9874).
4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): 4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
@@ -788,6 +788,42 @@
788 rather than rolling our own approximation. 788 rather than rolling our own approximation.
789 (SCROLL_BAR_VEC_SIZE): Remove; not used. 789 (SCROLL_BAR_VEC_SIZE): Remove; not used.
790 790
7912012-01-14 Eli Zaretskii <eliz@gnu.org>
792
793 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
794 thrashing the stack of the thread. (Bug#9087)
795
7962012-01-12 Paul Eggert <eggert@cs.ucla.edu>
797
798 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
799
8002012-01-11 Eli Zaretskii <eliz@gnu.org>
801
802 * xdisp.c (rows_from_pos_range): Handle the case where the
803 highlight ends on a newline. (Bug#10464)
804 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
805 he end column for display of highlight that ends on a newline
806 before a R2L line.
807
8082012-01-11 Glenn Morris <rgm@gnu.org>
809
810 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
811 from load-path also when installation-directory is nil. (Bug#10208)
812
8132012-01-10 Glenn Morris <rgm@gnu.org>
814
815 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
816
817 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
818 Update template values to be closer to their typical values these days.
819
8202012-01-09 Eli Zaretskii <eliz@gnu.org>
821
822 * xdisp.c (rows_from_pos_range): Accept additional argument
823 DISP_STRING, and accept any glyph in a row whose object is that
824 string as eligible for mouse highlight. Fixes mouse highlight of
825 display strings from overlays. (Bug#10464)
826
7912012-01-07 Paul Eggert <eggert@cs.ucla.edu> 8272012-01-07 Paul Eggert <eggert@cs.ucla.edu>
792 828
793 emacs: fix an auto-save permissions race condition (Bug#10400) 829 emacs: fix an auto-save permissions race condition (Bug#10400)
@@ -896,7 +932,7 @@
896 (trackingNotification): Surround with ifdef NS_IMPL_COCOA. 932 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
897 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA. 933 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
898 934
8992011-12-18 David Reitter <reitter@cmu.edu> 9352011-12-18 David Reitter <reitter@cmu.edu>
900 936
901 * nsterm.m (ns_term_init): Subscribe for notifications 937 * nsterm.m (ns_term_init): Subscribe for notifications
902 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification 938 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
@@ -6545,7 +6581,7 @@
6545 where the include path doesn't have X11/X.h by default. See 6581 where the include path doesn't have X11/X.h by default. See
6546 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>. 6582 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
6547 6583
65482011-05-20 Kenichi Handa <handa@m17n.org> 65842011-05-20 Kenichi Handa <handa@m17n.org>
6549 6585
6550 * composite.c (find_automatic_composition): Fix previous change. 6586 * composite.c (find_automatic_composition): Fix previous change.
6551 6587
@@ -6887,7 +6923,7 @@
6887 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end 6923 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
6888 marker. (Bug#8610) 6924 marker. (Bug#8610)
6889 6925
68902011-05-05 Eli Zaretskii <eliz@gnu.org> 69262011-05-05 Eli Zaretskii <eliz@gnu.org>
6891 6927
6892 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]: 6928 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
6893 New version that can reserve upto 2GB of heap space. 6929 New version that can reserve upto 2GB of heap space.
@@ -9091,7 +9127,7 @@
9091 are now in src/globals.h. 9127 are now in src/globals.h.
9092 (syms_of_minibuf): Remove spurious & from previous change. 9128 (syms_of_minibuf): Remove spurious & from previous change.
9093 9129
90942011-03-20 Leo <sdl.web@gmail.com> 91302011-03-20 Leo Liu <sdl.web@gmail.com>
9095 9131
9096 * minibuf.c (completing-read-function): New variable. 9132 * minibuf.c (completing-read-function): New variable.
9097 (completing-read-default): Rename from completing-read. 9133 (completing-read-default): Rename from completing-read.
diff --git a/src/ChangeLog.11 b/src/ChangeLog.11
index 6c361399535..e8bfd964312 100644
--- a/src/ChangeLog.11
+++ b/src/ChangeLog.11
@@ -3538,7 +3538,6 @@
3538 * nsmenu.m (syms_of_nsmenu): 3538 * nsmenu.m (syms_of_nsmenu):
3539 * nsfns.m (syms_of_nsfns): 3539 * nsfns.m (syms_of_nsfns):
3540 * msdos.c (syms_of_msdos): 3540 * msdos.c (syms_of_msdos):
3541
3542 * image.c (syms_of_image): 3541 * image.c (syms_of_image):
3543 * charset.c (syms_of_charset): Use intern_c_string instead of intern. 3542 * charset.c (syms_of_charset): Use intern_c_string instead of intern.
3544 3543
@@ -4388,7 +4387,7 @@
4388 * xml.c (Fxml_parse_string, Fxml_parse_string): Revert last change. 4387 * xml.c (Fxml_parse_string, Fxml_parse_string): Revert last change.
4389 Don't make first argument optional. Doc fix. 4388 Don't make first argument optional. Doc fix.
4390 4389
43912010-09-14 Leo <sdl.web@gmail.com> (tiny change) 43902010-09-14 Leo Liu <sdl.web@gmail.com> (tiny change)
4392 4391
4393 * xml.c (Fxml_parse_string, Fhtml_parse_string): Fix up the 4392 * xml.c (Fxml_parse_string, Fhtml_parse_string): Fix up the
4394 parameters for the doc string. 4393 parameters for the doc string.
@@ -29523,7 +29522,7 @@
29523 (Fdisplay_buffer): Use it. 29522 (Fdisplay_buffer): Use it.
29524 (syms_of_window): Export, and initialize it. 29523 (syms_of_window): Export, and initialize it.
29525 29524
295262007-09-06 Pixel <pixel@mandriva.com> (tiny change) 295252007-09-06 Pascal Rigaux <pixel@mandriva.com> (tiny change)
29527 29526
29528 * image.c (gif_load): Fix bug: Handle nonexistent colormap. 29527 * image.c (gif_load): Fix bug: Handle nonexistent colormap.
29529 29528
diff --git a/src/bidi.c b/src/bidi.c
index a2d857469cc..99936d93e4f 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -572,7 +572,7 @@ bidi_cache_find (ptrdiff_t charpos, int level, struct bidi_it *bidi_it)
572 572
573 bidi_copy_it (bidi_it, &bidi_cache[i]); 573 bidi_copy_it (bidi_it, &bidi_cache[i]);
574 bidi_cache_last_idx = i; 574 bidi_cache_last_idx = i;
575 /* Don't let scan direction from from the cached state override 575 /* Don't let scan direction from the cached state override
576 the current scan direction. */ 576 the current scan direction. */
577 bidi_it->scan_dir = current_scan_dir; 577 bidi_it->scan_dir = current_scan_dir;
578 return bidi_it->type; 578 return bidi_it->type;
diff --git a/src/dispnew.c b/src/dispnew.c
index 5290b60972a..749523158cb 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -62,7 +62,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
62#include <errno.h> 62#include <errno.h>
63 63
64/* Get number of chars of output now in the buffer of a stdio stream. 64/* Get number of chars of output now in the buffer of a stdio stream.
65 This ought to be built in in stdio, but it isn't. Some s- files 65 This ought to be built in stdio, but it isn't. Some s- files
66 override this because their stdio internals differ. */ 66 override this because their stdio internals differ. */
67 67
68#ifdef __GNU_LIBRARY__ 68#ifdef __GNU_LIBRARY__
diff --git a/src/emacs.c b/src/emacs.c
index b8abcef6cbd..29bc44191ab 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2485,9 +2485,11 @@ The value is nil if that directory's name is not known. */);
2485 2485
2486 DEFVAR_LISP ("installation-directory", Vinstallation_directory, 2486 DEFVAR_LISP ("installation-directory", Vinstallation_directory,
2487 doc: /* A directory within which to look for the `lib-src' and `etc' directories. 2487 doc: /* A directory within which to look for the `lib-src' and `etc' directories.
2488This is non-nil when we can't find those directories in their standard 2488In an installed Emacs, this is normally nil. It is non-nil if
2489installed locations, but we can find them near where the Emacs executable 2489both `lib-src' (on MS-DOS, `info') and `etc' directories are found
2490was found. */); 2490within the variable `invocation-directory' or its parent. For example,
2491this is the case when running an uninstalled Emacs executable from its
2492build directory. */);
2491 Vinstallation_directory = Qnil; 2493 Vinstallation_directory = Qnil;
2492 2494
2493 DEFVAR_LISP ("system-messages-locale", Vsystem_messages_locale, 2495 DEFVAR_LISP ("system-messages-locale", Vsystem_messages_locale,
diff --git a/src/epaths.in b/src/epaths.in
index 9ce1cefd211..17cb65a3234 100644
--- a/src/epaths.in
+++ b/src/epaths.in
@@ -19,14 +19,21 @@ You should have received a copy of the GNU General Public License
19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21 21
22/* The default search path for Lisp function "load". 22/* The default value of load-path, which is the search path for
23 This sets load-path. */ 23 the Lisp function "load". Configure (using "make epaths-force")
24#define PATH_LOADSEARCH "/usr/local/lib/emacs/lisp" 24 sets this to $lisppath, which typically has a value like:
25 25 <datadir>/emacs/VERSION/site-lisp:<datadir>/emacs/site-lisp:
26/* Like PATH_LOADSEARCH, but used only when Emacs is dumping. This 26 <datadir>/emacs/VERSION/lisp:<datadir>/emacs/VERSION/leim
27 path is usually identical to PATH_LOADSEARCH except that the entry 27 where datadir is eg /usr/local/share.
28 for the directory containing the installed lisp files has been 28 Configure prepends any $locallisppath, as set by the
29 replaced with ../lisp. */ 29 --enable-locallisppath argument.
30*/
31#define PATH_LOADSEARCH "/usr/local/share/emacs/lisp"
32
33/* Like PATH_LOADSEARCH, but used only during the build process
34 when Emacs is dumping. Configure (using "make epaths-force") sets
35 this to $buildlisppath, which normally has the value: <srcdir>/lisp.
36*/
30#define PATH_DUMPLOADSEARCH "../lisp" 37#define PATH_DUMPLOADSEARCH "../lisp"
31 38
32/* The extra search path for programs to invoke. This is appended to 39/* The extra search path for programs to invoke. This is appended to
@@ -34,12 +41,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
34 variable exec-path and the first file name in it sets the Lisp 41 variable exec-path and the first file name in it sets the Lisp
35 variable exec-directory. exec-directory is used for finding 42 variable exec-directory. exec-directory is used for finding
36 executables and other architecture-dependent files. */ 43 executables and other architecture-dependent files. */
37#define PATH_EXEC "/usr/local/lib/emacs/etc" 44#define PATH_EXEC "/usr/local/libexec/emacs"
38 45
39/* Where Emacs should look for its architecture-independent data 46/* Where Emacs should look for its architecture-independent data
40 files, like the NEWS file. The lisp variable data-directory 47 files, like the NEWS file. The lisp variable data-directory
41 is set to this value. */ 48 is set to this value. */
42#define PATH_DATA "/usr/local/lib/emacs/data" 49#define PATH_DATA "/usr/local/share/emacs/etc"
43 50
44/* Where Emacs should look for X bitmap files. 51/* Where Emacs should look for X bitmap files.
45 The lisp variable x-bitmap-file-path is set based on this value. */ 52 The lisp variable x-bitmap-file-path is set based on this value. */
@@ -47,7 +54,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
47 54
48/* Where Emacs should look for its docstring file. The lisp variable 55/* Where Emacs should look for its docstring file. The lisp variable
49 doc-directory is set to this value. */ 56 doc-directory is set to this value. */
50#define PATH_DOC "/usr/local/lib/emacs/data" 57#define PATH_DOC "/usr/local/share/emacs/etc"
51 58
52/* Where the configuration process believes the info tree lives. The 59/* Where the configuration process believes the info tree lives. The
53 lisp variable configure-info-directory gets its value from this 60 lisp variable configure-info-directory gets its value from this
diff --git a/src/keyboard.c b/src/keyboard.c
index 177034f91ca..da15f663a0d 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2237,8 +2237,8 @@ do { if (polling_stopped_here) start_polling (); \
2237 polling_stopped_here = 0; } while (0) 2237 polling_stopped_here = 0; } while (0)
2238 2238
2239/* read a character from the keyboard; call the redisplay if needed */ 2239/* read a character from the keyboard; call the redisplay if needed */
2240/* commandflag 0 means do not do auto-saving, but do do redisplay. 2240/* commandflag 0 means do not autosave, but do redisplay.
2241 -1 means do not do redisplay, but do do autosaving. 2241 -1 means do not redisplay, but do autosave.
2242 1 means do both. */ 2242 1 means do both. */
2243 2243
2244/* The arguments MAPS and NMAPS are for menu prompting. 2244/* The arguments MAPS and NMAPS are for menu prompting.
@@ -5133,7 +5133,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
5133 5133
5134 if (WINDOWP (window)) 5134 if (WINDOWP (window))
5135 { 5135 {
5136 /* It's a click in window window at frame coordinates (x,y) */ 5136 /* It's a click in window WINDOW at frame coordinates (X,Y) */
5137 struct window *w = XWINDOW (window); 5137 struct window *w = XWINDOW (window);
5138 Lisp_Object string_info = Qnil; 5138 Lisp_Object string_info = Qnil;
5139 ptrdiff_t textpos = -1; 5139 ptrdiff_t textpos = -1;
diff --git a/src/lread.c b/src/lread.c
index 2a7b7a8585d..256624da046 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4115,7 +4115,46 @@ init_lread (void)
4115 const char *normal; 4115 const char *normal;
4116 int turn_off_warning = 0; 4116 int turn_off_warning = 0;
4117 4117
4118 /* Compute the default load-path. */ 4118 /* Compute the default Vload-path, with the following logic:
4119 If CANNOT_DUMP just use PATH_LOADSEARCH.
4120 Else if purify-flag (ie dumping) start from PATH_DUMPLOADSEARCH;
4121 otherwise start from PATH_LOADSEARCH.
4122 If !initialized, then just set both Vload_path and dump_path.
4123 If initialized, then if Vload_path != dump_path, do nothing.
4124 (Presumably the load-path has already been changed by something.)
4125 Also do nothing if Vinstallation_directory is nil.
4126 Otherwise:
4127 Remove site-lisp directories from the front of load-path.
4128 Add installation-dir/lisp (if exists and not already a member),
4129 at the front, and turn off warnings about missing directories
4130 (because we are presumably running uninstalled).
4131 If it does not exist, add dump_path at the end instead.
4132 Add installation-dir/leim (if exists and not already a member)
4133 at the front.
4134 Add installation-dir/site-lisp (if !no_site_lisp, and exists
4135 and not already a member) at the front.
4136 If installation-dir != source-dir (ie running an uninstalled,
4137 out-of-tree build) AND install-dir/src/Makefile exists BUT
4138 install-dir/src/Makefile.in does NOT exist (this is a sanity
4139 check), then repeat the above steps for source-dir/lisp,
4140 leim and site-lisp.
4141 Finally, add the previously removed site-lisp directories back
4142 at the front (if !no_site_lisp).
4143
4144 We then warn about any of the load-path elements that do not
4145 exist. The only ones that might not exist are those from
4146 PATH_LOADSEARCH, and perhaps dump_path.
4147
4148 Having done all this, we then throw it all away if purify-flag is
4149 nil (ie, not dumping) and EMACSLOADPATH is set, and just
4150 unconditionally use the latter value instead.
4151 So AFAICS the only net results of all the previous steps will be
4152 possibly to issue some irrelevant warnings.
4153
4154 FIXME? There's a case for saying that if we are running
4155 uninstalled, the eventual installation directories should not yet
4156 be included in load-path.
4157 */
4119#ifdef CANNOT_DUMP 4158#ifdef CANNOT_DUMP
4120 normal = PATH_LOADSEARCH; 4159 normal = PATH_LOADSEARCH;
4121 Vload_path = decode_env_path (0, normal); 4160 Vload_path = decode_env_path (0, normal);
@@ -4125,23 +4164,28 @@ init_lread (void)
4125 else 4164 else
4126 normal = PATH_DUMPLOADSEARCH; 4165 normal = PATH_DUMPLOADSEARCH;
4127 4166
4128 /* In a dumped Emacs, we normally have to reset the value of 4167 /* In a dumped Emacs, we normally reset the value of Vload_path using
4129 Vload_path from PATH_LOADSEARCH, since the value that was dumped 4168 PATH_LOADSEARCH, since the value that was dumped uses lisp/ in
4130 uses ../lisp, instead of the path of the installed elisp 4169 the source directory, instead of the path of the installed elisp
4131 libraries. However, if it appears that Vload_path was changed 4170 libraries. However, if it appears that Vload_path has already been
4132 from the default before dumping, don't override that value. */ 4171 changed from the default that was saved before dumping, don't
4172 change it further. */
4133 if (initialized) 4173 if (initialized)
4134 { 4174 {
4135 if (! NILP (Fequal (dump_path, Vload_path))) 4175 if (! NILP (Fequal (dump_path, Vload_path)))
4136 { 4176 {
4137 Vload_path = decode_env_path (0, normal); 4177 Vload_path = decode_env_path (0, normal);
4138 if (!NILP (Vinstallation_directory)) 4178 if (no_site_lisp || !NILP (Vinstallation_directory))
4139 { 4179 {
4140 Lisp_Object tem, tem1, sitelisp; 4180 Lisp_Object tem, tem1, sitelisp;
4141 4181
4142 /* Remove site-lisp dirs from path temporarily and store 4182 /* Remove "site-lisp" dirs from front of path temporarily
4143 them in sitelisp, then conc them on at the end so 4183 and store them in sitelisp, then conc them on at the
4144 they're always first in path. */ 4184 end so they're always first in path.
4185 Note that this won't work if you used a
4186 --enable-locallisppath element that does not happen
4187 to contain "site-lisp" in its name.
4188 */
4145 sitelisp = Qnil; 4189 sitelisp = Qnil;
4146 while (1) 4190 while (1)
4147 { 4191 {
@@ -4157,96 +4201,99 @@ init_lread (void)
4157 break; 4201 break;
4158 } 4202 }
4159 4203
4160 /* Add to the path the lisp subdir of the 4204 if (!NILP (Vinstallation_directory))
4161 installation dir, if it exists. */
4162 tem = Fexpand_file_name (build_string ("lisp"),
4163 Vinstallation_directory);
4164 tem1 = Ffile_exists_p (tem);
4165 if (!NILP (tem1))
4166 {
4167 if (NILP (Fmember (tem, Vload_path)))
4168 {
4169 turn_off_warning = 1;
4170 Vload_path = Fcons (tem, Vload_path);
4171 }
4172 }
4173 else
4174 /* That dir doesn't exist, so add the build-time
4175 Lisp dirs instead. */
4176 Vload_path = nconc2 (Vload_path, dump_path);
4177
4178 /* Add leim under the installation dir, if it exists. */
4179 tem = Fexpand_file_name (build_string ("leim"),
4180 Vinstallation_directory);
4181 tem1 = Ffile_exists_p (tem);
4182 if (!NILP (tem1))
4183 {
4184 if (NILP (Fmember (tem, Vload_path)))
4185 Vload_path = Fcons (tem, Vload_path);
4186 }
4187
4188 /* Add site-lisp under the installation dir, if it exists. */
4189 if (!no_site_lisp)
4190 { 4205 {
4191 tem = Fexpand_file_name (build_string ("site-lisp"), 4206 /* Add to the path the lisp subdir of the
4207 installation dir, if it exists. */
4208 tem = Fexpand_file_name (build_string ("lisp"),
4192 Vinstallation_directory); 4209 Vinstallation_directory);
4193 tem1 = Ffile_exists_p (tem); 4210 tem1 = Ffile_exists_p (tem);
4194 if (!NILP (tem1)) 4211 if (!NILP (tem1))
4195 { 4212 {
4196 if (NILP (Fmember (tem, Vload_path))) 4213 if (NILP (Fmember (tem, Vload_path)))
4197 Vload_path = Fcons (tem, Vload_path); 4214 {
4215 turn_off_warning = 1;
4216 Vload_path = Fcons (tem, Vload_path);
4217 }
4198 } 4218 }
4199 } 4219 else
4200 4220 /* That dir doesn't exist, so add the build-time
4201 /* If Emacs was not built in the source directory, 4221 Lisp dirs instead. */
4202 and it is run from where it was built, add to load-path 4222 Vload_path = nconc2 (Vload_path, dump_path);
4203 the lisp, leim and site-lisp dirs under that directory. */
4204
4205 if (NILP (Fequal (Vinstallation_directory, Vsource_directory)))
4206 {
4207 Lisp_Object tem2;
4208 4223
4209 tem = Fexpand_file_name (build_string ("src/Makefile"), 4224 /* Add leim under the installation dir, if it exists. */
4225 tem = Fexpand_file_name (build_string ("leim"),
4210 Vinstallation_directory); 4226 Vinstallation_directory);
4211 tem1 = Ffile_exists_p (tem); 4227 tem1 = Ffile_exists_p (tem);
4212 4228 if (!NILP (tem1))
4213 /* Don't be fooled if they moved the entire source tree
4214 AFTER dumping Emacs. If the build directory is indeed
4215 different from the source dir, src/Makefile.in and
4216 src/Makefile will not be found together. */
4217 tem = Fexpand_file_name (build_string ("src/Makefile.in"),
4218 Vinstallation_directory);
4219 tem2 = Ffile_exists_p (tem);
4220 if (!NILP (tem1) && NILP (tem2))
4221 { 4229 {
4222 tem = Fexpand_file_name (build_string ("lisp"),
4223 Vsource_directory);
4224
4225 if (NILP (Fmember (tem, Vload_path))) 4230 if (NILP (Fmember (tem, Vload_path)))
4226 Vload_path = Fcons (tem, Vload_path); 4231 Vload_path = Fcons (tem, Vload_path);
4232 }
4227 4233
4228 tem = Fexpand_file_name (build_string ("leim"), 4234 /* Add site-lisp under the installation dir, if it exists. */
4229 Vsource_directory); 4235 if (!no_site_lisp)
4236 {
4237 tem = Fexpand_file_name (build_string ("site-lisp"),
4238 Vinstallation_directory);
4239 tem1 = Ffile_exists_p (tem);
4240 if (!NILP (tem1))
4241 {
4242 if (NILP (Fmember (tem, Vload_path)))
4243 Vload_path = Fcons (tem, Vload_path);
4244 }
4245 }
4230 4246
4231 if (NILP (Fmember (tem, Vload_path))) 4247 /* If Emacs was not built in the source directory,
4232 Vload_path = Fcons (tem, Vload_path); 4248 and it is run from where it was built, add to load-path
4249 the lisp, leim and site-lisp dirs under that directory. */
4233 4250
4234 if (!no_site_lisp) 4251 if (NILP (Fequal (Vinstallation_directory, Vsource_directory)))
4252 {
4253 Lisp_Object tem2;
4254
4255 tem = Fexpand_file_name (build_string ("src/Makefile"),
4256 Vinstallation_directory);
4257 tem1 = Ffile_exists_p (tem);
4258
4259 /* Don't be fooled if they moved the entire source tree
4260 AFTER dumping Emacs. If the build directory is indeed
4261 different from the source dir, src/Makefile.in and
4262 src/Makefile will not be found together. */
4263 tem = Fexpand_file_name (build_string ("src/Makefile.in"),
4264 Vinstallation_directory);
4265 tem2 = Ffile_exists_p (tem);
4266 if (!NILP (tem1) && NILP (tem2))
4235 { 4267 {
4236 tem = Fexpand_file_name (build_string ("site-lisp"), 4268 tem = Fexpand_file_name (build_string ("lisp"),
4269 Vsource_directory);
4270
4271 if (NILP (Fmember (tem, Vload_path)))
4272 Vload_path = Fcons (tem, Vload_path);
4273
4274 tem = Fexpand_file_name (build_string ("leim"),
4237 Vsource_directory); 4275 Vsource_directory);
4238 4276
4239 if (NILP (Fmember (tem, Vload_path))) 4277 if (NILP (Fmember (tem, Vload_path)))
4240 Vload_path = Fcons (tem, Vload_path); 4278 Vload_path = Fcons (tem, Vload_path);
4279
4280 if (!no_site_lisp)
4281 {
4282 tem = Fexpand_file_name (build_string ("site-lisp"),
4283 Vsource_directory);
4284
4285 if (NILP (Fmember (tem, Vload_path)))
4286 Vload_path = Fcons (tem, Vload_path);
4287 }
4241 } 4288 }
4242 } 4289 } /* Vinstallation_directory != Vsource_directory */
4243 } 4290 } /* if Vinstallation_directory */
4244 if (!NILP (sitelisp) && !no_site_lisp) 4291 if (!NILP (sitelisp) && !no_site_lisp)
4245 Vload_path = nconc2 (Fnreverse (sitelisp), Vload_path); 4292 Vload_path = nconc2 (Fnreverse (sitelisp), Vload_path);
4246 } 4293 } /* if Vinstallation_directory || no_site_lisp */
4247 } 4294 } /* if dump_path == Vload_path */
4248 } 4295 }
4249 else 4296 else /* !initialized */
4250 { 4297 {
4251 /* NORMAL refers to the lisp dir in the source directory. */ 4298 /* NORMAL refers to the lisp dir in the source directory. */
4252 /* We used to add ../lisp at the front here, but 4299 /* We used to add ../lisp at the front here, but
@@ -4256,7 +4303,7 @@ init_lread (void)
4256 Vload_path = decode_env_path (0, normal); 4303 Vload_path = decode_env_path (0, normal);
4257 dump_path = Vload_path; 4304 dump_path = Vload_path;
4258 } 4305 }
4259#endif 4306#endif /* CANNOT_DUMP */
4260 4307
4261#if (!(defined (WINDOWSNT) || (defined (HAVE_NS)))) 4308#if (!(defined (WINDOWSNT) || (defined (HAVE_NS))))
4262 /* When Emacs is invoked over network shares on NT, PATH_LOADSEARCH is 4309 /* When Emacs is invoked over network shares on NT, PATH_LOADSEARCH is
@@ -4264,6 +4311,8 @@ init_lread (void)
4264 confuses users. Since PATH_LOADSEARCH is always overridden by the 4311 confuses users. Since PATH_LOADSEARCH is always overridden by the
4265 EMACSLOADPATH environment variable below, disable the warning on NT. */ 4312 EMACSLOADPATH environment variable below, disable the warning on NT. */
4266 4313
4314 /* HAVE_NS also uses EMACSLOADPATH. */
4315
4267 /* Warn if dirs in the *standard* path don't exist. */ 4316 /* Warn if dirs in the *standard* path don't exist. */
4268 if (!turn_off_warning) 4317 if (!turn_off_warning)
4269 { 4318 {
@@ -4278,6 +4327,10 @@ init_lread (void)
4278 if (STRINGP (dirfile)) 4327 if (STRINGP (dirfile))
4279 { 4328 {
4280 dirfile = Fdirectory_file_name (dirfile); 4329 dirfile = Fdirectory_file_name (dirfile);
4330 /* Do we really need to warn about missing site-lisp dirs?
4331 It's true that the installation should have created
4332 them and added subdirs.el, but it's harmless if they
4333 are not there. */
4281 if (access (SSDATA (dirfile), 0) < 0) 4334 if (access (SSDATA (dirfile), 0) < 0)
4282 dir_warning ("Warning: Lisp directory `%s' does not exist.\n", 4335 dir_warning ("Warning: Lisp directory `%s' does not exist.\n",
4283 XCAR (path_tail)); 4336 XCAR (path_tail));
diff --git a/src/w32fns.c b/src/w32fns.c
index d7a6eefab67..3a6929844de 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2479,6 +2479,10 @@ signal_user_input (void)
2479 if (!NILP (Vthrow_on_input)) 2479 if (!NILP (Vthrow_on_input))
2480 { 2480 {
2481 Vquit_flag = Vthrow_on_input; 2481 Vquit_flag = Vthrow_on_input;
2482 /* Doing a QUIT from this thread is a bad idea, since this
2483 unwinds the stack of the Lisp thread, and the Windows runtime
2484 rightfully barfs. Disabled. */
2485#if 0
2482 /* If we're inside a function that wants immediate quits, 2486 /* If we're inside a function that wants immediate quits,
2483 do it now. */ 2487 do it now. */
2484 if (immediate_quit && NILP (Vinhibit_quit)) 2488 if (immediate_quit && NILP (Vinhibit_quit))
@@ -2486,6 +2490,7 @@ signal_user_input (void)
2486 immediate_quit = 0; 2490 immediate_quit = 0;
2487 QUIT; 2491 QUIT;
2488 } 2492 }
2493#endif
2489 } 2494 }
2490} 2495}
2491 2496
diff --git a/src/xdisp.c b/src/xdisp.c
index d3a1dfc4b20..58678fc6385 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -25822,12 +25822,14 @@ cursor_in_mouse_face_p (struct window *w)
25822 25822
25823/* Find the glyph rows START_ROW and END_ROW of window W that display 25823/* Find the glyph rows START_ROW and END_ROW of window W that display
25824 characters between buffer positions START_CHARPOS and END_CHARPOS 25824 characters between buffer positions START_CHARPOS and END_CHARPOS
25825 (excluding END_CHARPOS). This is similar to row_containing_pos, 25825 (excluding END_CHARPOS). DISP_STRING is a display string that
25826 but is more accurate when bidi reordering makes buffer positions 25826 covers these buffer positions. This is similar to
25827 change non-linearly with glyph rows. */ 25827 row_containing_pos, but is more accurate when bidi reordering makes
25828 buffer positions change non-linearly with glyph rows. */
25828static void 25829static void
25829rows_from_pos_range (struct window *w, 25830rows_from_pos_range (struct window *w,
25830 ptrdiff_t start_charpos, ptrdiff_t end_charpos, 25831 ptrdiff_t start_charpos, ptrdiff_t end_charpos,
25832 Lisp_Object disp_string,
25831 struct glyph_row **start, struct glyph_row **end) 25833 struct glyph_row **start, struct glyph_row **end)
25832{ 25834{
25833 struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix); 25835 struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
@@ -25879,8 +25881,11 @@ rows_from_pos_range (struct window *w,
25879 25881
25880 while (g < e) 25882 while (g < e)
25881 { 25883 {
25882 if ((BUFFERP (g->object) || INTEGERP (g->object)) 25884 if (((BUFFERP (g->object) || INTEGERP (g->object))
25883 && start_charpos <= g->charpos && g->charpos < end_charpos) 25885 && start_charpos <= g->charpos && g->charpos < end_charpos)
25886 /* A glyph that comes from DISP_STRING is by
25887 definition to be highlighted. */
25888 || EQ (g->object, disp_string))
25884 *start = row; 25889 *start = row;
25885 g++; 25890 g++;
25886 } 25891 }
@@ -25899,14 +25904,15 @@ rows_from_pos_range (struct window *w,
25899 for ( ; row->enabled_p && MATRIX_ROW_BOTTOM_Y (row) <= last_y; row++) 25904 for ( ; row->enabled_p && MATRIX_ROW_BOTTOM_Y (row) <= last_y; row++)
25900 { 25905 {
25901 struct glyph_row *next = row + 1; 25906 struct glyph_row *next = row + 1;
25907 ptrdiff_t next_start = MATRIX_ROW_START_CHARPOS (next);
25902 25908
25903 if (!next->enabled_p 25909 if (!next->enabled_p
25904 || next >= MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w) 25910 || next >= MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w)
25905 /* The first row >= START whose range of displayed characters 25911 /* The first row >= START whose range of displayed characters
25906 does NOT intersect the range [START_CHARPOS..END_CHARPOS] 25912 does NOT intersect the range [START_CHARPOS..END_CHARPOS]
25907 is the row END + 1. */ 25913 is the row END + 1. */
25908 || (start_charpos < MATRIX_ROW_START_CHARPOS (next) 25914 || (start_charpos < next_start
25909 && end_charpos < MATRIX_ROW_START_CHARPOS (next)) 25915 && end_charpos < next_start)
25910 || ((start_charpos > MATRIX_ROW_END_CHARPOS (next) 25916 || ((start_charpos > MATRIX_ROW_END_CHARPOS (next)
25911 || (start_charpos == MATRIX_ROW_END_CHARPOS (next) 25917 || (start_charpos == MATRIX_ROW_END_CHARPOS (next)
25912 && !next->ends_at_zv_p 25918 && !next->ends_at_zv_p
@@ -25925,12 +25931,29 @@ rows_from_pos_range (struct window *w,
25925 but none of the characters it displays are in the range, it is 25931 but none of the characters it displays are in the range, it is
25926 also END + 1. */ 25932 also END + 1. */
25927 struct glyph *g = next->glyphs[TEXT_AREA]; 25933 struct glyph *g = next->glyphs[TEXT_AREA];
25934 struct glyph *s = g;
25928 struct glyph *e = g + next->used[TEXT_AREA]; 25935 struct glyph *e = g + next->used[TEXT_AREA];
25929 25936
25930 while (g < e) 25937 while (g < e)
25931 { 25938 {
25932 if ((BUFFERP (g->object) || INTEGERP (g->object)) 25939 if (((BUFFERP (g->object) || INTEGERP (g->object))
25933 && start_charpos <= g->charpos && g->charpos < end_charpos) 25940 && ((start_charpos <= g->charpos && g->charpos < end_charpos)
25941 /* If the buffer position of the first glyph in
25942 the row is equal to END_CHARPOS, it means
25943 the last character to be highlighted is the
25944 newline of ROW, and we must consider NEXT as
25945 END, not END+1. */
25946 || (((!next->reversed_p && g == s)
25947 || (next->reversed_p && g == e - 1))
25948 && (g->charpos == end_charpos
25949 /* Special case for when NEXT is an
25950 empty line at ZV. */
25951 || (g->charpos == -1
25952 && !row->ends_at_zv_p
25953 && next_start == end_charpos)))))
25954 /* A glyph that comes from DISP_STRING is by
25955 definition to be highlighted. */
25956 || EQ (g->object, disp_string))
25934 break; 25957 break;
25935 g++; 25958 g++;
25936 } 25959 }
@@ -25939,6 +25962,13 @@ rows_from_pos_range (struct window *w,
25939 *end = row; 25962 *end = row;
25940 break; 25963 break;
25941 } 25964 }
25965 /* The first row that ends at ZV must be the last to be
25966 highlighted. */
25967 else if (next->ends_at_zv_p)
25968 {
25969 *end = next;
25970 break;
25971 }
25942 } 25972 }
25943 } 25973 }
25944} 25974}
@@ -25974,7 +26004,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
25974 xassert (NILP (after_string) || STRINGP (after_string)); 26004 xassert (NILP (after_string) || STRINGP (after_string));
25975 26005
25976 /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */ 26006 /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */
25977 rows_from_pos_range (w, start_charpos, end_charpos, &r1, &r2); 26007 rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2);
25978 if (r1 == NULL) 26008 if (r1 == NULL)
25979 r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); 26009 r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
25980 /* If the before-string or display-string contains newlines, 26010 /* If the before-string or display-string contains newlines,
@@ -26252,6 +26282,19 @@ mouse_face_from_buffer_pos (Lisp_Object window,
26252 } 26282 }
26253 x += end->pixel_width; 26283 x += end->pixel_width;
26254 } 26284 }
26285 /* If we exited the above loop because we arrived at the last
26286 glyph of the row, and its buffer position is still not in
26287 range, it means the last character in range is the preceding
26288 newline. Bump the end column and x values to get past the
26289 last glyph. */
26290 if (end == glyph
26291 && BUFFERP (end->object)
26292 && (end->charpos < start_charpos
26293 || end->charpos >= end_charpos))
26294 {
26295 x += end->pixel_width;
26296 ++end;
26297 }
26255 hlinfo->mouse_face_end_x = x; 26298 hlinfo->mouse_face_end_x = x;
26256 hlinfo->mouse_face_end_col = end - r2->glyphs[TEXT_AREA]; 26299 hlinfo->mouse_face_end_col = end - r2->glyphs[TEXT_AREA];
26257 } 26300 }