aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/forms.el
diff options
context:
space:
mode:
authorGerd Moellmann1999-11-13 22:07:05 +0000
committerGerd Moellmann1999-11-13 22:07:05 +0000
commit5658a814fdd6afda5248fdf690cde4f751fe92c3 (patch)
tree03103951c583b0ccc280dc86dee999376daca66c /lisp/forms.el
parenta3f8903ea95bf32eb76e6246defdc9157992b7ff (diff)
downloademacs-5658a814fdd6afda5248fdf690cde4f751fe92c3.tar.gz
emacs-5658a814fdd6afda5248fdf690cde4f751fe92c3.zip
Use new backquote syntax.
(forms--make-format-elt-using-text-properties): Treat `intangible' differently.
Diffstat (limited to 'lisp/forms.el')
-rw-r--r--lisp/forms.el176
1 files changed, 88 insertions, 88 deletions
diff --git a/lisp/forms.el b/lisp/forms.el
index a76312d2f9d..226474c5c0c 100644
--- a/lisp/forms.el
+++ b/lisp/forms.el
@@ -301,10 +301,10 @@
301(provide 'forms) ;;; official 301(provide 'forms) ;;; official
302(provide 'forms-mode) ;;; for compatibility 302(provide 'forms-mode) ;;; for compatibility
303 303
304(defconst forms-version (substring "$Revision: 2.38 $" 11 -2) 304(defconst forms-version (substring "$Revision: 2.39 $" 11 -2)
305 "The version number of forms-mode (as string). The complete RCS id is: 305 "The version number of forms-mode (as string). The complete RCS id is:
306 306
307 $Id: forms.el,v 2.38 1999/05/01 01:11:12 kwzh Exp eliz $") 307 $Id: forms.el,v 2.39 1999/05/31 08:34:19 eliz Exp $")
308 308
309(defcustom forms-mode-hooks nil 309(defcustom forms-mode-hooks nil
310 "Hook functions to be run upon entering Forms mode." 310 "Hook functions to be run upon entering Forms mode."
@@ -923,23 +923,23 @@ Commands: Equivalent keys in read-only mode:
923 (setq 923 (setq
924 forms--format 924 forms--format
925 (if forms-use-text-properties 925 (if forms-use-text-properties
926 (` (lambda (arg) 926 `(lambda (arg)
927 (let ((inhibit-read-only t)) 927 (let ((inhibit-read-only t))
928 (,@ (apply 'append 928 ,@(apply 'append
929 (mapcar 'forms--make-format-elt-using-text-properties 929 (mapcar 'forms--make-format-elt-using-text-properties
930 forms-format-list))) 930 forms-format-list))
931 ;; Prevent insertion before the first text. 931 ;; Prevent insertion before the first text.
932 (,@ (if (numberp (car forms-format-list)) 932 ,@(if (numberp (car forms-format-list))
933 nil 933 nil
934 '((add-text-properties (point-min) (1+ (point-min)) 934 '((add-text-properties (point-min) (1+ (point-min))
935 '(front-sticky (read-only intangible)))))) 935 '(front-sticky (read-only intangible)))))
936 ;; Prevent insertion after the last text. 936 ;; Prevent insertion after the last text.
937 (remove-text-properties (1- (point)) (point) 937 (remove-text-properties (1- (point)) (point)
938 '(rear-nonsticky))) 938 '(rear-nonsticky)))
939 (setq forms--iif-start nil))) 939 (setq forms--iif-start nil))
940 (` (lambda (arg) 940 `(lambda (arg)
941 (,@ (apply 'append 941 ,@(apply 'append
942 (mapcar 'forms--make-format-elt forms-format-list))))))) 942 (mapcar 'forms--make-format-elt forms-format-list)))))
943 943
944 ;; We have tallied the number of markers and dynamic texts, 944 ;; We have tallied the number of markers and dynamic texts,
945 ;; so we can allocate the arrays now. 945 ;; so we can allocate the arrays now.
@@ -1009,46 +1009,46 @@ Commands: Equivalent keys in read-only mode:
1009 (cond 1009 (cond
1010 ((stringp el) 1010 ((stringp el)
1011 1011
1012 (` ((set-text-properties 1012 `((set-text-properties
1013 (point) ; start at point 1013 (point) ; start at point
1014 (progn ; until after insertion 1014 (progn ; until after insertion
1015 (insert (, el)) 1015 (insert ,el)
1016 (point)) 1016 (point))
1017 (list 'face forms--ro-face ; read-only appearance 1017 (list 'face forms--ro-face ; read-only appearance
1018 'read-only (,@ (list (1+ forms--marker))) 1018 'read-only ,@(list (1+ forms--marker))
1019 'intangible t 1019 'intangible ,@(list (1+ forms--marker))
1020 'insert-in-front-hooks '(forms--iif-hook) 1020 'insert-in-front-hooks '(forms--iif-hook)
1021 'rear-nonsticky '(face read-only insert-in-front-hooks 1021 'rear-nonsticky '(face read-only insert-in-front-hooks
1022 intangible)))))) 1022 intangible)))))
1023 1023
1024 ((numberp el) 1024 ((numberp el)
1025 (` ((let ((here (point))) 1025 `((let ((here (point)))
1026 (aset forms--markers 1026 (aset forms--markers
1027 (, (prog1 forms--marker 1027 ,(prog1 forms--marker
1028 (setq forms--marker (1+ forms--marker)))) 1028 (setq forms--marker (1+ forms--marker)))
1029 (point-marker)) 1029 (point-marker))
1030 (insert (elt arg (, (1- el)))) 1030 (insert (elt arg ,(1- el)))
1031 (or (= (point) here) 1031 (or (= (point) here)
1032 (set-text-properties 1032 (set-text-properties
1033 here (point) 1033 here (point)
1034 (list 'face forms--rw-face 1034 (list 'face forms--rw-face
1035 'front-sticky '(face)))))))) 1035 'front-sticky '(face)))))))
1036 1036
1037 ((listp el) 1037 ((listp el)
1038 (` ((set-text-properties 1038 `((set-text-properties
1039 (point) 1039 (point)
1040 (progn 1040 (progn
1041 (insert (aset forms--dyntexts 1041 (insert (aset forms--dyntexts
1042 (, (prog1 forms--dyntext 1042 ,(prog1 forms--dyntext
1043 (setq forms--dyntext (1+ forms--dyntext)))) 1043 (setq forms--dyntext (1+ forms--dyntext)))
1044 (, el))) 1044 ,el))
1045 (point)) 1045 (point))
1046 (list 'face forms--ro-face 1046 (list 'face forms--ro-face
1047 'read-only (,@ (list (1+ forms--marker))) 1047 'read-only ,@(list (1+ forms--marker))
1048 'intangible t 1048 'intangible ,@(list (1+ forms--marker))
1049 'insert-in-front-hooks '(forms--iif-hook) 1049 'insert-in-front-hooks '(forms--iif-hook)
1050 'rear-nonsticky '(read-only face insert-in-front-hooks 1050 'rear-nonsticky '(read-only face insert-in-front-hooks
1051 intangible)))))) 1051 intangible)))))
1052 1052
1053 ;; end of cond 1053 ;; end of cond
1054 )) 1054 ))
@@ -1073,15 +1073,15 @@ Commands: Equivalent keys in read-only mode:
1073 1073
1074 (cond 1074 (cond
1075 ((stringp el) 1075 ((stringp el)
1076 (` ((insert (, el))))) 1076 `((insert ,el)))
1077 ((numberp el) 1077 ((numberp el)
1078 (prog1 1078 (prog1
1079 (` ((aset forms--markers (, forms--marker) (point-marker)) 1079 `((aset forms--markers ,forms--marker (point-marker))
1080 (insert (elt arg (, (1- el)))))) 1080 (insert (elt arg ,(1- el))))
1081 (setq forms--marker (1+ forms--marker)))) 1081 (setq forms--marker (1+ forms--marker))))
1082 ((listp el) 1082 ((listp el)
1083 (prog1 1083 (prog1
1084 (` ((insert (aset forms--dyntexts (, forms--dyntext) (, el))))) 1084 `((insert (aset forms--dyntexts ,forms--dyntext ,el)))
1085 (setq forms--dyntext (1+ forms--dyntext)))))) 1085 (setq forms--dyntext (1+ forms--dyntext))))))
1086 1086
1087(defvar forms--field) 1087(defvar forms--field)
@@ -1106,13 +1106,13 @@ Commands: Equivalent keys in read-only mode:
1106 1106
1107 ;; Note: we add a nil element to the list passed to `mapcar', 1107 ;; Note: we add a nil element to the list passed to `mapcar',
1108 ;; see `forms--make-parser-elt' for details. 1108 ;; see `forms--make-parser-elt' for details.
1109 (` (lambda nil 1109 `(lambda nil
1110 (let (here) 1110 (let (here)
1111 (goto-char (point-min)) 1111 (goto-char (point-min))
1112 (,@ (apply 'append 1112 ,@(apply 'append
1113 (mapcar 1113 (mapcar
1114 'forms--make-parser-elt 1114 'forms--make-parser-elt
1115 (append forms-format-list (list nil))))))))))) 1115 (append forms-format-list (list nil)))))))))
1116 1116
1117 (forms--debug 'forms--parser)) 1117 (forms--debug 'forms--parser))
1118 1118
@@ -1171,15 +1171,15 @@ Commands: Equivalent keys in read-only mode:
1171 ((stringp el) 1171 ((stringp el)
1172 (prog1 1172 (prog1
1173 (if forms--field 1173 (if forms--field
1174 (` ((setq here (point)) 1174 `((setq here (point))
1175 (if (not (search-forward (, el) nil t nil)) 1175 (if (not (search-forward ,el nil t nil))
1176 (error "Parse error: cannot find `%s'" (, el))) 1176 (error "Parse error: cannot find `%s'" ,el))
1177 (aset forms--recordv (, (1- forms--field)) 1177 (aset forms--recordv ,(1- forms--field)
1178 (buffer-substring-no-properties here 1178 (buffer-substring-no-properties here
1179 (- (point) (, (length el))))))) 1179 (- (point) ,(length el)))))
1180 (` ((if (not (looking-at (, (regexp-quote el)))) 1180 `((if (not (looking-at ,(regexp-quote el)))
1181 (error "Parse error: not looking at `%s'" (, el))) 1181 (error "Parse error: not looking at `%s'" ,el))
1182 (forward-char (, (length el)))))) 1182 (forward-char ,(length el))))
1183 (setq forms--seen-text t) 1183 (setq forms--seen-text t)
1184 (setq forms--field nil))) 1184 (setq forms--field nil)))
1185 ((numberp el) 1185 ((numberp el)
@@ -1190,22 +1190,22 @@ Commands: Equivalent keys in read-only mode:
1190 nil)) 1190 nil))
1191 ((null el) 1191 ((null el)
1192 (if forms--field 1192 (if forms--field
1193 (` ((aset forms--recordv (, (1- forms--field)) 1193 `((aset forms--recordv ,(1- forms--field)
1194 (buffer-substring-no-properties (point) (point-max))))))) 1194 (buffer-substring-no-properties (point) (point-max))))))
1195 ((listp el) 1195 ((listp el)
1196 (prog1 1196 (prog1
1197 (if forms--field 1197 (if forms--field
1198 (` ((let ((here (point)) 1198 `((let ((here (point))
1199 (forms--dyntext (aref forms--dyntexts (, forms--dyntext)))) 1199 (forms--dyntext (aref forms--dyntexts ,forms--dyntext)))
1200 (if (not (search-forward forms--dyntext nil t nil)) 1200 (if (not (search-forward forms--dyntext nil t nil))
1201 (error "Parse error: cannot find `%s'" forms--dyntext)) 1201 (error "Parse error: cannot find `%s'" forms--dyntext))
1202 (aset forms--recordv (, (1- forms--field)) 1202 (aset forms--recordv ,(1- forms--field)
1203 (buffer-substring-no-properties here 1203 (buffer-substring-no-properties here
1204 (- (point) (length forms--dyntext))))))) 1204 (- (point) (length forms--dyntext))))))
1205 (` ((let ((forms--dyntext (aref forms--dyntexts (, forms--dyntext)))) 1205 `((let ((forms--dyntext (aref forms--dyntexts ,forms--dyntext)))
1206 (if (not (looking-at (regexp-quote forms--dyntext))) 1206 (if (not (looking-at (regexp-quote forms--dyntext)))
1207 (error "Parse error: not looking at `%s'" forms--dyntext)) 1207 (error "Parse error: not looking at `%s'" forms--dyntext))
1208 (forward-char (length forms--dyntext)))))) 1208 (forward-char (length forms--dyntext)))))
1209 (setq forms--dyntext (1+ forms--dyntext)) 1209 (setq forms--dyntext (1+ forms--dyntext))
1210 (setq forms--seen-text t) 1210 (setq forms--seen-text t)
1211 (setq forms--field nil))) 1211 (setq forms--field nil)))