GNU bug report logs - #1013
23.0.60; permanent-local not honored for word-wrap

Previous Next

Package: emacs;

Reported by: "Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>

Date: Sun, 21 Sep 2008 20:40:04 UTC

Severity: normal

Done: "Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #43 received at 1013-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 1013-done <at> debbugs.gnu.org
Subject: Re: bug#1013: 23.0.60; permanent-local not honored for word-wrap
Date: Mon, 22 Sep 2008 08:42:54 +0200
Stefan Monnier wrote:
>>   (put 'word-wrap 'permanent-local t)
>>   (setq word-wrap t)
>>   (kill-all-local-variables)
> 
>> and then look at word-wrap. It is nil, but it should be t.
> 
> Why should it?  word-wrap is automatically made local, so the `setq' is
> really like (set (make-local-variable 'word-wrap) t), thus not changing
> the global value at which is you'll be looking in the end.

Is there something I am missing? The three variables below are all
automatically buffer local, they are all three `permanent-local, but
only `word-wrap' looses it buffer local value? (Only the last test below
fails.)

From (info "(elisp) Creating Buffer-Local"):

   A buffer-local variable is "permanent" if the variable name (a
   symbol) has a `permanent-local' property that is non-`nil'.

==== Here is the test file again ===
;; Setup
(defvar word-wrap2 nil)
(make-variable-buffer-local 'word-wrap2)
(set-default 'word-wrap2 nil)

(defcustom word-wrap3 nil
  "doc 3"
  :type 'boolean)
(make-variable-buffer-local 'word-wrap3)
(set-default 'word-wrap3 nil)

(set-default 'word-wrap nil)

(put 'word-wrap  'permanent-local t)
(put 'word-wrap2 'permanent-local t)
(put 'word-wrap3 'permanent-local t)

(setq word-wrap t)
(setq word-wrap2 t)
(setq word-wrap3 t)

(kill-all-local-variables)

;; Test
(ert-should (eq (default-value 'word-wrap3) nil))
(ert-should (eq word-wrap3 t))
(ert-should (eq (default-value 'word-wrap2) nil))
(ert-should (eq word-wrap2 t))
(ert-should (eq (default-value 'word-wrap) nil))
(ert-should (eq word-wrap t))




This bug report was last modified 16 years and 246 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.