summaryrefslogtreecommitdiff
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2016-03-21 17:42:35 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-03-21 17:47:22 -0700
commit7dba17670f42cdaa73424a2bf60925ef49671fad (patch)
tree3accf314646edd564d5a53bbd3999d7d19e290f8 /lisp/textmodes
parent22cd92a0f3ab9b901d738b9b4cc236d16c97153f (diff)
downloademacs-7dba17670f42cdaa73424a2bf60925ef49671fad.tar.gz
Fix problems caused by new implementation of sub-word mode
* lisp/subr.el (forward-word-strictly, backward-word-strictly): New functions. (word-move-empty-char-table): New variable. * etc/NEWS: Mention 'forward-word-strictly' and 'backward-word-strictly'. * doc/lispref/positions.texi (Word Motion): Document 'find-word-boundary-function-table', 'forward-word-strictly', and 'backward-word-strictly'. (Bug#22560) * src/syntax.c (syms_of_syntax) <find-word-boundary-function-table>: Doc fix. * lisp/wdired.el (wdired-xcase-word): * lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name) (texinfo-copy-section-title, texinfo-start-menu-description) (texinfo-copy-menu-title, texinfo-specific-section-type) (texinfo-insert-node-lines, texinfo-copy-next-section-title): * lisp/textmodes/texinfo.el (texinfo-clone-environment) (texinfo-insert-@end): * lisp/textmodes/texinfmt.el (texinfo-format-scan) (texinfo-anchor, texinfo-multitable-widths) (texinfo-multitable-item): * lisp/textmodes/tex-mode.el (latex-env-before-change): * lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify): * lisp/skeleton.el (skeleton-insert): * lisp/simple.el (count-words): * lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit) (vhdl-beginning-of-defun, vhdl-beginning-of-statement-1) (vhdl-update-sensitivity-list, vhdl-template-block) (vhdl-template-break, vhdl-template-case, vhdl-template-default) (vhdl-template-default-indent, vhdl-template-for-loop) (vhdl-template-if-then-use, vhdl-template-bare-loop) (vhdl-template-nature, vhdl-template-procedural) (vhdl-template-process, vhdl-template-selected-signal-asst) (vhdl-template-type, vhdl-template-variable) (vhdl-template-while-loop, vhdl-beginning-of-block) (vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func): * lisp/progmodes/verilog-mode.el (verilog-backward-sexp) (verilog-forward-sexp, verilog-beg-of-statement) (verilog-set-auto-endcomments, verilog-backward-token) (verilog-do-indent): * lisp/progmodes/vera-mode.el (vera-guess-basic-syntax) (vera-indent-block-closing): * lisp/progmodes/simula.el (simula-context) (simula-backward-up-level, simula-forward-down-level) (simula-previous-statement, simula-next-statement) (simula-skip-comment-backward, simula-calculate-indent) (simula-find-if, simula-electric-keyword): * lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p): * lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p) (ruby-smie--forward-token, ruby-smie--backward-token) (ruby-singleton-class-p, ruby-calculate-indent) (ruby-forward-sexp, ruby-backward-sexp): * lisp/progmodes/ps-mode.el (ps-run-goto-error): * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function) (perl-syntax-propertize-special-constructs) (perl-backward-to-start-of-continued-exp): * lisp/progmodes/pascal.el (pascal-indent-declaration): * lisp/progmodes/octave.el (octave-function-file-p): * lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax): * lisp/progmodes/js.el (js--forward-function-decl): * lisp/progmodes/idlwave.el (idlwave-show-begin-check) (idlwave-beginning-of-block, idlwave-end-of-block) (idlwave-block-jump-out, idlwave-determine-class): * lisp/progmodes/icon.el (icon-is-continuation-line) (icon-backward-to-start-of-continued-exp, end-of-icon-defun): * lisp/progmodes/hideif.el (hide-ifdef-define): * lisp/progmodes/f90.el (f90-change-keywords): * lisp/progmodes/cperl-mode.el (cperl-electric-pod) (cperl-linefeed, cperl-electric-terminator) (cperl-find-pods-heres, cperl-fix-line-spacing) (cperl-invert-if-unless): * lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur): * lisp/progmodes/cc-align.el (c-lineup-java-inher): * lisp/progmodes/ada-mode.el (ada-compile-goto-error) (ada-adjust-case-skeleton, ada-create-case-exception) (ada-create-case-exception-substring) (ada-case-read-exceptions-from-file, ada-after-keyword-p) (ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end) (ada-get-indent-if, ada-get-indent-block-start) (ada-get-indent-loop, ada-get-indent-type) (ada-search-prev-end-stmt, ada-check-defun-name) (ada-goto-decl-start, ada-goto-matching-start) (ada-goto-matching-end, ada-looking-at-semi-or) (ada-looking-at-semi-private, ada-in-paramlist-p) (ada-search-ignore-complex-boolean, ada-move-to-start) (ada-move-to-end, ada-which-function, ada-gen-treat-proc): * lisp/net/quickurl.el (quickurl-grab-url): * lisp/mail/sendmail.el (mail-do-fcc): * lisp/mail/rmail.el (rmail-resend): * lisp/mail/mailabbrev.el (mail-abbrev-complete-alias): * lisp/mail/mail-extr.el (mail-extract-address-components): * lisp/json.el (json-read-keyword): * lisp/files.el (insert-directory): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/completion.el (symbol-under-point, symbol-before-point) (symbol-before-point-for-complete, next-cdabbrev) (add-completions-from-c-buffer): * lisp/cedet/semantic/texi.el (semantic-up-context) (semantic-beginning-of-context): * lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables): use 'forward-word-strictly' and 'backward-word-strictly' instead of 'forward-word' and 'backward-word'. [This reapplies commit c1d32a65372c72d7de4808d620eefd3214a8e92a, which was inadvertently lost by merge commit c71e7cc113ed0d5f01aaa2e441a3e3c9fbeb9fa5.]
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/flyspell.el2
-rw-r--r--lisp/textmodes/tex-mode.el3
-rw-r--r--lisp/textmodes/texinfmt.el8
-rw-r--r--lisp/textmodes/texinfo.el4
-rw-r--r--lisp/textmodes/texnfo-upd.el20
5 files changed, 19 insertions, 18 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 5db0d987a0f..042b7d40edc 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -368,7 +368,7 @@ property of the major mode name.")
(defun texinfo-mode-flyspell-verify ()
"Function used for `flyspell-generic-check-word-predicate' in Texinfo mode."
(save-excursion
- (forward-word -1)
+ (forward-word-strictly -1)
(not (looking-at "@"))))
;;*--- tex mode --------------------------------------------------------*/
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 5b1bd6a05bc..973b2d373d5 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -735,7 +735,8 @@ automatically inserts its partner."
(let ((arg-end (match-end 0)))
(if (null type) ;\end
(progn (goto-char arg-end)
- (latex-forward-sexp -1) (forward-word 1))
+ (latex-forward-sexp -1)
+ (forward-word-strictly 1))
(goto-char cmd-start)
(latex-forward-sexp 1)
(let (forward-sexp-function) (backward-sexp)))
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el
index 19a21237d2b..55be7fe9df5 100644
--- a/lisp/textmodes/texinfmt.el
+++ b/lisp/textmodes/texinfmt.el
@@ -891,7 +891,7 @@ commands."
;; @ is followed by a command-word; find the end of the word.
(setq texinfo-command-start (1- (point)))
(if (= (char-syntax (following-char)) ?w)
- (forward-word 1)
+ (forward-word-strictly 1)
(forward-char 1))
(setq texinfo-command-end (point))
;; Detect the case of two @-commands in a row;
@@ -1190,7 +1190,7 @@ Leave point after argument."
(forward-paragraph)
(let ((end (point)))
(if (save-excursion
- (backward-word 1)
+ (backward-word-strictly 1)
(search-forward "@refill" end t))
(setq anchor-string "@anchor-yes-refill")
(setq anchor-string "@anchor-no-refill")))
@@ -2003,7 +2003,7 @@ commands that are defined in texinfo.tex for printed output.
(error "In @multitable, @columnfractions misspelled"))
;; Case 1: @columnfractions .25 .3 .45
((looking-at "@columnfractions")
- (forward-word 1)
+ (forward-word-strictly 1)
(while (not (eolp))
(push (truncate
(1-
@@ -2118,7 +2118,7 @@ This command is executed when texinfmt sees @item inside @multitable."
;; Delete the @tab command, including the @-sign
(delete-region
(point)
- (progn (forward-word -1) (1- (point)))))
+ (progn (forward-word-strictly -1) (1- (point)))))
(point)))
;; Set fill-column *wider* than needed to produce inter-column space
(setq fill-column (+ 1
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index 12a991163b3..ed6022f9fbb 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -393,7 +393,7 @@ Subexpression 1 is what goes into the corresponding `@end' statement.")
(unless (get-char-property start 'text-clones)
(if endp
(texinfo-last-unended-begin)
- (forward-word 1)
+ (forward-word-strictly 1)
(texinfo-next-unmatched-end))
(skip-syntax-forward "^w")
(when (looking-at
@@ -738,7 +738,7 @@ With prefix argument or inside @code or @example, inserts a plain \"."
"Insert the matching `@end' for the last Texinfo command that needs one."
(ignore-errors
(save-excursion
- (backward-word 1)
+ (backward-word-strictly 1)
(texinfo-last-unended-begin)
(or (match-string 1) '-)))
\n "@end " str \n \n)
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el
index 8f401323445..b01c678ffec 100644
--- a/lisp/textmodes/texnfo-upd.el
+++ b/lisp/textmodes/texnfo-upd.el
@@ -519,7 +519,7 @@ line. If there is no node name, returns an empty string."
(save-excursion
(buffer-substring
- (progn (forward-word 1) ; skip over node command
+ (progn (forward-word-strictly 1) ; skip over node command
(skip-chars-forward " \t") ; and over spaces
(point))
(if (search-forward "," (line-end-position) t) ; bound search
@@ -542,7 +542,7 @@ must have been done by `texinfo-menu-locate-entry-p'."
(goto-char (match-beginning 7)) ; match section name
(buffer-substring
- (progn (forward-word 1) ; skip over section type
+ (progn (forward-word-strictly 1) ; skip over section type
(skip-chars-forward " \t") ; and over spaces
(point))
(progn (end-of-line) (point))))
@@ -794,7 +794,7 @@ complements the node name rather than repeats it as a title does."
(setq title
(buffer-substring
;; skip over section type
- (progn (forward-word 1)
+ (progn (forward-word-strictly 1)
;; and over spaces
(skip-chars-forward " \t")
(point))
@@ -1104,7 +1104,7 @@ point."
t)
(progn
(beginning-of-line)
- (forward-word 1) ; skip over section type
+ (forward-word-strictly 1) ; skip over section type
(skip-chars-forward " \t") ; and over spaces
(buffer-substring
(point)
@@ -1167,7 +1167,7 @@ error if the node is not the top node and a section is not found."
(setq sec-name (buffer-substring-no-properties
(progn (beginning-of-line) ; copy its name
(1+ (point)))
- (progn (forward-word 1)
+ (progn (forward-word-strictly 1)
(point))))))
(cond
((or sec-pos top-pos)
@@ -1374,7 +1374,7 @@ Point must be at beginning of node line. Does not move point."
(save-excursion
(let ((initial (texinfo-copy-next-section-title)))
;; This is not clean. Use `interactive' to read the arg.
- (forward-word 1) ; skip over node command
+ (forward-word-strictly 1) ; skip over node command
(skip-chars-forward " \t") ; and over spaces
(if (not (looking-at "[^,\t\n ]+")) ; regexp based on what Info looks for
; alternatively, use "[a-zA-Z]+"
@@ -1700,7 +1700,7 @@ node names in pre-existing `@node' lines that lack names."
(if title-p
(progn
(beginning-of-line)
- (forward-word 1)
+ (forward-word-strictly 1)
(skip-chars-forward " \t")
(setq title (buffer-substring
(point)
@@ -1713,7 +1713,7 @@ node names in pre-existing `@node' lines that lack names."
(line-beginning-position -1))
t)
;; @node is present, and point at beginning of that line
- (forward-word 1) ; Leave point just after @node.
+ (forward-word-strictly 1) ; Leave point just after @node.
;; Else @node missing; insert one.
(beginning-of-line) ; Beginning of `@section' line.
(insert "@node\n")
@@ -1728,7 +1728,7 @@ node names in pre-existing `@node' lines that lack names."
(if (not (looking-at "[^,\t\n ]+"))
(progn
(beginning-of-line)
- (forward-word 1)
+ (forward-word-strictly 1)
(insert " " title)
(message "Inserted title %s ... " title)))))
;; Go forward beyond current section title.
@@ -1813,7 +1813,7 @@ same place. If there is no title, returns an empty string."
;; copy title
(let ((title
(buffer-substring
- (progn (forward-word 1) ; skip over section type
+ (progn (forward-word-strictly 1) ; skip over section type
(skip-chars-forward " \t") ; and over spaces
(point))
(progn (end-of-line) (point)))))