message.el (message-is-yours-p): Allow disabling canlock checking (bug#9295).
(message-shoot-gnksa-feet): Add `canlock-verify'.
(message-auto-save-directory): Use ~/ as the auto-save directory if the message directory isn't writable (bug#9304).
auth-source.el (auth-source-netrc-saver): Make the .authinfo file non-world-readable.
Martin Rudalics [Wed, 17 Aug 2011 06:50:31 +0000 (08:50 +0200)]
In display-buffer-pop-up-frame make frame with buffer to display current.
* window.el (display-buffer-pop-up-frame): Run frame creation
function with BUFFER current (as special-display-popup-frame
does). Reported by Drew Adams.
Ken Brown [Tue, 16 Aug 2011 13:27:12 +0000 (09:27 -0400)]
Fix memory allocation problems in Cygwin build (Bug#9273).
* src/gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo): New
variables.
(malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
dumped emacs.
(_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
in the static heap.
[CYGWIN] (special_realloc): New function.
(_realloc_internal_nolock) [CYGWIN]: Use the new function on
requests to realloc storage in the static heap.
* src/unexcw.c ( __malloc_initialized): Declare external variable.
(fixup_executable): Force the dumped emacs to reinitialize malloc.
Eli Zaretskii [Tue, 16 Aug 2011 07:53:33 +0000 (10:53 +0300)]
Improve documentation of regexp search for categories.
doc/lispref/searching.texi (Regexp Backslash): Document how to display
existing categories. Mention the possibility of adding
categories, and add an xref to where this is described. Add an
index entry.
doc/lispref/syntax.texi (Categories): Add an example of defining a new
category and category table.
Eli Zaretskii [Mon, 15 Aug 2011 17:47:25 +0000 (20:47 +0300)]
Use uniprop tables instead of biditype.h and bidimirror.h.
src/bidi.c (bidi_initialize): Use uniprop_table instead of including
biditype.h and bidimirror.h.
src/biditype.h: File removed.
src/bidimirror.h: File removed.
src/deps.mk (bidi.o): Remove biditype.h and
bidimirror.h.
src/makefile.w32-in ($(BLD)/bidi.$(O)): Remove biditype.h and
bidimirror.h.
src/dispextern.h: Fix a typo in the comment to bidi_type_t.
src/chartab.c: Improve commentary for the uniprop_table API.
Chong Yidong [Sun, 14 Aug 2011 18:08:20 +0000 (14:08 -0400)]
Avoid deleting ibuffer named filters by default.
* lisp/ibuf-ext.el (ibuffer-filter-disable): New arg for deleting
filter groups.
(ibuffer-included-in-filter-p-1): Use it. Suggested by Noam
Postavsky.
Eli Zaretskii [Sun, 14 Aug 2011 11:10:19 +0000 (14:10 +0300)]
Fix bug #9296 with vertical cursor motion on images.
src/xdisp.c (move_it_in_display_line_to): Don't invoke
IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
ppos_it. Fixes vertical cursor motion when line beginning is
covered by an image.
Jan Djärv [Sun, 14 Aug 2011 10:39:38 +0000 (12:39 +0200)]
Fix that executing applescript may hang emacs uninterruptedly.
* nsfns.m (as_script, as_result, as_status): New static variables.
(ns_run_ascript): New function.
(Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
the event loop. Get status from as_status.
* nsterm.m (sendEvent): If event is NSApplicationDefined and
data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
the event loop (Bug#7276).
Jan Djärv [Sat, 13 Aug 2011 10:48:03 +0000 (12:48 +0200)]
Fix network-interface-list|info on newer BSD derived OS:es.
* configure.in: Add header check: sys/socket.h,
ifaddrs.h, net/if_dl.h. Check for getifaddrs and freeifaddrs.
Check for sa_len in struct ifreq.ifr_addr (Bug#8477).
* src/process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
(Fnetwork_interface_list): Allocate in increments of bytes instead
of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
sockaddr.
(struct ifflag_def): notrailers is smart on OSX.
(Fnetwork_interface_info): Handle case when ifr_flags is negative.
Get hardware address with getifaddrs if available.
Sam Steingold [Fri, 12 Aug 2011 18:52:40 +0000 (14:52 -0400)]
* lisp/gnus/gnus-score.el (gnus-score-find-alist): Keep the score files already
in the reverse order to avoid modifying the cache with `nreverse'.
(gnus-all-score-files): Do not modify the value returned by
`gnus-score-find-alist' because it lives in a cache variable.
(gnus-current-home-score-file): No need to `nreverse' the return value
of `gnus-score-find-alist', it is already in the correct order.
Eli Zaretskii [Fri, 12 Aug 2011 11:19:44 +0000 (14:19 +0300)]
Fix bug #9284 with line/wrap-prefix property on display strings.
src/xdisp.c (iterate_out_of_display_property): xassert that
IT->position is set to within IT->object's boundaries. Break from
the loop as soon as EOB is reached; avoids infloops in redisplay
when IT->position is set up wrongly due to some bug. Set
IT->current to match the bidi iterator unconditionally.
(push_display_prop): Allow GET_FROM_STRING as IT->method on
entry; avoids crashes when line/wrap-prefix is set on a display
string. Force push_it to save on the stack the current
buffer/string position, to be restored by pop_it. Fix flags in
the iterator structure wrt the object coming from a display
property, as `line-prefix' and `wrap-prefix' are not ``replacing''
properties.
Daiki Ueno [Fri, 12 Aug 2011 03:30:18 +0000 (12:30 +0900)]
Make epa-file progress message user-friendly.
* epa.el (epa-progress-callback-function): Fix the logic of
displaying progress.
* epa-file.el (epa-file-insert-file-contents): Make progress
display more user-friendly.
(epa-file-write-region): Ditto.
Chong Yidong [Mon, 8 Aug 2011 18:21:32 +0000 (14:21 -0400)]
* image-dired.el: Don't use find-file for temporary work.
(image-dired--with-db-file): New macro.
(image-dired-write-tags, image-dired-remove-tag)
(image-dired-create-gallery-lists, image-dired-write-comments)
(image-dired-get-comment, image-dired-mark-tagged-files)
(image-dired-list-tags, image-dired-gallery-generate): Use it.
(image-dired-gallery-generate): Use insert-file-contents.
Eli Zaretskii [Sat, 6 Aug 2011 10:59:36 +0000 (13:59 +0300)]
Fix bug #9254 with crash and cursor positioning under longlines-mode.
src/xdisp.c (set_cursor_from_row): Fix cursor positioning when a
display property strides EOL and includes a newline, as in
longlines-mode.
src/bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
is non-zero, even if the data buffer is NULL. Fixes a crash in
vertical-motion with longlines-mode.
Eli Zaretskii [Fri, 5 Aug 2011 11:04:44 +0000 (14:04 +0300)]
Fix bug #9221 with memory leak in bidi display.
Add code to monitor memory allocation for bidi cache shelving.
src/xdisp.c (display_line): Release buffer allocated for shelved bidi
cache.
src/bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
amount allocated this far in `bidi_cache_total_alloc'.
(bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
non-zero, only free the data buffer without restoring the cache
contents. All callers changed.
src/dispextern.h (bidi_unshelve_cache): Update prototype.
src/xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
(move_it_in_display_line, move_it_to)
(move_it_vertically_backward, move_it_by_lines): Replace the call
to xfree to an equivalent call to bidi_unshelve_cache.
(move_it_in_display_line_to): Fix logic of returning
MOVE_POS_MATCH_OR_ZV in the bidi case.
Eli Zaretskii [Fri, 5 Aug 2011 10:48:37 +0000 (13:48 +0300)]
Fix bug #9221 with resource allocation under word-wrap.
Add diagnostic facility for monitoring memory allocated for cache shelving.
src/xdisp.c (display_line): Release buffer allocated for shelved bidi
cache. (Bug#9221)
src/bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
amount allocated this far in `bidi_cache_total_alloc'.
(bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
non-zero, only free the data buffer without restoring the cache
contents. All callers changed.
src/dispextern.h (bidi_unshelve_cache): Update prototype.
src/xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
(move_it_in_display_line, move_it_to)
(move_it_vertically_backward, move_it_by_lines): Replace the call
to xfree to an equivalent call to bidi_unshelve_cache.
(move_it_in_display_line_to): Fix logic of returning
MOVE_POS_MATCH_OR_ZV in the bidi case.
Martin Rudalics [Fri, 5 Aug 2011 06:23:23 +0000 (08:23 +0200)]
Turn some defsubsts into defuns and revert part of last switch-to-buffer fix.
* window.el (display-buffer-same-window)
(display-buffer-same-frame, display-buffer-other-window)
(pop-to-buffer-same-window, pop-to-buffer-same-frame)
(pop-to-buffer-other-window)
(pop-to-buffer-same-frame-other-window)
(pop-to-buffer-other-frame): Make them defuns.
(switch-to-buffer): Don't set LABEL argument of pop-to-buffer.
Jan Djärv [Thu, 4 Aug 2011 11:06:22 +0000 (13:06 +0200)]
Set _NET_WM_WINDOW_OPACITY on outer window manager window also.
* xterm.c (x_find_topmost_parent): New function.
(x_set_frame_alpha): Find topmost parent window with
x_find_topmost_parent and set the property there also.
(handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
Daiki Ueno [Thu, 4 Aug 2011 06:55:53 +0000 (15:55 +0900)]
Make sure GPG keys are usable when composing non-MIME messages (bug#8955).
* mml1991.el (mml1991-epg-find-usable-key)
(mml1991-epg-find-usable-secret-key): New function.
(mml1991-epg-sign): Check if signing key is usable.
(mml1991-epg-encrypt): Check if encrypting key is usable (bug#8955).
Andrew Cohen [Wed, 3 Aug 2011 22:09:04 +0000 (22:09 +0000)]
nnir.el (nnir-read-server-parm): Add an argument to restrict to server-variables only. This should fix a bug introduced with commit e1889675b7f4adf057833c5513c9374134c4e053.
(nnir-run-query): 'nnir-search-engine should not be set from the global environment.
Stefan Monnier [Wed, 3 Aug 2011 21:40:06 +0000 (17:40 -0400)]
* src/keymap.c (Fmake_composed_keymap): Move to subr.el.
* lisp/subr.el (make-composed-keymap): Move from C. Change calling
convention, and improve docstring to bring attention to a subtle point.
* lisp/minibuffer.el (completing-read-default): Adjust accordingly.