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. 写Java程序让Jvm崩溃

    package jvm; public class HeapCrash { public static void main(String[] args) { //Object[] o = {“abc” ...

  2. apache prefork和worker模式的比较

    http://www.t086.com/article/4443 http://www.cnblogs.com/fnng/archive/2012/11/20/2779977.html

  3. Linux进程的睡眠和唤醒简析

    COPY FROM:http://www.2cto.com/os/201204/127771.html 1 Linux进程的睡眠和唤醒 在Linux中,仅等待CPU时间的进程称为就绪进程,它们被放置在 ...

  4. NuGet在2015中的使用

    NuGet Package Restore  https://docs.nuget.org/Consume/Package-Restore 以https://github.com/andburn/hd ...

  5. R语言日期时间函数

    Sys.Date( ) returns today's date. date() returns the current date and time.# print today's datetoday ...

  6. linux中改变文件权限和属性

    Linux中,默认显示所有用户名的文件在/etc/passwd,用户组的信息在/etc/group 密码/etc/shadow chgrp改变文件所属用户组 chgrp [-R] 用户组名 文件或目录 ...

  7. 关于fft的一点总结

    好吧,其实我并没有深入运用fft,只会优化卷积 听说fft经常和生成函数结合在一起………………oi真是迅猛发展,我真是与时代脱节了…… 关于fft的学习推荐直接去看算法导论,写得非常清楚 主要弄懂n次 ...

  8. bzoj3747

    经典题,记录每个位置对应数下次出现的位置next[i] 每个位置维护当前左端点下到这个位置的和 随着左端点的右移一位到i+1,对[i+1,next[i]-1] 的影响是-a[i], [next[i], ...

  9. UVa 10868 (物理) Bungee Jumping

    题意: 有个人在蹦极,给出悬崖的高度,绳子的长度,弹簧绳的胡克系数 以及 人的质量. 判断人是否能够着地,能的话是否能安全着地.所谓安全着地就是到达地面的速度不超过10m/s. 分析: 学过一点高中物 ...

  10. UVa 11400 Lighting System Design

    题意: 一共有n种灯泡,不同种类的灯泡必须用不同种电源,但同一种灯泡可以用同一种电源.每种灯泡有四个参数: 电压值V.电源费用K.每个灯泡的费用C.所需该种灯泡的数量L 为了省钱,可以用电压高的灯泡来 ...