Attached is an updated patch.

I added the bindings alt-<right> and alt-<left> for move-column
support. These were unbound before.
I thought about suggesting introducing PARAGRAPH_MOVE_{RIGHT,LEFT} but
now I think that would be unnecessary abstraction.

Should I make (four) buttons for the table toolbar? I'm not sure if
this feature is worth adding 4 buttons for. I don't see why a user
would prefer to use a button instead of a keyboard shortcut. I think
the only reason to do this would be to let people know that the
function is there in case they want to find and use the keyboard
shortcut. I have no opinion on this. Either way though, I am curious
as to whether we have svg (or other) originals of the current buttons
or do we only have the png's that are in lib/images/ ?

I just found the following lines in stdcontext.inc and stdmenus.inc:
# Item "Swap Rows|S" "inset-modify tabular swap-row" # currently broken
# Item "Swap Columns|w" "inset-modify tabular swap-column" # currently broken

I think that this is what I am trying to implement.
It looks like it goes back to 2002, introduced by this commit: df03e5fc
Should I use the name "move-row" or "swap-row"? I think "move-row" is
more user friendly, but I think "swap-row" is more technically
correct.

The only thing that is not working (that I know of) is change
tracking. But this is true for a lot of tabular features so does it
make sense to commit this anyway and then file a bug report for all of
them?

If anyone has some complicated tables around and feels like testing
this, I would appreciate it. I don't use tables often and when I do,
it's for simple tables.

Any comments would be appreciated.

Thanks,

Scott
From 4aaf1f4849f4f94e4546e0aec9da5d6f8f98f366 Mon Sep 17 00:00:00 2001
From: Scott Kostyshak <skost...@lyx.org>
Date: Mon, 10 Dec 2012 06:54:37 -0500
Subject: [PATCH] Warn when using docs with knitr and sweave modules

A warning is now displayed when opening a document with the knitr or
sweave module enabled. If the user ticks the checkbox on the warning
message, the warning will not be displayed in the future for documents
with the same filename and author.

The reason that a warning is appropriate is that arbitrary system
commands can be run in R (e.g., the 'system' command). LaTeX can also
run arbitrary system commands (e.g. the '\write18' command) but LyX does
not allow these commands by default because the LaTeX converters are not
run with the '--shell-escape' option by default.
---
 src/TextClass.cpp |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/TextClass.cpp b/src/TextClass.cpp
index d0a9f0d..5b4066b 100644
--- a/src/TextClass.cpp
+++ b/src/TextClass.cpp
@@ -1469,6 +1469,18 @@ DocumentClassPtr getDocumentClass(
                                                bformat(_("Error reading module 
%1$s\n"), from_utf8(modName));
                        frontend::Alert::warning(_("Read Error"), msg);
                }
+               if (modName == "knitr" || modName == "sweave") {
+                       docstring const msg =
+                               bformat(_("If you compile this document with 
the %1$s module enabled\n"
+                                       "(which it currently is), it is 
possible that arbitrary system\n"
+                                       "commands could be run (e.g. with R's 
'system' command).\n"
+                                       "Only compile this document if you 
trust the author or if you\n"
+                                       "have reviewed the embedded R code. 
Tick the checkbox below\n"
+                                       "if you do not want to see this warning 
again for any documents\n"
+                                       "with this same name (DOCNAME) and 
author (AUTHOR_NAME)."),
+                               from_utf8(modName));
+                       frontend::Alert::warning(_("Potentially dangerous 
module"), msg, true);
+               }
        }
        return doc_class;
 }
-- 
1.7.9.5

Reply via email to