Dmitry Antipov [Thu, 8 Nov 2012 14:10:28 +0000 (18:10 +0400)]
Shrink struct vectorlike_header to the only size field.
* lisp.h (enum pvec_type): Avoid explicit enum member values.
Adjust comment.
(enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
PVEC_TYPE_MASK to arrange new bitfield in the vector header.
(PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
(PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
information from the vector header. Adjust comment.
(XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
(PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
layout.
(XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
(struct vectorlike_header): Remove next member. Adjust comment.
(struct Lisp_Subr): Add convenient header. Adjust comment.
(allocate_pseudovector): Adjust prototype.
* alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
(sweep_string, lisp_malloc): Remove useless prototypes.
(enum mem_type): Adjust comment.
(NEXT_IN_FREE_LIST): New macro.
(SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
(Fmake_bool_vector): Likewise.
(struct large_vector): New type to represent allocation unit for
the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
(large_vectors): Change type to struct large_vector.
(allocate_vector_from_block): Simplify.
(PSEUDOVECTOR_NBYTES): Replace with...
(vector_nbytes): ...new function. Adjust users.
(sweep_vectors): Adjust processing of large vectors.
(allocate_vectorlike): Likewise.
(allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
Add easserts. Adjust XSETPVECTYPESIZE usage.
(allocate_buffer): Use BUFFER_PVEC_INIT.
(live_vector_p): Adjust to match large vector.
* buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
* buffer.h (struct buffer): Add next member.
(BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
New macros.
(FOR_EACH_BUFFER): Adjust to match struct buffer change.
* fns.c (internal_equal): Adjust to match enum pvec_type change.
(copy_hash_table): Adjust to match vector header change.
* lread.c (defsubr): Use XSETPVECTYPE.
* .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
(xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
(xvecsize): New command.
Dmitry Antipov [Thu, 8 Nov 2012 09:26:40 +0000 (13:26 +0400)]
* keyboard.c (event_to_kboard): Do not dereference
frame_or_window field of SELECTION_REQUEST_EVENT
and SELECTION_CLEAR_EVENT events (Bug#12814).
* xterm.h (struct selection_input_event): Adjust comment.
Michael Albinus [Thu, 8 Nov 2012 07:50:43 +0000 (08:50 +0100)]
* os.texi (Notifications): Update descriptions of
notifications-notify, notifications-close-notification and
notifications-get-capabilities according to latest code changes.
Add notifications-get-server-information.
Eli Zaretskii [Wed, 7 Nov 2012 21:12:25 +0000 (23:12 +0200)]
A (hopefully) better fix for bug #1280.
src/w32fns.c (modifier_set): Don't report modifiers from toggle key,
such as Scroll Lock, if the respective keys are treated as
function keys, not as modifiers. This avoids destroying non-ASCII
keyboard input when Scroll Lock is toggled ON.
Eli Zaretskii [Wed, 7 Nov 2012 16:44:48 +0000 (18:44 +0200)]
Fix bug #1280 with non-ASCII keyboard input on MS-Windows.
src/w32fns.c (w32_wnd_proc): Don't directly handle key chords
including modifiers from toggle key, such as Scroll Lock, if the
respective keys are treated as function keys, not as modifiers.
This avoids destroying non-ASCII keyboard input when Scroll Lock
is toggled ON.
Paul Eggert [Tue, 6 Nov 2012 20:48:35 +0000 (12:48 -0800)]
Restore some duplicate definitions.
This undoes part of the 2012-11-03 changes. Some people build
with plain -g rather than with -g3, and they need the duplicate
definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
* lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
Define as macros, as well as as enums or as constants.
Paul Eggert [Tue, 6 Nov 2012 17:40:07 +0000 (09:40 -0800)]
Minor adjustments of recently-changed frame functions.
* buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
known to be a frame (we're in the FRAMEP branch).
* lisp.h (Qframep): Remove decl. frame.h declares this.
* window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
since they're meant for Lisp fixnum values.
Agustín Martín [Tue, 6 Nov 2012 16:33:56 +0000 (17:33 +0100)]
ispell.el (ispell-region): Do not prefix sent string by comment in autoconf mode
This commit changes some of the `in-comment' ocurrences to more specific
`add-comment', set only if comment prefix is to be added.
When in comment, old code prefixed string by comment string to let ispell
know this is part of a comment string.
This is only supported in some modes. In particular, this is not supported in
autoconf mode where adding the comment string messes everything up because
ispell tries to spellcheck the `dnl' string header causing misalignments in
some cases (debbugs.gnu.org: #12768).
Agustín Martín [Tue, 6 Nov 2012 16:22:09 +0000 (17:22 +0100)]
textmodes/ispell.el: Experimental support for support debugging.
* (ispell-create-debug-buffer): Create a `ispell-debug-buffer' debug
buffer for ispell.
* (ispell-print-if-debug): New function to print stuff to
`ispell-debug-buffer' if debugging is enabled.
* (ispell-region, ispell-process-line): Use `ispell-print-if-debug' to
show some debugging info.
* (ispell-buffer-with-debug): New function that creates a debugging
buffer and calls `ispell-buffer' with debugging enabled. This is also
en example of a possible way to use this system.
Dmitry Antipov [Tue, 6 Nov 2012 15:57:14 +0000 (19:57 +0400)]
* window.c (Fwindow_combination_limit): Revert to the only
required argument and adjust docstring as suggested in
http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
by Martin Rudalics <rudalics@gmx.at>.
Dmitry Antipov [Tue, 6 Nov 2012 06:27:20 +0000 (10:27 +0400)]
* window.c (quad): New function.
(Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
(Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
(Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
(Fwindow_line_height): Use it.
(Fwindow_fringes): Use list3.
(Fwindow_scroll_bars): Use list4.
(Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
(Fwindow_combination_limit): Allow zero number of arguments.
Eli Zaretskii [Mon, 5 Nov 2012 16:30:45 +0000 (18:30 +0200)]
Fix bug #12805 with compilation error in the cygw32 build.
src/makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
src/w32fns.c Include unistd.h, to avoid compiler warnings on Cygwin.
(emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
file descriptor 2 for standard error.
Paul Eggert [Mon, 5 Nov 2012 01:59:00 +0000 (17:59 -0800)]
Simplify by assuming __fpending.
Now that Emacs is using the gnulib fpending module,
there's no need for Emacs to have a separate implementation.
* configure.ac (stdio_ext.h, __fpending): Remove now-duplicate checks.
(PENDING_OUTPUT_COUNT, DISPNEW_NEEDS_STDIO_EXT): Remove.
* admin/CPP-DEFINES (PENDING_OUTPUT_COUNT): Remove.
* src/dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
(update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
Do not assume that __fpending's result fits in int.
Paul Eggert [Sun, 4 Nov 2012 22:33:00 +0000 (14:33 -0800)]
Remove EMACS_OUTQSIZE+sleep hack.
* dispnew.c (update_frame_1): Remove hack for terminals slower
than 2400 bps, which throttled Emacs by having it sleep. This
code hasn't worked since at least 2007, when the multi-tty stuff
was added, and anyway those old terminals are long dead.
* systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
without the dispnew.c change, as dispnew.c doesn't include systty.h.
Paul Eggert [Sun, 4 Nov 2012 17:29:52 +0000 (09:29 -0800)]
Fix data-loss with --version.
* emacs.c (close_output_streams): Use strerror, not emacs_strerror,
as we can't assume that emacs_strerror is initialized, and strerror
is good enough here.
(main): Invoke atexit earlier, to catch earlier instances of
sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
Juri Linkov [Sun, 4 Nov 2012 03:24:00 +0000 (11:24 +0800)]
Don't bind same-window-* in isearch.el commands.
* isearch.el (isearch-help-for-help, isearch-describe-bindings)
(isearch-describe-key, isearch-describe-mode): Use a display
action instead of binding same-window-* variables.
Eli Zaretskii [Sat, 3 Nov 2012 20:43:29 +0000 (22:43 +0200)]
Fix Windows build as fallout from 2012-11-03T18:54:17Z!eggert@cs.ucla.edu.
nt/config.nt (PENDING_OUTPUT_N_BYTES): Define.
lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/fpending.$(O) and
$(BLD)/close-stream.$(O).
($(BLD)/close-stream.$(O)):
($(BLD)/fpending.$(O)): New dependencies.
Paul Eggert [Sat, 3 Nov 2012 18:54:17 +0000 (11:54 -0700)]
Fix data-loss with --batch.
* admin/merge-gnulib (GNULIB_MODULES): Add close-stream.
* lib/close-stream.c, lib/close-stream.h, lib/fpending.c
* lib/fpending.h, m4/close-stream.m4, m4/fpending.m4:
New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* src/emacs.c: Include <close-stream.h>.
(close_output_streams): New function.
(main): Pass it to atexit, so that Emacs closes stdout and stderr
and handles errors appropriately.
(Fkill_emacs): Don't worry about flushing, as close_output_stream
does that now.
Paul Eggert [Sat, 3 Nov 2012 18:32:41 +0000 (11:32 -0700)]
Fix a race condition that causes Emacs to mess up glib.
The symptom is a diagnostic "GLib-WARNING **: In call to
g_spawn_sync(), exit status of a child process was requested but
SIGCHLD action was set to SIG_IGN and ECHILD was received by
waitpid(), so exit status can't be returned." The diagnostic
is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
The real bug is a race condition between Emacs and glib: Emacs
does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
so that glib can't find it. Work around the bug by invoking
waitpid only on subprocesses that Emacs itself creates.
* process.c (create_process, record_child_status_change):
Don't use special value -1 in pid field, as the caller now must
know the pid rather than having the callee infer it. The
inference was sometimes incorrect anyway, due to another race.
(create_process): Set new 'alive' member if child is created.
(process_status_retrieved): New function.
(record_child_status_change): Use it.
Accept negative 1st argument, which means to wait for the
processes that Emacs already knows about. Move special-case code
for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
processes that have already been waited for, by testing and
clearing new 'alive' member.
(CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
now does this internally.
(handle_child_signal): Let record_child_status_change do all
the work, since we do not want to reap all exited child processes,
only the child processes that Emacs itself created.
* process.h (Lisp_Process): New boolean member 'alive'.
Paul Eggert [Sat, 3 Nov 2012 18:19:50 +0000 (11:19 -0700)]
Omit duplicate definitions no longer needed with gcc -g3.
* lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
(VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
Define only as macros. There's no longer any need to also define
these symbols as enums or as constants, since we now assume
gcc -g3 when debugging.
Glenn Morris [Sat, 3 Nov 2012 17:56:30 +0000 (10:56 -0700)]
Further edits for doc/misc/cl.texi
* cl.texi: Further general copyedits.
(List Functions): Remove copy-tree, standard elisp for some time.
(Efficiency Concerns): Comment out examples that no longer apply.
(Compiler Optimizations): Rename from "Optimizing Compiler"; reword.
Eli Zaretskii [Sat, 3 Nov 2012 13:58:33 +0000 (15:58 +0200)]
Adapt MSDOS port to latest changes.
config.bat: Copy lib/execinfo.in.h to lib/execinfo.in-h if needed.
msdos/sedlibmk.inp: Sync with changes in lib/Makefile.in.
(HAVE_DECL_ENVIRON, GNULIB_ENVIRON): Edit to require declaration
through lib/unistd.h.
msdos/sed1v2.inp: Sync with changes in src/Makefile.in.
msdos/sed2v2.inp: Sync with changes in src/config.in.
src/lisp.mk: Adjust comments to the fact that term/internal is now
loaded from loadup.el.
src/msdos.c (msdos_abort): Rename from emacs_abort, and make static.
(msdos_fatal_signal): New function.
(XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
its argument list.
src/conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
for GCC versions before 4.
(emacs_raise): Define to call msdos_fatal_signal.
lisp/term/pc-win.el: Don't load term/internal from here.
lisp/loadup.el: Load term/internal from here.
Jan Djärv [Sat, 3 Nov 2012 11:33:28 +0000 (12:33 +0100)]
Backport from trunk.
* widget.c (resize_cb): New function.
(EmacsFrameRealize): Add resize_cb as event handler.
(EmacsFrameResize): Check if all is up to date before changing frame
size.
Chong Yidong [Sat, 3 Nov 2012 11:02:43 +0000 (19:02 +0800)]
Clarify documentation about escape sequences in strings.
* objects.texi (General Escape Syntax): Clarify the explanation of
escape sequences.
(Non-ASCII in Strings): Clarify when a string is unibyte vs
multibyte. Hex escapes do not automatically make a string multibyte.
Dmitry Antipov [Sat, 3 Nov 2012 05:59:17 +0000 (09:59 +0400)]
* frame.h (struct frame): Drop can_have_scroll_bars member
which is meaningless for a long time. Adjust comments.
(FRAME_CAN_HAVE_SCROLL_BARS): Remove.
* frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
Dmitry Antipov [Sat, 3 Nov 2012 05:11:34 +0000 (09:11 +0400)]
* window.c (decode_next_window_args): Update window arg after
calling decode_live_window and so fix crash reported at
http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
by Juanma Barranquero <lekktu@gmail.com>.
(Fwindow_body_width, Fwindow_body_height): Simplify a bit.
* font.c (Ffont_at): Likewise.
Glenn Morris [Sat, 3 Nov 2012 01:19:40 +0000 (21:19 -0400)]
* doc/misc/cl.texi: Further general copyedits.
Eg, no longer distinguish between "the optimizing compiler" and "the
non-optimizing compiler" like they were different entities.
Gnus developers [Fri, 2 Nov 2012 23:37:02 +0000 (23:37 +0000)]
Merge changes made in Gnus master
2012-10-05 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus.texi (Mail Source Specifiers):
Document :leave keyword used for pop mail source.
2012-10-25 Tassilo Horn <tsdh@gnu.org>
* gnus-dired.el (gnus-dired-attach): Attach to last used message buffer
by default. Patch provided by Stephen Eglen.
2012-10-05 Katsumi Yamaoka <yamaoka@jpl.org>
New UIDL implementation.
* mail-source.el (mail-sources, mail-source-keyword-map):
Add :leave as a pop3 keyword.
(mail-source-fetch-pop): Bind pop3-leave-mail-on-server.
* pop3.el (pop3-leave-mail-on-server): Allow number.
(pop3-uidl-file, pop3-uidl-file-backup): New user options.
(pop3-movemail): Add UIDL support.
(pop3-send-streaming-command): Take a list of mail numbers instead of
the number of mails.
(pop3-write-to-file): Add X-UIDL header.
(pop3-uidl-stat, pop3-uidl-dele, pop3-uidl-load, pop3-uidl-save)
(pop3-uidl-add-xheader): New functions.
* message.el (message-ignored-resent-headers):
Add X-Content-Length and X-UIDL headers.
Jan Djärv [Thu, 1 Nov 2012 22:44:53 +0000 (23:44 +0100)]
* widget.c (resize_cb): New function.
(EmacsFrameRealize): Add resize_cb as event handler.
(EmacsFrameResize): Check if all is up to date before changing frame
size.
Eli Zaretskii [Fri, 2 Nov 2012 14:00:45 +0000 (16:00 +0200)]
Implement backtrace output for fatal errors on MS-Windows.
src/w32fns.c (CaptureStackBackTrace_proc): New typedef.
(BACKTRACE_LIMIT_MAX): New macro.
(w32_backtrace): New function.
(emacs_abort): Use w32_backtrace when the user chooses not to
attach a debugger. Update the text of the abort dialog.
Dmitry Antipov [Fri, 2 Nov 2012 09:44:08 +0000 (13:44 +0400)]
Remove pad from struct input_event.
* termhooks.h (struct input_event): Remove padding field.
Adjust comment.
* keyboard.c (event_to_kboard): Simplify because frame_or_window
member is never cons for a long time. Adjust comment.
(mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
* xterm.c (handle_one_xevent): Do not initialize frame_or_window
field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
Glenn Morris [Thu, 1 Nov 2012 07:16:32 +0000 (00:16 -0700)]
More edits for cl.texi
* doc/misc/cl.texi: More copyedits, plus:
(Time of Evaluation, Iteration): Add xref to Emacs Lisp manual.
(Macro Bindings, Blocks and Exits): Acknowledge existence of lexical-binding.
(Iteration): Mainly defer to doc of standard dolist, dotimes.
Paul Eggert [Wed, 31 Oct 2012 17:27:29 +0000 (10:27 -0700)]
Fix crash when using Emacs as commit editor for git.
* callproc.c (setpgrp): Remove macro, as we now use setpgid
and it is configured in conf_post.h.
(Fcall_process): Don't invoke both setsid and setpgid; the former
is enough, if it exists.
* callproc.c (Fcall_process, child_setup):
* process.c (create_process): Use setpgid.
* conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
for the real thing.
* dispnew.c (init_display): Initialize the foreground group
if we are running a tty display.
* emacs.c (main): Do not worry about setpgrp; init_display does it now.
* lisp.h (init_foreground_group): New decl.
* sysdep.c (inherited_pgroup): New static var.
(init_foreground_group, tcsetpgrp_without_stopping)
(narrow_foreground_group, widen_foreground_group): New functions.
(init_sys_modes): Narrow foreground group.
(reset_sys_modes): Widen foreground group.
Martin Rudalics [Wed, 31 Oct 2012 10:02:51 +0000 (11:02 +0100)]
Install fixes for Bug#12764 and Bug#12766.
* window.el (quit-restore-window): If the window has been
created on an existing frame and ended up as the sole window on
that frame, do not delete it (Bug#12764).
* minibuf.c (read_minibuf): Restore current buffer since
choose_minibuf_frame calling Fset_frame_selected_window may
change it (Bug#12766).
Glenn Morris [Wed, 31 Oct 2012 07:25:18 +0000 (00:25 -0700)]
Document cl-flet and cl-labels in doc/misc/cl.texi
* doc/misc/cl.texi (Function Bindings): Update for cl-flet and cl-labels.
(Obsolete Lexical Binding): Rename section from "Lexical Bindings".
(Obsolete Macros): Rename section from "Obsolete Lexical Macros".
Reword, and add details of flet and labels.