commit d67d49ceb31777cb731a56b9518bf1a1f2a94d25 (HEAD, refs/remotes/origin/master) Author: Glenn Morris Date: Tue Jun 16 23:43:03 2015 -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. * lisp/international/characters.el: Load charscript. * src/Makefile.in (charscript): New variable. (${charscript}): New target. (${lispintdir}/characters.elc): Depend on charscript.elc. (temacs$(EXEEXT)): Depend on charscript. ; * admin/unidata/README: Mention Blocks.txt. ; * .gitignore: Add lisp/international/charscript.el. diff --git a/.gitignore b/.gitignore index 092fd03..1e2f206 100644 --- a/.gitignore +++ b/.gitignore @@ -195,6 +195,7 @@ admin/charsets/jisx2131-filter admin/unidata/unidata.txt etc/charsets/*.map lisp/international/charprop.el +lisp/international/charscript.el lisp/international/cp51932.el lisp/international/eucjp-ms.el lisp/international/uni-*.el diff --git a/admin/unidata/Blocks.txt b/admin/unidata/Blocks.txt new file mode 100644 index 0000000..0a4a580 --- /dev/null +++ b/admin/unidata/Blocks.txt @@ -0,0 +1,298 @@ +# Blocks-8.0.0.txt +# Date: 2014-11-10, 23:04:00 GMT [KW] +# +# Unicode Character Database +# Copyright (c) 1991-2014 Unicode, Inc. +# For terms of use, see http://www.unicode.org/terms_of_use.html +# For documentation, see http://www.unicode.org/reports/tr44/ +# +# Format: +# Start Code..End Code; Block Name + +# ================================================ + +# Note: When comparing block names, casing, whitespace, hyphens, +# and underbars are ignored. +# For example, "Latin Extended-A" and "latin extended a" are equivalent. +# For more information on the comparison of property values, +# see UAX #44: http://www.unicode.org/reports/tr44/ +# +# All block ranges start with a value where (cp MOD 16) = 0, +# and end with a value where (cp MOD 16) = 15. In other words, +# the last hexadecimal digit of the start of range is ...0 +# and the last hexadecimal digit of the end of range is ...F. +# This constraint on block ranges guarantees that allocations +# are done in terms of whole columns, and that code chart display +# never involves splitting columns in the charts. +# +# All code points not explicitly listed for Block +# have the value No_Block. + +# Property: Block +# +# @missing: 0000..10FFFF; No_Block + +0000..007F; Basic Latin +0080..00FF; Latin-1 Supplement +0100..017F; Latin Extended-A +0180..024F; Latin Extended-B +0250..02AF; IPA Extensions +02B0..02FF; Spacing Modifier Letters +0300..036F; Combining Diacritical Marks +0370..03FF; Greek and Coptic +0400..04FF; Cyrillic +0500..052F; Cyrillic Supplement +0530..058F; Armenian +0590..05FF; Hebrew +0600..06FF; Arabic +0700..074F; Syriac +0750..077F; Arabic Supplement +0780..07BF; Thaana +07C0..07FF; NKo +0800..083F; Samaritan +0840..085F; Mandaic +08A0..08FF; Arabic Extended-A +0900..097F; Devanagari +0980..09FF; Bengali +0A00..0A7F; Gurmukhi +0A80..0AFF; Gujarati +0B00..0B7F; Oriya +0B80..0BFF; Tamil +0C00..0C7F; Telugu +0C80..0CFF; Kannada +0D00..0D7F; Malayalam +0D80..0DFF; Sinhala +0E00..0E7F; Thai +0E80..0EFF; Lao +0F00..0FFF; Tibetan +1000..109F; Myanmar +10A0..10FF; Georgian +1100..11FF; Hangul Jamo +1200..137F; Ethiopic +1380..139F; Ethiopic Supplement +13A0..13FF; Cherokee +1400..167F; Unified Canadian Aboriginal Syllabics +1680..169F; Ogham +16A0..16FF; Runic +1700..171F; Tagalog +1720..173F; Hanunoo +1740..175F; Buhid +1760..177F; Tagbanwa +1780..17FF; Khmer +1800..18AF; Mongolian +18B0..18FF; Unified Canadian Aboriginal Syllabics Extended +1900..194F; Limbu +1950..197F; Tai Le +1980..19DF; New Tai Lue +19E0..19FF; Khmer Symbols +1A00..1A1F; Buginese +1A20..1AAF; Tai Tham +1AB0..1AFF; Combining Diacritical Marks Extended +1B00..1B7F; Balinese +1B80..1BBF; Sundanese +1BC0..1BFF; Batak +1C00..1C4F; Lepcha +1C50..1C7F; Ol Chiki +1CC0..1CCF; Sundanese Supplement +1CD0..1CFF; Vedic Extensions +1D00..1D7F; Phonetic Extensions +1D80..1DBF; Phonetic Extensions Supplement +1DC0..1DFF; Combining Diacritical Marks Supplement +1E00..1EFF; Latin Extended Additional +1F00..1FFF; Greek Extended +2000..206F; General Punctuation +2070..209F; Superscripts and Subscripts +20A0..20CF; Currency Symbols +20D0..20FF; Combining Diacritical Marks for Symbols +2100..214F; Letterlike Symbols +2150..218F; Number Forms +2190..21FF; Arrows +2200..22FF; Mathematical Operators +2300..23FF; Miscellaneous Technical +2400..243F; Control Pictures +2440..245F; Optical Character Recognition +2460..24FF; Enclosed Alphanumerics +2500..257F; Box Drawing +2580..259F; Block Elements +25A0..25FF; Geometric Shapes +2600..26FF; Miscellaneous Symbols +2700..27BF; Dingbats +27C0..27EF; Miscellaneous Mathematical Symbols-A +27F0..27FF; Supplemental Arrows-A +2800..28FF; Braille Patterns +2900..297F; Supplemental Arrows-B +2980..29FF; Miscellaneous Mathematical Symbols-B +2A00..2AFF; Supplemental Mathematical Operators +2B00..2BFF; Miscellaneous Symbols and Arrows +2C00..2C5F; Glagolitic +2C60..2C7F; Latin Extended-C +2C80..2CFF; Coptic +2D00..2D2F; Georgian Supplement +2D30..2D7F; Tifinagh +2D80..2DDF; Ethiopic Extended +2DE0..2DFF; Cyrillic Extended-A +2E00..2E7F; Supplemental Punctuation +2E80..2EFF; CJK Radicals Supplement +2F00..2FDF; Kangxi Radicals +2FF0..2FFF; Ideographic Description Characters +3000..303F; CJK Symbols and Punctuation +3040..309F; Hiragana +30A0..30FF; Katakana +3100..312F; Bopomofo +3130..318F; Hangul Compatibility Jamo +3190..319F; Kanbun +31A0..31BF; Bopomofo Extended +31C0..31EF; CJK Strokes +31F0..31FF; Katakana Phonetic Extensions +3200..32FF; Enclosed CJK Letters and Months +3300..33FF; CJK Compatibility +3400..4DBF; CJK Unified Ideographs Extension A +4DC0..4DFF; Yijing Hexagram Symbols +4E00..9FFF; CJK Unified Ideographs +A000..A48F; Yi Syllables +A490..A4CF; Yi Radicals +A4D0..A4FF; Lisu +A500..A63F; Vai +A640..A69F; Cyrillic Extended-B +A6A0..A6FF; Bamum +A700..A71F; Modifier Tone Letters +A720..A7FF; Latin Extended-D +A800..A82F; Syloti Nagri +A830..A83F; Common Indic Number Forms +A840..A87F; Phags-pa +A880..A8DF; Saurashtra +A8E0..A8FF; Devanagari Extended +A900..A92F; Kayah Li +A930..A95F; Rejang +A960..A97F; Hangul Jamo Extended-A +A980..A9DF; Javanese +A9E0..A9FF; Myanmar Extended-B +AA00..AA5F; Cham +AA60..AA7F; Myanmar Extended-A +AA80..AADF; Tai Viet +AAE0..AAFF; Meetei Mayek Extensions +AB00..AB2F; Ethiopic Extended-A +AB30..AB6F; Latin Extended-E +AB70..ABBF; Cherokee Supplement +ABC0..ABFF; Meetei Mayek +AC00..D7AF; Hangul Syllables +D7B0..D7FF; Hangul Jamo Extended-B +D800..DB7F; High Surrogates +DB80..DBFF; High Private Use Surrogates +DC00..DFFF; Low Surrogates +E000..F8FF; Private Use Area +F900..FAFF; CJK Compatibility Ideographs +FB00..FB4F; Alphabetic Presentation Forms +FB50..FDFF; Arabic Presentation Forms-A +FE00..FE0F; Variation Selectors +FE10..FE1F; Vertical Forms +FE20..FE2F; Combining Half Marks +FE30..FE4F; CJK Compatibility Forms +FE50..FE6F; Small Form Variants +FE70..FEFF; Arabic Presentation Forms-B +FF00..FFEF; Halfwidth and Fullwidth Forms +FFF0..FFFF; Specials +10000..1007F; Linear B Syllabary +10080..100FF; Linear B Ideograms +10100..1013F; Aegean Numbers +10140..1018F; Ancient Greek Numbers +10190..101CF; Ancient Symbols +101D0..101FF; Phaistos Disc +10280..1029F; Lycian +102A0..102DF; Carian +102E0..102FF; Coptic Epact Numbers +10300..1032F; Old Italic +10330..1034F; Gothic +10350..1037F; Old Permic +10380..1039F; Ugaritic +103A0..103DF; Old Persian +10400..1044F; Deseret +10450..1047F; Shavian +10480..104AF; Osmanya +10500..1052F; Elbasan +10530..1056F; Caucasian Albanian +10600..1077F; Linear A +10800..1083F; Cypriot Syllabary +10840..1085F; Imperial Aramaic +10860..1087F; Palmyrene +10880..108AF; Nabataean +108E0..108FF; Hatran +10900..1091F; Phoenician +10920..1093F; Lydian +10980..1099F; Meroitic Hieroglyphs +109A0..109FF; Meroitic Cursive +10A00..10A5F; Kharoshthi +10A60..10A7F; Old South Arabian +10A80..10A9F; Old North Arabian +10AC0..10AFF; Manichaean +10B00..10B3F; Avestan +10B40..10B5F; Inscriptional Parthian +10B60..10B7F; Inscriptional Pahlavi +10B80..10BAF; Psalter Pahlavi +10C00..10C4F; Old Turkic +10C80..10CFF; Old Hungarian +10E60..10E7F; Rumi Numeral Symbols +11000..1107F; Brahmi +11080..110CF; Kaithi +110D0..110FF; Sora Sompeng +11100..1114F; Chakma +11150..1117F; Mahajani +11180..111DF; Sharada +111E0..111FF; Sinhala Archaic Numbers +11200..1124F; Khojki +11280..112AF; Multani +112B0..112FF; Khudawadi +11300..1137F; Grantha +11480..114DF; Tirhuta +11580..115FF; Siddham +11600..1165F; Modi +11680..116CF; Takri +11700..1173F; Ahom +118A0..118FF; Warang Citi +11AC0..11AFF; Pau Cin Hau +12000..123FF; Cuneiform +12400..1247F; Cuneiform Numbers and Punctuation +12480..1254F; Early Dynastic Cuneiform +13000..1342F; Egyptian Hieroglyphs +14400..1467F; Anatolian Hieroglyphs +16800..16A3F; Bamum Supplement +16A40..16A6F; Mro +16AD0..16AFF; Bassa Vah +16B00..16B8F; Pahawh Hmong +16F00..16F9F; Miao +1B000..1B0FF; Kana Supplement +1BC00..1BC9F; Duployan +1BCA0..1BCAF; Shorthand Format Controls +1D000..1D0FF; Byzantine Musical Symbols +1D100..1D1FF; Musical Symbols +1D200..1D24F; Ancient Greek Musical Notation +1D300..1D35F; Tai Xuan Jing Symbols +1D360..1D37F; Counting Rod Numerals +1D400..1D7FF; Mathematical Alphanumeric Symbols +1D800..1DAAF; Sutton SignWriting +1E800..1E8DF; Mende Kikakui +1EE00..1EEFF; Arabic Mathematical Alphabetic Symbols +1F000..1F02F; Mahjong Tiles +1F030..1F09F; Domino Tiles +1F0A0..1F0FF; Playing Cards +1F100..1F1FF; Enclosed Alphanumeric Supplement +1F200..1F2FF; Enclosed Ideographic Supplement +1F300..1F5FF; Miscellaneous Symbols and Pictographs +1F600..1F64F; Emoticons +1F650..1F67F; Ornamental Dingbats +1F680..1F6FF; Transport and Map Symbols +1F700..1F77F; Alchemical Symbols +1F780..1F7FF; Geometric Shapes Extended +1F800..1F8FF; Supplemental Arrows-C +1F900..1F9FF; Supplemental Symbols and Pictographs +20000..2A6DF; CJK Unified Ideographs Extension B +2A700..2B73F; CJK Unified Ideographs Extension C +2B740..2B81F; CJK Unified Ideographs Extension D +2B820..2CEAF; CJK Unified Ideographs Extension E +2F800..2FA1F; CJK Compatibility Ideographs Supplement +E0000..E007F; Tags +E0100..E01EF; Variation Selectors Supplement +F0000..FFFFF; Supplementary Private Use Area-A +100000..10FFFF; Supplementary Private Use Area-B + +# EOF diff --git a/admin/unidata/Makefile.in b/admin/unidata/Makefile.in index 6c81d32..954e9fa 100644 --- a/admin/unidata/Makefile.in +++ b/admin/unidata/Makefile.in @@ -23,6 +23,8 @@ SHELL = @SHELL@ +AWK = @AWK@ + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ @@ -51,7 +53,7 @@ am__v_at_1 = .PHONY: all unifiles -all: ${top_srcdir}/src/macuvs.h unifiles +all: ${top_srcdir}/src/macuvs.h unifiles ${unidir}/charscript.el ## Specify .elc as an order-only prereq so as to not needlessly rebuild ## target just because the .elc is missing. @@ -94,6 +96,16 @@ unifiles: ${unidir}/charprop.el [ -f $(unidir)/$$f ] || exec $(MAKE) PHONY_EXTRAS=$< $<; \ done + +.PHONY: charscript.el +charscript.el: ${unidir}/charscript.el + +blocks = ${srcdir}/blocks.awk + +${unidir}/charscript.el: ${srcdir}/Blocks.txt ${blocks} + $(AM_V_GEN)$(AWK) -f ${blocks} < $< > $@ + + .PHONY: clean bootstrap-clean distclean maintainer-clean extraclean clean: @@ -110,7 +122,7 @@ maintainer-clean: distclean ## change and it slows down bootstrap (a tiny bit). ## Cf leim/ja-dic (which is much slower). extraclean: - rm -f ${top_srcdir}/src/macuvs.h + rm -f ${top_srcdir}/src/macuvs.h ${unidir}/charscript.el* ifneq (,$(wildcard $(unidir)/charprop.el)) cd $(unidir) && \ rm -f `sed -n 's/^;; FILE: //p' < charprop.el` charprop.el diff --git a/admin/unidata/README b/admin/unidata/README index e0d0e00..8ad0a12 100644 --- a/admin/unidata/README +++ b/admin/unidata/README @@ -16,3 +16,7 @@ http://www.unicode.org/ivd/data/2014-05-16/IVD_Sequences.txt UnicodeData.txt http://www.unicode.org/Public/UNIDATA/UnicodeData.txt 2014-03-10 + +Blocks.txt +http://www.unicode.org/Public/8.0.0/ucd/Blocks.txt +2014-11-10 diff --git a/admin/unidata/blocks.awk b/admin/unidata/blocks.awk new file mode 100755 index 0000000..892ac58 --- /dev/null +++ b/admin/unidata/blocks.awk @@ -0,0 +1,225 @@ +#!/usr/bin/awk -f + +## Copyright (C) 2015 Free Software Foundation, Inc. + +## Author: Glenn Morris + +## This file is part of GNU Emacs. + +## GNU Emacs is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. + +## GNU Emacs is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with GNU Emacs. If not, see . + +### Commentary: + +## This script takes as input Unicode's Blocks.txt +## (http://www.unicode.org/Public/UNIDATA/Blocks.txt) +## and produces output for Emacs's lisp/international/charscript.el. + +## It lumps together all the blocks belonging to the same language. +## E.g., "Basic Latin", "Latin-1 Supplement", "Latin Extended-A", +## etc. are all lumped together under "latin". + +## The Unicode blocks actually extend past some of these ranges with +## undefined codepoints. + +## For additional details, see . + +## Things to do after installing a new version of Blocks.txt: +## Check the output against the old output. +## Adjust the alias array, and the name2alias function for any new +## entries, if necessary. +## Check fix_start (and fix_end) to see if entries need adding/removing. +## Review the hard-coded splits at the end of the main body. + +### Code: + +BEGIN { + ## Hard-coded names. See name2alias for the rest. + alias["ipa extensions"] = "phonetic" + alias["letterlike symbols"] = "symbol" + alias["number forms"] = "symbol" + alias["miscellaneous technical"] = "symbol" + alias["control pictures"] = "symbol" + alias["optical character recognition"] = "symbol" + alias["enclosed alphanumerics"] = "symbol" + alias["box drawing"] = "symbol" + alias["block elements"] = "symbol" + alias["miscellaneous symbols"] = "symbol" + alias["cjk strokes"] = "cjk-misc" + alias["cjk symbols and punctuation"] = "cjk-misc" + alias["halfwidth and fullwidth forms"] = "cjk-misc" + alias["common indic number forms"] = "north-indic-number" + + tohex["a"] = 10 + tohex["b"] = 11 + tohex["c"] = 12 + tohex["d"] = 13 + tohex["e"] = 14 + tohex["f"] = 15 + + fix_start["0080"] = "00A0" + ## Define fix_end here if you need it. +} + +## From admin/charsets/. +## With gawk's --non-decimal-data switch we wouldn't need this. +function decode_hex(str , n, len, i, c) { + n = 0 + len = length(str) + for (i = 1; i <= len; i++) + { + c = substr (str, i, 1) + if (c >= "0" && c <= "9") + n = n * 16 + (c - "0") + else + n = n * 16 + tohex[tolower(c)] + } + return n +} + +function name2alias(name , w, w2) { + name = tolower(name) + if (alias[name]) return alias[name] + else if (name ~ /for symbols/) return "symbol" + else if (name ~ /latin|combining .* marks|spacing modifier|tone letters|alphabetic presentation/) return "latin" + else if (name ~ /cjk|yijing|enclosed ideograph|kangxi/) return "han" + else if (name ~ /arabic/) return "arabic" + else if (name ~ /^greek/) return "greek" + else if (name ~ /^coptic/) return "coptic" + else if (name ~ /cuneiform number/) return "cuneiform-numbers-and-punctuation" + else if (name ~ /cuneiform/) return "cuneiform" + else if (name ~ /mathematical alphanumeric symbol/) return "mathematical" + else if (name ~ /punctuation|mathematical|arrows|currency|superscript|small form variants|geometric|dingbats|enclosed|alchemical|pictograph|emoticon|transport/) return "symbol" + else if (name ~ /canadian aboriginal/) return "canadian-aboriginal" + else if (name ~ /katakana|hiragana/) return "kana" + else if (name ~ /myanmar/) return "burmese" + else if (name ~ /hangul/) return "hangul" + else if (name ~ /khmer/) return "khmer" + else if (name ~ /braille/) return "braille" + else if (name ~ /^yi /) return "yi" + else if (name ~ /surrogates|private use|variation selectors/) return 0 + else if (name ~/^(specials|tags)$/) return 0 + else if (name ~ /linear b/) return "linear-b" + else if (name ~ /aramaic/) return "aramaic" + else if (name ~ /rumi num/) return "rumi-number" + else if (name ~ /duployan|shorthand/) return "duployan-shorthand" + else if (name ~ /sutton signwriting/) return "sutton-sign-writing" + + sub(/ (extended|extensions|supplement).*/, "", name) + sub(/numbers/, "number", name) + sub(/numerals/, "numeral", name) + sub(/symbols/, "symbol", name) + sub(/forms$/, "form", name) + sub(/tiles$/, "tile", name) + sub(/^new /, "", name) + sub(/ (characters|hieroglyphs|cursive)$/, "", name) + gsub(/ /, "-", name) + + return name +} + +/^[0-9A-F]/ { + sep = index($1, "..") + len = length($1) + s = substr($1,1,sep-1) + e = substr($1,sep+2,len-sep-2) + $1 = "" + sub(/^ */, "", $0) + i++ + start[i] = fix_start[s] ? fix_start[s] : s + end[i] = fix_end[e] ? fix_end[e]: e + name[i] = $0 + + alt[i] = name2alias(name[i]) + + if (!alt[i]) + { + i-- + next + } + + ## Combine adjacent ranges with the same name. + if (alt[i] == alt[i-1] && decode_hex(start[i]) == 1 + decode_hex(end[i-1])) + { + end[i-1] = end[i] + name[i-1] = (name[i-1] ", " name[i]) + i-- + } + + ## Some hard-coded splits. + if (start[i] == "0370") + { + end[i] = "03E1" + i++ + start[i] = "03E2" + end[i] = "03EF" + alt[i] = "coptic" + i++ + start[i] = "03F0" + end[i] = "03FF" + alt[i] = "greek" + } + else if (start[i] == "FB00") + { + end[i] = "FB06" + i++ + start[i] = "FB13" + end[i] = "FB17" + alt[i] = "armenian" + i++ + start[i] = "FB1D" + end[i] = "FB4F" + alt[i] = "hebrew" + } + else if (start[i] == "FF00") + { + end[i] = "FF60" + i++ + start[i] = "FF61" + end[i] = "FF9F" + alt[i] = "kana" + i++ + start[i] = "FFA0" + end[i] = "FFDF" + alt[i] = "hangul" + i++ + start[i] = "FFE0" + end[i] = "FFEF" + alt[i] = "cjk-misc" + } +} + +END { + print ";;; charscript.el --- character script table" + print ";;; Automatically generated from admin/unidata/Blocks.txt" + print "(let (script-list)" + print " (dolist (elt '(" + + for (j=1;j<=i;j++) + { + printf(" (#x%s #x%s %s)", start[j], end[j], alt[j]) + ## Fuzz to decide whether worth printing original name as a comment. + if (name[j] && alt[j] != tolower(name[j]) && alt[j] !~ /-/) + printf(" ; %s", name[j]) + printf("\n") + } + + print " ))" + print " (set-char-table-range char-script-table" + print " (cons (car elt) (nth 1 elt)) (nth 2 elt))" + print " (or (memq (nth 2 elt) script-list)" + print " (setq script-list (cons (nth 2 elt) script-list))))" + print " (set-char-table-extra-slot char-script-table 0 (nreverse script-list)))" + print "" + print "(provide 'charscript)" +} diff --git a/lisp/international/characters.el b/lisp/international/characters.el index c4c9060..310384a 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -1163,235 +1163,11 @@ Setup char-width-table appropriate for non-CJK language environment." ;; Setting char-script-table. - -;; The data is compiled from Blocks.txt and Scripts.txt in the -;; "Unicode Character Database", simplified to lump together all the -;; blocks belonging to the same language. E.g., "Basic Latin", -;; "Latin-1 Supplement", "Latin Extended-A", etc. are all lumped -;; together under "latin". -;; -;; The Unicode blocks actually extend past some of these ranges with -;; undefined codepoints. -;; -;; Last update: http://www.unicode.org/Public/8.0.0/ucd/Blocks-8.0.0d3.txt -(let ((script-list nil)) - (dolist - (elt - '((#x0000 #x007F latin) - (#x00A0 #x024F latin) - (#x0250 #x02AF phonetic) ; IPA Extensions - (#x02B0 #x036F latin) ; Spacing Modifiers and Diacriticals - (#x0370 #x03E1 greek) - (#x03E2 #x03EF coptic) - (#x03F0 #x03FF greek) - (#x0400 #x052F cyrillic) - (#x0530 #x058F armenian) - (#x0590 #x05FF hebrew) - (#x0600 #x06FF arabic) - (#x0700 #x074F syriac) - (#x0750 #x077F arabic) ; Arabic Supplement - (#x0780 #x07BF thaana) - (#x07C0 #x07FF nko) - (#x0800 #x083F samaritan) - (#x0840 #x085F mandaic) - (#x08A0 #x08FF arabic) ; Arabic Extended-A - (#x0900 #x097F devanagari) - (#x0980 #x09FF bengali) - (#x0A00 #x0A7F gurmukhi) - (#x0A80 #x0AFF gujarati) - (#x0B00 #x0B7F oriya) - (#x0B80 #x0BFF tamil) - (#x0C00 #x0C7F telugu) - (#x0C80 #x0CFF kannada) - (#x0D00 #x0D7F malayalam) - (#x0D80 #x0DFF sinhala) - (#x0E00 #x0E7F thai) - (#x0E80 #x0EFF lao) - (#x0F00 #x0FFF tibetan) - (#x1000 #x109F burmese) ; Myanmar - (#x10A0 #x10FF georgian) - (#x1100 #x11FF hangul) - (#x1200 #x139F ethiopic) ; Ethiopic and Ethiopic Supplement - (#x13A0 #x13FF cherokee) - (#x1400 #x167F canadian-aboriginal) - (#x1680 #x169F ogham) - (#x16A0 #x16FF runic) - (#x1700 #x171F tagalog) - (#x1720 #x173F hanunoo) - (#x1740 #x175F buhid) - (#x1760 #x177F tagbanwa) - (#x1780 #x17FF khmer) - (#x1800 #x18AF mongolian) - (#x18B0 #x18FF canadian-aboriginal) ; Canadian Aboriginal Syllabics Extended - (#x1900 #x194F limbu) - (#x1950 #x197F tai-le) - (#x1980 #x19DF tai-lue) ; New Tai Lue - (#x19E0 #x19FF khmer) ; Khmer Symbols - (#x1A00 #x1A1F buginese) - (#x1A20 #x1AAF tai-tham) - (#x1AB0 #x1AFF latin) ; Combining Diacritical Marks Extended - (#x1B00 #x1B7F balinese) - (#x1B80 #x1BBF sundanese) - (#x1BC0 #x1BFF batak) - (#x1C00 #x1C4F lepcha) - (#x1C50 #x1C7F ol-chiki) - (#x1CC0 #x1CCF sundanese) - (#x1CD0 #x1CFF vedic) - (#x1D00 #x1DBF phonetic) ; Phonetic Extensions & Supplement - (#x1DC0 #x1EFF latin) ; Latin Extended Additional - (#x1F00 #x1FFF greek) ; Greek Extended - (#x2000 #x27FF symbol) - (#x2800 #x28FF braille) - (#x2900 #x2BFF symbol) - (#x2C00 #x2C5F glagolitic) - (#x2C60 #x2C7F latin) ; Latin Extended-C - (#x2C80 #x2CFF coptic) - (#x2D00 #x2D2F georgian) ; Georgian Supplement - (#x2D30 #x2D7F tifinagh) - (#x2D80 #x2DDF ethiopic) ; Ethiopic Extended - (#x2DE0 #x2DFF cyrillic) ; Cyrillic Extended-A - (#x2E00 #x2E7F symbol) - (#x2E80 #x2FDF han) - (#x2FF0 #x2FFF ideographic-description) - (#x3000 #x303F cjk-misc) - (#x3040 #x30FF kana) ; Hiragana and Katakana - (#x3100 #x312F bopomofo) - (#x3130 #x318F hangul) ; Hangul Compatibility Jamo - (#x3190 #x319F kanbun) - (#x31A0 #x31BF bopomofo) ; Bopomofo Extended - (#x31C0 #x31EF cjk-misc) ; CJK Strokes - (#x31F0 #x31FF kana) ; Katakana Phonetic Extensions - (#x3200 #x9FFF han) - (#xA000 #xA4CF yi) - (#xA4D0 #xA4FF lisu) - (#xA500 #xA63F vai) - (#xA640 #xA69F cyrillic) ; Cyrillic Extended-B - (#xA6A0 #xA6FF bamum) - (#xA700 #xA7FF latin) - (#xA800 #xA82F syloti-nagri) - (#xA830 #xA83F north-indic-number) - (#xA840 #xA87F phags-pa) - (#xA880 #xA8DF saurashtra) - (#xA8E0 #xA8FF devanagari) ; Devanagari Extended - (#xA900 #xA92F kayah-li) - (#xA930 #xA95F rejang) - (#xA960 #xA97F hangul) ; Hangul Jamo Extended - (#xA980 #xA9DF javanese) - (#xA9E0 #xA9FF burmese) ; Myanmar Extended-B - (#xAA00 #xAA5F cham) - (#xAA60 #xAA7F burmese) ; Myanmar Extended-A - (#xAA80 #xAADF tai-viet) - (#xAAE0 #xAAFF meetei-mayek) ; Meetei Mayek Extensions - (#xAB00 #xAB2F ethiopic) ; Ethiopic Extended-A - (#xAB30 #xAB6F latin) ; Latin Extended-E - (#xAB70 #xABBF cherokee) ; Cherokee Supplement - (#xABC0 #xABFF meetei-mayek) - (#xAC00 #xD7FF hangul) - (#xF900 #xFAFF han) - (#xFB00 #xFB06 latin) ; Latin ligatures - (#xFB13 #xFB17 armenian) ; Armenian ligatures - (#xFB1D #xFB4F hebrew) ; Alphabetic Presentation Forms - (#xFB50 #xFDFF arabic) ; Arabic Presentation Forms-A - (#xFE10 #xFE1F vertical-form) - (#xFE20 #xFE2F latin) ; Combining Half Marks - (#xFE30 #xFE4F han) - (#xFE50 #xFE6F symbol) ; Small Form Variants - (#xFE70 #xFEFF arabic) ; Arabic Presentation Forms-B - (#xFF00 #xFF60 cjk-misc) - (#xFF61 #xFF9F kana) - (#xFFA0 #xFFDF hangul) - (#xFFE0 #xFFEF cjk-misc) - (#x10000 #x100FF linear-b) - (#x10100 #x1013F aegean-number) - (#x10140 #x1018F ancient-greek-number) - (#x10190 #x101CF ancient-symbol) - (#x101D0 #x101FF phaistos-disc) - (#x10280 #x1029F lycian) - (#x102A0 #x102DF carian) - (#x102E0 #x102FF coptic) ; Coptic Epact Numbers - (#x10300 #x1032F old-italic) - (#x10330 #x1034F gothic) - (#x10350 #x1037F old-permic) - (#x10380 #x1039F ugaritic) - (#x103A0 #x103DF old-persian) - (#x10400 #x1044F deseret) - (#x10450 #x1047F shavian) - (#x10480 #x104AF osmanya) - (#x10500 #x1052F elbasan) - (#x10530 #x1056F caucasian-albanian) - (#x10600 #x1077F linear-a) - (#x10800 #x1083F cypriot-syllabary) - (#x10840 #x1085F aramaic) - (#x10860 #x1087F palmyrene) - (#x10880 #x108AF nabataean) - (#x108E0 #x108FF hatran) - (#x10900 #x1091F phoenician) - (#x10920 #x1093F lydian) - (#x10980 #x109FF meroitic) - (#x10A00 #x10A5F kharoshthi) - (#x10A60 #x10A7F old-south-arabian) - (#x10A80 #x10A9F old-north-arabian) - (#x10AC0 #x10AFF manichaean) - (#x10B00 #x10B3F avestan) - (#x10B40 #x10B5F inscriptional-parthian) - (#x10B60 #x10B7F inscriptional-pahlavi) - (#x10B80 #x10BAF psalter-pahlavi) - (#x10C00 #x10C4F old-turkic) - (#x10C80 #x10CFF old-hungarian) - (#x10E60 #x10E7F rumi-number) - (#x11000 #x1107F brahmi) - (#x11080 #x110CF kaithi) - (#x110D0 #x110FF sora-sompeng) - (#x11100 #x1114F chakma) - (#x11150 #x1117F mahajani) - (#x11180 #x111DF sharada) - (#x111E0 #x111FF sinhala-archaic-number) - (#x11200 #x1124F khojki) - (#x11280 #x112AF multani) - (#x112B0 #x112FF khudawadi) - (#x11300 #x1137F grantha) - (#x11480 #x114DF tirhuta) - (#x11580 #x115FF siddham) - (#x11600 #x1165F modi) - (#x11680 #x116CF takri) - (#x11700 #x1173F ahom) - (#x118A0 #x118FF warang-citi) - (#x11AC0 #x11AFF pau-cin-hau) - (#x12000 #x123FF cuneiform) - (#x12400 #x1247F cuneiform-numbers-and-punctuation) - (#x12480 #x1254F cuneiform) ; Early Dynastic Cuneiform - (#x13000 #x1342F egyptian) - (#x14400 #x1467F anatolian) - (#x16800 #x16A3F bamum) - (#x16A40 #x16A6F mro) - (#x16AD0 #x16AFF bassa-vah) - (#x16B00 #x16B8F pahawh-hmong) - (#x16F00 #x16F9F miao) - (#x1B000 #x1B0FF kana) ; Kana Supplement - (#x1BC00 #x1BCAF duployan-shorthand) - (#x1D000 #x1D0FF byzantine-musical-symbol) - (#x1D100 #x1D1FF musical-symbol) - (#x1D200 #x1D24F ancient-greek-musical-notation) - (#x1D300 #x1D35F tai-xuan-jing-symbol) - (#x1D360 #x1D37F counting-rod-numeral) - (#x1D400 #x1D7FF mathematical) - (#x1D800 #x1DAAF sutton-sign-writing) - (#x1E800 #x1E8DF mende-kikakui) - (#x1EE00 #x1EEFF arabic) ; Arabic Mathematical Alphabetic Symbols - (#x1F000 #x1F02F mahjong-tile) - (#x1F030 #x1F09F domino-tile) - (#x1F0A0 #x1F0FF playing-cards) - (#x1F100 #x1F1FF symbol) ; Enclosed Alphanumeric Supplement - (#x1F200 #x1F2FF han) ; Enclosed Ideographic Supplement - (#x1F300 #x1F9FF symbol) - (#x20000 #x2A6DF han) - (#x2A700 #x2CEAF han) - (#x2F800 #x2FA1F han))) - (set-char-table-range char-script-table - (cons (car elt) (nth 1 elt)) (nth 2 elt)) - (or (memq (nth 2 elt) script-list) - (setq script-list (cons (nth 2 elt) script-list)))) - (set-char-table-extra-slot char-script-table 0 (nreverse script-list))) +(if purify-flag + ;; While dumping, we can't use require, and international is not + ;; in load-path. + (load "international/charscript") + (require 'charscript)) (map-charset-chars #'(lambda (range _ignore) diff --git a/src/Makefile.in b/src/Makefile.in index 172fa8e..e5c5ddb 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -488,6 +488,12 @@ charsets = ${top_srcdir}/admin/charsets/charsets.stamp ${charsets}: FORCE ${MAKE} -C ../admin/charsets all +charscript = ${lispintdir}/charscript.el +${charscript}: FORCE + $(MAKE) -C ../admin/unidata $(notdir $@) + +${lispintdir}/characters.elc: ${charscript:.el=.elc} + ## The dumped Emacs is as functional and more efficient than ## bootstrap-emacs, so we replace the latter with the former. ## Strictly speaking, emacs does not depend directly on all of $lisp, @@ -557,7 +563,7 @@ $(lib)/libgnu.a: $(config_h) ## This goes on to affect various things, and the emacs binary fails ## to start if Vinstallation_directory has the wrong value. temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) \ - $(lib)/libgnu.a $(EMACSRES) ${charsets} + $(lib)/libgnu.a $(EMACSRES) ${charsets} ${charscript} $(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ -o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES) $(MKDIR_P) $(etc) commit c9e2003b44b446a2f994039d9fc73d387cf6a1df Author: Glenn Morris Date: Tue Jun 16 23:26:16 2015 -0700 * lisp/international/characters.el (char-script-table): Tweak some ranges to better match the source. (Bug#20789#17) diff --git a/lisp/international/characters.el b/lisp/international/characters.el index ad6a0d9..c4c9060 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -1297,8 +1297,9 @@ Setup char-width-table appropriate for non-CJK language environment." (#xFE30 #xFE4F han) (#xFE50 #xFE6F symbol) ; Small Form Variants (#xFE70 #xFEFF arabic) ; Arabic Presentation Forms-B - (#xFF00 #xFF5F cjk-misc) + (#xFF00 #xFF60 cjk-misc) (#xFF61 #xFF9F kana) + (#xFFA0 #xFFDF hangul) (#xFFE0 #xFFEF cjk-misc) (#x10000 #x100FF linear-b) (#x10100 #x1013F aegean-number) @@ -1383,8 +1384,9 @@ Setup char-width-table appropriate for non-CJK language environment." (#x1F100 #x1F1FF symbol) ; Enclosed Alphanumeric Supplement (#x1F200 #x1F2FF han) ; Enclosed Ideographic Supplement (#x1F300 #x1F9FF symbol) - (#x20000 #x2CEAF han) - (#x2F800 #x2FFFF han))) + (#x20000 #x2A6DF han) + (#x2A700 #x2CEAF han) + (#x2F800 #x2FA1F han))) (set-char-table-range char-script-table (cons (car elt) (nth 1 elt)) (nth 2 elt)) (or (memq (nth 2 elt) script-list) commit 5a90d5125bc7b0486b40e8eb2095cb770e28c729 Author: Glenn Morris Date: Tue Jun 16 22:47:21 2015 -0700 Remove "no-byte-compile: t" from a few files. * lisp/obsolete/bruce.el, lisp/obsolete/keyswap.el: * lisp/obsolete/patcomp.el: No reason not to compile these. diff --git a/lisp/obsolete/bruce.el b/lisp/obsolete/bruce.el index 6b0d04e..54b92b6 100644 --- a/lisp/obsolete/bruce.el +++ b/lisp/obsolete/bruce.el @@ -1,4 +1,4 @@ -;;; bruce.el --- bruce phrase utility for overloading the Communications -*- no-byte-compile: t -*- +;;; bruce.el --- bruce phrase utility for overloading the Communications ;;; Decency Act snoops, if any. ;; Copyright (C) 1988, 1993, 1997, 2001-2015 Free Software Foundation, diff --git a/lisp/obsolete/keyswap.el b/lisp/obsolete/keyswap.el index 3c8fd5f..1f27896 100644 --- a/lisp/obsolete/keyswap.el +++ b/lisp/obsolete/keyswap.el @@ -1,4 +1,4 @@ -;;; keyswap.el --- swap BS and DEL keys -*- no-byte-compile: t -*- +;;; keyswap.el --- swap BS and DEL keys ;; Copyright (C) 1992, 2001-2015 Free Software Foundation, Inc. diff --git a/lisp/obsolete/patcomp.el b/lisp/obsolete/patcomp.el index 9aacdd8..8545f07 100644 --- a/lisp/obsolete/patcomp.el +++ b/lisp/obsolete/patcomp.el @@ -1,4 +1,4 @@ -;;; patcomp.el --- used by patch files to update Emacs releases -*- no-byte-compile: t -*- +;;; patcomp.el --- used by patch files to update Emacs releases ;; This file is part of GNU Emacs. commit 0fe54891f02e2d44b5de6cc8da3b3be809877574 Author: Glenn Morris Date: Tue Jun 16 20:54:40 2015 -0400 Fix some typos in copied Unicode data. (Bug#20789) * lisp/international/characters.el (char-script-table): * lisp/international/fontset.el (script-representative-chars) (setup-default-fontset): Fix typos. diff --git a/lisp/international/characters.el b/lisp/international/characters.el index dcf2d01..ad6a0d9 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -1308,7 +1308,7 @@ Setup char-width-table appropriate for non-CJK language environment." (#x10280 #x1029F lycian) (#x102A0 #x102DF carian) (#x102E0 #x102FF coptic) ; Coptic Epact Numbers - (#x10300 #x1032F olt-italic) + (#x10300 #x1032F old-italic) (#x10330 #x1034F gothic) (#x10350 #x1037F old-permic) (#x10380 #x1039F ugaritic) @@ -1360,7 +1360,7 @@ Setup char-width-table appropriate for non-CJK language environment." (#x12400 #x1247F cuneiform-numbers-and-punctuation) (#x12480 #x1254F cuneiform) ; Early Dynastic Cuneiform (#x13000 #x1342F egyptian) - (#x14400 #x1457F anatolian) + (#x14400 #x1467F anatolian) (#x16800 #x16A3F bamum) (#x16A40 #x16A6F mro) (#x16AD0 #x16AFF bassa-vah) diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 2c693f5..2d57955 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -198,7 +198,7 @@ (phaistos-disc #x101D0) (lycian #x10280) (carian #x102A0) - (olt-italic #x10300) + (old-italic #x10300) (ugaritic #x10380) (old-permic #x10350) (old-persian #x103A0) @@ -633,7 +633,7 @@ phaistos-disc lycian carian - olt-italic + old-italic ugaritic old-persian deseret commit b7d5033c39b82d8ae6cde701edcbf94f1575a622 Author: Glenn Morris Date: Tue Jun 16 20:45:35 2015 -0400 * lisp/emacs-lisp/check-declare.el (check-declare-warn): Don't print filename twice (it's in the prefix now). diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el index ecdb6d8..ea865f2 100644 --- a/lisp/emacs-lisp/check-declare.el +++ b/lisp/emacs-lisp/check-declare.el @@ -279,10 +279,8 @@ TYPE is a string giving the nature of the error. Warning is displayed in entry)) (warning-fill-prefix " ")) (display-warning 'check-declare - (format "%s said `%s' was defined in %s: %s" - (file-name-nondirectory file) fn - (file-name-nondirectory fnfile) - type) + (format "said `%s' was defined in %s: %s" + fn (file-name-nondirectory fnfile) type) nil check-declare-warning-buffer))) (declare-function compilation-forget-errors "compile" ()) commit d3b779fa79f3570879b2df2effa683c3b4aaa96a Author: Glenn Morris Date: Tue Jun 16 20:44:57 2015 -0400 * lisp/emacs-lisp/pcase.el (pcase--u1): Revert earlier workaround. No longer needed. diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index bcc2d58..50a2507 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -774,9 +774,9 @@ Otherwise, it defers to REST which is a list of branches of the form ((memq upat '(t _)) (let ((code (pcase--u1 matches code vars rest))) (if (eq upat '_) code - (message "%s" - "Pattern t is deprecated. Use `_' instead") - code))) + (macroexp--warn-and-return + "Pattern t is deprecated. Use `_' instead" + code)))) ((eq upat 'pcase--dontcare) :pcase--dontcare) ((memq (car-safe upat) '(guard pred)) (if (eq (car upat) 'pred) (pcase--mark-used sym)) commit c07e67aaafc5374ad6f26a5f6c631f19a9256969 Author: Glenn Morris Date: Tue Jun 16 20:44:23 2015 -0400 Address a compilation warning. * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defalias): Replace 't' with '_' in pcase. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index baa08e7..197df3b 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -4416,7 +4416,7 @@ binding slots have been popped." ;; which is to call back byte-compile-file-form and then return nil. ;; Except that we can't just call byte-compile-file-form since it would ;; call us right back. - (t (byte-compile-keep-pending form))))) + (_ (byte-compile-keep-pending form))))) (byte-defop-compiler-1 with-no-warnings byte-compile-no-warnings) (defun byte-compile-no-warnings (form) commit fb77502f695331501fb32e686424c3aec3c7b1a3 Author: Glenn Morris Date: Tue Jun 16 20:33:48 2015 -0400 Address some check-declare warnings. * lisp/simple.el (tabulated-list-print): * lisp/progmodes/elisp-mode.el (xref-collect-matches): * lisp/term/ns-win.el (ns-selection-owner-p, ns-selection-exists-p) (ns-get-selection): Update declarations. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 11c9b16..76f32de 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -582,7 +582,7 @@ It can be quoted, or be inside a quoted form." (declare-function xref-make-bogus-location "xref" (message)) (declare-function xref-make "xref" (description location)) -(declare-function xref-collect-matches "xref" (input dir &optional kind)) +(declare-function xref-collect-matches "xref" (symbol dir)) (declare-function xref-collect-references "xref" (symbol dir)) (defun elisp-xref-find (action id) diff --git a/lisp/simple.el b/lisp/simple.el index 46023a5..48451aa 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3521,7 +3521,7 @@ support pty association, if PROGRAM is nil." (defvar tabulated-list-sort-key) (declare-function tabulated-list-init-header "tabulated-list" ()) (declare-function tabulated-list-print "tabulated-list" - (&optional remember-pos)) + (&optional remember-pos update)) (defvar process-menu-query-only nil) diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index f603f3e..a21c105 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -930,12 +930,9 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (declare-function ns-own-selection-internal "nsselect.m" (selection value)) (declare-function ns-disown-selection-internal "nsselect.m" (selection)) -(declare-function ns-selection-owner-p "nsselect.m" - (&optional selection terminal)) -(declare-function ns-selection-exists-p "nsselect.m" - (&optional selection terminal)) -(declare-function ns-get-selection "nsselect.m" - (selection-symbol target-type &optional time-stamp terminal)) +(declare-function ns-selection-owner-p "nsselect.m" (&optional selection)) +(declare-function ns-selection-exists-p "nsselect.m" (&optional selection)) +(declare-function ns-get-selection "nsselect.m" (selection-symbol target-type)) (cl-defmethod gui-backend-set-selection (selection value &context (window-system (eql ns))) commit d5152a7eef9dbb8b6953f9efdd44bcdbca2311dd Author: Glenn Morris Date: Tue Jun 16 20:28:48 2015 -0400 Address some compilation warnings. * lisp/elec-pair.el (electric-pair-post-self-insert-function): * lisp/vc/vc-git.el (vc-git-file-type-as-string): Replace 't' with '_' in pcase. diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index db812c9..205ad7e 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -499,7 +499,7 @@ happened." (not (funcall electric-pair-inhibit-predicate last-command-event)))) (save-excursion (electric-pair--insert pair))))) - (t + (_ (when (and (if (functionp electric-pair-open-newline-between-pairs) (funcall electric-pair-open-newline-between-pairs) electric-pair-open-newline-between-pairs) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index e3cd5d4..9522328 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -308,12 +308,12 @@ matching the resulting Git log output, and KEYWORDS is a list of (pcase old-type (?\100 " (type change file -> symlink)") (?\160 " (type change subproject -> symlink)") - (t " (symlink)"))) + (_ " (symlink)"))) (?\160 ;; Subproject. (pcase old-type (?\100 " (type change file -> subproject)") (?\120 " (type change symlink -> subproject)") - (t " (subproject)"))) + (_ " (subproject)"))) (?\110 nil) ;; Directory (internal, not a real git state). (?\000 ;; Deleted or unknown. (pcase old-type commit 55b41a82cdbb682a4657ddc47d194e5813cf262b Author: Glenn Morris Date: Tue Jun 16 20:04:35 2015 -0400 Address some compilation warnings. * lisp/face-remap.el (text-scale-adjust): * lisp/menu-bar.el (popup-menu-normalize-position): * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): * lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn): * lisp/emacs-lisp/generator.el (cps--transform-1): * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): * lisp/obsolete/vc-arch.el (vc-arch-mode-line-string): * lisp/progmodes/octave.el (octave-goto-function-definition) (octave-find-definition-default-filename): Replace 't' with '_' in pcase. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 3014793..1a34fa7 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -292,7 +292,7 @@ (format "Inlining closure %S failed" name)) form)))) - (t ;; Give up on inlining. + (_ ;; Give up on inlining. form)))) ;; ((lambda ...) ...) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index efd4389..baa08e7 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1417,7 +1417,7 @@ extra args." (`(lambda ,args . ,_) args) (`(closure ,_ ,args . ,_) args) ((pred byte-code-function-p) (aref old 0)) - (t '(&rest def))))) + (_ '(&rest def))))) (sig2 (byte-compile-arglist-signature arglist))) (unless (byte-compile-arglist-signatures-congruent-p sig1 sig2) (byte-compile-set-symbol-position name) diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el index 08e1b7c..123f64b 100644 --- a/lisp/emacs-lisp/generator.el +++ b/lisp/emacs-lisp/generator.el @@ -507,7 +507,7 @@ don't yield.") next-state))) ;; Process everything else by just evaluating the form normally. - (t (cps--make-atomic-state form next-state)))) + (_ (cps--make-atomic-state form next-state)))) (defun cps--make-catch-wrapper (tag-binding next-state) (lambda (form) diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 05ffa8d..e9af3b0 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -284,7 +284,7 @@ Assumes the caller has bound `macroexpand-all-environment'." (macroexp--expand-all newform))) (macroexp--expand-all newform)))))) - (t form)))) + (_ form)))) ;;;###autoload (defun macroexpand-all (form &optional environment) diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 93eec5b..3a8aba5 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -330,7 +330,7 @@ a top-level keymap, `text-scale-increase' or ((or ?+ ?=) inc) (?- (- inc)) (?0 0) - (t inc)))) + (_ inc)))) (text-scale-increase step) ;; (unless (zerop step) (message "Use +,-,0 for further adjustment") diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index a1b6d95..65ed8d5 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2258,7 +2258,7 @@ If nil, the current mouse position is used." ;; Event. ((pred eventp) (popup-menu-normalize-position (event-end position))) - (t position))) + (_ position))) (defcustom tty-menu-open-use-tmm nil "If non-nil, \\[menu-bar-open] on a TTY will invoke `tmm-menubar'. diff --git a/lisp/obsolete/vc-arch.el b/lisp/obsolete/vc-arch.el index 2469f76..8b2454b 100644 --- a/lisp/obsolete/vc-arch.el +++ b/lisp/obsolete/vc-arch.el @@ -397,7 +397,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see (pcase (vc-state file) ((or `up-to-date `needs-update) ?-) (`added ?@) - (t ?:)) + (_ ?:)) rev))) (defun vc-arch-diff3-rej-p (rej) diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 8541cce..50f888c 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -1064,7 +1064,7 @@ directory and makes this the current buffer's default directory." (pcase (and buffer-file-name (file-name-extension buffer-file-name)) (`"cc" (funcall search "\\_ Date: Tue Jun 16 18:27:02 2015 -0400 * lisp/emacs-lisp/pcase.el (pcase--u1): Paper-over today's bootstrap failure. diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 50a2507..bcc2d58 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -774,9 +774,9 @@ Otherwise, it defers to REST which is a list of branches of the form ((memq upat '(t _)) (let ((code (pcase--u1 matches code vars rest))) (if (eq upat '_) code - (macroexp--warn-and-return - "Pattern t is deprecated. Use `_' instead" - code)))) + (message "%s" + "Pattern t is deprecated. Use `_' instead") + code))) ((eq upat 'pcase--dontcare) :pcase--dontcare) ((memq (car-safe upat) '(guard pred)) (if (eq (car upat) 'pred) (pcase--mark-used sym)) commit 70a567971a930f104b47200fcdb01a858846d41d Author: Nicolas Petton Date: Tue Jun 16 23:49:17 2015 +0200 * lisp/emacs-lisp/seq.el: Fix a byte-compiler warnings related to pcase. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 0aa0f09..2d20de6 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -249,7 +249,7 @@ TYPE must be one of following symbols: vector, string or list. (`vector (apply #'vconcat seqs)) (`string (apply #'concat seqs)) (`list (apply #'append (append seqs '(nil)))) - (t (error "Not a sequence type name: %S" type)))) + (_ (error "Not a sequence type name: %S" type)))) (defun seq-mapcat (function seq &optional type) "Concatenate the result of applying FUNCTION to each element of SEQ. @@ -323,7 +323,7 @@ TYPE can be one of the following symbols: vector, string or list." (`vector (vconcat seq)) (`string (concat seq)) (`list (append seq nil)) - (t (error "Not a sequence type name: %S" type)))) + (_ (error "Not a sequence type name: %S" type)))) (defun seq--drop-list (list n) "Return a list from LIST without its first N elements. @@ -379,7 +379,7 @@ This is an optimization for lists in `seq-take-while'." ,(seq--elt-safe args (1+ index))) bindings) (setq rest-marker t))) - (t + (_ (push `(app (pcase--flip seq--elt-safe ,index) ,name) bindings)))) (setq index (1+ index))) bindings)) @@ -413,7 +413,7 @@ BINDINGS." (seq-drop ,seq ,index)) bindings) (setq rest-marker t))) - (t + (_ (push `(,name (seq--elt-safe ,seq ,index)) bindings)))) (setq index (1+ index))) bindings)) commit 7d5c120fedd86b911bb9ffe423920e701f63a7c3 Author: Nicolas Petton Date: Tue Jun 16 23:04:03 2015 +0200 * lisp/emacs-lisp/map.el (map-into): Fix a byte-compiler warning. diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index dd7fb91..f5a9fd9 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el @@ -218,7 +218,7 @@ MAP can be a list, hash-table or array." map)) (defun map-filter (pred map) - "Return an alist of the key/val pairs for which (PRED key val) is non-nil in MAP. + "Return an alist of key/val pairs for which (PRED key val) is non-nil in MAP. MAP can be a list, hash-table or array." (delq nil (map-apply (lambda (key val) @@ -297,7 +297,7 @@ MAP can be a list, hash-table or array." (pcase type (`list (map-pairs map)) (`hash-table (map--into-hash-table map)) - (t (error "Not a map type name: %S" type)))) + (_ (error "Not a map type name: %S" type)))) (defun map--apply-alist (function map) "Private function used to apply FUNCTION over MAP, MAP being an alist." commit 3986489aef3779b299c099e077d91e0d4b09a2e5 Author: Nicolas Petton Date: Tue Jun 16 22:52:24 2015 +0200 Better confirmation message in `find-alternate-file' (Bug#20830) * lisp/files.el (find-alternate-file'): Improve the confirmation message to show the buffer name. diff --git a/lisp/files.el b/lisp/files.el index 26f9f70..4656ada 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1640,7 +1640,9 @@ killed." (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) (user-error "Aborted")) (and (buffer-modified-p) buffer-file-name - (not (yes-or-no-p "Kill and replace the buffer without saving it? ")) + (not (yes-or-no-p + (format "Kill and replace buffer `%s' without saving it? " + (buffer-name)))) (user-error "Aborted")) (let ((obuf (current-buffer)) (ofile buffer-file-name) commit deb6e89caf2d134dbb05ea0d41178e6dc8bc989b Author: Nicolas Petton Date: Tue Jun 16 21:45:07 2015 +0200 Better docstring for null. (Bug#20815) * src/data.c (null): Improves the docstring, saying what null returns when OBJECT is non-nil. diff --git a/src/data.c b/src/data.c index 9b1c12a..80f2ac9 100644 --- a/src/data.c +++ b/src/data.c @@ -186,7 +186,7 @@ DEFUN ("eq", Feq, Seq, 2, 2, 0, } DEFUN ("null", Fnull, Snull, 1, 1, 0, - doc: /* Return t if OBJECT is nil. */ + doc: /* Return t if OBJECT is nil, and return nil otherwise. */ attributes: const) (Lisp_Object object) { commit ac1e89ebaca61c797fcb77a40ad67cd4cef29eeb Author: Stefan Monnier Date: Tue Jun 16 15:39:35 2015 -0400 * lisp/net/newst-treeview.el: Use lexical-binding. diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el index df7628a..eca2a9c 100644 --- a/lisp/net/newst-treeview.el +++ b/lisp/net/newst-treeview.el @@ -1,10 +1,9 @@ -;;; newst-treeview.el --- Treeview frontend for newsticker. +;;; newst-treeview.el --- Treeview frontend for newsticker. -*- lexical-binding:t -*- ;; Copyright (C) 2008-2015 Free Software Foundation, Inc. ;; Author: Ulf Jasper ;; Filename: newst-treeview.el -;; URL: http://www.nongnu.org/newsticker ;; Created: 2007 ;; Keywords: News, RSS, Atom ;; Package: newsticker @@ -259,8 +258,10 @@ their id stays constant." ;; ====================================================================== -(unless (fboundp 'declare-function) (defmacro declare-function (&rest r))) +(unless (fboundp 'declare-function) (defmacro declare-function (&rest _))) (declare-function w3m-toggle-inline-images "ext:w3m" (&optional force no-cache)) +(defvar w3m-fill-column) +(defvar w3-maximum-line-length) (defun newsticker--treeview-render-text (start end) "Render text between markers START and END." @@ -351,7 +352,7 @@ If string SHOW-FEED is non-nil it is shown in the item string." (remove-overlays)))) (defun newsticker--treeview-list-items-with-age-callback (widget - changed-widget + _changed-widget &rest ages) "Fill newsticker treeview list window with items of certain age. This is a callback function for the treeview nodes. @@ -360,7 +361,7 @@ Argument CHANGED-WIDGET is the widget that actually has changed. Optional argument AGES is the list of ages that are to be shown." (newsticker--treeview-list-clear) (widget-put widget :nt-selected t) - (apply 'newsticker--treeview-list-items-with-age ages)) + (apply #'newsticker--treeview-list-items-with-age ages)) (defun newsticker--treeview-list-items-with-age (&rest ages) "Actually fill newsticker treeview list window with items of certain age. @@ -377,7 +378,7 @@ AGES is the list of ages that are to be shown." (newsticker--treeview-list-update nil)) (defun newsticker--treeview-list-new-items (widget changed-widget - &optional event) + &optional _event) "Fill newsticker treeview list window with new items. This is a callback function for the treeview nodes. Argument WIDGET is the calling treeview widget. @@ -390,7 +391,7 @@ Optional argument EVENT is the mouse event that triggered this action." "This is a virtual feed containing all new items")) (defun newsticker--treeview-list-immortal-items (widget changed-widget - &optional event) + &optional _event) "Fill newsticker treeview list window with immortal items. This is a callback function for the treeview nodes. Argument WIDGET is the calling treeview widget. @@ -403,7 +404,7 @@ Optional argument EVENT is the mouse event that triggered this action." "This is a virtual feed containing all immortal items.")) (defun newsticker--treeview-list-obsolete-items (widget changed-widget - &optional event) + &optional _event) "Fill newsticker treeview list window with obsolete items. This is a callback function for the treeview nodes. Argument WIDGET is the calling treeview widget. @@ -455,8 +456,8 @@ Optional argument EVENT is the mouse event that triggered this action." (cdr (newsticker--cache-get-feed (intern feed-name))))) (newsticker--treeview-list-update nil)))) -(defun newsticker--treeview-list-feed-items (widget changed-widget - &optional event) +(defun newsticker--treeview-list-feed-items (widget _changed-widget + &optional _event) "Callback function for listing feed items. Argument WIDGET is the calling treeview widget. Argument CHANGED-WIDGET is the widget that actually has changed. @@ -583,11 +584,10 @@ The sort function is chosen according to the value of (defun newsticker--treeview-list-update-highlight () "Update the highlight in the treeview list buffer." (newsticker--treeview-list-clear-highlight) - (let (pos num-lines) - (with-current-buffer (newsticker--treeview-list-buffer) - (let ((inhibit-read-only t)) - (put-text-property (point-at-bol) (point-at-eol) :nt-selected t)) - (newsticker--treeview-list-update-faces)))) + (with-current-buffer (newsticker--treeview-list-buffer) + (let ((inhibit-read-only t)) + (put-text-property (point-at-bol) (point-at-eol) :nt-selected t)) + (newsticker--treeview-list-update-faces))) (defun newsticker--treeview-list-highlight-start () "Return position of selection in treeview list buffer." @@ -664,23 +664,22 @@ for the button." (defun newsticker--treeview-list-select (item) "Select ITEM in treeview's list buffer." (newsticker--treeview-list-clear-highlight) - (let (pos num-lines) - (save-current-buffer - (set-buffer (newsticker--treeview-list-buffer)) - (goto-char (point-min)) - (catch 'found - (while t - (let ((it (get-text-property (point) :nt-item))) - (when (eq it item) - (newsticker--treeview-list-update-highlight) - (newsticker--treeview-list-update-faces) - (newsticker--treeview-item-show - item (get-text-property (point) :nt-feed)) - (throw 'found t))) - (forward-line 1) - (when (eobp) - (goto-char (point-min)) - (throw 'found nil))))))) + (save-current-buffer + (set-buffer (newsticker--treeview-list-buffer)) + (goto-char (point-min)) + (catch 'found + (while t + (let ((it (get-text-property (point) :nt-item))) + (when (eq it item) + (newsticker--treeview-list-update-highlight) + (newsticker--treeview-list-update-faces) + (newsticker--treeview-item-show + item (get-text-property (point) :nt-feed)) + (throw 'found t))) + (forward-line 1) + (when (eobp) + (goto-char (point-min)) + (throw 'found nil)))))) ;; ====================================================================== ;;; item window @@ -863,8 +862,8 @@ Callback function for tree widget that adds nodes for feeds and subgroups." (widget-put icon :leaf-icon 'tree-widget-leaf-icon) (tree-widget-icon-create icon)))) -(defun newsticker--treeview-tree-expand-status (tree &optional changed-widget - event) +(defun newsticker--treeview-tree-expand-status (tree &optional _changed-widget + _event) "Expand the vfeed TREE. Optional arguments CHANGED-WIDGET and EVENT are ignored." (tree-widget-set-theme "folder") @@ -916,7 +915,7 @@ Optional arguments CHANGED-WIDGET and EVENT are ignored." :tag (newsticker--treeview-propertize-tag "Feeds" 0 "feeds") :expander 'newsticker--treeview-tree-expand - :expander-p (lambda (&rest ignore) t) + :expander-p (lambda (&rest _) t) :leaf-icon 'newsticker--tree-widget-leaf-icon :nt-group (cdr newsticker-groups) :nt-id "feeds" @@ -927,7 +926,7 @@ Optional arguments CHANGED-WIDGET and EVENT are ignored." :tag (newsticker--treeview-propertize-tag "Virtual Feeds" 0 "vfeeds") :expander 'newsticker--treeview-tree-expand-status - :expander-p (lambda (&rest ignore) t) + :expander-p (lambda (&rest _) t) :leaf-icon 'newsticker--tree-widget-leaf-icon :nt-id "vfeeds" :keep '(:nt-id) @@ -990,10 +989,10 @@ Optional argument NT-ID is added to the tag's properties." (defun newsticker--stat-num-items-for-group (feed-name-symbol &rest ages) "Count number of items in feed FEED-NAME-SYMBOL that have an age matching AGES." ;;(message "newsticker--stat-num-items-for-group %s %s" feed-name-symbol ages) - (let ((result (apply 'newsticker--stat-num-items feed-name-symbol ages))) + (let ((result (apply #'newsticker--stat-num-items feed-name-symbol ages))) (mapc (lambda (f-n) (setq result (+ result - (apply 'newsticker--stat-num-items (intern f-n) + (apply #'newsticker--stat-num-items (intern f-n) ages)))) (newsticker--group-get-feeds (newsticker--group-get-group (symbol-name feed-name-symbol)) t)) @@ -1019,7 +1018,7 @@ the feed is a virtual feed." num-new)) (defun newsticker--treeview-tree-update-tag (w &optional recursive - &rest ignore) + &rest _ignore) "Update tag for tree widget W. If RECURSIVE is non-nil recursively update parent widgets as well. Argument IGNORE is ignored. Note that this function, if @@ -1042,8 +1041,7 @@ that case." (widget-put w :num-new num-new) (widget-put w :tag tag) (when (marker-position (widget-get w :from)) - (let ((p (point)) - (notify (widget-get w :notify))) + (let ((p (point))) ;; FIXME: This moves point!!!! (with-current-buffer (newsticker--treeview-tree-buffer) (widget-value-set w (widget-value w))) @@ -1057,9 +1055,9 @@ that case." (newsticker--treeview-tree-do-update-tags w)) (newsticker--treeview-tree-update-tag widget)))) -(defun newsticker--treeview-tree-update-tags (&rest ignore) +(defun newsticker--treeview-tree-update-tags (&rest _ignore) "Update all tags of all trees. -Arguments IGNORE are ignored." +Arguments are ignored." (save-current-buffer (set-buffer (newsticker--treeview-tree-buffer)) (let ((inhibit-read-only t)) @@ -1655,8 +1653,8 @@ Return t if a new feed was activated, nil otherwise." (completing-read "Jump to feed: " (append '("new" "obsolete" "immortal" "all") - (mapcar 'car (append newsticker-url-list - newsticker-url-list-defaults))) + (mapcar #'car (append newsticker-url-list + newsticker-url-list-defaults))) nil t)))) (newsticker--treeview-unfold-node feed-name)) @@ -1788,7 +1786,8 @@ return a nested list." (string= old-name (car elt))) (cons new-name (cdr elt))) (t - elt))) parent-group))) + elt))) + parent-group))) (defun newsticker-group-rename-group (old-name new-name) "Rename group OLD-NAME to NEW-NAME." @@ -1808,7 +1807,7 @@ return a nested list." (defun newsticker--get-group-names (lst) "Do get the group names from LST." (delete nil (cons (car lst) - (apply 'append + (apply #'append (mapcar (lambda (e) (cond ((listp e) (newsticker--get-group-names e)) @@ -1826,7 +1825,7 @@ Update treeview afterwards unless NO-UPDATE is non-nil." (interactive (let ((completion-ignore-case t)) (list (completing-read "Name of feed or group to move: " - (append (mapcar 'car newsticker-url-list) + (append (mapcar #'car newsticker-url-list) (newsticker--group-names)) nil t newsticker--treeview-current-feed) (completing-read "Name of new parent group: " (newsticker--group-names) commit a1f543b4aa2309aecfd4ee2c6c220c71a97bbea8 Author: Stefan Monnier Date: Tue Jun 16 14:28:38 2015 -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. diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 2b4638b..2a53e40 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -311,6 +311,25 @@ per-character basis, this may not be accurate." charset-list) nil))))))))) +(defun filepos-to-bufferpos--dos (byte f) + (let ((eol-offset 0) + ;; Make sure we terminate, even if BYTE falls right in the middle + ;; of a CRLF or some other weird corner case. + (omin 0) (omax most-positive-fixnum) + pos lines) + (while + (progn + (setq pos (funcall f (- byte eol-offset))) + ;; Adjust POS for DOS EOL format. + (setq lines (1- (line-number-at-pos pos))) + (and (not (= lines eol-offset)) (> omax omin))) + (if (> lines eol-offset) + (setq omax (min (1- omax) lines) + eol-offset omax) + (setq omin (max (1+ omin) lines) + eol-offset omin))) + pos)) + ;;;###autoload (defun filepos-to-bufferpos (byte &optional quality coding-system) "Try to return the buffer position corresponding to a particular file position. @@ -320,9 +339,9 @@ to `buffer-file-coding-system'. QUALITY can be: `approximate', in which case we may cut some corners to avoid excessive work. + `exact', in which case we may end up re-(en/de)coding a large + part of the file/buffer. nil, in which case we may return nil rather than an approximation." - ;; `exact', in which case we may end up re-(en|de)coding a large - ;; part of the file. (unless coding-system (setq coding-system buffer-file-coding-system)) (let ((eol (coding-system-eol-type coding-system)) (type (coding-system-type coding-system)) @@ -331,23 +350,36 @@ QUALITY can be: (`utf-8 (when (coding-system-get coding-system :bom) (setq byte (max 0 (- byte 3)))) - (let (pos lines (eol-offset 0)) - (while - (progn - (setq pos (byte-to-position (+ pm byte (- eol-offset)))) - ;; Adjust POS for DOS EOL format. - (when (= eol 1) - (setq lines (1- (line-number-at-pos pos))) - (not (= lines eol-offset)))) - (setq eol-offset lines)) - pos)) + (if (= eol 1) + (filepos-to-bufferpos--dos (+ pm byte) #'byte-to-position) + (byte-to-position (+ pm byte)))) ;; FIXME: What if it's a 2-byte charset? Are there such beasts? - (`charset (+ pm byte)) + (`charset + (if (= eol 1) + (filepos-to-bufferpos--dos (+ pm byte) #'identity) + (+ pm byte))) (_ (pcase quality - (`approximate (+ pm (byte-to-position byte))) - ;; (`exact ...) - ))))) + (`approximate (byte-to-position (+ pm byte))) + (`exact + ;; Rather than assume that the file exists and still holds the right + ;; data, we reconstruct it based on the buffer's content. + (let ((buf (current-buffer))) + (with-temp-buffer + (set-buffer-multibyte nil) + (let ((tmp-buf (current-buffer))) + (with-current-buffer buf + (save-restriction + (widen) + ;; Since encoding should always return more bytes than + ;; there were chars, encoding all chars up to (+ byte pm) + ;; guarantees the encoded result has at least `byte' bytes. + (encode-coding-region pm (min (point-max) (+ pm byte)) + coding-system tmp-buf))) + (+ pm (length + (decode-coding-region (point-min) + (min (point-max) (+ pm byte)) + coding-system t)))))))))))) (provide 'mule-util) commit 08f8fb327bf375d9e52752621f6108c8cdf94471 Author: Cédric Chépied Date: Tue Jun 16 19:38:38 2015 +0200 Identify feeds in newsticker treeview with :nt-feed property * lisp/net/newst-treeview.el: (newsticker--treeview-nodes-eq): Use property :nt-feed instead of :tag. diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el index a964750..df7628a 100644 --- a/lisp/net/newst-treeview.el +++ b/lisp/net/newst-treeview.el @@ -219,7 +219,7 @@ their id stays constant." ;;(message "%s/%s %s/%s" (widget-get node1 :tag) (widget-get node2 :tag) ;; (or id1 -1) (or id2 -1)) (or (newsticker--treeview-ids-eq id1 id2) - (string= (widget-get node1 :tag) (widget-get node2 :tag))))) + (string= (widget-get node1 :nt-feed) (widget-get node2 :nt-feed))))) (defun newsticker--treeview-do-get-node-of-feed (feed-name startnode) "Recursively search node for feed FEED-NAME starting from STARTNODE." commit 3ef311678b1467d6e6852cbc509fb92917f6f449 Author: Stefan Monnier Date: Tue Jun 16 12:37:33 2015 -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. (bug#20784) diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 0d3b21b..50a2507 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -112,11 +112,12 @@ CASES is a list of elements of the form (PATTERN CODE...). Patterns can take the following forms: _ matches anything. - SELFQUOTING matches itself. This includes keywords, numbers, and strings. SYMBOL matches anything and binds it to SYMBOL. (or PAT...) matches if any of the patterns matches. (and PAT...) matches if all the patterns match. 'VAL matches if the object is `equal' to VAL + ATOM is a shorthand for 'ATOM. + ATOM can be a keyword, an integer, or a string. (pred FUN) matches if FUN applied to the object returns non-nil. (guard BOOLEXP) matches if BOOLEXP evaluates to non-nil. (let PAT EXP) matches if EXP matches PAT. @@ -638,7 +639,7 @@ MATCH is the pattern that needs to be matched, of the form: res)) (defun pcase--self-quoting-p (upat) - (or (keywordp upat) (numberp upat) (stringp upat))) + (or (keywordp upat) (integerp upat) (stringp upat))) (defun pcase--app-subst-match (match sym fun nsym) (cond @@ -770,7 +771,12 @@ Otherwise, it defers to REST which is a list of branches of the form (sym (car cdrpopmatches)) (upat (cdr cdrpopmatches))) (cond - ((memq upat '(t _)) (pcase--u1 matches code vars rest)) + ((memq upat '(t _)) + (let ((code (pcase--u1 matches code vars rest))) + (if (eq upat '_) code + (macroexp--warn-and-return + "Pattern t is deprecated. Use `_' instead" + code)))) ((eq upat 'pcase--dontcare) :pcase--dontcare) ((memq (car-safe upat) '(guard pred)) (if (eq (car upat) 'pred) (pcase--mark-used sym)) @@ -784,7 +790,7 @@ Otherwise, it defers to REST which is a list of branches of the form (pcase--eval (cadr upat) vars)) (pcase--u1 matches code vars then-rest) (pcase--u else-rest)))) - ((symbolp upat) + ((and (symbolp upat) upat) (pcase--mark-used sym) (if (not (assq upat vars)) (pcase--u1 matches code (cons (cons upat sym) vars) rest) @@ -854,7 +860,7 @@ Otherwise, it defers to REST which is a list of branches of the form (pcase--u rest)) vars (list `((and . ,matches) ,code . ,vars)))) - (t (error "Unknown internal pattern `%S'" upat))))) + (t (error "Unknown pattern `%S'" upat))))) (t (error "Incorrect MATCH %S" (car matches))))) (def-edebug-spec @@ -870,9 +876,9 @@ QPAT can take the following forms: (QPAT1 . QPAT2) matches if QPAT1 matches the car and QPAT2 the cdr. [QPAT1 QPAT2..QPATn] matches a vector of length n and QPAT1..QPATn match its 0..(n-1)th elements, respectively. - ,PAT matches if the pattern PAT matches. - STRING matches if the object is `equal' to STRING. - ATOM matches if the object is `eq' to ATOM." + ,PAT matches if the pcase pattern PAT matches. + ATOM matches if the object is `equal' to ATOM. + ATOM can be a symbol, an integer, or a string." (declare (debug (pcase-QPAT))) (cond ((eq (car-safe qpat) '\,) (cadr qpat)) @@ -888,7 +894,8 @@ QPAT can take the following forms: `(and (pred consp) (app car ,(list '\` (car qpat))) (app cdr ,(list '\` (cdr qpat))))) - ((or (stringp qpat) (integerp qpat) (symbolp qpat)) `',qpat))) + ((or (stringp qpat) (integerp qpat) (symbolp qpat)) `',qpat) + (t (error "Unknown QPAT: %S" qpat)))) (provide 'pcase) commit 34a43ba26a049bb966426022ffb2c41ab07841b8 Author: Eli Zaretskii Date: Tue Jun 16 17:37:45 2015 +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) diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 92c540c..2b4638b 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -335,9 +335,11 @@ QUALITY can be: (while (progn (setq pos (byte-to-position (+ pm byte (- eol-offset)))) - (setq lines (1- (line-number-at-pos pos))) - (not (= lines eol-offset))) - (setq eol-offset (+ eol-offset lines))) + ;; Adjust POS for DOS EOL format. + (when (= eol 1) + (setq lines (1- (line-number-at-pos pos))) + (not (= lines eol-offset)))) + (setq eol-offset lines)) pos)) ;; FIXME: What if it's a 2-byte charset? Are there such beasts? (`charset (+ pm byte)) commit 93ae9f46e7947aeb2180e3b8a98b551fa143ba51 Author: Martin Rudalics Date: Tue Jun 16 15:09:24 2015 +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. diff --git a/src/nsfns.m b/src/nsfns.m index 6a2e2ff..286445c 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -70,9 +70,7 @@ Lisp_Object Fx_open_connection (Lisp_Object, Lisp_Object, Lisp_Object); static Lisp_Object as_script, *as_result; static int as_status; -#ifdef GLYPH_DEBUG static ptrdiff_t image_cache_refcount; -#endif /* ========================================================================== @@ -1005,6 +1003,17 @@ unwind_create_frame (Lisp_Object frame) struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); #endif + /* If the frame's image cache refcount is still the same as our + private shadow variable, it means we are unwinding a frame + for which we didn't yet call init_frame_faces, where the + refcount is incremented. Therefore, we increment it here, so + that free_frame_faces, called in x_free_frame_resources + below, will not mistakenly decrement the counter that was not + incremented yet to account for this new frame. */ + if (FRAME_IMAGE_CACHE (f) != NULL + && FRAME_IMAGE_CACHE (f)->refcount == image_cache_refcount) + FRAME_IMAGE_CACHE (f)->refcount++; + x_free_frame_resources (f); free_glyphs (f); @@ -1241,10 +1250,8 @@ This function is an internal primitive--use `make-frame' instead. */) x_default_parameter (f, parms, Qright_fringe, Qnil, "rightFringe", "RightFringe", RES_TYPE_NUMBER); -#ifdef GLYPH_DEBUG image_cache_refcount = FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; -#endif init_frame_faces (f); diff --git a/src/w32fns.c b/src/w32fns.c index c247a9b..5f40729 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -204,7 +204,8 @@ unsigned int msh_mousewheel = 0; static unsigned menu_free_timer = 0; #ifdef GLYPH_DEBUG -static int image_cache_refcount, dpyinfo_refcount; +static ptrdiff_t image_cache_refcount; +static int dpyinfo_refcount; #endif static HWND w32_visible_system_caret_hwnd; diff --git a/src/xfns.c b/src/xfns.c index 634881d..d066043 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -120,8 +120,8 @@ extern LWLIB_ID widget_id_tick; #define MAXREQUEST(dpy) (XMaxRequestSize (dpy)) -#ifdef GLYPH_DEBUG static ptrdiff_t image_cache_refcount; +#ifdef GLYPH_DEBUG static int dpyinfo_refcount; #endif @@ -2828,6 +2828,17 @@ unwind_create_frame (Lisp_Object frame) struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); #endif + /* If the frame's image cache refcount is still the same as our + private shadow variable, it means we are unwinding a frame + for which we didn't yet call init_frame_faces, where the + refcount is incremented. Therefore, we increment it here, so + that free_frame_faces, called in x_free_frame_resources + below, will not mistakenly decrement the counter that was not + incremented yet to account for this new frame. */ + if (FRAME_IMAGE_CACHE (f) != NULL + && FRAME_IMAGE_CACHE (f)->refcount == image_cache_refcount) + FRAME_IMAGE_CACHE (f)->refcount++; + x_free_frame_resources (f); free_glyphs (f); @@ -3205,9 +3216,9 @@ This function is an internal primitive--use `make-frame' instead. */) "scrollBarBackground", "ScrollBarBackground", false); -#ifdef GLYPH_DEBUG image_cache_refcount = FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; +#ifdef GLYPH_DEBUG dpyinfo_refcount = dpyinfo->reference_count; #endif /* GLYPH_DEBUG */ @@ -5178,9 +5189,9 @@ x_create_tip_frame (struct x_display_info *dpyinfo, x_default_parameter (f, parms, Qborder_color, build_string ("black"), "borderColor", "BorderColor", RES_TYPE_STRING); -#ifdef GLYPH_DEBUG image_cache_refcount = FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; +#ifdef GLYPH_DEBUG dpyinfo_refcount = dpyinfo->reference_count; #endif /* GLYPH_DEBUG */