(package--with-work-buffer-async): Only propagate the error if the
callback returns non-nil.
(package--download-one-archive): Return nil on the signature
checking callback if we accept unsigned.
(package--download-and-read-archives): Return non-nil on the
archive download callback.
Eli Zaretskii [Thu, 18 Jun 2015 12:06:53 +0000 (15:06 +0300)]
Improve and extend filepos-to-bufferpos
* lisp/international/mule-util.el (filepos-to-bufferpos--dos):
Don't barf if F returns nil for some argument.
(filepos-to-bufferpos): Expand to support UTF-16 and not assume
that every encoding of type 'charset' is single-byte.
Eli Zaretskii [Thu, 18 Jun 2015 08:14:13 +0000 (11:14 +0300)]
Update data files from just-released Unicode 8.0
* etc/NEWS: Update wording since Unicode 8.0 is no longer in draft
status.
* test/BidiCharacterTest.txt: Update from Unicode 8.0.
* admin/unidata/BidiMirroring.txt:
* admin/unidata/BidiBrackets.txt:
* admin/unidata/UnicodeData.txt: Update from Unicode 8.0.
Paul Eggert [Thu, 18 Jun 2015 06:50:45 +0000 (23:50 -0700)]
Document curved quotes a bit better
* doc/emacs/basic.texi (Inserting Text):
Mention C-x 8. Change example to use curved quote rather
than infinity, as this lets us give more ways to do it.
* doc/emacs/mule.texi (International Chars): Mention C-x 8 shortcuts
and quotation marks.
* doc/emacs/text.texi (Quotation Marks):
* doc/lispref/tips.texi (Documentation Tips):
Add "curly quotes" and "curved quotes" to the index.
* doc/emacs/text.texi (Quotation Marks):
Give the C-x 8 shorthands for curved quotes.
Cross-reference to "Quotation Marks".
Eli Zaretskii [Wed, 17 Jun 2015 17:18:11 +0000 (20:18 +0300)]
Avoid infloop in redisplay with tall images
* src/xdisp.c (try_scrolling): Prevent an infloop when scrolling
down near ZV. (Bug#20808)
Call bidi_unshelve_cache to avoid memory leaks. Use IT_CHARPOS
instead of CHARPOS.
Artur Malabarba [Wed, 17 Jun 2015 14:37:51 +0000 (15:37 +0100)]
* lisp/emacs-lisp/package.el: Revert buffer after any operation
Call `package-menu--post-refresh' after any operation that changes
the package database (`package-install' and `package-delete'). To
avoid performance issues in large transactions, these functions
add `post-refresh' to `post-command-hook' instead of calling it
immediately.
(package-menu--mark-or-notify-upgrades): New function.
(list-packages): Add it to `package--post-download-archives-hook'.
(package-menu--post-refresh): Lose the upgrade-checking code, add
code to remove itself from `post-command-hook'.
(package-install, package-delete): Add it to `post-command-hook'.
(package-menu-execute): Don't call `package-menu--post-refresh'.
Glenn Morris [Wed, 17 Jun 2015 06:43:03 +0000 (23:43 -0700)]
Generate char-script-table from Unicode source. (Bug#20789)
* admin/unidata/Makefile.in (AWK): New, set by configure.
(all): Add charscript.el.
(blocks): New variable.
(charscript.el, ${unidir}/charscript.el): New targets.
(extraclean): Also remove generated charscript.el.
* admin/unidata/blocks.awk: New script.
* admin/unidata/Blocks.txt: New data file, from unicode.org.
* src/Makefile.in (charscript): New variable.
(${charscript}): New target.
(${lispintdir}/characters.elc): Depend on charscript.elc.
(temacs$(EXEEXT)): Depend on charscript.
Stefan Monnier [Tue, 16 Jun 2015 18:28:38 +0000 (14:28 -0400)]
(filepos-to-bufferpos): Add missing cases. Make sure it terminates.
* lisp/international/mule-util.el (filepos-to-bufferpos--dos):
New auxiliary function, extracted from filepos-to-bufferpos.
Make sure it terminates.
(filepos-to-bufferpos): Use it to fix the latin-1-dos case.
Add support for the `exact' quality.
Stefan Monnier [Tue, 16 Jun 2015 16:37:33 +0000 (12:37 -0400)]
* lisp/emacs-lisp/pcase.el: Improve docs and error handling
(pcase--self-quoting-p): Floats aren't self-quoting.
(pcase): Tweak docstring.
(pcase--u1): Deprecate the t pattern. Improve error detection for
the nil pattern.
(\`): Tweak docstring. Signal an error for unrecognized cases.
Eli Zaretskii [Tue, 16 Jun 2015 14:37:45 +0000 (17:37 +0300)]
Fix infloop in filepos-to-bufferpos
* lisp/international/mule-util.el (filepos-to-bufferpos): Fix EOL
offset calculation, and make it conditional on the eol-type of the
file's encoding. (Bug#20825)
Martin Rudalics [Tue, 16 Jun 2015 13:09:24 +0000 (15:09 +0200)]
Fix handling of image cache refcounts. (Bug#20802)
This backports Eli Zaretskii's solution of this problem for W32
to X and NS.
* src/nsfns.m (image_cache_refcount): Define unconditionally.
(unwind_create_frame): If the image cache's reference count
hasn't been updated yet, do that now.
(Fx_create_frame): Set image_cache_refcount unconditionally.
* src/xfns.c (image_cache_refcount): Define unconditionally.
(unwind_create_frame): If the image cache's reference count
hasn't been updated yet, do that now.
(Fx_create_frame, x_create_tip_frame): Set image_cache_refcount
unconditionally.
* src/w32fns.c (image_cache_refcount): Make it a ptrdiff_t as on
X and NS.
Nils Ackermann [Tue, 16 Jun 2015 07:24:47 +0000 (09:24 +0200)]
Improve reftex-label-regexps default value
* lisp/textmodes/reftex-vars.el (reftex-label-regexps): Make
keyvals label regexp more strict to better cope with unbalanced
brackets common in math documents.
Stefan Monnier [Mon, 15 Jun 2015 22:48:08 +0000 (18:48 -0400)]
* lisp/info.el: Cleanup bytepos/charpos issues
* lisp/international/mule-util.el: Use lexical-binding.
(filepos-to-bufferpos): New function.
* lisp/info.el (Info-find-in-tag-table-1): Use 0-based file positions.
(Info-find-node-2): Use filepos-to-bufferpos (bug#20704).
(Info-read-subfile, Info-search): Use 0-based file positions.
Paul Eggert [Mon, 15 Jun 2015 19:40:32 +0000 (12:40 -0700)]
Fix quoting when making derived mode docstring
* lisp/emacs-lisp/derived.el (derived-mode-make-docstring):
Nest regexp-quote inside format, not the reverse.
Problem reported by Artur Malabarba in:
http://lists.gnu.org/archive/html/emacs-devel/2015-06/msg00206.html
Eli Zaretskii [Mon, 15 Jun 2015 17:10:19 +0000 (20:10 +0300)]
Fix current-iso639-language on MS-Windows
* lisp/international/mule-cmds.el (set-locale-environment):
Downcase the locale name before interning it. This is so the
'current-iso639-language' on MS-Windows matches the ':lang'
property of font-spec objects.
Eli Zaretskii [Sun, 14 Jun 2015 15:02:55 +0000 (18:02 +0300)]
Another improvement for symbol and punctuation characters
* lisp/international/fontset.el (setup-default-fontset): Exclude
from Symbola character ranges for symbols and punctuation covered
well by popular Unicode fonts. Prefer fixed-misc Unicode font, if
installed and where its coverage of symbols and punctuation is
known to be good. (Bug#20727)
Glenn Morris [Sun, 14 Jun 2015 00:17:47 +0000 (17:17 -0700)]
Tweaks for getting repository version; a bit more like it was for bzr.
* lisp/version.el (emacs-repository-version-git)
(emacs-repository--version-git-1): New functions,
split from emacs-repository-get-version.
(emacs-repository-get-version): Make the second argument meaningful.
Paul Eggert [Sat, 13 Jun 2015 16:35:10 +0000 (09:35 -0700)]
Better fix for documenting `X as "`X"
Fix suggested by Stefan Monnier.
* lisp/help-fns.el (help-fns--signature):
Insert "`X", not "(\` X)", when documenting `X (Bug#20759).
* lisp/help.el (help-split-fundoc, help--make-usage-docstring):
Don't treat `X specially, as help-fns--signature now handles this.
Eli Zaretskii [Sat, 13 Jun 2015 11:51:33 +0000 (14:51 +0300)]
Improve the default fontset when Symbola is not installed
* lisp/international/fontset.el (setup-default-fontset): Only
prepend Symbola and FreeMono font specs for symbols and
punctuation; do not replace the default spec for them. This
should have better results when Symbola/FreeMono are not
installed. (Bug#20727)
Eli Zaretskii [Sat, 13 Jun 2015 10:23:42 +0000 (13:23 +0300)]
Improve documentation of ':lang' in font specs
* src/font.c (Ffont_spec): Doc fix: elaborate on the values and
use of the ':lang' property of the font spec.
* doc/emacs/frames.texi (Fonts): Document the language names that
can be in the STYLE part of XLFD.
* doc/lispref/display.texi (Low-Level Font): Document the ':lang'
property.
Eli Zaretskii [Sat, 13 Jun 2015 07:31:37 +0000 (10:31 +0300)]
Revert last change in fontset.el
* lisp/international/fontset.el (setup-default-fontset): Revert
the change "Configure Symbola font only if installed", since font
search is evidently not yet set up when this function is called.
(Bug#20727)
Eli Zaretskii [Fri, 12 Jun 2015 19:45:41 +0000 (22:45 +0300)]
Configure Symbola font only for symbols and punctuation
* lisp/international/fontset.el (setup-default-fontset): Leave
only symbols and punctuation in the fontset setup for Symbola
font; remove "Greek and Coptic" and "Cyrillic Supplement".
(Bug#20798)
Paul Eggert [Fri, 12 Jun 2015 05:49:02 +0000 (22:49 -0700)]
Port to Solaris 10 sparc + Sun C 5.13
* configure.ac (SETUP_SLAVE_PTY) [sol2* | unixware]:
Adjust to process.c change.
* src/process.c (create_process): Declare volatile variables at
top level of this function, so that they're less likely to be
reused later in the function in the code executed by the vforked
child. Do not declare locals used only in the vforked child, as
they might share memory with locals still live in the parent.
Instead, use the same variables in the child as in the parent.
This works around a subtle bug that causes a garbage collector
crash when Emacs is built with Sun C 5.13 sparc on Solaris 10.
Paul Eggert [Thu, 11 Jun 2015 23:41:36 +0000 (16:41 -0700)]
Fix "not a tty" bug on Solaris 10
* configure.ac (PTY_OPEN): Define to plain 'open'
on SVR4-derived hosts, so that the O_CLOEXEC flag isn't set.
* src/process.c (allocate_pty): Set the O_CLOEXEC flag after
calling PTY_TTY_NAME_SPRINTF, for the benefit of SVR4-derived
hosts that call grantpt which does its work via a setuid subcommand
(Bug#19191, Bug#19927, Bug#20555, Bug#20686).
Also, set O_CLOEXEC even if PTY_OPEN is not defined, since it
seems relevant in that case too.
Paul Eggert [Thu, 11 Jun 2015 17:23:46 +0000 (10:23 -0700)]
Fix quoting of help for functions with odd names
While investigating Bug#20759, I discovered other quoting problems:
C-h f mishandled characters like backslash and quote in function names.
This fix changes the behavior so that 'C-h f pcase RET' now
generates "... (\` QPAT) ..." instead of "... (` QPAT) ...",
because '(format "%S" '(` FOO))' returns "(\\` FOO)". A comment
in src/lread.c's read1 function says that the backslash will be
needed starting in Emacs 25, which implies that 'format' is
correct and the old pcase documention was wrong to omit the backslash.
* lisp/emacs-lisp/nadvice.el (advice--make-docstring):
* lisp/help-fns.el (help-fns--signature):
* lisp/help.el (help-add-fundoc-usage):
* lisp/progmodes/elisp-mode.el (elisp-function-argstring):
Use help--make-usage-docstring rather than formatting
help-make-usage.
* lisp/emacs-lisp/pcase.el (pcase--make-docstring):
Return raw docstring.
* lisp/help-fns.el (help-fns--signature): New arg RAW, to return
raw docstring. Take more care to distinguish raw from cooked dstrings.
(describe-function-1): Let help-fns--signature substitute
command keys.
* lisp/help.el (help--docstring-quote): New function.
(help-split-fundoc): Use it, to quote funny characters more
systematically.
(help--make-usage): Rename from help-make-usage, since this
should be private. Leave an obsolete alias for the old name.
(help--make-usage-docstring): New function.
* test/automated/help-fns.el (help-fns-test-funny-names): New test.
Glenn Morris [Wed, 10 Jun 2015 23:07:09 +0000 (19:07 -0400)]
Slight namespace cleanup for thingatpt.el.
* lisp/thingatpt.el (thing-at-point--in-string-p)
(thing-at-point--end-of-sexp, thing-at-point--beginning-of-sexp)
(thing-at-point--read-from-whole-string): Rename from
old versions without "thing-at-point--" prefix.
Keep old versions as obsolete aliases. Update all uses.