Merge branch '1851_xdg_config'
* 1851_xdg_config: menu file now searched also in mc_sysconfig_dir directory renamed cedit.menu to mcedit.menu Added environment variable MC_LOG_ENABLE for specify if logging is enabled (higher priority rather then parameter from config file). Also added environment variable MC_LOG_FILE for specify file name. Added new function mc_always_log() for logging on early bootstrap stages Updated docs (man pages and comments in source code) Renamed variables mc_home to mc_sysconfig_dir and mc_home_alt to mc_share_data_dir for more sence Ticket #1851: Home config directory [xdg-user-dirs]
Этот коммит содержится в:
Коммит
1b9957058a
10
doc/FAQ
10
doc/FAQ
@ -263,11 +263,11 @@ f2 Keyboard
|
||||
enhanced keys. If you want to use ESC to cancel things you have to
|
||||
press it twice i.e. ESC-ESC. If you find this cumbersome you can
|
||||
generally use F10 to cancel. Alternatively turn on the old_esc_mode
|
||||
setting in the ~/.mc/ini file. The old_esc_mode setting makes ESC
|
||||
work as a prefix only if another key is pressed within 0.5 seconds.
|
||||
After 0.5 seconds the ESC key cancels. There is no way to make ESC
|
||||
cancel immediately (if we want to be able to use arrows keys and
|
||||
function keys).
|
||||
setting in the ~/.config/mc/ini file. The
|
||||
old_esc_mode setting makes ESC work as a prefix only if another key
|
||||
is pressed within 0.5 seconds. After 0.5 seconds the ESC key cancels.
|
||||
There is no way to make ESC cancel immediately (if we want to be able
|
||||
to use arrows keys and function keys).
|
||||
|
||||
2.5 How can I add the plus sign (+) on the command line?
|
||||
|
||||
|
@ -198,7 +198,7 @@ y el
|
||||
El valor por defecto de auto repetición para los botones del ratón es 400
|
||||
milisegundos. Este valor se puede modificar editando el archivo
|
||||
.\"LINK2"
|
||||
\&~/.mc/ini
|
||||
\&~/.config/mc/ini
|
||||
.\"Save Setup"
|
||||
y cambiando el parámetro
|
||||
.IR mouse_repeat_rate .
|
||||
@ -1291,7 +1291,7 @@ Los directorios a ser omitidos deberían ser enumerados en la variable
|
||||
.B ignore_dirs
|
||||
en la sección
|
||||
.B FindFile
|
||||
de nuestro archivo ~/.mc/ini.
|
||||
de nuestro archivo ~/.config/mc/ini.
|
||||
.PP
|
||||
Los componentes del directorio deberían ser separados por dos puntos, como en
|
||||
el ejemplo que sigue:
|
||||
@ -1355,7 +1355,7 @@ comando cd interno\&.
|
||||
.\"NODE " Extension File Edit"
|
||||
.SH " Editar el Archivo de Extensiones"
|
||||
Abre el archivo
|
||||
.I ~/.mc/bindings
|
||||
.I ~/.local/share/mc/bindings
|
||||
en nuestro editor. El administrador puede optar por editar, en su lugar,
|
||||
el archivo de extensiones del sistema
|
||||
.IR @prefix@/share/mc/mc.ext .
|
||||
@ -1428,7 +1428,7 @@ El menú de usuario es un menú de acciones útiles que puede ser personalizado
|
||||
por el usuario. Cuando accedemos al menú de usuario se utiliza, si existe,
|
||||
el archivo .mc.menu del directorio actual, pero sólo si es propiedad del
|
||||
usuario o del superusuario y no es modificable por todos.
|
||||
Si no se encuentra allí el archivo, se intenta de la misma manera con ~/.mc/menu,
|
||||
Si no se encuentra allí el archivo, se intenta de la misma manera con ~/.local/share/mc/menu,
|
||||
y si no, mc utiliza el menú por defecto para todo el sistema
|
||||
@prefix@/share/mc/mc.menu.
|
||||
.PP
|
||||
@ -1713,7 +1713,7 @@ regulares son las descritas en ed(1).
|
||||
.I Auto\-Guardar Configuración.
|
||||
Si esta opción está activada, cuando salimos de Midnight Commander las
|
||||
opciones configurables de Midnight Commander se guardan en el archivo
|
||||
~/.mc/ini.
|
||||
~/.config/mc/ini.
|
||||
.PP
|
||||
.I Auto Menús.
|
||||
Si está activada, el menú de usuario aparece automáticamente al arrancar.
|
||||
@ -1868,7 +1868,7 @@ desaparezca. Si no, pulsaremos la tecla que nos pide y esperaremos hasta que
|
||||
el diálogo desaparezca.
|
||||
.PP
|
||||
Cuando acabemos con todas las teclas, podríamos Guardar nuestras teclas
|
||||
en nuestro archivo ~/.mc/ini dentro de la sección [terminal:TERM] (donde TERM es el
|
||||
en nuestro archivo ~/.config/mc/ini dentro de la sección [terminal:TERM] (donde TERM es el
|
||||
nombre de nuestro terminal actual) o descartarlas. Si todas nuestras teclas funcionan
|
||||
correctamente y no debemos corregir ninguna, entonces (lógico) no se grabará.
|
||||
.\"NODE " Virtual FS"
|
||||
@ -1951,14 +1951,14 @@ y puede ser impedida por algún cortafuegos.
|
||||
.\"NODE " Save Setup"
|
||||
.SH " Guardar Configuración"
|
||||
Al arrancar Midnight Commander se carga la información de inicio del
|
||||
archivo ~/.mc/ini. Si éste no existe, se cargará la información del
|
||||
archivo ~/.config/mc/ini. Si éste no existe, se cargará la información del
|
||||
archivo de configuración genérico del sistema, @prefix@/share/mc/mc.ini.
|
||||
Si el archivo de configuración genérico del sistema no existe, MC utiliza
|
||||
la configuración por defecto.
|
||||
.PP
|
||||
El comando
|
||||
.I Guardar Configuración
|
||||
crea el archivo ~/.mc/ini guardando la configuración actual de los menús
|
||||
crea el archivo ~/.config/mc/ini guardando la configuración actual de los menús
|
||||
.\"LINK2"
|
||||
Izquierdo, Derecho
|
||||
.\"Left and Right Menus"
|
||||
@ -2147,11 +2147,11 @@ que serán válidos hasta salir de Midnight Commander.
|
||||
Si estamos usando
|
||||
.B bash
|
||||
podremos especificar comandos de arranque
|
||||
para el subshell en nuestro archivo ~/.mc/bashrc y
|
||||
mapas de teclado especiales en el archivo ~/.mc/inputrc.
|
||||
para el subshell en nuestro archivo ~/.local/share/mc/bashrc y
|
||||
mapas de teclado especiales en el archivo ~/.local/share/mc/inputrc.
|
||||
Los usuarios de
|
||||
.B tcsh
|
||||
podrán especificar los comandos de arranque en el archivo ~/.mc/tcshrc.
|
||||
podrán especificar los comandos de arranque en el archivo ~/.local/share/mc/tcshrc.
|
||||
.PP
|
||||
Cuando utilizamos el código del subshell, podemos suspender aplicaciones en
|
||||
cualquier momento con la secuencia
|
||||
@ -2566,14 +2566,14 @@ aunque podemos recuperar su funcionamiento habitual en terminales (copiar
|
||||
y pegar) manteniendo pulsada la tecla mayúsculas.
|
||||
.B Ctrl\-Ins
|
||||
copia al archivo
|
||||
.B cooledit.clip
|
||||
.B mcedit.clip
|
||||
y
|
||||
.B Mayús\-Ins
|
||||
pega desde
|
||||
.BR cooledit.clip .
|
||||
.BR mcedit.clip .
|
||||
.B Mayús\-Supr
|
||||
corta y copia en
|
||||
.BR cooledit.clip ,
|
||||
.BR mcedit.clip ,
|
||||
y
|
||||
.B Ctrl\-Supr
|
||||
elimina el texto resaltado. La tecla
|
||||
@ -2592,7 +2592,7 @@ seguido de la tecla asignada. También será ejecutada si
|
||||
pulsamos Meta (Alt), Ctrl, o Escape y la tecla asignada, siempre y cuando
|
||||
la tecla no sea usada por ninguna otra función. Una vez definida, los comandos de
|
||||
macro irán al archivo
|
||||
.B cedit/cooledit.macros
|
||||
.B ~/.local/share/mc/mcedit/mcedit.macros
|
||||
en nuestro directorio de inicio. Podemos eliminar una macro borrando
|
||||
la línea adecuada en este archivo.
|
||||
.PP
|
||||
@ -2604,7 +2604,7 @@ o
|
||||
u otro). Esto está controlado por el archivo
|
||||
.B @prefix@/share/mc/edit.indent.rc
|
||||
que se copia la primera vez que se usa en
|
||||
.B .mc/cedit/edit.indent.rc
|
||||
.B ~/.local/share/mc/mcedit/edit.indent.rc
|
||||
en el directorio personal.
|
||||
.PP
|
||||
El editor también visualiza caracteres no estadounidenses (160+). Al editar
|
||||
@ -3129,7 +3129,7 @@ o sin su extensión \.ini. De no indicar la ruta se realiza la búsqueda,
|
||||
en orden, en:
|
||||
.IP
|
||||
1)
|
||||
.BR ~/.mc/skins/ .
|
||||
.BR ~/.local/share/mc/skins/ .
|
||||
.br
|
||||
2)
|
||||
.BR @sysconfdir@/mc/skins/ .
|
||||
@ -3468,7 +3468,7 @@ La mayoría de las opciones de Midnight Commander pueden cambiarse desde
|
||||
los menús. Sin embargo, hay un pequeño número de ajustes para los que
|
||||
es necesario editar el archivo de configuración.
|
||||
.PP
|
||||
Estas variables se pueden cambiar en nuestro archivo ~/.mc/ini:
|
||||
Estas variables se pueden cambiar en nuestro archivo ~/.config/mc/ini:
|
||||
.PP
|
||||
.I clear_before_exec
|
||||
.IP
|
||||
@ -3596,7 +3596,7 @@ del sistema sin necesidad de privilegios de superusuario. El programa
|
||||
busca definiciones de teclas en el archivo de inicialización del sistema
|
||||
.B @prefix@/share/mc/mc.lib
|
||||
o en el del usuario
|
||||
.BR ~/.mc/ini ,
|
||||
.BR ~/.config/mc/ini ,
|
||||
en la sección "terminal:nuestro\-terminal" y si no en "terminal:general".
|
||||
Cada línea comienza con el identificador de la tecla, seguido de un signo
|
||||
de igual y la definición de la tecla. Para representar el carácter de escape
|
||||
@ -3622,7 +3622,7 @@ complete tecla para completar
|
||||
.PP
|
||||
Ejemplo: para indicar que la secuencia Escape + [ + O + p corresponde
|
||||
a la tecla de insertar, hay que colocar en el archivo
|
||||
.BR ~/.mc/ini :
|
||||
.BR ~/.config/mc/ini :
|
||||
.PP
|
||||
.nf
|
||||
insert=\\e[Op
|
||||
@ -3666,7 +3666,7 @@ Archivo de ayuda.
|
||||
.IP
|
||||
Archivo de extensiones por defecto del sistema.
|
||||
.PP
|
||||
.I ~/.mc/bindings
|
||||
.I ~/.local/share/mc/bindings
|
||||
.IP
|
||||
Archivo de usuario de extensiones y configuración de visor y editor. Si
|
||||
está presente prevalece sobre el contenido de los archivos del sistema.
|
||||
@ -3674,17 +3674,17 @@ está presente prevalece sobre el contenido de los archivos del sistema.
|
||||
.I @prefix@/share/mc/mc.ini
|
||||
.IP
|
||||
Archivo de configuración del sistema para Midnight Commander, sólo si
|
||||
el usuario no dispone de su propio ~/.mc/ini.
|
||||
el usuario no dispone de su propio ~/.config/mc/ini.
|
||||
.PP
|
||||
.I @prefix@/share/mc/mc.lib
|
||||
.IP
|
||||
Opciones globales de Midnight Commander. Se aplican siempre a todos los
|
||||
usuarios, tengan ~/.mc/ini o no. Actualmente sólo se emplea para los
|
||||
usuarios, tengan ~/.config/mc/ini o no. Actualmente sólo se emplea para los
|
||||
.\"LINK2"
|
||||
ajustes de terminal\&.
|
||||
.\"Terminal databases"
|
||||
.PP
|
||||
.I ~/.mc/ini
|
||||
.I ~/.config/mc/ini
|
||||
.IP
|
||||
Configuración personal del usuario. Si este archivo está presente entonces
|
||||
se cargará la configuración desde aquí en lugar de desde el archivo de
|
||||
@ -3699,12 +3699,12 @@ programa.
|
||||
.IP
|
||||
Este archivo contiene el menú de aplicaciones por defecto para el sistema.
|
||||
.PP
|
||||
.I ~/.mc/menu
|
||||
.I ~/.local/share/mc/menu
|
||||
.IP
|
||||
Menú de aplicaciones personal del usuario. Si está presente será utilizado
|
||||
en lugar del menú por defecto del sistema.
|
||||
.PP
|
||||
.I ~/.mc/Tree
|
||||
.I ~/.cache/mc/Tree
|
||||
.IP
|
||||
La lista de directorios para el árbol de directorios y la vista en árbol.
|
||||
.PP
|
||||
|
@ -188,7 +188,7 @@ esetén is.
|
||||
Az egérgomb automatikus ismétlésének határértéke alapesetben 400
|
||||
ezredmásodpercnyi. Ez megváltoztatható az
|
||||
.\"LINK2"
|
||||
~/.mc/ini
|
||||
~/.config/mc/ini
|
||||
.\"Save Setup"
|
||||
fájlban a
|
||||
.I mouse_repeat_rate
|
||||
@ -1218,7 +1218,7 @@ slow linkkel csatoltak).
|
||||
.PP
|
||||
Az átlépendő könyvtárakat a
|
||||
.B ignore_dirs
|
||||
változó állítja be az ~/.mc/ini fájlod
|
||||
változó állítja be az ~/.config/mc/ini fájlod
|
||||
.B FindFile
|
||||
részében.
|
||||
.PP
|
||||
@ -1289,7 +1289,7 @@ A cd belső parancs
|
||||
leírásánál.
|
||||
.\"NODE " Extension File Edit"
|
||||
.SH " Társítások"
|
||||
Ez az ~/.mc/bindings szerkesztéséhez segítségül fogja hívni a
|
||||
Ez az ~/.local/share/mc/bindings szerkesztéséhez segítségül fogja hívni a
|
||||
szövegszerkesztődet. A fájl formátuma a következő (a formátum a 3.0\-ás
|
||||
verzióval megváltozott):
|
||||
.PP
|
||||
@ -1361,7 +1361,7 @@ A felhasználói menüt a felhasználó testre szabhatja. Ez az aktulis
|
||||
könyvtár .mc.menu fájlja, ha az létezik, de csak, ha az a felhasználó
|
||||
(illetve a root) a tulajdonosa, és nem lehet bárki számára írható. Ha
|
||||
nem talál ilyen fájlt, az
|
||||
.I ~/.mc/menu
|
||||
.I ~/.local/share/mc/menu
|
||||
keresése a következő lépés, egyébként pedig az mc az alapértelmezett
|
||||
rendszerszintű menüt használja, pl.:
|
||||
.IR @prefix@/share/mc/mc.menu ,
|
||||
@ -1654,7 +1654,7 @@ engedélyezett, akkor a szokásos kiterjesztések azonosak a ed\-ben lévőkkel:
|
||||
.PP
|
||||
.I Beállítások automatikus mentése
|
||||
Ha ez az opciót bekapcsoltad, amikor kilépsz a Midnight Commander\-ből,
|
||||
az MC opcióinak beállításait az ~/.mc/ini fájlba menti.
|
||||
az MC opcióinak beállításait az ~/.config/mc/ini fájlba menti.
|
||||
.PP
|
||||
.I Auto menük.
|
||||
Ha ez az opció engedélyezett, a felhasználói menü megjelenik az mc
|
||||
@ -1808,7 +1808,7 @@ begépelt gomb lesz az megkérdezett gombbal azonosított. Ezután a
|
||||
dialógus ablak eltűnik.
|
||||
.PP
|
||||
Amikor végeztél minden gombbal, ezt elmentheted a Mentés gombbal az
|
||||
~/.mc/ini fájlba, a [terminal:TERM] részbe (ahol a TERM a jelenlegi
|
||||
~/.config/mc/ini fájlba, a [terminal:TERM] részbe (ahol a TERM a jelenlegi
|
||||
terminál neve), vagy elvetheted. Ha minden gombod megfelelően működik,
|
||||
és nem javítottál semmit, akkor (természetesen) nem fog menteni semmit
|
||||
sem.
|
||||
@ -1869,7 +1869,7 @@ FTP fájlrendszernél\&.
|
||||
.SH " Beállítások mentése"
|
||||
A Midnight Commander indításkor megpróbálja az indítási információkat
|
||||
beolvasni az
|
||||
.I ~/.mc/ini
|
||||
.I ~/.config/mc/ini
|
||||
fájlból. Ha ez a fájl nem létezik, ezeket az információkat a
|
||||
rendszerszintű konfigurációs fájlból fogja beolvasni, amelyek a
|
||||
.I @prefix@/share/mc/mc.ini
|
||||
@ -1886,7 +1886,7 @@ Bal és Jobb oldali menü
|
||||
.\"LINK2"
|
||||
Beállítások
|
||||
.\"Options Menu"
|
||||
menü beállításait az ~/.mc/ini fájlba.
|
||||
menü beállításait az ~/.config/mc/ini fájlba.
|
||||
.PP
|
||||
Ha aktiválod az
|
||||
.I Auto Beállításmentés
|
||||
@ -2092,10 +2092,10 @@ használni fog.
|
||||
.PP
|
||||
Ha
|
||||
.BR bash \-t
|
||||
használsz, a subshell indító parancsait megadhatod az ~/.mc/bashrc
|
||||
fájlban, és tetszőleges billentyűzet térképet az ~/.mc/inputrc fájlban. A
|
||||
használsz, a subshell indító parancsait megadhatod az ~/.local/share/mc/bashrc
|
||||
fájlban, és tetszőleges billentyűzet térképet az ~/.local/share/mc/inputrc fájlban. A
|
||||
.B tcsh
|
||||
felhasználóknak az indítási parancsokat az ~/.mc/tcshrc fájlban van
|
||||
felhasználóknak az indítási parancsokat az ~/.local/share/mc/tcshrc fájlban van
|
||||
lehetőségük megadni.
|
||||
.PP
|
||||
Amikor a subshell kódot használod, bármikor megszakíthatod az
|
||||
@ -2459,13 +2459,13 @@ legördülő menü megtekintése szükséges. Egyéb gombok: Shift és nyíl
|
||||
billentyűk a szöveg kijelöléséhez. A
|
||||
.B Ctrl\-Ins
|
||||
kimásolja a szöveget a
|
||||
.BR cooledit.clip \-be
|
||||
.BR mcedit.clip \-be
|
||||
és a
|
||||
.B Shift\-Ins
|
||||
beilleszti azt a cooledit.clip\-ből. A
|
||||
beilleszti azt a mcedit.clip\-ből. A
|
||||
.B Shift\-Del
|
||||
kivágja a szöveget a
|
||||
.BR cooledit.clip \-be,
|
||||
.BR mcedit.clip \-be,
|
||||
és a
|
||||
.B Ctrl\-Del
|
||||
törli a kijelölt szöveget. A lezáró billentyűként szintén használható a
|
||||
@ -2485,7 +2485,7 @@ hozzárendelhetsz az adott gomb lenyomásával. A makró lefut a
|
||||
lenyomod a Váltó (Alt), Ctrl, vagy az Esc\-et és a megadott gombot,
|
||||
feltételezve azt, hogy a gombot nem használja más funkció. Miután
|
||||
megadtad, a makro parancs a home könyvtárad
|
||||
.B ~/.cedit/cooledit.macros
|
||||
.B ~/.local/share/mc/mcedit/mcedit.macros
|
||||
fájljába kerül. A makrót a fájl megfelelő sorának törlésével végezheted
|
||||
el.
|
||||
.PP
|
||||
@ -2873,7 +2873,7 @@ base_color=normal=white,default:marked=magenta,default
|
||||
A legtöbb Midnight Commander beállítás a menükből is elérhető. Ám van
|
||||
néhány beállítás, ami csak a setup fájl szerkesztésével állítható be.
|
||||
.PP
|
||||
Ezeket a változókat az ~/.mc/ini fájlban állíthatod be:
|
||||
Ezeket a változókat az ~/.config/mc/ini fájlban állíthatod be:
|
||||
.PP
|
||||
.I clear_before_exec
|
||||
.IP
|
||||
@ -2981,7 +2981,7 @@ tartalommal.
|
||||
A Midnight Commander lehetőséget nyújt a terminál adatbázis root jogok
|
||||
használata nélküli módosítására. A Midnight Commander a rendszer indító
|
||||
fájlban (az mc.lib fájlt a Midnight Commander library könyvtárában
|
||||
találjuk), vagy az ~/.mc/ini file "terminal:your\-terminal\-name" részében
|
||||
találjuk), vagy az ~/.config/mc/ini file "terminal:your\-terminal\-name" részében
|
||||
keres, és, a "terminal:general" rész minden sora tartalmazza azokat a
|
||||
billentyűzet szimbólumokat az egyenlőségjelet és a definiált szimbólumot
|
||||
követően, amelyeket te mag akarsz határozni. A \\e speciális formátumot
|
||||
@ -3033,7 +3033,7 @@ A program súgó fájlja.
|
||||
.IP
|
||||
Az alapértelmezett rendszerszintű kiterjesztés fájl.
|
||||
.PP
|
||||
.I ~/.mc/bindings
|
||||
.I ~/.local/share/mc/bindings
|
||||
.IP
|
||||
A felhasználó saját kiterjesztései, nézet beállítások és szerkesztési
|
||||
beállítások. Ezek felülbírálják a rendszerszintű fájl bejegyzéseit, ha
|
||||
@ -3042,7 +3042,7 @@ van ilyen.
|
||||
.I @prefix@/share/mc/mc.ini
|
||||
.IP
|
||||
Az alapértelmezett rendszerszintű Midnight Commander beállítás, amelyet
|
||||
csak akkor használ, ha a felhasználónak nincs saját ~/.mc/ini fájlja.
|
||||
csak akkor használ, ha a felhasználónak nincs saját ~/.config/mc/ini fájlja.
|
||||
.PP
|
||||
.I @prefix@/share/mc/mc.lib
|
||||
.IP
|
||||
@ -3050,7 +3050,7 @@ A Midnight Commander globális beállításai. Az ebben a fájlban elvégzett
|
||||
beállítások minden felhasználó Midnight Commander\-jére vonatkoznak, ez
|
||||
használható a site\-globális terminál beállításaihoz.
|
||||
.PP
|
||||
.I ~/.mc/ini
|
||||
.I ~/.config/mc/ini
|
||||
.IP
|
||||
A felhasználó saját beállításai. Ha ez a fájl elérhető, akkor a
|
||||
beállítások ebből a fájlból olvasódnak be a rendszerszintű indító fájl
|
||||
@ -3065,19 +3065,19 @@ Ez a fájl tartalmazza a program által megjelenített útmutattásokat
|
||||
.IP
|
||||
Ez a fájl azonos a rendszerszintű alkalmazás menüvel.
|
||||
.PP
|
||||
.I ~/.mc/menu
|
||||
.I ~/.local/share/mc/menu
|
||||
.IP
|
||||
A falhasználó saját alkalmazás menüje. Ha ez a fájl elérhető a
|
||||
rendszerszintű alkalmazás menü helyett ezt fogja használni.
|
||||
.PP
|
||||
.I ~/.mc/Tree
|
||||
.I ~/.cache/mc/Tree
|
||||
.IP
|
||||
A könyvtárlista a Könyvtárfa és a Fa nézethez. Minden sor egy
|
||||
bejegyzés. Minden sor perjellel kezdik a teljes könyvtár neveknél. A
|
||||
sorok egy számmal kezdődnek, amik azonosak az elöző könyvtáréval. Ha ezt
|
||||
a fájlt el akarod készíteni a következő parancsot használd:
|
||||
.nf
|
||||
find / \-type d \-print | sort > ~/.mc/Tree"
|
||||
find / \-type d \-print | sort > ~/.cache/mc/Tree"
|
||||
.fi
|
||||
Normálisan nincs erre szükséged, mert a Midnight Commander automatikusan
|
||||
frissíti ezt.
|
||||
|
@ -207,7 +207,7 @@ albero directory\&.
|
||||
L'auto ripetizione predefinita per il mouse è di 400 millisecondi. Questo
|
||||
valore può essere cambiato modificando il file
|
||||
.\"LINK2"
|
||||
\&~/.mc/ini
|
||||
\&~/.config/mc/ini
|
||||
.\"Save Setup"
|
||||
e cambiando il parametro
|
||||
.IR mouse_repeat_rate .
|
||||
@ -1239,7 +1239,7 @@ Le directory che devono essere saltate devono essere impostate nella variabile
|
||||
.B ignore_dirs
|
||||
nella sezione
|
||||
.B FindFile
|
||||
del file ~/.mc/ini.
|
||||
del file ~/.config/mc/ini.
|
||||
.PP
|
||||
Le directory devono essere separate da una virgola, come nell'esempio:
|
||||
.PP
|
||||
@ -1304,7 +1304,7 @@ comando cd interno\&.
|
||||
.\"NODE " Extension File Edit"
|
||||
.SH " Modifica file estensioni"
|
||||
Questo comando invocherà l'editor sul file
|
||||
.IR ~/.mc/bindings .
|
||||
.IR ~/.local/share/mc/bindings .
|
||||
Il fomato di questo file è il seguente (il formato è cambiato dalla
|
||||
versione 3.0):
|
||||
.PP
|
||||
@ -1371,7 +1371,7 @@ personalizzati dall'utente. Quando si accede al menu utente, viene
|
||||
utilizzato, se esiste, il file .mc.menu dalla directory corrente,
|
||||
ma solo se è di proprietà dell'utente o di root e se non è scrivibile
|
||||
a tutti. Se tale file non viene trovato, mc alla stessa maniera
|
||||
prova con ~/.mc/menu altrimenti usa il menu di sistema
|
||||
prova con ~/.local/share/mc/menu altrimenti usa il menu di sistema
|
||||
@prefix@/share/mc/mc.menu.
|
||||
.PP
|
||||
Il formato del file menu è molto semplice. Le righe che cominciano
|
||||
@ -1656,7 +1656,7 @@ espressioni regolari sono quelle descritte in ed(1).
|
||||
.I Autosalva configurazione.
|
||||
Se quest'opzione è abilitata, quando si esce dal Midnight Commander le
|
||||
opzioni configurabili del Midnight Commander vengono salvate nel file
|
||||
~/.mc/ini.
|
||||
~/.config/mc/ini.
|
||||
.PP
|
||||
.I Menu automatici.
|
||||
Se quest'opzione è abilitata, il menu utente sarà invocato alla partenza.
|
||||
@ -1807,7 +1807,7 @@ premere Esc una volta ed aspettare.
|
||||
.PP
|
||||
Quando si è finito con tutti i tasti, è possibile salvarli. Le definizioni
|
||||
dei tasti che si è ridefinito saranno scritte nella sezione [terminal:TERM]
|
||||
del vostro ~/.mc/ini file (dove TERM è il nome del terminale corrente). Le
|
||||
del vostro ~/.config/mc/ini file (dove TERM è il nome del terminale corrente). Le
|
||||
definizioni dei tasti che già funzionavano correttamente non vengono salvate.
|
||||
.\"NODE " Virtual FS"
|
||||
.SH " FS virtuale "
|
||||
@ -1904,14 +1904,14 @@ funzionare con alcuni firewall.
|
||||
.\"NODE " Save Setup"
|
||||
.SH " Salva configurazione"
|
||||
Alla partenza il Midnight Commander prova a caricare le informazioni di
|
||||
inizializzazione dal file ~/.mc/ini. Se questo file non esiste,
|
||||
inizializzazione dal file ~/.config/mc/ini. Se questo file non esiste,
|
||||
caricherà le informazioni dal file di configurazione di sistema
|
||||
posizionato in @prefix@/share/mc/mc.ini. Se il file di configurazione di
|
||||
sistema non esiste, MC userà le impostazioni predefinite.
|
||||
.PP
|
||||
Il comando
|
||||
.I salva configurazione
|
||||
crea il file ~/.mc/ini salvando le impostazioni correnti
|
||||
crea il file ~/.config/mc/ini salvando le impostazioni correnti
|
||||
dei menu
|
||||
.\"LINK2"
|
||||
sinistra, destra
|
||||
@ -2113,11 +2113,11 @@ esca dal Midnight Commander.
|
||||
Se si sta usando
|
||||
.B bash
|
||||
si può specificare comandi alla partenza della subshell nel file
|
||||
~/.mc/bashrc e mappature speciali della tastiera nel file
|
||||
~/.mc/inputrc.
|
||||
~/.local/share/mc/bashrc e mappature speciali della tastiera nel file
|
||||
~/.local/share/mc/inputrc.
|
||||
.B tcsh
|
||||
gli utenti possono specificare comandi alla partenza nel file
|
||||
~/.mc/tcshrc.
|
||||
~/.local/share/mc/tcshrc.
|
||||
.PP
|
||||
Quando il codice della subshell viene utilizzato, si può sospendere
|
||||
l'applicazione in ogni momento con la sequenza C\-o e saltare nuovamente
|
||||
@ -2495,13 +2495,13 @@ discesa appropriato. Gli altri tasti sono: maiusc + tasti freccia
|
||||
produce la selezione del testo.
|
||||
.B Ctrl\-Ins
|
||||
copia nel file
|
||||
.B cooledit.clip
|
||||
.B mcedit.clip
|
||||
e
|
||||
.B Shift\-Ins
|
||||
incolla da cooledit.clip.
|
||||
incolla da mcedit.clip.
|
||||
.B Shift\-Del
|
||||
taglia in
|
||||
.BR cooledit.clip ,
|
||||
.BR mcedit.clip ,
|
||||
e
|
||||
.B Ctrl\-Del
|
||||
cancella il testo selezionato.
|
||||
@ -2520,7 +2520,7 @@ e poi il tasto assegnato. La macro viene eseguita anche se si
|
||||
preme il tasto Meta, Ctrl, o Esc e il tasto assegnato, basta che il tasto
|
||||
non sia già assegnato a qualche altra funzione. Una volta definiti, i
|
||||
macro comandi finiscono nel file
|
||||
.B .mc/cedit/cooledit.macros
|
||||
.B ~/.local/share/mc/mcedit/mcedit.macros
|
||||
nella propria directory home. E' possibile cancellare una macro cancellando
|
||||
la riga appropriata nel suddetto file.
|
||||
.PP
|
||||
@ -2532,7 +2532,7 @@ o
|
||||
o altro). Questo comportamento viene controllato dal file
|
||||
.B @prefix@/share/mc/edit.indent.rc
|
||||
che viene copiato nel
|
||||
.B .mc/cedit/edit.indent.rc
|
||||
.B ~/.local/share/mc/mcedit/edit.indent.rc
|
||||
nella propria directory home la prima volta che lo si usa.
|
||||
.PP
|
||||
L'editor visualizza snche caratteri non\-americani (160+). Quando si modifica
|
||||
@ -2910,13 +2910,13 @@ Molte delle impostazioni del Midnight Commander possono essere cambiate
|
||||
dai menu. Comunque, c'è un piccolo numero di impostazioni che possono
|
||||
essere cambiate solo agendo sul file di configurazione.
|
||||
.PP
|
||||
Queste sono le variabili che possono essere impostate nel file ~/.mc/ini:
|
||||
Queste sono le variabili che possono essere impostate nel file ~/.config/mc/ini:
|
||||
.TP
|
||||
.I clear_before_exec
|
||||
Il valore predefinito del Midnight Commander è di cancellare lo schermo
|
||||
prima dell'esecuzione di un comando. Se si preferisce vedere il risultato
|
||||
di un comando in fondo allo schermo, si modifichi la copia locale del file
|
||||
~/.mc/ini e si cambi il valore del campo clear_before_exec a 0.
|
||||
~/.config/mc/ini e si cambi il valore del campo clear_before_exec a 0.
|
||||
.TP
|
||||
.I confirm_view_dir
|
||||
Se si preme F3 su di una directory, normalmente MC entra nella directory.
|
||||
@ -3005,7 +3005,7 @@ Il Midnight Commander fornisce una maniera per correggere il database
|
||||
dei terminali si sistema senza richiedere i privilegi di
|
||||
amministratore (root). Il Midnight Commander ricerca nel file di
|
||||
inizializzazione di sistema (il file mc.lib collocato nella directory
|
||||
di libreria del Midnight Commander) e nel file ~/.mc/ini la sezione
|
||||
di libreria del Midnight Commander) e nel file ~/.config/mc/ini la sezione
|
||||
"terminal:nome\-del\-terminale\-in\-uso" e poi la sezione "terminal:general",
|
||||
ogni riga della sezione contiene il simbolo chiave che si vuol definire,
|
||||
seguito da un segno di uguale e la definizione per quel tasto.
|
||||
@ -3058,7 +3058,7 @@ Il file di aiuto per il programma.
|
||||
.IP
|
||||
Il file delle estensioni di sistema predefinito.
|
||||
.PP
|
||||
.I ~/.mc/bindings
|
||||
.I ~/.local/share/mc/bindings
|
||||
.IP
|
||||
Le estensioni dell'utente, la configurazione del visualizzatore e
|
||||
dell'editor di file. Se presenti, questi file si sovrappongono ai file di
|
||||
@ -3067,19 +3067,19 @@ sistema.
|
||||
.I @prefix@/share/mc/mc.ini
|
||||
.IP
|
||||
La configurazione di sistema predefinita per il Midnight Commander, usata solo
|
||||
se l'utente non possiede il proprio file ~/.mc/ini.
|
||||
se l'utente non possiede il proprio file ~/.config/mc/ini.
|
||||
.PP
|
||||
.I @prefix@/share/mc/mc.lib
|
||||
.IP
|
||||
Le impostazioni globali per il Midnight Commander. La modifica di questo
|
||||
file influisce su tutti gli utenti, che abbiano o no il file ~/.mc/ini .
|
||||
file influisce su tutti gli utenti, che abbiano o no il file ~/.config/mc/ini .
|
||||
Attualmente vengono caricate solo le
|
||||
.\"LINK2"
|
||||
impostazioni del terminale
|
||||
.\"Terminal databases"
|
||||
da mc.lib.
|
||||
.PP
|
||||
.I ~/.mc/ini
|
||||
.I ~/.config/mc/ini
|
||||
.IP
|
||||
La configurazione dell'utente. Se questo file è presente, la configurazione
|
||||
viene caricata da qui invece che dal file di sistema.
|
||||
@ -3092,12 +3092,12 @@ Questo file contiene i suggerimenti (dritte) mostrate dal programma.
|
||||
.IP
|
||||
Questo file contiene il menu di sistema per le applicazioni.
|
||||
.PP
|
||||
.I ~/.mc/menu
|
||||
.I ~/.local/share/mc/menu
|
||||
.IP
|
||||
Il menu utente per le applicazioni. Se presente viene usato al posto
|
||||
del menu delle applicazioni di sistema.
|
||||
.PP
|
||||
.I ~/.mc/Tree
|
||||
.I ~/.cache/mc/Tree
|
||||
.IP
|
||||
L'elenco di directory per l'albero directory e per la vista ad albero.
|
||||
.PP
|
||||
|
@ -226,7 +226,7 @@ key labels by clicking on them.
|
||||
The default auto repeat rate for the mouse buttons is 400
|
||||
milliseconds. This may be changed to other values by editing the
|
||||
.\"LINK2"
|
||||
\&~/.mc/ini
|
||||
\&~/.config/mc/ini
|
||||
.\"Save Setup"
|
||||
file and changing the
|
||||
.I mouse_repeat_rate
|
||||
@ -326,7 +326,7 @@ in section
|
||||
.BR [Midnight\-Commander]
|
||||
.BR
|
||||
4) File
|
||||
.BR ~/.mc/mc.keymap
|
||||
.BR ~/.local/share/mc/mc.keymap
|
||||
.BR
|
||||
5) File
|
||||
.BR @sysconfdir@/mc/mc.keymap
|
||||
@ -339,7 +339,7 @@ contain the absolute path to the keymap\-file (with the extension \.keymap
|
||||
or without it). Search of keymap\-file will occur in (to the first one found):
|
||||
.IP
|
||||
1)
|
||||
.BR ~/.mc/
|
||||
.BR ~/.local/share
|
||||
.BR
|
||||
2)
|
||||
.BR @sysconfdir@/mc/
|
||||
@ -1398,7 +1398,7 @@ Directories to be skipped should be set on the variable
|
||||
.B ignore_dirs
|
||||
in the
|
||||
.B FindFile
|
||||
section of your ~/.mc/ini file.
|
||||
section of your ~/.config/ini file.
|
||||
.PP
|
||||
Directory components should be separated with a colon, here is an
|
||||
example:
|
||||
@ -1464,7 +1464,7 @@ description.
|
||||
.\"NODE " Extension File Edit"
|
||||
.SH " Extension File Edit"
|
||||
This will invoke your editor on the file
|
||||
.IR ~/.mc/bindings .
|
||||
.IR ~/.local/share/mc/bindings .
|
||||
The format of this file following:
|
||||
.PP
|
||||
All lines starting with # or empty lines are thrown away.
|
||||
@ -1557,7 +1557,7 @@ The user menu is a menu of useful actions that can be customized by
|
||||
the user. When you access the user menu, the
|
||||
file .mc.menu from the current directory is used if it exists,
|
||||
but only if it is owned by user or root and is not world\-writable.
|
||||
If no such file found, ~/.mc/menu is tried in the same way,
|
||||
If no such file found, ~/.local/share/mc/menu is tried in the same way,
|
||||
and otherwise mc uses the default system\-wide menu
|
||||
@prefix@/share/mc/mc.menu.
|
||||
.PP
|
||||
@ -1908,7 +1908,7 @@ This option is disabled by default.
|
||||
.I Auto save setup.
|
||||
If this option is enabled, when you exit the Midnight Commander the
|
||||
configurable options of the Midnight Commander are saved in the
|
||||
~/.mc/ini file.
|
||||
~/.config/mc/ini file.
|
||||
.\"NODE " Layout"
|
||||
.SH " Layout"
|
||||
The layout dialog gives you a possibility to change the general layout
|
||||
@ -2016,7 +2016,7 @@ format and sort options. Unchecked by default.
|
||||
.PP
|
||||
.I Auto save panels setup.
|
||||
If this option is enabled, when you exit the Midnight Commander the
|
||||
current settings of panels are saved in the ~/.mc/panels.ini file.
|
||||
current settings of panels are saved in the ~/.cache/mc/panels.ini file.
|
||||
Disabled by default.
|
||||
.PP
|
||||
.B Navigation
|
||||
@ -2110,7 +2110,7 @@ and wait.
|
||||
.PP
|
||||
When you finish with all the keys, you can Save them. The definitions
|
||||
for the keys you have redefined will be written into the [terminal:TERM]
|
||||
section of your ~/.mc/ini file (where TERM is the name of your current
|
||||
section of your ~/.config/mc/ini file (where TERM is the name of your current
|
||||
terminal). The definitions of the keys that were already working properly
|
||||
are not saved.
|
||||
.\"NODE " Virtual FS"
|
||||
@ -2202,15 +2202,15 @@ firewalls.
|
||||
.\"NODE " Save Setup"
|
||||
.SH " Save Setup"
|
||||
At startup the Midnight Commander will try to load initialization
|
||||
information from the ~/.mc/ini file. If this file doesn't exist, it will
|
||||
load the information from the system\-wide configuration file, located in
|
||||
@prefix@/share/mc/mc.ini. If the system\-wide configuration file doesn't
|
||||
exist, MC uses the default settings.
|
||||
information from the ~/.config/mc/ini file. If this file
|
||||
doesn't exist, it will load the information from the system\-wide
|
||||
configuration file, located in @prefix@/share/mc/mc.ini. If the
|
||||
system\-wide configuration file doesn't exist, MC uses the default settings.
|
||||
.PP
|
||||
The
|
||||
.I Save Setup
|
||||
command creates the ~/.mc/ini file by saving the current settings
|
||||
of the
|
||||
command creates the ~/.config/mc/ini file by saving the
|
||||
current settings of the
|
||||
.\"LINK2"
|
||||
Left, Right
|
||||
.\"Left and Right Menus"
|
||||
@ -2410,10 +2410,10 @@ valid until you quit the Midnight Commander.
|
||||
If you are using
|
||||
.B bash
|
||||
you can specify startup
|
||||
commands for the subshell in your ~/.mc/bashrc file and
|
||||
special keyboard maps in the ~/.mc/inputrc file.
|
||||
commands for the subshell in your ~/.local/share/mc/bashrc file and
|
||||
special keyboard maps in the ~/.local/share/mc/inputrc file.
|
||||
.B tcsh
|
||||
users may specify startup commands in the ~/.mc/tcshrc file.
|
||||
users may specify startup commands in the ~/.local/share/mc/tcshrc file.
|
||||
.PP
|
||||
When the subshell code is used, you can suspend applications at any
|
||||
time with the sequence C\-o and jump back to the Midnight Commander, if
|
||||
@ -2932,13 +2932,13 @@ keys do what, just consult the appropriate pull\-down menu. Other keys
|
||||
are: Shift movement keys do text highlighting.
|
||||
.B Ctrl\-Ins
|
||||
copies to the file
|
||||
.B cooledit.clip
|
||||
.B mcedit.clip
|
||||
and
|
||||
.B Shift\-Ins
|
||||
pastes from cooledit.clip.
|
||||
pastes from mcedit.clip.
|
||||
.B Shift\-Del
|
||||
cuts to
|
||||
.BR cooledit.clip ,
|
||||
.BR mcedit.clip ,
|
||||
and
|
||||
.B Ctrl\-Del
|
||||
deletes highlighted text. Mouse highlighting also works, and you
|
||||
@ -2958,8 +2958,8 @@ and then the assigned key. The macro is also executed if
|
||||
you press Meta, Ctrl, or Esc and the assigned key, provided that the
|
||||
key is not used for any other function. Once defined, the macro
|
||||
commands go into the file
|
||||
.B .mc/cedit/cooledit.macros
|
||||
in your home directory. You can delete a macro by deleting the
|
||||
.B ~/.local/share/mc/mcedit/mcedit.macros
|
||||
You can delete a macro by deleting the
|
||||
appropriate line in this file.
|
||||
.PP
|
||||
To change charset of displayed text may use M\-e (Alt\-e).
|
||||
@ -2976,7 +2976,7 @@ code or another). This is controlled by the
|
||||
file
|
||||
.B @prefix@/share/mc/edit.indent.rc
|
||||
which is copied to
|
||||
.B .mc/cedit/edit.indent.rc
|
||||
.B ~/.local/share/mc/mcedit/edit.indent.rc
|
||||
in your home directory the first time you use it.
|
||||
.PP
|
||||
The editor also displays non\-us characters (160+). When editing
|
||||
@ -3546,7 +3546,7 @@ contain the absolute path to the skin\-file (with the extension \.ini
|
||||
or without it). Search of skin\-file will occur in (to the first one found):
|
||||
.IP
|
||||
1)
|
||||
.B ~/.mc/skins/
|
||||
.B ~/.local/share/mc/skins/
|
||||
.br
|
||||
2)
|
||||
.B @sysconfdir@/mc/skins/
|
||||
@ -3855,7 +3855,7 @@ Skins
|
||||
section.
|
||||
.PP
|
||||
Rules of filenames highlight are placed in @prefix@/share/mc/filehighlight.ini file
|
||||
(~/.mc/filehighlight.ini).
|
||||
(~/.config/mc/filehighlight.ini).
|
||||
Name of section in this file must be equal to parameters names in
|
||||
[filehighlight] section (in current skin\-file).
|
||||
.PP
|
||||
@ -3900,12 +3900,12 @@ Most of the Midnight Commander settings can be changed from the
|
||||
menus. However, there are a small number of settings which can only be
|
||||
changed by editing the setup file.
|
||||
.PP
|
||||
These variables may be set in your ~/.mc/ini file:
|
||||
These variables may be set in your ~/.config/mc/ini file:
|
||||
.TP
|
||||
.I clear_before_exec
|
||||
By default the Midnight Commander clears the screen before executing a
|
||||
command. If you would prefer to see the output of the command at the
|
||||
bottom of the screen, edit your ~/.mc/ini file and change the value of
|
||||
bottom of the screen, edit your ~/.config/mc/ini file and change the value of
|
||||
the field clear_before_exec to 0.
|
||||
.TP
|
||||
.I confirm_view_dir
|
||||
@ -4022,8 +4022,9 @@ autodetect_codeset=russian
|
||||
The Midnight Commander provides a way to fix your system terminal
|
||||
database without requiring root privileges. The Midnight Commander
|
||||
searches in the system initialization file (the mc.lib file located in
|
||||
the Midnight Commander library directory) and in the ~/.mc/ini file for
|
||||
the section "terminal:your\-terminal\-name" and then for the section
|
||||
the Midnight Commander library directory) and in the
|
||||
~/.config/mc/ini file for the section
|
||||
"terminal:your\-terminal\-name" and then for the section
|
||||
"terminal:general", each line of the section contains a key symbol that
|
||||
you want to define, followed by an equal sign and the definition for the
|
||||
key. You can use the special \\e form to represent the escape character
|
||||
@ -4090,7 +4091,7 @@ The help file for the program.
|
||||
.IP
|
||||
The default system\-wide extensions file.
|
||||
.PP
|
||||
.I ~/.mc/bindings
|
||||
.I ~/.local/share/mc/bindings
|
||||
.IP
|
||||
User's own extension, view configuration and edit configuration
|
||||
file. They override the contents of the system wide files if present.
|
||||
@ -4098,18 +4099,18 @@ file. They override the contents of the system wide files if present.
|
||||
.I @prefix@/share/mc/mc.ini
|
||||
.IP
|
||||
The default system\-wide setup for the Midnight Commander, used only if
|
||||
the user doesn't have his own ~/.mc/ini file.
|
||||
the user doesn't have his own ~/.config/mc/ini file.
|
||||
.PP
|
||||
.I @prefix@/share/mc/mc.lib
|
||||
.IP
|
||||
Global settings for the Midnight Commander. Settings in this file
|
||||
affect all users, whether they have ~/.mc/ini or not. Currently, only
|
||||
affect all users, whether they have ~/.config/mc/ini or not. Currently, only
|
||||
.\"LINK2"
|
||||
terminal settings
|
||||
.\"Terminal databases"
|
||||
are loaded from mc.lib.
|
||||
.PP
|
||||
.I ~/.mc/ini
|
||||
.I ~/.config/mc/ini
|
||||
.IP
|
||||
User's own setup. If this file is present then the setup is loaded
|
||||
from here instead of the system\-wide startup file.
|
||||
@ -4122,16 +4123,16 @@ This file contains the hints displayed by the program.
|
||||
.IP
|
||||
This file contains the default system\-wide applications menu.
|
||||
.PP
|
||||
.I ~/.mc/menu
|
||||
.I ~/.local/share/mc/menu
|
||||
.IP
|
||||
User's own application menu. If this file is present it is used instead
|
||||
of the system\-wide applications menu.
|
||||
.PP
|
||||
.I ~/.mc/Tree
|
||||
.I ~/.cache/mc/Tree
|
||||
.IP
|
||||
The directory list for the directory tree and tree view features.
|
||||
.PP
|
||||
.I ./.mc.menu
|
||||
.I ~/.local/share/mc.menu
|
||||
.IP
|
||||
Local user\-defined menu. If this file is present, it is used instead of
|
||||
the home or system\-wide applications menu.
|
||||
|
@ -76,13 +76,13 @@ In addition to that, Shift combined with arrows does text highlighting
|
||||
(if supported by the terminal):
|
||||
.B Ctrl\-Ins
|
||||
copies to the file
|
||||
.BR ~/.mc/cedit/cooledit.clip ,
|
||||
.BR ~/.cache/mc/mcedit/mcedit.clip ,
|
||||
.B Shift\-Ins
|
||||
pastes from
|
||||
.BR ~/.mc/cedit/cooledit.clip ,
|
||||
.BR ~/.cache/mc/mcedit/mcedit.clip ,
|
||||
.B Shift\-Del
|
||||
cuts to
|
||||
.BR ~/.mc/cedit/cooledit.clip ,
|
||||
.BR ~/.cache/mc/mcedit/mcedit.clip ,
|
||||
and
|
||||
.B Ctrl\-Del
|
||||
deletes highlighted text. Mouse highlighting also works on some
|
||||
@ -108,7 +108,7 @@ by pressing that key. The macro is executed when you press
|
||||
and then the assigned key. The macro is also executed if you press
|
||||
Meta, Ctrl, or Esc and the assigned key, provided that the key is not
|
||||
used for any other function. The macro commands are stored in the file
|
||||
.BR ~/.mc/cedit/cooledit.macros .
|
||||
.BR ~/.local/share/mc/mcedit/mcedit.macros .
|
||||
Do NOT edit this file if you are going to use macros again in the same
|
||||
editing session, because
|
||||
.B mcedit
|
||||
@ -121,14 +121,14 @@ other running editors for macros to take effect.
|
||||
.B F19
|
||||
will format C, C++, Java or HTML code when it is highlighted. An executable
|
||||
file called
|
||||
.B ~/.mc/cedit/edit.indent.rc
|
||||
.B ~/.local/share/mc/mcedit/edit.indent.rc
|
||||
will be created for you from the default template. Feel free to edit it
|
||||
if you need.
|
||||
.PP
|
||||
.B C\-p
|
||||
will run ispell on a block of text in a similar way. The script file
|
||||
will be called
|
||||
.BR ~/.mc/cedit/edit.spell.rc .
|
||||
.BR ~/.local/share/mc/mcedit/edit.spell.rc .
|
||||
.PP
|
||||
If some keys don't work, you can use
|
||||
.B Learn Keys
|
||||
@ -160,12 +160,12 @@ Forward).
|
||||
supports syntax highlighting. This means that keywords and contexts
|
||||
(like C comments, string constants, etc) are highlighted in different
|
||||
colors. The following section explains the format of the file
|
||||
.BR ~/.mc/cedit/Syntax .
|
||||
.BR ~/.local/share/mc/mcedit/Syntax .
|
||||
If this file is missing, system\-wide
|
||||
.B @prefix@/share/mc/syntax/Syntax
|
||||
is used.
|
||||
The file
|
||||
.B ~/.mc/cedit/Syntax
|
||||
.B ~/.local/share/mc/mcedit/Syntax
|
||||
is rescanned on opening of a any new editor file. The file contains
|
||||
rules for highlighting, each of which is given on a separate line, and
|
||||
define which keywords will be highlighted to what color.
|
||||
@ -400,7 +400,7 @@ Most options can now be set from the editors options dialog box. See
|
||||
the
|
||||
.B Options
|
||||
menu. The following options are defined in
|
||||
.B ~/.mc/ini
|
||||
.B ~/.config/mc/ini
|
||||
and have obvious counterparts in the dialog box. You can modify them to
|
||||
change the editor behavior, by editing the file. Unless specified, a 1
|
||||
sets the option to on, and a 0 sets it to off, as is usual.
|
||||
@ -551,24 +551,24 @@ The help file for the program.
|
||||
.I @prefix@/share/mc/mc.ini
|
||||
.IP
|
||||
The default system\-wide setup for GNU Midnight Commander, used only if
|
||||
the user's own ~/.mc/ini file is missing.
|
||||
the user's own ~/.config/mc/ini file is missing.
|
||||
.PP
|
||||
.I @prefix@/share/mc/mc.lib
|
||||
.IP
|
||||
Global settings for the Midnight Commander. Settings in this file
|
||||
affect all users, whether they have ~/.mc/ini or not.
|
||||
affect all users, whether they have ~/.config/mc/ini or not.
|
||||
.PP
|
||||
.I @prefix@/share/mc/syntax/*
|
||||
.IP
|
||||
The default system\-wide syntax files for mcedit, used only if
|
||||
the corresponding user's own ~/.mc/cedit/ file is missing.
|
||||
the corresponding user's own ~/.local/share/mc/mcedit/ file is missing.
|
||||
.PP
|
||||
.I $HOME/.mc/ini
|
||||
.I ~/.config/mc/ini
|
||||
.IP
|
||||
User's own setup. If this file is present then the setup is loaded
|
||||
from here instead of the system\-wide setup file.
|
||||
.PP
|
||||
.I $HOME/.mc/cedit/
|
||||
.I ~/.local/share/mc/mcedit/
|
||||
.IP
|
||||
User's own directory where block commands are processed and saved and
|
||||
user's own syntax files are located.
|
||||
|
@ -68,14 +68,14 @@ The help file for the program.
|
||||
.I @prefix@/share/mc/mc.ini
|
||||
.IP
|
||||
The default system\-wide setup for GNU Midnight Commander, used only if
|
||||
the user's own ~/.mc/ini file is missing.
|
||||
the user's own ~/.config/mc/ini file is missing.
|
||||
.PP
|
||||
.I @prefix@/share/mc/mc.lib
|
||||
.IP
|
||||
Global settings for the Midnight Commander. Settings in this file
|
||||
affect all users, whether they have ~/.mc/ini or not.
|
||||
affect all users, whether they have ~/.config/mc/ini or not.
|
||||
.PP
|
||||
.I $HOME/.mc/ini
|
||||
.I ~/.config/mc/ini
|
||||
.IP
|
||||
User's own setup. If this file is present, the setup is loaded from
|
||||
here instead of the system\-wide startup file.
|
||||
|
@ -162,7 +162,7 @@ przeglądaniu pomocy i przy drzewie katalogów.
|
||||
.PP
|
||||
Standardowo czas autopowtórzenia przy klikaniu myszą wynosi 400 milisekund.
|
||||
Tę wartość można zmienić edytując plik
|
||||
\&~/.mc/ini
|
||||
\&~/.config/mc/ini
|
||||
i zmieniając parametr
|
||||
.IR mouse_repeat_rate .
|
||||
.PP
|
||||
@ -1024,7 +1024,7 @@ Katalogi do omijania powinny być umieszczone w zmiennej
|
||||
.B ignore_dirs
|
||||
w sekcji
|
||||
.B FindFile
|
||||
twojego pliku ~/.mc/ini.
|
||||
twojego pliku ~/.config/mc/ini.
|
||||
.PP
|
||||
Składowe katalogów powinny być oddzielone od siebie przez średniki, to jest
|
||||
przykład:
|
||||
@ -1085,7 +1085,7 @@ przemieszczanie.
|
||||
.PP
|
||||
.\"NODE " Extension File Edit"
|
||||
.SH " Edycja rozszerzeń pliów (Extension File Edit)"
|
||||
Ta komenda wywoła twój edytor na plik ~/.mc/bindings. Format tego pliku jest
|
||||
Ta komenda wywoła twój edytor na plik ~/.local/share/mc/bindings. Format tego pliku jest
|
||||
następujący (zmienił się on począwszy od wersji 3.0):
|
||||
.PP
|
||||
Wszystkie linie zaczynające się od #, lub puste, nie są brane pod uwagę.
|
||||
@ -1158,7 +1158,7 @@ Menu użytkownika jest bardzo użytecznym menu, które może być tworzone
|
||||
w sposób dowolny, przez użytkownika. Kiedy tylko próbujesz coś zrobić
|
||||
przy użyciu tego menu, ładowany jest plik .mc.menu z aktualnego katalogu, ale
|
||||
tylko wtedy kiedy jest on w posiadaniu użytkownika lub roota i mamy do niego
|
||||
prawa zapisu. Jeśli takiego nie ma próbuje się z plikiem ~/.mc/menu z tymi
|
||||
prawa zapisu. Jeśli takiego nie ma próbuje się z plikiem ~/.local/share/mc/menu z tymi
|
||||
samymi założeniami, jeśli jego też nie ma \- używa się standardowego pliku
|
||||
systemowego, który znajduje się w @prefix@/share/mc/mc.menu.
|
||||
.PP
|
||||
@ -1412,7 +1412,7 @@ te, których używa w komenda
|
||||
.I Auto Save Setup.
|
||||
Jeśli ta opcja jest włączona, kiedy wychodzisz z Midnight Commandera
|
||||
konfiguracja MC zostanie zachowana automatycznie (bez pytania)
|
||||
do pliku ~/.mc/ini.
|
||||
do pliku ~/.config/mc/ini.
|
||||
.PP
|
||||
.I Auto menus.
|
||||
Jeśli ta opcja jest włączona, menu użytkownika będzie włączone na starcie.
|
||||
@ -1544,7 +1544,7 @@ wiadomość zniknie. W przeciwnym wypadku wciśnij klawisz, który sobie życzys
|
||||
i również poczekaj na zniknięcie okna.
|
||||
.PP
|
||||
Kiedy skończysz już ze wszystkimi klawiszami, możesz nacisnąć Save
|
||||
żeby zachować zmiany do pliku ~/.mc/ini do sekcji [terminal:TERM] (gdzie
|
||||
żeby zachować zmiany do pliku ~/.config/mc/ini do sekcji [terminal:TERM] (gdzie
|
||||
TERM jest nazwą twojego aktualnego terminala) lub po prostu odrzucić je.
|
||||
.PP
|
||||
.\"NODE " Virtual FS"
|
||||
@ -1597,13 +1597,13 @@ System plików FTP (FTP File System) po więcej szczegółów.
|
||||
.\"NODE " Save Setup"
|
||||
.SH " Zapisz ustawienia (Save Setup)"
|
||||
Na starcie Midnight Commander będzie próbował odczytać opcje startowe
|
||||
z pliku ~/.mc/ini. Jeśli on nie istnieje, odczyta on konfiguracje z
|
||||
z pliku ~/.config/mc/ini. Jeśli on nie istnieje, odczyta on konfiguracje z
|
||||
ogólnodostępnego pliku @prefix@/share/mc/mc.ini. Jeśli on też nie istnieje MC
|
||||
użyje swoich domyślnych ustawień.
|
||||
.PP
|
||||
Komenda
|
||||
.I Save Setup
|
||||
tworzy plik ~/.mc/ini zachowując aktualne ustawienia lewego, prawego menu,
|
||||
tworzy plik ~/.config/mc/ini zachowując aktualne ustawienia lewego, prawego menu,
|
||||
jak również menu opcji.
|
||||
.PP
|
||||
Jeśli właczysz opcję
|
||||
@ -1758,11 +1758,11 @@ z Midnight Commandera.
|
||||
.PP
|
||||
Jeśli używasz
|
||||
.B basha
|
||||
możesz wybrać startowe komendy twojej powłoki w tle w pliku ~/.mc/bashrc,
|
||||
a ustawienia klawiatury w ~/.mc/inputrc.
|
||||
możesz wybrać startowe komendy twojej powłoki w tle w pliku ~/.local/share/mc/bashrc,
|
||||
a ustawienia klawiatury w ~/.local/share/mc/inputrc.
|
||||
Użytkownicy
|
||||
.B tcsh
|
||||
mogą wstawiać komendy startowe do pliku ~/.mc/tcshrc.
|
||||
mogą wstawiać komendy startowe do pliku ~/.local/share/mc/tcshrc.
|
||||
.PP
|
||||
Jeśli kod powłoki w tle jest użyty, możesz zawiesić aplikację w dowolnej chwili
|
||||
po prostu naciskając kombinację C\-o i przeskakując spowrotem do Midnight
|
||||
@ -2109,13 +2109,13 @@ zobaczyć jakie są klawisze po prostu obejrzyj odpowiednie menu
|
||||
rozwijalne. Inne klawisze to: przemieszczanie z Shiftem zaznaczające tekst.
|
||||
.B Ctrl\-Ins
|
||||
kopiuje do pliku
|
||||
.B cooledit.clip
|
||||
.B mcedit.clip
|
||||
a
|
||||
.B Shift\-Ins
|
||||
wkleja z pliku cooledit.clip.
|
||||
wkleja z pliku mcedit.clip.
|
||||
.B Shift\-Del
|
||||
Wycina do
|
||||
.BR cooledit.clip ,
|
||||
.BR mcedit.clip ,
|
||||
a
|
||||
.B Ctrl\-Del
|
||||
kasuje zaznaczony tekst. Klawisze dokończenia również dają Enter z
|
||||
@ -2135,20 +2135,20 @@ i przyporządkowany klawisz. Makro jest wykonywane również jeśli naciśniesz
|
||||
klawisz Meta, Ctrl, lub Esc i wybrany klawisz, jednak tylko jeśli ten
|
||||
klawisz nie jest używane przez inne funkcje. Raz zdefiniowane, makro
|
||||
wędruje sobie do pliku
|
||||
.B .mc/cedit/cooledit.macros
|
||||
.B ~/.local/share/mc/mcedit/mcedit.macros
|
||||
w twoim katalogu domowym. Możesz skasować makro kasując odpowiednią linię z
|
||||
tego pliku.
|
||||
.PP
|
||||
.B F19
|
||||
sformatuje format C jeśli jest podświetlony. Żeby to działało, stwórz
|
||||
wykonywalny plik
|
||||
.B .mc/cedit/edit.indent.rc
|
||||
.B ~/.local/share/mc/mcedit/edit.indent.rc
|
||||
w twoim katalogu domowym zawierający poniższe:
|
||||
.PP
|
||||
.nf
|
||||
#!/bin/sh
|
||||
/usr/bin/indent \-kr \-pcs $HOME/.mc/cedit/cooledit.block >& /dev/null
|
||||
cat /dev/null > $HOME/.mc/cedit/cooledit.error
|
||||
/usr/bin/indent \-kr \-pcs ~/.cache/mc/mcedit/mcedit.block>& /dev/null
|
||||
cat /dev/null > ~/.cache/mc/mcedit/cooledit.error
|
||||
.fi
|
||||
.PP
|
||||
Edytor wyświetla również znaki nieamerykańskie (160+). Kiedy edytujesz plik
|
||||
@ -2529,7 +2529,7 @@ Większość ustawień Midnight Commandera może być zmieniana z poziomu menu.
|
||||
Pomimo tego jest pewna ilość ustawień, których zmiana możliwa jest jedynie
|
||||
poprzez zmianę w plikach konfiguracyjnych.
|
||||
.PP
|
||||
Opcje mogą być ustawione w twoim pliku ~/.mc/ini :
|
||||
Opcje mogą być ustawione w twoim pliku ~/.config/mc/ini :
|
||||
.PP
|
||||
.I clear_before_exec.
|
||||
.IP
|
||||
@ -2680,7 +2680,7 @@ zawartość wybranego katalogu.
|
||||
Midnight Commander pozwala ci na naprawienie bazy danych terminali bez
|
||||
posiadania uprawnień roota. Midnight Commander szuka w pliku startowym
|
||||
(mc.lib położonego w katalogach z bibliotekami Midnight Commandera) lub w
|
||||
pliku ~/.mc/ini sekcji "terminal:nazwa\-twojego\-terminala" i potem sekcji
|
||||
pliku ~/.config/mc/ini sekcji "terminal:nazwa\-twojego\-terminala" i potem sekcji
|
||||
"terminal:general", każda linia sekcji zawiera symbol klawisza, który
|
||||
chcesz zdefiniować, zaczynające się do znaku równości i definicji klawisza.
|
||||
Możesz użyć kombinacji \\E aby reprezentować znak escape i ^x aby
|
||||
@ -2733,7 +2733,7 @@ Plik pomocy dla programu.
|
||||
.IP
|
||||
Standardowy plik rozszerzeń plików.
|
||||
.PP
|
||||
~/.mc/bindings
|
||||
~/.local/share/mc/bindings
|
||||
.IP
|
||||
Własny plik użytkownika, konfiguruje podgląd i edycje plików. Ma wyższy
|
||||
priorytet niż plik systemowy.
|
||||
@ -2741,7 +2741,7 @@ priorytet niż plik systemowy.
|
||||
@prefix@/share/mc/mc.ini
|
||||
.IP
|
||||
Standardowy plik setupu do Midnight Commandera, używany tylko wówczas,
|
||||
kiedy użytkownik nie ma swojego własnego pliku ~/.mc/ini.
|
||||
kiedy użytkownik nie ma swojego własnego pliku ~/.config/mc/ini.
|
||||
.PP
|
||||
@prefix@/share/mc/mc.lib
|
||||
.IP
|
||||
@ -2749,7 +2749,7 @@ Globalne ustawienia Midnight Commandera. Ustawienia w tym pliku są
|
||||
uwzględniane przez wszystkie sesje Midnight Commandera, użyteczne do
|
||||
definiowania ogólnosystemowych ustawień terminali.
|
||||
.PP
|
||||
~/.mc/ini
|
||||
~/.config/mc/ini
|
||||
.IP
|
||||
Własny setup użytkownika. Jeśli ten plik jest dostępny, jest ładowany
|
||||
zamiast pliku globalnego.
|
||||
@ -2762,18 +2762,18 @@ Plik zawierający podpowiedzi (hints) wyświetlane przez program.
|
||||
.IP
|
||||
Ten plik zawiera informacje o ogólnosystemowych aplikacjach w menu.
|
||||
.PP
|
||||
~/.mc/menu
|
||||
~/.local/share/mc/menu
|
||||
.IP
|
||||
Własny plik menu użytkownika. Jeśli ten plik jest obecny jest używany
|
||||
zamiast pliku globalnego.
|
||||
.PP
|
||||
~/.mc/tree
|
||||
~~/.cache/mc/tree
|
||||
.IP
|
||||
Lista katalogów drzewa katalogów i podglądu drzewa. Jedna linia jest jednym
|
||||
wejściem. Linie zaczynające się od ukośnika są pełnymi nazwami katalogów.
|
||||
Linie zaczynające się od numeru mają tyle znaków ile poprzedni katalog.
|
||||
Jeśli chcesz możesz stworzyć plik używając komendy "find / \-type d
|
||||
\-print | sort > ~/.mc/tree". Normalnie nie ma sensu tego czynić, gdyż
|
||||
\-print | sort > ~/.cache/mc/tree". Normalnie nie ma sensu tego czynić, gdyż
|
||||
Midnight Commander robi to sam za ciebie.
|
||||
.PP
|
||||
\&./.mc.menu
|
||||
|
@ -220,7 +220,7 @@ Commander, просто набрав имя этой команды (прогр
|
||||
.I mouse_repeat_rate
|
||||
в файле
|
||||
.\"LINK2"
|
||||
\&~/.mc/ini
|
||||
\&~/.config/mc/ini
|
||||
.\"Save Setup"
|
||||
.PP
|
||||
Если Commander запущен с поддержкой мыши, вы можете обойти Commander и
|
||||
@ -322,7 +322,7 @@ S\-<символ> означает, что нужно держать в нажа
|
||||
.BR [Midnight\-Commander]
|
||||
.br
|
||||
4) Файл
|
||||
.BR ~/.mc/mc.keymap
|
||||
.BR ~/.local/share/mc/mc.keymap
|
||||
.br
|
||||
5) Файл
|
||||
.BR @sysconfdir@/mc/mc.keymap
|
||||
@ -337,7 +337,7 @@ S\-<символ> означает, что нужно держать в нажа
|
||||
будет происходить по следующим каталогам (до первого нахождения):
|
||||
.IP
|
||||
1)
|
||||
.BR ~/.mc/
|
||||
.BR ~/.local/share/mc/
|
||||
.br
|
||||
2)
|
||||
.BR @sysconfdir@/mc/
|
||||
@ -1496,7 +1496,7 @@ CDROM или не хотите искать в каталогах, подклю
|
||||
в секции
|
||||
.B FindFile
|
||||
вашего файла
|
||||
.BR ~/.mc/ini .
|
||||
.BR ~/.config/mc/ini .
|
||||
Имена каталогов разделяются двоеточиями, следующим образом:
|
||||
.PP
|
||||
.nf
|
||||
@ -1567,7 +1567,7 @@ CDPATH (смотрите описание
|
||||
.SH " Файл расширений"
|
||||
Этот пункт меню "Команда" служит для вызова редактора и редактирования
|
||||
файла
|
||||
.BR ~/.mc/bindings .
|
||||
.BR ~/.local/share/mc/bindings .
|
||||
Этот файл имеет следующий формат (формат был изменен в версии 3.0):
|
||||
.PP
|
||||
Все строки, начинающиеся с # или пустые строки игнорируются.
|
||||
@ -1659,7 +1659,7 @@ View из второй секции. default должно описывать в
|
||||
если владельцем этого файла является данный пользователь или root и этот
|
||||
файл не доступен на запись всем). Если такого файла не найдено, таким же
|
||||
образом ищется файл
|
||||
.B ~/.mc/menu
|
||||
.B ~/.local/share/mc/menu
|
||||
и, в последнюю очередь, mc использует общесистемное меню
|
||||
.BR @prefix@/share/mc/mc.menu .
|
||||
.PP
|
||||
@ -2054,7 +2054,7 @@ like regular expressions). Для того, чтобы достичь таког
|
||||
.I Автосохранение настроек.
|
||||
Если эта опция включена, то при выходе из программы Midnight Commander
|
||||
значения всех настраиваемых параметров сохраняются в файле
|
||||
.BR ~/.mc/ini .
|
||||
.BR ~/.config/mc/ini .
|
||||
.\"NODE " Layout"
|
||||
.SH " Внешний вид"
|
||||
Диалоговое окно "Внешний вид" дает вам возможность изменить некоторые
|
||||
@ -2167,7 +2167,7 @@ Commander будет использовать для вывода содержи
|
||||
.I Автосохранение настроек панелей.
|
||||
Если опция включена (по умолчанию она выключена), то при выходе из
|
||||
Midnight Commander'а текущие настройки панелей соханяются в файле
|
||||
~/.mc/panels.ini.
|
||||
~/.cache/mc/panels.ini.
|
||||
.PP
|
||||
.B Навигация
|
||||
.PP
|
||||
@ -2299,7 +2299,7 @@ Commander, выделены цветом, определенным ключев
|
||||
.PP
|
||||
Когда закончите тестирование и настройку всех клавиш, вы можете
|
||||
сохранить эти настройки в секции [terminal:TERM] вашего файла
|
||||
.B ~/.mc/ini
|
||||
.B ~/.config/mc/ini
|
||||
(где TERM \- название используемого терминала) либо отказаться от
|
||||
запоминания изменений. Если все клавиши работают нормально, то
|
||||
сохранение, конечно, не требуется.
|
||||
@ -2383,7 +2383,7 @@ FTP\-сервера, в памяти (в кеше). Время, в течени
|
||||
.SH " Сохранение установок"
|
||||
При загрузке Midnight Commander пытается считать значения различных
|
||||
установочных параметров из файла
|
||||
.BR ~/.mc/ini .
|
||||
.BR ~/.config/mc/ini .
|
||||
Если такого файла не существует, необходимая информация ищется в
|
||||
общесистемном конфигурационном файле
|
||||
.BR mc.ini .
|
||||
@ -2398,7 +2398,7 @@ FTP\-сервера, в памяти (в кеше). Время, в течени
|
||||
Команда
|
||||
.I Сохранить настройки
|
||||
создает файл
|
||||
.BR ~/.mc/ini ,
|
||||
.BR ~/.config/mc/ini ,
|
||||
в котором записываются текущие значения параметров, задаваемых опциями
|
||||
меню
|
||||
.\"LINK2"
|
||||
@ -2608,13 +2608,13 @@ bash, tcsh и zsh.
|
||||
.BR bash ,
|
||||
можно указать команды, которые будут выполняться при запуске
|
||||
subshell, в файле
|
||||
.B ~/.mc/bashrc
|
||||
.B ~/.local/share/mc/bashrc
|
||||
и специальную карту раскладки клавиатуры в файле
|
||||
.B ~/.mc/inputrc.
|
||||
.B ~/.local/share/mc/inputrc.
|
||||
Пользователи
|
||||
.B tcsh
|
||||
могут задать выполняемые при запуске команды в файле
|
||||
.B ~/.mc/tcshrc.
|
||||
.B ~/.local/share/mc/tcshrc.
|
||||
.PP
|
||||
Во время выполнения приложения в subshell можно в любой момент нажать
|
||||
комбинацию клавиш
|
||||
@ -3221,13 +3221,13 @@ pipe text blocks through shell commands like indent).
|
||||
выделение блока текста.
|
||||
.B Ctrl\-Ins
|
||||
копирует блок в файл
|
||||
.BR cooledit.clip .
|
||||
.BR mcedit.clip .
|
||||
.B Shift\-Ins
|
||||
производит вставку последнего скопированного в cooledit.clip блока в
|
||||
производит вставку последнего скопированного в mcedit.clip блока в
|
||||
позицию курсора.
|
||||
.B Shift\-Del
|
||||
удаляет выделенный блок текста, запоминая его в файле
|
||||
.BR cooledit.clip .
|
||||
.BR mcedit.clip .
|
||||
По клавише Enter вставляются символы конца строки, причем на следующей
|
||||
строке автоматически устанавливается отступ. Работает выделение текста с
|
||||
помощью мыши, причем если удерживать клавишу Shift, то управление мышью
|
||||
@ -3245,7 +3245,7 @@ pipe text blocks through shell commands like indent).
|
||||
любой из клавиш Meta (Alt), Ctrl, или Esc и назначенной макросу клавиши,
|
||||
при условии, что данная комбинация не используется для вызова какой\-либо
|
||||
другой функции. Макрокоманды после определения записываются в файл
|
||||
.B .mc/cedit/cooledit.macros
|
||||
.B ~/.local/share/mc/mcedit/mcedit.macros
|
||||
в вашем домашнем каталоге. Вы можете удалить макрос удалением
|
||||
соответствующей строки в этом файле.
|
||||
.PP
|
||||
@ -3257,7 +3257,7 @@ pipe text blocks through shell commands like indent).
|
||||
блока кода на языке C, C++ или других. Форматирование управляется файлом
|
||||
.B @prefix@/share/mc/edit.indent.rc
|
||||
который при первом вызове копируется в
|
||||
.B .mc/cedit/edit.indent.rc
|
||||
.B ~/.local/share/mc/mcedit/edit.indent.rc
|
||||
в вашем домашнем каталоге.
|
||||
.PP
|
||||
Встроенный редактор обрабатывает символы из второй половины кодовой
|
||||
@ -3828,7 +3828,7 @@ menuhotsel=yellow;black;bold+underline
|
||||
нахождения):
|
||||
.IP
|
||||
1)
|
||||
.BR ~/.mc/skins/
|
||||
.BR ~/.local/share/mc/skins/
|
||||
.br
|
||||
2)
|
||||
.BR @sysconfdir@/mc/skins/
|
||||
@ -4119,7 +4119,7 @@ menuhotsel=yellow;black;bold+underline
|
||||
.\"Skins"
|
||||
.PP
|
||||
Правила подсветки находятся в файле @sysconfdir@/mc/filehighlight.ini
|
||||
(~/.mc/filehighlight.ini).
|
||||
(~/.config/mc/filehighlight.ini).
|
||||
Названия групп должны совпадать с названиями параметров в секции
|
||||
[filehighlight] в текущем скин\-файле.
|
||||
.PP
|
||||
@ -4162,7 +4162,7 @@ menuhotsel=yellow;black;bold+underline
|
||||
использования меню. Однако имеется несколько установок, которые могут
|
||||
быть изменены только путем непосредственного редактирования
|
||||
конфигурационного файла
|
||||
.BR ~/.mc/ini .
|
||||
.BR ~/.config/mc/ini .
|
||||
.PP
|
||||
.I clear_before_exec
|
||||
.IP
|
||||
@ -4309,7 +4309,7 @@ Midnight Commander обеспечивает возможность внесен
|
||||
файле (файл
|
||||
.B mc.lib
|
||||
в библиотечном каталоге программы Midnight Commander) или в файле
|
||||
.B ~/.mc/ini
|
||||
.B ~/.config/mc/ini
|
||||
секцию с названием "terminal:your\-terminal\-name", а затем секцию
|
||||
"terminal:general". Каждая строка в этих секциях содержит ключевое
|
||||
слово, которое вы хотите определить, за которым следует знак равенства и
|
||||
@ -4376,7 +4376,7 @@ insert=\\e[Op
|
||||
.IP
|
||||
Используемый по умолчанию общесистемный файл расширений.
|
||||
.PP
|
||||
.I ~/.mc/bindings
|
||||
.I ~/.local/share/mc/bindings
|
||||
.IP
|
||||
Файл расширений пользователя. Если этот файл существует, он используется
|
||||
вместо общесистемного файла расширений.
|
||||
@ -4386,19 +4386,19 @@ insert=\\e[Op
|
||||
Используемый по умолчанию общесистемный файл установок для Midnight
|
||||
Commander; используется только в тех случаях, когда пользователь не
|
||||
имеет своего файла
|
||||
.B ~/.mc/ini
|
||||
.B ~/.config/mc/ini
|
||||
.PP
|
||||
.I @prefix@/share/mc/mc.lib
|
||||
.IP
|
||||
Глобальные установки для Midnight Commander. Установки из этого файла
|
||||
действительны для всех пользователей, независимо от того, имеют ли они
|
||||
~/.mc/ini или нет. В настоящий момент только
|
||||
~/.config/mc/ini или нет. В настоящий момент только
|
||||
.\"LINK2"
|
||||
настройки терминалов
|
||||
.\"Terminal databases"
|
||||
загружаются из mc.lib.
|
||||
.PP
|
||||
.I ~/.mc/ini
|
||||
.I ~/.config/mc/ini
|
||||
.IP
|
||||
Собственные установки пользователя. Если такой файл существует, то
|
||||
установки загружаются из него, а не из общесистемного инициализационного
|
||||
@ -4413,12 +4413,12 @@ Commander; используется только в тех случаях, ко
|
||||
.IP
|
||||
Этот файл содержит общесистемное меню приложений.
|
||||
.PP
|
||||
.I ~/.mc/menu
|
||||
.I ~/.local/share/mc/menu
|
||||
.IP
|
||||
Собственное меню пользователя. Если этот файл существует, он
|
||||
используется вместо общесистемного меню.
|
||||
.PP
|
||||
.I ~/.mc/Tree
|
||||
.I ~/.cache/mc/Tree
|
||||
.IP
|
||||
Список каталогов для окна, выводимого при выборе пункта меню
|
||||
"Команда/Дерево каталогов" или при просмотре дерева каталогов в одной из
|
||||
@ -4429,7 +4429,7 @@ Commander; используется только в тех случаях, ко
|
||||
команду
|
||||
.IP
|
||||
.nf
|
||||
find / \-type d \-print | sort > ~/.mc/Tree
|
||||
find / \-type d \-print | sort > ~/.cache/mc/Tree
|
||||
.fi
|
||||
.IP
|
||||
Обычно не имеет смысла делать это, потому что Midnight Commander
|
||||
|
@ -184,7 +184,7 @@ termcap/terminfo. Корисно је само на ХП\-овим термин
|
||||
Подразумевано чекање при понављању за дугмад миша је 400 милисекунди.
|
||||
Ово се може променити уређивањем датотеке
|
||||
.\"LINK2"
|
||||
\&~/.mc/ini
|
||||
\&~/.config/mc/ini
|
||||
.\"Save Setup"
|
||||
и променом параметра
|
||||
.IR "mouse_repeat_rate".
|
||||
@ -1207,7 +1207,7 @@ egrep(1). Ово значи да морате да наводите знаков
|
||||
.B ignore_dirs
|
||||
у одељку
|
||||
.B FindFile
|
||||
ваше датотеке ~/.mc/ini.
|
||||
ваше датотеке ~/.config/mc/ini.
|
||||
.PP
|
||||
Директоријуме би требало раздвајати двотачком; ево примера:
|
||||
.PP
|
||||
@ -1272,7 +1272,7 @@ awk '$9 ~! /incoming/ { print $9 }' < /var/log/xferlog
|
||||
.\"NODE " Extension File Edit"
|
||||
.SH " Уреди датотеку врста"
|
||||
Ово покреће ваш уређивач над датотеком
|
||||
.IR ~/.mc/bindings .
|
||||
.IR ~/.local/share/mc/bindings .
|
||||
Формат ове датотеке је следећи:
|
||||
.PP
|
||||
Сви редови који почињу на # или празни редови се одбацују.
|
||||
@ -1363,7 +1363,7 @@ awk '$9 ~! /incoming/ { print $9 }' < /var/log/xferlog
|
||||
датотека .mc.menu из текућег директоријума, уколико она постоји, али само
|
||||
уколико је њен власник корисник или администратор (root) и није
|
||||
дозвољен упис у њу од стране других (света). Ако таква датотека није
|
||||
нађена, на исти начин се покушава са датотеком ~/.mc/menu, а иначе ПН
|
||||
нађена, на исти начин се покушава са датотеком ~/.local/share/mc/menu, а иначе ПН
|
||||
користи подразумевану датотеку менија за цео систем
|
||||
@prefix@/share/mc/mc.menu.
|
||||
.PP
|
||||
@ -1647,7 +1647,7 @@ L Набраја садржај компримоване архиве врсте
|
||||
.PP
|
||||
.I Аутоматско чување подешавања.
|
||||
Ако је овај избор укључен, подесиви избори Поноћног наредника ће бити
|
||||
сачувани у датотеци ~/.mc/ini при изласку из Поноћног наредника.
|
||||
сачувани у датотеци ~/.config/mc/ini при изласку из Поноћног наредника.
|
||||
.PP
|
||||
.I Аутоматски менији.
|
||||
Ако је овај избор укључен, при покретању Поноћног наредника ће бити
|
||||
@ -1802,7 +1802,7 @@ L Набраја садржај компримоване архиве врсте
|
||||
.PP
|
||||
Кад завршите са свим тастерима, можете да их сачувате. Дефиниције
|
||||
тастера које сте задали ће бити уписане у одељак [terminal:TERM] ваше
|
||||
датотеке ~/.mc/ini (где `TERM' представља назив вашег текућег
|
||||
датотеке ~/.config/mc/ini (где `TERM' представља назив вашег текућег
|
||||
терминала). Дефиниције тастера који су већ исправно радили се не
|
||||
чувају.
|
||||
.\"NODE " Virtual FS"
|
||||
@ -1893,13 +1893,13 @@ ftpfs чува списак директоријума који добавља
|
||||
.\"NODE " Save Setup"
|
||||
.SH " Сачувај подешавања"
|
||||
При покретању, Поноћни наредник ће покушати да учита податке о
|
||||
покретању из датотеке ~/.mc/ini. Ако ова датотека не постоји, учитаће
|
||||
покретању из датотеке ~/.config/mc/ini. Ако ова датотека не постоји, учитаће
|
||||
податке из датотеке са подешавањима за цео систем. Ако ни она не
|
||||
постоји, ПН ће користити подразумеване поставке.
|
||||
.PP
|
||||
Наредба
|
||||
.I Сачувај подешавања
|
||||
ствара датотеку ~/.mc/ini чувањем текућих поставки менија
|
||||
ствара датотеку ~/.config/mc/ini чувањем текућих поставки менија
|
||||
.\"LINK2"
|
||||
`Лево', `Десно'
|
||||
.\"Left and Right Menus"
|
||||
@ -2097,12 +2097,12 @@ linux би вас одвело у /usr/src/linux).
|
||||
Уколико користите љуску
|
||||
.BR "bash",
|
||||
можете да задате наредбе које се извршавају при покретању подљуске у
|
||||
вашој датотеци ~/.mc/bashrc а посебне мапе тастатуре у датотеци
|
||||
~/.mc/inputrc.
|
||||
вашој датотеци ~/.local/share/mc/bashrc а посебне мапе тастатуре у датотеци
|
||||
~/.local/share/mc/inputrc.
|
||||
Корисници љуске
|
||||
.B tcsh
|
||||
могу да задају наредбе које се извршавају при покретању у датотеци
|
||||
~/.mc/tcshrc.
|
||||
~/.local/share/mc/tcshrc.
|
||||
.PP
|
||||
При употреби кода подљуске, можете било када да обуставите апликације
|
||||
пречицом C\-o и вратите се у Поноћног наредника; уколико сте обуставили
|
||||
@ -2488,13 +2488,13 @@ if the
|
||||
кретање у комбинацији са тастером `Shift' за означавање текста.
|
||||
.B Ctrl\-Ins
|
||||
копира у датотеку
|
||||
.B `cooledit.clip'
|
||||
.B `mcedit.clip'
|
||||
а
|
||||
.B Shift\-Ins
|
||||
лепи из датотеке `cooledit.clip'.
|
||||
лепи из датотеке `mcedit.clip'.
|
||||
.B Shift\-Del
|
||||
исеца у
|
||||
.BR `cooledit.clip' ,
|
||||
.BR `mcedit.clip' ,
|
||||
а
|
||||
.B Ctrl\-Del
|
||||
брише означени текст. Такође функционише и означавање мишем, а можете,
|
||||
@ -2513,7 +2513,7 @@ if the
|
||||
`Meta', `Ctrl' или `Esc' са додељеним тастером, уз услов да се та
|
||||
пречица не користи за нешто друго. Када су једном задане, макронаредбе
|
||||
се смештају у датотеку
|
||||
.B .mc/cedit/cooledit.macros
|
||||
.B ~/.local/share/mc/mcedit/mcedit.macros
|
||||
у вашем домаћем директоријуму. Можете да обришете макро брисањем
|
||||
одговарајућег реда у овој датотеци.
|
||||
.PP
|
||||
@ -2525,7 +2525,7 @@ if the
|
||||
или другом). Овим се управља преко датотеке
|
||||
.B @prefix@/share/mc/edit.indent.rc
|
||||
која ће бити копирана у
|
||||
.B .mc/cedit/edit.indent.rc
|
||||
.B ~/.local/share/mc/mcedit/edit.indent.rc
|
||||
у вашем домаћем директоријуму први пут када је будете користили.
|
||||
.PP
|
||||
Уређивач такође приказује неамеричке знаке (160 и више). При уређивању
|
||||
@ -3040,12 +3040,12 @@ base_color=normal=white,default:marked=magenta,default
|
||||
Међутим, постоји нешто поставки које се могу изменити само уређивањем
|
||||
датотеке поставки.
|
||||
.PP
|
||||
Ове променљиве се могу подесити у вашој датотеци `~/.mc/ini':
|
||||
Ове променљиве се могу подесити у вашој датотеци `~/.config/mc/ini':
|
||||
.TP
|
||||
.I clear_before_exec
|
||||
Подразумевано ће пре извршавања наредбе Поноћни наредник очистити
|
||||
екран. Уколико желите да видите излаз наредби на дну екрана, уредите
|
||||
вашу датотеку `~/.mc/ini' и промените вредност поља
|
||||
вашу датотеку `~/.config/mc/ini' и промените вредност поља
|
||||
`clear_before_exec' на 0.
|
||||
.TP
|
||||
.I confirm_view_dir
|
||||
@ -3134,7 +3134,7 @@ base_color=normal=white,default:marked=magenta,default
|
||||
терминала без потребе за администраторским привилегијама. Поноћни
|
||||
наредник претражује системску датотеку са почетним поставкама
|
||||
(датотеку `mc.lib' у библиотечком директоријуму Поноћног наредника),
|
||||
онда одељак `terminal:назив\-вашег\-терминала' у датотеци `~/.mc/ini',
|
||||
онда одељак `terminal:назив\-вашег\-терминала' у датотеци `~/.config/mc/ini',
|
||||
и онда одељак `terminal:general', чији сваки ред садржи симбол тастера
|
||||
кога желите да задате, после кога следи знак једнакости и задавање
|
||||
тастера. Можете да користите посебан облик `\\e' да бисте представили
|
||||
@ -3186,7 +3186,7 @@ MC_DATADIR. Ако ова променљива није постављена, б
|
||||
.IP
|
||||
Подразумевана системска датотека врста.
|
||||
.PP
|
||||
.I ~/.mc/bindings
|
||||
.I ~/.local/share/mc/bindings
|
||||
.IP
|
||||
Корисничке датотеке врста, подешавања прегледача и уређивача. Уколико
|
||||
постоје, оне заобилазе системске датотеке.
|
||||
@ -3194,19 +3194,19 @@ MC_DATADIR. Ако ова променљива није постављена, б
|
||||
.I @prefix@/share/mc/mc.ini
|
||||
.IP
|
||||
Подразумевана системска подешавања Поноћног наредника; користе се само
|
||||
у случају да корисник нема сопствену датотеку ~/.mc/ini.
|
||||
у случају да корисник нема сопствену датотеку ~/.config/mc/ini.
|
||||
.PP
|
||||
.I @prefix@/share/mc/mc.lib
|
||||
.IP
|
||||
Глобалне поставке Поноћног наредника. Поставке из ове датотеке се
|
||||
односе на све кориснике без обзира на то да ли они имају своје
|
||||
датотеке ~/.mc/ini или не. За сада, из датотеке mc.lib се учитавају
|
||||
датотеке ~/.config/mc/ini или не. За сада, из датотеке mc.lib се учитавају
|
||||
само
|
||||
.\"LINK2"
|
||||
поставке терминала\&.
|
||||
.\"Terminal databases"
|
||||
.PP
|
||||
.I ~/.mc/ini
|
||||
.I ~/.config/mc/ini
|
||||
.IP
|
||||
Корисничка подешавања. Ако је ова датотека присутна, подешавања се
|
||||
учитавају из ње уместо из системске почетне датотеке.
|
||||
@ -3219,12 +3219,12 @@ MC_DATADIR. Ако ова променљива није постављена, б
|
||||
.IP
|
||||
Ова датотека садржи подразумевани мени програма за цео систем.
|
||||
.PP
|
||||
.I ~/.mc/menu
|
||||
.I ~/.local/share/mc/menu
|
||||
.IP
|
||||
Кориснички мени програма. Ако је ова датотека присутна, онда се она
|
||||
користи уместо менија програма система.
|
||||
.PP
|
||||
.I ~/.mc/Tree
|
||||
.I ~/.cache/mc/Tree
|
||||
.IP
|
||||
Списак директоријума за одлику `стабло директоријума' и
|
||||
директоријумски поглед.
|
||||
|
@ -200,12 +200,12 @@ load_codepages_list (void)
|
||||
char *fname;
|
||||
|
||||
/* 1: try load /usr/share/mc/mc.charsets */
|
||||
fname = g_build_filename (mc_home_alt, CHARSETS_LIST, (char *) NULL);
|
||||
fname = g_build_filename (mc_share_data_dir, CHARSETS_LIST, (char *) NULL);
|
||||
load_codepages_list_from_file (&codepages, fname);
|
||||
g_free (fname);
|
||||
|
||||
/* 2: try load /etc/mc/mc.charsets */
|
||||
fname = g_build_filename (mc_home, CHARSETS_LIST, (char *) NULL);
|
||||
fname = g_build_filename (mc_sysconfig_dir, CHARSETS_LIST, (char *) NULL);
|
||||
load_codepages_list_from_file (&codepages, fname);
|
||||
g_free (fname);
|
||||
|
||||
|
@ -201,22 +201,22 @@ mc_fhl_init_from_standard_files (mc_fhl_t * fhl)
|
||||
gchar *name;
|
||||
gboolean ok;
|
||||
|
||||
/* ~/.mc/filehighlight.ini */
|
||||
name = g_build_filename (home_dir, MC_USERCONF_DIR, MC_FHL_INI_FILE, (char *) NULL);
|
||||
/* ${XDG_CONFIG_HOME}/mc/filehighlight.ini */
|
||||
name = g_build_filename (mc_config_get_data_path (), MC_FHL_INI_FILE, (char *) NULL);
|
||||
ok = mc_fhl_read_ini_file (fhl, name);
|
||||
g_free (name);
|
||||
if (ok)
|
||||
return TRUE;
|
||||
|
||||
/* ${sysconfdir}/mc/filehighlight.ini */
|
||||
name = g_build_filename (mc_home, MC_FHL_INI_FILE, (char *) NULL);
|
||||
name = g_build_filename (mc_sysconfig_dir, MC_FHL_INI_FILE, (char *) NULL);
|
||||
ok = mc_fhl_read_ini_file (fhl, name);
|
||||
g_free (name);
|
||||
if (ok)
|
||||
return TRUE;
|
||||
|
||||
/* ${datadir}/mc/filehighlight.ini */
|
||||
name = g_build_filename (mc_home_alt, MC_FHL_INI_FILE, (char *) NULL);
|
||||
name = g_build_filename (mc_share_data_dir, MC_FHL_INI_FILE, (char *) NULL);
|
||||
ok = mc_fhl_read_ini_file (fhl, name);
|
||||
g_free (name);
|
||||
return ok;
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#ifndef MC_USERCONF_DIR
|
||||
#define MC_USERCONF_DIR ".mc"
|
||||
#define MC_USERCONF_DIR "mc"
|
||||
#endif
|
||||
|
||||
#define TAGS_NAME "TAGS"
|
||||
@ -62,16 +62,16 @@
|
||||
#define MC_SKINS_SUBDIR "skins"
|
||||
|
||||
/* editor home directory */
|
||||
#define EDIT_DIR MC_USERCONF_DIR PATH_SEP_STR "cedit"
|
||||
#define EDIT_DIR "mcedit"
|
||||
|
||||
/* file names */
|
||||
#define EDIT_SYNTAX_FILE EDIT_DIR PATH_SEP_STR "Syntax"
|
||||
#define EDIT_CLIP_FILE EDIT_DIR PATH_SEP_STR "cooledit.clip"
|
||||
#define EDIT_MACRO_FILE EDIT_DIR PATH_SEP_STR "cooledit.macros"
|
||||
#define EDIT_BLOCK_FILE EDIT_DIR PATH_SEP_STR "cooledit.block"
|
||||
#define EDIT_TEMP_FILE EDIT_DIR PATH_SEP_STR "cooledit.temp"
|
||||
#define EDIT_CLIP_FILE EDIT_DIR PATH_SEP_STR "mcedit.clip"
|
||||
#define EDIT_MACRO_FILE EDIT_DIR PATH_SEP_STR "mcedit.macros"
|
||||
#define EDIT_BLOCK_FILE EDIT_DIR PATH_SEP_STR "mcedit.block"
|
||||
#define EDIT_TEMP_FILE EDIT_DIR PATH_SEP_STR "mcedit.temp"
|
||||
|
||||
#define EDIT_GLOBAL_MENU "cedit.menu"
|
||||
#define EDIT_GLOBAL_MENU "mcedit.menu"
|
||||
#define EDIT_LOCAL_MENU ".cedit.menu"
|
||||
#define EDIT_HOME_MENU EDIT_DIR PATH_SEP_STR "menu"
|
||||
|
||||
|
120
lib/logging.c
120
lib/logging.c
@ -36,37 +36,99 @@
|
||||
#include "lib/mcconfig.h"
|
||||
#include "lib/fileloc.h"
|
||||
|
||||
#include "src/main.h" /* home_dir */
|
||||
|
||||
#include "logging.h"
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
/*** file scope macro definitions ****************************************************************/
|
||||
|
||||
#define CONFIG_GROUP_NAME "Development"
|
||||
#define CONFIG_KEY_NAME "logging"
|
||||
#define CONFIG_KEY_NAME_FILE "logfile"
|
||||
|
||||
/*** file scope type declarations ****************************************************************/
|
||||
|
||||
/*** file scope variables ************************************************************************/
|
||||
|
||||
static gboolean logging_initialized = FALSE;
|
||||
static gboolean logging_enabled = FALSE;
|
||||
|
||||
/*** file scope functions ************************************************************************/
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
is_logging_enabled_from_env (void)
|
||||
{
|
||||
const char *env_is_enabled;
|
||||
|
||||
env_is_enabled = g_getenv ("MC_LOG_ENABLE");
|
||||
if (env_is_enabled == NULL)
|
||||
return FALSE;
|
||||
|
||||
logging_enabled = (*env_is_enabled == '1' || g_ascii_strcasecmp (env_is_enabled, "true") == 0);
|
||||
logging_initialized = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
is_logging_enabled (void)
|
||||
{
|
||||
static gboolean logging_initialized = FALSE;
|
||||
static gboolean logging_enabled = FALSE;
|
||||
|
||||
if (!logging_initialized)
|
||||
{
|
||||
logging_enabled = mc_config_get_bool (mc_main_config,
|
||||
CONFIG_APP_SECTION, "development.enable_logging",
|
||||
FALSE);
|
||||
logging_initialized = TRUE;
|
||||
}
|
||||
if (logging_initialized)
|
||||
return logging_enabled;
|
||||
|
||||
if (is_logging_enabled_from_env ())
|
||||
return logging_enabled;
|
||||
|
||||
logging_enabled =
|
||||
mc_config_get_bool (mc_main_config, CONFIG_GROUP_NAME, CONFIG_KEY_NAME, FALSE);
|
||||
logging_initialized = TRUE;
|
||||
|
||||
return logging_enabled;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static char *
|
||||
get_log_filename (void)
|
||||
{
|
||||
const char *env_filename;
|
||||
|
||||
env_filename = g_getenv ("MC_LOG_FILE");
|
||||
if (env_filename != NULL)
|
||||
return g_strdup (env_filename);
|
||||
|
||||
if (mc_config_has_param (mc_main_config, CONFIG_GROUP_NAME, CONFIG_KEY_NAME_FILE))
|
||||
return mc_config_get_string (mc_main_config, CONFIG_GROUP_NAME, CONFIG_KEY_NAME_FILE, NULL);
|
||||
|
||||
return g_build_filename (mc_config_get_cache_path (), "mc.log", NULL);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_va_log (const char *fmt, va_list args)
|
||||
{
|
||||
FILE *f;
|
||||
char *logfilename;
|
||||
|
||||
logfilename = get_log_filename ();
|
||||
|
||||
if (logfilename != NULL)
|
||||
{
|
||||
f = fopen (logfilename, "a");
|
||||
if (f != NULL)
|
||||
{
|
||||
(void) vfprintf (f, fmt, args);
|
||||
(void) fclose (f);
|
||||
}
|
||||
g_free (logfilename);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/*** public functions ****************************************************************************/
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -75,25 +137,25 @@ void
|
||||
mc_log (const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
FILE *f;
|
||||
char *logfilename;
|
||||
|
||||
if (is_logging_enabled ())
|
||||
{
|
||||
va_start (args, fmt);
|
||||
logfilename = g_strdup_printf ("%s/%s/log", home_dir, MC_USERCONF_DIR);
|
||||
if (logfilename != NULL)
|
||||
{
|
||||
f = fopen (logfilename, "a");
|
||||
if (f != NULL)
|
||||
{
|
||||
(void) vfprintf (f, fmt, args);
|
||||
(void) fclose (f);
|
||||
}
|
||||
g_free (logfilename);
|
||||
va_end (args);
|
||||
}
|
||||
}
|
||||
if (!is_logging_enabled ())
|
||||
return;
|
||||
|
||||
va_start (args, fmt);
|
||||
mc_va_log (fmt, args);
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_always_log (const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start (args, fmt);
|
||||
mc_va_log (fmt, args);
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -23,6 +23,7 @@
|
||||
/*** declarations of public functions ************************************************************/
|
||||
|
||||
extern void mc_log (const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
|
||||
extern void mc_always_log (const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
#ifndef MC_CONFIG_H
|
||||
#define MC_CONFIG_H
|
||||
|
||||
/*** typedefs(not structures) and defined constants ********************/
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define CONFIG_APP_SECTION "Midnight-Commander"
|
||||
#define CONFIG_PANELS_SECTION "Panels"
|
||||
|
||||
/*** enums *************************************************************/
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
/*** structures declarations (and typedefs of structures)***************/
|
||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||
|
||||
typedef struct mc_config_struct
|
||||
{
|
||||
@ -16,12 +16,12 @@ typedef struct mc_config_struct
|
||||
gchar *ini_path;
|
||||
} mc_config_t;
|
||||
|
||||
/*** global variables defined in .c file *******************************/
|
||||
/*** global variables defined in .c file *********************************************************/
|
||||
|
||||
extern mc_config_t *mc_main_config;
|
||||
extern mc_config_t *mc_panels_config;
|
||||
|
||||
/*** declarations of public functions **********************************/
|
||||
/*** declarations of public functions ************************************************************/
|
||||
|
||||
/* mcconfig/common.c: */
|
||||
|
||||
@ -86,4 +86,26 @@ void mc_config_set_int_list (mc_config_t *, const gchar *, const gchar *, int[],
|
||||
|
||||
void mc_config_show_dialog (void);
|
||||
|
||||
|
||||
/* mcconfig/paths.c: */
|
||||
|
||||
void mc_config_init_config_paths (GError ** error);
|
||||
|
||||
void mc_config_deinit_config_paths (void);
|
||||
|
||||
gboolean mc_config_deprecated_dir_present (void);
|
||||
|
||||
void mc_config_migrate_from_old_place (GError ** error);
|
||||
|
||||
const char *mc_config_get_data_path (void);
|
||||
|
||||
const char *mc_config_get_cache_path (void);
|
||||
|
||||
const char *mc_config_get_path (void);
|
||||
|
||||
const char *mc_config_get_home_dir (void);
|
||||
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
||||
#endif
|
||||
|
@ -4,7 +4,8 @@ noinst_LTLIBRARIES = libmcconfig.la
|
||||
libmcconfig_la_SOURCES = \
|
||||
common.c \
|
||||
get.c \
|
||||
set.c
|
||||
set.c \
|
||||
paths.c
|
||||
|
||||
libmcconfig_la_CFLAGS = -I$(top_srcdir) \
|
||||
$(GLIB_CFLAGS) \
|
||||
|
369
lib/mcconfig/paths.c
Обычный файл
369
lib/mcconfig/paths.c
Обычный файл
@ -0,0 +1,369 @@
|
||||
/*
|
||||
paths to configuration files
|
||||
|
||||
Copyright (C) 2010 The Free Software Foundation, Inc.
|
||||
|
||||
Written by:
|
||||
Slava Zanko <slavazanko@gmail.com>, 2010.
|
||||
|
||||
This file is part of the Midnight Commander.
|
||||
|
||||
The Midnight Commander is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Midnight Commander is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/mcconfig.h"
|
||||
#include "lib/fileloc.h"
|
||||
#include "lib/vfs/mc-vfs/vfs.h"
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
/*** file scope macro definitions ****************************************************************/
|
||||
|
||||
/*** file scope type declarations ****************************************************************/
|
||||
|
||||
/*** file scope variables ************************************************************************/
|
||||
|
||||
static gboolean xdg_vars_initialized = FALSE;
|
||||
static char *xdg_config = NULL;
|
||||
static char *xdg_cache = NULL;
|
||||
static char *xdg_data = NULL;
|
||||
|
||||
static const char *homedir = NULL;
|
||||
|
||||
static gboolean config_dir_present = FALSE;
|
||||
|
||||
static const struct
|
||||
{
|
||||
const char *old_filename;
|
||||
|
||||
char **new_basedir;
|
||||
const char *new_filename;
|
||||
} mc_config_migrate_rules[] =
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
/* config */
|
||||
{ "ini", &xdg_config, MC_CONFIG_FILE},
|
||||
{ "filehighlight.ini", &xdg_config, MC_FHL_INI_FILE},
|
||||
{ "hotlist", &xdg_config, MC_HOTLIST_FILE},
|
||||
{ "mc.keymap", &xdg_config, GLOBAL_KEYMAP_FILE},
|
||||
|
||||
|
||||
/* data */
|
||||
{ "skins", &xdg_data, MC_SKINS_SUBDIR},
|
||||
{ "fish", &xdg_data, FISH_PREFIX},
|
||||
{ "bindings", &xdg_data, MC_FILEBIND_FILE},
|
||||
{ "menu", &xdg_data, MC_USERMENU_FILE},
|
||||
{ "bashrc", &xdg_data, "bashrc"},
|
||||
{ "inputrc", &xdg_data, "inputrc"},
|
||||
{ "extfs.d", &xdg_data, MC_EXTFS_DIR},
|
||||
{ "cedit" PATH_SEP_STR "cooledit.macros", &xdg_data, EDIT_MACRO_FILE},
|
||||
{ "cedit" PATH_SEP_STR "Syntax", &xdg_data, EDIT_SYNTAX_FILE},
|
||||
{ "cedit" PATH_SEP_STR "menu", &xdg_data, EDIT_HOME_MENU},
|
||||
{ "cedit" PATH_SEP_STR "edit.indent.rc", &xdg_data, EDIT_DIR PATH_SEP_STR "edit.indent.rc"},
|
||||
{ "cedit" PATH_SEP_STR "edit.spell.rc", &xdg_data, EDIT_DIR PATH_SEP_STR "edit.spell.rc"},
|
||||
|
||||
/* cache */
|
||||
{ "history", &xdg_cache, MC_HISTORY_FILE},
|
||||
{ "panels.ini", &xdg_cache, MC_PANELS_FILE},
|
||||
{ "log", &xdg_cache, "mc.log"},
|
||||
{ "filepos", &xdg_cache, MC_FILEPOS_FILE},
|
||||
{ "Tree", &xdg_cache, MC_TREESTORE_FILE},
|
||||
{ "cedit" PATH_SEP_STR "cooledit.clip", &xdg_cache, EDIT_CLIP_FILE},
|
||||
{ "cedit" PATH_SEP_STR "cooledit.temp", &xdg_cache, EDIT_TEMP_FILE},
|
||||
{ "cedit" PATH_SEP_STR "cooledit.block", &xdg_cache, EDIT_BLOCK_FILE},
|
||||
|
||||
{NULL, NULL, NULL}
|
||||
/* *INDENT-ON* */
|
||||
};
|
||||
|
||||
/*** file scope functions *********************************************************************** */
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_config_mkdir (const char *directory_name, GError ** error)
|
||||
{
|
||||
if ((!g_file_test (directory_name, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) &&
|
||||
(g_mkdir_with_parents (directory_name, 0700) != 0))
|
||||
{
|
||||
g_propagate_error (error,
|
||||
g_error_new (MC_ERROR, 0, _("Cannot create %s directory"),
|
||||
directory_name));
|
||||
}
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static char *
|
||||
mc_config_init_one_config_path (const char *path_base, const char *subdir, GError ** error)
|
||||
{
|
||||
char *full_path;
|
||||
|
||||
full_path = g_build_filename (path_base, subdir, NULL);
|
||||
|
||||
if (g_file_test (full_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
|
||||
config_dir_present = TRUE;
|
||||
|
||||
mc_config_mkdir (full_path, error);
|
||||
if (error != NULL && *error != NULL)
|
||||
{
|
||||
g_free (full_path);
|
||||
full_path = NULL;
|
||||
}
|
||||
return full_path;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static char *
|
||||
mc_config_get_deprecated_path (void)
|
||||
{
|
||||
return g_build_filename (mc_config_get_home_dir (), "." MC_USERCONF_DIR, NULL);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_config_copy (const char *old_name, const char *new_name, GError ** error)
|
||||
{
|
||||
if (error != NULL && *error != NULL)
|
||||
return;
|
||||
|
||||
if (g_file_test (old_name, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
|
||||
{
|
||||
char *contents = NULL;
|
||||
size_t length;
|
||||
|
||||
if (g_file_get_contents (old_name, &contents, &length, error))
|
||||
g_file_set_contents (new_name, contents, length, error);
|
||||
|
||||
g_free (contents);
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_file_test (old_name, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
|
||||
{
|
||||
|
||||
GDir *dir;
|
||||
const char *dir_name;
|
||||
|
||||
dir = g_dir_open (old_name, 0, error);
|
||||
if (dir == NULL)
|
||||
return;
|
||||
|
||||
if (!g_mkdir_with_parents (new_name, 0700))
|
||||
{
|
||||
g_dir_close (dir);
|
||||
g_propagate_error (error,
|
||||
g_error_new (MC_ERROR, 0,
|
||||
_
|
||||
("An error occured while migrating user settings: %s"),
|
||||
g_strerror (errno)));
|
||||
return;
|
||||
}
|
||||
|
||||
while ((dir_name = g_dir_read_name (dir)) != NULL)
|
||||
{
|
||||
char *old_name2, *new_name2;
|
||||
old_name2 = g_build_filename (old_name, dir_name, NULL);
|
||||
new_name2 = g_build_filename (new_name, dir_name, NULL);
|
||||
mc_config_copy (old_name2, new_name2, error);
|
||||
g_free (new_name2);
|
||||
g_free (old_name2);
|
||||
}
|
||||
}
|
||||
|
||||
if (rename (old_name, new_name) != 0)
|
||||
{
|
||||
g_propagate_error (error,
|
||||
g_error_new (MC_ERROR, 0,
|
||||
_
|
||||
("An error occured while migrating user settings: %s"),
|
||||
g_strerror (errno)));
|
||||
}
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/*** public functions ****************************************************************************/
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_init_config_paths (GError ** error)
|
||||
{
|
||||
char *u_config_dir = (char *) g_get_user_config_dir ();
|
||||
char *u_data_dir = (char *) g_get_user_data_dir ();
|
||||
char *u_cache_dir = (char *) g_get_user_cache_dir ();
|
||||
|
||||
if (xdg_vars_initialized)
|
||||
return;
|
||||
|
||||
u_config_dir = (u_config_dir == NULL)
|
||||
? g_build_filename (mc_config_get_home_dir (), ".config", NULL) : g_strdup (u_config_dir);
|
||||
|
||||
u_cache_dir = (u_cache_dir == NULL)
|
||||
? g_build_filename (mc_config_get_home_dir (), ".cache", NULL) : g_strdup (u_cache_dir);
|
||||
|
||||
u_data_dir = (u_data_dir == NULL)
|
||||
? g_build_filename (mc_config_get_home_dir (), ".local", "share", NULL)
|
||||
: g_strdup (u_data_dir);
|
||||
|
||||
xdg_config = mc_config_init_one_config_path (u_config_dir, MC_USERCONF_DIR, error);
|
||||
xdg_cache = mc_config_init_one_config_path (u_cache_dir, MC_USERCONF_DIR, error);
|
||||
xdg_data = mc_config_init_one_config_path (u_data_dir, MC_USERCONF_DIR, error);
|
||||
|
||||
g_free (u_data_dir);
|
||||
g_free (u_cache_dir);
|
||||
g_free (u_config_dir);
|
||||
xdg_vars_initialized = TRUE;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_deinit_config_paths (void)
|
||||
{
|
||||
if (!xdg_vars_initialized)
|
||||
return;
|
||||
|
||||
g_free (xdg_config);
|
||||
g_free (xdg_cache);
|
||||
g_free (xdg_data);
|
||||
|
||||
xdg_vars_initialized = FALSE;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
const char *
|
||||
mc_config_get_data_path (void)
|
||||
{
|
||||
if (!xdg_vars_initialized)
|
||||
mc_config_init_config_paths (NULL);
|
||||
|
||||
return (const char *) xdg_data;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
const char *
|
||||
mc_config_get_cache_path (void)
|
||||
{
|
||||
if (!xdg_vars_initialized)
|
||||
mc_config_init_config_paths (NULL);
|
||||
|
||||
return (const char *) xdg_cache;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
const char *
|
||||
mc_config_get_home_dir (void)
|
||||
{
|
||||
if (homedir == NULL)
|
||||
{
|
||||
homedir = g_getenv ("HOME");
|
||||
if (homedir == NULL)
|
||||
homedir = g_get_home_dir ();
|
||||
}
|
||||
return homedir;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
const char *
|
||||
mc_config_get_path (void)
|
||||
{
|
||||
if (!xdg_vars_initialized)
|
||||
mc_config_init_config_paths (NULL);
|
||||
|
||||
return (const char *) xdg_config;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_migrate_from_old_place (GError ** error)
|
||||
{
|
||||
char *old_dir, *tmp_dir_name;
|
||||
size_t rule_index;
|
||||
|
||||
old_dir = mc_config_get_deprecated_path ();
|
||||
|
||||
tmp_dir_name = mc_config_init_one_config_path (xdg_config, EDIT_DIR, error);
|
||||
g_free (tmp_dir_name);
|
||||
tmp_dir_name = mc_config_init_one_config_path (xdg_cache, EDIT_DIR, error);
|
||||
g_free (tmp_dir_name);
|
||||
tmp_dir_name = mc_config_init_one_config_path (xdg_data, EDIT_DIR, error);
|
||||
g_free (tmp_dir_name);
|
||||
|
||||
for (rule_index = 0; mc_config_migrate_rules[rule_index].old_filename != NULL; rule_index++)
|
||||
{
|
||||
char *old_name, *new_name;
|
||||
|
||||
old_name =
|
||||
g_build_filename (old_dir, mc_config_migrate_rules[rule_index].old_filename, NULL);
|
||||
|
||||
if (!g_file_test (old_name, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
g_free (old_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
new_name = g_build_filename (*mc_config_migrate_rules[rule_index].new_basedir,
|
||||
mc_config_migrate_rules[rule_index].new_filename, NULL);
|
||||
|
||||
mc_config_copy (old_name, new_name, error);
|
||||
|
||||
g_free (new_name);
|
||||
g_free (old_name);
|
||||
}
|
||||
/*
|
||||
{
|
||||
char *old_dir2;
|
||||
old_dir2 = g_strconcat (old_dir, "~", NULL);
|
||||
rename (old_dir, old_dir2);
|
||||
g_free (old_dir2);
|
||||
}
|
||||
*/
|
||||
g_propagate_error (error,
|
||||
g_error_new (MC_ERROR, 0,
|
||||
_
|
||||
("Your old settings were migrated from %s\n"
|
||||
"to Freedesktop recommended dirs.\n"
|
||||
"To get more info, please visit\n"
|
||||
"http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html"),
|
||||
old_dir));
|
||||
|
||||
g_free (old_dir);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_config_deprecated_dir_present (void)
|
||||
{
|
||||
char *old_dir = mc_config_get_deprecated_path ();
|
||||
gboolean is_present = g_file_test (old_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR);
|
||||
g_free (old_dir);
|
||||
return is_present && !config_dir_present;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
@ -81,8 +81,7 @@ mc_skin_ini_file_load_search_in_dir (mc_skin_t * mc_skin, const gchar * base_dir
|
||||
gboolean
|
||||
mc_skin_ini_file_load (mc_skin_t * mc_skin)
|
||||
{
|
||||
char *file_name, *user_home_dir;
|
||||
gboolean ok;
|
||||
char *file_name;
|
||||
|
||||
file_name = g_path_get_basename (mc_skin->name);
|
||||
if (file_name == NULL)
|
||||
@ -98,19 +97,16 @@ mc_skin_ini_file_load (mc_skin_t * mc_skin)
|
||||
}
|
||||
g_free (file_name);
|
||||
|
||||
/* ~/.mc/skins/ */
|
||||
user_home_dir = g_build_filename (home_dir, MC_USERCONF_DIR, (char *) NULL);
|
||||
ok = mc_skin_ini_file_load_search_in_dir (mc_skin, user_home_dir);
|
||||
g_free (user_home_dir);
|
||||
if (ok)
|
||||
/* ${XDG_DATA_HOME}/mc/skins/ */
|
||||
if (mc_skin_ini_file_load_search_in_dir (mc_skin, mc_config_get_data_path ()))
|
||||
return TRUE;
|
||||
|
||||
/* /etc/mc/skins/ */
|
||||
if (mc_skin_ini_file_load_search_in_dir (mc_skin, mc_home))
|
||||
if (mc_skin_ini_file_load_search_in_dir (mc_skin, mc_sysconfig_dir))
|
||||
return TRUE;
|
||||
|
||||
/* /usr/share/mc/skins/ */
|
||||
return mc_skin_ini_file_load_search_in_dir (mc_skin, mc_home_alt);
|
||||
return mc_skin_ini_file_load_search_in_dir (mc_skin, mc_share_data_dir);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
13
lib/util.c
13
lib/util.c
@ -50,7 +50,7 @@
|
||||
|
||||
#include "src/filemanager/filegui.h"
|
||||
#include "src/filemanager/file.h" /* copy_file_file() */
|
||||
#include "src/main.h" /* home_dir, eight_bit_clean */
|
||||
#include "src/main.h" /* eight_bit_clean */
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
@ -392,8 +392,7 @@ void
|
||||
size_trunc_len (char *buffer, unsigned int len, uintmax_t size, int units, gboolean use_si)
|
||||
{
|
||||
/* Avoid taking power for every file. */
|
||||
static const uintmax_t power10[] =
|
||||
{
|
||||
static const uintmax_t power10[] = {
|
||||
1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000
|
||||
};
|
||||
static const char *const suffix[] = { "", "K", "M", "G", "T", "P", "E", "Z", "Y", NULL };
|
||||
@ -585,8 +584,8 @@ strip_home_and_password (const char *dir)
|
||||
size_t len;
|
||||
static char newdir[MC_MAXPATHLEN];
|
||||
|
||||
len = strlen (home_dir);
|
||||
if (home_dir != NULL && strncmp (dir, home_dir, len) == 0 &&
|
||||
len = strlen (mc_config_get_home_dir ());
|
||||
if (mc_config_get_home_dir () != NULL && strncmp (dir, mc_config_get_home_dir (), len) == 0 &&
|
||||
(dir[len] == PATH_SEP || dir[len] == '\0'))
|
||||
{
|
||||
newdir[0] = '~';
|
||||
@ -1229,7 +1228,7 @@ load_file_position (const char *filename, long *line, long *column, off_t * offs
|
||||
*offset = 0;
|
||||
|
||||
/* open file with positions */
|
||||
fn = g_build_filename (home_dir, MC_USERCONF_DIR, MC_FILEPOS_FILE, NULL);
|
||||
fn = g_build_filename (mc_config_get_cache_path (), MC_FILEPOS_FILE, NULL);
|
||||
f = fopen (fn, "r");
|
||||
g_free (fn);
|
||||
if (f == NULL)
|
||||
@ -1319,7 +1318,7 @@ save_file_position (const char *filename, long line, long column, off_t offset,
|
||||
filepos_max_saved_entries = mc_config_get_int (mc_main_config, CONFIG_APP_SECTION,
|
||||
"filepos_max_saved_entries", 1024);
|
||||
|
||||
fn = g_build_filename (home_dir, MC_USERCONF_DIR, MC_FILEPOS_FILE, NULL);
|
||||
fn = g_build_filename (mc_config_get_cache_path (), MC_FILEPOS_FILE, NULL);
|
||||
if (fn == NULL)
|
||||
goto early_error;
|
||||
|
||||
|
@ -48,6 +48,7 @@
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/fileloc.h"
|
||||
#include "lib/mcconfig.h"
|
||||
#include "lib/util.h"
|
||||
#include "lib/widget.h" /* message() */
|
||||
|
||||
@ -1630,14 +1631,11 @@ static int
|
||||
extfs_init (struct vfs_class *me)
|
||||
{
|
||||
gboolean d1, d2;
|
||||
char *dirname;
|
||||
|
||||
(void) me;
|
||||
|
||||
/* 1st: scan user directory */
|
||||
dirname = g_build_path (PATH_SEP_STR, home_dir, MC_USERCONF_DIR, (char *) NULL);
|
||||
d1 = extfs_get_plugins (dirname, TRUE); /* silent about user dir */
|
||||
g_free (dirname);
|
||||
d1 = extfs_get_plugins (mc_config_get_data_path (), TRUE); /* silent about user dir */
|
||||
/* 2nd: scan system dir */
|
||||
d2 = extfs_get_plugins (LIBEXECDIR, d1);
|
||||
|
||||
|
@ -61,6 +61,7 @@
|
||||
#include "lib/strescape.h"
|
||||
#include "lib/unixcompat.h"
|
||||
#include "lib/fileloc.h"
|
||||
#include "lib/mcconfig.h"
|
||||
|
||||
#include "src/filemanager/layout.h" /* print_vfs_message */
|
||||
#include "src/execute.h" /* pre_exec, post_exec */
|
||||
@ -149,7 +150,7 @@ fish_load_script_from_file (const char *hostname, const char *script_name, const
|
||||
gsize scr_len = 0;
|
||||
|
||||
/* 1st: scan user directory */
|
||||
scr_filename = g_build_path (PATH_SEP_STR, home_dir, MC_USERCONF_DIR, FISH_PREFIX, hostname,
|
||||
scr_filename = g_build_path (PATH_SEP_STR, mc_config_get_data_path (), FISH_PREFIX, hostname,
|
||||
script_name, (char *) NULL);
|
||||
/* silent about user dir */
|
||||
g_file_get_contents (scr_filename, &scr_content, &scr_len, NULL);
|
||||
|
@ -88,6 +88,7 @@ What to do with this?
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/util.h"
|
||||
#include "lib/mcconfig.h"
|
||||
|
||||
#include "lib/tty/tty.h" /* enable/disable interrupt key */
|
||||
#include "lib/widget.h" /* message() */
|
||||
@ -666,7 +667,7 @@ ftpfs_load_no_proxy_list (void)
|
||||
if (mc_file)
|
||||
return;
|
||||
|
||||
mc_file = concat_dir_and_file (mc_home, "mc.no_proxy");
|
||||
mc_file = concat_dir_and_file (mc_sysconfig_dir, "mc.no_proxy");
|
||||
if (exist_file (mc_file))
|
||||
{
|
||||
npf = fopen (mc_file, "r");
|
||||
@ -1827,7 +1828,7 @@ ftpfs_file_store (struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *l
|
||||
w_buf += n_written;
|
||||
n_read -= n_written;
|
||||
}
|
||||
print_vfs_message ("%s: %" PRIuMAX "/%" PRIuMAX,
|
||||
print_vfs_message ("%s: %" PRIuMAX "/%" PRIuMAX,
|
||||
_("ftpfs: storing file"), (uintmax_t) n_stored, (uintmax_t) s.st_size);
|
||||
}
|
||||
tty_disable_interrupt_key ();
|
||||
@ -2388,7 +2389,7 @@ ftpfs_netrc_lookup (const char *host, char **login, char **pass)
|
||||
}
|
||||
|
||||
/* Load current .netrc */
|
||||
netrcname = g_build_filename (home_dir, ".netrc", (char *) NULL);
|
||||
netrcname = g_build_filename (mc_config_get_home_dir (), ".netrc", (char *) NULL);
|
||||
if (!g_file_get_contents (netrcname, &netrc, NULL, NULL))
|
||||
{
|
||||
g_free (netrcname);
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include "lib/util.h"
|
||||
#include "lib/widget.h" /* D_ERROR, D_NORMAL */
|
||||
|
||||
#include "src/main.h" /* mc_home */
|
||||
#include "src/main.h" /* mc_sysconfig_dir */
|
||||
#include "src/execute.h" /* EXECUTE_AS_SHELL */
|
||||
|
||||
#include "vfs-impl.h"
|
||||
@ -415,7 +415,7 @@ sfs_init (struct vfs_class *me)
|
||||
|
||||
(void) me;
|
||||
|
||||
mc_sfsini = g_build_filename (mc_home, "sfs.ini", (char *) NULL);
|
||||
mc_sfsini = g_build_filename (mc_sysconfig_dir, "sfs.ini", (char *) NULL);
|
||||
cfg = fopen (mc_sfsini, "r");
|
||||
|
||||
if (cfg == NULL)
|
||||
|
@ -154,7 +154,7 @@ history_get (const char *input_name)
|
||||
if ((input_name == NULL) || (*input_name == '\0'))
|
||||
return NULL;
|
||||
|
||||
profile = g_build_filename (home_dir, MC_USERCONF_DIR, MC_HISTORY_FILE, NULL);
|
||||
profile = g_build_filename (mc_config_get_cache_path (), MC_HISTORY_FILE, NULL);
|
||||
cfg = mc_config_init (profile);
|
||||
|
||||
/* get number of keys */
|
||||
@ -209,7 +209,7 @@ history_get (const char *input_name)
|
||||
/*
|
||||
This saves the history of an input line from the widget. It is called
|
||||
with the widgets history name. It stores histories in the file
|
||||
~/.mc/history in using the profile code.
|
||||
${XDG_CACHE_HOME}/mc/history in using the profile code.
|
||||
*/
|
||||
void
|
||||
history_put (const char *input_name, GList * h)
|
||||
@ -227,7 +227,7 @@ history_put (const char *input_name, GList * h)
|
||||
if (h == NULL)
|
||||
return;
|
||||
|
||||
profile = g_build_filename (home_dir, MC_USERCONF_DIR, MC_HISTORY_FILE, NULL);
|
||||
profile = g_build_filename (mc_config_get_cache_path (), MC_HISTORY_FILE, NULL);
|
||||
|
||||
i = open (profile, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
|
||||
if (i != -1)
|
||||
|
@ -53,7 +53,7 @@
|
||||
#include "src/main.h" /* home_dir */
|
||||
#include "src/filemanager/midnight.h" /* current_panel */
|
||||
#include "src/clipboard.h" /* copy_file_to_ext_clip, paste_to_file_from_ext_clip */
|
||||
#include "src/keybind-defaults.h" /* input_map */
|
||||
#include "src/keybind-defaults.h" /* input_map */
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
@ -91,7 +91,7 @@ save_text_to_clip_file (const char *text)
|
||||
ssize_t ret;
|
||||
size_t str_len;
|
||||
|
||||
fname = g_build_filename (home_dir, EDIT_CLIP_FILE, NULL);
|
||||
fname = g_build_filename (mc_config_get_cache_path (), EDIT_CLIP_FILE, NULL);
|
||||
file = mc_open (fname, O_CREAT | O_WRONLY | O_TRUNC,
|
||||
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH | O_BINARY);
|
||||
g_free (fname);
|
||||
@ -115,7 +115,7 @@ load_text_from_clip_file (char **text)
|
||||
char *fname = NULL;
|
||||
gboolean first = TRUE;
|
||||
|
||||
fname = g_build_filename (home_dir, EDIT_CLIP_FILE, NULL);
|
||||
fname = g_build_filename (mc_config_get_cache_path (), EDIT_CLIP_FILE, NULL);
|
||||
f = fopen (fname, "r");
|
||||
g_free (fname);
|
||||
|
||||
|
@ -13,7 +13,7 @@ pkgdata_DATA += mc.charsets
|
||||
endif
|
||||
|
||||
LIBFILES_CONST = \
|
||||
cedit.menu \
|
||||
mcedit.menu \
|
||||
edit.indent.rc \
|
||||
edit.spell.rc \
|
||||
filehighlight.ini \
|
||||
|
@ -567,7 +567,7 @@ mc_args_process (int argc, char *argv[])
|
||||
}
|
||||
if (mc_args__show_datadirs)
|
||||
{
|
||||
printf ("%s (%s)\n", mc_home, mc_home_alt);
|
||||
printf ("%s (%s)\n", mc_sysconfig_dir, mc_share_data_dir);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/fileloc.h"
|
||||
#include "lib/mcconfig.h"
|
||||
#include "lib/util.h"
|
||||
|
||||
#include "main.h"
|
||||
@ -67,7 +68,7 @@ copy_file_to_ext_clip (void)
|
||||
if (d == NULL || clipboard_store_path == NULL || clipboard_store_path[0] == '\0')
|
||||
return FALSE;
|
||||
|
||||
tmp = concat_dir_and_file (home_dir, EDIT_CLIP_FILE);
|
||||
tmp = concat_dir_and_file (mc_config_get_cache_path (), EDIT_CLIP_FILE);
|
||||
cmd = g_strconcat (clipboard_store_path, " ", tmp, " 2>/dev/null", (char *) NULL);
|
||||
|
||||
if (cmd != NULL)
|
||||
@ -90,7 +91,7 @@ paste_to_file_from_ext_clip (void)
|
||||
if (d == NULL || clipboard_paste_path == NULL || clipboard_paste_path[0] == '\0')
|
||||
return FALSE;
|
||||
|
||||
tmp = concat_dir_and_file (home_dir, EDIT_CLIP_FILE);
|
||||
tmp = concat_dir_and_file (mc_config_get_cache_path (), EDIT_CLIP_FILE);
|
||||
cmd = g_strconcat (clipboard_paste_path, " > ", tmp, " 2>/dev/null", (char *) NULL);
|
||||
|
||||
if (cmd != NULL)
|
||||
|
@ -57,7 +57,7 @@
|
||||
#endif
|
||||
|
||||
#include "src/filemanager/cmd.h" /* view_other_cmd() */
|
||||
#include "src/filemanager/usermenu.h" /* user_menu_cmd() */
|
||||
#include "src/filemanager/usermenu.h" /* user_menu_cmd() */
|
||||
|
||||
#include "src/main.h" /* source_codepage */
|
||||
#include "src/setup.h" /* option_tab_spacing */
|
||||
@ -1678,7 +1678,7 @@ user_menu (WEdit * edit)
|
||||
long start_mark, end_mark;
|
||||
struct stat status;
|
||||
|
||||
block_file = concat_dir_and_file (home_dir, EDIT_BLOCK_FILE);
|
||||
block_file = concat_dir_and_file (mc_config_get_cache_path (), EDIT_BLOCK_FILE);
|
||||
|
||||
nomark = eval_marks (edit, &start_mark, &end_mark);
|
||||
if (nomark == 0)
|
||||
|
@ -60,7 +60,7 @@
|
||||
#include "src/filemanager/layout.h" /* clr_scr() */
|
||||
|
||||
#include "src/history.h"
|
||||
#include "src/main.h" /* mc_home, midnight_shutdown */
|
||||
#include "src/main.h" /* mc_sysconfig_dir, midnight_shutdown */
|
||||
#include "src/setup.h" /* option_tab_spacing */
|
||||
#include "src/help.h" /* interactive_display() */
|
||||
#include "src/selcodepage.h"
|
||||
@ -456,7 +456,7 @@ edit_open_macro_file (const char *r)
|
||||
gchar *filename;
|
||||
FILE *fd;
|
||||
int file;
|
||||
filename = concat_dir_and_file (home_dir, EDIT_MACRO_FILE);
|
||||
filename = concat_dir_and_file (mc_config_get_data_path (), EDIT_MACRO_FILE);
|
||||
file = open (filename, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
if (file == -1)
|
||||
{
|
||||
@ -508,7 +508,7 @@ edit_delete_macro (WEdit * edit, int k)
|
||||
if (j < 0)
|
||||
return 0;
|
||||
}
|
||||
tmp = concat_dir_and_file (home_dir, EDIT_TEMP_FILE);
|
||||
tmp = concat_dir_and_file (mc_config_get_cache_path (), EDIT_TEMP_FILE);
|
||||
g = fopen (tmp, "w");
|
||||
g_free (tmp);
|
||||
if (!g)
|
||||
@ -545,8 +545,8 @@ edit_delete_macro (WEdit * edit, int k)
|
||||
}
|
||||
fclose (f);
|
||||
fclose (g);
|
||||
tmp = concat_dir_and_file (home_dir, EDIT_TEMP_FILE);
|
||||
tmp2 = concat_dir_and_file (home_dir, EDIT_MACRO_FILE);
|
||||
tmp = concat_dir_and_file (mc_config_get_cache_path (), EDIT_TEMP_FILE);
|
||||
tmp2 = concat_dir_and_file (mc_config_get_data_path (), EDIT_MACRO_FILE);
|
||||
if (rename (tmp, tmp2) == -1)
|
||||
{
|
||||
edit_error_dialog (_("Delete macro"), get_sys_error (_("Cannot overwrite macro file")));
|
||||
@ -635,18 +635,18 @@ edit_load_syntax_file (WEdit * edit)
|
||||
_("&User"), _("&System Wide"));
|
||||
}
|
||||
|
||||
extdir = g_build_filename (mc_home, "syntax", "Syntax", (char *) NULL);
|
||||
extdir = g_build_filename (mc_sysconfig_dir, "syntax", "Syntax", (char *) NULL);
|
||||
if (!exist_file (extdir))
|
||||
{
|
||||
g_free (extdir);
|
||||
extdir = g_build_filename (mc_home_alt, "syntax", "Syntax", (char *) NULL);
|
||||
extdir = g_build_filename (mc_share_data_dir, "syntax", "Syntax", (char *) NULL);
|
||||
}
|
||||
|
||||
if (dir == 0)
|
||||
{
|
||||
char *buffer;
|
||||
|
||||
buffer = concat_dir_and_file (home_dir, EDIT_SYNTAX_FILE);
|
||||
buffer = concat_dir_and_file (mc_config_get_data_path (), EDIT_SYNTAX_FILE);
|
||||
check_for_default (extdir, buffer);
|
||||
edit_load_file_from_filename (edit, buffer);
|
||||
g_free (buffer);
|
||||
@ -670,12 +670,12 @@ edit_load_menu_file (WEdit * edit)
|
||||
_("Which menu file do you want to edit?"), D_NORMAL,
|
||||
geteuid () != 0 ? 2 : 3, _("&Local"), _("&User"), _("&System Wide"));
|
||||
|
||||
menufile = concat_dir_and_file (mc_home, EDIT_GLOBAL_MENU);
|
||||
menufile = concat_dir_and_file (mc_sysconfig_dir, EDIT_GLOBAL_MENU);
|
||||
|
||||
if (!exist_file (menufile))
|
||||
{
|
||||
g_free (menufile);
|
||||
menufile = concat_dir_and_file (mc_home_alt, EDIT_GLOBAL_MENU);
|
||||
menufile = concat_dir_and_file (mc_share_data_dir, EDIT_GLOBAL_MENU);
|
||||
}
|
||||
|
||||
switch (dir)
|
||||
@ -687,16 +687,16 @@ edit_load_menu_file (WEdit * edit)
|
||||
break;
|
||||
|
||||
case 1:
|
||||
buffer = concat_dir_and_file (home_dir, EDIT_HOME_MENU);
|
||||
buffer = concat_dir_and_file (mc_config_get_data_path (), EDIT_HOME_MENU);
|
||||
check_for_default (menufile, buffer);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
buffer = concat_dir_and_file (mc_home, EDIT_GLOBAL_MENU);
|
||||
buffer = concat_dir_and_file (mc_sysconfig_dir, EDIT_GLOBAL_MENU);
|
||||
if (!exist_file (buffer))
|
||||
{
|
||||
g_free (buffer);
|
||||
buffer = concat_dir_and_file (mc_home_alt, EDIT_GLOBAL_MENU);
|
||||
buffer = concat_dir_and_file (mc_share_data_dir, EDIT_GLOBAL_MENU);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1007,7 +1007,7 @@ edit_do_search (WEdit * edit)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_search (WEdit *edit)
|
||||
edit_search (WEdit * edit)
|
||||
{
|
||||
if (editcmd_dialog_search_show (edit))
|
||||
edit_do_search (edit);
|
||||
@ -1058,7 +1058,7 @@ edit_save_block_to_clip_file (WEdit * edit, long start, long finish)
|
||||
{
|
||||
int ret;
|
||||
gchar *tmp;
|
||||
tmp = concat_dir_and_file (home_dir, EDIT_CLIP_FILE);
|
||||
tmp = concat_dir_and_file (mc_config_get_cache_path (), EDIT_CLIP_FILE);
|
||||
ret = edit_save_block (edit, tmp, start, finish);
|
||||
g_free (tmp);
|
||||
return ret;
|
||||
@ -1741,7 +1741,7 @@ eval_marks (WEdit * edit, long *start_mark, long *end_mark)
|
||||
}
|
||||
|
||||
if (edit->column_highlight
|
||||
&& (((edit->mark1 > end_mark_curs) && (edit->column1 < edit->column2))
|
||||
&& (((edit->mark1 > end_mark_curs) && (edit->column1 < edit->column2))
|
||||
|| ((edit->mark1 < end_mark_curs) && (edit->column1 > edit->column2))))
|
||||
{
|
||||
start_bol = edit_bol (edit, *start_mark);
|
||||
@ -2500,7 +2500,7 @@ edit_paste_from_X_buf_cmd (WEdit * edit)
|
||||
gchar *tmp;
|
||||
/* try use external clipboard utility */
|
||||
paste_to_file_from_ext_clip ();
|
||||
tmp = concat_dir_and_file (home_dir, EDIT_CLIP_FILE);
|
||||
tmp = concat_dir_and_file (mc_config_get_cache_path (), EDIT_CLIP_FILE);
|
||||
edit_insert_file (edit, tmp);
|
||||
g_free (tmp);
|
||||
}
|
||||
@ -2561,7 +2561,7 @@ edit_save_block_cmd (WEdit * edit)
|
||||
if (eval_marks (edit, &start_mark, &end_mark))
|
||||
return 1;
|
||||
|
||||
tmp = concat_dir_and_file (home_dir, EDIT_CLIP_FILE);
|
||||
tmp = concat_dir_and_file (mc_config_get_cache_path (), EDIT_CLIP_FILE);
|
||||
exp =
|
||||
input_expand_dialog (_("Save block"), _("Enter file name:"),
|
||||
MC_HISTORY_EDIT_SAVE_BLOCK, tmp);
|
||||
@ -2603,7 +2603,7 @@ edit_insert_file_cmd (WEdit * edit)
|
||||
gchar *tmp;
|
||||
char *exp;
|
||||
|
||||
tmp = concat_dir_and_file (home_dir, EDIT_CLIP_FILE);
|
||||
tmp = concat_dir_and_file (mc_config_get_cache_path (), EDIT_CLIP_FILE);
|
||||
exp = input_expand_dialog (_("Insert file"), _("Enter file name:"),
|
||||
MC_HISTORY_EDIT_INSERT_FILE, tmp);
|
||||
g_free (tmp);
|
||||
@ -2651,7 +2651,7 @@ edit_sort_cmd (WEdit * edit)
|
||||
return 0;
|
||||
}
|
||||
|
||||
tmp = concat_dir_and_file (home_dir, EDIT_BLOCK_FILE);
|
||||
tmp = concat_dir_and_file (mc_config_get_cache_path (), EDIT_BLOCK_FILE);
|
||||
edit_save_block (edit, tmp, start_mark, end_mark);
|
||||
g_free (tmp);
|
||||
|
||||
@ -2663,8 +2663,10 @@ edit_sort_cmd (WEdit * edit)
|
||||
return 1;
|
||||
g_free (old);
|
||||
old = exp;
|
||||
tmp = g_strconcat (" sort ", exp, " ", home_dir, PATH_SEP_STR EDIT_BLOCK_FILE, " > ",
|
||||
home_dir, PATH_SEP_STR EDIT_TEMP_FILE, (char *) NULL);
|
||||
tmp =
|
||||
g_strconcat (" sort ", exp, " ", mc_config_get_cache_path (), PATH_SEP_STR EDIT_BLOCK_FILE,
|
||||
" > ", mc_config_get_cache_path (), PATH_SEP_STR EDIT_TEMP_FILE,
|
||||
(char *) NULL);
|
||||
e = system (tmp);
|
||||
g_free (tmp);
|
||||
if (e)
|
||||
@ -2688,7 +2690,7 @@ edit_sort_cmd (WEdit * edit)
|
||||
|
||||
if (edit_block_delete_cmd (edit))
|
||||
return 1;
|
||||
tmp = concat_dir_and_file (home_dir, EDIT_TEMP_FILE);
|
||||
tmp = concat_dir_and_file (mc_config_get_cache_path (), EDIT_TEMP_FILE);
|
||||
edit_insert_file (edit, tmp);
|
||||
g_free (tmp);
|
||||
return 0;
|
||||
@ -2713,7 +2715,9 @@ edit_ext_cmd (WEdit * edit)
|
||||
if (!exp)
|
||||
return 1;
|
||||
|
||||
tmp = g_strconcat (exp, " > ", home_dir, PATH_SEP_STR EDIT_TEMP_FILE, (char *) NULL);
|
||||
tmp =
|
||||
g_strconcat (exp, " > ", mc_config_get_cache_path (), PATH_SEP_STR EDIT_TEMP_FILE,
|
||||
(char *) NULL);
|
||||
e = system (tmp);
|
||||
g_free (tmp);
|
||||
g_free (exp);
|
||||
@ -2725,7 +2729,7 @@ edit_ext_cmd (WEdit * edit)
|
||||
}
|
||||
|
||||
edit->force |= REDRAW_COMPLETELY;
|
||||
tmp = concat_dir_and_file (home_dir, EDIT_TEMP_FILE);
|
||||
tmp = concat_dir_and_file (mc_config_get_cache_path (), EDIT_TEMP_FILE);
|
||||
edit_insert_file (edit, tmp);
|
||||
g_free (tmp);
|
||||
return 0;
|
||||
@ -2746,9 +2750,9 @@ edit_block_process_cmd (WEdit * edit, const char *shell_cmd, int block)
|
||||
gchar *o, *h, *b, *tmp;
|
||||
char *quoted_name = NULL;
|
||||
|
||||
o = g_strconcat (mc_home, shell_cmd, (char *) NULL); /* original source script */
|
||||
h = g_strconcat (home_dir, PATH_SEP_STR EDIT_DIR, shell_cmd, (char *) NULL); /* home script */
|
||||
b = concat_dir_and_file (home_dir, EDIT_BLOCK_FILE); /* block file */
|
||||
o = g_strconcat (mc_sysconfig_dir, shell_cmd, (char *) NULL); /* original source script */
|
||||
h = g_strconcat (mc_config_get_data_path (), PATH_SEP_STR EDIT_DIR, shell_cmd, (char *) NULL); /* home script */
|
||||
b = concat_dir_and_file (mc_config_get_cache_path (), EDIT_BLOCK_FILE); /* block file */
|
||||
|
||||
script_home = fopen (h, "r");
|
||||
if (script_home == NULL)
|
||||
@ -2767,7 +2771,7 @@ edit_block_process_cmd (WEdit * edit, const char *shell_cmd, int block)
|
||||
script_src = fopen (o, "r");
|
||||
if (script_src == NULL)
|
||||
{
|
||||
o = g_strconcat (mc_home_alt, shell_cmd, (char *) NULL);
|
||||
o = g_strconcat (mc_share_data_dir, shell_cmd, (char *) NULL);
|
||||
script_src = fopen (o, "r");
|
||||
if (script_src == NULL)
|
||||
{
|
||||
@ -2816,8 +2820,10 @@ edit_block_process_cmd (WEdit * edit, const char *shell_cmd, int block)
|
||||
* $3 - file where error messages should be put
|
||||
* (for compatibility with old scripts).
|
||||
*/
|
||||
tmp = g_strconcat (" ", home_dir, PATH_SEP_STR EDIT_DIR, shell_cmd, " ", quoted_name,
|
||||
" ", home_dir, PATH_SEP_STR EDIT_BLOCK_FILE " /dev/null", (char *) NULL);
|
||||
tmp =
|
||||
g_strconcat (" ", mc_config_get_cache_path (), PATH_SEP_STR EDIT_DIR, shell_cmd, " ",
|
||||
quoted_name, " ", mc_config_get_cache_path (),
|
||||
PATH_SEP_STR EDIT_BLOCK_FILE " /dev/null", (char *) NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2826,7 +2832,7 @@ edit_block_process_cmd (WEdit * edit, const char *shell_cmd, int block)
|
||||
* Arguments:
|
||||
* $1 - name of the edited file.
|
||||
*/
|
||||
tmp = g_strconcat (" ", home_dir, PATH_SEP_STR EDIT_DIR, shell_cmd, " ",
|
||||
tmp = g_strconcat (" ", mc_config_get_cache_path (), PATH_SEP_STR EDIT_DIR, shell_cmd, " ",
|
||||
quoted_name, (char *) NULL);
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include "lib/strutil.h" /* str_term_trim() */
|
||||
#include "lib/util.h" /* concat_dir_and_file() */
|
||||
#include "lib/widget.h"
|
||||
#include "lib/mcconfig.h"
|
||||
|
||||
#include "src/keybind-defaults.h"
|
||||
#include "src/main.h" /* home_dir */
|
||||
@ -265,7 +266,7 @@ edit_dialog_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, vo
|
||||
return MSG_HANDLED;
|
||||
|
||||
case DLG_VALIDATE:
|
||||
h->state = DLG_ACTIVE; /* don't stop the dialog before final decision */
|
||||
h->state = DLG_ACTIVE; /* don't stop the dialog before final decision */
|
||||
if (edit_ok_to_exit (edit))
|
||||
h->state = DLG_CLOSED;
|
||||
return MSG_HANDLED;
|
||||
@ -345,7 +346,15 @@ edit_file (const char *_file, int line)
|
||||
|
||||
if (!made_directory)
|
||||
{
|
||||
char *dir = concat_dir_and_file (home_dir, EDIT_DIR);
|
||||
char *dir = concat_dir_and_file (mc_config_get_cache_path (), EDIT_DIR);
|
||||
made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST);
|
||||
g_free (dir);
|
||||
|
||||
dir = concat_dir_and_file (mc_config_get_path (), EDIT_DIR);
|
||||
made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST);
|
||||
g_free (dir);
|
||||
|
||||
dir = concat_dir_and_file (mc_config_get_data_path (), EDIT_DIR);
|
||||
made_directory = (mkdir (dir, 0700) != -1 || errno == EEXIST);
|
||||
g_free (dir);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@
|
||||
#include "lib/util.h"
|
||||
#include "lib/widget.h" /* message() */
|
||||
|
||||
#include "src/main.h" /* mc_home */
|
||||
#include "src/main.h" /* mc_sysconfig_dir */
|
||||
|
||||
#include "edit-impl.h"
|
||||
#include "edit-widget.h"
|
||||
@ -852,19 +852,20 @@ open_include_file (const char *filename)
|
||||
return fopen (filename, "r");
|
||||
|
||||
g_free (error_file_name);
|
||||
error_file_name = g_build_filename (home_dir, EDIT_DIR, filename, (char *) NULL);
|
||||
error_file_name =
|
||||
g_build_filename (mc_config_get_data_path (), EDIT_DIR, filename, (char *) NULL);
|
||||
f = fopen (error_file_name, "r");
|
||||
if (f != NULL)
|
||||
return f;
|
||||
|
||||
g_free (error_file_name);
|
||||
error_file_name = g_build_filename (mc_home, "syntax", filename, (char *) NULL);
|
||||
error_file_name = g_build_filename (mc_sysconfig_dir, "syntax", filename, (char *) NULL);
|
||||
f = fopen (error_file_name, "r");
|
||||
if (f != NULL)
|
||||
return f;
|
||||
|
||||
g_free (error_file_name);
|
||||
error_file_name = g_build_filename (mc_home_alt, "syntax", filename, (char *) NULL);
|
||||
error_file_name = g_build_filename (mc_share_data_dir, "syntax", filename, (char *) NULL);
|
||||
|
||||
return fopen (error_file_name, "r");
|
||||
}
|
||||
@ -1266,7 +1267,7 @@ edit_read_syntax_file (WEdit * edit, char ***pnames, const char *syntax_file,
|
||||
f = fopen (syntax_file, "r");
|
||||
if (f == NULL)
|
||||
{
|
||||
lib_file = g_build_filename (mc_home_alt, "syntax", "Syntax", (char *) NULL);
|
||||
lib_file = g_build_filename (mc_share_data_dir, "syntax", "Syntax", (char *) NULL);
|
||||
f = fopen (lib_file, "r");
|
||||
g_free (lib_file);
|
||||
if (f == NULL)
|
||||
@ -1510,7 +1511,7 @@ edit_load_syntax (WEdit * edit, char ***pnames, const char *type)
|
||||
if (!*edit->filename && !type)
|
||||
return;
|
||||
}
|
||||
f = g_build_filename (home_dir, EDIT_SYNTAX_FILE, (char *) NULL);
|
||||
f = g_build_filename (mc_config_get_data_path (), EDIT_SYNTAX_FILE, (char *) NULL);
|
||||
if (edit != NULL)
|
||||
r = edit_read_syntax_file (edit, pnames, f, edit->filename,
|
||||
get_first_editor_line (edit),
|
||||
|
@ -1020,11 +1020,11 @@ ext_cmd (void)
|
||||
_("Which extension file you want to edit?"), D_NORMAL, 2,
|
||||
_("&User"), _("&System Wide"));
|
||||
}
|
||||
extdir = concat_dir_and_file (mc_home, MC_LIB_EXT);
|
||||
extdir = concat_dir_and_file (mc_sysconfig_dir, MC_LIB_EXT);
|
||||
|
||||
if (dir == 0)
|
||||
{
|
||||
buffer = g_build_filename (home_dir, MC_USERCONF_DIR, MC_FILEBIND_FILE, NULL);
|
||||
buffer = g_build_filename (mc_config_get_data_path (), MC_FILEBIND_FILE, NULL);
|
||||
check_for_default (extdir, buffer);
|
||||
do_edit (buffer);
|
||||
g_free (buffer);
|
||||
@ -1034,7 +1034,7 @@ ext_cmd (void)
|
||||
if (!exist_file (extdir))
|
||||
{
|
||||
g_free (extdir);
|
||||
extdir = concat_dir_and_file (mc_home_alt, MC_LIB_EXT);
|
||||
extdir = concat_dir_and_file (mc_share_data_dir, MC_LIB_EXT);
|
||||
}
|
||||
do_edit (extdir);
|
||||
}
|
||||
@ -1056,12 +1056,12 @@ edit_mc_menu_cmd (void)
|
||||
_("Which menu file do you want to edit?"),
|
||||
D_NORMAL, geteuid ()? 2 : 3, _("&Local"), _("&User"), _("&System Wide"));
|
||||
|
||||
menufile = concat_dir_and_file (mc_home, MC_GLOBAL_MENU);
|
||||
menufile = concat_dir_and_file (mc_sysconfig_dir, MC_GLOBAL_MENU);
|
||||
|
||||
if (!exist_file (menufile))
|
||||
{
|
||||
g_free (menufile);
|
||||
menufile = concat_dir_and_file (mc_home_alt, MC_GLOBAL_MENU);
|
||||
menufile = concat_dir_and_file (mc_share_data_dir, MC_GLOBAL_MENU);
|
||||
}
|
||||
|
||||
switch (dir)
|
||||
@ -1073,16 +1073,16 @@ edit_mc_menu_cmd (void)
|
||||
break;
|
||||
|
||||
case 1:
|
||||
buffer = g_build_filename (home_dir, MC_USERCONF_DIR, MC_USERMENU_FILE, NULL);
|
||||
buffer = g_build_filename (mc_config_get_data_path (), MC_USERMENU_FILE, NULL);
|
||||
check_for_default (menufile, buffer);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
buffer = concat_dir_and_file (mc_home, MC_GLOBAL_MENU);
|
||||
buffer = concat_dir_and_file (mc_sysconfig_dir, MC_GLOBAL_MENU);
|
||||
if (!exist_file (buffer))
|
||||
{
|
||||
g_free (buffer);
|
||||
buffer = concat_dir_and_file (mc_home_alt, MC_GLOBAL_MENU);
|
||||
buffer = concat_dir_and_file (mc_share_data_dir, MC_GLOBAL_MENU);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1114,11 +1114,11 @@ edit_fhl_cmd (void)
|
||||
_("Which highlighting file you want to edit?"), D_NORMAL, 2,
|
||||
_("&User"), _("&System Wide"));
|
||||
}
|
||||
fhlfile = concat_dir_and_file (mc_home, MC_FHL_INI_FILE);
|
||||
fhlfile = concat_dir_and_file (mc_sysconfig_dir, MC_FHL_INI_FILE);
|
||||
|
||||
if (dir == 0)
|
||||
{
|
||||
buffer = g_build_filename (home_dir, MC_USERCONF_DIR, MC_FHL_INI_FILE, NULL);
|
||||
buffer = g_build_filename (mc_config_get_path (), MC_FHL_INI_FILE, NULL);
|
||||
check_for_default (fhlfile, buffer);
|
||||
do_edit (buffer);
|
||||
g_free (buffer);
|
||||
@ -1128,7 +1128,7 @@ edit_fhl_cmd (void)
|
||||
if (!exist_file (fhlfile))
|
||||
{
|
||||
g_free (fhlfile);
|
||||
fhlfile = concat_dir_and_file (mc_home, MC_FHL_INI_FILE);
|
||||
fhlfile = concat_dir_and_file (mc_sysconfig_dir, MC_FHL_INI_FILE);
|
||||
}
|
||||
do_edit (fhlfile);
|
||||
}
|
||||
@ -1365,7 +1365,7 @@ get_random_hint (int force)
|
||||
return g_strdup ("");
|
||||
last_sec = tv.tv_sec;
|
||||
|
||||
data = load_mc_home_file (mc_home_alt, MC_HINT, NULL);
|
||||
data = load_mc_home_file (mc_share_data_dir, MC_HINT, NULL);
|
||||
if (data == NULL)
|
||||
return NULL;
|
||||
|
||||
@ -1572,8 +1572,8 @@ void
|
||||
save_setup_cmd (void)
|
||||
{
|
||||
if (save_setup (TRUE, TRUE))
|
||||
message (D_NORMAL, _("Setup"), _("Setup saved to ~/%s"),
|
||||
MC_USERCONF_DIR PATH_SEP_STR MC_CONFIG_FILE);
|
||||
message (D_NORMAL, _("Setup"), _("Setup saved to %s%s%s"),
|
||||
mc_config_get_path (), PATH_SEP_STR, MC_CONFIG_FILE);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -325,7 +325,7 @@ do_cd_command (char *orig_cmd)
|
||||
{
|
||||
if (cmd[0] == 0)
|
||||
{
|
||||
sync_tree (home_dir);
|
||||
sync_tree (mc_config_get_home_dir ());
|
||||
}
|
||||
else if (strcmp (cmd + 3, "..") == 0)
|
||||
{
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "lib/tty/tty.h"
|
||||
#include "lib/search.h"
|
||||
#include "lib/fileloc.h"
|
||||
#include "lib/mcconfig.h"
|
||||
#include "lib/util.h"
|
||||
#include "lib/vfs/mc-vfs/vfs.h"
|
||||
#include "lib/widget.h"
|
||||
@ -629,16 +630,16 @@ regex_command (const char *filename, const char *action, int *move_dir)
|
||||
int mc_user_ext = 1;
|
||||
int home_error = 0;
|
||||
|
||||
extension_file = g_build_filename (home_dir, MC_USERCONF_DIR, MC_FILEBIND_FILE, NULL);
|
||||
extension_file = g_build_filename (mc_config_get_data_path (), MC_FILEBIND_FILE, NULL);
|
||||
if (!exist_file (extension_file))
|
||||
{
|
||||
g_free (extension_file);
|
||||
check_stock_mc_ext:
|
||||
extension_file = concat_dir_and_file (mc_home, MC_LIB_EXT);
|
||||
extension_file = concat_dir_and_file (mc_sysconfig_dir, MC_LIB_EXT);
|
||||
if (!exist_file (extension_file))
|
||||
{
|
||||
g_free (extension_file);
|
||||
extension_file = concat_dir_and_file (mc_home_alt, MC_LIB_EXT);
|
||||
extension_file = concat_dir_and_file (mc_share_data_dir, MC_LIB_EXT);
|
||||
}
|
||||
mc_user_ext = 0;
|
||||
}
|
||||
@ -662,12 +663,12 @@ regex_command (const char *filename, const char *action, int *move_dir)
|
||||
else
|
||||
{
|
||||
char *title = g_strdup_printf (_(" %s%s file error"),
|
||||
mc_home, MC_LIB_EXT);
|
||||
mc_sysconfig_dir, MC_LIB_EXT);
|
||||
message (D_ERROR, title, _("The format of the %smc.ext "
|
||||
"file has changed with version 3.0. It seems that "
|
||||
"the installation failed. Please fetch a fresh "
|
||||
"copy from the Midnight Commander package."),
|
||||
mc_home);
|
||||
mc_sysconfig_dir);
|
||||
g_free (title);
|
||||
return 0;
|
||||
}
|
||||
@ -675,13 +676,14 @@ regex_command (const char *filename, const char *action, int *move_dir)
|
||||
}
|
||||
if (home_error)
|
||||
{
|
||||
char *title = g_strdup_printf (_("~/%s file error"),
|
||||
MC_USERCONF_DIR PATH_SEP_STR MC_FILEBIND_FILE);
|
||||
char *title = g_strdup_printf (_("%s%s%s file error"),
|
||||
mc_config_get_data_path (), PATH_SEP_STR,
|
||||
MC_FILEBIND_FILE);
|
||||
message (D_ERROR, title,
|
||||
_("The format of the ~/%s file has "
|
||||
_("The format of the %s%s%s file has "
|
||||
"changed with version 3.0. You may either want to copy "
|
||||
"it from %smc.ext or use that file as an example of how to write it."),
|
||||
MC_USERCONF_DIR PATH_SEP_STR MC_FILEBIND_FILE, mc_home);
|
||||
mc_config_get_data_path (), PATH_SEP_STR, MC_FILEBIND_FILE, mc_sysconfig_dir);
|
||||
g_free (title);
|
||||
}
|
||||
}
|
||||
|
@ -506,7 +506,7 @@ hotlist_button_callback (WButton * button, int action)
|
||||
|
||||
case B_REFRESH_VFS:
|
||||
listbox_remove_list (l_hotlist);
|
||||
listbox_add_item (l_hotlist, LISTBOX_APPEND_AT_END, 0, home_dir, 0);
|
||||
listbox_add_item (l_hotlist, LISTBOX_APPEND_AT_END, 0, mc_config_get_home_dir (), 0);
|
||||
vfs_fill_names (add_name_to_list);
|
||||
return MSG_NOT_HANDLED;
|
||||
#endif /* ENABLE_VFS */
|
||||
@ -814,7 +814,7 @@ init_hotlist (int list_type)
|
||||
#ifdef ENABLE_VFS
|
||||
if (list_type == LIST_VFSLIST)
|
||||
{
|
||||
listbox_add_item (l_hotlist, LISTBOX_APPEND_AT_END, 0, home_dir, 0);
|
||||
listbox_add_item (l_hotlist, LISTBOX_APPEND_AT_END, 0, mc_config_get_home_dir (), 0);
|
||||
vfs_fill_names (add_name_to_list);
|
||||
}
|
||||
else
|
||||
@ -1551,7 +1551,7 @@ load_hotlist (void)
|
||||
}
|
||||
|
||||
if (!hotlist_file_name)
|
||||
hotlist_file_name = g_build_filename (home_dir, MC_USERCONF_DIR, MC_HOTLIST_FILE, NULL);
|
||||
hotlist_file_name = g_build_filename (mc_config_get_path (), MC_HOTLIST_FILE, NULL);
|
||||
|
||||
hotlist = new_hotlist ();
|
||||
hotlist->type = HL_TYPE_GROUP;
|
||||
|
@ -2632,7 +2632,7 @@ _do_panel_cd (WPanel * panel, const char *new_dir, enum cd_enum cd_type)
|
||||
new_dir = temp;
|
||||
}
|
||||
}
|
||||
directory = *new_dir ? new_dir : home_dir;
|
||||
directory = *new_dir ? new_dir : mc_config_get_home_dir ();
|
||||
|
||||
if (mc_chdir (directory) == -1)
|
||||
{
|
||||
|
@ -160,7 +160,7 @@ remove_callback (tree_entry * entry, void *data)
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/** Save the ~/.mc/Tree file */
|
||||
/** Save the ${XDG_CACHE_HOME}/mc/Tree file */
|
||||
|
||||
static void
|
||||
save_tree (WTree * tree)
|
||||
@ -174,7 +174,8 @@ save_tree (WTree * tree)
|
||||
|
||||
if (error)
|
||||
{
|
||||
tree_name = g_build_filename (home_dir, MC_USERCONF_DIR, MC_TREESTORE_FILE, (char *) NULL);
|
||||
tree_name =
|
||||
g_build_filename (mc_config_get_cache_path (), MC_TREESTORE_FILE, (char *) NULL);
|
||||
fprintf (stderr, _("Cannot open the %s file for writing:\n%s\n"), tree_name,
|
||||
unix_error_string (error));
|
||||
g_free (tree_name);
|
||||
@ -212,7 +213,7 @@ load_tree (WTree * tree)
|
||||
tree_store_load ();
|
||||
|
||||
tree->selected_ptr = tree->store->tree_first;
|
||||
tree_chdir (tree, home_dir);
|
||||
tree_chdir (tree, mc_config_get_home_dir ());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -640,7 +640,7 @@ tree_store_load (void)
|
||||
char *name;
|
||||
int retval;
|
||||
|
||||
name = g_build_filename (home_dir, MC_USERCONF_DIR, MC_TREESTORE_FILE, NULL);
|
||||
name = g_build_filename (mc_config_get_cache_path (), MC_TREESTORE_FILE, NULL);
|
||||
retval = tree_store_load_from (name);
|
||||
g_free (name);
|
||||
|
||||
@ -660,7 +660,7 @@ tree_store_save (void)
|
||||
char *name;
|
||||
int retval;
|
||||
|
||||
name = g_build_filename (home_dir, MC_USERCONF_DIR, MC_TREESTORE_FILE, NULL);
|
||||
name = g_build_filename (mc_config_get_cache_path (), MC_TREESTORE_FILE, NULL);
|
||||
mc_util_make_backup_if_possible (name, ".tmp");
|
||||
|
||||
retval = tree_store_save_to (name);
|
||||
|
@ -785,7 +785,7 @@ expand_format (struct WEdit *edit_widget, char c, gboolean do_quote)
|
||||
#ifdef USE_INTERNAL_EDIT
|
||||
if (edit_widget)
|
||||
{
|
||||
char *file = concat_dir_and_file (home_dir, EDIT_BLOCK_FILE);
|
||||
char *file = concat_dir_and_file (mc_config_get_cache_path (), EDIT_BLOCK_FILE);
|
||||
fname = (*quote_func) (file, 0);
|
||||
g_free (file);
|
||||
return fname;
|
||||
@ -872,20 +872,29 @@ user_menu_cmd (struct WEdit *edit_widget)
|
||||
{
|
||||
g_free (menu);
|
||||
if (edit_widget)
|
||||
menu = concat_dir_and_file (home_dir, EDIT_HOME_MENU);
|
||||
menu = concat_dir_and_file (mc_config_get_data_path (), EDIT_HOME_MENU);
|
||||
else
|
||||
menu = g_build_filename (home_dir, MC_USERCONF_DIR, MC_USERMENU_FILE, NULL);
|
||||
menu = g_build_filename (mc_config_get_data_path (), MC_USERMENU_FILE, NULL);
|
||||
|
||||
|
||||
if (!exist_file (menu))
|
||||
{
|
||||
g_free (menu);
|
||||
menu = concat_dir_and_file (mc_home, edit_widget ? EDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
menu =
|
||||
concat_dir_and_file (mc_config_get_home_dir (),
|
||||
edit_widget ? EDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
if (!exist_file (menu))
|
||||
{
|
||||
g_free (menu);
|
||||
menu = concat_dir_and_file
|
||||
(mc_home_alt, edit_widget ? EDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
menu =
|
||||
concat_dir_and_file (mc_sysconfig_dir,
|
||||
edit_widget ? EDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
if (!exist_file (menu))
|
||||
{
|
||||
g_free (menu);
|
||||
menu = concat_dir_and_file
|
||||
(mc_share_data_dir, edit_widget ? EDIT_GLOBAL_MENU : MC_GLOBAL_MENU);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1047,7 +1047,7 @@ interactive_display (const char *filename, const char *node)
|
||||
if (filename != NULL)
|
||||
g_file_get_contents (filename, &filedata, NULL, NULL);
|
||||
else
|
||||
filedata = load_mc_home_file (mc_home_alt, MC_HELP, &hlpfile);
|
||||
filedata = load_mc_home_file (mc_share_data_dir, MC_HELP, &hlpfile);
|
||||
|
||||
if (filedata == NULL)
|
||||
message (D_ERROR, MSG_ERROR, _("Cannot open file %s\n%s"),
|
||||
|
72
src/main.c
72
src/main.c
@ -119,12 +119,13 @@ char *shell = NULL;
|
||||
/* The prompt */
|
||||
const char *mc_prompt = NULL;
|
||||
|
||||
/* mc_home: The home of MC - /etc/mc or defined by MC_DATADIR */
|
||||
char *mc_home = NULL;
|
||||
/* mc_home_alt: Alternative home of MC - deprecated /usr/share/mc */
|
||||
char *mc_home_alt = NULL;
|
||||
/* The home directory */
|
||||
const char *home_dir = NULL;
|
||||
/* mc_sysconfig_dir: Area for default settings from maintainers of distributuves
|
||||
default is /etc/mc or may be defined by MC_DATADIR
|
||||
*/
|
||||
char *mc_sysconfig_dir = NULL;
|
||||
|
||||
/* mc_share_data_dir: Area for default settings from developers */
|
||||
char *mc_share_data_dir = NULL;
|
||||
|
||||
/* Set to TRUE to suppress printing the last directory */
|
||||
int print_last_revert = FALSE;
|
||||
@ -198,20 +199,15 @@ OS_Setup (void)
|
||||
mc_libdir = getenv ("MC_DATADIR");
|
||||
if (mc_libdir != NULL)
|
||||
{
|
||||
mc_home = g_strdup (mc_libdir);
|
||||
mc_home_alt = g_strdup (SYSCONFDIR);
|
||||
mc_sysconfig_dir = g_strdup (mc_libdir);
|
||||
mc_share_data_dir = g_strdup (SYSCONFDIR);
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_home = g_strdup (SYSCONFDIR);
|
||||
mc_home_alt = g_strdup (DATADIR);
|
||||
mc_sysconfig_dir = g_strdup (SYSCONFDIR);
|
||||
mc_share_data_dir = g_strdup (DATADIR);
|
||||
}
|
||||
|
||||
/* This variable is used by the subshell */
|
||||
home_dir = getenv ("HOME");
|
||||
|
||||
if (home_dir == NULL)
|
||||
home_dir = mc_home;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -418,8 +414,6 @@ update_xterm_title_path (void)
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
struct stat s;
|
||||
char *mc_dir;
|
||||
GError *error = NULL;
|
||||
gboolean isInitialized;
|
||||
|
||||
@ -428,6 +422,7 @@ main (int argc, char *argv[])
|
||||
bindtextdomain ("mc", LOCALEDIR);
|
||||
textdomain ("mc");
|
||||
|
||||
|
||||
/* Set up temporary directory */
|
||||
mc_tmpdir ();
|
||||
|
||||
@ -462,6 +457,17 @@ main (int argc, char *argv[])
|
||||
/* We need this, since ncurses endwin () doesn't restore the signals */
|
||||
save_stop_handler ();
|
||||
|
||||
/* Initialize and create home directories */
|
||||
/* do it after the screen library initialization to show the error message */
|
||||
mc_config_init_config_paths (&error);
|
||||
if (error == NULL)
|
||||
{
|
||||
if (mc_config_deprecated_dir_present ())
|
||||
{
|
||||
mc_config_migrate_from_old_place (&error);
|
||||
}
|
||||
}
|
||||
|
||||
/* Must be done before init_subshell, to set up the terminal size: */
|
||||
/* FIXME: Should be removed and LINES and COLS computed on subshell */
|
||||
tty_init ((gboolean) mc_args__slow_terminal, (gboolean) mc_args__ugly_line_drawing);
|
||||
@ -477,24 +483,28 @@ main (int argc, char *argv[])
|
||||
load_keymap_defs ();
|
||||
|
||||
tty_init_colors (mc_args__disable_colors, mc_args__force_colors);
|
||||
isInitialized = mc_skin_init (&error);
|
||||
mc_filehighlight = mc_fhl_new (TRUE);
|
||||
dlg_set_default_colors ();
|
||||
|
||||
if (!isInitialized)
|
||||
{
|
||||
GError *error2 = NULL;
|
||||
isInitialized = mc_skin_init (&error2);
|
||||
mc_filehighlight = mc_fhl_new (TRUE);
|
||||
dlg_set_default_colors ();
|
||||
|
||||
if (!isInitialized)
|
||||
{
|
||||
message (D_ERROR, _("Warning"), "%s", error2->message);
|
||||
g_error_free (error2);
|
||||
error2 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (error != NULL)
|
||||
{
|
||||
message (D_ERROR, _("Warning"), "%s", error->message);
|
||||
g_error_free (error);
|
||||
error = NULL;
|
||||
}
|
||||
|
||||
/* create home directory */
|
||||
/* do it after the screen library initialization to show the error message */
|
||||
mc_dir = g_build_filename (home_dir, MC_USERCONF_DIR, (char *) NULL);
|
||||
canonicalize_pathname (mc_dir);
|
||||
if ((stat (mc_dir, &s) != 0) && (errno == ENOENT) && mkdir (mc_dir, 0700) != 0)
|
||||
message (D_ERROR, _("Warning"), _("Cannot create %s directory"), mc_dir);
|
||||
g_free (mc_dir);
|
||||
|
||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||
/* Done here to ensure that the subshell doesn't */
|
||||
@ -571,8 +581,8 @@ main (int argc, char *argv[])
|
||||
}
|
||||
g_free (last_wd_string);
|
||||
|
||||
g_free (mc_home_alt);
|
||||
g_free (mc_home);
|
||||
g_free (mc_share_data_dir);
|
||||
g_free (mc_sysconfig_dir);
|
||||
g_free (shell);
|
||||
|
||||
done_key ();
|
||||
@ -582,6 +592,8 @@ main (int argc, char *argv[])
|
||||
g_free (mc_run_param0);
|
||||
g_free (mc_run_param1);
|
||||
|
||||
mc_config_deinit_config_paths ();
|
||||
|
||||
putchar ('\n'); /* Hack to make shell's prompt start at left of screen */
|
||||
|
||||
return 0;
|
||||
|
@ -78,10 +78,8 @@ extern int midnight_shutdown;
|
||||
extern char *shell;
|
||||
extern const char *mc_prompt;
|
||||
|
||||
extern char *mc_home;
|
||||
extern char *mc_home_alt;
|
||||
|
||||
extern const char *home_dir;
|
||||
extern char *mc_sysconfig_dir;
|
||||
extern char *mc_share_data_dir;
|
||||
|
||||
/*** declarations of public functions ************************************************************/
|
||||
|
||||
|
56
src/setup.c
56
src/setup.c
@ -78,7 +78,7 @@
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
char *profile_name; /* .mc/ini */
|
||||
char *profile_name; /* ${XDG_CONFIG_HOME}/mc/ini */
|
||||
char *global_profile_name; /* mc.lib */
|
||||
|
||||
/* Only used at program boot */
|
||||
@ -190,7 +190,7 @@ int file_op_compute_totals = 1;
|
||||
|
||||
/*** file scope variables ************************************************************************/
|
||||
|
||||
static char *panels_profile_name = NULL; /* .mc/panels.ini */
|
||||
static char *panels_profile_name = NULL; /* ${XDG_CACHE_HOME}/mc/panels.ini */
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
static const struct
|
||||
@ -383,15 +383,13 @@ static const struct
|
||||
\return
|
||||
Newly allocated path to config name or NULL if file not found.
|
||||
|
||||
If config_file_name is a relative path, then search config in stantart pathes.
|
||||
If config_file_name is a relative path, then search config in stantart paths.
|
||||
*/
|
||||
static char *
|
||||
load_setup_get_full_config_name (const char *subdir, const char *config_file_name)
|
||||
{
|
||||
/*
|
||||
TODO: IMHO, in future this function must be placed into mc_config module.
|
||||
Also, need to rename stupid mc_home and mc_home_alt to mc_sysconfdir and mc_datadir;
|
||||
home_mc => mc_user_homedir
|
||||
*/
|
||||
char *lc_basename, *ret;
|
||||
|
||||
@ -407,9 +405,9 @@ load_setup_get_full_config_name (const char *subdir, const char *config_file_nam
|
||||
return NULL;
|
||||
|
||||
if (subdir != NULL)
|
||||
ret = g_build_filename (home_dir, MC_USERCONF_DIR, subdir, lc_basename, NULL);
|
||||
ret = g_build_filename (mc_config_get_path (), subdir, lc_basename, NULL);
|
||||
else
|
||||
ret = g_build_filename (home_dir, MC_USERCONF_DIR, lc_basename, NULL);
|
||||
ret = g_build_filename (mc_config_get_path (), lc_basename, NULL);
|
||||
|
||||
if (exist_file (ret))
|
||||
{
|
||||
@ -419,9 +417,9 @@ load_setup_get_full_config_name (const char *subdir, const char *config_file_nam
|
||||
g_free (ret);
|
||||
|
||||
if (subdir != NULL)
|
||||
ret = g_build_filename (mc_home, subdir, lc_basename, NULL);
|
||||
ret = g_build_filename (mc_sysconfig_dir, subdir, lc_basename, NULL);
|
||||
else
|
||||
ret = g_build_filename (mc_home, lc_basename, NULL);
|
||||
ret = g_build_filename (mc_sysconfig_dir, lc_basename, NULL);
|
||||
|
||||
if (exist_file (ret))
|
||||
{
|
||||
@ -431,9 +429,9 @@ load_setup_get_full_config_name (const char *subdir, const char *config_file_nam
|
||||
g_free (ret);
|
||||
|
||||
if (subdir != NULL)
|
||||
ret = g_build_filename (mc_home_alt, subdir, lc_basename, NULL);
|
||||
ret = g_build_filename (mc_share_data_dir, subdir, lc_basename, NULL);
|
||||
else
|
||||
ret = g_build_filename (mc_home_alt, lc_basename, NULL);
|
||||
ret = g_build_filename (mc_share_data_dir, lc_basename, NULL);
|
||||
|
||||
g_free (lc_basename);
|
||||
|
||||
@ -678,18 +676,18 @@ load_setup_get_keymap_profile_config (void)
|
||||
mc_config_t *keymap_config = NULL;
|
||||
char *fname, *fname2;
|
||||
|
||||
/* 1) /usr/share/mc (mc_home_alt) */
|
||||
fname = g_build_filename (mc_home_alt, GLOBAL_KEYMAP_FILE, NULL);
|
||||
/* 1) /usr/share/mc (mc_share_data_dir) */
|
||||
fname = g_build_filename (mc_share_data_dir, GLOBAL_KEYMAP_FILE, NULL);
|
||||
load_setup_init_config_from_file (&keymap_config, fname);
|
||||
g_free (fname);
|
||||
|
||||
/* 2) /etc/mc (mc_home) */
|
||||
fname = g_build_filename (mc_home, GLOBAL_KEYMAP_FILE, NULL);
|
||||
/* 2) /etc/mc (mc_sysconfig_dir) */
|
||||
fname = g_build_filename (mc_sysconfig_dir, GLOBAL_KEYMAP_FILE, NULL);
|
||||
load_setup_init_config_from_file (&keymap_config, fname);
|
||||
g_free (fname);
|
||||
|
||||
/* 3) ~/.mc (home_dir?) */
|
||||
fname = g_build_filename (home_dir, MC_USERCONF_DIR, GLOBAL_KEYMAP_FILE, NULL);
|
||||
/* 3) ${XDG_CONFIG_HOME}/mc */
|
||||
fname = g_build_filename (mc_config_get_path (), GLOBAL_KEYMAP_FILE, NULL);
|
||||
load_setup_init_config_from_file (&keymap_config, fname);
|
||||
g_free (fname);
|
||||
|
||||
@ -811,10 +809,10 @@ setup_init (void)
|
||||
if (profile_name != NULL)
|
||||
return profile_name;
|
||||
|
||||
profile = g_build_filename (home_dir, MC_USERCONF_DIR, MC_CONFIG_FILE, NULL);
|
||||
profile = g_build_filename (mc_config_get_path (), MC_CONFIG_FILE, NULL);
|
||||
if (!exist_file (profile))
|
||||
{
|
||||
inifile = concat_dir_and_file (mc_home, "mc.ini");
|
||||
inifile = concat_dir_and_file (mc_sysconfig_dir, "mc.ini");
|
||||
if (exist_file (inifile))
|
||||
{
|
||||
g_free (profile);
|
||||
@ -823,7 +821,7 @@ setup_init (void)
|
||||
else
|
||||
{
|
||||
g_free (inifile);
|
||||
inifile = concat_dir_and_file (mc_home_alt, "mc.ini");
|
||||
inifile = concat_dir_and_file (mc_share_data_dir, "mc.ini");
|
||||
if (exist_file (inifile))
|
||||
{
|
||||
g_free (profile);
|
||||
@ -856,15 +854,15 @@ load_setup (void)
|
||||
profile = setup_init ();
|
||||
|
||||
/* mc.lib is common for all users, but has priority lower than
|
||||
~/.mc/ini. FIXME: it's only used for keys and treestore now */
|
||||
global_profile_name = g_build_filename (mc_home, MC_GLOBAL_CONFIG_FILE, (char *) NULL);
|
||||
${XDG_CONFIG_HOME}/mc/ini. FIXME: it's only used for keys and treestore now */
|
||||
global_profile_name = g_build_filename (mc_sysconfig_dir, MC_GLOBAL_CONFIG_FILE, (char *) NULL);
|
||||
if (!exist_file (global_profile_name))
|
||||
{
|
||||
g_free (global_profile_name);
|
||||
global_profile_name = g_build_filename (mc_home_alt, MC_GLOBAL_CONFIG_FILE, (char *) NULL);
|
||||
global_profile_name = g_build_filename (mc_share_data_dir, MC_GLOBAL_CONFIG_FILE, (char *) NULL);
|
||||
}
|
||||
|
||||
panels_profile_name = g_build_filename (home_dir, MC_USERCONF_DIR, MC_PANELS_FILE, NULL);
|
||||
panels_profile_name = g_build_filename (mc_config_get_cache_path (), MC_PANELS_FILE, NULL);
|
||||
|
||||
mc_main_config = mc_config_init (profile);
|
||||
|
||||
@ -1015,7 +1013,7 @@ save_setup (gboolean save_options, gboolean save_panel_options)
|
||||
mc_config_set_string (mc_main_config, "Misc", "clipboard_store", clipboard_store_path);
|
||||
mc_config_set_string (mc_main_config, "Misc", "clipboard_paste", clipboard_paste_path);
|
||||
|
||||
tmp_profile = g_build_filename (home_dir, MC_USERCONF_DIR, MC_CONFIG_FILE, NULL);
|
||||
tmp_profile = g_build_filename (mc_config_get_path (), MC_CONFIG_FILE, NULL);
|
||||
ret = mc_config_save_to_file (mc_main_config, tmp_profile, NULL);
|
||||
|
||||
g_free (tmp_profile);
|
||||
@ -1069,7 +1067,7 @@ save_config (void)
|
||||
GError *error = NULL;
|
||||
size_t i;
|
||||
|
||||
profile = g_build_filename (home_dir, MC_USERCONF_DIR, MC_CONFIG_FILE, NULL);
|
||||
profile = g_build_filename (mc_config_get_path (), MC_CONFIG_FILE, NULL);
|
||||
|
||||
/* Save integer options */
|
||||
for (i = 0; int_options[i].opt_name != NULL; i++)
|
||||
@ -1108,7 +1106,7 @@ save_layout (void)
|
||||
char *profile;
|
||||
size_t i;
|
||||
|
||||
profile = g_build_filename (home_dir, MC_USERCONF_DIR, MC_CONFIG_FILE, NULL);
|
||||
profile = g_build_filename (mc_config_get_path (), MC_CONFIG_FILE, NULL);
|
||||
/* Save integer options */
|
||||
for (i = 0; layout[i].opt_name != NULL; i++)
|
||||
mc_config_set_int (mc_main_config, "Layout", layout[i].opt_name, *layout[i].opt_addr);
|
||||
@ -1122,7 +1120,7 @@ void
|
||||
load_key_defs (void)
|
||||
{
|
||||
/*
|
||||
* Load keys from mc.lib before ~/.mc/ini, so that the user
|
||||
* Load keys from mc.lib before ${XDG_CONFIG_HOME}/mc/ini, so that the user
|
||||
* definitions override global settings.
|
||||
*/
|
||||
mc_config_t *mc_global_config;
|
||||
@ -1163,7 +1161,7 @@ void
|
||||
load_keymap_defs (void)
|
||||
{
|
||||
/*
|
||||
* Load keymap from GLOBAL_KEYMAP_FILE before ~/.mc/keymap, so that the user
|
||||
* Load keymap from GLOBAL_KEYMAP_FILE before ${XDG_DATA_HOME}/mc/keymap, so that the user
|
||||
* definitions override global settings.
|
||||
*/
|
||||
mc_config_t *mc_global_keymap;
|
||||
|
@ -53,7 +53,7 @@
|
||||
#include "lib/tty/key.h" /* XCTRL */
|
||||
#include "lib/vfs/mc-vfs/vfs.h"
|
||||
#include "lib/strutil.h"
|
||||
#include "lib/fileloc.h"
|
||||
#include "lib/mcconfig.h"
|
||||
#include "lib/util.h"
|
||||
#include "lib/widget.h"
|
||||
|
||||
@ -237,7 +237,7 @@ write_all (int fd, const void *buf, size_t count)
|
||||
static void
|
||||
init_subshell_child (const char *pty_name)
|
||||
{
|
||||
const char *init_file = NULL;
|
||||
char *init_file = NULL;
|
||||
pid_t mc_sid;
|
||||
|
||||
(void) pty_name;
|
||||
@ -270,7 +270,7 @@ init_subshell_child (const char *pty_name)
|
||||
/* and the user's startup file may do a `cd' command anyway */
|
||||
{
|
||||
int ret;
|
||||
ret = chdir (home_dir); /* FIXME? What about when we re-run the subshell? */
|
||||
ret = chdir (mc_config_get_home_dir ()); /* FIXME? What about when we re-run the subshell? */
|
||||
}
|
||||
|
||||
/* Set MC_SID to prevent running one mc from another */
|
||||
@ -285,16 +285,28 @@ init_subshell_child (const char *pty_name)
|
||||
switch (subshell_type)
|
||||
{
|
||||
case BASH:
|
||||
init_file = MC_USERCONF_DIR PATH_SEP_STR "bashrc";
|
||||
init_file = g_build_filename (mc_config_get_path (), "bashrc", NULL);
|
||||
|
||||
if (access (init_file, R_OK) == -1)
|
||||
init_file = ".bashrc";
|
||||
{
|
||||
g_free (init_file);
|
||||
init_file = g_strdup (".bashrc");
|
||||
}
|
||||
|
||||
/* Make MC's special commands not show up in bash's history */
|
||||
putenv ((char *) "HISTCONTROL=ignorespace");
|
||||
|
||||
/* Allow alternative readline settings for MC */
|
||||
if (access (MC_USERCONF_DIR PATH_SEP_STR "inputrc", R_OK) == 0)
|
||||
putenv ((char *) "INPUTRC=" MC_USERCONF_DIR PATH_SEP_STR "/inputrc");
|
||||
{
|
||||
char *input_file = g_build_filename (mc_config_get_path (), "inputrc", NULL);
|
||||
if (access (input_file, R_OK) == 0)
|
||||
{
|
||||
char *putenv_str = g_strconcat ("INPUTRC=", input_file, NULL);
|
||||
putenv (putenv_str);
|
||||
g_free (putenv_str);
|
||||
}
|
||||
g_free (input_file);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@ -353,6 +365,7 @@ init_subshell_child (const char *pty_name)
|
||||
}
|
||||
|
||||
/* If we get this far, everything failed miserably */
|
||||
g_free (init_file);
|
||||
_exit (FORK_FAILURE);
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user