[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 4c24b9e 1/5: Quoting fixes in lisp/progmodes
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 4c24b9e 1/5: Quoting fixes in lisp/progmodes |
Date: |
Mon, 31 Aug 2015 06:12:37 +0000 |
branch: master
commit 4c24b9e30fd47b537ad08dcf298b5b1a39f20e50
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Quoting fixes in lisp/progmodes
* lisp/progmodes/cc-engine.el (c-bos-report-error):
* lisp/progmodes/cpp.el (cpp-edit-reset):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional)
(etags-tags-apropos, list-tags, tags-apropos):
* lisp/progmodes/executable.el (executable-set-magic):
* lisp/progmodes/octave.el (octave-sync-function-file-names)
(octave-help, octave-find-definition-default-filename)
(octave-find-definition):
Respect text quoting style in doc strings and diagnostics.
* lisp/progmodes/cc-langs.el (c-populate-syntax-table):
* lisp/progmodes/verilog-mode.el (verilog-auto-reset-widths):
* lisp/progmodes/vhdl-mode.el (vhdl-electric-quote):
Escape apostrophes in doc strings.
* lisp/progmodes/cmacexp.el (c-macro-expansion):
Use straight quoting in ASCII comment.
* lisp/progmodes/idlwave.el (idlwave-auto-fill-split-string)
(idlwave-pad-keyword):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate)
(vhdl-electric-open-bracket, vhdl-electric-close-bracket):
(vhdl-electric-semicolon, vhdl-electric-comma)
(vhdl-electric-period, vhdl-electric-equal):
Use directed quotes in diagnostics and doc strings.
---
lisp/progmodes/cc-engine.el | 11 ++++++-----
lisp/progmodes/cc-langs.el | 2 +-
lisp/progmodes/cmacexp.el | 5 +++--
lisp/progmodes/cpp.el | 5 +++--
lisp/progmodes/ebrowse.el | 2 +-
lisp/progmodes/etags.el | 19 ++++++++++---------
lisp/progmodes/executable.el | 5 +++--
lisp/progmodes/idlwave.el | 6 +++---
lisp/progmodes/octave.el | 12 ++++++------
lisp/progmodes/verilog-mode.el | 2 +-
lisp/progmodes/vhdl-mode.el | 16 ++++++++--------
11 files changed, 45 insertions(+), 40 deletions(-)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 1223db3..f26b8ec 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -618,11 +618,12 @@ comment at the start of cc-engine.el for more info."
(defmacro c-bos-report-error ()
'(unless noerror
(setq c-parsing-error
- (format "No matching `%s' found for `%s' on line %d"
- (elt saved-pos 1)
- (elt saved-pos 2)
- (1+ (count-lines (point-min)
- (c-point 'bol (elt saved-pos 0))))))))
+ (format-message
+ "No matching `%s' found for `%s' on line %d"
+ (elt saved-pos 1)
+ (elt saved-pos 2)
+ (1+ (count-lines (point-min)
+ (c-point 'bol (elt saved-pos 0))))))))
(defun c-beginning-of-statement-1 (&optional lim ignore-labels
noerror comma-delim)
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 235ef21..0e904d2 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -327,7 +327,7 @@ the evaluated constant value at compile time."
(defun c-populate-syntax-table (table)
"Populate the given syntax table as necessary for a C-like language.
-This includes setting ' and \" as string delimiters, and setting up
+This includes setting \\=' and \" as string delimiters, and setting up
the comment syntax to handle both line style \"//\" and block style
\"/*\" \"*/\" comments."
diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el
index 19d0473..005e71a 100644
--- a/lisp/progmodes/cmacexp.el
+++ b/lisp/progmodes/cmacexp.el
@@ -389,8 +389,9 @@ Optional arg DISPLAY non-nil means show messages in the
echo area."
;; Put the messages inside a comment, so they won't get in
;; the way of font-lock, highlighting etc.
(insert
- (format "/* Preprocessor terminated with status %s\n\n
Messages from `%s\':\n\n"
- exit-status cppcommand))
+ (format
+ "/* Preprocessor terminated with status %s\n\n Messages
from '%s\':\n\n"
+ exit-status cppcommand))
(goto-char (+ (point)
(nth 1 (insert-file-contents tempname))))
(insert "\n\n*/\n")))
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el
index 685bb21..3cf17f4 100644
--- a/lisp/progmodes/cpp.el
+++ b/lisp/progmodes/cpp.el
@@ -494,9 +494,10 @@ You can also use the keyboard accelerators indicated like
this: [K]ey."
(set-buffer buffer)
(setq cpp-edit-symbols symbols)
(erase-buffer)
- (insert "CPP Display Information for `")
+ (insert (substitute-command-keys "CPP Display Information for `"))
(cpp-make-button (buffer-name cpp-edit-buffer) 'cpp-edit-home)
- (insert "'\n\nClick mouse-2 on item you want to change or use\n"
+ (insert (substitute-command-keys
+ "'\n\nClick mouse-2 on item you want to change or use\n")
"or switch to this buffer and type the keyboard equivalents.\n"
"Keyboard equivalents are indicated with brackets like [T]his.\n\n")
(cpp-make-button "[H]ome (display the C file)" 'cpp-edit-home)
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index 7c785d4..2443d6f 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -3471,7 +3471,7 @@ are not performed."
(with-output-to-temp-buffer (concat "*Apropos Members*")
(set-buffer standard-output)
(erase-buffer)
- (insert "Members matching `" regexp "'\n\n")
+ (insert (format-message "Members matching ‘%s’\n\n" regexp))
(cl-loop for s in (ebrowse-list-of-matching-members members regexp) do
(cl-loop for info in (gethash s members) do
(ebrowse-draw-file-member-info info))))))
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 23f9370..611ba84 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1459,7 +1459,7 @@ hits the start of file."
(when (symbolp symbs)
(if (boundp symbs)
(setq symbs (symbol-value symbs))
- (insert "symbol `" (symbol-name symbs) "' has no value\n")
+ (insert (format-message "symbol ‘%s’ has no value\n" symbs))
(setq symbs nil)))
(if (vectorp symbs)
(mapatoms ins-symb symbs)
@@ -1469,13 +1469,13 @@ hits the start of file."
(defun etags-tags-apropos (string) ; Doc string?
(when tags-apropos-verbose
- (princ "Tags in file `")
+ (princ (substitute-command-keys "Tags in file `"))
(tags-with-face 'highlight (princ buffer-file-name))
- (princ "':\n\n"))
+ (princ (substitute-command-keys "':\n\n")))
(goto-char (point-min))
(let ((progress-reporter (make-progress-reporter
- (format "Making tags apropos buffer for `%s'..."
- string)
+ (format-message
+ "Making tags apropos buffer for `%s'..." string)
(point-min) (point-max))))
(while (re-search-forward string nil t)
(progress-reporter-update progress-reporter (point))
@@ -1920,9 +1920,9 @@ directory specification."
'tags-complete-tags-table-file
nil t nil)))
(with-output-to-temp-buffer "*Tags List*"
- (princ "Tags in file `")
+ (princ (substitute-command-keys "Tags in file `"))
(tags-with-face 'highlight (princ file))
- (princ "':\n\n")
+ (princ (substitute-command-keys "':\n\n"))
(save-excursion
(let ((first-time t)
(gotany nil))
@@ -1944,9 +1944,10 @@ directory specification."
(declare (obsolete xref-find-apropos "25.1"))
(interactive "sTags apropos (regexp): ")
(with-output-to-temp-buffer "*Tags List*"
- (princ "Click mouse-2 to follow tags.\n\nTags matching regexp `")
+ (princ (substitute-command-keys
+ "Click mouse-2 to follow tags.\n\nTags matching regexp `"))
(tags-with-face 'highlight (princ regexp))
- (princ "':\n\n")
+ (princ (substitute-command-keys "':\n\n"))
(save-excursion
(let ((first-time t))
(while (visit-tags-table-buffer (not first-time))
diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el
index 50e4da9..b057fa6 100644
--- a/lisp/progmodes/executable.el
+++ b/lisp/progmodes/executable.el
@@ -240,8 +240,9 @@ executable."
(save-window-excursion
;; Make buffer visible before question.
(switch-to-buffer (current-buffer))
- (y-or-n-p (concat "Replace magic number by `"
- executable-prefix argument "'?
"))))
+ (y-or-n-p (format-message
+ "Replace magic number by `%s%s'? "
+ executable-prefix argument))))
(progn
(replace-match argument t t nil 1)
(message "Magic number changed to `%s'"
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index d759442..18299c7 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -293,7 +293,7 @@ extends to the end of the match for the regular expression."
(defcustom idlwave-auto-fill-split-string t
"If non-nil then auto fill will split strings with the IDL `+' operator.
When the line end falls within a string, string concatenation with the
-'+' operator will be used to distribute a long string over lines.
+`+' operator will be used to distribute a long string over lines.
If nil and a string is split then a terminal beep and warning are issued.
This variable is ignored when `idlwave-fill-comment-line-only' is
@@ -768,8 +768,8 @@ Also see help for `idlwave-surround'."
:type 'boolean)
(defcustom idlwave-pad-keyword t
- "Non-nil means pad '=' in keywords (routine calls or defs) like assignment.
-Whenever `idlwave-surround' is non-nil then this affects how '=' is
+ "Non-nil means pad `=' in keywords (routine calls or defs) like assignment.
+Whenever `idlwave-surround' is non-nil then this affects how `=' is
padded for keywords and for variables. If t, pad the same as for
assignments. If nil then spaces are removed. With any other value,
spaces are left unchanged."
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 89e0b10..70a2b1a 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -1122,7 +1122,7 @@ See Info node `(octave)Function Files'."
(let* ((func (buffer-substring name-start name-end))
(file (file-name-sans-extension
(file-name-nondirectory buffer-file-name)))
- (help-form (format "\
+ (help-form (format-message "\
a: Use function name `%s'
b: Use file name `%s'
q: Don't fix\n" func file))
@@ -1728,12 +1728,12 @@ code line."
(dir (file-name-directory
(directory-file-name (file-name-directory file)))))
(replace-match "" nil nil nil 1)
- (insert "`")
+ (insert (substitute-command-keys "`"))
;; Include the parent directory which may be regarded as
;; the category for the FN.
(help-insert-xref-button (file-relative-name file dir)
'octave-help-file fn)
- (insert "'")))
+ (insert (substitute-command-keys "'"))))
;; Make 'See also' clickable.
(with-syntax-table octave-mode-syntax-table
(when (re-search-forward "^\\s-*See also:" nil t)
@@ -1816,8 +1816,8 @@ If the environment variable OCTAVE_SRCDIR is set, it is
searched first."
(error "File `%s' not found" name))
file))
(`"mex"
- (if (yes-or-no-p (format "File `%s' may be binary; open? "
- (file-name-nondirectory name)))
+ (if (yes-or-no-p (format-message "File `%s' may be binary; open? "
+ (file-name-nondirectory name)))
name
(user-error "Aborted")))
(_ name)))
@@ -1847,7 +1847,7 @@ if iskeyword('%s') disp('`%s'' is a keyword') else
which('%s') endif\n"
(when (string-match "from the file \\(.*\\)$" line)
(setq file (match-string 1 line))))
(if (not file)
- (user-error "%s" (or line (format "`%s' not found" fn)))
+ (user-error "%s" (or line (format-message "`%s' not found" fn)))
(ring-insert find-tag-marker-ring (point-marker))
(setq file (funcall octave-find-definition-filename-function file))
(when file
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 107dee5..76d85c6 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -1054,7 +1054,7 @@ the MSB or LSB of a signal inside an AUTORESET.
If nil, AUTORESET uses \"0\" as the constant.
-If `unbased', AUTORESET used the unbased unsized literal \"'0\"
+If `unbased', AUTORESET used the unbased unsized literal \"\\='0\"
as the constant. This setting is strongly recommended for
SystemVerilog designs."
:type 'boolean
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 1b270e6..47b15d8 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -164,7 +164,7 @@
'/' or is empty)."
(let ((val (widget-value widget)))
(unless (string-match "^\\(\\|.*/\\)$" val)
- (widget-put widget :error "Invalid directory entry: must end with '/'")
+ (widget-put widget :error "Invalid directory entry: must end with ‘/’")
widget)))
;; help string for user options
@@ -8743,7 +8743,7 @@ is omitted or nil."
(vhdl-comment-insert)))))
(self-insert-command count)))
-(defun vhdl-electric-open-bracket (count) "'[' --> '(', '([' --> '['"
+(defun vhdl-electric-open-bracket (count) "‘[’ --> ‘(’, ‘([’ --> ‘[’"
(interactive "p")
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(if (= (preceding-char) ?\()
@@ -8751,7 +8751,7 @@ is omitted or nil."
(insert-char ?\( 1))
(self-insert-command count)))
-(defun vhdl-electric-close-bracket (count) "']' --> ')', ')]' --> ']'"
+(defun vhdl-electric-close-bracket (count) "‘]’ --> ‘)’, ‘)]’ --> ‘]’"
(interactive "p")
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(progn
@@ -8761,7 +8761,7 @@ is omitted or nil."
(blink-matching-open))
(self-insert-command count)))
-(defun vhdl-electric-quote (count) "'' --> \""
+(defun vhdl-electric-quote (count) "\\='\\=' --> \""
(interactive "p")
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(if (= (preceding-char) vhdl-last-input-event)
@@ -8769,7 +8769,7 @@ is omitted or nil."
(insert-char ?\' 1))
(self-insert-command count)))
-(defun vhdl-electric-semicolon (count) "';;' --> ' : ', ': ;' --> ' := '"
+(defun vhdl-electric-semicolon (count) "‘;;’ --> ‘ : ’, ‘: ;’ --> ‘ := ’"
(interactive "p")
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)
@@ -8783,7 +8783,7 @@ is omitted or nil."
(t (insert-char ?\; 1)))
(self-insert-command count)))
-(defun vhdl-electric-comma (count) "',,' --> ' <= '"
+(defun vhdl-electric-comma (count) "‘,,’ --> ‘ <= ’"
(interactive "p")
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)
@@ -8793,7 +8793,7 @@ is omitted or nil."
(t (insert-char ?\, 1)))
(self-insert-command count)))
-(defun vhdl-electric-period (count) "'..' --> ' => '"
+(defun vhdl-electric-period (count) "‘..’ --> ‘ => ’"
(interactive "p")
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)
@@ -8803,7 +8803,7 @@ is omitted or nil."
(t (insert-char ?\. 1)))
(self-insert-command count)))
-(defun vhdl-electric-equal (count) "'==' --> ' == '"
+(defun vhdl-electric-equal (count) "‘==’ --> ‘ == ’"
(interactive "p")
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)