0

I know how to move to the end of a line, the paragraph, the s-expression, the word, or even the buffer.

But, I do not know how to move to the end of a sentence. Is there some way to move the end of a sentence? Maybe some package or tailor-made command for that?

I suppose it would be necessary to search for the closest punctuation inside the paragraph, such as ., ! or ?.

It could be the same position as the end of the paragraph, but not necessarily the coincidence would happen.

Drew
  • 75,699
  • 9
  • 109
  • 225
Pedro Delfino
  • 1,369
  • 3
  • 13
  • 1
    Does this answer your question? [backword-sentence and forward-sentence are moving over paragraphs](https://emacs.stackexchange.com/questions/2279/backword-sentence-and-forward-sentence-are-moving-over-paragraphs) You say that your other post solves the problem you ask about here. And your other post is a duplicate. So I think this question is also essentially a duplicate. – Drew Jun 01 '22 at 14:46
  • Well, it is a complicated situation. I was unaware of the command. Then, I realized the command was not working. The root of the problem is that I was trying to move to the end of a phrase (sentence). But, I trust on you @Drew. Whatever you feel like it is the best for our community! Since I have been asking a lot about Emacs in the last year or so, thanks a lot for the help provided and keep the good work! :) – Pedro Delfino Jun 01 '22 at 14:58
  • 1
    More votes to close are needed than just mine. And I might well be misjudging. You might be able to tell better than I - you can just delete questions you pose, if you feel that they duplicate existing questions. Thx. – Drew Jun 01 '22 at 15:00

1 Answers1

1

You can navigate by sentences.

M-a Move back to the beginning of the sentence (backward-sentence).
M-e Move forward to the end of the sentence (forward-sentence).

See C-hig (emacs)Sentences for full details.

Take particular note of this:

The sentence commands assume that you follow the American typist’s convention of putting two spaces at the end of a sentence. That is, a sentence ends wherever there is a ., ? or ! followed by the end of a line or two spaces, with any number of ), ], ', or " characters allowed in between. A sentence also begins or ends wherever a paragraph begins or ends. It is useful to follow this convention, because it allows the Emacs sentence commands to distinguish between periods that end a sentence and periods that indicate abbreviations.

If you want to use just one space between sentences, you can set the variable sentence-end-double-space to nil to make the sentence commands stop for single spaces. However, this has a drawback: there is no way to distinguish between periods that end sentences and those that indicate abbreviations. For convenient and reliable editing, we therefore recommend you follow the two-space convention.

phils
  • 48,657
  • 3
  • 76
  • 115
  • thanks! Not sure if something is broken in my config though. It does not seem to work as expected. – Pedro Delfino Jun 01 '22 at 13:59
  • Here, the problem is understood and solved: https://emacs.stackexchange.com/questions/71972/why-is-forward-sentence-moving-the-cursor-to-the-end-of-the-paragraph-and-not-wo/71973#71973 – Pedro Delfino Jun 01 '22 at 14:30
  • 1
    Was it *really* not expected? Your new problem/question was resolved by the specific thing that I had pointed out to you here with the prefix "**Take particular note of this**". – phils Jun 01 '22 at 22:03
  • You are correct. But, the first time I read your reply, I did not fully understand the sentence-end-double-space point. Sorry for misunderstanding your thorough reply. – Pedro Delfino Jun 01 '22 at 22:14