aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2015-08-30 22:53:21 -0700
committerPaul Eggert2015-08-30 23:12:30 -0700
commit2cac2e2e1067b6f48e96667b9c030cdb5df88af4 (patch)
treead5375302a3c1e080a4995a3c44e08c2d662d8a8
parentb533552292e37a99862627651e11860c6ef5411c (diff)
downloademacs-2cac2e2e1067b6f48e96667b9c030cdb5df88af4.tar.gz
emacs-2cac2e2e1067b6f48e96667b9c030cdb5df88af4.zip
Quoting fixes in lisp/textmodes
* lisp/textmodes/bibtex.el (bibtex-validate) (bibtex-validate-globally, bibtex-search-entries): * lisp/textmodes/ispell.el (ispell-command-loop): * lisp/textmodes/page-ext.el (search-pages, pages-directory): * lisp/textmodes/texinfmt.el (texinfmt-version) (texinfo-format-region, texinfo-format-buffer-1): * lisp/textmodes/two-column.el (2C-split): Respect text quoting style in doc strings and diagnostics. * lisp/textmodes/conf-mode.el (conf-mode-map, conf-quote-normal): * lisp/textmodes/sgml-mode.el (sgml-specials, sgml-mode): Escape apostrophes in doc strings.
-rw-r--r--lisp/textmodes/bibtex.el39
-rw-r--r--lisp/textmodes/conf-mode.el6
-rw-r--r--lisp/textmodes/ispell.el3
-rw-r--r--lisp/textmodes/page-ext.el14
-rw-r--r--lisp/textmodes/sgml-mode.el10
-rw-r--r--lisp/textmodes/texinfmt.el36
-rw-r--r--lisp/textmodes/two-column.el5
7 files changed, 60 insertions, 53 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index b1232d4c0a0..279f657c0ec 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -4232,7 +4232,7 @@ Return t if test was successful, nil otherwise."
4232 (cond ((not previous)) 4232 (cond ((not previous))
4233 ((member key key-list) 4233 ((member key key-list)
4234 (push (cons (bibtex-current-line) 4234 (push (cons (bibtex-current-line)
4235 (format "Duplicate key `%s'" key)) 4235 (format-message "Duplicate key `%s'" key))
4236 error-list)) 4236 error-list))
4237 ((and bibtex-maintain-sorted-entries 4237 ((and bibtex-maintain-sorted-entries
4238 (not (bibtex-lessp previous current))) 4238 (not (bibtex-lessp previous current)))
@@ -4255,8 +4255,9 @@ Return t if test was successful, nil otherwise."
4255 (cdr (assoc-string (car key) bibtex-reference-keys))) 4255 (cdr (assoc-string (car key) bibtex-reference-keys)))
4256 (bibtex-search-entry (car key)) 4256 (bibtex-search-entry (car key))
4257 (push (cons (bibtex-current-line) 4257 (push (cons (bibtex-current-line)
4258 (format "Duplicate key `%s' in %s" (car key) 4258 (format-message
4259 (abbreviate-file-name (buffer-file-name buffer)))) 4259 "Duplicate key `%s' in %s" (car key)
4260 (abbreviate-file-name (buffer-file-name buffer))))
4260 error-list)))) 4261 error-list))))
4261 4262
4262 (when test-thoroughly 4263 (when test-thoroughly
@@ -4306,14 +4307,16 @@ Return t if test was successful, nil otherwise."
4306 (if (setq idx (nth 3 field)) 4307 (if (setq idx (nth 3 field))
4307 (bibtex-vec-push alt-expect idx (car field)) 4308 (bibtex-vec-push alt-expect idx (car field))
4308 (push (cons beg-line 4309 (push (cons beg-line
4309 (format "Required field `%s' missing" 4310 (format-message
4310 (car field))) 4311 "Required field `%s' missing"
4312 (car field)))
4311 error-list))) 4313 error-list)))
4312 (dotimes (idx num-alt) 4314 (dotimes (idx num-alt)
4313 (unless (aref alt-fields idx) 4315 (unless (aref alt-fields idx)
4314 (push (cons beg-line 4316 (push (cons beg-line
4315 (format "Alternative fields `%s' missing" 4317 (format-message
4316 (aref alt-expect idx))) 4318 "Alternative fields `%s' missing"
4319 (aref alt-expect idx)))
4317 error-list)))))))) 4320 error-list))))))))
4318 (bibtex-progress-message 'done))))) 4321 (bibtex-progress-message 'done)))))
4319 4322
@@ -4327,7 +4330,8 @@ Return t if test was successful, nil otherwise."
4327 (unless (eq major-mode 'compilation-mode) (compilation-mode)) 4330 (unless (eq major-mode 'compilation-mode) (compilation-mode))
4328 (let ((inhibit-read-only t)) 4331 (let ((inhibit-read-only t))
4329 (delete-region (point-min) (point-max)) 4332 (delete-region (point-min) (point-max))
4330 (insert "BibTeX mode command `bibtex-validate'\n" 4333 (insert (substitute-command-keys
4334 "BibTeX mode command `bibtex-validate'\n")
4331 (if syntax-error 4335 (if syntax-error
4332 "Maybe undetected errors due to syntax errors. \ 4336 "Maybe undetected errors due to syntax errors. \
4333Correct and validate again.\n" 4337Correct and validate again.\n"
@@ -4362,9 +4366,10 @@ Return t if test was successful, nil otherwise."
4362 (if (or (and strings (bibtex-string= entry-type "string")) 4366 (if (or (and strings (bibtex-string= entry-type "string"))
4363 (assoc-string entry-type bibtex-entry-alist t)) 4367 (assoc-string entry-type bibtex-entry-alist t))
4364 (if (member key key-list) 4368 (if (member key key-list)
4365 (push (format "%s:%d: Duplicate key `%s'\n" 4369 (push (format-message
4366 (buffer-file-name) 4370 "%s:%d: Duplicate key `%s'\n"
4367 (bibtex-current-line) key) 4371 (buffer-file-name)
4372 (bibtex-current-line) key)
4368 error-list) 4373 error-list)
4369 (push key key-list)))) 4374 (push key key-list))))
4370 (push (cons buffer key-list) buffer-key-list))))) 4375 (push (cons buffer key-list) buffer-key-list)))))
@@ -4377,9 +4382,10 @@ Return t if test was successful, nil otherwise."
4377 (dolist (key (cdr (assq buffer buffer-key-list))) 4382 (dolist (key (cdr (assq buffer buffer-key-list)))
4378 (when (assoc-string key current-keys) 4383 (when (assoc-string key current-keys)
4379 (bibtex-search-entry key) 4384 (bibtex-search-entry key)
4380 (push (format "%s:%d: Duplicate key `%s' in %s\n" 4385 (push (format-message
4381 (buffer-file-name) (bibtex-current-line) key 4386 "%s:%d: Duplicate key `%s' in %s\n"
4382 (abbreviate-file-name (buffer-file-name buffer))) 4387 (buffer-file-name) (bibtex-current-line) key
4388 (abbreviate-file-name (buffer-file-name buffer)))
4383 error-list)))))) 4389 error-list))))))
4384 4390
4385 ;; Process error list 4391 ;; Process error list
@@ -4389,7 +4395,8 @@ Return t if test was successful, nil otherwise."
4389 (unless (eq major-mode 'compilation-mode) (compilation-mode)) 4395 (unless (eq major-mode 'compilation-mode) (compilation-mode))
4390 (let ((inhibit-read-only t)) 4396 (let ((inhibit-read-only t))
4391 (delete-region (point-min) (point-max)) 4397 (delete-region (point-min) (point-max))
4392 (insert "BibTeX mode command `bibtex-validate-globally'\n\n") 4398 (insert (substitute-command-keys
4399 "BibTeX mode command `bibtex-validate-globally'\n\n"))
4393 (dolist (err (sort error-list 'string-lessp)) (insert err)) 4400 (dolist (err (sort error-list 'string-lessp)) (insert err))
4394 (set-buffer-modified-p nil)) 4401 (set-buffer-modified-p nil))
4395 (goto-char (point-min)) 4402 (goto-char (point-min))
@@ -5280,7 +5287,7 @@ where FILE is the BibTeX file of ENTRY."
5280 (bibtex-display-entries entries) 5287 (bibtex-display-entries entries)
5281 (message "No BibTeX entries %smatching `%s'" 5288 (message "No BibTeX entries %smatching `%s'"
5282 (if (string= "" field) "" 5289 (if (string= "" field) ""
5283 (format "with field `%s' " field)) 5290 (format-message "with field `%s' " field))
5284 regexp))) 5291 regexp)))
5285 entries)) 5292 entries))
5286 5293
diff --git a/lisp/textmodes/conf-mode.el b/lisp/textmodes/conf-mode.el
index b6bea218626..267d23f38de 100644
--- a/lisp/textmodes/conf-mode.el
+++ b/lisp/textmodes/conf-mode.el
@@ -122,7 +122,7 @@ not align (only setting space according to `conf-assignment-space')."
122 (define-key menu-map [c-s0] '("--")) 122 (define-key menu-map [c-s0] '("--"))
123 (define-key menu-map [conf-quote-normal] 123 (define-key menu-map [conf-quote-normal]
124 '(menu-item "Set quote syntax normal" conf-quote-normal 124 '(menu-item "Set quote syntax normal" conf-quote-normal
125 :help "Set the syntax of \' and \" to punctuation")) 125 :help "Set the syntax of \\=' and \" to punctuation"))
126 (define-key menu-map [conf-align-assignments] 126 (define-key menu-map [conf-align-assignments]
127 '(menu-item "Align assignments" conf-align-assignments 127 '(menu-item "Align assignments" conf-align-assignments
128 :help "Align assignments")) 128 :help "Align assignments"))
@@ -296,8 +296,8 @@ contents of the region. Otherwise, operate on the whole buffer."
296 296
297 297
298(defun conf-quote-normal (arg) 298(defun conf-quote-normal (arg)
299 "Set the syntax of ' and \" to punctuation. 299 "Set the syntax of \\=' and \" to punctuation.
300With prefix arg, only do it for ' if 1, or only for \" if 2. 300With prefix arg, only do it for \\=' if 1, or only for \" if 2.
301This only affects the current buffer. Some conf files use quotes 301This only affects the current buffer. Some conf files use quotes
302to delimit strings, while others allow quotes as simple parts of 302to delimit strings, while others allow quotes as simple parts of
303the assigned value. In those files font locking will be wrong, 303the assigned value. In those files font locking will be wrong,
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index dda983b52b3..3fe21c482d6 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2297,7 +2297,8 @@ Global `ispell-quit' set to start location to continue spell session."
2297 (insert "\n\t")) 2297 (insert "\n\t"))
2298 (insert (car guess) " ") 2298 (insert (car guess) " ")
2299 (setq guess (cdr guess))) 2299 (setq guess (cdr guess)))
2300 (insert "\nUse option `i' to accept this spelling and put it in your private dictionary.\n"))) 2300 (insert (substitute-command-keys
2301 "\nUse option `i' to accept this spelling and put it in your private dictionary.\n"))))
2301 (while choices 2302 (while choices
2302 (when (> (+ 7 (current-column) 2303 (when (> (+ 7 (current-column)
2303 (length (car choices)) 2304 (length (car choices))
diff --git a/lisp/textmodes/page-ext.el b/lisp/textmodes/page-ext.el
index d3bd33e98f0..57134e06c19 100644
--- a/lisp/textmodes/page-ext.el
+++ b/lisp/textmodes/page-ext.el
@@ -395,8 +395,8 @@ Point is left in the body of page."
395 "Search for REGEXP, starting from point, and narrow to page it is in." 395 "Search for REGEXP, starting from point, and narrow to page it is in."
396 (interactive (list 396 (interactive (list
397 (read-string 397 (read-string
398 (format "Search for `%s' (end with RET): " 398 (format-message "Search for `%s' (end with RET): "
399 (or pages-last-search "regexp"))))) 399 (or pages-last-search "regexp")))))
400 (if (equal regexp "") 400 (if (equal regexp "")
401 (setq regexp pages-last-search) 401 (setq regexp pages-last-search)
402 (setq pages-last-search regexp)) 402 (setq pages-last-search regexp))
@@ -549,16 +549,18 @@ directory for only the accessible portion of the buffer."
549 (list nil 549 (list nil
550 nil 550 nil
551 (read-string 551 (read-string
552 (format "Select according to `%s' (end with RET): " 552 (format-message
553 (or pages-directory-previous-regexp "regexp"))))) 553 "Select according to `%s' (end with RET): "
554 (or pages-directory-previous-regexp "regexp")))))
554 ((> (prefix-numeric-value current-prefix-arg) 0) 555 ((> (prefix-numeric-value current-prefix-arg) 0)
555 (list t t nil)) 556 (list t t nil))
556 ((< (prefix-numeric-value current-prefix-arg) 0) 557 ((< (prefix-numeric-value current-prefix-arg) 0)
557 (list nil 558 (list nil
558 t 559 t
559 (read-string 560 (read-string
560 (format "Select according to `%s' (end with RET): " 561 (format-message
561 (or pages-directory-previous-regexp "regexp"))))))) 562 "Select according to `%s' (end with RET): "
563 (or pages-directory-previous-regexp "regexp")))))))
562 564
563 (if (equal regexp "") 565 (if (equal regexp "")
564 (setq regexp pages-directory-previous-regexp) 566 (setq regexp pages-directory-previous-regexp)
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 6a14b52dc92..1d872f08749 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -106,10 +106,10 @@ This list is used when first loading the `sgml-mode' library.
106The supported characters and potential disadvantages are: 106The supported characters and potential disadvantages are:
107 107
108 ?\\\" Makes \" in text start a string. 108 ?\\\" Makes \" in text start a string.
109 ?' Makes ' in text start a string. 109 ?\\=' Makes \\=' in text start a string.
110 ?- Makes -- in text start a comment. 110 ?- Makes -- in text start a comment.
111 111
112When only one of ?\\\" or ?' are included, \"'\" or '\"', as can be found in 112When only one of ?\\\" or ?\\=' are included, \"\\='\" or \\='\"\\=', as can be found in
113DTDs, start a string. To partially avoid this problem this also makes these 113DTDs, start a string. To partially avoid this problem this also makes these
114self insert as named entities depending on `sgml-quick-keys'. 114self insert as named entities depending on `sgml-quick-keys'.
115 115
@@ -482,14 +482,14 @@ This function is designed for use in `fill-nobreak-predicate'.
482(define-derived-mode sgml-mode text-mode '(sgml-xml-mode "XML" "SGML") 482(define-derived-mode sgml-mode text-mode '(sgml-xml-mode "XML" "SGML")
483 "Major mode for editing SGML documents. 483 "Major mode for editing SGML documents.
484Makes > match <. 484Makes > match <.
485Keys <, &, SPC within <>, \", / and ' can be electric depending on 485Keys <, &, SPC within <>, \", / and \\=' can be electric depending on
486`sgml-quick-keys'. 486`sgml-quick-keys'.
487 487
488An argument of N to a tag-inserting command means to wrap it around 488An argument of N to a tag-inserting command means to wrap it around
489the next N words. In Transient Mark mode, when the mark is active, 489the next N words. In Transient Mark mode, when the mark is active,
490N defaults to -1, which means to wrap it around the current region. 490N defaults to -1, which means to wrap it around the current region.
491 491
492If you like upcased tags, put (setq sgml-transformation-function 'upcase) 492If you like upcased tags, put (setq sgml-transformation-function \\='upcase)
493in your init file. 493in your init file.
494 494
495Use \\[sgml-validate] to validate your document with an SGML parser. 495Use \\[sgml-validate] to validate your document with an SGML parser.
@@ -2066,7 +2066,7 @@ Images in many formats can be inlined with <img src=\"URL\">.
2066If you mainly create your own documents, `sgml-specials' might be 2066If you mainly create your own documents, `sgml-specials' might be
2067interesting. But note that some HTML 2 browsers can't handle `&apos;'. 2067interesting. But note that some HTML 2 browsers can't handle `&apos;'.
2068To work around that, do: 2068To work around that, do:
2069 (eval-after-load \"sgml-mode\" '(aset sgml-char-names ?' nil)) 2069 (eval-after-load \"sgml-mode\" '(aset sgml-char-names ?\\=' nil))
2070 2070
2071\\{html-mode-map}" 2071\\{html-mode-map}"
2072 (setq-local sgml-display-text html-display-text) 2072 (setq-local sgml-display-text html-display-text)
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el
index d08daea0310..37f10a8e871 100644
--- a/lisp/textmodes/texinfmt.el
+++ b/lisp/textmodes/texinfmt.el
@@ -34,7 +34,7 @@
34If optional argument HERE is non-nil, insert info at point." 34If optional argument HERE is non-nil, insert info at point."
35 (interactive "P") 35 (interactive "P")
36 (let ((version-string 36 (let ((version-string
37 (format "Version of `texinfmt.el': %s" texinfmt-version))) 37 (format-message "Version of `texinfmt.el': %s" texinfmt-version)))
38 (if here 38 (if here
39 (insert version-string) 39 (insert version-string)
40 (if (called-interactively-p 'interactive) 40 (if (called-interactively-p 'interactive)
@@ -330,25 +330,24 @@ converted to Info is stored in a temporary buffer."
330 (let ((arg (texinfo-parse-arg-discard))) 330 (let ((arg (texinfo-parse-arg-discard)))
331 (insert " " 331 (insert " "
332 texinfo-region-buffer-name 332 texinfo-region-buffer-name
333 " buffer for: `") 333 (format-message " buffer for: `"))
334 (insert (file-name-nondirectory (expand-file-name arg))) 334 (insert (file-name-nondirectory (expand-file-name arg)))
335 (insert "', -*-Text-*-\n"))) 335 (insert (format-message "', -*-Text-*-\n"))))
336 ;; Else no `@setfilename' line 336 ;; Else no `@setfilename' line
337 (insert " " 337 (insert " "
338 texinfo-region-buffer-name 338 texinfo-region-buffer-name
339 " buffer -*-Text-*-\n")) 339 " buffer -*-Text-*-\n"))
340 (insert "produced by `texinfo-format-region'\n" 340 (insert (format-message "produced by `texinfo-format-region'\n")
341 "from a region in: " 341 "from a region in: "
342 (if (buffer-file-name input-buffer) 342 (if (buffer-file-name input-buffer)
343 (concat "`" 343 (format-message "`%s'"
344 (file-name-sans-versions 344 (file-name-sans-versions
345 (file-name-nondirectory 345 (file-name-nondirectory
346 (buffer-file-name input-buffer))) 346 (buffer-file-name input-buffer))))
347 "'") 347 (format-message "buffer `%s'" (buffer-name input-buffer)))
348 (concat "buffer `" (buffer-name input-buffer) "'")) 348 (format-message "\nusing `texinfmt.el' version ")
349 "\nusing `texinfmt.el' version " 349 texinfmt-version
350 texinfmt-version 350 ".\n\n")
351 ".\n\n")
352 351
353 ;; Now convert for real. 352 ;; Now convert for real.
354 (goto-char (point-min)) 353 (goto-char (point-min))
@@ -479,19 +478,18 @@ if large. You can use `Info-split' to do this manually."
479 ;; Insert info about how this file was made. 478 ;; Insert info about how this file was made.
480 (insert "Info file: " 479 (insert "Info file: "
481 texinfo-format-filename ", -*-Text-*-\n" 480 texinfo-format-filename ", -*-Text-*-\n"
482 "produced by `texinfo-format-buffer'\n" 481 (format-message "produced by `texinfo-format-buffer'\n")
483 ;; Date string removed so that regression testing is easier. 482 ;; Date string removed so that regression testing is easier.
484 ;; "on " 483 ;; "on "
485 ;; (insert (format-time-string "%e %b %Y")) " " 484 ;; (insert (format-time-string "%e %b %Y")) " "
486 "from file" 485 "from file"
487 (if (buffer-file-name input-buffer) 486 (if (buffer-file-name input-buffer)
488 (concat " `" 487 (format-message " `%s'"
489 (file-name-sans-versions 488 (file-name-sans-versions
490 (file-name-nondirectory 489 (file-name-nondirectory
491 (buffer-file-name input-buffer))) 490 (buffer-file-name input-buffer))))
492 "'") 491 (format-message "buffer `%s'" (buffer-name input-buffer)))
493 (concat "buffer `" (buffer-name input-buffer) "'")) 492 (format-message "\nusing `texinfmt.el' version ")
494 "\nusing `texinfmt.el' version "
495 texinfmt-version 493 texinfmt-version
496 ".\n\n") 494 ".\n\n")
497 ;; Return data for indices. 495 ;; Return data for indices.
diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el
index ea6b52561d6..5e318b5569e 100644
--- a/lisp/textmodes/two-column.el
+++ b/lisp/textmodes/two-column.el
@@ -373,9 +373,8 @@ First column's text sSs Second column's text
373\(See \\[describe-mode] .)" 373\(See \\[describe-mode] .)"
374 (interactive "*p") 374 (interactive "*p")
375 (and (2C-other) 375 (and (2C-other)
376 (if (y-or-n-p (concat "Overwrite associated buffer `" 376 (if (y-or-n-p (format-message "Overwrite associated buffer ā€˜%s’? "
377 (buffer-name (2C-other)) 377 (buffer-name (2C-other))))
378 "'? "))
379 (with-current-buffer (2C-other) 378 (with-current-buffer (2C-other)
380 (erase-buffer)) 379 (erase-buffer))
381 (signal 'quit nil))) 380 (signal 'quit nil)))