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. Buffer数据结构和new IO的Memory-mapped files

    一.Buffer类 java.nio.Buffer这个类是用来干什么的?有怎样的结构? "Core Java"中是这样定义的“A buffer is array of values ...

  2. Spring IoC — 基于注解的配置

    基于XML的配置,Bean定义信息和Bean实现类本身是分离的,而采用基于注解的配置方式时,Bean定义信息即通过在Bean实现类上标注注解实现. @Component:对类进行标注,Spring容器 ...

  3. 百度HTTPS加密搜索有什么用?

    前段时间,我曾提到百度支持移动端HTTPS SSL加密搜索,用以保护用户隐私.最近,百度开始支持PC端HTTPS SSL加密搜索,现在可以启用 https://www.baidu.com 搜索.我很少 ...

  4. hdu2457:DNA repair

    AC自动机+dp.问改变多少个字符能让目标串不含病毒串.即走过多少步不经过病毒串终点.又是同样的问题. #include<cstdio> #include<cstring> # ...

  5. I.MX6 Power off register hacking

    /*********************************************************************** * I.MX6 Power off register ...

  6. noip2005提高组题解

    05年的题目绝对是自2000年以来难度最大的.后三题的难度系数分别为0.2.0.2.0.3,而前面几年的题目中每年最多只出现一道难度系数为0.2的题目,其难度可见一斑. 强烈推荐这个 PPT,每道题都 ...

  7. MVC中前台所得

    前台页面时间格式修改: @item.CreateTime.ToString("yyyy-MM-dd hh:mm:ss") 前台方法调用传参数: <a href="# ...

  8. Android Message和obtainMessage的区别

    类概述 定义一个包含任意类型的描述数据对象,此对象可以发送给Handler.对象包含两个额外的int字段和一个额外的对象字段,这样可以使得在很多情况下不用做分配工作. 尽管Message的构造器是公开 ...

  9. Android 长按setOnItemLongClickListener 注意细节

    Java代码 gridview.setOnItemLongClickListener(new OnItemLongClickListener() { @Override public boolean ...

  10. mysql5.6子查询的优化

    https://dev.mysql.com/doc/refman/5.6/en/subquery-optimization.html Semi-join in MySQL 5.6   MySQL 5. ...