M-x  是运行command的意思。

若使用常规Emacs debugger(即不使用edebuger),先把要debug的函数加入到debug-on-entry:

 M-x   debug-on-entry   the-function-name   RET
然后再使用eval-last-sexp命令运行单句elisp(需要移动焦点point到函数调用处),一般情况下它被绑定到键盘C-x C-e,
C-x C-e           runs   the   command   eval-last-sexp
然后就会popup一个debug窗口,按d键就可以单步调试,c键是skip and continue。

若要查看帮助,可以:
1、C-h a,  查看包含字串的command,C-h a runs the command apropos-command
2、C-h f,  查看elise的函数,describe-function,它可以查看function和command,其实command也是function。
3、C-h v, 查看变量,describe-variable
4、C-h m,查看mode的帮助, describe-mode

在emacs里执行elisp语句 :
(M-x 后面跟任何function原则上都可以交互执行,比如:M-x getenv RET 之后,输入USER就可以获得环境用户名)
M-x eval-buffer     如果你有一个代码块要执行,把它拷贝到一个新建的buffer,然后执行行首的命令。
M-x eval-region    If you want something less hamfisted(拳头) you can tell Emacs to only evaluate the region by                                                      marking what you want to run and executing(代码不多可以选择执行region,没拳头那么大)
C-x C-e                    which is bound to eval-last-sexp: 这句和emacs工作的模式有关,但大多数模式都支持。但这句有一些特别                                             地方:它不会更新由defvar 或 defcustom什么的变量的值,另外你必须把point(光标)移动                                                       到要执行的语句的结尾。
C-M-x                     eval-defun,它可能是执行某条命令的最好方式了。它基本没有上面的命令的任何问题,你可                                               以在一个form的任何地方执行这条命令,它会自动选择执行最外层的form。
M-:                          被绑定到eval-expression,是让你自己输入要执行的语句,如 (getenv "USER")。

Running Shell Commands from Emacs

M-! cmd RET

Run the shell command line cmd and display the output (shell-command).

M-| cmd RET

Run the shell command line cmd with region contents as input; optionally replace the region with the output (shell-command-on-region).

M-x shell

Run a subshell with input and output through an Emacs buffer. You can then give commands interactively.

M-x term

Run a subshell with input and output through an Emacs buffer. You can then give commands interactively. Full terminal emulation is available.

M-x eshell

Start the Emacs shell.

elisp debug的更多相关文章

  1. jmeter sampler maven项目排错记

    eclipse 创建的maven项目,引入jar包之后出现红色叹号,一直找不到原因,连main方法都无法运行,提示找不到类: 错误: 找不到或无法加载主类 soapsampler.SoapSample ...

  2. 记一次debug记录:Uncaught SyntaxError: Unexpected token ILLEGAL

    在使用FIS3搭建项目的时候,遇到了一些问题,这里记录下. 这里是发布搭建代码: // 代码发布时 fis.media('qa') .match('*.{js,css,png}', { useHash ...

  3. .NET Core的日志[3]:将日志写入Debug窗口

    定义在NuGet包"Microsoft.Extensions.Logging.Debug"中的DebugLogger会直接调用Debug的WriteLine方法来写入分发给它的日志 ...

  4. 设置tomcat远程debug

    查看端口占用情况命令: netstat -tunlp |grep 8000 tomcat 启动远程debug: startup.sh 中的最后一行 exec "$PRGDIR"/& ...

  5. Android NDK debug 方法

    最近又频繁遇到 NDK 的错误,记录一下debug调试的一些经验,以备后续查看 一般来说,在Android Studio中的Monitor中将过滤器的 LOG TAG 设置为 "DEBUG& ...

  6. 玩转Windows服务系列——Debug、Release版本的注册和卸载,及其原理

    Windows服务Debug版本 注册 Services.exe -regserver 卸载 Services.exe -unregserver Windows服务Release版本 注册 Servi ...

  7. struts debug 标签

    < s:debug> 引起下面的错误 org.apache.jasper.JasperException: Caught an exception while getting the pr ...

  8. How to debug .NET Core RC2 app with Visual Studio Code on Windows?

    Simone Chiaretta (http://codeclimber.net.nz/archive/2016/05/20/How-to-debug-NET-Core-RC2-app-with-Vi ...

  9. Debug Databinding Issues in WPF

    DataBinding is one of the most powerful features in WPF. But because it resolves the bindings at run ...

随机推荐

  1. 机器学习 —— 概率图模型(Homework: Exact Inference)

    在前三周的作业中,我构造了概率图模型并调用第三方的求解器对器进行了求解,最终获得了每个随机变量的分布(有向图),最大后验分布(双向图).本周作业的主要内容就是自行编写概率图模型的求解器.实际上,从根本 ...

  2. 【原创】Sliding Window Maximum 解法分析

    这道题是lintcode上的一道题,当然leetcode上同样有. 本题需要寻找O(N)复杂度的算法. 解体思路比较有特点,所以容易想到参考 最小栈 的解题办法. 但是最小栈用栈维护最小值很直观,这道 ...

  3. Java 包装类 自动装箱和拆箱

    包装类(Wrapper Class) 包装类是针对于原生数据类型的包装. 因为有8个原生数据类型,所以对应有8个包装类. 所有的包装类(8个)都位于java.lang下. Java中的8个包装类分别是 ...

  4. Android开发之三种动画

    转载:http://www.cnblogs.com/angeldevil/archive/2011/12/02/2271096.html http://www.lightskystreet.com/2 ...

  5. [POJ3352]Road Construction(缩点,割边,桥,环)

    题目链接:http://poj.org/problem?id=3352 给一个图,问加多少条边可以干掉所有的桥. 先找环,然后缩点.标记对应环的度,接着找桥.写几个例子就能知道要添加的边数是桥的个数/ ...

  6. Web内容管理系统 Magnolia 安装使用-挖掘优良的架构(2)

    在Windows上安装社区版  tomcat集成版 Magnolia CMS社区版本为免费发行,不需要任何GNU通用公共许可协议(第3版)条款下的授权(这个许可协议允许您在特定条款和条件下,重新分配和 ...

  7. SetCapture、ReleaseCapture、GetCapture

    正常情况下,鼠标指针位于哪个窗口区域内,鼠标消息就自动发给哪个窗口.如果调用了SetCapture,之后无论鼠标的位置在哪,鼠标消息都发给指定的这个窗口,直到调用ReleaseCapture或者调用S ...

  8. 为初学者写ORM,ORM的原理及测试案例

    提纲 一.什么是ORM.二.反射以及Attribute在ORM中的应用.三.创建一个数据库表和表对应的实体model.四.实体model如何映射出数据库表.五.组合ORM映射生成insert语句.六. ...

  9. BZOJ2299: [HAOI2011]向量

    题目:http://www.lydsy.com/JudgeOnline/problem.php?id=2299 题解:乱搞就可以了... 不妨认为有用的只有(a,b)(a,-b)(b,a)(b,-a) ...

  10. Android开发之WebService介绍

    经常有网友问:“在Android平台如何调用WebService”?经过沟通我发现,甚至有些朋友连什么是WebSerivce都不知道就在问怎么使用,更别说和WebService有关的SOAP.WSDL ...