From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Why is touch-screen.el preloaded? Date: Wed, 29 Nov 2023 15:26:21 +0200 Message-ID: <83edg87ksi.fsf@gnu.org> References: <83a5r2c94q.fsf@gnu.org> <87ttp9b7am.fsf@yahoo.com> <83h6l9ax2j.fsf@gnu.org> <87leakbume.fsf@yahoo.com> <87h6l6bh4n.fsf@yahoo.com> <83h6l67yh9.fsf@gnu.org> <83v89l6xm7.fsf@gnu.org> <87cyvsbwrt.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39778"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 29 14:27:24 2023 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 1r8Kb6-000A9L-FL for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Nov 2023 14:27:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8KaL-0007K2-14; Wed, 29 Nov 2023 08:26:38 -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 1r8KaF-0007Jf-Iw for emacs-devel@gnu.org; Wed, 29 Nov 2023 08:26:32 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r8KaF-0005XZ-0a; Wed, 29 Nov 2023 08:26:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=jy5kT5yO2kUcIb183XF9NQKogFvw2BuDWZ9aVUyhqYU=; b=OENbIL2AmhJh bpfUV0ggJ3qibqnpRBD/K08DoTxyR+OYeEaOzYgokRWhQnAt9Ikk3/S9BORtuN+YWhhRH1H6PEUBP Ep0/R2Xixw5biERMLT/hKYVrxU/GQ2okKpvpfAiHTMTeWjG3hytIkvhY//bcHKxE0BWskXjUI2PC3 HSSU3h2wjgvDv1KjiwtQ0hZuFzFvDR0Pn6N8L8d6oJPoXQDhCfE73NpHz1xMWnU9Nzy0qzZgkCv1A epYCYctHoQmV3DMaoMFRHwQL3sN4gq3wZWUhqrLvq+tbVZanocKTg3dBRGo6pGt+V1fE+uQs3J9XF 22gm1ON+uTfKS9dYx/klGg==; In-Reply-To: <87cyvsbwrt.fsf@yahoo.com> (message from Po Lu on Wed, 29 Nov 2023 19:53:58 +0800) 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:313359 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Wed, 29 Nov 2023 19:53:58 +0800 > > Eli Zaretskii writes: > > > I don't think I understand what you are saying. Can you perhaps show > > an example and explain this using that example? > > OK. calc.el binds touch-screen-display-keyboard to t, preventing window > creation hooks it installs from removing the virtual keyboard when the > selected window changes as its calculator windows are created. > > ;; not hidden by accident. > (let ((touch-screen-display-keyboard t)) > (when (get-buffer-window "*Calc Keypad*") > > This let statement binding a global variable won't take effect if > byte-compiled on systems where touch-screen.el is not preloaded unless a > defvar statement is inserted, and much code will omit this statement, > since their authors will be unaware it might be necessary. Such code > will function improperly if compiled on those systems. But we have this issue in gazillion places in Emacs. It is the job of whoever writes such code to make sure there is a defvar. Otherwise this is a subtle bug, which will be fixed when reported by someone from the affected platforms. A random example: (defvar w32-collate-ignore-punctuation) ; Declare for non-w32 builds. (defsubst ls-lisp-string-lessp (s1 s2) "Return t if string S1 should sort before string S2. Case is significant if `ls-lisp-ignore-case' is nil. Uses `string-collate-lessp' if `ls-lisp-use-string-collate' is non-nil, `compare-strings' otherwise. On GNU/Linux systems, if the locale specifies UTF-8 as the codeset, the sorting order will place together file names that differ only by punctuation characters, like `.emacs' and `emacs'. To have a similar behavior on MS-Windows, customize `ls-lisp-UCA-like-collation' to a non-nil value." (let ((w32-collate-ignore-punctuation ls-lisp-UCA-like-collation)) (if ls-lisp-use-string-collate (string-collate-lessp s1 s2 nil ls-lisp-ignore-case) (let ((u (compare-strings s1 0 nil s2 0 nil ls-lisp-ignore-case))) (and (numberp u) (< u 0)))))) So I don't see any grave problem here. It's nothing new.