home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.univie.ac.at!blekul11!cc11.kuleuven.ac.be!stud01
- Nntp-Posting-Host: 134.58.8.17
- Newsgroups: comp.emacs
- From: stud01@cc4.kuleuven.ac.be (Barbe Albert)
- Distribution: world
- Date: Tuesday, 18 Aug 1992 11:37:36 +02
- Message-ID: <1992Aug18.112949@cc4.kuleuven.ac.be>
- Organization: K.U.Leuven - Academic Computing Center
- Subject: all.el missing function (Oops)
- Lines: 53
-
- I forgot to include the function unfold-all.
- Here is the complete version (hope it works now)
- ----------------Cut Here-------------------------
- ;;
- ;; all.el v1.01 Bert Barbe (stud01@cc4.kuleuven.ac.be)
- ;; use : type M-x all
- ;; then type the pattern ( or just enter to show all lines again)
- ;;
- ;; This function uses selective-display and hides lines by changing
- ;; the end of the line in control-M
- ;;
- ;; comments are allways welcome !
- ╚
- ;; all
- ;;
- (defun all ( patern )
- (interactive "sPattern: ")
- (setq selective-display t)
- (if (string-equal patern "")
- (unfold-all)
- (setq selective-display t)
- (let ((modp (buffer-modified-p)))
- (unwind-protect
- (save-excursion
- (subst-char-in-region (point-min) (point-max)
- ?\n ?\^m t)
- (goto-char 0)
- (or (char-equal ?\^m (char-after 1)) (insert-char ?\^m 1))
- (while (re-search-forward patern (point-max) t)
- (save-excursion
- (if (search-backward "\^m" (point-min) t)
- (progn
- (delete-char 1 )
- (insert-char ?\n 1))
- (message "Something went wrong.Pity.")))
- )
- )
-
- (set-buffer-modified-p modp)))))
- ;; unfold-all
- ;; this function was missing in v1.00
- ;;
- (defun unfold-all ()
- (interactive)
- (let ((modp (buffer-modified-p)))
- (unwind-protect
- (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)
- (set-buffer-modified-p modp))))
- ----------------Cut Here-------------------------
- --
- ------------------------------------------------------------------------
- Barbe Albert stud01@cc4.kuleuven.ac.be (AIX/370)
- FHGAA98@cc1.kuleuven.ac.be (VM/CMS)
-