bpt/emacs.git
11 years agoFix failure to compile on Windows due to 2012-07-27T06:04:35Z!dmantipov@yandex.ru.
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.

11 years agomessage.el: Make header fill function work properly
Katsumi Yamaoka [Fri, 27 Jul 2012 08:01:44 +0000 (08:01 +0000)]
message.el: Make header fill function work properly

11 years ago* textmodes/reftex-vars.el (reftex-label-alist-builtin): Add
Tassilo Horn [Fri, 27 Jul 2012 07:59:50 +0000 (09:59 +0200)]
* 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.

11 years agoRevert last save_excursion_save and save_excursion_restore changes.
Dmitry Antipov [Fri, 27 Jul 2012 07:51:52 +0000 (11:51 +0400)]
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>.

11 years agoFix recently-introduced typos in Windows port.
Dmitry Antipov [Fri, 27 Jul 2012 07:36:33 +0000 (11:36 +0400)]
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.

11 years agoImprove GDB symbol export.
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.

11 years agoUtility function to make a list from specified amount of objects.
Dmitry Antipov [Fri, 27 Jul 2012 06:04:35 +0000 (10:04 +0400)]
Utility function to make a list from specified amount of objects.
* lisp.h (enum constype): New datatype.
(listn): New prototype.
* alloc.c (listn): New function.
(Fmemory_use_count, syms_of_alloc): Use it.
* buffer.c (syms_of_buffer): Likewise.
* callint.c (syms_of_callint): Likewise.
* charset.c (define_charset_internal): Likewise.
* coding.c (syms_of_coding): Likewise.
* keymap.c (syms_of_keymap): Likewise.
* search.c (syms_of_search): Likewise.
* syntax.c (syms_of_syntax): Likewise.
* w32.c (init_environment): Likewise.
* w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
* xdisp.c (syms_of_xdisp): Likewise.
* xfns.c (syms_of_xfns): Likewise.

11 years agocalccomp.el (math-compose-expr): Use parentheses when
Jay Belanger [Fri, 27 Jul 2012 03:48:40 +0000 (22:48 -0500)]
calccomp.el (math-compose-expr): Use parentheses when
there is a product in the denominator of a fraction.

11 years agoFast save_excursion_save and save_excursion_restore.
Dmitry Antipov [Fri, 27 Jul 2012 02:47:07 +0000 (06:47 +0400)]
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.

11 years ago* emacs.c: Do not include <verify.h>; no longer needed.
Paul Eggert [Thu, 26 Jul 2012 19:58:48 +0000 (12:58 -0700)]
* emacs.c: Do not include <verify.h>; no longer needed.

Fixes: debbugs:12036

11 years agoFix export of symbols to GDB.
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.

11 years agoFix parallel bootstrap in lisp/ on MS-Windows.
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.

11 years agosrc/makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
Juanma Barranquero [Thu, 26 Jul 2012 13:59:01 +0000 (15:59 +0200)]
src/makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.

11 years agoAdd Bug#1995-05-30T23:07:27Z!kwzh@gnu.org to latest ChangeLog entry.
Paul Eggert [Thu, 26 Jul 2012 09:14:40 +0000 (02:14 -0700)]
Add Bug#1995-05-30T23:07:27Z!kwzh@gnu.org to latest ChangeLog entry.

(I found this bug report after installing the change.)

11 years agoSpelling fix in comment.
Paul Eggert [Thu, 26 Jul 2012 08:51:23 +0000 (01:51 -0700)]
Spelling fix in comment.

11 years agoIn mouse-drag-line don't exit tracking prematurely (Bug#12006).
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).

11 years agoSimplify export of symbols to GDB; fix related .gdbinit bugs.
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.

11 years agoExplicitly free restriction data that are not needed anymore.
Dmitry Antipov [Thu, 26 Jul 2012 05:23:25 +0000 (09:23 +0400)]
Explicitly free restriction data that are not needed anymore.
* editfns.c (save_restriction_restore): Free restriction data.

11 years ago* lisp/mouse.el (popup-menu): Fix last change.
Stefan Monnier [Thu, 26 Jul 2012 01:29:24 +0000 (21:29 -0400)]
* lisp/mouse.el (popup-menu): Fix last change.

11 years agoAutoload more carefully from Lisp. Follow aliases for function properties.
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.

* lisp/speedbar.el (speedbar-add-localized-speedbar-support):
* lisp/emacs-lisp/disass.el (disassemble-internal):
* lisp/desktop.el (desktop-load-file):
* lisp/help-fns.el (help-function-arglist, find-lisp-object-file-name)
(describe-function-1):
* lisp/emacs-lisp/find-func.el (find-function-noselect):
* lisp/emacs-lisp/elp.el (elp-instrument-function):
* lisp/emacs-lisp/advice.el (ad-has-proper-definition):
* lisp/apropos.el (apropos-safe-documentation, apropos-macrop):
* lisp/emacs-lisp/debug.el (debug-on-entry):
* lisp/emacs-lisp/cl-macs.el (cl-compiler-macroexpand):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
* lisp/calc/calc.el (name): Use autoloadp & autoload-do-load.

11 years ago* international/mule-cmds.el (ucs-insert): Mark it as an obsolete
Alp Aker [Wed, 25 Jul 2012 23:11:23 +0000 (19:11 -0400)]
* international/mule-cmds.el (ucs-insert): Mark it as an obsolete
  function, not an obsolete variable (Bug#12046).

11 years agoUse typedef for EMACS_INT, EMACS_UINT.
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.

11 years agognus-art.el (gnus-kill-sticky-article-buffers): Reintroduce
Julien Danjou [Wed, 25 Jul 2012 22:10:37 +0000 (22:10 +0000)]
gnus-art.el (gnus-kill-sticky-article-buffers): Reintroduce

11 years ago* nsterm.m (ns_read_socket): Return early if there is a modal window.
Jan Djärv [Wed, 25 Jul 2012 17:31:34 +0000 (19:31 +0200)]
* nsterm.m (ns_read_socket): Return early if there is a modal window.

Fixes: debbugs:12043

11 years agoFixes: debbugs:12042
Andreas Schwab [Wed, 25 Jul 2012 10:46:59 +0000 (12:46 +0200)]
Fixes: debbugs:12042

* faces.el (face-spec-reset-face): Fix last change.

11 years agoIn pp-display-expression select old selected window only if it is still live (Bug...
Christopher Schmidt [Wed, 25 Jul 2012 09:43:12 +0000 (11:43 +0200)]
In pp-display-expression select old selected window only if it is still live (Bug#12034).

* emacs-lisp/pp.el (pp-display-expression): Select old selected
window only if it is still live (Bug#12034).

11 years agoAdd advertised calling convention for redirect-frame-focus (Bug#12030).
Martin Rudalics [Wed, 25 Jul 2012 09:34:48 +0000 (11:34 +0200)]
Add advertised calling convention for redirect-frame-focus (Bug#12030).

* frame.c (Fredirect_frame_focus): In doc-string don't mention
that FOCUS-FRAME can be omitted.

* subr.el (redirect-frame-focus): Add advertised calling
convention (Bug#12030).

11 years agoPrefer typical American spelling for "acknowledgment".
Paul Eggert [Wed, 25 Jul 2012 05:48:19 +0000 (22:48 -0700)]
Prefer typical American spelling for "acknowledgment".

11 years agoAdjust buffer text indirection counters at the end of Fkill_buffer.
Dmitry Antipov [Wed, 25 Jul 2012 05:09:02 +0000 (09:09 +0400)]
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).

11 years agonnimap.el (nnimap-get-responses): Don't remove, still used
Katsumi Yamaoka [Wed, 25 Jul 2012 03:22:25 +0000 (03:22 +0000)]
nnimap.el (nnimap-get-responses): Don't remove, still used

11 years agocalc-alg.el (math-simplify-divide): Don't cross multiply
Jay Belanger [Wed, 25 Jul 2012 02:38:36 +0000 (21:38 -0500)]
calc-alg.el (math-simplify-divide): Don't cross multiply
in an equation when the lhs is a variable.

11 years agoMerge changes made in Gnus master; Remove dead code
Julien Danjou [Tue, 24 Jul 2012 22:17:17 +0000 (22:17 +0000)]
Merge changes made in Gnus master; Remove dead code

* mail-source.el (mail-source-movemail-and-remove): Remove, unused.
* nntp.el (nntp-send-nosy-authinfo, nntp-send-authinfo-from-file)
  (nntp-async-timer-handler): Remove, unused.
* nnimap.el (nnimap-get-responses): Remove, unused.
* nnheader.el (mail-header-set-extra): Remove, unused.
* netrc.el (netrc-find-service-number, netrc-store-data): Remove,
  unused.
* mm-view.el (mm-view-sound-file): Remove, unused.
* mm-url.el (mm-url-fetch-simple, mm-url-fetch-form)
  (mm-url-encode-multipart-form-data): Remove, unused.
* message.el (message-remove-signature, message-make-host-name)
  (message-fill-address): Remove, unused.
* gnus.el (gnus-writable-groups, gnus-group-guess-prefixed-name)
  (gnus-group-guess-full-name, gnus-group-guess-prefixed-name): Remove,
  unused.
* gnus-uu.el (gnus-uu-find-name-in-shar): Remove, unused.
* gnus-util.el (gnus-extract-address-component-name)
  (gnus-extract-address-component-email, gnus-sortable-date)
  (gnus-alist-to-hashtable, gnus-hashtable-to-alist)
  (gnus-process-live-p): Remove, unused.
* gnus-topic.el (gnus-group-parent-topic): Remove, unused.
* gnus-sum.el (gnus-score-set-default, gnus-article-parent-p)
  (gnus-article-read-p, gnus-uncompress-marks): Remove, unused.
  (gnus-summary-set-current-mark): Remove obsolete, empty and unused
  function.
* gnus-start.el (gnus-kill-newsgroup): Remove unused obsolete function.
* gnus-score.el (gnus-summary-score-crossposting)
  (gnus-score-regexp-bad-p): Remove, unused.
* gnus-salt.el (gnus-tree-goto-article): Remove, unused.
* gnus-range.el (gnus-sublist-p): Remove, unused.
* gnus-msg.el (gnus-mail-parse-comma-list, gnus-put-message): Remove,
  unused.
* gnus-kill.el (gnus-Newsgroup-kill-file): Remove, unused.
* gnus-int.el (gnus-list-active-group, gnus-request-group-articles)
  (gnus-request-associate-buffer): Remove, unused.
* gnus-group.el (gnus-group-set-method-info)
  (gnus-group-set-params-info): Remove, unused.
* gnus-fun.el (gnus-shell-command-to-string)
  (gnus-shell-command-on-region): Remove, unused.
* gnus-cite.el (gnus-cited-line-p): Remove, unused.
* gnus-art.el (gnus-article-text-type-exists-p)
  (article-translate-characters, gnus-article-hide-text-of-type)
  (gnus-kill-sticky-article-buffers, gnus-article-maybe-highlight):
  Remove, unused.

11 years agoFix display of tooltips damaged by enhancements for bug #11832.
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.

11 years agoSimplify copy_overlay.
Dmitry Antipov [Tue, 24 Jul 2012 06:45:44 +0000 (10:45 +0400)]
Simplify copy_overlay.
* buffer.c (copy_overlay): Simplify, use build_marker.
* lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.

11 years agoFix displaying the user name in error message about no home directory.
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.

11 years agoFix bug #12025 with a crash when displaying tooltips.
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.

11 years agonnir.el ("nnir"): Revert last change, that's premature to merge from Gnus master
Katsumi Yamaoka [Mon, 23 Jul 2012 11:26:29 +0000 (11:26 +0000)]
nnir.el ("nnir"): Revert last change, that's premature to merge from Gnus master

11 years agoCleanup miscellaneous objects allocation and initialization.
Dmitry Antipov [Mon, 23 Jul 2012 11:15:43 +0000 (15:15 +0400)]
Cleanup miscellaneous objects allocation and initialization.
* alloc.c (allocate_misc): Change to static.  Add argument to
specify the subtype.  Adjust comment and users.
(build_overlay): New function.
* buffer.c (copy_overlays, Fmake_overlay): Use it.
* lisp.h (struct Lisp_Overlay): Remove obsolete comment.
(allocate_misc): Remove prototype.
(build_overlay): Add prototype.

11 years agonnir.el ("nnir"): Add 'virtual ability to nnir backend
Andrew Cohen [Mon, 23 Jul 2012 11:10:23 +0000 (11:10 +0000)]
nnir.el ("nnir"): Add 'virtual ability to nnir backend

11 years agoSwap buffer text indirection counters in Fbuffer_swap_text.
Dmitry Antipov [Mon, 23 Jul 2012 07:14:58 +0000 (11:14 +0400)]
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.

11 years ago* ses.el (ses-cell-formula-aset): New macro.
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.

11 years ago* nsmenu.m (Popdown_data): New struct.
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).

11 years agoAdjust consing_since_gc when objects are explicitly freed.
Dmitry Antipov [Sun, 22 Jul 2012 15:13:50 +0000 (19:13 +0400)]
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.

11 years agoSimplify and cleanup markers positioning code.
Dmitry Antipov [Sun, 22 Jul 2012 05:37:24 +0000 (09:37 +0400)]
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.

11 years agoMerge from gnulib (comment changes only).
Paul Eggert [Sun, 22 Jul 2012 04:16:53 +0000 (21:16 -0700)]
Merge from gnulib (comment changes only).

11 years agoSpelling fixes.
Paul Eggert [Sun, 22 Jul 2012 04:11:49 +0000 (21:11 -0700)]
Spelling fixes.

11 years ago* buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
Paul Eggert [Sun, 22 Jul 2012 03:44:35 +0000 (20:44 -0700)]
* buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,

as it's limited by the amount of memory, not by INT_MAX.

11 years agoFix previous change in w32menu.c.
Eli Zaretskii [Sat, 21 Jul 2012 19:26:25 +0000 (22:26 +0300)]
Fix previous change in w32menu.c.

11 years agoImprove documentation of special events and of the "e" interactive spec.
Eli Zaretskii [Sat, 21 Jul 2012 14:48:17 +0000 (17:48 +0300)]
Improve documentation of special events and of the "e" interactive spec.

 doc/lispref/commands.texi (Special Events): Mention language-change event.
 (Input Events, Interactive Codes):
 doc/lispref/keymaps.texi (Key Sequences): Mention events that are
 non-keyboard but also non-mouse events.

11 years agoBind language-change in special-event-map.
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.

11 years agoFix data type casting when setting up menus on Windows.
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>.

11 years ago* nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
Jan Djärv [Sat, 21 Jul 2012 12:10:49 +0000 (14:10 +0200)]
* nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.

11 years ago* nsterm.m (conversationIdentifier): Return value is NSInteger.
Jan Djärv [Sat, 21 Jul 2012 11:34:19 +0000 (13:34 +0200)]
* nsterm.m (conversationIdentifier): Return value is NSInteger.

11 years agoerc-notifications: new file
Julien Danjou [Sat, 21 Jul 2012 11:08:32 +0000 (13:08 +0200)]
erc-notifications: new file

11 years agolisp/gnus/message.el: Replace deprecated rmail vars
Julien Danjou [Sat, 21 Jul 2012 11:05:32 +0000 (11:05 +0000)]
lisp/gnus/message.el: Replace deprecated rmail vars

11 years ago* nsterm.m (accessibilityAttributeValue): New function..
Jan Djärv [Sat, 21 Jul 2012 10:23:21 +0000 (12:23 +0200)]
* nsterm.m (accessibilityAttributeValue): New function..

Fixes: debbugs:11134

11 years agoDisallow windows on dead frames in decode_any_window.
Chong Yidong [Sat, 21 Jul 2012 06:17:30 +0000 (14:17 +0800)]
Disallow windows on dead frames in decode_any_window.

* window.c (decode_any_window): Signal an error if the window is
on a dead frame.

Fixes: debbugs:11984

11 years agoMerge from emacs-24 branch; up to 2012-05-01T10:20:43Z!rgm@gnu.org
Chong Yidong [Sat, 21 Jul 2012 06:13:23 +0000 (14:13 +0800)]
Merge from emacs-24 branch; up to 2012-05-01T10:20:43Z!rgm@gnu.org

11 years agoUse match-string-no-properties instead in c-defun-name
Leo Liu [Sat, 21 Jul 2012 01:41:48 +0000 (09:41 +0800)]
Use match-string-no-properties instead in c-defun-name

for consistency.

11 years ago* lisp/progmodes/cc-cmds.el (c-defun-name): Handle objc selectors properly.
Leo Liu [Fri, 20 Jul 2012 21:18:52 +0000 (05:18 +0800)]
* lisp/progmodes/cc-cmds.el (c-defun-name): Handle objc selectors properly.

Fixes: debbugs:7879

11 years ago* ses.el (ses-rename-cell): Set new name also in reference list of cells of which...
Vincent Belaïche [Fri, 20 Jul 2012 21:09:04 +0000 (23:09 +0200)]
* ses.el (ses-rename-cell): Set new name also in reference list of cells of which the renamed cell depends.

11 years agoBackport: Recognize Objective-C methods also in c-defun-name
Jan Djärv [Fri, 20 Jul 2012 19:59:49 +0000 (03:59 +0800)]
Backport: Recognize Objective-C methods also in c-defun-name

Fixes: debbugs:7879

11 years agoAdd indirection counting to speed up Fkill_buffer.
Dmitry Antipov [Fri, 20 Jul 2012 16:05:47 +0000 (20:05 +0400)]
Add indirection counting to speed up Fkill_buffer.
* buffer.h (struct buffer): New member.
* buffer.c (Fget_buffer_create): Set indirection counter to 0.
(Fmake_indirect_buffer): Set indirection counter to -1, increment
base buffer indirection counter.
(compact_buffer): If ENABLE_CHECKING, verify indirection counters.
(Fkill_buffer): Adjust indirection counters as needed, don't walk
through buffer list if indirection counter is 0.

11 years agoExtend the value returned by Fgarbage_collect with heap statistics.
Dmitry Antipov [Fri, 20 Jul 2012 14:07:28 +0000 (18:07 +0400)]
Extend the value returned by Fgarbage_collect with heap statistics.
* alloc.c (Qheap): New symbol.
(syms_of_alloc): DEFSYM it.
(Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
(Fmemory_free): Remove.
(syms_of_alloc): Don't defsubr it.
* buffer.c (Fcompact_buffer): Remove.
(syms_of_buffer): Don't defsubr it.

11 years agoMake maybe_gc inline.
Dmitry Antipov [Fri, 20 Jul 2012 13:14:58 +0000 (17:14 +0400)]
Make maybe_gc inline.
Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
* lisp.h (consing_since_gc, gc_relative_threshold)
(memory_full_cons_threshold): Revert declaration.
(maybe_gc): Remove prototype, define as inline.
* alloc.c: Remove old commented-out code.
(consing_since_gc, gc_relative_threshold)
(memory_full_cons_threshold): Revert to global.
(maybe_gc): Remove.

11 years ago* progmodes/cc-langs.el (c-symbol-start): Include char _.
Leo Liu [Fri, 20 Jul 2012 11:36:41 +0000 (19:36 +0800)]
* progmodes/cc-langs.el (c-symbol-start): Include char _.

Fixes: debbugs:11986

11 years ago* lisp/term/x-win.el (x-menu-bar-open): Use `frame-parameter'
Masatake YAMATO [Fri, 20 Jul 2012 11:32:30 +0000 (07:32 -0400)]
* lisp/term/x-win.el (x-menu-bar-open): Use `frame-parameter'
to check whether menu-bar is shown or not.  If not shown,
show the menu-bar as a popup menu instead of using tmm.
* lisp/mouse.el (popup-menu): Accept `point' as `position' argument.

11 years ago* lisp/progmodes/ruby-mode.el (ruby-parse-partial): No error when end
Dmitry Gutov [Fri, 20 Jul 2012 11:10:25 +0000 (07:10 -0400)]
* lisp/progmodes/ruby-mode.el (ruby-parse-partial): No error when end
up inside string symbol literal.
* test/automated/ruby-mode-tests.el: New file with one test.

Fixes: debbugs:11923

11 years agoFix display of Hebrew tutorial title on splash screen.
Eli Zaretskii [Fri, 20 Jul 2012 10:29:32 +0000 (13:29 +0300)]
Fix display of Hebrew tutorial title on splash screen.

 lisp/startup.el (fancy-startup-text): Read the whole tutorial, not
 just its first 256 bytes.  Prevents gibberish in display of the
 tutorial title.
 etc/tutorials/TUTORIAL.he: Make the first sentence display correctly
 in a left-to-right paragraph, such as what is shown on the fancy
 splash screen, by using directional control characters.

11 years agoSimple wrapper for make_unibyte_string, adjust font_open_by_name.
Dmitry Antipov [Fri, 20 Jul 2012 07:29:04 +0000 (11:29 +0400)]
Simple wrapper for make_unibyte_string, adjust font_open_by_name.
* src/lisp.h (build_unibyte_string): New function.
* src/dosfns.c, src/fileio.c, src/fns.c, src/ftfont.c, src/process.c:
* src/sysdep.c, src/w32fns.c, src/xfns.c: Use it.
* src/font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
of type Lisp_Object to avoid redundant calls to make_unibyte_string.
Adjust users accordingly.
* src/font.h (font_open_by_name): Adjust prototype.
* admin/coccinelle/unibyte_string.cocci: Semantic patch to convert from
make_unibyte_string to build_unibyte_string where appropriate.

11 years agoCleanup calls to Fgarbage_collect.
Dmitry Antipov [Fri, 20 Jul 2012 05:28:00 +0000 (09:28 +0400)]
Cleanup calls to Fgarbage_collect.
* lisp.h (maybe_gc): New prototype.
(consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
Remove declarations.
* alloc.c (maybe_gc): New function.
(consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
Make them static.
* bytecode.c (MAYBE_GC): Use maybe_gc.
* eval.c (eval_sub, Ffuncall): Likewise.
* keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
to avoid dependency from auto-save feature.

11 years agoDrop idle buffer compaction due to an absence of the
Dmitry Antipov [Fri, 20 Jul 2012 04:13:04 +0000 (08:13 +0400)]
Drop idle buffer compaction due to an absence of the
proved efficiency.
* lisp/compact.el: Remove.

11 years ago* buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
Paul Eggert [Thu, 19 Jul 2012 22:35:58 +0000 (15:35 -0700)]
* buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.

(FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
'for_each_per_buffer_object_at'.
All uses changed.  It's better to use upper-case for macros that
cannot be implemented as functions, to give the reader a clue
that they're special.

11 years ago* lisp/vc/vc-dispatcher.el (vc-compilation-mode): Add, based on
Sam Steingold [Thu, 19 Jul 2012 14:38:01 +0000 (10:38 -0400)]
* lisp/vc/vc-dispatcher.el (vc-compilation-mode): Add, based on
vc-bzr-pull & vc-bzr-merge-branch.
* lisp/vc/vc-bzr.el (vc-bzr-pull, vc-bzr-merge-branch): Use it.
(vc-bzr-error-regexp-alist): Rename from vc-bzr-error-regex-alist
for consistency with compilation-error-regexp-alist.
* lisp/vc/vc-git.el (vc-git-error-regexp-alist): Add.
(vc-git-pull, vc-git-merge-branch): Call vc-compilation-mode.
* lisp/vc/vc-hg.el (vc-hg-error-regexp-alist): Add.
(vc-hg-pull, vc-hg-merge-branch): Call vc-compilation-mode.

11 years ago* lisp/emacs-lisp/chart.el: Use lexical-binding.
Stefan Monnier [Thu, 19 Jul 2012 11:39:38 +0000 (07:39 -0400)]
* lisp/emacs-lisp/chart.el: Use lexical-binding.
(chart-emacs-storage): Don't hardcode the list of entries.
* src/alloc.c (Fgarbage_collect): Tweak docstring.

11 years agoTweak the value returned from Fgarbage_collect again.
Dmitry Antipov [Thu, 19 Jul 2012 09:50:01 +0000 (13:50 +0400)]
Tweak the value returned from Fgarbage_collect again.
* src/alloc.c (Fgarbage_collect): New return value, as confirmed in
http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
Adjust documentation.
(total_vector_bytes): Rename to total_vector_slots, adjust
accounting.
(total_free_vector_bytes): Rename to total_free_vector_slots,
adjust accounting.
(Qstring_bytes, Qvector_slots): New symbols.
(syms_of_alloc): DEFSYM them.
* lisp/emacs-lisp/chart.el (chart-emacs-storage): Adjust again.

11 years agoCompact buffers when idle.
Dmitry Antipov [Thu, 19 Jul 2012 08:56:53 +0000 (12:56 +0400)]
Compact buffers when idle.
* lisp/compact.el: New file.
* src/buffer.c (compact_buffer, Fcompact_buffer): New function.
(syms_of_buffer): Register Fcompact_buffer.
* src/alloc.c (Fgarbage_collect): Use compact_buffer.
* src/buffer.h (compact_buffer): New prototype.
(struct buffer_text): New member.

11 years ago* lisp/subr.el (eventp): Presume that if it looks vaguely like an event,
Stefan Monnier [Thu, 19 Jul 2012 06:24:04 +0000 (02:24 -0400)]
* lisp/subr.el (eventp): Presume that if it looks vaguely like an event,
it's an event.

Fixes: debbugs:10190

11 years agoNew macro to iterate over all buffers, miscellaneous cleanups.
Dmitry Antipov [Thu, 19 Jul 2012 03:55:59 +0000 (07:55 +0400)]
New macro to iterate over all buffers, miscellaneous cleanups.
* lisp.h (all_buffers): Remove declaration.
* buffer.h (all_buffers): Add declaration, with comment.
(for_each_buffer): New macro.
* alloc.c (Fgarbage_collect, mark_object): Use it.
* buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
(init_buffer): Likewise.
* data.c (Fset_default): Likewise.
* coding.c (code_conversion_restore): Remove redundant check
for dead buffer.
* buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.

11 years agoAvoid two crashes involving windows on dead frames.
Chong Yidong [Thu, 19 Jul 2012 03:33:08 +0000 (11:33 +0800)]
Avoid two crashes involving windows on dead frames.

* window.c (Fwindow_absolute_pixel_edges)
(Fdelete_other_windows_internal): Signal an error if the window is
on a dead frame.

Fixes: debbugs:11984

11 years ago* emacs.texi: Update ISBN.
Chong Yidong [Thu, 19 Jul 2012 01:15:06 +0000 (09:15 +0800)]
* emacs.texi: Update ISBN.

11 years agoEnhancements to ppss related code (thanks Stefan).
Fabián Ezequiel Gallina [Thu, 19 Jul 2012 00:55:55 +0000 (21:55 -0300)]
Enhancements to ppss related code (thanks Stefan).
* progmodes/python.el (python-indent-context)
(python-indent-calculate-indentation, python-indent-dedent-line)
(python-indent-electric-colon, python-nav-forward-block)
(python-mode-abbrev-table)
(python-info-assignment-continuation-line-p): Simplified checks
for ppss context.
(python-info-continuation-line-p): Cleanup.
(python-info-ppss-context): Do not catch 'quote.
(python-info-ppss-context-type)
(python-info-ppss-comment-or-string-p): Simplify.

11 years agoFix bug that created negative-length intervals.
Andreas Schwab [Wed, 18 Jul 2012 21:33:37 +0000 (14:33 -0700)]
Fix bug that created negative-length intervals.

* intervals.c (merge_interval_right, merge_interval_left):
Do not zero out this interval if it is absorbed by its children,
as this interval's total length doesn't change in that case.  See
<http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.

11 years agoprogmodes/python.el: Set file local vars at end of file and clean tabs.
Fabián Ezequiel Gallina [Wed, 18 Jul 2012 19:04:06 +0000 (16:04 -0300)]
progmodes/python.el: Set file local vars at end of file and clean tabs.

11 years ago* progmodes/python.el: Enhancements to eldoc support.
Fabián Ezequiel Gallina [Wed, 18 Jul 2012 18:40:03 +0000 (15:40 -0300)]
* progmodes/python.el: Enhancements to eldoc support.
(python-info-current-symbol): New function.
(python-eldoc-at-point): Use python-info-current-symbol.
(python-info-current-defun): Fix cornercase on first defun scan.
(python-eldoc--get-doc-at-point): Use python-info-current-symbol
and signal error when no inferior python process is available.

11 years ago* alloc.c (Fmake_bool_vector): Fix off-by-8 bug
Paul Eggert [Wed, 18 Jul 2012 17:29:34 +0000 (10:29 -0700)]
* alloc.c (Fmake_bool_vector): Fix off-by-8 bug

when invoking (make-bool-vector N t) and N is a positive
multiple of 8 -- the last 8 bits were mistakenly cleared.

11 years agoRemove some struct layout assumptions in bool vectors.
Paul Eggert [Wed, 18 Jul 2012 17:26:43 +0000 (10:26 -0700)]
Remove some struct layout assumptions in bool vectors.

* alloc.c (bool_header_size): New constant.
(header_size, word_size): Move earlier, as they're now used earlier.
Use 'word_size' in a few more places, where it's appropriate.
(Fmake_bool_vector, sweep_vectors): Don't assume that there is no
padding before the data member of a bool vector.
(sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
than doing the check by hand with an abort ().

11 years ago* src/eval.c (Fdefvar): Don't check constants since we only set the var if
Stefan Monnier [Wed, 18 Jul 2012 15:20:33 +0000 (11:20 -0400)]
* src/eval.c (Fdefvar): Don't check constants since we only set the var if
it's not yet defined anyway.

Fixes: debbugs:11904

11 years ago* vc/vc-git.el (vc-git-state): Don't call `vc-git-registered',
Dmitry Gutov [Wed, 18 Jul 2012 15:04:36 +0000 (17:04 +0200)]
* vc/vc-git.el (vc-git-state): Don't call `vc-git-registered',
assume it's always t.
(vc-git-registered): Remove caching, the function is only called
once.
(vc-git-branches): Use `vc-git--call' instead of `call-process'.

11 years agoFix last commit.
Chong Yidong [Wed, 18 Jul 2012 14:48:25 +0000 (22:48 +0800)]
Fix last commit.

11 years ago* subr.el (last-input-char, last-command-char): Remove.
Chong Yidong [Wed, 18 Jul 2012 14:46:32 +0000 (22:46 +0800)]
* subr.el (last-input-char, last-command-char): Remove.

Fixes: debbugs:9195

11 years ago* simple.el (count-words): Report on narrowing.
Chong Yidong [Wed, 18 Jul 2012 14:29:34 +0000 (22:29 +0800)]
* simple.el (count-words): Report on narrowing.

Fixes: debbugs:9959

11 years ago* lisp/bindings.el: Bind M-= to count-words.
Chong Yidong [Wed, 18 Jul 2012 14:17:49 +0000 (22:17 +0800)]
* lisp/bindings.el: Bind M-= to count-words.

11 years ago* faces.el (face-spec-reset-face): Handle reverse video.
Chong Yidong [Wed, 18 Jul 2012 14:00:09 +0000 (22:00 +0800)]
* faces.el (face-spec-reset-face): Handle reverse video.

Fixes: debbugs:4238

11 years ago* lisp/progmodes/sh-script.el (sh-imenu-generic-expression):
Masatake YAMATO [Wed, 18 Jul 2012 13:40:57 +0000 (09:40 -0400)]
* lisp/progmodes/sh-script.el (sh-imenu-generic-expression):
Capture a function with `function' keyword and without parentheses
like "function FOO".

Fixes: debbugs:11856

11 years ago* subr.el (keyboard-translate): Doc fix.
Chong Yidong [Wed, 18 Jul 2012 13:31:16 +0000 (21:31 +0800)]
* subr.el (keyboard-translate): Doc fix.

Fixes: debbugs:7261

11 years ago* src/lisp.h (last_undo_boundary): Declare new var.
Stefan Monnier [Wed, 18 Jul 2012 13:20:59 +0000 (09:20 -0400)]
* src/lisp.h (last_undo_boundary): Declare new var.
* src/keyboard.c (command_loop_1): Set it.
* src/cmds.c (Fself_insert_command): Use it to only remove boundaries that
were auto-added by the command loop.

Fixes: debbugs:11774

11 years ago* lisp/userlock.el, emacs-lisp/map-ynp.el: Declare part of `emacs' package.
Stefan Monnier [Wed, 18 Jul 2012 11:44:13 +0000 (07:44 -0400)]
* lisp/userlock.el, emacs-lisp/map-ynp.el: Declare part of `emacs' package.
* lisp/progmodes/bug-reference.el, lisp/misearch.el: Provide themselves.

Fixes: debbugs:11915

11 years agognus/{sieve-mode,sieve}.el: Close buffers by default
Julien Danjou [Wed, 18 Jul 2012 10:38:37 +0000 (10:38 +0000)]
gnus/{sieve-mode,sieve}.el: Close buffers by default

11 years ago* w32font.c (Qsymbol): Remove local definition.
Andreas Schwab [Wed, 18 Jul 2012 10:12:43 +0000 (12:12 +0200)]
* w32font.c (Qsymbol): Remove local definition.
(syms_of_w32font): Don't DEFSYM it.