Dmitry Antipov [Tue, 13 Aug 2013 15:29:25 +0000 (19:29 +0400)]
* window.h (WINDOW_FRINGE_EXTENDED_P): New macro.
* nsterm.m (ns_set_vertical_scroll_bar): Use it. Use convenient
bool instead of BOOL.
* w32term.h (struct scroll_bar): Convert fringe_extended_p
from Lisp_Object to bitfield. Adjust comment.
* w32term.c (x_scroll_bar_create): Adjust user.
Use WINDOW_FRINGE_EXTENDED_P and bool for boolean.
* xterm.c (XTset_vertical_scroll_bar): Likewise.
Use bool for boolean.
* xterm.h (struct scroll_bar): Prefer commonly used `unsigned'
to `unsigned int' when defining a bitfield.
Dmitry Antipov [Tue, 13 Aug 2013 14:45:58 +0000 (18:45 +0400)]
* window.h (struct window): Convert left_margin_cols and
right_margin_cols from Lisp_Objects to integers. Adjust comment.
(WINDOW_LEFT_MARGIN_COLS, WINDOW_RIGHT_MARGIN_COLS)
(WINDOW_LEFT_MARGIN_WIDTH, WINDOW_RIGHT_MARGIN_WIDTH):
Adjust users.
* dispnew.c (margin_glyphs_to_reserve): Convert 3rd arg to int.
Adjust comment.
(showing_window_margins_p, update_window_line, update_frame_1):
* fringe.c (draw_fringe_bitmap_1):
* xdisp.c (window_box_width): Adjust users.
* window.c (wset_left_margin_cols, wset_right_margin_cols): Remove.
(adjust_window_margins, set_window_buffer, Fsplit_window_internal):
Use direct assignment.
(Fset_window_configuration, save_window_save, Fwindow_margins):
Convert Lisp_Object to integer and back where appropriate.
(Fset_window_margins): Adjust user. Return t if any margin
was actually changed, and mention this in docstring.
Stefan Monnier [Tue, 13 Aug 2013 13:47:54 +0000 (09:47 -0400)]
* lisp/frameset.el (frameset--make): Rename constructor from make-frameset.
(frameset-p, frameset-valid-p): Don't autoload.
(frameset-valid-p): Use normal accessors.
Dmitry Antipov [Tue, 13 Aug 2013 12:13:04 +0000 (16:13 +0400)]
* window.h (struct window): Convert left_fringe_width
and right_fringe_width from Lisp_Objects to integers.
Adjust comment.
(WINDOW_FRINGE_COLS, WINDOW_LEFT_FRINGE_WIDTH)
(WINDOW_RIGHT_FRINGE_WIDTH): Adjust users.
* window.c (wset_left_fringe_width, wset_right_fringe_width):
Remove.
(make_window): Initialize new integer fields to -1.
(Fsplit_window_internal): Use direct assignment.
(Fset_window_configuration, save_window_save): Convert
Lisp_Object to integer and back where appropriate.
(Fset_window_fringes): Adjust user. Return t if any fringe
was actually changed, and mention this in docstring.
Dmitry Antipov [Tue, 13 Aug 2013 08:58:15 +0000 (12:58 +0400)]
* nsfns.m (x_set_cursor_type):
* w32fns.c (x_set_cursor_type):
* xfns.m (x_set_cursor_type): Do not set cursor_type_changed here...
* xdisp.c (set_frame_cursor_types): ...but in common code.
Dmitry Antipov [Tue, 13 Aug 2013 08:18:11 +0000 (12:18 +0400)]
* font.c (clear_font_cache): New function, stripped from...
(Fclear_font_cache): ...here, which now uses the function
above. Adjust comment.
* font.h (clear_font_cache): Add prototype.
* xfaces.c (clear_face_cache): Use clear_font_cache.
Stefan Monnier [Tue, 13 Aug 2013 02:30:52 +0000 (22:30 -0400)]
* lisp/emacs-lisp/timer.el (timer--time-setter): New function.
(timer--time): Use it as gv-setter.
* lisp/emacs-lisp/gv.el (gv-define-simple-setter): Output warning when
setter is not a symbol.
Eli Zaretskii [Mon, 12 Aug 2013 19:48:04 +0000 (22:48 +0300)]
Fix zlib support on MS-Windows.
configure.ac (HAVE_ZLIB): Don't use -lz on MinGW.
src/decompress.c <zlib_initialized> [WINDOWSNT]: New static variable.
(Fzlib_decompress_region) [WINDOWSNT]: Call init_zlib_functions if
not yet initialized.
lisp/xml.el (xml-parse-tag-1): Use looking-at.
(This reverts change in 2013-08-11T00:07:48Z!lekktu@gmail.com, which breaks the test suite).
https://lists.gnu.org/archive/html/emacs-devel/2013-08/msg00263.html
Eli Zaretskii [Mon, 12 Aug 2013 13:15:01 +0000 (16:15 +0300)]
Fix build with zlib on MS-Windows.
configure.ac (LIBZ): Comment on w32 peculiarities regarding LIBZ.
src/decompress.c [WINDOWSNT]: Include windows.h and w32.h.
(DEF_ZLIB_FN, LOAD_ZLIB_FN) [WINDOWSNT]: New macros. Use them to
define static variables that are pointers to zlib functions to be
dynamically loaded.
(init_zlib_functions) [WINDOWSNT]: New function.
(fn_inflateInit2_, fn_inflate, fn_inflateEnd, fn_inflateInit2):
New macros.
(Fdecompress_gzipped_region, unwind_decompress): Use the fn_*
macros instead of invoking the zlib functions directly.
(syms_of_decompress): DEFSYM Qzlib_dll. Staticpro
Szlib_available_p.
lisp/term/w32-win.el (dynamic-library-alist): Add DLLs for zlib.
Dmitry Antipov [Mon, 12 Aug 2013 09:34:00 +0000 (13:34 +0400)]
Avoid looping over all frame windows to freeze and unfreeze.
* window.h (struct window): Drop frozen_window_start_p.
(freeze_window_starts): Drop prototype.
* frame.h (struct frame): New frozen_window_starts flag.
(FRAME_WINDOWS_FROZEN): New macro.
* window.c (freeze_window_start, freeze_window_starts):
Remove.
(select_window, replace_window): Adjust users.
* xdisp.c (resize_mini_window): Use FRAME_WINDOWS_FROZEN.
(window_frozen_p): New function.
(redisplay_window): Use it.
Paul Eggert [Mon, 12 Aug 2013 07:12:07 +0000 (00:12 -0700)]
Fix some fd issues when running subprocesses.
Fix bugs that can leak files or file descriptors on errors.
Don't unlink open temp files, as that's hard for users to diagnose
when things go awry (e.g., temp disk exhausted).
Don't bother to lock temp files. Check for invalid recursion.
* callproc.c (synch_process_fd): Remove. All uses removed.
(synch_process_tempfile): New var or macro.
(CALLPROC_STDOUT, CALLPROC_STDERR, CALLPROC_PIPEREAD, CALLPROC_FDS):
New constants.
(record_kill_process): New arg, the temp name. All callers changed.
(delete_temp_file): Now just a simple wrapper around unlink.
(call_process_kill): New arg, the call_process_fd array.
Close them all. Clear synch_process_pid. Remove the temp file,
or arrange for it to be removed.
(call_process_cleanup) [MSDOS]: Arg no longer contains file name;
that's been moved to synch_process_tempfile. Caller changed.
Do not remove the tempfile; that's now call_process_kill's
responsibility.
(call_process_cleanup) [!MSDOS]: Do not record unwind-protect for
call_process_kill; the caller now does that.
(call_process_cleanup): Do not close the process fd; that's now
call_process_kill's responsibility.
(Fcall_process): Implement via new function call_process, which
has most of the old body of Fcall_process, but with a different API.
(call_process): New function that does not open or close filefd if
it is nonnegative. Record which fds need to be closed, and let
call_process_kill close (and remove the tempfile, on MSDOS) on error.
Signal an error if invoked recursively (could be done via a hook).
Simplify creation of the tempfile in the MSDOS case.
Don't create the output file until after checking for the executable.
Report any failure to open /dev/null.
Don't open /dev/null for writing twice; once is enough.
Don't create pipe if all output is being discarded or sent to file.
Don't worry about setting up the coding system or reading from the
pipe if all output is being discarded.
Hoist fd_error local into top level, to lessen block nesting.
Don't record deleted pid here; now done by Fcall_process_region.
(Fcall_process) [MSDOS]: Report mktemp failure immediately,
and note its success in synch_process_tempfile.
Do not leak resources when child_setup fails.
(Fcall_process) [!MSDOS && !WINDOWSNT]: Remove duplicate assignment
to child_errno. Remove unnecessary close of fd0; it's close-on-exec.
(create_temp_file): Now returns open fd, with an additional
Lisp_Object * argument to return the name. All callers changed.
Do not close the file; rewind it instead, and leave it open for
the caller. Do not lock the temp file. Unwind-protect the file
and the file-descriptor.
(Fcall_process_region): If the input is /dev/null, unwind-protect it.
If an asynchrounous process, record it here, not in call_process.
(syms_of_callproc) [MSDOS]: Initialize synch_process_tempfile.
* eval.c (set_unwind_protect): New function.
* fileio.c (write_region): New function, generalized from the
old Fwrite_region. Do not lock temp files.
(Fwrite_region): Use it.
* lisp.h (set_unwind_protect, write_region): New decls.
* process.c: Include <verify.h>.
(make_process): Mark fds as initially closed.
(deleted_pid_list): Now a list of pid-filename pairs.
All uses changed.
(close_process_fd): New function.
(SUBPROCESS_STDIN, WRITE_TO_SUBPROCESS, READ_FROM_SUBPROCESS)
(SUBPROCESS_STDOUT, READ_FROM_EXEC_MONITOR, EXEC_MONITOR_OUTPUT):
New constants. Verify that their number matches PROCESS_OPEN_FDS.
(create_process, create_pty, Fmake_serial_process)
(server_accept_connection): Record which fds need to be closed,
and let deactivate_process close them.
(Fmake_network_process): Do not discard the unwind-protect
until it's safe to do so.
(deactivate_process): Close the fds opened by create_process etc.
(Fprocess_send_eof): Adjust to new way of recording open fds.
Report an error if /dev/null can't be opened, instead of aborting.
* process.h (PROCESS_OPEN_FDS): New constant.
(struct Lisp_Process): New member open_fds.
(record_kill_process, record_deleted_pid): Adjust signatures.
(record_deleted_pid): Move decl here ...
* syswait.h (record_deleted_pid): ... from here.
Katsumi Yamaoka [Mon, 12 Aug 2013 05:59:47 +0000 (05:59 +0000)]
lisp/gnus/mm-decode.el (mm-display-external): Run a timer for the temp files deletion after a viwer exits; add a deletion timer for the needsterm case, too
Paul Eggert [Sun, 11 Aug 2013 23:09:26 +0000 (16:09 -0700)]
* decompress.c: Fix bugs with large buffers and weird inputs.
Tune a bit. Reindent as per usual Emacs style.
(BUFFER_SIZE): Remove.
(Fdecompress_gzipped_region): Do not mishandle input buffers with
more than UINT_MAX bytes. Decompress into the gap instead of into
an auto buffer, as this should avoid copying. Return nil if
'inflate' returns Z_NEED_DICT, as we have no dictionary. Do not
set immediate_quit; we shouldn't trust zlib code that much.
Paul Eggert [Sun, 11 Aug 2013 22:58:47 +0000 (15:58 -0700)]
Add --with-zlib to 'configure'.
* configure.ac: Add --with-zlib option to 'configure', so that Emacs
can be built without zlib. Don't assume that -lz is needed on
non-PNG hosts. Mention zlib configuration status in 'configure' output.
Jan Djärv [Sun, 11 Aug 2013 14:57:12 +0000 (16:57 +0200)]
* nsmenu.m (ns_update_menubar): Call fillWithWidgetValue:setDelegate.
(x_activate_menubar): Update the whole menu.
(trackingNotification:): Call ns_check_menu_open if tracking ends.
(menuWillOpen:): Increment trackingMenu. For OSX <= 10.6, exit if
current event is not NSSystemDefined.
Call ns_check_menu_open only if trackingMenu is 2.
(menuDidClose:): New method, decrease trackingMenu.
(fillWithWidgetValue:setDelegate:): New method.
(fillWithWidgetValue:): Call the above.
lisp/*.el: More lexical-binding warnings' cleanups.
* tutorial.el (tutorial--describe-nonstandard-key): Use string-match-p.
(tutorial--detailed-help): Remove unused local variables.
(tutorial--save-tutorial-to): Use ignore-errors.
(help-with-tutorial): Use looking-at-p.
* view.el (view-buffer-other-window, view-buffer-other-frame):
Mark unused arguments.
* xml.el (xml-parse-tag-1, xml-parse-string): Use looking-at-p.
(xml-parse-dtd): Use looking-at-p, string-match-p. Mark unused
argument. Remove unused local variable.
(xml-parse-elem-type): Use string-match-p.
(xml-substitute-numeric-entities): Use ignore-errors.
Paul Eggert [Sat, 10 Aug 2013 15:42:08 +0000 (08:42 -0700)]
Minor string-length refactoring.
* alloc.c (xstrdup): Use memcpy, not strcpy, since the length's known.
* frame.c (make_monitor_attribute_list):
Prefer build_string to strlen + make_string.
lisp/*.el: Remove lexical-binding warnings; additional small cleanups.
* calculator.el (calculator): Mark unused argument.
(calculator-paste, calculator-quit, calculator-integer-p):
Use ignore-errors.
(calculator-string-to-number, calculator-decimal, calculator-exp)
(calculator-op-or-exp): Use string-match-p.
* dired-aux.el (dired-compress): Use ignore-errors.
(dired-do-chxxx, dired-do-chmod, dired-trample-file-versions)
(dired-do-async-shell-command, dired-do-shell-command)
(dired-shell-stuff-it, dired-compress-file, dired-insert-subdir)
(dired-insert-subdir-validate): Use string-match-p.
(dired-map-dired-file-lines, dired-subdir-hidden-p): Use looking-at-p.
(dired-add-entry): Use string-match-p, looking-at-p.
(dired-insert-subdir-newpos): Remove unused local variable.
* dired.el (dired-buffer-more-recently-used-p): Declare.
(dired-insert-set-properties, dired-insert-old-subdirs):
Use ignore-errors.
* filenotify.el (file-notify-callback): Remove unused local variable.
* filesets.el (filesets-error): Mark unused argument.
(filesets-which-command-p, filesets-filter-dir-names)
(filesets-directory-files, filesets-get-external-viewer)
(filesets-ingroup-get-data): Use string-match-p.
* find-file.el (ff-other-file-name, ff-other-file-name)
(ff-find-the-other-file, ff-cc-hh-converter):
Remove unused local variables.
(ff-get-file-name): Use string-match-p.
(ff-all-dirs-under): Use ignore-errors.
* follow.el (follow-comint-scroll-to-bottom): Mark unused argument.
(follow-select-if-visible): Remove unused local variable.
* forms.el (read-file-filter): Move declaration.
(forms--make-format, forms--make-parser, forms-insert-record):
Quote function with #'.
(forms--update): Use string-match-p. Quote function with #'.
* help-mode.el (help-dir-local-var-def): Mark unused argument.
(help-make-xrefs): Use looking-at-p.
(help-xref-on-pp): Use looking-at-p, ignore-errors.
* ibuffer.el (ibuffer-ext-visible-p): Declare.
(ibuffer-confirm-operation-on): Use string-match-p.
* msb.el (msb-item-handler, msb-dired-item-handler):
Mark unused arguments.
* ses.el (ses-decode-cell-symbol)
(ses-kill-override): Remove unused local variable.
(ses-create-cell-variable, ses-relocate-formula): Use string-match-p.
(ses-load): Use ignore-errors, looking-at-p.
(ses-jump-safe): Use ignore-errors.
(ses-export-tsv, ses-export-tsf, ses-unsafe): Mark unused arguments.
* tabify.el (untabify, tabify): Mark unused arguments.
* thingatpt.el (thing-at-point--bounds-of-well-formed-url):
Mark unused argument.
(bounds-of-thing-at-point, thing-at-point-bounds-of-list-at-point)
(thing-at-point-newsgroup-p, form-at-point): Use ignore-errors.
Xue Fuqiao [Sat, 10 Aug 2013 04:58:31 +0000 (12:58 +0800)]
* doc/misc/ido.texi (Working Directories):
(Flexible Matching, Regexp Matching, Find File At Point)
(Ignoring, Misc Customization): Use @defopt for user options.
Eli Zaretskii [Fri, 9 Aug 2013 10:18:48 +0000 (13:18 +0300)]
Define a few variables of obscure types to aid debugging exceptions on Windows.
src/w32.c (PEXCEPTION_POINTERS, PEXCEPTION_RECORD, PCONTEXT): Define
variables of these types so that GDB would know about them, as aid
for debugging fatal exceptions. (Bug#15024) See also
http://sourceware.org/ml/gdb/2013-08/msg00010.html for related
discussions.
Katsumi Yamaoka [Fri, 9 Aug 2013 08:05:56 +0000 (08:05 +0000)]
Gnus: delete temporary files when Gnus exits instead of using timers
lisp/gnus/mm-decode.el (mm-temp-files-to-be-deleted,
mm-temp-files-cache-file): New internal variables.
(mm-temp-files-delete): New function; add it to gnus-exit-gnus-hook.
(mm-display-external): Use it to delete temporary files instead of
using timers.