diff options
| author | David Reitter | 2015-11-30 20:52:27 -0500 |
|---|---|---|
| committer | David Reitter | 2015-11-30 21:01:06 -0500 |
| commit | 49689a415c4a83625ba2df127917139e0d98e381 (patch) | |
| tree | a67c86c5112cbedc5eb9ca2d27704dfc4901942d /src | |
| parent | 5eafc0a7a910db0accac162a59f4709fc2ecec4c (diff) | |
| download | emacs-49689a415c4a83625ba2df127917139e0d98e381.tar.gz emacs-49689a415c4a83625ba2df127917139e0d98e381.zip | |
Read frame_title_format from buffer-local variable for NS port
* nsfns.m (x_implicitly_set_name): Read frame-title-format and
icon-title-format variables from buffer in appropriate window.
(Bug#22048)
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsfns.m | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index 434fd6aa944..edc02e8350b 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -405,10 +405,12 @@ ns_set_name_internal (struct frame *f, Lisp_Object name) | |||
| 405 | NSString *str; | 405 | NSString *str; |
| 406 | NSView *view = FRAME_NS_VIEW (f); | 406 | NSView *view = FRAME_NS_VIEW (f); |
| 407 | 407 | ||
| 408 | |||
| 408 | encoded_name = ENCODE_UTF_8 (name); | 409 | encoded_name = ENCODE_UTF_8 (name); |
| 409 | 410 | ||
| 410 | str = [NSString stringWithUTF8String: SSDATA (encoded_name)]; | 411 | str = [NSString stringWithUTF8String: SSDATA (encoded_name)]; |
| 411 | 412 | ||
| 413 | |||
| 412 | /* Don't change the name if it's already NAME. */ | 414 | /* Don't change the name if it's already NAME. */ |
| 413 | if (! [[[view window] title] isEqualToString: str]) | 415 | if (! [[[view window] title] isEqualToString: str]) |
| 414 | [[view window] setTitle: str]; | 416 | [[view window] setTitle: str]; |
| @@ -483,9 +485,14 @@ x_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 483 | { | 485 | { |
| 484 | NSTRACE ("x_implicitly_set_name"); | 486 | NSTRACE ("x_implicitly_set_name"); |
| 485 | 487 | ||
| 488 | Lisp_Object frame_title = buffer_local_value | ||
| 489 | (Qframe_title_format, XWINDOW (f->selected_window)->contents); | ||
| 490 | Lisp_Object icon_title = buffer_local_value | ||
| 491 | (Qicon_title_format, XWINDOW (f->selected_window)->contents); | ||
| 492 | |||
| 486 | /* Deal with NS specific format t. */ | 493 | /* Deal with NS specific format t. */ |
| 487 | if (FRAME_NS_P (f) && ((FRAME_ICONIFIED_P (f) && EQ (Vicon_title_format, Qt)) | 494 | if (FRAME_NS_P (f) && ((FRAME_ICONIFIED_P (f) && EQ (icon_title, Qt)) |
| 488 | || EQ (Vframe_title_format, Qt))) | 495 | || EQ (frame_title, Qt))) |
| 489 | ns_set_name_as_filename (f); | 496 | ns_set_name_as_filename (f); |
| 490 | else | 497 | else |
| 491 | ns_set_name (f, arg, 0); | 498 | ns_set_name (f, arg, 0); |
| @@ -3134,6 +3141,8 @@ void | |||
| 3134 | syms_of_nsfns (void) | 3141 | syms_of_nsfns (void) |
| 3135 | { | 3142 | { |
| 3136 | DEFSYM (Qfontsize, "fontsize"); | 3143 | DEFSYM (Qfontsize, "fontsize"); |
| 3144 | DEFSYM (Qframe_title_format, "frame-title-format"); | ||
| 3145 | DEFSYM (Qicon_title_format, "icon-title-format"); | ||
| 3137 | 3146 | ||
| 3138 | DEFVAR_LISP ("ns-icon-type-alist", Vns_icon_type_alist, | 3147 | DEFVAR_LISP ("ns-icon-type-alist", Vns_icon_type_alist, |
| 3139 | doc: /* Alist of elements (REGEXP . IMAGE) for images of icons associated to frames. | 3148 | doc: /* Alist of elements (REGEXP . IMAGE) for images of icons associated to frames. |