如何获得基本的App< - > Emacs集成? [英] How do I get basic App<->Emacs integration?

查看:105
本文介绍了如何获得基本的App< - > Emacs集成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一大堆应用程序将Emacs与外部进程集成在一起。 GDB是一个想到的。我可以从emacs控制GDB,然后在屏幕上获得反馈。

There are a bunch of applications out there that integrate Emacs with external processes. GDB is one that comes to mind. I can control GDB from emacs and then get feedback on the screen.

我想用我的应用程序向这个方向做某事。

I'd like to do something in that direction with my application.

这是我想要的:


  • 建立我和emacs之间的连接。我可能会开始一个新的emacs过程,并将其压缩到我的GUI中。

  • 告诉emacs显示一个文件。 (容易与emacsclient)

  • 告诉emacs滚动到一个特定行号的中心,hilite或只是将光标移动到那里。


    • 可能真正的问题是如何从我的外部应用程序发送任意的elisp代码以执行emacs。

    • 我不会说elisp,但这将是一个很好的借口学习

    • establish a connection between me and emacs. I'd probably start a new emacs process and slurp it into my GUI
    • tell emacs to display a file. (easy with emacsclient)
    • tell emacs to scroll to center on a particular line number and hilite or just move the cursor there.
      • Probably the real question is how do I send arbitrary elisp code from my external app for emacs to execute.
      • I don't speak elisp, but this would be a great excuse to learn

      • 即使没有可点击性,发送消息的键绑定也是一个开始。 (但我知道可点击的事情是可能的,所以我问)

      我知道这是可能的(在emacs中是不可能的),但是我不知道从哪里开始googling。

      I know that this is all possible (what isn't possible in emacs?), but I just don't know where to start googling.

      推荐答案

      可点击区域

      窗口小部件库可以让您将缓冲区的一部分按钮(也是无线电框,复选框) ,列表),当您单击它们时将执行elisp。例如:

      The widget library would let you make parts of your buffer into buttons (also radio boxes, check boxes, lists), which will execute elisp when you click them. For example:

          (require 'widget)
      
      (defun simple-widget-example ()
         (interactive)
        (switch-to-buffer "*Simple widget example*")
      
        (let ((inhibit-read-only t))
          (erase-buffer))
      
        (let ((all (overlay-lists)))
          ;; Delete all the overlays.
          (mapcar 'delete-overlay (car all))
          (mapcar 'delete-overlay (cdr all)))
      
        (widget-insert "Sample button\n")
        (widget-create 'push-button
               :notify (lambda (&rest ignore) 
                     (message "Poop! Ha Ha!"))
               "Press Me")
      
        (use-local-map widget-keymap)
      
        (widget-setup))
      

      请参阅 Emacs小部件库

      这篇关于如何获得基本的App< - > Emacs集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆