]> code.delx.au - gnu-emacs/blobdiff - src/doc.c
Merge from origin/emacs-25
[gnu-emacs] / src / doc.c
index 5d0aae795b7f552877dffcee28eb0fbf6cacdf46..c5dd8d5a78600edd74d42970e2d72d277a85cd5e 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -1,14 +1,14 @@
 /* Record indices of function doc strings stored in a file. -*- coding: utf-8 -*-
 
-Copyright (C) 1985-1986, 1993-1995, 1997-2015 Free Software Foundation,
+Copyright (C) 1985-1986, 1993-1995, 1997-2016 Free Software Foundation,
 Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -31,9 +31,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "lisp.h"
 #include "character.h"
+#include "coding.h"
 #include "buffer.h"
 #include "disptab.h"
-#include "keyboard.h"
 #include "keymap.h"
 
 /* Buffer used for reading from documentation file.  */
@@ -138,6 +138,9 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
 #endif
       if (fd < 0)
        {
+         if (errno == EMFILE || errno == ENFILE)
+           report_file_error ("Read error on documentation file", file);
+
          SAFE_FREE ();
          AUTO_STRING (cannot_open, "Cannot open doc string file \"");
          AUTO_STRING (quote_nl, "\"\n");
@@ -724,7 +727,7 @@ as the keymap for future \\=\\[COMMAND] substrings.
 
 Each \\=‘ and \\=` is replaced by left quote, and each \\=’ and \\='
 is replaced by right quote.  Left and right quote characters are
-specified by ‘text-quoting-style’.
+specified by `text-quoting-style'.
 
 \\=\\= quotes the following character and is discarded; thus,
 \\=\\=\\=\\= puts \\=\\= into the output, \\=\\=\\=\\[ puts \\=\\[ into the output, and
@@ -865,16 +868,14 @@ Otherwise, return a new string.  */)
         \<foo> just sets the keymap used for \[cmd].  */
       else if (strp[0] == '\\' && (strp[1] == '{' || strp[1] == '<'))
        {
-         struct buffer *oldbuf;
-         ptrdiff_t start_idx;
+        {
          /* This is for computing the SHADOWS arg for describe_map_tree.  */
          Lisp_Object active_maps = Fcurrent_active_maps (Qnil, Qnil);
-         Lisp_Object earlier_maps;
          ptrdiff_t count = SPECPDL_INDEX ();
 
          strp += 2;            /* skip \{ or \< */
          start = strp;
-         start_idx = start - SDATA (string);
+         ptrdiff_t start_idx = start - SDATA (string);
 
          while ((strp - SDATA (string) < SBYTES (string))
                 && *strp != '}' && *strp != '>')
@@ -904,7 +905,7 @@ Otherwise, return a new string.  */)
            }
 
          /* Now switch to a temp buffer.  */
-         oldbuf = current_buffer;
+         struct buffer *oldbuf = current_buffer;
          set_buffer_internal (XBUFFER (Vprin1_to_string_buffer));
          /* This is for an unusual case where some after-change
             function uses 'format' or 'prin1' or something else that
@@ -929,7 +930,8 @@ Otherwise, return a new string.  */)
            {
              /* Get the list of active keymaps that precede this one.
                 If this one's not active, get nil.  */
-             earlier_maps = Fcdr (Fmemq (tem, Freverse (active_maps)));
+             Lisp_Object earlier_maps
+               = Fcdr (Fmemq (tem, Freverse (active_maps)));
              describe_map_tree (tem, 1, Fnreverse (earlier_maps),
                                 Qnil, 0, 1, 0, 0, 1);
            }
@@ -937,6 +939,7 @@ Otherwise, return a new string.  */)
          Ferase_buffer ();
          set_buffer_internal (oldbuf);
          unbind_to (count, Qnil);
+        }
 
        subst_string:
          start = SDATA (tem);
@@ -1023,16 +1026,17 @@ syms_of_doc (void)
   Vbuild_files = Qnil;
 
   DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style,
-               doc: /* Style to use for single quotes when generating text.
-‘curve’ means quote with curved single quotes \\=‘like this\\=’.
-‘straight’ means quote with straight apostrophes \\='like this\\='.
-‘grave’ means quote with grave accent and apostrophe \\=`like this\\='.
-The default value nil acts like ‘curve’ if curved single quotes are
-displayable, and like ‘grave’ otherwise.  */);
+               doc: /* Style to use for single quotes in help and messages.
+Its value should be a symbol.
+`curve' means quote with curved single quotes \\=‘like this\\=’.
+`straight' means quote with straight apostrophes \\='like this\\='.
+`grave' means quote with grave accent and apostrophe \\=`like this\\='.
+The default value nil acts like `curve' if curved single quotes are
+displayable, and like `grave' otherwise.  */);
   Vtext_quoting_style = Qnil;
 
   DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag,
-              doc: /* If nil, a nil ‘text-quoting-style’ is treated as ‘grave’.  */);
+              doc: /* If nil, a nil `text-quoting-style' is treated as `grave'.  */);
   /* Initialized by ‘main’.  */
 
   defsubr (&Sdocumentation);