Paul Eggert [Sat, 28 Apr 2012 22:17:27 +0000 (15:17 -0700)]
Do not avoid creating empty evaporating overlays (Bug#9642).
* buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
That is, do not delete an evaporating overlay if it becomes
empty after its bounds are adjusted to fit within its buffer.
This fix caused other problems, and I'm reverting it until we get
to the bottom of them.
Stefan Monnier [Sat, 28 Apr 2012 21:59:08 +0000 (17:59 -0400)]
Avoid the obsolete `assoc' package.
* lisp/speedbar.el (speedbar-refresh): Avoid adelete.
(speedbar-file-lists): Simplify and avoid aput.
* lisp/man.el (Man--sections, Man--refpages): New vars, replacing
Man-sections-alist and Man-refpages-alist.
(Man-build-section-alist, Man-build-references-alist):
Use them; avoid aput.
(Man--last-section, Man--last-refpage): New vars.
(Man-follow-manual-reference): Use them.
Use the `default' arg of completing-read.
(Man-goto-section): Idem. Move prompt to the `interactive' spec.
* lisp/gnus/auth-source.el (auth-source--aput-1, auth-source--aput)
(auth-source--aget): New functions and macros.
Use them instead of aput/aget.
Fix application of menu-bar-mode etc. by X resources.
* lisp/startup.el (x-apply-session-resources): New function.
* lisp/term/ns-win.el (ns-initialize-window-system):
* lisp/term/w32-win.el (w32-initialize-window-system):
* lisp/term/x-win.el (x-initialize-window-system): Use it to properly
set menu-bar-mode and other vars from X resources, even if the initial
frame is not a window-system frame (Bug#2299).
Eli Zaretskii [Thu, 26 Apr 2012 10:07:35 +0000 (13:07 +0300)]
Don't disable Unicode menus on Windows NT and later due to random errors.
src/w32menu.c: Include w32heap.h.
(add_menu_item): If the call to AppendMenuW (via
unicode_append_menu) fails, disable Unicode menus only if we are
running on Windows 9X/Me.
* lisp/vc/diff-mode.el (diff-beginning-of-hunk): Return a meaningful
value, for symmetry with diff-end-of-hunk.
(diff-split-hunk, diff-find-source-location)
(diff-ignore-whitespace-hunk, diff-refine-hunk): Use it.
(diff-bounds-of-hunk, diff-bounds-of-file): New functions.
(diff-restrict-view, diff-hunk-kill, diff-file-kill): Use them to
compute the relevant hunk or file properly.
(diff-file-junk-re): Add bzr's "modified file" tag.
* vc/ediff-wind.el (ediff-setup-windows-default): New function.
(ediff-window-setup-function): Use it as the default, to set up
windows based on whether the current frame is graphical.
(ediff-choose-window-setup-function-automatically): Make obsolete.
Stefan Monnier [Wed, 25 Apr 2012 18:57:09 +0000 (14:57 -0400)]
Remove unnecessary use of minibuffer-completing-file-name.
* lisp/ffap.el: Remove old code for obsolete package.
(ffap-complete-as-file-p): Remove.
* lisp/mh-e/mh-utils.el (minibuffer-completing-file-name): Don't declare.
Stefan Monnier [Wed, 25 Apr 2012 18:53:57 +0000 (14:53 -0400)]
Use completion-table-with-quoting for comint and pcomplete.
* lisp/comint.el (comint--unquote&requote-argument)
(comint--unquote-argument, comint--requote-argument): New functions.
(comint--unquote&expand-filename, comint-unquote-filename): Obsolete.
(comint-quote-filename): Use regexp-opt-charset.
(comint--common-suffix, comint--common-quoted-suffix)
(comint--table-subvert): Remove.
(comint-unquote-function, comint-requote-function): New vars.
(comint--complete-file-name-data): Use them with
completion-table-with-quoting.
* lisp/pcmpl-unix.el (pcomplete/scp): Use completion-table-subvert.
* lisp/pcomplete.el (pcomplete-arg-quote-list)
(pcomplete-quote-arg-hook, pcomplete-quote-argument): Obsolete.
(pcomplete-unquote-argument-function): Default to non-nil.
(pcomplete-unquote-argument): Simplify.
(pcomplete--common-quoted-suffix): Remove.
(pcomplete-requote-argument-function): New var.
(pcomplete--common-suffix): New function.
(pcomplete-completions-at-point): Use completion-table-with-quoting
and completion-table-subvert.
Stefan Monnier [Wed, 25 Apr 2012 18:42:15 +0000 (14:42 -0400)]
* lisp/minibuffer.el: Use completion-table-with-quoting for read-file-name.
(minibuffer--double-dollars): Preserve properties.
(completion--sifn-requote): New function.
(completion--file-name-table): Rewrite using it and c-t-with-quoting.
Stefan Monnier [Wed, 25 Apr 2012 18:40:42 +0000 (14:40 -0400)]
* lisp/minibuffer.el: Add support for completion of quoted/escaped data.
(completion-table-with-quoting, completion-table-subvert): New funs.
(completion--twq-try, completion--twq-all): New functions.
(completion--nth-completion): New function.
(completion-try-completion, completion-all-completions): Use it.
Alex Harsanyi [Wed, 25 Apr 2012 10:28:29 +0000 (12:28 +0200)]
Sync with soap-client repository. Support SOAP simpleType. (Bug#10331)
* soap-client.el (soap-resolve-references-for-sequence-type)
(soap-resolve-references-for-array-type): hack to prevent self
references, see Bug#9.
(soap-parse-envelope): report the contents of the 'detail' node
when receiving a fault reply.
(soap-parse-envelope): report the contents of the entire 'detail' node.
* soap-inspect.el (soap-sample-value-for-simple-type)
(soap-inspect-simple-type): new function
* soap-client.el (soap-simple-type): new struct
(soap-default-xsd-types, soap-default-soapenc-types)
(soap-decode-basic-type, soap-encode-basic-type): support
unsignedInt and double basic types
(soap-resolve-references-for-simple-type)
(soap-parse-simple-type, soap-encode-simple-type): new function
(soap-parse-schema): parse xsd:simpleType declarations
* soap-client.el (soap-default-xsd-types)
(soap-default-soapenc-types): add integer, byte and anyURI types
(soap-parse-complex-type-complex-content): use `soap-wk2l' to find
the local name of "soapenc:Array"
(soap-decode-basic-type, soap-encode-basic-type): support encoding
decoding integer, byte and anyURI xsd types.
Eli Zaretskii [Wed, 25 Apr 2012 08:07:57 +0000 (11:07 +0300)]
Force interactive-mode in GDB on MS-Windows.
lisp/progmodes/gdb-mi.el (gdb-init-1): Condition Windows-specific
settings on 'system-type', not on 'window-system'. On MS-Windows,
set interactive-mode on in GDB.
Michael Albinus [Tue, 24 Apr 2012 17:56:30 +0000 (19:56 +0200)]
* notifications.el (notifications-specification-version): Change to "1.2".
(notifications-notify): Add :action-items, :resident and
:transient hints. Change "image_data" to "image-data" and
"image_path" to "image-path".
(notifications-get-capabilities): Return a list of keywords.
* os.texi (Notifications): Extend possible notification hints.
Stefan Monnier [Tue, 24 Apr 2012 17:06:12 +0000 (13:06 -0400)]
* lisp/progmodes/ruby-mode.el: Simplify last change, and cleanup code.
(ruby-syntax-propertize-regexp): Remove.
(ruby-syntax-propertize-function): Split regexp into chunks.
Match following code directly.
* test/indent/ruby.rb: New file, to test new syntax-propertize code.
* lisp/progmodes/ruby-mode.el: Handle Cucumber defs (bug#6286).
(ruby-syntax-propertize-regexp): New function.
(ruby-syntax-propertize-function): Use it to handle regexp not preceded
by a special keyword.
* lisp/progmodes/ruby-mode.el: Handle general delimited literals.
(ruby-syntax-general-delimiters-goto-beg)
(ruby-syntax-propertize-general-delimiters): New functions.
(ruby-syntax-propertize-function): Use them to handle GDL.
(ruby-font-lock-keywords): Move old handling of GDL...
(ruby-font-lock-syntactic-keywords): .. to here.
(ruby-calculate-indent): Adjust indentation for GDL.
Martin Rudalics [Tue, 24 Apr 2012 08:56:31 +0000 (10:56 +0200)]
Don't clear echo area prematurely when handling select window events (Bug#11304).
* keyboard.c (read_char): Don't wipe echo area for select window
events: These might get delayed via `mouse-autoselect-window'
(Bug#11304).
* window.el (handle-select-window): Clear echo area since this is
no more done by read_char (Bug#11304).
Ensure that X selection convertors properly encode returned strings.
Though not itself a regression, this bug was exposed by the support
for MULTIPLE selections, which is new to Emacs 24 (see Bug#11315).
* lisp/select.el (xselect--encode-string): New function, split from
xselect-convert-to-string.
(xselect-convert-to-string): Use it.
(xselect-convert-to-filename, xselect-convert-to-os)
(xselect-convert-to-host, xselect-convert-to-user): Ensure that
returned strings are properly encoded.
Stefan Monnier [Tue, 24 Apr 2012 03:40:57 +0000 (23:40 -0400)]
* lisp/ibuffer.el (ibuffer-mode-map): Bind `/ m' to filter-used-mode
and `/ M' to filter-derived-mode.
* lisp/ibuf-ext.el (ibuffer-list-buffer-modes): Simplify; avoid add-to-list.
(ibuffer-filter-by-mode, ibuffer-filter-by-used-mode)
(ibuffer-mark-by-mode): Use default rather than initial-input.
(ibuffer-filter-by-derived-mode): Autoload and require-match.
Paul Eggert [Mon, 23 Apr 2012 22:46:35 +0000 (15:46 -0700)]
Do not create empty overlays with the evaporate property (Bug#9642).
* buffer.c (Fmove_overlay): Delete an evaporating overlay
if it becomes empty after its bounds are adjusted to fit within
its buffer. Without this fix, in a nonempty buffer (let ((o
(make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
yields an empty overlay that has the evaporate property, which is
not supposed to happen.
Eli Zaretskii [Mon, 23 Apr 2012 16:22:23 +0000 (19:22 +0300)]
Avoid assertion violation when scrolling minibuffer windows.
src/xdisp.c (pos_visible_p): If the window start position is beyond
ZV, start the display from buffer beginning. Prevents assertion
violation in init_iterator when the minibuffer window is scrolled
via the scroll bar.
src/window.c (window_scroll_pixel_based): Likewise.
ispell.el,flyspell.el: Preserve session localwords when switching back buffers.
Once a word is declared valid for a session and a buffer it should
stay valid for that buffer regardless buffer switches unless ispell
process is explicitly killed or dictionary changed for that buffer.
However, it is currently lost when we switch to a different buffer
that triggers a new ispell process and then switch back to the
original buffer (triggering a new ispell restart).
These changes try to keep buffer session localwords accepted in above
case.
`ispell-insert-word' is a plain `insert' together with word filtering
through `translation-table-for-input' for character code unification.
This was useful in Emacs 22, but is not needed for Emacs 23 and above
since unification is now direct.
Since XEmacs does not have `translation-table-for-input' there is no
need at all to keep this old code, but use (insert) directly.
Paul Eggert [Sun, 22 Apr 2012 19:23:51 +0000 (12:23 -0700)]
Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
* gmalloc.c: (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
(__malloc_size_t, __malloc_ptrdiff_t):
Remove. All uses removed, replaced by the definiens if needed,
since we can assume C89 or better now.
Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
(protect_malloc_state, align, get_contiguous_space)
(malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
(malloc_atfork_handler_child, malloc_enable_thread)
(malloc_initialize_1, __malloc_initialize, morecore_nolock)
(_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
(_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
(special_realloc, _realloc_internal_nolock, _realloc_internal)
(realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
(freehook, mallochook, reallochook, mabort, mcheck, mprobe):
Define using prototypes, not old style.
(align, _malloc_internal_nolock, _free_internal_nolock, memalign):
Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
(align): Don't assume that signed integer overflow wraps around.
Omit unused local var.
(malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
(_free_internal_nolock, memalign, mallochook, reallochook):
Omit no-longer-needed casts.
(valloc): Use getpagesize, not __getpagesize.
(MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
(struct hdr): The 'magic' member is now size_t, not unsigned long.
Make the "reset-saved" Custom operation reset to default if there is no saved value.
* lisp/cus-edit.el (custom-variable-menu)
(custom-variable-reset-saved, custom-face-menu)
(custom-face-reset-saved): If there is no saved value, make the
"reset-saved" operation bring back the default.
(custom-face-state): Properly detect themed faces.