Eli Zaretskii [Tue, 26 Jun 2012 16:57:54 +0000 (19:57 +0300)]
Fix parallel bootstrap on MS-Windows in lib/ and lisp/.
lib/makefile.w32-in ($(GNULIBOBJS)): Depend on stamp_BLD. This
replaces separate dependency for each object file, which required
the same object file to be mentioned twice, causing failures in
parallel builds.
lisp/makefile.w32-in (compile, compile-always): Depend on
update-subdirs, not on subdirs.el. Otherwise, several different
sub-targets of 'bootstrap' running in parallel could
simultaneously write to subdirs.el, producing a garbled file.
Sam Steingold [Tue, 26 Jun 2012 16:23:01 +0000 (12:23 -0400)]
* lisp/files.el (file-name-base): New convenience function.
* lisp/autoinsert.el, lisp/cus-dep.el, lisp/doc-view.el, lisp/image-dired.el,
* lisp/woman.el, lisp/eshell/esh-cmd.el, lisp/progmodes/ada-xref.el,
* lisp/progmodes/cc-defs.el, lisp/progmodes/cperl-mode.el,
* lisp/progmodes/flymake.el, lisp/progmodes/gud.el, lisp/progmodes/idlwave.el,
* lisp/textmodes/ispell.el, lisp/textmodes/reftex-ref.el,
* lisp/textmodes/tex-mode.el: Use it.
Did not touch cedet and org because they are maintained elsewhere.
Martin Rudalics [Tue, 26 Jun 2012 07:13:40 +0000 (09:13 +0200)]
In calendar-exit don't try to delete or iconify last frame.
* calendar/calendar.el (calendar-exit): Don't try to delete or
iconify last frame. See:
http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00372.html
Dmitry Antipov [Tue, 26 Jun 2012 05:00:30 +0000 (09:00 +0400)]
* src/alloc.c: Remove build_string.
* src/lisp.h: Define build_string as static inline. This provides
a better opportunity to optimize away calls to strlen when the
function is called with compile-time constant argument.
* src/image.c (imagemagick_error): Convert to build_string.
* src/w32proc.c (sys_spawnve): Likewise.
* src/xterm.c (x_term_init): Likewise.
* admin/coccinelle/build_string.cocci: Semantic patch
to convert from make_string to build_string.
Paul Eggert [Tue, 26 Jun 2012 02:33:51 +0000 (19:33 -0700)]
Use sprintf return value instead of invoking strlen on result.
In the old days this wasn't portable, since some sprintf
implementations returned char *. But they died out years ago and
Emacs already assumes sprintf returns int.
Similarly for float_to_string.
This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
* ccl.c (ccl_driver):
* character.c (string_escape_byte8):
* data.c (Fnumber_to_string):
* doprnt.c (doprnt):
* print.c (print_object):
* xdisp.c (message_dolog):
* xfns.c (syms_of_xfns):
Use sprintf or float_to_string result to avoid need to call strlen.
* data.c (Fnumber_to_string):
Use make_unibyte_string, since the string must be ASCII.
* lisp.h, print.c (float_to_string): Now returns int length.
* term.c (produce_glyphless_glyph):
Use sprintf result rather than recomputing it.
Dmitry Antipov [Mon, 25 Jun 2012 14:07:04 +0000 (18:07 +0400)]
* configure.in (AC_CHECK_FUNCS): Detect library functions
strcasecmp and strncasecmp.
* lib-src/etags.c (etags_strcasecmp, etags_strncasecmp): Define to
library functions strcasecmp and strncasecmp if available.
* lwlib/lwlib.c (my_strcasecmp): Rename to lwlib_strcasecmp, which
may be defined to library function strcasecmp if available.
* src/dispextern.c (xstrcasecmp): Define to library function
strcasecmp if available.
* src/xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
Eli Zaretskii [Sun, 24 Jun 2012 17:21:20 +0000 (20:21 +0300)]
Improve port of struct timespec to MS-Windows.
lib/makefile.w32-in ($(BLD)/dtotimespec.$(O)):
($(BLD)/timespec-add.$(O)):
($(BLD)/timespec-sub.$(O)): Don't depend on
$(EMACS_ROOT)/nt/inc/sys/time.h.
lib/stat-time.h:
lib/timespec.h:
lib/utimens.h: Revert last change.
src/makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
(SYSTIME_H): Add nt/inc/sys/time.h.
src/systime.h [WINDOWSNT]: Include sys/time.h.
src/s/ms-w32.h (struct timespec): Definition moved from
nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
nt/inc/sys/time.h (struct timespec): Don't define it here, it is
now defined in src/s/ms-w32.h.
Dmitry Antipov [Sun, 24 Jun 2012 16:18:41 +0000 (20:18 +0400)]
First Coccinelle semantic patch.
* coccinelle: New subdirectory
* coccinelle/README: Documentation stub.
* coccinelle/vector_contents.cocci: Semantic patch to replace direct
access to `contents' member of Lisp_Vector objects with AREF and ASET
where appropriate.
Paul Eggert [Sun, 24 Jun 2012 04:11:19 +0000 (21:11 -0700)]
Fix bug when time_t is unsigned and as wide as intmax_t.
* lisp.h (WAIT_READING_MAX): New macro.
* dispnew.c (Fsleep_for, sit_for):
* keyboard.c (kbd_buffer_get_event):
* process.c (Faccept_process_output):
Use it to avoid bogus compiler warnings with obsolescent GCC versions.
This improves on the previous patch, which introduced a bug
when time_t is unsigned and as wide as intmax_t.
See <http://bugs.gnu.org/9000#51>.
Eli Zaretskii [Sat, 23 Jun 2012 19:40:50 +0000 (22:40 +0300)]
Avoid compiler warnings in comparing time_t.
src/dispnew.c (sit_for, Fsleep_for):
src/keyboard.c (kbd_buffer_get_event):
src/process.c (Faccept_process_output): Avoid compiler warnings when
comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
Paul Eggert [Sat, 23 Jun 2012 16:44:45 +0000 (09:44 -0700)]
* sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
Privately reported by Herbert J. Skuhra.
(make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
All uses changed.
(system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
not make_lisp_timeval, when the argument is of type EMACS_TIME.
Stefan Monnier [Sat, 23 Jun 2012 15:38:23 +0000 (11:38 -0400)]
Miscellaneous minor cleanups and simplifications.
* lisp/help-fns.el (describe-variable): Don't croak when doc is not found.
* lisp/vc/pcvs.el (cvs-retrieve-revision): Avoid toggle-read-only.
* lisp/menu-bar.el (menu-bar-line-wrapping-menu): Purecopy a tiny bit more.
* lisp/emacs-lisp/syntax.el (syntax-ppss): Simplify with new `if' place.
* lisp/emacs-lisp/smie.el (smie-next-sexp): CSE.
* lisp/emacs-lisp/macroexp.el (macroexp-let2): Fix edebug spec and avoid
((lambda ..) ..).
* lisp/emacs-lisp/eieio.el (eieio-oref, slot-value): Use simpler defsetf.
Chong Yidong [Sat, 23 Jun 2012 13:27:40 +0000 (21:27 +0800)]
Fixes for Info link-following mouse commands.
* lisp/info.el (Info-mouse-follow-link): Accept symbol values of the
link-args property. Select the window.
(Info-fontify-node): Use Info-link-keymap for all navigation
buttons, with link-args property to perform the desired action.
(Info-link-keymap): Doc fix.
(Info-next-link-keymap, Info-prev-link-keymap)
(Info-up-link-keymap): Delete now-unused keymaps.
Eli Zaretskii [Sat, 23 Jun 2012 12:39:23 +0000 (15:39 +0300)]
Improve and document the language-change event on MS-Windows.
src/keyboard.c (kbd_buffer_get_event): Include the codepage and the
language ID in the event parameters.
src/w32term.c (w32_read_socket): Put the new keyboard codepage into
event.code, not the obscure "character set ID".
doc/lispref/commands.texi (Misc Events): Document the language-change event.
Eli Zaretskii [Sat, 23 Jun 2012 09:46:33 +0000 (12:46 +0300)]
Really fix bug #11519, by fixing the last change in ralloc.c.
src/ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
in the logic of incrementing and decrementing the value of
use_relocatable_buffers.
Privately reported by Herbert J. Skuhra.
[__FreeBSD__]: Remove "*/" typo after "#include".
(timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
(TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
(TIMEVAL, system_process_attributes) [__FreeBSD__]:
Don't assume EMACS_TIME and struct timeval are the same type.
Stefan Monnier [Fri, 22 Jun 2012 21:24:54 +0000 (17:24 -0400)]
Further GV/CL cleanups.
* lisp/emacs-lisp/gv.el (gv-get): Autoload functions to find their
gv-expander.
(gv--defun-declaration): New function.
(defun-declarations-alist): Use it.
(gv-define-modify-macro, gv-pushnew!, gv-inc!, gv-dec!): Remove.
(gv-place): Autoload.
* lisp/emacs-lisp/cl.el (cl--dotimes, cl--dolist): Remember subr.el's
original definition of dotimes and dolist.
* lisp/emacs-lisp/cl-macs.el (cl-expr-access-order): Remove unused.
(cl-dolist, cl-dotimes): Use `dolist' and `dotimes'.
* lisp/emacs-lisp/cl-lib.el: Move gv handlers from cl-macs to here.
(cl-fifth, cl-sixth, cl-seventh, cl-eighth)
(cl-ninth, cl-tenth): Move gv handler to the function's definition.
* lisp/emacs-lisp/cl-extra.el (cl-subseq, cl-get, cl-getf): Move gv handler
to the function's definition.
* lisp/Makefile.in (COMPILE_FIRST): Re-order to speed it up by about 50%.
* lisp/window.el:
* lisp/files.el:
* lisp/faces.el:
* lisp/env.el: Don't use CL.
Stefan Monnier [Fri, 22 Jun 2012 17:37:28 +0000 (13:37 -0400)]
* lisp/icomplete.el (icomplete-minibuffer-setup, icomplete-completions):
Move the non-essential binding to the post/pre-command-hook where it is
more obviously correct.
Stefan Monnier [Fri, 22 Jun 2012 17:30:25 +0000 (13:30 -0400)]
* lisp/subr.el (read-passwd): Don't use a history at all.
* lisp/savehist.el (savehist-save): Remove password saved accidentally
because of the above bug.
Glenn Morris [Fri, 22 Jun 2012 07:38:26 +0000 (00:38 -0700)]
Further speed up rpm completion, by caching the installed packages
* lisp/pcmpl-rpm.el (pcmpl-rpm-cache): New option.
(pcmpl-rpm-cache-stamp-file): New constant.
(pcmpl-rpm-cache-time, pcmpl-rpm-packages): New variables.
(pcmpl-rpm-packages): Optionally cache list of packages.
Glenn Morris [Fri, 22 Jun 2012 07:01:32 +0000 (00:01 -0700)]
Try to speed up pcomplete's calling of rpm -qa
Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-04/msg00174.html
* lisp/pcmpl-rpm.el (pcmpl-rpm): New group.
(pcmpl-rpm-query-options): New option.
(pcmpl-rpm-packages): No need to inline it. Use pcmpl-rpm-query-options.
Eli Zaretskii [Fri, 22 Jun 2012 06:51:06 +0000 (09:51 +0300)]
Enlarge NSTATICS to 0x650.
src/alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
staticidx goes up to 1597 out of 1600 = 0x640.)
Chong Yidong [Wed, 20 Jun 2012 08:34:21 +0000 (16:34 +0800)]
Fixes to window size calculations in term.el.
* term.el (term-window-width): Handle the case of a missing right
fringe.
(term-check-size): Use window-text-height.
(term-mode): Use define-derived-mode. Minor cleanups.
Dmitry Antipov [Tue, 19 Jun 2012 16:56:28 +0000 (20:56 +0400)]
* alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
* font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
* print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
access to `contents' member of Lisp_Vector objects with AREF and ASET
where appropriate.
Kevin Gallagher [Tue, 19 Jun 2012 07:05:44 +0000 (15:05 +0800)]
In EDT emulator, allow updating of menu-bar Buffers menu.
* lisp/emulation/edt.el (edt-default-menu-bar-update-buffers)
(edt-user-menu-bar-update-buffers): New functions.
(edt-default-emulation-setup, edt-user-emulation-setup): Use them.
Chong Yidong [Tue, 19 Jun 2012 06:49:50 +0000 (14:49 +0800)]
Preserve tty top-frames under various window-changing operations.
* subr.el (with-selected-window): Preserve the selected window's
terminal's top-frame.
* window.el (save-selected-window): Likewise.
* frame.c (delete_frame): When selecting a frame on a different
text terminal, do not alter the terminal's top-frame.
* term.c (Ftty_top_frame): New function.
* xdisp.c (format_mode_line_unwind_data): Record the target
frame's selected window and its terminal's top-frame.
(unwind_format_mode_line): Restore them.
(x_consider_frame_title, display_mode_line, Fformat_mode_line):
Callers changed.
(x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
since tty frames can be explicitly named.
(prepare_menu_bars): Likewise.
Stefan Monnier [Mon, 18 Jun 2012 15:57:41 +0000 (11:57 -0400)]
Fix return value of `defun' and un-define it.
* src/data.c (Fdefalias): Return `symbol'.
* doc/lispref/functions.texi (Defining Functions):
* doc/lispref/macros.texi (Defining Macros): Un-define the return value of
`defun', `defmacro' and `defalias'.