aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnders Lindgren2015-10-28 12:13:18 +0100
committerAnders Lindgren2015-10-28 12:13:18 +0100
commite69f7770611d85e130806763a46db7e212bc952f (patch)
tree96bdd02003f21cea72a604d8f14a06ff99cd9744 /src
parent0392e241b844487261d4dfcccc9a442793e0a868 (diff)
parentcc587a3539612d250d222363b18d15258e33f82a (diff)
downloademacs-e69f7770611d85e130806763a46db7e212bc952f.tar.gz
emacs-e69f7770611d85e130806763a46db7e212bc952f.zip
Merge branch 'master' of /Volumes/HD2/build/emacs-git-ssh
Diffstat (limited to 'src')
-rw-r--r--src/lread.c6
-rw-r--r--src/nsfns.m2
-rw-r--r--src/nsmenu.m37
-rw-r--r--src/nsterm.h10
-rw-r--r--src/nsterm.m27
-rw-r--r--src/process.c6
6 files changed, 78 insertions, 10 deletions
diff --git a/src/lread.c b/src/lread.c
index a98fa6199f1..1119f3fdfd4 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4479,8 +4479,10 @@ were read in. */);
4479 4479
4480 DEFVAR_LISP ("load-path", Vload_path, 4480 DEFVAR_LISP ("load-path", Vload_path,
4481 doc: /* List of directories to search for files to load. 4481 doc: /* List of directories to search for files to load.
4482Each element is a string (directory name) or nil (meaning `default-directory'). 4482Each element is a string (directory file name) or nil (meaning
4483Initialized during startup as described in Info node `(elisp)Library Search'. */); 4483`default-directory'). Initialized during startup as described in Info
4484node `(elisp)Library Search'. Use `directory-file-name' when adding items
4485to this path. */);
4484 4486
4485 DEFVAR_LISP ("load-suffixes", Vload_suffixes, 4487 DEFVAR_LISP ("load-suffixes", Vload_suffixes,
4486 doc: /* List of suffixes for (compiled or source) Emacs Lisp files. 4488 doc: /* List of suffixes for (compiled or source) Emacs Lisp files.
diff --git a/src/nsfns.m b/src/nsfns.m
index 1ed3e23cba5..c24344436ad 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1298,6 +1298,8 @@ This function is an internal primitive--use `make-frame' instead. */)
1298 = [NSCursor arrowCursor]; 1298 = [NSCursor arrowCursor];
1299 f->output_data.ns->current_pointer = f->output_data.ns->text_cursor; 1299 f->output_data.ns->current_pointer = f->output_data.ns->text_cursor;
1300 1300
1301 f->output_data.ns->in_animation = NO;
1302
1301 [[EmacsView alloc] initFrameFromEmacs: f]; 1303 [[EmacsView alloc] initFrameFromEmacs: f];
1302 1304
1303 x_icon (f, parms); 1305 x_icon (f, parms);
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 2ef12234960..ddc5dc20a82 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -998,10 +998,20 @@ free_frame_tool_bar (struct frame *f)
998 -------------------------------------------------------------------------- */ 998 -------------------------------------------------------------------------- */
999{ 999{
1000 EmacsView *view = FRAME_NS_VIEW (f); 1000 EmacsView *view = FRAME_NS_VIEW (f);
1001
1002 NSTRACE ("free_frame_tool_bar");
1003
1001 block_input (); 1004 block_input ();
1002 view->wait_for_tool_bar = NO; 1005 view->wait_for_tool_bar = NO;
1003 [[view toolbar] setVisible: NO]; 1006
1004 FRAME_TOOLBAR_HEIGHT (f) = 0; 1007 FRAME_TOOLBAR_HEIGHT (f) = 0;
1008
1009 /* Note: This trigger an animation, which calls windowDidResize
1010 repeatedly. */
1011 f->output_data.ns->in_animation = 1;
1012 [[view toolbar] setVisible: NO];
1013 f->output_data.ns->in_animation = 0;
1014
1005 unblock_input (); 1015 unblock_input ();
1006} 1016}
1007 1017
@@ -1017,6 +1027,8 @@ update_frame_tool_bar (struct frame *f)
1017 EmacsToolbar *toolbar = [view toolbar]; 1027 EmacsToolbar *toolbar = [view toolbar];
1018 int oldh; 1028 int oldh;
1019 1029
1030 NSTRACE ("update_frame_tool_bar");
1031
1020 if (view == nil || toolbar == nil) return; 1032 if (view == nil || toolbar == nil) return;
1021 block_input (); 1033 block_input ();
1022 1034
@@ -1096,7 +1108,11 @@ update_frame_tool_bar (struct frame *f)
1096 } 1108 }
1097 1109
1098 if (![toolbar isVisible]) 1110 if (![toolbar isVisible])
1111 {
1112 f->output_data.ns->in_animation = 1;
1099 [toolbar setVisible: YES]; 1113 [toolbar setVisible: YES];
1114 f->output_data.ns->in_animation = 0;
1115 }
1100 1116
1101#ifdef NS_IMPL_COCOA 1117#ifdef NS_IMPL_COCOA
1102 if ([toolbar changed]) 1118 if ([toolbar changed])
@@ -1150,6 +1166,8 @@ update_frame_tool_bar (struct frame *f)
1150 1166
1151- initForView: (EmacsView *)view withIdentifier: (NSString *)identifier 1167- initForView: (EmacsView *)view withIdentifier: (NSString *)identifier
1152{ 1168{
1169 NSTRACE ("[EmacsToolbar initForView: withIdentifier:]");
1170
1153 self = [super initWithIdentifier: identifier]; 1171 self = [super initWithIdentifier: identifier];
1154 emacsView = view; 1172 emacsView = view;
1155 [self setDisplayMode: NSToolbarDisplayModeIconOnly]; 1173 [self setDisplayMode: NSToolbarDisplayModeIconOnly];
@@ -1164,6 +1182,8 @@ update_frame_tool_bar (struct frame *f)
1164 1182
1165- (void)dealloc 1183- (void)dealloc
1166{ 1184{
1185 NSTRACE ("[EmacsToolbar dealloc]");
1186
1167 [prevIdentifiers release]; 1187 [prevIdentifiers release];
1168 [activeIdentifiers release]; 1188 [activeIdentifiers release];
1169 [identifierToItem release]; 1189 [identifierToItem release];
@@ -1172,6 +1192,8 @@ update_frame_tool_bar (struct frame *f)
1172 1192
1173- (void) clearActive 1193- (void) clearActive
1174{ 1194{
1195 NSTRACE ("[EmacsToolbar clearActive]");
1196
1175 [prevIdentifiers release]; 1197 [prevIdentifiers release];
1176 prevIdentifiers = [activeIdentifiers copy]; 1198 prevIdentifiers = [activeIdentifiers copy];
1177 [activeIdentifiers removeAllObjects]; 1199 [activeIdentifiers removeAllObjects];
@@ -1181,6 +1203,8 @@ update_frame_tool_bar (struct frame *f)
1181 1203
1182- (void) clearAll 1204- (void) clearAll
1183{ 1205{
1206 NSTRACE ("[EmacsToolbar clearAll]");
1207
1184 [self clearActive]; 1208 [self clearActive];
1185 while ([[self items] count] > 0) 1209 while ([[self items] count] > 0)
1186 [self removeItemAtIndex: 0]; 1210 [self removeItemAtIndex: 0];
@@ -1188,6 +1212,8 @@ update_frame_tool_bar (struct frame *f)
1188 1212
1189- (BOOL) changed 1213- (BOOL) changed
1190{ 1214{
1215 NSTRACE ("[EmacsToolbar changed]");
1216
1191 return [activeIdentifiers isEqualToArray: prevIdentifiers] && 1217 return [activeIdentifiers isEqualToArray: prevIdentifiers] &&
1192 enablement == prevEnablement ? NO : YES; 1218 enablement == prevEnablement ? NO : YES;
1193} 1219}
@@ -1198,6 +1224,8 @@ update_frame_tool_bar (struct frame *f)
1198 helpText: (const char *)help 1224 helpText: (const char *)help
1199 enabled: (BOOL)enabled 1225 enabled: (BOOL)enabled
1200{ 1226{
1227 NSTRACE ("[EmacsToolbar addDisplayItemWithImage: ...]");
1228
1201 /* 1) come up w/identifier */ 1229 /* 1) come up w/identifier */
1202 NSString *identifier 1230 NSString *identifier
1203 = [NSString stringWithFormat: @"%lu", (unsigned long)[img hash]]; 1231 = [NSString stringWithFormat: @"%lu", (unsigned long)[img hash]];
@@ -1231,6 +1259,7 @@ update_frame_tool_bar (struct frame *f)
1231 all items to enabled state (for some reason). */ 1259 all items to enabled state (for some reason). */
1232- (void)validateVisibleItems 1260- (void)validateVisibleItems
1233{ 1261{
1262 NSTRACE ("[EmacsToolbar validateVisibleItems]");
1234} 1263}
1235 1264
1236 1265
@@ -1240,12 +1269,16 @@ update_frame_tool_bar (struct frame *f)
1240 itemForItemIdentifier: (NSString *)itemIdentifier 1269 itemForItemIdentifier: (NSString *)itemIdentifier
1241 willBeInsertedIntoToolbar: (BOOL)flag 1270 willBeInsertedIntoToolbar: (BOOL)flag
1242{ 1271{
1272 NSTRACE ("[EmacsToolbar toolbar: ...]");
1273
1243 /* look up NSToolbarItem by identifier and return... */ 1274 /* look up NSToolbarItem by identifier and return... */
1244 return [identifierToItem objectForKey: itemIdentifier]; 1275 return [identifierToItem objectForKey: itemIdentifier];
1245} 1276}
1246 1277
1247- (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar 1278- (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar
1248{ 1279{
1280 NSTRACE ("[EmacsToolbar toolbarDefaultItemIdentifiers:]");
1281
1249 /* return entire set.. */ 1282 /* return entire set.. */
1250 return activeIdentifiers; 1283 return activeIdentifiers;
1251} 1284}
@@ -1253,6 +1286,8 @@ update_frame_tool_bar (struct frame *f)
1253/* for configuration palette (not yet supported) */ 1286/* for configuration palette (not yet supported) */
1254- (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar 1287- (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar
1255{ 1288{
1289 NSTRACE ("[EmacsToolbar toolbarAllowedItemIdentifiers:]");
1290
1256 /* return entire set... */ 1291 /* return entire set... */
1257 return activeIdentifiers; 1292 return activeIdentifiers;
1258 //return [identifierToItem allKeys]; 1293 //return [identifierToItem allKeys];
diff --git a/src/nsterm.h b/src/nsterm.h
index 8d52dc642ed..3fb8cfc9cd8 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -65,9 +65,12 @@ typedef float EmacsCGFloat;
65 65
66 ========================================================================== */ 66 ========================================================================== */
67 67
68/* Uncomment the following line to enable trace. */ 68/* Uncomment the following line to enable trace.
69 69
70/* #define NSTRACE_ENABLED 1 */ 70 Hint: keep the trailing whitespace -- the version control system
71 will reject accidental commits. */
72
73/* #define NSTRACE_ENABLED 1 */
71 74
72 75
73/* Print a call tree containing all annotated functions. 76/* Print a call tree containing all annotated functions.
@@ -913,6 +916,9 @@ struct ns_output
913 916
914 /* Non-zero if we are zooming (maximizing) the frame. */ 917 /* Non-zero if we are zooming (maximizing) the frame. */
915 int zooming; 918 int zooming;
919
920 /* Non-zero if we are doing an animation, e.g. toggling the tool bar. */
921 int in_animation;
916}; 922};
917 923
918/* this dummy decl needed to support TTYs */ 924/* this dummy decl needed to support TTYs */
diff --git a/src/nsterm.m b/src/nsterm.m
index be860610b47..925e9af30a7 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1501,7 +1501,7 @@ x_set_window_size (struct frame *f,
1501 if (view == nil) 1501 if (view == nil)
1502 return; 1502 return;
1503 1503
1504 NSTRACE_RECT ("input", wr); 1504 NSTRACE_RECT ("current", wr);
1505 1505
1506/*fprintf (stderr, "\tsetWindowSize: %d x %d, pixelwise %d, font size %d x %d\n", width, height, pixelwise, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f));*/ 1506/*fprintf (stderr, "\tsetWindowSize: %d x %d, pixelwise %d, font size %d x %d\n", width, height, pixelwise, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f));*/
1507 1507
@@ -1563,7 +1563,6 @@ x_set_window_size (struct frame *f,
1563 make_number (FRAME_NS_TITLEBAR_HEIGHT (f)), 1563 make_number (FRAME_NS_TITLEBAR_HEIGHT (f)),
1564 make_number (FRAME_TOOLBAR_HEIGHT (f)))); 1564 make_number (FRAME_TOOLBAR_HEIGHT (f))));
1565 1565
1566 [view setRows: rows andColumns: cols];
1567 NSTRACE_RECT ("setFrame", wr); 1566 NSTRACE_RECT ("setFrame", wr);
1568 [window setFrame: wr display: YES]; 1567 [window setFrame: wr display: YES];
1569 1568
@@ -6171,6 +6170,8 @@ not_in_argv (NSString *arg)
6171 NSTRACE ("updateFrameSize"); 6170 NSTRACE ("updateFrameSize");
6172 NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh)); 6171 NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh));
6173 NSTRACE_RECT ("Original frame", wr); 6172 NSTRACE_RECT ("Original frame", wr);
6173 NSTRACE_MSG ("Original columns: %d", cols);
6174 NSTRACE_MSG ("Original rows: %d", rows);
6174 6175
6175 if (! [self isFullscreen]) 6176 if (! [self isFullscreen])
6176 { 6177 {
@@ -6187,13 +6188,19 @@ not_in_argv (NSString *arg)
6187 if (wait_for_tool_bar) 6188 if (wait_for_tool_bar)
6188 { 6189 {
6189 if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0) 6190 if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0)
6190 return; 6191 {
6192 NSTRACE_MSG ("Waiting for toolbar");
6193 return;
6194 }
6191 wait_for_tool_bar = NO; 6195 wait_for_tool_bar = NO;
6192 } 6196 }
6193 6197
6194 neww = (int)wr.size.width - emacsframe->border_width; 6198 neww = (int)wr.size.width - emacsframe->border_width;
6195 newh = (int)wr.size.height - extra; 6199 newh = (int)wr.size.height - extra;
6196 6200
6201 NSTRACE_SIZE ("New size", NSMakeSize (neww, newh));
6202 NSTRACE_MSG ("tool_bar_height: %d", emacsframe->tool_bar_height);
6203
6197 cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, neww); 6204 cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, neww);
6198 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, newh); 6205 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, newh);
6199 6206
@@ -6203,6 +6210,9 @@ not_in_argv (NSString *arg)
6203 if (rows < MINHEIGHT) 6210 if (rows < MINHEIGHT)
6204 rows = MINHEIGHT; 6211 rows = MINHEIGHT;
6205 6212
6213 NSTRACE_MSG ("New columns: %d", cols);
6214 NSTRACE_MSG ("New rows: %d", rows);
6215
6206 if (oldr != rows || oldc != cols || neww != oldw || newh != oldh) 6216 if (oldr != rows || oldc != cols || neww != oldw || newh != oldh)
6207 { 6217 {
6208 NSView *view = FRAME_NS_VIEW (emacsframe); 6218 NSView *view = FRAME_NS_VIEW (emacsframe);
@@ -6220,6 +6230,10 @@ not_in_argv (NSString *arg)
6220 [view setFrame: wr]; 6230 [view setFrame: wr];
6221 [self windowDidMove:nil]; // Update top/left. 6231 [self windowDidMove:nil]; // Update top/left.
6222 } 6232 }
6233 else
6234 {
6235 NSTRACE_MSG ("No change");
6236 }
6223} 6237}
6224 6238
6225- (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize 6239- (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize
@@ -6328,6 +6342,12 @@ not_in_argv (NSString *arg)
6328{ 6342{
6329 NSTRACE ("windowDidResize"); 6343 NSTRACE ("windowDidResize");
6330 6344
6345 if (emacsframe->output_data.ns->in_animation)
6346 {
6347 NSTRACE_MSG ("Ignored (in animation)");
6348 return;
6349 }
6350
6331 if (! [self fsIsNative]) 6351 if (! [self fsIsNative])
6332 { 6352 {
6333 NSWindow *theWindow = [notification object]; 6353 NSWindow *theWindow = [notification object];
@@ -7425,6 +7445,7 @@ not_in_argv (NSString *arg)
7425 7445
7426- (void) setRows: (int) r andColumns: (int) c 7446- (void) setRows: (int) r andColumns: (int) c
7427{ 7447{
7448 NSTRACE ("[EmacsView setRows:%d andColumns:%d]", r, c);
7428 rows = r; 7449 rows = r;
7429 cols = c; 7450 cols = c;
7430} 7451}
diff --git a/src/process.c b/src/process.c
index dc93b86cee2..ed1d59d01b0 100644
--- a/src/process.c
+++ b/src/process.c
@@ -7176,8 +7176,10 @@ setup_process_coding_systems (Lisp_Object process)
7176} 7176}
7177 7177
7178DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0, 7178DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0,
7179 doc: /* Return the (or a) process associated with BUFFER. 7179 doc: /* Return the (or a) live process associated with BUFFER.
7180BUFFER may be a buffer or the name of one. */) 7180BUFFER may be a buffer or the name of one.
7181Return nil if all processes associated with BUFFER have been
7182deleted or killed. */)
7181 (register Lisp_Object buffer) 7183 (register Lisp_Object buffer)
7182{ 7184{
7183#ifdef subprocesses 7185#ifdef subprocesses