Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add highlight-symbol-nav-mode #15

Merged
merged 1 commit into from
Nov 3, 2013
Merged

Add highlight-symbol-nav-mode #15

merged 1 commit into from
Nov 3, 2013

Conversation

swsnr
Copy link
Contributor

@swsnr swsnr commented Nov 2, 2013

This minor mode binds highlight-symbol-prev and highlight-symbol-next to M-p
and M-n respectively.

It is not particularly advanced, but quite convenient.

This minor mode binds highlight-symbol-prev and highlight-symbol-next to
M-p and M-n respectively.

It is not particularly advanced, but quite convenient.
@swsnr swsnr mentioned this pull request Nov 3, 2013
@purcell
Copy link

purcell commented Nov 3, 2013

Would be nice to have a globalized variant of this too.

@swsnr
Copy link
Contributor Author

swsnr commented Nov 3, 2013

@purcell I'll add one, if @nschum is generally willing to accept this feature.

@purcell
Copy link

purcell commented Nov 3, 2013

I'm a big fan of wrapping groups of related interactive functions into minor mode + global minor mode pairs. Seems to give the best blend of flexibility and convenience.

@swsnr
Copy link
Contributor Author

swsnr commented Nov 3, 2013

@purcell I'm as well :), but @nschum might think differently :)

@nschum
Copy link
Owner

nschum commented Nov 3, 2013

While I'm not a fan of such groupings, I don't mind adding it by popular demand. :)

I'm not opposed to a global mode, either, but could there be any problems in special buffers? (See my concerns in #11.)

@swsnr
Copy link
Contributor Author

swsnr commented Nov 3, 2013

@nschum I don't know, whether there could be problems. It is possible to inhibit a global mode in specific buffers, but I have no clue, what prerequisites a buffer must fulfill to be compatible with symbol navigation. I haven't looked at the source of these functions.

Shouldn't you know which modes are incompatible?

@nschum
Copy link
Owner

nschum commented Nov 3, 2013

Well, as I said in #11: I only enable the keybindings in coding modes, so I haven't really tested anywhere else. I also generally don't use global modes.

Before merging a global mode, I'd like to know it's been tested a bit so there aren't any surprises.

nschum added a commit that referenced this pull request Nov 3, 2013
@nschum nschum merged commit ae5e98f into nschum:master Nov 3, 2013
@nschum
Copy link
Owner

nschum commented Nov 3, 2013

I guess merging the commit automatically closes the PR. That's not an indication I've decided against a global mode. :)

@purcell
Copy link

purcell commented Nov 3, 2013

You're right that hooking prog-mode would get us most of the way there. The main thing is to have a nice specific keymap for the mode.

As far as default restrictions for global modes go, I find this a fairly conservative "turn-on" function template:

(defun turn-on-my-magic-mode ()
  (unless (or (minibufferp)
              (derived-mode-p 'special-mode 'view-mode 'comint-mode))
    (my-magic-mode 1)))

@purcell
Copy link

purcell commented Nov 3, 2013

But @lunaryorn or I can now easily try a globalized version of this minor mode locally and see if it makes sense. So thanks for merging. :-)

@swsnr swsnr deleted the nav-mode branch November 4, 2013 07:39
@swsnr
Copy link
Contributor Author

swsnr commented Nov 4, 2013

@nschum Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants