Paul Eggert [Sun, 29 Jul 2012 08:18:29 +0000 (01:18 -0700)]
Don't use the abbreviation "win" to refer to Windows (Bug#10421).
* lisp/org/ob-lilypond.el (ly-w32-ly-path): Rename from ly-win32-ly-path.
(ly-w32-pdf-path): Rename from ly-win32-pdf-path.
(ly-w32-midi-path): Rename from ly-win32-midi-path.
(ly-determine-ly-path, ly-determine-pdf-path, ly-determine-midi-path):
Check for "windows-nt", not "win32", in system-type.
* src/regex.c (MAX_BUF_SIZE): Remove some incorrect and
long-ago-commented-out code that talks about "WIN32".
* src/w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
All uses changed.
* NEWS: Document these changes.
* leim/quail/uni-input.el (ucs-input-deactivate):
Rename from ucs-input-inactivate.
* leim/quail/hangul.el (hangul-input-method-deactivate):
Rename from hangul-input-method-inactivate.
* emulation/viper-init.el (viper-deactivate-input-method-action):
Rename from viper-inactivate-input-method-action.
(viper-deactivate-input-method):
Rename from viper-inactivate-input-method.
* lisp/follow.el (follow-inactive-menu): Rename from follow-deactive-menu.
* lisp/international/mule-cmds.el (deactivate-input-method):
Rename from inactivate-input-method.
Also run input-method-deactivate-hook.
(deactivate-current-input-method-function):
Rename from inactivate-current-input-method-function.
(input-method-deactivate-hook): New hook.
(input-method-inactivate-hook): Mark obsolete.
* lisp/international/quail.el (quail-activate):
Also run quail-deactivate-hook.
(quail-deactivate): Rename from quail-inactivate.
* lisp/international/robin.el (robin-activate):
Also run robin-deactivate-hook.
(robin-deactivate): Rename from robin-inactivate.
Deactivate the mark on more copy operations, and indicate the copied region.
* lisp/simple.el (indicate-copied-region): New function.
(kill-ring-save): Split off from here.
* lisp/rect.el (copy-rectangle-as-kill): Call indicate-copied-region.
(kill-rectangle): Set deactivate-mark to t on read-only error.
* lisp/register.el (copy-to-register, copy-rectangle-to-register):
Deactivate the mark, and use indicate-copied-region.
(append-to-register, prepend-to-register): Call
Paul Eggert [Sat, 28 Jul 2012 23:05:32 +0000 (16:05 -0700)]
Use Gnulib stdalign and environ modules (Bug#9772, Bug#9960).
* .bzrignore: Add lib/stdalign.h.
* config.bat: Do not set NO_DECL_ALIGN; no longer needed.
Copy lib/stdalign.in.h to lib/stdalign.in-h as needed.
* configure.ac (HAVE_ATTRIBUTE_ALIGNED): Remove the code that
fiddles with this, as gnulib now does this for us.
* admin/merge-gnulib: Add environ, stdalign.
* m4/environ.m4: New file, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/stdalign.in.h, m4/stdalign.m4: New files, from gnulib.
* sed2v2.inp (HAVE_ATTRIBUTE_ALIGNED): Remove edit.
* sedlibmk.inp (STDALIGN_H, @GL_GENERATE_STDALIGN_H_TRUE@)
(GL_GENERATE_STDALIGN_H_FALSE): New edits.
* nt/config.nt (HAVE_ATTRIBUTE_ALIGNED): Remove.
* src/alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
Simplify by using alignof.
(pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
* src/lisp.h: Include <stdalign.h>.
(GCALIGNMENT): New macro and constant.
(DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
(USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
(stdalign): New macro, if not already defined.
Eli Zaretskii [Sat, 28 Jul 2012 16:57:57 +0000 (19:57 +0300)]
Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
src/w32inevt.c: Include w32inevt.h.
(w32_read_console_input): New inline function, calls either
ReadConsoleInputA or ReadConsoleInputW, depending on the value of
w32_console_unicode_input.
(fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
(w32_kbd_patch_key, key_event): Use the codepage returned by
GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
(key_event): use uChar.UnicodeChar only if
w32_console_unicode_input is non-zero.
src/w32console.c: Include w32heap.h.
<w32_console_unicode_input>: New global variable.
(initialize_w32_display): Set w32_console_unicode_input to 1 on NT
family of Windows, zero otherwise.
src/w32inevt.h: Declare w32_console_unicode_input.
lisp/international/mule-cmds.el (set-locale-environment): In a
console session on MS-Windows, set up keyboard and terminal
encoding from the OEM codepage, not the ANSI codepage.
David Engster [Sat, 28 Jul 2012 11:07:17 +0000 (13:07 +0200)]
Fix various issues with url-dav package (Bug#11916).
* url-dav.el (url-dav-supported-p): Added doc-string and remove
check for feature `xml' and function `xml-expand-namespace' which
never existed in Emacs proper.
(url-dav-process-response): Remove all indentation and newlines
from XML before parsing. Change call to `xml-parse-region' to do
namespace expansion with simple qualified names (Bug#11916).
(url-dav-request): Add autoload.
(url-dav-directory-files): Properly deal with empty directories.
Unhex URL before generating relative URLs.
(url-dav-file-directory-p): Fix check for 'DAV:collection.
David Engster [Sat, 28 Jul 2012 09:19:53 +0000 (11:19 +0200)]
Maybe return expanded XML qnames as plain symbols (Bug#11916).
* xml.el (xml-node-name, xml-parse-file, xml-parse-region):
Explanation of new 'symbol-qnames feature in doc-strings.
(xml-maybe-do-ns): Return expanded names as plain symbols if
'symbol-qnames was provided in XML-NS argument (Bug#11916).
(xml-parse-tag-1): Deal with new definition of PARSE-NS argument.
Paul Eggert [Fri, 27 Jul 2012 20:50:02 +0000 (13:50 -0700)]
Adjust GDB to reflect pvec_type changes.
* .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
2012-07-04 changes to pseudovector representation. Problem
reported by Eli Zaretskii in <http://bugs.gnu.org/1995-05-30T23:07:27Z!kwzh@gnu.org#30>.
* lisp/progmodes/python.el (python-mode-map): Added keybinding for
run-python.
(python-shell-make-comint): Fix pop-to-buffer call.
(run-python): Autoload. New arg SHOW.
(python-shell-get-or-create-process): Do not pop python process
buffer.
Michael Albinus [Fri, 27 Jul 2012 10:56:03 +0000 (12:56 +0200)]
* notifications.el (notifications-on-action-signal)
(notifications-on-closed-signal): Use also the bus address for the map.
(notifications-notify, notifications-close-notification)
(notifications-get-capabilities): Add optional argument BUS.
Eli Zaretskii [Fri, 27 Jul 2012 09:24:34 +0000 (12:24 +0300)]
Fix failure to compile on Windows due to 2012-07-27T06:04:35Z!dmantipov@yandex.ru.
src/lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
enumeration constants, as PURE and HEAP are too general, and clash
with other headers and sources, such as gmalloc.c and the
MS-Windows system headers. All users changed.
* textmodes/reftex-vars.el (reftex-label-alist-builtin): Add
support for the lstlisting and minted environments, and for the
ctable macro.
* textmodes/reftex.el (reftex-compile-variables): Also recognize
labels written in keyvals syntax.
Revert last save_excursion_save and save_excursion_restore changes.
* alloc.c, editfns.c, marker.c, lisp.h: Revert.
Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
Fix recently-introduced typos in Windows port.
Reported by Martin Rudalics <rudalics@gmx.at>.
* w32.c (init_environment): Replace comma with semicolon.
* w32fns.c (syms_of_w32fns): Likewise.
Paul Eggert [Fri, 27 Jul 2012 06:18:36 +0000 (23:18 -0700)]
Improve GDB symbol export.
* .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
arms of an 'if', not using conditional expressions; otherwise GDB
complains about the types in the unevaluated arm when the argument
is an integer literal.
(xgetint): Simplify expression.
* alloc.c (gdb_make_enums_visible): New constant. This ports to
GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
Zaretskii in <http://bugs.gnu.org/1995-05-30T23:07:27Z!kwzh@gnu.org#13>.
* lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
needed now that we have gdb_make_enums_visible.
(enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
(enum enum_USE_LSB_TAG):
New enum types, packaging up enums that need to be exported to GDB.
Fast save_excursion_save and save_excursion_restore.
* lisp.h (struct Lisp_Excursion): New data type.
(PVEC_EXCURSION): New pseudovector type.
(XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
to deal with it. Adjust comments.
(init_marker, attach_marker): New prototype.
(unchain_marker): Adjust prototype.
* marker.c (attach_marker): Change to global.
(init_marker): New function.
* alloc.c (Fmake_marker, build_marker): Use it.
(build_marker): More easserts.
(mark_object): Handle struct Lisp_Excursion.
* editfns.c (save_excursion_save, save_excursion_restore):
Reimplement to use struct Lisp_Excursion. Add comments.
Paul Eggert [Thu, 26 Jul 2012 18:35:50 +0000 (11:35 -0700)]
Fix export of symbols to GDB.
* alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
(ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
emacs.c, as this is a more-suitable home. Had this been done earlier
the fix for 1995-05-30T23:07:27Z!kwzh@gnu.org would have avoided some of the problems noted in
<http://bugs.gnu.org/1995-05-30T23:07:27Z!kwzh@gnu.org#13> by Eli Zaretskii, as the scope problems
would have been more obvious.
* emacs.c (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
(gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
(CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
Remove; now done in lisp.h.
* lisp.h (PUBLISH_TO_GDB): New macro.
(GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
(DATA_SEG_BITS): Use it.
(GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
(CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
* mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
not be usable in #if. This simplifies things.
Eli Zaretskii [Thu, 26 Jul 2012 17:10:21 +0000 (20:10 +0300)]
Fix parallel bootstrap in lisp/ on MS-Windows.
lisp/makefile.w32-in ($(lisp)/calendar/cal-loaddefs.el)
($(lisp)/calendar/diary-loaddefs.el)
($(lisp)/calendar/hol-loaddefs.el, $(lisp)/mh-e/mh-loaddefs.el)
($(lisp)/net/tramp-loaddefs.el): Depend on update-subdirs. Fixes
failures in parallel bootstrap because subdirs.el is being
rewritten while the autoload files are built at the same time,
which needs to load subdirs.el.
Martin Rudalics [Thu, 26 Jul 2012 08:32:25 +0000 (10:32 +0200)]
In mouse-drag-line don't exit tracking prematurely (Bug#12006).
* mouse.el (popup-menu): Fix doc-string and re-indent code.
(mouse-drag-line): Don't exit tracking when a switch-frame or
switch-window event occurs (Bug#12006).
Paul Eggert [Thu, 26 Jul 2012 08:12:03 +0000 (01:12 -0700)]
Simplify export of symbols to GDB; fix related .gdbinit bugs.
* etc/emacs-buffer.gdb ($tagmask, $valmask): Remove.
(ygetptr): Adjust to recent changes in lisp.h and emacs.c,
by using VALMASK instead of $valmask, CHECK_LISP_OBJECT_TYPE
instead of gdb_use_union, and DATA_SEG_BITS instead of
gdb_data_seg_bits. Also, use $ptr.i rather than $ptr.u.val.
* src/.gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
$bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
(xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
Adjust to changes in lisp.h and emacs.c, by using
CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
instead of gdb_valbits.
(xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
instead of gdb_array_mark_flag.
(xboolvector): Get size from $->size, not $->header.size.
Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
(xreload, hook-run, hookpost-run): Remove.
* src/emacs.c: Include <verify.h>.
(gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
(gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
Remove.
(gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
(gdb_USE_LSB_TAG): New enum constants.
(CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
Also define these as enum constants, so they're visible to GDB.
(ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
(ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
as constants, so they're visible to GDB.
* src/lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
(PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
Now enum constants, not macros, so they're visible to GDB.
(CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
more convenient now. All uses changed.
(VALMASK) [USE_LSB_TAG]: Also define in this case.
* src/mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
Stefan Monnier [Thu, 26 Jul 2012 01:27:33 +0000 (21:27 -0400)]
Autoload more carefully from Lisp. Follow aliases for function properties.
* lisp/subr.el (autoloadp): New function.
(symbol-file): Use it.
(function-get): New function.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Use function-get and
autoload-do-load.
* lisp/emacs-lisp/lisp-mode.el (lisp-font-lock-syntactic-face-function)
(lisp-indent-function):
* lisp/emacs-lisp/gv.el (gv-get):
* lisp/emacs-lisp/edebug.el (get-edebug-spec, edebug-basic-spec):
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
* lisp/emacs-lisp/autoload.el (make-autoload, autoload-print-form):
Use function-get.
* lisp/emacs-lisp/cl.el: Don't propagate function properties any more.
* src/eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
add argument, tune behavior, and adjust all callers.
Paul Eggert [Wed, 25 Jul 2012 22:47:42 +0000 (15:47 -0700)]
Use typedef for EMACS_INT, EMACS_UINT.
* lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
than macros. This simplifies debugging in the usual case, since
it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
and it allows expressions involving EMACS_INT casts.
* .gdbinit (xreload): Simplify by using EMACS_INT cast.
Adjust buffer text indirection counters at the end of Fkill_buffer.
* buffer.c (Fkill_buffer): Adjust indirection counters when the
buffer is definitely dead. This should really fix an issue reported
by Christoph Scholtes again. (Bug#12007).
(init_buffer_once): Initialize indirection counters of
buffer_defaults and buffer_local_symbols (for sanity and safety).
Eli Zaretskii [Tue, 24 Jul 2012 16:34:15 +0000 (19:34 +0300)]
Fix display of tooltips damaged by enhancements for bug #11832.
src/xdisp.c (init_iterator): Don't compute dimensions of truncation
and continuation glyphs on tooltip frames, leave them at zero.
Avoids displaying continued lines in tooltips.
Eli Zaretskii [Mon, 23 Jul 2012 17:27:41 +0000 (20:27 +0300)]
Fix displaying the user name in error message about no home directory.
lisp/startup.el (command-line): Don't display an empty user name in
the error message about non-existent home directory, when
init-file-user was set to an empty string. See
http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00835.html
for the details and context.
Eli Zaretskii [Mon, 23 Jul 2012 16:57:20 +0000 (19:57 +0300)]
Fix bug #12025 with a crash when displaying tooltips.
src/print.c (print_object): Don't crash when a frame's name is nil
or invalid.
src/window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
it signals an error when a tooltip frame is being created.
Swap buffer text indirection counters in Fbuffer_swap_text.
* buffer.c (Fbuffer_swap_text): Swap indirections too.
This avoids crash reported by Christoph Scholtes at
http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
Vincent Belaïche [Sun, 22 Jul 2012 21:14:12 +0000 (23:14 +0200)]
* ses.el (ses-cell-formula-aset): New macro.
(ses-cell-references-aset): New macro.
(ses-cell-p): New function.
(ses-rename-cell): Do no longer rely on complex operations like
ses-cell-set-formula or ses-set-cell to change the cell and handle
the undo at the same time, but rather use lower level new macros
`ses-cell-formula-aset' and `ses-cell-references-aset' and handle
the undo directly. Refresh the mode line.
Jan Djärv [Sun, 22 Jul 2012 16:35:15 +0000 (18:35 +0200)]
* nsmenu.m (Popdown_data): New struct.
(pop_down_menu): p->pointer is Popdown_data. Release the pool and
free Popdown_data.
(ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
(initWithContentRect): Make imgView and contentView non-static
and autorelease them. Also autorelease img and matrix.
(dealloc): Remove (Bug#1995-05-29T20:16:10Z!kwzh@gnu.org).
Adjust consing_since_gc when objects are explicitly freed.
* alloc.c (GC_DEFAULT_THRESHOLD): New macro.
(Fgarbage_collect): Use it. Change minimum to 1/10 of default.
(free_cons, free_misc): Subtract object size from consing_since_gc.
Simplify and cleanup markers positioning code.
* marker.c (attach_marker): More useful eassert.
(live_buffer, set_marker_internal): New function.
(Fset_marker, set_marker_restricted): Use set_marker_internal.
(set_marker_both, set_marker_restricted_both): Use live_buffer.
Eli Zaretskii [Sat, 21 Jul 2012 14:11:33 +0000 (17:11 +0300)]
Bind language-change in special-event-map.
src/keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
in special-event-map. See the discussion at
http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
for the reasons.
Eli Zaretskii [Sat, 21 Jul 2012 13:33:32 +0000 (16:33 +0300)]
Fix data type casting when setting up menus on Windows.
src/w32menu.c (add_menu_item): Cast to UINT_PTR when assigning
info.dwItemData. Fixes crashes on 64-bit Windows. Suggested by
Fabrice Popineau <fabrice.popineau@supelec.fr>.