comparison scripts/miscellaneous/edit.m @ 19628:fe689210525c gui-release

maint: Periodic merge of stable to gui-release.
author John W. Eaton <jwe@octave.org>
date Tue, 20 Jan 2015 10:05:42 -0500
parents 832ecfda1d3c 446c46af4b42
children 0e1f5a750d00
comparison
equal deleted inserted replaced
19624:6d75f1683ce8 19628:fe689210525c
139 139
140 if (nargin == 1) 140 if (nargin == 1)
141 ## User has supplied one arg, this can be a single file name 141 ## User has supplied one arg, this can be a single file name
142 ## or a cell array of strings containing multiple files to be opened 142 ## or a cell array of strings containing multiple files to be opened
143 if (iscellstr (varargin{1})) 143 if (iscellstr (varargin{1}))
144 ## If first arg is a cell array of strings, 144 ## If first arg is a cell array of strings,
145 ## it becomes the list of files to be edited 145 ## it becomes the list of files to be edited
146 editfilelist = varargin{1}; 146 editfilelist = varargin{1};
147 elseif (ischar (varargin{1})) 147 elseif (ischar (varargin{1}))
148 ## If first arg is a string, create a cell array of strings 148 ## If first arg is a string, create a cell array of strings
149 ## of length 1 (by copying the input cell array) 149 ## of length 1 (by copying the input cell array)
238 for i = 1:numel (editfilelist) 238 for i = 1:numel (editfilelist)
239 edit (editfilelist{i}); 239 edit (editfilelist{i});
240 endfor 240 endfor
241 241
242 else 242 else
243 243
244 ## Only one file name was supplied, get it from the cell array 244 ## Only one file name was supplied, get it from the cell array
245 file = tilde_expand (editfilelist{1}); 245 file = tilde_expand (editfilelist{1});
246 246
247 ## Check whether the user is trying to edit a builtin or compiled function. 247 ## Check whether the user is trying to edit a builtin or compiled function.
248 switch (exist (file)) 248 switch (exist (file))
500 endif 500 endif
501 fputs (fid, text); 501 fputs (fid, text);
502 fclose (fid); 502 fclose (fid);
503 503
504 do_edit (FUNCTION.EDITOR, fileandpath, FUNCTION.MODE); 504 do_edit (FUNCTION.EDITOR, fileandpath, FUNCTION.MODE);
505 505
506 endif 506 endif
507 507
508 endfunction 508 endfunction
509 509
510 function retval = default_home () 510 function retval = default_home ()