File mode settings

View: New views
14 Messages — Rating Filter:   Alert me  

File mode settings

by François Poulain-2 :: Rate this Message:

| View Threaded | Show Only this Message

Dear all,

I continously have mode changes (between 644 to 655) the file
plugins/asymptote/bin/perl-tm_asy

(Its in 644 in the svn but become 755 during the compilation.)

Does any people knows sufficiently about it to fix correctly the
permissions ?

François

--
François Poulain <fpoulain@...>

_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

svn 5232: Russian keyboard input does not work

by Andrey G. Grozin :: Rate this Message:

| View Threaded | Show Only this Message

Hello *,

I've just compiled 5232 in Linux. Starting

texmacs --debug-keyboard

setting Document -> Language -> Russian, and switching the keyboard to the
Russian mode, I get something like

Keyboard] Pressed #44B at 46632
         ] #44B -> #44B -> #44B
Keyboard] unrecognized key #44B is probably missing in the encoding files.

each time I press a letter key, and nothing appears in the document. This
bug is new (at least, in 1.0.7.14 Russian input worked OK; haven't tried
it in 1.0.7.15).

Andrey

_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Re: svn 5232: Russian keyboard input does not work

by Miguel de Benito Delgado :: Rate this Message:

| View Threaded | Show Only this Message

Dear Andrey,

   could you please try and apply the attached patch at
src/src/Plugins/Qt, then compile and try again?

Thanks,
Miguel.


Andrey G. Grozin wrote:

> Hello *,
>
> I've just compiled 5232 in Linux. Starting
>
> texmacs --debug-keyboard
>
> setting Document -> Language -> Russian, and switching the keyboard to
> the Russian mode, I get something like
>
> Keyboard] Pressed #44B at 46632
>         ] #44B -> #44B -> #44B
> Keyboard] unrecognized key #44B is probably missing in the encoding
> files.
>
> each time I press a letter key, and nothing appears in the document.
> This bug is new (at least, in 1.0.7.14 Russian input worked OK;
> haven't tried it in 1.0.7.15).
>
> Andrey
>
> _______________________________________________
> Texmacs-dev mailing list
> Texmacs-dev@...
> https://lists.gnu.org/mailman/listinfo/texmacs-dev
--
______________
Miguel de Benito.


Index: QTMWidget.cpp
===================================================================
--- QTMWidget.cpp (revision 5232)
+++ QTMWidget.cpp (working copy)
@@ -502,20 +502,11 @@
           case 0x308: r= "umlaut"; break;
           case 0x33e: r= "tilde"; break;
           default:
-            QByteArray buf= nss.toUtf8();
-            string rr (buf.constData(), buf.count());
-            string tstr= utf8_to_cork (rr);
-            // HACK! The encodings defined in langs/encoding and which utf8_to_cork uses
-            // (via the converters loaded in converter_rep::load()), enclose the texmacs
-            // symbols in "< >", but this seems to be an abandoned convention (or not
-            // used for keypresses), so we must remove them. (MBD)
-            int len= N(tstr);
-            if (len >= 1 && tstr(0,1) == "<" && tstr(len-1,len) == ">")
-              r= tstr(1, len-1);
-            else
-              r= tstr;
-            if (r == "less") r= "<";
-            else if (r == "gtr")r= ">";
+           QByteArray buf= nss.toUtf8();
+        string rr (buf.constData(), buf.count());
+ r= utf8_to_cork (rr);
+ if (r == "<less>") r= "<";
+ if (r == "<gtr>") r= ">";
 
         }
 #ifdef Q_WS_MAC

_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Re: svn 5232: Russian keyboard input does not work

by Andrey G. Grozin :: Rate this Message:

| View Threaded | Show Only this Message

On Fri, 6 Apr 2012, Miguel de Benito Delgado wrote:
>  could you please try and apply the attached patch at src/src/Plugins/Qt,
> then compile and try again?
Yes, with this patch Russian input works. Thanks.

Andrey

_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Re: svn 5232: Russian keyboard input does not work

by Miguel de Benito Delgado :: Rate this Message:

| View Threaded | Show Only this Message

Sadly, it breaks input of some keys in other languages...

Andrey G. Grozin wrote:
> On Fri, 6 Apr 2012, Miguel de Benito Delgado wrote:
>> could you please try and apply the attached patch at
>> src/src/Plugins/Qt, then compile and try again?
> Yes, with this patch Russian input works. Thanks.
>
> Andrey

_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Re: svn 5232: Russian keyboard input does not work

by Miguel de Benito Delgado :: Rate this Message:

| View Threaded | Show Only this Message

Ok, I committed another ugly hack to solve the issue with the russian
language while not breaking the fix for bug #1967. The whole issue needs
redesigning, though.

You should be able to discard that patch and use the svn version now.

Andrey G. Grozin wrote:
> On Fri, 6 Apr 2012, Miguel de Benito Delgado wrote:
>>  could you please try and apply the attached patch at
>> src/src/Plugins/Qt, then compile and try again?
> Yes, with this patch Russian input works. Thanks.
>
> Andrey

--
______________
Miguel de Benito.


_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Regression in LaTeX import: \\ broken

by Andrey G. Grozin :: Rate this Message:

| View Threaded | Show Only this Message

Hello *,

When I run, e.g., reduce plugin, and it produces a matrix, it sends to
TeXmacs

[BEGIN]latex:\black$\displaystyle  \left(\begin{matrix}a&b\\c&d\end{matrix}\right)$[END]

In TeXmacs-1.0.7.15, this matrix was displayed correctly. In svn 5238 (and
5232) I see instead just

(a b <\> c d)

I.e., TeXmacs no longer understands \\ inside a matrix.

If I write a variable a2b, reduce sends to TeXmacs

[BEGIN]latex:\black$\displaystyle  \mathrm{a2b}$[END]

and it is displayed as

a*2*b

This is an old bug; I thought it has been fixed, but it has not.

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)

where the variable reduce-help has a string value. If I do, in a scheme
session,

<\session|scheme|default>
   <\input|Scheme] >
     (define reduce-help
"/home/grozin/reduce-1556/cslbuild/i686-pc-linux-gnu/csl/reduce.doc/index.html")
   </input>

   <\unfolded-io|Scheme] >
     (load-in-new-window reduce-help)
   <|unfolded-io>
     wrong-type-arg
   </unfolded-io>

   <\input|Scheme] >
     \;
   </input>
</session>

and no new window appears. As I said, this worked in 1.0.7.15.

Finally, an old bug which seems immortal: in the Go menu, file names are
translated!!! index.html looks as указатель.html !!! As I said at the
workshop, plugin names in the Help -> Plug-ins menu are also translated,
Axiom becomes Аксиома.

Hoped to commit the reduce plugin today, but... so many things have broken
recently :-(

Andrey
_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Re: Regression in LaTeX import: \\ broken

by Miguel de Benito Delgado :: Rate this Message:

| View Threaded | Show Only this Message

Hi Andrey,

Andrey G. Grozin wrote:
> Finally, an old bug which seems immortal: in the Go menu, file names
> are translated!!! index.html looks as указатель.html !!! As I said at
> the workshop, plugin names in the Help -> Plug-ins menu are also
> translated, Axiom becomes Аксиома.
It took me a while, and I'm not quite sure it's completely right, so I
won't commit it to the repo yet, but in the meantime, you can apply the
patch I've attached. The problem was that any strings used as labels in
the menus or elsewhere are automatically translated, so I created a new
tag "nolocale" which can be used to bypass this feature. In your menu
definitions you can use it like this:

(menu-bing tools-menu
  (former)
  ---
  ((nolocale "Document") (noop)))

I suppose you already filed a bug, can you send me the link so I post
the patch there?

Thanks,
--
______________
Miguel de Benito.


diff --git a/src/TeXmacs/progs/doc/help-menu.scm b/src/TeXmacs/progs/doc/help-menu.scm
index 423d55b..14b0bec 100644
--- a/src/TeXmacs/progs/doc/help-menu.scm
+++ b/src/TeXmacs/progs/doc/help-menu.scm
@@ -27,7 +27,7 @@
                           plugin-documented?))
     (with menu-name (or (ahash-ref supported-sessions-table name)
                         (upcase-first name))
-      ((eval menu-name)
+      ((nolocale (eval menu-name))
        (load-help-article (string-append name))))))
 
 (menu-bind help-menu
diff --git a/src/TeXmacs/progs/kernel/gui/gui-markup.scm b/src/TeXmacs/progs/kernel/gui/gui-markup.scm
index 272c343..a301c17 100644
--- a/src/TeXmacs/progs/kernel/gui/gui-markup.scm
+++ b/src/TeXmacs/progs/kernel/gui/gui-markup.scm
@@ -262,6 +262,10 @@
   (:synopsis "Make text")
   `(list 'text ,text))
 
+(tm-define-macro ($nolocale text)
+  (:synopsis "Make non-localizable text")
+  `(list 'nolocale ,text))
+
 (tm-define-macro ($input cmd type proposals width)
   (:synopsis "Make input field")
   `(list 'input (lambda (answer) ,cmd) ,type (lambda () ,proposals) ,width))
diff --git a/src/TeXmacs/progs/kernel/gui/menu-define.scm b/src/TeXmacs/progs/kernel/gui/menu-define.scm
index 071322f..df87d34 100644
--- a/src/TeXmacs/progs/kernel/gui/menu-define.scm
+++ b/src/TeXmacs/progs/kernel/gui/menu-define.scm
@@ -22,6 +22,10 @@
   (if (not (match? x pattern))
     (texmacs-error "gui-make" "invalid menu item ~S" x)))
 
+(define (gui-make-nolocale x)
+  (require-format x '(nolocale :%1))
+  `($nolocale ,(cadr x)))
+
 (define (gui-make-eval x)
   (require-format x '(eval :%1))
   (cadr x))
@@ -295,6 +299,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-table gui-make-table
+  (nolocale ,gui-make-nolocale)
   (eval ,gui-make-eval)
   (dynamic ,gui-make-dynamic)
   (former ,gui-make-former)
@@ -373,11 +378,11 @@
                ((== x (string->symbol "|")) '$/)
                (else
                  (texmacs-error "gui-make" "invalid menu item ~S" x))))
- ((string? x) x)
+        ((string? x) x)
         ((and (pair? x) (ahash-ref gui-make-table (car x)))
          (apply (car (ahash-ref gui-make-table (car x))) (list x)))
- ((and (pair? x) (or (string? (car x)) (pair? (car x))))
- `($> ,(gui-make (car x)) ,@(cdr x)))
+        ((and (pair? x) (or (string? (car x)) (pair? (car x))))
+         `($> ,(gui-make (car x)) ,@(cdr x)))
         (else
           (texmacs-error "gui-make" "invalid menu item ~S" x))))
 
diff --git a/src/TeXmacs/progs/kernel/gui/menu-widget.scm b/src/TeXmacs/progs/kernel/gui/menu-widget.scm
index 94011e7..7cc7e83 100644
--- a/src/TeXmacs/progs/kernel/gui/menu-widget.scm
+++ b/src/TeXmacs/progs/kernel/gui/menu-widget.scm
@@ -23,6 +23,7 @@
 (define-regexp-grammar
   (:menu-label (:or
     :string?
+    (nolocale :string?)
     (concat :*)
     (color :%5)
     (verbatim :%1)
@@ -38,6 +39,7 @@
   (:menu-item (:or
     ---
     |
+    (nolocale :string?)
     (group :string?)
     (text :string?)
     (glue :boolean? :boolean? :integer? :integer?)
@@ -134,7 +136,8 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define (translatable? s)
-  (or (string? s) (func? s 'concat) (func? s 'verbatim)))
+  (and (not (func? s 'nolocale))
+       (or (string? s) (func? s 'concat) (func? s 'verbatim))))
 
 (define (active? style)
   (== (logand style widget-style-inert) 0))
@@ -153,19 +156,24 @@
   ;;     Example default values are: family="roman", class="mr",
   ;;     series="medium", shape="normal", size=10, dpi=600.
   ;;   <label> :: <string>
-  ;;     Simple menu label, its display style is controlled by tt? and style
+  ;;     Simple menu label, its display style is controlled by tt? and style.
+  ;;   <label> :: (nolocale <string>)
+  ;;     Simple menu label which won't be translated.
   ;;   <label> :: (icon <string>)
   ;;     Pixmap menu label, the <string> is the name of the pixmap.
   (let ((tt? (and (nnull? opt) (car opt)))
  (col (color (if (greyed? style) "dark grey" "black"))))
     (cond ((translatable? p) ; "text"
-   (widget-text (translate p) style col #t))
-    ((tuple? p 'balloon 2)        ; (balloon <label> "balloon text")
-     (make-menu-label (cadr p) style tt?))
-    ((tuple? p 'extend) ; (extend <label> . ws)
+           (widget-text (translate p) style col #t))
+          ((func? p 'nolocale)
+           (display* "hi there! : " p "\n")
+           (widget-text (cadr p) style col #t))
+          ((tuple? p 'balloon 2)        ; (balloon <label> "balloon text")
+           (make-menu-label (cadr p) style tt?))
+          ((tuple? p 'extend) ; (extend <label> . ws)
            (with l (make-menu-items (cddr p) style tt?)
-             (widget-extend (make-menu-label (cadr p) style tt?) l)))
-    ((tuple? p 'style 2) ; (style st <label>)
+            (widget-extend (make-menu-label (cadr p) style tt?) l)))
+          ((tuple? p 'style 2) ; (style st <label>)
            (let* ((x (cadr p))
                   (new-style (if (> x 0) (logior style x)
                                  (logand style (lognot (- x))))))
@@ -576,6 +584,8 @@
  ,(lambda (p style bar?) (list (make-menu-group (cadr p) style))))
   (text (:string?)
  ,(lambda (p style bar?) (list (make-menu-text (cadr p) style))))
+  (nolocale (:string?)
+ ,(lambda (p style bar?) (list (make-menu-text (cadr p) style))))
   (symbol (:string? :*)
   ,(lambda (p style bar?) (list (make-menu-symbol p style))))
   (texmacs-output (:%1)

_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

maxima plugin

by Andrey G. Grozin :: Rate this Message:

| View Threaded | Show Only this Message

Hello *,

I've just committed a new version of the maxima plugin. As discussed in
this list, support for paleolithic versions has been removed. Only maxima
versions >= 5.9.1 are now supported (5.9.* are considered neolithic, they
were released in 2004; the earliest version still available for download
is 5.17.1 from 2008). The plugin is now much simpler and easier to
maintain; maxima_filter.c has gone. The problem reoorted by some Mac user
(his modern version of maxima was erroneously identified as pre-historic
5.6, and the plugin did not work) should now disappear.

Andrey

_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

reduce plugin

by Andrey G. Grozin :: Rate this Message:

| View Threaded | Show Only this Message

Hello *,

I've just committed a new reduce plugin which works with modern free psl
reduce. At the moment, it does not work with csl reduce; solving this
problem requires some work on the reduce side.

This plugin works with 1.0.7.15 better than with recent svn, because of
several regressions which I discussed in a separate email.

Andrey

_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Re: Regression in LaTeX import: \\ broken

by Miguel de Benito Delgado :: Rate this Message:

| View Threaded | Show Only this Message

Hi Andrey,

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.

You can check the details in progs/texmacs/texmacs/tm-files.scm

Best,
--
______________
Miguel de Benito.


_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Re: Regression in LaTeX import: \\ broken

by Andrey G. Grozin :: Rate this Message:

| View Threaded | Show Only this Message

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?

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

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?

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.

Andrey

_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Re: Regression in LaTeX import: \\ broken

by François Poulain-2 :: Rate this Message:

| View Threaded | Show Only this Message

Le Mon, 9 Apr 2012 05:00:03 +0700 (NOVT),
"Andrey G. Grozin" <A.G.Grozin@...> a écrit :

> When I run, e.g., reduce plugin, and it produces a matrix, it sends
> to TeXmacs
>
> [BEGIN]latex:\black$\displaystyle
> \left(\begin{matrix}a&b\\c&d\end{matrix}\right)$[END]
>
> In TeXmacs-1.0.7.15, this matrix was displayed correctly. In svn 5238
> (and 5232) I see instead just
>
> (a b <\> c d)
>
> I.e., TeXmacs no longer understands \\ inside a matrix.
>
> If I write a variable a2b, reduce sends to TeXmacs
>
> [BEGIN]latex:\black$\displaystyle  \mathrm{a2b}$[END]
>
> and it is displayed as
>
> a*2*b
>
> This is an old bug; I thought it has been fixed, but it has not.

I will check this asap.

François

--
François Poulain <fpoulain@...>

La fin justifie les moyens ? Cela est possible. Mais qui justifiera la
fin ? À cette question la révolte répond : les moyens.
-+- Albert Camus, L'homme révolté -+-

_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Re: Opening files in a new window

by Miguel de Benito Delgado :: Rate this Message:

| View Threaded | Show Only this Message

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



_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@...
https://lists.gnu.org/mailman/listinfo/texmacs-dev