Paul Eggert [Mon, 16 May 2011 05:08:59 +0000 (22:08 -0700)]
* character.c (lisp_string_width): Check for string overflow.
Use EMACS_INT, not int, for string indexes and lengths; in
particular, 2nd arg is now EMACS_INT, not int. Do not crash if
the resulting string length overflows an EMACS_INT; instead,
report a string overflow if no precision given. When checking for
precision exhaustion, use a check that cannot possibly have
integer overflow. (Bug#8675)
* character.h (lisp_string_width): Adjust to new signature.
Paul Eggert [Mon, 16 May 2011 01:11:54 +0000 (18:11 -0700)]
* alloc.c (string_overflow): New function.
(Fmake_string): Use it. This doesn't change behavior, but saves
a few bytes and will simplify future changes.
* character.c (string_escape_byte8): Likewise.
* lisp.h (string_overflow): New decl.
Paul Eggert [Sat, 14 May 2011 09:03:53 +0000 (02:03 -0700)]
Fixups, following up to the user-interface timestamp change.
* nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
for UI timestamps, instead of unsigned long.
* w32gui.h (Time): Define by including "systime.h" rather than by
declaring it ourselves. (Bug#8664)
Ulf Jasper [Fri, 13 May 2011 19:35:36 +0000 (21:35 +0200)]
newsticker: Moved icons to etc/newsticker/images
lisp/ChangeLog:
2011-05-13 Ulf Jasper <ulf.jasper@web.de>
* net/newst-treeview.el (newsticker-treeview-face): Changed default
family from helvetica to sans.
(newsticker-treeview-tool-bar-map): Moved tool-bar icons to
etc/images/newsticker.
* net/newst-reader.el (newsticker-feed-face): Changed default
family from helvetica to sans.
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face): Changed default family from
helvetica to sans.
(newsticker--plainview-tool-bar-map): Moved tool-bar icons to
etc/images/newsticker.
* net/newst-backend.el (newsticker--do-run-auto-mark-filter),
(newsticker--process-auto-mark-filter-match): : Tell user about
auto-marking.
Didier Verna [Fri, 13 May 2011 19:27:52 +0000 (16:27 -0300)]
Common Lisp indentation improvements on defmethod and lambda-lists.
* cl-indent.el: Advertise the changes and remove obsolete TODO entries.
(lisp-lambda-list-keyword-parameter-indentation)
(lisp-lambda-list-keyword-parameter-alignment)
(lisp-lambda-list-keyword-alignment): New customizable user options.
(lisp-indent-defun-method): Improve docstring.
(extended-loop-p): Fix comment.
(lisp-indent-lambda-list-keywords-regexp): New variable.
(lisp-indent-lambda-list): New function.
(lisp-indent-259): Use it.
(lisp-indent-defmethod): Support for more than one
method qualifier and properly indent methods lambda-lists.
(defgeneric): Provide a missing common-lisp-indent-function property.
Ulf Jasper [Fri, 13 May 2011 19:06:36 +0000 (21:06 +0200)]
newsticker: Moved icons to etc/newsticker/images
lisp/ChangeLog:
2011-05-13 Ulf Jasper <ulf.jasper@web.de>
* net/newst-treeview.el (newsticker-treeview-face): Changed default
family from helvetica to sans.
(newsticker-treeview-tool-bar-map): Moved tool-bar icons to
etc/images/newsticker.
* net/newst-reader.el (newsticker-feed-face): Changed default
family from helvetica to sans.
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face): Changed default family from
helvetica to sans.
(newsticker--plainview-tool-bar-map): Moved tool-bar icons to
etc/images/newsticker.
* net/newst-backend.el (newsticker--do-run-auto-mark-filter),
(newsticker--process-auto-mark-filter-match): : Tell user about
auto-marking.
Paul Eggert [Fri, 13 May 2011 06:12:24 +0000 (23:12 -0700)]
* editfns.c (Fformat): Fix several integer overflow problems.
For example, without this change, (format "%2147483648d" 1) dumps
core on x86-64 GNU/Linux. Use EMACS_INT, not size_t, for sizes,
since we prefer using signed values, and EMACS_INT will be big
enough soon, even on 32-bit hosts. Also, prefer EMACS_INT to int
for sizes. Don't assume that pI is either "l" or ""; it might be
"ll" or "I64". Check for width and precision greater than
INT_MAX, as this can make sprintf go kaflooey. (Bug#8668)
Teodor Zlatanov [Fri, 13 May 2011 04:12:37 +0000 (04:12 +0000)]
registry.el (prune-factor): New initialization parameter defaulting to 0.1.
(registry-prune-hard): Use it.
gnus-registry.el (gnus-registry-fixup-registry): Set prune-factor to 0.1 expicitly.
Paul Eggert [Thu, 12 May 2011 20:23:33 +0000 (13:23 -0700)]
Be more systematic about user-interface timestamps.
Before, the code sometimes used 'Time', sometimes 'unsigned long',
and sometimes 'EMACS_UINT', to represent these timestamps. This
change causes it to use 'Time' uniformly, as that's what X uses.
This makes the code easier to follow, and makes it easier to catch
integer overflow bugs such as Bug#8664.
* frame.c (Fmouse_position, Fmouse_pixel_position):
Use Time, not unsigned long, for user-interface timestamps.
* keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
(button_down_time, make_lispy_position, make_lispy_movement): Likewise.
* keyboard.h (last_event_timestamp): Likewise.
* menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
* menu.h (xmenu_show): Likewise.
* term.c (term_mouse_position): Likewise.
* termhooks.h (struct input_event.timestamp): Likewise.
(struct terminal.mouse_position_hook): Likewise.
* xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
* xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
* systime.h (Time): New decl. Pull it in from <X11/X.h> if
HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
what it was before.
* menu.h, termhooks.h: Include "systime.h", for Time.
Paul Eggert [Thu, 12 May 2011 19:37:40 +0000 (12:37 -0700)]
* keyboard.c (make_lispy_event): Fix problem in integer overflow.
Don't assume that the difference between two unsigned long values
can fit into an integer. At this point, we know button_down_time
<= event->timestamp, so the difference must be nonnegative, so
there's no need to cast the result if double-click-time is
nonnegative, as it should be; check that it's nonnegative, just in
case. This bug is triggered when events are more than 2**31 ms
apart (about 25 days).
Stefan Monnier [Thu, 12 May 2011 12:55:10 +0000 (09:55 -0300)]
* lisp/shell.el (shell-completion-vars): New function.
(shell-mode):
* lisp/simple.el (read-shell-command): Use it.
(blink-matching-open): No need for " [...]" in minibuffer-message.
Details:
appt-now-displayed was set non-nil the first time a reminder was displayed.
Nothing ever set it back to nil again. Thus when full-check was nil,
mode-line-only was always true, so the "(when (or full-check mode-line-only)"
was pointless. That was the only use of full-check. mode-line-only
was only used in a negative sense, and can be reduced to the zerop test.
Stefan Monnier [Thu, 12 May 2011 02:25:58 +0000 (23:25 -0300)]
* lisp/net/rcirc.el: Add support for SSL/TLS connections.
(rcirc-server-alist): New field `encryption'.
(rcirc): Check `encryption' settings.
(rcirc-connect): New arg `encryption'. Use open-network-stream.
Merge make-local-variable into `set'.
(rcirc--connection-open-p): New function.
(rcirc-send-string, rcirc-clean-up-buffer): Use it to handle case where
the process is not a network process (e.g. running gnutls-cli).
(set-rcirc-decode-coding-system, set-rcirc-encode-coding-system):
Make rcirc-(en|de)code-coding-system local here.
(rcirc-mode): Merge make-local-variable into `set'.
(rcirc-parent-buffer): Make permanent buffer-local.
(rcirc-multiline-minor-mode): Don't do it here.
(rcirc-switch-to-server-buffer): Don't switch to a random buffer if
there's no server buffer.
Paul Eggert [Wed, 11 May 2011 23:16:52 +0000 (16:16 -0700)]
* xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
Before, the code was not consistent. These values cannot exceed
2**31 - 1 so there's no need to make them unsigned.
(x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
(x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
(x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
as modifiers.
* xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
Paul Eggert [Wed, 11 May 2011 21:42:11 +0000 (14:42 -0700)]
* lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
(XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
presumably because the widths might not match.
Take account of fringe background extension in scroll_run_hook.
* w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
`width' to `bar_area_x' and `bar_area_width', respectively.
(x_scroll_run): Take account of fringe background extension.
* xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]: Rename
local vars `left' and `width' to `bar_area_x' and
`bar_area_width', respectively.
(x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
background extension.
Teodor Zlatanov [Tue, 10 May 2011 22:21:39 +0000 (22:21 +0000)]
registry.el (registry-prune-hard-candidates, registry-prune-soft-candidates): Helper methods for registry pruning.
(registry-prune): Use them. Make the sort function optional.
Katsumi Yamaoka [Tue, 10 May 2011 03:14:44 +0000 (03:14 +0000)]
shr.el (shr-put-image-function): New variable.
(shr-image-fetched, shr-image-displayer, shr-tag-img): Funcall it.
(shr-put-image): Return scaled image.
gnus-art.el (gnus-shr-put-image): New function.
(gnus-article-prepare-display): Bind shr-put-image-function to it.
gnus-html.el (gnus-html-wash-images): Register scaled images, not original ones, as deletable.
Teodor Zlatanov [Mon, 9 May 2011 22:27:17 +0000 (22:27 +0000)]
registry.el (registry-full): Add convenience method. Fix logic.
(registry-insert): Use it. Fix logic here too.
gnus-registry.el (gnus-registry-insert): Add wrapper that calls `registry-prune' if `registry-full' returns t.
(gnus-registry-handle-action, gnus-registry-get-or-make-entry, gnus-registry-set-id-key, gnus-registry-usage-test): Use it.
lisp/misc.el: Implement new command `list-dynamic-libraries'.
* misc.el (list-dynamic-libraries--loaded-only-p): New variable.
(list-dynamic-libraries--refresh): New function.
(list-dynamic-libraries): New command.