diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-04-18 14:05:31 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 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.tar.bz2 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
diff --git a/src/doc.c b/src/doc.c index c5dd8d5a786..e1f508e5014 100644 --- a/src/doc.c +++ b/src/doc.c @@ -34,6 +34,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "coding.h" #include "buffer.h" #include "disptab.h" +#include "intervals.h" #include "keymap.h" /* Buffer used for reading from documentation file. */ @@ -739,6 +740,7 @@ Otherwise, return a new string. */) { char *buf; bool changed = false; + bool nonquotes_changed = false; unsigned char *strp; char *bufp; ptrdiff_t idx; @@ -786,7 +788,7 @@ Otherwise, return a new string. */) { /* \= quotes the next character; thus, to put in \[ without its special meaning, use \=\[. */ - changed = true; + changed = nonquotes_changed = true; strp += 2; if (multibyte) { @@ -946,6 +948,8 @@ Otherwise, return a new string. */) length = SCHARS (tem); length_byte = SBYTES (tem); subst: + nonquotes_changed = true; + subst_quote: changed = true; { ptrdiff_t offset = bufp - buf; @@ -967,7 +971,7 @@ Otherwise, return a new string. */) length = 1; length_byte = sizeof uLSQM - 1; idx = strp - SDATA (string) + 1; - goto subst; + goto subst_quote; } else if (strp[0] == '`' && quoting_style == STRAIGHT_QUOTING_STYLE) { @@ -1003,7 +1007,22 @@ Otherwise, return a new string. */) } if (changed) /* don't bother if nothing substituted */ - tem = make_string_from_bytes (buf, nchars, bufp - buf); + { + tem = make_string_from_bytes (buf, nchars, bufp - buf); + if (!nonquotes_changed) + { + /* Nothing has changed other than quoting, so copy the string’s + text properties. FIXME: Text properties should survive other + changes too. */ + INTERVAL interval_copy = copy_intervals (string_intervals (string), + 0, SCHARS (string)); + if (interval_copy) + { + set_interval_object (interval_copy, tem); + set_string_intervals (tem, interval_copy); + } + } + } else tem = string; 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) int text_area_x, text_area_y, text_area_width, text_area_height; - window_box (s->w, - ANY_AREA, - &text_area_x, - &text_area_y, - &text_area_width, - &text_area_height); - clip_right = min (xww->width, - text_area_width); - clip_left = max (0, - text_area_x); - - clip_bottom = min (xww->height, - text_area_height); - clip_top = max (0, text_area_y); + window_box (s->w, TEXT_AREA, &text_area_x, &text_area_y, + &text_area_width, &text_area_height); + clip_left = max (0, text_area_x - x); + clip_right = max (clip_left, + min (xww->width, text_area_x + text_area_width - x)); + clip_top = max (0, text_area_y - y); + clip_bottom = max (clip_top, + min (xww->height, text_area_y + text_area_height - y)); /* We are concerned with movement of the onscreen area. The area might sit still when the widget actually moves. This happens @@ -622,8 +616,8 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) || xv->clip_bottom != clip_bottom || xv->clip_top != clip_top || xv->clip_left != clip_left) { - gtk_widget_set_size_request (xv->widgetwindow, clip_right + clip_left, - clip_bottom + clip_top); + gtk_widget_set_size_request (xv->widgetwindow, clip_right - clip_left, + clip_bottom - clip_top); gtk_fixed_move (GTK_FIXED (xv->widgetwindow), xv->widget, -clip_left, -clip_top); |