comparison lisp/textmodes/sgml-mode.el @ 20922:3ae81bc17b19

(sgml-mode-common): Downcase key for assoc so upper-case markup works. (sgml-attributes, sgml-tag-help): Likewise.
author Dave Love <fx@gnu.org>
date Tue, 17 Feb 1998 20:08:22 +0000
parents dad8223e709d
children 5dc3fe7cd300
comparison
equal deleted inserted replaced
20921:ccde9a52e7c1 20922:3ae81bc17b19
1 ;;; sgml-mode.el --- SGML- and HTML-editing modes 1 ;;; sgml-mode.el --- SGML- and HTML-editing modes
2 2
3 ;; Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc. 3 ;; Copyright (C) 1992, 1995, 1996, 1998 Free Software Foundation, Inc.
4 4
5 ;; Author: James Clark <jjc@jclark.com> 5 ;; Author: James Clark <jjc@jclark.com>
6 ;; Adapted-By: ESR; Daniel.Pfeiffer@Informatik.START.dbp.de 6 ;; Adapted-By: ESR; Daniel.Pfeiffer@Informatik.START.dbp.de
7 ;; F.Potorti@cnuce.cnr.it 7 ;; F.Potorti@cnuce.cnr.it
8 ;; Keywords: wp, hypermedia, comm, languages 8 ;; Keywords: wp, hypermedia, comm, languages
301 (not (assq 1 sgml-tag-face-alist)) 301 (not (assq 1 sgml-tag-face-alist))
302 (nconc sgml-tag-face-alist 302 (nconc sgml-tag-face-alist
303 `((1 (,(concat "<\\(" 303 `((1 (,(concat "<\\("
304 (mapconcat 'car sgml-tag-face-alist "\\|") 304 (mapconcat 'car sgml-tag-face-alist "\\|")
305 "\\)\\([ \t].+\\)?>\\(.+\\)</\\1>") 305 "\\)\\([ \t].+\\)?>\\(.+\\)</\\1>")
306 3 (cdr (assoc (match-string 1) ',sgml-tag-face-alist))))))) 306 3 (cdr (assoc (downcase (match-string 1))
307 ',sgml-tag-face-alist)))))))
307 (setq indent-line-function 'indent-relative-maybe 308 (setq indent-line-function 'indent-relative-maybe
308 ;; A start or end tag by itself on a line separates a paragraph. 309 ;; A start or end tag by itself on a line separates a paragraph.
309 ;; This is desirable because SGML discards a newline that appears 310 ;; This is desirable because SGML discards a newline that appears
310 ;; immediately after a start tag or immediately before an end tag. 311 ;; immediately after a start tag or immediately before an end tag.
311 paragraph-separate "[ \t]*$\\|\ 312 paragraph-separate "[ \t]*$\\|\
537 (skeleton-read '(completing-read 538 (skeleton-read '(completing-read
538 "Attribute: " 539 "Attribute: "
539 alist))))) 540 alist)))))
540 (if (string= "" attribute) 541 (if (string= "" attribute)
541 (setq i 0) 542 (setq i 0)
542 (sgml-value (assoc attribute alist)) 543 (sgml-value (assoc (downcase attribute) alist))
543 (setq i (1- i)))) 544 (setq i (1- i))))
544 (if (eq (preceding-char) ? ) 545 (if (eq (preceding-char) ? )
545 (delete-backward-char 1))) 546 (delete-backward-char 1)))
546 car))) 547 car)))
547 548
572 (setq tag (sgml-beginning-of-tag)))) 573 (setq tag (sgml-beginning-of-tag))))
573 (or (stringp tag) 574 (or (stringp tag)
574 (error "No tag selected")) 575 (error "No tag selected"))
575 (setq tag (downcase tag)) 576 (setq tag (downcase tag))
576 (message "%s" 577 (message "%s"
577 (or (cdr (assoc tag sgml-tag-help)) 578 (or (cdr (assoc (downcase tag) sgml-tag-help))
578 (and (eq (aref tag 0) ?/) 579 (and (eq (aref tag 0) ?/)
579 (cdr (assoc (substring tag 1) sgml-tag-help))) 580 (cdr (assoc (downcase (substring tag 1)) sgml-tag-help)))
580 "No description available"))) 581 "No description available")))
581 582
582 583
583 (defun sgml-maybe-end-tag () 584 (defun sgml-maybe-end-tag ()
584 "Name self unless in position to end a tag." 585 "Name self unless in position to end a tag."