comparison lisp/textmodes/fill.el @ 44507:d62ce2e3b473

(fill-context-prefix): Fix up last change.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 12 Apr 2002 00:01:53 +0000
parents 483f757c5f72
children 235f5029534d
comparison
equal deleted inserted replaced
44506:4b6af4218eb9 44507:d62ce2e3b473
242 242
243 (if ;; If the non-whitespace chars match the first line, 243 (if ;; If the non-whitespace chars match the first line,
244 ;; just use it (this subsumes the 2 checks used previously). 244 ;; just use it (this subsumes the 2 checks used previously).
245 ;; Used when first line is `/* ...' and second-line is 245 ;; Used when first line is `/* ...' and second-line is
246 ;; ` * ...'. 246 ;; ` * ...'.
247 (string-match 247 (let ((flp (replace-regexp-in-string
248 (concat "\\`" 248 "[ \t]+" "" first-line-prefix)))
249 (mapconcat 249 (if (equal flp "")
250 (lambda (c) (regexp-quote (string c))) 250 (string-match "\\`[ \t]*\\'" second-line-prefix)
251 (replace-regexp-in-string "[ \t]+" "" first-line-prefix) 251 (string-match
252 "?") 252 (concat "\\`"
253 "?\\'") 253 (mapconcat
254 (replace-regexp-in-string "[ \t]+" "" second-line-prefix)) 254 (lambda (c) (regexp-quote (string c))) flp "?")
255 "?\\'")
256 (replace-regexp-in-string "[ \t]+" "" second-line-prefix))))
255 second-line-prefix 257 second-line-prefix
256 258
257 ;; Use the longest common substring of both prefixes, 259 ;; Use the longest common substring of both prefixes,
258 ;; if there is one. 260 ;; if there is one.
259 (fill-common-string-prefix first-line-prefix 261 (fill-common-string-prefix first-line-prefix