From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#35058: [PATCH] Use display-graphic-p in more cases Date: Fri, 05 Apr 2019 10:29:43 +0300 Message-ID: <838swodi54.fsf@gnu.org> References: <8736n4ndav.fsf@gmail.com> <83tvfjgilm.fsf@gnu.org> <875zry9x94.fsf@gmail.com> <83a7hagv11.fsf@gnu.org> <87d0m4pcca.fsf@gmail.com> <83ef6kfhjf.fsf@gnu.org> <878swsp9wh.fsf@gmail.com> <838swsfdzb.fsf@gnu.org> <87r2ajbrhd.fsf@gmail.com> <83pnq3ejxe.fsf@gnu.org> <87h8be7s3t.fsf@gmail.com> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="232251"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 35058@debbugs.gnu.org To: Alex Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 05 09:31:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hCJJf-000yHj-3Y for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Apr 2019 09:31:11 +0200 Original-Received: from localhost ([127.0.0.1]:37501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCJJe-0004uB-4M for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Apr 2019 03:31:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCJJX-0004u3-1l for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2019 03:31:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hCJJW-00068y-24 for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2019 03:31:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59729) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hCJJV-00068s-Sv for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2019 03:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hCJJV-0007nj-Ma for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2019 03:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Apr 2019 07:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35058 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35058-submit@debbugs.gnu.org id=B35058.155444940929863 (code B ref 35058); Fri, 05 Apr 2019 07:31:01 +0000 Original-Received: (at 35058) by debbugs.gnu.org; 5 Apr 2019 07:30:09 +0000 Original-Received: from localhost ([127.0.0.1]:45040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hCJIe-0007la-SI for submit@debbugs.gnu.org; Fri, 05 Apr 2019 03:30:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hCJIc-0007ke-4w for 35058@debbugs.gnu.org; Fri, 05 Apr 2019 03:30:07 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCJIW-0004Nj-SQ; Fri, 05 Apr 2019 03:30:00 -0400 Original-Received: from [176.228.60.248] (port=2475 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hCJIU-0007s5-TU; Fri, 05 Apr 2019 03:29:59 -0400 In-reply-to: <87h8be7s3t.fsf@gmail.com> (message from Alex on Wed, 03 Apr 2019 14:26:30 -0600) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157211 Archived-At: > From: Alex > Cc: 35058@debbugs.gnu.org > Date: Wed, 03 Apr 2019 14:26:30 -0600 > > I've attached a patch series below (including the logb change Basil > recommended). Are these okay to apply? Almost, we are close. See the remaining few comments below. > The first patch does still use display-graphic-p in a few cases in > frame.el for the predicates concerning pixel dimensions. Do you really > want them to use memq instead? For the display-* functions, yes, I'd like to leave their definitions explicit. > +(defun display-symbol-keys-p (&optional display) > + "Return non-nil if DISPLAY supports symbol names as keys. > +This means that, for example, DISPLAY can differentiate between > +the keybinding RET and [return]." > + (let ((frame-type (framep-on-display display))) > + (or (memq frame-type '(x w32 ns pc)) > + (memq system-type '(ms-dos windows-nt))))) Please add a comment here explaining that MS-Windows/MS-DOS terminals are an exception because they have built-in support for function keys. > --- a/lisp/faces.el > +++ b/lisp/faces.el > @@ -55,6 +55,7 @@ term-file-aliases > :group 'terminals > :version "25.1") > > +(declare-function display-graphic-p "frame" (&optional display)) Did you try to bootstrap with this? frame.el is loaded after faces.el. (There are more similar declarations in the patches with the same issues.) > --- a/lisp/emulation/cua-base.el > +++ b/lisp/emulation/cua-base.el > @@ -427,7 +427,7 @@ cua-rectangle-mark-key > > (defcustom cua-rectangle-modifier-key 'meta > "Modifier key used for rectangle commands bindings. > -On non-window systems, always use the meta modifier. > +On non-window systems, use `cua-rectangle-terminal-modifier-key'. > Must be set prior to enabling CUA." > :type '(choice (const :tag "Meta key" meta) > (const :tag "Alt key" alt) > @@ -435,6 +435,16 @@ cua-rectangle-modifier-key > (const :tag "Super key" super)) > :group 'cua) > > +(defcustom cua-rectangle-terminal-modifier-key 'meta > + "Modifier key used for rectangle commands bindings in terminals. > +Must be set prior to enabling CUA." > + :type '(choice (const :tag "Meta key" meta) > + (const :tag "Alt key" alt) > + (const :tag "Hyper key" hyper) > + (const :tag "Super key" super)) > + :group 'cua > + :version "27.1") This change should be called out in NEWS. The new display-* predicates should probably also be mentioned in NEWS. Thanks.