[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
know perl for gnus-user-format-function-X but not lisp
From: |
Dan Jacobson |
Subject: |
know perl for gnus-user-format-function-X but not lisp |
Date: |
Fri, 22 Oct 2004 10:04:22 +0800 |
Is there any perl to emacs lisp converter program?
You see I want do s/A/B/g in emacs lisp, but it looks tough in the docs,
What you probably want is a loop like this:
(while (search-forward FROM-STRING nil t)
(replace-match TO-STRING nil t))
which will run faster and will not set the mark or print anything.
(You may need a more complex loop if FROM-STRING can match the null string
and TO-STRING is also null.)
Checking in the Emacs Lisp manual didn't make things clearer.
You see I want to do as I say in the comment:
(setq
gnus-summary-line-format
(concat
"%U%R%z%I%(%t|%~(cut-left 3)d%~(max-right 2)d%4L|%-20,20f%)"
"%~(max-right 1)~(form(gnus-extra-header 'X-NOFFLE-Status))@:%s\n"))
;I want to use (perl) regexp s/(\w)\w* */$1/g above to get the first
;letter of each of the items on the X-NOFFLE-Status line, but don't know
;how in gnus, so we just get the first letter.
There is no example on gnus Info node 8.4.4 User-Defined Specs.
- know perl for gnus-user-format-function-X but not lisp,
Dan Jacobson <=