(defcustom sgml-basic-offset 2
"Specifies the basic indentation level for `sgml-indent-line'."
- :type 'integer
- :group 'sgml)
+ :type 'integer)
(defcustom sgml-attribute-offset 0
"Specifies a delta for attribute indentation in `sgml-indent-line'.
</element>"
:version "25.1"
:type 'integer
- :safe 'integerp
- :group 'sgml)
+ :safe 'integerp)
(defcustom sgml-xml-mode nil
"When non-nil, tag insertion functions will be XML-compliant.
It is set to be buffer-local when the file has
a DOCTYPE or an XML declaration."
:type 'boolean
- :version "22.1"
- :group 'sgml)
+ :version "22.1")
(defvaralias 'sgml-transformation 'sgml-transformation-function)
(and (derived-mode-p 'sgml-mode)
(not sgml-xml-mode)
(setq skeleton-transformation-function val))))
- (buffer-list)))
- :group 'sgml)
+ (buffer-list))))
(put 'sgml-transformation-function 'variable-interactive
"aTransformation function: ")
(defcustom sgml-mode-hook nil
"Hook run by command `sgml-mode'.
`text-mode-hook' is run first."
- :group 'sgml
:type 'hook)
;; As long as Emacs's syntax can't be complemented with predicates to context
(defcustom sgml-name-8bit-mode nil
"When non-nil, insert non-ASCII characters as named entities."
- :type 'boolean
- :group 'sgml)
+ :type 'boolean)
(defvar sgml-char-names
[nil nil nil nil nil nil nil nil
The file name of current buffer file name will be appended to this,
separated by a space."
:type 'string
- :version "21.1"
- :group 'sgml)
+ :version "21.1")
(defvar sgml-saved-validate-command nil
"The command last used to validate in this buffer.")
;; so use a small distance here.
(defcustom sgml-slash-distance 1000
"If non-nil, is the maximum distance to search for matching `/'."
- :type '(choice (const nil) integer)
- :group 'sgml)
+ :type '(choice (const nil) integer))
(defconst sgml-namespace-re "[_[:alpha:]][-_.[:alnum:]]*")
(defconst sgml-name-re "[_:[:alpha:]][-_.:[:alnum:]]*")
(defface sgml-namespace
'((t (:inherit font-lock-builtin-face)))
- "`sgml-mode' face used to highlight the namespace part of identifiers."
- :group 'sgml)
+ "`sgml-mode' face used to highlight the namespace part of identifiers.")
(defvar sgml-namespace-face 'sgml-namespace)
;; internal
("--[ \t\n]*\\(>\\)" (1 "> b"))
("\\(<\\)[?!]" (1 (prog1 "|>"
(sgml-syntax-propertize-inside end))))
- ;; Double quotes outside of tags should not introduce strings.
- ;; Be careful to call `syntax-ppss' on a position before the one we're
- ;; going to change, so as not to need to flush the data we just computed.
- ("\"" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0))))
- (goto-char (match-end 0)))
- (string-to-syntax ".")))))))
+ ;; Double quotes outside of tags should not introduce strings which end up
+ ;; hiding tags. We used to test every double quote and mark it as "."
+ ;; if it's outside of tags, but there are too many double quotes and
+ ;; the resulting number of calls to syntax-ppss made it too slow
+ ;; (bug#33887), so we're now careful to leave alone any pair
+ ;; of quotes that doesn't hold a < or > char, which is the vast majority.
+ ("\\(\"\\)[^\"<>]*[<>\"]"
+ (1 (unless (eq ?\" (char-before))
+ ;; Be careful to call `syntax-ppss' on a position before the one
+ ;; we're going to change, so as not to need to flush the data we
+ ;; just computed.
+ (if (prog1 (zerop (car (syntax-ppss (match-beginning 0))))
+ (goto-char (1- (match-end 0))))
+ (string-to-syntax ".")))))
+ )))
(defun sgml-syntax-propertize (start end)
"Syntactic keywords for `sgml-mode'."
ATTRIBUTERULE is a list of optionally t (no value when no input) followed by
an optional alist of possible values."
:type '(repeat (cons (string :tag "Tag Name")
- (repeat :tag "Tag Rule" sexp)))
- :group 'sgml)
+ (repeat :tag "Tag Rule" sexp))))
(put 'sgml-tag-alist 'risky-local-variable t)
(defcustom sgml-tag-help
("!entity" . "Entity (macro) declaration"))
"Alist of tag name and short description."
:type '(repeat (cons (string :tag "Tag Name")
- (string :tag "Description")))
- :group 'sgml)
+ (string :tag "Description"))))
(defvar sgml-empty-tags nil
"List of tags whose !ELEMENT definition says EMPTY.")
nil t)
(string-match "X\\(HT\\)?ML" (match-string 3))))))
-(defvar v2) ; free for skeleton
+(with-no-warnings (defvar v2)) ; free for skeleton
(defun sgml-comment-indent-new-line (&optional soft)
(let ((comment-start "-- ")
(defcustom html-mode-hook nil
"Hook run by command `html-mode'.
`text-mode-hook' and `sgml-mode-hook' are run first."
- :group 'sgml
:type 'hook
:options '(html-autoview-mode))
`html-mode'. If enabled, saving the file automatically runs
`browse-url-of-buffer' to view it."
nil nil nil
- :group 'sgml
(if html-autoview-mode
- (add-hook 'after-save-hook 'browse-url-of-buffer nil t)
- (remove-hook 'after-save-hook 'browse-url-of-buffer t)))
+ (add-hook 'after-save-hook #'browse-url-of-buffer nil t)
+ (remove-hook 'after-save-hook #'browse-url-of-buffer t)))
\f
(define-skeleton html-href-anchor