emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Links and visual-line-mode
@ 2011-06-01 23:32 Scott Randby
  2011-06-02  2:49 ` Nick Dokos
  0 siblings, 1 reply; 15+ messages in thread
From: Scott Randby @ 2011-06-01 23:32 UTC (permalink / raw)
  To: [Orgmode]

This is a problem that has been bugging me for some time because I use
visual-line-mode a lot when I'm working on my org-mode files.

Say I have visual-line-mode turned on when I'm editing an org-mode file.
If I do C-c C-l, put in the link address, hit <Enter>, put in a
description, and hit <Enter>, then the long lines in the document are no
longer wrapped even though "(Org Wrap)" still appears on the mode line.
The only way I've been able to get wrapping back is to do M-x
visual-line-mode twice (which is just leaving the mode and then bringing
it back. This is very inconvenient, especially when I want to enter
several links. Is this a bug or is there an easy way to remind Emacs
that it is in visual-line-mode and that it should wrap long lines?

I have org-mode 7.5 on Emacs 23.2.1

Scott Randby

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

* Re: Links and visual-line-mode
  2011-06-01 23:32 Links and visual-line-mode Scott Randby
@ 2011-06-02  2:49 ` Nick Dokos
  2011-06-02  5:30   ` Scott Randby
  0 siblings, 1 reply; 15+ messages in thread
From: Nick Dokos @ 2011-06-02  2:49 UTC (permalink / raw)
  To: Scott Randby; +Cc: nicholas.dokos, [Orgmode]

Scott Randby <srandby@gmail.com> wrote:

> This is a problem that has been bugging me for some time because I use
> visual-line-mode a lot when I'm working on my org-mode files.
> 
> Say I have visual-line-mode turned on when I'm editing an org-mode file.
> If I do C-c C-l, put in the link address, hit <Enter>, put in a
> description, and hit <Enter>, then the long lines in the document are no
> longer wrapped even though "(Org Wrap)" still appears on the mode line.
> The only way I've been able to get wrapping back is to do M-x
> visual-line-mode twice (which is just leaving the mode and then bringing
> it back. This is very inconvenient, especially when I want to enter
> several links. Is this a bug or is there an easy way to remind Emacs
> that it is in visual-line-mode and that it should wrap long lines?
> 
> I have org-mode 7.5 on Emacs 23.2.1
> 

Cannot reproduce this either on emacs 23.1.1 or emacs 24.0.50 - the only
versions I have available here. org-mode is from earlier today.

The word-wrap documentation suggests some interaction with
truncate-lines and truncate-partial-width-windows, so that might be a
path of investigation.  But when I try setting truncate-lines to t
(which does truncate long lines even though "Wrap" is still on the mode
line) and then do (visual-line-mode 1), the variable is set back to nil
again. In any case, inserting links does not cause any other changes, no
matter what I set the variable to.

Nick

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

* Re: Links and visual-line-mode
  2011-06-02  2:49 ` Nick Dokos
@ 2011-06-02  5:30   ` Scott Randby
  2011-06-02  5:58     ` Nick Dokos
  0 siblings, 1 reply; 15+ messages in thread
From: Scott Randby @ 2011-06-02  5:30 UTC (permalink / raw)
  To: [Orgmode]

On 06/01/2011 10:49 PM, Nick Dokos wrote:
> Scott Randby <srandby@gmail.com> wrote:
> 
>> This is a problem that has been bugging me for some time because I use
>> visual-line-mode a lot when I'm working on my org-mode files.
>>
>> Say I have visual-line-mode turned on when I'm editing an org-mode file.
>> If I do C-c C-l, put in the link address, hit <Enter>, put in a
>> description, and hit <Enter>, then the long lines in the document are no
>> longer wrapped even though "(Org Wrap)" still appears on the mode line.
>> The only way I've been able to get wrapping back is to do M-x
>> visual-line-mode twice (which is just leaving the mode and then bringing
>> it back. This is very inconvenient, especially when I want to enter
>> several links. Is this a bug or is there an easy way to remind Emacs
>> that it is in visual-line-mode and that it should wrap long lines?
>>
>> I have org-mode 7.5 on Emacs 23.2.1
>>
> 
> Cannot reproduce this either on emacs 23.1.1 or emacs 24.0.50 - the only
> versions I have available here. org-mode is from earlier today.
> 
> The word-wrap documentation suggests some interaction with
> truncate-lines and truncate-partial-width-windows, so that might be a
> path of investigation.  But when I try setting truncate-lines to t
> (which does truncate long lines even though "Wrap" is still on the mode
> line) and then do (visual-line-mode 1), the variable is set back to nil
> again. In any case, inserting links does not cause any other changes, no
> matter what I set the variable to.

In my .emacs, I have pop-up-windows set to nil. If I change that setting
to t, then visual-line-mode keeps working when C-c C-l is used to insert
a link. Changing pop-up-windows back to nil causes the bad behavior.

One reason I want pop-up-windows to be set to nil is because I
frequently use C-x C-b to look at the buffer list. If pop-up-windows is
set to t, then C-x C-b opens the buffer list in a pop-up window while
the active cursor is in the other window. This is ridiculous.

I found this message about org-mode and pop-up windows in the mailing
list archives:

http://lists.gnu.org/archive/html/emacs-orgmode/2009-04/msg00712.html

While the issue described is not the same as mine, the complaint about
org-mode not playing nice when pop-up-windows is set to nil is still valid.

Scott

> 
> Nick
> 

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

* Re: Links and visual-line-mode
  2011-06-02  5:30   ` Scott Randby
@ 2011-06-02  5:58     ` Nick Dokos
  2011-06-02  6:03       ` Nick Dokos
                         ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Nick Dokos @ 2011-06-02  5:58 UTC (permalink / raw)
  To: Scott Randby; +Cc: nicholas.dokos, [Orgmode]

Scott Randby <srandby@gmail.com> wrote:

> On 06/01/2011 10:49 PM, Nick Dokos wrote:
> > Scott Randby <srandby@gmail.com> wrote:
> > 
> >> This is a problem that has been bugging me for some time because I use
> >> visual-line-mode a lot when I'm working on my org-mode files.
> >>
> >> Say I have visual-line-mode turned on when I'm editing an org-mode file.
> >> If I do C-c C-l, put in the link address, hit <Enter>, put in a
> >> description, and hit <Enter>, then the long lines in the document are no
> >> longer wrapped even though "(Org Wrap)" still appears on the mode line.
> >> The only way I've been able to get wrapping back is to do M-x
> >> visual-line-mode twice (which is just leaving the mode and then bringing
> >> it back. This is very inconvenient, especially when I want to enter
> >> several links. Is this a bug or is there an easy way to remind Emacs
> >> that it is in visual-line-mode and that it should wrap long lines?
> >>
> >> I have org-mode 7.5 on Emacs 23.2.1
> >>
> > 
> > Cannot reproduce this either on emacs 23.1.1 or emacs 24.0.50 - the only
> > versions I have available here. org-mode is from earlier today.
> > 
> > The word-wrap documentation suggests some interaction with
> > truncate-lines and truncate-partial-width-windows, so that might be a
> > path of investigation.  But when I try setting truncate-lines to t
> > (which does truncate long lines even though "Wrap" is still on the mode
> > line) and then do (visual-line-mode 1), the variable is set back to nil
> > again. In any case, inserting links does not cause any other changes, no
> > matter what I set the variable to.
> 
> In my .emacs, I have pop-up-windows set to nil. If I change that setting
> to t, then visual-line-mode keeps working when C-c C-l is used to insert
> a link. Changing pop-up-windows back to nil causes the bad behavior.
> 
> One reason I want pop-up-windows to be set to nil is because I
> frequently use C-x C-b to look at the buffer list. If pop-up-windows is
> set to t, then C-x C-b opens the buffer list in a pop-up window while
> the active cursor is in the other window. This is ridiculous.
> 
> I found this message about org-mode and pop-up windows in the mailing
> list archives:
> 
> http://lists.gnu.org/archive/html/emacs-orgmode/2009-04/msg00712.html
> 
> While the issue described is not the same as mine, the complaint about
> org-mode not playing nice when pop-up-windows is set to nil is still valid.
> 

Yes, with pop-up-windows set to nil, I can reproduce it too.
The problem is that truncate-lines is set to t inside org-insert-link.
When I comment that out, I get the behavior you expect. The question is:
why is truncate-lines set to t? I don't know the answer to that, but it
seems to be unnecessary: I think it could be let-bound instead or explicitly
reset to its former value afterwards.

The problems described by Samuel in the link you provided may be caused 
by the same setting, but I haven't looked in detail.

Nick

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

* Re: Links and visual-line-mode
  2011-06-02  5:58     ` Nick Dokos
@ 2011-06-02  6:03       ` Nick Dokos
  2011-06-02 14:01       ` Scott Randby
  2011-06-02 14:16       ` Carsten Dominik
  2 siblings, 0 replies; 15+ messages in thread
From: Nick Dokos @ 2011-06-02  6:03 UTC (permalink / raw)
  Cc: Scott Randby, [Orgmode], nicholas.dokos

Nick Dokos <nicholas.dokos@hp.com> wrote:

> Scott Randby <srandby@gmail.com> wrote:
> 
> > ...
> > 
> > I found this message about org-mode and pop-up windows in the mailing
> > list archives:
> > 
> > http://lists.gnu.org/archive/html/emacs-orgmode/2009-04/msg00712.html
> > 
> > While the issue described is not the same as mine, the complaint about
> > org-mode not playing nice when pop-up-windows is set to nil is still valid.
> > 
> 
> ...
> 
> The problems described by Samuel in the link you provided may be caused 
> by the same setting, but I haven't looked in detail.
> 

No, those seem to be unrelated problems, having to do with pop-up-windows
itself, not any setting of truncate-lines.

Nick

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

* Re: Links and visual-line-mode
  2011-06-02  5:58     ` Nick Dokos
  2011-06-02  6:03       ` Nick Dokos
@ 2011-06-02 14:01       ` Scott Randby
  2011-06-02 20:20         ` Sebastien Vauban
  2011-06-02 14:16       ` Carsten Dominik
  2 siblings, 1 reply; 15+ messages in thread
From: Scott Randby @ 2011-06-02 14:01 UTC (permalink / raw)
  To: [Orgmode]

On 06/02/2011 01:58 AM, Nick Dokos wrote:
> Scott Randby <srandby@gmail.com> wrote:
> 
>> On 06/01/2011 10:49 PM, Nick Dokos wrote:
>>> Scott Randby <srandby@gmail.com> wrote:
>>>
>>>> This is a problem that has been bugging me for some time because I use
>>>> visual-line-mode a lot when I'm working on my org-mode files.
>>>>
>>>> Say I have visual-line-mode turned on when I'm editing an org-mode file.
>>>> If I do C-c C-l, put in the link address, hit <Enter>, put in a
>>>> description, and hit <Enter>, then the long lines in the document are no
>>>> longer wrapped even though "(Org Wrap)" still appears on the mode line.
>>>> The only way I've been able to get wrapping back is to do M-x
>>>> visual-line-mode twice (which is just leaving the mode and then bringing
>>>> it back. This is very inconvenient, especially when I want to enter
>>>> several links. Is this a bug or is there an easy way to remind Emacs
>>>> that it is in visual-line-mode and that it should wrap long lines?
>>>>
>>>> I have org-mode 7.5 on Emacs 23.2.1
>>>>
>>>
>>> Cannot reproduce this either on emacs 23.1.1 or emacs 24.0.50 - the only
>>> versions I have available here. org-mode is from earlier today.
>>>
>>> The word-wrap documentation suggests some interaction with
>>> truncate-lines and truncate-partial-width-windows, so that might be a
>>> path of investigation.  But when I try setting truncate-lines to t
>>> (which does truncate long lines even though "Wrap" is still on the mode
>>> line) and then do (visual-line-mode 1), the variable is set back to nil
>>> again. In any case, inserting links does not cause any other changes, no
>>> matter what I set the variable to.
>>
>> In my .emacs, I have pop-up-windows set to nil. If I change that setting
>> to t, then visual-line-mode keeps working when C-c C-l is used to insert
>> a link. Changing pop-up-windows back to nil causes the bad behavior.
>>
>> One reason I want pop-up-windows to be set to nil is because I
>> frequently use C-x C-b to look at the buffer list. If pop-up-windows is
>> set to t, then C-x C-b opens the buffer list in a pop-up window while
>> the active cursor is in the other window. This is ridiculous.
>>
>> I found this message about org-mode and pop-up windows in the mailing
>> list archives:
>>
>> http://lists.gnu.org/archive/html/emacs-orgmode/2009-04/msg00712.html
>>
>> While the issue described is not the same as mine, the complaint about
>> org-mode not playing nice when pop-up-windows is set to nil is still valid.
>>
> 
> Yes, with pop-up-windows set to nil, I can reproduce it too.
> The problem is that truncate-lines is set to t inside org-insert-link.
> When I comment that out, I get the behavior you expect. The question is:
> why is truncate-lines set to t? I don't know the answer to that, but it
> seems to be unnecessary: I think it could be let-bound instead or explicitly
> reset to its former value afterwards.

I will set pop-up-windows to t for now, but I hope the matter is
investigated further to see if truncate-lines must be set to t in
org-insert-link or if the code can be changed as you suggest.

Thanks for your help.

Scott

> 
> The problems described by Samuel in the link you provided may be caused 
> by the same setting, but I haven't looked in detail.
> 
> Nick
> 

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

* Re: Links and visual-line-mode
  2011-06-02  5:58     ` Nick Dokos
  2011-06-02  6:03       ` Nick Dokos
  2011-06-02 14:01       ` Scott Randby
@ 2011-06-02 14:16       ` Carsten Dominik
  2011-06-02 15:51         ` Nick Dokos
  2 siblings, 1 reply; 15+ messages in thread
From: Carsten Dominik @ 2011-06-02 14:16 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Scott Randby, [Orgmode]


On 2.6.2011, at 07:58, Nick Dokos wrote:

> Scott Randby <srandby@gmail.com> wrote:
> 
>> On 06/01/2011 10:49 PM, Nick Dokos wrote:
>>> Scott Randby <srandby@gmail.com> wrote:
>>> 
>>>> This is a problem that has been bugging me for some time because I use
>>>> visual-line-mode a lot when I'm working on my org-mode files.
>>>> 
>>>> Say I have visual-line-mode turned on when I'm editing an org-mode file.
>>>> If I do C-c C-l, put in the link address, hit <Enter>, put in a
>>>> description, and hit <Enter>, then the long lines in the document are no
>>>> longer wrapped even though "(Org Wrap)" still appears on the mode line.
>>>> The only way I've been able to get wrapping back is to do M-x
>>>> visual-line-mode twice (which is just leaving the mode and then bringing
>>>> it back. This is very inconvenient, especially when I want to enter
>>>> several links. Is this a bug or is there an easy way to remind Emacs
>>>> that it is in visual-line-mode and that it should wrap long lines?
>>>> 
>>>> I have org-mode 7.5 on Emacs 23.2.1
>>>> 
>>> 
>>> Cannot reproduce this either on emacs 23.1.1 or emacs 24.0.50 - the only
>>> versions I have available here. org-mode is from earlier today.
>>> 
>>> The word-wrap documentation suggests some interaction with
>>> truncate-lines and truncate-partial-width-windows, so that might be a
>>> path of investigation.  But when I try setting truncate-lines to t
>>> (which does truncate long lines even though "Wrap" is still on the mode
>>> line) and then do (visual-line-mode 1), the variable is set back to nil
>>> again. In any case, inserting links does not cause any other changes, no
>>> matter what I set the variable to.
>> 
>> In my .emacs, I have pop-up-windows set to nil. If I change that setting
>> to t, then visual-line-mode keeps working when C-c C-l is used to insert
>> a link. Changing pop-up-windows back to nil causes the bad behavior.
>> 
>> One reason I want pop-up-windows to be set to nil is because I
>> frequently use C-x C-b to look at the buffer list. If pop-up-windows is
>> set to t, then C-x C-b opens the buffer list in a pop-up window while
>> the active cursor is in the other window. This is ridiculous.
>> 
>> I found this message about org-mode and pop-up windows in the mailing
>> list archives:
>> 
>> http://lists.gnu.org/archive/html/emacs-orgmode/2009-04/msg00712.html
>> 
>> While the issue described is not the same as mine, the complaint about
>> org-mode not playing nice when pop-up-windows is set to nil is still valid.
>> 
> 
> Yes, with pop-up-windows set to nil, I can reproduce it too.
> The problem is that truncate-lines is set to t inside org-insert-link.

Yes, but only after the focus was switched to the *Org Link* buffer which is
shown in order to select a link.  truncate-lines is automatically buffer-local,
so it should not effect its value in other buffers.  Is truncate-lines modified after inserting a link????

> When I comment that out, I get the behavior you expect. The question is:
> why is truncate-lines set to t?

To get just one line per link, so to get a nicely
organized selection buffer.

- Carsten

> I don't know the answer to that, but it
> seems to be unnecessary: I think it could be let-bound instead or explicitly
> reset to its former value afterwards.
> 
> The problems described by Samuel in the link you provided may be caused 
> by the same setting, but I haven't looked in detail.
> 
> Nick
> 

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

* Re: Links and visual-line-mode
  2011-06-02 14:16       ` Carsten Dominik
@ 2011-06-02 15:51         ` Nick Dokos
  2011-06-02 16:04           ` Carsten Dominik
  0 siblings, 1 reply; 15+ messages in thread
From: Nick Dokos @ 2011-06-02 15:51 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Scott Randby, [Orgmode], nicholas.dokos

Carsten Dominik <carsten.dominik@gmail.com> wrote:

> > Yes, with pop-up-windows set to nil, I can reproduce it too.
> > The problem is that truncate-lines is set to t inside org-insert-link.
> 
> Yes, but only after the focus was switched to the *Org Link* buffer which is
> shown in order to select a link.  truncate-lines is automatically buffer-local,
> so it should not effect its value in other buffers.  Is truncate-lines modified after inserting a link????
> 

Here's what I see with a minimal .emacs and a simple org file (both of them appended):

- emacs -Q -l minimal.emacs
- check truncate-lines: it is nil in the foo.org buffer
- TAB to expand the heading - I get a wrapped line as expected
- go to the end, C-c C-l foo <RET> bar <RET>
- by the time of the first <RET> I am back at the foo.org buffer and the line is truncated;
  checking truncate-lines shows it to be t.

Nick

GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of 2011-04-13
Org-mode version 7.5 (baseline.261.g3433)

minimal.emacs:
--8<---------------cut here---------------start------------->8---
;;; -*- mode: emacs-lisp -*-
;;; constant part
(add-to-list 'load-path (expand-file-name "~/src/emacs/org/org-mode/lisp"))
(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
(require 'org-install)
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)

(setq org-startup-truncated nil)
(setq pop-up-windows nil)
(setq-default truncate-lines nil)
(find-file "~/src/org/visual/scott-randby/foo.org")
(visual-line-mode 1)
--8<---------------cut here---------------end--------------->8---


foo.org:
--8<---------------cut here---------------start------------->8---

* foo

[[foo][bar]]
bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar 

[[foo][bar]] [[foo][bar]]
--8<---------------cut here---------------end--------------->8---

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

* Re: Links and visual-line-mode
  2011-06-02 15:51         ` Nick Dokos
@ 2011-06-02 16:04           ` Carsten Dominik
  2011-06-02 16:41             ` Nick Dokos
  0 siblings, 1 reply; 15+ messages in thread
From: Carsten Dominik @ 2011-06-02 16:04 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Scott Randby, [Orgmode]


On 2.6.2011, at 17:51, Nick Dokos wrote:

> Carsten Dominik <carsten.dominik@gmail.com> wrote:
> 
>>> Yes, with pop-up-windows set to nil, I can reproduce it too.
>>> The problem is that truncate-lines is set to t inside org-insert-link.
>> 
>> Yes, but only after the focus was switched to the *Org Link* buffer which is
>> shown in order to select a link.  truncate-lines is automatically buffer-local,
>> so it should not effect its value in other buffers.  Is truncate-lines modified after inserting a link????
>> 
> 
> Here's what I see with a minimal .emacs and a simple org file (both of them appended):
> 
> - emacs -Q -l minimal.emacs
> - check truncate-lines: it is nil in the foo.org buffer
> - TAB to expand the heading - I get a wrapped line as expected
> - go to the end, C-c C-l foo <RET> bar <RET>
> - by the time of the first <RET> I am back at the foo.org buffer and the line is truncated;
>  checking truncate-lines shows it to be t.

Thanks Nick.  Seems like Emacs is not sure in which
buffer it is at that moment, because it has not yet been displayed.
Could you please try to following paranoid patch?

Thanks.

- Carsten

diff --git a/lisp/org.el b/lisp/org.el
index 1ca03f4..b43a877 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8889,7 +8889,8 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
 		  (reverse org-stored-links) "\n"))))
       (let ((cw (selected-window)))
 	(select-window (get-buffer-window "*Org Links*" 'visible))
-	(setq truncate-lines t)
+	(with-current-buffer "*Org Links*"
+	  (set (make-local-variable 'truncate-lines) t))
 	(unless (pos-visible-in-window-p (point-max))
 	  (org-fit-window-to-buffer))
 	(and (window-live-p cw) (select-window cw)))



> 
> Nick
> 
> GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of 2011-04-13
> Org-mode version 7.5 (baseline.261.g3433)
> 
> minimal.emacs:
> --8<---------------cut here---------------start------------->8---
> ;;; -*- mode: emacs-lisp -*-
> ;;; constant part
> (add-to-list 'load-path (expand-file-name "~/src/emacs/org/org-mode/lisp"))
> (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
> (require 'org-install)
> (global-set-key "\C-cl" 'org-store-link)
> (global-set-key "\C-ca" 'org-agenda)
> 
> (setq org-startup-truncated nil)
> (setq pop-up-windows nil)
> (setq-default truncate-lines nil)
> (find-file "~/src/org/visual/scott-randby/foo.org")
> (visual-line-mode 1)
> --8<---------------cut here---------------end--------------->8---
> 
> 
> foo.org:
> --8<---------------cut here---------------start------------->8---
> 
> * foo
> 
> [[foo][bar]]
> bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar 
> 
> [[foo][bar]] [[foo][bar]]
> --8<---------------cut here---------------end--------------->8---
> 
> 

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

* Re: Links and visual-line-mode
  2011-06-02 16:04           ` Carsten Dominik
@ 2011-06-02 16:41             ` Nick Dokos
  2011-06-02 17:47               ` Scott Randby
  2011-06-02 17:49               ` Carsten Dominik
  0 siblings, 2 replies; 15+ messages in thread
From: Nick Dokos @ 2011-06-02 16:41 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Scott Randby, [Orgmode], nicholas.dokos

Carsten Dominik <carsten.dominik@gmail.com> wrote:


> Thanks Nick.  Seems like Emacs is not sure in which
> buffer it is at that moment, because it has not yet been displayed.
> Could you please try to following paranoid patch?
> 
> Thanks.
> 
> - Carsten
> 
> diff --git a/lisp/org.el b/lisp/org.el
> index 1ca03f4..b43a877 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -8889,7 +8889,8 @@ Use TAB to complete link prefixes, then RET for =
> type-specific completion support
>  		  (reverse org-stored-links) "\n"))))
>        (let ((cw (selected-window)))
>  	(select-window (get-buffer-window "*Org Links*" 'visible))
> -	(setq truncate-lines t)
> +	(with-current-buffer "*Org Links*"
> +	  (set (make-local-variable 'truncate-lines) t))
>  	(unless (pos-visible-in-window-p (point-max))
>  	  (org-fit-window-to-buffer))
>  	(and (window-live-p cw) (select-window cw)))
> 

Both this and the simpler

> -	(setq truncate-lines t)
> +	(with-current-buffer "*Org Links*"
> +	  (setq truncate-lines t))

seem to work in my simple test.

Nick

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

* Re: Links and visual-line-mode
  2011-06-02 16:41             ` Nick Dokos
@ 2011-06-02 17:47               ` Scott Randby
  2011-06-02 17:49               ` Carsten Dominik
  1 sibling, 0 replies; 15+ messages in thread
From: Scott Randby @ 2011-06-02 17:47 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: [Orgmode], Carsten Dominik

On 06/02/2011 12:41 PM, Nick Dokos wrote:
> Carsten Dominik <carsten.dominik@gmail.com> wrote:
> 
> 
>> Thanks Nick.  Seems like Emacs is not sure in which
>> buffer it is at that moment, because it has not yet been displayed.
>> Could you please try to following paranoid patch?
>>
>> Thanks.
>>
>> - Carsten
>>
>> diff --git a/lisp/org.el b/lisp/org.el
>> index 1ca03f4..b43a877 100644
>> --- a/lisp/org.el
>> +++ b/lisp/org.el
>> @@ -8889,7 +8889,8 @@ Use TAB to complete link prefixes, then RET for =
>> type-specific completion support
>>  		  (reverse org-stored-links) "\n"))))
>>        (let ((cw (selected-window)))
>>  	(select-window (get-buffer-window "*Org Links*" 'visible))
>> -	(setq truncate-lines t)
>> +	(with-current-buffer "*Org Links*"
>> +	  (set (make-local-variable 'truncate-lines) t))
>>  	(unless (pos-visible-in-window-p (point-max))
>>  	  (org-fit-window-to-buffer))
>>  	(and (window-live-p cw) (select-window cw)))
>>
> 
> Both this and the simpler
> 
>> -	(setq truncate-lines t)
>> +	(with-current-buffer "*Org Links*"
>> +	  (setq truncate-lines t))
> 
> seem to work in my simple test.

I looked at several different scenarios using Nick's solution and they
all worked fine. I didn't try Carsten's solution.

Scott

> 
> Nick
> 
> 

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

* Re: Links and visual-line-mode
  2011-06-02 16:41             ` Nick Dokos
  2011-06-02 17:47               ` Scott Randby
@ 2011-06-02 17:49               ` Carsten Dominik
  2011-06-02 19:56                 ` Nick Dokos
  1 sibling, 1 reply; 15+ messages in thread
From: Carsten Dominik @ 2011-06-02 17:49 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Scott Randby, [Orgmode]


On 2.6.2011, at 18:41, Nick Dokos wrote:

> Carsten Dominik <carsten.dominik@gmail.com> wrote:
> 
> 
>> Thanks Nick.  Seems like Emacs is not sure in which
>> buffer it is at that moment, because it has not yet been displayed.
>> Could you please try to following paranoid patch?
>> 
>> Thanks.
>> 
>> - Carsten
>> 
>> diff --git a/lisp/org.el b/lisp/org.el
>> index 1ca03f4..b43a877 100644
>> --- a/lisp/org.el
>> +++ b/lisp/org.el
>> @@ -8889,7 +8889,8 @@ Use TAB to complete link prefixes, then RET for =
>> type-specific completion support
>> 		  (reverse org-stored-links) "\n"))))
>>       (let ((cw (selected-window)))
>> 	(select-window (get-buffer-window "*Org Links*" 'visible))
>> -	(setq truncate-lines t)
>> +	(with-current-buffer "*Org Links*"
>> +	  (set (make-local-variable 'truncate-lines) t))
>> 	(unless (pos-visible-in-window-p (point-max))
>> 	  (org-fit-window-to-buffer))
>> 	(and (window-live-p cw) (select-window cw)))
>> 
> 
> Both this and the simpler
> 
>> -	(setq truncate-lines t)
>> +	(with-current-buffer "*Org Links*"
>> +	  (setq truncate-lines t))
> 
> seem to work in my simple test.

OK, I pushed your version.

- Carsten

> 
> Nick
> 

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

* Re: Links and visual-line-mode
  2011-06-02 17:49               ` Carsten Dominik
@ 2011-06-02 19:56                 ` Nick Dokos
  0 siblings, 0 replies; 15+ messages in thread
From: Nick Dokos @ 2011-06-02 19:56 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Scott Randby, [Orgmode], nicholas.dokos

Carsten Dominik <carsten.dominik@gmail.com> wrote:

> 
> On 2.6.2011, at 18:41, Nick Dokos wrote:
> 
> > Carsten Dominik <carsten.dominik@gmail.com> wrote:
> > 
> > 
> >> Thanks Nick.  Seems like Emacs is not sure in which
> >> buffer it is at that moment, because it has not yet been displayed.
> >> Could you please try to following paranoid patch?
> >> 
> >> Thanks.
> >> 
> >> - Carsten
> >> 
> >> diff --git a/lisp/org.el b/lisp/org.el
> >> index 1ca03f4..b43a877 100644
> >> --- a/lisp/org.el
> >> +++ b/lisp/org.el
> >> @@ -8889,7 +8889,8 @@ Use TAB to complete link prefixes, then RET for =
> >> type-specific completion support
> >> 		  (reverse org-stored-links) "\n"))))
> >>       (let ((cw (selected-window)))
> >> 	(select-window (get-buffer-window "*Org Links*" 'visible))
> >> -	(setq truncate-lines t)
> >> +	(with-current-buffer "*Org Links*"
> >> +	  (set (make-local-variable 'truncate-lines) t))
> >> 	(unless (pos-visible-in-window-p (point-max))
> >> 	  (org-fit-window-to-buffer))
> >> 	(and (window-live-p cw) (select-window cw)))
> >> 
> > 
> > Both this and the simpler
> > 
> >> -	(setq truncate-lines t)
> >> +	(with-current-buffer "*Org Links*"
> >> +	  (setq truncate-lines t))
> > 
> > seem to work in my simple test.
> 
> OK, I pushed your version.
> 

The test is still passing, so I guess things are OK.

Thanks,
Nick

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

* Re: Links and visual-line-mode
  2011-06-02 14:01       ` Scott Randby
@ 2011-06-02 20:20         ` Sebastien Vauban
  2011-06-03 14:24           ` Scott Randby
  0 siblings, 1 reply; 15+ messages in thread
From: Sebastien Vauban @ 2011-06-02 20:20 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi all,

Scott Randby wrote:
>>> One reason I want pop-up-windows to be set to nil is because I
>>> frequently use C-x C-b to look at the buffer list. If pop-up-windows is
>>> set to t, then C-x C-b opens the buffer list in a pop-up window while
>>> the active cursor is in the other window. This is ridiculous.

Just on that one point, a trick read in "Emacs Lisp programming" IIRC:

#+begin_src emacs-lisp
      ;; rebind `C-x C-b'
      (global-set-key (kbd "C-x C-b") 'buffer-menu)
      ;; `buffer-menu' moves point in the window which lists your buffers
#+end_src

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Links and visual-line-mode
  2011-06-02 20:20         ` Sebastien Vauban
@ 2011-06-03 14:24           ` Scott Randby
  0 siblings, 0 replies; 15+ messages in thread
From: Scott Randby @ 2011-06-03 14:24 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

On 06/02/2011 04:20 PM, Sebastien Vauban wrote:
> Hi all,
> 
> Scott Randby wrote:
>>>> One reason I want pop-up-windows to be set to nil is because I
>>>> frequently use C-x C-b to look at the buffer list. If pop-up-windows is
>>>> set to t, then C-x C-b opens the buffer list in a pop-up window while
>>>> the active cursor is in the other window. This is ridiculous.
> 
> Just on that one point, a trick read in "Emacs Lisp programming" IIRC:
> 
> #+begin_src emacs-lisp
>       ;; rebind `C-x C-b'
>       (global-set-key (kbd "C-x C-b") 'buffer-menu)
>       ;; `buffer-menu' moves point in the window which lists your buffers
> #+end_src

Thanks for this. I've never wanted to eliminate all pop-up windows, and
this allows me to keep them and have C-x C-b work like I want it to
work. Emacs, org-mode, and the org-mode community are the best!

This is off-topic and it is certainly not new to long-time users of
Emacs, but I found the following discussion of the buffer menu on
EmacsWiki to be most enlightening.

http://www.emacswiki.org/emacs/BufferMenu

Scott

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

end of thread, other threads:[~2011-06-03 14:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-01 23:32 Links and visual-line-mode Scott Randby
2011-06-02  2:49 ` Nick Dokos
2011-06-02  5:30   ` Scott Randby
2011-06-02  5:58     ` Nick Dokos
2011-06-02  6:03       ` Nick Dokos
2011-06-02 14:01       ` Scott Randby
2011-06-02 20:20         ` Sebastien Vauban
2011-06-03 14:24           ` Scott Randby
2011-06-02 14:16       ` Carsten Dominik
2011-06-02 15:51         ` Nick Dokos
2011-06-02 16:04           ` Carsten Dominik
2011-06-02 16:41             ` Nick Dokos
2011-06-02 17:47               ` Scott Randby
2011-06-02 17:49               ` Carsten Dominik
2011-06-02 19:56                 ` Nick Dokos

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