Friday, April 18, 2025

Re: Can makeprg (or equivalent) be locally file-customised?

On Fri, 18 Apr 2025, dvalin via vim_use wrote:

> When Vimming a number of wildly disparate textfiles, each with a
> single custom processing requirement, it would be absolutely ideal to
> set makeprg (or equivalent) in a modeline. But for makeprg that is
> verboten: "This option cannot be set from a |modeline| or in the
> |sandbox|, for security reasons."

Yes that makes sense. You don't want to run arbitrary commands that you
are not aware of because those are set by the modeline.

> Mind you, here there is no such security concern - whether any command
> is run by ":!" or makeprg makes no real difference, so I'm not

Because this is not potentially run when reading the file. The user will
need to run this manually and hopefully he knows what he is doing.

> entirely sure why one would impose the clumsiness of having to insert
> ":!groff -k -Tpdf -ms -m hdtbl -dpaper=a4 -P-pa4 % > /tmp/vde.pdf" or
> whatever another file needs?

Define a custom command so you don't have to type it manually.

> So is there a file-local way to just alias e.g. ^m to a shell command,
> **in the modeline**? That would be much faster to invoke, and not muck
> with makeprg.

I hope this is not possibly and I won't support such a thing for
security reasons.

Thanks,
Christian
--
Better hope you get what you want before you stop wanting it.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/aAIPoJuFVKoXZro/%40256bit.org.

No comments: