From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tomas Hlavaty Newsgroups: gmane.emacs.help Subject: printing configuration per file Date: Sun, 24 Jan 2021 02:11:20 +0100 Message-ID: <875z3nkukn.fsf@logand.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13723"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 24 02:12:23 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3Tx0-0003SX-2w for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 24 Jan 2021 02:12:22 +0100 Original-Received: from localhost ([::1]:39846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3Twz-0006IU-40 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Jan 2021 20:12:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Tw8-0006HZ-K0 for help-gnu-emacs@gnu.org; Sat, 23 Jan 2021 20:11:28 -0500 Original-Received: from logand.com ([37.48.87.44]:48374) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3Tw5-0003Ik-0q for help-gnu-emacs@gnu.org; Sat, 23 Jan 2021 20:11:28 -0500 Original-Received: by logand.com (Postfix, from userid 1001) id 0466F19F173; Sun, 24 Jan 2021 02:11:23 +0100 (CET) X-Mailer: emacs 27.1 (via feedmail 11-beta-1 I) Received-SPF: pass client-ip=37.48.87.44; envelope-from=tom@logand.com; helo=logand.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127333 Archived-At: Hi, I would like to specify printing configuration per file instead of globally. Example: I have a file /foo/a/a.txt and a file /foo/b/b.txt. When I open a.txt, the variables ps-font-size, ps-print-header and ps-print-footer should have specific values. When I open b.txt, those variables should have different values. I do not want to set those variables globaly. What are the ways to achieve that? I tried storing the files in different directories and using .dir-locals.el but that did not work (did not set the values + I want to set the values for a specific file, not for all files in the directory or per mode): --- .dir-locals.el file ;;; Directory Local Variables ;;; For more information see (info "(emacs) Directory Variables") ((nil . ((ps-font-size . 10) (ps-print-header . nil) (ps-print-footer . nil)))) --- eof Ideally, it should also work without having to store the files in different directories. It might work like this: --- a.txt This is a document to be printed. Local variables: ps-font-size: (9 . 11) End: --- eof But the I need to exclude the Local declaration from being printed. Is there an existing way (a function) to get the buffer contents without Local variables section already? Or do I need to remove the Local variables configuration from output myself using my own heuristic? Is there a way to set local variables not per directory like .dir-locals.el does but per file and still using different file? E.g. for /foo/a.txt using /foo/a.txt.file-locals.el? Is there a gui for setting buffer local variables, e.g. something like customize but writing the values to Local variables section or .dir-locals.el file? Is there a way to see buffer local variables? There is (buffer-local-variables) but if I evaluate that in the buffer, *Message* buffer does not contain readable print of that value. I do not want to write a program for this. Thanks, Tomas