我想写一个Emacs函数来调用describe-function的current-word.如果没有命名的函数current-word则调用describe-variable.
我试着写,但我连打电话describe-function的current-word...
(defun describe-function-or-variable ()
(interactive)
(describe-function `(current-word)))
Run Code Online (Sandbox Code Playgroud)
我怎么写呢?
我想使用bash shell脚本调整多个.jpg和.png图像的大小.
以下脚本工作正常,但我不想写两次相同的东西.
for image in *.jpg; do
mogrify -resize x1000 "${image}"
done
for image in *.png; do
mogrify -resize x1000 "${image}"
done
Run Code Online (Sandbox Code Playgroud)
如何一次过滤jpg和png图像?
我想改变一个小模式的行为取决于主模式.现在,我写的就是以下.
(defun foo (input)
(if (or
(eql major-mode 'foo-mode)
(eql major-mode 'foo1-mode)
(eql major-mode 'foo2-mode))
(myfunc-one input)
(myfunc-two input)))
Run Code Online (Sandbox Code Playgroud)
我工作,但我不想写3次类似的条件陈述.我怎样才能更有效地写它?