emacs - how to process the buffer character-by-character in elisp? -


I am trying to write some alips to process each character in the current buffer (I know this is a little bit Will slow down, but it seems that this is the best way). How do I do not want to use a regular expression?

The function buffer-string returns the current buffer as a string, it can be used and can redirect / reset each character. I can not understand how to remove the result in buffer.
Can a person show an example of walking on each character, can change it in a few simple ways, and bring the result back into buffer?

use a while loop and forward-char < / Code> All characters in the buffer:

  (goto-four) (while not (eobb) (let's * ((current-character (four- After ()) (new -character (some-current-character)) (deleted letter 1) (insert- four new characters)) (forward-char 1))   

the loop moves forward By the time the buffer ( eobp ) is gone, the character once.

Four-After gives you the character The current term. Delete-variable / insert-char calls changes the old character with the new character, which results from the processing of the old character.

old character of multiple letters, i.e. a string, just type with insert . insert after , so the loop will move forward with the next unprocessed character.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -