I am struggling a bit with proper key setup for Emacs on Haiku.
describe-key for backspace says “DEL (translated from <backspace>)” and describe-key for delete says “DEL (translated from <delete>)”, so they both do the same thing (i.e. backward-delete-char-untabify), but what I want is to run “delete-forward-char” for the delete key.
On Linux it says "<deletechar> (translated from <delete>)" for the delete key and I get the expected behaviour. Anyone know how I can get a similar setup on Haiku?
Another issue appears to be that Ctrl-/ doesn’t do anything on Haiku Emacs (it doesn’t even seem to get to the process as there is no reaction when pressing Ctrl-/ in a describe-key). Any ideas?
I can’t see what it was translated from, because I guess it was not pasted correctly into the forum software. Do they both translate from `<backspace>’ on Haiku?
Is there an easy way to change those files on a running system without having to rebuild emacs?
Anyway, played around a bit and I think in addition to the change in simple.el we also need to change display-symbol-keys-p in frame.el so it returns true for haiku.
Well, I put it into .emacs and it seems to work after doing normal-erase-is-backspace-mode twice which I guess means that it does work (just doesn’t automatically take effect when starting emacs, as it’s only in .emacs)
Did you put the patch into .emacs? Could you please show that code?
It’s getting awfully close to Emacs 29 being released, so right now we are rather reluctant to make any (even tiny) changes to Emacs 29 branch. But I’d like to see this issue fixed there.
(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)))))
The delete key seems to be functioning properly after rebuilding Emacs with both of those changes(display-symbol-keys-p and normal-erase-is-backspace-setup-frame)
Still need to figure out why several of the control keys don’t seem to be generating any input(C-; C-/ C-, C-.)