unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Changes OK for Emacs 29?
Date: Sat, 21 Jan 2023 08:28:44 +0800	[thread overview]
Message-ID: <875yd07mtf.fsf@yahoo.com> (raw)
In-Reply-To: <833585nxn9.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Jan 2023 15:28:10 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Date: Fri, 20 Jan 2023 17:49:13 +0800
>> 
>> Users report that the following changes to two functions are needed for
>> the Delete key to delete forward correctly on Haiku:
>> 
>> (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 pgtk haiku))
>>         ;; MS-DOS and MS-Windows terminals have built-in support for
>>         ;; function (symbol) keys
>>         (memq system-type '(ms-dos windows-nt)))))
>> 
>> (defun normal-erase-is-backspace-setup-frame (&optional frame)
>>   "Set up `normal-erase-is-backspace-mode' on FRAME, if necessary."
>>   (unless frame (setq frame (selected-frame)))
>>   (with-selected-frame frame
>>     (unless (terminal-parameter nil 'normal-erase-is-backspace)
>>       (normal-erase-is-backspace-mode
>>        (if (if (eq normal-erase-is-backspace 'maybe)
>>                (and (not noninteractive)
>>                     (or (memq system-type '(ms-dos windows-nt))
>> 			(memq window-system '(w32 ns pgtk haiku))
>>                         (and (eq window-system 'x)
>>                              (fboundp 'x-backspace-delete-keys-p)
>>                              (x-backspace-delete-keys-p))
>>                         ;; If the terminal Emacs is running on has erase char
>>                         ;; set to ^H, use the Backspace key for deleting
>>                         ;; backward, and the Delete key for deleting forward.
>>                         (and (null window-system)
>>                              (eq tty-erase-char ?\^H))))
>>              normal-erase-is-backspace)
>>            1 0)))))
>> 
>> Are they ok for Emacs 29?
>
> I don't know.  Please describe the problem, please show the changes
> (as diffs, for example), and please explain how these changes fix the
> problems.

Here are the changes.  It's always possible to tell backspace apart from
delete, and RET from return on Haiku.

diff --git a/lisp/simple.el b/lisp/simple.el
index 4551b749d56..a38426060e0 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10317,7 +10317,7 @@ normal-erase-is-backspace-setup-frame
        (if (if (eq normal-erase-is-backspace 'maybe)
                (and (not noninteractive)
                     (or (memq system-type '(ms-dos windows-nt))
-			(memq window-system '(w32 ns pgtk))
+			(memq window-system '(w32 ns pgtk haiku))
                         (and (eq window-system 'x)
                              (fboundp 'x-backspace-delete-keys-p)
                              (x-backspace-delete-keys-p))

diff --git a/lisp/frame.el b/lisp/frame.el
index 322a6f9aa59..fa376788eb0 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -2189,7 +2189,7 @@ display-symbol-keys-p
 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 pgtk))
+    (or (memq frame-type '(x w32 ns pc pgtk haiku))
         ;; MS-DOS and MS-Windows terminals have built-in support for
         ;; function (symbol) keys
         (memq system-type '(ms-dos windows-nt)))))



  reply	other threads:[~2023-01-21  0:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87cz797cyu.fsf.ref@yahoo.com>
2023-01-20  9:49 ` Changes OK for Emacs 29? Po Lu
2023-01-20 13:28   ` Eli Zaretskii
2023-01-21  0:28     ` Po Lu [this message]
2023-01-21  8:24       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875yd07mtf.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).