unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Sergey Konoplev <gray.ru@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Whitespace mode toggling after setting directory local variables problem
Date: Sat, 26 Feb 2011 15:40:28 +0300	[thread overview]
Message-ID: <AANLkTimJcUp4hbHuZk-tH0pREcaNq8BEvdyshzKLskW_@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

Hi, all.

I added perl-mode-hook toggling whitespace mode globally. I also use
dir-locals-set-class-variables to set tab-width and indent-tabs-mode
in perl-mode for a project directory. When I open a perl file from
this directory it sets the variables properly but whitespace-mode
looks like it needs to be re-toggled because it highlights some places
according to the global set tab-width and indent-tabs-mode settings.
How to re-toggle it automatically after setting directory local
variables?

See my perl-mode related configuration is in the attachment.

Thank you in advance.

-- 
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com /
Linkedin: http://ru.linkedin.com/in/grayhemp /
JID/GTalk: gray.ru@gmail.com / Skype: gray-hemp

[-- Attachment #2: perl.el --]
[-- Type: text/x-emacs-lisp, Size: 831 bytes --]

;; Minor modes
(add-hook 'perl-mode-hook 'whitespace-mode)
(add-hook 'perl-mode-hook 'capitalized-words-mode)
;(add-hook 'perl-mode-hook 'flyspell-mode)
;; perlcritic
(require 'cl) ; perlcritic needs it
(autoload 'perlcritic "perlcritic" "" t)
(autoload 'perlcritic-region "perlcritic" "" t)
(autoload 'perlcritic-mode "perlcritic" "" t)
(eval-after-load "perl-mode"
  '(add-hook 'perl-mode-hook 'perlcritic-mode))

;; Indentation settings
(add-hook 'perl-mode-hook
	  '(lambda ()
	     (setq
	      ;; Insert spaces instead of tabs
	      indent-tabs-mode nil
	      tab-width 4)))

;; Add postgresql-consulting specifics
(dir-locals-set-class-variables
 'postgresql-consulting '((perl-mode . ((indent-tabs-mode . t)
					(tab-width . 4)))))
(dir-locals-set-directory-class
 "~/repo/postgresql-consulting" 'postgresql-consulting)

             reply	other threads:[~2011-02-26 12:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-26 12:40 Sergey Konoplev [this message]
2011-03-01  8:45 ` Whitespace mode toggling after setting directory local variables problem Sergey Konoplev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimJcUp4hbHuZk-tH0pREcaNq8BEvdyshzKLskW_@mail.gmail.com \
    --to=gray.ru@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).