[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enabling modes

From: Nick Helm
Subject: Re: Enabling modes
Date: Mon, 11 Sep 2017 14:41:51 +1200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (darwin)

Robert Thorpe <> writes:

> I use global-visual-line mode.  I've found a problem with it for one
> file type that I use (tab-separated values).
> So, what I want to do is set visual-line-mode in all buffers except
> those particular ones.
> Usually modes are set up the other way around, by including things.
> Mode X is triggered for languages Y and Z, for example.  I want it the
> opposite way around, I want visual-line-mode to be always enabled unless
> I have a tab-separated-value file.
> Is that possible?

You could use mode hooks, but if you'd prefer to turn it off just for
files with a TSV extension you could add an entry to auto-mode-alist.
Something like this in your init should work:

(add-to-list 'auto-mode-alist '("\\.tsv\\'" . (lambda () (visual-line-mode 

Alternatively, you could use magic-mode-alist to detect the tabbed
format itself, which would work for any extension.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]