comparison lisp/generic.el @ 58473:9aacf8e5ae58

(generic-mode-set-comments): Accept an empty comment-end.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 24 Nov 2004 15:20:38 +0000
parents 5bd3a1e1dfe5
children 275bfc016770
comparison
equal deleted inserted replaced
58472:5cd5cdafa9c5 58473:9aacf8e5ae58
287 (make-local-variable 'comment-start-skip) 287 (make-local-variable 'comment-start-skip)
288 (make-local-variable 'comment-end) 288 (make-local-variable 'comment-end)
289 289
290 ;; Go through all the comments 290 ;; Go through all the comments
291 (dolist (start comment-list) 291 (dolist (start comment-list)
292 (let ((end ?\n) (comstyle "")) 292 (let ((end nil) (comstyle ""))
293 ;; Normalize 293 ;; Normalize
294 (when (consp start) 294 (when (consp start)
295 (setq end (or (cdr start) end)) 295 (setq end (or (cdr start) end))
296 (setq start (car start))) 296 (setq start (car start)))
297 (when (char-valid-p start) (setq start (char-to-string start))) 297 (when (char-valid-p start) (setq start (char-to-string start)))
298 (when (char-valid-p end) (setq end (char-to-string end))) 298 (cond
299 ((char-valid-p end) (setq end (char-to-string end)))
300 ((zerop (length end)) (setq end "\n")))
299 301
300 ;; Setup the vars for `comment-region' 302 ;; Setup the vars for `comment-region'
301 (if comment-start 303 (if comment-start
302 ;; We have already setup a comment-style, so use style b 304 ;; We have already setup a comment-style, so use style b
303 (progn 305 (progn
412 1 414 1
413 face)) 415 face))
414 416
415 (provide 'generic) 417 (provide 'generic)
416 418
417 ;;; arch-tag: 239c1fc4-1303-48d9-9ac0-657d655669ea 419 ;; arch-tag: 239c1fc4-1303-48d9-9ac0-657d655669ea
418 ;;; generic.el ends here 420 ;;; generic.el ends here