From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tom Browder Newsgroups: gmane.emacs.help Subject: Re: Can one modify a variable definition in a major mode depending on buffer name? Date: Mon, 1 Aug 2016 20:35:53 -0500 Message-ID: References: <87fuqoc61w.fsf@web.de> NNTP-Posting-Host: blaine Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1470101792 2718 195.159.176.226 (2 Aug 2016 01:36:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 2 Aug 2016 01:36:32 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" , Stefan Monnier To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 02 03:36:28 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUOdA-0000Uz-1G for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Aug 2016 03:36:28 +0200 Original-Received: from localhost ([::1]:53577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUOd6-0001Ah-F3 for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Aug 2016 21:36:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUOce-0001AR-Tr for help-gnu-emacs@gnu.org; Mon, 01 Aug 2016 21:35:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUOcc-0007CU-Vd for help-gnu-emacs@gnu.org; Mon, 01 Aug 2016 21:35:55 -0400 Original-Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]:34863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUOcc-0007BZ-Q4 for help-gnu-emacs@gnu.org; Mon, 01 Aug 2016 21:35:54 -0400 Original-Received: by mail-oi0-x233.google.com with SMTP id 4so6890635oih.2 for ; Mon, 01 Aug 2016 18:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=umhUDLJ4YNpt+22TkjjbPMCPg3B/KmyYsfC9JAAqOT8=; b=QOl2AigdWG7wC3HzfJG6v3rkP8sME6TTMBZYLTDIZzfwwt9E07lRSKRmxvzyIWLF3U bpJVLEHCV2iGVdYwUQeHw17CKOUABntKHgRmNP6rsD3Tjj0p/ZQ0I1P8SsNTbacNSyTY yecwWHH5V+pdXFf9Ypg61ZX5vN4Lv8LCYod5QcwVzWd2rZi5dnffEUOzXK6Q4jAQ92xt mDcA4iOb+mQi52UkYHDUdS+wmVciLN98P3O+iuMuzSH3VCHyn/469VIJKJURWV0DMYWe QDIaTTHN2dblpf80OXHzZcP2sGILe6Oj573UFGtxNs9yNh63RciNzSpdUAlWu/45vHmF zLmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=umhUDLJ4YNpt+22TkjjbPMCPg3B/KmyYsfC9JAAqOT8=; b=F8AlHhzuK18TiPKcobyjyjg4WNj4/JZcmueTa05UQQ1taNfbEt82GUV1D69wZ92i0z Drypl3Gv1k2ejAO4h4aADUEpoX4ydDRLDZJHW8ucoWPjSaOQm70aeDeD6ir+5fMeXBRX hqJQ96zxqpCRvcoCiGoAoJLGlS0ZKmQKaK5WDd4v0tN4h/VlkoD2imrB/QV/AEtvGWgN QFh38L75IeYf3MYy1riX6siJZ9loRiFDmKMsGn0rMOKYb3Hr6f6cS/30Er72VdMMXXPi xHt3i9opAnZCvMa6vD4lc+p5B9UH34DxwZPov54NzBMyKajOCo7SwuSgReEvOh0L4ZKI raqg== X-Gm-Message-State: AEkoouveurlm2ZNA9Z+t7EhFOlum3yO6/qr/t06De820kespXoZsxjgRiundUUQrz29xxGXUDllPg2QYGbGXhg== X-Received: by 10.202.244.85 with SMTP id s82mr11628883oih.100.1470101754136; Mon, 01 Aug 2016 18:35:54 -0700 (PDT) Original-Received: by 10.157.62.135 with HTTP; Mon, 1 Aug 2016 18:35:53 -0700 (PDT) In-Reply-To: <87fuqoc61w.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::233 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111038 Archived-At: On Monday, August 1, 2016, Michael Heerdegen wrote: > Tom Browder > writes: > > > > (add-to-list 'auto-mode-alist '("\\.nqp\\'" . nqp-mode)) > > > > > > (define-derived-mode nqp-mode perl-mode "NQP" > > > "Major mode for NQP's subset of Perl 6." > > > (setq-local the-var-i-need-to-change the-new-value)) > > > > > > Stefan, are those lines the entire contents of a "nqp-mode.el" file? > > [I'm not Stefan] > > Yes, that should exactly do what you want. It's more or less the > canonical solution for your problem (do you miss anything?). Thanks, Michael. The reason I asked if that was all is that often we see a solution that is not exactly "cookbook" because it leaves out things that make it complete. I have not tried it yet but will tomorrow. Best regards, -Tom