bpt/emacs.git
11 years agoRevert 2013-01-25T10:27:16Z!eliz@gnu.org.
Eli Zaretskii [Fri, 25 Jan 2013 14:38:21 +0000 (16:38 +0200)]
Revert 2013-01-25T10:27:16Z!eliz@gnu.org.

11 years ago* autorevert.el (auto-revert-remote-files)
Michael Albinus [Fri, 25 Jan 2013 13:15:22 +0000 (14:15 +0100)]
* autorevert.el (auto-revert-remote-files)
(auto-revert-notify-exclude-dir-regexp): New defcustoms.
(auto-revert-notify-enabled, auto-revert-use-notify)
(auto-revert-notify-watch-descriptor-hash-list)
(auto-revert-notify-modified-p, auto-revert-notify-event-p)
(auto-revert-notify-event-descriptor)
(auto-revert-notify-event-action)
(auto-revert-notify-event-file-name): Doc fix.
(global-auto-revert-mode): Reorder checks.
(auto-revert-notify-rm-watch): Respect changed values of
`auto-revert-notify-watch-descriptor-hash-list'.
(auto-revert-notify-add-watch): Check for
`auto-revert-notify-exclude-dir-regexp'.  Adapt filters for
`inotify-add-watch'.  Watch `default-directory' instead of
`buffer-file-name'.  `auto-revert-notify-watch-descriptor-hash-list'
has a changed meaning now.  (Bug#13540)
(auto-revert-notify-handler): Change implementation wrt events
returning from a directory.
(auto-revert-handler): Reorder implementation for checks of remote
files.
(auto-revert-buffers): Fix parentheses error.

11 years agow32.c (readlink): Support DBCS codepages.
Eli Zaretskii [Fri, 25 Jan 2013 10:27:16 +0000 (12:27 +0200)]
w32.c (readlink): Support DBCS codepages.

11 years agoUpdate doc string of w32notify-add-watch per discussions in bug #13540.
Eli Zaretskii [Fri, 25 Jan 2013 09:39:47 +0000 (11:39 +0200)]
Update doc string of w32notify-add-watch per discussions in bug #13540.

 src/w32notify.c (Fw32notify_add_watch): Doc fix.

11 years ago* font.c (num_fonts): Remove the leftover from old
Dmitry Antipov [Fri, 25 Jan 2013 06:31:41 +0000 (10:31 +0400)]
* font.c (num_fonts): Remove the leftover from old
debugging code.  Adjust comment style here and there.

11 years agoMerge from emacs-24; up to 2012-12-11T18:52:31Z!monnier@iro.umontreal.ca
Glenn Morris [Fri, 25 Jan 2013 04:41:39 +0000 (20:41 -0800)]
Merge from emacs-24; up to 2012-12-11T18:52:31Z!monnier@iro.umontreal.ca

11 years ago* paren.el (show-paren-function): Make sure to set 'priority and
Bastien Guerry [Thu, 24 Jan 2013 21:19:02 +0000 (22:19 +0100)]
* paren.el (show-paren-function): Make sure to set 'priority and
'face only if the overlay does exist.

11 years ago* net/tramp.el (tramp-tramp-file-p): Check, whether NAME is unibyte.
Michael Albinus [Thu, 24 Jan 2013 09:50:02 +0000 (10:50 +0100)]
* net/tramp.el (tramp-tramp-file-p): Check, whether NAME is unibyte.

* net/tramp-sh.el (tramp-sh-handle-set-file-acl): Do not suppress
basic attributes.
(tramp-sh-handle-set-file-acl): Improve error checking.

11 years ago* tramp.texi (Filename Syntax): Filenames must be unibyte strings.
Michael Albinus [Thu, 24 Jan 2013 09:43:32 +0000 (10:43 +0100)]
* tramp.texi (Filename Syntax): Filenames must be unibyte strings.

11 years ago* nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
Dmitry Antipov [Thu, 24 Jan 2013 05:56:31 +0000 (09:56 +0400)]
* nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
Avoid redundant calls to strlen.

11 years agoDrop async_visible and async_iconified fields of struct frame.
Dmitry Antipov [Thu, 24 Jan 2013 05:41:28 +0000 (09:41 +0400)]
Drop async_visible and async_iconified fields of struct frame.
This is possible because async input is gone; for details, see
http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
* frame.h (struct frame): Remove async_visible and async_iconified
members, convert garbaged to unsigned bitfield.  Adjust comments.
(FRAME_SAMPLE_VISIBILITY): Remove.  Adjust all users.
(SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
* frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
* w32term.c: Ditto.
(w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
properly.  Likewise for obscured.
* xterm.c: Ditto.
(handle_one_xevent): Save visible state go generate ICONIFY_EVENT
properly.
* nsterm.m: Ditto.
(windowDidDeminiaturize): Generate DEICONIFY_EVENT.

11 years ago* src/insdel.c (prepare_to_modify_buffer): Revert last change as suggested
Dmitry Antipov [Thu, 24 Jan 2013 03:34:20 +0000 (07:34 +0400)]
* src/insdel.c (prepare_to_modify_buffer): Revert last change as suggested
in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
* lisp/doc-view.el (doc-view-display): Force mode line update until
all document is converted.  Suggested by Stefan Monnier (Bug#13164).

11 years ago* lisp/progmodes/python.el: Enhancements to header documentation about
Fabián Ezequiel Gallina [Thu, 24 Jan 2013 01:24:09 +0000 (22:24 -0300)]
* lisp/progmodes/python.el: Enhancements to header documentation about
skeletons.

Fixes: debbugs:5716

11 years ago* .bzrignore: add lib-src/blessmail.
Giorgos Keramidas [Wed, 23 Jan 2013 23:49:46 +0000 (15:49 -0800)]
* .bzrignore: add lib-src/blessmail.

11 years ago* imenu.el (imenu-default-create-index-function): Remove useless
Fabián Ezequiel Gallina [Wed, 23 Jan 2013 21:55:46 +0000 (18:55 -0300)]
* imenu.el (imenu-default-create-index-function): Remove useless
infinite loop check.

Fixes: debbugs:13438

11 years ago* src/xdisp.c (message2, message2_nolog): Remove functions.
Stefan Monnier [Wed, 23 Jan 2013 20:07:28 +0000 (15:07 -0500)]
* src/xdisp.c (message2, message2_nolog): Remove functions.
(message3, message3_nolog): Extract nbytes and multibyteness directly
from the string.  Change all callers.
(message3_nolog): Don't set message_enable_multibyte since set_message
will reset it anyway.
(message1, message1_nolog): Use message3.
(vmessage): Use a stack allocated buffer rather than f->message_buf.
(with_echo_area_buffer): Remove last two arguments.  Update all callers.
(set_message): Drop all but the second arg, which has to be a string.
(set_message_1): Simplify now that we know that a1 is NULL and the
second arg is a string.
* src/frame.h (struct frame): Remove `message_buf' field.
Use glyphs_initialized_p instead.
(FRAME_MESSAGE_BUF): Remove macro.
* src/w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
* src/lisp.h (message2, message2_nolog): Remove declarations.
(message3, message3_nolog): Update declarations.
* src/keyboard.c (read_char_minibuf_menu_text)
(read_char_minibuf_menu_width): Remove vars.
(read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
to correctly handle multibyte strings.
* src/frame.c (delete_frame): Don't free message_buf any more.
* src/editfns.c (message_text, message_length): Remove vars.
(Fmessage_box): Don't copy the Lisp string's bytes any longer.
* src/fileio.c (auto_save_error): Use message3 instead of message2.
* src/dispnew.c (adjust_frame_message_buffer): Remove function.

11 years agoFix a bug in the state cache mechanism. Refactor this a bit.
Alan Mackenzie [Wed, 23 Jan 2013 18:58:11 +0000 (18:58 +0000)]
Fix a bug in the state cache mechanism.  Refactor this a bit.

cc-engine.el (c-parse-state-get-strategy): Remove the `cache-pos' element
from the return value.
(c-append-lower-brace-pair-to-state-cache): "Narrow" to end of buffer to
enable proper searching from beyond HERE.
Amend the test for detecting the sought brace pair.  Amend the value
written to the "brace desert cache" when the brace isn't found.
(c-remove-stale-state-cache): Rename `good-pos' to `start-point', and
several other variables analogously.
(c-remove-stale-state-cache-backwards): Change `cache-pos' from a
parameter to a locally calculated variable.
(c-parse-state-1): Change the calling conventions to the two defuns
involving `cache-pos'.

11 years agoFix dimensions of maximized frame on MS-Windows.
Eli Zaretskii [Wed, 23 Jan 2013 16:52:05 +0000 (18:52 +0200)]
Fix dimensions of maximized frame on MS-Windows.

 src/w32term.c (w32fullscreen_hook): Account correctly for the screen
 real estate used for the tool bar, the menu bar, and scroll bar.

11 years agoFix bug #13515 with processing DBCS file names on MS-Windows.
Eli Zaretskii [Wed, 23 Jan 2013 16:11:04 +0000 (18:11 +0200)]
Fix bug #13515 with processing DBCS file names on MS-Windows.

 src/w32.c (max_filename_mbslen): New function.
 (normalize_filename, readdir): Use it to detect locales where ANSI
 encoding of file names uses a double-byte character set (DBCS).
 If a DBCS encoding is used, advance by characters using
 CharNextExA, instead of incrementing a 'char *' pointer.  Use
 _mbslwr instead of _strlwr.

11 years ago* insdel.c (prepare_to_modify_buffer): Force redisplay if
Dmitry Antipov [Wed, 23 Jan 2013 14:49:54 +0000 (18:49 +0400)]
* insdel.c (prepare_to_modify_buffer): Force redisplay if
hidden buffer is prepared to modification (Bug#13164).

11 years ago* paren.el (show-paren-function): Make sure an overlay exists
Bastien Guerry [Wed, 23 Jan 2013 09:43:29 +0000 (10:43 +0100)]
* paren.el (show-paren-function): Make sure an overlay exists
before trying to delete it.  Also use `pos' as a position only
when it is an integer.

See this thread: http://thread.gmane.org/gmane.emacs.devel/156498

11 years ago* lisp/play/gametree.el (gametree-break-line-here): Use point-marker.
Dmitry Antipov [Wed, 23 Jan 2013 08:49:34 +0000 (12:49 +0400)]
* lisp/play/gametree.el (gametree-break-line-here): Use point-marker.
* lisp/mh-e/mh-acros.el (mh-do-at-event-location): Likewise.
* lisp/mh-e/mh-search.el (mh-index-create-imenu-index): Likewise.
* lisp/mh-e/mh-xface.el (mh-x-image-url-display): Likewise.

11 years ago* xml.el (xml-entity-or-char-ref-re): Fix regexp.
Chong Yidong [Wed, 23 Jan 2013 06:25:50 +0000 (14:25 +0800)]
* xml.el (xml-entity-or-char-ref-re): Fix regexp.

This bug was reported by Jae-oh Kim; it was posted to bug-gnu-emacs
but didn't show up in the bug tracker for some reason.  It is a
regression against Emacs 24.2.

11 years agoUndo stray change committed by mistake.
Paul Eggert [Wed, 23 Jan 2013 01:51:49 +0000 (17:51 -0800)]
Undo stray change committed by mistake.

11 years agoMerge from gnulib.
Paul Eggert [Wed, 23 Jan 2013 01:47:44 +0000 (17:47 -0800)]
Merge from gnulib.

11 years agoFix bug #13065 with file selector dialog on Windows 7.
Eli Zaretskii [Tue, 22 Jan 2013 13:30:17 +0000 (15:30 +0200)]
Fix bug #13065 with file selector dialog on Windows 7.

 src/w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
 request of memory reservation to 1.7GB.

11 years ago* window.h (struct window): Change window_end_valid member from
Dmitry Antipov [Tue, 22 Jan 2013 11:48:00 +0000 (15:48 +0400)]
* window.h (struct window): Change window_end_valid member from
Lisp_Object to a bitfield.  Adjust comments.
(wset_window_end_valid): Remove.
* window.c (adjust_window_count): Clear window_end_valid.
(Fwindow_end): Adjust user.  Remove ancient #if 0 code.
(Fwindow_line_height, set_window_buffer, Frecenter)
(Fsplit_window_internal, Fdelete_other_windows_internal)
(Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
* dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
* xdisp.c (check_window_end, reconsider_clip_changes)
(redisplay_internal, mark_window_display_accurate_1, redisplay_window)
(try_window, try_window_reusing_current_matrix, note_mouse_highlight)
(find_first_unchanged_at_end_row, try_window_id): Likewise.

11 years ago* xdisp.c (mark_window_display_accurate): Simplify the loop
Dmitry Antipov [Tue, 22 Jan 2013 11:41:21 +0000 (15:41 +0400)]
* xdisp.c (mark_window_display_accurate): Simplify the loop
assuming that the only one of vchild, hchild or buffer window
slots is non-nil.  Call mark_window_display_accurate_1 for
the leaf windows only.
(mark_window_display_accurate_1): Always assume leaf window.
Adjust comment.

11 years ago* tramp-cmds.el (tramp-bug, tramp-append-tramp-buffers): Mark
Michael Albinus [Tue, 22 Jan 2013 08:49:03 +0000 (09:49 +0100)]
* tramp-cmds.el (tramp-bug, tramp-append-tramp-buffers): Mark
descriptive parts with `display' property.

11 years ago* emacs.c (Qkill_emacs_hook): Now static.
Paul Eggert [Tue, 22 Jan 2013 07:48:59 +0000 (23:48 -0800)]
* emacs.c (Qkill_emacs_hook): Now static.

11 years ago* fileio.c (Finsert_file_contents): Simplify.
Paul Eggert [Tue, 22 Jan 2013 06:10:20 +0000 (22:10 -0800)]
* fileio.c (Finsert_file_contents): Simplify.

Remove unnecessary assignments and tests.

11 years agognus-sum.el (gnus-summary-read-group-1): Debbugs group entry fixups
Lars Magne Ingebrigtsen [Mon, 21 Jan 2013 22:07:34 +0000 (22:07 +0000)]
gnus-sum.el (gnus-summary-read-group-1): Debbugs group entry fixups

11 years agoAnother minor fix in acl_set_file on Windows.
Eli Zaretskii [Mon, 21 Jan 2013 18:00:19 +0000 (20:00 +0200)]
Another minor fix in acl_set_file on Windows.

 src/w32.c (acl_set_file): Don't test for errors unless
 set_file_security returns FALSE.  Avoids spurious errors when
 saving files.

11 years ago* fileio.c (Finsert_file_contents): Revert code introduced at
Dmitry Antipov [Mon, 21 Jan 2013 17:01:09 +0000 (21:01 +0400)]
* fileio.c (Finsert_file_contents): Revert code introduced at
2013-01-18 in favor of the simpler and generally better fix.
Save stack space by removing 'buffer' and reusing 'read_buf'
where appropriate.

11 years agoispell.el: Make sure hunspell specific dict names are used for standard dicts when...
Agustín Martín [Mon, 21 Jan 2013 16:05:30 +0000 (17:05 +0100)]
ispell.el: Make sure hunspell specific dict names are used for standard dicts when using hunspell.

(ispell-hunspell-dictionary-equivs-alist):
  New variable to map standard dict names to hunspell ones.

(ispell-set-spellchecker-params):
  Make sure specific dict names are used for standard dicts with hunspell.

  If a mapping is missing, skip that dictionary.

Fixes: debbugs:13460

11 years ago* textmodes/reftex-cite.el (reftex-format-citation): Add format
Tassilo Horn [Mon, 21 Jan 2013 12:14:56 +0000 (13:14 +0100)]
* textmodes/reftex-cite.el (reftex-format-citation): Add format
chars for note (%N) and url (%U).
* textmodes/reftex-vars.el (reftex-cite-format): Document them.

11 years ago* lisp/frame.el: Bind `f10' in `esc-map' to `toggle-frame-maximized'
Juri Linkov [Mon, 21 Jan 2013 10:45:20 +0000 (12:45 +0200)]
* lisp/frame.el: Bind `f10' in `esc-map' to `toggle-frame-maximized'
in addition to existing separate binding `meta f10' in `global-map'.

Fixes: debbugs:13484

11 years agoImprove XEmacs compatibility.
Michael Albinus [Mon, 21 Jan 2013 09:49:43 +0000 (10:49 +0100)]
Improve XEmacs compatibility.

* net/tramp.el (tramp-replace-environment-variables): Make it a defun.

* net/tramp-adb.el (top): Require `time-date'.
(tramp-adb-ls-output-time-less-p): Use `tramp-time-less-p'.
(tramp-adb-handle-copy-file, tramp-adb-handle-rename-file): Use
`tramp-file-name-handler'.
(tramp-adb-maybe-open-connection): Use
`tramp-compat-set-process-query-on-exit-flag'.

* net/tramp-sh.el (tramp-sh-handle-file-acl): Use
`tramp-compat-funcall'.

* net/tramp-smb.el (tramp-smb-handle-file-acl): Use `looking-at' and
`tramp-compat-funcall'.

11 years ago* net/tramp-adb.el (tramp-adb-handle-start-file-process): Complete
Jürgen Hötzel [Mon, 21 Jan 2013 09:40:51 +0000 (10:40 +0100)]
* net/tramp-adb.el (tramp-adb-handle-start-file-process): Complete
reimplementation using "adb shell command ..." instead of running
remote shell interactively.

11 years agoFixes: debbugs:13505
Andreas Schwab [Sun, 20 Jan 2013 22:59:47 +0000 (23:59 +0100)]
Fixes: debbugs:13505

* src/coding.c (detect_coding_iso_2022): Move back mis-reordered code
at check_extra_latin label.

11 years agoMention in NEWS that scroll-bar-adjust-thumb-portion is for X only. Bug#13503.
Eli Zaretskii [Sun, 20 Jan 2013 18:06:54 +0000 (20:06 +0200)]
Mention in NEWS that scroll-bar-adjust-thumb-portion is for X only.  Bug#13503.

11 years ago* src/doprnt.c: Fix comment.
Paul Eggert [Sun, 20 Jan 2013 17:45:53 +0000 (09:45 -0800)]
* src/doprnt.c: Fix comment.

11 years ago* lisp-mode.el (emacs-lisp-mode-map): Add native profiler menu entries.
Glenn Morris [Sun, 20 Jan 2013 02:40:49 +0000 (18:40 -0800)]
* lisp-mode.el (emacs-lisp-mode-map): Add native profiler menu entries.

11 years agoprofiler.el tweaks
Glenn Morris [Sun, 20 Jan 2013 02:39:59 +0000 (18:39 -0800)]
profiler.el tweaks

* profiler.el (profiler-running-p): New function.
(profiler-cpu-profile): Use profiler-running-p.
(profiler-report-mode-map): Add some more menu entries.

11 years agoComment
Glenn Morris [Sat, 19 Jan 2013 23:59:48 +0000 (15:59 -0800)]
Comment

11 years agoImprove addr2line suggestion.
Paul Eggert [Sat, 19 Jan 2013 22:48:47 +0000 (14:48 -0800)]
Improve addr2line suggestion.

Fixes: debbugs:13445

11 years ago* lisp.h (eabs): Define unconditionally.
Paul Eggert [Sat, 19 Jan 2013 22:33:29 +0000 (14:33 -0800)]
* lisp.h (eabs): Define unconditionally.

The old "#if !defined (eabs)" was an unnecessary revenant of back
when this macro was called "abs".  Document 'eabs' better.

Fixes: debbugs:13419

11 years agoFix typo: addrline -> binutils.
Paul Eggert [Sat, 19 Jan 2013 22:15:03 +0000 (14:15 -0800)]
Fix typo: addrline -> binutils.

11 years ago* trouble.texi (Crashing): Suggest -p for recent addrline.
Paul Eggert [Sat, 19 Jan 2013 22:12:27 +0000 (14:12 -0800)]
* trouble.texi (Crashing): Suggest -p for recent addrline.

Without it, I don't see function names.  Older addrlines will die
out sooner or later, so tailor the suggestion to recent addrline
and put in a comment about older ones.

Fixes: debbugs:13445

11 years agoTweak previous change
Glenn Morris [Sat, 19 Jan 2013 20:58:00 +0000 (12:58 -0800)]
Tweak previous change

11 years ago* lisp/mail/unrmail.el (unrmail): Do not mangle the mbox From line
Glenn Morris [Sat, 19 Jan 2013 20:54:56 +0000 (12:54 -0800)]
* lisp/mail/unrmail.el (unrmail): Do not mangle the mbox From line
fixes 2012-12-07 change.

Fixes: debbugs:13499

11 years agoMerge from emacs-24; up to 2012-12-11T09:51:12Z!dmantipov@yandex.ru
Glenn Morris [Sat, 19 Jan 2013 20:38:13 +0000 (12:38 -0800)]
Merge from emacs-24; up to 2012-12-11T09:51:12Z!dmantipov@yandex.ru

11 years agoFix crashes with lots of overlays.
Eli Zaretskii [Sat, 19 Jan 2013 20:04:33 +0000 (22:04 +0200)]
Fix crashes with lots of overlays.

 src/editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
 segfault when there are lots of overlays.
 src/buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
 when there are lots of overlays.  See
 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
 for the details and a way to reproduce.

11 years ago* fileio.c: Use O_APPEND to append.
Paul Eggert [Sat, 19 Jan 2013 18:58:40 +0000 (10:58 -0800)]
* fileio.c: Use O_APPEND to append.

This corresponds better to the natural interpretation of "append",
and avoids the need to open the output file twice, or to invoke
lseek when APPEND is neither nil nor a number.
This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
(Fwrite_region): Simplify.  Use O_APPEND instead of opening the
file possibly twice, and lseeking to its end; this avoids the
need to lseek on non-regular files.  Do not use O_EXCL and O_TRUNC
at the same time: the combination is never needed and apparently
it doesn't work with DOS_NT.

11 years ago* image-mode.el (image-next-file, image-previous-file): New commands.
Christian Wittern [Sat, 19 Jan 2013 15:22:38 +0000 (23:22 +0800)]
* image-mode.el (image-next-file, image-previous-file): New commands.
(image-mode-map): Bind them to n and p.
(image-mode--images-in-directory): New helper function.

Fixes: debbugs:8453

11 years agoFix size bug on DOS_NT introduced by CIFS workaround.
Paul Eggert [Sat, 19 Jan 2013 12:29:10 +0000 (04:29 -0800)]
Fix size bug on DOS_NT introduced by CIFS workaround.

* fileio.c (Fwrite_region): Use O_BINARY in checking code, too.

Fixes: debbugs:13149

11 years ago* fileio.c (Fwrite_region): Sync diagnostic to previous change.
Paul Eggert [Sat, 19 Jan 2013 12:17:20 +0000 (04:17 -0800)]
* fileio.c (Fwrite_region): Sync diagnostic to previous change.

11 years ago* image-mode.el (image-mode-fit-frame): Add a frame argument.
Chong Yidong [Sat, 19 Jan 2013 10:34:07 +0000 (18:34 +0800)]
* image-mode.el (image-mode-fit-frame): Add a frame argument.
Suggested by Drew Adams.  Handle window decorations;
save and restore the old window configuration.

Fixes: debbugs:7730

11 years agoAllow floating-point file offsets.
Paul Eggert [Sat, 19 Jan 2013 09:59:51 +0000 (01:59 -0800)]
Allow floating-point file offsets.

Problem reported by Vitalie Spinu in
<http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
* doc/lispref/files.texi (Reading from Files, Writing to Files):
Say that file offsets can be numbers, not just integers.
* src/fileio.c (emacs_lseek): Remove.
(file_offset): New function.
(Finsert_file_contents, Fwrite_region): Use it.

11 years ago* emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid aborting on Fsignal.
Chong Yidong [Sat, 19 Jan 2013 08:49:17 +0000 (16:49 +0800)]
* emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid aborting on Fsignal.

Fixes: debbugs:13289

11 years agoMake 'fstat' on MS-Windows behave more like 'stat' and 'lstat'.
Eli Zaretskii [Sat, 19 Jan 2013 07:32:36 +0000 (09:32 +0200)]
Make 'fstat' on MS-Windows behave more like 'stat' and 'lstat'.

 src/w32.c (fstat): Return owner and group like 'stat' and 'lstat' do.

11 years agoMinor fix in acl_set_file.
Eli Zaretskii [Sat, 19 Jan 2013 07:13:19 +0000 (09:13 +0200)]
Minor fix in acl_set_file.

 src/w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
 set_file_security as failure due to insufficient privileges.
 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.

11 years agoWork around bug in CIFS and vboxsf file systems.
Paul Eggert [Sat, 19 Jan 2013 04:44:34 +0000 (20:44 -0800)]
Work around bug in CIFS and vboxsf file systems.

The bug was observed on Ubuntu operating inside a virtual machine,
editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
The workaround introduces a race condition on non-buggy hosts,
but it's an unlikely race and anyway there's a nearly identical
nearby race that can't be fixed.
* fileio.c (valid_timestamp_file_system, timestamp_file_system):
New static vars.
(Fwrite_region): Test for file system time stamp bug.
(init_fileio): New function.
* lisp.h (init_fileio): Declare it.
* emacs.c (main): Call it.

Fixes: debbugs:13149

11 years ago* fileio.c (Finsert_file_contents): Simplify new diagnostic
Paul Eggert [Sat, 19 Jan 2013 00:40:07 +0000 (16:40 -0800)]
* fileio.c (Finsert_file_contents): Simplify new diagnostic

and make it more consistent with other stat-failure diagnostics.

11 years agoPrune erroneous values in dired-get-marked-files
Leo Liu [Fri, 18 Jan 2013 18:35:44 +0000 (02:35 +0800)]
Prune erroneous values in dired-get-marked-files

Fixes: debbugs:13152

11 years ago* lisp/progmodes/js.el: Tweak autoload cookie for alias.
Leo Liu [Fri, 18 Jan 2013 18:22:18 +0000 (02:22 +0800)]
* lisp/progmodes/js.el: Tweak autoload cookie for alias.

11 years agoFix crash when inserting data from non-regular files. See
Dmitry Antipov [Fri, 18 Jan 2013 06:32:12 +0000 (10:32 +0400)]
Fix crash when inserting data from non-regular files.  See
http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
for the error description produced by valgrind.
* fileio.c (read_non_regular): Rename to read_contents.
Free Lisp_Save_Value object used to pass parameters.
(read_non_regular_quit): Rename to read_contents_quit.
(Finsert_file_contents): Redesign internal file reading loop to adjust
gap and end positions after each read and so help make_gap to work
properly.  Do not signal an I/O error too early and so do not leave
not yet decoded characters in a buffer, which was the reason of
redisplay crash.  Use list2 to build return value.  Adjust comments.

11 years agoClose a race when statting and reading files.
Paul Eggert [Fri, 18 Jan 2013 05:12:08 +0000 (21:12 -0800)]
Close a race when statting and reading files.

* fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
This avoids a race if the file is renamed between stat and open.
This race is not the problem originally noted in Bug#13149;
see <http://bugs.gnu.org/13149#73> and later messages in the thread.

11 years ago* doc/emacs/custom.texi (Directory Variables): Fix paren typo.
Glenn Morris [Fri, 18 Jan 2013 01:53:34 +0000 (20:53 -0500)]
* doc/emacs/custom.texi (Directory Variables): Fix paren typo.

11 years ago* autorevert.el (auto-revert-notify-watch-descriptor): Make it
Michael Albinus [Thu, 17 Jan 2013 19:12:40 +0000 (20:12 +0100)]
* autorevert.el (auto-revert-notify-watch-descriptor): Make it
buffer local, again.  This was lost with the fix on 2013-01-12.

11 years agoAuto-commit of generated files.
Glenn Morris [Thu, 17 Jan 2013 11:17:35 +0000 (06:17 -0500)]
Auto-commit of generated files.

11 years ago* eshell/esh-util.el (eshell-path-env): Make it buffer local, in
Jürgen Hötzel [Thu, 17 Jan 2013 10:01:33 +0000 (11:01 +0100)]
* eshell/esh-util.el (eshell-path-env): Make it buffer local, in
order to support several eshell buffers in parallel.

11 years ago* autorevert.el (auto-revert-use-notify): In the :set function, do
Michael Albinus [Thu, 17 Jan 2013 09:06:47 +0000 (10:06 +0100)]
* autorevert.el (auto-revert-use-notify): In the :set function, do
not modify `kill-buffer-hook'.
(auto-revert-notify-rm-watch): Remove
`auto-revert-notify-rm-watch' from `kill-buffer-hook'.
(auto-revert-notify-add-watch): Do not call
`auto-revert-notify-rm-watch', but add it to a buffer local
`kill-buffer-hook'.

11 years ago* lisp.h (toplevel): Add comment about using Lisp_Save_Value
Dmitry Antipov [Thu, 17 Jan 2013 06:29:40 +0000 (10:29 +0400)]
* lisp.h (toplevel): Add comment about using Lisp_Save_Value
objects, related functions and macros.
(make_save_value): Adjust prototype.
(make_save_pointer): New prototype.
(SAFE_NALLOCA): Fix indentation.  Use make_save_pointer.
(SAFE_ALLOCA_LISP): Adjust make_save_value usage.
* alloc.c (format_save_value): Rename to make_save_value.
(make_save_pointer): New function.
(record_xmalloc): Use make_save_pointer.
* dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
* nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
Change users of make_save_value to make_save_pointer.
Likewise for format_save_value and make_save_value.

11 years ago* buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
Dmitry Antipov [Thu, 17 Jan 2013 05:52:13 +0000 (09:52 +0400)]
* buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
(DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
* buffer.c (toplevel, syms_of_buffer): Drop old commented-out
debugging stubs.

11 years agoetags.el fix for bug#13412
Glenn Morris [Thu, 17 Jan 2013 02:07:25 +0000 (21:07 -0500)]
etags.el fix for bug#13412

* lisp/progmodes/etags.el (tags-table-check-computed-list):
Preserve point in tags buffer.

11 years ago* src/fns.c (Frandom): Doc fix.
Glenn Morris [Thu, 17 Jan 2013 02:05:16 +0000 (21:05 -0500)]
* src/fns.c (Frandom): Doc fix.

11 years ago* lisp/emacs-lisp/trace.el (trace--read-args): Use a closure and an honest
Stefan Monnier [Wed, 16 Jan 2013 19:06:15 +0000 (14:06 -0500)]
* lisp/emacs-lisp/trace.el (trace--read-args): Use a closure and an honest
call to `eval' rather than a backquoted lambda.

11 years agoMerge from gnulib.
Paul Eggert [Wed, 16 Jan 2013 17:45:39 +0000 (09:45 -0800)]
Merge from gnulib.

11 years agoAuto-commit of loaddefs files.
Glenn Morris [Wed, 16 Jan 2013 12:21:01 +0000 (07:21 -0500)]
Auto-commit of loaddefs files.

11 years agoAuto-commit of generated files.
Glenn Morris [Wed, 16 Jan 2013 12:17:36 +0000 (07:17 -0500)]
Auto-commit of generated files.

11 years agoAuto-commit of generated files.
Glenn Morris [Wed, 16 Jan 2013 11:17:35 +0000 (06:17 -0500)]
Auto-commit of generated files.

11 years agoNEWS tweak
Glenn Morris [Wed, 16 Jan 2013 08:10:18 +0000 (00:10 -0800)]
NEWS tweak

11 years agoBackport configure.ac message tweak from trunk
Glenn Morris [Wed, 16 Jan 2013 08:08:34 +0000 (00:08 -0800)]
Backport configure.ac message tweak from trunk

11 years ago* configure.ac: Document that --enable-gcc-warnings emits errors.
Paul Eggert [Wed, 16 Jan 2013 06:04:58 +0000 (22:04 -0800)]
* configure.ac: Document that --enable-gcc-warnings emits errors.

Fixes: debbugs:13448

11 years ago* lisp/gnus/smiley.el (smiley-style): Make the file loadable in batch mode.
Glenn Morris [Wed, 16 Jan 2013 02:46:25 +0000 (21:46 -0500)]
* lisp/gnus/smiley.el (smiley-style): Make the file loadable in batch mode.
Not likely to be very useful, of course, but helps with automated testing.

11 years ago* doc/emacs/trouble.texi (Crashing): Not all addr2line have -p. (Bug#13445)
Glenn Morris [Wed, 16 Jan 2013 02:11:10 +0000 (21:11 -0500)]
* doc/emacs/trouble.texi (Crashing): Not all addr2line have -p.  (Bug#13445)

11 years agoDoc fixes related to "(declare (indent symbol))" (bug#13450)
Glenn Morris [Wed, 16 Jan 2013 02:03:06 +0000 (21:03 -0500)]
Doc fixes related to "(declare (indent symbol))" (bug#13450)

* doc/lispref/macros.texi (Indenting Macros):
Fix order of an indent symbol's arguments.

* lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): Doc fix.

11 years ago* doc/emacs/custom.texi (Custom Themes): Fix typo.
Glenn Morris [Wed, 16 Jan 2013 01:47:40 +0000 (20:47 -0500)]
* doc/emacs/custom.texi (Custom Themes): Fix typo.

11 years ago* rmailmm.el (rmail-insert-mime-forwarded-message): Revert 2012-12-29 change
Glenn Morris [Wed, 16 Jan 2013 01:44:11 +0000 (20:44 -0500)]
* rmailmm.el (rmail-insert-mime-forwarded-message): Revert 2012-12-29 change
 Ref:
<http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00360.html>

(Do not merge to trunk)

11 years ago* Makefile.in (install-arch-indep): Put back a chmod
Glenn Morris [Wed, 16 Jan 2013 01:41:31 +0000 (20:41 -0500)]
* Makefile.in (install-arch-indep): Put back a chmod
that was removed 2012-05-19.  (Bug#13430)

11 years ago* src/alloc.c (free_save_value): Now static.
Paul Eggert [Tue, 15 Jan 2013 21:38:58 +0000 (13:38 -0800)]
* src/alloc.c (free_save_value): Now static.

11 years ago* make-docfile.c (write_globals): Make it a bit clearer.
Paul Eggert [Tue, 15 Jan 2013 21:26:01 +0000 (13:26 -0800)]
* make-docfile.c (write_globals): Make it a bit clearer.

This pacifies GCC 4.7.2 when Emacs is configured with
--enable-link-time-optimization and --enable-gcc-warnings.

Fixes: debbugs:13448

11 years ago* keymap.c (map_keymap_internal): Use format_save_value.
Dmitry Antipov [Tue, 15 Jan 2013 10:14:31 +0000 (14:14 +0400)]
* keymap.c (map_keymap_internal): Use format_save_value.
(map_keymap_char_table_item): Adjust accordingly.
* fileio.c (non_regular_fd, non_regular_inserted)
(non_regular_nbytes): Remove.
(Finsert_file_contents): Convert trytry to ptrdiff_t.  Use
format_save_value to pass parameters to read_non_regular.
(read_non_regular): Use XSAVE_ macros to extract parameters.
Adjust comment.
* xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
format_save_value.
(pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.

11 years ago* src/lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow extraction
Dmitry Antipov [Tue, 15 Jan 2013 09:22:25 +0000 (13:22 +0400)]
* src/lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow extraction
from any Lisp_Save_Value slot.  Add type checking.
* src/alloc.c, src/dired.c, src/editfns.c, src/fileio.c, src/ftfont.c:
* src/gtkutil.c, src/keymap.c, src/lread.c, src/nsterm.h, src/nsmenu.c:
* src/xfns.c, src/xmenu.c, src/xselect.c: All users changed.
* admin/coccinelle/xsave.cocci: Semantic patch to adjust users of
XSAVE_POINTER and XSAVE_INTEGER macros.

11 years agoSome convenient bits to deal with Lisp_Save_Values.
Dmitry Antipov [Tue, 15 Jan 2013 08:38:07 +0000 (12:38 +0400)]
Some convenient bits to deal with Lisp_Save_Values.
* lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
(allocate_misc): Remove prototype.
(format_save_value): New prototype.
* alloc.c (allocate_misc): Revert back to static.
(format_save_value): New function to build Lisp_Save_Value
object with the specified internal structure.
(make_save_value): Reimplement using format_save_value.
* editfns.c (save_excursion_save): Use format_save_value.
(save_excursion_restore): Use XSAVE_OBJECT.

11 years ago* lisp/emacs-lisp/advice.el (ad-preactivate-advice): Adjust the cleanup to
Stefan Monnier [Tue, 15 Jan 2013 06:05:22 +0000 (01:05 -0500)]
* lisp/emacs-lisp/advice.el (ad-preactivate-advice): Adjust the cleanup to
the use of nadvice.el.
* lisp/emacs-lisp/nadvice.el (advice--tweak): Make it possible for `tweak'
to return an explicit nil.
(advice--remove-function): Change accordingly.
* test/automated/advice-tests.el: Split up.  Add advice-test-preactivate.

11 years ago* lisp/gnus/nnimap.el (nnimap-keepalive): Don't throw an error if there's no
Stefan Monnier [Tue, 15 Jan 2013 04:26:28 +0000 (23:26 -0500)]
* lisp/gnus/nnimap.el (nnimap-keepalive): Don't throw an error if there's no
more imap process running.

11 years ago* lisp/progmodes/which-func.el (which-function): Silence imenu errors.
Stefan Monnier [Tue, 15 Jan 2013 04:20:13 +0000 (23:20 -0500)]
* lisp/progmodes/which-func.el (which-function): Silence imenu errors.

Fixes: debbugs:13433

11 years ago* progmodes/sql.el: (sql-imenu-generic-expression):
Michael Mauger [Tue, 15 Jan 2013 03:21:56 +0000 (22:21 -0500)]
* progmodes/sql.el: (sql-imenu-generic-expression):
(sql-mode-font-lock-object-name): Match schema qualified names.
(sql-connect): Use string keys.
(sql-product-interactive): Wait for interpreter prompt.
(sql-comint-oracle): Set process coding based on NLS_LANG.