[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changes OK for Emacs 29?
From: |
Po Lu |
Subject: |
Re: Changes OK for Emacs 29? |
Date: |
Sat, 21 Jan 2023 08:28:44 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
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)))))