1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2009 - DIGITEO - Sylvestre KOUMAR
*
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at
* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
*
-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="scinotes" xml:lang="en">
<refnamediv>
<refname>scinotes</refname>
<refpurpose>Scinotes: Embedded Scilab text editor</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Calling Sequence</title>
<synopsis>
scinotes()
scinotes(file)
scinotes([file1, file2])
scinotes(file, line_number)
scinotes(file, line_number, macro_name)
scinotes([file1, file2], [line_number1, line_number2])
scinotes(file, 'readonly')
scinotes(file, ['indent','trailing','quote'])
scinotes([file1, file2], 'readonly')
scinotes([file1, file2], ['indent','trailing','quote'])
</synopsis>
</refsynopsisdiv>
<refsection>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term>file</term>
<listitem>
<para>a string, the file to be opened.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>[file1, file2]</term>
<listitem>
<para>a matrix of string, files to be opened.</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term>line_number</term>
<listitem>
<para>An integer, the number of the line to be highlighted at the
opening of the file.
</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term>macro_name</term>
<listitem>
<para>a string, the line number would be relative to the definition of the function macro_name</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term>[line_number1, line_number2]</term>
<listitem>
<para>a matrix of integer, each opened file will have its corresponding
line highlighted.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection>
<title>Description</title>
<para>
<literal>Scinotes</literal> is an embedded Scilab text editor.
</para>
<para>It can be started with a fresh text buffer pressing the "Editor"
button on top of the main Scilab window, or from Scilab command line with
the instruction <literal>editor()</literal>, or it can open specific files
if invoked with any of the calling sequences above (whithout any
parameters, it opens editor with a blank file).
</para>
<para>The same invocation adds further files to an already opened
Editor.
</para>
<para>With the option 'readonly', files are opened in read-only mode so
they cannot be modified.
</para>
<para>With the options 'indent', 'quote' or 'trailing', the editor will not be opened and the file(s) will be treated consequently to the actions. The actions are the following:
<itemizedlist>
<listitem>
<para>
The action 'indent' will indent correctly the file.
</para>
</listitem>
<listitem>
<para>
The action 'trailing' will remove the trailing white spaces.
</para>
</listitem>
<listitem>
<para>
The action 'quote' will replace all simple quoted strings by double quoted ones.
</para>
</listitem>
</itemizedlist>
</para>
<para>
One or several actions can be used at the same time, e.g. 'trailing' or ['indent','quote'].
</para>
<para>Keyboard shortcuts are defined for most possible editing actions and
reported by the menu entries.
</para>
<para/>
<para>Scinotes can be started in the following ways :</para>
<itemizedlist>
<listitem>
<para>By the menu Applications. Choose Applications =>
Editor
</para>
</listitem>
<listitem>
<para>From the command line:</para>
<itemizedlist>
<listitem>
<para>scinotes()</para>
</listitem>
<listitem>
<para>scinotes(file)</para>
</listitem>
<listitem>
<para>scinotes([file1, file2])</para>
</listitem>
<listitem>
<para>scinotes(file, line_number)</para>
</listitem>
<listitem>
<para>scinotes([file1, file2], [line_number1, line_number2])</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</refsection>
<refsection>
<title>Menus and Shortcuts</title>
<itemizedlist>
<listitem>
<para>Menu File</para>
<informaltable border="1">
<tr>
<td>
<para>Command</para>
</td>
<td>
<para>Shortcut</para>
</td>
<td>
<para>Description</para>
</td>
</tr>
<tr>
<td>New...</td>
<td><CTRL-N></td>
<td>
<para>Open a new file</para>
</td>
</tr>
<tr>
<td>Open...</td>
<td><CTRL-O></td>
<td>
<para>Open an existing file</para>
</td>
</tr>
<tr>
<td>Recent Files</td>
<td/>
<td>
<para>Display files recently opened</para>
</td>
</tr>
<tr>
<td>Save</td>
<td><CTRL-S></td>
<td>
<para>Save a file</para>
</td>
</tr>
<tr>
<td>Save as...</td>
<td><CTRL-MAJ-S></td>
<td>
<para>Save a file as</para>
</td>
</tr>
<tr>
<td>Page Setup</td>
<td/>
<td>
<para>Setup page for printing</para>
</td>
</tr>
<tr>
<td>Print Preview</td>
<td><CTRL-MAJ-P></td>
<td>
<para>Open a print preview window</para>
</td>
</tr>
<tr>
<td>Print...</td>
<td><CTRL-P></td>
<td>
<para>Print a file</para>
</td>
</tr>
<tr>
<td>Close</td>
<td><CTRL-W></td>
<td>
<para>Close a file</para>
</td>
</tr>
<tr>
<td>Quit</td>
<td><CTRL-Q></td>
<td>
<para>Close Editor</para>
</td>
</tr>
</informaltable>
</listitem>
<listitem>
<para>Menu Edit</para>
<informaltable border="1">
<tr>
<td>
<para>Command</para>
</td>
<td>
<para>Shortcut</para>
</td>
<td>
<para>Description</para>
</td>
</tr>
<tr>
<td>Undo</td>
<td><CTRL-Z></td>
<td>
<para>Undo action</para>
</td>
</tr>
<tr>
<td>Redo</td>
<td><CTRL-Y></td>
<td>
<para>Redo action</para>
</td>
</tr>
<tr>
<td>Cut</td>
<td><CTRL-X></td>
<td>
<para>Cut the selection</para>
</td>
</tr>
<tr>
<td>Copy</td>
<td><CTRL-C></td>
<td>
<para>Copy the selection</para>
</td>
</tr>
<tr>
<td>Paste</td>
<td><CTRL-V></td>
<td>
<para>Paste the selection</para>
</td>
</tr>
<tr>
<td>Select All</td>
<td><CTRL-A></td>
<td>
<para>Select the entire document</para>
</td>
</tr>
<tr>
<td>Delete</td>
<td/>
<td>
<para>Delete the selection</para>
</td>
</tr>
<tr>
<td>Comment Selection</td>
<td><CTRL-D></td>
<td>
<para>Comment selected lines</para>
</td>
</tr>
<tr>
<td>Uncomment Selection</td>
<td><CTRL-MAJ-D></td>
<td>
<para>Uncomment selected lines</para>
</td>
</tr>
<tr>
<td>Tabify Selection</td>
<td><TAB></td>
<td>
<para>Tabify selected lines</para>
</td>
</tr>
<tr>
<td>Untabify Selection</td>
<td><MAJ-TAB></td>
<td>
<para>Untabify selected lines</para>
</td>
</tr>
<tr>
<td>Indent</td>
<td><CTRL-I></td>
<td>
<para>Indent selected lines</para>
</td>
</tr>
</informaltable>
</listitem>
<listitem>
<para>Menu Search</para>
<informaltable border="1">
<tr>
<td>
<para>Command</para>
</td>
<td>
<para>Shortcut</para>
</td>
<td>
<para>Description</para>
</td>
</tr>
<tr>
<td>Find/Replace</td>
<td><CTRL-F></td>
<td>
<para>Find and/or Replace an element</para>
</td>
</tr>
<tr>
<td>Goto line</td>
<td><CTRL-G></td>
<td>
<para>Goto line</para>
</td>
</tr>
</informaltable>
</listitem>
<listitem>
<para>Menu View</para>
<informaltable border="1">
<tr>
<td>
<para>Command</para>
</td>
<td>
<para>Shortcut</para>
</td>
<td>
<para>Description</para>
</td>
</tr>
<tr>
<td>Show/Hide Toolbar</td>
<td/>
<td>
<para>Option to show or hide the toolbar</para>
</td>
</tr>
<tr>
<td>Highlight current line</td>
<td><CTRL-J></td>
<td>
<para>Highlight the current line</para>
</td>
</tr>
<tr>
<td>Line Numbers</td>
<td><CTRL-B></td>
<td>
<para>Display document's line numbers</para>
</td>
</tr>
<tr>
<td>Set Colors...</td>
<td/>
<td>
<para>Color settings for documents</para>
</td>
</tr>
<tr>
<td>Set Fonts...</td>
<td/>
<td>
<para>Font settings for documents</para>
</td>
</tr>
<tr>
<td>Reset default font</td>
<td/>
<td>
<para>Reset default font settings for documents</para>
</td>
</tr>
</informaltable>
</listitem>
<listitem>
<para>Menu Document</para>
<informaltable border="1">
<tr>
<td>
<para>Command</para>
</td>
<td>
<para>Shortcut</para>
</td>
<td>
<para>Description</para>
</td>
</tr>
<tr>
<td>Syntax Type</td>
<td/>
<td>
<para>Syntax type settings (default type is Scilab)</para>
</td>
</tr>
<tr>
<td>Encoding</td>
<td/>
<td>
<para>Encoding settings (default type is UTF-8
Encoding)
</para>
</td>
</tr>
<tr>
<td>Colorize</td>
<td/>
<td>
<para>Colorize the document</para>
</td>
</tr>
<tr>
<td>Auto Indent</td>
<td/>
<td>
<para>Activate the automatic indentation</para>
</td>
</tr>
</informaltable>
</listitem>
<listitem>
<para>Menu Execute</para>
<informaltable border="1">
<tr>
<td>
<para>Command</para>
</td>
<td>
<para>Shortcut</para>
</td>
<td>
<para>Description</para>
</td>
</tr>
<tr>
<td>Load Into Scilab</td>
<td><CTRL-L></td>
<td>
<para>Load the entire document into the Scilab console</para>
</td>
</tr>
<tr>
<td>Evaluate Selection</td>
<td/>
<td>
<para>Load the selection into the Scilab console</para>
</td>
</tr>
<tr>
<td>Execute Into Scilab</td>
<td><CTRL-E></td>
<td>
<para>If the file exist, execute the content of the file</para>
</td>
</tr>
</informaltable>
</listitem>
</itemizedlist>
</refsection>
<refsection>
<title>Remarks</title>
<variablelist>
<varlistentry>
<term>Document :</term>
<listitem>
<para>The default text colorization is the Scilab's syntax
colorization.
</para>
<para>
The <literal>auto-indent</literal> mode indent a line
according to Scilab's syntax (after a return action).
</para>
<para/>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection>
<title>Examples</title>
<programlisting role="example"><![CDATA[
// editor without parameters
scinotes();
// editor with a file name
scinotes('SCI/modules/time/macros/datenum.sci');
// editor with a matrix of files name
scinotes(['SCI/modules/time/macros/datenum.sci','SCI/modules/time/macros/datevec.sci']);
// editor with a file name and the line number to highlight
scinotes('SCI/modules/time/macros/datenum.sci', 5);
// editor with a file name and the line number to highlight
scinotes('SCI/modules/time/macros/datenum.sci', 8, 'datenum');
// editor with a matrix of files name and the corresponding matrix of lines to highlight
// the files name matrix and the lines to highlight matrix should have the same size
scinotes(['SCI/modules/time/macros/datenum.sci','SCI/modules/time/macros/datevec.sci'], [5,10]);
]]></programlisting>
Indent some Scilab code
<programlisting role="example"><![CDATA[
f=TMPDIR + "/file_to_correct.sci";
mputl(["a=''abcdef'' ";
"if a==1";
" b=1+""abcdef'' ";
" c=2";
" d=3 ";
" if ";
"a=''abcdef""""""";
" end";
" end "], f);
scinotes(f, ["indent" "trailing" "quote"]);
// Show the results
mgetl(f)
]]></programlisting>
</refsection>
<refsection>
<title>History</title>
<revhistory>
<revision>
<revnumber>5.4.1</revnumber>
<revremark>['indent','trailing','quote'] options added.</revremark>
</revision>
</revhistory>
</refsection>
</refentry>
|