* net/tramp-ftp.el:
* net/tramp-sh.el:
* net/tramp-smb.el: Set `tramp-autoload' cookie, and eval after
load "tramp.el" `tramp-set-completion-function'.
Stefan Monnier [Sat, 4 Jun 2011 12:31:34 +0000 (09:31 -0300)]
* lisp/shell.el: Require and use pcomplete.
(shell-dynamic-complete-functions): Add pcomplete-completions-at-point.
(shell-completion-vars): Set pcomplete-default-completion-function.
Eli Zaretskii [Sat, 4 Jun 2011 07:41:44 +0000 (10:41 +0300)]
Support bidi reordering of text covered by display properties.
src/bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
(bidi_fetch_char, bidi_fetch_char_advance): New functions.
(bidi_cache_search, bidi_cache_iterator_state)
(bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
(bidi_level_of_next_char, bidi_move_to_visually_next): Support
character positions inside a run of characters covered by a
display string.
(bidi_paragraph_init, bidi_resolve_explicit_1)
(bidi_level_of_next_char): Call bidi_fetch_char and
bidi_fetch_char_advance instead of FETCH_CHAR and
FETCH_CHAR_ADVANCE.
(bidi_init_it): Initialize new members.
(LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
definitions.
(bidi_explicit_dir_char): Lookup character type in bidi_type_table,
instead of using explicit *_CHAR codes.
(bidi_resolve_explicit, bidi_resolve_weak): Use
FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
bidirectional text is supported only in multibyte buffers.
(bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
it to initialize the frame_window_p member of struct bidi_it.
(bidi_cache_iterator_state, bidi_resolve_explicit_1)
(bidi_resolve_explicit, bidi_resolve_weak)
(bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
bidi_it->nchars is non-positive.
(bidi_level_of_next_char): Don't try to lookup the cache for the
next/previous character if nothing is cached there yet, or if we
were just reseat()'ed to a new position.
src/xdisp.c (set_cursor_from_row): Set start and stop points
according to the row's direction when priming the loop that looks
for the glyph on which to display cursor.
(single_display_spec_intangible_p): Function deleted.
(display_prop_intangible_p): Reimplement to call
handle_display_spec instead of single_display_spec_intangible_p.
Accept 3 additional arguments needed by handle_display_spec. This
fixes incorrect cursor motion across display property with complex
values: lists, `(when COND...)' forms, etc.
(single_display_spec_string_p): Support property values that are
lists with the argument STRING its top-level element.
(display_prop_string_p): Fix the condition for processing a
property that is a list to be consistent with handle_display_spec.
(handle_display_spec): New function, refactored from the
last portion of handle_display_prop.
(compute_display_string_pos): Accept additional argument
FRAME_WINDOW_P. Call handle_display_spec to determine whether the
value of a `display' property is a "replacing spec".
(handle_single_display_spec): Accept 2 additional arguments BUFPOS
and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
the display property, but just return a value indicating whether
the display property will replace the characters it covers.
(Fcurrent_bidi_paragraph_direction): Initialize the nchars and
frame_window_p members of struct bidi_it.
(compute_display_string_pos, compute_display_string_end): New
functions.
(push_it): Accept second argument POSITION, where pop_it should
jump to continue iteration.
(reseat_1): Initialize bidi_it.disp_pos.
src/keyboard.c (adjust_point_for_property): Adjust the call to
display_prop_intangible_p to its new signature.
src/dispextern.h (struct bidi_it): New member frame_window_p.
(bidi_init_it): Update prototypes.
(display_prop_intangible_p): Update prototype.
(compute_display_string_pos, compute_display_string_end): Declare
prototypes.
(struct bidi_it): New members nchars and disp_pos. ch_len is now
EMACS_INT.
Stefan Monnier [Wed, 1 Jun 2011 19:32:04 +0000 (16:32 -0300)]
Silence various byte-compiler warnings.
* lisp/emacs-lisp/byte-run.el (make-obsolete-variable): New argument
`access-type' and new obsolescence format.
* lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Adjust to
new format.
(byte-compile-check-variable): New `access-type' argument.
Only warn if the access-type is obsolete.
(byte-compile-dynamic-variable-bind, byte-compile-variable-ref)
(byte-compile-variable-set): Adjust callers.
* lisp/help-fns.el (describe-variable): Adjust to new obsolescence format.
* lisp/mail/sendmail.el (mail-mailer-swallows-blank-line): Only mark
setting it as obsolete.
* lisp/simple.el (minibuffer-completing-symbol):
* lisp/font-lock.el (font-lock-beginning-of-syntax-function): Only mark read
access as obsolete.
* lisp/minibuffer.el (minibuffer-completing-file-name): Don't make it
obsolete yet.
* lisp/international/quail.el (quail-mouse-choose-completion): Remove unused
code referring to obsolete var.
(quail-choose-completion-string): Remove.
* lisp/server.el (server-clients-with, server-kill-buffer-query-function)
(server-kill-emacs-query-function): Silence "unused `proc'" warnings.
* lisp/proced.el (proced-send-signal):
* lisp/emacs-lisp/lisp.el (lisp-complete-symbol):
Replace completion-annotate-function with completion-extra-properties.
Stefan Monnier [Wed, 1 Jun 2011 15:52:35 +0000 (12:52 -0300)]
* lisp/simple.el (goto-line): Use read-number.
(overriding-map-is-bound): Remove.
(saved-overriding-map): Change default.
(save&set-overriding-map): Rename from ensure-overriding-map-is-bound;
Take the map as argument.
(universal-argument, negative-argument, digit-argument): Use it.
(restore-overriding-map): Adjust.
(do-auto-fill): Use fill-forward-paragraph.
(keyboard-quit): Don't signal an error when debug-on-quit is non-nil.
Stefan Monnier [Wed, 1 Jun 2011 15:34:41 +0000 (12:34 -0300)]
* lisp/minibuffer.el (minibuffer-inactive-mode-map): New var.
(minibuffer-inactive-mode): New major mode.
* src/minibuf.c (get_minibuffer, read_minibuf_unwind): Call it.
* lisp/mouse.el (mouse-drag-region): Remove the "mouse-1 pops up
the *Messages* buffer" hack.
(mouse-popup-menubar): Don't burp if the event is a normal key.
Gnus developers [Tue, 31 May 2011 22:08:51 +0000 (22:08 +0000)]
Merge changes made in Gnus trunk.
gnus.texi (Store custom flags and keywords): Refer to `gnus-registry-article-marks-to-{chars,names}' instead of `gnus-registry-user-format-function-{M,M2}'.
shr.el (shr-rescale-image): Add an :ascent of 100 to images so that the underline comes at the bottom.
gnus-registry.el (gnus-registry-article-marks-to-chars): Rename from `gnus-registry-user-format-function-M' and declare the latter obsolete.
(gnus-registry-article-marks-to-names): Rename from `gnus-registry-user-format-function-M2'.
shr.el (shr-browse-image): Copy the URL if called interactively.
Stefan Monnier [Tue, 31 May 2011 21:40:30 +0000 (18:40 -0300)]
* lisp/minibuffer.el (complete-with-action): Return nil for the metadata and
boundaries of non-functional tables.
(completion-table-dynamic): Return nil for the metadata.
(completion-table-with-terminator): Add default case, using
complete-with-action.
(completion--metadata): New function.
(completion-all-sorted-completions, minibuffer-completion-help): Use it
to try and avoid pathological performance problems.
(completion--embedded-envvar-table): Return `category' metadata.
Dan Nicolaescu [Tue, 31 May 2011 14:52:10 +0000 (07:52 -0700)]
Don't force ./temacs to start in terminal mode.
* frame.c (make_initial_frame): Initialize faces in all cases, not
only when CANNOT_DUMP is defined.
* dispnew.c (init_display): Remove CANNOT_DUMP condition.
Martin Rudalics [Tue, 31 May 2011 08:51:21 +0000 (10:51 +0200)]
Minor fixes in window resizing routines and documentation update.
* window.c (Fsplit_window_internal): Make all arguments
mandatory. Rewrite doc-string. Simplify code.
* window.el (ignore-window-parameters, window-size-fixed):
Rewrite doc-strings.
(window-min-delta-1, window-min-delta): Reorder. Minor rewrite.
(resize-subwindows-normal): Use zerop when checking other-delta.
Call window-min-delta with NODOWN argument nil.
(adjust-window-trailing-edge): Fix doc-string.
(other-window): Fix doc-string and respect
ignore-window-parameters.
(delete-window, delete-other-windows): Fix doc-strings. Remove
-function postfix from associated window parameters.
(quit-restore-window): Resize only if buffer was in
temp-buffer-resize-mode.
(window-split-min-size): Rewrite doc-string.
(split-window): Rewrite doc-string. Rename horflag to
horizontal. Major rewrite of size calculations. Remove
-function postfix from associated window parameter.
(window-state-put-1, display-buffer-split-window-1): Rename
horflag to horizontal.
(same-window-p): Remove call to non-existent function.
* windows.texi (Windows and Frames, Window Sizes)
(Resizing Windows): Minor rewrites.
(Splitting Windows): Provide additional examples. Rewrite
parts on window-splits and window-nest.
(Deleting Windows, Window Parameters, Side Windows): Minor
rewrites.
Paul Eggert [Tue, 31 May 2011 06:05:00 +0000 (23:05 -0700)]
Remove arbitrary limit of 2**31 entries in hash tables.
* category.c (hash_get_category_set): Use 'EMACS_UINT' and 'EMACS_INT'
for hashes and hash indexes, instead of 'unsigned' and 'int'.
* ccl.c (ccl_driver): Likewise.
* charset.c (Fdefine_charset_internal): Likewise.
* charset.h (struct charset.hash_index): Likewise.
* composite.c (get_composition_id, gstring_lookup_cache):
(composition_gstring_put_cache): Likewise.
* composite.h (struct composition.hash_index): Likewise.
* dispextern.h (struct image.hash): Likewise.
* fns.c (next_almost_prime, larger_vector, cmpfn_eql):
(cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql):
(hashfn_equal, hashfn_user_defined, make_hash_table):
(maybe_resize_hash_table, hash_lookup, hash_put):
(hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE):
(sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
(Fsxhash, Fgethash, Fputhash, Fmaphash): Likewise.
* image.c (make_image, search_image_cache, lookup_image):
(xpm_put_color_table_h): Likewise.
* lisp.h (struct Lisp_Hash_Table): Likewise, for 'count', 'cmpfn',
and 'hashfn' members.
* minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
Likewise.
* print.c (print): Likewise.
* alloc.c (allocate_vectorlike): Check for overflow in vector size
calculations.
* ccl.c (ccl_driver): Check for overflow when converting EMACS_INT
to int.
* fns.c, image.c: Remove unnecessary static decls that would otherwise
need to be updated by these changes.
* fns.c (make_hash_table, maybe_resize_hash_table): Check for integer
overflow with large hash tables.
(make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
(SXHASH_REDUCE): New macro.
(sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
Use it instead of discarding useful hash info with large hash values.
(sxhash_float): New function.
(sxhash): Use it. No more need for "& INTMASK" due to above changes.
* lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
(MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK): Rewrite
to use FIXNUM_BITS, as this simplifies things.
(next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
Adjust signatures to match updated version of code.
(consing_since_gc): Now EMACS_INT, since a single hash table can
use more than INT_MAX bytes.
Dan Nicolaescu [Tue, 31 May 2011 05:12:19 +0000 (22:12 -0700)]
Make it possible to run ./temacs.
* callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
syms_of_callproc does the same thing. Remove test for
"initialized", do it in the caller.
* emacs.c (main): Avoid calling set_initial_environment when dumping.
Stefan Monnier [Tue, 31 May 2011 03:03:38 +0000 (00:03 -0300)]
* lisp/minibuffer.el: Add metadata method to completion tables.
(completion-category-overrides): New defcustom.
(completion-metadata, completion--field-metadata)
(completion-metadata-get, completion--styles)
(completion--cycle-threshold): New functions.
(completion-try-completion, completion-all-completions):
Add `metadata' argument to choose completion-styles.
(completion--do-completion): Use metadata to choose cycling.
(completion-all-sorted-completions): Use metadata for sorting.
Remove :completion-cycle-penalty which is not needed any more.
(completion--try-word-completion): Add `metadata' argument.
(minibuffer-completion-help): Check metadata for annotation function
and sorting.
(completion-file-name-table): Return `category' metadata.
(minibuffer-completing-file-name): Make obsolete.
* lisp/simple.el (minibuffer-completing-symbol): Make obsolete.
* lisp/icomplete.el (icomplete-completions): Pass new `metadata' param to
completion-try-completion.
* src/minibuf.c (Finternal_complete_buffer): Return `category' metadata.
(read_minibuf): Use get_minibuffer.
(syms_of_minibuf): Use DEFSYM.
(Qmetadata): New var.
* src/data.c (Qbuffer): Don't make it static.
(syms_of_data): Use DEFSYM.
gnus-group.el (gnus-group-mark-article-read): It's possible that we want to have `gnus-newsgroup-unselected' kept sorted. If this isn't done, then unselected articles may be marked as read.
pop3.el (pop3-open-server): Erase the buffer after the greeting, since not doing this seems to lead to a race condition in pop3-logon.
nnvirtual.el (nnvirtual-request-article): Bind `gnus-command-method' so that the call chain it correct when we call "upwards".
gnus-sum.el (gnus-select-newsgroup): Auto-expiry doesn't make sense in read-only groups.
gnus-group.el (gnus-group-mark-article-read): Ditto.
message.el (message-cite-reply-position): Doc string fix.
nnimap.el (nnimap-transform-headers): Simplify regexp to hopefully avoid regexp overflow.
(nnimap-transform-split-mail): Ditto.
pop3.el (pop3-retr): Error out if the server closes the connection.
Stefan Monnier [Mon, 30 May 2011 17:21:59 +0000 (14:21 -0300)]
* lisp/gnus/mml1991.el (mml1991-mailcrypt-encrypt): Remove use of ill-designed
mm-with-unibyte-current-buffer. The buffer should not contain any
multibyte chars anyway at this stage.
Paul Eggert [Mon, 30 May 2011 16:47:35 +0000 (09:47 -0700)]
[ChangeLog]
Malloc failure behavior now depends on size of allocation.
* lib/allocator.h (struct allocator.die): New size arg.
* lib/careadlinkat.c (careadlinkat): Pass size to 'die' function.
If the actual problem is an ssize_t limitation, not a size_t or
malloc failure, fail with errno == ENAMETOOLONG instead of calling 'die'.
[src/ChangeLog]
Malloc failure behavior now depends on size of allocation.
* alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
* lisp.h: Change signatures accordingly.
* alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
All callers changed.