vis editor doesn't respect user configuration

OpenSubmitted by tsmish.
Details
2 participants
  • Gábor Boskovits
  • tsmish
Owner
unassigned
Severity
normal
T
T
tsmish wrote on 2 Feb 2020 18:55
(address . bug-guix@gnu.org)
CAMaATaOz3p7ek4M55wwqe-=-L+xE3U+dt13nSxf6QOZMP3U+-Q@mail.gmail.com
Steps to reproduce:1. Make file ~/.config/vis/visrc.lua with following text:```require('vis')
vis.events.subscribe(vis.events.INIT, function() vis:command('qall')end)```2. Open vis
vis should immediately close on startup, but it doesn't.
It happens because package defines $VIS_PATH search path to directorywhich contains example visrc.lua file and $VIS_PATH is highestpriority directory according to man page.
Suggestions:1. Remove or rename example visrc.lua in share/vis2. Remove $VIS_PATH search path from package. This shouldn't breakanything, as it seems share/vis is in later resolution path.
G
G
Gábor Boskovits wrote on 2 Feb 2020 21:03
(name . tsmish)(address . tsymsh@gmail.com)(address . 39394@debbugs.gnu.org)
CAE4v=pguCiEpxD+Bqfy7LPFqirZGdPAC2Z9pVvYJ6kpEU5k-Wg@mail.gmail.com
Thanks for the report.
tsmish <tsymsh@gmail.com> ezt írta (időpont: 2020. febr. 2., Vas 18:57):
Toggle quote (20 lines)> Steps to reproduce:> 1. Make file ~/.config/vis/visrc.lua with following text:> ```> require('vis')>> vis.events.subscribe(vis.events.INIT, function()> vis:command('qall')> end)> ```> 2. Open vis>> vis should immediately close on startup, but it doesn't.>> It happens because package defines $VIS_PATH search path to directory> which contains example visrc.lua file and $VIS_PATH is highest> priority directory according to man page.>> Suggestions:> 1. Remove or rename example visrc.lua in share/vis>
I would go for renaming it like visrc.lua.example, or similar.
Would you like to propose a patch?
2. Remove $VIS_PATH search path from package. This shouldn't break
Toggle quote (5 lines)> anything, as it seems share/vis is in later resolution path.>>>>
Attachment: file
G
G
Gábor Boskovits wrote on 2 Feb 2020 21:05
(address . control@debbugs.gnu.org)(address . 39394@debbugs.gnu.org)
CAE4v=pjaJueA97LtOpb+6iuhKZBPT_Dhj-aCoy7hvUS2kRS4_g@mail.gmail.com
tag 39394 easy quit
Attachment: file
T
T
tsmish wrote on 2 Feb 2020 22:08
(name . Gábor Boskovits)(address . boskovits@gmail.com)(address . 39394@debbugs.gnu.org)
CAMaATaPLmK-_6wL=SdKxswAr0ubt2aSZ-BE-NuYezVScF08f9w@mail.gmail.com
Toggle quote (2 lines)> I would go for renaming it like visrc.lua.example, or similar.
I don't really like this solution because while this particularproblem will be fixed, underlying issue of system paths having higherpriority than user ones will stay.From what I can figure out from thecode(https://github.com/martanne/vis/blob/a4b64c5c396646bb2f14db3b4145a5482a2ff8bf/vis-lua.c#L2650)$VIS_PATH is at the top of package.path which will make requires fromuser configuration go there in case of files with same name.Also this will probably make commands such as "set theme" ignore userfiles from configuration directory when there is a file in system one.
Also there is VIS_PATH #define which seems to be intended way to setpath to system directory. It is set to /usr/local/share/vis bydefault, but I don't see itin help, which probably means it gets overwritten with some kind of guix magic.
G
G
Gábor Boskovits wrote on 2 Feb 2020 23:56
(name . tsmish)(address . tsymsh@gmail.com)(address . 39394@debbugs.gnu.org)
CAE4v=piEdnZLWJCWHwddy-ne9CPFG7rFMKwzeZ=hXct4wToRNg@mail.gmail.com
tsmish <tsymsh@gmail.com> ezt írta (időpont: 2020. febr. 2., Vas 22:08):
Toggle quote (14 lines)> > I would go for renaming it like visrc.lua.example, or similar.>> I don't really like this solution because while this particular> problem will be fixed, underlying issue of system paths having higher> priority than user ones will stay.> From what I can figure out from the> code(> https://github.com/martanne/vis/blob/a4b64c5c396646bb2f14db3b4145a5482a2ff8bf/vis-lua.c#L2650> )> $VIS_PATH is at the top of package.path which will make requires from> user configuration go there in case of files with same name.> Also this will probably make commands such as "set theme" ignore user> files from configuration directory when there is a file in system one>
Ok, as a real user of vis, I believe you got a better understanding. I willhave a look at the package tomorrow.
Toggle quote (7 lines)>> Also there is VIS_PATH #define which seems to be intended way to set> path to system directory. It is set to /usr/local/share/vis by> default, but I don't see it> in help, which probably means it gets overwritten with some kind of guix> magic.>
Attachment: file
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send email to 39394@debbugs.gnu.org