|
From: | Stefan Monnier |
Subject: | Re: Can one modify a variable definition in a major mode depending on buffer name? |
Date: | Sat, 30 Jul 2016 13:37:28 -0400 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
> My use case is modifying our perl6-mode for the slight difference in > allowable identifiers between Perl 6 and NQP (Not Quite Perl). By > convention, nqp files end in ".nqp" so that the buffer name should be a > good way to automatically change the single regex bound to a var name in > the mode file. That would save having to write another major mode just for > such a small change. (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
[Prev in Thread] | Current Thread | [Next in Thread] |