diff options
| author | Michael Albinus | 2021-12-03 14:24:49 +0100 |
|---|---|---|
| committer | Michael Albinus | 2021-12-03 14:24:49 +0100 |
| commit | d3eb3918d4989408ae8b71d39c24924f2f2343c7 (patch) | |
| tree | 1a7c4be3407f515f22633038ccb19171203cf016 /src | |
| parent | 76099240119d0137f25b356d64e2c1b70201973e (diff) | |
| parent | 1431fce67f75e5f0acaa77f508502a00603177de (diff) | |
| download | emacs-d3eb3918d4989408ae8b71d39c24924f2f2343c7.tar.gz emacs-d3eb3918d4989408ae8b71d39c24924f2f2343c7.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 20 | ||||
| -rw-r--r-- | src/comp.c | 18 | ||||
| -rw-r--r-- | src/comp.h | 10 | ||||
| -rw-r--r-- | src/data.c | 10 | ||||
| -rw-r--r-- | src/eval.c | 23 | ||||
| -rw-r--r-- | src/fileio.c | 4 | ||||
| -rw-r--r-- | src/lisp.h | 16 | ||||
| -rw-r--r-- | src/lread.c | 12 | ||||
| -rw-r--r-- | src/pdumper.c | 40 | ||||
| -rw-r--r-- | src/xdisp.c | 57 | ||||
| -rw-r--r-- | src/xwidget.c | 3 |
11 files changed, 84 insertions, 129 deletions
diff --git a/src/alloc.c b/src/alloc.c index f8908c91dba..55c30847bbf 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3160,26 +3160,26 @@ cleanup_vector (struct Lisp_Vector *vector) | |||
| 3160 | module_finalize_function (function); | 3160 | module_finalize_function (function); |
| 3161 | } | 3161 | } |
| 3162 | #endif | 3162 | #endif |
| 3163 | else if (NATIVE_COMP_FLAG | 3163 | #ifdef HAVE_NATIVE_COMP |
| 3164 | && PSEUDOVECTOR_TYPEP (&vector->header, PVEC_NATIVE_COMP_UNIT)) | 3164 | else if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_NATIVE_COMP_UNIT)) |
| 3165 | { | 3165 | { |
| 3166 | struct Lisp_Native_Comp_Unit *cu = | 3166 | struct Lisp_Native_Comp_Unit *cu = |
| 3167 | PSEUDOVEC_STRUCT (vector, Lisp_Native_Comp_Unit); | 3167 | PSEUDOVEC_STRUCT (vector, Lisp_Native_Comp_Unit); |
| 3168 | unload_comp_unit (cu); | 3168 | unload_comp_unit (cu); |
| 3169 | } | 3169 | } |
| 3170 | else if (NATIVE_COMP_FLAG | 3170 | else if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_SUBR)) |
| 3171 | && PSEUDOVECTOR_TYPEP (&vector->header, PVEC_SUBR)) | ||
| 3172 | { | 3171 | { |
| 3173 | struct Lisp_Subr *subr = | 3172 | struct Lisp_Subr *subr = |
| 3174 | PSEUDOVEC_STRUCT (vector, Lisp_Subr); | 3173 | PSEUDOVEC_STRUCT (vector, Lisp_Subr); |
| 3175 | if (!NILP (subr->native_comp_u[0])) | 3174 | if (!NILP (subr->native_comp_u)) |
| 3176 | { | 3175 | { |
| 3177 | /* FIXME Alternative and non invasive solution to this | 3176 | /* FIXME Alternative and non invasive solution to this |
| 3178 | cast? */ | 3177 | cast? */ |
| 3179 | xfree ((char *)subr->symbol_name); | 3178 | xfree ((char *)subr->symbol_name); |
| 3180 | xfree (subr->native_c_name[0]); | 3179 | xfree (subr->native_c_name); |
| 3181 | } | 3180 | } |
| 3182 | } | 3181 | } |
| 3182 | #endif | ||
| 3183 | } | 3183 | } |
| 3184 | 3184 | ||
| 3185 | /* Reclaim space used by unmarked vectors. */ | 3185 | /* Reclaim space used by unmarked vectors. */ |
| @@ -6785,15 +6785,17 @@ mark_object (Lisp_Object arg) | |||
| 6785 | break; | 6785 | break; |
| 6786 | 6786 | ||
| 6787 | case PVEC_SUBR: | 6787 | case PVEC_SUBR: |
| 6788 | #ifdef HAVE_NATIVE_COMP | ||
| 6788 | if (SUBR_NATIVE_COMPILEDP (obj)) | 6789 | if (SUBR_NATIVE_COMPILEDP (obj)) |
| 6789 | { | 6790 | { |
| 6790 | set_vector_marked (ptr); | 6791 | set_vector_marked (ptr); |
| 6791 | struct Lisp_Subr *subr = XSUBR (obj); | 6792 | struct Lisp_Subr *subr = XSUBR (obj); |
| 6792 | mark_object (subr->native_intspec); | 6793 | mark_object (subr->native_intspec); |
| 6793 | mark_object (subr->native_comp_u[0]); | 6794 | mark_object (subr->native_comp_u); |
| 6794 | mark_object (subr->lambda_list[0]); | 6795 | mark_object (subr->lambda_list); |
| 6795 | mark_object (subr->type[0]); | 6796 | mark_object (subr->type); |
| 6796 | } | 6797 | } |
| 6798 | #endif | ||
| 6797 | break; | 6799 | break; |
| 6798 | 6800 | ||
| 6799 | case PVEC_FREE: | 6801 | case PVEC_FREE: |
diff --git a/src/comp.c b/src/comp.c index 7bb160e4f0a..fb9b1a5a2d8 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -5136,21 +5136,29 @@ make_subr (Lisp_Object symbol_name, Lisp_Object minarg, Lisp_Object maxarg, | |||
| 5136 | if (CONSP (minarg)) | 5136 | if (CONSP (minarg)) |
| 5137 | { | 5137 | { |
| 5138 | /* Dynamic code. */ | 5138 | /* Dynamic code. */ |
| 5139 | x->s.lambda_list[0] = maxarg; | 5139 | #ifdef HAVE_NATIVE_COMP |
| 5140 | x->s.lambda_list = maxarg; | ||
| 5141 | #endif | ||
| 5140 | maxarg = XCDR (minarg); | 5142 | maxarg = XCDR (minarg); |
| 5141 | minarg = XCAR (minarg); | 5143 | minarg = XCAR (minarg); |
| 5142 | } | 5144 | } |
| 5143 | else | 5145 | else |
| 5144 | x->s.lambda_list[0] = Qnil; | 5146 | { |
| 5147 | #ifdef HAVE_NATIVE_COMP | ||
| 5148 | x->s.lambda_list = Qnil; | ||
| 5149 | #endif | ||
| 5150 | } | ||
| 5145 | x->s.function.a0 = func; | 5151 | x->s.function.a0 = func; |
| 5146 | x->s.min_args = XFIXNUM (minarg); | 5152 | x->s.min_args = XFIXNUM (minarg); |
| 5147 | x->s.max_args = FIXNUMP (maxarg) ? XFIXNUM (maxarg) : MANY; | 5153 | x->s.max_args = FIXNUMP (maxarg) ? XFIXNUM (maxarg) : MANY; |
| 5148 | x->s.symbol_name = xstrdup (SSDATA (symbol_name)); | 5154 | x->s.symbol_name = xstrdup (SSDATA (symbol_name)); |
| 5149 | x->s.native_intspec = intspec; | 5155 | x->s.native_intspec = intspec; |
| 5150 | x->s.doc = XFIXNUM (doc_idx); | 5156 | x->s.doc = XFIXNUM (doc_idx); |
| 5151 | x->s.native_comp_u[0] = comp_u; | 5157 | #ifdef HAVE_NATIVE_COMP |
| 5152 | x->s.native_c_name[0] = xstrdup (SSDATA (c_name)); | 5158 | x->s.native_comp_u = comp_u; |
| 5153 | x->s.type[0] = type; | 5159 | x->s.native_c_name = xstrdup (SSDATA (c_name)); |
| 5160 | x->s.type = type; | ||
| 5161 | #endif | ||
| 5154 | Lisp_Object tem; | 5162 | Lisp_Object tem; |
| 5155 | XSETSUBR (tem, &x->s); | 5163 | XSETSUBR (tem, &x->s); |
| 5156 | 5164 | ||
diff --git a/src/comp.h b/src/comp.h index c4af4193d0b..96bb52a14bc 100644 --- a/src/comp.h +++ b/src/comp.h | |||
| @@ -20,16 +20,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 20 | #ifndef COMP_H | 20 | #ifndef COMP_H |
| 21 | #define COMP_H | 21 | #define COMP_H |
| 22 | 22 | ||
| 23 | /* To keep ifdefs under control. */ | ||
| 24 | enum { | ||
| 25 | NATIVE_COMP_FLAG = | ||
| 26 | #ifdef HAVE_NATIVE_COMP | ||
| 27 | 1 | ||
| 28 | #else | ||
| 29 | 0 | ||
| 30 | #endif | ||
| 31 | }; | ||
| 32 | |||
| 33 | #include <dynlib.h> | 23 | #include <dynlib.h> |
| 34 | 24 | ||
| 35 | struct Lisp_Native_Comp_Unit | 25 | struct Lisp_Native_Comp_Unit |
diff --git a/src/data.c b/src/data.c index 0d3376f0903..b2c395831ae 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -891,9 +891,11 @@ function or t otherwise. */) | |||
| 891 | { | 891 | { |
| 892 | CHECK_SUBR (subr); | 892 | CHECK_SUBR (subr); |
| 893 | 893 | ||
| 894 | return SUBR_NATIVE_COMPILED_DYNP (subr) | 894 | #ifdef HAVE_NATIVE_COMP |
| 895 | ? XSUBR (subr)->lambda_list[0] | 895 | if (SUBR_NATIVE_COMPILED_DYNP (subr)) |
| 896 | : Qt; | 896 | return XSUBR (subr)->lambda_list; |
| 897 | #endif | ||
| 898 | return Qt; | ||
| 897 | } | 899 | } |
| 898 | 900 | ||
| 899 | DEFUN ("subr-type", Fsubr_type, | 901 | DEFUN ("subr-type", Fsubr_type, |
| @@ -917,7 +919,7 @@ DEFUN ("subr-native-comp-unit", Fsubr_native_comp_unit, | |||
| 917 | (Lisp_Object subr) | 919 | (Lisp_Object subr) |
| 918 | { | 920 | { |
| 919 | CHECK_SUBR (subr); | 921 | CHECK_SUBR (subr); |
| 920 | return XSUBR (subr)->native_comp_u[0]; | 922 | return XSUBR (subr)->native_comp_u; |
| 921 | } | 923 | } |
| 922 | 924 | ||
| 923 | DEFUN ("native-comp-unit-file", Fnative_comp_unit_file, | 925 | DEFUN ("native-comp-unit-file", Fnative_comp_unit_file, |
diff --git a/src/eval.c b/src/eval.c index 94ad0607732..fe29564aa2d 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -220,17 +220,14 @@ void | |||
| 220 | init_eval_once (void) | 220 | init_eval_once (void) |
| 221 | { | 221 | { |
| 222 | /* Don't forget to update docs (lispref node "Local Variables"). */ | 222 | /* Don't forget to update docs (lispref node "Local Variables"). */ |
| 223 | if (!NATIVE_COMP_FLAG) | 223 | #ifndef HAVE_NATIVE_COMP |
| 224 | { | 224 | max_specpdl_size = 1800; /* See bug#46818. */ |
| 225 | max_specpdl_size = 1800; /* See bug#46818. */ | 225 | max_lisp_eval_depth = 800; |
| 226 | max_lisp_eval_depth = 800; | 226 | #else |
| 227 | } | 227 | /* Original values increased for comp.el. */ |
| 228 | else | 228 | max_specpdl_size = 2500; |
| 229 | { | 229 | max_lisp_eval_depth = 1600; |
| 230 | /* Original values increased for comp.el. */ | 230 | #endif |
| 231 | max_specpdl_size = 2500; | ||
| 232 | max_lisp_eval_depth = 1600; | ||
| 233 | } | ||
| 234 | Vrun_hooks = Qnil; | 231 | Vrun_hooks = Qnil; |
| 235 | pdumper_do_now_and_after_load (init_eval_once_for_pdumper); | 232 | pdumper_do_now_and_after_load (init_eval_once_for_pdumper); |
| 236 | } | 233 | } |
| @@ -3278,11 +3275,13 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, | |||
| 3278 | else if (MODULE_FUNCTIONP (fun)) | 3275 | else if (MODULE_FUNCTIONP (fun)) |
| 3279 | return funcall_module (fun, nargs, arg_vector); | 3276 | return funcall_module (fun, nargs, arg_vector); |
| 3280 | #endif | 3277 | #endif |
| 3278 | #ifdef HAVE_NATIVE_COMP | ||
| 3281 | else if (SUBR_NATIVE_COMPILED_DYNP (fun)) | 3279 | else if (SUBR_NATIVE_COMPILED_DYNP (fun)) |
| 3282 | { | 3280 | { |
| 3283 | syms_left = XSUBR (fun)->lambda_list[0]; | 3281 | syms_left = XSUBR (fun)->lambda_list; |
| 3284 | lexenv = Qnil; | 3282 | lexenv = Qnil; |
| 3285 | } | 3283 | } |
| 3284 | #endif | ||
| 3286 | else | 3285 | else |
| 3287 | emacs_abort (); | 3286 | emacs_abort (); |
| 3288 | 3287 | ||
diff --git a/src/fileio.c b/src/fileio.c index 859b30564aa..12ece586b83 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2386,7 +2386,9 @@ permissions. */) | |||
| 2386 | 2386 | ||
| 2387 | if (!NILP (keep_time)) | 2387 | if (!NILP (keep_time)) |
| 2388 | { | 2388 | { |
| 2389 | struct timespec ts[] = { get_stat_atime (&st), get_stat_mtime (&st) }; | 2389 | struct timespec ts[2]; |
| 2390 | ts[0] = get_stat_atime (&st); | ||
| 2391 | ts[1] = get_stat_mtime (&st); | ||
| 2390 | if (futimens (ofd, ts) != 0) | 2392 | if (futimens (ofd, ts) != 0) |
| 2391 | xsignal2 (Qfile_date_error, | 2393 | xsignal2 (Qfile_date_error, |
| 2392 | build_string ("Cannot set file date"), newname); | 2394 | build_string ("Cannot set file date"), newname); |
diff --git a/src/lisp.h b/src/lisp.h index 19caba40014..242156bbcb8 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2091,10 +2091,12 @@ struct Lisp_Subr | |||
| 2091 | Lisp_Object native_intspec; | 2091 | Lisp_Object native_intspec; |
| 2092 | }; | 2092 | }; |
| 2093 | EMACS_INT doc; | 2093 | EMACS_INT doc; |
| 2094 | Lisp_Object native_comp_u[NATIVE_COMP_FLAG]; | 2094 | #ifdef HAVE_NATIVE_COMP |
| 2095 | char *native_c_name[NATIVE_COMP_FLAG]; | 2095 | Lisp_Object native_comp_u; |
| 2096 | Lisp_Object lambda_list[NATIVE_COMP_FLAG]; | 2096 | char *native_c_name; |
| 2097 | Lisp_Object type[NATIVE_COMP_FLAG]; | 2097 | Lisp_Object lambda_list; |
| 2098 | Lisp_Object type; | ||
| 2099 | #endif | ||
| 2098 | } GCALIGNED_STRUCT; | 2100 | } GCALIGNED_STRUCT; |
| 2099 | union Aligned_Lisp_Subr | 2101 | union Aligned_Lisp_Subr |
| 2100 | { | 2102 | { |
| @@ -4786,19 +4788,19 @@ extern char *emacs_root_dir (void); | |||
| 4786 | INLINE bool | 4788 | INLINE bool |
| 4787 | SUBR_NATIVE_COMPILEDP (Lisp_Object a) | 4789 | SUBR_NATIVE_COMPILEDP (Lisp_Object a) |
| 4788 | { | 4790 | { |
| 4789 | return SUBRP (a) && !NILP (XSUBR (a)->native_comp_u[0]); | 4791 | return SUBRP (a) && !NILP (XSUBR (a)->native_comp_u); |
| 4790 | } | 4792 | } |
| 4791 | 4793 | ||
| 4792 | INLINE bool | 4794 | INLINE bool |
| 4793 | SUBR_NATIVE_COMPILED_DYNP (Lisp_Object a) | 4795 | SUBR_NATIVE_COMPILED_DYNP (Lisp_Object a) |
| 4794 | { | 4796 | { |
| 4795 | return SUBR_NATIVE_COMPILEDP (a) && !NILP (XSUBR (a)->lambda_list[0]); | 4797 | return SUBR_NATIVE_COMPILEDP (a) && !NILP (XSUBR (a)->lambda_list); |
| 4796 | } | 4798 | } |
| 4797 | 4799 | ||
| 4798 | INLINE Lisp_Object | 4800 | INLINE Lisp_Object |
| 4799 | SUBR_TYPE (Lisp_Object a) | 4801 | SUBR_TYPE (Lisp_Object a) |
| 4800 | { | 4802 | { |
| 4801 | return XSUBR (a)->type[0]; | 4803 | return XSUBR (a)->type; |
| 4802 | } | 4804 | } |
| 4803 | 4805 | ||
| 4804 | INLINE struct Lisp_Native_Comp_Unit * | 4806 | INLINE struct Lisp_Native_Comp_Unit * |
diff --git a/src/lread.c b/src/lread.c index 2e63ec48912..5a2f1bc54e5 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1279,7 +1279,10 @@ Return t if the file exists and loads successfully. */) | |||
| 1279 | || suffix_p (file, MODULES_SECONDARY_SUFFIX) | 1279 | || suffix_p (file, MODULES_SECONDARY_SUFFIX) |
| 1280 | #endif | 1280 | #endif |
| 1281 | #endif | 1281 | #endif |
| 1282 | || (NATIVE_COMP_FLAG && suffix_p (file, NATIVE_ELISP_SUFFIX))) | 1282 | #ifdef HAVE_NATIVE_COMP |
| 1283 | || suffix_p (file, NATIVE_ELISP_SUFFIX) | ||
| 1284 | #endif | ||
| 1285 | ) | ||
| 1283 | must_suffix = Qnil; | 1286 | must_suffix = Qnil; |
| 1284 | /* Don't insist on adding a suffix | 1287 | /* Don't insist on adding a suffix |
| 1285 | if the argument includes a directory name. */ | 1288 | if the argument includes a directory name. */ |
| @@ -1359,8 +1362,11 @@ Return t if the file exists and loads successfully. */) | |||
| 1359 | bool is_module = false; | 1362 | bool is_module = false; |
| 1360 | #endif | 1363 | #endif |
| 1361 | 1364 | ||
| 1362 | bool is_native_elisp = | 1365 | #ifdef HAVE_NATIVE_COMP |
| 1363 | NATIVE_COMP_FLAG && suffix_p (found, NATIVE_ELISP_SUFFIX) ? true : false; | 1366 | bool is_native_elisp = suffix_p (found, NATIVE_ELISP_SUFFIX); |
| 1367 | #else | ||
| 1368 | bool is_native_elisp = false; | ||
| 1369 | #endif | ||
| 1364 | 1370 | ||
| 1365 | /* Check if we're stuck in a recursive load cycle. | 1371 | /* Check if we're stuck in a recursive load cycle. |
| 1366 | 1372 | ||
diff --git a/src/pdumper.c b/src/pdumper.c index 9eff5c48d09..02956aa7cec 100644 --- a/src/pdumper.c +++ b/src/pdumper.c | |||
| @@ -2860,13 +2860,18 @@ dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr) | |||
| 2860 | struct Lisp_Subr out; | 2860 | struct Lisp_Subr out; |
| 2861 | dump_object_start (ctx, &out, sizeof (out)); | 2861 | dump_object_start (ctx, &out, sizeof (out)); |
| 2862 | DUMP_FIELD_COPY (&out, subr, header.size); | 2862 | DUMP_FIELD_COPY (&out, subr, header.size); |
| 2863 | if (NATIVE_COMP_FLAG && !NILP (subr->native_comp_u[0])) | 2863 | #ifdef HAVE_NATIVE_COMP |
| 2864 | bool native_comp = !NILP (subr->native_comp_u); | ||
| 2865 | #else | ||
| 2866 | bool native_comp = false; | ||
| 2867 | #endif | ||
| 2868 | if (native_comp) | ||
| 2864 | out.function.a0 = NULL; | 2869 | out.function.a0 = NULL; |
| 2865 | else | 2870 | else |
| 2866 | dump_field_emacs_ptr (ctx, &out, subr, &subr->function.a0); | 2871 | dump_field_emacs_ptr (ctx, &out, subr, &subr->function.a0); |
| 2867 | DUMP_FIELD_COPY (&out, subr, min_args); | 2872 | DUMP_FIELD_COPY (&out, subr, min_args); |
| 2868 | DUMP_FIELD_COPY (&out, subr, max_args); | 2873 | DUMP_FIELD_COPY (&out, subr, max_args); |
| 2869 | if (NATIVE_COMP_FLAG && !NILP (subr->native_comp_u[0])) | 2874 | if (native_comp) |
| 2870 | { | 2875 | { |
| 2871 | dump_field_fixup_later (ctx, &out, subr, &subr->symbol_name); | 2876 | dump_field_fixup_later (ctx, &out, subr, &subr->symbol_name); |
| 2872 | dump_remember_cold_op (ctx, | 2877 | dump_remember_cold_op (ctx, |
| @@ -2880,19 +2885,16 @@ dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr) | |||
| 2880 | dump_field_emacs_ptr (ctx, &out, subr, &subr->intspec); | 2885 | dump_field_emacs_ptr (ctx, &out, subr, &subr->intspec); |
| 2881 | } | 2886 | } |
| 2882 | DUMP_FIELD_COPY (&out, subr, doc); | 2887 | DUMP_FIELD_COPY (&out, subr, doc); |
| 2883 | if (NATIVE_COMP_FLAG) | 2888 | #ifdef HAVE_NATIVE_COMP |
| 2884 | { | 2889 | dump_field_lv (ctx, &out, subr, &subr->native_comp_u, WEIGHT_NORMAL); |
| 2885 | dump_field_lv (ctx, &out, subr, &subr->native_comp_u[0], WEIGHT_NORMAL); | 2890 | if (!NILP (subr->native_comp_u)) |
| 2886 | if (!NILP (subr->native_comp_u[0])) | 2891 | dump_field_fixup_later (ctx, &out, subr, &subr->native_c_name); |
| 2887 | dump_field_fixup_later (ctx, &out, subr, &subr->native_c_name[0]); | ||
| 2888 | 2892 | ||
| 2889 | dump_field_lv (ctx, &out, subr, &subr->lambda_list[0], WEIGHT_NORMAL); | 2893 | dump_field_lv (ctx, &out, subr, &subr->lambda_list, WEIGHT_NORMAL); |
| 2890 | dump_field_lv (ctx, &out, subr, &subr->type[0], WEIGHT_NORMAL); | 2894 | dump_field_lv (ctx, &out, subr, &subr->type, WEIGHT_NORMAL); |
| 2891 | } | 2895 | #endif |
| 2892 | dump_off subr_off = dump_object_finish (ctx, &out, sizeof (out)); | 2896 | dump_off subr_off = dump_object_finish (ctx, &out, sizeof (out)); |
| 2893 | if (NATIVE_COMP_FLAG | 2897 | if (native_comp && ctx->flags.dump_object_contents) |
| 2894 | && ctx->flags.dump_object_contents | ||
| 2895 | && !NILP (subr->native_comp_u[0])) | ||
| 2896 | /* We'll do the final addr relocation during VERY_LATE_RELOCS time | 2898 | /* We'll do the final addr relocation during VERY_LATE_RELOCS time |
| 2897 | after the compilation units has been loaded. */ | 2899 | after the compilation units has been loaded. */ |
| 2898 | dump_push (&ctx->dump_relocs[VERY_LATE_RELOCS], | 2900 | dump_push (&ctx->dump_relocs[VERY_LATE_RELOCS], |
| @@ -3422,9 +3424,9 @@ dump_cold_native_subr (struct dump_context *ctx, Lisp_Object subr) | |||
| 3422 | 3424 | ||
| 3423 | dump_remember_fixup_ptr_raw | 3425 | dump_remember_fixup_ptr_raw |
| 3424 | (ctx, | 3426 | (ctx, |
| 3425 | subr_offset + dump_offsetof (struct Lisp_Subr, native_c_name[0]), | 3427 | subr_offset + dump_offsetof (struct Lisp_Subr, native_c_name), |
| 3426 | ctx->offset); | 3428 | ctx->offset); |
| 3427 | const char *c_name = XSUBR (subr)->native_c_name[0]; | 3429 | const char *c_name = XSUBR (subr)->native_c_name; |
| 3428 | dump_write (ctx, c_name, 1 + strlen (c_name)); | 3430 | dump_write (ctx, c_name, 1 + strlen (c_name)); |
| 3429 | } | 3431 | } |
| 3430 | #endif | 3432 | #endif |
| @@ -5361,20 +5363,16 @@ dump_do_dump_relocation (const uintptr_t dump_base, | |||
| 5361 | } | 5363 | } |
| 5362 | case RELOC_NATIVE_SUBR: | 5364 | case RELOC_NATIVE_SUBR: |
| 5363 | { | 5365 | { |
| 5364 | if (!NATIVE_COMP_FLAG) | ||
| 5365 | /* This cannot happen. */ | ||
| 5366 | emacs_abort (); | ||
| 5367 | |||
| 5368 | /* When resurrecting from a dump given non all the original | 5366 | /* When resurrecting from a dump given non all the original |
| 5369 | native compiled subrs may be still around we can't rely on | 5367 | native compiled subrs may be still around we can't rely on |
| 5370 | a 'top_level_run' mechanism, we revive them one-by-one | 5368 | a 'top_level_run' mechanism, we revive them one-by-one |
| 5371 | here. */ | 5369 | here. */ |
| 5372 | struct Lisp_Subr *subr = dump_ptr (dump_base, reloc_offset); | 5370 | struct Lisp_Subr *subr = dump_ptr (dump_base, reloc_offset); |
| 5373 | struct Lisp_Native_Comp_Unit *comp_u = | 5371 | struct Lisp_Native_Comp_Unit *comp_u = |
| 5374 | XNATIVE_COMP_UNIT (subr->native_comp_u[0]); | 5372 | XNATIVE_COMP_UNIT (subr->native_comp_u); |
| 5375 | if (!comp_u->handle) | 5373 | if (!comp_u->handle) |
| 5376 | error ("NULL handle in compilation unit %s", SSDATA (comp_u->file)); | 5374 | error ("NULL handle in compilation unit %s", SSDATA (comp_u->file)); |
| 5377 | const char *c_name = subr->native_c_name[0]; | 5375 | const char *c_name = subr->native_c_name; |
| 5378 | eassert (c_name); | 5376 | eassert (c_name); |
| 5379 | void *func = dynlib_sym (comp_u->handle, c_name); | 5377 | void *func = dynlib_sym (comp_u->handle, c_name); |
| 5380 | if (!func) | 5378 | if (!func) |
diff --git a/src/xdisp.c b/src/xdisp.c index 80c8457795d..9f93799783d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -28812,21 +28812,6 @@ normal_char_height (struct font *font, int c) | |||
| 28812 | return ascent + descent; | 28812 | return ascent + descent; |
| 28813 | } | 28813 | } |
| 28814 | 28814 | ||
| 28815 | /* Return the "standard" pixel width of a character from FACE's font, | ||
| 28816 | if the font is fixed-pitch, zero otherwise. */ | ||
| 28817 | static int | ||
| 28818 | get_normal_width (struct face *face) | ||
| 28819 | { | ||
| 28820 | struct font *ascii_font = face->ascii_face->font; | ||
| 28821 | /* Heuristics: fixed-pitch fonts have the value of MAX-WIDTH not | ||
| 28822 | much larger than AVERAGE-WIDTH. */ | ||
| 28823 | bool fixed_pitch = | ||
| 28824 | ascii_font->average_width == ascii_font->space_width | ||
| 28825 | && ascii_font->average_width != 0 | ||
| 28826 | && ascii_font->max_width < 3 * ascii_font->average_width; | ||
| 28827 | return fixed_pitch ? ascii_font->space_width : 0; | ||
| 28828 | } | ||
| 28829 | |||
| 28830 | /* EXPORT for RIF: | 28815 | /* EXPORT for RIF: |
| 28831 | Set *LEFT and *RIGHT to the left and right overhang of GLYPH on | 28816 | Set *LEFT and *RIGHT to the left and right overhang of GLYPH on |
| 28832 | frame F. Overhangs of glyphs other than type CHAR_GLYPH are | 28817 | frame F. Overhangs of glyphs other than type CHAR_GLYPH are |
| @@ -30924,17 +30909,6 @@ gui_produce_glyphs (struct it *it) | |||
| 30924 | it->phys_ascent = pcm->ascent + boff; | 30909 | it->phys_ascent = pcm->ascent + boff; |
| 30925 | it->phys_descent = pcm->descent - boff; | 30910 | it->phys_descent = pcm->descent - boff; |
| 30926 | it->pixel_width = pcm->width; | 30911 | it->pixel_width = pcm->width; |
| 30927 | if (align_columns_display) | ||
| 30928 | { | ||
| 30929 | int unit_width = get_normal_width (face); | ||
| 30930 | if (unit_width > 0) | ||
| 30931 | { | ||
| 30932 | int ncolumns = | ||
| 30933 | (it->pixel_width - 1 + unit_width) / unit_width; | ||
| 30934 | |||
| 30935 | it->pixel_width = ncolumns * unit_width; | ||
| 30936 | } | ||
| 30937 | } | ||
| 30938 | /* Don't use font-global values for ascent and descent | 30912 | /* Don't use font-global values for ascent and descent |
| 30939 | if they result in an exceedingly large line height. */ | 30913 | if they result in an exceedingly large line height. */ |
| 30940 | if (it->override_ascent < 0) | 30914 | if (it->override_ascent < 0) |
| @@ -31512,17 +31486,6 @@ gui_produce_glyphs (struct it *it) | |||
| 31512 | it->glyph_row->contains_overlapping_glyphs_p = true; | 31486 | it->glyph_row->contains_overlapping_glyphs_p = true; |
| 31513 | 31487 | ||
| 31514 | it->pixel_width = cmp->pixel_width; | 31488 | it->pixel_width = cmp->pixel_width; |
| 31515 | if (align_columns_display) | ||
| 31516 | { | ||
| 31517 | int unit_width = get_normal_width (face); | ||
| 31518 | if (unit_width > 0) | ||
| 31519 | { | ||
| 31520 | int ncolumns = | ||
| 31521 | (it->pixel_width - 1 + unit_width) / unit_width; | ||
| 31522 | |||
| 31523 | it->pixel_width = ncolumns * unit_width; | ||
| 31524 | } | ||
| 31525 | } | ||
| 31526 | it->ascent = it->phys_ascent = cmp->ascent; | 31489 | it->ascent = it->phys_ascent = cmp->ascent; |
| 31527 | it->descent = it->phys_descent = cmp->descent; | 31490 | it->descent = it->phys_descent = cmp->descent; |
| 31528 | IT_APPLY_FACE_BOX(it, face); | 31491 | IT_APPLY_FACE_BOX(it, face); |
| @@ -31568,17 +31531,6 @@ gui_produce_glyphs (struct it *it) | |||
| 31568 | it->glyph_row->contains_overlapping_glyphs_p = true; | 31531 | it->glyph_row->contains_overlapping_glyphs_p = true; |
| 31569 | it->ascent = it->phys_ascent = metrics.ascent; | 31532 | it->ascent = it->phys_ascent = metrics.ascent; |
| 31570 | it->descent = it->phys_descent = metrics.descent; | 31533 | it->descent = it->phys_descent = metrics.descent; |
| 31571 | if (align_columns_display) | ||
| 31572 | { | ||
| 31573 | int unit_width = get_normal_width (face); | ||
| 31574 | if (unit_width > 0) | ||
| 31575 | { | ||
| 31576 | int ncolumns = | ||
| 31577 | (it->pixel_width - 1 + unit_width) / unit_width; | ||
| 31578 | |||
| 31579 | it->pixel_width = ncolumns * unit_width; | ||
| 31580 | } | ||
| 31581 | } | ||
| 31582 | } | 31534 | } |
| 31583 | IT_APPLY_FACE_BOX(it, face); | 31535 | IT_APPLY_FACE_BOX(it, face); |
| 31584 | 31536 | ||
| @@ -35655,15 +35607,6 @@ variable are ignored and the default 0.25 is used instead. */); | |||
| 35655 | Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); | 35607 | Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); |
| 35656 | Vdisplay_pixels_per_inch = make_float (72.0); | 35608 | Vdisplay_pixels_per_inch = make_float (72.0); |
| 35657 | 35609 | ||
| 35658 | DEFVAR_BOOL ("align-columns-display", align_columns_display, | ||
| 35659 | doc: /* Whether to align columns on GUI frames. | ||
| 35660 | If this is non-nil characters displayed on GUI frames will be | ||
| 35661 | aligned to produce straight columns. This is achieved by | ||
| 35662 | enlarging the pixel width of characters to an integral | ||
| 35663 | multiple of pixels taken by ASCII characters of the same face. | ||
| 35664 | This affects only fixed-pitch fonts. */); | ||
| 35665 | align_columns_display = false; | ||
| 35666 | |||
| 35667 | #ifdef GLYPH_DEBUG | 35610 | #ifdef GLYPH_DEBUG |
| 35668 | DEFVAR_INT ("debug-end-pos", debug_end_pos, doc: /* Don't ask. */); | 35611 | DEFVAR_INT ("debug-end-pos", debug_end_pos, doc: /* Don't ask. */); |
| 35669 | #endif | 35612 | #endif |
diff --git a/src/xwidget.c b/src/xwidget.c index a5b96d01100..9b9f364ce40 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -1098,6 +1098,9 @@ xwidget_scroll (struct xwidget_view *view, double x, double y, | |||
| 1098 | xg_event->scroll.delta_y = dy; | 1098 | xg_event->scroll.delta_y = dy; |
| 1099 | xg_event->scroll.device = find_suitable_pointer (view->frame); | 1099 | xg_event->scroll.device = find_suitable_pointer (view->frame); |
| 1100 | 1100 | ||
| 1101 | if (!(fabs (dx) > 0) || !(fabs (dy) > 0)) | ||
| 1102 | xg_event->scroll.is_stop = TRUE; | ||
| 1103 | |||
| 1101 | g_object_ref (xg_event->any.window); | 1104 | g_object_ref (xg_event->any.window); |
| 1102 | 1105 | ||
| 1103 | gtk_main_do_event (xg_event); | 1106 | gtk_main_do_event (xg_event); |