diff options
| author | Juanma Barranquero | 2013-08-11 02:07:48 +0200 |
|---|---|---|
| committer | Juanma Barranquero | 2013-08-11 02:07:48 +0200 |
| commit | 9a4ebc748797acc8af74f561367aa1b34ca02d2e (patch) | |
| tree | 47ff4c1682c4faeb34c44b7a881ddfa0e0a8926f | |
| parent | b41bfdd0566140601f0adb65b0052246c1294bb6 (diff) | |
| download | emacs-9a4ebc748797acc8af74f561367aa1b34ca02d2e.tar.gz emacs-9a4ebc748797acc8af74f561367aa1b34ca02d2e.zip | |
lisp/*.el: More lexical-binding warnings' cleanups.
* tutorial.el (tutorial--describe-nonstandard-key): Use string-match-p.
(tutorial--detailed-help): Remove unused local variables.
(tutorial--save-tutorial-to): Use ignore-errors.
(help-with-tutorial): Use looking-at-p.
* view.el (view-buffer-other-window, view-buffer-other-frame):
Mark unused arguments.
* woman.el (woman-parse-colon-path, woman-parse-colon-path)
(woman-select-symbol-fonts, woman, woman-find-file)
(woman-insert-file-contents, woman-non-underline-faces):
Use string-match-p.
(woman1-unquote): Move declaration.
* xml.el (xml-parse-tag-1, xml-parse-string): Use looking-at-p.
(xml-parse-dtd): Use looking-at-p, string-match-p. Mark unused
argument. Remove unused local variable.
(xml-parse-elem-type): Use string-match-p.
(xml-substitute-numeric-entities): Use ignore-errors.
| -rw-r--r-- | lisp/ChangeLog | 20 | ||||
| -rw-r--r-- | lisp/tutorial.el | 12 | ||||
| -rw-r--r-- | lisp/view.el | 4 | ||||
| -rw-r--r-- | lisp/woman.el | 18 | ||||
| -rw-r--r-- | lisp/xml.el | 48 |
5 files changed, 58 insertions, 44 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4c55452e5b4..ed1aa7c18f0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,25 @@ | |||
| 1 | 2013-08-10 Juanma Barranquero <lekktu@gmail.com> | 1 | 2013-08-10 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 2 | ||
| 3 | * tutorial.el (tutorial--describe-nonstandard-key): Use string-match-p. | ||
| 4 | (tutorial--detailed-help): Remove unused local variables. | ||
| 5 | (tutorial--save-tutorial-to): Use ignore-errors. | ||
| 6 | (help-with-tutorial): Use looking-at-p. | ||
| 7 | |||
| 8 | * view.el (view-buffer-other-window, view-buffer-other-frame): | ||
| 9 | Mark unused arguments. | ||
| 10 | |||
| 11 | * woman.el (woman-parse-colon-path, woman-parse-colon-path) | ||
| 12 | (woman-select-symbol-fonts, woman, woman-find-file) | ||
| 13 | (woman-insert-file-contents, woman-non-underline-faces): | ||
| 14 | Use string-match-p. | ||
| 15 | (woman1-unquote): Move declaration. | ||
| 16 | |||
| 17 | * xml.el (xml-parse-tag-1, xml-parse-string): Use looking-at-p. | ||
| 18 | (xml-parse-dtd): Use looking-at-p, string-match-p. Mark unused | ||
| 19 | argument. Remove unused local variable. | ||
| 20 | (xml-parse-elem-type): Use string-match-p. | ||
| 21 | (xml-substitute-numeric-entities): Use ignore-errors. | ||
| 22 | |||
| 3 | * calculator.el (calculator): Mark unused argument. | 23 | * calculator.el (calculator): Mark unused argument. |
| 4 | (calculator-paste, calculator-quit, calculator-integer-p): | 24 | (calculator-paste, calculator-quit, calculator-integer-p): |
| 5 | Use ignore-errors. | 25 | Use ignore-errors. |
diff --git a/lisp/tutorial.el b/lisp/tutorial.el index 6fb8d05f438..d581cb13e28 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el | |||
| @@ -156,7 +156,7 @@ options: | |||
| 156 | " RET instead.")) | 156 | " RET instead.")) |
| 157 | (insert "\n\nWith your current key bindings" | 157 | (insert "\n\nWith your current key bindings" |
| 158 | " you can use " | 158 | " you can use " |
| 159 | (if (string-match "^the .*menus?$" where) | 159 | (if (string-match-p "^the .*menus?$" where) |
| 160 | "" | 160 | "" |
| 161 | "the key") | 161 | "the key") |
| 162 | where | 162 | where |
| @@ -346,10 +346,8 @@ from the Emacs default:\n\n" ) | |||
| 346 | (def-fun-txt (nth 2 tk)) | 346 | (def-fun-txt (nth 2 tk)) |
| 347 | (where (nth 3 tk)) | 347 | (where (nth 3 tk)) |
| 348 | (remark (nth 4 tk)) | 348 | (remark (nth 4 tk)) |
| 349 | (rem-fun (command-remapping def-fun)) | ||
| 350 | (key-txt (key-description key)) | 349 | (key-txt (key-description key)) |
| 351 | (key-fun (with-current-buffer tutorial-buffer (key-binding key))) | 350 | (key-fun (with-current-buffer tutorial-buffer (key-binding key)))) |
| 352 | tot-len) | ||
| 353 | (unless (eq def-fun key-fun) | 351 | (unless (eq def-fun key-fun) |
| 354 | ;; Insert key binding description: | 352 | ;; Insert key binding description: |
| 355 | (when (string= key-txt explain-key-desc) | 353 | (when (string= key-txt explain-key-desc) |
| @@ -723,9 +721,7 @@ See `tutorial--save-tutorial' for more information." | |||
| 723 | saved-file | 721 | saved-file |
| 724 | (error-message-string err)))) | 722 | (error-message-string err)))) |
| 725 | ;; An error is raised here?? Is this a bug? | 723 | ;; An error is raised here?? Is this a bug? |
| 726 | (condition-case nil | 724 | (ignore-errors (undo-only)) |
| 727 | (undo-only) | ||
| 728 | (error nil)) | ||
| 729 | ;; Restore point | 725 | ;; Restore point |
| 730 | (goto-char old-point) | 726 | (goto-char old-point) |
| 731 | (if save-err | 727 | (if save-err |
| @@ -881,7 +877,7 @@ Run the Viper tutorial? ")) | |||
| 881 | ;; or just delete the <<...>> line if a [...] line follows. | 877 | ;; or just delete the <<...>> line if a [...] line follows. |
| 882 | (cond ((save-excursion | 878 | (cond ((save-excursion |
| 883 | (forward-line 1) | 879 | (forward-line 1) |
| 884 | (looking-at "\\[")) | 880 | (looking-at-p "\\[")) |
| 885 | (delete-region (point) (progn (forward-line 1) (point)))) | 881 | (delete-region (point) (progn (forward-line 1) (point)))) |
| 886 | ((looking-at "<<Blank lines inserted.*>>") | 882 | ((looking-at "<<Blank lines inserted.*>>") |
| 887 | (replace-match "[Middle of page left blank for didactic purposes. Text continues below]")) | 883 | (replace-match "[Middle of page left blank for didactic purposes. Text continues below]")) |
diff --git a/lisp/view.el b/lisp/view.el index f9326399a26..333a9883d14 100644 --- a/lisp/view.el +++ b/lisp/view.el | |||
| @@ -322,7 +322,7 @@ own View-like bindings." | |||
| 322 | (view-mode-enter nil exit-action))) | 322 | (view-mode-enter nil exit-action))) |
| 323 | 323 | ||
| 324 | ;;;###autoload | 324 | ;;;###autoload |
| 325 | (defun view-buffer-other-window (buffer &optional not-return exit-action) | 325 | (defun view-buffer-other-window (buffer &optional _not-return exit-action) |
| 326 | "View BUFFER in View mode in another window. | 326 | "View BUFFER in View mode in another window. |
| 327 | Emacs commands editing the buffer contents are not available; | 327 | Emacs commands editing the buffer contents are not available; |
| 328 | instead, a special set of commands (mostly letters and | 328 | instead, a special set of commands (mostly letters and |
| @@ -349,7 +349,7 @@ own View-like bindings." | |||
| 349 | (view-mode-enter nil exit-action))) | 349 | (view-mode-enter nil exit-action))) |
| 350 | 350 | ||
| 351 | ;;;###autoload | 351 | ;;;###autoload |
| 352 | (defun view-buffer-other-frame (buffer &optional not-return exit-action) | 352 | (defun view-buffer-other-frame (buffer &optional _not-return exit-action) |
| 353 | "View BUFFER in View mode in another frame. | 353 | "View BUFFER in View mode in another frame. |
| 354 | Emacs commands editing the buffer contents are not available; | 354 | Emacs commands editing the buffer contents are not available; |
| 355 | instead, a special set of commands (mostly letters and | 355 | instead, a special set of commands (mostly letters and |
diff --git a/lisp/woman.el b/lisp/woman.el index 1cead32ab2f..b1be2d67b62 100644 --- a/lisp/woman.el +++ b/lisp/woman.el | |||
| @@ -438,7 +438,7 @@ As a special case, if PATHS is nil then replace it by calling | |||
| 438 | (if (memq system-type '(windows-nt ms-dos)) | 438 | (if (memq system-type '(windows-nt ms-dos)) |
| 439 | (cond ((null paths) | 439 | (cond ((null paths) |
| 440 | (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf))) | 440 | (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf))) |
| 441 | ((string-match ";" paths) | 441 | ((string-match-p ";" paths) |
| 442 | ;; Assume DOS-style path-list... | 442 | ;; Assume DOS-style path-list... |
| 443 | (woman-mapcan ; splice list into list | 443 | (woman-mapcan ; splice list into list |
| 444 | (lambda (x) | 444 | (lambda (x) |
| @@ -446,7 +446,7 @@ As a special case, if PATHS is nil then replace it by calling | |||
| 446 | (list x) | 446 | (list x) |
| 447 | (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf)))) | 447 | (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf)))) |
| 448 | (parse-colon-path paths))) | 448 | (parse-colon-path paths))) |
| 449 | ((string-match "\\`[a-zA-Z]:" paths) | 449 | ((string-match-p "\\`[a-zA-Z]:" paths) |
| 450 | ;; Assume single DOS-style path... | 450 | ;; Assume single DOS-style path... |
| 451 | (list paths)) | 451 | (list paths)) |
| 452 | (t | 452 | (t |
| @@ -974,7 +974,7 @@ This is usually either black or white." | |||
| 974 | ;; With NTEmacs 20.5, the PATTERN option to `x-list-fonts' does | 974 | ;; With NTEmacs 20.5, the PATTERN option to `x-list-fonts' does |
| 975 | ;; not seem to work and fonts may be repeated, so ... | 975 | ;; not seem to work and fonts may be repeated, so ... |
| 976 | (dolist (font fonts) | 976 | (dolist (font fonts) |
| 977 | (and (string-match "-Symbol-" font) | 977 | (and (string-match-p "-Symbol-" font) |
| 978 | (not (member font symbol-fonts)) | 978 | (not (member font symbol-fonts)) |
| 979 | (setq symbol-fonts (cons font symbol-fonts)))) | 979 | (setq symbol-fonts (cons font symbol-fonts)))) |
| 980 | symbol-fonts)) | 980 | symbol-fonts)) |
| @@ -1173,7 +1173,7 @@ Used non-interactively, arguments are optional: if given then TOPIC | |||
| 1173 | should be a topic string and non-nil RE-CACHE forces re-caching." | 1173 | should be a topic string and non-nil RE-CACHE forces re-caching." |
| 1174 | (interactive (list nil current-prefix-arg)) | 1174 | (interactive (list nil current-prefix-arg)) |
| 1175 | ;; The following test is for non-interactive calls via gnudoit etc. | 1175 | ;; The following test is for non-interactive calls via gnudoit etc. |
| 1176 | (if (or (not (stringp topic)) (string-match "\\S " topic)) | 1176 | (if (or (not (stringp topic)) (string-match-p "\\S " topic)) |
| 1177 | (let ((file-name (woman-file-name topic re-cache))) | 1177 | (let ((file-name (woman-file-name topic re-cache))) |
| 1178 | (if file-name | 1178 | (if file-name |
| 1179 | (woman-find-file file-name) | 1179 | (woman-find-file file-name) |
| @@ -1614,7 +1614,7 @@ decompress the file if appropriate. See the documentation for the | |||
| 1614 | (let* ((bufname (file-name-nondirectory file-name)) | 1614 | (let* ((bufname (file-name-nondirectory file-name)) |
| 1615 | (case-fold-search t) | 1615 | (case-fold-search t) |
| 1616 | (compressed | 1616 | (compressed |
| 1617 | (not (not (string-match woman-file-compression-regexp bufname))))) | 1617 | (and (string-match-p woman-file-compression-regexp bufname) t))) |
| 1618 | (if compressed | 1618 | (if compressed |
| 1619 | (setq bufname (file-name-sans-extension bufname))) | 1619 | (setq bufname (file-name-sans-extension bufname))) |
| 1620 | (setq bufname (if exists | 1620 | (setq bufname (if exists |
| @@ -1756,7 +1756,7 @@ Leave point at end of new text. Return length of inserted text." | |||
| 1756 | ;; Co-operate with auto-compression mode: | 1756 | ;; Co-operate with auto-compression mode: |
| 1757 | (if (and compressed | 1757 | (if (and compressed |
| 1758 | (or (eq compressed t) | 1758 | (or (eq compressed t) |
| 1759 | (string-match woman-file-compression-regexp filename)) | 1759 | (string-match-p woman-file-compression-regexp filename)) |
| 1760 | ;; (not auto-compression-mode) | 1760 | ;; (not auto-compression-mode) |
| 1761 | (not (rassq 'jka-compr-handler file-name-handler-alist)) ) | 1761 | (not (rassq 'jka-compr-handler file-name-handler-alist)) ) |
| 1762 | ;; (error "Compressed file requires Auto File Decompression turned on") | 1762 | ;; (error "Compressed file requires Auto File Decompression turned on") |
| @@ -2192,7 +2192,7 @@ To be called on original buffer and any .so insertions." | |||
| 2192 | (let ((face-list (face-list))) | 2192 | (let ((face-list (face-list))) |
| 2193 | (dolist (face face-list) | 2193 | (dolist (face face-list) |
| 2194 | (let ((face-name (symbol-name face))) | 2194 | (let ((face-name (symbol-name face))) |
| 2195 | (if (and (string-match "\\`woman-" face-name) | 2195 | (if (and (string-match-p "\\`woman-" face-name) |
| 2196 | (face-underline-p face)) | 2196 | (face-underline-p face)) |
| 2197 | (let ((face-no-ul (intern (concat face-name "-no-ul")))) | 2197 | (let ((face-no-ul (intern (concat face-name "-no-ul")))) |
| 2198 | (copy-face face face-no-ul) | 2198 | (copy-face face face-no-ul) |
| @@ -3029,6 +3029,8 @@ Leave point at TO (which should be a marker)." | |||
| 3029 | "Delete any double-quote characters up to the end of the line." | 3029 | "Delete any double-quote characters up to the end of the line." |
| 3030 | (woman-unquote (save-excursion (end-of-line) (point-marker)))) | 3030 | (woman-unquote (save-excursion (end-of-line) (point-marker)))) |
| 3031 | 3031 | ||
| 3032 | (defvar woman1-unquote) ; bound locally by woman1-roff-buffer | ||
| 3033 | |||
| 3032 | (defun woman1-roff-buffer () | 3034 | (defun woman1-roff-buffer () |
| 3033 | "Process non-breaking requests." | 3035 | "Process non-breaking requests." |
| 3034 | (let ((case-fold-search t) | 3036 | (let ((case-fold-search t) |
| @@ -3069,8 +3071,6 @@ Leave point at TO (which should be a marker)." | |||
| 3069 | ".I -- Set words of current line in italic font." | 3071 | ".I -- Set words of current line in italic font." |
| 3070 | (woman1-B-or-I ".ft I\n")) | 3072 | (woman1-B-or-I ".ft I\n")) |
| 3071 | 3073 | ||
| 3072 | (defvar woman1-unquote) ; bound locally by woman1-roff-buffer | ||
| 3073 | |||
| 3074 | (defun woman1-B-or-I (B-or-I) | 3074 | (defun woman1-B-or-I (B-or-I) |
| 3075 | ".B/I -- Set words of current line in bold/italic font. | 3075 | ".B/I -- Set words of current line in bold/italic font. |
| 3076 | B-OR-I is the appropriate complete control line." | 3076 | B-OR-I is the appropriate complete control line." |
diff --git a/lisp/xml.el b/lisp/xml.el index a3d34670bfb..e4d5f0b6b6d 100644 --- a/lisp/xml.el +++ b/lisp/xml.el | |||
| @@ -479,7 +479,7 @@ Return one of: | |||
| 479 | xml-default-ns)))) | 479 | xml-default-ns)))) |
| 480 | (cond | 480 | (cond |
| 481 | ;; Processing instructions, like <?xml version="1.0"?>. | 481 | ;; Processing instructions, like <?xml version="1.0"?>. |
| 482 | ((looking-at "<\\?") | 482 | ((looking-at-p "<\\?") |
| 483 | (search-forward "?>") | 483 | (search-forward "?>") |
| 484 | (skip-syntax-forward " ") | 484 | (skip-syntax-forward " ") |
| 485 | (xml-parse-tag-1 parse-dtd xml-ns)) | 485 | (xml-parse-tag-1 parse-dtd xml-ns)) |
| @@ -492,14 +492,14 @@ Return one of: | |||
| 492 | (buffer-substring-no-properties pos (match-beginning 0)) | 492 | (buffer-substring-no-properties pos (match-beginning 0)) |
| 493 | (xml-parse-string)))) | 493 | (xml-parse-string)))) |
| 494 | ;; DTD for the document | 494 | ;; DTD for the document |
| 495 | ((looking-at "<!DOCTYPE[ \t\n\r]") | 495 | ((looking-at-p "<!DOCTYPE[ \t\n\r]") |
| 496 | (let ((dtd (xml-parse-dtd parse-ns))) | 496 | (let ((dtd (xml-parse-dtd parse-ns))) |
| 497 | (skip-syntax-forward " ") | 497 | (skip-syntax-forward " ") |
| 498 | (if xml-validating-parser | 498 | (if xml-validating-parser |
| 499 | (cons dtd (xml-parse-tag-1 nil xml-ns)) | 499 | (cons dtd (xml-parse-tag-1 nil xml-ns)) |
| 500 | (xml-parse-tag-1 nil xml-ns)))) | 500 | (xml-parse-tag-1 nil xml-ns)))) |
| 501 | ;; skip comments | 501 | ;; skip comments |
| 502 | ((looking-at "<!--") | 502 | ((looking-at-p "<!--") |
| 503 | (search-forward "-->") | 503 | (search-forward "-->") |
| 504 | ;; FIXME: This loses the skipped-over spaces. | 504 | ;; FIXME: This loses the skipped-over spaces. |
| 505 | (skip-syntax-forward " ") | 505 | (skip-syntax-forward " ") |
| @@ -507,7 +507,7 @@ Return one of: | |||
| 507 | (let ((xml-sub-parser t)) | 507 | (let ((xml-sub-parser t)) |
| 508 | (xml-parse-tag-1 parse-dtd xml-ns)))) | 508 | (xml-parse-tag-1 parse-dtd xml-ns)))) |
| 509 | ;; end tag | 509 | ;; end tag |
| 510 | ((looking-at "</") | 510 | ((looking-at-p "</") |
| 511 | '()) | 511 | '()) |
| 512 | ;; opening tag | 512 | ;; opening tag |
| 513 | ((looking-at (eval-when-compile (concat "<\\(" xml-name-re "\\)"))) | 513 | ((looking-at (eval-when-compile (concat "<\\(" xml-name-re "\\)"))) |
| @@ -530,7 +530,7 @@ Return one of: | |||
| 530 | (setq children (list attrs (xml-maybe-do-ns node-name "" xml-ns))) | 530 | (setq children (list attrs (xml-maybe-do-ns node-name "" xml-ns))) |
| 531 | (cond | 531 | (cond |
| 532 | ;; is this an empty element ? | 532 | ;; is this an empty element ? |
| 533 | ((looking-at "/>") | 533 | ((looking-at-p "/>") |
| 534 | (forward-char 2) | 534 | (forward-char 2) |
| 535 | (nreverse children)) | 535 | (nreverse children)) |
| 536 | ;; is this a valid start tag ? | 536 | ;; is this a valid start tag ? |
| @@ -538,12 +538,12 @@ Return one of: | |||
| 538 | (forward-char 1) | 538 | (forward-char 1) |
| 539 | ;; Now check that we have the right end-tag. | 539 | ;; Now check that we have the right end-tag. |
| 540 | (let ((end (concat "</" node-name "\\s-*>"))) | 540 | (let ((end (concat "</" node-name "\\s-*>"))) |
| 541 | (while (not (looking-at end)) | 541 | (while (not (looking-at-p end)) |
| 542 | (cond | 542 | (cond |
| 543 | ((eobp) | 543 | ((eobp) |
| 544 | (error "XML: (Not Well-Formed) End of document while reading element `%s'" | 544 | (error "XML: (Not Well-Formed) End of document while reading element `%s'" |
| 545 | node-name)) | 545 | node-name)) |
| 546 | ((looking-at "</") | 546 | ((looking-at-p "</") |
| 547 | (forward-char 2) | 547 | (forward-char 2) |
| 548 | (error "XML: (Not Well-Formed) Invalid end tag `%s' (expecting `%s')" | 548 | (error "XML: (Not Well-Formed) Invalid end tag `%s' (expecting `%s')" |
| 549 | (let ((pos (point))) | 549 | (let ((pos (point))) |
| @@ -591,7 +591,7 @@ references." | |||
| 591 | (old-remaining-size (- (buffer-size) (point))) | 591 | (old-remaining-size (- (buffer-size) (point))) |
| 592 | ref val) | 592 | ref val) |
| 593 | (while (and (not (eobp)) | 593 | (while (and (not (eobp)) |
| 594 | (not (looking-at "<"))) | 594 | (not (looking-at-p "<"))) |
| 595 | ;; Find the next < or & character. | 595 | ;; Find the next < or & character. |
| 596 | (skip-chars-forward "^<&") | 596 | (skip-chars-forward "^<&") |
| 597 | (when (eq (char-after) ?&) | 597 | (when (eq (char-after) ?&) |
| @@ -690,11 +690,11 @@ This follows the rule [28] in the XML specifications." | |||
| 690 | (let ((xml-validating-parser nil)) | 690 | (let ((xml-validating-parser nil)) |
| 691 | (xml-parse-dtd))) | 691 | (xml-parse-dtd))) |
| 692 | 692 | ||
| 693 | (defun xml-parse-dtd (&optional parse-ns) | 693 | (defun xml-parse-dtd (&optional _parse-ns) |
| 694 | "Parse the DTD at point." | 694 | "Parse the DTD at point." |
| 695 | (forward-char (eval-when-compile (length "<!DOCTYPE"))) | 695 | (forward-char (eval-when-compile (length "<!DOCTYPE"))) |
| 696 | (skip-syntax-forward " ") | 696 | (skip-syntax-forward " ") |
| 697 | (if (and (looking-at ">") | 697 | (if (and (looking-at-p ">") |
| 698 | xml-validating-parser) | 698 | xml-validating-parser) |
| 699 | (error "XML: (Validity) Invalid DTD (expecting name of the document)")) | 699 | (error "XML: (Validity) Invalid DTD (expecting name of the document)")) |
| 700 | 700 | ||
| @@ -755,7 +755,7 @@ This follows the rule [28] in the XML specifications." | |||
| 755 | 755 | ||
| 756 | ;; Parse the rest of the DTD | 756 | ;; Parse the rest of the DTD |
| 757 | ;; Fixme: Deal with NOTATION, PIs. | 757 | ;; Fixme: Deal with NOTATION, PIs. |
| 758 | (while (not (looking-at "\\s-*\\]")) | 758 | (while (not (looking-at-p "\\s-*\\]")) |
| 759 | (skip-syntax-forward " ") | 759 | (skip-syntax-forward " ") |
| 760 | (cond | 760 | (cond |
| 761 | ((eobp) | 761 | ((eobp) |
| @@ -771,14 +771,14 @@ This follows the rule [28] in the XML specifications." | |||
| 771 | (end-pos (match-end 0))) | 771 | (end-pos (match-end 0))) |
| 772 | ;; Translation of rule [46] of XML specifications | 772 | ;; Translation of rule [46] of XML specifications |
| 773 | (cond | 773 | (cond |
| 774 | ((string-match "\\`EMPTY\\s-*\\'" type) ; empty declaration | 774 | ((string-match-p "\\`EMPTY\\s-*\\'" type) ; empty declaration |
| 775 | (setq type 'empty)) | 775 | (setq type 'empty)) |
| 776 | ((string-match "\\`ANY\\s-*$" type) ; any type of contents | 776 | ((string-match-p "\\`ANY\\s-*$" type) ; any type of contents |
| 777 | (setq type 'any)) | 777 | (setq type 'any)) |
| 778 | ((string-match "\\`(\\(.*\\))\\s-*\\'" type) ; children ([47]) | 778 | ((string-match "\\`(\\(.*\\))\\s-*\\'" type) ; children ([47]) |
| 779 | (setq type (xml-parse-elem-type | 779 | (setq type (xml-parse-elem-type |
| 780 | (match-string-no-properties 1 type)))) | 780 | (match-string-no-properties 1 type)))) |
| 781 | ((string-match "^%[^;]+;[ \t\n\r]*\\'" type) ; substitution | 781 | ((string-match-p "^%[^;]+;[ \t\n\r]*\\'" type) ; substitution |
| 782 | nil) | 782 | nil) |
| 783 | (xml-validating-parser | 783 | (xml-validating-parser |
| 784 | (error "XML: (Validity) Invalid element type in the DTD"))) | 784 | (error "XML: (Validity) Invalid element type in the DTD"))) |
| @@ -803,7 +803,7 @@ This follows the rule [28] in the XML specifications." | |||
| 803 | (goto-char (match-end 0))) | 803 | (goto-char (match-end 0))) |
| 804 | 804 | ||
| 805 | ;; Comments (skip to end, ignoring parameter entity): | 805 | ;; Comments (skip to end, ignoring parameter entity): |
| 806 | ((looking-at "<!--") | 806 | ((looking-at-p "<!--") |
| 807 | (search-forward "-->") | 807 | (search-forward "-->") |
| 808 | (and next-parameter-entity | 808 | (and next-parameter-entity |
| 809 | (> (point) next-parameter-entity) | 809 | (> (point) next-parameter-entity) |
| @@ -856,7 +856,6 @@ This follows the rule [28] in the XML specifications." | |||
| 856 | (unless (looking-at xml-pe-reference-re) | 856 | (unless (looking-at xml-pe-reference-re) |
| 857 | (error "XML: Internal error")) | 857 | (error "XML: Internal error")) |
| 858 | (let* ((entity (match-string 1)) | 858 | (let* ((entity (match-string 1)) |
| 859 | (beg (point-marker)) | ||
| 860 | (elt (assoc entity xml-parameter-entity-alist))) | 859 | (elt (assoc entity xml-parameter-entity-alist))) |
| 861 | (if elt | 860 | (if elt |
| 862 | (progn | 861 | (progn |
| @@ -916,11 +915,11 @@ references and parameter-entity references." | |||
| 916 | (progn | 915 | (progn |
| 917 | (setq elem (match-string-no-properties 1 string) | 916 | (setq elem (match-string-no-properties 1 string) |
| 918 | modifier (match-string-no-properties 2 string)) | 917 | modifier (match-string-no-properties 2 string)) |
| 919 | (if (string-match "|" elem) | 918 | (if (string-match-p "|" elem) |
| 920 | (setq elem (cons 'choice | 919 | (setq elem (cons 'choice |
| 921 | (mapcar 'xml-parse-elem-type | 920 | (mapcar 'xml-parse-elem-type |
| 922 | (split-string elem "|")))) | 921 | (split-string elem "|")))) |
| 923 | (if (string-match "," elem) | 922 | (if (string-match-p "," elem) |
| 924 | (setq elem (cons 'seq | 923 | (setq elem (cons 'seq |
| 925 | (mapcar 'xml-parse-elem-type | 924 | (mapcar 'xml-parse-elem-type |
| 926 | (split-string elem ","))))))) | 925 | (split-string elem ","))))))) |
| @@ -987,13 +986,12 @@ by \"*\"." | |||
| 987 | (if (and string (stringp string)) | 986 | (if (and string (stringp string)) |
| 988 | (let ((start 0)) | 987 | (let ((start 0)) |
| 989 | (while (string-match "&#\\([0-9]+\\);" string start) | 988 | (while (string-match "&#\\([0-9]+\\);" string start) |
| 990 | (condition-case nil | 989 | (ignore-errors |
| 991 | (setq string (replace-match | 990 | (setq string (replace-match |
| 992 | (string (read (substring string | 991 | (string (read (substring string |
| 993 | (match-beginning 1) | 992 | (match-beginning 1) |
| 994 | (match-end 1)))) | 993 | (match-end 1)))) |
| 995 | nil nil string)) | 994 | nil nil string))) |
| 996 | (error nil)) | ||
| 997 | (setq start (1+ (match-beginning 0)))) | 995 | (setq start (1+ (match-beginning 0)))) |
| 998 | string) | 996 | string) |
| 999 | nil)) | 997 | nil)) |