unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Detect end-of-line format
@ 2021-02-02  5:03 Joe Riel
  2021-02-02  8:20 ` Philipp Stephani
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Riel @ 2021-02-02  5:03 UTC (permalink / raw)
  To: help-gnu-emacs

Is there an emacs function that indicates the end-of-line
format (unix, dos, mac) used in the file associated with
a buffer?

-- 
Joe Riel




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Detect end-of-line format
  2021-02-02  5:03 Detect end-of-line format Joe Riel
@ 2021-02-02  8:20 ` Philipp Stephani
  2021-02-02 16:02   ` Joe Riel
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Stephani @ 2021-02-02  8:20 UTC (permalink / raw)
  To: Joe Riel; +Cc: help-gnu-emacs

Am Di., 2. Feb. 2021 um 06:04 Uhr schrieb Joe Riel <joer@san.rr.com>:
>
> Is there an emacs function that indicates the end-of-line
> format (unix, dos, mac) used in the file associated with
> a buffer?
>

Try
(coding-system-eol-type buffer-file-coding-system)
or, if the buffer hasn't been decoded yet:
(coding-system-eol-type (detect-coding-region (point-min) (point-max) :highest))



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Detect end-of-line format
  2021-02-02  8:20 ` Philipp Stephani
@ 2021-02-02 16:02   ` Joe Riel
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Riel @ 2021-02-02 16:02 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: help-gnu-emacs

On Tue, 2 Feb 2021 09:20:34 +0100
Philipp Stephani <p.stephani2@gmail.com> wrote:

> Am Di., 2. Feb. 2021 um 06:04 Uhr schrieb Joe Riel <joer@san.rr.com>:
> >
> > Is there an emacs function that indicates the end-of-line
> > format (unix, dos, mac) used in the file associated with
> > a buffer?
> >  
> 
> Try
> (coding-system-eol-type buffer-file-coding-system)
> or, if the buffer hasn't been decoded yet:
> (coding-system-eol-type (detect-coding-region (point-min) (point-max) :highest))
> 

Thanks, the first works for my purposes.

-- 
Joe Riel




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-02 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-02  5:03 Detect end-of-line format Joe Riel
2021-02-02  8:20 ` Philipp Stephani
2021-02-02 16:02   ` Joe Riel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).