开始写的emacs lisp 两个小东西
;*****************************************************************************************************************;作者:zklhp
;Email:zklhp@
;QQ:493165744
;2012.9.3
;版权所有 转载请保持完整
;*****************************************************************************************************************
第一个是插入那个录像中东西的代码 不过我最开始弄的时候不是用的代码 看pangding版主发了vim的我也写了个emacs的
(dotimes (i 1000) (insert (format "a[%d] = 0;\n" i)))
用法很简单 M-: 打上上面的就可以了 M-: 在PC上其实是 Alt-: 为了打:自然也得打Shift
后一个是昨天晚上写的 因为经常要从文献中复制东西 而文献中是自动断行的
DFT Calculations. DFT calculations were performed using
Gaussian03
60
to study the geometry changes of the copper
complexes induced by the presence of a counterion. As reported
previously,
19
geometry optimizations were carried out without
symmetry constraints using the BLYP
50,61
functional, with the
6-31G* basis set on C, H, O, and N atoms and the SDD
62
basis
set and ECP on Cu. Harmonic frequency calculations were
performed to confirm that calculated structures were minima.
To calculate electron densities and estimate solvent effects (with
the PCM
63
model as implemented in Gaussian03), single point
calculations were performed adding one polarization function
on hydrogen and one diffuse function on heavy atoms (6-31+G**). In order to estimate the energetic cost of distortion
caused by ClO
4
-, we have defined a strain energy calculated as
follows: (i) BLYP/6-31 +G** single point on the opti
啊 基本没法看、、、 所以有下面的函数 优点是带了简单的判断 不过实现方法比较恶心。。
程序代码:
(defun make-a-long-sentence () "make a long sentence" (interactive) (let (str pt) (end-of-line) (delete-char 1) (backward-char) (setq str (buffer-substring (setq pt (point)) (1+ pt))) (if (not (string-equal str " ")) (progn (forward-char) (insert " ") ) ) ) )
上面这个算是我原创的第一个emacs lisp函数罢 写的不好各位多批评。。。。
[ 本帖最后由 zklhp 于 2012-9-3 10:19 编辑 ]