all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.