Ticket #4 (reopened enhancement)

Opened 5 years ago

Last modified 5 years ago

Add default g:haddock_browser/g:haddock_browser_callformat for Mac

Reported by: spl Owned by: claus
Priority: minor Milestone:
Component: ftplugin/haskell_doc.vim Version:
Keywords: Cc: leather@…

Description

Add a default g:haddock_browser and g:haddock_browser_callformat for the Mac:

let g:haddock_browser = "open"
let g:haddock_browser_callformat = "%s %s"

This is described in more detail here.

Change History

follow-up: ↓ 3   Changed 5 years ago by claus

There used to be a default for the browser to call, but users were complaining if the default didn't match their preference (it is amazing how varied preferences can be, even for the same programmers' editor - that is how most of the configuration options came into being;-). Now, everyone gets to (has to) choose. Since that disappears in VIMINIT, it isn't too tiresome.

But I would like to add useful settings to the project page, and improve the documentation so that users don't get turned off by configuration issues.

From the open man page you link to, open is a general file-type-based program launcher and, unless otherwise instructed, will send the program into the background, so Vim editing can proceed independently of the browser session.

So, the default send-to-background plus output redirection isn't needed in g:haddock_browser_callformat - any particular reason for removing the file:// prefix?

Oh, if your installation lacks local docs, you can download documentation tarballs, as mentioned in :help haskellmode-requirements. Older versions can be found one level up.

Meta-level question: I thought I had set up this trac to send emails, but only discovered this ticket via the RSS-feed - did you get emails for this ticket?

  Changed 5 years ago by claus

  • status changed from new to closed
  • resolution set to wontfix

As one example of weird preferences: on my system, the default browser is not the one I use for Haddock browsing.

For now, I've just added a link to your blog entry, for Mac users.

(Ticket confirmation emails weren't working when your ticket was submitted, but should work now.)

in reply to: ↑ 1   Changed 5 years ago by spl

I don't understand the complaint against having a default configuration option. The point of a default is to allow a system to work immediately and to reduce the need for customization. It makes applications much easier to use if there are few or no configuration options to get started.

Selecting the default browser as the default value for this makes perfect sense to me. People usually use their default browser, otherwise it wouldn't be the default or they don't know how to change (and probably wouldn't be using Vim in that case).

None of this negates the idea of customization. If you have a default, it does not mean you cannot change it. That is the power of editors like Vim that allow for a wide range of customization.

  Changed 5 years ago by spl

To respond to your other questions...

No reason for not including the file:// prefix. I got to a point that worked, and I stopped. Is the file:// prefix necessary for some reason? open does the right thing for HTML files.

I used open primarily because it uses the current browser if it is already open. I'm using Firefox, and I get a new tab when I use open. If I were to call the executable directly, it would complain and tell me that I already have one instance of Firefox open (which I always do). So, it's more than just opening in the background.

Thanks for the pointer to the documentation tarballs.

I didn't get an email for your first response, but I did for you second. Thanks for fixing that.

  Changed 5 years ago by claus

  • status changed from closed to reopened
  • resolution wontfix deleted

I agree about defaults - that is why the scripts have so many. But defaults cannot always be right, and I've found it misleading to assume that all Vim users are happy with re-configuring defaults. Perhaps the specific complaints about default browsers came from users on systems where there was no easily configurable system default. So I'm willing to give it another try for Macs.

One concern about general program launchers: they launch any program. If the scripts mess things up, a browser will have more safeguards against trying to run (rather than view) the mess than the launcher. If you can assure me that this isn't an issue for Mac open, I could set your suggested default.

Hmm, but what Vim feature switch to use (:help feature-list)? mac, macunix, or gui_mac? Does that default work best for gui_running, or will it also satisfy terminal-only Vim users (some of which are happy with GUI browsers, others insist on terminal-mode browsers and things like screen to switch views)?

Tying browser-specific window reuse issues into this would be not be an argument for making it a default, but might be useful to document such tips in your blog entry.

Note: See TracTickets for help on using tickets.