]> code.delx.au - gnu-emacs/commitdiff
Fix a few problems with directed quotes
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 2 Oct 2015 04:42:53 +0000 (21:42 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 2 Oct 2015 04:44:35 +0000 (21:44 -0700)
This is in response to a problem report by Kaushal Modi in:
http://bugs.gnu.org/21588#25
* lisp/cedet/mode-local.el (describe-mode-local-overload):
* lisp/emacs-lisp/bytecomp.el (byte-compile-fix-header):
* lisp/info-xref.el (info-xref-check-all-custom):
* lisp/mail/emacsbug.el (report-emacs-bug-hook):
Prefer directed to undirected single quotes in diagnostics.

doc/emacs/text.texi
doc/lispref/control.texi
doc/lispref/display.texi
lisp/cedet/mode-local.el
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/elint.el
lisp/info-xref.el
lisp/mail/emacsbug.el
lisp/mh-e/mh-e.el
lisp/net/newst-treeview.el

index 7f3afd71d5b470fc92fed49187ddd23c87cb2e46..bab660e1e10be3efe7025a9fa834fc026a035fbe 100644 (file)
@@ -417,8 +417,8 @@ beginning of a line.
 using straight apostrophes @t{'like this'} or double-quotes @t{"like
 this"}.  Another common way is the curved quote convention, which uses
 left and right single or double quotation marks @t{‘like this’} or
-@t{“like this”}.  Typewriter quotes are simple and portable; curved
-quotes are less ambiguous and typically look nicer.
+@t{“like this”}.  In text files, typewriter quotes are simple and
+portable; curved quotes are less ambiguous and typically look nicer.
 
   Electric Quote mode makes it easier to type curved quotes.  As you
 type characters it optionally converts @t{`} to @t{‘}, @t{'} to @t{’},
index fca16da5d3f81ccff3fb15fba10936ebf0275def..412903f8fbc64ea030c2c0eac7c62ea71a4adaae 100644 (file)
@@ -1,4 +1,4 @@
-@c -*-texinfo-*-
+@c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
 @c Copyright (C) 1990-1995, 1998-1999, 2001-2015 Free Software
 @c Foundation, Inc.
@@ -1002,8 +1002,8 @@ These examples show typical uses of @code{error}:
 @end group
 
 @group
-(error "You have committed %d errors" 10)
-     @error{} You have committed 10 errors
+(error "Invalid name `%s'" "A%%B")
+     @error{} Invalid name ‘A%%B’
 @end group
 @end example
 
@@ -1011,10 +1011,16 @@ These examples show typical uses of @code{error}:
 error symbol @code{error}, and a list containing the string returned by
 @code{format-message}.
 
+In a format string containing single quotes, curved quotes @t{‘like
+this’} and grave quotes @t{`like this'} work better than straight
+quotes @t{'like this'}, as @code{error} typically formats every
+straight quote as a curved closing quote.
+
 @strong{Warning:} If you want to use your own string as an error message
 verbatim, don't just write @code{(error @var{string})}.  If @var{string}
-contains @samp{%}, it will be interpreted as a format specifier, with
-undesirable results.  Instead, use @code{(error "%s" @var{string})}.
+@var{string} contains @samp{%}, @samp{`}, or @samp{'} it may be
+reformatted, with undesirable results.  Instead, use @code{(error "%s"
+@var{string})}.
 @end defun
 
 @defun signal error-symbol data
index 452462adcfc38e4e71abf8cc526ae27eb39587ee..ad248b116edeb8c32abe8b71c3eba124cb4c6da4 100644 (file)
@@ -1,4 +1,4 @@
-@c -*-texinfo-*-
+@c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
 @c Copyright (C) 1990-1995, 1998-2015 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
@@ -254,6 +254,11 @@ properties, it is displayed with the specified faces (@pxref{Faces}).
 The string is also added to the @file{*Messages*} buffer, but without
 text properties (@pxref{Logging Messages}).
 
+In a format string containing single quotes, curved quotes @t{‘like
+this’} and grave quotes @t{`like this'} work better than straight
+quotes @t{'like this'}, as @code{message} typically formats every
+straight quote as a curved closing quote.
+
 In batch mode, the message is printed to the standard error stream,
 followed by a newline.
 
@@ -268,21 +273,26 @@ onto the screen immediately.
 
 @example
 @group
-(message "Minibuffer depth is %d."
-         (minibuffer-depth))
- @print{} Minibuffer depth is 0.
-@result{} "Minibuffer depth is 0."
+(message "Reverting `%s'..." (buffer-name))
+ @print{} Reverting ‘subr.el’...
+@result{} "Reverting ‘subr.el’..."
 @end group
 
 @group
 ---------- Echo Area ----------
-Minibuffer depth is 0.
+Reverting ‘subr.el’...
 ---------- Echo Area ----------
 @end group
 @end example
 
 To automatically display a message in the echo area or in a pop-buffer,
 depending on its size, use @code{display-message-or-buffer} (see below).
+
+@strong{Warning:} If you want to use your own string as a message
+verbatim, don't just write @code{(message @var{string})}.  If
+@var{string} contains @samp{%}, @samp{`}, or @samp{'} it may be
+reformatted, with undesirable results.  Instead, use @code{(message
+"%s" @var{string})}.
 @end defun
 
 @defvar inhibit-message
index 8736a4ff93c799ec83fb3f28c09248aced6a9047..b5995ffa3972fbd187ef88fc0bbd1830744002de 100644 (file)
@@ -644,9 +644,9 @@ SYMBOL is a function that can be overridden."
       (insert (overload-docstring-extension symbol) "\n\n")
       (insert (format-message "default function: `%s'\n" default))
       (if override
-         (insert (format-message "\noverride in buffer '%s': `%s'\n"
+         (insert (format-message "\noverride in buffer `%s': `%s'\n"
                                  describe-function-orig-buffer override))
-       (insert (format-message "\nno override in buffer '%s'\n"
+       (insert (format-message "\nno override in buffer `%s'\n"
                                describe-function-orig-buffer)))
 
       (mapatoms
index 8699af60ea841a1ccbcad2a6277f23377d8a046d..6f7ba3353f697814b59df34f9c1b75744c3f6d5d 100644 (file)
@@ -2015,7 +2015,7 @@ and will be removed soon.  See (elisp)Backquote in the manual."))
        (format "     (string-lessp emacs-version \"%s\")\n" minimum-version)
        ;; Because the header must fit in a fixed width, we cannot
        ;; insert arbitrary-length file names (Bug#11585).
-       "     (error \"'%s' was compiled for "
+       "     (error \"`%s' was compiled for "
        (format "Emacs %s or later\" #$))\n\n" minimum-version))
       ;; Now compensate for any change in size, to make sure all
       ;; positions in the file remain valid.
index 86ac33c2600c0e261fcd5db942830dbb99e90594..64d65c059027422cc1dad471bd0ca66b715666f5 100644 (file)
@@ -520,7 +520,7 @@ Return nil if there are no more forms, t otherwise."
              ;;;       (with-syntax-table emacs-lisp-mode-syntax-table
              ;;;         (elint-update-env))
              ;;;       (setq env (elint-env-add-env env elint-buffer-env))))
-             ;;(message "Elint processed (require '%s)" name))
+             ;;(message "%s" (format "Elint processed (require '%s)" name))
          (error "%s.el not found in load-path" libname)))
     (error
      (message "Can't get variables from require'd library %s: %s"
index 2b81efa178ea73650bb88b13046ef4aa05aadedb..fcdf5323db7f38f78a6bc28cda027781e1002b07 100644 (file)
@@ -454,7 +454,7 @@ and can take a long time."
         (cond ((symbolp load)
                (condition-case cause (require load)
                  (error
-                  (info-xref-output "Symbol `%s': cannot require '%s: %s"
+                  (info-xref-output "Symbol `%s': cannot require `%s': %s"
                                     symbol load cause))))
               ;; skip if previously loaded
               ((assoc load load-history))
index f54893fb4bef55a901ed33f3dce5a1fff3169a58..8e28973c43fe958bb978c1493a5d562e3ba8055b 100644 (file)
@@ -417,7 +417,8 @@ and send the mail again%s."
                                         (regexp-quote (system-name)))
                                 from))
               (not (yes-or-no-p
-                    (format "Is '%s' really your email address? " from)))
+                    (format-message "Is `%s' really your email address? "
+                                     from)))
               (error "Please edit the From address and try again"))))))
 
 
index 96fe7d797c2720b2008c45a5af8a60ba60f921b5..c757920ef29ac9b9b6f4f5679c528bb2dfa1fcfa 100644 (file)
@@ -2901,11 +2901,11 @@ This option contains the Unix command line which performs the
 actual printing for the \\[mh-print-msg] command. The string can
 contain one escape, \"%s\", which is replaced by the name of the
 folder and the message number and is useful for print job names.
-I use \"mpage -h'%s' -b Letter -H1of -mlrtb -P\" which produces a
+I use \"mpage -h\\='%s\\=' -b Letter -H1of -mlrtb -P\" which produces a
 nice header and adds a bit of margin so the text fits within my
 printer's margins.
 
-This options is not used by the commands \\[mh-ps-print-msg] or
+This option is not used by the commands \\[mh-ps-print-msg] or
 \\[mh-ps-print-msg-file]."
   :type 'string
   :group 'mh-show
index 4eef58092333b5a795460e30eab23472c694008c..0c2df8897d7344d71a011fbc621170989fca669f 100644 (file)
@@ -940,7 +940,7 @@ Optional arguments CHANGED-WIDGET and EVENT are ignored."
   "Return propertized copy of string TAG.
 Optional argument NUM-NEW is used for choosing face, other
 arguments NT-ID, FEED, and VFEED are added as properties."
-  ;;(message "newsticker--treeview-propertize-tag '%s' %s" feed nt-id)
+  ;;(message "newsticker--treeview-propertize-tag `%s' %s" feed nt-id)
   (let ((face 'newsticker-treeview-face)
         (map (make-sparse-keymap)))
     (if (and num-new (> num-new 0))