From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Testing font things Date: Mon, 21 Nov 2022 08:42:01 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24349"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 21 14:43:05 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ox74j-00066f-9h for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Nov 2022 14:43:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ox73s-0007yj-VA; Mon, 21 Nov 2022 08:42:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox73p-0007uG-He for emacs-devel@gnu.org; Mon, 21 Nov 2022 08:42:09 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox73n-0000GT-AU for emacs-devel@gnu.org; Mon, 21 Nov 2022 08:42:09 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A0CE71000E1; Mon, 21 Nov 2022 08:42:04 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1811D100054; Mon, 21 Nov 2022 08:42:03 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1669038123; bh=0EMlXCTo0Dm3obStxxI14ZaT8rmGWYYlCzjFLfrHEcY=; h=From:To:Subject:Date:From; b=IrIxtr1E6oVU4bVePN2MYMAL+cvVeMDfmBwQKxi1iPCw7HxYY5zvKBQ5OXNY7rmpZ ctdJQ5yZZ55q7xF2PLVYwm+vNP3blCYQ69qveAzoWEEu/zzChoWt+3fFgcZiWEVKMX IOd3tgjmKUAqfnvg3LNQd6eMHbOmi7hxs9gJzigT79kIOAv0uU5DDpMYJcHskzlRH2 Mh2rM44U/VchIpfJbPDN5QyPpwiC3vGbMVejODX57SdftMVIYT2Gz+jrLEgBDCSry1 8eCb1ipmTyCZhJVQw6+KktTZcEF2Ed715mpQvUPMD21rKK040bcNUwmna6ZLse3ezb 2wqT5V2O9CWXQ== Original-Received: from pastel (unknown [104.247.241.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E4D19120ECD; Mon, 21 Nov 2022 08:42:02 -0500 (EST) Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300294 Archived-At: I'm trying to write a test for our font choice code (bug#59347) Here's the situation so far: - I have not been able to create a GUI frame from a `--batch` process :-( The process gets killed by SIGIO. I tried to change `(un)request_sigio` so as to ignore `noninteractive` but without any success. - So I resorted to an `--fg-daemon` (with the patch below to let me start a daemon without creating the server socket and waiting for connections). - With this, I'm able to get pretty much what I want with: src/emacs -Q --fg-daemon=none -l test/src/font-tests.el \ -f ert-run-tests-batch The code in font-tests.el looks like: (defvar font-tests--gui-frame (unless noninteractive ;; I get "killed by SIGIO" in batch mode :-( (with-demoted-errors "%S" (make-frame-on-display (getenv "DISPLAY") '((visibility . nil) ;; Tell the window manager not to ask the user to ;; manually place the frame/window. (user-position . t) (left . 0) (top . 0) (no-other-frame . t)))))) (defvar font-tests--dejavu-sans (when font-tests--gui-frame (list-fonts (font-spec :family "DejaVu Sans") font-tests--gui-frame))) (defvar font-tests--misc-fixed (when font-tests--gui-frame (list-fonts (font-spec :name "-misc-fixed-*-*-semicondensed-*-13-*-*-*-*-*-*-*") font-tests--gui-frame))) (ert-deftest font-tests--bug59347 () (skip-unless (and font-tests--misc-fixed font-tests--dejavu-sans)) (face-spec-set 'default '((t :font "-misc-fixed-*-*-semicondensed-*-13-*-*-*-*-*-*-*"))) (face-spec-set 'font-tests-dejavu '((t :family "DejaVu Sans"))) (with-temp-buffer (let ((w (frame-root-window font-tests--gui-frame))) (set-window-buffer w (current-buffer)) (insert "hello " (propertize "world" 'face 'font-tests-dejavu)) (should (member (font-at (1+ (point-min)) w) font-tests--misc-fixed)) (should (member (font-at (1- (point-max)) w) font-tests--dejavu-sans))))) But this fails because `fonts-at` gets me a "font-object" whereas `list-fonts` gets me "font entities". How can I convert one to the other? -- Stefan diff --git a/lisp/startup.el b/lisp/startup.el index 5e0a47d3f8f..7dc35e2392c 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -390,7 +390,7 @@ user-mail-address "The email address of the current user. This defaults to either: the value of EMAIL environment variable; or user@host, using `user-login-name' and `mail-host-address' (or `system-name')." - :initialize 'custom-initialize-delay + :initialize #'custom-initialize-delay :set-after '(mail-host-address) :type 'string :group 'mail) @@ -1613,7 +1613,11 @@ command-line ;; processing all command line arguments to allow e.g. `server-name' ;; to be changed before the server starts. (let ((dn (daemonp))) - (when dn + (cond + ((equal dn "none") + (message "Not starting any server; exiting") + (kill-emacs 1)) + (dn (when (stringp dn) (setq server-name dn)) (server-start) (if server-process @@ -1623,7 +1627,7 @@ command-line "Unable to start daemon: Emacs server named %S already running" server-name) (message "Unable to start the daemon.\nAnother instance of Emacs is running the server, either as daemon or interactively.\nYou can use emacsclient to connect to that Emacs process.")) - (kill-emacs 1)))) + (kill-emacs 1))))) ;; Run emacs-session-restore (session management) if started by ;; the session manager and we have a session manager connection.