Difference between revisions of "File page"

From TED Notepad
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>{{manversion|5.3.0.4}}__NOTOC__</noinclude>
+
<noinclude>{{manversion|6.0.0.17|dialog|Settings:File}}__NOTOC__</noinclude>
  
====Default encoding====
+
===={{field|Settings:File|Default encoding}}====
  
The {{field|Default encoding}} specifies a default file encoding that should be used for new documents. Supported encodings are {{system|ANSI}}, both {{system|Unicodes}} and {{system|UTF-8}}.
+
The '''{{field|Settings:File|Default encoding}}''' setting specifies default
 +
{{feature|Encoding}} to be used for new documents, or in cases where detection of encoding of a file being loaded is indecisive (e.g. if loading pure ASCII file, encoding can be both ANSI and UTF-8).
  
Note: See chapter [[Managing documents]] for more informations about these file encodings, their usage, advantages and also their pitfalls.
+
Supported default encodings are:
 +
* '''{{field|Settings:File|Default encoding: ANSI}}''', which depends on the System default code page.
 +
* '''{{field|Settings:File|Default encoding: UTF-8}}''', which can include or exclude {{defined|BOM}}.
 +
* '''{{field|Settings:File|Default encoding: Unicode}}''', which should always include {{defined|BOM}}.
 +
* '''{{field|Settings:File|Default encoding: Big Endian}}''', which should always include {{defined|BOM}}.
  
====Default newlines====
+
The '''{{field|Settings:File|Default encoding: Add BOM (UTF-8 / Unicode)}}''' setting extends some encodings with {{defined|BOM}} and non-{{defined|BOM}} variants. Note: While some encodings do not allow {{defined|BOM}} at all (e.g. ANSI), other encodings recommend using {{defined|BOM}} (e.g. both Unicodes), and some encodings make {{defined|BOM}} optional (e.g. UTF-8).
  
The {{field|UNIX/Mac support}} specifies, whether the transparent UNIX/Mac {{defined|newlines}} conversion support is to be available. See chapter [[Managing documents]] for more details about transparent {{defined|newlines}} conversions.
+
'''Important note:''' If {{defined|BOM}} is recommended for some encoding, omitting it is allowed, but might result in inability to auto-detect correct file encoding upon future file loading. This is especially true with Unicode files. See {{feature|Open File}} for further details about encoding auto-detection and available workarounds.
  
The {{field|Windows}}, {{field|Unix}} and {{field|Mac}} fields can be used to specify the default {{defined|newlines}} to be used for new files.
+
===={{field|Settings:File|Default newlines}}====
  
====Default file type====
+
The '''{{field|Settings:File|Default newlines}}''' setting specifies default type of {{feature|Newlines}} to be used for new documents, or in cases where detection of newlines of a file being loaded is indecisive (e.g. if loading file with no newlines).
  
The {{field|Default file type}} setting specifies, what file extension is to be used by the {{feature|Save As}} dialog, if no extension is specified explicitly. The default extension may not exceed 4 characters.
+
Supported types of default newlines are:
 +
* '''{{field|Settings:File|Default newlines: Windows}}''', i.e. {{string|CR/NL}}, i.e. {{string|13 10}} in ASCII, i.e. {{string|0D 0A}} in hex.
 +
* '''{{field|Settings:File|Default newlines: Unix}}''', i.e. {{string|NL}} only, i.e. {{string|10}} in ASCII, i.e. {{string|0A}} in hex.
 +
* '''{{field|Settings:File|Default newlines: Mac}}''', i.e. {{string|CR}} only, i.e. {{string|13}} in ASCII, i.e. {{string|0D}} in hex.
  
The default extension for plain-text documents is usually {{string|txt}}, but users may choose to override this and use another value. E.g. Use {{string|html}}, if you create more HTML documents than simple text files.
+
See {{feature|Newlines}} for further details on when and how
 +
{{feature|Newlines}} are used within TED Notepad.
  
====Default path====
+
===={{field|Settings:File|Dialogs}}====
  
The {{field|Default path}} defines a relative or absolute path, that is to be used as the starting point in the {{dialog|Open/Save}} dialogs. When an absolute path is specified, it is used unchanged in all cases.
+
The '''{{field|Settings:File|Default file type}}''' setting specifies, what file extension is to be used by default in the {{feature|Save As}} dialog, if no file extension is specified explicitly. This default file extension may not exceed 4 characters.
  
When no path is specified as default path, the current working directory is used, if it contains files, which satisfy the {{field|Filter strings}} below. Otherwise, the personal files directory of the current user is used.
+
{{tip}} The default file extension for plain-text documents is {{string|txt}}, but users may choose to override this with another value. For example, use {{string|html}}, if creating HTML documents more often than plain-text files.
  
When a relative path is specified (e.g. {{string|.}} or {{string|\docs}}), it always refers to the current working directory. Note: The working directory is usually a directory, where TED Notepad is started from. Then this working directory changes with every {{dialog|Open/Save}} dialogs operation.
+
The '''{{field|Settings:File|Default path}}''' setting defines relative or absolute path, which is to be used as a starting point in the {{dialog|Open}} and {{dialog|Save As}} dialogs.
 +
* If no path is specified as {{field|Settings:File|Default path}}, the current working directory is used if it contains files which satisfy the {{field|Settings:File|Filter strings}} patterns described below. Otherwise, personal files directory of the current user is used as starting point.
 +
* If absolute path is specified, it is used unmodified in all cases.
 +
* If relative path is specified (e.g. {{string|.}} or {{string|\docs}}), it refers to current working directory. Note: The current working directory is usually the directory which TED Notepad was started from; although shortcuts allow to specify another starting directory for example. Also note that the current working directory no longer changes with every {{dialog|Open}} and {{dialog|Save As}} dialog operations as it did in previous versions of TED Notepad. The current working directory stays the same throughout the entire instance session.
  
{{tip}} A useful example for portable usage is a simple back-slash ({{string|\}}), which will make the {{dialog|Open/Save}} dialogs start in the root directory of the drive, where you launched the application. This can be used to twist your USB drive, when moving TED Notepad on the USB stick drive from one computer to another.
+
{{tip}} A useful example for portable usage is simple back-slash ({{string|\}}) as {{field|Settings:File|Default path}}, which makes the {{dialog|Open}} and {{dialog|Save As}} dialogs start in the root directory of the drive, from which you originally launched the application. This can be used to twist the USB drive around, while moving TED Notepad on the USB drive from one computer to another.
  
====Filter strings====
+
Note: One of the requirements for this to work, is to use correct working directory upon launching TED Notepad from the USB drive. In most typical cases, the system uses the USB drive as the working directory (as expected). However, some file managers and portable launchers may need to be told what working directory to use explicitly. Set them to use the USB drive.
  
The {{field|Filter strings}} defines filters, that are to be used in the {{dialog|Open/Save}} dialogs as file filters. They appear in a combo-box, usually bellow the file name box. Such a filter consists of two {{defined|strings}} separated by a Pipe character.
+
The '''{{field|Settings:File|Filter strings}}''' setting define filters, which are to be used in the {{dialog|Open}} and {{dialog|Save As}} dialogs as file filters. These filters appear in a combo-box, usually bellow the file name box. A filter consists of two {{defined|strings}} separated by Pipe character ({{string|<nowiki>|</nowiki>}}).
  
The first {{defined|string}} in a filter is a name to be displayed that describes the filter (e.g. {{string|Text Files}}). The second one specifies the filtering pattern (e.g. {{string|*.txt}}). Therefore a filter for text files would look like this: {{string|Text Files<nowiki>|</nowiki>*.txt}} or maybe even like this: {{string|Text Files (*.txt)<nowiki>|</nowiki>*.txt}}.
+
The first {{defined|string}} in a filter is a name to be displayed, which describes the filter (e.g. {{string|Text Files}}). The second one specifies a filtering pattern (e.g. {{string|*.txt}}). A filter for text files could look like {{string|Text Files<nowiki>|</nowiki>*.txt}} or {{string|Text Files (*.txt)<nowiki>|</nowiki>*.txt}}.
  
To specify multiple filtering patterns for a single filter, use a semicolon to separate the patterns (e.g. {{string|*.txt;*.doc;*.bak}}). A filtering pattern can be a combination of valid filename characters and an asterisk wildcard character. Do not include spaces in the pattern {{defined|string}}.
+
To specify multiple filtering patterns for single filter, use semicolon to separate the patterns (e.g. {{string|*.txt;*.doc;*.bak}}). Filtering pattern can be a combination of valid filename characters and an asterisk wildcard character. Do not include spaces in the pattern {{defined|string}}.
  
Several filters are to be delimited also by a Pipe character. Therefore this {{dialog|Filter strings}} value should eventually consist of pairs of {{defined|strings}} delimited by Pipes. Each pair defines one filter: a name and its filtering pattern.
+
Several filters are to be delimited by a Pipe character ({{string|<nowiki>|</nowiki>}}). Therefore {{field|Settings:File|Filter strings}} value should eventually consist of pairs of {{defined|strings}} delimited by Pipe characters. Each pair defines one filter: a name and its filtering pattern.
  
====Suggest first line as new file name====
+
Example: Default filters are {{string|<nowiki>Text Files (*.txt)|*.txt|All Files|*.*</nowiki>}}
  
The {{field|Suggest first line as new file name}} option specifies, whether the text from the first line of the document is to be suggested in the {{dialog|Save As}} dialog as a new file name instead of the default {{string|Untitled}}. Note: When there is no text on the first line, the {{string|Untitled}} is used regardless of this option.
+
The '''{{field|Settings:File|Suggest first line as new file name}}''' setting specifies, whether text from the first non-empty line of the document is to be suggested in the {{dialog|Save As}} dialog as a new file name instead of the default {{string|Untitled}}.
  
====Create backup files====
+
Note: Characters unallowed in file names are automatically converted into dashes.
 
 
The {{field|Create backup files}} option specifies, whether to create backup files by ''copying'' the previous version of the original file upon each save operation. The backup file name is created by appending a {{string|.~}} to the original file name.
 
 
 
====Save recovery every 5 mins====
 
 
 
The {{field|Save recovery every 5 mins}} option specifies, whether to auto-save the current file every 5 minutes into a recovery file. The recovery file name is created by appending a {{string|.$}} to the original file name. The auto-save operation is performed on background and occurs only, when there are unsaved modifications made to the document.
 
 
 
Note: The recovery file is deleted after a successful {{feature|Save}} operation; or upon closing the document by a user request (e.g. by opening a new file or closing the editor window).
 
 
 
====Force Read-only files====
 
 
 
The {{field|Force Read-only files}} option specifies, whether files with read-only attribute can be written to. By using this option, you override the system default behaviour, which prevents the modification of such files.
 
 
 
{{tip}} You can save a read-only file also by opening its {{feature|Properties}} dialog (hotkey {{hotkey|Ctrl+J}}) and unchecking the read-only attribute. After the saving, you may then choose, whether to set the read-only attribute back.
 
 
 
====Save without BOM====
 
 
 
The {{field|Save without BOM}} option specifies, whether to save {{system|UTF-8}} and {{system|Unicode}} files without their Byte-Order-Mark (BOM). '''Use this setting with caution. Always remember, when you turn it on!'''
 
 
 
Although there might be specific ocasions, where this is useful, it also brings non-trivial complications. A file without a BOM is not recognized correctly by most of the applications. {{system|Unicode}} files may be treated as {{system|binary}} files and in {{system|UTF-8}} files non-ASCII characters may be misinterpreted.
 
 
 
{{tip}} See also the {{field|Force the default encoding}} option below, which can be used to load files without BOM.
 
 
 
====Only one instance of each file====
 
 
 
The {{field|Only one instance of each file}} option specifies, whether TED Notepad should check for other instances of the same file already opened. When this option is turned on, each file is cross-checked upon opening, whether it is already opened in another window of TED Notepad. If so, a warning is displayed, asking the user, whether to switch to the already opened window.
 
 
 
====Check if file is modified outside====
 
 
 
The {{field|Check if file is modified outside}} option specifies, whether a watch is to be set for every opened file. When this option is turned on, TED Notepad raises a warning every time the current file is modified by some other application. It asks, whether to {{feature|Revert}} the file upon such event.
 
 
 
By reverting, you discard all unsaved modifications and load the new version of the file. The selection will try to persist the loading, placing the {{defined|actual insertion point}} to the same location. Also, the actual scrolling should persist unchanged.
 
 
 
====Keep file name on error====
 
 
 
The {{field|Keep file name on error}} option specifies, whether the file name should be kept even after an unsuccessful or unclean loading. '''Use this setting with caution. Always remember, when you turn it on!'''
 
 
 
By default, when a file ''fails'' to load (because of a read error, or even when the file is {{system|binary}}), the partially loaded data are displayed with a indication, that the file is already modified. Furthermore, to prevent you from accidentaly saving the modified file back without notice, its file name is discarded. Therefore, you need to explicitly specify a file name to save the data to.
 
 
 
By turning this option on, the above precaution is disabled, allowing you to save the incomplete or modified file right back. Note that when loading binary files, special characters are being modified in the process. The file might then become useless.
 
 
 
====Force the default encoding====
 
 
 
The {{field|Force the default encoding}} option specifies, whether to load all files using the default encoding specified above on this page. '''Use this setting with caution. Always remember, when you turn it on!'''
 
 
 
By turning this option on, all attempts to examine the file encoding are skipped and the default encoding is assumed. Also, all file data is assumed to be part of the text. In result, even an occasional Byte-Order-Mark (BOM) is treated just as a part of the text. This may become useful, when you know the exact encoding of the loaded file, but the file misses the correct BOM.
 
 
 
{{tip}} See also the {{field|Save without BOM}} option above, which can be used to save files without BOM.
 

Latest revision as of 00:02, 5 October 2021

This section is up to date for TED Notepad version 6.3.1.0.
Control page Control:dialog:Settings:File

Default encoding

The Default encoding setting specifies default Encoding to be used for new documents, or in cases where detection of encoding of a file being loaded is indecisive (e.g. if loading pure ASCII file, encoding can be both ANSI and UTF-8).

Supported default encodings are:

The Default encoding: Add BOM (UTF-8 / Unicode) setting extends some encodings with BOM and non-BOM variants. Note: While some encodings do not allow BOM at all (e.g. ANSI), other encodings recommend using BOM (e.g. both Unicodes), and some encodings make BOM optional (e.g. UTF-8).

Important note: If BOM is recommended for some encoding, omitting it is allowed, but might result in inability to auto-detect correct file encoding upon future file loading. This is especially true with Unicode files. See Open File for further details about encoding auto-detection and available workarounds.

Default newlines

The Default newlines setting specifies default type of Newlines to be used for new documents, or in cases where detection of newlines of a file being loaded is indecisive (e.g. if loading file with no newlines).

Supported types of default newlines are:

See Newlines for further details on when and how Newlines are used within TED Notepad.

Dialogs

The Default file type setting specifies, what file extension is to be used by default in the Save As dialog, if no file extension is specified explicitly. This default file extension may not exceed 4 characters.

Tip: The default file extension for plain-text documents is txt, but users may choose to override this with another value. For example, use html, if creating HTML documents more often than plain-text files.

The Default path setting defines relative or absolute path, which is to be used as a starting point in the Open and Save As dialogs.

  • If no path is specified as Default path, the current working directory is used if it contains files which satisfy the Filter strings patterns described below. Otherwise, personal files directory of the current user is used as starting point.
  • If absolute path is specified, it is used unmodified in all cases.
  • If relative path is specified (e.g. . or \docs), it refers to current working directory. Note: The current working directory is usually the directory which TED Notepad was started from; although shortcuts allow to specify another starting directory for example. Also note that the current working directory no longer changes with every Open and Save As dialog operations as it did in previous versions of TED Notepad. The current working directory stays the same throughout the entire instance session.

Tip: A useful example for portable usage is simple back-slash (\) as Default path, which makes the Open and Save As dialogs start in the root directory of the drive, from which you originally launched the application. This can be used to twist the USB drive around, while moving TED Notepad on the USB drive from one computer to another.

Note: One of the requirements for this to work, is to use correct working directory upon launching TED Notepad from the USB drive. In most typical cases, the system uses the USB drive as the working directory (as expected). However, some file managers and portable launchers may need to be told what working directory to use explicitly. Set them to use the USB drive.

The Filter strings setting define filters, which are to be used in the Open and Save As dialogs as file filters. These filters appear in a combo-box, usually bellow the file name box. A filter consists of two strings separated by Pipe character (|).

The first string in a filter is a name to be displayed, which describes the filter (e.g. Text Files). The second one specifies a filtering pattern (e.g. *.txt). A filter for text files could look like Text Files|*.txt or Text Files (*.txt)|*.txt.

To specify multiple filtering patterns for single filter, use semicolon to separate the patterns (e.g. *.txt;*.doc;*.bak). Filtering pattern can be a combination of valid filename characters and an asterisk wildcard character. Do not include spaces in the pattern string.

Several filters are to be delimited by a Pipe character (|). Therefore Filter strings value should eventually consist of pairs of strings delimited by Pipe characters. Each pair defines one filter: a name and its filtering pattern.

Example: Default filters are Text Files (*.txt)|*.txt|All Files|*.*

The Suggest first line as new file name setting specifies, whether text from the first non-empty line of the document is to be suggested in the Save As dialog as a new file name instead of the default Untitled.

Note: Characters unallowed in file names are automatically converted into dashes.