hrs / engine-mode

Minor mode for defining and querying search engines through Emacs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: default engine

Hugo-Heagren opened this issue · comments

I do most of my searching through the same engine. I'd like to be able to set it as a default, and have a simple keybinding for 'just search', which searches using it. I liked the way w3m allowed me to handle this, the principle searching key sequence (in engine-mode's case, engine/keybinding-prefix) searched with the default engine by default, and with others if a prefix arg was passed.

Of course, some/many users might not like this, so it could be configurable with a custom variable. Perhaps for those users the behaviour could be the reverse: normally let the user choose an engine, but with a prefix arg always use the default one.

I would be happy to implement this if you would accept a PR!

commented

This would be a neat feature!

the principle searching key sequence searched with the default engine by default, and with others if a prefix arg was passed.

Perhaps this could be a repeated press of the last key of the engine-mode-prefixed-map, e.g. C-c /, pressing / once more would send the query to the default search engine.

Maybe defengine can be modified to accept a new :default property to denote the default search engine.

What do you think?

Sorry to be negative, but I think I'd rather not include this feature for now. I'm not sure that it's necessary, since a user can already manually bind, say, engine/search-duckduckgo to any key they'd like. I really do appreciate the proposal, though! 😄

Perhaps this could be a repeated press of the last key of the engine-mode-prefixed-map, e.g. C-c /, pressing / once more would send the query to the default search engine.

That would be clever, but I'm not sure it's necessary in practice, since it's possible to imitate that functionality with something like :keybinding "/". I worry that binding a default engine automatically based on the last key of the keymap prefix would be more surprising for users than having them manually and explicitly bind that last key themselves. But again, though, thanks for the suggestion!

commented

Hey @hrs,

Thank you for your honesty and feedback on the requested features.