Emacs lisp “shell-command-on-region”

后端 未结 3 1756
孤独总比滥情好
孤独总比滥情好 2021-02-04 01:25

In GNU Emacs, I want to run a program, figlet, on the currently selected text. I then want to comment the region which is produced.

I have figured out how to do it using

3条回答
  •  心在旅途
    2021-02-04 01:52

    Well, I'm not sure where the garbage is coming from, but the error itself is coming from shell-command-region. When used in elisp, it expects at least 3 arguments, START END and COMMAND.

    Also, in general, it is bad practice to mess with the mark in functions. Here is what the doc of push-mark has to say on the subject:

    Novice Emacs Lisp programmers often try to use the mark for the wrong purposes. See the documentation of `set-mark' for more information.

提交回复
热议问题