texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Opening files in a new window


From: Miguel de Benito Delgado
Subject: Re: [Texmacs-dev] Opening files in a new window
Date: Tue, 10 Apr 2012 09:08:52 +0200
User-agent: Postbox 3.0.3 (Macintosh/20120304)

(Enough hijacking for one thread ==> new one)

Andrey G. Grozin wrote:
On Mon, 9 Apr 2012, Miguel de Benito Delgado wrote:
Andrey G. Grozin wrote:
Another regression (or, maybe, this is an incompatible change): help menu in reduce no longer works. It worked in 1.0.7.15. The menu entry Contents calls

(load-in-new-window reduce-help)
As you say it's an incompatible change: (load-in-new-window reduce-help) simply calls (load-buffer reduce-help 1), the second parameter implying that the buffer is opened as "generic" which it isn't because your file is html. If it were a TeXmacs file, the command would work, though.

What you need is either to call (load-buffer reduce-help) directly or use (load-browse-buffer reduce-help) which is just an alias.
Sorry, I don't quite understand. Is it possible to open an html file in a new window?

Yes, use (load-buffer reduce-help).

It's inconvenient to use the same window, a user would prefer to see both his session and the help (I know I can clone the window, and go back to my session in one of them; but that's a lot of extra work, it's much nicer just to open help in a new window).
Indeed.
Somewhat related question. Suppose I have help menu with many items (at the moment I don't, but let's suppose). I want to have a dedicated help window. At the start of the session it does not exist. When I click some item in the help menu, this new window appears, and the relevant help topic is displayed in it. When I click some other item in the help menu, it is displayed in the same help window, replacing the previous help topic. Is it possible?
Yes, you need to capture the window id for that, or maybe the path in the main tree to the buffer. I'm not sure, the interface is quite chaotic (yes, yes... to the untrained eye... x-D) and absolutely undocumented, but you can check inside TeXmacs/Data/tm_data.cpp and the relevant glue file Scheme/Glue/build-glue-basic.scm. Here you have (what I think are) the relevant bits:

(open-buffer-in-window new_buffer_in_new_window (void url content content))
  (open-window open_window (url))
  (open-window-geometry open_window (url content))
  (clone-window clone_window (void))
  (kill-window kill_window (void))
  (kill-window-and-buffer kill_window_and_buffer (void))

  blahblah...

  (window-current window_current (int))
  (window-list windows_list (path))
  (buffer->windows buffer_to_windows (path url))
  (window->buffer window_to_buffer (url int))
  (window-set-buffer window_set_buffer (void int url))
  (window-focus window_focus (void int))

And a lot of buffer related functions...

As you know, the first type in the last list is the return value of the C++ function, so you could try using window-set-buffer by finding first some integer handle for the window (actually "view", says the c++ implementation) and the url you are interested in. Check the buffer functions in that file.

Sorry I cannot research this any more right now, I'm sitting in the train...
In other words, just 2 states are possible: the help window either exists or not. Clicking some help item results in:
* create the help window if it does not exist
* display help in the help window
In the beginning it does not exist. If it exists and I close it, next time I request help it will be created again.
Exactly.
--
______________
Miguel de Benito.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]