1

I sometimes leave large blocks of comments in LaTeX source code:

Text text text text.

% Comments comments comments comments.
% Six lines of comments.
% More comments.

% Separate comment block.
% Eight lines of comments.
% More comments.

More text.

Navigating within these comment blocks can be difficult, because emacs acts as though they were not there at all; C-up (backward-paragraph) and C-down (forward-paragraph) skip past any number of comments and blank lines, and the cursor ends up past the next block of text lines.

I would like emacs to treat such comment blocks exactly as it treats normal text, so that C-up and C-down will stop on blank lines between comment lines and regular text, or between comment lines.

I looked at tex-mode.el. There's a macro named tex-search-noncomment that seems related to this, but I'm not sure what to do about it. My elisp-fu is very weak.

I'm using emacs 23.4.1.

  • AUCTeX works exactly in the way you like. – giordano Mar 1 '16 at 10:22
  • @giordano Hmm, sounds like something I should try, for more reasons than this. Thanks. – Tom Zych Mar 1 '16 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.