summaryrefslogtreecommitdiff
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2015-12-29 21:39:08 -0800
committerJohn Wiegley <johnw@newartisans.com>2015-12-29 21:39:08 -0800
commitec0a80cc283badc7f7fd5ef78512dde6d34b1355 (patch)
tree7190e0fb3d4aa06018d8cf997f06b806fb09a9c8 /lisp/textmodes
parentd259328fb87db8cc67d52771efcfa653e52c5b71 (diff)
parente823c34072bf045800d91e12c7ddb61fa23c6e30 (diff)
downloademacs-25-merge.tar.gz
Merge emacs-25 into master (using imerge)emacs-25-merge
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/artist.el28
-rw-r--r--lisp/textmodes/bibtex.el4
-rw-r--r--lisp/textmodes/css-mode.el3
-rw-r--r--lisp/textmodes/ispell.el80
-rw-r--r--lisp/textmodes/page-ext.el2
-rw-r--r--lisp/textmodes/refbib.el6
-rw-r--r--lisp/textmodes/refer.el6
-rw-r--r--lisp/textmodes/reftex-auc.el2
-rw-r--r--lisp/textmodes/reftex-vars.el10
-rw-r--r--lisp/textmodes/sgml-mode.el2
-rw-r--r--lisp/textmodes/table.el4
-rw-r--r--lisp/textmodes/tex-mode.el2
-rw-r--r--lisp/textmodes/text-mode.el2
13 files changed, 121 insertions, 30 deletions
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index a29418e6f84..373ab14e3fb 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -2873,10 +2873,36 @@ Returns a list of strings."
(error "Failed to read available fonts: %s (%d)" stderr exit-code))
(artist-string-split stdout ".flf\n")))
+(defun artist-figlet-get-font-list-windows ()
+ "Read in fonts on MS-Windows by collecting output of the `figlet' program.
+Returns a list of strings."
+ (let* ((ls-cmd "figlet -I2")
+ (result (artist-system shell-file-name nil
+ (list shell-command-switch ls-cmd)))
+ (exit-code (elt result 0))
+ (stdout (elt result 1))
+ (stderr (elt result 2)))
+ (if (not (= exit-code 0))
+ (error "Failed to read available fonts: %s (%d)" stderr exit-code))
+ (let ((dir-list (artist-string-split stdout "\n"))
+ result)
+ (mapc
+ (lambda (dir)
+ (let ((default-directory dir))
+ (setq result (append (file-expand-wildcards "*.flf") result))))
+ dir-list)
+ (mapcar
+ (lambda (file)
+ (replace-regexp-in-string "\.flf\\'" "" file))
+ result))))
+
(defun artist-figlet-choose-font ()
"Read any extra arguments for figlet."
(interactive)
- (let* ((avail-fonts (artist-figlet-get-font-list))
+ (let* ((avail-fonts
+ (if (memq system-type '(windows-nt ms-dos))
+ (artist-figlet-get-font-list-windows)
+ (artist-figlet-get-font-list)))
(font (completing-read (concat "Select font (default "
artist-figlet-default-font
"): ")
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index df8066ee2fc..deb39d943a8 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -1503,7 +1503,7 @@ At most `bibtex-entry-kill-ring-max' items are kept here.")
"The tail of `bibtex-entry-kill-ring' whose car is the last item yanked.")
(defvar bibtex-last-kill-command nil
- "Type of the last kill command (either 'field or 'entry).")
+ "Type of the last kill command (either `field' or `entry').")
(defvar bibtex-strings
(lazy-completion-table bibtex-strings
@@ -2573,7 +2573,7 @@ Formats current entry according to variable `bibtex-entry-format'."
(defun bibtex-field-re-init (regexp-alist type)
"Calculate optimized value for bibtex-regexp-TYPE-opt.
-This value is based on bibtex-regexp-TYPE-alist. TYPE is 'braces or 'strings.
+This value is based on bibtex-regexp-TYPE-alist. TYPE is `braces' or `strings'.
Return optimized value to be used by `bibtex-format-entry'."
(setq regexp-alist
(mapcar (lambda (e)
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 3e84b43bcb4..a8a206760b7 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -308,7 +308,8 @@
(defcustom css-indent-offset 4
"Basic size of one indentation step."
:version "22.2"
- :type 'integer)
+ :type 'integer
+ :safe 'integerp)
(require 'smie)
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index fe27f0f158c..05a5da57b66 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1782,6 +1782,51 @@ Extended character mode can be changed for this buffer by placing
a `~' followed by an extended-character mode -- such as `~.tex'.
The last occurring definition in the buffer will be used.")
+(defun ispell--\\w-filter (char)
+ "Return CHAR in a string when CHAR doesn't have \"word\" syntax,
+nil otherwise. CHAR must be a character."
+ (let ((str (string char)))
+ (and
+ (not (string-match "\\w" str))
+ str)))
+
+(defun ispell--make-\\w-expression (chars)
+ "Make a regular expression like \"\\(\\w\\|[-_]\\)\".
+This (parenthesized) expression matches either a character of
+\"word\" syntax or one in CHARS.
+
+CHARS is a string of characters. A member of CHARS is omitted
+from the expression if it already has word syntax. (Be careful
+about special characters such as ?\\, ?^, ?], and ?- in CHARS.)
+If after this filtering there are no chars left, or only one, a
+special form of the expression is generated."
+ (let ((filtered
+ (mapconcat #'ispell--\\w-filter chars "")))
+ (concat
+ "\\(\\w"
+ (cond
+ ((equal filtered "")
+ "\\)")
+ ((eq (length filtered) 1)
+ (concat "\\|" filtered "\\)"))
+ (t
+ (concat "\\|[" filtered "]\\)"))))))
+
+(defun ispell--make-filename-or-URL-re ()
+ "Construct a regexp to match some file names or URLs or email addresses.
+The expression is crafted to match as great a variety of these
+objects as practicable, without too many false matches happening."
+ (concat ;"\\(--+\\|_+\\|"
+ "\\(/\\w\\|\\("
+ (ispell--make-\\w-expression "-_")
+ "+[.:@]\\)\\)"
+ (ispell--make-\\w-expression "-_")
+ "*\\([.:/@]+"
+ (ispell--make-\\w-expression "-_~=?&")
+ "+\\)+"
+ ;"\\)"
+ ))
+
;;;###autoload
(defvar ispell-skip-region-alist
`((ispell-words-keyword forward-line)
@@ -1798,7 +1843,7 @@ The last occurring definition in the buffer will be used.")
;; Matches e-mail addresses, file names, http addresses, etc. The
;; `-+' `_+' patterns are necessary for performance reasons when
;; `-' or `_' part of word syntax.
- (,(purecopy "\\(--+\\|_+\\|\\(/\\w\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)"))
+; (,(purecopy "\\(--+\\|_+\\|\\(/\\w\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)"))
;; above checks /.\w sequences
;;("\\(--+\\|\\(/\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)")
;; This is a pretty complex regexp. It can be simplified to the following:
@@ -2248,6 +2293,11 @@ If so, ask if it needs to be saved."
(setq ispell-pdict-modified-p nil))
+(defvar ispell-update-post-hook nil
+ "A normal hook invoked from the ispell command loop.
+It is called once per iteration, before displaying a prompt to
+the user.")
+
(defun ispell-command-loop (miss guess word start end)
"Display possible corrections from list MISS.
GUESS lists possibly valid affix construction of WORD.
@@ -2315,8 +2365,10 @@ Global `ispell-quit' set to start location to continue spell session."
count (ispell-int-char (1+ count))))
(setq count (ispell-int-char (- count ?0 skipped))))
+ (run-hooks 'ispell-update-post-hook)
+
;; ensure word is visible
- (if (not (pos-visible-in-window-p end))
+ (if (not (pos-visible-in-window-group-p end))
(sit-for 0))
;; Display choices for misspelled word.
@@ -2809,6 +2861,7 @@ The variable `ispell-highlight-face' selects the face to use for highlighting."
(regexp-quote (buffer-substring-no-properties start end))
"\\b"))
(isearch-regexp t)
+ (isearch-regexp-function nil)
(isearch-case-fold-search nil)
(isearch-forward t)
(isearch-other-end start)
@@ -2844,13 +2897,20 @@ Also position fit window to BUFFER and select it."
(prog1
(condition-case nil
(split-window
- nil (- ispell-choices-win-default-height) 'above)
+ ;; Chose the last of a window group, since
+ ;; otherwise, the lowering of another window's
+ ;; TL corner would cause the logical order of
+ ;; the windows to be changed.
+ (car (last (selected-window-group)))
+ (- ispell-choices-win-default-height) 'above)
(error nil))
(modify-frame-parameters frame '((unsplittable . t))))))
(and (not unsplittable)
(condition-case nil
(split-window
- nil (- ispell-choices-win-default-height) 'above)
+ ;; See comment above.
+ (car (last (selected-window-group)))
+ (- ispell-choices-win-default-height) 'above)
(error nil)))
(display-buffer buffer))))
(if (not window)
@@ -3373,7 +3433,8 @@ Must be called after `ispell-buffer-local-parsing' due to dependence on mode."
(if (string= "" comment-end) "^" (regexp-quote comment-end)))
(if (and (null ispell-check-comments) comment-start)
(regexp-quote comment-start))
- (ispell-begin-skip-region ispell-skip-region-alist)))
+ (ispell-begin-skip-region ispell-skip-region-alist)
+ (ispell--make-filename-or-URL-re)))
"\\|"))
@@ -3412,6 +3473,8 @@ Manual checking must include comments and tib references.
The list is of the form described by variable `ispell-skip-region-alist'.
Must be called after `ispell-buffer-local-parsing' due to dependence on mode."
(let ((skip-alist ispell-skip-region-alist))
+ (setq skip-alist (append (list (list (ispell--make-filename-or-URL-re)))
+ skip-alist))
;; only additional explicit region definition is tex.
(if (eq ispell-parser 'tex)
(setq case-fold-search nil
@@ -4105,9 +4168,10 @@ You can bind this to the key C-c i in GNUS or mail by adding to
(ispell-non-empty-string vm-included-text-prefix)))
(t default-prefix)))
(ispell-skip-region-alist
- (cons (list (concat "^\\(" cite-regexp "\\)")
- (function forward-line))
- ispell-skip-region-alist))
+ (cons (list (ispell--make-filename-or-URL-re))
+ (cons (list (concat "^\\(" cite-regexp "\\)")
+ (function forward-line))
+ ispell-skip-region-alist)))
(old-case-fold-search case-fold-search)
(dictionary-alist ispell-message-dictionary-alist)
(ispell-checking-message t))
diff --git a/lisp/textmodes/page-ext.el b/lisp/textmodes/page-ext.el
index 99962c75897..c7a2f258f86 100644
--- a/lisp/textmodes/page-ext.el
+++ b/lisp/textmodes/page-ext.el
@@ -351,7 +351,7 @@ Else insert at exact location of point.
Narrow to new page if `pages-directory-for-adding-page-narrowing-p' is
non-nil.
-Page begins with a '^L' as the default `page-delimiter'.
+Page begins with a `^L' as the default `page-delimiter'.
Use \\[set-page-delimiter] to change the page-delimiter.
Point is left in the body of page."
(interactive "sHeader line: ")
diff --git a/lisp/textmodes/refbib.el b/lisp/textmodes/refbib.el
index 424b6d0f6a1..e5b89a24a52 100644
--- a/lisp/textmodes/refbib.el
+++ b/lisp/textmodes/refbib.el
@@ -79,7 +79,7 @@ may be eliminated if is exactly the same as the car.
Because titles are capitalized before matching, the abbreviation
for the journal name should be listed as beginning with a capital
letter, even if it really doesn't.
- For example, a value of '((\"Aij\" \"{Artificial Intelligence}\")
+ For example, a value of ((\"Aij\" \"{Artificial Intelligence}\")
\(\"Ijcai81\" \"ijcai7\")) would expand Aij to the text string
\"Artificial Intelligence\", but would replace Ijcai81 with the
BibTeX macro \"ijcai7\"."
@@ -97,7 +97,7 @@ abbreviation. The cadr may be eliminated if is exactly the same as
the car.
Because titles are capitalized before matching, the abbreviated title
should be listed as beginning with a capital letter, even if it doesn't.
- For example, a value of '((\"Aij\" \"{Artificial Intelligence}\")
+ For example, a value of ((\"Aij\" \"{Artificial Intelligence}\")
\(\"Ijcai81\" \"ijcai7\")) would expand Aij to the text string
\"Artificial Intelligence\", but would replace Ijcai81 with the
BibTeX macro \"ijcai7\"."
@@ -115,7 +115,7 @@ The entry must match the given data exactly.
should begin with a capital letter.
For example, suppose the title \"Ijcai81\" is used for the proceedings of
a conference, and its expansion is the BibTeX macro \"ijcai7\". Then
-`r2b-proceedings-list' should be '((\"Ijcai81\") ...). If instead its
+`r2b-proceedings-list' should be ((\"Ijcai81\") ...). If instead its
expansion were \"Proceedings of the Seventh International Conference
on Artificial Intelligence\", then you would NOT need to include Ijcai81
in `r2b-proceedings-list' (although it wouldn't cause an error)."
diff --git a/lisp/textmodes/refer.el b/lisp/textmodes/refer.el
index 22dc7dc9165..dfdda8a5742 100644
--- a/lisp/textmodes/refer.el
+++ b/lisp/textmodes/refer.el
@@ -77,13 +77,13 @@
(defcustom refer-bib-directory nil
"Directory, or list of directories, to search for \\.bib files.
-Can be set to 'bibinputs or 'texinputs, in which case the environment
+Can be set to `bibinputs' or `texinputs', in which case the environment
variable BIBINPUTS or TEXINPUTS, respectively, is used to obtain a
-list of directories. Useful only if `refer-bib-files' is set to 'dir or
+list of directories. Useful only if `refer-bib-files' is set to `dir' or
a list of file names (without directory). A value of nil indicates the
current working directory.
-If `refer-bib-directory' is 'bibinputs or 'texinputs, it is setq'd to
+If `refer-bib-directory' is `bibinputs' or `texinputs', it is setq'd to
the appropriate list of directories when it is first used.
Note that an empty directory is interpreted by BibTeX as indicating
diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el
index b2629a5a5ae..8316fe5072b 100644
--- a/lisp/textmodes/reftex-auc.el
+++ b/lisp/textmodes/reftex-auc.el
@@ -137,7 +137,7 @@ argument identify one of multiple indices."
((stringp tag) tag)
((integerp tag)
(save-excursion
- (goto-char (match-end 1))
+ (goto-char (match-end 0))
(or (reftex-nth-arg tag (nth 6 entry)) "idx")))
(t "idx")))))
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 97c8af365e8..fcab1367f7d 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -335,7 +335,7 @@ more than `reftex-idle-time' seconds.
Value t means, turn on immediately when RefTeX gets started. Then,
recentering will work for any TOC window created during the session.
-Value 'frame (the default) means, turn automatic recentering on only while the
+Value `frame' (the default) means, turn automatic recentering on only while the
dedicated TOC frame does exist, and do the recentering only in that frame. So
when creating that frame (with `d' key in an ordinary TOC window), the
automatic recentering is turned on. When the frame gets destroyed, automatic
@@ -739,7 +739,7 @@ And here is the setup for RefTeX:
\\end. Here we use \"linguex\" as this name.
(setq reftex-label-alist
- '((\"linguex\" ?x \"ex:\" \"~\\\\ref{%s}\" nil (\"Example\" \"Ex.\"))))
+ \\='((\"linguex\" ?x \"ex:\" \"~\\\\ref{%s}\" nil (\"Example\" \"Ex.\"))))
2. Write a function to detect the list macros and the determinators as well.
@@ -762,7 +762,7 @@ And here is the setup for RefTeX:
3. Tell RefTeX to use this function
- (setq reftex-special-environment-functions '(my-detect-linguex-list))"
+ (setq reftex-special-environment-functions \\='(my-detect-linguex-list))"
:group 'reftex-defining-label-environments
:type 'hook)
@@ -877,7 +877,7 @@ DOWNCASE t: Downcase words before using them."
"\\\\label{\\(?1:[^}]*\\)}"
;; keyvals [..., label = {foo}, ...] forms used by ctable,
;; listings, minted, ...
- "\\[[^[]]*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?")
+ "\\[[^][]\\{0,2000\\}\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?")
"List of regexps matching \\label definitions.
The default value matches usual \\label{...} definitions and
keyval style [..., label = {...}, ...] label definitions. It is
@@ -1206,7 +1206,7 @@ strings.
`reftex-cite-format' directly yourself or set it to the SYMBOL of one of
the predefined styles. The predefined symbols are those which have an
association in the constant `reftex-cite-format-builtin'.
-E.g.: (setq reftex-cite-format 'natbib)"
+E.g.: (setq reftex-cite-format \\='natbib)"
:group 'reftex-citation-support
:type
`(choice
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 55a1e6d26db..239112bca33 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -697,7 +697,7 @@ This only works for Latin-1 input."
"Prompt for a tag and insert it, optionally with attributes.
Completion and configuration are done according to `sgml-tag-alist'.
If you like tags and attributes in uppercase, customize
-`sgml-transformation-function' to 'upcase."
+`sgml-transformation-function' to `upcase'."
(funcall (or skeleton-transformation-function 'identity)
(setq sgml-tag-last
(completing-read
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el
index 151d64808af..97da43757da 100644
--- a/lisp/textmodes/table.el
+++ b/lisp/textmodes/table.el
@@ -2938,7 +2938,7 @@ WHERE is provided the cell and table at that location is reported."
(defun table-generate-source (language &optional dest-buffer caption)
"Generate source of the current table in the specified language.
LANGUAGE is a symbol that specifies the language to describe the
-structure of the table. It must be either 'html, 'latex or 'cals.
+structure of the table. It must be either `html', `latex' or `cals'.
The resulted source text is inserted into DEST-BUFFER and the buffer
object is returned. When DEST-BUFFER is omitted or nil the default
buffer specified in `table-dest-buffer-name' is used. In this case
@@ -3561,7 +3561,7 @@ delimiter regular expressions. This parsing determines the number of
columns and rows of the table automatically. If COL-DELIM-REGEXP and
ROW-DELIM-REGEXP are omitted the result table has only one cell and
the entire region contents is placed in that cell. Optional JUSTIFY
-is one of 'left, 'center or 'right, which specifies the cell
+is one of `left', `center' or `right', which specifies the cell
justification. Optional MIN-CELL-WIDTH specifies the minimum cell
width. Optional COLUMNS specify the number of columns when
ROW-DELIM-REGEXP is not specified.
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index c9d347da02d..22bb8ca41db 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -188,7 +188,7 @@ If two printers are not enough of a choice, you can set the variable
for example,
(setq tex-alt-dvi-print-command
- '(format \"lpr -P%s\" (read-string \"Use printer: \")))
+ \\='(format \"lpr -P%s\" (read-string \"Use printer: \")))
would tell \\[tex-print] with a prefix argument to ask you which printer to
use."
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index 1466556ab59..1e0a949ed05 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -39,7 +39,7 @@
(defvar text-mode-variant nil
"Non-nil if this buffer's major mode is a variant of Text mode.
-Use (derived-mode-p 'text-mode) instead.")
+Use (derived-mode-p \\='text-mode) instead.")
(defvar text-mode-syntax-table
(let ((st (make-syntax-table)))