- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我使用“--no-init-file”运行 emacs 23 和 24,以避免加载我的自定义设置。但后来我明确加载了我的旧版本 python-mode.el(版本 3.105,最后版权声明 1998 年),并看到了我将要描述的相同行为,所以我相信它是核心 emacs,而不是 python。
考虑以下代码(*
标记光标位置):
*def emacs_is_fun():
for x in range(3):
print(x)
将光标置于“def”开头的第 4 列。
在 emacs 23 中,运行 mark-sexp
选择“def”。
在 emacs 24 中,mark-sexp
选择整个代码块,直到最后打印语句。
这还不错。主要问题是这种常见用法:
*very_long_var_name[very_long_expn] += long_function_call(long_arg_list, blah)
同样,光标位于该行可打印部分的开头,第 4 列。
在 emacs 23 中,mark-sexp
选择 very_long_var_name
。
在 emacs 24 中,mark-sexp
选择从第 4 列到末尾的整行。
我一直在使用Ctrl-alt-space alt-w
来快速保存变量名称。(或者alt-2 ctrl-alt-space alt-w
来保存引用表达式。)现在是走了。是emacs,所以这个肯定是可以定制的,但是我没找到实现新行为的地方(记住我正在使用 python 模式大约15岁)。我需要在 .emacs 文件中放入什么内容?
最佳答案
@Eric 有趣。感谢您在我的其他答案的评论中提供上下文。
我想你可能只是想要这个:
(add-hook 'python-mode-hook (lambda () (setqforward-sexp-function nil)))
来自 python-mode
内置 emacs 24 内的评论(我认为您可能会得到它)
At last but not least the specialized
python-nav-forward-sexp
allows easy navigation between code blocks. If you prefercc-mode
-likeforward-sexp
movement, settingforward-sexp-function
to nil is enough...
这更接近我对 sexp 的看法,就像我在其他答案中提到的那样,但在 lisp 之外,sexp 似乎至少有些模棱两可。
关于python - emacs 24 : How do I get back emacs-23 sexp behavior for python mode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35162556/
我有很棒的vim-sexp和 vim-sexp-mappings-for-regular-people安装了插件,我遇到了一个我不确定如何解决的情况。 假设我有以下形式: (alimony barba
在任何 lisp 中是否有一种形式可以“传播”父 sexp 中的列表?喜欢: (+ (spread '(1 2 3))) -> (+ 1 2 3) 最佳答案 有两种方法可以做到这一点。哪个更好取决于你
如果我写一个文件使用 (with-open-file (s "~/example.sexp" :direction :output) (write '(1 2 3) :strea
我正在尝试创建一个捕获模板,该模板将 URL 转换为带有 的组织模式链接。作为链接名称。 我的转换函数如下所示: (defun get-page-title (url) "Get title o
sexp 是这样的:type sexp = Atom of string | sexp 列表列表,例如,"((a b) ((c d) e) f)"。 我编写了一个解析器来将 sexp 字符串解析为以下
我正在使用 C 中的 R 内部接口(interface)。我需要从 C 中分析 SEXP 的内容,但我不知道确切的 SEXP 结构。有没有一种简单的方法(或一些现有代码)可以将 SEXP 转储到控制台
我正在写一个 R package to provide debug helper functions gdb 打印 R 的 SEXP 和 Rcpp 数据类型的变量值。 C/C++ 是一种强类型语言,但
我有一个函数可以替换列表中符号的所有实例: (defun replace-symbol-in-sexp-fn (symbol-to-replace new-symbol sexp) (if (eq
对于一项任务,我们必须实现类似非常基本的 sexp 解析器的东西,这样的输入如下: "((a b) ((c d) e) f)" 它会返回: [["a", "b"], [["c", "d"], "e"]
这个问题在这里已经有了答案: Initialize a variable with different type based on a switch statement (2 个答案) 关闭 6 年
如何使用 org-contacts 设置纪念日,以便在我的议程.org 文件中显示生日等内容? 我的议程.org 文件包含以下内容,如 org-contacts 底部所述 #+STARTUP: sho
我需要将已知长度的 const char* 转换为 Rcpp::RawVector 以返回到 R. Rcpp::wrap 适用于许多类型,但似乎不适用于 char *。 最佳答案 library(Rc
愚蠢的人,但我自己想不出来 - 我如何获得下一个 sexp?就像 preceding-sexp 一样,但是向前。 最佳答案 查看 forward-sexp。你有一个很好的例子here . 好的,根据您
我在 utop 中运行这段代码: # type u = { a: int; b: float } [@@deriving sexp];; 但是没有生成预期的 s 表达式转换器声明。 我安装了 Core
我在 Hadley Wickham 的书中读到 RObjects 应该在 R 的 C API 中声明为 S 表达式 (SEXP): SEXP x( SEXP a, SEXP b { } 然而,在 Rc
假设我有一个函数将 SEXP 类型作为参数: SEXP myFun(SEXP param) 如何找出这个参数的类型?查看我的调试器中的 SEXP 类型,我可以看到我可以调用 param->sxpinf
考虑一个虚拟的例子 > cppFunction(' + NumericVector invert(NumericVector& x) { + x = x + 1; + return x
SEXP callFunction1(List network, List words, Function testWordContinuity){ SEXP res = testWordCont
有没有办法转换 arma::subview进入 SEXP ?创建矩阵后我有以下代码 X在我的 Rcpp代码: //.... MCMC loop if(i % skiplength == 0)
正在关注 this recipe ,我准备了这个搜索命令: (shell-command "grep . /tmp/listoffiles | xargs grep -n mystring" 1) 如
我是一名优秀的程序员,十分优秀!