auctex
[Top][All Lists]
Advanced

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

Re: LaTeX-math-list: Binding on key sequences?


From: Arash Esbati
Subject: Re: LaTeX-math-list: Binding on key sequences?
Date: Fri, 16 Jul 2021 12:49:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50

Ikumi Keita <ikumi@ikumi.que.jp> writes:

>>>>>> Arash Esbati <arash@gnu.org> writes:
>>
>> Adding "Key sequence" with a string as KEY is missing.
>
> Yeah, I think it should be updated, too. However, I feel that it's not
> enough just to mention that KEY can be a string describing key sequence.
> As I experienced first in this thread, if a key sequence KEY begins with
> an entry in LaTeX-math-default which is already bound to another
> command, `define-key' returns error. That would be hard for users
> without elisp knowledge to understand why.

What do you think about a change like this:

--8<---------------cut here---------------start------------->8---
diff --git a/latex.el b/latex.el
index 083e5303..ded745fc 100644
--- a/latex.el
+++ b/latex.el
@@ -5653,8 +5653,14 @@ Each entry should be a list with up to four elements, 
KEY, VALUE,
 MENU and CHARACTER.

 KEY is the key (after `LaTeX-math-abbrev-prefix') to be redefined
-in math minor mode.  If KEY is nil, the symbol has no associated
-keystroke \(it is available in the menu, though\).
+in math minor mode.  KEY can be a character (e.g. ?o) for a
+single stroke or a string (e.g. \"o a\") for a multi-stroke
+binding.  If KEY is nil, the symbol has no associated
+keystroke (it is available in the menu, though).  Note that
+predefined keys in `LaTeX-math-default' cannot be overridden in
+this variable.  Currently, only the lowercase letter 'o' is free
+for user customization, more options are available in uppercase
+area.

 VALUE can be a string with the name of the macro to be inserted,
 or a function to be called.  The macro must be given without the
@@ -5662,8 +5668,8 @@ leading backslash.

 The third element MENU is the name of the submenu where the
 command should be added.  MENU can be either a string
-\(e.g. \"greek\"\), a list (e.g. \(\"AMS\" \"Delimiters\"\)\) or
-nil.  If MENU is nil, no menu item will be created.
+\(e.g. \"greek\"), a list (e.g. (\"AMS\" \"Delimiters\")) or nil.
+If MENU is nil, no menu item will be created.

 The fourth element CHARACTER is a Unicode character position for
 menu display.  When nil, no character is shown.
--8<---------------cut here---------------end--------------->8---

> A framework such that key sequence specification in LaTeX-math-list can
> override LaTeX-math-default in such cases would be preferable. However,
> I couldn't think of an easy way to do so.

+1

>> I also think we should give users a key for personal key sequences
>> instead of replacing the predefined ones.  A list of keys used by
>> `LaTeX-math-default' is attached below.  'o' seems to be free in the
>> lowercase area.  What do you and others think?
>
> It wouldn't hurt to just suggest `o'. However, we have to anticipate
> that there are some users who aren't satisfied with only single fixed
> prefix "` o" left for customization. So I don't think it's an enough
> solution.

Well, currently this is the only solution we have in the lowercase
area.  More uppercase and \C-prefixed options are available.  But as you
said, a framework for full flexibility is not easy.

Best, Arash



reply via email to

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