<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Configuration file</title><link>https://sourceforge.net/p/scdict/wiki/Configuration%2520file/</link><description>Recent changes to Configuration file</description><atom:link href="https://sourceforge.net/p/scdict/wiki/Configuration%20file/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 13 Feb 2014 16:38:45 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/scdict/wiki/Configuration%20file/feed" rel="self" type="application/rss+xml"/><item><title>Configuration file modified by Quasus</title><link>https://sourceforge.net/p/scdict/wiki/Configuration%2520file/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -93,3 +93,28 @@

 This means that the *A Copious...* dictionary may be further referred to as "KL-EN", and that SCDICT will generally prefer to display the latter notation.  Anyway, general information about a dictionary is not its `name` field, but its `title` and `description`.

+## Grouping ##
+
+If you use numerous dictionaries, it is convenient to organize them into groups.  A group is a collection of dictionaries typically having a name and a description.  Dictionaries belonging to a group can have one or more aliases referred to as *akas*; they are local to the group.  It is convenient to have short akas in order to quickly switch between dictionaries during an interactive session.
+
+A group is defined as follows:
+
+    (defgroup 
+      (description )
+      (items
+        ( )
+        ...
+        ( )))
+
+Here `` is the name of the group to be defined, `` is a (double-quoted) string, `` is the name or the nick of a dictionary, and `` come in pairs `&lt;option name="name"&gt;` `&lt;/option&gt;&lt;option value="value"&gt;`.  Currently only option `` is supported, its values are strings.
+
+Example:
+
+    (defgroup kl
+      (description "Klingon dictionaries")
+      (items
+        ("EN-KL" aka "E")
+        ("KL-EN" aka "K")
+        ("KL-KL" aka "A" aka "B")))
+
+The `description` and `items` clauses can go in an arbitrary order, the first one being optional.
&lt;/option&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Quasus</dc:creator><pubDate>Thu, 13 Feb 2014 16:38:45 -0000</pubDate><guid>https://sourceforge.net75dc248bdb0faf1f90cdba155f467ea423ecaa7c</guid></item><item><title>Configuration file modified by Quasus</title><link>https://sourceforge.net/p/scdict/wiki/Configuration%2520file/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="configuration-file"&gt;Configuration file&lt;/h1&gt;
&lt;p&gt;The configuration file &lt;code&gt;~/.scdict/scdictrc.lisp&lt;/code&gt; uses Lisp-like syntax.  It allows you to define viewers and associate them with file types and particular dictionaries as well as manage your dictionary collection by introducing aliases (so-called &lt;em&gt;nicks&lt;/em&gt;) and creating groups of dictionaries.&lt;/p&gt;
&lt;h2 id="defining-a-viewer"&gt;Defining a viewer&lt;/h2&gt;
&lt;p&gt;In order to set a default viewer, you first define one.  To do so you use the following syntax:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;defviewer&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;viewer&lt;/span&gt;&lt;span class="na"&gt;-name&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="na"&gt;-string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="na"&gt;-arguments&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;viewer-name&amp;gt;&lt;/code&gt; is any sequence of letters (typically lowercase with hyphens as separators; in what follows such sequences are referenced to as &lt;em&gt;symbols&lt;/em&gt;);&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;file&amp;gt;&lt;/code&gt; is a symbol standing for variable file name;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;page&amp;gt;&lt;/code&gt; is a symbol standing for variable page number;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;format-string&amp;gt;&lt;/code&gt; is a string delimited by double quotes possibly including sequences &lt;code&gt;~A&lt;/code&gt;.  More generally, it can be an arbitrary Common Lisp format string.  Note that inside strings literal double quotes and backslashes must be escaped with a backslash;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;format-arguments&amp;gt;&lt;/code&gt; are several symbols (one for each &lt;code&gt;~A&lt;/code&gt;) used for substitution into the format string.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="example-djview4"&gt;Example: djview4&lt;/h3&gt;
&lt;p&gt;Say, you want to use djview4 as your default DjVu viewer. A possible command to open a file at a given page would be&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nx"&gt;djview&lt;/span&gt; &lt;span class="na"&gt;-page&lt;/span&gt;&lt;span class="o"&gt;=&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;&amp;lt;file&amp;gt;&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;(see &lt;code&gt;man djview&lt;/code&gt; for more options).  Note that you should quote the file name as it may contain spaces.  In your scdictrc.lisp you use write as follows:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;defviewer&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;djvu&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;viewer&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;djview -page=~A &lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s"&gt;~A&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here &lt;code&gt;defviewer&lt;/code&gt; means that we are defining a new viewer and &lt;code&gt;default-djvu-viewer&lt;/code&gt; is its name (you could choose another one to your liking).  Next, as we mentioned, we specify two symbols &lt;code&gt;f&lt;/code&gt; and &lt;code&gt;p&lt;/code&gt; that will stand for the file name and page number.  You could chose any two letters (identifiers) you like, but the first letter in parentheses after the viewer's name will always stand for the file name, while the second one will stand for the page.  Next we see our command in the form of a format string.  The string has two gaps for the page number and the file name which are both represented by ~A. After the string we supply the values to fill in the gaps in the order the gaps occur, i. e. first the page number, then the file name.  Notice once again that the format string (as any string) is delimited by double quotes and you must escape literal double quotes with backslashes.&lt;/p&gt;
&lt;h3 id="example-mupdf"&gt;Example: mupdf&lt;/h3&gt;
&lt;p&gt;Here is another example for mupdf:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;defviewer&lt;/span&gt; &lt;span class="n"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;favourite&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;viewer&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="s"&gt;&amp;quot;mupdf &lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s"&gt;~A&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s"&gt; ~A&amp;quot;&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here the syntax is simpler and can be written in the form&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nx"&gt;mupdf&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We have used the variable names &lt;code&gt;file&lt;/code&gt; and &lt;code&gt;page&lt;/code&gt; instead of just f and p.&lt;/p&gt;
&lt;p&gt;Observe that you can split Lisp code between multiple lines (anyway, computer reads it by parentheses) and it it customary (though not absolutely necessary) to indent the body of a macro by two spaces.  Further, observe that Lisp code is typically written in lower case with hyphens as separators (rather than e. g. underscores).  Of course, a dedicated text editor makes formatting code much easier, but if you are not going to code that much, you can have pretty rc files even without it.&lt;/p&gt;
&lt;h2 id="setting-up-default-viewers"&gt;Setting up default viewers&lt;/h2&gt;
&lt;p&gt;Next, we want to associate our viewers with formats.  The format of a dictionary is its &lt;code&gt;format&lt;/code&gt; property and typically is "PDF" or "DJVU".  To establish associations, use the following syntax:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;viewer&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;PDF&amp;quot;&lt;/span&gt; &lt;span class="n"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;favourite&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;viewer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;viewer&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;DJVU&amp;quot;&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;djvu&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;viewer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The magic word &lt;code&gt;set-default-viewer&lt;/code&gt; does the trick.  It is followed by the format designator  and by the name of the viewer defined earlier.&lt;/p&gt;
&lt;h3 id="setting-up-viewers-for-specific-dictionaries"&gt;Setting up viewers for specific dictionaries&lt;/h3&gt;
&lt;p&gt;Moreover, you can establish viewers for individual dictionaries using &lt;code&gt;set-viewer&lt;/code&gt; as follows:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;defviewer&lt;/span&gt; &lt;span class="n"&gt;djview&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;fullscreen&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="s"&gt;&amp;quot;djview -fullscreen -page=~A &lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s"&gt;~A&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;viewer&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;MY-DICT&amp;quot;&lt;/span&gt; &lt;span class="n"&gt;djview&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;fullscreen&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this case the dictionary by nick "MY-DICT" will be opened in the fullscreen mode.&lt;/p&gt;
&lt;h2 id="renaming-dictionaries"&gt;Renaming dictionaries&lt;/h2&gt;
&lt;p&gt;Dictionaries are identified by the field &lt;code&gt;name&lt;/code&gt; of their JSON description.  This means that the names should be long enough to prevent name clashes when adding new dictionaries to an existent collection.  However, it is often more handy to replace long names by convenient shorter ones.&lt;/p&gt;
&lt;p&gt;SCDICT distinguishes between three kinds of names.&lt;/p&gt;
&lt;p&gt;The primary means to identify dictionaries is the &lt;code&gt;name&lt;/code&gt; field of the JSON records.&lt;/p&gt;
&lt;p&gt;A user may set up global &lt;em&gt;nicks&lt;/em&gt; for dictionaries.  A dictionary having a nick can still be referenced by the name unless the name is shadowed by another nick.  However, SCDICT prefers to mention dictionaries by nicks rather than by names (e. g. when listing loaded dictionaries).&lt;/p&gt;
&lt;p&gt;Within a group dictionaries may have local aliases (&lt;em&gt;akas&lt;/em&gt;).  These are treated in the subsection Grouping.&lt;/p&gt;
&lt;p&gt;Typically a name may be a not-so-short string, a nick may be a more convenient designation in the context of your own dictionary collection, and an aka may be a handy one-letter shortcut for easy referring to a dictionary when switching, etc.&lt;/p&gt;
&lt;p&gt;You set up a nick as follows:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nick&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;nick&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;where  and  are strings (double-quoted, as usually).&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nick&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;A_Copious_and_Critical_Klingon-English_Lexicon&amp;quot;&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;KL-EN&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This means that the &lt;em&gt;A Copious...&lt;/em&gt; dictionary may be further referred to as "KL-EN", and that SCDICT will generally prefer to display the latter notation.  Anyway, general information about a dictionary is not its &lt;code&gt;name&lt;/code&gt; field, but its &lt;code&gt;title&lt;/code&gt; and &lt;code&gt;description&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Quasus</dc:creator><pubDate>Thu, 13 Feb 2014 16:12:35 -0000</pubDate><guid>https://sourceforge.netc1d6257833961a1650cbad0c240e37da5cd6003d</guid></item></channel></rss>