Hello,

Thanks for the bind file (but please remember to send your messages to the lyx-devel list too!)

The shortcuts can indeed be improved. Feel free to propose an update to math.bind for all the shortcuts that do not conflict with something else.

Note that some of the shortcuts only make sense on a French keyboard, like e.g.
\bind "C-M-m apostrophe" "math-delim { }"

Another option is to put your bind file on the wiki, either here
  https://wiki.lyx.org/LyX/KeyboardShortcuts
or on a subpage referenced from there.

Regards,
JMarc


-------- Message transféré --------
Sujet :         Re: [PATCH] Make math autocorrrect work with more than 2 chars
Date :  Wed, 19 Jun 2019 08:37:12 +0000 (UTC)
De :    Ben Houcine <benhouc...@rocketmail.com>
Pour :  Jean-Marc Lasgouttes <lasgout...@lyx.org>



I'm a heavily Math equations user in my text and I'm not sure if MS Word has some speed over LyX (LibreOffice has a Formula editor too). In the last months I have completely overhauled my shortcut keys (find attached my bind keys). I write like 75% of symbols I use extremely fast using only keyboard. However, I have suggest that LyX development should focus more on improving shortcut system.

On Monday, April 15, 2019, 10:06:46 AM GMT+1, Jean-Marc Lasgouttes <lasgout...@lyx.org> wrote:


Dear Isaac,

I forward your e-mail to the developers list because this is the right
place to discuss. I understand that we forgot to keep you in cc: of the
discussion. To avoid this in the future (although we'll try to do our
best), I propose two solutions:
* that you subscribe to the list
* or that you create tickets on www.lyx.org/trac for the different
subjects that are outlines below.

Next, I'll write about the patches, which are the interesting part :)

JMarc


-------- Message transféré --------
Sujet :     Re: [PATCH] Make math autocorrrect work with more than 2 chars
Date :     Fri, 12 Apr 2019 03:23:43 +0000
De :     Isaac Oscar Gariano <isaacos...@live.com.au <mailto:isaacos...@live.com.au>> Pour : skost...@lyx.org <mailto:skost...@lyx.org> <skost...@lyx.org <mailto:skost...@lyx.org>>, lasgout...@lyx.org <mailto:lasgout...@lyx.org>
<lasgout...@lyx.org <mailto:lasgout...@lyx.org>>



Dear Lyx Developers,
Thank you JMarc and scott for responding! For some reason I did not
receiver an email, so I only noticed by looking at www.mail-archive.com
<http://www.mail-archive.com/>.
As suggested I have split my patch into two commits, and attached them.

The main reason I made this change was because I am a frequent Micrsofot
Word user, however at work I do not have windows and am usually required
to write things following LaTeX styles, hence I wanted to use lyx (which
works great!). However, I relly heavily on Microsoft Word's math
equation features as I use it's WYSYWIG features to work out what an
equation should be as writing it, rather than just typeseting an
equation I allready have in my head. In particular its autocorrect has
several features that the lyx one is lacking:

   * It supports autocorrect from an arbitrarilly long sequence of
     unicode characters.
   * It supports undoing the autocorrect with Ctrl-Z
   * It supports unicode input. LyX seems supports this as well, but when
     I put '→' in the autocorrect file instead of '\rightarrow' it shows
     in lyx with a different font, however it still outputs \rightarrow
     in the LaTeX. It would be nice if I could change the font lyx uses
     here, so I could at least copy and paste unicode symbols from other
     programs.
   * It has a simple graphical dialogue for edditing the autocorrect
     list. I use this feature quite frequently, so it would be very
     annoying to have to restart the program every time I make a simple
     change to it. I wanted to implement such a thing for LyX, however I
     am not familar with QT, so I decided to be lazy and just add a
     reload button. Perhaps instead we should just have a 'reload config'
     button that reloads all config files at once, similar to the
     existing 'reconfigure' button?
   * It allows turning on autocorrect in text mode, thus can be quite
     convenient. It may be better add a feature to LyX to make such
     autocorrects automatically create an equation, e.g. typing '->' in a
     text field would generate the latex '$\rightarrow$.
   * It triggers autocorrect on space, this is very annoying, lyx on the
     other hand applies the autocorrect immediatley!
   * It allows verbatim spaces, which is annoying as I am unable to pass
     literal spaces to a user-defined math macro, though it is possible
     with the predefined \text macro; I may consider 'fixing' this later.

As for the commented out texmacs corrections, I havn't had the time to
go through it, but their are several problems with them:

   * Some refer to commands that lyx dosn't recognise, like \longdashv (I
     don't know how to fix this problem).
   * They are in the wrong format (they are missing whitespace before the
     character that triggers the redirect)
   * Prefixes to some of them are allready registered as autocorrects
    (e.g. '<=**> \lesseqqgtr' needs to be changed to '\leqq > \lesseqqgtr')


As for your question:
   > Where do I find the first and last command of autocorrect in the
code?The idea of extending it is very nice IMO.
I'm not sure what you mean by this? Are asking where the code that
performs the autoccrect is? If so most of the changes are in
'src/mathed/MathAutoCorrect.cpp'. The main work for autocorrection is
done by Correction::correct, and the main work for reading the
autocorrect list is done in Correction::read. The rest of the changes
were just parsing a cursor to Correction::correct instead of a MathAtom
and making the Correction class store MathDatas instead of MathAtoms.

If your asking the fileformat of the autocorrect file: every line
starting with  'whitespace* #' is a comment; the rest of the lines are
of the form 'MathAtom1+ whitespace+ Character  whitespace+ MathAtom2+';
This means 'MathAtom1+ character' is autocorrected to 'MathAtom2+'; note
that autocorrects are tested from first to last in the file, so if one
is a suffix of the other, e.g. '- > \rightarrrow' and '-- >
\longrightarrow', the longer one should appear in the file /first/.

— Isaac

Attachment: user.bind
Description: Binary data

Reply via email to