* bug#1013: 23.0.60; permanent-local not honored for word-wrap
@ 2008-09-21 20:31 ` Lennart Borgman (gmail)
2008-09-21 22:25 ` Lennart Borgman (gmail)
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Lennart Borgman (gmail) @ 2008-09-21 20:31 UTC (permalink / raw)
To: emacs-pretest-bug
In a new buffer evaluate this:
(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.
In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
of 2008-09-18
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags
-Ic:/g/include -fno-crossjumping'
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#1013: 23.0.60; permanent-local not honored for word-wrap
2008-09-21 20:31 ` bug#1013: 23.0.60; permanent-local not honored for word-wrap Lennart Borgman (gmail)
@ 2008-09-21 22:25 ` Lennart Borgman (gmail)
2008-09-21 23:13 ` Lennart Borgman (gmail)
2008-09-22 3:35 ` bug#1013: marked as done (23.0.60; permanent-local not honored for word-wrap) Emacs bug Tracking System
2008-09-23 4:30 ` Emacs bug Tracking System
2 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman (gmail) @ 2008-09-21 22:25 UTC (permalink / raw)
To: 1013
[-- Attachment #1: Type: text/plain, Size: 187 bytes --]
I played a bit with making a unit test for this, see the attached file.
This requires the ert2.el that comes with nXhtml and should be placed in
the same subdir as nxhtmltest-suites.el.
[-- Attachment #2: emacstest-suites.el --]
[-- Type: text/plain, Size: 2988 bytes --]
;;; emacstest-suites.el --- Some unit tests for Emacs
;;
;; Author: Lennart Borgman (lennart O borgman A gmail O com)
;; Created: 2008-09-21T22:34:11+0200 Sun
;; Version:
;; Last-Updated:
;; URL:
;; Keywords:
;; Compatibility:
;;
;; Features that might be required by this library:
;;
;; None
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; Unit tests for some Emacs bug reports.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Change log:
;;
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
;; Floor, Boston, MA 02110-1301, USA.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(eval-when-compile (require 'cl))
(setq debug-on-error t)
(defvar emacstest-bin
(file-name-directory (if load-file-name load-file-name buffer-file-name)))
(pushnew emacstest-bin load-path)
(require 'ert2)
(defvar emacstest-files-root
(let* ((this-dir emacstest-bin)
(root (expand-file-name "inemacs/" this-dir)))
(unless (file-accessible-directory-p root)
(error (if (file-exists-p root)
"Can't read files in test directory %s"
"Can't find test directory %s")
root))
root))
(let ((distr-in "c:/EmacsW32/nxhtml/tests/inemacs/"))
(when (file-directory-p distr-in)
(setq nxhtmltest-files-root distr-in)))
(ert-deftest emacs-bug1013 ()
"Emacs bug 1013.
See URL
`http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1013'."
(with-temp-buffer
(insert "
(defvar word-wrap2 nil)
(make-variable-buffer-local 'word-wrap2)
(defcustom word-wrap3 nil
\"doc 3\"
:type 'boolean)
(make-variable-buffer-local 'word-wrap3)
(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)")
(eval-buffer)
(ert-should (eq word-wrap3 t))
(ert-should (eq word-wrap2 t))
(ert-should (eq word-wrap t))
))
(provide 'emacstest-suites)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; emacstest-suites.el ends here
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#1013: 23.0.60; permanent-local not honored for word-wrap
2008-09-21 22:25 ` Lennart Borgman (gmail)
@ 2008-09-21 23:13 ` Lennart Borgman (gmail)
0 siblings, 0 replies; 9+ messages in thread
From: Lennart Borgman (gmail) @ 2008-09-21 23:13 UTC (permalink / raw)
To: 1013, Christian Ohler; +Cc: Phil Hagelberg
[-- Attachment #1: Type: text/plain, Size: 509 bytes --]
Lennart Borgman (gmail) wrote:
> I played a bit with making a unit test for this, see the attached file.
> This requires the ert2.el that comes with nXhtml and should be placed in
> the same subdir as nxhtmltest-suites.el.
Here is a much better way to structure the test. To test it:
- Put emacstest-suites.el in nxhtml/test/
- Put bug1013.el in nxhtml/test/inemacs/
- M-x emacstest-run
If we include ert.el + ert2.el in Emacs we could write unit tests like
this for bug reports.
Christian, any thoughts?
[-- Attachment #2: emacstest-suites.el --]
[-- Type: text/plain, Size: 2949 bytes --]
;;; emacstest-suites.el --- Some unit tests for Emacs
;;
;; Author: Lennart Borgman (lennart O borgman A gmail O com)
;; Created: 2008-09-21T22:34:11+0200 Sun
;; Version:
;; Last-Updated: 2008-09-22T00:36:11+0200 Sun
;; URL:
;; Keywords:
;; Compatibility:
;;
;; Features that might be required by this library:
;;
;; `button', `cl', `debug', `ert', `ert2', `ewoc', `find-func',
;; `help-fns', `help-mode', `view'.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; Unit tests for some Emacs bug reports.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Change log:
;;
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
;; Floor, Boston, MA 02110-1301, USA.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(eval-when-compile (require 'cl))
(setq debug-on-error t)
(defvar emacstest-bin
(file-name-directory (if load-file-name load-file-name buffer-file-name)))
(pushnew emacstest-bin load-path)
(require 'ert2)
(defvar emacstest-files-root
(let* ((this-dir emacstest-bin)
(root (expand-file-name "inemacs/" this-dir)))
(unless (file-accessible-directory-p root)
(error (if (file-exists-p root)
"Can't read files in test directory %s"
"Can't find test directory %s")
root))
root))
(let ((distr-in "c:/EmacsW32/nxhtml/tests/inemacs/"))
(when (file-directory-p distr-in)
(setq emacstest-files-root distr-in)))
(defun emacstest-run ()
"Run Emacs tests."
(interactive)
(setq message-log-max t)
(setq ert-test-files-root emacstest-files-root)
(let ((selector "emacs-"))
(if noninteractive
(ert-run-tests-batch selector)
(ert-kill-temp-test-buffers)
(ert-run-tests-interactively selector)
(other-window 1)
(ert-list-temp-test-buffers))))
(ert-deftest emacs-bug1013 ()
"Emacs bug 1013.
See URL
`http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1013'."
(ert-with-temp-buffer-include-file "bug1013.el"
(eval-buffer)))
(provide 'emacstest-suites)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; emacstest-suites.el ends here
[-- Attachment #3: bug1013.el --]
[-- Type: text/plain, Size: 709 bytes --]
;; 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))
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#1013: marked as done (23.0.60; permanent-local not honored for word-wrap)
2008-09-21 20:31 ` bug#1013: 23.0.60; permanent-local not honored for word-wrap Lennart Borgman (gmail)
2008-09-21 22:25 ` Lennart Borgman (gmail)
@ 2008-09-22 3:35 ` Emacs bug Tracking System
2008-09-22 15:59 ` martin rudalics
2008-09-23 4:30 ` Emacs bug Tracking System
2 siblings, 1 reply; 9+ messages in thread
From: Emacs bug Tracking System @ 2008-09-22 3:35 UTC (permalink / raw)
To: Stefan Monnier
[-- Attachment #1: Type: text/plain, Size: 893 bytes --]
Your message dated Sun, 21 Sep 2008 23:26:15 -0400
with message-id <jwvmyi07tgx.fsf-monnier+emacsbugreports@gnu.org>
and subject line Re: bug#1013: 23.0.60; permanent-local not honored for word-wrap
has caused the Emacs bug report #1013,
regarding 23.0.60; permanent-local not honored for word-wrap
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)
--
1013: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1013
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems
[-- Attachment #2: Type: message/rfc822, Size: 2794 bytes --]
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: emacs-pretest-bug@gnu.org
Subject: 23.0.60; permanent-local not honored for word-wrap
Date: Sun, 21 Sep 2008 22:31:49 +0200
Message-ID: <48D6AF35.7070208@gmail.com>
In a new buffer evaluate this:
(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.
In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
of 2008-09-18
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags
-Ic:/g/include -fno-crossjumping'
[-- Attachment #3: Type: message/rfc822, Size: 1990 bytes --]
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Lennart Borgman \(gmail\)" <lennart.borgman@gmail.com>
Cc: 1013-done@emacsbugs.donarmstrong.com
Subject: Re: bug#1013: 23.0.60; permanent-local not honored for word-wrap
Date: Sun, 21 Sep 2008 23:26:15 -0400
Message-ID: <jwvmyi07tgx.fsf-monnier+emacsbugreports@gnu.org>
> (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.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#1013: marked as done (23.0.60; permanent-local not honored for word-wrap)
2008-09-22 3:35 ` bug#1013: marked as done (23.0.60; permanent-local not honored for word-wrap) Emacs bug Tracking System
@ 2008-09-22 15:59 ` martin rudalics
0 siblings, 0 replies; 9+ messages in thread
From: martin rudalics @ 2008-09-22 15:59 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 1013
>> (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.
Presumably Lennart wants to preserve the previous value when he changes
the major mode. IIUC it is reset because buffer_permanent_local_flags
is 0 for word_wrap. But I'm not sure whether that's TRT and I didn't
find any documentation for this behavior either.
martin
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#1013: 23.0.60; permanent-local not honored for word-wrap
[not found] ` <48D7ADA2.4030605@gmail.com>
@ 2008-09-22 17:38 ` Stefan Monnier
2008-09-22 18:11 ` Lennart Borgman (gmail)
2008-09-23 4:30 ` Processed: " Emacs bug Tracking System
0 siblings, 2 replies; 9+ messages in thread
From: Stefan Monnier @ 2008-09-22 17:38 UTC (permalink / raw)
To: Lennart Borgman (gmail); +Cc: control, 1013
reopen 1013
thanks
> I just tested with truncate-lines. Same bug as with word-wrap.
> Both `word-wrap' and `truncate-lines' are defined using
> DEFVAR_PER_BUFFER. My guess is that there is a bug in DEFVAR_PER_BUFFER
> or something related to that.
Duh, sorry I misread kill-local-variable for kill-all-local-variables
(i.e. I didn't read what you wrote, but what I thought you'd written).
Yes, it's a problem with the variables defined by DEFVAR_PER_BUFFER.
Their semantics is subtly different from the ones declared with
make-variable-buffer-local.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#1013: 23.0.60; permanent-local not honored for word-wrap
2008-09-22 17:38 ` bug#1013: 23.0.60; permanent-local not honored for word-wrap Stefan Monnier
@ 2008-09-22 18:11 ` Lennart Borgman (gmail)
2008-09-23 4:30 ` Processed: " Emacs bug Tracking System
1 sibling, 0 replies; 9+ messages in thread
From: Lennart Borgman (gmail) @ 2008-09-22 18:11 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 1013
Stefan Monnier wrote:
> reopen 1013
> thanks
>
>> I just tested with truncate-lines. Same bug as with word-wrap.
>
>> Both `word-wrap' and `truncate-lines' are defined using
>> DEFVAR_PER_BUFFER. My guess is that there is a bug in DEFVAR_PER_BUFFER
>> or something related to that.
>
> Duh, sorry I misread kill-local-variable for kill-all-local-variables
> (i.e. I didn't read what you wrote, but what I thought you'd written).
>
> Yes, it's a problem with the variables defined by DEFVAR_PER_BUFFER.
> Their semantics is subtly different from the ones declared with
> make-variable-buffer-local.
Thanks. Are there any principal reason that 'permanent-local is not honored?
BTW: Should not variables like `word-wrap' be permanent-local by
default? It looks to me like they are more "per buffer/file" than "per
major mode".
^ permalink raw reply [flat|nested] 9+ messages in thread
* Processed: Re: bug#1013: 23.0.60; permanent-local not honored for word-wrap
2008-09-22 17:38 ` bug#1013: 23.0.60; permanent-local not honored for word-wrap Stefan Monnier
2008-09-22 18:11 ` Lennart Borgman (gmail)
@ 2008-09-23 4:30 ` Emacs bug Tracking System
1 sibling, 0 replies; 9+ messages in thread
From: Emacs bug Tracking System @ 2008-09-23 4:30 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Emacs Bugs
Processing commands for control@emacsbugs.donarmstrong.com:
> reopen 1013
bug#1013: 23.0.60; permanent-local not honored for word-wrap
bug reopened, originator not changed.
> thanks
Stopping processing here.
Please contact me if you need assistance.
Don Armstrong
(administrator, Emacs bugs database)
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#1013: marked as done (23.0.60; permanent-local not honored for word-wrap)
2008-09-21 20:31 ` bug#1013: 23.0.60; permanent-local not honored for word-wrap Lennart Borgman (gmail)
2008-09-21 22:25 ` Lennart Borgman (gmail)
2008-09-22 3:35 ` bug#1013: marked as done (23.0.60; permanent-local not honored for word-wrap) Emacs bug Tracking System
@ 2008-09-23 4:30 ` Emacs bug Tracking System
2 siblings, 0 replies; 9+ messages in thread
From: Emacs bug Tracking System @ 2008-09-23 4:30 UTC (permalink / raw)
To: Lennart Borgman (gmail)
[-- Attachment #1: Type: text/plain, Size: 872 bytes --]
Your message dated Mon, 22 Sep 2008 16:37:22 +0200
with message-id <48D7ADA2.4030605@gmail.com>
and subject line Re: bug#1013: 23.0.60; permanent-local not honored for word-wrap
has caused the Emacs bug report #1013,
regarding 23.0.60; permanent-local not honored for word-wrap
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)
--
1013: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1013
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems
[-- Attachment #2: Type: message/rfc822, Size: 2794 bytes --]
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: emacs-pretest-bug@gnu.org
Subject: 23.0.60; permanent-local not honored for word-wrap
Date: Sun, 21 Sep 2008 22:31:49 +0200
Message-ID: <48D6AF35.7070208@gmail.com>
In a new buffer evaluate this:
(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.
In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
of 2008-09-18
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags
-Ic:/g/include -fno-crossjumping'
[-- Attachment #3: Type: message/rfc822, Size: 2535 bytes --]
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 1013-done@emacsbugs.donarmstrong.com
Subject: Re: bug#1013: 23.0.60; permanent-local not honored for word-wrap
Date: Mon, 22 Sep 2008 16:37:22 +0200
Message-ID: <48D7ADA2.4030605@gmail.com>
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.
I just tested with truncate-lines. Same bug as with word-wrap.
Both `word-wrap' and `truncate-lines' are defined using
DEFVAR_PER_BUFFER. My guess is that there is a bug in DEFVAR_PER_BUFFER
or something related to that.
Stefan, could it be that you forgot about `permanent-local' when you
implemented this?
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-09-23 4:30 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <jwvmyi07tgx.fsf-monnier+emacsbugreports@gnu.org>
2008-09-21 20:31 ` bug#1013: 23.0.60; permanent-local not honored for word-wrap Lennart Borgman (gmail)
2008-09-21 22:25 ` Lennart Borgman (gmail)
2008-09-21 23:13 ` Lennart Borgman (gmail)
2008-09-22 3:35 ` bug#1013: marked as done (23.0.60; permanent-local not honored for word-wrap) Emacs bug Tracking System
2008-09-22 15:59 ` martin rudalics
2008-09-23 4:30 ` Emacs bug Tracking System
[not found] ` <48D7ADA2.4030605@gmail.com>
2008-09-22 17:38 ` bug#1013: 23.0.60; permanent-local not honored for word-wrap Stefan Monnier
2008-09-22 18:11 ` Lennart Borgman (gmail)
2008-09-23 4:30 ` Processed: " Emacs bug Tracking System
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.