unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39394: vis editor doesn't respect user configuration
@ 2020-02-02 17:55 tsmish
  2020-02-02 20:03 ` Gábor Boskovits
  0 siblings, 1 reply; 5+ messages in thread
From: tsmish @ 2020-02-02 17:55 UTC (permalink / raw)
  To: 39394

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
2. Remove $VIS_PATH search path from package. This shouldn't break
anything, as it seems share/vis is in later resolution path.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#39394: vis editor doesn't respect user configuration
  2020-02-02 17:55 bug#39394: vis editor doesn't respect user configuration tsmish
@ 2020-02-02 20:03 ` Gábor Boskovits
  2020-02-02 20:05   ` Gábor Boskovits
  2020-02-02 21:08   ` tsmish
  0 siblings, 2 replies; 5+ messages in thread
From: Gábor Boskovits @ 2020-02-02 20:03 UTC (permalink / raw)
  To: tsmish; +Cc: 39394

[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

Thanks for the report.

tsmish <tsymsh@gmail.com> ezt írta (időpont: 2020. febr. 2., Vas 18:57):

> 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
> anything, as it seems share/vis is in later resolution path.
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 1501 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#39394: vis editor doesn't respect user configuration
  2020-02-02 20:03 ` Gábor Boskovits
@ 2020-02-02 20:05   ` Gábor Boskovits
  2020-02-02 21:08   ` tsmish
  1 sibling, 0 replies; 5+ messages in thread
From: Gábor Boskovits @ 2020-02-02 20:05 UTC (permalink / raw)
  To: control; +Cc: 39394

[-- Attachment #1: Type: text/plain, Size: 20 bytes --]

tag 39394 easy quit

[-- Attachment #2: Type: text/html, Size: 127 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#39394: vis editor doesn't respect user configuration
  2020-02-02 20:03 ` Gábor Boskovits
  2020-02-02 20:05   ` Gábor Boskovits
@ 2020-02-02 21:08   ` tsmish
  2020-02-02 22:56     ` Gábor Boskovits
  1 sibling, 1 reply; 5+ messages in thread
From: tsmish @ 2020-02-02 21:08 UTC (permalink / raw)
  To: Gábor Boskovits; +Cc: 39394

> 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.

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#39394: vis editor doesn't respect user configuration
  2020-02-02 21:08   ` tsmish
@ 2020-02-02 22:56     ` Gábor Boskovits
  0 siblings, 0 replies; 5+ messages in thread
From: Gábor Boskovits @ 2020-02-02 22:56 UTC (permalink / raw)
  To: tsmish; +Cc: 39394

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

tsmish <tsymsh@gmail.com> ezt írta (időpont: 2020. febr. 2., Vas 22:08):

> > 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 will
have a look at the package tomorrow.

>
> 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 #2: Type: text/html, Size: 1789 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-02 22:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-02 17:55 bug#39394: vis editor doesn't respect user configuration tsmish
2020-02-02 20:03 ` Gábor Boskovits
2020-02-02 20:05   ` Gábor Boskovits
2020-02-02 21:08   ` tsmish
2020-02-02 22:56     ` Gábor Boskovits

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).