emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dmitrii Korobeinikov <dim1212k@gmail.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: Philipp Stephani <p.stephani2@gmail.com>,
	35419@debbugs.gnu.org, Noam Postavsky <npostavs@gmail.com>
Subject: bug#35419: [Proposal] Buffer Lenses and the Case of Org-Mode (also, Jupyter)
Date: Sun, 2 Jun 2019 15:09:47 +0600	[thread overview]
Message-ID: <CA+Yh0SS=uwztoyBA0P=W_e6-CcKm+v_+zTfeCQU6pZSzKWUBOw__26262.5055200019$1559466713$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <87v9xpfjhs.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me>

[-- Attachment #1: Type: text/plain, Size: 2449 bytes --]

Dear Ihor,

> Regarding the question about buffer-lens interaction. Let's take even
> more complicated example:  To run the command, the user hits some key
> combination, which happens to be bound to different commands in the main
> buffer and in the lense buffer (i.e. the main buffer is in org-mode, the
> lense is in mingus-mode, and the key is C-d). What should be the
> behaviour in such a case? run the commands in both the buffers? decide
> depending on the point position? It is easy to make up similar
> complicated examples if you consider some exotic major modes in the
> lense buffer.

It's basically a question of customization, a client-side decision.
In other words, this really depends on what the user wants to happen.

This customization is done through the controller of the lens.

To your example.
If the desirable behavior (for you, as a user) for C-d is to run in the
lens, then add "C-d" to the controller of the lens.
And then, whenever the point is in the area, C-d runs in the lens
unconditionally.
(For the sake of terminology, we can say that the keybinding is
"redirected".)

If you want C-d to work conditionally (sometimes do the org-mode thing and
sometimes the mingus-mode thing), I am afraid there is nothing better than
to update the controller yourself on the go.
And that's fine, because that's what the user wants (to use the same bind
for two different things in the same place at different times).

(BTW, the controller could be asked to work "in reverse" and redirect all
keybindings, except the ones in its black list.)

But speaking of the larger picture and integration, a user can define a
list of key combinations for any mode and the list will be added to the
controller if the lens runs that mode.
I think this should cover the vast majority of use-cases.
Of course, there is no reason for the logic of key addition not to be
flexible enough to cover anything more exotic.

> I think that it would be more effective if someone decide on some basic
> approach for the low-level implementation of the lense-mode (which
> probably involves modifying emacs C-level source code) and continue the
> discussion according to the benefits/limitations of that kind of
> implementation.

I too look forward to hearing from someone about the low-level
implementation possibilities :)
I especially hope the approach for the border-case issue (as described in
my previous message) can work.

Best regards,
Dmitrii.

[-- Attachment #2: Type: text/html, Size: 2696 bytes --]

  parent reply	other threads:[~2019-06-02  9:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+Yh0SQpFnsE2NZqbRjuzDyS-sQO_RTtTPBKth0F5EhnjNGtBQ@mail.gmail.com>
2019-05-05  6:07 ` bug#35419: [Proposal] Buffer Lenses and the Case of Org-Mode (also, Jupyter) Ihor Radchenko
     [not found] ` <87muk1fn90.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me>
2019-05-14 17:42   ` Dmitrii Korobeinikov
2019-06-01 14:49     ` Ihor Radchenko
     [not found]     ` <87v9xpfjhs.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me>
2019-06-02  9:09       ` Dmitrii Korobeinikov [this message]
     [not found] <CA+Yh0SQ7yWQBjXhKbJPrCroriNpwhyFyQWAfHsUvxwmojsjKuw@mail.gmail.com>
2019-04-25  1:37 ` Noam Postavsky
     [not found] ` <87sgu6rhkt.fsf@gmail.com>
2019-04-25  8:40   ` Dmitrii Korobeinikov
     [not found]   ` <CA+Yh0SSvQMucaC1EJR9GBxpKeP6haGiHN+Lf2QYo8csNoy0Waw@mail.gmail.com>
2019-04-25 17:52     ` Philipp Stephani
     [not found]     ` <CAArVCkQcwnjeMyRU6rpiuvGsOCUOsnQTQwQSGdDFKwQz_Sbi3g@mail.gmail.com>
2019-04-25 21:14       ` Dmitrii Korobeinikov
2019-04-26 12:05     ` Roland Everaert
2019-05-02 21:31 ` Dmitrii Korobeinikov
2019-04-24 19:20 Dmitrii Korobeinikov
2019-04-25  3:25 ` Ihor Radchenko
2019-04-25 21:00   ` bug#35419: " Dmitrii Korobeinikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+Yh0SS=uwztoyBA0P=W_e6-CcKm+v_+zTfeCQU6pZSzKWUBOw__26262.5055200019$1559466713$gmane$org@mail.gmail.com' \
    --to=dim1212k@gmail.com \
    --cc=35419@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    --cc=p.stephani2@gmail.com \
    --cc=yantar92@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).