From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Reiner Steib <4uce.02.r.steib@gmx.net> Newsgroups: gmane.emacs.help Subject: Re: Regular expression - replace lower case to upper case Date: Fri, 01 Nov 2002 20:34:29 +0100 Organization: private Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: Reply-To: reiner.steib@gmx.de NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1036185392 12989 80.91.224.249 (1 Nov 2002 21:16:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 1 Nov 2002 21:16:32 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 187j9b-0003NM-00 for ; Fri, 01 Nov 2002 22:16:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 187j9E-0006b4-00; Fri, 01 Nov 2002 16:16:08 -0500 Original-Newsgroups: gnu.emacs.help X-Face: 3Phac&+dw=IZHjhua]bp}LH<*p{qzj8u+ (message "upcased %d html tags" counter)))) Nice. I changed your function slighly: include closing tags (), always use current buffer. Because I prefer lowercase tags, you need do give a prefix argument, if you want uppercase tags: M-x rs-html-downcase-or-upcase-tags RET --> downcase buffer C-u M-x rs-html-downcase-or-upcase-tags RET --> upcase buffer (defun rs-html-downcase-or-upcase-tags (&optional upcase) "Downcase html-tags in curent buffer. If given a prefix, upcase tags." (interactive "P") (save-excursion (goto-char (point-min)) (let ((counter 0)) (while (re-search-forward "" nil t) (funcall (if upcase 'upcase-region 'downcase-region) (match-beginning 1) (match-end 1)) (setq counter (1+ counter))) (message "%scased %d html-tags" (if upcase "up" "down") counter)))) Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/