www.delorie.com/gnu/docs/recode/recode_14.html   search  
 
Buy GNU books!


The recode reference manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.8 Using recode within Emacs

The fact recode is a filter makes it quite easy to use from within GNU Emacs. For example, recoding the whole buffer from the IBM-PC charset to current charset (Latin-1 on Unix) is easily done with:

 
C-x h C-u M-| recode ibmpc RET

`C-x h' selects the whole buffer, and `C-u M-|' filters and replaces the current region through the given shell command. Here is another example, binding the keys `C-c T' to the recoding of the current region from Easy French to Latin-1 (on Unix) and the key `C-u C-c T' from Latin-1 (on Unix) to Easy French:

 
(global-set-key "\C-cT" 'recode-texte)

(defun recode-texte (flag)
  (interactive "P")
  (shell-command-on-region
   (region-beginning) (region-end)
   (concat "recode " (if flag "..txte" "txte")) t)
  (exchange-point-and-mark))


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)