views:

72

answers:

1

I remember seeing this functionnality while editing elisp code, using a config cloned from someone on github. However, I can't find it anymore, and would especially like to know if this feature is possible using other major modes (especially javascript, ruby, and maybe nXhtml).

A: 

Block scope? Do you mean highlight the current function? If so, your function is mark-defun usually bound to C-M-h.

Specific language modes (like the python-mode) have extra functions to mark the current class/block etc.

Noufal Ibrahim
Maybe I should edit my question to clarify, but I meant dynamically highlighting, as the point is moved through the source. The example of this functionality I saw didn't involve marking though.
julien
Dynamically highlighting? `which-function-mode` will show you what function you're in in the modeline. Is that what you're looking for? IF not, can you elaborate what you mean by dynamic highlighting?
Noufal Ibrahim
That's pretty good, but I was hoping for more visual feedback. Basically I mean when the point moves to a function declaration or into its body, there would be some highlighting done from the begining to the end of the block. It would help quickly spotting missing delimiter errors and such... Catch my drift ?
julien
I'm not aware of such a function. I often do the `mark-defun` I've mentioned in the answer and then `narrow-to-region` (or you could just use `narrow-to-defun`) to focus only the function I'm editing.
Noufal Ibrahim
well, guess that will have to do for now.
julien