Questions tagged [newlines]

68 questions
73
votes
2 answers

How to convert DOS/Windows newline characters to Unix format within GNU Emacs?

Is there a way to tell GNU Emacs to convert DOS/Windows newline characters in a file to Unix format?
Charo
  • 925
  • 1
  • 9
  • 11
8
votes
2 answers

How to examine the new line characters in emacs?

I want to check if there is a "\r" at the end of a line of a plain text file (compressed as .gz file). I try the whitespace mode, and I don't find ^M shown. Is \r shown as ^M in whitespace mode? But my python program says something is wrong with…
Tim
  • 5,007
  • 7
  • 32
  • 61
1
vote
1 answer

How to count the number of lines between two points? (ignoring word wrap)

Is there a convenient way to count the number of lines between two points? While I could search for \n in a loop and limit it to one of the points, this seems like an overly verbose way of doing it.
ideasman42
  • 8,786
  • 1
  • 32
  • 114
1
vote
4 answers

Recursively insert a new line character in every line at a certain column

I was just going to ask how to accomplish this, but through a few DuckDuckGo searches, I was able to answer a lot of my question. I have a buffer of part numbers and part number descriptions each in a single line like this... 123456789 Description1 …
CigEmacs
  • 15
  • 5
0
votes
0 answers

Using terpri to insert newlines in buffer

I am using (insert "\n") to insert a newline in a specified buffer. Is this the recommended way to do it? I have seen (terpri) but cannot get it to make a newline. (defun fire-clock (bufrn) "TODO." (interactive) (let ( (ss (nth 0…
Dilna
  • 1
  • 3
  • 11
0
votes
0 answers

Changing the definition of the paragraph

I would like to change the definition of the paragraph in such a way that every line to be considered as a paragraph. As I understand from the documentation, one should change the variables paragraph-start and paragraph-separate for this purpose. I…
Name
  • 7,849
  • 4
  • 41
  • 87