commit c40ea1328bb33abaec14f1fc92ac2349b5ee2715 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Tue Jul 14 22:29:16 2015 -0700 Merge from gnulib This incorporates: 2015-07-05 acl-permissions: Document FreeBSD ACL_TYPE_NFS4 acls 2015-07-05 acl-permissions: Fix on FreeBSD 2015-07-05 file-has-acl, acl-permissions: fix some more HP-UX typos * lib/acl-internal.c, lib/acl-internal.h, lib/get-permissions.c: * lib/set-permissions.c: Copy from gnulib. diff --git a/lib/acl-internal.c b/lib/acl-internal.c index 1a2f8c4..1eaa671 100644 --- a/lib/acl-internal.c +++ b/lib/acl-internal.c @@ -115,6 +115,13 @@ acl_access_nontrivial (acl_t acl) # endif } +int +acl_default_nontrivial (acl_t acl) +{ + /* acl is non-trivial if it is non-empty. */ + return (acl_entries (acl) > 0); +} + # endif #elif USE_ACL && HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */ diff --git a/lib/acl-internal.h b/lib/acl-internal.h index 4f042ad..38a4ab2 100644 --- a/lib/acl-internal.h +++ b/lib/acl-internal.h @@ -155,6 +155,12 @@ extern int acl_extended_nontrivial (acl_t); Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. Return -1 and set errno upon failure to determine it. */ extern int acl_access_nontrivial (acl_t); + +/* ACL is an ACL, from a file, stored as type ACL_TYPE_DEFAULT. + Return 1 if the given ACL is non-trivial. + Return 0 if it is trivial, i.e. equivalent to a simple stat() mode. + Return -1 and set errno upon failure to determine it. */ +extern int acl_default_nontrivial (acl_t); # endif # elif HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */ diff --git a/lib/get-permissions.c b/lib/get-permissions.c index 6c6618d..459513c 100644 --- a/lib/get-permissions.c +++ b/lib/get-permissions.c @@ -60,6 +60,12 @@ get_permissions (const char *name, int desc, mode_t mode, return -1; } +# if HAVE_ACL_TYPE_NFS4 /* FreeBSD */ + + /* TODO (see set_permissions). */ + +# endif + # else /* HAVE_ACL_TYPE_EXTENDED */ /* Mac OS X */ diff --git a/lib/set-permissions.c b/lib/set-permissions.c index 25c463d..1aa5b49 100644 --- a/lib/set-permissions.c +++ b/lib/set-permissions.c @@ -530,7 +530,8 @@ set_acls (struct permission_context *ctx, const char *name, int desc, *acls_set = true; if (S_ISDIR(ctx->mode)) { - if (! from_mode && ctx->default_acl) + if (! from_mode && ctx->default_acl && + acl_default_nontrivial (ctx->default_acl)) ret = acl_set_file (name, ACL_TYPE_DEFAULT, ctx->default_acl); else @@ -540,6 +541,15 @@ set_acls (struct permission_context *ctx, const char *name, int desc, } } +# if HAVE_ACL_TYPE_NFS4 /* FreeBSD */ + + /* File systems either support POSIX ACLs (for example, ufs) or NFS4 ACLs + (for example, zfs). */ + + /* TODO: Implement setting ACLs once get_permissions() reads them. */ + +# endif + # else /* HAVE_ACL_TYPE_EXTENDED */ /* Mac OS X */ commit ff0e184ef3af49b19cdfb5ee5bb24212676c800b Author: Paul Eggert Date: Tue Jul 14 22:19:45 2015 -0700 Port to stricter C99 * src/keyboard.h (kbd_buffer_store_event_hold): Don't return a void expression. diff --git a/src/keyboard.h b/src/keyboard.h index eaf8194..b843e8d 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -459,8 +459,8 @@ kbd_buffer_store_event_hold (struct input_event *event, { verify (alignof (struct input_event) == alignof (union buffered_input_event) && sizeof (struct input_event) == sizeof (union buffered_input_event)); - return kbd_buffer_store_buffered_event ((union buffered_input_event *) event, - hold_quit); + kbd_buffer_store_buffered_event ((union buffered_input_event *) event, + hold_quit); } #ifdef HAVE_X11 extern void kbd_buffer_unget_event (struct selection_input_event *); commit 7fab529cd22feec796265e3843fdc357d2335451 Author: Xue Fuqiao Date: Wed Jul 15 12:08:29 2015 +0800 * doc/emacs/frames.texi (Creating Frames): Fix the command `C-x 5 m' runs. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 4a193dd..0667826 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -412,8 +412,8 @@ Select a Dired buffer for directory @var{directory} in another frame. This runs @code{dired-other-frame}. @xref{Dired}. @item C-x 5 m Start composing a mail message in another frame. This runs -@code{mail-other-frame}. It is the other-frame variant of @kbd{C-x m}. -@xref{Sending Mail}. +@code{compose-mail-other-frame}. It is the other-frame variant of +@kbd{C-x m}. @xref{Sending Mail}. @item C-x 5 . Find a tag in the current tag table in another frame. This runs @code{find-tag-other-frame}, the multiple-frame variant of @kbd{M-.}. commit 894a90671b9ebc37fb56abfcef6e422e954d6460 Author: Michael Albinus Date: Tue Jul 14 18:23:39 2015 +0200 New autorevert tests. * test/automated/auto-revert-tests.el: New file. diff --git a/test/automated/auto-revert-tests.el b/test/automated/auto-revert-tests.el new file mode 100644 index 0000000..a98428f --- /dev/null +++ b/test/automated/auto-revert-tests.el @@ -0,0 +1,210 @@ +;;; auto-revert-tests.el --- Tests of auto-revert + +;; Copyright (C) 2015 Free Software Foundation, Inc. + +;; Author: Michael Albinus + +;; This program 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. +;; +;; This program 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 this program. If not, see `http://www.gnu.org/licenses/'. + +;;; Commentary: + +;; A whole test run can be performed calling the command `auto-revert-test-all'. + +;;; Code: + +(require 'ert) +(require 'autorevert) +(setq auto-revert-notify-exclude-dir-regexp "nothing-to-be-excluded" + auto-revert-stop-on-user-input nil) + +(defvar auto-revert--timeout 10) + +(ert-deftest auto-revert-test00-auto-revert-mode () + "Check autorevert for a file." + ;; `auto-revert-buffers' runs every 5". And we must wait, until the + ;; file has been reverted. + (let ((tmpfile (make-temp-file "auto-revert-test")) + buf) + (unwind-protect + (progn + (with-current-buffer (get-buffer-create "*Messages*") + (narrow-to-region (point-max) (point-max))) + (write-region "any text" nil tmpfile nil 'no-message) + (setq buf (find-file-noselect tmpfile)) + (with-current-buffer buf + (should (string-equal (buffer-string) "any text")) + ;; `buffer-stale--default-function' checks for + ;; `verify-visited-file-modtime'. We must ensure that it + ;; returns nil. + (sleep-for 1) + (auto-revert-mode 1) + (should auto-revert-mode) + + ;; Modify file. We wait for a second, in order to have + ;; another timestamp. + (sleep-for 1) + (write-region "another text" nil tmpfile nil 'no-message) + + ;; Check, that the buffer has been reverted. + (with-timeout (auto-revert--timeout nil) + (with-current-buffer "*Messages*" + (while + (null (string-match + (format "Reverting buffer `%s'." (buffer-name buf)) + (buffer-string))) + (read-event nil nil 0.1)))) + (should (string-match "another text" (buffer-string))) + + ;; When the buffer is modified, it shall not be reverted. + (with-current-buffer (get-buffer-create "*Messages*") + (narrow-to-region (point-max) (point-max))) + (set-buffer-modified-p t) + (sleep-for 1) + (write-region "any text" nil tmpfile nil 'no-message) + + ;; Check, whether the buffer has been reverted. + (with-timeout (auto-revert--timeout nil) + (with-current-buffer "*Messages*" + (while + (null (string-match + (format "Reverting buffer `%s'." (buffer-name buf)) + (buffer-string))) + (read-event nil nil 0.1)))) + (should-not (string-match "any text" (buffer-string))))) + + ;; Exit. + (with-current-buffer "*Messages*" (widen)) + (ignore-errors + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf)) + (ignore-errors (delete-file tmpfile))))) + +(ert-deftest auto-revert-test01-auto-revert-tail-mode () + "Check autorevert tail mode." + ;; `auto-revert-buffers' runs every 5". And we must wait, until the + ;; file has been reverted. + (let ((tmpfile (make-temp-file "auto-revert-test")) + buf) + (unwind-protect + (progn + (with-current-buffer (get-buffer-create "*Messages*") + (narrow-to-region (point-max) (point-max))) + (write-region "any text" nil tmpfile nil 'no-message) + (setq buf (find-file-noselect tmpfile)) + (with-current-buffer buf + ;; `buffer-stale--default-function' checks for + ;; `verify-visited-file-modtime'. We must ensure that it + ;; returns nil. + (sleep-for 1) + (auto-revert-tail-mode 1) + (should auto-revert-tail-mode) + (erase-buffer) + (insert "modified text\n") + (set-buffer-modified-p nil) + + ;; Modify file. We wait for a second, in order to have + ;; another timestamp. + (sleep-for 1) + (write-region "another text" nil tmpfile 'append 'no-message) + + ;; Check, that the buffer has been reverted. + (with-timeout (auto-revert--timeout nil) + (with-current-buffer "*Messages*" + (while + (null (string-match + (format "Reverting buffer `%s'." (buffer-name buf)) + (buffer-string))) + (read-event nil nil 0.1)))) + (should + (string-match "modified text\nanother text" (buffer-string))))) + + ;; Exit. + (with-current-buffer "*Messages*" (widen)) + (ignore-errors (kill-buffer buf)) + (ignore-errors (delete-file tmpfile))))) + +(ert-deftest auto-revert-test02-auto-revert-mode-dired () + "Check autorevert for dired." + ;; `auto-revert-buffers' runs every 5". And we must wait, until the + ;; file has been reverted. + (let* ((tmpfile (make-temp-file "auto-revert-test")) + (name (file-name-nondirectory tmpfile)) + buf) + (unwind-protect + (progn + (with-current-buffer (get-buffer-create "*Messages*") + (narrow-to-region (point-max) (point-max))) + (setq buf (dired-noselect temporary-file-directory)) + (with-current-buffer buf + ;; `buffer-stale--default-function' checks for + ;; `verify-visited-file-modtime'. We must ensure that it + ;; returns nil. + (sleep-for 1) + (auto-revert-mode 1) + (should auto-revert-mode) + (should + (string-match name (substring-no-properties (buffer-string)))) + + ;; Delete file. We wait for a second, in order to have + ;; another timestamp. + (sleep-for 1) + (delete-file tmpfile) + + ;; Check, that the buffer has been reverted. + (with-timeout (auto-revert--timeout nil) + (with-current-buffer "*Messages*" + (while + (null (string-match + (format "Reverting buffer `%s'." (buffer-name buf)) + (buffer-string))) + (read-event nil nil 0.1)))) + (should + (null + (string-match name (substring-no-properties (buffer-string))))) + + ;; When the dired buffer is modified, it shall not be + ;; reverted. This is questionable, see Bug#20943. + (with-current-buffer (get-buffer-create "*Messages*") + (narrow-to-region (point-max) (point-max))) + (set-buffer-modified-p t) + (sleep-for 1) + (write-region "any text" nil tmpfile nil 'no-message) + + ;; Check, that the buffer hasn't been reverted. + (with-timeout (auto-revert--timeout nil) + (with-current-buffer "*Messages*" + (while + (null (string-match + (format "Reverting buffer `%s'." (buffer-name buf)) + (buffer-string))) + (read-event nil nil 0.1)))) + (should-not + (string-match name (substring-no-properties (buffer-string)))))) + + ;; Exit. + (with-current-buffer "*Messages*" (widen)) + (ignore-errors + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf)) + (ignore-errors (delete-file tmpfile))))) + +(defun auto-revert-test-all (&optional interactive) + "Run all tests for \\[auto-revert]." + (interactive "p") + (if interactive + (ert-run-tests-interactively "^auto-revert-") + (ert-run-tests-batch "^auto-revert-"))) + +(provide 'auto-revert-tests) +;;; auto-revert-tests.el ends here commit 2254b6c09cff8f3a83684fd159289d0e305b0e7d Author: Paul Eggert Date: Tue Jul 14 06:59:26 2015 -0700 Clear gcprolist etc. after stack overflow After stack overflow, command_loop calls init_eval, and this needs to clear gcprolist and byte_stack_list (Bug#20996). * src/alloc.c (init_alloc): Move gcprolist and byte_stack_list initialization from here ... * src/eval.c (init_eval): ... to here. diff --git a/src/alloc.c b/src/alloc.c index c9bdcc2..9ac3ad8 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -7255,8 +7255,6 @@ init_alloc_once (void) void init_alloc (void) { - gcprolist = 0; - byte_stack_list = 0; #if GC_MARK_STACK #if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS setjmp_tested_p = longjmps_done = 0; diff --git a/src/eval.c b/src/eval.c index 4655095..4f7f42f 100644 --- a/src/eval.c +++ b/src/eval.c @@ -220,6 +220,8 @@ static struct handler handlerlist_sentinel; void init_eval (void) { + gcprolist = 0; + byte_stack_list = 0; specpdl_ptr = specpdl; { /* Put a dummy catcher at top-level so that handlerlist is never NULL. This is important since handlerlist->nextfree holds the freelist commit 6a7e718916d00dbacaa765669f389b86f33075f5 Author: Xue Fuqiao Date: Mon Jul 13 19:05:32 2015 +0800 * doc/emacs/windows.texi (Pop Up Window): Fix the description of `C-x 4 m'. diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 6d2eb1f..24cc946 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -223,10 +223,11 @@ Visit file @var{filename} and select its buffer in another window Select a Dired buffer for directory @var{directory} in another window (@code{dired-other-window}). @xref{Dired}. -@findex mail-other-window +@c Don't index @kbd{C-x 4 m} and @code{compose-mail-other-window} +@c here, they are indexed in sending.texi, in the "Sending Mail" node. @item C-x 4 m Start composing a mail message, similar to @kbd{C-x m} (@pxref{Sending -Mail}), but in another window (@code{mail-other-window}). +Mail}), but in another window (@code{compose-mail-other-window}). @findex find-tag-other-window @item C-x 4 . commit a1f783824fb7aa21cd4a413b7876d7ceba351982 Author: YAMAMOTO Mitsuharu Date: Mon Jul 13 19:14:25 2015 +0900 Avoid deprecated enums in mac-ct font backend driver * src/macfont.m (mac_font_copy_default_descriptors_for_language) (mac_ctfont_get_advance_width_for_glyph) (mac_ctfont_get_bounding_rect_for_glyph): Avoid deprecated enums. diff --git a/src/macfont.m b/src/macfont.m index b25640e..02dc468 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -3521,15 +3521,25 @@ mac_ctfont_create_preferred_family_for_attributes (CFDictionaryRef attributes) static inline double mac_ctfont_get_advance_width_for_glyph (CTFontRef font, CGGlyph glyph) { - return CTFontGetAdvancesForGlyphs (font, kCTFontDefaultOrientation, - &glyph, NULL, 1); + return CTFontGetAdvancesForGlyphs (font, +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 + kCTFontOrientationDefault, +#else + kCTFontDefaultOrientation, +#endif + &glyph, NULL, 1); } static inline CGRect mac_ctfont_get_bounding_rect_for_glyph (CTFontRef font, CGGlyph glyph) { - return CTFontGetBoundingRectsForGlyphs (font, kCTFontDefaultOrientation, - &glyph, NULL, 1); + return CTFontGetBoundingRectsForGlyphs (font, +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 + kCTFontOrientationDefault, +#else + kCTFontDefaultOrientation, +#endif + &glyph, NULL, 1); } static CFArrayRef @@ -3891,7 +3901,7 @@ mac_font_copy_default_descriptors_for_language (CFStringRef language) #endif { CTFontRef user_font = - CTFontCreateUIFontForLanguage (kCTFontUserFontType, 0, language); + CTFontCreateUIFontForLanguage (kCTFontUIFontUser, 0, language); if (user_font) { commit 455fe1a7f1cf5cf6b7f1fc99bb8b05c633503c1d Author: YAMAMOTO Mitsuharu Date: Mon Jul 13 18:55:47 2015 +0900 Cache font family in mac-ct font backend driver * src/macfont.m (macfont_family_cache): New variable. (syms_of_macfont): Initialize it. (macfont_available_families_cache): New variable. (macfont_invalidate_family_cache, macfont_get_family_cache_if_present) (macfont_set_family_cache, macfont_invalidate_available_families_cache) (macfont_handle_font_change_notification) (macfont_init_font_change_handler) (macfont_copy_available_families_cache): New functions. (macfont_create_family_with_symbol): Use font family caches. (macfont_list, macfont_list_family): Use macfont_copy_available_families_cache instead of mac_font_create_available_families. diff --git a/src/macfont.m b/src/macfont.m index cbf1ab8..b25640e 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -897,14 +897,152 @@ macfont_descriptor_entity (FontDescriptorRef desc, Lisp_Object extra, return entity; } +/* Cache for font family name symbols vs CFStrings. A value of nil +means the cache has been invalidated. Otherwise the value is a Lisp +hash table whose keys are symbols and the value for a key is either +nil (no corresponding family name) or a Lisp save value wrapping the +corresponding family name in CFString. */ + +static Lisp_Object macfont_family_cache; + +static void +macfont_invalidate_family_cache (void) +{ + if (HASH_TABLE_P (macfont_family_cache)) + { + struct Lisp_Hash_Table *h = XHASH_TABLE (macfont_family_cache); + ptrdiff_t i, size = HASH_TABLE_SIZE (h); + + for (i = 0; i < size; ++i) + if (!NILP (HASH_HASH (h, i))) + { + Lisp_Object value = HASH_VALUE (h, i); + + if (SAVE_VALUEP (value)) + CFRelease (XSAVE_POINTER (value, 0)); + } + macfont_family_cache = Qnil; + } +} + +static bool +macfont_get_family_cache_if_present (Lisp_Object symbol, CFStringRef *string) +{ + if (HASH_TABLE_P (macfont_family_cache)) + { + struct Lisp_Hash_Table *h = XHASH_TABLE (macfont_family_cache); + ptrdiff_t i = hash_lookup (h, symbol, NULL); + + if (i >= 0) + { + Lisp_Object value = HASH_VALUE (h, i); + + *string = SAVE_VALUEP (value) ? XSAVE_POINTER (value, 0) : NULL; + + return true; + } + } + + return false; +} + +static void +macfont_set_family_cache (Lisp_Object symbol, CFStringRef string) +{ + struct Lisp_Hash_Table *h; + ptrdiff_t i; + EMACS_UINT hash; + Lisp_Object value; + + if (!HASH_TABLE_P (macfont_family_cache)) + { + Lisp_Object args[2]; + + args[0] = QCtest; + args[1] = Qeq; + macfont_family_cache = Fmake_hash_table (2, args); + } + + h = XHASH_TABLE (macfont_family_cache); + i = hash_lookup (h, symbol, &hash); + value = string ? make_save_ptr ((void *) CFRetain (string)) : Qnil; + if (i >= 0) + { + Lisp_Object old_value = HASH_VALUE (h, i); + + if (SAVE_VALUEP (old_value)) + CFRelease (XSAVE_POINTER (old_value, 0)); + set_hash_value_slot (h, i, value); + } + else + hash_put (h, symbol, value, hash); +} + +/* Cache of all the available font family names except "LastResort" +and those start with ".". NULL means the cache has been invalidated. +Otherwise, the value is CFArray of CFStrings and the elements are +sorted in the canonical order (CTFontManagerCompareFontFamilyNames on +OS X 10.6 and later). */ + +static CFArrayRef macfont_available_families_cache = NULL; + +static void +macfont_invalidate_available_families_cache (void) +{ + if (macfont_available_families_cache) + { + CFRelease (macfont_available_families_cache); + macfont_available_families_cache = NULL; + } +} + +static void +macfont_handle_font_change_notification (CFNotificationCenterRef center, + void *observer, + CFStringRef name, const void *object, + CFDictionaryRef userInfo) +{ + macfont_invalidate_family_cache (); + macfont_invalidate_available_families_cache (); +} + +static void +macfont_init_font_change_handler (void) +{ + static bool initialized = false; + + if (initialized) + return; + + initialized = true; + CFNotificationCenterAddObserver + (CFNotificationCenterGetLocalCenter (), NULL, + macfont_handle_font_change_notification, + kCTFontManagerRegisteredFontsChangedNotification, + NULL, CFNotificationSuspensionBehaviorCoalesce); +} + +static CFArrayRef +macfont_copy_available_families_cache (void) +{ + macfont_init_font_change_handler (); + + if (macfont_available_families_cache == NULL) + macfont_available_families_cache = mac_font_create_available_families (); + + return (macfont_available_families_cache + ? CFRetain (macfont_available_families_cache) : NULL); +} + static CFStringRef macfont_create_family_with_symbol (Lisp_Object symbol) { - static CFArrayRef families = NULL; CFStringRef result = NULL, family_name; - int using_cache_p = 1; CFComparatorFunction family_name_comparator; + if (macfont_get_family_cache_if_present (symbol, &result)) + return result ? CFRetain (result) : NULL; + family_name = cfstring_create_with_string_noencode (SYMBOL_NAME (symbol)); if (family_name == NULL) return NULL; @@ -917,42 +1055,32 @@ macfont_create_family_with_symbol (Lisp_Object symbol) == kCFCompareEqualTo) result = CFSTR ("LastResort"); else - while (1) - { - CFIndex i, count; - - if (families == NULL) - { - families = mac_font_create_available_families (); - using_cache_p = 0; - if (families == NULL) - break; - } - - count = CFArrayGetCount (families); - i = CFArrayBSearchValues (families, CFRangeMake (0, count), - (const void *) family_name, - family_name_comparator, NULL); - if (i < count) - { - CFStringRef name = CFArrayGetValueAtIndex (families, i); + { + CFIndex i, count; + CFArrayRef families = macfont_copy_available_families_cache (); - if ((*family_name_comparator) (name, family_name, NULL) - == kCFCompareEqualTo) - result = CFRetain (name); - } + if (families) + { + count = CFArrayGetCount (families); + i = CFArrayBSearchValues (families, CFRangeMake (0, count), + (const void *) family_name, + family_name_comparator, NULL); + if (i < count) + { + CFStringRef name = CFArrayGetValueAtIndex (families, i); - if (result || !using_cache_p) - break; - else - { - CFRelease (families); - families = NULL; - } - } + if ((*family_name_comparator) (name, family_name, NULL) + == kCFCompareEqualTo) + result = CFRetain (name); + } + CFRelease (families); + } + } CFRelease (family_name); + macfont_set_family_cache (symbol, result); + return result; } @@ -2091,7 +2219,7 @@ macfont_list (struct frame *f, Lisp_Object spec) CFStringRef pref_family; CFIndex families_count, pref_family_index = -1; - families = mac_font_create_available_families (); + families = macfont_copy_available_families_cache (); if (families == NULL) goto err; @@ -2380,7 +2508,7 @@ macfont_list_family (struct frame *frame) block_input (); - families = mac_font_create_available_families (); + families = macfont_copy_available_families_cache (); if (families) { CFIndex i, count = CFArrayGetCount (families); @@ -3923,4 +4051,7 @@ syms_of_macfont (void) /* The boolean-valued font property key specifying the use of leading. */ DEFSYM (QCminspace, ":minspace"); + + macfont_family_cache = Qnil; + staticpro (&macfont_family_cache); }