Stefan Monnier [Tue, 25 Jun 2013 16:13:49 +0000 (12:13 -0400)]
* lisp/emacs-lisp/package.el: Include obsolete packages from archives.
Use lexical-binding.
(package-archive-contents): Change format; include obsolete packages.
(package-desc): Use `dir' to mark builtin packages.
(package--from-builtin): Set the `dir' field to `builtin'.
(generated-autoload-file, version-control): Declare.
(package-compute-transaction): Change first arg and return value to be
lists of package-descs. Adjust to new package-archive-contents format.
(package--add-to-archive-contents): Adjust to new
package-archive-contents format.
(package-download-transaction): Arg is now a list of package-descs.
(package-install): If `pkg' is a package name, pass it as
a requirement, so it is subject to the usual (e.g. disabled) checks.
(describe-package): Accept package-desc as well.
(describe-package-1): Describe a specific package-desc. Add links to
other package-descs for the same package name.
(package-menu-describe-package): Pass the actual package-desc.
(package-menu-mode): Add to tabulated-list-revert-hook so revert-buffer
works correctly.
(package-desc-status): New function.
(package-menu--refresh): New function, extracted
from package-menu--generate.
(package-menu--generate): Use it.
(package-delete): Update package-alist.
(package-menu-execute): Don't call package-initialize.
Stefan Monnier [Tue, 25 Jun 2013 13:07:04 +0000 (09:07 -0400)]
* lisp/files-x.el (read-file-local-variable-value): Use read-from-minibuffer
for values and use read--expression for expressions.
(read-file-local-variable): Avoid setq.
(read-file-local-variable-mode): Use minor-mode-list.
Glenn Morris [Tue, 25 Jun 2013 02:24:32 +0000 (19:24 -0700)]
* test/automated/occur-tests.el (occur-test-create): New function.
Use it to create separate tests for each element, so we run them
all rather than stopping at the first error.
Daiki Ueno [Mon, 24 Jun 2013 07:07:08 +0000 (16:07 +0900)]
epg.el: Add context option `home-directory' and `program'.
* epg.el (epg-make-context): Check if PROTOCOL is valid; embed the
file name of gpg executable.
(epg-context-program): New function.
(epg-context-home-directory): New function.
(epg-context-set-program): New function.
(epg-context-set-home-directory): New function.
(epg--start): Use `epg-context-program' instead of
'epg-gpg-program'.
(epg--list-keys-1): Likewise.
Glenn Morris [Mon, 24 Jun 2013 02:26:57 +0000 (19:26 -0700)]
* doc/misc/eudc.texi (Overview, Creating BBDB Records): Restrict bbdb cross-ref
to info output. It's not very important, and gives broken links in
the html version.
Paul Eggert [Mon, 24 Jun 2013 00:31:31 +0000 (17:31 -0700)]
A more-conservative workaround for Cygwin SIGCHLD issues.
* callproc.c (Fcall_process):
* process.c (create_process):
Make sure SIGCHLD is caught before we fork,
since Emacs startup no arranges to catch SIGCHLD.
* process.c (lib_child_handler): Initialize to null, not to
dummy_handler.
(catch_child_signal): Allow self to be called lazily.
Do nothing if it's already been called.
Assume caller has blocked SIGCHLD (all callers do now).
* emacs.c (main): Do not catch SIGCHLD here; defer it until
just before it's really needed.
* nsterm.m (ns_term_init): No need to re-catch SIGCHLD here,
since it hasn't been caught yet.
lisp/faces.el: Minor changes.
(face-documentation): Simplify.
(read-face-attribute, tty-find-type, x-resolve-font-name):
Use `string-match-p'.
(list-faces-display): Use `string-match-p'. Simplify.
(face-spec-recalc): Check face to avoid face alias loops.
(read-color): Use `string-match-p' and non-capturing parenthesis.
Paul Eggert [Sun, 23 Jun 2013 18:18:47 +0000 (11:18 -0700)]
Try to avoid malloc SEGVs on Cygwin.
* callproc.c, process.h (block_child_signal, unblock_child_signal):
Now extern.
* emacs.c (main): Catch SIGCHLD just before initializing gfilenotify.
* process.c (catch_child_signal): Block SIGCHLD while futzing with
the SIGCHLD handler, since the code is not atomic and (due to glib)
signals may be arriving now.
* sysdep.c (init_signals): Do not catch child signals here;
'main' now does that later, at a safer time.
lisp/emacs-lisp/tabulated-list.el: Fix alignment problem with :pad-right = 0.
(tabulated-list-init-header): Don't skip aligning the next header field when
padding is 0; otherwise, field width is not respected unless the title is as
wide as the field.
Glenn Morris [Sun, 23 Jun 2013 01:48:23 +0000 (18:48 -0700)]
Remove some doc/misc/Makefile.in stuff that is not needed any more
* doc/misc/Makefile.in (HTML_TARGETS, html, emacs-faq.html, emacs-faq):
Remove; not needed now we use a standard html layout for the faq.
(clean): Remove HTML_TARGETS, emacs-faq.text.
Paul Eggert [Sat, 22 Jun 2013 19:01:47 +0000 (12:01 -0700)]
Clean up SIGCHLD handling a bit.
* process.c, process.h (catch_child_signal):
Now always extern, even if !NS_IMPL_GNUSTEP.
* process.c (catch_child_signal): Move glib tickler here from
init_process_emacs, so that it's done earlier in Emacs
initialization. Also move the noninteractive && !initialized
check here from init_process_emacs. This is all a bit cleaner for
GNUish platforms, and I hope it works around the Cygwin bug.
* sysdep.c (init_signals): Invoke catch_child_signal here, so
that glib signal handling is tickled before glib creates threads.
Paul Eggert [Fri, 21 Jun 2013 20:11:44 +0000 (13:11 -0700)]
Use C99-style flexible array members if available.
This avoids some subtle aliasing issues, which typically
aren't a problem with GCC but may be a problem elsewhere.
* lib-src/ebrowse.c (struct member, struct alias, struct sym):
Use FLEXIBLE_ARRAY_MEMBER.
(add_sym, add_member, make_namespace, register_namespace_alias):
Use offsetof (struct, flex_array_member), not sizeof (struct), as
that ports better to pre-C99 non-GCC.
* src/alloc.c (sdata): New typedef, replacing the old struct sdata.
It is a struct if GC_CHECK_STRING_BYTES, a union otherwise.
In either case, it uses a flexible array member rather than
the old struct hack. All uses changed.
(SDATA_NBYTES, sweep_strings) [!GC_CHECK_STRING_BYTES]:
Adjust to sdata reorganization.
* src/alloc.c (VBLOCK_BYTES_MIN, allocate_vectorlike, Fgarbage_collect):
Use offsetof (struct, flex_array_member), not sizeof (struct), as
that ports better to pre-C99 non-GCC.
* src/chartab.c (Fmake_char_table, make_sub_char_table, copy_char_table):
Use CHAR_TABLE_STANDARD_SLOTS rather than its definition,
as the latter has changed.
* src/conf_post.h (FLEXIBLE_ARRAY_MEMBER): Move here from w32.c,
and port better to pre-C99 GCC.
* src/image.c (struct xpm_cached_color):
* src/lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector)
(struct Lisp_Char_Table, struct Lisp_Sub_Char_Table):
Use FLEXIBLE_ARRAY_MEMBER.
* src/lisp.h (string_bytes) [GC_CHECK_STRING_BYTES]:
Move decl to top level so it gets checked against implementation.
(CHAR_TABLE_STANDARD_SLOTS): Adjust to struct Lisp_Char_Table change.
* src/w32.c (FLEXIBLE_ARRAY_MEMBER): Move to conf_post.h.
Eduard Wiebe [Fri, 21 Jun 2013 14:36:13 +0000 (10:36 -0400)]
Extend flymake's warning predicate to be a function. Test suite for flymake.
* lisp/progmodes/flymake.el (flymake-warning-predicate): New.
(flymake-parse-line): Use it.
(flymake-warning-re): Make obsolete alias to
`flymake-warning-predicate'.
* doc/misc/flymake.texi (Parsing the output, Customizable variables):
Add reference to `flymake-warning-predicate'.
* test/automated/flymake-tests.el:
* test/automated/flymake/warnpred/Makefile
* test/automated/flymake/warnpred/test.c
* test/automated/flymake/warnpred/test.pl: New files.
Stefan Monnier [Fri, 21 Jun 2013 14:12:56 +0000 (10:12 -0400)]
* lisp/emacs-lisp/package.el (package-alist): Include obsolete packages.
(package-obsolete-list): Remove.
(package-activate): Remove min-version argument. Add `force' argument.
Adjust to new package-alist format.
(package-mark-obsolete): Remove.
(package-unpack): Force reload of the package's autoloads.
(package-installed-p): Check builtins if the installed package is not
recent enough.
(package-initialize): Don't reset package-obsolete-list.
Don't specify which package version to activate.
(package-process-define-package, describe-package-1)
(package-menu--generate): Adjust to new package-alist format.
Stephen Berman [Fri, 21 Jun 2013 14:02:39 +0000 (16:02 +0200)]
* todo-mode.el: Clean up doc strings, comments and prompt strings,
mainly by changing "Todo" to "todo" when it is not part of a mode
name or does not begin a sentence.
Stephen Berman [Fri, 21 Jun 2013 13:23:51 +0000 (15:23 +0200)]
* todo-mode.el: Offer to convert legacy file. Update commentary.
(todo-show): If a legacy file is found and no new todo file
exists, offer to convert it and show it. Restore autoload cookie.
(todo-convert-legacy-files): Delete unused local variable.
If todo-directory doesn't exist, create it before writing to file.
Check format of converted files. Prompt to show converted todo file.
Glenn Morris [Fri, 21 Jun 2013 07:35:33 +0000 (00:35 -0700)]
cookie1.el small cleanup
Make some funcs interactive, copy some functionality from yow.el.
* lisp/play/cookie1.el (cookie): New custom group.
(cookie-file): New option.
(cookie-check-file): New function.
(cookie): Make it interactive. Make start and end messages optional.
Interactively, display the result. Default to cookie-file.
(cookie-insert): Default to cookie-file.
(cookie-snarf): Make start and end messages optional.
Default to cookie-file. Use with-temp-buffer.
(cookie-read): Rename from read-cookie.
Make start and end messages optional. Default to cookie-file.
(cookie-shuffle-vector): Rename from shuffle-vector. Use dotimes.
(cookie-apropos, cookie-doctor): New functions, copied from yow.el
* lisp/obsolete/yow.el (read-zippyism): Use new name for read-cookie.
Glenn Morris [Fri, 21 Jun 2013 06:32:50 +0000 (23:32 -0700)]
* lisp/url/url-future.el (url-future-call): Remove useless value call.
An earlier version of this function returned the value, ref
http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00708.html
but now it returns the function (see commentary).
Stefan Monnier [Fri, 21 Jun 2013 03:08:47 +0000 (23:08 -0400)]
* lisp/emacs-lisp/package.el: Use tar-mode rather than tar executable.
Consolidate the single-file vs tarball code.
(package-desc-suffix): New function.
(package-desc-full-name): Don't bother inlining it.
(package-load-descriptor): Return the new package-desc.
(package-mark-obsolete): Remove unused arg `package'.
(package-unpack): Make it work for single files as well.
Make it update package-alist.
(package--make-autoloads-and-stuff): Rename from
package--make-autoloads-and-compile. Don't compile any more.
(package--compile): New function.
(package-generate-description-file): New function, extracted from
package-unpack-single.
(package-unpack-single): Remove.
(package--with-work-buffer): Add indentation and debugging info.
(package-download-single): Remove.
(package-install-from-archive): Rename from package-download-tar, make
it take a pkg-desc, and make it work for single files as well.
(package-download-transaction): Simplify.
(package-tar-file-info): Remove `file' arg. Rewrite not to use an
external tar program.
(package-install-from-buffer): Remove `pkg-desc' argument.
Use package-tar-file-info for tar-mode buffers.
(package-install-file): Simplify accordingly.
(package-archive-base): Change to take a pkg-desc.
* lisp/tar-mode.el (tar--check-descriptor): New function, extracted from
tar-get-descriptor.
(tar-get-descriptor): Use it.
(tar-get-file-descriptor): New function.
(tar--extract): New function, extracted from tar-extract.
(tar--extract): Use it.
* lisp/emacs-lisp/package-x.el (package-upload-file): Decode the file, in
case the summary uses non-ascii. Adjust to new calling convention of
package-tar-file-info.
Stefan Monnier [Thu, 20 Jun 2013 20:01:51 +0000 (16:01 -0400)]
* lisp/emacs-lisp/cl-loaddefs.el: Don't version-control any more.
* lisp/emacs-lisp/cl-lib.el: Load cl-macs when cl-loaddefs is not
yet available.
* lisp/Makefile.in (AUTOGEN_VCS): Move cl-loaddefs.el...
(AUTOGENEL): ... here.
* lisp/emacs-lisp/cl-macs.el (cl--sublis): New function.
(cl--defsubst-expand): Use it.
* .bzrignore: Don't unignore cl-loaddefs.el.
Paul Eggert [Thu, 20 Jun 2013 18:59:08 +0000 (11:59 -0700)]
* syntax.c: Integer cleanups.
(SYNTAX_FLAGS_COMMENT_STYLEC): Return a boolean, not 0-or-2.
All uses that need 0-or-2 changed to:
(SYNTAX_FLAGS_COMMENT_STYLEC2): New macro, with the same semantics
as the old SYNTAX_FLAGS_COMMENT_STYLEC.
(struct lisp_parse_state, syntax_prefix_flag_p, update_syntax_table)
(char_quoted, prev_char_comend_first, back_comment)
(Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
(in_classes, forw_comment, scan_lists, scan_sexps_forward):
Use bool for boolean.
(update_syntax_table, skip_chars, skip_syntaxes):
Prefer int to unsigned when either will do.
(back_comment): Return boolean success flag, like forw_comment,
instead of positive-or-minus-1 (which might have overflowed int anyway).
Don't stuff ptrdiff_t into int.
(syntax_spec_code, syntax_code_spec): Now const.
(Fmatching_paren, scan_lists, scan_sexps_forward):
Use enum syntaxcode for syntax code.
(Fmatching_paren): Check that arg is a character, not just an integer.
(Fstring_to_syntax): Don't assume 0377 fits in enum syntaxcode.
(Finternal_describe_syntax_value): Omit no-longer-needed
comparison to 0.
(skip_chars): Use char, not unsigned char, when the distinction
doesn't matter.
(forw_comment, scan_lists): Prefer A |= B to A = A || B when B's cheap.
* bytecode.c (exec_byte_code):
* syntax.c (syntax_spec_code, Fchar_syntax)
(Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
(init_syntax_once):
* syntax.h (SYNTAX_WITH_FLAGS):
Omit unnecessary casts.
Eli Zaretskii [Thu, 20 Jun 2013 17:36:24 +0000 (20:36 +0300)]
Yet another attempt at fixing bugs #14602, 14630, 14669.
src/w32fns.c (w32_wnd_proc): Don't compute the header line and mode
line dimensions here, to avoid race conditions with the main
thread.
src/w32term.c (w32_draw_window_cursor): Compute the header line and
mode line dimensions here.
<w32_system_caret_window, w32_system_caret_hdr_height>:
<w32_system_caret_mode_height>: New variables.
src/w32term.h: Declare them.
Paul Eggert [Thu, 20 Jun 2013 14:47:46 +0000 (07:47 -0700)]
* alloc.c (die): Move "assertion failed" string here ...
* lisp.h (eassert): ... from here. Also, suppress evaluation of
COND when SUPPRESS_CHECKING. This shrinks the executable text
size by 0.8% to 2.2% when configured with --enable-checking,
depending on optimization flags (GCC 4.8.1 x86-64).
Paul Eggert [Thu, 20 Jun 2013 14:15:42 +0000 (07:15 -0700)]
Add log2 support and make log10 obsolete for consistency.
* configure.ac (log2): Check for this function.
* doc/lispref/numbers.texi (Math Functions): Remove obsolete function log10.
* lisp/subr.el (log10): Move here from C code, and declare as obsolete.
All uses of (log10 X) replaced with (log X 10).
* src/floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the
base is 2; this is more accurate.
(Flog10): Move to Lisp (marked obsolete there).