]> code.delx.au - gnu-emacs/commitdiff
Merge from origin/emacs-25
authorJohn Wiegley <johnw@newartisans.com>
Tue, 12 Jan 2016 06:48:07 +0000 (22:48 -0800)
committerJohn Wiegley <johnw@newartisans.com>
Tue, 12 Jan 2016 06:48:07 +0000 (22:48 -0800)
6ee327d Add handle_user_signal_hook
47580e0 Avoid writing to purespace
0588be7 Remove unused variable
89e7483 * configure.ac: Find libxml2 headers in Xcode SDK dir on Darwin.
3b95e9c Use posix_openpt instead of openpty on Darwin
86312ff Document support for ':documentation' in Lisp mode
c930e75b Document new features of TeX mode
7c83d84 Clarify docs of hscroll in RTL text
4c8f8db Fix rendering of HTML pages that use character composition
a8d37ca Avoid some compiler warnings in w32.c
ce106f3de Undo ill-advised change
be0bba4 Unbreak completion in python-mode buffers

16 files changed:
configure.ac
doc/emacs/programs.texi
doc/emacs/text.texi
doc/lispref/windows.texi
etc/NEWS
lisp/emacs-lisp/lisp-mode.el
lisp/international/mule-cmds.el
lisp/progmodes/python.el
lisp/progmodes/xref.el
src/alloc.c
src/character.h
src/indent.c
src/keyboard.c
src/keyboard.h
src/lisp.h
src/w32.c

index 0aa863afe344da63599b1e61fee1cf430002eb4f..62bf9cff84a9cede53b8c340ba8376e0faceacd4 100644 (file)
@@ -3638,6 +3638,14 @@ if test "${with_xml2}" != "no"; then
   # Built-in libxml2 on OS X 10.8 lacks libxml-2.0.pc.
   if test "${HAVE_LIBXML2}" != "yes" && test "$opsys" = "darwin"; then
     SAVE_CPPFLAGS="$CPPFLAGS"
+    if test -z "$xcsdkdir" -a -n "$XCRUN" -a ! -d /usr/include; then
+      dnl /usr/include is not found.  Try Xcode SDK dir if it is sane.
+      xcsdkdir=`$XCRUN --show-sdk-path 2>/dev/null`
+      case $xcsdkdir in
+       *[[\\\"\#\$\&\'\`$am_lf\ \      ]]*)
+       xcsdkdir="" ;;
+      esac
+    fi
     CPPFLAGS="$CPPFLAGS -I$xcsdkdir/usr/include/libxml2"
     AC_CHECK_HEADER(libxml/HTMLparser.h,
       [AC_CHECK_DECL(HTML_PARSE_RECOVER, HAVE_LIBXML2=yes, ,
@@ -4433,24 +4441,11 @@ case $opsys in
     AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
     ;;
 
-  dnl FIXME?  Maybe use same as freebsd - see bug#12040.
-  darwin )
-    AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)])
-    dnl Not used, because PTY_ITERATION is defined.
-    AC_DEFINE(FIRST_PTY_LETTER, ['p'])
-    dnl Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8.
-    dnl But we don't have to block SIGCHLD because it is blocked in the
-    dnl implementation of grantpt.
-    AC_DEFINE(PTY_OPEN, [ do { int slave; if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1) fd = -1; else emacs_close (slave); } while (false)])
-    AC_DEFINE(PTY_NAME_SPRINTF, [])
-    AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
-    ;;
-
   gnu | openbsd )
     AC_DEFINE(FIRST_PTY_LETTER, ['p'])
     ;;
 
-  gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd | nacl )
+  gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd | darwin | nacl )
     dnl if HAVE_GRANTPT
     if test "x$ac_cv_func_grantpt" = xyes; then
       AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.])
index 8423b70203c02b3302aaf70865a830eefb18ab40..83695b12134d2832725b51119fe7f9363855508c 100644 (file)
@@ -1530,14 +1530,16 @@ with the Foldout package (@pxref{Foldout}).
   Prettify Symbols mode is a buffer-local minor mode that replaces
 certain strings with more attractive versions for display purposes.
 For example, in Emacs Lisp mode, it replaces the string @samp{lambda}
-with the Greek lambda character @samp{λ}.  You may wish to use this in
-non-programming modes as well.  You can customize the mode by adding
-more entries to @code{prettify-symbols-alist}.  More elaborate
-customization is available via customizing
-@code{prettify-symbols-compose-predicate} if its default value
-@code{prettify-symbols-default-compose-p} is not appropriate.  There
-is also a global version, @code{global-prettify-symbols-mode}, which
-enables the mode in all buffers that support it.
+with the Greek lambda character @samp{λ}.  In a @TeX{} buffer, it will
+replace @samp{\alpha} @dots{} @samp{\omega} and other math macros with
+their Unicode characters.  You may wish to use this in non-programming
+modes as well.  You can customize the mode by adding more entries to
+@code{prettify-symbols-alist}.  More elaborate customization is
+available via customizing @code{prettify-symbols-compose-predicate} if
+its default value @code{prettify-symbols-default-compose-p} is not
+appropriate.  There is also a global version,
+@code{global-prettify-symbols-mode}, which enables the mode in all
+buffers that support it.
 
   The symbol at point can be shown in its original form.  This is
 controlled by the variable @code{prettify-symbols-unprettify-at-point}:
index bab660e1e10be3efe7025a9fa834fc026a035fbe..3e8e0ace5871d9c6c93957cfdf30ef4eb7e1cac9 100644 (file)
@@ -1717,6 +1717,7 @@ such as @code{"/tmp"}.
 @vindex latex-run-command
 @vindex tex-dvi-view-command
 @vindex tex-dvi-print-command
+@vindex tex-print-file-extension
   The buffer's @TeX{} variant determines what shell command @kbd{C-c
 C-b} actually runs.  In Plain @TeX{} mode, it is specified by the
 variable @code{tex-run-command}, which defaults to @code{"tex"}.  In
@@ -1725,7 +1726,12 @@ defaults to @code{"latex"}.  The shell command that @kbd{C-c C-v} runs
 to view the @file{.dvi} output is determined by the variable
 @code{tex-dvi-view-command}, regardless of the @TeX{} variant.  The
 shell command that @kbd{C-c C-p} runs to print the output is
-determined by the variable @code{tex-dvi-print-command}.
+determined by the variable @code{tex-dvi-print-command}.  The variable
+@code{tex-print-file-extension} can be set to the required file
+extension for viewing and printing @TeX{}-compiled files.  For
+example, you can set it to @file{.pdf}, and update
+@code{tex-dvi-view-command} and @code{tex-dvi-print-command}
+accordingly.
 
   Normally, Emacs automatically appends the output file name to the
 shell command strings described in the preceding paragraph.  For
index e45201b0570db55785337b36d110d5cdec3a97ab..778e38bf251246a8ac224cf9c937fe88258e4257 100644 (file)
@@ -3706,6 +3706,11 @@ The return value is the total amount of leftward horizontal scrolling in
 effect after the change---just like the value returned by
 @code{window-hscroll} (below).
 
+Note that text in paragraphs whose base direction is right-to-left
+(@pxref{Bidirectional Display}) moves in the opposite direction: e.g.,
+it moves to the right when @code{scroll-left} is invoked with a
+positive value of @var{count}.
+
 Once you scroll a window as far right as it can go, back to its normal
 position where the total leftward scrolling is zero, attempts to scroll
 any farther right have no effect.
@@ -3727,8 +3732,9 @@ of scrolling, this works just like @code{scroll-left}.
 @defun window-hscroll &optional window
 This function returns the total leftward horizontal scrolling of
 @var{window}---the number of columns by which the text in @var{window}
-is scrolled left past the left margin.  The default for
-@var{window} is the selected window.
+is scrolled left past the left margin.  (In right-to-left paragraphs,
+the value is the total amount of the rightward scrolling instead.)
+The default for @var{window} is the selected window.
 
 The return value is never negative.  It is zero when no horizontal
 scrolling has been done in @var{window} (which is usually the case).
@@ -3753,9 +3759,10 @@ scrolling has been done in @var{window} (which is usually the case).
 @defun set-window-hscroll window columns
 This function sets horizontal scrolling of @var{window}.  The value of
 @var{columns} specifies the amount of scrolling, in terms of columns
-from the left margin.  The argument @var{columns} should be zero or
-positive; if not, it is taken as zero.  Fractional values of
-@var{columns} are not supported at present.
+from the left margin (right margin in right-to-left paragraphs).  The
+argument @var{columns} should be zero or positive; if not, it is taken
+as zero.  Fractional values of @var{columns} are not supported at
+present.
 
 Note that @code{set-window-hscroll} may appear not to work if you test
 it by evaluating a call with @kbd{M-:} in a simple way.  What happens
index 8907f7ad453d5e680402515890cedba2a687a8cd..39fb3e19b5bf344390af5434ac7856e0a6c5eea9 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -706,7 +706,12 @@ respectively, `show-paren-when-point-inside-paren' or
 `show-paren-when-point-in-periphery'.
 
 ** Lisp mode
+
+---
 *** Strings after `:documentation' are highlighted as docstrings.
+This enhances Lisp mode fontification to handle documentation of the
+form `(:documentation "the doc string")' used in Common Lisp code for
+CLOS class and slot documentation.
 
 ** Rectangle editing
 
@@ -953,9 +958,11 @@ name patterns (e.g. all "FOR_DOXYGEN_ONLY_*") to be excluded.
 
 ** TeX mode
 
++++
 *** New custom variable `tex-print-file-extension' to help users who
 use PDF instead of DVI.
 
++++
 *** TeX mode now supports Prettify Symbols mode.  When enabling
 `prettify-symbols-mode' in a tex-mode buffer, \alpha ... \omega, and
 many other math macros are displayed using unicode characters.
index 3448b72c3f1d3cbc728b69ec2bb5f89e5b662a82..e99f8a55ab18a063811ef885fc0ea5e747a83a90 100644 (file)
@@ -488,6 +488,9 @@ This will generate compile-time constants from BINDINGS."
   "Default expressions to highlight in Lisp modes.")
 
 (defun lisp-string-in-doc-position-p (listbeg startpos)
+   "Return true if a doc string may occur at STARTPOS inside a list.
+LISTBEG is the position of the start of the innermost list
+containing STARTPOS."
   (let* ((firstsym (and listbeg
                         (save-excursion
                           (goto-char listbeg)
@@ -518,6 +521,9 @@ This will generate compile-time constants from BINDINGS."
                 (= (point) startpos))))))
 
 (defun lisp-string-after-doc-keyword-p (listbeg startpos)
+  "Return true if `:documentation' symbol ends at STARTPOS inside a list.
+LISTBEG is the position of the start of the innermost list
+containing STARTPOS."
   (and listbeg                          ; We are inside a Lisp form.
        (save-excursion
          (goto-char startpos)
@@ -526,6 +532,9 @@ This will generate compile-time constants from BINDINGS."
                   (looking-at ":documentation\\_>"))))))
 
 (defun lisp-font-lock-syntactic-face-function (state)
+  "Return syntactic face function for the position represented by STATE.
+STATE is a `parse-partial-sexp' state, and the returned function is the
+Lisp font lock syntactic face function."
   (if (nth 3 state)
       ;; This might be a (doc)string or a |...| symbol.
       (let ((startpos (nth 8 state)))
index 0904ff93e232d82454719d38129dd02624c02b0e..690ea6f75331b730c79193c01502764bbbccaecb 100644 (file)
@@ -35,8 +35,6 @@
 (defvar dos-codepage)
 (autoload 'widget-value "wid-edit")
 
-(defvar mac-system-coding-system)
-
 ;;; MULE related key bindings and menus.
 
 (defvar mule-keymap
index 04542cdff3dd810069a6d1d58fbe854bffe70a00..c9235129f9862fa2ea595c4f2ee8b645cb222432 100644 (file)
@@ -3569,7 +3569,9 @@ using that one instead of current buffer's process."
               (forward-char (length (match-string-no-properties 0)))
               (point))))
          (end (point))
-         (prompt-boundaries (python-util-comint-last-prompt))
+         (prompt-boundaries
+          (with-current-buffer (process-buffer process)
+            (python-util-comint-last-prompt)))
          (prompt
           (with-current-buffer (process-buffer process)
             (when prompt-boundaries
index abb9cc6361dfd5382046670e9c8ce176e664b9dc..00f348929ef636bf33f14d06f660f7eda14f7678 100644 (file)
@@ -886,7 +886,7 @@ IGNORES is a list of glob patterns."
               hits)))
     (unwind-protect
         (cl-mapcan (lambda (hit) (xref--collect-matches hit regexp))
-                   hits)
+                   (nreverse hits))
       ;; TODO: Same as above.
       (mapc #'kill-buffer
             (cl-set-difference (buffer-list) orig-buffers)))))
index fe55cde49c91c45b12bbbe848cbe9d106765925e..49f5b7f18bc6d188f57786a7d7d4dfc5ce947f99 100644 (file)
@@ -2119,8 +2119,11 @@ INIT must be an integer that represents a character.  */)
     {
       nbytes = XINT (length);
       val = make_uninit_string (nbytes);
-      memset (SDATA (val), c, nbytes);
-      SDATA (val)[nbytes] = 0;
+      if (nbytes)
+       {
+         memset (SDATA (val), c, nbytes);
+         SDATA (val)[nbytes] = 0;
+       }
     }
   else
     {
@@ -2145,7 +2148,8 @@ INIT must be an integer that represents a character.  */)
              memcpy (p, beg, len);
            }
        }
-      *p = 0;
+      if (nbytes)
+       *p = 0;
     }
 
   return val;
@@ -3188,7 +3192,8 @@ allocate_vector (EMACS_INT len)
   if (min ((nbytes_max - header_size) / word_size, MOST_POSITIVE_FIXNUM) < len)
     memory_full (SIZE_MAX);
   v = allocate_vectorlike (len);
-  v->header.size = len;
+  if (len)
+    v->header.size = len;
   return v;
 }
 
index 871c1c3de959e6a3b420c2a57ff4051fd5ff7e38..440e78147d1d5002146364d64b0957b29992bc3c 100644 (file)
@@ -135,14 +135,12 @@ enum
   do {                                 \
     Lisp_Object tmp = XCAR (x);                \
     CHECK_CHARACTER (tmp);             \
-    XSETCAR ((x), tmp);                        \
   } while (false)
 
 #define CHECK_CHARACTER_CDR(x) \
   do {                                 \
     Lisp_Object tmp = XCDR (x);                \
     CHECK_CHARACTER (tmp);             \
-    XSETCDR ((x), tmp);                        \
   } while (false)
 
 /* Nonzero iff C is a character of code less than 0x100.  */
index 33bf424b344ab0e6eed9de95b7c70aeec6a63231..ec38ea798c73dca8bd7286ec67109817fa65d25b 100644 (file)
@@ -2130,6 +2130,15 @@ whether or not it is currently displayed in some window.  */)
              && it.method == GET_FROM_BUFFER
              && it.c == '\n')
            it_overshoot_count = 1;
+         else if (it_overshoot_count == 1 && it.vpos == 0
+                  && it.current_x < it.last_visible_x)
+           {
+             /* If we came to the same screen line as the one where
+                we started, we didn't overshoot the line, and won't
+                need to backtrack after all.  This happens, for
+                example, when PT is in the middle of a composition.  */
+             it_overshoot_count = 0;
+           }
          else if (disp_string_at_start_p && it.vpos > 0)
            {
              /* This is the case of a display string that spans
index eb2c7563afdf30bd921c33fce43bd9b2d300e3a1..8be1cd5c0fbd38b35aaab6b8af926b4d902f221b 100644 (file)
@@ -7124,6 +7124,9 @@ struct user_signal_info
 /* List of user signals.  */
 static struct user_signal_info *user_signals = NULL;
 
+/* Function called when handling user signals.  */
+void (*handle_user_signal_hook) (int);
+
 void
 add_user_signal (int sig, const char *name)
 {
@@ -7172,6 +7175,8 @@ handle_user_signal (int sig)
           }
 
        p->npending++;
+       if (handle_user_signal_hook)
+         (*handle_user_signal_hook) (sig);
 #ifdef USABLE_SIGIO
        if (interrupt_input)
          handle_input_available_signal (sig);
index 890d24eb2d9691c4970644522c566eb7f081f112..4558bd614149e04615289ef9447058404c063a6d 100644 (file)
@@ -415,6 +415,8 @@ extern void unuse_menu_items (void);
 #define EVENT_HEAD_KIND(event_head) \
   (Fget ((event_head), Qevent_kind))
 
+extern void (*handle_user_signal_hook) (int);
+
 /* True while doing kbd input.  */
 extern bool waiting_for_input;
 
index ff88605fc9f425de55d76cc668d06342f8d8b6bb..ce05b4dee4993ff6a9a8ef1f3461f7186a2250b1 100644 (file)
@@ -1325,7 +1325,7 @@ STRING_MULTIBYTE (Lisp_Object str)
 /* Mark STR as a unibyte string.  */
 #define STRING_SET_UNIBYTE(STR)                                \
   do {                                                 \
-    if (EQ (STR, empty_multibyte_string))              \
+    if (XSTRING (STR)->size == 0)                      \
       (STR) = empty_unibyte_string;                    \
     else                                               \
       XSTRING (STR)->size_byte = -1;                   \
@@ -1335,7 +1335,7 @@ STRING_MULTIBYTE (Lisp_Object str)
    ASCII characters in advance.  */
 #define STRING_SET_MULTIBYTE(STR)                      \
   do {                                                 \
-    if (EQ (STR, empty_unibyte_string))                        \
+    if (XSTRING (STR)->size == 0)                      \
       (STR) = empty_multibyte_string;                  \
     else                                               \
       XSTRING (STR)->size_byte = XSTRING (STR)->size;  \
index 9b1d94de7862f359bd50ab1ab2b77a02f0027dfa..773290fc2f09cd9ef0b0cc5d23dabcbd39427be7 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -1513,7 +1513,7 @@ codepage_for_filenames (CPINFO *cp_info)
 
       if (NILP (current_encoding))
        {
-         char *cpname = SDATA (SYMBOL_NAME (current_encoding));
+         char *cpname = SSDATA (SYMBOL_NAME (current_encoding));
          char *cp = NULL, *end;
          int cpnum;
 
@@ -2165,11 +2165,11 @@ unixtodos_filename (register char *p)
    (From msdos.c...probably should figure out a way to share it,
    although this code isn't going to ever change.)  */
 static int
-crlf_to_lf (register int n, register unsigned char *buf)
+crlf_to_lf (register int n, register char *buf)
 {
-  unsigned char *np = buf;
-  unsigned char *startp = buf;
-  unsigned char *endp = buf + n;
+  unsigned char *np = (unsigned char *)buf;
+  unsigned char *startp = np;
+  char *endp = buf + n;
 
   if (n == 0)
     return n;
@@ -2386,7 +2386,7 @@ ansi_encode_filename (Lisp_Object filename)
     {
       char shortname[MAX_PATH];
 
-      if (w32_get_short_filename (SDATA (filename), shortname, MAX_PATH))
+      if (w32_get_short_filename (SSDATA (filename), shortname, MAX_PATH))
        {
          dostounix_filename (shortname);
          encoded_filename = build_string (shortname);
@@ -7495,7 +7495,7 @@ socket_to_fd (SOCKET s)
                   though the socket wasn't really a kernel handle,
                   because a real handle has the same value.  So
                   test whether the new handle really is a socket.  */
-               long nonblocking = 0;
+               unsigned long nonblocking = 0;
                if (pfn_ioctlsocket ((SOCKET) new_s, FIONBIO, &nonblocking) == 0)
                  {
                    pfn_closesocket (s);
@@ -8520,7 +8520,7 @@ sys_write (int fd, const void * buffer, unsigned int count)
          int nbytes = count;
 
          SAFE_NALLOCA (tmpbuf, 2, count);
-         dst = tmpbuf;
+         dst = (unsigned char *)tmpbuf;
 
          while (1)
            {
@@ -9062,8 +9062,8 @@ check_windows_init_file (void)
       if (fd < 0)
        {
          Lisp_Object load_path_print = Fprin1_to_string (Vload_path, Qnil);
-         char *init_file_name = SDATA (init_file);
-         char *load_path = SDATA (load_path_print);
+         char *init_file_name = SSDATA (init_file);
+         char *load_path = SSDATA (load_path_print);
          char *buffer = alloca (1024
                                 + strlen (init_file_name)
                                 + strlen (load_path));