diff options
author | David Reitter <david.reitter@gmail.com> | 2015-11-30 20:52:27 -0500 |
---|---|---|
committer | David Reitter <david.reitter@gmail.com> | 2015-11-30 21:01:06 -0500 |
commit | 49689a415c4a83625ba2df127917139e0d98e381 (patch) | |
tree | a67c86c5112cbedc5eb9ca2d27704dfc4901942d /src | |
parent | 5eafc0a7a910db0accac162a59f4709fc2ecec4c (diff) | |
download | emacs-49689a415c4a83625ba2df127917139e0d98e381.tar.gz |
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) NSString *str; NSView *view = FRAME_NS_VIEW (f); + encoded_name = ENCODE_UTF_8 (name); str = [NSString stringWithUTF8String: SSDATA (encoded_name)]; + /* Don't change the name if it's already NAME. */ if (! [[[view window] title] isEqualToString: str]) [[view window] setTitle: str]; @@ -483,9 +485,14 @@ x_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { NSTRACE ("x_implicitly_set_name"); + Lisp_Object frame_title = buffer_local_value + (Qframe_title_format, XWINDOW (f->selected_window)->contents); + Lisp_Object icon_title = buffer_local_value + (Qicon_title_format, XWINDOW (f->selected_window)->contents); + /* Deal with NS specific format t. */ - if (FRAME_NS_P (f) && ((FRAME_ICONIFIED_P (f) && EQ (Vicon_title_format, Qt)) - || EQ (Vframe_title_format, Qt))) + if (FRAME_NS_P (f) && ((FRAME_ICONIFIED_P (f) && EQ (icon_title, Qt)) + || EQ (frame_title, Qt))) ns_set_name_as_filename (f); else ns_set_name (f, arg, 0); @@ -3134,6 +3141,8 @@ void syms_of_nsfns (void) { DEFSYM (Qfontsize, "fontsize"); + DEFSYM (Qframe_title_format, "frame-title-format"); + DEFSYM (Qicon_title_format, "icon-title-format"); DEFVAR_LISP ("ns-icon-type-alist", Vns_icon_type_alist, doc: /* Alist of elements (REGEXP . IMAGE) for images of icons associated to frames. |