From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Baloff Newsgroups: gmane.emacs.help Subject: function def && eval exp. Date: 31 Jul 2005 15:29:26 +1000 Organization: iPrimus Customer - reports relating to abuse should be sent to abuse@iprimus.com.au Message-ID: <87y87nh7bd.fsf@wash.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1122786764 30229 80.91.229.2 (31 Jul 2005 05:12:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 31 Jul 2005 05:12:44 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 31 07:12:43 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dz67t-0004sv-0T for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Jul 2005 07:12:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dz6AT-0003IR-2z for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Jul 2005 01:15:21 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newscon02.news.prodigy.com!prodigy.net!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!newsfeed-west.nntpserver.com!news1.optus.net.au!optus!newsfeed.pacific.net.au!token.pipenetworks.com!218.100.2.58.MISMATCH!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 X-Original-NNTP-Posting-Host: 203.134.35.146 X-Original-NNTP-Posting-Host: 127.0.0.1 Original-Lines: 25 Original-NNTP-Posting-Host: 203.134.67.67 Original-X-Trace: 1122786584 un-2park-reader-02.sydney.pipenetworks.com.au 30727 203.134.67.67:2881 Original-X-Complaints-To: Abuse, including message IDs to abuse@pipenetworks.com Original-Xref: shelby.stanford.edu gnu.emacs.help:132779 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:28303 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:28303 Hello using the shell in emacs $ls -l -rw-r--r-- 1 sam sam 319 Jul 31 13:00 main.cpp to remove those strange character around the filename I M-: (ansi-color-apply-on-region (point-min) (point-max)) I have currently in my .emacs this function which removes all the ^M from text which get infested with it. (global-set-key [f5] 'cut-ctrlM) ; cut all ^M. (defun cut-ctrlM () "Cut all visible ^M." (interactive) (beginning-of-buffer) (while (search-forward "\r" nil t) (replace-match "" nil t)) ) how can I do both, eval the expression and run the function by the [f5]key. thanks