aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog85
-rw-r--r--src/bidi.c17
-rw-r--r--src/composite.c2
-rw-r--r--src/dispextern.h1
-rw-r--r--src/editfns.c11
-rw-r--r--src/fontset.c8
-rw-r--r--src/ftfont.c4
-rw-r--r--src/process.c93
-rw-r--r--src/unexmacosx.c37
-rw-r--r--src/xdisp.c138
-rw-r--r--src/xfaces.c2
11 files changed, 332 insertions, 66 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7f90c576fb1..9d7834fd053 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,6 +1,6 @@
12011-08-06 Paul Eggert <eggert@cs.ucla.edu> 12011-08-14 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Integer and memory overflow issues. 3 Integer and memory overflow issues (Bug#9196).
4 4
5 * charset.c (charset_table_size) 5 * charset.c (charset_table_size)
6 (struct charset_sort_data.priority): Now ptrdiff_t. 6 (struct charset_sort_data.priority): Now ptrdiff_t.
@@ -409,6 +409,87 @@
409 (gs_load): Use printmax_t to print the widest integers possible. 409 (gs_load): Use printmax_t to print the widest integers possible.
410 Check for integer overflow when computing image height and width. 410 Check for integer overflow when computing image height and width.
411 411
4122011-08-14 Paul Eggert <eggert@cs.ucla.edu>
413
414 * xfaces.c (Qframe_set_background_mode): Now static.
415 * dispextern.h (Qframe_set_background_mode): Remove decl.
416
417 * process.c (Fnetwork_interface_info): Declare local only if needed.
418
4192011-08-13 Jan Djärv <jan.h.d@swipnet.se>
420
421 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
422 (Fnetwork_interface_list): Allocate in increments of bytes instead
423 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
424 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
425 sockaddr.
426 (struct ifflag_def): notrailers is smart on OSX.
427 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
428 Get hardware address with getifaddrs if available.
429
4302011-08-12 Eli Zaretskii <eliz@gnu.org>
431
432 * xdisp.c (iterate_out_of_display_property): xassert that
433 IT->position is set to within IT->object's boundaries. Break from
434 the loop as soon as EOB is reached; avoids infloops in redisplay
435 when IT->position is set up wrongly due to some bug. Set
436 IT->current to match the bidi iterator unconditionally.
437 (push_display_prop): Allow GET_FROM_STRING as IT->method on
438 entry. Force push_it to save on the stack the current
439 buffer/string position, to be restored by pop_it. Fix flags in
440 the iterator structure wrt the object coming from a display
441 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
442 properties. (Bug#9284)
443
4442011-08-09 Andreas Schwab <schwab@linux-m68k.org>
445
446 * fontset.c (fontset_get_font_group): Add proper type checks.
447 (Bug#9172)
448
4492011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
450
451 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
452 and LC_VERSION_MIN_MACOSX.
453 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
454 (dump_it) [LC_FUNCTION_STARTS]: Use it.
455
4562011-08-08 Eli Zaretskii <eliz@gnu.org>
457
458 * xdisp.c (forward_to_next_line_start): Allow to use the
459 no-display-properties-and-no-overlays under bidi display. Set
460 disp_pos in the bidi iterator to avoid searches for display
461 properties and overlays.
462
4632011-08-08 Chong Yidong <cyd@stupidchicken.com>
464
465 * editfns.c (Fset_time_zone_rule): Document relationship with the
466 setenv function.
467
468 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
469 the font entity extracted from the cache (Bug#8109).
470
4712011-08-07 Chong Yidong <cyd@stupidchicken.com>
472
473 * composite.c (autocmp_chars): Don't reset point. That is done by
474 restore_point_unwind (Bug#5984).
475
4762011-08-07 Juri Linkov <juri@jurta.org>
477
478 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
479 to show the arg `TIME' instead of `TIMEVAL'.
480
4812011-08-06 Eli Zaretskii <eliz@gnu.org>
482
483 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
484 display property strides EOL and includes a newline, as in
485 longlines-mode. (Bug#9254)
486 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
487 word-wrap under bidirectional display. (Bug#9224)
488
489 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
490 is non-zero, even if the data buffer is NULL. Fixes a crash in
491 vertical-motion with longlines-mode. (Bug#9254)
492
4122011-08-05 Eli Zaretskii <eliz@gnu.org> 4932011-08-05 Eli Zaretskii <eliz@gnu.org>
413 494
414 * bidi.c <bidi_cache_total_alloc>: Now static. 495 * bidi.c <bidi_cache_total_alloc>: Now static.
diff --git a/src/bidi.c b/src/bidi.c
index f6ad22f8ea2..767af02a78a 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -669,7 +669,11 @@ bidi_shelve_cache (void)
669 return databuf; 669 return databuf;
670} 670}
671 671
672/* Restore the cache state from a copy stashed away by bidi_shelve_cache. */ 672/* Restore the cache state from a copy stashed away by
673 bidi_shelve_cache, and free the buffer used to stash that copy.
674 JUST_FREE non-zero means free the buffer, but don't restore the
675 cache; used when the corresponding iterator is discarded instead of
676 being restored. */
673void 677void
674bidi_unshelve_cache (void *databuf, int just_free) 678bidi_unshelve_cache (void *databuf, int just_free)
675{ 679{
@@ -677,10 +681,13 @@ bidi_unshelve_cache (void *databuf, int just_free)
677 681
678 if (!p) 682 if (!p)
679 { 683 {
680 /* A NULL pointer means an empty cache. */ 684 if (!just_free)
681 bidi_cache_start = 0; 685 {
682 bidi_cache_sp = 0; 686 /* A NULL pointer means an empty cache. */
683 bidi_cache_reset (); 687 bidi_cache_start = 0;
688 bidi_cache_sp = 0;
689 bidi_cache_reset ();
690 }
684 } 691 }
685 else 692 else
686 { 693 {
diff --git a/src/composite.c b/src/composite.c
index 738fcd3774c..2a3fbe29552 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -965,8 +965,6 @@ autocmp_chars (Lisp_Object rule, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT
965 args[4] = font_object; 965 args[4] = font_object;
966 args[5] = string; 966 args[5] = string;
967 lgstring = safe_call (6, args); 967 lgstring = safe_call (6, args);
968 if (NILP (string))
969 TEMP_SET_PT_BOTH (pt, pt_byte);
970 } 968 }
971 return unbind_to (count, lgstring); 969 return unbind_to (count, lgstring);
972} 970}
diff --git a/src/dispextern.h b/src/dispextern.h
index 02d1089e3e7..83c3ba713b6 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3203,7 +3203,6 @@ int merge_faces (struct frame *, Lisp_Object, EMACS_INT, int);
3203int compute_char_face (struct frame *, int, Lisp_Object); 3203int compute_char_face (struct frame *, int, Lisp_Object);
3204void free_all_realized_faces (Lisp_Object); 3204void free_all_realized_faces (Lisp_Object);
3205extern Lisp_Object Qforeground_color, Qbackground_color; 3205extern Lisp_Object Qforeground_color, Qbackground_color;
3206extern Lisp_Object Qframe_set_background_mode;
3207extern char unspecified_fg[], unspecified_bg[]; 3206extern char unspecified_fg[], unspecified_bg[];
3208 3207
3209/* Defined in xfns.c */ 3208/* Defined in xfns.c */
diff --git a/src/editfns.c b/src/editfns.c
index 4e1b46b82c3..90b559dfdd5 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1695,7 +1695,9 @@ The modifiers are `E' and `O'. For certain characters X,
1695%EX is a locale's alternative version of %X; 1695%EX is a locale's alternative version of %X;
1696%OX is like %X, but uses the locale's number symbols. 1696%OX is like %X, but uses the locale's number symbols.
1697 1697
1698For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */) 1698For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z".
1699
1700usage: (format-time-string FORMAT-STRING &optional TIME UNIVERSAL) */)
1699 (Lisp_Object format_string, Lisp_Object timeval, Lisp_Object universal) 1701 (Lisp_Object format_string, Lisp_Object timeval, Lisp_Object universal)
1700{ 1702{
1701 time_t value; 1703 time_t value;
@@ -2051,7 +2053,12 @@ static char *initial_tz;
2051DEFUN ("set-time-zone-rule", Fset_time_zone_rule, Sset_time_zone_rule, 1, 1, 0, 2053DEFUN ("set-time-zone-rule", Fset_time_zone_rule, Sset_time_zone_rule, 1, 1, 0,
2052 doc: /* Set the local time zone using TZ, a string specifying a time zone rule. 2054 doc: /* Set the local time zone using TZ, a string specifying a time zone rule.
2053If TZ is nil, use implementation-defined default time zone information. 2055If TZ is nil, use implementation-defined default time zone information.
2054If TZ is t, use Universal Time. */) 2056If TZ is t, use Universal Time.
2057
2058Instead of calling this function, you typically want (setenv "TZ" TZ).
2059That changes both the environment of the Emacs process and the
2060variable `process-environment', whereas `set-time-zone-rule' affects
2061only the former. */)
2055 (Lisp_Object tz) 2062 (Lisp_Object tz)
2056{ 2063{
2057 const char *tzstring; 2064 const char *tzstring;
diff --git a/src/fontset.c b/src/fontset.c
index 74eb61d2665..c8ae1e74848 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -447,7 +447,7 @@ reorder_font_vector (Lisp_Object font_group, struct font *font)
447/* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for 447/* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for
448 character C in FONTSET. If C is -1, return a fallback font-group. 448 character C in FONTSET. If C is -1, return a fallback font-group.
449 If C is not -1, the value may be Qt (FONTSET doesn't have a font 449 If C is not -1, the value may be Qt (FONTSET doesn't have a font
450 for C even in the fallback group, or 0 (a font for C may be found 450 for C even in the fallback group), or 0 (a font for C may be found
451 only in the fallback group). */ 451 only in the fallback group). */
452 452
453static Lisp_Object 453static Lisp_Object
@@ -465,7 +465,9 @@ fontset_get_font_group (Lisp_Object fontset, int c)
465 if (! NILP (font_group)) 465 if (! NILP (font_group))
466 return font_group; 466 return font_group;
467 base_fontset = FONTSET_BASE (fontset); 467 base_fontset = FONTSET_BASE (fontset);
468 if (c >= 0) 468 if (NILP (base_fontset))
469 font_group = Qnil;
470 else if (c >= 0)
469 font_group = char_table_ref_and_range (base_fontset, c, &from, &to); 471 font_group = char_table_ref_and_range (base_fontset, c, &from, &to);
470 else 472 else
471 font_group = FONTSET_FALLBACK (base_fontset); 473 font_group = FONTSET_FALLBACK (base_fontset);
@@ -476,6 +478,8 @@ fontset_get_font_group (Lisp_Object fontset, int c)
476 char_table_set_range (fontset, from, to, font_group); 478 char_table_set_range (fontset, from, to, font_group);
477 return font_group; 479 return font_group;
478 } 480 }
481 if (!VECTORP (font_group))
482 return font_group;
479 font_group = Fcopy_sequence (font_group); 483 font_group = Fcopy_sequence (font_group);
480 for (i = 0; i < ASIZE (font_group); i++) 484 for (i = 0; i < ASIZE (font_group); i++)
481 if (! NILP (AREF (font_group, i))) 485 if (! NILP (AREF (font_group, i)))
diff --git a/src/ftfont.c b/src/ftfont.c
index 5b95e2b2f08..7858a31be21 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -214,6 +214,10 @@ ftfont_pattern_entity (FcPattern *p, Lisp_Object extra)
214 214
215 for (i = 0; i < FONT_OBJLIST_INDEX; i++) 215 for (i = 0; i < FONT_OBJLIST_INDEX; i++)
216 ASET (val, i, AREF (entity, i)); 216 ASET (val, i, AREF (entity, i));
217
218 ASET (val, FONT_EXTRA_INDEX, Fcopy_sequence (extra));
219 font_put_extra (val, QCfont_entity, key);
220
217 return val; 221 return val;
218 } 222 }
219 entity = font_make_entity (); 223 entity = font_make_entity ();
diff --git a/src/process.c b/src/process.c
index f2c2bfd81c5..887090df26c 100644
--- a/src/process.c
+++ b/src/process.c
@@ -58,6 +58,17 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
58#include <net/if.h> 58#include <net/if.h>
59#endif /* HAVE_NET_IF_H */ 59#endif /* HAVE_NET_IF_H */
60 60
61#if defined(HAVE_IFADDRS_H)
62/* Must be after net/if.h */
63#include <ifaddrs.h>
64
65/* We only use structs from this header when we use getifaddrs. */
66#if defined(HAVE_NET_IF_DL_H)
67#include <net/if_dl.h>
68#endif
69
70#endif
71
61#ifdef NEED_BSDTTY 72#ifdef NEED_BSDTTY
62#include <bsdtty.h> 73#include <bsdtty.h>
63#endif 74#endif
@@ -3557,9 +3568,10 @@ format; see the description of ADDRESS in `make-network-process'. */)
3557 (void) 3568 (void)
3558{ 3569{
3559 struct ifconf ifconf; 3570 struct ifconf ifconf;
3560 struct ifreq *ifreqs = NULL; 3571 struct ifreq *ifreq;
3561 ptrdiff_t ifaces = 0; 3572 void *buf = NULL;
3562 int buf_size, s; 3573 ptrdiff_t buf_size = 512;
3574 int s, i;
3563 Lisp_Object res; 3575 Lisp_Object res;
3564 3576
3565 s = socket (AF_INET, SOCK_STREAM, 0); 3577 s = socket (AF_INET, SOCK_STREAM, 0);
@@ -3567,14 +3579,14 @@ format; see the description of ADDRESS in `make-network-process'. */)
3567 return Qnil; 3579 return Qnil;
3568 3580
3569 again: 3581 again:
3570 ifreqs = xpalloc (ifreqs, &ifaces, 25, 3582
3571 INT_MAX / sizeof *ifreqs, sizeof *ifreqs); 3583 buf = xpalloc (buf, &buf_size, sizeof *ifreq, INT_MAX, 1);
3572 buf_size = ifaces * sizeof (ifreqs[0]); 3584 ifconf.ifc_buf = buf;
3573 ifconf.ifc_len = buf_size; 3585 ifconf.ifc_len = buf_size;
3574 ifconf.ifc_req = ifreqs;
3575 if (ioctl (s, SIOCGIFCONF, &ifconf)) 3586 if (ioctl (s, SIOCGIFCONF, &ifconf))
3576 { 3587 {
3577 close (s); 3588 close (s);
3589 xfree (buf);
3578 return Qnil; 3590 return Qnil;
3579 } 3591 }
3580 3592
@@ -3582,15 +3594,29 @@ format; see the description of ADDRESS in `make-network-process'. */)
3582 goto again; 3594 goto again;
3583 3595
3584 close (s); 3596 close (s);
3585 ifaces = ifconf.ifc_len / sizeof (ifreqs[0]);
3586 3597
3587 res = Qnil; 3598 res = Qnil;
3588 while (--ifaces >= 0) 3599 for (ifreq = ifconf.ifc_req;
3600 (char *) ifreq < (char *) (ifconf.ifc_req) + ifconf.ifc_len;
3601 )
3589 { 3602 {
3590 struct ifreq *ifq = &ifreqs[ifaces]; 3603 struct ifreq *ifq = ifreq;
3604#ifdef HAVE_STRUCT_IFREQ_IFR_ADDR_SA_LEN
3605#define SIZEOF_IFREQ(sif) \
3606 ((sif)->ifr_addr.sa_len < sizeof(struct sockaddr) ? \
3607 sizeof((*sif)) : sizeof ((sif)->ifr_name) + sif->ifr_addr.sa_len)
3608
3609 int len = SIZEOF_IFREQ (ifq);
3610#else
3611 int len = sizeof (*ifreq);
3612#endif
3591 char namebuf[sizeof (ifq->ifr_name) + 1]; 3613 char namebuf[sizeof (ifq->ifr_name) + 1];
3614 i += len;
3615 ifreq = (struct ifreq*) ((char*) ifreq + len);
3616
3592 if (ifq->ifr_addr.sa_family != AF_INET) 3617 if (ifq->ifr_addr.sa_family != AF_INET)
3593 continue; 3618 continue;
3619
3594 memcpy (namebuf, ifq->ifr_name, sizeof (ifq->ifr_name)); 3620 memcpy (namebuf, ifq->ifr_name, sizeof (ifq->ifr_name));
3595 namebuf[sizeof (ifq->ifr_name)] = 0; 3621 namebuf[sizeof (ifq->ifr_name)] = 0;
3596 res = Fcons (Fcons (build_string (namebuf), 3622 res = Fcons (Fcons (build_string (namebuf),
@@ -3599,6 +3625,7 @@ format; see the description of ADDRESS in `make-network-process'. */)
3599 res); 3625 res);
3600 } 3626 }
3601 3627
3628 xfree (buf);
3602 return res; 3629 return res;
3603} 3630}
3604#endif /* SIOCGIFCONF */ 3631#endif /* SIOCGIFCONF */
@@ -3636,8 +3663,13 @@ static const struct ifflag_def ifflag_table[] = {
3636 { IFF_PROMISC, "promisc" }, 3663 { IFF_PROMISC, "promisc" },
3637#endif 3664#endif
3638#ifdef IFF_NOTRAILERS 3665#ifdef IFF_NOTRAILERS
3666#ifdef NS_IMPL_COCOA
3667 /* Really means smart, notrailers is obsolete */
3668 { IFF_NOTRAILERS, "smart" },
3669#else
3639 { IFF_NOTRAILERS, "notrailers" }, 3670 { IFF_NOTRAILERS, "notrailers" },
3640#endif 3671#endif
3672#endif
3641#ifdef IFF_ALLMULTI 3673#ifdef IFF_ALLMULTI
3642 { IFF_ALLMULTI, "allmulti" }, 3674 { IFF_ALLMULTI, "allmulti" },
3643#endif 3675#endif
@@ -3690,6 +3722,10 @@ FLAGS is the current flags of the interface. */)
3690 Lisp_Object elt; 3722 Lisp_Object elt;
3691 int s; 3723 int s;
3692 int any = 0; 3724 int any = 0;
3725#if (! (defined SIOCGIFHWADDR && defined HAVE_STRUCT_IFREQ_IFR_HWADDR) \
3726 && defined HAVE_GETIFADDRS && defined LLADDR)
3727 struct ifaddrs *ifap;
3728#endif
3693 3729
3694 CHECK_STRING (ifname); 3730 CHECK_STRING (ifname);
3695 3731
@@ -3708,6 +3744,12 @@ FLAGS is the current flags of the interface. */)
3708 const struct ifflag_def *fp; 3744 const struct ifflag_def *fp;
3709 int fnum; 3745 int fnum;
3710 3746
3747 /* If flags is smaller than int (i.e. short) it may have the high bit set
3748 due to IFF_MULTICAST. In that case, sign extending it into
3749 an int is wrong. */
3750 if (flags < 0 && sizeof (rq.ifr_flags) < sizeof (flags))
3751 flags = (unsigned short) rq.ifr_flags;
3752
3711 any = 1; 3753 any = 1;
3712 for (fp = ifflag_table; flags != 0 && fp->flag_sym; fp++) 3754 for (fp = ifflag_table; flags != 0 && fp->flag_sym; fp++)
3713 { 3755 {
@@ -3741,7 +3783,38 @@ FLAGS is the current flags of the interface. */)
3741 p->contents[n] = make_number (((unsigned char *)&rq.ifr_hwaddr.sa_data[0])[n]); 3783 p->contents[n] = make_number (((unsigned char *)&rq.ifr_hwaddr.sa_data[0])[n]);
3742 elt = Fcons (make_number (rq.ifr_hwaddr.sa_family), hwaddr); 3784 elt = Fcons (make_number (rq.ifr_hwaddr.sa_family), hwaddr);
3743 } 3785 }
3786#elif defined(HAVE_GETIFADDRS) && defined(LLADDR)
3787 if (getifaddrs (&ifap) != -1)
3788 {
3789 Lisp_Object hwaddr = Fmake_vector (make_number (6), Qnil);
3790 register struct Lisp_Vector *p = XVECTOR (hwaddr);
3791 struct ifaddrs *it;
3792
3793 for (it = ifap; it != NULL; it = it->ifa_next)
3794 {
3795 struct sockaddr_dl *sdl = (struct sockaddr_dl*) it->ifa_addr;
3796 unsigned char linkaddr[6];
3797 int n;
3798
3799 if (it->ifa_addr->sa_family != AF_LINK
3800 || strcmp (it->ifa_name, SSDATA (ifname)) != 0
3801 || sdl->sdl_alen != 6)
3802 continue;
3803
3804 memcpy (linkaddr, LLADDR(sdl), sdl->sdl_alen);
3805 for (n = 0; n < 6; n++)
3806 p->contents[n] = make_number (linkaddr[n]);
3807
3808 elt = Fcons (make_number (it->ifa_addr->sa_family), hwaddr);
3809 break;
3810 }
3811 }
3812#ifdef HAVE_FREEIFADDRS
3813 freeifaddrs (ifap);
3744#endif 3814#endif
3815
3816#endif /* HAVE_GETIFADDRS && LLADDR */
3817
3745 res = Fcons (elt, res); 3818 res = Fcons (elt, res);
3746 3819
3747 elt = Qnil; 3820 elt = Qnil;
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 04e3edf463e..0751eeacb9b 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -599,6 +599,16 @@ print_load_command_name (int lc)
599 printf ("LC_DYLD_INFO_ONLY"); 599 printf ("LC_DYLD_INFO_ONLY");
600 break; 600 break;
601#endif 601#endif
602#ifdef LC_VERSION_MIN_MACOSX
603 case LC_VERSION_MIN_MACOSX:
604 printf ("LC_VERSION_MIN_MACOSX");
605 break;
606#endif
607#ifdef LC_FUNCTION_STARTS
608 case LC_FUNCTION_STARTS:
609 printf ("LC_FUNCTION_STARTS");
610 break;
611#endif
602 default: 612 default:
603 printf ("unknown "); 613 printf ("unknown ");
604 } 614 }
@@ -1135,6 +1145,28 @@ copy_dyld_info (struct load_command *lc, long delta)
1135} 1145}
1136#endif 1146#endif
1137 1147
1148#ifdef LC_FUNCTION_STARTS
1149/* Copy a LC_FUNCTION_STARTS load command from the input file to the
1150 output file, adjusting the data offset field. */
1151static void
1152copy_linkedit_data (struct load_command *lc, long delta)
1153{
1154 struct linkedit_data_command *ldp = (struct linkedit_data_command *) lc;
1155
1156 if (ldp->dataoff > 0)
1157 ldp->dataoff += delta;
1158
1159 printf ("Writing ");
1160 print_load_command_name (lc->cmd);
1161 printf (" command\n");
1162
1163 if (!unexec_write (curr_header_offset, lc, lc->cmdsize))
1164 unexec_error ("cannot write linkedit data command to header");
1165
1166 curr_header_offset += lc->cmdsize;
1167}
1168#endif
1169
1138/* Copy other kinds of load commands from the input file to the output 1170/* Copy other kinds of load commands from the input file to the output
1139 file, ones that do not require adjustments of file offsets. */ 1171 file, ones that do not require adjustments of file offsets. */
1140static void 1172static void
@@ -1207,6 +1239,11 @@ dump_it (void)
1207 copy_dyld_info (lca[i], linkedit_delta); 1239 copy_dyld_info (lca[i], linkedit_delta);
1208 break; 1240 break;
1209#endif 1241#endif
1242#ifdef LC_FUNCTION_STARTS
1243 case LC_FUNCTION_STARTS:
1244 copy_linkedit_data (lca[i], linkedit_delta);
1245 break;
1246#endif
1210 default: 1247 default:
1211 copy_other (lca[i]); 1248 copy_other (lca[i]);
1212 break; 1249 break;
diff --git a/src/xdisp.c b/src/xdisp.c
index 481dd35c5d0..98bd25d1e4f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5323,6 +5323,8 @@ iterate_out_of_display_property (struct it *it)
5323 EMACS_INT eob = (buffer_p ? ZV : it->end_charpos); 5323 EMACS_INT eob = (buffer_p ? ZV : it->end_charpos);
5324 EMACS_INT bob = (buffer_p ? BEGV : 0); 5324 EMACS_INT bob = (buffer_p ? BEGV : 0);
5325 5325
5326 xassert (eob >= CHARPOS (it->position) && CHARPOS (it->position) >= bob);
5327
5326 /* Maybe initialize paragraph direction. If we are at the beginning 5328 /* Maybe initialize paragraph direction. If we are at the beginning
5327 of a new paragraph, next_element_from_buffer may not have a 5329 of a new paragraph, next_element_from_buffer may not have a
5328 chance to do that. */ 5330 chance to do that. */
@@ -5331,7 +5333,8 @@ iterate_out_of_display_property (struct it *it)
5331 /* prev_stop can be zero, so check against BEGV as well. */ 5333 /* prev_stop can be zero, so check against BEGV as well. */
5332 while (it->bidi_it.charpos >= bob 5334 while (it->bidi_it.charpos >= bob
5333 && it->prev_stop <= it->bidi_it.charpos 5335 && it->prev_stop <= it->bidi_it.charpos
5334 && it->bidi_it.charpos < CHARPOS (it->position)) 5336 && it->bidi_it.charpos < CHARPOS (it->position)
5337 && it->bidi_it.charpos < eob)
5335 bidi_move_to_visually_next (&it->bidi_it); 5338 bidi_move_to_visually_next (&it->bidi_it);
5336 /* Record the stop_pos we just crossed, for when we cross it 5339 /* Record the stop_pos we just crossed, for when we cross it
5337 back, maybe. */ 5340 back, maybe. */
@@ -5340,14 +5343,11 @@ iterate_out_of_display_property (struct it *it)
5340 /* If we ended up not where pop_it put us, resync IT's 5343 /* If we ended up not where pop_it put us, resync IT's
5341 positional members with the bidi iterator. */ 5344 positional members with the bidi iterator. */
5342 if (it->bidi_it.charpos != CHARPOS (it->position)) 5345 if (it->bidi_it.charpos != CHARPOS (it->position))
5343 { 5346 SET_TEXT_POS (it->position, it->bidi_it.charpos, it->bidi_it.bytepos);
5344 SET_TEXT_POS (it->position, 5347 if (buffer_p)
5345 it->bidi_it.charpos, it->bidi_it.bytepos); 5348 it->current.pos = it->position;
5346 if (buffer_p) 5349 else
5347 it->current.pos = it->position; 5350 it->current.string_pos = it->position;
5348 else
5349 it->current.string_pos = it->position;
5350 }
5351} 5351}
5352 5352
5353/* Restore IT's settings from IT->stack. Called, for example, when no 5353/* Restore IT's settings from IT->stack. Called, for example, when no
@@ -5529,19 +5529,42 @@ forward_to_next_line_start (struct it *it, int *skipped_p,
5529 5529
5530 xassert (!STRINGP (it->string)); 5530 xassert (!STRINGP (it->string));
5531 5531
5532 /* If we are not bidi-reordering, and there isn't any `display' 5532 /* If there isn't any `display' property in sight, and no
5533 property in sight, and no overlays, we can just use the 5533 overlays, we can just use the position of the newline in
5534 position of the newline in buffer text. */ 5534 buffer text. */
5535 if (!it->bidi_p 5535 if (it->stop_charpos >= limit
5536 && (it->stop_charpos >= limit 5536 || ((pos = Fnext_single_property_change (make_number (start),
5537 || ((pos = Fnext_single_property_change (make_number (start), 5537 Qdisplay, Qnil,
5538 Qdisplay, Qnil, 5538 make_number (limit)),
5539 make_number (limit)), 5539 NILP (pos))
5540 NILP (pos)) 5540 && next_overlay_change (start) == ZV))
5541 && next_overlay_change (start) == ZV))) 5541 {
5542 { 5542 if (!it->bidi_p)
5543 IT_CHARPOS (*it) = limit; 5543 {
5544 IT_BYTEPOS (*it) = CHAR_TO_BYTE (limit); 5544 IT_CHARPOS (*it) = limit;
5545 IT_BYTEPOS (*it) = CHAR_TO_BYTE (limit);
5546 }
5547 else
5548 {
5549 struct bidi_it bprev;
5550
5551 /* Help bidi.c avoid expensive searches for display
5552 properties and overlays, by telling it that there are
5553 none up to `limit'. */
5554 if (it->bidi_it.disp_pos < limit)
5555 {
5556 it->bidi_it.disp_pos = limit;
5557 it->bidi_it.disp_prop_p = 0;
5558 }
5559 do {
5560 bprev = it->bidi_it;
5561 bidi_move_to_visually_next (&it->bidi_it);
5562 } while (it->bidi_it.charpos != limit);
5563 IT_CHARPOS (*it) = limit;
5564 IT_BYTEPOS (*it) = it->bidi_it.bytepos;
5565 if (bidi_it_prev)
5566 *bidi_it_prev = bprev;
5567 }
5545 *skipped_p = newline_found_p = 1; 5568 *skipped_p = newline_found_p = 1;
5546 } 5569 }
5547 else 5570 else
@@ -8006,13 +8029,19 @@ move_it_in_display_line_to (struct it *it,
8006 positions smaller than TO_CHARPOS, return 8029 positions smaller than TO_CHARPOS, return
8007 MOVE_POS_MATCH_OR_ZV, like the unidirectional display 8030 MOVE_POS_MATCH_OR_ZV, like the unidirectional display
8008 did. */ 8031 did. */
8009 if (it->bidi_p && (op & MOVE_TO_POS) != 0 8032 if (it->bidi_p && (op & MOVE_TO_POS) != 0)
8010 && !saw_smaller_pos
8011 && IT_CHARPOS (*it) > to_charpos)
8012 { 8033 {
8013 if (IT_CHARPOS (ppos_it) < ZV) 8034 if (!saw_smaller_pos && IT_CHARPOS (*it) > to_charpos)
8014 RESTORE_IT (it, &ppos_it, ppos_data); 8035 {
8015 goto buffer_pos_reached; 8036 if (IT_CHARPOS (ppos_it) < ZV)
8037 RESTORE_IT (it, &ppos_it, ppos_data);
8038 goto buffer_pos_reached;
8039 }
8040 else if (it->line_wrap == WORD_WRAP && atpos_it.sp >= 0
8041 && IT_CHARPOS (*it) > to_charpos)
8042 goto buffer_pos_reached;
8043 else
8044 result = MOVE_NEWLINE_OR_CR;
8016 } 8045 }
8017 else 8046 else
8018 result = MOVE_NEWLINE_OR_CR; 8047 result = MOVE_NEWLINE_OR_CR;
@@ -13283,6 +13312,9 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13283 /* Last buffer position covered by an overlay string with an integer 13312 /* Last buffer position covered by an overlay string with an integer
13284 `cursor' property. */ 13313 `cursor' property. */
13285 EMACS_INT bpos_covered = 0; 13314 EMACS_INT bpos_covered = 0;
13315 /* Non-zero means the display string on which to display the cursor
13316 comes from a text property, not from an overlay. */
13317 int string_from_text_prop = 0;
13286 13318
13287 /* Skip over glyphs not having an object at the start and the end of 13319 /* Skip over glyphs not having an object at the start and the end of
13288 the row. These are special glyphs like truncation marks on 13320 the row. These are special glyphs like truncation marks on
@@ -13601,9 +13633,14 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13601 { 13633 {
13602 Lisp_Object str; 13634 Lisp_Object str;
13603 EMACS_INT tem; 13635 EMACS_INT tem;
13636 /* If the display property covers the newline, we
13637 need to search for it one position farther. */
13638 EMACS_INT lim = pos_after
13639 + (pos_after == MATRIX_ROW_END_CHARPOS (row) + delta);
13604 13640
13641 string_from_text_prop = 0;
13605 str = glyph->object; 13642 str = glyph->object;
13606 tem = string_buffer_position_lim (str, pos, pos_after, 0); 13643 tem = string_buffer_position_lim (str, pos, lim, 0);
13607 if (tem == 0 /* from overlay */ 13644 if (tem == 0 /* from overlay */
13608 || pos <= tem) 13645 || pos <= tem)
13609 { 13646 {
@@ -13627,7 +13664,10 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13627 EMACS_INT strpos = glyph->charpos; 13664 EMACS_INT strpos = glyph->charpos;
13628 13665
13629 if (tem) 13666 if (tem)
13630 cursor = glyph; 13667 {
13668 cursor = glyph;
13669 string_from_text_prop = 1;
13670 }
13631 for ( ; 13671 for ( ;
13632 (row->reversed_p ? glyph > stop : glyph < stop) 13672 (row->reversed_p ? glyph > stop : glyph < stop)
13633 && EQ (glyph->object, str); 13673 && EQ (glyph->object, str);
@@ -13728,8 +13768,17 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13728 /* previous candidate is a glyph from a string that has 13768 /* previous candidate is a glyph from a string that has
13729 a non-nil `cursor' property */ 13769 a non-nil `cursor' property */
13730 || (STRINGP (g1->object) 13770 || (STRINGP (g1->object)
13731 && !NILP (Fget_char_property (make_number (g1->charpos), 13771 && (!NILP (Fget_char_property (make_number (g1->charpos),
13732 Qcursor, g1->object))))) 13772 Qcursor, g1->object))
13773 /* pevious candidate is from the same display
13774 string as this one, and the display string
13775 came from a text property */
13776 || (EQ (g1->object, glyph->object)
13777 && string_from_text_prop)
13778 /* this candidate is from newline and its
13779 position is not an exact match */
13780 || (INTEGERP (glyph->object)
13781 && glyph->charpos != pt_old)))))
13733 return 0; 13782 return 0;
13734 /* If this candidate gives an exact match, use that. */ 13783 /* If this candidate gives an exact match, use that. */
13735 if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old) 13784 if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old)
@@ -18005,16 +18054,25 @@ cursor_row_p (struct glyph_row *row)
18005 18054
18006 18055
18007 18056
18008/* Push the display property PROP so that it will be rendered at the 18057/* Push the property PROP so that it will be rendered at the current
18009 current position in IT. Return 1 if PROP was successfully pushed, 18058 position in IT. Return 1 if PROP was successfully pushed, 0
18010 0 otherwise. */ 18059 otherwise. Called from handle_line_prefix to handle the
18060 `line-prefix' and `wrap-prefix' properties. */
18011 18061
18012static int 18062static int
18013push_display_prop (struct it *it, Lisp_Object prop) 18063push_display_prop (struct it *it, Lisp_Object prop)
18014{ 18064{
18015 xassert (it->method == GET_FROM_BUFFER); 18065 struct text_pos pos =
18066 (it->method == GET_FROM_STRING) ? it->current.string_pos : it->current.pos;
18016 18067
18017 push_it (it, NULL); 18068 xassert (it->method == GET_FROM_BUFFER
18069 || it->method == GET_FROM_STRING);
18070
18071 /* We need to save the current buffer/string position, so it will be
18072 restored by pop_it, because iterate_out_of_display_property
18073 depends on that being set correctly, but some situations leave
18074 it->position not yet set when this function is called. */
18075 push_it (it, &pos);
18018 18076
18019 if (STRINGP (prop)) 18077 if (STRINGP (prop))
18020 { 18078 {
@@ -18033,11 +18091,9 @@ push_display_prop (struct it *it, Lisp_Object prop)
18033 it->stop_charpos = 0; 18091 it->stop_charpos = 0;
18034 it->prev_stop = 0; 18092 it->prev_stop = 0;
18035 it->base_level_stop = 0; 18093 it->base_level_stop = 0;
18036 it->string_from_display_prop_p = 1;
18037 it->from_disp_prop_p = 1;
18038 18094
18039 /* Force paragraph direction to be that of the parent 18095 /* Force paragraph direction to be that of the parent
18040 buffer. */ 18096 buffer/string. */
18041 if (it->bidi_p && it->bidi_it.paragraph_dir == R2L) 18097 if (it->bidi_p && it->bidi_it.paragraph_dir == R2L)
18042 it->paragraph_embedding = it->bidi_it.paragraph_dir; 18098 it->paragraph_embedding = it->bidi_it.paragraph_dir;
18043 else 18099 else
@@ -18050,7 +18106,7 @@ push_display_prop (struct it *it, Lisp_Object prop)
18050 it->bidi_it.string.s = NULL; 18106 it->bidi_it.string.s = NULL;
18051 it->bidi_it.string.schars = it->end_charpos; 18107 it->bidi_it.string.schars = it->end_charpos;
18052 it->bidi_it.string.bufpos = IT_CHARPOS (*it); 18108 it->bidi_it.string.bufpos = IT_CHARPOS (*it);
18053 it->bidi_it.string.from_disp_str = 1; 18109 it->bidi_it.string.from_disp_str = it->string_from_display_prop_p;
18054 it->bidi_it.string.unibyte = !it->multibyte_p; 18110 it->bidi_it.string.unibyte = !it->multibyte_p;
18055 bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it); 18111 bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it);
18056 } 18112 }
diff --git a/src/xfaces.c b/src/xfaces.c
index 53b30a5c1c2..df40a6999f7 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -339,7 +339,7 @@ char unspecified_fg[] = "unspecified-fg", unspecified_bg[] = "unspecified-bg";
339/* The name of the function to call when the background of the frame 339/* The name of the function to call when the background of the frame
340 has changed, frame_set_background_mode. */ 340 has changed, frame_set_background_mode. */
341 341
342Lisp_Object Qframe_set_background_mode; 342static Lisp_Object Qframe_set_background_mode;
343 343
344/* Names of basic faces. */ 344/* Names of basic faces. */
345 345