Paul Eggert [Sun, 4 Aug 2013 16:56:56 +0000 (09:56 -0700)]
Fix some minor races in hosts lacking mkostemp.
Gnulib's emulation of mkostemp doesn't have races that Emacs's does.
* configure.ac (mkostemp): Remove check for this function;
gnulib does the check now.
(mkstemp): Remove check for this no-longer-used function.
* lib/mkostemp.c, lib/secure_getenv.c, lib/tempname.c, lib/tempname.h:
* m4/mkostemp.m4, m4/secure_getenv.m4, m4/tempname.m4:
New files, copied from Gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* admin/merge-gnulib (GNULIB_MODULES): Add mkostemp.
* lib-src/movemail.c (main):
* lib-src/update-game-score.c (write_scores):
Use mkostemp (which now works on all platforms, due to changes
in the portability layer) rather than mktemp (which has a race)
or mkstemp (which we no longer bother with).
* src/callproc.c (create_temp_file):
* src/filelock.c (create_lock_file):
Assume mkostemp, since it's now provided by Gnulib.
Eli Zaretskii [Sun, 4 Aug 2013 15:32:12 +0000 (18:32 +0300)]
Implement mkostemp for MS-Windows.
nt/mingw-cfg.site (ac_cv_func_mkostemp): New var with value of "yes".
nt/inc/ms-w32.h (mkostemp): Declare prototype.
nt/config.nt (HAVE_MKOSTEMP): Define to 1.
src/w32.c (mkostemp): New function.
(mktemp): Remove, no longer used. Most of the code reused in mkostemp.
Stefan Monnier [Sun, 4 Aug 2013 06:48:00 +0000 (02:48 -0400)]
* lisp/emacs-lisp/nadvice.el (advice-function-mapc): Rename from advice-mapc.
(advice-mapc): New function, using it.
(advice-function-member-p): New function.
(advice--normalize): Store the cdr in advice--saved-rewrite since
that's the part that will be changed.
(advice--symbol-function): New function.
(advice-remove): Handle removal before the function is defined.
Adjust to new advice--saved-rewrite.
(advice-member-p): Use advice-function-member-p and
advice--symbol-function.
Dmitry Antipov [Sun, 4 Aug 2013 04:07:18 +0000 (08:07 +0400)]
* dispnew.c (glyph_matrix_count, glyph_pool_count):
Move under GLYPH_DEBUG and ENABLE_CHECKING.
(new_glyph_matrix, free_glyph_matrix, new_glyph_pool)
(free_glyph_pool, check_glyph_memory): Likewise for
all users. Adjust comments where appropriate.
lisp/desktop.el (desktop-clear): Be more careful about deleting frames.
Do it only when called interactively and desktop-restore-frames is non-nil.
Doc fix.
(desktop-read): Set desktop-saved-frameset to nil.
Paul Eggert [Sat, 3 Aug 2013 21:09:57 +0000 (14:09 -0700)]
* composite.h: Minor fixups.
(composition_registered_p): Rename from COMPOSITION_REGISTERD_P
to fix a misspelling, and change it to an inline function while
we're at it (it need not be a macro). All uses changed.
(composition_method, composition_valid_p):
Rewrite to avoid assignments in if-conditions.
Glenn Morris [Sat, 3 Aug 2013 01:02:51 +0000 (21:02 -0400)]
icalendar-tests.el tweaks related to timezone handling
* test/automated/icalendar-tests.el (icalendar-tests--test-export)
(icalendar-tests--test-import):
Use getenv/setenv rather than set-time-zone-rule.
(icalendar-tests--test-import): Reset zone even if error occurred.
Stefan Monnier [Fri, 2 Aug 2013 21:16:33 +0000 (17:16 -0400)]
Make defvar affect the default binding outside of any let.
* src/eval.c (default_toplevel_binding): New function.
(Fdefvar): Use it.
(unbind_to, backtrace_eval_unrewind): Do a bit of CSE simplification.
(Fdefault_toplevel_value, Fset_default_toplevel_value): New subrs.
(syms_of_eval): Export them.
* src/data.c (Fdefault_value): Micro cleanup.
* src/term.c (init_tty): Use "false".
* lisp/custom.el (custom-initialize-default, custom-initialize-set)
(custom-initialize-reset, custom-initialize-changed): Affect the
toplevel-default-value (bug#6275, bug#14586).
* lisp/emacs-lisp/advice.el (ad-compile-function): Undo previous workaround
for bug#6275.
* test/automated/core-elisp-tests.el: New file.
2013-08-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus-group.el (gnus-group-delete-articles): Allow deleting only "old"
articles.
* gnus-delay.el (gnus-delay-article): Run `message-send-hook' so that
we can get spell-checking etc.
Dmitry Antipov [Fri, 2 Aug 2013 13:22:23 +0000 (17:22 +0400)]
Fix X GC leak in GTK and raw (no toolkit) X ports.
* xterm.c (x_free_frame_resources): If white and black relief
GCs are allocated, always free them here.
* xfns.c (x_make_gc): Omit redundant initialization.
* widget.c (create_frame_gcs): Remove the leftover.
(EmacsFrameDestroy): Do nothing because all GCs are now freed
in x_free_frame_resources.
Jan Djärv [Fri, 2 Aug 2013 09:42:23 +0000 (11:42 +0200)]
* nsterm.h (EmacsView): Add maximizing_resize, put it and old_title
inside NS_IMPL_COCOA.
* nsterm.m (windowWillResize:toSize:): Only change title if
! maximizing_resize && FULLSCREEN_NONE. strdup title before
modifying it.
(viewDidEndLiveResize): New method.
Dmitry Antipov [Fri, 2 Aug 2013 07:07:08 +0000 (11:07 +0400)]
* insdel.c (adjust_after_replace, replace_range, del_range_2):
Do not check whether undo is enabled because record_insert and
record_delete does that themselves.
lisp/desktop.el: Move code related to saving frames to frameset.el.
Require frameset.
(desktop-restore-frames): Doc fix.
(desktop-restore-reuses-frames): Rename from
desktop-restoring-reuses-frames.
(desktop-saved-frameset): Rename from desktop-saved-frame-states.
(desktop-clear): Clear frames too.
(desktop-filter-parameters-alist): Set from frameset-filter-alist.
(desktop--filter-tty*, desktop-save, desktop-read):
Use frameset functions.
(desktop-before-saving-frames-functions, desktop--filter-*-color)
(desktop--filter-minibuffer, desktop--filter-restore-desktop-parm)
(desktop--filter-save-desktop-parm, desktop--filter-iconified-position)
(desktop-restore-in-original-display-p, desktop--filter-frame-parms)
(desktop--process-minibuffer-frames, desktop-save-frames)
(desktop--reuse-list, desktop--compute-pos, desktop--move-onscreen)
(desktop--find-frame, desktop--select-frame, desktop--make-frame)
(desktop--sort-states, desktop-restoring-frames-p)
(desktop-restore-frames): Remove. Most code moved to frameset.el.
(desktop-restoring-frameset-p, desktop-restore-frameset)
(desktop--check-dont-save, desktop-save-frameset): New functions.
(desktop--app-id): New constant.
(desktop-first-buffer, desktop-buffer-ok-count)
(desktop-buffer-fail-count): Move before first use.
lisp/frameset.el: New file.
Dmitry Antipov [Fri, 2 Aug 2013 03:55:24 +0000 (07:55 +0400)]
* xterm.h (struct x_output) [HAVE_X_I18N]: Remove xic_base_fontname
member which is not really used any more.
(FRAME_XIC_BASE_FONTNAME): Remove.
* xfns.c (xic_free_fontset): Adjust user.
* xmenu.c (mouse_position_for_popup, x_activate_menubar)
(update_frame_menubar, set_frame_menubar, free_frame_menubar)
(create_and_show_popup_menu, xmenu_show, create_and_show_dialog)
(xdialog_show): Use eassert for debugging check.
Stefan Monnier [Thu, 1 Aug 2013 23:18:37 +0000 (19:18 -0400)]
* lisp/files.el: Use lexical-binding.
(dir-locals-read-from-file): Remove unused `err' variable.
(hack-dir-local-variables--warned-coding): New var.
(hack-dir-local-variables): Use it to avoid repeated warnings.
(make-backup-file-name--default-function): New function.
(make-backup-file-name-function): Use it as default.
(buffer-stale--default-function): New function.
(buffer-stale-function): Use it as default.
(revert-buffer-insert-file-contents--default-function): New function.
(revert-buffer-insert-file-contents-function): Use it as default.
(insert-directory): Avoid add-to-list.
* lisp/autorevert.el (auto-revert-handler): Simplify.
Use buffer-stale--default-function.
Gnus developers [Thu, 1 Aug 2013 22:58:40 +0000 (22:58 +0000)]
Merge changes made in Gnus master
2013-08-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Basic Usage): Mention that warp means jump here.
(The notmuch Engine): Mention notmuch.
2013-08-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
* message.el (message-ignored-news-headers): Delete X-Gnus-Delayed
before sending.
* dgnushack.el (dgnushack-compile): Add a temporary check for
gnus-icalendar.
* mm-decode.el (mm-command-output): New face.
(mm-display-external): Use it.
2013-08-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus-icalendar.el (gnus-icalendar-event:inline-reply-buttons):
Include `handle' parameter.
2013-08-01 Jan Tatarik <jan.tatarik@gmail.com>
* gnus-icalendar.el: New file.
2013-08-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus-int.el (gnus-warp-to-article): Mention that warp means jump.
* gnus-uu.el (gnus-uu-mark-thread, gnus-uu-unmark-thread): Work with
dummy roots, too.
2013-08-01 David Edmondson <dme@dme.org>
* mml2015.el (mml2015-epg-key-image-to-string): Protect against bugging
out on ttys.
2013-08-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus-start.el (gnus-dribble-save): Only save the dribble file if it's
not empty.
Dmitry Antipov [Thu, 1 Aug 2013 16:09:20 +0000 (20:09 +0400)]
Fix last font-related change.
* w32font.h (w32font_list_internal, w32font_match_internal):
Fix prototype.
* w32uniscribe.c (uniscribe_list, uniscribe_match):
(uniscribe_list_family): Adjust to match font API change.
MS-Windows breakage reported by Juanma Barranquero <lekktu@gmail.com>
at http://lists.gnu.org/archive/html/emacs-devel/2013-08/msg00006.html.
Tassilo Horn [Thu, 1 Aug 2013 12:58:28 +0000 (14:58 +0200)]
Refactor out setting `whitespace-indent-tabs-mode' and
`whitespace-tab-width' buffer-locally to own function, so that
`whitespace-cleanup' and friends work appropriately without
needing to enable `whitespace-mode'.
* whitespace.el (whitespace-ensure-local-variables): New function.
(whitespace-cleanup-region): Call it.
(whitespace-turn-on): Call it.
Michael Albinus [Thu, 1 Aug 2013 11:10:31 +0000 (13:10 +0200)]
Complete file name handlers.
* net/tramp.el (tramp-handle-set-visited-file-modtime)
(tramp-handle-verify-visited-file-modtime)
(tramp-handle-file-notify-rm-watch): New functions.
(tramp-call-process): Do not bind `default-directory'.
* net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order
alphabetically.
[file-notify-rm-watch ]: Use default Tramp handler.
[executable-find]: Remove private handler.
(tramp-do-copy-or-rename-file-out-of-band): Do not bind
`default-directory'.
(tramp-sh-handle-executable-find)
(tramp-sh-handle-file-notify-rm-watch): Remove functions.
(tramp-sh-file-gvfs-monitor-dir-process-filter)
(tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path):
Do not use `format' in `tramp-message'.
* net/tramp-smb.el (tramp-smb-file-name-handler-alist)
[file-notify-rm-watch, set-visited-file-modtime]:
[verify-visited-file-modtime]: Add handler.
(tramp-smb-call-winexe): Do not bind `default-directory'.
Dmitry Antipov [Thu, 1 Aug 2013 06:38:49 +0000 (10:38 +0400)]
Do not use pure Xism x_wm_set_icon_position in non-X ports.
* frame.c (x_set_frame_parameters): Call to x_wm_set_icon_position
only if HAVE_X_WINDOWS is in use.
* frame.h (x_set_frame_parameters): Move under HAVE_X_WINDOWS.
* nsterm.m (x_wm_set_icon_position): Remove no-op.
* w32term.c (x_wm_set_icon_position): Likewise.
* w32fns.c (x_icon): Adjust user.
Dmitry Antipov [Thu, 1 Aug 2013 05:56:20 +0000 (09:56 +0400)]
* xterm.c (x_flush): Call XFlush once per each X display, not
frame. This is better because this code always unconditionally
skips non-X frames in Vframe_list and issues the only XFlush if
we have more than one X frame on the same X display.
Drop unnecessary functions that deals with frame pixel size.
* frame.h, msdos.h, w32term.h, xterm.h (x_pixel_width)
(x_pixel_height): Drop prototypes.
* msdos.c, nsfns.m, w32fns.c, xfns.c (x_pixel_width)
(x_pixel_height): Drop implementations.
* frame.c (Fframe_pixel_height): Use FRAME_PIXEL_HEIGHT
which should be always valid for window frame.
(Frame_pixel_width): Likewise with FRAME_PIXEL_WIDTH.
* w32menu.c (Fx_popup_dialog):
* xmenu.c (Fx_popup_dialog): Likewise for both.
* lisp/vc/log-view.el (log-view-diff): Extract `log-view-diff-common',
use it.
(log-view-diff-changeset): Same.
(log-view-diff-common): Call backend command `previous-revision'
to find out the previous revision, in both cases. Swap the
variables `to' and `fr', so that `fr' usually refers to the
earlier revision.
* frame.c (Fset_frame_height, Fset_frame_width): Mention nil frame in docstring.
(Fset_frame_size, Fset_frame_position): Use decode_live_frame and mention nil
frame in docstring.
* ibuf-ext.el (ibuffer-filter-by-filename): Make it work with dired buffers too.
Ref: http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00573.html
2013-07-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus-start.el (gnus-read-active-for-groups): Always mark the data as
dirty to ensure nnimap data being saved.
2013-07-30 Tassilo Horn <tsdh@gnu.org>
* gnus-sum.el (gnus-summary-make-menu-bar): Add "Current thread score"
menu entry.
* gnus-score.el (gnus-summary-current-score): Use prefix arg to show
the current thread's total score instead of the current article's
score.
* xfaces.c (make_face_cache): For struct face_cache, prefer
xmalloc to xzalloc and so avoid redundant call to memset.
(Finternal_set_lisp_face_attribute): Fix comment typo and style.
Gnus: Improve subthread sorting;
make subthread sorting customizable and add docs for it
* doc/misc/gnus.texi (Sorting the Summary Buffer): Document new defcustom
`gnus-subthread-sort-functions' and remove the obsolete documentation
of `gnus-sort-threads-recursively'.
* lisp/gnus/gnus-sum.el (gnus-sort-subthreads-recursive): New function.
(gnus-sort-threads-recursive): Use it.
(gnus-sort-threads): Unconditionally call `gnus-sort-threads-recursive'
again. Now that determines how to sort subthreads.