Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
;;; sgml-mode.el --- SGML- and HTML-editing modes -*- lexical-binding:t -*-
|
1992-07-17 06:48:03 +00:00
|
|
|
|
|
2022-01-01 02:45:51 -05:00
|
|
|
|
;; Copyright (C) 1992, 1995-1996, 1998, 2001-2022 Free Software
|
2013-01-01 09:11:05 +00:00
|
|
|
|
;; Foundation, Inc.
|
1992-07-22 03:58:44 +00:00
|
|
|
|
|
1997-04-13 05:07:27 +00:00
|
|
|
|
;; Author: James Clark <jjc@jclark.com>
|
2019-05-25 13:43:06 -07:00
|
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
1998-12-14 03:22:44 +00:00
|
|
|
|
;; Adapted-By: ESR, Daniel Pfeiffer <occitan@esperanto.org>,
|
1997-04-16 21:43:01 +00:00
|
|
|
|
;; F.Potorti@cnuce.cnr.it
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
;; Keywords: wp, hypermedia, comm, languages
|
1992-07-17 06:48:03 +00:00
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2008-05-06 04:34:22 +00:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1992-07-17 06:48:03 +00:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 04:34:22 +00:00
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
1992-07-17 06:48:03 +00:00
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 15:52:52 -07:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
1992-07-17 06:48:03 +00:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
;; Configurable major mode for editing document in the SGML standard general
|
|
|
|
|
;; markup language. As an example contains a mode for editing the derived
|
|
|
|
|
;; HTML hypertext markup language.
|
1992-07-17 06:48:03 +00:00
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2016-09-24 13:55:36 +02:00
|
|
|
|
(require 'dom)
|
|
|
|
|
(require 'seq)
|
2021-03-18 05:55:16 +01:00
|
|
|
|
(require 'facemenu)
|
2017-04-18 19:07:28 -04:00
|
|
|
|
(eval-when-compile (require 'subr-x))
|
1999-08-04 19:18:55 +00:00
|
|
|
|
(eval-when-compile
|
|
|
|
|
(require 'skeleton)
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(require 'cl-lib))
|
1998-11-16 17:50:28 +00:00
|
|
|
|
|
1997-04-13 05:07:27 +00:00
|
|
|
|
(defgroup sgml nil
|
2005-07-04 03:37:24 +00:00
|
|
|
|
"SGML editing mode."
|
2005-11-17 07:40:11 +00:00
|
|
|
|
:link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces)
|
1997-04-13 05:07:27 +00:00
|
|
|
|
:group 'languages)
|
|
|
|
|
|
2002-03-29 19:38:22 +00:00
|
|
|
|
(defcustom sgml-basic-offset 2
|
2007-05-10 06:02:15 +00:00
|
|
|
|
"Specifies the basic indentation level for `sgml-indent-line'."
|
2020-09-05 16:54:45 +02:00
|
|
|
|
:type 'integer
|
|
|
|
|
:safe #'integerp)
|
2002-03-29 19:38:22 +00:00
|
|
|
|
|
2015-03-22 08:22:29 -07:00
|
|
|
|
(defcustom sgml-attribute-offset 0
|
|
|
|
|
"Specifies a delta for attribute indentation in `sgml-indent-line'.
|
|
|
|
|
|
|
|
|
|
When 0, attribute indentation looks like this:
|
|
|
|
|
|
|
|
|
|
<element
|
|
|
|
|
attribute=\"value\">
|
|
|
|
|
</element>
|
|
|
|
|
|
|
|
|
|
When 2, attribute indentation looks like this:
|
|
|
|
|
|
|
|
|
|
<element
|
|
|
|
|
attribute=\"value\">
|
|
|
|
|
</element>"
|
|
|
|
|
:version "25.1"
|
|
|
|
|
:type 'integer
|
2019-01-17 18:25:00 -05:00
|
|
|
|
:safe 'integerp)
|
2015-03-22 08:22:29 -07:00
|
|
|
|
|
2013-02-21 21:01:32 -05:00
|
|
|
|
(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
|
2019-01-17 18:25:00 -05:00
|
|
|
|
:version "22.1")
|
2013-02-21 21:01:32 -05:00
|
|
|
|
|
2021-12-20 22:12:25 +01:00
|
|
|
|
(define-obsolete-variable-alias 'sgml-transformation
|
|
|
|
|
'sgml-transformation-function "29.1")
|
2018-04-20 18:34:39 -04:00
|
|
|
|
|
2006-05-21 22:19:59 +00:00
|
|
|
|
(defcustom sgml-transformation-function 'identity
|
2007-05-10 06:02:15 +00:00
|
|
|
|
"Default value for `skeleton-transformation-function' in SGML mode."
|
1997-04-16 21:43:01 +00:00
|
|
|
|
:type 'function
|
2013-02-21 21:01:32 -05:00
|
|
|
|
:initialize 'custom-initialize-default
|
|
|
|
|
:set (lambda (sym val)
|
|
|
|
|
(set-default sym val)
|
|
|
|
|
(mapc (lambda (buff)
|
|
|
|
|
(with-current-buffer buff
|
2013-02-21 21:33:42 -05:00
|
|
|
|
(and (derived-mode-p 'sgml-mode)
|
2013-02-21 21:01:32 -05:00
|
|
|
|
(not sgml-xml-mode)
|
|
|
|
|
(setq skeleton-transformation-function val))))
|
2019-01-17 18:25:00 -05:00
|
|
|
|
(buffer-list))))
|
1997-04-16 21:43:01 +00:00
|
|
|
|
|
2006-05-21 22:19:59 +00:00
|
|
|
|
(put 'sgml-transformation-function 'variable-interactive
|
1997-04-16 21:43:01 +00:00
|
|
|
|
"aTransformation function: ")
|
|
|
|
|
|
1999-08-04 19:18:55 +00:00
|
|
|
|
(defcustom sgml-mode-hook nil
|
|
|
|
|
"Hook run by command `sgml-mode'.
|
|
|
|
|
`text-mode-hook' is run first."
|
|
|
|
|
:type 'hook)
|
|
|
|
|
|
2019-04-21 22:44:50 -04:00
|
|
|
|
;; The official handling of "--" is complicated in SGML, and
|
|
|
|
|
;; historically not well supported by browser HTML parsers.
|
|
|
|
|
;; Recommendations for writing HTML comments is to use <!--...-->
|
|
|
|
|
;; (where ... doesn't contain "--") to avoid the complications
|
|
|
|
|
;; altogether (XML goes even further by requiring this in the spec).
|
|
|
|
|
;; So there is probably no need to handle it "correctly".
|
|
|
|
|
(defvar sgml-specials '(?\" ?\')
|
1997-04-24 19:37:13 +00:00
|
|
|
|
"List of characters that have a special meaning for SGML mode.
|
2002-02-28 16:14:50 +00:00
|
|
|
|
This list is used when first loading the `sgml-mode' library.
|
2019-04-21 22:44:50 -04:00
|
|
|
|
The supported characters are ?\\\", ?\\=', and ?-.
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
2019-04-21 22:44:50 -04:00
|
|
|
|
Including ?- makes double dashes into comment delimiters, but
|
|
|
|
|
they are really only supposed to delimit comments within DTD
|
|
|
|
|
definitions. So we normally turn it off.")
|
1996-01-24 17:12:21 +00:00
|
|
|
|
|
|
|
|
|
(defvar sgml-quick-keys nil
|
2002-04-01 23:32:15 +00:00
|
|
|
|
"Use <, >, &, /, SPC and `sgml-specials' keys \"electrically\" when non-nil.
|
2002-02-28 16:14:50 +00:00
|
|
|
|
This takes effect when first loading the `sgml-mode' library.")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(defvar sgml-mode-map
|
2021-02-23 03:51:12 +01:00
|
|
|
|
(let ((map (make-keymap))) ;`sparse' doesn't allow binding to charsets.
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(define-key map "\C-c\C-i" 'sgml-tags-invisible)
|
|
|
|
|
(define-key map "/" 'sgml-slash)
|
1996-01-24 17:12:21 +00:00
|
|
|
|
(define-key map "\C-c\C-n" 'sgml-name-char)
|
|
|
|
|
(define-key map "\C-c\C-t" 'sgml-tag)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(define-key map "\C-c\C-a" 'sgml-attributes)
|
|
|
|
|
(define-key map "\C-c\C-b" 'sgml-skip-tag-backward)
|
|
|
|
|
(define-key map [?\C-c left] 'sgml-skip-tag-backward)
|
|
|
|
|
(define-key map "\C-c\C-f" 'sgml-skip-tag-forward)
|
|
|
|
|
(define-key map [?\C-c right] 'sgml-skip-tag-forward)
|
|
|
|
|
(define-key map "\C-c\C-d" 'sgml-delete-tag)
|
|
|
|
|
(define-key map "\C-c\^?" 'sgml-delete-tag)
|
|
|
|
|
(define-key map "\C-c?" 'sgml-tag-help)
|
2010-10-23 20:21:59 -04:00
|
|
|
|
(define-key map "\C-c]" 'sgml-close-tag)
|
2002-04-02 11:26:12 +00:00
|
|
|
|
(define-key map "\C-c/" 'sgml-close-tag)
|
2010-05-13 17:52:20 -04:00
|
|
|
|
|
|
|
|
|
;; Redundant keybindings, for consistency with TeX mode.
|
|
|
|
|
(define-key map "\C-c\C-o" 'sgml-tag)
|
|
|
|
|
(define-key map "\C-c\C-e" 'sgml-close-tag)
|
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(define-key map "\C-c8" 'sgml-name-8bit-mode)
|
|
|
|
|
(define-key map "\C-c\C-v" 'sgml-validate)
|
2001-10-05 16:21:14 +00:00
|
|
|
|
(when sgml-quick-keys
|
|
|
|
|
(define-key map "&" 'sgml-name-char)
|
|
|
|
|
(define-key map "<" 'sgml-tag)
|
|
|
|
|
(define-key map " " 'sgml-auto-attributes)
|
|
|
|
|
(define-key map ">" 'sgml-maybe-end-tag)
|
|
|
|
|
(when (memq ?\" sgml-specials)
|
|
|
|
|
(define-key map "\"" 'sgml-name-self))
|
|
|
|
|
(when (memq ?' sgml-specials)
|
|
|
|
|
(define-key map "'" 'sgml-name-self)))
|
2001-10-22 09:45:39 +00:00
|
|
|
|
(let ((c 127)
|
|
|
|
|
(map (nth 1 map)))
|
|
|
|
|
(while (< (setq c (1+ c)) 256)
|
|
|
|
|
(aset map c 'sgml-maybe-name-self)))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
map)
|
|
|
|
|
"Keymap for SGML mode. See also `sgml-specials'.")
|
|
|
|
|
|
2021-02-23 03:51:12 +01:00
|
|
|
|
(easy-menu-define sgml-mode-menu sgml-mode-map
|
|
|
|
|
"Menu for SGML mode."
|
|
|
|
|
'("SGML"
|
|
|
|
|
["Insert Tag" sgml-tag]
|
|
|
|
|
["Insert Attributes" sgml-attributes]
|
|
|
|
|
["Backward Tag" sgml-skip-tag-backward]
|
|
|
|
|
["Forward Tag" sgml-skip-tag-forward]
|
|
|
|
|
["Delete Tag" sgml-delete-tag]
|
|
|
|
|
["Describe Tag" sgml-tag-help]
|
|
|
|
|
"---"
|
|
|
|
|
["Toggle Tag Visibility" sgml-tags-invisible]
|
|
|
|
|
["Toggle 8 Bit Insertion" sgml-name-8bit-mode]
|
|
|
|
|
"---"
|
|
|
|
|
["Validate" sgml-validate]))
|
|
|
|
|
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(defun sgml-make-syntax-table (specials)
|
|
|
|
|
(let ((table (make-syntax-table text-mode-syntax-table)))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(modify-syntax-entry ?< "(>" table)
|
|
|
|
|
(modify-syntax-entry ?> ")<" table)
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(modify-syntax-entry ?: "_" table)
|
|
|
|
|
(modify-syntax-entry ?_ "_" table)
|
|
|
|
|
(modify-syntax-entry ?. "_" table)
|
|
|
|
|
(if (memq ?- specials)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(modify-syntax-entry ?- "_ 1234" table))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(if (memq ?\" specials)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(modify-syntax-entry ?\" "\"\"" table))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(if (memq ?' specials)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(modify-syntax-entry ?\' "\"'" table))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
table))
|
|
|
|
|
|
|
|
|
|
(defvar sgml-mode-syntax-table (sgml-make-syntax-table sgml-specials)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"Syntax table used in SGML mode. See also `sgml-specials'.")
|
|
|
|
|
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(defconst sgml-tag-syntax-table
|
2021-06-14 14:57:57 +02:00
|
|
|
|
(let ((table (sgml-make-syntax-table sgml-specials))
|
|
|
|
|
brackets)
|
|
|
|
|
(map-char-table
|
|
|
|
|
(lambda (key value)
|
|
|
|
|
(setq brackets (cons (list
|
|
|
|
|
(if (consp key)
|
|
|
|
|
(list (car key) (cdr key))
|
|
|
|
|
key)
|
|
|
|
|
value)
|
|
|
|
|
brackets)))
|
|
|
|
|
(unicode-property-table-internal 'paired-bracket))
|
|
|
|
|
(setq brackets (delete-dups (flatten-tree brackets)))
|
|
|
|
|
(dolist (char (append brackets (list ?$ ?% ?& ?* ?+ ?/)))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(modify-syntax-entry char "." table))
|
2008-09-19 06:20:30 +00:00
|
|
|
|
(unless (memq ?' sgml-specials)
|
|
|
|
|
;; Avoid that skipping a tag backwards skips any "'" prefixing it.
|
|
|
|
|
(modify-syntax-entry ?' "w" table))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
table)
|
|
|
|
|
"Syntax table used to parse SGML tags.")
|
|
|
|
|
|
1997-04-13 05:07:27 +00:00
|
|
|
|
(defcustom sgml-name-8bit-mode nil
|
2007-05-10 06:02:15 +00:00
|
|
|
|
"When non-nil, insert non-ASCII characters as named entities."
|
2019-01-17 18:25:00 -05:00
|
|
|
|
:type 'boolean)
|
1992-07-17 06:48:03 +00:00
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(defvar sgml-char-names
|
|
|
|
|
[nil nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
1997-04-16 21:43:01 +00:00
|
|
|
|
"nbsp" "excl" "quot" "num" "dollar" "percnt" "amp" "apos"
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"lpar" "rpar" "ast" "plus" "comma" "hyphen" "period" "sol"
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
|
|
|
|
nil nil "colon" "semi" "lt" "eq" "gt" "quest"
|
|
|
|
|
"commat" nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil "lsqb" nil "rsqb" "uarr" "lowbar"
|
|
|
|
|
"lsquo" nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil "lcub" "verbar" "rcub" "tilde" nil
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
|
|
|
|
nil nil nil nil nil nil nil nil
|
|
|
|
|
"nbsp" "iexcl" "cent" "pound" "curren" "yen" "brvbar" "sect"
|
|
|
|
|
"uml" "copy" "ordf" "laquo" "not" "shy" "reg" "macr"
|
|
|
|
|
"ring" "plusmn" "sup2" "sup3" "acute" "micro" "para" "middot"
|
1999-10-30 21:06:34 +00:00
|
|
|
|
"cedil" "sup1" "ordm" "raquo" "frac14" "frac12" "frac34" "iquest"
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"Agrave" "Aacute" "Acirc" "Atilde" "Auml" "Aring" "AElig" "Ccedil"
|
|
|
|
|
"Egrave" "Eacute" "Ecirc" "Euml" "Igrave" "Iacute" "Icirc" "Iuml"
|
|
|
|
|
"ETH" "Ntilde" "Ograve" "Oacute" "Ocirc" "Otilde" "Ouml" nil
|
|
|
|
|
"Oslash" "Ugrave" "Uacute" "Ucirc" "Uuml" "Yacute" "THORN" "szlig"
|
|
|
|
|
"agrave" "aacute" "acirc" "atilde" "auml" "aring" "aelig" "ccedil"
|
|
|
|
|
"egrave" "eacute" "ecirc" "euml" "igrave" "iacute" "icirc" "iuml"
|
|
|
|
|
"eth" "ntilde" "ograve" "oacute" "ocirc" "otilde" "ouml" "divide"
|
|
|
|
|
"oslash" "ugrave" "uacute" "ucirc" "uuml" "yacute" "thorn" "yuml"]
|
|
|
|
|
"Vector of symbolic character names without `&' and `;'.")
|
|
|
|
|
|
2001-10-22 09:45:39 +00:00
|
|
|
|
(put 'sgml-table 'char-table-extra-slots 0)
|
|
|
|
|
|
|
|
|
|
(defvar sgml-char-names-table
|
|
|
|
|
(let ((table (make-char-table 'sgml-table))
|
|
|
|
|
(i 32)
|
|
|
|
|
elt)
|
2002-03-01 02:29:13 +00:00
|
|
|
|
(while (< i 128)
|
2001-10-22 09:45:39 +00:00
|
|
|
|
(setq elt (aref sgml-char-names i))
|
|
|
|
|
(if elt (aset table (make-char 'latin-iso8859-1 i) elt))
|
|
|
|
|
(setq i (1+ i)))
|
|
|
|
|
table)
|
|
|
|
|
"A table for mapping non-ASCII characters into SGML entity names.
|
|
|
|
|
Currently, only Latin-1 characters are supported.")
|
|
|
|
|
|
2014-08-11 16:15:59 -04:00
|
|
|
|
(defcustom sgml-validate-command
|
|
|
|
|
;; prefer tidy because (o)nsgmls is often built without --enable-http
|
|
|
|
|
;; which makes it next to useless
|
|
|
|
|
(cond ((executable-find "tidy")
|
2022-10-15 11:17:51 +02:00
|
|
|
|
;; tidy is available from https://tidy.sourceforge.net/
|
2014-11-26 14:38:35 -05:00
|
|
|
|
"tidy --gnu-emacs yes -utf8 -e -q")
|
2014-08-11 16:15:59 -04:00
|
|
|
|
((executable-find "nsgmls")
|
|
|
|
|
;; nsgmls is a free SGML parser in the SP suite available from
|
|
|
|
|
;; ftp.jclark.com, replaced old `sgmls'.
|
|
|
|
|
"nsgmls -s")
|
|
|
|
|
((executable-find "onsgmls")
|
|
|
|
|
;; onsgmls is the community version of `nsgmls'
|
2022-10-15 11:17:51 +02:00
|
|
|
|
;; hosted on https://openjade.sourceforge.net/
|
2014-08-11 16:15:59 -04:00
|
|
|
|
"onsgmls -s")
|
|
|
|
|
(t "Install (o)nsgmls, tidy, or some other SGML validator, and set `sgml-validate-command'"))
|
2007-05-10 06:02:15 +00:00
|
|
|
|
"The command to validate an SGML document.
|
1992-07-17 06:48:03 +00:00
|
|
|
|
The file name of current buffer file name will be appended to this,
|
1997-04-13 05:07:27 +00:00
|
|
|
|
separated by a space."
|
|
|
|
|
:type 'string
|
2019-01-17 18:25:00 -05:00
|
|
|
|
:version "21.1")
|
1992-07-17 06:48:03 +00:00
|
|
|
|
|
|
|
|
|
(defvar sgml-saved-validate-command nil
|
|
|
|
|
"The command last used to validate in this buffer.")
|
|
|
|
|
|
2001-06-17 09:01:23 +00:00
|
|
|
|
;; I doubt that null end tags are used much for large elements,
|
|
|
|
|
;; so use a small distance here.
|
1997-04-13 05:07:27 +00:00
|
|
|
|
(defcustom sgml-slash-distance 1000
|
2007-05-10 06:02:15 +00:00
|
|
|
|
"If non-nil, is the maximum distance to search for matching `/'."
|
2019-01-17 18:25:00 -05:00
|
|
|
|
:type '(choice (const nil) integer))
|
1992-07-17 06:48:03 +00:00
|
|
|
|
|
2003-05-12 15:46:02 +00:00
|
|
|
|
(defconst sgml-namespace-re "[_[:alpha:]][-_.[:alnum:]]*")
|
2002-03-29 19:38:22 +00:00
|
|
|
|
(defconst sgml-name-re "[_:[:alpha:]][-_.:[:alnum:]]*")
|
|
|
|
|
(defconst sgml-tag-name-re (concat "<\\([!/?]?" sgml-name-re "\\)"))
|
2020-04-16 11:04:24 +02:00
|
|
|
|
(defconst sgml-attrs-re
|
|
|
|
|
;; This pattern cannot begin with a character matched by the end of
|
|
|
|
|
;; `sgml-name-re' above.
|
|
|
|
|
"\\(?:[^_.:\"'/><[:alnum:]-]\\(?:[^\"'/><]\\|\"[^\"]*\"\\|'[^']*'\\)*\\)?")
|
2002-03-29 19:38:22 +00:00
|
|
|
|
(defconst sgml-start-tag-regex (concat "<" sgml-name-re sgml-attrs-re)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"Regular expression that matches a non-empty start tag.
|
1997-04-24 19:37:13 +00:00
|
|
|
|
Any terminating `>' or `/' is not matched.")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
2005-06-10 10:45:17 +00:00
|
|
|
|
(defface sgml-namespace
|
2003-05-12 15:46:02 +00:00
|
|
|
|
'((t (:inherit font-lock-builtin-face)))
|
2019-01-17 18:25:00 -05:00
|
|
|
|
"`sgml-mode' face used to highlight the namespace part of identifiers.")
|
2005-06-10 10:45:17 +00:00
|
|
|
|
(defvar sgml-namespace-face 'sgml-namespace)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
1998-04-27 01:22:08 +00:00
|
|
|
|
;; internal
|
|
|
|
|
(defconst sgml-font-lock-keywords-1
|
2002-03-29 19:38:22 +00:00
|
|
|
|
`((,(concat "<\\([!?]" sgml-name-re "\\)") 1 font-lock-keyword-face)
|
2003-05-12 15:46:02 +00:00
|
|
|
|
;; We could use the simpler "\\(" sgml-namespace-re ":\\)?" instead,
|
|
|
|
|
;; but it would cause a bit more backtracking in the re-matcher.
|
|
|
|
|
(,(concat "</?\\(" sgml-namespace-re "\\)\\(?::\\(" sgml-name-re "\\)\\)?")
|
|
|
|
|
(1 (if (match-end 2) sgml-namespace-face font-lock-function-name-face))
|
|
|
|
|
(2 font-lock-function-name-face nil t))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
;; FIXME: this doesn't cover the variables using a default value.
|
2006-12-04 08:08:06 +00:00
|
|
|
|
;; The first shy-group is an important anchor: it prevents an O(n^2)
|
|
|
|
|
;; pathological case where we otherwise keep retrying a failing match
|
|
|
|
|
;; against a very long word at every possible position within the word.
|
|
|
|
|
(,(concat "\\(?:^\\|[ \t]\\)\\(" sgml-namespace-re "\\)\\(?::\\("
|
2003-05-12 15:46:02 +00:00
|
|
|
|
sgml-name-re "\\)\\)?=[\"']")
|
|
|
|
|
(1 (if (match-end 2) sgml-namespace-face font-lock-variable-name-face))
|
|
|
|
|
(2 font-lock-variable-name-face nil t))
|
2002-03-29 19:38:22 +00:00
|
|
|
|
(,(concat "[&%]" sgml-name-re ";?") . font-lock-variable-name-face)))
|
2001-10-25 22:25:30 +00:00
|
|
|
|
|
|
|
|
|
(defconst sgml-font-lock-keywords-2
|
|
|
|
|
(append
|
|
|
|
|
sgml-font-lock-keywords-1
|
|
|
|
|
'((eval
|
|
|
|
|
. (cons (concat "<"
|
|
|
|
|
(regexp-opt (mapcar 'car sgml-tag-face-alist) t)
|
|
|
|
|
"\\([ \t][^>]*\\)?>\\([^<]+\\)</\\1>")
|
2007-06-17 13:55:17 +00:00
|
|
|
|
'(3 (cdr (assoc-string (match-string 1) sgml-tag-face-alist t))
|
|
|
|
|
prepend))))))
|
1998-04-27 01:22:08 +00:00
|
|
|
|
|
|
|
|
|
;; for font-lock, but must be defvar'ed after
|
|
|
|
|
;; sgml-font-lock-keywords-1 and sgml-font-lock-keywords-2 above
|
|
|
|
|
(defvar sgml-font-lock-keywords sgml-font-lock-keywords-1
|
2012-04-09 21:05:48 +08:00
|
|
|
|
"Rules for highlighting SGML code. See also `sgml-tag-face-alist'.")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
2019-05-26 17:41:22 -04:00
|
|
|
|
(defun sgml-font-lock-syntactic-face (state)
|
|
|
|
|
"`font-lock-syntactic-face-function' for `sgml-mode'."
|
|
|
|
|
;; Don't use string face outside of tags.
|
|
|
|
|
(cond ((and (nth 9 state) (nth 3 state)) font-lock-string-face)
|
|
|
|
|
((nth 4 state) font-lock-comment-face)))
|
|
|
|
|
|
2019-05-22 18:36:37 -04:00
|
|
|
|
(defvar-local sgml--syntax-propertize-ppss nil)
|
|
|
|
|
|
|
|
|
|
(defun sgml--syntax-propertize-ppss (pos)
|
|
|
|
|
"Return PPSS at POS, fixing the syntax of any lone `>' along the way."
|
|
|
|
|
(cl-assert (>= pos (car sgml--syntax-propertize-ppss)))
|
|
|
|
|
(let ((ppss (parse-partial-sexp (car sgml--syntax-propertize-ppss) pos -1
|
|
|
|
|
nil (cdr sgml--syntax-propertize-ppss))))
|
|
|
|
|
(while (eq -1 (car ppss))
|
|
|
|
|
(put-text-property (1- (point)) (point)
|
|
|
|
|
'syntax-table (string-to-syntax "."))
|
|
|
|
|
;; Hack attack: rather than recompute the ppss from
|
|
|
|
|
;; (car sgml--syntax-propertize-ppss), we manually "fix it".
|
|
|
|
|
(setcar ppss 0)
|
|
|
|
|
(setq ppss (parse-partial-sexp (point) pos -1 nil ppss)))
|
|
|
|
|
(setcdr sgml--syntax-propertize-ppss ppss)
|
|
|
|
|
(setcar sgml--syntax-propertize-ppss pos)
|
|
|
|
|
ppss))
|
|
|
|
|
|
2017-03-23 11:33:47 -06:00
|
|
|
|
(eval-and-compile
|
|
|
|
|
(defconst sgml-syntax-propertize-rules
|
|
|
|
|
(syntax-propertize-precompile-rules
|
|
|
|
|
;; Use the `b' style of comments to avoid interference with the -- ... --
|
|
|
|
|
;; comments recognized when `sgml-specials' includes ?-.
|
|
|
|
|
;; FIXME: beware of <!--> blabla <!--> !!
|
|
|
|
|
("\\(<\\)!--" (1 "< b"))
|
|
|
|
|
("--[ \t\n]*\\(>\\)" (1 "> b"))
|
|
|
|
|
("\\(<\\)[?!]" (1 (prog1 "|>"
|
|
|
|
|
(sgml-syntax-propertize-inside end))))
|
2019-05-15 18:51:30 -04:00
|
|
|
|
;; Quotes outside of tags should not introduce strings which end up
|
|
|
|
|
;; hiding tags. We used to test every quote and mark it as "."
|
|
|
|
|
;; if it's outside of tags, but there are too many 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
|
2019-06-04 12:26:52 -04:00
|
|
|
|
;; of quotes that doesn't hold a < or > char, which is the vast majority:
|
|
|
|
|
;; either they're both within a tag (or a comment), in which case it's
|
|
|
|
|
;; indeed correct to leave them as is, or they're both outside of tags, in
|
|
|
|
|
;; which case they arguably should have punctuation syntax, but it is
|
|
|
|
|
;; harmless to let them have string syntax because they won't "hide" any
|
|
|
|
|
;; tag or comment from us (and we use the
|
|
|
|
|
;; font-lock-syntactic-face-function to make sure those spurious "strings
|
|
|
|
|
;; within text" aren't highlighted as strings).
|
2019-05-26 11:07:14 -04:00
|
|
|
|
("\\([\"']\\)[^\"'<>]*"
|
2019-05-22 18:36:37 -04:00
|
|
|
|
(1 (if (eq (char-after) (char-after (match-beginning 0)))
|
2019-06-04 12:26:52 -04:00
|
|
|
|
;; Fast-track case.
|
2019-05-22 18:36:37 -04:00
|
|
|
|
(forward-char 1)
|
2019-06-04 12:26:52 -04:00
|
|
|
|
;; Point has moved to the end of the text we matched after the
|
|
|
|
|
;; quote, but this risks overlooking a match to one of the other
|
|
|
|
|
;; regexp in the rules. We could just (goto-char (match-end 1))
|
|
|
|
|
;; to solve this, but that would be too easy, so instead we
|
|
|
|
|
;; only move back enough to avoid skipping comment ender, which
|
|
|
|
|
;; happens to be the only one that we could have overlooked.
|
2019-05-26 11:07:14 -04:00
|
|
|
|
(when (eq (char-after) ?>)
|
|
|
|
|
(skip-chars-backward "-"))
|
2019-05-15 18:51:30 -04:00
|
|
|
|
;; 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.
|
2019-05-22 18:36:37 -04:00
|
|
|
|
(if (zerop (save-excursion
|
|
|
|
|
(car (sgml--syntax-propertize-ppss
|
|
|
|
|
(match-beginning 0)))))
|
2019-05-15 18:51:30 -04:00
|
|
|
|
(string-to-syntax ".")))))
|
2019-11-29 11:51:48 -05:00
|
|
|
|
)
|
|
|
|
|
"Syntax-propertize rules for sgml text.
|
|
|
|
|
These have to be run via `sgml-syntax-propertize'"))
|
2017-03-23 11:33:47 -06:00
|
|
|
|
|
2019-11-29 11:51:48 -05:00
|
|
|
|
(defconst sgml--syntax-propertize
|
|
|
|
|
(syntax-propertize-rules sgml-syntax-propertize-rules))
|
|
|
|
|
|
|
|
|
|
(defun sgml-syntax-propertize (start end &optional rules-function)
|
2017-02-28 09:34:13 -05:00
|
|
|
|
"Syntactic keywords for `sgml-mode'."
|
2019-05-22 18:36:37 -04:00
|
|
|
|
(setq sgml--syntax-propertize-ppss (cons start (syntax-ppss start)))
|
2022-02-28 10:30:31 +01:00
|
|
|
|
(when (>= (cadr sgml--syntax-propertize-ppss) 0)
|
|
|
|
|
(sgml-syntax-propertize-inside end)
|
|
|
|
|
(funcall (or rules-function sgml--syntax-propertize) (point) end)
|
|
|
|
|
;; Catch any '>' after the last quote.
|
|
|
|
|
(sgml--syntax-propertize-ppss end)))
|
2017-02-28 09:34:13 -05:00
|
|
|
|
|
|
|
|
|
(defun sgml-syntax-propertize-inside (end)
|
|
|
|
|
(let ((ppss (syntax-ppss)))
|
|
|
|
|
(cond
|
|
|
|
|
((eq (nth 3 ppss) t)
|
|
|
|
|
(let ((endre (save-excursion
|
|
|
|
|
(goto-char (nth 8 ppss))
|
|
|
|
|
(cond
|
|
|
|
|
((looking-at-p "<!\\[CDATA\\[") "]]>")
|
|
|
|
|
((looking-at-p "<\\?") (if sgml-xml-mode "\\?>" ">"))
|
|
|
|
|
(t ">")))))
|
|
|
|
|
(when (re-search-forward endre end 'move)
|
|
|
|
|
(put-text-property (1- (point)) (point)
|
|
|
|
|
'syntax-table (string-to-syntax "|<"))))))))
|
2001-10-25 22:25:30 +00:00
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
;; internal
|
|
|
|
|
(defvar sgml-face-tag-alist ()
|
2021-10-02 15:14:15 +02:00
|
|
|
|
"Alist of face and tag name for facemenu.
|
|
|
|
|
The tag name can be a string or a list of strings.")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(defvar sgml-tag-face-alist ()
|
|
|
|
|
"Tag names and face or list of faces to fontify with when invisible.
|
|
|
|
|
When `font-lock-maximum-decoration' is 1 this is always used for fontifying.
|
|
|
|
|
When more these are fontified together with `sgml-font-lock-keywords'.")
|
|
|
|
|
|
|
|
|
|
(defvar sgml-display-text ()
|
|
|
|
|
"Tag names as lowercase symbols, and display string when invisible.")
|
|
|
|
|
|
|
|
|
|
;; internal
|
|
|
|
|
(defvar sgml-tags-invisible nil)
|
|
|
|
|
|
1997-04-13 05:07:27 +00:00
|
|
|
|
(defcustom sgml-tag-alist
|
1996-01-24 17:12:21 +00:00
|
|
|
|
'(("![" ("ignore" t) ("include" t))
|
|
|
|
|
("!attlist")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("!doctype")
|
|
|
|
|
("!element")
|
|
|
|
|
("!entity"))
|
2007-05-10 06:02:15 +00:00
|
|
|
|
"Alist of tag names for completing read and insertion rules.
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
This alist is made up as
|
|
|
|
|
|
|
|
|
|
((\"tag\" . TAGRULE)
|
|
|
|
|
...)
|
|
|
|
|
|
2002-04-09 12:02:20 +00:00
|
|
|
|
TAGRULE is a list of optionally t (no endtag) or `\\n' (separate endtag by
|
|
|
|
|
newlines) or a skeleton with nil, t or `\\n' in place of the interactor
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
followed by an ATTRIBUTERULE (for an always present attribute) or an
|
|
|
|
|
attribute alist.
|
|
|
|
|
|
|
|
|
|
The attribute alist is made up as
|
|
|
|
|
|
|
|
|
|
((\"attribute\" . ATTRIBUTERULE)
|
|
|
|
|
...)
|
|
|
|
|
|
2002-04-09 12:02:20 +00:00
|
|
|
|
ATTRIBUTERULE is a list of optionally t (no value when no input) followed by
|
1997-04-13 05:07:27 +00:00
|
|
|
|
an optional alist of possible values."
|
|
|
|
|
:type '(repeat (cons (string :tag "Tag Name")
|
2022-07-11 10:33:45 +02:00
|
|
|
|
(repeat :tag "Tag Rule" sexp)))
|
|
|
|
|
:risky t)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
1997-04-13 05:07:27 +00:00
|
|
|
|
(defcustom sgml-tag-help
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
'(("!" . "Empty declaration for comment")
|
|
|
|
|
("![" . "Embed declarations with parser directive")
|
|
|
|
|
("!attlist" . "Tag attributes declaration")
|
|
|
|
|
("!doctype" . "Document type (DTD) declaration")
|
|
|
|
|
("!element" . "Tag declaration")
|
|
|
|
|
("!entity" . "Entity (macro) declaration"))
|
2007-05-10 06:02:15 +00:00
|
|
|
|
"Alist of tag name and short description."
|
1997-04-13 05:07:27 +00:00
|
|
|
|
:type '(repeat (cons (string :tag "Tag Name")
|
2019-01-17 18:25:00 -05:00
|
|
|
|
(string :tag "Description"))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
2001-10-28 04:10:40 +00:00
|
|
|
|
(defvar sgml-empty-tags nil
|
|
|
|
|
"List of tags whose !ELEMENT definition says EMPTY.")
|
|
|
|
|
|
2002-03-29 19:38:22 +00:00
|
|
|
|
(defvar sgml-unclosed-tags nil
|
|
|
|
|
"List of tags whose !ELEMENT definition says the end-tag is optional.")
|
|
|
|
|
|
2001-10-27 16:07:35 +00:00
|
|
|
|
(defun sgml-xml-guess ()
|
2007-06-17 13:55:17 +00:00
|
|
|
|
"Guess whether the current buffer is XML. Return non-nil if so."
|
2001-10-27 16:07:35 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(or (string= "xml" (file-name-extension (or buffer-file-name "")))
|
2010-12-10 18:50:58 -08:00
|
|
|
|
;; Maybe the buffer-size check isn't needed, I don't know.
|
|
|
|
|
(and (zerop (buffer-size))
|
|
|
|
|
(string= "xhtml" (file-name-extension (or buffer-file-name ""))))
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(looking-at "\\s-*<\\?xml")
|
|
|
|
|
(when (re-search-forward
|
|
|
|
|
(eval-when-compile
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(mapconcat 'identity
|
|
|
|
|
'("<!DOCTYPE" "\\(\\w+\\)" "\\(\\w+\\)"
|
2007-06-17 13:55:17 +00:00
|
|
|
|
"\"\\([^\"]+\\)\"" "\"\\([^\"]+\\)\"")
|
|
|
|
|
"\\s-+"))
|
|
|
|
|
nil t)
|
|
|
|
|
(string-match "X\\(HT\\)?ML" (match-string 3))))))
|
2001-10-27 16:07:35 +00:00
|
|
|
|
|
2019-01-17 18:25:00 -05:00
|
|
|
|
(with-no-warnings (defvar v2)) ; free for skeleton
|
1998-11-16 17:50:28 +00:00
|
|
|
|
|
2002-04-08 21:32:05 +00:00
|
|
|
|
(defun sgml-comment-indent-new-line (&optional soft)
|
2021-02-01 10:42:22 +01:00
|
|
|
|
(if (ppss-comment-depth (syntax-ppss))
|
|
|
|
|
(let ((comment-start "-- ")
|
|
|
|
|
(comment-start-skip "\\(<!\\)?--[ \t]*")
|
|
|
|
|
(comment-end " --")
|
|
|
|
|
(comment-style 'plain))
|
|
|
|
|
(comment-indent-new-line soft))
|
2002-04-08 21:32:05 +00:00
|
|
|
|
(comment-indent-new-line soft)))
|
|
|
|
|
|
Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
(defun sgml-mode-facemenu-add-face-function (face _end)
|
2021-10-02 15:14:15 +02:00
|
|
|
|
"Add \"face\" tags with `facemenu-keymap' commands."
|
|
|
|
|
(let ((tag-face (ensure-list (cdr (assq face sgml-face-tag-alist)))))
|
2009-10-31 21:52:53 +00:00
|
|
|
|
(cond (tag-face
|
|
|
|
|
(setq tag-face (funcall skeleton-transformation-function tag-face))
|
2021-10-02 15:14:15 +02:00
|
|
|
|
(setq facemenu-end-add-face
|
|
|
|
|
(mapconcat (lambda (f) (concat "</" f ">")) (reverse tag-face) ""))
|
|
|
|
|
(mapconcat (lambda (f) (concat "<" f ">")) tag-face ""))
|
2009-10-31 21:52:53 +00:00
|
|
|
|
((and (consp face)
|
|
|
|
|
(consp (car face))
|
|
|
|
|
(null (cdr face))
|
|
|
|
|
(memq (caar face) '(:foreground :background)))
|
|
|
|
|
(setq facemenu-end-add-face "</span>")
|
|
|
|
|
(format "<span style=\"%s:%s\">"
|
|
|
|
|
(if (eq (caar face) :foreground)
|
|
|
|
|
"color"
|
|
|
|
|
"background-color")
|
|
|
|
|
(cadr (car face))))
|
|
|
|
|
(t
|
|
|
|
|
(error "Face not configured for %s mode"
|
|
|
|
|
(format-mode-line mode-name))))))
|
2002-03-17 23:55:15 +00:00
|
|
|
|
|
2005-01-13 14:51:57 +00:00
|
|
|
|
(defun sgml-fill-nobreak ()
|
2011-03-05 18:30:44 -08:00
|
|
|
|
"Don't break between a tag name and its first argument.
|
|
|
|
|
This function is designed for use in `fill-nobreak-predicate'.
|
|
|
|
|
|
|
|
|
|
<a href=\"some://where\" type=\"text/plain\">
|
|
|
|
|
^ ^
|
|
|
|
|
| no break here | but still allowed here"
|
2005-01-13 14:51:57 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(skip-chars-backward " \t")
|
|
|
|
|
(and (not (zerop (skip-syntax-backward "w_")))
|
|
|
|
|
(skip-chars-backward "/?!")
|
|
|
|
|
(eq (char-before) ?<))))
|
|
|
|
|
|
2014-11-16 17:38:15 +01:00
|
|
|
|
(defvar tildify-space-string)
|
2014-11-17 14:41:37 +01:00
|
|
|
|
(defvar tildify-foreach-region-function)
|
2014-11-16 17:38:15 +01:00
|
|
|
|
|
2002-03-17 23:55:15 +00:00
|
|
|
|
;;;###autoload
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(define-derived-mode sgml-mode text-mode '(sgml-xml-mode "XML" "SGML")
|
2002-03-17 23:55:15 +00:00
|
|
|
|
"Major mode for editing SGML documents.
|
|
|
|
|
Makes > match <.
|
2015-08-30 22:53:21 -07:00
|
|
|
|
Keys <, &, SPC within <>, \", / and \\=' can be electric depending on
|
2002-03-17 23:55:15 +00:00
|
|
|
|
`sgml-quick-keys'.
|
|
|
|
|
|
|
|
|
|
An argument of N to a tag-inserting command means to wrap it around
|
|
|
|
|
the next N words. In Transient Mark mode, when the mark is active,
|
|
|
|
|
N defaults to -1, which means to wrap it around the current region.
|
|
|
|
|
|
2015-08-30 22:53:21 -07:00
|
|
|
|
If you like upcased tags, put (setq sgml-transformation-function \\='upcase)
|
2012-09-17 13:41:04 +08:00
|
|
|
|
in your init file.
|
2002-03-17 23:55:15 +00:00
|
|
|
|
|
|
|
|
|
Use \\[sgml-validate] to validate your document with an SGML parser.
|
|
|
|
|
|
|
|
|
|
Do \\[describe-variable] sgml- SPC to see available variables.
|
|
|
|
|
Do \\[describe-key] on the following bindings to discover what they do.
|
|
|
|
|
\\{sgml-mode-map}"
|
1992-07-17 06:48:03 +00:00
|
|
|
|
(make-local-variable 'sgml-saved-validate-command)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(make-local-variable 'facemenu-end-add-face)
|
2014-11-16 17:38:15 +01:00
|
|
|
|
;; If encoding does not allow non-break space character, use reference.
|
|
|
|
|
;; FIXME: Perhaps use if possible (e.g. when we know its HTML)?
|
|
|
|
|
(setq-local tildify-space-string
|
|
|
|
|
(if (equal (decode-coding-string
|
|
|
|
|
(encode-coding-string " " buffer-file-coding-system)
|
|
|
|
|
buffer-file-coding-system) " ")
|
|
|
|
|
" " " "))
|
2014-11-17 14:41:37 +01:00
|
|
|
|
;; FIXME: Use the fact that we're parsing the document already
|
|
|
|
|
;; rather than using regex-based filtering.
|
|
|
|
|
(setq-local tildify-foreach-region-function
|
|
|
|
|
(apply-partially
|
|
|
|
|
'tildify-foreach-ignore-environments
|
2022-07-04 14:52:50 +02:00
|
|
|
|
`((,(concat
|
|
|
|
|
"<\\("
|
|
|
|
|
(regexp-opt '("pre" "dfn" "code" "samp" "kbd" "var"
|
|
|
|
|
"PRE" "DFN" "CODE" "SAMP" "KBD" "VAR"))
|
|
|
|
|
"\\)\\>[^>]*>")
|
2014-11-17 14:41:37 +01:00
|
|
|
|
. ("</" 1 ">"))
|
|
|
|
|
("<! *--" . "-- *>")
|
|
|
|
|
("<" . ">"))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
;;(make-local-variable 'facemenu-remove-face-function)
|
2001-10-27 16:07:35 +00:00
|
|
|
|
;; A start or end tag by itself on a line separates a paragraph.
|
|
|
|
|
;; This is desirable because SGML discards a newline that appears
|
|
|
|
|
;; immediately after a start tag or immediately before an end tag.
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
(setq-local paragraph-start (concat "[ \t]*$\\|\
|
2019-05-26 17:41:22 -04:00
|
|
|
|
\[ \t]*</?\\(" sgml-name-re sgml-attrs-re "\\)?>"))
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
(setq-local paragraph-separate (concat paragraph-start "$"))
|
|
|
|
|
(setq-local adaptive-fill-regexp "[ \t]*")
|
2005-01-13 14:51:57 +00:00
|
|
|
|
(add-hook 'fill-nobreak-predicate 'sgml-fill-nobreak nil t)
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
(setq-local indent-line-function 'sgml-indent-line)
|
|
|
|
|
(setq-local comment-start "<!-- ")
|
|
|
|
|
(setq-local comment-end " -->")
|
|
|
|
|
(setq-local comment-indent-function 'sgml-comment-indent)
|
|
|
|
|
(setq-local comment-line-break-function 'sgml-comment-indent-new-line)
|
|
|
|
|
(setq-local skeleton-further-elements '((completion-ignore-case t)))
|
2021-12-29 20:52:11 +02:00
|
|
|
|
(setq-local skeleton-end-newline nil)
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
(setq-local skeleton-end-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(or (eolp)
|
|
|
|
|
(not (or (eq v2 '\n) (eq (car-safe v2) '\n)))
|
|
|
|
|
(newline-and-indent))))
|
|
|
|
|
(setq font-lock-defaults '((sgml-font-lock-keywords
|
|
|
|
|
sgml-font-lock-keywords-1
|
|
|
|
|
sgml-font-lock-keywords-2)
|
2019-05-26 17:41:22 -04:00
|
|
|
|
nil t nil
|
|
|
|
|
(font-lock-syntactic-face-function
|
|
|
|
|
. sgml-font-lock-syntactic-face)))
|
2017-02-28 09:34:13 -05:00
|
|
|
|
(setq-local syntax-propertize-function #'sgml-syntax-propertize)
|
2019-06-23 21:27:43 -04:00
|
|
|
|
(setq-local syntax-ppss-table sgml-tag-syntax-table)
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
(setq-local facemenu-add-face-function 'sgml-mode-facemenu-add-face-function)
|
2021-04-14 19:19:01 +02:00
|
|
|
|
(when (sgml-xml-guess)
|
|
|
|
|
(setq-local sgml-xml-mode t))
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
(unless sgml-xml-mode
|
|
|
|
|
(setq-local skeleton-transformation-function sgml-transformation-function))
|
2001-03-07 00:03:50 +00:00
|
|
|
|
;; This will allow existing comments within declarations to be
|
|
|
|
|
;; recognized.
|
2008-02-14 02:42:45 +00:00
|
|
|
|
;; I can't find a clear description of SGML/XML comments, but it seems that
|
|
|
|
|
;; the only reliable ones are <!-- ... --> although it's not clear what
|
|
|
|
|
;; "..." can contain. It used to accept -- ... -- as well, but that was
|
|
|
|
|
;; apparently a mistake.
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
(setq-local comment-start-skip "<!--[ \t]*")
|
|
|
|
|
(setq-local comment-end-skip "[ \t]*--[ \t\n]*>")
|
2004-10-26 21:38:57 +00:00
|
|
|
|
;; This definition has an HTML leaning but probably fits well for other modes.
|
|
|
|
|
(setq imenu-generic-expression
|
|
|
|
|
`((nil
|
|
|
|
|
,(concat "<!\\(element\\|entity\\)[ \t\n]+%?[ \t\n]*\\("
|
|
|
|
|
sgml-name-re "\\)")
|
|
|
|
|
2)
|
|
|
|
|
("Id"
|
|
|
|
|
,(concat "<[^>]+[ \t\n]+[Ii][Dd]=\\(['\"]"
|
|
|
|
|
(if sgml-xml-mode "" "?")
|
|
|
|
|
"\\)\\(" sgml-name-re "\\)\\1")
|
|
|
|
|
2)
|
|
|
|
|
("Name"
|
|
|
|
|
,(concat "<[^>]+[ \t\n]+[Nn][Aa][Mm][Ee]=\\(['\"]"
|
|
|
|
|
(if sgml-xml-mode "" "?")
|
|
|
|
|
"\\)\\(" sgml-name-re "\\)\\1")
|
|
|
|
|
2))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
1992-07-17 06:48:03 +00:00
|
|
|
|
(defun sgml-comment-indent ()
|
2001-03-07 00:03:50 +00:00
|
|
|
|
(if (looking-at "--") comment-column 0))
|
1992-07-17 06:48:03 +00:00
|
|
|
|
|
|
|
|
|
(defun sgml-slash (arg)
|
2002-04-01 23:32:15 +00:00
|
|
|
|
"Insert ARG slash characters.
|
|
|
|
|
Behaves electrically if `sgml-quick-keys' is non-nil."
|
|
|
|
|
(interactive "p")
|
|
|
|
|
(cond
|
|
|
|
|
((not (and (eq (char-before) ?<) (= arg 1)))
|
|
|
|
|
(sgml-slash-matching arg))
|
|
|
|
|
((eq sgml-quick-keys 'indent)
|
|
|
|
|
(insert-char ?/ 1)
|
|
|
|
|
(indent-according-to-mode))
|
|
|
|
|
((eq sgml-quick-keys 'close)
|
Replace Lisp calls to delete-backward-char by delete-char.
* bs.el, expand.el, ido.el, image-dired.el, lpr.el, pcomplete.el,
skeleton.el, term.el, time.el, wid-edit.el, woman.el,
calc/calc-graph.el, calc/calc-help.el, calc/calc-incom.el,
calc/calc.el, emacs-cl-extra.el, emacs-cl-loaddefs.el,
emulation/cua-rect.el, emulation/viper-ex.el, eshell/esh-test.el,
eshell/eshell.el, gnus/gnus-uu.el, gnus/nndoc.el, gnus/nnrss.el,
gnus/rfc2047.el, gnus/utf7.el, international/utf-7.el,
language/ethio-util.el, mh-e/mh-alias.el, mh-e/mh-search.el,
net/imap.el, net/rcirc.el, obsolete/complete.el, play/decipher.el,
progmodes/ada-mode.el, progmodes/cc-awk.el, progmodes/dcl-mode.el,
progmodes/ps-mode.el, progmodes/verilog-mode.el,
progmodes/vhdl-mode.el, textmodes/bibtex.el, textmodes/fill.el,
textmodes/reftex-auc.el, textmodes/rst.el, textmodes/sgml-mode.el,
textmodes/table.el, textmodes/texinfmt.el: Replace Lisp calls to
delete-backward-char by calls to delete-char.
2010-05-24 22:11:08 -04:00
|
|
|
|
(delete-char -1)
|
2002-04-02 11:26:12 +00:00
|
|
|
|
(sgml-close-tag))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
(t
|
2018-04-15 23:56:24 +02:00
|
|
|
|
(insert-char ?/ arg))))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
|
|
|
|
|
(defun sgml-slash-matching (arg)
|
1997-04-24 19:37:13 +00:00
|
|
|
|
"Insert `/' and display any previous matching `/'.
|
|
|
|
|
Two `/'s are treated as matching if the first `/' ends a net-enabling
|
|
|
|
|
start tag, and the second `/' is the corresponding null end tag."
|
1992-07-17 06:48:03 +00:00
|
|
|
|
(interactive "p")
|
|
|
|
|
(insert-char ?/ arg)
|
|
|
|
|
(if (> arg 0)
|
|
|
|
|
(let ((oldpos (point))
|
|
|
|
|
(blinkpos)
|
|
|
|
|
(level 0))
|
|
|
|
|
(save-excursion
|
|
|
|
|
(save-restriction
|
|
|
|
|
(if sgml-slash-distance
|
|
|
|
|
(narrow-to-region (max (point-min)
|
|
|
|
|
(- (point) sgml-slash-distance))
|
|
|
|
|
oldpos))
|
|
|
|
|
(if (and (re-search-backward sgml-start-tag-regex (point-min) t)
|
|
|
|
|
(eq (match-end 0) (1- oldpos)))
|
|
|
|
|
()
|
|
|
|
|
(goto-char (1- oldpos))
|
|
|
|
|
(while (and (not blinkpos)
|
|
|
|
|
(search-backward "/" (point-min) t))
|
|
|
|
|
(let ((tagend (save-excursion
|
|
|
|
|
(if (re-search-backward sgml-start-tag-regex
|
|
|
|
|
(point-min) t)
|
|
|
|
|
(match-end 0)
|
|
|
|
|
nil))))
|
|
|
|
|
(if (eq tagend (point))
|
|
|
|
|
(if (eq level 0)
|
|
|
|
|
(setq blinkpos (point))
|
|
|
|
|
(setq level (1- level)))
|
|
|
|
|
(setq level (1+ level)))))))
|
2001-10-26 17:40:59 +00:00
|
|
|
|
(when blinkpos
|
|
|
|
|
(goto-char blinkpos)
|
|
|
|
|
(if (pos-visible-in-window-p)
|
|
|
|
|
(sit-for 1)
|
|
|
|
|
(message "Matches %s"
|
|
|
|
|
(buffer-substring (line-beginning-position)
|
|
|
|
|
(1+ blinkpos)))))))))
|
1992-07-17 06:48:03 +00:00
|
|
|
|
|
2002-03-04 02:14:31 +00:00
|
|
|
|
;; Why doesn't this use the iso-cvt table or, preferably, generate the
|
|
|
|
|
;; inverse of the extensive table in the SGML Quail input method? -- fx
|
|
|
|
|
;; I guess that's moot since it only works with Latin-1 anyhow.
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(defun sgml-name-char (&optional char)
|
|
|
|
|
"Insert a symbolic character name according to `sgml-char-names'.
|
2001-10-22 09:45:39 +00:00
|
|
|
|
Non-ASCII chars may be inserted either with the meta key, as in M-SPC for
|
|
|
|
|
no-break space or M-- for a soft hyphen; or via an input method or
|
|
|
|
|
encoded keyboard operation."
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(interactive "*")
|
|
|
|
|
(insert ?&)
|
|
|
|
|
(or char
|
1997-04-17 21:22:21 +00:00
|
|
|
|
(setq char (read-quoted-char "Enter char or octal number")))
|
Replace Lisp calls to delete-backward-char by delete-char.
* bs.el, expand.el, ido.el, image-dired.el, lpr.el, pcomplete.el,
skeleton.el, term.el, time.el, wid-edit.el, woman.el,
calc/calc-graph.el, calc/calc-help.el, calc/calc-incom.el,
calc/calc.el, emacs-cl-extra.el, emacs-cl-loaddefs.el,
emulation/cua-rect.el, emulation/viper-ex.el, eshell/esh-test.el,
eshell/eshell.el, gnus/gnus-uu.el, gnus/nndoc.el, gnus/nnrss.el,
gnus/rfc2047.el, gnus/utf7.el, international/utf-7.el,
language/ethio-util.el, mh-e/mh-alias.el, mh-e/mh-search.el,
net/imap.el, net/rcirc.el, obsolete/complete.el, play/decipher.el,
progmodes/ada-mode.el, progmodes/cc-awk.el, progmodes/dcl-mode.el,
progmodes/ps-mode.el, progmodes/verilog-mode.el,
progmodes/vhdl-mode.el, textmodes/bibtex.el, textmodes/fill.el,
textmodes/reftex-auc.el, textmodes/rst.el, textmodes/sgml-mode.el,
textmodes/table.el, textmodes/texinfmt.el: Replace Lisp calls to
delete-backward-char by calls to delete-char.
2010-05-24 22:11:08 -04:00
|
|
|
|
(delete-char -1)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(insert char)
|
|
|
|
|
(undo-boundary)
|
2002-11-12 16:46:19 +00:00
|
|
|
|
(sgml-namify-char))
|
|
|
|
|
|
|
|
|
|
(defun sgml-namify-char ()
|
|
|
|
|
"Change the char before point into its `&name;' equivalent.
|
|
|
|
|
Uses `sgml-char-names'."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let* ((char (char-before))
|
|
|
|
|
(name
|
|
|
|
|
(cond
|
|
|
|
|
((null char) (error "No char before point"))
|
|
|
|
|
((< char 256) (or (aref sgml-char-names char) char))
|
|
|
|
|
((aref sgml-char-names-table char))
|
|
|
|
|
((encode-char char 'ucs)))))
|
|
|
|
|
(if (not name)
|
|
|
|
|
(error "Don't know the name of `%c'" char)
|
Replace Lisp calls to delete-backward-char by delete-char.
* bs.el, expand.el, ido.el, image-dired.el, lpr.el, pcomplete.el,
skeleton.el, term.el, time.el, wid-edit.el, woman.el,
calc/calc-graph.el, calc/calc-help.el, calc/calc-incom.el,
calc/calc.el, emacs-cl-extra.el, emacs-cl-loaddefs.el,
emulation/cua-rect.el, emulation/viper-ex.el, eshell/esh-test.el,
eshell/eshell.el, gnus/gnus-uu.el, gnus/nndoc.el, gnus/nnrss.el,
gnus/rfc2047.el, gnus/utf7.el, international/utf-7.el,
language/ethio-util.el, mh-e/mh-alias.el, mh-e/mh-search.el,
net/imap.el, net/rcirc.el, obsolete/complete.el, play/decipher.el,
progmodes/ada-mode.el, progmodes/cc-awk.el, progmodes/dcl-mode.el,
progmodes/ps-mode.el, progmodes/verilog-mode.el,
progmodes/vhdl-mode.el, textmodes/bibtex.el, textmodes/fill.el,
textmodes/reftex-auc.el, textmodes/rst.el, textmodes/sgml-mode.el,
textmodes/table.el, textmodes/texinfmt.el: Replace Lisp calls to
delete-backward-char by calls to delete-char.
2010-05-24 22:11:08 -04:00
|
|
|
|
(delete-char -1)
|
2002-11-12 16:46:19 +00:00
|
|
|
|
(insert (format (if (numberp name) "&#%d;" "&%s;") name)))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(defun sgml-name-self ()
|
|
|
|
|
"Insert a symbolic character name according to `sgml-char-names'."
|
|
|
|
|
(interactive "*")
|
2009-01-09 04:23:38 +00:00
|
|
|
|
(sgml-name-char last-command-event))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(defun sgml-maybe-name-self ()
|
|
|
|
|
"Insert a symbolic character name according to `sgml-char-names'."
|
|
|
|
|
(interactive "*")
|
|
|
|
|
(if sgml-name-8bit-mode
|
2010-01-21 09:03:10 -05:00
|
|
|
|
(sgml-name-char last-command-event)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(self-insert-command 1)))
|
|
|
|
|
|
|
|
|
|
(defun sgml-name-8bit-mode ()
|
2002-03-04 02:14:31 +00:00
|
|
|
|
"Toggle whether to insert named entities instead of non-ASCII characters.
|
|
|
|
|
This only works for Latin-1 input."
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(interactive)
|
1997-04-23 18:58:33 +00:00
|
|
|
|
(setq sgml-name-8bit-mode (not sgml-name-8bit-mode))
|
2001-10-22 09:45:39 +00:00
|
|
|
|
(message "sgml name entity mode is now %s"
|
1997-04-23 18:58:33 +00:00
|
|
|
|
(if sgml-name-8bit-mode "ON" "OFF")))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
1997-04-24 19:37:13 +00:00
|
|
|
|
;; When an element of a skeleton is a string "str", it is passed
|
2006-05-21 22:19:59 +00:00
|
|
|
|
;; through `skeleton-transformation-function' and inserted.
|
|
|
|
|
;; If "str" is to be inserted literally, one should obtain it as
|
|
|
|
|
;; the return value of a function, e.g. (identity "str").
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
2002-11-12 16:46:19 +00:00
|
|
|
|
(defvar sgml-tag-last nil)
|
|
|
|
|
(defvar sgml-tag-history nil)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(define-skeleton sgml-tag
|
1997-04-24 19:37:13 +00:00
|
|
|
|
"Prompt for a tag and insert it, optionally with attributes.
|
|
|
|
|
Completion and configuration are done according to `sgml-tag-alist'.
|
2013-02-21 21:01:32 -05:00
|
|
|
|
If you like tags and attributes in uppercase, customize
|
2015-11-17 15:28:50 -08:00
|
|
|
|
`sgml-transformation-function' to `upcase'."
|
2006-05-21 22:19:59 +00:00
|
|
|
|
(funcall (or skeleton-transformation-function 'identity)
|
2002-11-12 16:46:19 +00:00
|
|
|
|
(setq sgml-tag-last
|
|
|
|
|
(completing-read
|
|
|
|
|
(if (> (length sgml-tag-last) 0)
|
Use `format-prompt' when prompting with default values
* lisp/woman.el (woman-file-name):
* lisp/wid-edit.el (widget-file-prompt-value)
(widget-coding-system-prompt-value):
* lisp/w32-fns.el (w32-set-system-coding-system):
* lisp/vc/vc.el (vc-print-root-log):
* lisp/vc/vc-annotate.el (vc-annotate):
* lisp/vc/emerge.el (emerge-read-file-name):
* lisp/vc/ediff.el (ediff-directories)
(ediff-directory-revisions, ediff-directories3)
(ediff-merge-directories, )
(ediff-merge-directories-with-ancestor)
(ediff-merge-directory-revisions)
(ediff-merge-directory-revisions-with-ancestor)
(ediff-merge-revisions, ediff-merge-revisions-with-ancestor)
(ediff-revision):
* lisp/vc/ediff-util.el (ediff-toggle-regexp-match):
* lisp/vc/ediff-mult.el (ediff-filegroup-action):
* lisp/vc/add-log.el (prompt-for-change-log-name):
* lisp/textmodes/table.el (table-insert-row-column)
(table-span-cell, table-split-cell-horizontally)
(table-split-cell, table-justify, table-generate-source)
(table-insert-sequence, table-capture)
(table--read-from-minibuffer, table--query-justification):
* lisp/textmodes/sgml-mode.el (sgml-tag, sgml-tag-help):
* lisp/textmodes/reftex-ref.el (reftex-goto-label):
* lisp/textmodes/refer.el (refer-get-bib-files):
* lisp/textmodes/css-mode.el (css-lookup-symbol):
* lisp/term.el (serial-read-name, serial-read-speed):
* lisp/speedbar.el (speedbar-change-initial-expansion-list):
* lisp/simple.el (previous-matching-history-element)
(set-variable):
* lisp/ses.el (ses-read-cell, ses-set-column-width):
* lisp/replace.el (query-replace-read-from)
(occur-read-primary-args):
* lisp/rect.el (string-rectangle, string-insert-rectangle):
* lisp/progmodes/tcl.el (tcl-help-on-word):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/python.el (python-eldoc-at-point):
* lisp/progmodes/octave.el (octave-completing-read)
(octave-update-function-file-comment, octave-insert-defun):
* lisp/progmodes/inf-lisp.el (lisp-symprompt):
* lisp/progmodes/cperl-mode.el (cperl-info-on-command)
(cperl-perldoc):
* lisp/progmodes/compile.el (compilation-find-file):
* lisp/net/rcirc.el (rcirc-prompt-for-encryption):
* lisp/net/eww.el (eww):
* lisp/net/browse-url.el (browse-url-with-browser-kind):
* lisp/man.el (man):
* lisp/mail/sendmail.el (sendmail-query-user-about-smtp):
* lisp/mail/mailalias.el (build-mail-aliases):
* lisp/mail/mailabbrev.el (merge-mail-abbrevs)
(rebuild-mail-abbrevs):
* lisp/locate.el (locate-prompt-for-search-string):
* lisp/isearch.el (isearch-occur):
* lisp/international/ogonek.el (ogonek-read-encoding)
(ogonek-read-prefix):
* lisp/international/mule.el (read-buffer-file-coding-system)
(set-terminal-coding-system, set-keyboard-coding-system)
(set-next-selection-coding-system, recode-region):
* lisp/international/mule-cmds.el ()
(universal-coding-system-argument, search-unencodable-char)
(select-safe-coding-system-interactively):
* lisp/info.el (Info-search, Info-search-backward, Info-menu):
* lisp/info-look.el (info-lookup-interactive-arguments):
* lisp/imenu.el (imenu--completion-buffer):
* lisp/ibuf-ext.el (mode, used-mode, ibuffer-mark-by-mode):
* lisp/hi-lock.el (hi-lock-unface-buffer)
(hi-lock-read-face-name):
* lisp/help.el (view-emacs-news, where-is):
* lisp/help-fns.el (describe-variable, describe-symbol)
(describe-keymap):
* lisp/gnus/mm-decode.el (mm-save-part):
* lisp/gnus/gnus-sum.el (gnus-summary-browse-url):
* lisp/gnus/gnus-group.el (gnus-group--read-bug-ids)
(gnus-group-set-current-level):
* lisp/frame.el (make-frame-on-monitor)
(close-display-connection, select-frame-by-name):
* lisp/format.el (format-encode-buffer, format-encode-region):
* lisp/files.el (recode-file-name):
* lisp/files-x.el (read-file-local-variable)
(read-file-local-variable-value, )
(read-file-local-variable-mode):
* lisp/ffap.el (ffap-menu-ask):
* lisp/faces.el (face-read-string):
* lisp/facemenu.el (facemenu-set-charset):
* lisp/erc/erc-dcc.el (erc-dcc-do-GET-command):
* lisp/emulation/edt-mapper.el (edt-mapper):
* lisp/emacs-lisp/trace.el (trace--read-args)
(trace-function-foreground, trace-function-background):
* lisp/emacs-lisp/smie.el (smie-config-set-indent):
* lisp/emacs-lisp/re-builder.el (reb-change-syntax):
* lisp/emacs-lisp/package.el (describe-package):
* lisp/emacs-lisp/find-func.el (read-library-name)
(find-function-read):
* lisp/emacs-lisp/ert.el (ert-read-test-name)
(ert-run-tests-interactively):
* lisp/emacs-lisp/disass.el (disassemble):
* lisp/emacs-lisp/debug.el (debug-on-entry)
(debug-on-variable-change):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-read-regexp):
* lisp/dired-x.el (dired--mark-suffix-interactive-spec):
* lisp/dired-aux.el (dired-diff):
* lisp/cus-edit.el (custom-variable-prompt, customize-mode)
(customize-changed-options):
* lisp/completion.el (interactive-completion-string-reader):
* lisp/calendar/timeclock.el (timeclock-ask-for-project):
* lisp/calc/calcalg3.el (calc-get-fit-variables):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-bin.el (calc-word-size):
* lisp/bookmark.el (bookmark-set-internal):
* lisp/abbrev.el (read-abbrev-file): Use `format-prompt' for
prompting (bug#12443).
2020-09-06 16:56:44 +02:00
|
|
|
|
(format-prompt "Tag" sgml-tag-last)
|
2002-11-12 16:46:19 +00:00
|
|
|
|
"Tag: ")
|
|
|
|
|
sgml-tag-alist nil nil nil 'sgml-tag-history sgml-tag-last)))
|
2001-03-07 00:03:50 +00:00
|
|
|
|
?< str |
|
1997-04-23 18:58:33 +00:00
|
|
|
|
(("") -1 '(undo-boundary) (identity "<")) | ; see comment above
|
2001-10-28 04:10:40 +00:00
|
|
|
|
`(("") '(setq v2 (sgml-attributes ,str t)) ?>
|
|
|
|
|
(cond
|
|
|
|
|
((string= "![" ,str)
|
|
|
|
|
(backward-char)
|
|
|
|
|
'(("") " [ " _ " ]]"))
|
2002-03-17 23:55:15 +00:00
|
|
|
|
((and (eq v2 t) sgml-xml-mode (member ,str sgml-empty-tags))
|
2005-03-08 21:45:00 +00:00
|
|
|
|
'(("") -1 " />"))
|
2002-03-17 23:55:15 +00:00
|
|
|
|
((or (and (eq v2 t) (not sgml-xml-mode)) (string-match "^[/!?]" ,str))
|
2001-10-28 04:10:40 +00:00
|
|
|
|
nil)
|
|
|
|
|
((symbolp v2)
|
|
|
|
|
;; Make sure we don't fall into an infinite loop.
|
|
|
|
|
;; For xhtml's `tr' tag, we should maybe use \n instead.
|
|
|
|
|
(if (eq v2 t) (setq v2 nil))
|
|
|
|
|
;; We use `identity' to prevent skeleton from passing
|
2006-05-21 22:19:59 +00:00
|
|
|
|
;; `str' through `skeleton-transformation-function' a second time.
|
2012-11-26 00:07:58 +08:00
|
|
|
|
'(("") v2 _ v2 "</" (identity ',str) ?> >))
|
2001-10-28 04:10:40 +00:00
|
|
|
|
((eq (car v2) t)
|
|
|
|
|
(cons '("") (cdr v2)))
|
|
|
|
|
(t
|
|
|
|
|
(append '(("") (car v2))
|
|
|
|
|
(cdr v2)
|
2012-11-26 00:07:58 +08:00
|
|
|
|
'(resume: (car v2) _ "</" (identity ',str) ?> >))))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(autoload 'skeleton-read "skeleton")
|
|
|
|
|
|
1997-04-23 18:58:33 +00:00
|
|
|
|
(defun sgml-attributes (tag &optional quiet)
|
1997-04-24 19:37:13 +00:00
|
|
|
|
"When at top level of a tag, interactively insert attributes.
|
1997-04-23 18:58:33 +00:00
|
|
|
|
|
1997-04-24 19:37:13 +00:00
|
|
|
|
Completion and configuration of TAG are done according to `sgml-tag-alist'.
|
|
|
|
|
If QUIET, do not print a message when there are no attributes for TAG."
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(interactive (list (save-excursion (sgml-beginning-of-tag t))))
|
1997-04-23 18:58:33 +00:00
|
|
|
|
(or (stringp tag) (error "Wrong context for adding attribute"))
|
|
|
|
|
(if tag
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(let ((completion-ignore-case t)
|
1997-04-23 18:58:33 +00:00
|
|
|
|
(alist (cdr (assoc (downcase tag) sgml-tag-alist)))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
car attribute i)
|
|
|
|
|
(if (or (symbolp (car alist))
|
|
|
|
|
(symbolp (car (car alist))))
|
|
|
|
|
(setq car (car alist)
|
|
|
|
|
alist (cdr alist)))
|
2019-04-30 16:00:46 -07:00
|
|
|
|
(unless (or alist quiet)
|
|
|
|
|
(message "No attributes configured."))
|
|
|
|
|
(when alist
|
|
|
|
|
;; Add class and id attributes if a) the element has any
|
|
|
|
|
;; other attributes configured, and b) they're not already
|
|
|
|
|
;; present.
|
|
|
|
|
(unless (assoc-string "class" alist)
|
|
|
|
|
(setq alist (cons '("class") alist)))
|
|
|
|
|
(unless (assoc-string "id" alist)
|
|
|
|
|
(setq alist (cons '("id") alist))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(if (stringp (car alist))
|
|
|
|
|
(progn
|
2005-07-04 03:37:24 +00:00
|
|
|
|
(insert (if (eq (preceding-char) ?\s) "" ?\s)
|
2006-05-21 22:19:59 +00:00
|
|
|
|
(funcall skeleton-transformation-function (car alist)))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(sgml-value alist))
|
|
|
|
|
(setq i (length alist))
|
|
|
|
|
(while (> i 0)
|
2005-07-04 03:37:24 +00:00
|
|
|
|
(insert ?\s)
|
2006-05-21 22:19:59 +00:00
|
|
|
|
(insert (funcall skeleton-transformation-function
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(setq attribute
|
2015-07-23 18:09:44 +02:00
|
|
|
|
(skeleton-read (lambda ()
|
|
|
|
|
(completing-read
|
|
|
|
|
"Attribute: "
|
|
|
|
|
alist))))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(if (string= "" attribute)
|
|
|
|
|
(setq i 0)
|
1998-02-17 20:08:22 +00:00
|
|
|
|
(sgml-value (assoc (downcase attribute) alist))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(setq i (1- i))))
|
2005-07-04 03:37:24 +00:00
|
|
|
|
(if (eq (preceding-char) ?\s)
|
Replace Lisp calls to delete-backward-char by delete-char.
* bs.el, expand.el, ido.el, image-dired.el, lpr.el, pcomplete.el,
skeleton.el, term.el, time.el, wid-edit.el, woman.el,
calc/calc-graph.el, calc/calc-help.el, calc/calc-incom.el,
calc/calc.el, emacs-cl-extra.el, emacs-cl-loaddefs.el,
emulation/cua-rect.el, emulation/viper-ex.el, eshell/esh-test.el,
eshell/eshell.el, gnus/gnus-uu.el, gnus/nndoc.el, gnus/nnrss.el,
gnus/rfc2047.el, gnus/utf7.el, international/utf-7.el,
language/ethio-util.el, mh-e/mh-alias.el, mh-e/mh-search.el,
net/imap.el, net/rcirc.el, obsolete/complete.el, play/decipher.el,
progmodes/ada-mode.el, progmodes/cc-awk.el, progmodes/dcl-mode.el,
progmodes/ps-mode.el, progmodes/verilog-mode.el,
progmodes/vhdl-mode.el, textmodes/bibtex.el, textmodes/fill.el,
textmodes/reftex-auc.el, textmodes/rst.el, textmodes/sgml-mode.el,
textmodes/table.el, textmodes/texinfmt.el: Replace Lisp calls to
delete-backward-char by calls to delete-char.
2010-05-24 22:11:08 -04:00
|
|
|
|
(delete-char -1)))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
car)))
|
|
|
|
|
|
|
|
|
|
(defun sgml-auto-attributes (arg)
|
1997-04-24 19:37:13 +00:00
|
|
|
|
"Self insert the character typed; at top level of tag, prompt for attributes.
|
|
|
|
|
With prefix argument, only self insert."
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(interactive "*P")
|
|
|
|
|
(let ((point (point))
|
|
|
|
|
tag)
|
|
|
|
|
(if (or arg
|
|
|
|
|
(not sgml-tag-alist) ; no message when nothing configured
|
|
|
|
|
(symbolp (setq tag (save-excursion (sgml-beginning-of-tag t))))
|
|
|
|
|
(eq (aref tag 0) ?/))
|
|
|
|
|
(self-insert-command (prefix-numeric-value arg))
|
|
|
|
|
(sgml-attributes tag)
|
2009-01-09 04:23:38 +00:00
|
|
|
|
(setq last-command-event ?\s)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(or (> (point) point)
|
|
|
|
|
(self-insert-command 1)))))
|
|
|
|
|
|
|
|
|
|
(defun sgml-tag-help (&optional tag)
|
1997-04-24 19:37:13 +00:00
|
|
|
|
"Display description of tag TAG. If TAG is omitted, use the tag at point."
|
2009-10-18 04:06:32 +00:00
|
|
|
|
(interactive
|
|
|
|
|
(list (let ((def (save-excursion
|
|
|
|
|
(if (eq (following-char) ?<) (forward-char))
|
|
|
|
|
(sgml-beginning-of-tag))))
|
Use `format-prompt' when prompting with default values
* lisp/woman.el (woman-file-name):
* lisp/wid-edit.el (widget-file-prompt-value)
(widget-coding-system-prompt-value):
* lisp/w32-fns.el (w32-set-system-coding-system):
* lisp/vc/vc.el (vc-print-root-log):
* lisp/vc/vc-annotate.el (vc-annotate):
* lisp/vc/emerge.el (emerge-read-file-name):
* lisp/vc/ediff.el (ediff-directories)
(ediff-directory-revisions, ediff-directories3)
(ediff-merge-directories, )
(ediff-merge-directories-with-ancestor)
(ediff-merge-directory-revisions)
(ediff-merge-directory-revisions-with-ancestor)
(ediff-merge-revisions, ediff-merge-revisions-with-ancestor)
(ediff-revision):
* lisp/vc/ediff-util.el (ediff-toggle-regexp-match):
* lisp/vc/ediff-mult.el (ediff-filegroup-action):
* lisp/vc/add-log.el (prompt-for-change-log-name):
* lisp/textmodes/table.el (table-insert-row-column)
(table-span-cell, table-split-cell-horizontally)
(table-split-cell, table-justify, table-generate-source)
(table-insert-sequence, table-capture)
(table--read-from-minibuffer, table--query-justification):
* lisp/textmodes/sgml-mode.el (sgml-tag, sgml-tag-help):
* lisp/textmodes/reftex-ref.el (reftex-goto-label):
* lisp/textmodes/refer.el (refer-get-bib-files):
* lisp/textmodes/css-mode.el (css-lookup-symbol):
* lisp/term.el (serial-read-name, serial-read-speed):
* lisp/speedbar.el (speedbar-change-initial-expansion-list):
* lisp/simple.el (previous-matching-history-element)
(set-variable):
* lisp/ses.el (ses-read-cell, ses-set-column-width):
* lisp/replace.el (query-replace-read-from)
(occur-read-primary-args):
* lisp/rect.el (string-rectangle, string-insert-rectangle):
* lisp/progmodes/tcl.el (tcl-help-on-word):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/python.el (python-eldoc-at-point):
* lisp/progmodes/octave.el (octave-completing-read)
(octave-update-function-file-comment, octave-insert-defun):
* lisp/progmodes/inf-lisp.el (lisp-symprompt):
* lisp/progmodes/cperl-mode.el (cperl-info-on-command)
(cperl-perldoc):
* lisp/progmodes/compile.el (compilation-find-file):
* lisp/net/rcirc.el (rcirc-prompt-for-encryption):
* lisp/net/eww.el (eww):
* lisp/net/browse-url.el (browse-url-with-browser-kind):
* lisp/man.el (man):
* lisp/mail/sendmail.el (sendmail-query-user-about-smtp):
* lisp/mail/mailalias.el (build-mail-aliases):
* lisp/mail/mailabbrev.el (merge-mail-abbrevs)
(rebuild-mail-abbrevs):
* lisp/locate.el (locate-prompt-for-search-string):
* lisp/isearch.el (isearch-occur):
* lisp/international/ogonek.el (ogonek-read-encoding)
(ogonek-read-prefix):
* lisp/international/mule.el (read-buffer-file-coding-system)
(set-terminal-coding-system, set-keyboard-coding-system)
(set-next-selection-coding-system, recode-region):
* lisp/international/mule-cmds.el ()
(universal-coding-system-argument, search-unencodable-char)
(select-safe-coding-system-interactively):
* lisp/info.el (Info-search, Info-search-backward, Info-menu):
* lisp/info-look.el (info-lookup-interactive-arguments):
* lisp/imenu.el (imenu--completion-buffer):
* lisp/ibuf-ext.el (mode, used-mode, ibuffer-mark-by-mode):
* lisp/hi-lock.el (hi-lock-unface-buffer)
(hi-lock-read-face-name):
* lisp/help.el (view-emacs-news, where-is):
* lisp/help-fns.el (describe-variable, describe-symbol)
(describe-keymap):
* lisp/gnus/mm-decode.el (mm-save-part):
* lisp/gnus/gnus-sum.el (gnus-summary-browse-url):
* lisp/gnus/gnus-group.el (gnus-group--read-bug-ids)
(gnus-group-set-current-level):
* lisp/frame.el (make-frame-on-monitor)
(close-display-connection, select-frame-by-name):
* lisp/format.el (format-encode-buffer, format-encode-region):
* lisp/files.el (recode-file-name):
* lisp/files-x.el (read-file-local-variable)
(read-file-local-variable-value, )
(read-file-local-variable-mode):
* lisp/ffap.el (ffap-menu-ask):
* lisp/faces.el (face-read-string):
* lisp/facemenu.el (facemenu-set-charset):
* lisp/erc/erc-dcc.el (erc-dcc-do-GET-command):
* lisp/emulation/edt-mapper.el (edt-mapper):
* lisp/emacs-lisp/trace.el (trace--read-args)
(trace-function-foreground, trace-function-background):
* lisp/emacs-lisp/smie.el (smie-config-set-indent):
* lisp/emacs-lisp/re-builder.el (reb-change-syntax):
* lisp/emacs-lisp/package.el (describe-package):
* lisp/emacs-lisp/find-func.el (read-library-name)
(find-function-read):
* lisp/emacs-lisp/ert.el (ert-read-test-name)
(ert-run-tests-interactively):
* lisp/emacs-lisp/disass.el (disassemble):
* lisp/emacs-lisp/debug.el (debug-on-entry)
(debug-on-variable-change):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-read-regexp):
* lisp/dired-x.el (dired--mark-suffix-interactive-spec):
* lisp/dired-aux.el (dired-diff):
* lisp/cus-edit.el (custom-variable-prompt, customize-mode)
(customize-changed-options):
* lisp/completion.el (interactive-completion-string-reader):
* lisp/calendar/timeclock.el (timeclock-ask-for-project):
* lisp/calc/calcalg3.el (calc-get-fit-variables):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-bin.el (calc-word-size):
* lisp/bookmark.el (bookmark-set-internal):
* lisp/abbrev.el (read-abbrev-file): Use `format-prompt' for
prompting (bug#12443).
2020-09-06 16:56:44 +02:00
|
|
|
|
(completing-read (format-prompt "Tag" def)
|
2009-10-18 04:06:32 +00:00
|
|
|
|
sgml-tag-alist nil nil nil
|
|
|
|
|
'sgml-tag-history def))))
|
|
|
|
|
(or (and tag (> (length tag) 0))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(if (eq (following-char) ?<)
|
|
|
|
|
(forward-char))
|
|
|
|
|
(setq tag (sgml-beginning-of-tag))))
|
|
|
|
|
(or (stringp tag)
|
|
|
|
|
(error "No tag selected"))
|
|
|
|
|
(setq tag (downcase tag))
|
1996-01-25 00:57:01 +00:00
|
|
|
|
(message "%s"
|
1998-02-17 20:08:22 +00:00
|
|
|
|
(or (cdr (assoc (downcase tag) sgml-tag-help))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(and (eq (aref tag 0) ?/)
|
1998-02-17 20:08:22 +00:00
|
|
|
|
(cdr (assoc (downcase (substring tag 1)) sgml-tag-help)))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"No description available")))
|
|
|
|
|
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(defun sgml-maybe-end-tag (&optional arg)
|
|
|
|
|
"Name self unless in position to end a tag or a prefix ARG is given."
|
|
|
|
|
(interactive "P")
|
|
|
|
|
(if (or arg (eq (car (sgml-lexical-context)) 'tag))
|
|
|
|
|
(self-insert-command (prefix-numeric-value arg))
|
|
|
|
|
(sgml-name-self)))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(defun sgml-skip-tag-backward (arg)
|
|
|
|
|
"Skip to beginning of tag or matching opening tag if present.
|
2007-06-17 13:55:17 +00:00
|
|
|
|
With prefix argument ARG, repeat this ARG times.
|
|
|
|
|
Return non-nil if we skipped over matched tags."
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(interactive "p")
|
2002-11-12 16:46:19 +00:00
|
|
|
|
;; FIXME: use sgml-get-context or something similar.
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(let ((return t))
|
|
|
|
|
(while (>= arg 1)
|
|
|
|
|
(search-backward "<" nil t)
|
|
|
|
|
(if (looking-at "</\\([^ \n\t>]+\\)")
|
|
|
|
|
;; end tag, skip any nested pairs
|
|
|
|
|
(let ((case-fold-search t)
|
|
|
|
|
(re (concat "</?" (regexp-quote (match-string 1))
|
|
|
|
|
;; Ignore empty tags like <foo/>.
|
|
|
|
|
"\\([^>]*[^/>]\\)?>")))
|
|
|
|
|
(while (and (re-search-backward re nil t)
|
|
|
|
|
(eq (char-after (1+ (point))) ?/))
|
|
|
|
|
(forward-char 1)
|
|
|
|
|
(sgml-skip-tag-backward 1)))
|
|
|
|
|
(setq return nil))
|
|
|
|
|
(setq arg (1- arg)))
|
|
|
|
|
return))
|
|
|
|
|
|
2016-01-25 10:54:02 -05:00
|
|
|
|
(defun sgml-forward-sexp (n)
|
|
|
|
|
;; This function is needed in major-modes such as nxml-mode where
|
|
|
|
|
;; forward-sexp-function is used to give a more dwimish behavior to
|
|
|
|
|
;; the `forward-sexp' command.
|
|
|
|
|
;; Without it, we can end up with backtraces like:
|
|
|
|
|
;; "get-text-property" (0xffffc0f0)
|
|
|
|
|
;; "nxml-token-after" (0xffffc2ac)
|
|
|
|
|
;; "nxml-forward-single-balanced-item" (0xffffc46c)
|
|
|
|
|
;; "nxml-forward-balanced-item" (0xffffc61c)
|
|
|
|
|
;; "forward-sexp" (0xffffc7f8)
|
|
|
|
|
;; "sgml-parse-tag-backward" (0xffffc9c8)
|
|
|
|
|
;; "sgml-lexical-context" (0xffffcba8)
|
|
|
|
|
;; "sgml-mode-flyspell-verify" (0xffffcd74)
|
|
|
|
|
;; "flyspell-word" (0xffffcf3c)
|
|
|
|
|
;; "flyspell-post-command-hook" (0xffffd108)
|
|
|
|
|
;; FIXME: should we also set the sgml-tag-syntax-table?
|
|
|
|
|
(let ((forward-sexp-function nil))
|
|
|
|
|
(forward-sexp n)))
|
|
|
|
|
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(defvar sgml-electric-tag-pair-overlays nil)
|
|
|
|
|
(defvar sgml-electric-tag-pair-timer nil)
|
|
|
|
|
|
Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
(defun sgml-electric-tag-pair-before-change-function (_beg end)
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(condition-case err
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char end)
|
2019-03-19 18:45:17 -07:00
|
|
|
|
(skip-chars-backward "-[:alnum:]_.:")
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(if (and ;; (<= (point) beg) ; This poses problems for downcase-word.
|
|
|
|
|
(or (eq (char-before) ?<)
|
|
|
|
|
(and (eq (char-before) ?/)
|
|
|
|
|
(eq (char-before (1- (point))) ?<)))
|
|
|
|
|
(null (get-char-property (point) 'text-clones)))
|
|
|
|
|
(let* ((endp (eq (char-before) ?/))
|
|
|
|
|
(cl-start (point))
|
2019-03-19 18:45:17 -07:00
|
|
|
|
(cl-end (progn (skip-chars-forward "-[:alnum:]_.:") (point)))
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(match
|
|
|
|
|
(if endp
|
|
|
|
|
(when (sgml-skip-tag-backward 1) (forward-char 1) t)
|
|
|
|
|
(with-syntax-table sgml-tag-syntax-table
|
2016-01-16 10:43:19 -05:00
|
|
|
|
(let ((forward-sexp-function nil))
|
|
|
|
|
(up-list -1)
|
|
|
|
|
(when (sgml-skip-tag-forward 1)
|
|
|
|
|
(backward-sexp 1)
|
|
|
|
|
(forward-char 2)
|
|
|
|
|
t)))))
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(clones (get-char-property (point) 'text-clones)))
|
|
|
|
|
(when (and match
|
|
|
|
|
(/= cl-end cl-start)
|
|
|
|
|
(equal (buffer-substring cl-start cl-end)
|
|
|
|
|
(buffer-substring (point)
|
|
|
|
|
(save-excursion
|
2019-03-19 18:45:17 -07:00
|
|
|
|
(skip-chars-forward
|
|
|
|
|
"-[:alnum:]_.:")
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(point))))
|
|
|
|
|
(or (not endp) (eq (char-after cl-end) ?>)))
|
|
|
|
|
(when clones
|
|
|
|
|
(message "sgml-electric-tag-pair-before-change-function: deleting old OLs")
|
|
|
|
|
(mapc 'delete-overlay clones))
|
|
|
|
|
(message "sgml-electric-tag-pair-before-change-function: new clone")
|
|
|
|
|
(text-clone-create cl-start cl-end 'spread "[[:alnum:]-_.:]+")
|
|
|
|
|
(setq sgml-electric-tag-pair-overlays
|
|
|
|
|
(append (get-char-property (point) 'text-clones)
|
|
|
|
|
sgml-electric-tag-pair-overlays))))))
|
|
|
|
|
(scan-error nil)
|
|
|
|
|
(error (message "Error in sgml-electric-pair-mode: %s" err))))
|
|
|
|
|
|
|
|
|
|
(defun sgml-electric-tag-pair-flush-overlays ()
|
|
|
|
|
(while sgml-electric-tag-pair-overlays
|
|
|
|
|
(delete-overlay (pop sgml-electric-tag-pair-overlays))))
|
|
|
|
|
|
|
|
|
|
(define-minor-mode sgml-electric-tag-pair-mode
|
2011-10-19 20:26:14 -04:00
|
|
|
|
"Toggle SGML Electric Tag Pair mode.
|
|
|
|
|
|
|
|
|
|
SGML Electric Tag Pair mode is a buffer-local minor mode for use
|
2011-11-19 01:18:31 -08:00
|
|
|
|
with `sgml-mode' and related major modes. When enabled, editing
|
2011-10-19 20:26:14 -04:00
|
|
|
|
an opening markup tag automatically updates the closing tag."
|
2007-06-17 13:55:17 +00:00
|
|
|
|
:lighter "/e"
|
|
|
|
|
(if sgml-electric-tag-pair-mode
|
|
|
|
|
(progn
|
|
|
|
|
(add-hook 'before-change-functions
|
|
|
|
|
'sgml-electric-tag-pair-before-change-function
|
|
|
|
|
nil t)
|
|
|
|
|
(unless sgml-electric-tag-pair-timer
|
|
|
|
|
(setq sgml-electric-tag-pair-timer
|
|
|
|
|
(run-with-idle-timer 5 'repeat 'sgml-electric-tag-pair-flush-overlays))))
|
|
|
|
|
(remove-hook 'before-change-functions
|
|
|
|
|
'sgml-electric-tag-pair-before-change-function
|
|
|
|
|
t)
|
|
|
|
|
;; We leave the timer running for other buffers.
|
|
|
|
|
))
|
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
2002-11-01 17:41:41 +00:00
|
|
|
|
(defun sgml-skip-tag-forward (arg)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"Skip to end of tag or matching closing tag if present.
|
1997-04-24 19:37:13 +00:00
|
|
|
|
With prefix argument ARG, repeat this ARG times.
|
2007-08-08 07:27:21 +00:00
|
|
|
|
Return t if after a closing tag."
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(interactive "p")
|
2002-11-12 16:46:19 +00:00
|
|
|
|
;; FIXME: Use sgml-get-context or something similar.
|
|
|
|
|
;; It currently might jump to an unrelated </P> if the <P>
|
|
|
|
|
;; we're skipping has no matching </P>.
|
2002-11-01 17:41:41 +00:00
|
|
|
|
(let ((return t))
|
2002-11-12 16:46:19 +00:00
|
|
|
|
(with-syntax-table sgml-tag-syntax-table
|
|
|
|
|
(while (>= arg 1)
|
|
|
|
|
(skip-chars-forward "^<>")
|
|
|
|
|
(if (eq (following-char) ?>)
|
|
|
|
|
(up-list -1))
|
|
|
|
|
(if (looking-at "<\\([^/ \n\t>]+\\)\\([^>]*[^/>]\\)?>")
|
|
|
|
|
;; start tag, skip any nested same pairs _and_ closing tag
|
|
|
|
|
(let ((case-fold-search t)
|
|
|
|
|
(re (concat "</?" (regexp-quote (match-string 1))
|
|
|
|
|
;; Ignore empty tags like <foo/>.
|
|
|
|
|
"\\([^>]*[^/>]\\)?>"))
|
|
|
|
|
point close)
|
|
|
|
|
(forward-list 1)
|
|
|
|
|
(setq point (point))
|
|
|
|
|
;; FIXME: This re-search-forward will mistakenly match
|
|
|
|
|
;; tag-like text inside attributes.
|
|
|
|
|
(while (and (re-search-forward re nil t)
|
|
|
|
|
(not (setq close
|
|
|
|
|
(eq (char-after (1+ (match-beginning 0))) ?/)))
|
|
|
|
|
(goto-char (match-beginning 0))
|
|
|
|
|
(sgml-skip-tag-forward 1))
|
|
|
|
|
(setq close nil))
|
|
|
|
|
(unless close
|
|
|
|
|
(goto-char point)
|
|
|
|
|
(setq return nil)))
|
|
|
|
|
(forward-list 1))
|
|
|
|
|
(setq arg (1- arg)))
|
|
|
|
|
return)))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
2009-10-24 03:45:50 +00:00
|
|
|
|
(defsubst sgml-looking-back-at (str)
|
|
|
|
|
"Return t if the test before point matches STR."
|
|
|
|
|
(let ((start (- (point) (length str))))
|
|
|
|
|
(and (>= start (point-min))
|
|
|
|
|
(equal str (buffer-substring-no-properties start (point))))))
|
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(defun sgml-delete-tag (arg)
|
2002-11-12 16:46:19 +00:00
|
|
|
|
;; FIXME: Should be called sgml-kill-tag or should not touch the kill-ring.
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"Delete tag on or after cursor, and matching closing or opening tag.
|
1997-04-24 19:37:13 +00:00
|
|
|
|
With prefix argument ARG, repeat this ARG times."
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(interactive "p")
|
|
|
|
|
(while (>= arg 1)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* (close open)
|
1996-01-24 17:12:21 +00:00
|
|
|
|
(if (looking-at "[ \t\n]*<")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
;; just before tag
|
|
|
|
|
(if (eq (char-after (match-end 0)) ?/)
|
|
|
|
|
;; closing tag
|
|
|
|
|
(progn
|
|
|
|
|
(setq close (point))
|
|
|
|
|
(goto-char (match-end 0))))
|
|
|
|
|
;; on tag?
|
|
|
|
|
(or (save-excursion (setq close (sgml-beginning-of-tag)
|
|
|
|
|
close (and (stringp close)
|
|
|
|
|
(eq (aref close 0) ?/)
|
|
|
|
|
(point))))
|
|
|
|
|
;; not on closing tag
|
|
|
|
|
(let ((point (point)))
|
|
|
|
|
(sgml-skip-tag-backward 1)
|
|
|
|
|
(if (or (not (eq (following-char) ?<))
|
|
|
|
|
(save-excursion
|
|
|
|
|
(forward-list 1)
|
|
|
|
|
(<= (point) point)))
|
|
|
|
|
(error "Not on or before tag")))))
|
|
|
|
|
(if close
|
|
|
|
|
(progn
|
|
|
|
|
(sgml-skip-tag-backward 1)
|
|
|
|
|
(setq open (point))
|
|
|
|
|
(goto-char close)
|
|
|
|
|
(kill-sexp 1))
|
|
|
|
|
(setq open (point))
|
2005-03-08 21:45:00 +00:00
|
|
|
|
(when (and (sgml-skip-tag-forward 1)
|
2009-10-18 22:25:36 +00:00
|
|
|
|
(not (sgml-looking-back-at "/>")))
|
2002-11-12 16:46:19 +00:00
|
|
|
|
(kill-sexp -1)))
|
|
|
|
|
;; Delete any resulting empty line. If we didn't kill-sexp,
|
|
|
|
|
;; this *should* do nothing, because we're right after the tag.
|
|
|
|
|
(if (progn (forward-line 0) (looking-at "\\(?:[ \t]*$\\)\n?"))
|
|
|
|
|
(delete-region (match-beginning 0) (match-end 0)))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(goto-char open)
|
2002-11-12 16:46:19 +00:00
|
|
|
|
(kill-sexp 1)
|
|
|
|
|
(if (progn (forward-line 0) (looking-at "\\(?:[ \t]*$\\)\n?"))
|
|
|
|
|
(delete-region (match-beginning 0) (match-end 0)))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(setq arg (1- arg))))
|
2002-04-09 12:02:20 +00:00
|
|
|
|
|
1997-04-16 21:43:01 +00:00
|
|
|
|
|
|
|
|
|
;; Put read-only last to enable setting this even when read-only enabled.
|
|
|
|
|
(or (get 'sgml-tag 'invisible)
|
|
|
|
|
(setplist 'sgml-tag
|
|
|
|
|
(append '(invisible t
|
Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
cursor-sensor-functions (sgml-cursor-sensor)
|
1997-04-16 21:43:01 +00:00
|
|
|
|
rear-nonsticky t
|
|
|
|
|
read-only t)
|
|
|
|
|
(symbol-plist 'sgml-tag))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(defun sgml-tags-invisible (arg)
|
|
|
|
|
"Toggle visibility of existing tags."
|
|
|
|
|
(interactive "P")
|
Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
(let ((inhibit-read-only t)
|
2001-10-25 22:25:30 +00:00
|
|
|
|
string)
|
Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
(with-silent-modifications
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(if (setq-local sgml-tags-invisible
|
|
|
|
|
(if arg
|
|
|
|
|
(>= (prefix-numeric-value arg) 0)
|
|
|
|
|
(not sgml-tags-invisible)))
|
|
|
|
|
(while (re-search-forward sgml-tag-name-re nil t)
|
|
|
|
|
(setq string
|
|
|
|
|
(cdr (assq (intern-soft (downcase (match-string 1)))
|
|
|
|
|
sgml-display-text)))
|
|
|
|
|
(goto-char (match-beginning 0))
|
|
|
|
|
(and (stringp string)
|
|
|
|
|
(not (overlays-at (point)))
|
|
|
|
|
(let ((ol (make-overlay (point) (match-beginning 1))))
|
|
|
|
|
(overlay-put ol 'before-string string)
|
|
|
|
|
(overlay-put ol 'sgml-tag t)))
|
|
|
|
|
(put-text-property (point)
|
|
|
|
|
(progn (forward-list) (point))
|
|
|
|
|
'category 'sgml-tag))
|
|
|
|
|
(let ((pos (point-min)))
|
|
|
|
|
(while (< (setq pos (next-overlay-change pos)) (point-max))
|
|
|
|
|
(dolist (ol (overlays-at pos))
|
|
|
|
|
(if (overlay-get ol 'sgml-tag)
|
|
|
|
|
(delete-overlay ol)))))
|
|
|
|
|
(remove-text-properties (point-min) (point-max) '(category nil)))))
|
|
|
|
|
(cursor-sensor-mode (if sgml-tags-invisible 1 -1))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(run-hooks 'sgml-tags-invisible-hook)
|
|
|
|
|
(message "")))
|
|
|
|
|
|
Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
(defun sgml-cursor-sensor (window x dir)
|
|
|
|
|
;; Show preceding or following hidden tag, depending of cursor direction (and
|
|
|
|
|
;; `dir' is not the direction in this sense).
|
|
|
|
|
(when (eq dir 'entered)
|
|
|
|
|
(ignore-errors
|
|
|
|
|
(let* ((y (window-point window))
|
|
|
|
|
(otherend
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char y)
|
|
|
|
|
(cond
|
|
|
|
|
((and (eq (char-before) ?>)
|
|
|
|
|
(or (not (eq (char-after) ?<))
|
|
|
|
|
(> x y)))
|
2016-01-25 10:54:02 -05:00
|
|
|
|
(sgml-forward-sexp -1))
|
Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
((eq (char-after y) ?<)
|
2016-01-25 10:54:02 -05:00
|
|
|
|
(sgml-forward-sexp 1)))
|
Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
(point))))
|
|
|
|
|
(message "Invisible tag: %s"
|
|
|
|
|
;; Strip properties, otherwise, the text is invisible.
|
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
|
y otherend))))))
|
2002-04-09 12:02:20 +00:00
|
|
|
|
|
1997-04-16 21:43:01 +00:00
|
|
|
|
|
1992-07-17 06:48:03 +00:00
|
|
|
|
(defun sgml-validate (command)
|
|
|
|
|
"Validate an SGML document.
|
|
|
|
|
Runs COMMAND, a shell command, in a separate process asynchronously
|
1997-04-24 19:37:13 +00:00
|
|
|
|
with output going to the buffer `*compilation*'.
|
1992-07-17 06:48:03 +00:00
|
|
|
|
You can then use the command \\[next-error] to find the next error message
|
|
|
|
|
and move to the line in the SGML document that caused it."
|
|
|
|
|
(interactive
|
|
|
|
|
(list (read-string "Validate command: "
|
|
|
|
|
(or sgml-saved-validate-command
|
|
|
|
|
(concat sgml-validate-command
|
|
|
|
|
" "
|
2020-09-15 18:11:28 +02:00
|
|
|
|
(when-let ((name (buffer-file-name)))
|
|
|
|
|
(shell-quote-argument
|
|
|
|
|
(file-name-nondirectory name))))))))
|
1992-07-17 06:48:03 +00:00
|
|
|
|
(setq sgml-saved-validate-command command)
|
1998-12-31 14:40:03 +00:00
|
|
|
|
(save-some-buffers (not compilation-ask-about-save) nil)
|
2005-08-26 10:02:03 +00:00
|
|
|
|
(compilation-start command))
|
1992-07-17 06:48:03 +00:00
|
|
|
|
|
2002-04-16 10:38:30 +00:00
|
|
|
|
(defsubst sgml-at-indentation-p ()
|
2021-09-13 06:04:32 +02:00
|
|
|
|
"Return t if point is at the first non-whitespace character on the line."
|
2002-04-16 10:38:30 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(skip-chars-backward " \t")
|
|
|
|
|
(bolp)))
|
|
|
|
|
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(defun sgml-lexical-context (&optional limit)
|
|
|
|
|
"Return the lexical context at point as (TYPE . START).
|
|
|
|
|
START is the location of the start of the lexical element.
|
2007-05-08 06:57:38 +00:00
|
|
|
|
TYPE is one of `string', `comment', `tag', `cdata', `pi', or `text'.
|
2002-03-28 16:06:38 +00:00
|
|
|
|
|
2002-04-09 12:27:17 +00:00
|
|
|
|
Optional argument LIMIT is the position to start parsing from.
|
|
|
|
|
If nil, start from a preceding tag at indentation."
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((pos (point))
|
2002-04-03 21:17:38 +00:00
|
|
|
|
text-start state)
|
2002-04-09 12:27:17 +00:00
|
|
|
|
(if limit
|
|
|
|
|
(goto-char limit)
|
|
|
|
|
;; Skip tags backwards until we find one at indentation
|
|
|
|
|
(while (and (ignore-errors (sgml-parse-tag-backward))
|
|
|
|
|
(not (sgml-at-indentation-p)))))
|
2002-03-29 19:38:22 +00:00
|
|
|
|
(with-syntax-table sgml-tag-syntax-table
|
|
|
|
|
(while (< (point) pos)
|
|
|
|
|
;; When entering this loop we're inside text.
|
2002-04-02 12:07:27 +00:00
|
|
|
|
(setq text-start (point))
|
2002-03-29 19:38:22 +00:00
|
|
|
|
(skip-chars-forward "^<" pos)
|
2002-04-03 21:17:38 +00:00
|
|
|
|
(setq state
|
|
|
|
|
(cond
|
2002-04-08 21:32:05 +00:00
|
|
|
|
((= (point) pos)
|
2002-04-03 21:17:38 +00:00
|
|
|
|
;; We got to the end without seeing a tag.
|
|
|
|
|
nil)
|
|
|
|
|
((looking-at "<!\\[[A-Z]+\\[")
|
|
|
|
|
;; We've found a CDATA section or similar.
|
|
|
|
|
(let ((cdata-start (point)))
|
|
|
|
|
(unless (search-forward "]]>" pos 'move)
|
|
|
|
|
(list 0 nil nil 'cdata nil nil nil nil cdata-start))))
|
2009-12-05 20:23:25 +00:00
|
|
|
|
((looking-at comment-start-skip)
|
|
|
|
|
;; parse-partial-sexp doesn't handle <!-- comments -->,
|
|
|
|
|
;; or only if ?- is in sgml-specials, so match explicitly
|
|
|
|
|
(let ((start (point)))
|
|
|
|
|
(unless (re-search-forward comment-end-skip pos 'move)
|
|
|
|
|
(list 0 nil nil nil t nil nil nil start))))
|
2007-05-08 06:57:38 +00:00
|
|
|
|
((and sgml-xml-mode (looking-at "<\\?"))
|
|
|
|
|
;; Processing Instructions.
|
|
|
|
|
;; In SGML, it's basically a normal tag of the form
|
|
|
|
|
;; <?NAME ...> but in XML, it takes the form <? ... ?>.
|
|
|
|
|
(let ((pi-start (point)))
|
|
|
|
|
(unless (search-forward "?>" pos 'move)
|
|
|
|
|
(list 0 nil nil 'pi nil nil nil nil pi-start))))
|
2002-04-03 21:17:38 +00:00
|
|
|
|
(t
|
2002-04-11 21:59:45 +00:00
|
|
|
|
;; We've reached a tag. Parse it.
|
2002-04-03 21:17:38 +00:00
|
|
|
|
;; FIXME: Handle net-enabling start-tags
|
|
|
|
|
(parse-partial-sexp (point) pos 0))))))
|
|
|
|
|
(cond
|
2007-05-08 06:57:38 +00:00
|
|
|
|
((memq (nth 3 state) '(cdata pi)) (cons (nth 3 state) (nth 8 state)))
|
2002-04-03 21:17:38 +00:00
|
|
|
|
((nth 3 state) (cons 'string (nth 8 state)))
|
|
|
|
|
((nth 4 state) (cons 'comment (nth 8 state)))
|
|
|
|
|
((and state (> (nth 0 state) 0)) (cons 'tag (nth 1 state)))
|
|
|
|
|
(t (cons 'text text-start))))))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
|
Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
(defun sgml-beginning-of-tag (&optional only-immediate)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"Skip to beginning of tag and return its name.
|
2002-03-28 16:06:38 +00:00
|
|
|
|
If this can't be done, return nil."
|
|
|
|
|
(let ((context (sgml-lexical-context)))
|
|
|
|
|
(if (eq (car context) 'tag)
|
|
|
|
|
(progn
|
|
|
|
|
(goto-char (cdr context))
|
|
|
|
|
(when (looking-at sgml-tag-name-re)
|
|
|
|
|
(match-string-no-properties 1)))
|
Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
(if only-immediate nil
|
2002-03-29 22:20:15 +00:00
|
|
|
|
(when (not (eq (car context) 'text))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(goto-char (cdr context))
|
|
|
|
|
(sgml-beginning-of-tag t))))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(defun sgml-value (alist)
|
2002-04-01 12:08:13 +00:00
|
|
|
|
"Interactively insert value taken from attribute-rule ALIST.
|
2001-10-26 17:40:59 +00:00
|
|
|
|
See `sgml-tag-alist' for info about attribute rules."
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(setq alist (cdr alist))
|
|
|
|
|
(if (stringp (car alist))
|
|
|
|
|
(insert "=\"" (car alist) ?\")
|
2002-03-17 23:55:15 +00:00
|
|
|
|
(if (and (eq (car alist) t) (not sgml-xml-mode))
|
2001-10-26 17:40:59 +00:00
|
|
|
|
(when (cdr alist)
|
2001-10-28 04:10:40 +00:00
|
|
|
|
(insert "=\"")
|
2015-07-23 18:09:44 +02:00
|
|
|
|
(setq alist (skeleton-read (lambda ()
|
|
|
|
|
(completing-read
|
|
|
|
|
"Value: " (cdr alist)))))
|
2001-10-28 04:10:40 +00:00
|
|
|
|
(if (string< "" alist)
|
|
|
|
|
(insert alist ?\")
|
Replace Lisp calls to delete-backward-char by delete-char.
* bs.el, expand.el, ido.el, image-dired.el, lpr.el, pcomplete.el,
skeleton.el, term.el, time.el, wid-edit.el, woman.el,
calc/calc-graph.el, calc/calc-help.el, calc/calc-incom.el,
calc/calc.el, emacs-cl-extra.el, emacs-cl-loaddefs.el,
emulation/cua-rect.el, emulation/viper-ex.el, eshell/esh-test.el,
eshell/eshell.el, gnus/gnus-uu.el, gnus/nndoc.el, gnus/nnrss.el,
gnus/rfc2047.el, gnus/utf7.el, international/utf-7.el,
language/ethio-util.el, mh-e/mh-alias.el, mh-e/mh-search.el,
net/imap.el, net/rcirc.el, obsolete/complete.el, play/decipher.el,
progmodes/ada-mode.el, progmodes/cc-awk.el, progmodes/dcl-mode.el,
progmodes/ps-mode.el, progmodes/verilog-mode.el,
progmodes/vhdl-mode.el, textmodes/bibtex.el, textmodes/fill.el,
textmodes/reftex-auc.el, textmodes/rst.el, textmodes/sgml-mode.el,
textmodes/table.el, textmodes/texinfmt.el: Replace Lisp calls to
delete-backward-char by calls to delete-char.
2010-05-24 22:11:08 -04:00
|
|
|
|
(delete-char -2)))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(insert "=\"")
|
2007-05-10 06:02:15 +00:00
|
|
|
|
(if (cdr alist)
|
2015-07-23 18:09:44 +02:00
|
|
|
|
(insert (skeleton-read (lambda ()
|
|
|
|
|
(completing-read "Value: " alist))))
|
2007-05-10 06:02:15 +00:00
|
|
|
|
(when (null alist)
|
|
|
|
|
(insert (skeleton-read '(read-string "Value: ")))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(insert ?\"))))
|
2001-10-25 22:25:30 +00:00
|
|
|
|
|
|
|
|
|
(defun sgml-quote (start end &optional unquotep)
|
2002-07-13 19:23:05 +00:00
|
|
|
|
"Quote SGML text in region START ... END.
|
2018-03-31 14:16:54 +01:00
|
|
|
|
Only &, <, >, ' and \" characters are quoted, the rest is left
|
|
|
|
|
untouched. This is sufficient to use quoted text as SGML argument.
|
|
|
|
|
|
|
|
|
|
With prefix argument UNQUOTEP, unquote the region. All numeric entities,
|
|
|
|
|
\"amp\", \"lt\", \"gt\" and \"quot\" named entities are unquoted."
|
2002-07-13 19:23:05 +00:00
|
|
|
|
(interactive "r\nP")
|
|
|
|
|
(save-restriction
|
|
|
|
|
(narrow-to-region start end)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(if unquotep
|
|
|
|
|
;; FIXME: We should unquote other named character references as well.
|
|
|
|
|
(while (re-search-forward
|
Replace manually crafted hex regexes with [:xdigit:]
* admin/charsets/mapconv:
* build-aux/gitlog-to-changelog (parse_amend_file, git_dir_option):
* lisp/progmodes/verilog-mode.el (verilog-delay-re):
(verilog-type-font-keywords, verilog-read-always-signals-recurse):
(verilog-is-number):
* lisp/progmodes/vera-mode.el (vera-font-lock-keywords):
* test/src/emacs-module-tests.el (mod-test-sum-test):
* lisp/xml.el: (xml--entity-replacement-text):
* lisp/version.el (emacs-repository-version-git):
* lisp/textmodes/sgml-mode.el (sgml-quote):
* lisp/textmodes/css-mode.el (css-escapes-re)
(css--colors-regexp):
* lisp/progmodes/prolog.el (prolog-syntax-propertize-function):
* lisp/progmodes/hideif.el (hif-token-regexp, hif-tokenize):
* lisp/progmodes/ebnf-dtd.el: (ebnf-dtd-attlistdecl)
(ebnf-dtd-entitydecl, ebnf-dtd-lex):
* lisp/progmodes/ebnf-ebx.el (ebnf-ebx-hex-character):
* lisp/progmodes/ebnf-abn.el (ebnf-abn-character):
* lisp/progmodes/cperl-mode.el (cperl-highlight-charclass)
(cperl-find-pods-heres):
* lisp/progmodes/cc-mode.el (c-maybe-quoted-number-head)
(c-maybe-quoted-number, c-parse-quotes-before-change)
(c-parse-quotes-after-change, c-quoted-number-head-before-point)
(c-quoted-number-straddling-point):
* lisp/progmodes/ada-mode.el (featurep, ada-in-numeric-literal-p)
(ada-font-lock-keywords):
* lisp/org/org-mobile.el (org-mobile-copy-agenda-files)
* lisp/org/org-table.el (org-table-number-regexp):
(org-mobile-update-checksum-for-capture-file):
* lisp/nxml/xsd-regexp.el (xsdre-gen-categories):
* lisp/nxml/xmltok.el (let*):
* lisp/nxml/rng-xsd.el (rng-xsd-convert-hex-binary)
(rng-xsd-convert-any-uri):
* lisp/nxml/rng-uri.el (rng-uri-file-name-1)
(rng-uri-unescape-multibyte, rng-uri-unescape-unibyte)
(rng-uri-unescape-unibyte-match)
(rng-uri-unescape-unibyte-replace):
* lisp/nxml/rng-cmpct.el (rng-c-process-escapes):
* lisp/nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* lisp/net/shr-color.el (shr-color->hexadecimal):
* lisp/mail/rfc2231.el (rfc2231-decode-encoded-string):
* lisp/international/mule-cmds.el (read-char-by-name):
* lisp/htmlfontify.el (hfy-hex-regex):
* lisp/gnus/nneething.el (nneething-decode-file-name):
* lisp/gnus/mml-sec.el (mml-secure-find-usable-keys):
* lisp/gnus/gnus-art.el (gnus-button-mid-or-mail-heuristic-alist):
* lisp/faces.el (read-color):
* lisp/epg.el (epg--status-ERRSIG, epg--status-VALIDSIG)
(epg--status-SIG_CREATED, epg--decode-percent-escape)
(epg--decode-hexstring, epg--decode-quotedstring)
(epg-dn-from-string):
* lisp/emulation/cua-rect.el (cua-incr-rectangle):
* lisp/dnd.el (dnd-unescape-uri):
* lisp/cedet/semantic/lex.el (semantic-lex-number-expression):
* lisp/cedet/semantic/java.el (semantic-java-number-regexp):
* lisp/calc/calc-lang.el (pascal):
* lisp/calc/calc-ext.el (math-read-number-fancy):
* lisp/calc/calc-aent.el (math-read-token):
Replace various combinations of [0-9a-fA-F] with [[:xdigit:]].
(Bug#36167)
2019-06-13 03:18:43 +03:00
|
|
|
|
"\\(&\\(amp\\|quot\\|lt\\|gt\\|#\\([0-9]+\\|[xX][[:xdigit:]]+\\)\\)\\)\\([][<>&;\n\t \"%!'(),/=?]\\|$\\)"
|
2002-07-13 19:23:05 +00:00
|
|
|
|
nil t)
|
2018-03-31 14:16:54 +01:00
|
|
|
|
(replace-match
|
|
|
|
|
(string
|
|
|
|
|
(or (cdr (assq (char-after (match-beginning 2))
|
|
|
|
|
'((?a . ?&) (?q . ?\") (?l . ?<) (?g . ?>))))
|
|
|
|
|
(let ((num (match-string 3)))
|
|
|
|
|
(if (or (eq ?x (aref num 0)) (eq ?X (aref num 0)))
|
|
|
|
|
(string-to-number (substring num 1) 16)
|
|
|
|
|
(string-to-number num 10)))))
|
|
|
|
|
t t nil (if (eq (char-before (match-end 0)) ?\;) 0 1)))
|
|
|
|
|
(while (re-search-forward "[&<>\"']" nil t)
|
2002-07-13 19:23:05 +00:00
|
|
|
|
(replace-match (cdr (assq (char-before) '((?& . "&")
|
|
|
|
|
(?< . "<")
|
2018-03-31 14:16:54 +01:00
|
|
|
|
(?> . ">")
|
|
|
|
|
(?\" . """)
|
|
|
|
|
(?' . "'"))))
|
2002-07-13 19:23:05 +00:00
|
|
|
|
t t)))))
|
|
|
|
|
|
|
|
|
|
(defun sgml-pretty-print (beg end)
|
|
|
|
|
"Simple-minded pretty printer for SGML.
|
|
|
|
|
Re-indents the code and inserts newlines between BEG and END.
|
|
|
|
|
You might want to turn on `auto-fill-mode' to get better results."
|
|
|
|
|
;; TODO:
|
|
|
|
|
;; - insert newline between some start-tag and text.
|
|
|
|
|
;; - don't insert newline in front of some end-tags.
|
|
|
|
|
(interactive "r")
|
|
|
|
|
(save-excursion
|
|
|
|
|
(if (< beg end)
|
|
|
|
|
(goto-char beg)
|
|
|
|
|
(goto-char end)
|
|
|
|
|
(setq end beg)
|
|
|
|
|
(setq beg (point)))
|
|
|
|
|
;; Don't use narrowing because it screws up auto-indent.
|
|
|
|
|
(setq end (copy-marker end t))
|
|
|
|
|
(with-syntax-table sgml-tag-syntax-table
|
|
|
|
|
(while (re-search-forward "<" end t)
|
|
|
|
|
(goto-char (match-beginning 0))
|
|
|
|
|
(unless (or ;;(looking-at "</")
|
|
|
|
|
(progn (skip-chars-backward " \t") (bolp)))
|
|
|
|
|
(reindent-then-newline-and-indent))
|
2016-01-25 10:54:02 -05:00
|
|
|
|
(sgml-forward-sexp 1)))
|
2002-07-13 19:23:05 +00:00
|
|
|
|
;; (indent-region beg end)
|
|
|
|
|
))
|
2001-06-17 09:01:23 +00:00
|
|
|
|
|
2002-04-01 23:32:15 +00:00
|
|
|
|
|
|
|
|
|
;; Parsing
|
|
|
|
|
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(cl-defstruct (sgml-tag
|
2002-04-01 23:32:15 +00:00
|
|
|
|
(:constructor sgml-make-tag (type start end name)))
|
|
|
|
|
type start end name)
|
|
|
|
|
|
|
|
|
|
(defsubst sgml-parse-tag-name ()
|
|
|
|
|
"Skip past a tag-name, and return the name."
|
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
|
(point) (progn (skip-syntax-forward "w_") (point))))
|
|
|
|
|
|
2004-11-10 14:39:40 +00:00
|
|
|
|
(defun sgml-tag-text-p (start end)
|
|
|
|
|
"Return non-nil if text between START and END is a tag.
|
|
|
|
|
Checks among other things that the tag does not contain spurious
|
|
|
|
|
unquoted < or > chars inside, which would indicate that it
|
|
|
|
|
really isn't a tag after all."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(with-syntax-table sgml-tag-syntax-table
|
|
|
|
|
(let ((pps (parse-partial-sexp start end 2)))
|
|
|
|
|
(and (= (nth 0 pps) 0))))))
|
|
|
|
|
|
2017-03-23 11:33:47 -06:00
|
|
|
|
(defun sgml--find-<>-backward (limit)
|
|
|
|
|
"Search backward for a '<' or '>' character.
|
|
|
|
|
The character must have open or close syntax.
|
|
|
|
|
Returns t if found, nil otherwise."
|
|
|
|
|
(catch 'found
|
|
|
|
|
(while (re-search-backward "[<>]" limit 'move)
|
|
|
|
|
;; If this character has "open" or "close" syntax, then we've
|
|
|
|
|
;; found the one we want.
|
|
|
|
|
(when (memq (syntax-class (syntax-after (point))) '(4 5))
|
|
|
|
|
(throw 'found t)))))
|
|
|
|
|
|
2002-11-12 16:46:19 +00:00
|
|
|
|
(defun sgml-parse-tag-backward (&optional limit)
|
2002-04-01 23:32:15 +00:00
|
|
|
|
"Parse an SGML tag backward, and return information about the tag.
|
|
|
|
|
Assume that parsing starts from within a textual context.
|
|
|
|
|
Leave point at the beginning of the tag."
|
2004-11-10 14:39:40 +00:00
|
|
|
|
(catch 'found
|
|
|
|
|
(let (tag-type tag-start tag-end name)
|
2017-03-23 11:33:47 -06:00
|
|
|
|
(or (sgml--find-<>-backward limit)
|
2004-11-10 14:39:40 +00:00
|
|
|
|
(error "No tag found"))
|
|
|
|
|
(when (eq (char-after) ?<)
|
|
|
|
|
;; Oops!! Looks like we were not in a textual context after all!.
|
|
|
|
|
;; Let's try to recover.
|
2007-05-08 06:57:38 +00:00
|
|
|
|
;; Remember the tag-start so we don't need to look for it later.
|
|
|
|
|
;; This is not just an optimization but also makes sure we don't get
|
|
|
|
|
;; stuck in infloops in cases where "looking back for <" would not go
|
|
|
|
|
;; back far enough.
|
|
|
|
|
(setq tag-start (point))
|
2004-11-10 14:39:40 +00:00
|
|
|
|
(with-syntax-table sgml-tag-syntax-table
|
|
|
|
|
(let ((pos (point)))
|
|
|
|
|
(condition-case nil
|
2007-05-08 06:57:38 +00:00
|
|
|
|
;; FIXME: This does not correctly skip over PI an CDATA tags.
|
2016-01-25 10:54:02 -05:00
|
|
|
|
(sgml-forward-sexp 1)
|
2004-11-10 14:39:40 +00:00
|
|
|
|
(scan-error
|
|
|
|
|
;; This < seems to be just a spurious one, let's ignore it.
|
|
|
|
|
(goto-char pos)
|
|
|
|
|
(throw 'found (sgml-parse-tag-backward limit))))
|
|
|
|
|
;; Check it is really a tag, without any extra < or > inside.
|
|
|
|
|
(unless (sgml-tag-text-p pos (point))
|
|
|
|
|
(goto-char pos)
|
|
|
|
|
(throw 'found (sgml-parse-tag-backward limit)))
|
|
|
|
|
(forward-char -1))))
|
|
|
|
|
(setq tag-end (1+ (point)))
|
|
|
|
|
(cond
|
|
|
|
|
((sgml-looking-back-at "--") ; comment
|
|
|
|
|
(setq tag-type 'comment
|
2007-05-08 06:57:38 +00:00
|
|
|
|
tag-start (or tag-start (search-backward "<!--" nil t))))
|
2004-11-10 14:39:40 +00:00
|
|
|
|
((sgml-looking-back-at "]]") ; cdata
|
|
|
|
|
(setq tag-type 'cdata
|
2007-05-08 06:57:38 +00:00
|
|
|
|
tag-start (or tag-start
|
|
|
|
|
(re-search-backward "<!\\[[A-Z]+\\[" nil t))))
|
|
|
|
|
((sgml-looking-back-at "?") ; XML processing-instruction
|
|
|
|
|
(setq tag-type 'pi
|
|
|
|
|
;; IIUC: SGML processing instructions take the form <?foo ...>
|
|
|
|
|
;; i.e. a "normal" tag, handled below. In XML this is changed
|
|
|
|
|
;; to <?foo ... ?> where "..." can contain < and > and even <?
|
|
|
|
|
;; but not ?>. This means that when parsing backward, there's
|
|
|
|
|
;; no easy way to make sure that we find the real beginning of
|
|
|
|
|
;; the PI.
|
|
|
|
|
tag-start (or tag-start (search-backward "<?" nil t))))
|
2004-11-10 14:39:40 +00:00
|
|
|
|
(t
|
2007-05-08 06:57:38 +00:00
|
|
|
|
(unless tag-start
|
|
|
|
|
(setq tag-start
|
|
|
|
|
(with-syntax-table sgml-tag-syntax-table
|
|
|
|
|
(goto-char tag-end)
|
|
|
|
|
(condition-case nil
|
2016-01-25 10:54:02 -05:00
|
|
|
|
(sgml-forward-sexp -1)
|
2007-05-08 06:57:38 +00:00
|
|
|
|
(scan-error
|
|
|
|
|
;; This > isn't really the end of a tag. Skip it.
|
|
|
|
|
(goto-char (1- tag-end))
|
|
|
|
|
(throw 'found (sgml-parse-tag-backward limit))))
|
|
|
|
|
(point))))
|
2004-11-10 14:39:40 +00:00
|
|
|
|
(goto-char (1+ tag-start))
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(pcase (char-after)
|
2007-05-08 06:57:38 +00:00
|
|
|
|
(?! (setq tag-type 'decl)) ; declaration
|
|
|
|
|
(?? (setq tag-type 'pi)) ; processing-instruction
|
|
|
|
|
(?% (setq tag-type 'jsp)) ; JSP tags
|
2004-11-10 14:39:40 +00:00
|
|
|
|
(?/ ; close-tag
|
|
|
|
|
(forward-char 1)
|
|
|
|
|
(setq tag-type 'close
|
|
|
|
|
name (sgml-parse-tag-name)))
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(_ ; open or empty tag
|
2004-11-10 14:39:40 +00:00
|
|
|
|
(setq tag-type 'open
|
|
|
|
|
name (sgml-parse-tag-name))
|
|
|
|
|
(if (or (eq ?/ (char-before (- tag-end 1)))
|
|
|
|
|
(sgml-empty-tag-p name))
|
|
|
|
|
(setq tag-type 'empty))))))
|
|
|
|
|
(goto-char tag-start)
|
|
|
|
|
(sgml-make-tag tag-type tag-start tag-end name))))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(defun sgml-get-context (&optional until)
|
2002-04-01 23:32:15 +00:00
|
|
|
|
"Determine the context of the current position.
|
2003-06-05 01:14:23 +00:00
|
|
|
|
By default, parse until we find a start-tag as the first thing on a line.
|
|
|
|
|
If UNTIL is `empty', return even if the context is empty (i.e.
|
2002-04-01 23:32:15 +00:00
|
|
|
|
we just skipped over some element and got to a beginning of line).
|
|
|
|
|
|
|
|
|
|
The context is a list of tag-info structures. The last one is the tag
|
2003-06-05 01:14:23 +00:00
|
|
|
|
immediately enclosing the current position.
|
|
|
|
|
|
|
|
|
|
Point is assumed to be outside of any tag. If we discover that it's
|
|
|
|
|
not the case, the first tag returned is the one inside which we are."
|
2002-04-01 23:32:15 +00:00
|
|
|
|
(let ((here (point))
|
2005-01-13 14:51:57 +00:00
|
|
|
|
(stack nil)
|
2002-04-01 23:32:15 +00:00
|
|
|
|
(ignore nil)
|
|
|
|
|
(context nil)
|
|
|
|
|
tag-info)
|
|
|
|
|
;; CONTEXT keeps track of the tag-stack
|
2005-01-13 14:51:57 +00:00
|
|
|
|
;; STACK keeps track of the end tags we've seen (and thus the start-tags
|
|
|
|
|
;; we'll have to ignore) when skipping over matching open..close pairs.
|
|
|
|
|
;; IGNORE is a list of tags that can be ignored because they have been
|
|
|
|
|
;; closed implicitly.
|
2002-04-01 23:32:15 +00:00
|
|
|
|
(skip-chars-backward " \t\n") ; Make sure we're not at indentation.
|
|
|
|
|
(while
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(and (not (eq until 'now))
|
2005-01-13 14:51:57 +00:00
|
|
|
|
(or stack
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(not (if until (eq until 'empty) context))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
(not (sgml-at-indentation-p))
|
|
|
|
|
(and context
|
|
|
|
|
(/= (point) (sgml-tag-start (car context)))
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(sgml-unclosed-tag-p (sgml-tag-name (car context)))))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
(setq tag-info (ignore-errors (sgml-parse-tag-backward))))
|
2002-10-18 08:30:49 +00:00
|
|
|
|
|
2002-04-01 23:32:15 +00:00
|
|
|
|
;; This tag may enclose things we thought were tags. If so,
|
|
|
|
|
;; discard them.
|
|
|
|
|
(while (and context
|
|
|
|
|
(> (sgml-tag-end tag-info)
|
|
|
|
|
(sgml-tag-end (car context))))
|
|
|
|
|
(setq context (cdr context)))
|
2002-10-18 08:30:49 +00:00
|
|
|
|
|
2002-04-01 23:32:15 +00:00
|
|
|
|
(cond
|
2003-06-05 01:14:23 +00:00
|
|
|
|
((> (sgml-tag-end tag-info) here)
|
|
|
|
|
;; Oops!! Looks like we were not outside of any tag, after all.
|
|
|
|
|
(push tag-info context)
|
|
|
|
|
(setq until 'now))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
|
|
|
|
|
;; start-tag
|
|
|
|
|
((eq (sgml-tag-type tag-info) 'open)
|
|
|
|
|
(cond
|
2005-01-13 14:51:57 +00:00
|
|
|
|
((null stack)
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(if (assoc-string (sgml-tag-name tag-info) ignore t)
|
2002-04-01 23:32:15 +00:00
|
|
|
|
;; There was an implicit end-tag.
|
|
|
|
|
nil
|
2005-01-13 14:51:57 +00:00
|
|
|
|
(push tag-info context)
|
|
|
|
|
;; We're changing context so the tags implicitly closed inside
|
|
|
|
|
;; the previous context aren't implicitly closed here any more.
|
|
|
|
|
;; [ Well, actually it depends, but we don't have the info about
|
|
|
|
|
;; when it doesn't and when it does. --Stef ]
|
|
|
|
|
(setq ignore nil)))
|
2022-07-26 13:47:03 -04:00
|
|
|
|
((string-equal-ignore-case (sgml-tag-name tag-info) (car stack))
|
2005-01-13 14:51:57 +00:00
|
|
|
|
(setq stack (cdr stack)))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
(t
|
|
|
|
|
;; The open and close tags don't match.
|
|
|
|
|
(if (not sgml-xml-mode)
|
|
|
|
|
(unless (sgml-unclosed-tag-p (sgml-tag-name tag-info))
|
2002-07-13 19:23:05 +00:00
|
|
|
|
(message "Unclosed tag <%s>" (sgml-tag-name tag-info))
|
2005-01-13 14:51:57 +00:00
|
|
|
|
(let ((tmp stack))
|
2002-07-13 19:23:05 +00:00
|
|
|
|
;; We could just assume that the tag is simply not closed
|
|
|
|
|
;; but it's a bad assumption when tags *are* closed but
|
|
|
|
|
;; not properly nested.
|
|
|
|
|
(while (and (cdr tmp)
|
2022-07-26 13:47:03 -04:00
|
|
|
|
(not (string-equal-ignore-case
|
|
|
|
|
(sgml-tag-name tag-info) (cadr tmp))))
|
2002-07-13 19:23:05 +00:00
|
|
|
|
(setq tmp (cdr tmp)))
|
|
|
|
|
(if (cdr tmp) (setcdr tmp (cddr tmp)))))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
(message "Unmatched tags <%s> and </%s>"
|
2005-01-13 14:51:57 +00:00
|
|
|
|
(sgml-tag-name tag-info) (pop stack)))))
|
2005-02-09 15:50:47 +00:00
|
|
|
|
|
2005-01-13 14:51:57 +00:00
|
|
|
|
(if (and (null stack) (sgml-unclosed-tag-p (sgml-tag-name tag-info)))
|
|
|
|
|
;; This is a top-level open of an implicitly closed tag, so any
|
|
|
|
|
;; occurrence of such an open tag at the same level can be ignored
|
|
|
|
|
;; because it's been implicitly closed.
|
|
|
|
|
(push (sgml-tag-name tag-info) ignore)))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
|
|
|
|
|
;; end-tag
|
|
|
|
|
((eq (sgml-tag-type tag-info) 'close)
|
|
|
|
|
(if (sgml-empty-tag-p (sgml-tag-name tag-info))
|
|
|
|
|
(message "Spurious </%s>: empty tag" (sgml-tag-name tag-info))
|
2005-01-13 14:51:57 +00:00
|
|
|
|
(push (sgml-tag-name tag-info) stack)))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
;; return context
|
|
|
|
|
context))
|
|
|
|
|
|
|
|
|
|
(defun sgml-show-context (&optional full)
|
|
|
|
|
"Display the current context.
|
|
|
|
|
If FULL is non-nil, parse back to the beginning of the buffer."
|
|
|
|
|
(interactive "P")
|
|
|
|
|
(with-output-to-temp-buffer "*XML Context*"
|
2002-07-13 19:23:05 +00:00
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((context (sgml-get-context)))
|
|
|
|
|
(when full
|
|
|
|
|
(let ((more nil))
|
|
|
|
|
(while (setq more (sgml-get-context))
|
|
|
|
|
(setq context (nconc more context)))))
|
|
|
|
|
(pp context)))))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; Editing shortcuts
|
|
|
|
|
|
2002-04-02 11:26:12 +00:00
|
|
|
|
(defun sgml-close-tag ()
|
2002-11-12 16:46:19 +00:00
|
|
|
|
"Close current element.
|
|
|
|
|
Depending on context, inserts a matching close-tag, or closes
|
|
|
|
|
the current start-tag or the current comment or the current cdata, ..."
|
2002-04-01 23:32:15 +00:00
|
|
|
|
(interactive)
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(pcase (car (sgml-lexical-context))
|
2018-11-05 01:22:15 +01:00
|
|
|
|
('comment (insert " -->"))
|
|
|
|
|
('cdata (insert "]]>"))
|
|
|
|
|
('pi (insert " ?>"))
|
|
|
|
|
('jsp (insert " %>"))
|
|
|
|
|
('tag (insert " />"))
|
|
|
|
|
('text
|
2002-04-02 11:26:12 +00:00
|
|
|
|
(let ((context (save-excursion (sgml-get-context))))
|
|
|
|
|
(if context
|
2002-04-11 21:59:45 +00:00
|
|
|
|
(progn
|
2002-04-02 11:26:12 +00:00
|
|
|
|
(insert "</" (sgml-tag-name (car (last context))) ">")
|
|
|
|
|
(indent-according-to-mode)))))
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(_
|
2002-04-02 11:26:12 +00:00
|
|
|
|
(error "Nothing to close"))))
|
2002-04-01 23:32:15 +00:00
|
|
|
|
|
2002-04-01 12:08:13 +00:00
|
|
|
|
(defun sgml-empty-tag-p (tag-name)
|
|
|
|
|
"Return non-nil if TAG-NAME is an implicitly empty tag."
|
|
|
|
|
(and (not sgml-xml-mode)
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(assoc-string tag-name sgml-empty-tags 'ignore-case)))
|
2002-04-01 12:08:13 +00:00
|
|
|
|
|
|
|
|
|
(defun sgml-unclosed-tag-p (tag-name)
|
|
|
|
|
"Return non-nil if TAG-NAME is a tag for which an end-tag is optional."
|
|
|
|
|
(and (not sgml-xml-mode)
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(assoc-string tag-name sgml-unclosed-tags 'ignore-case)))
|
|
|
|
|
|
2002-04-01 12:08:13 +00:00
|
|
|
|
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(defun sgml-calculate-indent (&optional lcon)
|
|
|
|
|
"Calculate the column to which this line should be indented.
|
|
|
|
|
LCON is the lexical context, if any."
|
|
|
|
|
(unless lcon (setq lcon (sgml-lexical-context)))
|
|
|
|
|
|
|
|
|
|
;; Indent comment-start markers inside <!-- just like comment-end markers.
|
|
|
|
|
(if (and (eq (car lcon) 'tag)
|
|
|
|
|
(looking-at "--")
|
|
|
|
|
(save-excursion (goto-char (cdr lcon)) (looking-at "<!--")))
|
|
|
|
|
(setq lcon (cons 'comment (+ (cdr lcon) 2))))
|
|
|
|
|
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(pcase (car lcon)
|
2003-06-05 01:14:23 +00:00
|
|
|
|
|
2018-11-05 01:22:15 +01:00
|
|
|
|
('string
|
2003-06-05 01:14:23 +00:00
|
|
|
|
;; Go back to previous non-empty line.
|
|
|
|
|
(while (and (> (point) (cdr lcon))
|
|
|
|
|
(zerop (forward-line -1))
|
|
|
|
|
(looking-at "[ \t]*$")))
|
|
|
|
|
(if (> (point) (cdr lcon))
|
|
|
|
|
;; Previous line is inside the string.
|
|
|
|
|
(current-indentation)
|
|
|
|
|
(goto-char (cdr lcon))
|
|
|
|
|
(1+ (current-column))))
|
|
|
|
|
|
2018-11-05 01:22:15 +01:00
|
|
|
|
('comment
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(let ((mark (looking-at "--")))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
;; Go back to previous non-empty line.
|
|
|
|
|
(while (and (> (point) (cdr lcon))
|
|
|
|
|
(zerop (forward-line -1))
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(or (looking-at "[ \t]*$")
|
|
|
|
|
(if mark (not (looking-at "[ \t]*--"))))))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(if (> (point) (cdr lcon))
|
2003-06-05 01:14:23 +00:00
|
|
|
|
;; Previous line is inside the comment.
|
|
|
|
|
(skip-chars-forward " \t")
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(goto-char (cdr lcon))
|
2003-06-05 01:14:23 +00:00
|
|
|
|
;; Skip `<!' to get to the `--' with which we want to align.
|
|
|
|
|
(search-forward "--")
|
|
|
|
|
(goto-char (match-beginning 0)))
|
|
|
|
|
(when (and (not mark) (looking-at "--"))
|
|
|
|
|
(forward-char 2) (skip-chars-forward " \t"))
|
|
|
|
|
(current-column)))
|
|
|
|
|
|
|
|
|
|
;; We don't know how to indent it. Let's be honest about it.
|
2018-11-05 01:22:15 +01:00
|
|
|
|
('cdata nil)
|
2007-05-08 06:57:38 +00:00
|
|
|
|
;; We don't know how to indent it. Let's be honest about it.
|
2018-11-05 01:22:15 +01:00
|
|
|
|
('pi nil)
|
2003-06-05 01:14:23 +00:00
|
|
|
|
|
2018-11-05 01:22:15 +01:00
|
|
|
|
('tag
|
2015-03-22 08:22:29 -07:00
|
|
|
|
(goto-char (+ (cdr lcon) sgml-attribute-offset))
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(skip-chars-forward "^ \t\n") ;Skip tag name.
|
|
|
|
|
(skip-chars-forward " \t")
|
|
|
|
|
(if (not (eolp))
|
|
|
|
|
(current-column)
|
|
|
|
|
;; This is the first attribute: indent.
|
2015-03-22 08:22:29 -07:00
|
|
|
|
(goto-char (+ (cdr lcon) sgml-attribute-offset))
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(+ (current-column) sgml-basic-offset)))
|
|
|
|
|
|
2018-11-05 01:22:15 +01:00
|
|
|
|
('text
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(while (looking-at "</")
|
2016-01-25 10:54:02 -05:00
|
|
|
|
(sgml-forward-sexp 1)
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(skip-chars-forward " \t"))
|
|
|
|
|
(let* ((here (point))
|
|
|
|
|
(unclosed (and ;; (not sgml-xml-mode)
|
|
|
|
|
(looking-at sgml-tag-name-re)
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(assoc-string (match-string 1)
|
|
|
|
|
sgml-unclosed-tags 'ignore-case)
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(match-string 1)))
|
|
|
|
|
(context
|
|
|
|
|
;; If possible, align on the previous non-empty text line.
|
|
|
|
|
;; Otherwise, do a more serious parsing to find the
|
|
|
|
|
;; tag(s) relative to which we should be indenting.
|
|
|
|
|
(if (and (not unclosed) (skip-chars-backward " \t")
|
|
|
|
|
(< (skip-chars-backward " \t\n") 0)
|
|
|
|
|
(back-to-indentation)
|
|
|
|
|
(> (point) (cdr lcon)))
|
|
|
|
|
nil
|
|
|
|
|
(goto-char here)
|
|
|
|
|
(nreverse (sgml-get-context (if unclosed nil 'empty)))))
|
|
|
|
|
(there (point)))
|
|
|
|
|
;; Ignore previous unclosed start-tag in context.
|
|
|
|
|
(while (and context unclosed
|
2022-07-26 13:47:03 -04:00
|
|
|
|
(string-equal-ignore-case
|
|
|
|
|
(sgml-tag-name (car context)) unclosed))
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(setq context (cdr context)))
|
|
|
|
|
;; Indent to reflect nesting.
|
|
|
|
|
(cond
|
|
|
|
|
;; If we were not in a text context after all, let's try again.
|
|
|
|
|
((and context (> (sgml-tag-end (car context)) here))
|
|
|
|
|
(goto-char here)
|
|
|
|
|
(sgml-calculate-indent
|
|
|
|
|
(cons (if (memq (sgml-tag-type (car context)) '(comment cdata))
|
|
|
|
|
(sgml-tag-type (car context)) 'tag)
|
|
|
|
|
(sgml-tag-start (car context)))))
|
|
|
|
|
;; Align on the first element after the nearest open-tag, if any.
|
|
|
|
|
((and context
|
|
|
|
|
(goto-char (sgml-tag-end (car context)))
|
|
|
|
|
(skip-chars-forward " \t\n")
|
|
|
|
|
(< (point) here) (sgml-at-indentation-p))
|
|
|
|
|
(current-column))
|
Deprecate `intangible' and `point-entered' properties
* lisp/emacs-lisp/cursor-sensor.el: New file.
* lisp/simple.el (pre-redisplay-functions): New hook.
(redisplay--pre-redisplay-functions): New function.
(pre-redisplay-function): Use it.
(minibuffer-avoid-prompt): Mark obsolete.
(redisplay--update-region-highlight): Adapt it to work as a function on
pre-redisplay-functions.
* lisp/cus-start.el (minibuffer-prompt-properties--setter): New fun.
(minibuffer-prompt-properties): Use it. Use cursor-intangible rather
than point-entered to make the prompt intangible.
* lisp/forms.el: Move `provide' calls to the end.
(forms-mode): Don't use `run-hooks' on a local var.
(forms--make-format, forms--make-format-elt-using-text-properties):
Use cursor-intangible rather than `intangible'.
(forms-mode): Enable cursor-intangible-mode.
* lisp/isearch.el (isearch-mode): Use defvar-local.
(cursor-sensor-inhibit): Declare.
(isearch-mode): Set cursor-sensor-inhibit.
(isearch-done): Set it back.
(isearch-open-overlay-temporary, isearch-open-necessary-overlays)
(isearch-close-unnecessary-overlays): Don't bother with `intangible'
any more.
* lisp/ses.el (ses-localvars): Remove `mode-line-process'.
(ses-sym-rowcol, ses-cell-value, ses-col-width, ses-col-printer):
Add Edebug spec.
(ses-goto-print, ses-print-cell, ses-adjust-print-width)
(ses-goto-data, ses-setup, ses-copy-region): Don't let-bind
inhibit-point-motion-hooks any more.
(ses--cell-at-pos, ses--curcell): New functions, extracted from
ses-set-curcell.
(ses-set-curcell): Use them.
(ses-print-cell, ses-setup): Use cursor-intangible instead of
`intangible'. Make sure cursor-intangible isn't sticky at BOB.
(ses-print-cell-new-width, ses-reprint-all, ses-recalculate-all):
Use ses--cell-at-pos.
(ses--mode-line-process, ses--cursor-sensor-highlight): New functions,
extracted from ses-command-hook. Make them work with multiple windows
displaying the same buffer.
(ses-mode): Use them via mode-line-process and pre-redisplay-functions.
Enable cursor-intangible-mode.
(ses-command-hook): Remove cell highlight and mode-line update code.
(ses-forward-or-insert, ses-copy-region-helper, ses-sort-column):
Update for new name of text-property holding the cell name.
(ses-rename-cell): Don't mess with mode-line-process.
* lisp/erc/erc-stamp.el (erc-add-timestamp): Use the new
cursor-sensor-functions property instead of point-entered.
(erc-insert-timestamp-right, erc-format-timestamp):
Use cursor-intangible rather than `intangible'.
(erc-munge-invisibility-spec): Use add-to-invisibility-spec and
remove-from-invisibility-spec. Enable cursor-intangible-mode and
cursor-sensor-mode if needed.
(erc-echo-timestamp): Adapt to calling convention of
cursor-sensor-functions.
(erc-insert-timestamp-right): Remove unused vars `current-window' and
`indent'.
* lisp/gnus/gnus-group.el (gnus-tmp-*): Declare.
(gnus-update-group-mark-positions): Remove unused `topic' var.
(gnus-group-insert-group-line): Remove unused var `header'.
(gnus-group--setup-tool-bar-update): New function.
(gnus-group-insert-group-line): Use it.
(gnus-group-update-eval-form): Declare local
dynamically-bound variables.
(gnus-group-unsubscribe-group): Use \` and \' to match string bounds.
* lisp/gnus/gnus-topic.el (gnus-topic-jump-to-topic)
(gnus-group-prepare-topics, gnus-topic-update-topic)
(gnus-topic-change-level, gnus-topic-catchup-articles)
(gnus-topic-remove-group, gnus-topic-delete, gnus-topic-indent):
Use inhibit-read-only.
(gnus-topic-prepare-topic): Use gnus-group--setup-tool-bar-update.
(gnus-topic-mode): Use define-minor-mode and derived-mode-p.
* lisp/textmodes/reftex-index.el (reftex-display-index):
Use cursor-intangible-mode if available.
(reftex-index-post-command-hook): Check cursor-intangible.
* lisp/textmodes/reftex-toc.el (reftex-toc):
Use cursor-intangible-mode if available.
(reftex-toc-recenter, reftex-toc-post-command-hook):
Check cursor-intangible.
* lisp/textmodes/sgml-mode.el: Use lexical-binding.
(sgml-tag): Use cursor-sensor-functions instead of point-entered.
(sgml-tags-invisible): Use with-silent-modifications and
inhibit-read-only. Enable cursor-sensor-mode.
(sgml-cursor-sensor): Rename from sgml-point-entered and adjust to
calling convention of cursor-sensor-functions.
* lisp/textmodes/table.el (table-cell-map-hook, table-load-hook)
(table-point-entered-cell-hook, table-point-left-cell-hook):
Don't autoload.
(table-cell-entered-state): Remove var.
(table--put-cell-point-entered/left-property)
(table--remove-cell-properties):
Use cursor-sensor-functions rather than point-entered/left.
(table--point-entered/left-cell-function): Merge
table--point-entered-cell-function and table--point-left-cell-function
and adjust to calling convention of cursor-sensor-functions.
2015-04-13 15:51:15 -04:00
|
|
|
|
;; ;; If the parsing failed, try to recover.
|
|
|
|
|
;; ((and (null context) (bobp)
|
|
|
|
|
;; (not (eq (char-after here) ?<)))
|
|
|
|
|
;; (goto-char here)
|
|
|
|
|
;; (if (and (looking-at "--[ \t\n]*>")
|
|
|
|
|
;; (re-search-backward "<!--" nil t))
|
|
|
|
|
;; ;; No wonder parsing failed: we're in a comment.
|
|
|
|
|
;; (sgml-calculate-indent (prog2 (goto-char (match-end 0))
|
|
|
|
|
;; (sgml-lexical-context)
|
|
|
|
|
;; (goto-char here)))
|
|
|
|
|
;; ;; We have no clue what's going on, let's be honest about it.
|
|
|
|
|
;; nil))
|
|
|
|
|
;; Otherwise, just follow the rules.
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(t
|
|
|
|
|
(goto-char there)
|
|
|
|
|
(+ (current-column)
|
|
|
|
|
(* sgml-basic-offset (length context)))))))
|
|
|
|
|
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
|
|
|
|
(_
|
2005-06-16 16:23:46 +00:00
|
|
|
|
(error "Unrecognized context %s" (car lcon)))
|
2003-06-05 01:14:23 +00:00
|
|
|
|
|
|
|
|
|
))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
|
|
|
|
|
(defun sgml-indent-line ()
|
|
|
|
|
"Indent the current line as SGML."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let* ((savep (point))
|
|
|
|
|
(indent-col
|
|
|
|
|
(save-excursion
|
2002-03-29 19:38:22 +00:00
|
|
|
|
(back-to-indentation)
|
2002-03-28 16:06:38 +00:00
|
|
|
|
(if (>= (point) savep) (setq savep nil))
|
|
|
|
|
(sgml-calculate-indent))))
|
2003-06-05 01:14:23 +00:00
|
|
|
|
(if (null indent-col)
|
|
|
|
|
'noindent
|
|
|
|
|
(if savep
|
|
|
|
|
(save-excursion (indent-line-to indent-col))
|
|
|
|
|
(indent-line-to indent-col)))))
|
2002-03-28 16:06:38 +00:00
|
|
|
|
|
2002-04-11 21:59:45 +00:00
|
|
|
|
(defun sgml-guess-indent ()
|
|
|
|
|
"Guess an appropriate value for `sgml-basic-offset'.
|
2011-11-14 22:00:24 +01:00
|
|
|
|
Base the guessed indentation level on the first indented tag in the buffer.
|
2002-04-11 21:59:45 +00:00
|
|
|
|
Add this to `sgml-mode-hook' for convenience."
|
|
|
|
|
(interactive)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
2002-05-22 09:40:48 +00:00
|
|
|
|
(if (re-search-forward "^\\([ \t]+\\)<" 500 'noerror)
|
2002-04-11 21:59:45 +00:00
|
|
|
|
(progn
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
(setq-local sgml-basic-offset (1- (current-column)))
|
2002-04-11 21:59:45 +00:00
|
|
|
|
(message "Guessed sgml-basic-offset = %d"
|
|
|
|
|
sgml-basic-offset)
|
|
|
|
|
))))
|
|
|
|
|
|
2002-03-29 19:38:22 +00:00
|
|
|
|
(defun sgml-parse-dtd ()
|
|
|
|
|
"Simplistic parse of the current buffer as a DTD.
|
|
|
|
|
Currently just returns (EMPTY-TAGS UNCLOSED-TAGS)."
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(let ((empty nil)
|
|
|
|
|
(unclosed nil))
|
|
|
|
|
(while (re-search-forward "<!ELEMENT[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+[-O][ \t\n]+\\([-O]\\)[ \t\n]+\\([^ \t\n]+\\)" nil t)
|
|
|
|
|
(cond
|
|
|
|
|
((string= (match-string 3) "EMPTY")
|
|
|
|
|
(push (match-string-no-properties 1) empty))
|
|
|
|
|
((string= (match-string 2) "O")
|
|
|
|
|
(push (match-string-no-properties 1) unclosed))))
|
|
|
|
|
(setq empty (sort (mapcar 'downcase empty) 'string<))
|
|
|
|
|
(setq unclosed (sort (mapcar 'downcase unclosed) 'string<))
|
|
|
|
|
(list empty unclosed)))
|
|
|
|
|
|
2001-06-17 09:01:23 +00:00
|
|
|
|
;;; HTML mode
|
|
|
|
|
|
1999-08-04 19:18:55 +00:00
|
|
|
|
(defcustom html-mode-hook nil
|
|
|
|
|
"Hook run by command `html-mode'.
|
|
|
|
|
`text-mode-hook' and `sgml-mode-hook' are run first."
|
|
|
|
|
:type 'hook
|
|
|
|
|
:options '(html-autoview-mode))
|
|
|
|
|
|
1996-01-24 17:12:21 +00:00
|
|
|
|
(defvar html-quick-keys sgml-quick-keys
|
1996-01-26 19:39:42 +00:00
|
|
|
|
"Use C-c X combinations for quick insertion of frequent tags when non-nil.
|
1996-01-24 17:12:21 +00:00
|
|
|
|
This defaults to `sgml-quick-keys'.
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
This takes effect when first loading the library.")
|
|
|
|
|
|
|
|
|
|
(defvar html-mode-map
|
2021-02-23 03:51:12 +01:00
|
|
|
|
(let ((map (make-sparse-keymap)))
|
2001-04-06 16:24:42 +00:00
|
|
|
|
(set-keymap-parent map sgml-mode-map)
|
1996-06-15 23:19:40 +00:00
|
|
|
|
(define-key map "\C-c6" 'html-headline-6)
|
|
|
|
|
(define-key map "\C-c5" 'html-headline-5)
|
|
|
|
|
(define-key map "\C-c4" 'html-headline-4)
|
|
|
|
|
(define-key map "\C-c3" 'html-headline-3)
|
|
|
|
|
(define-key map "\C-c2" 'html-headline-2)
|
|
|
|
|
(define-key map "\C-c1" 'html-headline-1)
|
1996-01-24 17:12:21 +00:00
|
|
|
|
(define-key map "\C-c\r" 'html-paragraph)
|
|
|
|
|
(define-key map "\C-c\n" 'html-line)
|
|
|
|
|
(define-key map "\C-c\C-c-" 'html-horizontal-rule)
|
1996-06-15 23:19:40 +00:00
|
|
|
|
(define-key map "\C-c\C-co" 'html-ordered-list)
|
|
|
|
|
(define-key map "\C-c\C-cu" 'html-unordered-list)
|
1996-01-24 17:12:21 +00:00
|
|
|
|
(define-key map "\C-c\C-cr" 'html-radio-buttons)
|
|
|
|
|
(define-key map "\C-c\C-cc" 'html-checkboxes)
|
|
|
|
|
(define-key map "\C-c\C-cl" 'html-list-item)
|
|
|
|
|
(define-key map "\C-c\C-ch" 'html-href-anchor)
|
2020-08-06 15:11:48 +02:00
|
|
|
|
(define-key map "\C-c\C-cf" 'html-href-anchor-file)
|
1996-01-24 17:12:21 +00:00
|
|
|
|
(define-key map "\C-c\C-cn" 'html-name-anchor)
|
2019-11-03 16:06:26 +01:00
|
|
|
|
(define-key map "\C-c\C-c#" 'html-id-anchor)
|
1996-01-24 17:12:21 +00:00
|
|
|
|
(define-key map "\C-c\C-ci" 'html-image)
|
2001-10-26 17:40:59 +00:00
|
|
|
|
(when html-quick-keys
|
|
|
|
|
(define-key map "\C-c-" 'html-horizontal-rule)
|
2019-04-30 16:00:46 -07:00
|
|
|
|
(define-key map "\C-cd" 'html-div)
|
2001-10-26 17:40:59 +00:00
|
|
|
|
(define-key map "\C-co" 'html-ordered-list)
|
|
|
|
|
(define-key map "\C-cu" 'html-unordered-list)
|
|
|
|
|
(define-key map "\C-cr" 'html-radio-buttons)
|
|
|
|
|
(define-key map "\C-cc" 'html-checkboxes)
|
|
|
|
|
(define-key map "\C-cl" 'html-list-item)
|
|
|
|
|
(define-key map "\C-ch" 'html-href-anchor)
|
2020-08-06 15:11:48 +02:00
|
|
|
|
(define-key map "\C-cf" 'html-href-anchor-file)
|
2001-10-26 17:40:59 +00:00
|
|
|
|
(define-key map "\C-cn" 'html-name-anchor)
|
2019-11-03 16:06:26 +01:00
|
|
|
|
(define-key map "\C-c#" 'html-id-anchor)
|
2019-04-30 16:00:46 -07:00
|
|
|
|
(define-key map "\C-ci" 'html-image)
|
|
|
|
|
(define-key map "\C-cs" 'html-span))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(define-key map "\C-c\C-s" 'html-autoview-mode)
|
|
|
|
|
(define-key map "\C-c\C-v" 'browse-url-of-buffer)
|
2021-09-16 16:03:36 +02:00
|
|
|
|
(define-key map "\M-o" 'facemenu-keymap)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
map)
|
|
|
|
|
"Keymap for commands for use in HTML mode.")
|
|
|
|
|
|
2021-02-23 03:51:12 +01:00
|
|
|
|
(easy-menu-define html-mode-menu html-mode-map
|
|
|
|
|
"Menu for HTML mode."
|
|
|
|
|
'("HTML"
|
|
|
|
|
["ID Anchor" html-id-anchor]
|
|
|
|
|
["Name Anchor" html-name-anchor]
|
|
|
|
|
["Href Anchor File" html-href-anchor-file]
|
|
|
|
|
["Href Anchor URL" html-href-anchor]
|
|
|
|
|
["Image" html-image]
|
|
|
|
|
["Paragraph" html-paragraph]
|
|
|
|
|
["Line Break" html-line]
|
|
|
|
|
["Horizontal Rule" html-horizontal-rule]
|
|
|
|
|
["Ordered List" html-ordered-list]
|
|
|
|
|
["Unordered List" html-unordered-list]
|
|
|
|
|
["List Item" html-list-item]
|
|
|
|
|
["Checkboxes" html-checkboxes]
|
|
|
|
|
["Radio Buttons" html-radio-buttons]
|
|
|
|
|
["Heading 1" html-headline-1]
|
|
|
|
|
["Heading 2" html-headline-2]
|
|
|
|
|
["Heading 3" html-headline-3]
|
|
|
|
|
;; ["Heading 4" html-headline-4]
|
|
|
|
|
;; ["Heading 5" html-headline-5]
|
|
|
|
|
;; ["Heading 6" html-headline-6]
|
|
|
|
|
"---"
|
|
|
|
|
["View Buffer Contents" browse-url-of-buffer]
|
|
|
|
|
["Toggle Autoviewing" html-autoview-mode]))
|
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(defvar html-face-tag-alist
|
2020-05-06 03:30:20 +02:00
|
|
|
|
'((bold . "strong")
|
|
|
|
|
(italic . "em")
|
2021-10-02 15:14:15 +02:00
|
|
|
|
(bold-italic . ("strong" "em"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(underline . "u")
|
2012-06-02 18:56:09 +08:00
|
|
|
|
(mode-line . "rev"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"Value of `sgml-face-tag-alist' for HTML mode.")
|
|
|
|
|
|
|
|
|
|
(defvar html-tag-face-alist
|
|
|
|
|
'(("b" . bold)
|
|
|
|
|
("big" . bold)
|
|
|
|
|
("blink" . highlight)
|
|
|
|
|
("cite" . italic)
|
|
|
|
|
("em" . italic)
|
|
|
|
|
("h1" bold underline)
|
|
|
|
|
("h2" bold-italic underline)
|
|
|
|
|
("h3" italic underline)
|
|
|
|
|
("h4" . underline)
|
|
|
|
|
("h5" . underline)
|
|
|
|
|
("h6" . underline)
|
|
|
|
|
("i" . italic)
|
2012-06-02 18:56:09 +08:00
|
|
|
|
("rev" . mode-line)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("s" . underline)
|
|
|
|
|
("small" . default)
|
|
|
|
|
("strong" . bold)
|
|
|
|
|
("title" bold underline)
|
|
|
|
|
("tt" . default)
|
|
|
|
|
("u" . underline)
|
|
|
|
|
("var" . italic))
|
|
|
|
|
"Value of `sgml-tag-face-alist' for HTML mode.")
|
|
|
|
|
|
|
|
|
|
(defvar html-display-text
|
|
|
|
|
'((img . "[/]")
|
|
|
|
|
(hr . "----------")
|
|
|
|
|
(li . "o "))
|
|
|
|
|
"Value of `sgml-display-text' for HTML mode.")
|
2001-10-05 16:21:14 +00:00
|
|
|
|
|
2002-04-09 12:02:20 +00:00
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(defvar html-tag-alist
|
1997-04-23 18:58:33 +00:00
|
|
|
|
(let* ((1-7 '(("1") ("2") ("3") ("4") ("5") ("6") ("7")))
|
2001-06-17 09:01:23 +00:00
|
|
|
|
(1-9 `(,@1-7 ("8") ("9")))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(align '(("align" ("left") ("center") ("right"))))
|
2016-03-30 18:40:37 +02:00
|
|
|
|
(ialign '(("align" ("top") ("middle") ("bottom") ("left")
|
|
|
|
|
("right"))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(valign '(("top") ("middle") ("bottom") ("baseline")))
|
|
|
|
|
(rel '(("next") ("previous") ("parent") ("subdocument") ("made")))
|
|
|
|
|
(href '("href" ("ftp:") ("file:") ("finger:") ("gopher:") ("http:")
|
2022-08-02 17:11:29 +02:00
|
|
|
|
("https:") ("mailto:") ("news:") ("rlogin:") ("telnet:") ("tn3270:")
|
1996-01-24 17:12:21 +00:00
|
|
|
|
("wais:") ("/cgi-bin/")))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(name '("name"))
|
|
|
|
|
(link `(,href
|
|
|
|
|
("rel" ,@rel)
|
|
|
|
|
("rev" ,@rel)
|
|
|
|
|
("title")))
|
2001-10-05 16:21:14 +00:00
|
|
|
|
(list '((nil \n ("List item: " "<li>" str
|
2002-03-17 23:55:15 +00:00
|
|
|
|
(if sgml-xml-mode "</li>") \n))))
|
2016-03-30 18:40:37 +02:00
|
|
|
|
(shape '(("shape" ("rect") ("circle") ("poly") ("default"))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(cell `(t
|
2001-06-17 09:01:23 +00:00
|
|
|
|
,@align
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("valign" ,@valign)
|
|
|
|
|
("colspan" ,@1-9)
|
|
|
|
|
("rowspan" ,@1-9)
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("nowrap" t)))
|
|
|
|
|
(cellhalign '(("align" ("left") ("center") ("right")
|
|
|
|
|
("justify") ("char"))
|
|
|
|
|
("char") ("charoff")))
|
|
|
|
|
(cellvalign '(("valign" ("top") ("middle") ("bottom")
|
|
|
|
|
("baseline")))))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
;; put ,-expressions first, else byte-compile chokes (as of V19.29)
|
|
|
|
|
;; and like this it's more efficient anyway
|
|
|
|
|
`(("a" ,name ,@link)
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("area" t ,@shape ("coords") ("href") ("nohref" "nohref") ("alt")
|
|
|
|
|
("tabindex") ("accesskey") ("onfocus") ("onblur"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("base" t ,@href)
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("col" t ,@cellhalign ,@cellvalign ("span") ("width"))
|
|
|
|
|
("colgroup" \n ,@cellhalign ,@cellvalign ("span") ("width"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("dir" ,@list)
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("figcaption")
|
|
|
|
|
("figure" \n)
|
1997-04-23 18:58:33 +00:00
|
|
|
|
("font" nil "size" ("-1") ("+1") ("-2") ("+2") ,@1-7)
|
2001-10-28 04:10:40 +00:00
|
|
|
|
("form" (\n _ \n "<input type=\"submit\" value=\"\""
|
2005-03-08 21:45:00 +00:00
|
|
|
|
(if sgml-xml-mode " />" ">"))
|
1996-01-24 17:12:21 +00:00
|
|
|
|
("action" ,@(cdr href)) ("method" ("get") ("post")))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("h1" ,@align)
|
|
|
|
|
("h2" ,@align)
|
|
|
|
|
("h3" ,@align)
|
|
|
|
|
("h4" ,@align)
|
|
|
|
|
("h5" ,@align)
|
|
|
|
|
("h6" ,@align)
|
|
|
|
|
("hr" t ("size" ,@1-9) ("width") ("noshade" t) ,@align)
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("iframe" \n ,@ialign ("longdesc") ("name") ("src")
|
|
|
|
|
("frameborder" ("1") ("0")) ("marginwidth") ("marginheight")
|
|
|
|
|
("scrolling" ("yes") ("no") ("auto")) ("height") ("width"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("img" t ("align" ,@valign ("texttop") ("absmiddle") ("absbottom"))
|
|
|
|
|
("src") ("alt") ("width" "1") ("height" "1")
|
|
|
|
|
("border" "1") ("vspace" "1") ("hspace" "1") ("ismap" t))
|
2016-12-04 09:34:19 +01:00
|
|
|
|
("input" t ,name ("accept") ("alt") ("autocomplete" ("on") ("off"))
|
|
|
|
|
("autofocus" t) ("checked" t) ("dirname") ("disabled" t) ("form")
|
|
|
|
|
("formaction")
|
|
|
|
|
("formenctype" ("application/x-www-form-urlencoded")
|
|
|
|
|
("multipart/form-data") ("text/plain"))
|
|
|
|
|
("formmethod" ("get") ("post"))
|
|
|
|
|
("formnovalidate" t)
|
|
|
|
|
("formtarget" ("_blank") ("_self") ("_parent") ("_top"))
|
|
|
|
|
("height") ("inputmode") ("list") ("max") ("maxlength") ("min")
|
|
|
|
|
("minlength") ("multiple" t) ("pattern") ("placeholder")
|
|
|
|
|
("readonly" t) ("required" t) ("size") ("src") ("step")
|
|
|
|
|
("type" ("hidden") ("text") ("search") ("tel") ("url") ("email")
|
|
|
|
|
("password") ("date") ("time") ("number") ("range") ("color")
|
|
|
|
|
("checkbox") ("radio") ("file") ("submit") ("image") ("reset")
|
|
|
|
|
("button"))
|
|
|
|
|
("value") ("width"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("link" t ,@link)
|
|
|
|
|
("menu" ,@list)
|
1997-04-23 18:58:33 +00:00
|
|
|
|
("ol" ,@list ("type" ("A") ("a") ("I") ("i") ("1")))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("p" t ,@align)
|
|
|
|
|
("select" (nil \n
|
|
|
|
|
("Text: "
|
2002-03-17 23:55:15 +00:00
|
|
|
|
"<option>" str (if sgml-xml-mode "</option>") \n))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
,name ("size" ,@1-9) ("multiple" t))
|
|
|
|
|
("table" (nil \n
|
|
|
|
|
((completing-read "Cell kind: " '(("td") ("th"))
|
|
|
|
|
nil t "t")
|
2001-10-28 04:10:40 +00:00
|
|
|
|
"<tr><" str ?> _
|
2002-03-17 23:55:15 +00:00
|
|
|
|
(if sgml-xml-mode (concat "<" str "></tr>")) \n))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("border" t ,@1-9) ("width" "10") ("cellpadding"))
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("tbody" \n ,@cellhalign ,@cellvalign)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("td" ,@cell)
|
|
|
|
|
("textarea" ,name ("rows" ,@1-9) ("cols" ,@1-9))
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("tfoot" \n ,@cellhalign ,@cellvalign)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("th" ,@cell)
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("thead" \n ,@cellhalign ,@cellvalign)
|
1997-04-23 18:58:33 +00:00
|
|
|
|
("ul" ,@list ("type" ("disc") ("circle") ("square")))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
,@sgml-tag-alist
|
|
|
|
|
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("abbr")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("acronym")
|
|
|
|
|
("address")
|
|
|
|
|
("array" (nil \n
|
2002-03-17 23:55:15 +00:00
|
|
|
|
("Item: " "<item>" str (if sgml-xml-mode "</item>") \n))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"align")
|
2015-04-28 19:10:01 +02:00
|
|
|
|
("article" \n)
|
|
|
|
|
("aside" \n)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("au")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("audio" \n
|
|
|
|
|
("src") ("crossorigin" ("anonymous") ("use-credentials"))
|
|
|
|
|
("preload" ("none") ("metadata") ("auto"))
|
|
|
|
|
("autoplay" "autoplay") ("mediagroup") ("loop" "loop")
|
|
|
|
|
("muted" "muted") ("controls" "controls"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("b")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("bdi")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("bdo" nil ("lang") ("dir" ("ltr") ("rtl")))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("big")
|
|
|
|
|
("blink")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("blockquote" \n ("cite"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("body" \n ("background" ".gif") ("bgcolor" "#") ("text" "#")
|
|
|
|
|
("link" "#") ("alink" "#") ("vlink" "#"))
|
2002-03-17 23:55:15 +00:00
|
|
|
|
("box" (nil _ "<over>" _ (if sgml-xml-mode "</over>")))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("br" t ("clear" ("left") ("right")))
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("button" nil ("name") ("value")
|
|
|
|
|
("type" ("submit") ("reset") ("button"))
|
|
|
|
|
("disabled" "disabled")
|
|
|
|
|
("tabindex") ("accesskey") ("onfocus") ("onblur"))
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("canvas" \n ("width") ("height"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("caption" ("valign" ("top") ("bottom")))
|
|
|
|
|
("center" \n)
|
|
|
|
|
("cite")
|
|
|
|
|
("code" \n)
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("datalist" \n)
|
2002-03-17 23:55:15 +00:00
|
|
|
|
("dd" ,(not sgml-xml-mode))
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("del" nil ("cite") ("datetime"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("dfn")
|
2019-04-30 16:00:46 -07:00
|
|
|
|
("div" \n ("id") ("class"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("dl" (nil \n
|
|
|
|
|
( "Term: "
|
2002-03-17 23:55:15 +00:00
|
|
|
|
"<dt>" str (if sgml-xml-mode "</dt>")
|
|
|
|
|
"<dd>" _ (if sgml-xml-mode "</dd>") \n)))
|
|
|
|
|
("dt" (t _ (if sgml-xml-mode "</dt>")
|
|
|
|
|
"<dd>" (if sgml-xml-mode "</dd>") \n))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("em")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("embed" t ("src") ("type") ("width") ("height"))
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("fieldset" \n)
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("fn" "id" "fn") ;; Footnotes were deprecated in HTML 3.2
|
2015-04-28 19:10:01 +02:00
|
|
|
|
("footer" \n)
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("frame" t ("longdesc") ("name") ("src")
|
|
|
|
|
("frameborder" ("1") ("0")) ("marginwidth") ("marginheight")
|
|
|
|
|
("noresize" "noresize") ("scrolling" ("yes") ("no") ("auto")))
|
|
|
|
|
("frameset" \n ("rows") ("cols") ("onload") ("onunload"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("head" \n)
|
2015-04-28 19:10:01 +02:00
|
|
|
|
("header" \n)
|
|
|
|
|
("hgroup" \n)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("html" (\n
|
|
|
|
|
"<head>\n"
|
2016-11-04 12:45:51 -04:00
|
|
|
|
"<title>" (setq str (read-string "Title: ")) "</title>\n"
|
1999-02-26 16:40:13 +00:00
|
|
|
|
"</head>\n"
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"<body>\n<h1>" str "</h1>\n" _
|
|
|
|
|
"\n<address>\n<a href=\"mailto:"
|
1996-02-08 17:27:23 +00:00
|
|
|
|
user-mail-address
|
1999-02-26 16:40:13 +00:00
|
|
|
|
"\">" (user-full-name) "</a>\n</address>\n"
|
|
|
|
|
"</body>"
|
|
|
|
|
))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("i")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("ins" nil ("cite") ("datetime"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("isindex" t ("action") ("prompt"))
|
|
|
|
|
("kbd")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("label" nil ("for") ("accesskey") ("onfocus") ("onblur"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("lang")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("legend" nil ("accesskey"))
|
2002-03-17 23:55:15 +00:00
|
|
|
|
("li" ,(not sgml-xml-mode))
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("main" \n)
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("map" \n ("name"))
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("mark")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("math" \n)
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("meta" t ("http-equiv") ("name") ("content") ("scheme"))
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("meter" nil ("value") ("min") ("max") ("low") ("high")
|
|
|
|
|
("optimum"))
|
2015-04-28 19:10:01 +02:00
|
|
|
|
("nav" \n)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("nobr")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("noframes" \n)
|
|
|
|
|
("noscript" \n)
|
|
|
|
|
("object" \n ("declare" "declare") ("classid") ("codebase")
|
|
|
|
|
("data") ("type") ("codetype") ("archive") ("standby")
|
|
|
|
|
("height") ("width") ("usemap") ("name") ("tabindex"))
|
|
|
|
|
("optgroup" \n ("name") ("size") ("multiple" "multiple")
|
|
|
|
|
("disabled" "disabled") ("tabindex") ("onfocus") ("onblur")
|
|
|
|
|
("onchange"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("option" t ("value") ("label") ("selected" t))
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("output" nil ("for") ("form") ("name"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("over" t)
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("param" t ("name") ("value")
|
|
|
|
|
("valuetype" ("data") ("ref") ("object")) ("type"))
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("person") ;; Tag for person's name tag deprecated in HTML 3.2
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("pre" \n)
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("progress" nil ("value") ("max"))
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("q" nil ("cite"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("rev")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("rp" t)
|
|
|
|
|
("rt" t)
|
|
|
|
|
("ruby")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("s")
|
|
|
|
|
("samp")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("script" nil ("charset") ("type") ("src") ("defer" "defer"))
|
2015-04-28 19:10:01 +02:00
|
|
|
|
("section" \n)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("small")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("source" t ("src") ("type") ("media"))
|
2001-10-25 22:25:30 +00:00
|
|
|
|
("span" nil
|
|
|
|
|
("class"
|
|
|
|
|
("builtin")
|
|
|
|
|
("comment")
|
|
|
|
|
("constant")
|
|
|
|
|
("function-name")
|
|
|
|
|
("keyword")
|
|
|
|
|
("string")
|
|
|
|
|
("type")
|
|
|
|
|
("variable-name")
|
|
|
|
|
("warning")))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("strong")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("style" \n ("type") ("media") ("title"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("sub")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("summary")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("sup")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("time" nil ("datetime"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("title")
|
|
|
|
|
("tr" t)
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("track" t
|
|
|
|
|
("kind" ("subtitles") ("captions") ("descriptions")
|
|
|
|
|
("chapters") ("metadata"))
|
|
|
|
|
("src") ("srclang") ("label") ("default"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("tt")
|
|
|
|
|
("u")
|
|
|
|
|
("var")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("video" \n
|
|
|
|
|
("src") ("crossorigin" ("anonymous") ("use-credentials"))
|
|
|
|
|
("poster") ("preload" ("none") ("metadata") ("auto"))
|
|
|
|
|
("autoplay" "autoplay") ("mediagroup") ("loop" "loop")
|
|
|
|
|
("muted" "muted") ("controls" "controls") ("width") ("height"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("wbr" t)))
|
2012-04-09 21:05:48 +08:00
|
|
|
|
"Value of `sgml-tag-alist' for HTML mode.")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(defvar html-tag-help
|
|
|
|
|
`(,@sgml-tag-help
|
|
|
|
|
("a" . "Anchor of point or link elsewhere")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("abbr" . "Abbreviation")
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("acronym" . "Acronym")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("address" . "Formatted mail address")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("area" . "Region of an image map")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("array" . "Math array")
|
2015-04-28 19:10:01 +02:00
|
|
|
|
("article" . "An independent part of document or site")
|
|
|
|
|
("aside" . "Secondary content related to surrounding content (e.g. page or article)")
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("au" . "Author")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("audio" . "Sound or audio stream")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("b" . "Bold face")
|
|
|
|
|
("base" . "Base address for URLs")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("bdi" . "Text isolated for bidirectional formatting")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("bdo" . "Override text directionality")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("big" . "Font size")
|
|
|
|
|
("blink" . "Blinking text")
|
|
|
|
|
("blockquote" . "Indented quotation")
|
|
|
|
|
("body" . "Document body")
|
|
|
|
|
("box" . "Math fraction")
|
|
|
|
|
("br" . "Line break")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("button" . "Clickable button")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("canvas" . "Script generated graphics canvas")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("caption" . "Table caption")
|
|
|
|
|
("center" . "Centered text")
|
|
|
|
|
("changed" . "Change bars")
|
|
|
|
|
("cite" . "Citation of a document")
|
|
|
|
|
("code" . "Formatted source code")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("col" . "Group of attribute specifications for table columns")
|
|
|
|
|
("colgroup" . "Group of columns")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("datalist" . "A set of predefined options")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("dd" . "Definition of term")
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("del" . "Deleted text")
|
|
|
|
|
("dfn" . "Defining instance of a term")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("dir" . "Directory list (obsolete)")
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("div" . "Generic block-level container")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("dl" . "Definition list")
|
2011-11-12 00:17:16 +01:00
|
|
|
|
("dt" . "Term to be defined")
|
2005-06-16 16:23:46 +00:00
|
|
|
|
("em" . "Emphasized")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("embed" . "Embedded data in foreign format")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("fieldset" . "Group of related controls and labels")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("fig" . "Figure")
|
|
|
|
|
("figa" . "Figure anchor")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("figcaption" . "Caption for a figure")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("figd" . "Figure description")
|
|
|
|
|
("figt" . "Figure text")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("figure" . "Self-contained content, often with a caption")
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("fn" . "Footnote") ;; No one supports special footnote rendering.
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("font" . "Font size")
|
2015-04-28 19:10:01 +02:00
|
|
|
|
("footer" . "Footer of a section")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("form" . "Form with input fields")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("frame" . "Frame in which another HTML document can be displayed")
|
|
|
|
|
("frameset" . "Container for frames")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("group" . "Document grouping")
|
|
|
|
|
("h1" . "Most important section headline")
|
|
|
|
|
("h2" . "Important section headline")
|
|
|
|
|
("h3" . "Section headline")
|
|
|
|
|
("h4" . "Minor section headline")
|
|
|
|
|
("h5" . "Unimportant section headline")
|
|
|
|
|
("h6" . "Least important section headline")
|
|
|
|
|
("head" . "Document header")
|
2015-04-28 19:10:01 +02:00
|
|
|
|
("header" . "Header of a section")
|
|
|
|
|
("hgroup" . "Group of headings - h1-h6 elements")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("hr" . "Horizontal rule")
|
|
|
|
|
("html" . "HTML Document")
|
|
|
|
|
("i" . "Italic face")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("iframe" . "Inline frame with a nested browsing context")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("img" . "Graphic image")
|
|
|
|
|
("input" . "Form input field")
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("ins" . "Inserted text")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("isindex" . "Input field for index search")
|
2011-11-12 23:48:23 -08:00
|
|
|
|
("kbd" . "Keyboard example face")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("label" . "Caption for a user interface item")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("lang" . "Natural language")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("legend" . "Caption for a fieldset")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("li" . "List item")
|
|
|
|
|
("link" . "Link relationship")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("main" . "Main content of the document body")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("map" . "Image map (a clickable link area")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("mark" . "Highlighted text")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("math" . "Math formula")
|
2015-04-28 19:10:01 +02:00
|
|
|
|
("menu" . "List of commands")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("meta" . "Document properties")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("meter" . "Scalar measurement within a known range")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("mh" . "Form mail header")
|
2015-04-28 19:10:01 +02:00
|
|
|
|
("nav" . "Group of navigational links")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("nextid" . "Allocate new id")
|
|
|
|
|
("nobr" . "Text without line break")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("noframes" . "Content for user agents that don't support frames")
|
|
|
|
|
("noscript" . "Alternate content for when a script isn't executed")
|
|
|
|
|
("object" . "External resource")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("ol" . "Ordered list")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("optgroup" . "Group of options")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("option" . "Selection list item")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("output" . "Result of a calculation or user action")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("over" . "Math fraction rule")
|
|
|
|
|
("p" . "Paragraph start")
|
|
|
|
|
("panel" . "Floating panel")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("param" . "Parameters for an object")
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("person" . "Person's name")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("pre" . "Preformatted fixed width text")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("progress" . "Completion progress of a task")
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("q" . "Quotation")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("rev" . "Reverse video")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("rp" . "Fallback text for when ruby annotations aren't supported")
|
|
|
|
|
("rt" . "Ruby text component of a ruby annotation")
|
|
|
|
|
("ruby" . "Ruby annotation")
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("s" . "Strikeout")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("samp" . "Sample text")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("script" . "Executable script within a document")
|
2015-04-28 19:10:01 +02:00
|
|
|
|
("section" . "Section of a document")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("select" . "Selection list")
|
|
|
|
|
("small" . "Font size")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("source" . "Media resource for media elements")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("sp" . "Nobreak space")
|
2009-10-18 04:06:32 +00:00
|
|
|
|
("span" . "Generic inline container")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("strong" . "Standout text")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("style" . "Style information")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("sub" . "Subscript")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("summary" . "Summary, caption, or legend")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("sup" . "Superscript")
|
|
|
|
|
("table" . "Table with rows and columns")
|
|
|
|
|
("tb" . "Table vertical break")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("tbody" . "Table body")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("td" . "Table data cell")
|
|
|
|
|
("textarea" . "Form multiline edit area")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("tfoot" . "Table foot")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("th" . "Table header cell")
|
2016-03-30 18:40:37 +02:00
|
|
|
|
("thead" . "Table head")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("time" . "Content with optional machine-readable timestamp")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("title" . "Document title")
|
|
|
|
|
("tr" . "Table row separator")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("track" . "Timed text track for media elements")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("tt" . "Typewriter face")
|
|
|
|
|
("u" . "Underlined text")
|
|
|
|
|
("ul" . "Unordered list")
|
|
|
|
|
("var" . "Math variable face")
|
2016-04-15 17:36:10 +02:00
|
|
|
|
("video" . "Video or movie")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
("wbr" . "Enable <br> within <nobr>"))
|
Disambiguate function and variable references in docstrings.
* lisp/comint.el (comint-history-isearch-message): Fix ambiguous doc
string cross-reference(s).
* lisp/ffap.el (ffap-string-at-point-region, ffap-next)
(ffap-string-at-point, ffap-string-around)
(ffap-copy-string-as-kill, ffap-highlight-overlay)
(ffap-literally): Fix ambiguous doc string cross-reference(s).
* lisp/font-lock.el (font-lock-keywords-alist)
(font-lock-removed-keywords-alist): Fix ambiguous doc string
cross-reference(s).
* lisp/help-mode.el (help-xref-symbol-regexp): Add "call" as a hint for
a cross-reference to a function.
* lisp/info.el (Info-find-emacs-command-nodes): Fix ambiguous doc
string cross-reference(s).
* lisp/isearch.el (isearch-message-function, isearch-fail-pos): Fix
ambiguous doc string cross-reference(s).
* lisp/misearch.el (multi-isearch-next-buffer-function): Fix ambiguous
doc string cross-reference(s).
* lisp/newcomment.el (comment-box): Fix ambiguous doc string
cross-reference(s).
* lisp/printing.el (pr-txt-printer-alist, pr-ps-printer-alist)
(pr-setting-database): Fix ambiguous doc string
cross-reference(s).
* lisp/ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces)
(ps-n-up-filling-database): Fix ambiguous doc string
cross-reference(s).
* lisp/server.el (server-buffer, server-log): Fix ambiguous doc string
cross-reference(s).
* lisp/simple.el (newline, delete-backward-char, delete-forward-char)
(minibuffer-history-isearch-message, kill-line, track-eol)
(temporary-goal-column): Fix ambiguous doc string
cross-reference(s).
* lisp/whitespace.el (whitespace-point)
(whitespace-font-lock-refontify, whitespace-bob-marker)
(whitespace-eob-marker): Fix ambiguous doc string
cross-reference(s).
* lisp/calc/calc.el (calc-highlight-selections-with-faces)
(calc-dispatch): Fix ambiguous doc string cross-reference(s).
* lisp/emacs-lisp/edebug.el (edebug-read, edebug-eval-defun): Fix
ambiguous doc string cross-reference(s).
* lisp/gnus/gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string
cross-reference(s).
* lisp/gnus/gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string
cross-reference(s).
* lisp/international/mule.el (add-to-coding-system-list): Fix ambiguous
doc string cross-reference(s).
* lisp/progmodes/cc-fonts.el (c-font-lock-keywords-3)
(c++-font-lock-keywords-3, objc-font-lock-keywords-3)
(java-font-lock-keywords-3, idl-font-lock-keywords-3)
(pike-font-lock-keywords-3): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/compile.el (compile): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/etags.el (tags-table-files)
(tags-table-files-function, tags-included-tables-function): Fix
ambiguous doc string cross-reference(s).
* lisp/progmodes/gdb-mi.el (gdb, gdb-setup-windows)
(gdb-restore-windows): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-flag)
(flyspell-default-deplacement-commands): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/ispell.el (ispell-accept-output): Fix ambiguous doc
string cross-reference(s).
* lisp/textmodes/sgml-mode.el (html-tag-help): Fix ambiguous doc string
cross-reference(s).
* lisp/vc/compare-w.el (compare-ignore-whitespace)
(compare-ignore-case, compare-windows-dehighlight): Fix ambiguous
doc string cross-reference(s).
* lisp/vc/diff.el (diff): Fix ambiguous doc string cross-reference(s).
* src/insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
ambiguous doc string cross-reference(s).
* src/keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
doc string cross-reference(s).
* src/window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
string cross-reference(s).
Fixes: debbugs:12686
2013-01-11 18:08:55 -05:00
|
|
|
|
"Value of variable `sgml-tag-help' for HTML mode.")
|
2002-04-09 12:02:20 +00:00
|
|
|
|
|
2012-09-27 00:21:51 -07:00
|
|
|
|
(defvar outline-regexp)
|
|
|
|
|
(defvar outline-heading-end-regexp)
|
|
|
|
|
(defvar outline-level)
|
|
|
|
|
|
2012-12-01 13:51:33 +08:00
|
|
|
|
(defun html-current-defun-name ()
|
|
|
|
|
"Return the name of the last HTML title or heading, or nil."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(if (re-search-backward
|
|
|
|
|
(concat
|
|
|
|
|
"<[ \t\r\n]*"
|
|
|
|
|
"\\(?:[hH][0-6]\\|title\\|TITLE\\|Title\\)"
|
|
|
|
|
"[^>]*>"
|
|
|
|
|
"[ \t\r\n]*"
|
|
|
|
|
"\\([^<\r\n]*[^ <\t\r\n]+\\)")
|
|
|
|
|
nil t)
|
|
|
|
|
(match-string-no-properties 1))))
|
|
|
|
|
|
Prefer defvar-local in textmodes/*.el
This skips libraries that might want compatibility with Emacs 24.2.
* lisp/textmodes/artist.el (artist-curr-go)
(artist-line-char-set, artist-line-char, artist-fill-char-set)
(artist-fill-char, artist-erase-char, artist-default-fill-char)
(artist-draw-region-min-y, artist-draw-region-max-y)
(artist-borderless-shapes):
* lisp/textmodes/css-mode.el (css--at-ids, css--bang-ids)
(css--nested-selectors-allowed):
* lisp/textmodes/enriched.el (enriched-old-bindings):
* lisp/textmodes/flyspell.el (flyspell-generic-check-word-predicate)
(flyspell-consider-dash-as-word-delimiter-flag)
(flyspell-dash-dictionary, flyspell-dash-local-dictionary)
(flyspell-word-cache-start, flyspell-word-cache-end)
(flyspell-word-cache-word, flyspell-word-cache-result)
(flyspell-changes, flyspell-auto-correct-pos)
(flyspell-auto-correct-region, flyspell-auto-correct-ring)
(flyspell-auto-correct-word):
* lisp/textmodes/ispell.el (ispell-local-dictionary-overridden)
(ispell-local-pdict, ispell-buffer-session-localwords):
* lisp/textmodes/refill.el (refill-ignorable-overlay)
(refill-doit):
* lisp/textmodes/sgml-mode.el (html--buffer-classes-cache)
(html--buffer-ids-cache):
* lisp/textmodes/table.el (table-mode-indicator):
* lisp/textmodes/tex-mode.el (tex-send-command-modified-tick):
* lisp/textmodes/two-column.el (2C-autoscroll-start, 2C-mode):
Prefer defvar-local.
2021-01-31 18:45:47 +01:00
|
|
|
|
(defvar-local html--buffer-classes-cache nil
|
2016-09-24 13:55:36 +02:00
|
|
|
|
"Cache for `html-current-buffer-classes'.
|
|
|
|
|
When set, this should be a cons cell where the CAR is the
|
|
|
|
|
buffer's tick counter (as produced by `buffer-modified-tick'),
|
|
|
|
|
and the CDR is the list of class names found in the buffer.")
|
|
|
|
|
|
Prefer defvar-local in textmodes/*.el
This skips libraries that might want compatibility with Emacs 24.2.
* lisp/textmodes/artist.el (artist-curr-go)
(artist-line-char-set, artist-line-char, artist-fill-char-set)
(artist-fill-char, artist-erase-char, artist-default-fill-char)
(artist-draw-region-min-y, artist-draw-region-max-y)
(artist-borderless-shapes):
* lisp/textmodes/css-mode.el (css--at-ids, css--bang-ids)
(css--nested-selectors-allowed):
* lisp/textmodes/enriched.el (enriched-old-bindings):
* lisp/textmodes/flyspell.el (flyspell-generic-check-word-predicate)
(flyspell-consider-dash-as-word-delimiter-flag)
(flyspell-dash-dictionary, flyspell-dash-local-dictionary)
(flyspell-word-cache-start, flyspell-word-cache-end)
(flyspell-word-cache-word, flyspell-word-cache-result)
(flyspell-changes, flyspell-auto-correct-pos)
(flyspell-auto-correct-region, flyspell-auto-correct-ring)
(flyspell-auto-correct-word):
* lisp/textmodes/ispell.el (ispell-local-dictionary-overridden)
(ispell-local-pdict, ispell-buffer-session-localwords):
* lisp/textmodes/refill.el (refill-ignorable-overlay)
(refill-doit):
* lisp/textmodes/sgml-mode.el (html--buffer-classes-cache)
(html--buffer-ids-cache):
* lisp/textmodes/table.el (table-mode-indicator):
* lisp/textmodes/tex-mode.el (tex-send-command-modified-tick):
* lisp/textmodes/two-column.el (2C-autoscroll-start, 2C-mode):
Prefer defvar-local.
2021-01-31 18:45:47 +01:00
|
|
|
|
(defvar-local html--buffer-ids-cache nil
|
2016-09-24 13:55:36 +02:00
|
|
|
|
"Cache for `html-current-buffer-ids'.
|
|
|
|
|
When set, this should be a cons cell where the CAR is the
|
|
|
|
|
buffer's tick counter (as produced by `buffer-modified-tick'),
|
|
|
|
|
and the CDR is the list of class names found in the buffer.")
|
|
|
|
|
|
2018-02-26 22:47:27 -08:00
|
|
|
|
(declare-function libxml-parse-html-region "xml.c"
|
|
|
|
|
(start end &optional base-url discard-comments))
|
|
|
|
|
|
2016-09-24 13:55:36 +02:00
|
|
|
|
(defun html-current-buffer-classes ()
|
|
|
|
|
"Return a list of class names used in the current buffer.
|
|
|
|
|
The result is cached in `html--buffer-classes-cache'."
|
|
|
|
|
(let ((tick (buffer-modified-tick)))
|
|
|
|
|
(if (eq (car html--buffer-classes-cache) tick)
|
|
|
|
|
(cdr html--buffer-classes-cache)
|
|
|
|
|
(let* ((dom (libxml-parse-html-region (point-min) (point-max)))
|
|
|
|
|
(classes
|
|
|
|
|
(seq-mapcat
|
|
|
|
|
(lambda (el)
|
2017-09-12 13:08:47 -04:00
|
|
|
|
(when-let* ((class-list
|
|
|
|
|
(cdr (assq 'class (dom-attributes el)))))
|
2016-09-24 13:55:36 +02:00
|
|
|
|
(split-string class-list)))
|
|
|
|
|
(dom-by-class dom ""))))
|
|
|
|
|
(setq-local html--buffer-classes-cache (cons tick classes))
|
|
|
|
|
classes))))
|
|
|
|
|
|
|
|
|
|
(defun html-current-buffer-ids ()
|
|
|
|
|
"Return a list of IDs used in the current buffer.
|
|
|
|
|
The result is cached in `html--buffer-ids-cache'."
|
|
|
|
|
(let ((tick (buffer-modified-tick)))
|
|
|
|
|
(if (eq (car html--buffer-ids-cache) tick)
|
|
|
|
|
(cdr html--buffer-ids-cache)
|
|
|
|
|
(let* ((dom
|
|
|
|
|
(libxml-parse-html-region (point-min) (point-max)))
|
|
|
|
|
(ids
|
|
|
|
|
(seq-mapcat
|
|
|
|
|
(lambda (el)
|
2017-09-12 13:08:47 -04:00
|
|
|
|
(when-let* ((id-list
|
|
|
|
|
(cdr (assq 'id (dom-attributes el)))))
|
2016-09-24 13:55:36 +02:00
|
|
|
|
(split-string id-list)))
|
|
|
|
|
(dom-by-id dom ""))))
|
|
|
|
|
(setq-local html--buffer-ids-cache (cons tick ids))
|
|
|
|
|
ids))))
|
|
|
|
|
|
1998-06-27 19:46:22 +00:00
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
;;;###autoload
|
2007-06-17 13:55:17 +00:00
|
|
|
|
(define-derived-mode html-mode sgml-mode '(sgml-xml-mode "XHTML" "HTML")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"Major mode based on SGML mode for editing HTML documents.
|
1998-11-06 09:31:52 +00:00
|
|
|
|
This allows inserting skeleton constructs used in hypertext documents with
|
1996-01-24 17:12:21 +00:00
|
|
|
|
completion. See below for an introduction to HTML. Use
|
|
|
|
|
\\[browse-url-of-buffer] to see how this comes out. See also `sgml-mode' on
|
|
|
|
|
which this is based.
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
1996-01-24 17:12:21 +00:00
|
|
|
|
Do \\[describe-variable] html- SPC and \\[describe-variable] sgml- SPC to see available variables.
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
To write fairly well formatted pages you only need to know few things. Most
|
|
|
|
|
browsers have a function to read the source code of the page being seen, so
|
|
|
|
|
you can imitate various tricks. Here's a very short HTML primer which you
|
|
|
|
|
can also view with a browser to see what happens:
|
|
|
|
|
|
|
|
|
|
<title>A Title Describing Contents</title> should be on every page. Pages can
|
|
|
|
|
have <h1>Very Major Headlines</h1> through <h6>Very Minor Headlines</h6>
|
|
|
|
|
<hr> Parts can be separated with horizontal rules.
|
|
|
|
|
|
2021-09-16 16:03:36 +02:00
|
|
|
|
<p>Paragraphs only need an opening tag. Line breaks and multiple
|
|
|
|
|
spaces are ignored unless the text is <pre>preformatted.</pre>
|
|
|
|
|
Text can be marked as <strong>bold</strong>, <em>italic</em> or
|
|
|
|
|
<u>underlined</u> using the facemenu M-o or Edit/Text
|
|
|
|
|
Properties/Face commands.
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
Pages can have <a name=\"SOMENAME\">named points</a> and can link other points
|
|
|
|
|
to them with <a href=\"#SOMENAME\">see also somename</a>. In the same way <a
|
|
|
|
|
href=\"URL\">see also URL</a> where URL is a filename relative to current
|
2021-03-24 09:28:32 +01:00
|
|
|
|
directory, or absolute as in `https://www.cs.indiana.edu/elisp/w3/docs.html'.
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
Images in many formats can be inlined with <img src=\"URL\">.
|
|
|
|
|
|
1997-04-24 19:37:13 +00:00
|
|
|
|
If you mainly create your own documents, `sgml-specials' might be
|
|
|
|
|
interesting. But note that some HTML 2 browsers can't handle `''.
|
|
|
|
|
To work around that, do:
|
2015-09-03 15:31:12 -07:00
|
|
|
|
(eval-after-load \"sgml-mode\" \\='(aset sgml-char-names ?\\=' nil))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
\\{html-mode-map}"
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
(setq-local sgml-display-text html-display-text)
|
|
|
|
|
(setq-local sgml-tag-face-alist html-tag-face-alist)
|
|
|
|
|
(setq-local sgml-tag-alist html-tag-alist)
|
|
|
|
|
(setq-local sgml-face-tag-alist html-face-tag-alist)
|
|
|
|
|
(setq-local sgml-tag-help html-tag-help)
|
|
|
|
|
(setq-local outline-regexp "^.*<[Hh][1-6]\\>")
|
|
|
|
|
(setq-local outline-heading-end-regexp "</[Hh][1-6]>")
|
|
|
|
|
(setq-local outline-level
|
|
|
|
|
(lambda () (char-before (match-end 0))))
|
2012-12-01 13:51:33 +08:00
|
|
|
|
(setq-local add-log-current-defun-function #'html-current-defun-name)
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
(setq-local sentence-end-base "[.?!][]\"'”)}]*\\(<[^>]*>\\)*")
|
2022-06-15 18:29:42 +02:00
|
|
|
|
(add-hook 'completion-at-point-functions 'html-mode--complete-at-point nil t)
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
|
2016-09-24 13:55:36 +02:00
|
|
|
|
(when (fboundp 'libxml-parse-html-region)
|
|
|
|
|
(defvar css-class-list-function)
|
|
|
|
|
(setq-local css-class-list-function #'html-current-buffer-classes)
|
|
|
|
|
(defvar css-id-list-function)
|
|
|
|
|
(setq-local css-id-list-function #'html-current-buffer-ids))
|
|
|
|
|
|
1998-06-27 19:46:22 +00:00
|
|
|
|
(setq imenu-create-index-function 'html-imenu-index)
|
2021-11-08 01:40:58 +01:00
|
|
|
|
(yank-media-handler 'text/html #'html-mode--html-yank-handler)
|
|
|
|
|
(yank-media-handler "image/.*" #'html-mode--image-yank-handler)
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
|
|
|
|
|
(setq-local sgml-empty-tags
|
|
|
|
|
;; From HTML-4.01's loose.dtd, parsed with
|
2021-01-30 07:47:34 +01:00
|
|
|
|
;; `sgml-parse-dtd', plus manual additions of "source" and "wbr".
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
'("area" "base" "basefont" "br" "col" "frame" "hr" "img" "input"
|
2021-01-30 07:47:34 +01:00
|
|
|
|
"isindex" "link" "meta" "source" "param" "wbr"))
|
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
2012-12-01 12:09:55 +08:00
|
|
|
|
(setq-local sgml-unclosed-tags
|
|
|
|
|
;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd'.
|
|
|
|
|
'("body" "colgroup" "dd" "dt" "head" "html" "li" "option"
|
|
|
|
|
"p" "tbody" "td" "tfoot" "th" "thead" "tr"))
|
2001-06-17 09:01:23 +00:00
|
|
|
|
;; It's for the user to decide if it defeats it or not -stef
|
|
|
|
|
;; (make-local-variable 'imenu-sort-function)
|
|
|
|
|
;; (setq imenu-sort-function nil) ; sorting the menu defeats the purpose
|
2001-10-25 22:25:30 +00:00
|
|
|
|
)
|
2002-04-09 12:02:20 +00:00
|
|
|
|
|
2022-06-15 18:29:42 +02:00
|
|
|
|
(defun html-mode--complete-at-point ()
|
|
|
|
|
;; Complete a tag like <colg etc.
|
|
|
|
|
(or
|
|
|
|
|
(when-let ((tag (save-excursion
|
|
|
|
|
(and (looking-back "<\\([^ \t\n]*\\)"
|
|
|
|
|
(line-beginning-position))
|
|
|
|
|
(match-string 1)))))
|
|
|
|
|
(list (match-beginning 1) (point)
|
|
|
|
|
(mapcar #'car html-tag-alist)))
|
|
|
|
|
;; Complete params like <colgroup ali etc.
|
|
|
|
|
(when-let ((tag (save-excursion (sgml-beginning-of-tag)))
|
|
|
|
|
(params (seq-filter #'consp (cdr (assoc tag html-tag-alist))))
|
|
|
|
|
(param (save-excursion
|
|
|
|
|
(and (looking-back "[ \t\n]\\([^= \t\n]*\\)"
|
|
|
|
|
(line-beginning-position))
|
|
|
|
|
(match-string 1)))))
|
|
|
|
|
(list (match-beginning 1) (point)
|
|
|
|
|
(mapcar #'car params)))
|
|
|
|
|
;; Complete param values like <colgroup align=mi etc.
|
|
|
|
|
(when-let ((tag (save-excursion (sgml-beginning-of-tag)))
|
|
|
|
|
(params (seq-filter #'consp (cdr (assoc tag html-tag-alist))))
|
|
|
|
|
(param (save-excursion
|
|
|
|
|
(and (looking-back
|
|
|
|
|
"[ \t\n]\\([^= \t\n]+\\)=\\([^= \t\n]*\\)"
|
|
|
|
|
(line-beginning-position))
|
|
|
|
|
(match-string 1))))
|
|
|
|
|
(values (cdr (assoc param params))))
|
|
|
|
|
(list (match-beginning 2) (point)
|
|
|
|
|
(mapcar #'car values)))))
|
|
|
|
|
|
2021-11-06 22:45:05 +01:00
|
|
|
|
(defun html-mode--html-yank-handler (_type html)
|
|
|
|
|
(save-restriction
|
|
|
|
|
(insert html)
|
2021-11-08 06:04:11 +01:00
|
|
|
|
(ignore-errors
|
|
|
|
|
(sgml-pretty-print (point-min) (point-max)))))
|
2021-11-06 22:45:05 +01:00
|
|
|
|
|
2021-11-07 00:08:36 +01:00
|
|
|
|
(defun html-mode--image-yank-handler (type image)
|
2021-11-07 02:34:54 +01:00
|
|
|
|
(let ((file (read-file-name (format "Save %s image to: " type))))
|
2021-11-07 00:08:36 +01:00
|
|
|
|
(when (file-directory-p file)
|
|
|
|
|
(user-error "%s is a directory"))
|
|
|
|
|
(when (and (file-exists-p file)
|
2021-11-07 02:34:54 +01:00
|
|
|
|
(not (yes-or-no-p (format "%s exists; overwrite?" file))))
|
2021-11-07 00:08:36 +01:00
|
|
|
|
(user-error "%s exists"))
|
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(set-buffer-multibyte nil)
|
|
|
|
|
(insert image)
|
|
|
|
|
(write-region (point-min) (point-max) file))
|
2021-11-07 02:34:54 +01:00
|
|
|
|
(insert (format "<img src=%S>\n" (file-relative-name file)))
|
2021-11-07 00:08:36 +01:00
|
|
|
|
(insert-image
|
|
|
|
|
(create-image file (mailcap-mime-type-to-extension type) nil
|
|
|
|
|
:max-width 200
|
|
|
|
|
:max-height 200)
|
2021-11-07 02:34:54 +01:00
|
|
|
|
" ")))
|
2021-11-07 00:08:36 +01:00
|
|
|
|
|
1998-06-27 19:46:22 +00:00
|
|
|
|
(defvar html-imenu-regexp
|
|
|
|
|
"\\s-*<h\\([1-9]\\)[^\n<>]*>\\(<[^\n<>]*>\\)*\\s-*\\([^\n<>]*\\)"
|
2012-04-09 21:05:48 +08:00
|
|
|
|
"A regular expression matching a head line to be added to the menu.
|
1998-06-27 19:46:22 +00:00
|
|
|
|
The first `match-string' should be a number from 1-9.
|
|
|
|
|
The second `match-string' matches extra tags and is ignored.
|
|
|
|
|
The third `match-string' will be the used in the menu.")
|
|
|
|
|
|
|
|
|
|
(defun html-imenu-index ()
|
2002-10-18 08:30:49 +00:00
|
|
|
|
"Return a table of contents for an HTML buffer for use with Imenu."
|
1998-06-27 19:46:22 +00:00
|
|
|
|
(let (toc-index)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(while (re-search-forward html-imenu-regexp nil t)
|
|
|
|
|
(setq toc-index
|
|
|
|
|
(cons (cons (concat (make-string
|
|
|
|
|
(* 2 (1- (string-to-number (match-string 1))))
|
2005-07-04 03:37:24 +00:00
|
|
|
|
?\s)
|
1998-06-27 19:46:22 +00:00
|
|
|
|
(match-string 3))
|
2001-10-26 17:40:59 +00:00
|
|
|
|
(line-beginning-position))
|
1998-06-27 19:46:22 +00:00
|
|
|
|
toc-index))))
|
|
|
|
|
(nreverse toc-index)))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
2002-11-12 16:46:19 +00:00
|
|
|
|
(define-minor-mode html-autoview-mode
|
2011-10-19 20:26:14 -04:00
|
|
|
|
"Toggle viewing of HTML files on save (HTML Autoview mode).
|
|
|
|
|
|
|
|
|
|
HTML Autoview mode is a buffer-local minor mode for use with
|
|
|
|
|
`html-mode'. If enabled, saving the file automatically runs
|
|
|
|
|
`browse-url-of-buffer' to view it."
|
2021-04-11 23:47:14 -04:00
|
|
|
|
:lighter nil
|
2002-11-12 16:46:19 +00:00
|
|
|
|
(if html-autoview-mode
|
2019-01-17 18:25:00 -05:00
|
|
|
|
(add-hook 'after-save-hook #'browse-url-of-buffer nil t)
|
|
|
|
|
(remove-hook 'after-save-hook #'browse-url-of-buffer t)))
|
2002-04-09 12:02:20 +00:00
|
|
|
|
|
1998-06-27 19:46:22 +00:00
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(define-skeleton html-href-anchor
|
|
|
|
|
"HTML anchor tag with href attribute."
|
1997-04-16 21:43:01 +00:00
|
|
|
|
"URL: "
|
2005-03-08 21:45:00 +00:00
|
|
|
|
;; '(setq input "http:")
|
1997-04-16 21:43:01 +00:00
|
|
|
|
"<a href=\"" str "\">" _ "</a>")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
2020-08-06 15:11:48 +02:00
|
|
|
|
(define-skeleton html-href-anchor-file
|
|
|
|
|
"HTML anchor tag with href attribute (from a local file)."
|
|
|
|
|
(file-relative-name (read-file-name "File name: ") default-directory)
|
|
|
|
|
"<a href=\"" str "\">" _ "</a>")
|
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(define-skeleton html-name-anchor
|
|
|
|
|
"HTML anchor tag with name attribute."
|
1997-04-16 21:43:01 +00:00
|
|
|
|
"Name: "
|
2005-03-08 21:45:00 +00:00
|
|
|
|
"<a name=\"" str "\""
|
|
|
|
|
(if sgml-xml-mode (concat " id=\"" str "\""))
|
|
|
|
|
">" _ "</a>")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
2019-11-03 16:06:26 +01:00
|
|
|
|
(define-skeleton html-id-anchor
|
|
|
|
|
"HTML anchor tag with id attribute."
|
|
|
|
|
"ID: "
|
|
|
|
|
"<a id=\"" str "\">" _ "</a>")
|
|
|
|
|
|
1996-06-15 23:19:40 +00:00
|
|
|
|
(define-skeleton html-headline-1
|
|
|
|
|
"HTML level 1 headline tags."
|
|
|
|
|
nil
|
|
|
|
|
"<h1>" _ "</h1>")
|
|
|
|
|
|
|
|
|
|
(define-skeleton html-headline-2
|
|
|
|
|
"HTML level 2 headline tags."
|
|
|
|
|
nil
|
|
|
|
|
"<h2>" _ "</h2>")
|
|
|
|
|
|
|
|
|
|
(define-skeleton html-headline-3
|
|
|
|
|
"HTML level 3 headline tags."
|
|
|
|
|
nil
|
|
|
|
|
"<h3>" _ "</h3>")
|
|
|
|
|
|
|
|
|
|
(define-skeleton html-headline-4
|
|
|
|
|
"HTML level 4 headline tags."
|
|
|
|
|
nil
|
|
|
|
|
"<h4>" _ "</h4>")
|
|
|
|
|
|
|
|
|
|
(define-skeleton html-headline-5
|
|
|
|
|
"HTML level 5 headline tags."
|
|
|
|
|
nil
|
|
|
|
|
"<h5>" _ "</h5>")
|
|
|
|
|
|
|
|
|
|
(define-skeleton html-headline-6
|
|
|
|
|
"HTML level 6 headline tags."
|
|
|
|
|
nil
|
|
|
|
|
"<h6>" _ "</h6>")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(define-skeleton html-horizontal-rule
|
|
|
|
|
"HTML horizontal rule tag."
|
|
|
|
|
nil
|
2005-03-08 21:45:00 +00:00
|
|
|
|
(if sgml-xml-mode "<hr />" "<hr>") \n)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(define-skeleton html-image
|
|
|
|
|
"HTML image tag."
|
2005-03-08 21:45:00 +00:00
|
|
|
|
"Image URL: "
|
|
|
|
|
"<img src=\"" str "\" alt=\"" _ "\""
|
|
|
|
|
(if sgml-xml-mode " />" ">"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(define-skeleton html-line
|
|
|
|
|
"HTML line break tag."
|
|
|
|
|
nil
|
2005-03-08 21:45:00 +00:00
|
|
|
|
(if sgml-xml-mode "<br />" "<br>") \n)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
1996-06-15 23:19:40 +00:00
|
|
|
|
(define-skeleton html-ordered-list
|
|
|
|
|
"HTML ordered list tags."
|
|
|
|
|
nil
|
2019-04-30 16:00:46 -07:00
|
|
|
|
\n "<ol>" \n
|
2002-03-17 23:55:15 +00:00
|
|
|
|
"<li>" _ (if sgml-xml-mode "</li>") \n
|
2019-04-30 16:00:46 -07:00
|
|
|
|
"</ol>" > \n)
|
1996-06-15 23:19:40 +00:00
|
|
|
|
|
|
|
|
|
(define-skeleton html-unordered-list
|
|
|
|
|
"HTML unordered list tags."
|
|
|
|
|
nil
|
2019-04-30 16:00:46 -07:00
|
|
|
|
\n "<ul>" \n
|
2002-03-17 23:55:15 +00:00
|
|
|
|
"<li>" _ (if sgml-xml-mode "</li>") \n
|
2019-04-30 16:00:46 -07:00
|
|
|
|
"</ul>" > \n)
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(define-skeleton html-list-item
|
|
|
|
|
"HTML list item tag."
|
|
|
|
|
nil
|
|
|
|
|
(if (bolp) nil '\n)
|
2002-03-17 23:55:15 +00:00
|
|
|
|
"<li>" _ (if sgml-xml-mode "</li>"))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
|
|
|
|
(define-skeleton html-paragraph
|
|
|
|
|
"HTML paragraph tag."
|
|
|
|
|
nil
|
2019-04-30 16:00:46 -07:00
|
|
|
|
\n "<p>" _ (if sgml-xml-mode "</p>"))
|
|
|
|
|
|
|
|
|
|
(define-skeleton html-div
|
|
|
|
|
"HTML div tag."
|
|
|
|
|
nil
|
|
|
|
|
"<div>" > \n _ \n "</div>" >)
|
|
|
|
|
|
|
|
|
|
(define-skeleton html-span
|
|
|
|
|
"HTML span tag."
|
|
|
|
|
nil
|
|
|
|
|
"<span>" > _ "</span>")
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
1996-01-24 17:12:21 +00:00
|
|
|
|
(define-skeleton html-checkboxes
|
|
|
|
|
"Group of connected checkbox inputs."
|
|
|
|
|
nil
|
1997-04-16 21:43:01 +00:00
|
|
|
|
'(setq v1 nil
|
|
|
|
|
v2 nil)
|
|
|
|
|
("Value: "
|
1997-04-23 18:58:33 +00:00
|
|
|
|
"<input type=\"" (identity "checkbox") ; see comment above about identity
|
1997-04-16 21:43:01 +00:00
|
|
|
|
"\" name=\"" (or v1 (setq v1 (skeleton-read "Name: ")))
|
1996-01-24 17:12:21 +00:00
|
|
|
|
"\" value=\"" str ?\"
|
2001-10-05 16:21:14 +00:00
|
|
|
|
(when (y-or-n-p "Set \"checked\" attribute? ")
|
2006-05-21 22:19:59 +00:00
|
|
|
|
(funcall skeleton-transformation-function
|
2005-03-08 21:45:00 +00:00
|
|
|
|
(if sgml-xml-mode " checked=\"checked\"" " checked")))
|
|
|
|
|
(if sgml-xml-mode " />" ">")
|
1997-04-16 21:43:01 +00:00
|
|
|
|
(skeleton-read "Text: " (capitalize str))
|
|
|
|
|
(or v2 (setq v2 (if (y-or-n-p "Newline after text? ")
|
2006-05-21 22:19:59 +00:00
|
|
|
|
(funcall skeleton-transformation-function
|
2005-03-08 21:45:00 +00:00
|
|
|
|
(if sgml-xml-mode "<br />" "<br>"))
|
1997-04-16 21:43:01 +00:00
|
|
|
|
"")))
|
|
|
|
|
\n))
|
1996-01-24 17:12:21 +00:00
|
|
|
|
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
(define-skeleton html-radio-buttons
|
|
|
|
|
"Group of connected radio button inputs."
|
|
|
|
|
nil
|
1997-04-16 21:43:01 +00:00
|
|
|
|
'(setq v1 nil
|
|
|
|
|
v2 (cons nil nil))
|
|
|
|
|
("Value: "
|
1997-04-23 18:58:33 +00:00
|
|
|
|
"<input type=\"" (identity "radio") ; see comment above about identity
|
1997-04-16 21:43:01 +00:00
|
|
|
|
"\" name=\"" (or (car v2) (setcar v2 (skeleton-read "Name: ")))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
"\" value=\"" str ?\"
|
2001-10-05 16:21:14 +00:00
|
|
|
|
(when (and (not v1) (setq v1 (y-or-n-p "Set \"checked\" attribute? ")))
|
2006-05-21 22:19:59 +00:00
|
|
|
|
(funcall skeleton-transformation-function
|
2005-03-08 21:45:00 +00:00
|
|
|
|
(if sgml-xml-mode " checked=\"checked\"" " checked")))
|
|
|
|
|
(if sgml-xml-mode " />" ">")
|
1997-04-16 21:43:01 +00:00
|
|
|
|
(skeleton-read "Text: " (capitalize str))
|
|
|
|
|
(or (cdr v2) (setcdr v2 (if (y-or-n-p "Newline after text? ")
|
2006-05-21 22:19:59 +00:00
|
|
|
|
(funcall skeleton-transformation-function
|
2005-03-08 21:45:00 +00:00
|
|
|
|
(if sgml-xml-mode "<br />" "<br>"))
|
1997-04-16 21:43:01 +00:00
|
|
|
|
"")))
|
|
|
|
|
\n))
|
Also load for .sgm and .dtd files.
(sgml-specials, sgml-name-8bit-mode, sgml-char-names)
(sgml-font-lock-keywords, sgml-face-tag-alist, sgml-tag-face-alist)
(sgml-display-text, sgml-tag-alist, sgml-tag-help)
(sgml-auto-attributes): New variables.
(sgml-mode-common): New function.
(sgml-mode): Most code moved to it.
(sgml-name-char, sgml-name-self, sgml-maybe-name-self)
(sgml-name-8bit-mode, sgml-tag, sgml-attributes, sgml-auto-attributes)
(sgml-tag-help, sgml-maybe-end-tag, sgml-skip-tag-backward)
(sgml-skip-tag-forward, sgml-tags-invisible): New commands.
(sgml-beginning-of-tag, sgml-value): New functions.
1996-01-12 21:14:51 +00:00
|
|
|
|
|
2015-04-28 19:10:01 +02:00
|
|
|
|
(define-skeleton html-navigational-links
|
|
|
|
|
"Group of navigational links."
|
|
|
|
|
nil
|
|
|
|
|
"<nav>" \n
|
|
|
|
|
"<ul>" \n
|
|
|
|
|
"<li><a href=\"" (skeleton-read "URL: " "#") "\">"
|
|
|
|
|
(skeleton-read "Title: ") "</a>"
|
|
|
|
|
(if sgml-xml-mode (if sgml-xml-mode "</li>")) \n
|
|
|
|
|
"</ul>" \n
|
|
|
|
|
"</nav>")
|
|
|
|
|
|
|
|
|
|
(define-skeleton html-html5-template
|
2021-09-13 06:04:32 +02:00
|
|
|
|
"Initial HTML5 template."
|
2015-04-28 19:10:01 +02:00
|
|
|
|
nil
|
|
|
|
|
"<!DOCTYPE html>" \n
|
|
|
|
|
"<html lang=\"en\">" \n
|
|
|
|
|
"<head>" \n
|
|
|
|
|
"<meta charset=\"utf-8\">" \n
|
|
|
|
|
"<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">" \n
|
|
|
|
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" \n
|
|
|
|
|
"<title>" (skeleton-read "Page Title: ") "</title>" \n
|
|
|
|
|
"</head>" \n
|
|
|
|
|
"<body>" \n
|
|
|
|
|
"<div id=\"app\"></div>" \n
|
|
|
|
|
"</body>" \n
|
|
|
|
|
"</html>")
|
|
|
|
|
|
2001-06-17 09:01:23 +00:00
|
|
|
|
(provide 'sgml-mode)
|
2001-07-16 11:39:42 +00:00
|
|
|
|
|
1992-07-17 06:48:03 +00:00
|
|
|
|
;;; sgml-mode.el ends here
|