From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josh Newsgroups: gmane.emacs.bugs Subject: bug#13685: a way to say that dir-locals should only apply to buffers with files Date: Tue, 12 Feb 2013 19:24:19 -0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1360725947 1695 80.91.229.3 (13 Feb 2013 03:25:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Feb 2013 03:25:47 +0000 (UTC) Cc: 13685@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 13 04:26:08 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U5Syt-0004zy-VD for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Feb 2013 04:26:00 +0100 Original-Received: from localhost ([::1]:58135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5Sya-0004Rr-FX for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Feb 2013 22:25:40 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5SyW-0004Rm-Dl for bug-gnu-emacs@gnu.org; Tue, 12 Feb 2013 22:25:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5SyT-0007Fl-P1 for bug-gnu-emacs@gnu.org; Tue, 12 Feb 2013 22:25:36 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5SyT-0007Fh-Lv for bug-gnu-emacs@gnu.org; Tue, 12 Feb 2013 22:25:33 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U5Syw-0004T6-Ee for bug-gnu-emacs@gnu.org; Tue, 12 Feb 2013 22:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Josh Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Feb 2013 03:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13685 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13685-submit@debbugs.gnu.org id=B13685.136072592217103 (code B ref 13685); Wed, 13 Feb 2013 03:26:02 +0000 Original-Received: (at 13685) by debbugs.gnu.org; 13 Feb 2013 03:25:22 +0000 Original-Received: from localhost ([127.0.0.1]:53009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5SyI-0004Ro-4l for submit@debbugs.gnu.org; Tue, 12 Feb 2013 22:25:22 -0500 Original-Received: from mail-qe0-f41.google.com ([209.85.128.41]:51024) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U5SyF-0004Re-Jy for 13685@debbugs.gnu.org; Tue, 12 Feb 2013 22:25:20 -0500 Original-Received: by mail-qe0-f41.google.com with SMTP id 7so353995qeb.28 for <13685@debbugs.gnu.org>; Tue, 12 Feb 2013 19:24:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=O2L10uRqzqF5LVipt67Lv/GiYXi79X/oe4XGP/znWsY=; b=ja/rMlZa7uMphk+XA5HX6RMyDVtObyERQwDvcR/+rY9q5AAMbnA2vAjEUMZCo1Z55q aq0218CuPAbC+dRE/YRK3ERwfNdiNFN4hmDY7adi0l9/9x0xdSJtFmuukR1cH0yOrfa+ 8L5dtKWBRGbpTOyKuAUtO13C5CGUcGiCZJzyRcOTiP+VdS1K+SN7ykgPIMbgHOwX53nF m1OaUL6X4JILJk30rrEjP12i2az4OMX08wBJGZDxpRv5fJQwuRj+egTEml0kMY/I8Rdu hFRgmx25M3noNYMJ7YpCnlarfiy2RbuBuvwnISjpuJDij1/jt3+t4ZgYy0Uhlr6v7ddh ytVQ== X-Received: by 10.49.59.131 with SMTP id z3mr9206182qeq.1.1360725889844; Tue, 12 Feb 2013 19:24:49 -0800 (PST) Original-Received: by 10.49.109.99 with HTTP; Tue, 12 Feb 2013 19:24:19 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: 5jp8tM92QOxoitpjQYv5Tj9XhNs X-Gm-Message-State: ALoCoQlVm4OTiDBqHwnpwmnKyydXa8J9GNbERg8sDl0XX0nrtysgQB42muCOmgttZ1ToYenff9GE X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:71137 Archived-At: On Mon, Feb 11, 2013 at 6:32 PM, Glenn Morris wrote: > Glenn Morris wrote: > >> I think there should be some way in a dir-locals file to say >> "these settings should only be applied to buffers with files". >> Sometimes some options are not appropriate for file-less buffers. >> Ref bug#11127. > > This seems easy to do, but I don't know what the best UI is. > An element in the dir-locals list: > > (fileonly . t) > > or > > (apply-to . files) Or more generally, the cdr could specify a predicate taking a single argument (the buffer), e.g. (apply-if . buffer-file-name) > The latter allows for > > (apply-to . nonfiles) > > as well (though I can't think of a use for that). Likewise, (apply-if . (lambda (buffer) (not (buffer-file-name buffer))))