diff options
| author | Paul Eggert | 2016-04-18 14:05:31 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-04-18 14:05:31 -0700 |
| commit | dd92b5f5047931f6020045ce47360b62d1c2cb72 (patch) | |
| tree | 336a9b31454bbf0f9c888ea6169c852e7eae9462 /src | |
| parent | d11abb25428e9a468a5525c462489eb5a854798f (diff) | |
| parent | 32364bbbaa8bda68228a3b0191c0b340c252d2a2 (diff) | |
| download | emacs-dd92b5f5047931f6020045ce47360b62d1c2cb72.tar.gz emacs-dd92b5f5047931f6020045ce47360b62d1c2cb72.zip | |
Merge from origin/emacs-25
32364bb substitute-command-keys keeps quotes’ text props
567ab52 * src/xwidget.c (x_draw_xwidget_glyph_string): More clipping ...
24b87a1 Add semantic-symref-filepattern-alist entry for lisp-interact...
cc0b713 Perform xref searches without visiting unopened files
5045575 Revert "Prevent bootstrap autoload backup files"
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc.c | 25 | ||||
| -rw-r--r-- | src/xwidget.c | 26 |
2 files changed, 32 insertions, 19 deletions
| @@ -34,6 +34,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 34 | #include "coding.h" | 34 | #include "coding.h" |
| 35 | #include "buffer.h" | 35 | #include "buffer.h" |
| 36 | #include "disptab.h" | 36 | #include "disptab.h" |
| 37 | #include "intervals.h" | ||
| 37 | #include "keymap.h" | 38 | #include "keymap.h" |
| 38 | 39 | ||
| 39 | /* Buffer used for reading from documentation file. */ | 40 | /* Buffer used for reading from documentation file. */ |
| @@ -739,6 +740,7 @@ Otherwise, return a new string. */) | |||
| 739 | { | 740 | { |
| 740 | char *buf; | 741 | char *buf; |
| 741 | bool changed = false; | 742 | bool changed = false; |
| 743 | bool nonquotes_changed = false; | ||
| 742 | unsigned char *strp; | 744 | unsigned char *strp; |
| 743 | char *bufp; | 745 | char *bufp; |
| 744 | ptrdiff_t idx; | 746 | ptrdiff_t idx; |
| @@ -786,7 +788,7 @@ Otherwise, return a new string. */) | |||
| 786 | { | 788 | { |
| 787 | /* \= quotes the next character; | 789 | /* \= quotes the next character; |
| 788 | thus, to put in \[ without its special meaning, use \=\[. */ | 790 | thus, to put in \[ without its special meaning, use \=\[. */ |
| 789 | changed = true; | 791 | changed = nonquotes_changed = true; |
| 790 | strp += 2; | 792 | strp += 2; |
| 791 | if (multibyte) | 793 | if (multibyte) |
| 792 | { | 794 | { |
| @@ -946,6 +948,8 @@ Otherwise, return a new string. */) | |||
| 946 | length = SCHARS (tem); | 948 | length = SCHARS (tem); |
| 947 | length_byte = SBYTES (tem); | 949 | length_byte = SBYTES (tem); |
| 948 | subst: | 950 | subst: |
| 951 | nonquotes_changed = true; | ||
| 952 | subst_quote: | ||
| 949 | changed = true; | 953 | changed = true; |
| 950 | { | 954 | { |
| 951 | ptrdiff_t offset = bufp - buf; | 955 | ptrdiff_t offset = bufp - buf; |
| @@ -967,7 +971,7 @@ Otherwise, return a new string. */) | |||
| 967 | length = 1; | 971 | length = 1; |
| 968 | length_byte = sizeof uLSQM - 1; | 972 | length_byte = sizeof uLSQM - 1; |
| 969 | idx = strp - SDATA (string) + 1; | 973 | idx = strp - SDATA (string) + 1; |
| 970 | goto subst; | 974 | goto subst_quote; |
| 971 | } | 975 | } |
| 972 | else if (strp[0] == '`' && quoting_style == STRAIGHT_QUOTING_STYLE) | 976 | else if (strp[0] == '`' && quoting_style == STRAIGHT_QUOTING_STYLE) |
| 973 | { | 977 | { |
| @@ -1003,7 +1007,22 @@ Otherwise, return a new string. */) | |||
| 1003 | } | 1007 | } |
| 1004 | 1008 | ||
| 1005 | if (changed) /* don't bother if nothing substituted */ | 1009 | if (changed) /* don't bother if nothing substituted */ |
| 1006 | tem = make_string_from_bytes (buf, nchars, bufp - buf); | 1010 | { |
| 1011 | tem = make_string_from_bytes (buf, nchars, bufp - buf); | ||
| 1012 | if (!nonquotes_changed) | ||
| 1013 | { | ||
| 1014 | /* Nothing has changed other than quoting, so copy the string’s | ||
| 1015 | text properties. FIXME: Text properties should survive other | ||
| 1016 | changes too. */ | ||
| 1017 | INTERVAL interval_copy = copy_intervals (string_intervals (string), | ||
| 1018 | 0, SCHARS (string)); | ||
| 1019 | if (interval_copy) | ||
| 1020 | { | ||
| 1021 | set_interval_object (interval_copy, tem); | ||
| 1022 | set_string_intervals (tem, interval_copy); | ||
| 1023 | } | ||
| 1024 | } | ||
| 1025 | } | ||
| 1007 | else | 1026 | else |
| 1008 | tem = string; | 1027 | tem = string; |
| 1009 | xfree (buf); | 1028 | xfree (buf); |
diff --git a/src/xwidget.c b/src/xwidget.c index 7e96307bdd8..82449f7a215 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -580,20 +580,14 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 580 | 580 | ||
| 581 | int text_area_x, text_area_y, text_area_width, text_area_height; | 581 | int text_area_x, text_area_y, text_area_width, text_area_height; |
| 582 | 582 | ||
| 583 | window_box (s->w, | 583 | window_box (s->w, TEXT_AREA, &text_area_x, &text_area_y, |
| 584 | ANY_AREA, | 584 | &text_area_width, &text_area_height); |
| 585 | &text_area_x, | 585 | clip_left = max (0, text_area_x - x); |
| 586 | &text_area_y, | 586 | clip_right = max (clip_left, |
| 587 | &text_area_width, | 587 | min (xww->width, text_area_x + text_area_width - x)); |
| 588 | &text_area_height); | 588 | clip_top = max (0, text_area_y - y); |
| 589 | clip_right = min (xww->width, | 589 | clip_bottom = max (clip_top, |
| 590 | text_area_width); | 590 | min (xww->height, text_area_y + text_area_height - y)); |
| 591 | clip_left = max (0, | ||
| 592 | text_area_x); | ||
| 593 | |||
| 594 | clip_bottom = min (xww->height, | ||
| 595 | text_area_height); | ||
| 596 | clip_top = max (0, text_area_y); | ||
| 597 | 591 | ||
| 598 | /* We are concerned with movement of the onscreen area. The area | 592 | /* We are concerned with movement of the onscreen area. The area |
| 599 | might sit still when the widget actually moves. This happens | 593 | might sit still when the widget actually moves. This happens |
| @@ -622,8 +616,8 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 622 | || xv->clip_bottom != clip_bottom | 616 | || xv->clip_bottom != clip_bottom |
| 623 | || xv->clip_top != clip_top || xv->clip_left != clip_left) | 617 | || xv->clip_top != clip_top || xv->clip_left != clip_left) |
| 624 | { | 618 | { |
| 625 | gtk_widget_set_size_request (xv->widgetwindow, clip_right + clip_left, | 619 | gtk_widget_set_size_request (xv->widgetwindow, clip_right - clip_left, |
| 626 | clip_bottom + clip_top); | 620 | clip_bottom - clip_top); |
| 627 | gtk_fixed_move (GTK_FIXED (xv->widgetwindow), xv->widget, -clip_left, | 621 | gtk_fixed_move (GTK_FIXED (xv->widgetwindow), xv->widget, -clip_left, |
| 628 | -clip_top); | 622 | -clip_top); |
| 629 | 623 | ||