|
From: | Herbert Euler |
Subject: | Re: Patch: Syntax and Hard Newlines |
Date: | Fri, 17 Nov 2006 09:24:37 +0800 |
> What about this? > + (if (local-variable-p 'parse-sexp-lookup-properties) > + (setq longlines-parse-sexp-lookup-properties > + parse-sexp-lookup-properties > + longlines-pslp-was-local > + t > + parse-sexp-lookup-properties > + t) > + (setq longlines-pslp-was-local nil) > + (set (make-local-variable 'parse-sexp-lookup-properties) t)) [...] > + (if longlines-pslp-was-local > + (setq parse-sexp-lookup-properties > + longlines-parse-sexp-lookup-properties) > + (kill-local-variable 'parse-sexp-lookup-properties)) It should work with major modes since their activation usually kills all local variables. It won't work if another minor mode eventually needs this too. Suppose you (1) turn on longlines mode with `parse-sexp-lookup-properties' locally nil, (2) turn on a minor mode that sets `parse-sexp-lookup-properties' to t, (3) turn off longlines mode. Hence I'd rather leave this alone when turning off longlines mode.
It seems this shows a conflict between minor modes. `longlines' mode requires `parse-sexp-lookup-properties' to be t, while the other minor mode you refered requires it to be nil. Or at least, the other minor mode works even if it is t, but that is not desirable to the user. This I think is not because Emacs lacks some mechanism to handle local variables well, but rather that it is because the two minor modes are not well-designed so that they conflicts with each other. I cannot imagine a reasonable value for `parse-sexp-lookup-properties' to get a correct behavior when turning on both the two minor modes refered in your example. Regards, Guanpeng Xu _________________________________________________________________Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
[Prev in Thread] | Current Thread | [Next in Thread] |