Stefan Monnier [Fri, 19 Jun 2015 14:51:22 +0000 (10:51 -0400)]
(filepos-to-bufferpos): Further tweaks to the utf-16 code
* lisp/international/mule-util.el (filepos-to-bufferpos):
Fix typo. Move non-exact check to the utf-16 branch (the only one
affected). Don't use byte-to-position for the utf-16 case.
Eli Zaretskii [Fri, 19 Jun 2015 08:19:06 +0000 (11:19 +0300)]
Minor fixes in filepos-to-bufferpos
* lisp/international/mule-util.el (filepos-to-bufferpos): Remove
test for utf-8-emacs. Exempt single-byte encodings from the
'use-exact' path when QUALITY is 'exact'. Test UTF-16 encodings
for BOM before subtracting 2 bytes. Use 'identity' when adjusting
UTF-16 encoded files for CR-LF EOLs.
Paul Eggert [Fri, 19 Jun 2015 07:35:43 +0000 (00:35 -0700)]
Improve the optional translation of quotes
Fix several problems with the recently-added custom variable
help-quote-translation where the code would quote inconsistently
in help buffers. Add support for quoting 'like this', which
is common in other GNU programs in ASCII environments. Change
help-quote-translation to use more mnemonic values: values are now the
initial quoting char, e.g., (setq help-quote-translation ?`) gets the
traditional Emacs help-buffer quoting style `like this'. Change the
default behavior of substitute-command-keys to match what's done in
set-locale-environment, i.e., quote ‘like this’ if displayable,
'like this' otherwise.
* doc/lispref/help.texi (Keys in Documentation): Document
new behavior of substitute-command-keys, and document
help-quote-translation.
* doc/lispref/tips.texi (Documentation Tips):
Mention the effect of help-quote-translation.
* etc/NEWS: Mention new behavior of substitute-command-keys,
and merge help-quote-translation news into it.
When talking about doc strings, mention new ways to type quotes.
* lisp/cedet/mode-local.el (overload-docstring-extension):
Revert my recent change to this function, which shouldn't be
needed as the result is a doc string.
* lisp/cedet/mode-local.el (mode-local-print-binding)
(mode-local-describe-bindings-2):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-theme.el (describe-theme-1):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-class)
(eieio-help-constructor):
* lisp/emacs-lisp/package.el (describe-package-1):
* lisp/faces.el (describe-face):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode):
Use substitute-command-keys to ensure a more-consistent quoting
style in help buffers.
* lisp/cus-start.el (standard):
Document new help-quote-translation behavior.
* lisp/emacs-lisp/lisp-mode.el (lisp-fdefs):
* lisp/help-mode.el (help-xref-symbol-regexp, help-xref-info-regexp)
(help-xref-url-regexp):
* lisp/international/mule-cmds.el (help-xref-mule-regexp-template):
* lisp/wid-edit.el (widget-documentation-link-regexp):
Also match 'foo', in case we're in a help buffer generated when
help-quote-translation is ?'.
* src/doc.c: Include disptab.h, for DISP_CHAR_VECTOR.
(LEFT_SINGLE_QUOTATION_MARK, uLSQM0, uLSQM1, uLSQM2, uRSQM0)
(uRSQM1, uRSQM2, LSQM, RSQM): New constants.
(Fsubstitute_command_keys): Document and implement new behavior.
(Vhelp_quote_translation): Document new behavior.
Alan Mackenzie [Thu, 18 Jun 2015 21:00:20 +0000 (21:00 +0000)]
Make translation of quotes to curly in doc strings optional.
src/doc.c (traditional, prefer-unicode): new symbols.
(help-quote-translation): new variable.
(Fsubstitute_command_keys): make translation of quotes dependent on
`help-quote-translation'; also translate curly quotes back to ASCII
ones.
lisp/cus-start.el (top-level): Add a customization entry for
`help-quote-translation'.
(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.