summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/alloc.c10
-rw-r--r--src/buffer.c2
-rw-r--r--src/dispnew.c23
-rw-r--r--src/editfns.c2
-rw-r--r--src/fileio.c10
-rw-r--r--src/frame.c15
-rw-r--r--src/lisp.h6
-rw-r--r--src/thread.c4
-rw-r--r--src/window.c4
-rw-r--r--src/xterm.c16
10 files changed, 69 insertions, 23 deletions
diff --git a/src/alloc.c b/src/alloc.c
index da0c3ad4b3e..11afdfd7cc0 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -621,12 +621,6 @@ buffer_memory_full (ptrdiff_t nbytes)
#endif
}
-/* A common multiple of the positive integers A and B. Ideally this
- would be the least common multiple, but there's no way to do that
- as a constant expression in C, so do the best that we can easily do. */
-#define COMMON_MULTIPLE(a, b) \
- ((a) % (b) == 0 ? (a) : (b) % (a) == 0 ? (b) : (a) * (b))
-
#ifndef XMALLOC_OVERRUN_CHECK
#define XMALLOC_OVERRUN_CHECK_OVERHEAD 0
#else
@@ -7030,7 +7024,9 @@ sweep_symbols (void)
{
if (!sym->s.gcmarkbit)
{
- if (sym->s.redirect == SYMBOL_LOCALIZED)
+ if (sym->s.redirect == SYMBOL_LOCALIZED
+ /* Already freed? */
+ && !EQ (sym->s.function, Vdead))
xfree (SYMBOL_BLV (&sym->s));
sym->s.next = symbol_free_list;
symbol_free_list = &sym->s;
diff --git a/src/buffer.c b/src/buffer.c
index 1c8b4635086..9635733fcff 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5716,7 +5716,7 @@ word-wrapping, you might want to reduce the value of
in narrower windows.
Instead of setting this variable directly, most users should use
-Visual Line mode . Visual Line mode, when enabled, sets `word-wrap'
+Visual Line mode. Visual Line mode, when enabled, sets `word-wrap'
to t, and additionally redefines simple editing commands to act on
visual lines rather than logical lines. See the documentation of
`visual-line-mode'. */);
diff --git a/src/dispnew.c b/src/dispnew.c
index cb32f09b7c6..065d06813b8 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5149,6 +5149,29 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
include the hscroll. */
to_x += it.first_visible_x;
+ /* If we are hscrolling only the current line, and Y is at the line
+ containing point, augment TO_X with the hscroll amount of the
+ current line. */
+ if (it.line_wrap == TRUNCATE
+ && EQ (automatic_hscrolling, Qcurrent_line) && IT_CHARPOS (it) < PT)
+ {
+ struct it it2 = it;
+ void *it2data = bidi_shelve_cache ();
+ it2.last_visible_x = 1000000;
+ /* If the line at Y shows point, the call below to
+ move_it_in_display_line will succeed in reaching point. */
+ move_it_in_display_line (&it2, PT, -1, MOVE_TO_POS);
+ if (IT_CHARPOS (it2) >= PT)
+ {
+ to_x += (w->hscroll - w->min_hscroll) * FRAME_COLUMN_WIDTH (it.f);
+ /* We need to pretend the window is hscrolled, so that
+ move_it_in_display_line below will DTRT with TO_X. */
+ it.first_visible_x += w->hscroll * FRAME_COLUMN_WIDTH (it.f);
+ it.last_visible_x += w->hscroll * FRAME_COLUMN_WIDTH (it.f);
+ }
+ bidi_unshelve_cache (it2data, 0);
+ }
+
/* Now move horizontally in the row to the glyph under *X. Second
argument is ZV to prevent move_it_in_display_line from matching
based on buffer positions. */
diff --git a/src/editfns.c b/src/editfns.c
index 47ff2a5cbfd..e250c91ecbc 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -4119,7 +4119,7 @@ The # flag means to use an alternate display form for %o, %x, %X, %e,
\"0\"; for %x and %X, it prefixes the result with \"0x\" or \"0X\";
for %e and %f, it causes a decimal point to be included even if the
the precision is zero; for %g, it causes a decimal point to be
-included even if the the precision is zero, and also forces trailing
+included even if the precision is zero, and also forces trailing
zeros after the decimal point to be left in place.
The width specifier supplies a lower limit for the length of the
diff --git a/src/fileio.c b/src/fileio.c
index ac520c2328e..fb66118905f 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3126,7 +3126,15 @@ symbolic notation, like the `chmod' command from GNU Coreutils. */)
DEFUN ("set-default-file-modes", Fset_default_file_modes, Sset_default_file_modes, 1, 1, 0,
doc: /* Set the file permission bits for newly created files.
The argument MODE should be an integer; only the low 9 bits are used.
-This setting is inherited by subprocesses. */)
+On Posix hosts, this setting is inherited by subprocesses.
+
+This function works by setting the Emacs's file mode creation mask.
+Each bit that is set in the mask means that the corresponding bit
+in the permissions of newly created files will be disabled.
+
+Note that when `write-region' creates a file, it resets the
+execute bit, even if the mask set by this function allows that bit
+by having the corresponding bit in the mask reset. */)
(Lisp_Object mode)
{
mode_t oldrealmask, oldumask, newumask;
diff --git a/src/frame.c b/src/frame.c
index ab801eec9c7..fe1709e6ede 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -5895,16 +5895,11 @@ or call the function `tool-bar-mode'. */);
#endif
DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
- doc: /* Minibufferless frames use this frame's minibuffer.
-Emacs cannot create minibufferless frames unless this is set to an
-appropriate surrogate.
-
-Emacs consults this variable only when creating minibufferless
-frames; once the frame is created, it sticks with its assigned
-minibuffer, no matter what this variable is set to. This means that
-this variable doesn't necessarily say anything meaningful about the
-current set of frames, or where the minibuffer is currently being
-displayed.
+ doc: /* Minibuffer-less frames by default use this frame's minibuffer.
+Emacs consults this variable only when creating a minibuffer-less frame
+and no explicit minibuffer window has been specified for that frame via
+the `minibuffer' frame parameter. Once such a frame has been created,
+setting this variable does not change that frame's previous association.
This variable is local to the current terminal and cannot be buffer-local. */);
diff --git a/src/lisp.h b/src/lisp.h
index 266370333f5..43b3ec618f0 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -283,6 +283,12 @@ error !;
# define GCALIGNED /* empty */
#endif
+/* A common multiple of the positive integers A and B. Ideally this
+ would be the least common multiple, but there's no way to do that
+ as a constant expression in C, so do the best that we can easily do. */
+#define COMMON_MULTIPLE(a, b) \
+ ((a) % (b) == 0 ? (a) : (b) % (a) == 0 ? (b) : (a) * (b))
+
/* Some operations are so commonly executed that they are implemented
as macros, not functions, because otherwise runtime performance would
suffer too much when compiling with GCC without optimization.
diff --git a/src/thread.c b/src/thread.c
index 6f12d796ff9..7a670ba410b 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -26,7 +26,9 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "coding.h"
#include "syssignal.h"
-static struct thread_state alignas (GCALIGNMENT) main_thread;
+#define THREAD_ALIGNMENT COMMON_MULTIPLE (alignof (max_align_t), GCALIGNMENT)
+
+static struct thread_state alignas (THREAD_ALIGNMENT) main_thread;
struct thread_state *current_thread = &main_thread;
diff --git a/src/window.c b/src/window.c
index ba86d73911f..9bb2c43a698 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5832,8 +5832,8 @@ by this function. This happens in an interactive call. */)
}
DEFUN ("minibuffer-selected-window", Fminibuffer_selected_window, Sminibuffer_selected_window, 0, 0, 0,
- doc: /* Return the window which was selected when entering the minibuffer.
-Returns nil, if selected window is not a minibuffer window. */)
+ doc: /* Return window selected just before minibuffer window was selected.
+Return nil if the selected window is not a minibuffer window. */)
(void)
{
if (minibuf_level > 0
diff --git a/src/xterm.c b/src/xterm.c
index d90654b101d..dbb8349452d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11504,6 +11504,22 @@ x_make_frame_visible (struct frame *f)
/* Try to wait for a MapNotify event (that is what tells us when a
frame becomes visible). */
+
+#ifdef CYGWIN
+ /* On Cygwin, which uses input polling, we need to force input to
+ be read. See
+ http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00351.html
+ and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24091#131.
+ Fake an alarm signal to let the handler know that there's
+ something to be read.
+
+ It could be confusing if a real alarm arrives while processing
+ the fake one. Turn it off and let the handler reset it. */
+ int old_poll_suppress_count = poll_suppress_count;
+ poll_suppress_count = 1;
+ poll_for_input_1 ();
+ poll_suppress_count = old_poll_suppress_count;
+#endif
x_wait_for_event (f, MapNotify);
}
}