texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] One more patch to cut&paste


From: Norbert Nemec
Subject: Re: [Texmacs-dev] One more patch to cut&paste
Date: Thu, 11 Jun 2009 18:14:31 +0100
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

Gubinelli Massimiliano wrote:
Thank Norbert,
I will look at your patches as soon as possible and hopefully apply all of them.

Have you remarked any speed/memory size issues on Linux after long runing periods?
Nothing severe.

In complex documents, TeXmacs generally tends to become a bit sluggish even on simple stuff like typing text, but I have no reason to connect that with the Qt-GUI. I would love to find a way to do proper profiling, but that might be quite tricky.

Also, I am not fully content with the idling loop that is running to catch socket communications. It does not eat much CPU time, but it may interfer with some power saving features. A separate thread for each open socket doing synchronous reading would be the clean solution for this problem, but I do not see yet how one would then design the TeXmacs/GUI interface such that this works not only for Qt but for other GUIs as well.




massimiliano

On 11 juin 09, at 08:23, Norbert Nemec wrote:

Hi there,

attached is one more patch to the cut&paste mechanism.

Greetings,
Norbert
Do selection_get_cut operations on the "tmp" buffer by default. The "primary" buffer should only be used by explicit cut&paste operations by the user.

From:  <>


---

src/src/Edit/Replace/edit_select.cpp | 42 +++++++++++++++++-----------------
1 files changed, 21 insertions(+), 21 deletions(-)


diff --git a/src/src/Edit/Replace/edit_select.cpp b/src/src/Edit/Replace/edit_select.cpp
index 571609a..82f7711 100644
--- a/src/src/Edit/Replace/edit_select.cpp
+++ b/src/src/Edit/Replace/edit_select.cpp
@@ -801,27 +801,27 @@ edit_select_rep::raw_cut (path p1, path p2) {
void
edit_select_rep::selection_cut (string key) {
  if (inside_active_graphics ()) {
-    tree t= as_tree (eval ("(graphics-cut)"));
-    selection_set (key, t);
-    return;
-  }
-  if (!selection_active_any ()) return;
-  if (selection_active_table ()) {
-    path p1= start_p, p2= end_p;
-    tree sel= selection_get ();
-    selection_set (key, sel);
-    cut (p1, p2);
-  }
-  else {
+    if(key != "none") {
+      tree t= as_tree (eval ("(graphics-cut)"));
+      selection_set (key, t);
+    }
+  } else if (selection_active_any ()) {
    path p1, p2;
-    selection_get (p1, p2);
-    go_to (p2);
-    if (p2 == p1) return;
-
-    tree sel= compute_selection (et, p1, p2);
-    // cout << "Selection " << sel << "\n";
-    selection_set (key, simplify_correct (sel));
-    // cout << "Selected  " << sel << "\n";
+    if (selection_active_table ()) {
+      p1= start_p; p2= end_p;
+      if(key != "none") {
+        tree sel= selection_get ();
+        selection_set (key, sel);
+      }
+    } else {
+      selection_get (p1, p2);
+      go_to (p2);
+      if (p2 == p1) return;
+      if(key != "none") {
+        tree sel= compute_selection (et, p1, p2);
+        selection_set (key, simplify_correct (sel));
+      }
+    }
    cut (p1, p2);
  }
}
@@ -829,7 +829,7 @@ edit_select_rep::selection_cut (string key) {
tree
edit_select_rep::selection_get_cut () {
  tree t= selection_get ();
-  selection_cut ();
+  selection_cut ("none");
  return t;
}

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



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






reply via email to

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