diff options
| author | Andrea Corallo | 2021-02-21 22:08:01 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2021-02-21 22:08:01 +0100 |
| commit | cf1e8e792f60949e09e3ad4c53fb61b0b7628229 (patch) | |
| tree | 35080229c9e3b46e5db14a2f051c001ab8c6e586 /src | |
| parent | 39792cf62987ecc1a772f6a2027d6b32c70e8312 (diff) | |
| parent | d0c47652e527397cae96444c881bf60455c763c1 (diff) | |
| download | emacs-cf1e8e792f60949e09e3ad4c53fb61b0b7628229.tar.gz emacs-cf1e8e792f60949e09e3ad4c53fb61b0b7628229.zip | |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 33 | ||||
| -rw-r--r-- | src/callproc.c | 6 | ||||
| -rw-r--r-- | src/data.c | 12 | ||||
| -rw-r--r-- | src/dispnew.c | 2 | ||||
| -rw-r--r-- | src/font.c | 2 | ||||
| -rw-r--r-- | src/indent.c | 2 | ||||
| -rw-r--r-- | src/nsterm.m | 7 | ||||
| -rw-r--r-- | src/process.c | 2 | ||||
| -rw-r--r-- | src/w32.c | 51 | ||||
| -rw-r--r-- | src/w32fns.c | 2 |
10 files changed, 111 insertions, 8 deletions
diff --git a/src/alloc.c b/src/alloc.c index 0ed5b9346f6..af083361770 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3519,6 +3519,38 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT | |||
| 3519 | return val; | 3519 | return val; |
| 3520 | } | 3520 | } |
| 3521 | 3521 | ||
| 3522 | DEFUN ("make-closure", Fmake_closure, Smake_closure, 1, MANY, 0, | ||
| 3523 | doc: /* Create a byte-code closure from PROTOTYPE and CLOSURE-VARS. | ||
| 3524 | Return a copy of PROTOTYPE, a byte-code object, with CLOSURE-VARS | ||
| 3525 | replacing the elements in the beginning of the constant-vector. | ||
| 3526 | usage: (make-closure PROTOTYPE &rest CLOSURE-VARS) */) | ||
| 3527 | (ptrdiff_t nargs, Lisp_Object *args) | ||
| 3528 | { | ||
| 3529 | Lisp_Object protofun = args[0]; | ||
| 3530 | CHECK_TYPE (COMPILEDP (protofun), Qbyte_code_function_p, protofun); | ||
| 3531 | |||
| 3532 | /* Create a copy of the constant vector, filling it with the closure | ||
| 3533 | variables in the beginning. (The overwritten part should just | ||
| 3534 | contain placeholder values.) */ | ||
| 3535 | Lisp_Object proto_constvec = AREF (protofun, COMPILED_CONSTANTS); | ||
| 3536 | ptrdiff_t constsize = ASIZE (proto_constvec); | ||
| 3537 | ptrdiff_t nvars = nargs - 1; | ||
| 3538 | if (nvars > constsize) | ||
| 3539 | error ("Closure vars do not fit in constvec"); | ||
| 3540 | Lisp_Object constvec = make_uninit_vector (constsize); | ||
| 3541 | memcpy (XVECTOR (constvec)->contents, args + 1, nvars * word_size); | ||
| 3542 | memcpy (XVECTOR (constvec)->contents + nvars, | ||
| 3543 | XVECTOR (proto_constvec)->contents + nvars, | ||
| 3544 | (constsize - nvars) * word_size); | ||
| 3545 | |||
| 3546 | /* Return a copy of the prototype function with the new constant vector. */ | ||
| 3547 | ptrdiff_t protosize = PVSIZE (protofun); | ||
| 3548 | struct Lisp_Vector *v = allocate_vectorlike (protosize, false); | ||
| 3549 | v->header = XVECTOR (protofun)->header; | ||
| 3550 | memcpy (v->contents, XVECTOR (protofun)->contents, protosize * word_size); | ||
| 3551 | v->contents[COMPILED_CONSTANTS] = constvec; | ||
| 3552 | return make_lisp_ptr (v, Lisp_Vectorlike); | ||
| 3553 | } | ||
| 3522 | 3554 | ||
| 3523 | 3555 | ||
| 3524 | /*********************************************************************** | 3556 | /*********************************************************************** |
| @@ -7605,6 +7637,7 @@ N should be nonnegative. */); | |||
| 7605 | defsubr (&Srecord); | 7637 | defsubr (&Srecord); |
| 7606 | defsubr (&Sbool_vector); | 7638 | defsubr (&Sbool_vector); |
| 7607 | defsubr (&Smake_byte_code); | 7639 | defsubr (&Smake_byte_code); |
| 7640 | defsubr (&Smake_closure); | ||
| 7608 | defsubr (&Smake_list); | 7641 | defsubr (&Smake_list); |
| 7609 | defsubr (&Smake_vector); | 7642 | defsubr (&Smake_vector); |
| 7610 | defsubr (&Smake_record); | 7643 | defsubr (&Smake_record); |
diff --git a/src/callproc.c b/src/callproc.c index cb72b070b7b..cd0f67fe29b 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -411,7 +411,11 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 411 | /* If the buffer is (still) a list, it might be a (:file "file") spec. */ | 411 | /* If the buffer is (still) a list, it might be a (:file "file") spec. */ |
| 412 | if (CONSP (buffer) && EQ (XCAR (buffer), QCfile)) | 412 | if (CONSP (buffer) && EQ (XCAR (buffer), QCfile)) |
| 413 | { | 413 | { |
| 414 | output_file = Fexpand_file_name (XCAR (XCDR (buffer)), | 414 | Lisp_Object ofile = XCDR (buffer); |
| 415 | if (CONSP (ofile)) | ||
| 416 | ofile = XCAR (ofile); | ||
| 417 | CHECK_STRING (ofile); | ||
| 418 | output_file = Fexpand_file_name (ofile, | ||
| 415 | BVAR (current_buffer, directory)); | 419 | BVAR (current_buffer, directory)); |
| 416 | CHECK_STRING (output_file); | 420 | CHECK_STRING (output_file); |
| 417 | buffer = Qnil; | 421 | buffer = Qnil; |
diff --git a/src/data.c b/src/data.c index 5177a7cc649..50d4374abdd 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1031,9 +1031,17 @@ The value, if non-nil, is a list of mode name symbols. */) | |||
| 1031 | if (NILP (fun)) | 1031 | if (NILP (fun)) |
| 1032 | return Qnil; | 1032 | return Qnil; |
| 1033 | 1033 | ||
| 1034 | /* Use a `command-modes' property if present, analogous to the | ||
| 1035 | function-documentation property. */ | ||
| 1034 | fun = command; | 1036 | fun = command; |
| 1035 | while (SYMBOLP (fun)) | 1037 | while (SYMBOLP (fun)) |
| 1036 | fun = Fsymbol_function (fun); | 1038 | { |
| 1039 | Lisp_Object modes = Fget (fun, Qcommand_modes); | ||
| 1040 | if (!NILP (modes)) | ||
| 1041 | return modes; | ||
| 1042 | else | ||
| 1043 | fun = Fsymbol_function (fun); | ||
| 1044 | } | ||
| 1037 | 1045 | ||
| 1038 | if (COMPILEDP (fun)) | 1046 | if (COMPILEDP (fun)) |
| 1039 | { | 1047 | { |
| @@ -4056,6 +4064,8 @@ syms_of_data (void) | |||
| 4056 | DEFSYM (Qinteractive_form, "interactive-form"); | 4064 | DEFSYM (Qinteractive_form, "interactive-form"); |
| 4057 | DEFSYM (Qdefalias_fset_function, "defalias-fset-function"); | 4065 | DEFSYM (Qdefalias_fset_function, "defalias-fset-function"); |
| 4058 | 4066 | ||
| 4067 | DEFSYM (Qbyte_code_function_p, "byte-code-function-p"); | ||
| 4068 | |||
| 4059 | defsubr (&Sindirect_variable); | 4069 | defsubr (&Sindirect_variable); |
| 4060 | defsubr (&Sinteractive_form); | 4070 | defsubr (&Sinteractive_form); |
| 4061 | defsubr (&Scommand_modes); | 4071 | defsubr (&Scommand_modes); |
diff --git a/src/dispnew.c b/src/dispnew.c index e603c671363..b3e4587250f 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -3328,7 +3328,7 @@ update_frame_with_menu (struct frame *f, int row, int col) | |||
| 3328 | } | 3328 | } |
| 3329 | 3329 | ||
| 3330 | /* Update the mouse position for a frame F. This handles both | 3330 | /* Update the mouse position for a frame F. This handles both |
| 3331 | updating the display for mouse-face propreties and updating the | 3331 | updating the display for mouse-face properties and updating the |
| 3332 | help echo text. | 3332 | help echo text. |
| 3333 | 3333 | ||
| 3334 | Returns the number of events generated. */ | 3334 | Returns the number of events generated. */ |
diff --git a/src/font.c b/src/font.c index a59ebe216b8..7c1d1ff89b1 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -4122,7 +4122,7 @@ representing the OpenType features supported by the font by this form: | |||
| 4122 | SCRIPT, LANGSYS, and FEATURE are all symbols representing OpenType | 4122 | SCRIPT, LANGSYS, and FEATURE are all symbols representing OpenType |
| 4123 | Layout tags. | 4123 | Layout tags. |
| 4124 | 4124 | ||
| 4125 | In addition to the keys listed abobe, the following keys are reserved | 4125 | In addition to the keys listed above, the following keys are reserved |
| 4126 | for the specific meanings as below: | 4126 | for the specific meanings as below: |
| 4127 | 4127 | ||
| 4128 | The value of :combining-capability is non-nil if the font-backend of | 4128 | The value of :combining-capability is non-nil if the font-backend of |
diff --git a/src/indent.c b/src/indent.c index 0a6b460f753..6246b544fbd 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -1315,7 +1315,7 @@ compute_motion (ptrdiff_t from, ptrdiff_t frombyte, EMACS_INT fromvpos, | |||
| 1315 | j ^---- next after the point | 1315 | j ^---- next after the point |
| 1316 | ^--- next char. after the point. | 1316 | ^--- next char. after the point. |
| 1317 | ---------- | 1317 | ---------- |
| 1318 | In case of sigle-column character | 1318 | In case of single-column character |
| 1319 | 1319 | ||
| 1320 | ---------- | 1320 | ---------- |
| 1321 | abcdefgh\\ | 1321 | abcdefgh\\ |
diff --git a/src/nsterm.m b/src/nsterm.m index b0cf5952fd5..88317f88393 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -8377,6 +8377,11 @@ not_in_argv (NSString *arg) | |||
| 8377 | surface = [[EmacsSurface alloc] initWithSize:s | 8377 | surface = [[EmacsSurface alloc] initWithSize:s |
| 8378 | ColorSpace:[[[self window] colorSpace] | 8378 | ColorSpace:[[[self window] colorSpace] |
| 8379 | CGColorSpace]]; | 8379 | CGColorSpace]]; |
| 8380 | |||
| 8381 | /* Since we're using NSViewLayerContentsRedrawOnSetNeedsDisplay | ||
| 8382 | the layer's scale factor is not set automatically, so do it | ||
| 8383 | now. */ | ||
| 8384 | [[self layer] setContentsScale:[[self window] backingScaleFactor]]; | ||
| 8380 | } | 8385 | } |
| 8381 | 8386 | ||
| 8382 | CGContextRef context = [surface getContext]; | 8387 | CGContextRef context = [surface getContext]; |
| @@ -9762,7 +9767,7 @@ nswindow_orderedIndex_sort (id w1, id w2, void *c) | |||
| 9762 | for (id object in cache) | 9767 | for (id object in cache) |
| 9763 | CFRelease ((IOSurfaceRef)object); | 9768 | CFRelease ((IOSurfaceRef)object); |
| 9764 | 9769 | ||
| 9765 | [cache removeAllObjects]; | 9770 | [cache release]; |
| 9766 | 9771 | ||
| 9767 | [super dealloc]; | 9772 | [super dealloc]; |
| 9768 | } | 9773 | } |
diff --git a/src/process.c b/src/process.c index 3beb9cf7146..b98bc297a3f 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -8255,7 +8255,7 @@ init_process_emacs (int sockfd) | |||
| 8255 | private SIGCHLD handler, allowing catch_child_signal to copy | 8255 | private SIGCHLD handler, allowing catch_child_signal to copy |
| 8256 | it into lib_child_handler. | 8256 | it into lib_child_handler. |
| 8257 | 8257 | ||
| 8258 | Unfortunatly in glib commit 2e471acf, the behavior changed to | 8258 | Unfortunately in glib commit 2e471acf, the behavior changed to |
| 8259 | always install a signal handler when g_child_watch_source_new | 8259 | always install a signal handler when g_child_watch_source_new |
| 8260 | is called and not just the first time it's called. Glib also | 8260 | is called and not just the first time it's called. Glib also |
| 8261 | now resets signal handlers to SIG_DFL when it no longer has a | 8261 | now resets signal handlers to SIG_DFL when it no longer has a |
| @@ -346,6 +346,7 @@ static BOOL g_b_init_get_adapters_addresses; | |||
| 346 | static BOOL g_b_init_reg_open_key_ex_w; | 346 | static BOOL g_b_init_reg_open_key_ex_w; |
| 347 | static BOOL g_b_init_reg_query_value_ex_w; | 347 | static BOOL g_b_init_reg_query_value_ex_w; |
| 348 | static BOOL g_b_init_expand_environment_strings_w; | 348 | static BOOL g_b_init_expand_environment_strings_w; |
| 349 | static BOOL g_b_init_get_user_default_ui_language; | ||
| 349 | 350 | ||
| 350 | BOOL g_b_init_compare_string_w; | 351 | BOOL g_b_init_compare_string_w; |
| 351 | BOOL g_b_init_debug_break_process; | 352 | BOOL g_b_init_debug_break_process; |
| @@ -533,6 +534,7 @@ DWORD multiByteToWideCharFlags; | |||
| 533 | typedef LONG (WINAPI *RegOpenKeyExW_Proc) (HKEY,LPCWSTR,DWORD,REGSAM,PHKEY); | 534 | typedef LONG (WINAPI *RegOpenKeyExW_Proc) (HKEY,LPCWSTR,DWORD,REGSAM,PHKEY); |
| 534 | typedef LONG (WINAPI *RegQueryValueExW_Proc) (HKEY,LPCWSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD); | 535 | typedef LONG (WINAPI *RegQueryValueExW_Proc) (HKEY,LPCWSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD); |
| 535 | typedef DWORD (WINAPI *ExpandEnvironmentStringsW_Proc) (LPCWSTR,LPWSTR,DWORD); | 536 | typedef DWORD (WINAPI *ExpandEnvironmentStringsW_Proc) (LPCWSTR,LPWSTR,DWORD); |
| 537 | typedef LANGID (WINAPI *GetUserDefaultUILanguage_Proc) (void); | ||
| 536 | 538 | ||
| 537 | /* ** A utility function ** */ | 539 | /* ** A utility function ** */ |
| 538 | static BOOL | 540 | static BOOL |
| @@ -1489,6 +1491,28 @@ expand_environment_strings_w (LPCWSTR lpSrc, LPWSTR lpDst, DWORD nSize) | |||
| 1489 | return s_pfn_Expand_Environment_Strings_w (lpSrc, lpDst, nSize); | 1491 | return s_pfn_Expand_Environment_Strings_w (lpSrc, lpDst, nSize); |
| 1490 | } | 1492 | } |
| 1491 | 1493 | ||
| 1494 | static LANGID WINAPI | ||
| 1495 | get_user_default_ui_language (void) | ||
| 1496 | { | ||
| 1497 | static GetUserDefaultUILanguage_Proc s_pfn_GetUserDefaultUILanguage = NULL; | ||
| 1498 | HMODULE hm_kernel32 = NULL; | ||
| 1499 | |||
| 1500 | if (is_windows_9x () == TRUE) | ||
| 1501 | return 0; | ||
| 1502 | |||
| 1503 | if (g_b_init_get_user_default_ui_language == 0) | ||
| 1504 | { | ||
| 1505 | g_b_init_get_user_default_ui_language = 1; | ||
| 1506 | hm_kernel32 = LoadLibrary ("Kernel32.dll"); | ||
| 1507 | if (hm_kernel32) | ||
| 1508 | s_pfn_GetUserDefaultUILanguage = (GetUserDefaultUILanguage_Proc) | ||
| 1509 | get_proc_addr (hm_kernel32, "GetUserDefaultUILanguage"); | ||
| 1510 | } | ||
| 1511 | if (s_pfn_GetUserDefaultUILanguage == NULL) | ||
| 1512 | return 0; | ||
| 1513 | return s_pfn_GetUserDefaultUILanguage (); | ||
| 1514 | } | ||
| 1515 | |||
| 1492 | 1516 | ||
| 1493 | 1517 | ||
| 1494 | /* Return 1 if P is a valid pointer to an object of size SIZE. Return | 1518 | /* Return 1 if P is a valid pointer to an object of size SIZE. Return |
| @@ -2947,6 +2971,32 @@ init_environment (char ** argv) | |||
| 2947 | LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP, | 2971 | LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP, |
| 2948 | locale_name, sizeof (locale_name))) | 2972 | locale_name, sizeof (locale_name))) |
| 2949 | { | 2973 | { |
| 2974 | /* Microsoft are migrating away of locale IDs, replacing them | ||
| 2975 | with locale names, such as "en-US", and are therefore | ||
| 2976 | deprecating the APIs which use LCID etc. As part of that | ||
| 2977 | deprecation, they don't bother inventing LCID and LANGID | ||
| 2978 | codes for new locales and language/culture combinations; | ||
| 2979 | instead, those get LCID of 0xC000 and LANGID of 0x2000, for | ||
| 2980 | which the LCID/LANGID oriented APIs return "ZZZ" as the | ||
| 2981 | "language name". Such "language name" is useless for our | ||
| 2982 | purposes. So we instead use the default UI language, in the | ||
| 2983 | hope of getting something usable. */ | ||
| 2984 | if (strcmp (locale_name, "ZZZ") == 0) | ||
| 2985 | { | ||
| 2986 | LANGID lang_id = get_user_default_ui_language (); | ||
| 2987 | |||
| 2988 | if (lang_id != 0) | ||
| 2989 | { | ||
| 2990 | /* Disregard the sorting order differences between cultures. */ | ||
| 2991 | LCID def_lcid = MAKELCID (lang_id, SORT_DEFAULT); | ||
| 2992 | char locale_name_def[32]; | ||
| 2993 | |||
| 2994 | if (GetLocaleInfo (def_lcid, | ||
| 2995 | LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP, | ||
| 2996 | locale_name_def, sizeof (locale_name_def))) | ||
| 2997 | strcpy (locale_name, locale_name_def); | ||
| 2998 | } | ||
| 2999 | } | ||
| 2950 | for (i = 0; i < N_ENV_VARS; i++) | 3000 | for (i = 0; i < N_ENV_VARS; i++) |
| 2951 | { | 3001 | { |
| 2952 | if (strcmp (env_vars[i].name, "LANG") == 0) | 3002 | if (strcmp (env_vars[i].name, "LANG") == 0) |
| @@ -10580,6 +10630,7 @@ globals_of_w32 (void) | |||
| 10580 | g_b_init_expand_environment_strings_w = 0; | 10630 | g_b_init_expand_environment_strings_w = 0; |
| 10581 | g_b_init_compare_string_w = 0; | 10631 | g_b_init_compare_string_w = 0; |
| 10582 | g_b_init_debug_break_process = 0; | 10632 | g_b_init_debug_break_process = 0; |
| 10633 | g_b_init_get_user_default_ui_language = 0; | ||
| 10583 | num_of_processors = 0; | 10634 | num_of_processors = 0; |
| 10584 | /* The following sets a handler for shutdown notifications for | 10635 | /* The following sets a handler for shutdown notifications for |
| 10585 | console apps. This actually applies to Emacs in both console and | 10636 | console apps. This actually applies to Emacs in both console and |
diff --git a/src/w32fns.c b/src/w32fns.c index 86c3db64e7b..9db367bfafe 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -3893,7 +3893,7 @@ deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, UINT wParam, | |||
| 3893 | Essentially, we have no information about the "role" of | 3893 | Essentially, we have no information about the "role" of |
| 3894 | modifiers on this key: which contribute into the | 3894 | modifiers on this key: which contribute into the |
| 3895 | produced character (so "are consumed"), and which are | 3895 | produced character (so "are consumed"), and which are |
| 3896 | "extra" (must attache to bindable events). | 3896 | "extra" (must attach to bindable events). |
| 3897 | 3897 | ||
| 3898 | The default above would consume ALL modifiers, so the | 3898 | The default above would consume ALL modifiers, so the |
| 3899 | character is reported "as is". However, on many layouts | 3899 | character is reported "as is". However, on many layouts |