M-x narrow-to-region   - Narrow down to between point and mark

But I need to narrow from cursor position to end of buffer. Is it possible?


The doc-string of narrow-to-region tells us that the mandatory arguments are START and END: "When calling from a program, pass two arguments; positions (integers or markers) bounding the text that should remain visible."

The programmatic location of cursor in the active buffer is point, and the end of the buffer (or end of narrowed region) is point-max. Try typing M-x eval-expression RET (narrow-to-region (point) (point-max)) RET and see the result. A shortcut for eval-expression is M-:.

Another idea would be to hold the shift key down and move the cursor to the end of the buffer and then M-x narrow-to-region aka C-x n n.

| improve this answer | |
  • 1
    If you need this a lot you could define a command with the arguments suggested here. If it's an occasional thing I'd use: C-SPC M-> C-x n n, which would be set-mark-command, end-of-buffer, narrow-to-region. – glucas Jan 12 '19 at 19:12

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.