* unexcw.c (fixup_executable): use posix_fallocate to ensure that
the dumped Emacs is not a sparse file, greatly improving Cygwin
"make bootstrap" performance.
Jonas Bernoulli [Wed, 12 Dec 2012 02:16:05 +0000 (21:16 -0500)]
* lisp/emacs-lisp/eieio.el: Prettier object pretty-printing.
(eieio-override-prin1): Don't quote kewords and booleans.
(object-write) <eieio-default-superclass>: Don't put closing parens
on new line, avoid needless empty lines, align values that are objects
with the slot keyword (instead of beginning on the same line).
(eieio-list-prin1): Align value with slot keyword; increase
eieio-print-depth before printing members of the list.
Stefan Monnier [Tue, 11 Dec 2012 18:52:31 +0000 (13:52 -0500)]
* lisp/mail/emacsbug.el (report-emacs-bug): Move the intangible text to
a display text-property.
(report-emacs-bug-hook): Don't bother deleting it any more.
Stefan Monnier [Tue, 11 Dec 2012 18:51:27 +0000 (13:51 -0500)]
* lisp/hilit-chg.el (highlight-save-buffer-state): Delete.
Use with-silent-modifications instead.
(hilit-chg-set-face-on-change): Only fixup the text that's modified.
Stefan Monnier [Tue, 11 Dec 2012 18:49:25 +0000 (13:49 -0500)]
* lisp/button.el: Handle buttons in display text-properties.
(button--area-button-p, button--area-button-string):
Use (STRING . STRING-POS) representation instead of just STRING.
Paul Eggert [Tue, 11 Dec 2012 18:18:13 +0000 (10:18 -0800)]
Merge from gnulib for 'inline', incorporating:
2012-12-11 extern-inline: avoid incompatibility with Darwin Libc
* m4/extern-inline.m4: Update from gnulib.
Eli Zaretskii [Tue, 11 Dec 2012 12:22:35 +0000 (14:22 +0200)]
Fix part of bug #13011 with display of lines that have a box face.
src/xdisp.c (handle_face_prop): Fix logic of computing
it->start_of_box_run_p.
(append_space_for_newline): If the glyph row is R2L, reset the
iterator's end_of_box_run_p flag before prepending the space glyph.
(extend_face_to_end_of_line): If the glyph row is R2L, reset the
iterator's start_of_box_run_p flag before prepending the stretch.
(append_glyph, produce_image_glyph, append_composite_glyph)
(append_stretch_glyph, append_glyphless_glyph): Reverse the
left_box_line_p and right_box_line_p flags of the glyph for R2L
glyph rows.
Dmitry Antipov [Tue, 11 Dec 2012 09:51:12 +0000 (13:51 +0400)]
* buffer.c (Fset_buffer_multibyte): Do not force redisplay
if changed buffer is not shown in a window.
* insdel.c (prepare_to_modify_buffer): Likewise.
* window.c (replace_buffer_in_windows_safely): Do nothing
if buffer is not shown in a window.
(Fforce_window_update): Likewise if string or buffer argument
is passed.
Jay Belanger [Tue, 11 Dec 2012 02:29:21 +0000 (20:29 -0600)]
* lisp/calc/calc.el (calc-standard-date-formats): Add more date
formats.
* lisp/calc/calc-forms.el (math-parse-iso-date): New function.
(math-parse-date): Use `math-parse-iso-date' when appropriate.
(math-parse-iso-date-validate): Add extra error checking.
(calc-date-notation): Add ability to access new date formats.
Jambunathan K [Mon, 10 Dec 2012 18:33:59 +0000 (13:33 -0500)]
* lisp/hi-lock.el: Refine the choice of default face.
(hi-lock-keyword->face): New function. Use it wherever we used
cadadadr instead.
(hi-lock--regexps-at-point): Ignore faces that can't come from hi-lock.
(hi-lock--last-face): Remove var.
(hi-lock--unused-faces): New var to replace it.
(hi-lock-read-face-name): Use/maintain it.
(hi-lock-unface-buffer): Maintain it. Fix error for the C-u case.
(hi-lock-set-pattern): Ignore new rule if it has the same regexp even
if it has another face.
Dmitry Antipov [Mon, 10 Dec 2012 17:34:47 +0000 (21:34 +0400)]
Per-buffer window counters.
* buffer.h (struct buffer): New member window_count.
(buffer_window_count): New function.
* buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
Initialize window_count.
(Fkill_buffer): Verify window_count for the buffer being killed.
(modify_overlay): Do not force redisplay if buffer is not shown
in any window.
(init_buffer_once): Initialize window_count for buffer_defaults
and buffer_local_symbols.
* window.h (buffer_shared): Remove declaration.
(wset_buffer): Convert from inline ...
* window.c (wset_buffer): ... to an ordinary function.
(adjust_window_count): New function.
(make_parent_window): Use it.
* xdisp.c (buffer_shared): Remove.
(redisplay_internal, redisplay_window): Adjust users.
(buffer_shared_and_changed): Use per-buffer window counter.
Eli Zaretskii [Sun, 9 Dec 2012 21:32:12 +0000 (23:32 +0200)]
Parallelize byte compilation on MS-Windows.
lisp/makefile.w32-in (WINS_BASIC1, WINS_BASIC2, WINS_BASIC3)
(WINS_BASIC4): New variables, subdivide subdirectories into 4
parts.
(WINS_BASIC): Define as concatenation of the above.
(compile): Subdivide into 4 separate and independent jobs that can
be run in parallel.
(compile0-CMD, compile0-SH): New targets for compiling
COMPILE_FIRST files, which are prerequisites for the rest of the
byte-compilation.
(compile1-CMD, compile2-CMD, compile3-CMD, compile4-CMD): New
targets for parallel compilation with cmd.exe.
(compile1-SH, compile2-SH, compile3-SH, compile4-SH): Ditto for
compiling under a Unixy shell.
Paul Eggert [Sat, 8 Dec 2012 17:19:51 +0000 (09:19 -0800)]
Use putenv+unsetenv instead of modifying environ directly.
* admin/merge-gnulib (GNULIB_MODULES): Add putenv, unsetenv.
* lib/putenv.c, lib/unsetenv.c, m4/putenv.m4, m4/setenv.m4:
New files, copied automatically from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* src/alloc.c (xputenv): New function.
* src/dbusbind.c (Fdbus_init_bus):
* src/emacs.c (main):
* src/xterm.c (x_term_init):
Use xputenv instead of setenv or putenv, to detect memory exhaustion.
* src/editfns.c (initial_tz): Move static var decl up.
(tzvalbuf_in_environ): New static var.
(init_editfns): Initialize these two static vars.
(Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
Save old TZ value on stack, if it's small.
(Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
instead, use xputenv+unsetenv to set and restore TZ.
(environbuf): Remove static var. All uses removed.
(Fset_time_zone_rule): Do not save TZ and environ;
no longer needed here.
(set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
Move to inside set_time_zone_rule; they don't need file scope any more.
(set_time_zone_rule): Maintain the TZ=value string separately.
(syms_of_editfns): Don't initialize initial_tz;
init_editfns now does it.
* src/emacs.c (dump_tz) [HAVE_TZSET]: Now const.
* src/lisp.h (xputenv): New decl.
src/w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
DWORD_PTR, for compatibility with 64-bit builds.
src/w32.c (_PROCESS_MEMORY_COUNTERS_EX):
(GetProcessWorkingSetSize_Proc, get_process_working_set_size)
(system_process_attributes): Use SIZE_T rather than DWORD, for
compatibility with 64-bit builds.
Paul Eggert [Sat, 8 Dec 2012 06:56:26 +0000 (22:56 -0800)]
Simplify get_lim_data.
* admin/CPP-DEFINES (ULIMIT_BREAK_VALUE): Remove.
* configure.ac (ULIMIT_BREAK_VALUE): Remove.
* src/vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
Remove USG and vlimit methods; no longer used these days.
Add #error catchall just in case.
Paul Eggert [Sat, 8 Dec 2012 02:30:51 +0000 (18:30 -0800)]
Assume POSIX 1003.1-1988 or later for signal.h.
Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
* admin/CPP-DEFINES (SIGALRM, SIGCHLD, SIGHUP, SIGKILL, SIGPIPE, SIGQUIT):
Remove.
(SIGTRAP): Remove this one too, as config.h no longer defines it.
* admin/merge-gnulib (GNULIB_MODULES): Add sig2str.
* configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
Use SIGCHLD rather than SIGCLD.
* lib/sig2str.c, lib/sig2str.h, m4/sig2str.m4: New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/makefile.w32-in (GNULIBOBJS): Add $(BUILD)/sig2str.$(O).
* src/process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
(deleted_pid_list, Fdelete_process, create_process)
(record_child_status_change, handle_child_signal, deliver_child_signal)
(init_process_emacs, syms_of_process):
Assume SIGCHLD is defined.
(parse_signal): Remove. All uses removed.
(abbr_to_signal): New static function.
(Fsignal_process): Use it to convert signal names to ints.
* src/sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
kill (getpgrp (), ...).
(emacs_sigaction_init): Assume SIGCHLD is defined.
(init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
* src/syssignal.h (EMACS_KILLPG): Remove.
All uses replaced by 'kill' with a negative pid.
(SIGCHLD): Remove definition, as we now assume SIGCHLD.
* src/w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
Stefan Monnier [Fri, 7 Dec 2012 16:48:42 +0000 (11:48 -0500)]
* lisp/hi-lock.el (hi-lock-unface-buffer): If there's no matching regexp at
point, still provide some default.
(hi-lock--regexps-at-point): Don't enforce a "hi-lock-" prefix on face
names, since we don't use it right now. Actually return the list.
(hi-lock-file-patterns, hi-lock-interactive-patterns): Use defvar-local.
Eli Zaretskii [Fri, 7 Dec 2012 15:28:20 +0000 (17:28 +0200)]
Fix bug #13108 introduced by the fix to bug #12930.
src/indent.c (Fvertical_motion): If a display string will be
displayed on the left or the right margin, don't consider it as a
factor in cursor positioning.
Glenn Morris [Fri, 7 Dec 2012 08:59:14 +0000 (00:59 -0800)]
rmail-cease-edit fixes related to "^From " escaping
* mail/rmail.el (rmail-mime-decoded): New permanent local.
(rmail-show-message-1): Set rmail-mime-decoded when appropriate.
* mail/rmailedit.el (rmail-cease-edit): Respect rmail-mbox-format
and rmail-mime-decoded.
Dmitry Antipov [Fri, 7 Dec 2012 08:13:49 +0000 (12:13 +0400)]
* frame.c (make_frame): Do not set window's buffer to t.
* window.c (Fsplit_window_internal): Likewise. Previously it was
used to indicate that the window is being set up. Now we use
set_window_buffer for all new windows, so the condition in ...
(Fset_window_buffer): ... is always true and can be removed.
Dmitry Antipov [Fri, 7 Dec 2012 07:16:32 +0000 (11:16 +0400)]
Convenient macro to check whether the buffer is hidden.
* buffer.h (BUFFER_HIDDEN_P): New macro.
* frame.c (make_frame): Use it. Adjust comment.
* buffer.c (candidate_buffer): New function.
(Fother_buffer, other_buffer_safely): Use it.
Stefan Monnier [Thu, 6 Dec 2012 21:29:29 +0000 (16:29 -0500)]
Further cleanup of the "cl-" namespace. Fit CL in 80 columns.
* lisp/emacs-lisp/cl-macs.el (cl--pop2, cl--optimize-safety)
(cl--optimize-speed, cl--not-toplevel, cl--parse-loop-clause)
(cl--expand-do-loop, cl--proclaim-history, cl--declare-stack)
(cl--do-proclaim, cl--proclaims-deferred): Rename from the "cl-" prefix.
(cl-progv): Don't rely on dynamic scoping to find the body.
* lisp/emacs-lisp/cl-lib.el (cl--optimize-speed, cl--optimize-safety)
(cl--proclaims-deferred): Rename from the "cl-" prefix.
(cl-declaim): Use backquotes.
* lisp/emacs-lisp/cl-extra.el (cl-make-random-state, cl-random-state-p):
Use "cl--" prefix for the object's tag.
Stefan Monnier [Thu, 6 Dec 2012 20:16:38 +0000 (15:16 -0500)]
* lisp/ses.el: Use advice-add/remove.
(ses--advice-copy-region-as-kill, ses--advice-yank): New functions.
(copy-region-as-kill, yank): Use advice-add.
(ses-unload-function): Use advice-remove.
Jonas Bernoulli [Thu, 6 Dec 2012 20:10:36 +0000 (15:10 -0500)]
* lisp/button.el: Make them work in header-lines.
(button-map): Add bindings for header-line and mode-line use.
(button-get, button-put, button-label): `button' may now be a string.
(button-activate): Don't make it a defsubst.
(button--area-button-p, button--area-button-string): New functions.
(make-text-button): Fix the return value when `beg' was a string.
(push-button): Handle the mode-line case.
Eli Zaretskii [Thu, 6 Dec 2012 18:36:22 +0000 (20:36 +0200)]
Avoid busy-waiting for child processes on Windows. (Bug#13086)
src/w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
if the child process is still running. Instead, exit the wait
loop and return zero.
Stefan Monnier [Thu, 6 Dec 2012 17:29:30 +0000 (12:29 -0500)]
* lisp/progmodes/sql.el: Use cl-lib and lexical-binding; various cleanup.
(sql-signum): Remove. Use `cl-signum' instead.
(sql-read-passwd): Remove; use read-passwd instread.
(sql-get-login-ext): Use read-string.
(sql-get-login): Use dolist and pcase.
(sql--completion-table): Rename from sql-try-completion.
Use complete-with-action.
(sql-mode): Don't change abbrev-all-caps globally.
(sql-connect): Don't rely on dynamic scoping for `new-name'.
(sql-postgres-completion-object): Initialize vars in their `let'.
(sql-comint-sybase, sql-comint-sqlite, sql-comint-mysql)
(sql-comint-solid, sql-comint-ms, sql-comint-postgres)
(sql-comint-interbase): Use a single append, without setq.
(sql-comint-linter): Same, and unwind-protect the LINTER_MBX var.
Stefan Monnier [Thu, 6 Dec 2012 16:17:11 +0000 (11:17 -0500)]
* lisp/hi-lock.el: Rework the default face and the serialize regexp code.
(hi-lock--auto-select-face-defaults): Remove.
(hi-lock-string-serialize-serial): Remove.
(hi-lock--hashcons-hash): Rename from hi-lock-string-serialize-hash;
make weak.
(hi-lock--hashcons): Rename from hi-lock-string-serialize, return an
equal string.
(hi-lock-set-pattern): Adjust accordingly.
(hi-lock--regexps-at-point): Simplify accordingly.
(hi-lock--auto-select-face-defaults): Remove.
(hi-lock--last-face): New var to replace it.
(hi-lock-read-face-name): Rewrite.
(hi-lock-unface-buffer): Arrange for the face to be the next default.
Paul Eggert [Thu, 6 Dec 2012 07:31:58 +0000 (23:31 -0800)]
Fix a recently-introduced delete-process race condition.
* callproc.c, process.h (record_kill_process):
New function, containing part of the old call_process_kill.
(call_process_kill): Use it.
This does not change call_process_kill's behavior.
* process.c (Fdelete_process): Use record_kill_process to fix a
race condition that could cause Emacs to lose track of a child.
Dmitry Antipov [Thu, 6 Dec 2012 06:23:51 +0000 (10:23 +0400)]
Avoid code duplication between prev_frame and next_frame.
* frame.c (candidate_frame): New function. Add comment.
(prev_frame, next_frame): Use it. Adjust comment.