nnimap.el (nnimap-wait-for-response): Wait for results in a more secure manner.
gnus-art.el (article-update-date-lapsed): Try to avoid having point move around by not using save-window-excursion. It seems to work...
gnus-start.el (gnus-read-active-for-groups): Read the active files thoroughly for all backends that have no known groups. This should allow new nnml methods to retrieve mail.
gnus-group.el (gnus-group-jump-to-group): Allow jumping to groups that Gnus doesn't know exists again.
gnus-art.el: Rewrite the Date header formatting functionality.
The user can now have infinitely many Date headers.
This change should be pretty much backwards-compatible, even though
many customisation variables have been removed.
gnus.texi (Customizing Articles): Document the new way of customizing
the date headers(s).
Paul Eggert [Sun, 30 Jan 2011 19:22:02 +0000 (11:22 -0800)]
gnulib: import mktime and move-if-change fixes from gnulib
* configure: Regenerate from the following.
2011-01-30 Paul Eggert <eggert@cs.ucla.edu>
mktime: clarify long_int width checking
* lib/mktime.c (long_int_is_wide_enough): Move this assertion to
the top level, to make it clearer that the assumption about
long_int width is being checked. See
<http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00554.html>.
2011-01-29 Paul Eggert <eggert@cs.ucla.edu>
TYPE_MAXIMUM: avoid theoretically undefined behavior
* lib/intprops.h (TYPE_MINIMUM, TYPE_MAXIMUM): Do not shift a
negative number, which the C Standard says has undefined behavior.
In practice this is not a problem, but might as well do it by the book.
Reported by Rich Felker and Eric Blake; see
<http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00493.html>.
* m4/mktime.m4 (AC_FUNC_MKTIME): Likewise.
* lib/mktime.c (TYPE_MAXIMUM): Redo slightly to match the others.
mktime: #undef mktime before #defining it
* lib/mktime.c (mktime) [DEBUG]: #undef mktime before #defining it.
mktime: systematically normalize tm_isdst comparisons
* lib/mktime.c (isdst_differ): New function.
(__mktime_internal): Use it systematically for all isdst comparisons.
This completes the fix for libc BZ #6723, and removes the need for
normalizing tm_isdst. See
<http://sourceware.org/bugzilla/show_bug.cgi?id=6723>
(not_equal_tm) [DEBUG]: Use isdst_differ here, too.
mktime: fix some integer overflow issues and sidestep the rest
This was prompted by a bug report by Benjamin Lindner for MinGW
<http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00472.html>.
His bug is due to signed integer overflow (0 - INT_MIN), and I
I scanned through mktime.c looking for other integer overflow
problems, fixing all the bugs I found.
Although the C Standard says the resulting code is still not safe
in the presence of integer overflow, in practice it should be good
enough for all real-world two's-complement implementations, except
for debugging environments that deliberately trap on integer
overflow (e.g., gcc -ftrapv).
* lib/mktime.c (WRAPV): New macro.
(SHR): Also check that long_int and time_t shift right in the
usual way, before using the fast-but-unportable method.
(TYPE_ONES_COMPLEMENT, TYPE_SIGNED_MAGNITUDE): Remove, no longer
used. The code already assumed two's complement, so there's
no need to test for alternatives. All uses removed.
(TYPE_MAXIMUM): Don't rely here on overflow behavior not defined by
the C standard. Problem reported by Rich Felker in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00488.html>.
(twos_complement_arithmetic): Also check long_int and time_t.
(time_t_avg, time_t_add_ok, time_t_int_add_ok): New functions.
(guess_time_tm, ranged_convert, __mktime_internal): Use them.
(__mktime_internal): Avoid integer overflow with unary subtraction
in two instances where -1 - X is an adequate replacement for -X,
since the calculations are approximate.
2011-01-29 Eric Blake <eblake@redhat.com>
mktime: avoid infinite loop
* m4/mktime.m4 (AC_FUNC_MKTIME): Avoid overflow on possibly-signed
type; behavior is still undefined but portable to all known targets.
Reported by Rich Felker.
2011-01-28 Paul Eggert <eggert@cs.ucla.edu>
mktime: avoid problems on NetBSD 5 / i386
* lib/mktime.c (long_int): New type. This works around a problem
on NetBSD 5 / i386, where 'long int' and 'int' are both 32 bits
but time_t is 64 bits, and where I expect the existing code is
wrong in some cases.
(leapyear, ydhms_diff, guess_time_tm, __mktime_internal): Use it.
(ydhms_diff): Bring back the compile-time check for wide-enough
year and yday.
mktime: fix misspelling in comment
* lib/mktime.c (__mktime_internal): Fix misspelling in comment.
This merges all recent glibc changes of importance.
move-if-change: cope with concurrent mv of identical file.
* move-if-change (CMPPROG): Accept environment
variable as an override for `cmp'.
(usage): Document CMPPROG.
Adjust comparison to drop stdout. Cope with failure of mv if
the target file exists and is identical to the source, for
parallel builds.
Report from H.J. Lu against binutils in PR binutils/12283.
Jan Djärv [Sun, 30 Jan 2011 18:59:58 +0000 (19:59 +0100)]
Implement C-c m in report-emacs-bug (insert to mailer) for OSX.
* mail/emacsbug.el (report-emacs-bug-insert-to-mailer): Check
report-emacs-bug-can-use-osx-open and use that if t.
(report-emacs-bug-can-use-osx-open): New function.
(report-emacs-bug): Rename can-xdg-email to can-insert-mail.
Check report-emacs-bug-can-use-osx-open also for can-insert-mail.
nnmail.el (nnmail-article-group): Check for a direct fancy split method.
gnus.texi (Client-Side IMAP Splitting): Add a complete nnimap fancy splitting example.
Chong Yidong [Sat, 29 Jan 2011 21:19:21 +0000 (16:19 -0500)]
Refresh Dired and VC-dir buffers after vc-pull and vc-merge.
* vc/vc-dispatcher.el (vc-set-async-update): New function for
updating Dired or VC-dir buffers after async command completes.
* vc/vc-bzr.el (vc-bzr-async-command): Return the process buffer.
(vc-bzr-pull, vc-bzr-merge-branch): Use vc-set-async-update.
* vc/vc-git.el (vc-git-merge-branch): Add FETCH_HEAD to branch
completions if it exists. Use vc-set-async-update.
(vc-git-pull): Use vc-set-async-update.
* vc/vc-hg.el (vc-hg-pull): Fix default-contents arg to
read-shell-command. Use vc-set-async-update.
(vc-hg-merge-branch): Use vc-set-async-update.
Jan Djärv [Sat, 29 Jan 2011 11:30:11 +0000 (12:30 +0100)]
Handle nul-character in copy/paste (Bug#7934).
* nsselect.m (ns_string_from_pasteboard): Get length of string
and use make_string instead of build_string.
(ns_string_to_pasteboard_internal): Use initWithBytesNoCopy
instead of stringWithUTF8String (Bug#7934).
Stefan Monnier [Sat, 29 Jan 2011 06:08:24 +0000 (01:08 -0500)]
* lisp/progmodes/compile.el: Avoid an N² behavior in grep.
(compilation--previous-directory): New fun.
(compilation--previous-directory-cache): New var.
(compilation--remove-properties): Flush it.
(compilation-directory-properties, compilation-error-properties):
Use the new fun to speed up looking for the current directory.
Gnus developers [Fri, 28 Jan 2011 23:07:38 +0000 (23:07 +0000)]
Merge changes made in Gnus trunk.
gnus-win.el: Remove dead function gnus-window-configuration-element.
(gnus-all-windows-visible-p): Remove old compatibility code.
(gnus-window-top-edge): Add docstring.
gnus-sum.el (gnus-select-newsgroup): Don't try to alter the active data if the group is unactivated.
Stefan Monnier [Fri, 28 Jan 2011 22:06:20 +0000 (17:06 -0500)]
* lisp/progmodes/compile.el: Don't use font-lock any more.
(compilation-error-regexp-alist-alist): Change handling of makepp
so it preserves the warning/error distinction on subsequent files.
Simplify various rules.
(compilation-directory-properties): Use font-lock-face.
Add a compilation-message property.
(compilation-internal-error-properties): Use font-lock-face.
Don't set the compilation-debug property here.
(compilation--put-prop, compilation--remove-properties)
(compilation--parse-region, compilation--ensure-parse)
(compilation--ensure-parse): New functions.
(compilation-parse-errors): New function, largely inspired of
compilation-mode-font-lock-keywords. Set compilation-debug here.
(compilation--parsed): New var.
(compilation--flush-parse): Use compilation--ensure-parse.
(compilation-start): Don't call font-lock.
(compilation-turn-on-font-lock): Remove.
(compilation-setup): Don't set font-lock-extra-managed-props not change
other font-lock settings, other than keywords.
Don't activate font-lock-mode.
Set change-major-mode-hook and before-change-functions.
(compilation--unsetup): Remove properties and hooks.
(compilation-next-single-property-change): New function.
(compilation-next-error): Use it to parse when needed.
(compile-goto-error): Parse buffer as needed.
(compilation--compat-error-properties): Don't need a dummy `face'
property any more.
Stefan Monnier [Fri, 28 Jan 2011 21:42:34 +0000 (16:42 -0500)]
* lisp/progmodes/compile.el: Use accessors for clarity and fix omake hack.
(compilation-process-setup-function): Fix docstring's false promises.
(compilation-error-regexp-alist-alist): Catch omake's continuous
recompilation message and avoid reuse of old markers.
(compilation-parse-errors-function): Declare obsolete.
(compilation-buffer-modtime): Remove.
(compilation--make-cdrloc, compilation--loc->col)
(compilation--loc->line, compilation--loc->file-struct)
(compilation--loc->marker, compilation--loc->visited)
(compilation--make-file-struct, compilation--file-struct->file-spec)
(compilation--file-struct->formats)
(compilation--file-struct->loc-tree): New macros. Use them.
(compilation--message): New defstruct. Use them.
(compilation-next-error-function): Don't mess with timestamps to try
and guess when to reparse.
Stefan Monnier [Fri, 28 Jan 2011 21:16:04 +0000 (16:16 -0500)]
* lisp/textmodes/tex-mode.el: Get rid of compilation-parse-errors-function
(tex-old-error-file-name): New function,
extracted from tex-compilation-parse-errors.
(tex-compilation-parse-errors): Remove.
(tex-error-regexp-alist): New var.
(tex-shell): Use it to avoid compilation-parse-errors-function.
Stefan Monnier [Fri, 28 Jan 2011 21:11:19 +0000 (16:11 -0500)]
Minor cleanup for compile.el and grep.el.
* lisp/progmodes/compile.el: Cleanup text-properties namespace by using
`compilation-message' instead of `message', `compilation-directory'
instead of `directory', and `compilation-debug' instead of `debug'.
(compilation-last-buffer, compilation-parsing-end)
(compilation-error-list, compilation-old-error-list): Move to the
compatibility part of the code.
(compilation-error-properties): If `file' is a function, let it return
a file name.
(compilation-mode-font-lock-keywords): Be more conservative with the
omake "^ *" pattern prefix, to try and minimize the risk of
pathologically slow regexp matching.
(compilation-start): Use inhibit-read-only.
(compilation--unsetup): New function.
(compilation-shell-minor-mode, compilation-minor-mode): Use it.
(compilation-filter): Minor tweaks.
(compilation-next-error-function): Try and avoid abusing variable names.
(compilation--flush-file-structure): New fun.
(compilation-fake-loc): Use it for cleaner behavior when file is reused.
(debug-ignored-errors): Add "Moved past last ...".
(compilation--compat-error-properties)
(compilation--compat-parse-errors): Rename by doubling the "-".
* lisp/progmodes/grep.el (grep-regexp-alist): Tighten regexp.
(grep-mode-font-lock-keywords): Remove regexp that seems like
a left-over from before we used compile.el.
(grep-mode-font-lock-keywords): Call syntax-ppss-flush-cache when
modifying the buffer within with-silent-modifications.
Chong Yidong [Fri, 28 Jan 2011 20:30:38 +0000 (15:30 -0500)]
Fix text pos part of lispy positions for right fringe clicks (Bug#7839).
* src/keyboard.c (make_lispy_position): For clicks on right fringe or
margin, compute text position using the X coordinate relative to
the left of the text area (Bug#7839).
Stefan Monnier [Fri, 28 Jan 2011 19:46:58 +0000 (14:46 -0500)]
Port features from the previous prolog.el to the new one.
* lisp/progmodes/prolog.el (prolog-system): Add GNU and ECLiPSe options.
(prolog-program-name, prolog-program-switches, prolog-consult-string)
(prolog-compile-string, prolog-prompt-regexp): Get rid of the <foo>-i
variable and use a function to compute the value dynamically.
(prolog-prompt-regexp): Add regexp for GNU Prolog.
(prolog-continued-prompt-regexp): Remove, unused.
(prolog-find-value-by-system): Try and use the value of prolog-system
in the *prolog* buffer if it helps.
(prolog-mode-keybindings-common): Bind C-c C-z unconditionally...
(prolog-zip-on): ..and check prolog-system and version here instead.
(prolog-inferior-self-insert-command): New command.
(prolog-inferior-mode-map): Use it.
(prolog-inferior-error-regexp-alist): New var.
(prolog-inferior-mode): Use it, along with compilation-shell-minor-mode.
(prolog-input-filter): Use derived-mode-p.
(prolog-inferior-guess-flavor): New function.
(prolog-ensure-process): Use it. Use make-comint-in-buffer rather than
make-comint to avoid running comint-mode twice.
(prolog-inferior-buffer): New fun.
(prolog-old-process-region, prolog-old-process-file):
Don't call prolog-bsts here...
(prolog-build-prolog-command): ...do it here instead.
(prolog-old-process-region, prolog-old-process-file):
Use compilation-fake-loc and compilation-forget-errors.
(prolog-consult-compile-region): Use bolp.
Paul Eggert [Fri, 28 Jan 2011 00:25:24 +0000 (16:25 -0800)]
improve fix for MS-DOS file name clash
* Makefile.in (DOS_gnulib_comp.m4): Renamed from DOS-gnulib-comp.m4,
for portability to POSIX make. Reported by Bruno Haible.
(sync-from-gnulib): Copy gl-comp.m4 (if present) back to
gnulib-comp.m4 before running gnulib-tool, to prevent old gnulib
files from accumulating as garbage. Also reported by Bruno Haible.
Gnus developers [Fri, 28 Jan 2011 00:14:08 +0000 (00:14 +0000)]
gnus-group.el (gnus-group-refresh-group): Refresh even non-visible groups. This makes the nndraft:queue group pop up if it's not already there.
mml2015.el (mml2015-epg-sign): Add missing paren.
Gnus developers [Thu, 27 Jan 2011 23:42:38 +0000 (23:42 +0000)]
Merge changes made in Gnus trunk.
mml2015.el (mml2015-epg-sign): Add and use mml2015-sign-with-sender.
(mml2015-epg-encrypt): Use mml2015-sign-with-sender.
gnus-art.el (article-update-date-lapsed): Ensure that point stays at the "same place" even if point is on the line being replaced.
(article-update-date-lapsed): Allow updating both the combined lapsed and the lapsed headers.
(article-update-date-lapsed): Skip past all the X-Sent/Date headers.
(article-make-date-line): Limit the number of segments dynamically to avoid too-long lines.
Stefan Monnier [Thu, 27 Jan 2011 17:04:07 +0000 (12:04 -0500)]
* lisp/htmlfontify.el: Make it obey the font-lock-face text property.
Miscellaneous cleanup such as:
- Don't hide expressions after a closing paren.
- Move initial setq into let.
- Hoist common parts out of ifs.
(hfy-p-to-face, hfy-p-to-face-lennart): Remove.
(hfy-face-at): Use get-text-property instead.
(hfy-prop-invisible-p): Use invisible-p if available.
(htmlfontify-manual): Use \\[...].
(hfy-html-quote-regex): Use [...].
(hfy-combined-face-spec): Simplify.
(hfy-compile-face-map): Don't presume point-min==1.
(hfy-css-name, hfy-buffer, htmlfontify-buffer): Use \' rather than $ to
match end of string.
(hfy-text-p): η-reduce.
(hfy-tags-for-file): Receive cache-hash directly.
(hfy-mark-tag-names): Adjust call.
gnus-art.el (gnus-article-next-page): Change last-line-displayed behaviour.
(article-lapsed-string): Refactor out and allow specifying how many segments you want.
(gnus-article-setup-buffer): Start updating the lapsed header directly.
(gnus-article-update-lapsed-header): New variable.
shr.el (shr-put-color): Don't do the box padding in tables, since they're already padded.
gnus-util.el (float-time): If float-time is bound, always use it on all Emacsen. It's unclear why the subrp check was there.
(time-date): Require to make some autoload issues on XEmacs go away.
gnus-draft.el (gnus-draft-clear-marks): New function to be run as an exit hook to nix out all data on readedness on group exit.
gnus-sum.el (gnus-auto-select-subject): Doc typo.
Stefan Monnier [Wed, 26 Jan 2011 20:02:07 +0000 (15:02 -0500)]
Let the debugger continue to the normal handler.
* src/eval.c (maybe_call_debugger): Declare before new use.
(find_handler_clause): Don't call debugger any more.
Ignore Vstack_trace_on_error.
Use XCAR/XCDR.
(syms_of_eval): Remove Vstack_trace_on_error.
(Fsignal): Only modify handlerlist when we know we need to do it.
Call the debugger when necessary.
* src/globals.h (Vstack_trace_on_error): Remove.
shr.el: Revert change that made headings use different-sized faces. The Emacs display engine isn't advanced enough that, for instance, tables can comfortably use differntly-sized faces.
Gnus developers [Tue, 25 Jan 2011 23:51:40 +0000 (23:51 +0000)]
Merge changes made in Gnus trunk.
mm-view.el (mm-display-shell-script-inline): Fix typo in docstring.
(mm-display-javascript-inline): New function.
mm-decode.el (mm-inline-media-tests): Add application/javascript viewing function.
nnimap.el (nnimap-open-connection-1): Store the actual stream type used.
(nnimap-login): Prefer plain LOGIN if it's enabled (since it requires fewer round trips than CRAM-MD5, and it's less likely to be buggy), and we're using an encrypted connection.
proto-stream.el: Alter the interface functions to also return the actual stream type used: network or tls.
Glenn Morris [Tue, 25 Jan 2011 17:41:28 +0000 (09:41 -0800)]
Undo part of previous copyright.el change.
* lisp/emacs-lisp/copyright.el (copyright-update-directory):
Undo part of previous change - don't find files literally, we need
comment-start-skip, etc.
Glenn Morris [Tue, 25 Jan 2011 08:36:34 +0000 (00:36 -0800)]
copyright.el updates.
* lisp/emacs-lisp/copyright.el (copyright-at-end-flag)
(copyright-names-regexp): Add safety properties.
(copyright-year-ranges): New option.
(copyright-find-end): New function, split from copyright-update-year.
(copyright-update-year): Use copyright-find-end.
(copyright-fix-years): Optionally, convert years to ranges.
Handle years continued over comment lines.
Do not mess with the fill-prefix.
Do not call copyright-update.
(copyright-update-directory): Optionally, fix years rather than update.
Skip directories. Find files literally, with only safe local vars.
* etc/NEWS: Mention copyright-fix-years and ranges.
Gnus developers [Mon, 24 Jan 2011 23:38:05 +0000 (23:38 +0000)]
Merge changes made in Gnus trunk.
shr.el: Use defface to create shr-tag-h[1-6] faces to fontify h[1-6] tags.
mml-smime.el (mml-smime-use): Make it a defcustom and default to 'epg if EPG is loaded.
message.texi (IDNA): Explain what it is.
gnus.texi (The Empty Backend): Document nnnil (bug #7653).
gnus-agent.el (gnus-agent-prompt-send-queue): Whitespace fix.
shr.el (shr-expand-newlines): Proof of concept implemantation of boxy backgrounds.
(shr-expand-newlines): Switch to using overlays to enable kill'n'yank in a more sensible manner.
Jay Belanger [Mon, 24 Jan 2011 05:08:04 +0000 (23:08 -0600)]
* calc/calc.el (calc-default-power-reference-level)
(calc-default-field-reference-level): New variables.
* calc/calc-units.el (math-standard-units): Add dB and Np.
(math-logunits): New variable.
(math-extract-logunits, math-logcombine, calcFunc-luplus)
(calcFunc-luminus, calc-luplus, calc-luminus, math-logunit-level)
(calcFunc-fieldlevel, calcFunc-powerlevel, calc-level): New
functions.
(math-find-base-units-rec): Add entry for ln(10).
* calc/calc-help.el (calc-u-prefix-help): Add logarithmic help.
(calc-ul-prefix-help): New function.
* calc/calc-ext.el (calc-init-extensions): Autoload new units
functions. Add keybindings for new units functions.
gnus-html.el (gnus-html-image-fetched): Don't kill the temporary buffer after being called. It's apparently being killed by url.el, and killing it made point move to end-of-buffer in a random buffer.
shr.el (shr-image-fetched): Ditto.
shr.el (shr-image-fetched): Avoid having point move in the article buffer.
gnus-html.el (gnus-html-image-fetched): Kill the buffer anyway, and fix the bug in url-http.el instead.
shr.el (shr-image-fetched): Ditto.
gravatar.el (gravatar-retrieve): Be silent when retrieving.
gnus-gravatar.el (gnus-gravatar-insert): Don't move point around in the article buffer.
(gnus-gravatar-insert): Use blank space from the current buffer to avoid breaking text properties. This makes X-Sent updating work again.
gnus-art.el (gnus-article-read-summary-keys): Don't call disabled commands.