Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] Multiline-plugin

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] Multiline-plugin


Chronological Thread 
  • From: "Adrian S." <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Multiline-plugin
  • Date: Sun, 11 Mar 2012 09:46:46 -0600

Thank you, Joris.  I originally wanted this to be able to emulate EOF when newlines were not transformed into spaces so that the plugin would know when the entry of the user has ended.  In the modifications I gave this is worked around, and I did some guessing, since I still don't quite understand the serializer.

As far as I am concerned, it is no longer a priority for me to have that fixed, as I found a reasonable alternative, though this poses a problem in the documentation of features that are not available.

The fix to have all plugins compile was a long needed one, since they are the models people will follow to write new plugins.

Thank you, Joris!

Peace.
-Adrián.

On Sun, Mar 11, 2012 at 9:26 AM, Joris van der Hoeven <address@hidden> wrote:
Dear Adrian,

Yes, you are right: the multiline feature no longer works.
This is a consequence of the latest "improvement" of the plug-in system,
which now allows for the execution of several inputs in succession.
If I have some time, then I will try to fix this issue, but this is
not completely trivial.

Best wishes, --Joris

PS: I did fix the compilation issue concerning iostream.h;
also for the other example plug-ins.

On Mon, Mar 05, 2012 at 04:48:31PM -0600, Adrian S. wrote:
> I attach a modified file of the file multiline.cpp with slightly
> modified the  headers so that it will compile (it did not before).
> Simply replace the file that is inside of
> TeXmacs/examples/plugins/multiline/src with what I attach.  Then
> simply run make in TeXmacs/examples/plugins/multiline.
>
> You can add the multiline plugin then by simply copying the directory
> multiline directory inside  of your .TeXmacs/plugins directory so that
> TeXmacs recognizes it.   I am afraid that this change in the header
> files is needed for many of the example plugins.
>
> ----------------------------------Possible
> bug-------------------------------------------
> I ran it using the tools->debug and in debug I enabled the io.
> However, it seems that TeXmacs is not sending
>
> \020(input-done? "what the user wrote;")
>
> Here \020 means DATA_COMMAND, which is chr(16).
>
> I ran the program emulating the part that TeXmacs did via emacs and
> using ctrl-q ctrl-p to quote a ctrl-p in emacs shell mode.  It seemed
> to work fine.
>
> which the program is expecting to be waiting for.
>
> Can anybody confirm or hint me at a way to check if TeXmacs is indeed
> sending the \020(input-done? "what the user wrote;") ?
>
> I tracked down in the source and I saw the file plugin-cmd.scm where
> the command  default-format-command is defined, but would not find a
> way to tell if this is used elsewhere.
>
> Peace to all, and it was great to be there.
>
> -Adrián.

>
> /******************************************************************************
> * MODULE     : multiline.cpp
> * DESCRIPTION: A plugin which uses multiline input as long as
> *              the input is not terminated by ';'
> * COPYRIGHT  : (C) 2003  Joris van der Hoeven
> *******************************************************************************
> * This software falls under the GNU general public license version 3 or later.
> * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
> * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
> ******************************************************************************/
>
> #include <stdio.h>
> #include <iostream>
> #include <string.h>
> using namespace std;
>
> #define DATA_BEGIN   ((char) 2)/* ctrl-b*/
> #define DATA_END     ((char) 5)/* ctrl-e*/
> #define DATA_COMMAND ((char) 16)/* ctrl-p*/
> #define DATA_ESCAPE  ((char) 27)
>
> int
> main () {
>   cout << DATA_BEGIN << "verbatim:";
>   cout << "Terminate your input by ';'";
>   cout << DATA_END;
>   fflush (stdout);
>
>   while (true) {
>     char buffer[100];
>     cin.getline (buffer, 100, '\n');
>     if (buffer[0] != DATA_COMMAND) {
>       cout << DATA_BEGIN << "verbatim:"
>            << buffer;
>       cout << DATA_END;
>     }
>     else {
>       int  n = strlen (buffer);
>       cout << DATA_BEGIN << "scheme:";
>       if (buffer[n-3] == ';')
>       {cout << "#t";
>       }
>       else
>         {cout << "#f";
>       }
>       cout << DATA_END;
>     }
>     fflush (stdout);
>   }
>   return 0;
> }





Archive powered by MHonArc 2.6.19.

Top of Page