相关疑难解决方法(0)

emacs lisp以编程方式使用前缀参数调用函数

我想从一些elisp代码中调用一个函数,就好像我用前缀参数以交互方式调用它一样.具体来说,我想用前缀调用grep.

我最接近它的工作是使用execute-extended-command,但仍然要求我输入我想用前缀调用的命令...

;; calls command with a prefix, but I have to type the command to be called...
(global-set-key (kbd "C-c m g")
                (lambda () (interactive)
                  (execute-extended-command t)))
Run Code Online (Sandbox Code Playgroud)

该文件说,execute-extended-command使用command-execute执行从迷你缓冲区读取命令,但我一直没能使其工作:

;; doesn't call with prefix...
(global-set-key (kbd "C-c m g")
                (lambda () (interactive)
                  (command-execute 'grep t [t] t)))
Run Code Online (Sandbox Code Playgroud)

有没有办法以非交互方式调用带前缀的函数?

emacs elisp

36
推荐指数
2
解决办法
6134
查看次数

Emacs,如何只显示当前任务并在org-mode中隐藏其他任务?

组织模式.
我有一个很大的任务树,我想在缓冲区中只选择1个(只为它编写注释)并在编辑时隐藏其他任务.
我怎样才能做到这一点?

task-1
  subtask-1.1
  subtask-1.2
task-2
  subtask2.1
...
...
Run Code Online (Sandbox Code Playgroud)

例如,我想只为我显示:

subtask-1.2
(notes for this subtask)
Run Code Online (Sandbox Code Playgroud)

emacs org-mode

9
推荐指数
1
解决办法
1301
查看次数

标签 统计

emacs ×2

elisp ×1

org-mode ×1