emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9278e97 01/15: Merge from origin/emacs-25


From: John Wiegley
Subject: [Emacs-diffs] master 9278e97 01/15: Merge from origin/emacs-25
Date: Tue, 12 Jan 2016 07:08:44 +0000

branch: master
commit 9278e970c5319672a05c7bce6358af0e2794205b
Merge: eb0643c 6ee327d
Author: John Wiegley <address@hidden>
Commit: John Wiegley <address@hidden>

    Merge from origin/emacs-25
    
    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
---
 configure.ac                    |   23 +++++++++--------------
 doc/emacs/programs.texi         |   18 ++++++++++--------
 doc/emacs/text.texi             |    8 +++++++-
 doc/lispref/windows.texi        |   17 ++++++++++++-----
 etc/NEWS                        |    7 +++++++
 lisp/emacs-lisp/lisp-mode.el    |    9 +++++++++
 lisp/international/mule-cmds.el |    2 --
 lisp/progmodes/python.el        |    4 +++-
 lisp/progmodes/xref.el          |    2 +-
 src/alloc.c                     |   13 +++++++++----
 src/character.h                 |    2 --
 src/indent.c                    |    9 +++++++++
 src/keyboard.c                  |    5 +++++
 src/keyboard.h                  |    2 ++
 src/lisp.h                      |    4 ++--
 src/w32.c                       |   20 ++++++++++----------
 16 files changed, 95 insertions(+), 50 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0aa863a..62bf9cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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.])
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 8423b70..83695b1 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -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
address@hidden if its default value
address@hidden 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
address@hidden  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,
address@hidden, 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}:
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index bab660e..3e8e0ac 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -1717,6 +1717,7 @@ such as @code{"/tmp"}.
 @vindex latex-run-command
 @vindex tex-dvi-view-command
 @vindex tex-dvi-print-command
address@hidden 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
address@hidden 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
address@hidden 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
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index e45201b..778e38b 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -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
address@hidden 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
address@hidden 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
diff --git a/etc/NEWS b/etc/NEWS
index 8907f7a..39fb3e1 100644
--- 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.
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 3448b72..e99f8a5 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -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)))
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 0904ff9..690ea6f 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -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
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 04542cd..c923512 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -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
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index abb9cc6..00f3489 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -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)))))
diff --git a/src/alloc.c b/src/alloc.c
index fe55cde..49f5b7f 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -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;
 }
 
diff --git a/src/character.h b/src/character.h
index 871c1c3..440e781 100644
--- a/src/character.h
+++ b/src/character.h
@@ -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.  */
diff --git a/src/indent.c b/src/indent.c
index 33bf424..ec38ea7 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -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
diff --git a/src/keyboard.c b/src/keyboard.c
index eb2c756..8be1cd5 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -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);
diff --git a/src/keyboard.h b/src/keyboard.h
index 890d24e..4558bd6 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -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;
 
diff --git a/src/lisp.h b/src/lisp.h
index ff88605..ce05b4d 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -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;  \
diff --git a/src/w32.c b/src/w32.c
index 9b1d94d..773290f 100644
--- 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));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]