Mercurial > emacs
comparison lisp/forms.el @ 24077:b5abeb8ab500
(forms--show-record): Convert integers to string
expicitly since concat will no longer accept integers.
(forms-print): Use local `total-nb-records' since
`forms--total-records' will be inaccessible after buffer switching.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 15 Jan 1999 16:19:53 +0000 |
parents | 55b2ea28932a |
children | 39ca035fb9f5 |
comparison
equal
deleted
inserted
replaced
24076:6236e60302e2 | 24077:b5abeb8ab500 |
---|---|
294 ;;; Global variables and constants: | 294 ;;; Global variables and constants: |
295 | 295 |
296 (provide 'forms) ;;; official | 296 (provide 'forms) ;;; official |
297 (provide 'forms-mode) ;;; for compatibility | 297 (provide 'forms-mode) ;;; for compatibility |
298 | 298 |
299 (defconst forms-version (substring "$Revision: 2.35 $" 11 -2) | 299 (defconst forms-version (substring "$Revision: 2.36 $" 11 -2) |
300 "The version number of forms-mode (as string). The complete RCS id is: | 300 "The version number of forms-mode (as string). The complete RCS id is: |
301 | 301 |
302 $Id: forms.el,v 2.35 1998/07/17 14:01:15 stephen Exp kwzh $") | 302 $Id: forms.el,v 2.36 1998/10/06 23:19:46 kwzh Exp rms $") |
303 | 303 |
304 (defcustom forms-mode-hooks nil | 304 (defcustom forms-mode-hooks nil |
305 "Hook functions to be run upon entering Forms mode." | 305 "Hook functions to be run upon entering Forms mode." |
306 :group 'forms | 306 :group 'forms |
307 :type 'function) | 307 :type 'function) |
1543 ;; Prepare. | 1543 ;; Prepare. |
1544 (goto-char (point-min)) | 1544 (goto-char (point-min)) |
1545 (set-buffer-modified-p nil) | 1545 (set-buffer-modified-p nil) |
1546 (setq buffer-read-only forms-read-only) | 1546 (setq buffer-read-only forms-read-only) |
1547 (setq mode-line-process | 1547 (setq mode-line-process |
1548 (concat " " forms--current-record "/" forms--total-records))) | 1548 (concat " " (int-to-string forms--current-record) |
1549 "/" (int-to-string forms--total-records)))) | |
1549 | 1550 |
1550 (defun forms--parse-form () | 1551 (defun forms--parse-form () |
1551 "Parse contents of form into list of strings." | 1552 "Parse contents of form into list of strings." |
1552 ;; The contents of the form are parsed, and a new list of strings | 1553 ;; The contents of the form are parsed, and a new list of strings |
1553 ;; is constructed. | 1554 ;; is constructed. |
1999 (defun forms-print () | 2000 (defun forms-print () |
2000 "Send the records to the printer with 'print-buffer', one record per page." | 2001 "Send the records to the printer with 'print-buffer', one record per page." |
2001 (interactive) | 2002 (interactive) |
2002 (let ((inhibit-read-only t) | 2003 (let ((inhibit-read-only t) |
2003 (save-record forms--current-record) | 2004 (save-record forms--current-record) |
2005 (total-nb-records forms--total-records) | |
2004 (nb-record 1) | 2006 (nb-record 1) |
2005 (record nil)) | 2007 (record nil)) |
2006 (while (<= nb-record forms--total-records) | 2008 (while (<= nb-record forms--total-records) |
2007 (forms-jump-record nb-record) | 2009 (forms-jump-record nb-record) |
2008 (setq record (buffer-string)) | 2010 (setq record (buffer-string)) |
2009 (save-excursion | 2011 (save-excursion |
2010 (set-buffer (get-buffer-create "*forms-print*")) | 2012 (set-buffer (get-buffer-create "*forms-print*")) |
2011 (goto-char (buffer-end 1)) | 2013 (goto-char (buffer-end 1)) |
2012 (insert record) | 2014 (insert record) |
2013 (setq buffer-read-only nil) | 2015 (setq buffer-read-only nil) |
2014 (if (< nb-record forms--total-records) | 2016 (if (< nb-record total-nb-records) |
2015 (insert "\n\n"))) | 2017 (insert "\n\n"))) |
2016 (setq nb-record (1+ nb-record))) | 2018 (setq nb-record (1+ nb-record))) |
2017 (save-excursion | 2019 (save-excursion |
2018 (set-buffer "*forms-print*") | 2020 (set-buffer "*forms-print*") |
2019 (print-buffer) | 2021 (print-buffer) |