octave-patch-tracker
[Top][All Lists]
Advanced

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

[Octave-patch-tracker] [patch #9050] Display variables by hovering the m


From: Lachlan Andrew
Subject: [Octave-patch-tracker] [patch #9050] Display variables by hovering the mouse cursor
Date: Wed, 13 Jul 2016 10:34:51 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

URL:
  <http://savannah.gnu.org/patch/?9050>

                 Summary: Display variables by hovering the mouse cursor
                 Project: GNU Octave
            Submitted by: lachlan
            Submitted on: Wed 13 Jul 2016 10:34:48 AM GMT
                Category: Core : new feature
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

This patch, in three changesets, causes the value of a variable to be
displayed when the cursor hovers over it, as Matlab does.  (Philip, you
mentioned that this would be useful, so I'm adding you to the Cc list.)

The first two patches (display_mutex and display_hover) have been separated
out because they provide "infrastructure" that is likely to be useful for
other tasks.

The first provides a thread-safe (i.e., locked) mechanism to allow the GUI to
call quick functions from the core.  It uses a very coarse-grained mutex lock,
which the core holds whenever it is not doing a readline.  That minimizes the
locking overhead, while still allowing the GUI access while the user is
debugging or writing code.

The second provides "hover" events when the mouse stays still over the edit
area for more than 0.5s.  In future, this will allow us to show the matching
if/while etc. when hovering over an endif/endwhile/end, or the usage info for
a function.

The final patch, display_show_vars, responds to the hover signal by displaying
the variable name, size, type and value. Some, such as large diagonal
matrices, are displayed in a more compact form than print() gives, but most
just use print().

One caveat is that, like Matlab, this just looks at the string under the
cursor and evaluates it in the current context, even if the cursor is over a
function in a different context.  In the future, I hope to have the full parse
tree accessible to the GUI, which would allow us to determine which function
the cursor is in, and look for the appropriate stack frame.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 13 Jul 2016 10:34:48 AM GMT  Name: patch_xxxxx_display_mutex.cset 
Size: 3kB   By: lachlan

<http://savannah.gnu.org/patch/download.php?file_id=37843>
-------------------------------------------------------
Date: Wed 13 Jul 2016 10:34:48 AM GMT  Name:
patch_xxxxx_display_show_vars.cset  Size: 11kB   By: lachlan

<http://savannah.gnu.org/patch/download.php?file_id=37844>
-------------------------------------------------------
Date: Wed 13 Jul 2016 10:34:48 AM GMT  Name: patch_xxxxx_display_mutex.cset 
Size: 3kB   By: lachlan

<http://savannah.gnu.org/patch/download.php?file_id=37845>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?9050>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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