bpt/emacs.git
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.

11 years ago* window.el (split-window-sensibly): Make WINDOW argument
Tassilo Horn [Wed, 18 Jul 2012 10:02:54 +0000 (12:02 +0200)]
* window.el (split-window-sensibly): Make WINDOW argument
optional.

11 years agoFix sweep_vectors to handle large bool vectors correctly.
Dmitry Antipov [Wed, 18 Jul 2012 09:46:07 +0000 (13:46 +0400)]
Fix sweep_vectors to handle large bool vectors correctly.
* alloc.c (sweep_vectors): Account total_vector_bytes for
bool vectors larger than VBLOCK_BYTES_MAX.

11 years ago* lisp/progmodes/cperl-mode.el (cperl-unwind-to-safe): Don't inf-loop at end
Stefan Monnier [Wed, 18 Jul 2012 09:33:09 +0000 (05:33 -0400)]
* lisp/progmodes/cperl-mode.el (cperl-unwind-to-safe): Don't inf-loop at end
of narrowed buffer.

Fixes: debbugs:11966

11 years agoFix usage of C-x 8 key translations in Isearch.
Chong Yidong [Wed, 18 Jul 2012 09:27:23 +0000 (17:27 +0800)]
Fix usage of C-x 8 key translations in Isearch.

* lisp/isearch.el (isearch-mode-map): Handle C-x 8 key translations,
and make C-x 8 RET exit isearch.

* lisp/international/iso-transl.el: Move isearch-mode-map key
definitions to isearch.el.

Fixes: debbugs:11439

11 years agoRevert bogus change in 2011-07-28T21:49:16Z!eggert@cs.ucla.edu.
Chong Yidong [Wed, 18 Jul 2012 08:11:08 +0000 (16:11 +0800)]
Revert bogus change in 2011-07-28T21:49:16Z!eggert@cs.ucla.edu.

* src/frame.c (x_set_frame_parameters): Revert bogus change introduced
in 2012-05-25 commit by Paul Eggert.

Fixes: debbugs:11738

11 years ago* lisp/emacs-lisp/eieio.el: Adapt further to gv.el.
Stefan Monnier [Wed, 18 Jul 2012 07:20:04 +0000 (03:20 -0400)]
* lisp/emacs-lisp/eieio.el: Adapt further to gv.el.
(eieio-defclass): Use gv-define-setter when possible.

Fixes: debbugs:11970

11 years agoReturn more descriptive data from Fgarbage_collect.
Dmitry Antipov [Wed, 18 Jul 2012 05:44:36 +0000 (09:44 +0400)]
Return more descriptive data from Fgarbage_collect.
Suggested by Stefan Monnier in
http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
* src/alloc.c (bounded_number): New function.
(total_buffers, total_vectors): New variable.
(total_string_size): Rename to total_string_bytes, adjust users.
(total_vector_size): Rename to total_vector_bytes, adjust users.
(sweep_vectors): Account total_vectors and total_vector_bytes.
(Fgarbage_collect): New return value.  Adjust documentation.
(gc_sweep): Account total_buffers.
(Fmemory_free, Fmemory_use_counts): Use bounded_number.
(VECTOR_SIZE): Remove.
* src/data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
(Qinterval, Qmisc): New symbols.
(syms_of_data): Initialize them.
* src/lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
(Qcons, Qbuffer): New declarations.
* lisp/emacs-lisp/chart.el (chart-emacs-storage): Change to
reflect new format of data returned by Fgarbage_collect.

11 years agoNew utility functions + python-info-ppss-context fix.
Fabián Ezequiel Gallina [Tue, 17 Jul 2012 20:27:49 +0000 (17:27 -0300)]
New utility functions + python-info-ppss-context fix.
* progmodes/python.el (python-info-beginning-of-block-statement-p)
(python-info-ppss-comment-or-string-p): New functions.
(python-info-ppss-context): Small fix for string check.

Fixes: debbugs:11910

11 years ago* lisp/dired-aux.el (dired-do-async-shell-command): Doc fix.
Juri Linkov [Tue, 17 Jul 2012 18:40:15 +0000 (21:40 +0300)]
* lisp/dired-aux.el (dired-do-async-shell-command): Doc fix.
(dired-do-async-shell-command): Don't add `*' at the end of the
command (Bug#11815).
(dired-do-shell-command): Doc fix.
(dired-shell-stuff-it): Strip the trailing "&" and ";" if any.
Join the individual commands using either "&" or ";" as the
separator depending on the values of these trailing characters.
At the end re-add the trailing "&".  (Bug#10598)

* lisp/simple.el (async-shell-command): Sync the interactive spec with
`shell-command'.  Doc fix.
(shell-command): Doc fix.

11 years ago* lisp/descr-text.el (describe-char): Fix format args.
Juri Linkov [Tue, 17 Jul 2012 18:15:02 +0000 (21:15 +0300)]
* lisp/descr-text.el (describe-char): Fix format args.

Fixes: debbugs:10129

11 years agoFinal renames and doc fixes for movement commands.
Fabián Ezequiel Gallina [Tue, 17 Jul 2012 18:02:53 +0000 (15:02 -0300)]
Final renames and doc fixes for movement commands.
* progmodes/python.el (python-nav-beginning-of-statement): Rename
from python-nav-statement-start.
(python-nav-end-of-statement): Rename from
python-nav-statement-end.
(python-nav-beginning-of-block): Rename from
python-nav-block-start.
(python-nav-end-of-block): Rename from python-nav-block-end.

Fixes: debbugs:11899

11 years ago* progmodes/python.el (python-shell-send-string-no-output): Allow
Fabián Ezequiel Gallina [Tue, 17 Jul 2012 16:47:58 +0000 (13:47 -0300)]
* progmodes/python.el (python-shell-send-string-no-output): Allow
accept-process-output to quit, keeping shell process ready for
future interactions.

Fixes: debbugs:11868

11 years ago* alloc.c (Fmemory_free): Account for memory-free's own storage.
Paul Eggert [Tue, 17 Jul 2012 16:24:57 +0000 (09:24 -0700)]
* alloc.c (Fmemory_free): Account for memory-free's own storage.

Round up, not down.  Improve doc.

11 years ago* lisp/emacs-lisp/cl-macs.el (cl-progv): Use a properly prefixed var name.
Stefan Monnier [Tue, 17 Jul 2012 12:58:25 +0000 (08:58 -0400)]
* lisp/emacs-lisp/cl-macs.el (cl-progv): Use a properly prefixed var name.

11 years ago* lisp/emacs-lisp/elint.el (elint-find-args-in-code):
Stefan Monnier [Tue, 17 Jul 2012 12:30:48 +0000 (08:30 -0400)]
* lisp/emacs-lisp/elint.el (elint-find-args-in-code):
Use help-function-arglist, so as to handle lexical byte-code.

11 years agoRestore old code in allocate_string_data to avoid Faset breakage.
Dmitry Antipov [Tue, 17 Jul 2012 12:31:29 +0000 (16:31 +0400)]
Restore old code in allocate_string_data to avoid Faset breakage.
Reported by Julien Danjou <julien@danjou.info> in
http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
* alloc.c (allocate_string_data): Restore old code with minor
adjustments, fix comment to explain this subtle issue.

11 years agoMerge from emacs-24
Stefan Monnier [Tue, 17 Jul 2012 11:52:00 +0000 (07:52 -0400)]
Merge from emacs-24

11 years ago* lisp/progmodes/cc-engine.el (c-forward-sws, c-backward-sws):
Stefan Monnier [Tue, 17 Jul 2012 11:40:23 +0000 (07:40 -0400)]
* lisp/progmodes/cc-engine.el (c-forward-sws, c-backward-sws):
Avoid spuriously marking the buffer as modified because of c-is-sws.

11 years agoAuto-commit of generated files.
Glenn Morris [Tue, 17 Jul 2012 10:17:29 +0000 (06:17 -0400)]
Auto-commit of generated files.

11 years agoCleanup and convert miscellaneous checks to eassert.
Dmitry Antipov [Tue, 17 Jul 2012 09:12:24 +0000 (13:12 +0400)]
Cleanup and convert miscellaneous checks to eassert.
* alloc.c (mark_interval): Fix comment, partially rephrase
old comment from intervals.h (see below).
* intervals.c (find_interval, adjust_intervals_for_insertion)
(delete_interval, adjust_intervals_for_deletion)
(graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
Convert to eassert.
(adjust_intervals_for_insertion, make_new_interval):
Remove obsolete and unused code.
* intervals.h (struct interval): Remove obsolete comment.
* textprotp.c (erase_properties): Remove unused code.
(Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
(Fremove_list_of_text_properties): Convert to eassert.

11 years ago* lisp/progmodes/sh-script.el (sh-syntax-propertize-function): Mark "${#VAR"
Stefan Monnier [Tue, 17 Jul 2012 08:38:12 +0000 (04:38 -0400)]
* lisp/progmodes/sh-script.el (sh-syntax-propertize-function): Mark "${#VAR"
as not-a-comment.
* test/indent/shell.sh: Add test case for ${#VAR}.

Fixes: debbugs:11946

11 years agoMisc minor changes.
Stefan Monnier [Tue, 17 Jul 2012 08:15:06 +0000 (04:15 -0400)]
Misc minor changes.
* lisp/xt-mouse.el (xterm-mouse-translate-1, xterm-mouse-event-read):
Use read-event since we don't really want to read chars but bytes.
* lisp/emacs-lisp/macroexp.el (macroexp-let2): Use more informative names
for uninterned vars.

11 years ago* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-1): Highlight not only
Stefan Monnier [Tue, 17 Jul 2012 08:11:31 +0000 (04:11 -0400)]
* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-1): Highlight not only
$$..$$ but also $..$ using regexps.
Use tex-verbatim for \url and \path.
(tex-font-lock-keywords): Define as defconst like the others.
(tex-common-initialization): Don't use font-lock-syntax-table any more.
* test/indent/latex-mode.tex: New file.

Fixes: debbugs:11953

11 years agoDocument insert-char changes.
Chong Yidong [Tue, 17 Jul 2012 07:43:01 +0000 (15:43 +0800)]
Document insert-char changes.

* doc/emacs/basic.texi (Inserting Text): Replace ucs-insert with
insert-char.  Provide more details of input.

* doc/lispref/mule.texi (International Chars, Input Methods): Likewise.

* doc/lispref/text.texi (Insertion): Document insert-char changes.

* src/editfns.c (Finsert_char): Doc fix.

11 years agoFix toolkit configuration report.
Dmitry Antipov [Tue, 17 Jul 2012 07:30:25 +0000 (11:30 +0400)]
Fix toolkit configuration report.
* configure.ac (USE_X_TOOLKIT): Report toolkit as GTK3 if
--with-x-toolkit=gtk3 is used.

11 years agoFix previous change to make Fmemory_free always accurate.
Dmitry Antipov [Tue, 17 Jul 2012 07:15:50 +0000 (11:15 +0400)]
Fix previous change to make Fmemory_free always accurate.
* alloc.c (make_interval): Update total_free_intervals.
(make_float): Likewise for total_free_floats.
(free_cons, Fcons): Likewise for total_free_conses.
(SETUP_ON_FREE_LIST, allocate_vector_from_block):
Likewise for total_free_vector_bytes.
(Fmake_symbol): Likewise for total_free_symbols.
(bytes_free): Remove.

11 years agoSimple free memory accounting feature.
Dmitry Antipov [Tue, 17 Jul 2012 05:01:33 +0000 (09:01 +0400)]
Simple free memory accounting feature.
* alloc.c (bytes_free, total_free_vector_bytes): New variable.
(sweep_vectors): Accumulate size of free vectors.
(Fgarbage_collect): Setup bytes_free.
(Fmemory_free): New function.
(syms_of_alloc): Register it.

11 years agoCleanup overlays checking.
Dmitry Antipov [Tue, 17 Jul 2012 04:29:50 +0000 (08:29 +0400)]
Cleanup overlays checking.
* buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
* buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
eassert and OVERLAYP.
(sort_overlays): Change to use OVERLAYP.

11 years agoMake insert-char interactive, and ucs-insert an obsolete alias for it.
René Kyllingstad [Tue, 17 Jul 2012 04:17:23 +0000 (12:17 +0800)]
Make insert-char interactive, and ucs-insert an obsolete alias for it.

* lisp/international/mule-cmds.el (ucs-insert): Make it an obsolete
alias for insert-char.

* editfns.c (Finsert_char): Make it interactive, and make the second
arg optional.  Copy interactive spec and docstring from ucs-insert.

11 years ago* floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT.
Paul Eggert [Tue, 17 Jul 2012 02:56:00 +0000 (19:56 -0700)]
* floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT.

Unlike the other wrapped functions, fabs has an unspecified
effect on errno.

Fixes: debbugs:11913

11 years agoFix regression with pthread_sigmask on FreeBSD.
Paul Eggert [Tue, 17 Jul 2012 02:09:58 +0000 (19:09 -0700)]
Fix regression with pthread_sigmask on FreeBSD.

* configure.ac: Configure gnulib at the end, not before running
pkg-config.  This restores the behavior before 2012-06-22, when
higher-resolution time stamps were added, and fixes a bug whereby
LIB_PTHREAD was not used and gnulib's part of 'configure'
therefore incorrectly assumed that pthread_sigmask wasn't working.
Fix the problem with -lrt and clock_gettime a different way.
This should complete the fix for Bug#11884.
(pre_PKG_CONFIG_CFLAGS, pre_PKG_CONFIG_LIBS): New shell vars.

11 years ago* progmodes/python.el: Simplified imenu implementation.
Fabián Ezequiel Gallina [Mon, 16 Jul 2012 17:18:39 +0000 (14:18 -0300)]
* progmodes/python.el: Simplified imenu implementation.
(python-nav-jump-to-defun): Remove command.
(python-mode-map): Use `imenu' instead.
(python-nav-list-defun-positions-cache)
(python-imenu-include-defun-type, python-imenu-make-tree)
(python-imenu-subtree-root-label, python-imenu-index-alist):
Remove vars.
(python-nav-list-defun-positions, python-nav-read-defun)
(python-imenu-tree-assoc, python-imenu-make-element-tree)
(python-imenu-make-tree, python-imenu-create-index): Remove
functions.
(python-mode): Update to interact with imenu by setting
`imenu-extract-index-name-function' only.

11 years ago* progmodes/python.el: Enhancements to navigation commands.
Fabián Ezequiel Gallina [Mon, 16 Jul 2012 13:13:01 +0000 (10:13 -0300)]
* progmodes/python.el: Enhancements to navigation commands.
(python-nav-backward-sentence)
(python-nav-forward-sentence): Remove.
(python-nav-backward-statement, python-nav-forward-statement)
(python-nav-statement-start, python-nav-statement-end)
(python-nav-backward-block, python-nav-forward-block)
(python-nav-block-start, python-nav-block-end)
(python-nav-forward-sexp-function)
(python-info-current-line-comment-p)
(python-info-current-line-empty-p): New functions.
(python-indent-context): Use `python-nav-statement-start'.

11 years ago* eshell/em-ls.el (eshell/ls): Use `apply'.
Michael Albinus [Mon, 16 Jul 2012 11:42:01 +0000 (13:42 +0200)]
* eshell/em-ls.el (eshell/ls): Use `apply'.

* eshell/em-unix.el (eshell/su, eshell/sudo): Apply Tramp's ad-hoc
multi-hops, instead of Tramp internals.

11 years ago* nsterm.m (keyDown): Interpret flags without left/right bits
Jan Djärv [Mon, 16 Jul 2012 11:02:09 +0000 (13:02 +0200)]
* nsterm.m (keyDown): Interpret flags without left/right bits
as the left key.

Fixes: debbugs:11670

11 years ago* vc/ediff.el (ediff-directories): Add trailing space to prompts.
Michael Albinus [Mon, 16 Jul 2012 10:19:56 +0000 (12:19 +0200)]
* vc/ediff.el (ediff-directories): Add trailing space to prompts.

* vc/ediff-diff.el (ediff-same-file-contents): Handle the case,
when F1 and F2 are located on different hosts.

11 years agoRemove empty and useless init functions.
Dmitry Antipov [Mon, 16 Jul 2012 04:47:31 +0000 (08:47 +0400)]
Remove empty and useless init functions.
* lisp.h (init_character_once, init_fns, init_image)
(init_filelock, init_sound): Remove prototype.
* character.c (init_character_once): Remove.
* filelock.c (init_filelock): Likewise.
* fns.c (init_fns): Likewise.
* image.c (init_image): Likewise.
* sound.c (init_sound): Likewise.
* emacs.c (main): Adjust accordingly.

11 years ago* gtkutil.h: Tiny cleanups.
Dmitry Antipov [Mon, 16 Jul 2012 03:36:46 +0000 (07:36 +0400)]
* gtkutil.h: Tiny cleanups.
(use_old_gtk_file_dialog): Remove useless declaration.
(xg_uses_old_file_dialog): Add suggested const attribute.

11 years agoMerge from gnulib.
Paul Eggert [Sun, 15 Jul 2012 18:18:37 +0000 (11:18 -0700)]
Merge from gnulib.

2012-07-15 pthread_sigmask: fix bug on FreeBSD 9 (Bug#11884)
2012-07-11 gettext: do not assume '#define ... defined ...' behavior

11 years agoFix bug #11943 with slow redisplay in large paragraphs full of weak characters.
Eli Zaretskii [Sun, 15 Jul 2012 14:41:08 +0000 (17:41 +0300)]
Fix bug #11943 with slow redisplay in large paragraphs full of weak characters.

 src/bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
 (bidi_paragraph_init): Use it to limit search forward for a strong
 directional character in abnormally large paragraphs full of
 neutral or weak characters.