aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/nxml
diff options
context:
space:
mode:
authorGlenn Morris2019-05-14 17:18:18 -0700
committerGlenn Morris2019-05-14 17:18:18 -0700
commit5fe9375a5164960c3ecb65a7ef6d742069b8a7d7 (patch)
tree315715009d9fe5af40be38cb0dfccecfaf4c5528 /lisp/nxml
parent0f63e17663f99742425c9ec4f282f5e7e3194b1b (diff)
parent02bee7860f7e650ef13e00fe1a7f9a362e3eb001 (diff)
downloademacs-5fe9375a5164960c3ecb65a7ef6d742069b8a7d7.tar.gz
emacs-5fe9375a5164960c3ecb65a7ef6d742069b8a7d7.zip
Merge from origin/emacs-26
02bee78 Let dir locals for more specific modes override those from less b1235f9 Improve documentation of Hexl mode 32d1813 Fix description of (move-to-column <n> t) when column <n> is ... 0397b7c ; Fix smtpmail-stream-type docstring 7dab3ee Recognize single quote attribute values in nxml and sgml (Bug... e4cde42 Disable extra display of &#10; in nxml-mode (Bug#32897) ca14dd1 Fix nxml-get-inside (Bug#32003) e7ab351 Fix positioning client buffer as instructed by emacsclient # Conflicts: # lisp/files.el # lisp/textmodes/sgml-mode.el
Diffstat (limited to 'lisp/nxml')
-rw-r--r--lisp/nxml/nxml-mode.el4
-rw-r--r--lisp/nxml/nxml-rap.el42
2 files changed, 23 insertions, 23 deletions
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index 6f80912dd58..8da9f5ca287 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -2379,7 +2379,9 @@ With a prefix argument, inserts the character directly."
2379(put 'nxml-char-ref 'evaporate t) 2379(put 'nxml-char-ref 'evaporate t)
2380 2380
2381(defun nxml-char-ref-display-extra (start end n) 2381(defun nxml-char-ref-display-extra (start end n)
2382 (when nxml-char-ref-extra-display 2382 (when (and ;; Displaying literal newline is unhelpful.
2383 (not (eql n ?\n))
2384 nxml-char-ref-extra-display)
2383 (let ((name (or (get-char-code-property n 'name) 2385 (let ((name (or (get-char-code-property n 'name)
2384 (get-char-code-property n 'old-name))) 2386 (get-char-code-property n 'old-name)))
2385 (glyph-string (and nxml-char-ref-display-glyph-flag 2387 (glyph-string (and nxml-char-ref-display-glyph-flag
diff --git a/lisp/nxml/nxml-rap.el b/lisp/nxml/nxml-rap.el
index 2bd758be3a5..21dbaded25a 100644
--- a/lisp/nxml/nxml-rap.el
+++ b/lisp/nxml/nxml-rap.el
@@ -35,35 +35,25 @@
35;; 35;;
36;; Our strategy is to keep track of just the problematic things. 36;; Our strategy is to keep track of just the problematic things.
37;; Specifically, we keep track of all comments, CDATA sections and 37;; Specifically, we keep track of all comments, CDATA sections and
38;; processing instructions in the instance. We do this by marking all 38;; processing instructions in the instance. We do this by marking
39;; except the first character of these with a non-nil nxml-inside text 39;; the first character of these with the generic string syntax by setting
40;; property. The value of the nxml-inside property is comment, 40;; a 'syntax-table' text property in `sgml-syntax-propertize'.
41;; cdata-section or processing-instruction. The first character does
42;; not have the nxml-inside property so we can find the beginning of
43;; the construct by looking for a change in a text property value
44;; (Emacs provides primitives for this). We use text properties
45;; rather than overlays, since the implementation of overlays doesn't
46;; look like it scales to large numbers of overlays in a buffer.
47;;
48;; We don't in fact track all these constructs, but only track them in
49;; some initial part of the instance.
50;; 41;;
51;; Thus to parse some random point in the file we first ensure that we 42;; Thus to parse some random point in the file we first ensure that we
52;; have scanned up to that point. Then we search backwards for a 43;; have scanned up to that point. Then we search backwards for a <.
53;; <. Then we check whether the < has an nxml-inside property. If it 44;; Then we check whether the < has the generic string syntax. If it
54;; does we go backwards to first character that does not have an 45;; does we go backwards to first character of the generic string (this
55;; nxml-inside property (this character must be a <). Then we start 46;; character must be a <). Then we start parsing forward from the <
56;; parsing forward from the < we have found. 47;; we have found.
57;; 48;;
58;; The prolog has to be parsed specially, so we also keep track of the 49;; The prolog has to be parsed specially, so we also keep track of the
59;; end of the prolog in `nxml-prolog-end'. The prolog is reparsed on 50;; end of the prolog in `nxml-prolog-end'. The prolog is reparsed on
60;; every change to the prolog. This won't work well if people try to 51;; every change to the prolog. This won't work well if people try to
61;; edit huge internal subsets. Hopefully that will be rare. 52;; edit huge internal subsets. Hopefully that will be rare.
62;; 53;;
63;; We keep track of the changes by adding to the buffer's 54;; We rely on the `syntax-propertize-function' machinery to keep track
64;; after-change-functions hook. Scanning is also done as a 55;; of the changes in the buffer. Fontification also relies on correct
65;; prerequisite to fontification by adding to fontification-functions 56;; `syntax-table' properties. This means that scanning for these
66;; (in the same way as jit-lock). This means that scanning for these
67;; constructs had better be quick. Fortunately it is. Firstly, the 57;; constructs had better be quick. Fortunately it is. Firstly, the
68;; typical proportion of comments, CDATA sections and processing 58;; typical proportion of comments, CDATA sections and processing
69;; instructions is small relative to other things. Secondly, to scan 59;; instructions is small relative to other things. Secondly, to scan
@@ -79,7 +69,15 @@
79 "Integer giving position following end of the prolog.") 69 "Integer giving position following end of the prolog.")
80 70
81(defsubst nxml-get-inside (pos) 71(defsubst nxml-get-inside (pos)
82 (save-excursion (nth 8 (syntax-ppss pos)))) 72 "Return non-nil if inside comment, CDATA, or PI."
73 (let ((ppss (save-excursion (syntax-ppss pos))))
74 (or
75 ;; Inside comment.
76 (nth 4 ppss)
77 ;; Inside "generic" string which is used for CDATA, and PI.
78 ;; "Normal" double and single quoted strings are used for
79 ;; attribute values.
80 (eq t (nth 3 ppss)))))
83 81
84(defun nxml-inside-end (pos) 82(defun nxml-inside-end (pos)
85 "Return the end of the inside region containing POS. 83 "Return the end of the inside region containing POS.