aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-12-11 09:34:03 +0800
committerPo Lu2022-12-11 09:34:03 +0800
commit5737c2a3af70bc8d653abdb22922c4dc2a49e878 (patch)
tree4e718cb78d35766fb2b7ff7f7cc96fa575db53f6 /src
parent52de8885048daf444bdbdb34c4b3d0318dc6a76c (diff)
parent79659416f95ac986812a8b40c1260907b95aaa0b (diff)
downloademacs-5737c2a3af70bc8d653abdb22922c4dc2a49e878.tar.gz
emacs-5737c2a3af70bc8d653abdb22922c4dc2a49e878.zip
Merge from origin/emacs-29
79659416f95 ; * admin/git-bisect-start: Fix commit hash a9037aa8e81 ; Fix use-package-ensure-system-package macOS footnote 7d787564c08 Actually improve detection of long lines 118465f6fed ; Improve checkdoc.el commentary section 30e3cb21351 Unset the weight/slant/width in the spec when realizing a... 01154166057 Update to Org 9.6-31-g954a95 26a8644a587 ; tabulated-list.el: Remove duplicate obsolete declaration 29b9aeae32a ; * doc/misc/use-package.texi: Fix misplaced @end group. 3c5a41b2008 ; * doc/lispref/keymaps.texi (Searching Keymaps): Fix a t... 1753da24cd4 Fix infloop in 'shell-resync-dirs' with tcsh 2f1269c3331 ; Fix some minor issues in use-package.texi
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c1
-rw-r--r--src/buffer.h11
-rw-r--r--src/pdumper.c1
-rw-r--r--src/xdisp.c3
-rw-r--r--src/xfaces.c60
5 files changed, 59 insertions, 17 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 71be7ed9e13..69f27c9f476 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -604,7 +604,6 @@ even if it is dead. The return value is never nil. */)
604 set_buffer_intervals (b, NULL); 604 set_buffer_intervals (b, NULL);
605 BUF_UNCHANGED_MODIFIED (b) = 1; 605 BUF_UNCHANGED_MODIFIED (b) = 1;
606 BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1; 606 BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1;
607 BUF_CHARS_UNCHANGED_MODIFIED (b) = 1;
608 BUF_END_UNCHANGED (b) = 0; 607 BUF_END_UNCHANGED (b) = 0;
609 BUF_BEG_UNCHANGED (b) = 0; 608 BUF_BEG_UNCHANGED (b) = 0;
610 *(BUF_GPT_ADDR (b)) = *(BUF_Z_ADDR (b)) = 0; /* Put an anchor '\0'. */ 609 *(BUF_GPT_ADDR (b)) = *(BUF_Z_ADDR (b)) = 0; /* Put an anchor '\0'. */
diff --git a/src/buffer.h b/src/buffer.h
index 9ead875bcf8..7c3d1903140 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -149,18 +149,12 @@ enum { BEG = 1, BEG_BYTE = BEG };
149#define BUF_BEG_UNCHANGED(buf) ((buf)->text->beg_unchanged) 149#define BUF_BEG_UNCHANGED(buf) ((buf)->text->beg_unchanged)
150#define BUF_END_UNCHANGED(buf) ((buf)->text->end_unchanged) 150#define BUF_END_UNCHANGED(buf) ((buf)->text->end_unchanged)
151 151
152#define BUF_CHARS_UNCHANGED_MODIFIED(buf) \
153 ((buf)->text->chars_unchanged_modified)
154
155#define UNCHANGED_MODIFIED \ 152#define UNCHANGED_MODIFIED \
156 BUF_UNCHANGED_MODIFIED (current_buffer) 153 BUF_UNCHANGED_MODIFIED (current_buffer)
157#define OVERLAY_UNCHANGED_MODIFIED \ 154#define OVERLAY_UNCHANGED_MODIFIED \
158 BUF_OVERLAY_UNCHANGED_MODIFIED (current_buffer) 155 BUF_OVERLAY_UNCHANGED_MODIFIED (current_buffer)
159#define BEG_UNCHANGED BUF_BEG_UNCHANGED (current_buffer) 156#define BEG_UNCHANGED BUF_BEG_UNCHANGED (current_buffer)
160#define END_UNCHANGED BUF_END_UNCHANGED (current_buffer) 157#define END_UNCHANGED BUF_END_UNCHANGED (current_buffer)
161
162#define CHARS_UNCHANGED_MODIFIED \
163 BUF_CHARS_UNCHANGED_MODIFIED (current_buffer)
164 158
165/* Functions to set PT in the current buffer, or another buffer. */ 159/* Functions to set PT in the current buffer, or another buffer. */
166 160
@@ -274,11 +268,6 @@ struct buffer_text
274 end_unchanged contain no useful information. */ 268 end_unchanged contain no useful information. */
275 modiff_count overlay_unchanged_modified; 269 modiff_count overlay_unchanged_modified;
276 270
277 /* CHARS_MODIFF as of last redisplay that finished. It's used
278 when we only care about changes in actual buffer text, not in
279 any other kind of changes, like properties etc. */
280 modiff_count chars_unchanged_modified;
281
282 /* Properties of this buffer's text. */ 271 /* Properties of this buffer's text. */
283 INTERVAL intervals; 272 INTERVAL intervals;
284 273
diff --git a/src/pdumper.c b/src/pdumper.c
index 35e86d2b504..e1c55d07ac3 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2811,7 +2811,6 @@ dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer)
2811 DUMP_FIELD_COPY (out, buffer, own_text.end_unchanged); 2811 DUMP_FIELD_COPY (out, buffer, own_text.end_unchanged);
2812 DUMP_FIELD_COPY (out, buffer, own_text.unchanged_modified); 2812 DUMP_FIELD_COPY (out, buffer, own_text.unchanged_modified);
2813 DUMP_FIELD_COPY (out, buffer, own_text.overlay_unchanged_modified); 2813 DUMP_FIELD_COPY (out, buffer, own_text.overlay_unchanged_modified);
2814 DUMP_FIELD_COPY (out, buffer, own_text.chars_unchanged_modified);
2815 if (buffer->own_text.intervals) 2814 if (buffer->own_text.intervals)
2816 dump_field_fixup_later (ctx, out, buffer, &buffer->own_text.intervals); 2815 dump_field_fixup_later (ctx, out, buffer, &buffer->own_text.intervals);
2817 dump_field_lv_rawptr (ctx, out, buffer, &buffer->own_text.markers, 2816 dump_field_lv_rawptr (ctx, out, buffer, &buffer->own_text.markers,
diff --git a/src/xdisp.c b/src/xdisp.c
index 4e087bc39be..66584e4d73a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -17264,7 +17264,6 @@ mark_window_display_accurate_1 (struct window *w, bool accurate_p)
17264 17264
17265 BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); 17265 BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b);
17266 BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); 17266 BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b);
17267 BUF_CHARS_UNCHANGED_MODIFIED (b) = BUF_CHARS_MODIFF (b);
17268 BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); 17267 BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b);
17269 BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); 17268 BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b);
17270 17269
@@ -19535,7 +19534,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
19535 /* Check whether the buffer to be displayed contains long lines. */ 19534 /* Check whether the buffer to be displayed contains long lines. */
19536 if (!NILP (Vlong_line_threshold) 19535 if (!NILP (Vlong_line_threshold)
19537 && !current_buffer->long_line_optimizations_p 19536 && !current_buffer->long_line_optimizations_p
19538 && (CHARS_MODIFF - CHARS_UNCHANGED_MODIFIED > 8 19537 && (CHARS_MODIFF - UNCHANGED_MODIFIED > 8
19539 || current_buffer->clip_changed)) 19538 || current_buffer->clip_changed))
19540 { 19539 {
19541 ptrdiff_t cur, next, found, max = 0, threshold; 19540 ptrdiff_t cur, next, found, max = 0, threshold;
diff --git a/src/xfaces.c b/src/xfaces.c
index df078227c8a..643f4365896 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6071,8 +6071,42 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
6071 emacs_abort (); 6071 emacs_abort ();
6072 } 6072 }
6073 if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) 6073 if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
6074 attrs[LFACE_FONT_INDEX] 6074 {
6075 = font_load_for_lface (f, attrs, attrs[LFACE_FONT_INDEX]); 6075 Lisp_Object spec = copy_font_spec (attrs[LFACE_FONT_INDEX]);
6076#define MAYBE_UNSET_ATTRIBUTE(ATTR) \
6077 if (realize_gui_face_ignored_spec_attributes \
6078 & (1 << FONT_##ATTR##_INDEX)) \
6079 ASET (spec, FONT_##ATTR##_INDEX, Qnil);
6080 /* The default value of
6081 realize_gui_face_ignored_spec_attributes unsets the
6082 weight, slant and width in spec. The best possible
6083 values for these attributes is determined in
6084 font_find_for_lface, called by font_load_for_lface, when
6085 the candidate list returned by font_list_entities is
6086 sorted by font_select_entity (which calls
6087 font_sort_entities, which calls font_score). If these
6088 attributes are not unset here, the candidate font list
6089 returned by font_list_entities only contains fonts that
6090 are exact matches for these weight, slant and width
6091 attributes, which leads to suboptimal or wrong font
6092 choices. See bug#59347. */
6093 MAYBE_UNSET_ATTRIBUTE (WEIGHT);
6094 MAYBE_UNSET_ATTRIBUTE (SLANT);
6095 MAYBE_UNSET_ATTRIBUTE (WIDTH);
6096 /* Also allow unsetting other attributes for debugging
6097 purposes. */
6098 MAYBE_UNSET_ATTRIBUTE (FAMILY);
6099 MAYBE_UNSET_ATTRIBUTE (FOUNDRY);
6100 MAYBE_UNSET_ATTRIBUTE (REGISTRY);
6101 MAYBE_UNSET_ATTRIBUTE (ADSTYLE);
6102 MAYBE_UNSET_ATTRIBUTE (SIZE);
6103 MAYBE_UNSET_ATTRIBUTE (DPI);
6104 MAYBE_UNSET_ATTRIBUTE (SPACING);
6105 MAYBE_UNSET_ATTRIBUTE (AVGWIDTH);
6106 MAYBE_UNSET_ATTRIBUTE (EXTRA);
6107#undef MAYBE_UNSET_ATTRIBUTE
6108 attrs[LFACE_FONT_INDEX] = font_load_for_lface (f, attrs, spec);
6109 }
6076 if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) 6110 if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
6077 { 6111 {
6078 face->font = XFONT_OBJECT (attrs[LFACE_FONT_INDEX]); 6112 face->font = XFONT_OBJECT (attrs[LFACE_FONT_INDEX]);
@@ -7360,6 +7394,28 @@ Lisp programs that change the value of this variable should also
7360clear the face cache, see `clear-face-cache'. */); 7394clear the face cache, see `clear-face-cache'. */);
7361 face_near_same_color_threshold = 30000; 7395 face_near_same_color_threshold = 30000;
7362 7396
7397 DEFVAR_INT ("realize-gui-face-ignored-spec-attributes",
7398 realize_gui_face_ignored_spec_attributes,
7399 doc: /* Ignored font-spec attributes in realize_gui_face.
7400
7401The value is an integer number and represents a bit mask.
7402The attribute corresponding to each bit that is set is cleared in
7403realize_gui_face. The bits are: 1 = :foundry, 2 = :family,
74043 = :adstyle, 4 = :registry, 5 = :weight, 6 = :slant, 7 = :width,
74058 = :size, 9 = :dpi, 10 = :spacing, 11 = :avgwidth, 12 = extra
7406attributes (:name, :script, :lang and :otf).
7407
7408Bits 5 to 7 are set in the default value. When these bits are not
7409set, and when the font chosen for the default face has a weight, slant
7410or width that is not supported by other available fonts on the system,
7411such as 'medium', Emacs may select suboptimal fonts for other faces.
7412
7413There is no reason to change that value except for debugging purposes. */);
7414 realize_gui_face_ignored_spec_attributes =
7415 (1 << FONT_WEIGHT_INDEX) |
7416 (1 << FONT_SLANT_INDEX) |
7417 (1 << FONT_WIDTH_INDEX);
7418
7363#ifdef HAVE_WINDOW_SYSTEM 7419#ifdef HAVE_WINDOW_SYSTEM
7364 defsubr (&Sbitmap_spec_p); 7420 defsubr (&Sbitmap_spec_p);
7365 defsubr (&Sx_list_fonts); 7421 defsubr (&Sx_list_fonts);