commit 25b4572073179c8d6dc980ce2df3db4d96cd692f (HEAD, refs/remotes/origin/master) Author: Xue Fuqiao Date: Tue Oct 6 10:52:28 2015 +0800 * doc/lispref/objects.texi (Window Type): Add a cross reference. diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi index c650572..3cd4a38 100644 --- a/doc/lispref/objects.texi +++ b/doc/lispref/objects.texi @@ -1502,8 +1502,8 @@ in one window, no window, or several windows. Though many windows may exist simultaneously, at any time one window is designated the @dfn{selected window}. This is the window where the cursor is (usually) displayed when Emacs is ready for a command. The -selected window usually displays the current buffer, but this is not -necessarily the case. +selected window usually displays the current buffer (@pxref{Current +Buffer}), but this is not necessarily the case. Windows are grouped on the screen into frames; each window belongs to one and only one frame. @xref{Frame Type}. commit d62f03393ba7cc971017b65b9c9fc899c4fe90f4 Author: Xue Fuqiao Date: Tue Oct 6 06:48:39 2015 +0800 * src/buffer.c (syms_of_buffer): Typo fix. (Bug#21622) diff --git a/src/buffer.c b/src/buffer.c index 530fe11..38ee74d 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -6238,7 +6238,7 @@ If nil, only shows a cursor in the selected window. If t, displays a cursor related to the usual cursor type (a solid box becomes hollow, a bar becomes a narrower bar). You can also specify the cursor type as in the `cursor-type' variable. -Use Custom to set this variable and update the display." */); +Use Custom to set this variable and update the display. */); DEFVAR_LISP ("kill-buffer-query-functions", Vkill_buffer_query_functions, doc: /* List of functions called with no args to query before killing a buffer. commit 7e83f5022613f72679e071b95e9aa3033ddb0609 Author: Eli Zaretskii Date: Mon Oct 5 22:24:25 2015 +0300 ; Another minor fix in misc-lang.el diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index 9815421..c03fd42 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -78,8 +78,9 @@ and Italian."))) (set-char-table-range composition-function-table '(#x600 . #x74F) - (list ["[\u0600-\u074F\u200C\u200D]+" 0 'font-shape-gstring] - ["[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" 1 'font-shape-gstring])) + (list (vector "[\u0600-\u074F\u200C\u200D]+" 0 'font-shape-gstring) + (vector "[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" + 1 'font-shape-gstring))) (provide 'misc-lang) commit 0a74e2b590ca6b287f3c3d03e73e09a50b498fae Author: Eli Zaretskii Date: Mon Oct 5 22:19:39 2015 +0300 Fix composition-function-table for Arabic and Syriac * lisp/language/misc-lang.el (composition-function-table): Fix entries for Arabic and Syriac. diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index b56d31f..9815421 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -77,9 +77,9 @@ and Italian."))) (set-char-table-range composition-function-table - '(#x600 . #x6FF) - (list ["\u200D?[\u0600-\u074F]+[\u200D\u200C]*[\u0600-\u074F]+\u200D?" - 0 font-shape-gstring])) + '(#x600 . #x74F) + (list ["[\u0600-\u074F\u200C\u200D]+" 0 'font-shape-gstring] + ["[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" 1 'font-shape-gstring])) (provide 'misc-lang) commit 47e9556c70a7009d7c750fd7bf10a0e6cf41cdce Merge: 52beda9 ef171d1 Author: K. Handa Date: Mon Oct 5 22:56:26 2015 +0900 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit ef171d1d0b42758b5f705847d558436e867372f4 Author: Damien Cassou Date: Fri Oct 2 23:31:23 2015 +0200 Add first unit tests for auth-source.el * test/automated/auth-source-tests.el: New file. diff --git a/test/automated/auth-source-tests.el b/test/automated/auth-source-tests.el new file mode 100644 index 0000000..0b49b90 --- /dev/null +++ b/test/automated/auth-source-tests.el @@ -0,0 +1,178 @@ +;;; auth-source-tests.el --- Tests for auth-source.el -*- lexical-binding: t; -*- + +;; Copyright (C) 2015 Free Software Foundation, Inc. + +;; Author: Damien Cassou , +;; Nicolas Petton + +;; 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: + +;; + +;;; Code: + +(require 'ert) +(require 'auth-source) + +(defvar secrets-enabled t + "Enable the secrets backend to test its features.") + +(defun auth-source-validate-backend (source validation-alist) + (let ((backend (auth-source-backend-parse source))) + (should (auth-source-backend-p backend)) + (dolist (pair validation-alist) + (should (equal (eieio-oref backend (car pair)) (cdr pair)))))) + +(ert-deftest auth-source-backend-parse-macos-keychain () + (auth-source-validate-backend '(:source (:macos-keychain-generic foobar)) + '((:source . "foobar") + (:type . macos-keychain-generic) + (:search-function . auth-source-macos-keychain-search) + (:create-function . auth-source-macos-keychain-create)))) + +(ert-deftest auth-source-backend-parse-macos-keychain-generic-string () + (auth-source-validate-backend "macos-keychain-generic:foobar" + '((:source . "foobar") + (:type . macos-keychain-generic) + (:search-function . auth-source-macos-keychain-search) + (:create-function . auth-source-macos-keychain-create)))) + +(ert-deftest auth-source-backend-parse-macos-keychain-internet-string () + (auth-source-validate-backend "macos-keychain-internet:foobar" + '((:source . "foobar") + (:type . macos-keychain-internet) + (:search-function . auth-source-macos-keychain-search) + (:create-function . auth-source-macos-keychain-create)))) + +(ert-deftest auth-source-backend-parse-macos-keychain-internet-symbol () + (auth-source-validate-backend 'macos-keychain-internet + '((:source . "default") + (:type . macos-keychain-internet) + (:search-function . auth-source-macos-keychain-search) + (:create-function . auth-source-macos-keychain-create)))) + +(ert-deftest auth-source-backend-parse-macos-keychain-generic-symbol () + (auth-source-validate-backend 'macos-keychain-generic + '((:source . "default") + (:type . macos-keychain-generic) + (:search-function . auth-source-macos-keychain-search) + (:create-function . auth-source-macos-keychain-create)))) + +(ert-deftest auth-source-backend-parse-macos-keychain-internet-default-string () + (auth-source-validate-backend 'macos-keychain-internet + '((:source . "default") + (:type . macos-keychain-internet) + (:search-function . auth-source-macos-keychain-search) + (:create-function . auth-source-macos-keychain-create)))) + +(ert-deftest auth-source-backend-parse-plstore () + (auth-source-validate-backend '(:source "foo.plist") + '((:source . "foo.plist") + (:type . plstore) + (:search-function . auth-source-plstore-search) + (:create-function . auth-source-plstore-create)))) + +(ert-deftest auth-source-backend-parse-netrc () + (auth-source-validate-backend '(:source "foo") + '((:source . "foo") + (:type . netrc) + (:search-function . auth-source-netrc-search) + (:create-function . auth-source-netrc-create)))) + +(ert-deftest auth-source-backend-parse-netrc-string () + (auth-source-validate-backend "foo" + '((:source . "foo") + (:type . netrc) + (:search-function . auth-source-netrc-search) + (:create-function . auth-source-netrc-create)))) + +(ert-deftest auth-source-backend-parse-secrets () + (provide 'secrets) ; simulates the presence of the `secrets' package + (let ((secrets-enabled t)) + (auth-source-validate-backend '(:source (:secrets "foo")) + '((:source . "foo") + (:type . secrets) + (:search-function . auth-source-secrets-search) + (:create-function . auth-source-secrets-create))))) + +(ert-deftest auth-source-backend-parse-secrets-strings () + (provide 'secrets) ; simulates the presence of the `secrets' package + (let ((secrets-enabled t)) + (auth-source-validate-backend "secrets:foo" + '((:source . "foo") + (:type . secrets) + (:search-function . auth-source-secrets-search) + (:create-function . auth-source-secrets-create))))) + +(ert-deftest auth-source-backend-parse-secrets-nil-source () + (provide 'secrets) ; simulates the presence of the `secrets' package + (let ((secrets-enabled t)) + (auth-source-validate-backend '(:source (:secrets nil)) + '((:source . "session") + (:type . secrets) + (:search-function . auth-source-secrets-search) + (:create-function . auth-source-secrets-create))))) + +(ert-deftest auth-source-backend-parse-secrets-alias () + (provide 'secrets) ; simulates the presence of the `secrets' package + (let ((secrets-enabled t)) + ;; Redefine `secrets-get-alias' to map 'foo to "foo" + (cl-letf (((symbol-function 'secrets-get-alias) (lambda (_) "foo"))) + (auth-source-validate-backend '(:source (:secrets foo)) + '((:source . "foo") + (:type . secrets) + (:search-function . auth-source-secrets-search) + (:create-function . auth-source-secrets-create)))))) + +(ert-deftest auth-source-backend-parse-secrets-symbol () + (provide 'secrets) ; simulates the presence of the `secrets' package + (let ((secrets-enabled t)) + ;; Redefine `secrets-get-alias' to map 'default to "foo" + (cl-letf (((symbol-function 'secrets-get-alias) (lambda (_) "foo"))) + (auth-source-validate-backend 'default + '((:source . "foo") + (:type . secrets) + (:search-function . auth-source-secrets-search) + (:create-function . auth-source-secrets-create)))))) + +(ert-deftest auth-source-backend-parse-secrets-no-alias () + (provide 'secrets) ; simulates the presence of the `secrets' package + (let ((secrets-enabled t)) + ;; Redefine `secrets-get-alias' to map 'foo to nil (so that + ;; "Login" is used by default + (cl-letf (((symbol-function 'secrets-get-alias) (lambda (_) nil))) + (auth-source-validate-backend '(:source (:secrets foo)) + '((:source . "Login") + (:type . secrets) + (:search-function . auth-source-secrets-search) + (:create-function . auth-source-secrets-create)))))) + +;; TODO This test shows suspicious behavior of auth-source: the +;; "secrets" source is used even though nothing in the input indicates +;; that is what we want +(ert-deftest auth-source-backend-parse-secrets-no-source () + (provide 'secrets) ; simulates the presence of the `secrets' package + (let ((secrets-enabled t)) + (auth-source-validate-backend '(:source '(foo)) + '((:source . "session") + (:type . secrets) + (:search-function . auth-source-secrets-search) + (:create-function . auth-source-secrets-create))))) + +(provide 'auth-source-tests) +;;; auth-source-tests.el ends here commit 52beda922d2cb523a03661bf74b8678c8b45e440 Merge: 94ed516 1ac5a9c Author: K. Handa Date: Sun Sep 27 17:06:12 2015 +0900 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit 94ed5167557112fb00eeca05e62589db744206de Merge: 33f2e00 10e7f7d Author: K. Handa Date: Tue Sep 8 20:43:11 2015 +0900 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit 33f2e0023a5ef03db3e99ade0b93a7a1a913dbe1 Author: K. Handa Date: Wed Sep 2 22:29:37 2015 +0900 fix for the case that M17N_FLT_USE_NEW_FEATURE is not defined * ftfont.c (ftfont_drive_otf) [not M17N_FLT_USE_NEW_FEATURE]: Adjusted for the change of type of elements in the array MFLTGlyphString.glyphs. diff --git a/src/ftfont.c b/src/ftfont.c index 98058ac..15a8159 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -2234,6 +2234,8 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment) { struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font; + MFLTGlyphFT *in_glyphs = (MFLTGlyphFT *) (in->glyphs) + from; + MFLTGlyphFT *out_glyphs = out ? (MFLTGlyphFT *) (out->glyphs) : NULL; FT_Face ft_face = flt_font_ft->ft_face; OTF *otf = flt_font_ft->otf; int len = to - from; @@ -2284,8 +2286,8 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, setup_otf_gstring (len); for (i = 0; i < len; i++) { - otf_gstring.glyphs[i].c = in->glyphs[from + i].c; - otf_gstring.glyphs[i].glyph_id = in->glyphs[from + i].code; + otf_gstring.glyphs[i].c = in_glyphs[i].g.c; + otf_gstring.glyphs[i].glyph_id = in_glyphs[i].g.code; } OTF_drive_gdef (otf, &otf_gstring); @@ -2307,17 +2309,17 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, int min_from, max_to; int j; - g = out->glyphs + out->used; - *g = in->glyphs[from + otfg->f.index.from]; - if (g->code != otfg->glyph_id) + g = out_glyphs + out->used; + *g = in_glyphs[otfg->f.index.from]; + if (g->g.code != otfg->glyph_id) { - g->c = 0; - g->code = otfg->glyph_id; - g->measured = 0; + g->g.c = 0; + g->g.code = otfg->glyph_id; + g->g.measured = 0; } out->used++; - min_from = g->from; - max_to = g->to; + min_from = g->g.from; + max_to = g->g.to; if (otfg->f.index.from < otfg->f.index.to) { /* OTFG substitutes multiple glyphs in IN. */ @@ -2329,20 +2331,20 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, if (max_to < in->glyphs[j].to) max_to = in->glyphs[j].to; } - g->from = min_from; - g->to = max_to; + g->g.from = min_from; + g->g.to = max_to; } for (i++, otfg++; (i < otf_gstring.used && otfg->f.index.from == otfg[-1].f.index.from); i++, otfg++) { - g = out->glyphs + out->used; - *g = in->glyphs[from + otfg->f.index.to]; - if (g->code != otfg->glyph_id) + g = out_glyphs + out->used; + *g = in_glyphs[otfg->f.index.to]; + if (g->g.code != otfg->glyph_id) { - g->c = 0; - g->code = otfg->glyph_id; - g->measured = 0; + g->g.c = 0; + g->g.code = otfg->glyph_id; + g->g.measured = 0; } out->used++; } @@ -2356,7 +2358,7 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, return -2; } for (i = 0; i < len; i++) - out->glyphs[out->used++] = in->glyphs[from + i]; + out_glyphs[out->used++] = in_glyphs[i]; } if (gpos_features) @@ -2376,7 +2378,7 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, x_scale = ft_face->size->metrics.x_scale; y_scale = ft_face->size->metrics.y_scale; - for (i = 0, otfg = otf_gstring.glyphs, g = out->glyphs + gidx; + for (i = 0, otfg = otf_gstring.glyphs, g = out_glyphs + gidx; i < otf_gstring.used; i++, otfg++, g++) { MFLTGlyphFT *prev; @@ -2444,10 +2446,10 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, mark_y = otfg->f.f4.mark_anchor->YCoordinate * y_scale / 0x10000; if (otfg->f.f4.base_anchor->AnchorFormat != 1) - adjust_anchor (ft_face, otfg->f.f4.base_anchor, - prev->code, x_ppem, y_ppem, &base_x, &base_y); + adjust_anchor (ft_face, otfg->f.f4.base_anchor, prev->g.code, + x_ppem, y_ppem, &base_x, &base_y); if (otfg->f.f4.mark_anchor->AnchorFormat != 1) - adjust_anchor (ft_face, otfg->f.f4.mark_anchor, g->code, + adjust_anchor (ft_face, otfg->f.f4.mark_anchor, g->g.code, x_ppem, y_ppem, &mark_x, &mark_y); adjustment[i].xoff = (base_x - mark_x); adjustment[i].yoff = - (base_y - mark_y); @@ -2455,19 +2457,19 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, adjustment[i].xadv = 0; adjustment[i].advance_is_absolute = 1; adjustment[i].set = 1; - this_from = g->from; - this_to = g->to; + this_from = g->g.from; + this_to = g->g.to; for (j = 0; prev + j < g; j++) { - if (this_from > prev[j].from) - this_from = prev[j].from; - if (this_to < prev[j].to) - this_to = prev[j].to; + if (this_from > prev[j].g.from) + this_from = prev[j].g.from; + if (this_to < prev[j].g.to) + this_to = prev[j].g.to; } for (; prev <= g; prev++) { - prev->from = this_from; - prev->to = this_to; + prev->g.from = this_from; + prev->g.to = this_to; } } } @@ -2487,8 +2489,8 @@ ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in, if (out->allocated < out->used + len) return -2; font->get_metrics (font, in, from, to); - memcpy (out->glyphs + out->used, in->glyphs + from, - sizeof (MFLTGlyph) * len); + memcpy (out_glyphs + out->used, in_glyphs, + sizeof (MFLTGlyphFT) * len); out->used += len; return to; }