emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis
@ 2009-12-02 19:02 Martin Pohlack
  2009-12-03  8:20 ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Martin Pohlack @ 2009-12-02 19:02 UTC (permalink / raw)
  To: emacs-orgmode

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

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

I observe a strange interaction between whitespace-mode and org-mode
if org-ellipsis is set.

Whenever I use whitespace-toggle-options for customizing
whitespace-mode in a buffer, all org-mode buffers are effected.
Probably their display table is overwritten which only has effect if
org-ellipsis is set?

Steps to reproduce:

* Start emacs as follows (no local init file, start attached minimal
  init file, open two small org-files, also attached):

  $ emacs -q -l init.test.el test1.org test2.org

* Hit F10 in one org-mode buffer once.

* Look at other org-mode buffer to see that spaces are visualized via a
  centered dot.

What *is* happening:

* Other buffers are effected by a supposedly local action (display
  table?).

What *should* be happening:

* No change to other buffers should occur.

I'm not entirely convinced that org-mode is to blame here ...

Emacs  : GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.14.7)
 of 2009-09-17 on monat400
Package: Org-mode version 6.21b
Package: Org-mode version 6.32trans

Org-settings see attachment.

[-- Attachment #2: init.test.el --]
[-- Type: text/plain, Size: 1042 bytes --]

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(org-ellipsis "…"))

(require 'whitespace)

(defvar cycle-whitespace-modes-state 0
  "whitespace mode states:
   0 -> highlighting of stray whitespace, 72 & 80 column lines
   1 -> ws highlighting and identification for tabs and spaces (», ·)")
(make-variable-buffer-local 'cycle-whitespace-modes-state)

(defun my-cycle-whitespace-modes (&optional state)
  (interactive)
  (if state
      (setq cycle-whitespace-modes-state state)
    (setq cycle-whitespace-modes-state
          (mod (1+ cycle-whitespace-modes-state) 2)))
  (case cycle-whitespace-modes-state
    (0
     (whitespace-mode 0)
     )
    (otherwise
     (whitespace-mode 0)
     (whitespace-mode 1)
     (whitespace-toggle-options (list 'tab-mark 'space-mark))
     )))
(global-set-key [f10] 'my-cycle-whitespace-modes)

[-- Attachment #3: test1.org --]
[-- Type: text/plain, Size: 8 bytes --]

abc def

[-- Attachment #4: test2.org --]
[-- Type: text/plain, Size: 8 bytes --]

abc def

[-- Attachment #5: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis
@ 2009-12-02 19:06 Martin Pohlack
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Pohlack @ 2009-12-02 19:06 UTC (permalink / raw)
  To: emacs-orgmode

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

(sorry for the resent, this time with minimal init.test.el)

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

I observe a strange interaction between whitespace-mode and org-mode
if org-ellipsis is set.

Whenever I use whitespace-toggle-options for customizing
whitespace-mode in a buffer, all org-mode buffers are effected.
Probably their display table is overwritten which only has effect if
org-ellipsis is set?

Steps to reproduce:

* Start emacs as follows (no local init file, start attached minimal
  init file, open two small org-files, also attached):

  $ emacs -q -l init.test.el test1.org test2.org

* Hit F10 in one org-mode buffer once.

* Look at other org-mode buffer to see that spaces are visualized via a
  centered dot.

What *is* happening:

* Other buffers are effected by a supposedly local action (display
  table?).

What *should* be happening:

* No change to other buffers should occur.

I'm not entirely convinced that org-mode is to blame here ...

Emacs  : GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.14.7)
 of 2009-09-17 on monat400
Package: Org-mode version 6.21b
Package: Org-mode version 6.32trans

Org-settings see attachment.


[-- Attachment #2: test1.org --]
[-- Type: text/plain, Size: 9 bytes --]

abc def


[-- Attachment #3: test2.org --]
[-- Type: text/plain, Size: 9 bytes --]

abc def


[-- Attachment #4: init.test.el --]
[-- Type: text/plain, Size: 227 bytes --]

(custom-set-variables
 '(org-ellipsis "…"))

(require 'whitespace)

(defun my-whitespace-on ()
  (interactive)
  (whitespace-mode 1)
  (whitespace-toggle-options (list 'space-mark)))

(global-set-key [f10] 'my-whitespace-on)

[-- Attachment #5: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis
  2009-12-02 19:02 Martin Pohlack
@ 2009-12-03  8:20 ` Carsten Dominik
  2009-12-03 21:34   ` Martin Pohlack
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2009-12-03  8:20 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: emacs-orgmode

Hi Martin, this looks to me like a bug in whitespace.el, why does it  
override the display table org-mode is using?

- Carsten

On Dec 2, 2009, at 8:02 PM, Martin Pohlack wrote:

> Remember to cover the basics, that is, what you expected to happen and
> what in fact did happen.  You don't know how to make a good report?   
> See
>
>     http://orgmode.org/manual/Feedback.html#Feedback
>
> Your bug report will be posted to the Org-mode mailing list.
> ------------------------------------------------------------------------
>
> I observe a strange interaction between whitespace-mode and org-mode
> if org-ellipsis is set.
>
> Whenever I use whitespace-toggle-options for customizing
> whitespace-mode in a buffer, all org-mode buffers are effected.
> Probably their display table is overwritten which only has effect if
> org-ellipsis is set?
>
> Steps to reproduce:
>
> * Start emacs as follows (no local init file, start attached minimal
>  init file, open two small org-files, also attached):
>
>  $ emacs -q -l init.test.el test1.org test2.org
>
> * Hit F10 in one org-mode buffer once.
>
> * Look at other org-mode buffer to see that spaces are visualized  
> via a
>  centered dot.
>
> What *is* happening:
>
> * Other buffers are effected by a supposedly local action (display
>  table?).
>
> What *should* be happening:
>
> * No change to other buffers should occur.
>
> I'm not entirely convinced that org-mode is to blame here ...
>
> Emacs  : GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.14.7)
> of 2009-09-17 on monat400
> Package: Org-mode version 6.21b
> Package: Org-mode version 6.32trans
>
> Org-settings see attachment.
> (custom-set-variables
>  ;; custom-set-variables was added by Custom.
>  ;; If you edit it by hand, you could mess it up, so be careful.
>  ;; Your init file should contain only one such instance.
>  ;; If there is more than one, they won't work right.
> '(org-ellipsis "…"))
>
> (require 'whitespace)
>
> (defvar cycle-whitespace-modes-state 0
>  "whitespace mode states:
>   0 -> highlighting of stray whitespace, 72 & 80 column lines
>   1 -> ws highlighting and identification for tabs and spaces (», ·)")
> (make-variable-buffer-local 'cycle-whitespace-modes-state)
>
> (defun my-cycle-whitespace-modes (&optional state)
>  (interactive)
>  (if state
>      (setq cycle-whitespace-modes-state state)
>    (setq cycle-whitespace-modes-state
>          (mod (1+ cycle-whitespace-modes-state) 2)))
>  (case cycle-whitespace-modes-state
>    (0
>     (whitespace-mode 0)
>     )
>    (otherwise
>     (whitespace-mode 0)
>     (whitespace-mode 1)
>     (whitespace-toggle-options (list 'tab-mark 'space-mark))
>     )))
> (global-set-key [f10] 'my-cycle-whitespace-modes)
> abc def
> abc def
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis
  2009-12-03  8:20 ` Carsten Dominik
@ 2009-12-03 21:34   ` Martin Pohlack
  2009-12-04 12:26     ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Martin Pohlack @ 2009-12-03 21:34 UTC (permalink / raw)
  To: Carsten Dominik, emacs-orgmode

Carsten Dominik wrote:
> Hi Martin, this looks to me like a bug in whitespace.el, why does it  
> override the display table org-mode is using?

Hmm, my understanding is that each buffer can have its own display
table, buffer-display-table.  whitespace-mode has to modify this table
(or install an own one) if it wants to do buffer-local modifications.
So I think it modifies org-mode's table but doesn't override it.

My irritation is that by doing so, it does modifies some global state
that effects other buffers.

A short look into org.el shows that org-display-table is never made
buffer local, so this data structure is shared across all org-mode buffers?

The following hack seems to solve this problem:

--- org.el.bak	2009-12-03 22:31:07.000000000 +0100
+++ org.el	2009-12-03 22:31:48.000000000 +0100
@@ -427,9 +427,6 @@
 		 (face :tag "Face" :value org-warning)
 		 (string :tag "String" :value "...#")))

-(defvar org-display-table nil
-  "The display table for org-mode, in case `org-ellipsis' is non-nil.")
-
 (defgroup org-keywords nil
   "Keywords in Org-mode."
   :tag "Org Keywords"
@@ -4170,8 +4167,7 @@
   (when (and org-ellipsis
              (fboundp 'set-display-table-slot) (boundp
'buffer-display-table)
 	     (fboundp 'make-glyph-code))
-    (unless org-display-table
-      (setq org-display-table (make-display-table)))
+    (setq org-display-table (make-display-table))
     (set-display-table-slot
      org-display-table 4
      (vconcat (mapcar


Cheers,
Martin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis
  2009-12-03 21:34   ` Martin Pohlack
@ 2009-12-04 12:26     ` Carsten Dominik
  2009-12-04 15:41       ` Martin Pohlack
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2009-12-04 12:26 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: emacs-orgmode


On Dec 3, 2009, at 10:34 PM, Martin Pohlack wrote:

> Carsten Dominik wrote:
>> Hi Martin, this looks to me like a bug in whitespace.el, why does it
>> override the display table org-mode is using?
>
> Hmm, my understanding is that each buffer can have its own display
> table, buffer-display-table.  whitespace-mode has to modify this table
> (or install an own one) if it wants to do buffer-local modifications.
> So I think it modifies org-mode's table but doesn't override it.
>
> My irritation is that by doing so, it does modifies some global state
> that effects other buffers.
>
> A short look into org.el shows that org-display-table is never made
> buffer local, so this data structure is shared across all org-mode  
> buffers?

Yes, this is the idea, and it seems only logical to me.  So why
do you want different settings in different Org buffers for
whitespace?  So far I am unconvinced that creating a new
table in each buffer with the right thing to do.

- Carsten


>
> The following hack seems to solve this problem:
>
> --- org.el.bak	2009-12-03 22:31:07.000000000 +0100
> +++ org.el	2009-12-03 22:31:48.000000000 +0100
> @@ -427,9 +427,6 @@
> 		 (face :tag "Face" :value org-warning)
> 		 (string :tag "String" :value "...#")))
>
> -(defvar org-display-table nil
> -  "The display table for org-mode, in case `org-ellipsis' is non- 
> nil.")
> -
> (defgroup org-keywords nil
>   "Keywords in Org-mode."
>   :tag "Org Keywords"
> @@ -4170,8 +4167,7 @@
>   (when (and org-ellipsis
>              (fboundp 'set-display-table-slot) (boundp
> 'buffer-display-table)
> 	     (fboundp 'make-glyph-code))
> -    (unless org-display-table
> -      (setq org-display-table (make-display-table)))
> +    (setq org-display-table (make-display-table))
>     (set-display-table-slot
>      org-display-table 4
>      (vconcat (mapcar
>
>
> Cheers,
> Martin

- Carsten

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis
  2009-12-04 12:26     ` Carsten Dominik
@ 2009-12-04 15:41       ` Martin Pohlack
  2009-12-14 16:27         ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Martin Pohlack @ 2009-12-04 15:41 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik wrote:
> On Dec 3, 2009, at 10:34 PM, Martin Pohlack wrote:
> 
>> Carsten Dominik wrote:
>>> Hi Martin, this looks to me like a bug in whitespace.el, why does it
>>> override the display table org-mode is using?
>> Hmm, my understanding is that each buffer can have its own display
>> table, buffer-display-table.  whitespace-mode has to modify this table
>> (or install an own one) if it wants to do buffer-local modifications.
>> So I think it modifies org-mode's table but doesn't override it.
>>
>> My irritation is that by doing so, it does modifies some global state
>> that effects other buffers.
>>
>> A short look into org.el shows that org-display-table is never made
>> buffer local, so this data structure is shared across all org-mode  
>> buffers?
> 
> Yes, this is the idea, and it seems only logical to me.  So why
> do you want different settings in different Org buffers for
> whitespace?  So far I am unconvinced that creating a new
> table in each buffer with the right thing to do.

Ok, I have three argument to support this.

1. Let me start by describing a helper and how I use it.  This is a
   snippet from my init.el:

----8<---------------------------------------------------------->8----
;;;
;;; whitespace stuff
;;;
(when (require 'whitespace nil t)
  (require 'column-marker)

  (defvar cycle-whitespace-modes-state 0
    "whitespace mode states:
     0 -> no whitespace stuff,
     1 -> highlighting of stray whitespace, 72 & 80 column lines
     2 -> ws highlighting and identification for tabs and spaces (», ·)")
  (make-variable-buffer-local 'cycle-whitespace-modes-state)

  (defun my-cycle-whitespace-modes (&optional state)
    (interactive)
    (if state
        (setq cycle-whitespace-modes-state state)
      (setq cycle-whitespace-modes-state
            (mod (1+ cycle-whitespace-modes-state) 3)))
    (case cycle-whitespace-modes-state
      (0
       (whitespace-mode 0)
       (column-marker-1 -2)
       (column-marker-2 -2)
       (column-marker-3 -2))
      (1
       (whitespace-mode 0)
       (whitespace-mode 1)
       (column-marker-1 72)
       (column-marker-2 80))
      (otherwise
       (whitespace-mode 0)
       (whitespace-mode 1)
       (whitespace-toggle-options (list 'tab-mark 'space-mark))
       (column-marker-1 72)
       (column-marker-2 80))))

  (global-set-key [f10] 'my-cycle-whitespace-modes)

  (defun my-whitespace-modes-none () (my-cycle-whitespace-modes 0))
  (defun my-whitespace-modes-some () (my-cycle-whitespace-modes 1))
  (defun my-whitespace-modes-full () (my-cycle-whitespace-modes 2))

  (add-hook 'c-mode-common-hook         'my-whitespace-modes-some)
  ;…
  )
----8<---------------------------------------------------------->8----

I usually have whitespace mode active in a medium warning level
(my-whitespace-modes-some), which show whitespace at end of line etc.

Sometimes, I want to see all spaces and tabs in a single buffer
explicitly, e.g. for aligning stuff manually or debugging things
(my-whitespace-modes-full).

At other times, I want to deactivate all whitespace highlighting
(my-whitespace-modes-none), e.g., when dealing with long lines or when
crafting some ASCII drawings.

I make, all of these decision per buffer.


2. Whitespace-mode is usually buffer local.  Having it modify other
   buffers is irritating.  If global effects are desired there is the
   variable whitespace-global-modes


3. (whitespace-toggle-options …) is documented to modify the local
   buffer only.


Org's global display table de-localizes all of whitespace-mode's local
functionality.

Cheers,
Martin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis
  2009-12-04 15:41       ` Martin Pohlack
@ 2009-12-14 16:27         ` Carsten Dominik
  2009-12-14 19:51           ` Martin Pohlack
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2009-12-14 16:27 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: emacs-orgmode

Hi Martin,

i can follow your arguments and would like to improve this.

What I do not understand yet is this:

I was under the impression that normally, there is only a single
display table in Emacs, and that is the global one and every buffer
will use it.  So it would seem to me that whitespace-mode would normally
*make* a local table in order to put its changes in there.  However,
that does not seem to be the case here.  Can you see why?

- Carsten

On Dec 4, 2009, at 4:41 PM, Martin Pohlack wrote:

> Carsten Dominik wrote:
>> On Dec 3, 2009, at 10:34 PM, Martin Pohlack wrote:
>>
>>> Carsten Dominik wrote:
>>>> Hi Martin, this looks to me like a bug in whitespace.el, why does  
>>>> it
>>>> override the display table org-mode is using?
>>> Hmm, my understanding is that each buffer can have its own display
>>> table, buffer-display-table.  whitespace-mode has to modify this  
>>> table
>>> (or install an own one) if it wants to do buffer-local  
>>> modifications.
>>> So I think it modifies org-mode's table but doesn't override it.
>>>
>>> My irritation is that by doing so, it does modifies some global  
>>> state
>>> that effects other buffers.
>>>
>>> A short look into org.el shows that org-display-table is never made
>>> buffer local, so this data structure is shared across all org-mode
>>> buffers?
>>
>> Yes, this is the idea, and it seems only logical to me.  So why
>> do you want different settings in different Org buffers for
>> whitespace?  So far I am unconvinced that creating a new
>> table in each buffer with the right thing to do.
>
> Ok, I have three argument to support this.
>
> 1. Let me start by describing a helper and how I use it.  This is a
>   snippet from my init.el:
>
> ----8<---------------------------------------------------------->8----
> ;;;
> ;;; whitespace stuff
> ;;;
> (when (require 'whitespace nil t)
>  (require 'column-marker)
>
>  (defvar cycle-whitespace-modes-state 0
>    "whitespace mode states:
>     0 -> no whitespace stuff,
>     1 -> highlighting of stray whitespace, 72 & 80 column lines
>     2 -> ws highlighting and identification for tabs and spaces (»,  
> ·)")
>  (make-variable-buffer-local 'cycle-whitespace-modes-state)
>
>  (defun my-cycle-whitespace-modes (&optional state)
>    (interactive)
>    (if state
>        (setq cycle-whitespace-modes-state state)
>      (setq cycle-whitespace-modes-state
>            (mod (1+ cycle-whitespace-modes-state) 3)))
>    (case cycle-whitespace-modes-state
>      (0
>       (whitespace-mode 0)
>       (column-marker-1 -2)
>       (column-marker-2 -2)
>       (column-marker-3 -2))
>      (1
>       (whitespace-mode 0)
>       (whitespace-mode 1)
>       (column-marker-1 72)
>       (column-marker-2 80))
>      (otherwise
>       (whitespace-mode 0)
>       (whitespace-mode 1)
>       (whitespace-toggle-options (list 'tab-mark 'space-mark))
>       (column-marker-1 72)
>       (column-marker-2 80))))
>
>  (global-set-key [f10] 'my-cycle-whitespace-modes)
>
>  (defun my-whitespace-modes-none () (my-cycle-whitespace-modes 0))
>  (defun my-whitespace-modes-some () (my-cycle-whitespace-modes 1))
>  (defun my-whitespace-modes-full () (my-cycle-whitespace-modes 2))
>
>  (add-hook 'c-mode-common-hook         'my-whitespace-modes-some)
>  ;…
>  )
> ----8<---------------------------------------------------------->8----
>
> I usually have whitespace mode active in a medium warning level
> (my-whitespace-modes-some), which show whitespace at end of line etc.
>
> Sometimes, I want to see all spaces and tabs in a single buffer
> explicitly, e.g. for aligning stuff manually or debugging things
> (my-whitespace-modes-full).
>
> At other times, I want to deactivate all whitespace highlighting
> (my-whitespace-modes-none), e.g., when dealing with long lines or when
> crafting some ASCII drawings.
>
> I make, all of these decision per buffer.
>
>
> 2. Whitespace-mode is usually buffer local.  Having it modify other
>   buffers is irritating.  If global effects are desired there is the
>   variable whitespace-global-modes
>
>
> 3. (whitespace-toggle-options …) is documented to modify the local
>   buffer only.
>
>
> Org's global display table de-localizes all of whitespace-mode's local
> functionality.
>
> Cheers,
> Martin

- Carsten

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis
  2009-12-14 16:27         ` Carsten Dominik
@ 2009-12-14 19:51           ` Martin Pohlack
  2010-01-01 13:34             ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Martin Pohlack @ 2009-12-14 19:51 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Vinicius Jose Latorre, emacs-orgmode

Hi Carsten,

On 14.12.2009 17:27, Carsten Dominik wrote:
> i can follow your arguments and would like to improve this.
> 
> What I do not understand yet is this:
> 
> I was under the impression that normally, there is only a single
> display table in Emacs, and that is the global one and every buffer
> will use it.

Interesting, I had the opposite impression.  I'm not exactly sure why
though.  Maybe from the documentation and name of the variable
buffer-display-table?

Maybe you had standard-display-table in mind?

  "Variable: Display table to use for buffers that specify none.
   See `buffer-display-table' for more information."

I have, however, never seen a spelled out convention regarding deep
sharing of display tables.

> So it would seem to me that whitespace-mode would normally
> *make* a local table in order to put its changes in there.  However,
> that does not seem to be the case here.  Can you see why?

I think whitespace-mode usually assumes that the local display tables
is, well, local.  Therefore, no action would be required.

I forwarded my original bug-report to Vinicius Jose Latorre
(whitespace-mode's maintainer) after you mentioned it would be a
whitespace-mode bug.

He replied:

> Well, the problem was due to the way whitespace deal with 
> buffer-display-table variable.
> 
> I've just fixed this problem in Emacs CVS and EmacsWiki.

Here is the patch:

http://lists.gnu.org/archive/html/emacs-diffs/2009-12/msg00184.html

He basically creates a deep copy (the copy-sequence line) of the local
display table and installs it.  This should solve the problem.


I still have this nagging feeling that the sharing of the display table
is not the right thing to do and would regard the fix in whitespace-mode
as a kind of emergence case backup.  But this is probably purely a style
thing.

Thanks for getting back to me on this matter,
Martin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis
  2009-12-14 19:51           ` Martin Pohlack
@ 2010-01-01 13:34             ` Carsten Dominik
  0 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2010-01-01 13:34 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: Vinicius Jose Latorre, emacs-orgmode


On Dec 14, 2009, at 8:51 PM, Martin Pohlack wrote:

> Hi Carsten,
>
> On 14.12.2009 17:27, Carsten Dominik wrote:
>> i can follow your arguments and would like to improve this.
>>
>> What I do not understand yet is this:
>>
>> I was under the impression that normally, there is only a single
>> display table in Emacs, and that is the global one and every buffer
>> will use it.
>
> Interesting, I had the opposite impression.  I'm not exactly sure why
> though.  Maybe from the documentation and name of the variable
> buffer-display-table?
>
> Maybe you had standard-display-table in mind?
>
>  "Variable: Display table to use for buffers that specify none.
>   See `buffer-display-table' for more information."
>
> I have, however, never seen a spelled out convention regarding deep
> sharing of display tables.
>
>> So it would seem to me that whitespace-mode would normally
>> *make* a local table in order to put its changes in there.  However,
>> that does not seem to be the case here.  Can you see why?
>
> I think whitespace-mode usually assumes that the local display tables
> is, well, local.  Therefore, no action would be required.
>
> I forwarded my original bug-report to Vinicius Jose Latorre
> (whitespace-mode's maintainer) after you mentioned it would be a
> whitespace-mode bug.
>
> He replied:
>
>> Well, the problem was due to the way whitespace deal with
>> buffer-display-table variable.
>>
>> I've just fixed this problem in Emacs CVS and EmacsWiki.
>
> Here is the patch:
>
> http://lists.gnu.org/archive/html/emacs-diffs/2009-12/msg00184.html
>
> He basically creates a deep copy (the copy-sequence line) of the local
> display table and installs it.  This should solve the problem.
>
>
> I still have this nagging feeling that the sharing of the display  
> table
> is not the right thing to do and would regard the fix in whitespace- 
> mode
> as a kind of emergence case backup.  But this is probably purely a  
> style
> thing.

And I do not agree here.  Emacs has a global display tables that is
normally shared across all buffers!  So I would think it is perfectly
OK to one that all buffers of a certain mode share.  If whitespace.el
intends to temporarily modify the display table of a particular buffer
without affecting other, it must make sure that it does this correctly.
In fact it did it already by making a local display table in order
to avoid the global one.  So the fix Vinicius implemented seems to
be the correct solution.

>
> Thanks for getting back to me on this matter,

Thank *you* for pursuing this!

- Carsten

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-01-01 13:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-02 19:06 Org-mode version 6.32trans and 6.21b; Strange interaction between whitespace-mode and cust. org-ellipsis Martin Pohlack
  -- strict thread matches above, loose matches on Subject: below --
2009-12-02 19:02 Martin Pohlack
2009-12-03  8:20 ` Carsten Dominik
2009-12-03 21:34   ` Martin Pohlack
2009-12-04 12:26     ` Carsten Dominik
2009-12-04 15:41       ` Martin Pohlack
2009-12-14 16:27         ` Carsten Dominik
2009-12-14 19:51           ` Martin Pohlack
2010-01-01 13:34             ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).