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