]> code.delx.au - gnu-emacs/commitdiff
Merge from origin/emacs-24
authorTed Zlatanov <tzz@lifelogs.com>
Sat, 13 Dec 2014 00:15:10 +0000 (19:15 -0500)
committerTed Zlatanov <tzz@lifelogs.com>
Sat, 13 Dec 2014 00:23:19 +0000 (19:23 -0500)
bd6c441 * simple.el (password-word-equivalents): Add "passcode", used for numeric secrets like PINs or RSA tokens.
16d4c1c A better fix for bug#19346
82ec808 * .gitignore: Add !lib/std*.in.h, so as to not ignore the .in.h files.
3cf7629 Git ignore lib/std*.h
301a401 Always define `gnutls-available-p' even if GnuTLS is not available.
d76b9b2 Don't break example string between 2 lines (bug#19257)
75b4857 Port commit-msg to mawk
9ac0332 Improve commit-msg messages and autosquash
0c2f254 Support overflow-newline-into-fringe together with word-wrap (bug#19300)
935ee05 * net/tramp-sh.el (tramp-get-remote-path): Use a login shell in order to determine `tramp-own-remote-path'.
c2db939 python.el: Support interpreter paths with spaces
d83f329 ChangeLog fix
0f9fbb9 Port commit-message checking to FreeBSD 9.
3db1ada admin/MAINTAINERS: Update my interests and responsibilities.
6382f24 * .gitignore: Ignore autosave files.

Conflicts:
ChangeLog
lisp/progmodes/python.el
src/gnutls.c

15 files changed:
.gitignore
ChangeLog
admin/MAINTAINERS
build-aux/git-hooks/commit-msg
doc/lispref/ChangeLog
doc/lispref/text.texi
lisp/ChangeLog
lisp/net/tramp-sh.el
lisp/progmodes/python.el
lisp/simple.el
src/ChangeLog
src/emacs.c
src/gnutls.c
src/gnutls.h
src/xdisp.c

index 228deaaf8e529e62a031555eb5d660d5318f267e..188dd9f55d83002c2e6592b78cdb922e58776f95 100644 (file)
@@ -64,10 +64,8 @@ lib/getopt.h
 lib/inttypes.h
 lib/libgnu.a
 lib/signal.h
-lib/stdalign.h
-lib/stdint.h
-lib/stdio.h
-lib/stdlib.h
+lib/std*.h
+!lib/std*.in.h
 lib/string.h
 lib/sys/
 lib/time.h
@@ -237,6 +235,7 @@ info/dir
 *.rej
 *~
 .#*
+\#*\#
 [0-9]*.patch
 
 # Built by 'make install'.
index 32083d7b7f91cc872d0017831c07067013b57355..631682365d3d8081c8fccb0e47700081ae05a4d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,65 @@
+2014-11-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * .gitignore: Copy over sufficient ignorable files from the old
+       .bzrignore that a simple build doesn't list lots of unregistered
+       files.
+
+2014-11-11  Eric S. Raymond  <esr@thyrsus.com>
+
+       * Makefile.in: git transition - set VCWITNESS appropriately for git.
+
+       All bzr revision IDS, and all CVS revision IDs for which a commit
+       could be identified, were changed to time-date!committer version
+       stamps. All .cvsignore files in the history became .gitignore
+       files. Fixes-bug annotations from bzr were copied into the
+       corresponding commit comments.
+
+       (The first .cvsignore commit was 1999-09-30T14:07:54Z!fx@gnu.org.
+       The last CVS commit was 2009-12-27T08:11:12Z!cyd@stupidchicken.com.)
+
+       Committer/author email addresses are generally correct for the
+       transition day, not necessarily when the comit was originally
+       made.
+
+2014-12-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Git ignore lib/std*.h
+       * .gitignore: Add lib/std*.h, to ignore stdarg.h, stdbool.h, and
+       stddef.h.  Remove subsumed entries.
+       Add !lib/std*.in.h, so as to not ignore the .in.h files.
+
+2014-12-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port commit-msg to mawk
+       Problem reported by Ted Zlatanov in:
+       http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg01093.html
+       * build-aux/git-hooks/commit-msg (space, non_space, non_print):
+       New vars.  Use them as approximations to POSIX bracket expressions,
+       on implementations like mawk that do not support POSIX regexps.
+
+       Improve commit-msg messages and autosquash
+       Problem reported by Michal Nazarewicz in Bug#19337.
+       * build-aux/git-hooks/commit-msg: Add "commit message" to
+       diagnostics.  Distinguish better between tabs and other
+       unprintable chars in diagnostics.  Don't complain if a prefix
+       "fixup! " or "squash! " makes a summary line too long.
+
+2014-12-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port commit-message checking to FreeBSD 9.
+       This fixes a bug reported by Jan Djärv in:
+       http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg00704.html
+       along with some other issues I noticed while testing with FreeBSD.
+       * build-aux/git-hooks/commit-msg: Prefer gawk if available.
+       Prefer en_US.UTF-8 to en_US.utf8, as it's more portable.
+       Work around bug in FreeBSD 9 awk, where /[[:cntrl:]]/ matches
+       ordinary text characters.
+       Be less tricky about quoting "'" in a shell script.
+
+2014-12-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * .gitignore: Ignore autosave files.
+
 2014-12-12  Paul Eggert  <eggert@cs.ucla.edu>
 
        Merge from gnulib
index 9a46b64c3e8bc0a921f6119eb30add29ccee2403..57f199b27c21bbf6d1628c33d3193edba8bf87cf 100644 (file)
@@ -31,6 +31,7 @@ Eli Zaretskii
            src/msdos.[ch]
            src/dosfns.[ch]
            src/w16select.c
+           src/unexcoff.c
            lisp/term/internal.el
            lisp/term/pc-win.el
            lisp/dos-fns.el
@@ -80,14 +81,18 @@ Bastien Guerry
 Eli Zaretskii
        doc/*
        lispref/*
-       info/dir
 
        src/xfaces.c
        src/xdisp.c
        src/term.c
        src/dispnew.c
+       src/dispextern.h
        src/frame.c
        src/dired.c
+       src/unexw32.c
+       src/w32*.[ch]
+       src/window.c
+       nt/*
 
        lisp/arc-mode.el
        lisp/menu-bar.el
@@ -97,6 +102,8 @@ Eli Zaretskii
        lisp/startup.el
        lisp/w32*.el
 
+       admin/unidata/*
+
 Stefan Monnier
        src/intervals.c
        src/keyboard.c
@@ -181,24 +188,10 @@ src/tparam.c
 src/undo.c
 src/unexaix.c
 src/unexalpha.c
-src/unexcoff.c
 src/unexelf.c
 src/unexhp9k800.c
-src/unexw32.c
 src/vm-limit.c
-src/w32.c
-src/w32console.c
-src/w32fns.c
-src/w32heap.c
-src/w32inevt.c
-src/w32menu.c
-src/w32proc.c
-src/w32reg.c
-src/w32select.c
-src/w32term.c
-src/w32xfns.c
 src/widget.c
-src/window.c
 src/xfns.c
 src/xmenu.c
 src/xrdb.c
index 6a09eddf88bd1cc2bc5dd59a2bcf11fa69d51ecd..5eb994c6fe01ce85c7e3cf3f8ffbc36244c33f45 100755 (executable)
 
 # Written by Paul Eggert.
 
+# Prefer gawk if available, as it handles NUL bytes properly.
+if type gawk >/dev/null 2>&1; then
+  awk=gawk
+else
+  awk=awk
+fi
+
 # Use a UTF-8 locale if available, so that the UTF-8 check works.
 # Use U+00A2 CENT SIGN to test whether the locale works.
 cent_sign_utf8_octal='\302\242'
 at_sign=`
   printf "${cent_sign_utf8_octal}@" |
-  awk '{print substr($0, 2)}' 2>/dev/null
+  $awk '{print substr($0, 2)}' 2>/dev/null
 `
 if test "$at_sign" != @; then
   at_sign=`
     printf "${cent_sign_utf8_octal}@" |
-    LC_ALL=en_US.utf8 awk '{print substr($0, 2)}' 2>/dev/null
+    LC_ALL=en_US.UTF-8 $awk '{print substr($0, 2)}' 2>/dev/null
   `
   if test "$at_sign" = @; then
-    LC_ALL=en_US.utf8; export LC_ALL
+    LC_ALL=en_US.UTF-8; export LC_ALL
   fi
 fi
 
 # Check the log entry.
-exec awk '
+exec $awk '
+  BEGIN {
+    if (" " ~ /[[:space:]]/) {
+      space = "[[:space:]]"
+      non_space = "[^[:space:]]"
+      non_print = "[^[:print:]]"
+    } else {
+      # mawk 1.3.3 does not support POSIX bracket expressions.
+      # Approximate them as best we can.
+      space = "[ \f\n\r\t\v]"
+      non_space = "[^ \f\n\r\t\v]"
+      non_print = "[\1-\37\177]"
+    }
+  }
+
   /^#/ { next }
 
   !/^.*$/ {
-    print "Invalid character (not UTF-8)"
+    print "Invalid character (not UTF-8) in commit message"
     status = 1
   }
 
-  nlines == 0 && !/[^[:space:]]/ { next }
+  nlines == 0 && $0 !~ non_space { next }
 
   { nlines++ }
 
-  nlines == 1 && /^[[:space:]]/ {
-    print "White space at start of first line"
-    status = 1
-  }
+  nlines == 1 {
+    # Ignore special markers used by "git rebase --autosquash".
+    if (! sub(/^fixup! /, ""))
+      sub(/^squash! /, "")
 
-  nlines == 2 && /[^[:space:]]/ {
-    print "Nonempty second line"
-    status = 1
+    if ($0 ~ "^" space) {
+      print "White space at start of commit message'\''s first line"
+      status = 1
+    }
   }
 
-  /[[:cntrl:]]/ {
-    print "Text contains control character; please use spaces instead of tabs"
+  nlines == 2 && $0 ~ non_space {
+    print "Nonempty second line in commit message"
     status = 1
   }
 
-  72 < length && /[[:space:]]/ {
-    print "Line longer than 72 characters"
+  72 < length && $0 ~ space {
+    print "Line longer than 72 characters in commit message"
     status = 1
   }
 
   140 < length {
-    print "Word longer than 140 characters"
+    print "Word longer than 140 characters in commit message"
     status = 1
   }
 
   /^Signed-off-by: / {
-    print "'Signed-off-by:' present"
+    print "'\''Signed-off-by:'\'' in commit message"
+    status = 1
+  }
+
+  $0 ~ non_print {
+    if (gsub(/\t/, "")) {
+      print "Tab in commit message; please use spaces instead"
+    }
+    if ($0 ~ non_print) {
+      print "Unprintable character in commit message"
+    }
     status = 1
   }
 
   END {
     if (nlines == 0) {
-      print "Empty change log entry"
+      print "Empty commit message"
       status = 1
     }
     exit status
index e7b5606b681189b1b1e57f242c88f2a24f41560c..ad94751a790261251e413a7b5d723a215cfddac8 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-11  Eli Zaretskii  <eliz@gnu.org>
+
+       * text.texi (Comparing Text): Prevent a text string from being
+       broken between 2 lines.  (Bug#19257)
+
 2014-12-09  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * files.texi (Contents of Directories): Document
index 720343cb17d5ad46d43faf696236d8d1b6647516..3ef565b8f30c35a97eecbcf94a6d1e0a285443ca 100644 (file)
@@ -349,10 +349,10 @@ This function ignores case when comparing characters
 if @code{case-fold-search} is non-@code{nil}.  It always ignores
 text properties.
 
-Suppose the current buffer contains the text @samp{foobarbar
-haha!rara!}; then in this example the two substrings are @samp{rbar }
-and @samp{rara!}.  The value is 2 because the first substring is greater
-at the second character.
+Suppose you have the text @w{@samp{foobarbar haha!rara!}} in the
+current buffer; then in this example the two substrings are @samp{rbar
+} and @samp{rara!}.  The value is 2 because the first substring is
+greater at the second character.
 
 @example
 (compare-buffer-substrings nil 6 11 nil 16 21)
index 1db7c97680e9ebbc534d156b50c5b6fc2d3e4552..a41b5cc52aa023a26e4ee830af49c3b4ab7163bc 100644 (file)
@@ -1,3 +1,18 @@
+2014-12-12  Michael Albinus  <michael.albinus@gmx.de>
+
+       * simple.el (password-word-equivalents): Add "passcode", used for
+       numeric secrets like PINs or RSA tokens.
+
+2014-12-10  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp-sh.el (tramp-get-remote-path): Use a login shell in
+       order to determine `tramp-own-remote-path'.
+
+2014-12-09  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       * progmodes/python.el (python-shell-parse-command): Quote
+       `python-shell-interpreter`.  (Bug#19289)
+
 2014-12-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/python.el (python-indent-line): Use `noindent' in strings.
index c564988d3707283073f7d72db473a64394569b9f..c4d5e2fa97a7929b095f3fc8168f8249b7747461 100644 (file)
@@ -3868,6 +3868,18 @@ file exists and nonzero exit status otherwise."
        (setq item (pop alist))
        (when (string-match (car item) shell)
          (setq extra-args (cdr item))))
+      ;; It is useful to set the prompt in the following command
+      ;; because some people have a setting for $PS1 which /bin/sh
+      ;; doesn't know about and thus /bin/sh will display a strange
+      ;; prompt.  For example, if $PS1 has "${CWD}" in the value, then
+      ;; ksh will display the current working directory but /bin/sh
+      ;; will display a dollar sign.  The following command line sets
+      ;; $PS1 to a sane value, and works under Bourne-ish shells as
+      ;; well as csh-like shells.  We also unset the variable $ENV
+      ;; because that is read by some sh implementations (eg, bash
+      ;; when called as sh) on startup; this way, we avoid the startup
+      ;; file clobbering $PS1.  $PROMPT_COMMAND is another way to set
+      ;; the prompt in /bin/bash, it must be discarded as well.
       (tramp-send-command
        vec (format
            "exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s"
@@ -3944,20 +3956,6 @@ seconds.  If not, it produces an error message with the given ERROR-ARGS."
 Mainly sets the prompt and the echo correctly.  PROC is the shell
 process to set up.  VEC specifies the connection."
   (let ((tramp-end-of-output tramp-initial-end-of-output))
-    ;; It is useful to set the prompt in the following command because
-    ;; some people have a setting for $PS1 which /bin/sh doesn't know
-    ;; about and thus /bin/sh will display a strange prompt.  For
-    ;; example, if $PS1 has "${CWD}" in the value, then ksh will
-    ;; display the current working directory but /bin/sh will display
-    ;; a dollar sign.  The following command line sets $PS1 to a sane
-    ;; value, and works under Bourne-ish shells as well as csh-like
-    ;; shells.  Daniel Pittman reports that the unusual positioning of
-    ;; the single quotes makes it work under `rc', too.  We also unset
-    ;; the variable $ENV because that is read by some sh
-    ;; implementations (eg, bash when called as sh) on startup; this
-    ;; way, we avoid the startup file clobbering $PS1.  $PROMPT_COMMAND
-    ;; is another way to set the prompt in /bin/bash, it must be
-    ;; discarded as well.
     (tramp-open-shell
      vec
      (or (tramp-get-connection-property vec "remote-shell" nil)
@@ -5046,13 +5044,25 @@ Return ATTR."
                   "/bin:/usr/bin")
                  "/bin:/usr/bin"))))
           (own-remote-path
-            (when elt2
-              (condition-case nil
-                  (tramp-send-command-and-read vec "echo \\\"$PATH\\\"")
-                (error
-                 (tramp-message
-                  vec 3 "$PATH not set, ignoring `tramp-own-remote-path'.")
-                 nil)))))
+           ;; We cannot apply `tramp-send-command-and-read' because
+           ;; the login shell could return more than just the $PATH
+           ;; string.  So we emulate that function.
+           (when elt2
+             (tramp-send-command
+              vec
+              (format
+               "%s -l %s 'echo \\\"$PATH\\\"'"
+               (tramp-get-method-parameter
+                (tramp-file-name-method vec) 'tramp-remote-shell)
+               (mapconcat
+                'identity
+                (tramp-get-method-parameter
+                 (tramp-file-name-method vec) 'tramp-remote-shell-args)
+                " ")))
+             (with-current-buffer (tramp-get-connection-buffer vec)
+               (goto-char (point-max))
+               (forward-line -1)
+               (read (current-buffer))))))
 
       ;; Replace place holder `tramp-default-remote-path'.
       (when elt1
index f1d8cff15ee692172a0e57a76e9e22c4a5d92881..35e24e14e1c9eca9b6491a297670e68eeebf5bc0 100644 (file)
@@ -2125,7 +2125,9 @@ uniqueness for different types of configurations."
     ;; `python-shell-interpreter' absolute path can be found by
     ;; `executable-find'.
     (format "%s %s"
-            (executable-find python-shell-interpreter)
+            ;; FIXME: Why executable-find?
+            (shell-quote-argument
+             (executable-find python-shell-interpreter))
             python-shell-interpreter-args)))
 
 (define-obsolete-function-alias
index 9f447988a2f6af899357bb3b3a7a36202a983efe..0fcd5db45d99f29f1eae192fda9b3fa6609bd606 100644 (file)
@@ -2796,7 +2796,7 @@ which is defined in the `warnings' library.\n")
     t))
 \f
 (defcustom password-word-equivalents
-  '("password" "passphrase" "pass phrase"
+  '("password" "passcode" "passphrase" "pass phrase"
     ; These are sorted according to the GNU en_US locale.
     "암호"           ; ko
     "パスワード"  ; ja
index 887ca89261a7c59b2a737a9c8c456bcee2e8d9eb..fd37eaefbec61103d5d33db1b64d4e71d0cf2b69 100644 (file)
@@ -1,3 +1,26 @@
+2014-12-12  Eli Zaretskii  <eliz@gnu.org>
+
+       * gnutls.c (Fgnutls_available_p, syms_of_gnutls): Move
+       gnutls-available-p out of the HAVE_GNUTLS conditional, and define
+       them only once.
+
+2014-12-11  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * emacs.c (main): Always include gnutls.h and run syms_of_gnutls.
+
+       * gnutls.h: Always declare syms_of_gnutls.
+
+       * gnutls.c (Fgnutls_available_p syms_of_gnutls): Move later for
+       clarity.  Let the availability check return Qnil when the GnuTLS
+       integration is not available, instead of erroring out.
+       (Bug#19346)
+
+2014-12-10  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (move_it_in_display_line_to, display_line): Don't
+       disallow overflow-newline-into-fringe when word-wrap is in
+       effect.  (Bug#19300)
+
 2014-12-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * fileio.c: Better preserve window-points during revert (bug#19161).
index da34eaac14b54562cec1efb222e70ac5af2e4c79..b9654d0e03c493a80f94b03ee5679ef4095628e2 100644 (file)
@@ -88,9 +88,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sysselect.h"
 #include "systime.h"
 
-#ifdef HAVE_GNUTLS
 #include "gnutls.h"
-#endif
 
 #if (defined PROFILING \
      && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__))
@@ -1493,9 +1491,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
       syms_of_fontset ();
 #endif /* HAVE_NS */
 
-#ifdef HAVE_GNUTLS
       syms_of_gnutls ();
-#endif
 
 #ifdef HAVE_GFILENOTIFY
       syms_of_gfilenotify ();
index 4de2eaf5b5278da2d2a774fa5ae787d664306b6c..4e12d88ab82fa71aa43a5b00ccdf5b7be25cdeae 100644 (file)
@@ -779,26 +779,6 @@ See also `gnutls-init'.  */)
   return emacs_gnutls_deinit (proc);
 }
 
-DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
-       doc: /* Return t if GnuTLS is available in this instance of Emacs.  */)
-     (void)
-{
-#ifdef WINDOWSNT
-  Lisp_Object found = Fassq (Qgnutls_dll, Vlibrary_cache);
-  if (CONSP (found))
-    return XCDR (found);
-  else
-    {
-      Lisp_Object status;
-      status = init_gnutls_functions () ? Qt : Qnil;
-      Vlibrary_cache = Fcons (Fcons (Qgnutls_dll, status), Vlibrary_cache);
-      return status;
-    }
-#else
-  return Qt;
-#endif
-}
-
 static Lisp_Object
 gnutls_hex_string (unsigned char *buf, ptrdiff_t buf_size, const char *prefix)
 {
@@ -1101,7 +1081,6 @@ The return value is a property list with top-level keys :warnings and
   return result;
 }
 
-
 /* Initialize global GnuTLS state to defaults.
    Call `gnutls-global-deinit' when GnuTLS usage is no longer needed.
    Return zero on success.  */
@@ -1602,9 +1581,36 @@ This function may also return `gnutls-e-again', or
   return gnutls_make_error (ret);
 }
 
+#endif /* HAVE_GNUTLS */
+
+DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
+       doc: /* Return t if GnuTLS is available in this instance of Emacs.  */)
+     (void)
+{
+#ifdef HAVE_GNUTLS
+# ifdef WINDOWSNT
+  Lisp_Object found = Fassq (Qgnutls_dll, Vlibrary_cache);
+  if (CONSP (found))
+    return XCDR (found);
+  else
+    {
+      Lisp_Object status;
+      status = init_gnutls_functions () ? Qt : Qnil;
+      Vlibrary_cache = Fcons (Fcons (Qgnutls_dll, status), Vlibrary_cache);
+      return status;
+    }
+# else /* !WINDOWSNT */
+  return Qt;
+# endif         /* !WINDOWSNT */
+#else  /* !HAVE_GNUTLS */
+  return Qnil;
+#endif /* !HAVE_GNUTLS */
+}
+
 void
 syms_of_gnutls (void)
 {
+#ifdef HAVE_GNUTLS
   gnutls_global_initialized = 0;
 
   DEFSYM (Qgnutls_dll, "gnutls");
@@ -1646,7 +1652,6 @@ syms_of_gnutls (void)
   defsubr (&Sgnutls_boot);
   defsubr (&Sgnutls_deinit);
   defsubr (&Sgnutls_bye);
-  defsubr (&Sgnutls_available_p);
   defsubr (&Sgnutls_peer_status);
   defsubr (&Sgnutls_peer_status_warning_describe);
 
@@ -1656,6 +1661,8 @@ Set this larger than 0 to get debug output in the *Messages* buffer.
 1 is for important messages, 2 is for debug data, and higher numbers
 are as per the GnuTLS logging conventions.  */);
   global_gnutls_log_level = 0;
-}
 
-#endif /* HAVE_GNUTLS */
+#endif /* HAVE_GNUTLS */
+
+  defsubr (&Sgnutls_available_p);
+}
index 8a667c00568a267463ce21e3989b1b9bf5f32aa5..8a18976cf1b145e19fb51add5409cc76d5d88ae3 100644 (file)
@@ -82,8 +82,8 @@ extern void emacs_gnutls_transport_set_errno (gnutls_session_t state, int err);
 #endif
 extern Lisp_Object emacs_gnutls_deinit (Lisp_Object);
 
-extern void syms_of_gnutls (void);
-
 #endif
 
+extern void syms_of_gnutls (void);
+
 #endif
index 0d314688c2655a56d0fbe341e43271b140ca09ff..f022790023b9e7684e26e70a34bcbb9264e14c0b 100644 (file)
@@ -8794,12 +8794,7 @@ move_it_in_display_line_to (struct it *it,
                         doesn't fit on the line, e.g. a wide image.  */
                      it->hpos == 0
                      || (new_x == it->last_visible_x
-                         && FRAME_WINDOW_P (it->f)
-                         /* When word-wrap is ON and we have a valid
-                            wrap point, we don't allow the last glyph
-                            to "just barely fit" on the line.  */
-                         && (it->line_wrap != WORD_WRAP
-                             || wrap_it.sp < 0)))
+                         && FRAME_WINDOW_P (it->f)))
                    {
                      ++it->hpos;
                      it->current_x = new_x;
@@ -8866,7 +8861,8 @@ move_it_in_display_line_to (struct it *it,
                                }
                              if (ITERATOR_AT_END_OF_LINE_P (it)
                                  && (it->line_wrap != WORD_WRAP
-                                     || wrap_it.sp < 0))
+                                     || wrap_it.sp < 0
+                                     || IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)))
                                {
                                  result = MOVE_NEWLINE_OR_CR;
                                  break;
@@ -20438,7 +20434,8 @@ display_line (struct it *it)
                        {
                          /* If line-wrap is on, check if a previous
                             wrap point was found.  */
-                         if (wrap_row_used > 0
+                         if (!IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)
+                             && wrap_row_used > 0
                              /* Even if there is a previous wrap
                                 point, continue the line here as
                                 usual, if (i) the previous character
@@ -20468,6 +20465,18 @@ display_line (struct it *it)
                                  row->continued_p = 0;
                                  row->exact_window_width_line_p = 1;
                                }
+                             /* If line-wrap is on, check if a
+                                previous wrap point was found.  */
+                             else if (wrap_row_used > 0
+                                      /* Even if there is a previous wrap
+                                         point, continue the line here as
+                                         usual, if (i) the previous character
+                                         was a space or tab AND (ii) the
+                                         current character is not.  */
+                                      && (!may_wrap
+                                          || IT_DISPLAYING_WHITESPACE (it)))
+                               goto back_to_wrap;
+
                            }
                        }
                      else if (it->bidi_p)