comparison lisp/subr.el @ 21173:e917eb0d4e01

(save-match-data): store-match-data => set-match-data. (store-match-data): This is now the alias, set-match-data is now the primitive. (momentary-string-display): Pass t as UPDATE to window-end.
author Richard M. Stallman <rms@gnu.org>
date Sat, 14 Mar 1998 08:15:36 +0000
parents 7726f8d9eff0
children 3e8b7782f4f5
comparison
equal deleted inserted replaced
21172:f9887487a4a1 21173:e917eb0d4e01
541 (defalias 'indent-to-column 'indent-to) 541 (defalias 'indent-to-column 'indent-to)
542 (defalias 'backward-delete-char 'delete-backward-char) 542 (defalias 'backward-delete-char 'delete-backward-char)
543 (defalias 'search-forward-regexp (symbol-function 're-search-forward)) 543 (defalias 'search-forward-regexp (symbol-function 're-search-forward))
544 (defalias 'search-backward-regexp (symbol-function 're-search-backward)) 544 (defalias 'search-backward-regexp (symbol-function 're-search-backward))
545 (defalias 'int-to-string 'number-to-string) 545 (defalias 'int-to-string 'number-to-string)
546 (defalias 'set-match-data 'store-match-data) 546 (defalias 'store-match-data 'set-match-data)
547 547
548 ;;; Should this be an obsolete name? If you decide it should, you get 548 ;;; Should this be an obsolete name? If you decide it should, you get
549 ;;; to go through all the sources and change them. 549 ;;; to go through all the sources and change them.
550 (defalias 'string-to-int 'string-to-number) 550 (defalias 'string-to-int 'string-to-number)
551 551
823 ;; defeat file locking... don't try this at home, kids! 823 ;; defeat file locking... don't try this at home, kids!
824 (setq buffer-file-name nil) 824 (setq buffer-file-name nil)
825 (insert-before-markers string) 825 (insert-before-markers string)
826 (setq insert-end (point)) 826 (setq insert-end (point))
827 ;; If the message end is off screen, recenter now. 827 ;; If the message end is off screen, recenter now.
828 (if (< (window-end) insert-end) 828 (if (< (window-end nil t) insert-end)
829 (recenter (/ (window-height) 2))) 829 (recenter (/ (window-height) 2)))
830 ;; If that pushed message start off the screen, 830 ;; If that pushed message start off the screen,
831 ;; scroll to start it at the top of the screen. 831 ;; scroll to start it at the top of the screen.
832 (move-to-window-line 0) 832 (move-to-window-line 0)
833 (if (> (point) pos) 833 (if (> (point) pos)
991 (defmacro save-match-data (&rest body) 991 (defmacro save-match-data (&rest body)
992 "Execute the BODY forms, restoring the global value of the match data." 992 "Execute the BODY forms, restoring the global value of the match data."
993 `(let ((save-match-data-internal (match-data))) 993 `(let ((save-match-data-internal (match-data)))
994 (unwind-protect 994 (unwind-protect
995 (progn ,@body) 995 (progn ,@body)
996 (store-match-data save-match-data-internal)))) 996 (set-match-data save-match-data-internal))))
997 997
998 (defun match-string (num &optional string) 998 (defun match-string (num &optional string)
999 "Return string of text matched by last search. 999 "Return string of text matched by last search.
1000 NUM specifies which parenthesized expression in the last regexp. 1000 NUM specifies which parenthesized expression in the last regexp.
1001 Value is nil if NUMth pair didn't match, or there were less than NUM pairs. 1001 Value is nil if NUMth pair didn't match, or there were less than NUM pairs.