📄 emacs-gen.sh
字号:
#!/bin/shcase $# in1) file=$1;;*) echo "$0: Usage: $0 path-to-emacs.c" 1>&2 exit 1esac;if [ ! -r "$file" ] ;then echo "$0: can't read $file" 1>&2 exit 1ficat << E_O_F || exit 1/* * NOTE: THIS FILE WAS GENERATED AUTOMATICALLY FROM $file * * DO NOT BOTHER EDITING THIS FILE */E_O_F# Pass 1: print out lines before @START-FUNC-TAB@# and generate defines and function declarations,sed -e '1,/@START-FUNC-TAB@/d' -e '/@END-FUNC-TAB@/,$d' < $file | awk 'BEGIN { nfunc = 0; } /^[ ]*#/ { print $0; next; } { fname = $2; c = substr(fname, length(fname), 1); if (c == ",") fname = substr(fname, 1, length(fname) - 1); if (fname != "0") { printf "#define XFUNC_%s %d\n", substr(fname, 3, length(fname) - 2), nfunc; printf "static int %s ARGS((int c));\n", fname; nfunc++; } }' || exit 1exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -