Add highlight-symbol-nav-mode #15

Merged
merged 1 commit into from Nov 3, 2013

3 participants

@lunaryorn

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.

@lunaryorn lunaryorn Add highlight-symbol-nav-mode
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.
ae5e98f
@lunaryorn lunaryorn referenced this pull request in melpa/melpa Nov 3, 2013
Merged

Add Smartscan #1140

@purcell

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

@lunaryorn

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

@purcell

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.

@lunaryorn

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

@nschum
Owner

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

@lunaryorn

@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
Owner

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 nschum merged commit ae5e98f into nschum:master Nov 3, 2013

1 check passed

Details default The Travis CI build passed
@nschum
Owner

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

@purcell

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

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

@lunaryorn lunaryorn deleted the unknown repository branch Nov 4, 2013
@lunaryorn lunaryorn added a commit to lunaryorn/.emacs.d that referenced this pull request Nov 4, 2013
@lunaryorn lunaryorn Use highlight-symbol-nav-mode 3280615
@lunaryorn

@nschum Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment