From: Paul Eggert Date: Mon, 31 Aug 2015 05:05:43 +0000 (-0700) Subject: Quoting fixes in lisp/progmodes X-Git-Tag: emacs-25.0.90~1230^2~26 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/4c24b9e30fd47b537ad08dcf298b5b1a39f20e50 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. --- diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 1223db3b33..f26b8ec6dd 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 235ef21d06..0e904d23c5 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 19d0473c42..005e71a825 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 685bb21b43..3cf17f48b5 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 7c785d4ac2..2443d6f8ca 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 23f9370767..611ba84e25 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 50e4da93c7..b057fa6847 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 d7594428e8..18299c7f11 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 89e0b10522..70a2b1ab5a 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 107dee5803..76d85c68c9 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 1b270e66dd..47b15d886b 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)