mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Define and use new procedure display-symbol-keys-p
* lisp/frame.el (display-symbol-keys-p): Define. * lisp/simple.el (normal-erase-is-backspace-setup-frame): Use eq instead of memq. (normal-erase-is-backspace-mode): Use display-symbol-keys-p.
This commit is contained in:
parent
c6ea522de6
commit
cffc04c48d
3 changed files with 20 additions and 3 deletions
6
etc/NEWS
6
etc/NEWS
|
|
@ -1230,6 +1230,12 @@ the 128...255 range, as expected.
|
|||
This allows to create and parent immediately a minibuffer-only child
|
||||
frame when making a frame.
|
||||
|
||||
---
|
||||
*** New predicates 'display-blink-cursor-p' and 'display-symbol-keys-p'.
|
||||
These predicates are to be preferred over 'display-graphic-p' when
|
||||
testing for blinking cursor capability and the capability to have
|
||||
symbols (e.g., [return], [tab], [backspace]) as keys respectively.
|
||||
|
||||
** Tabulated List mode
|
||||
|
||||
+++
|
||||
|
|
|
|||
|
|
@ -1927,6 +1927,16 @@ frame's display)."
|
|||
(t
|
||||
nil))))
|
||||
|
||||
(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))
|
||||
;; MS-DOS and MS-Windows terminals have built-in support for
|
||||
;; function (symbol) keys
|
||||
(memq system-type '(ms-dos windows-nt)))))
|
||||
|
||||
(declare-function x-display-screens "xfns.c" (&optional terminal))
|
||||
|
||||
(defun display-screens (&optional display)
|
||||
|
|
|
|||
|
|
@ -8690,7 +8690,7 @@ call `normal-erase-is-backspace-mode' (which see) instead."
|
|||
(and (not noninteractive)
|
||||
(or (memq system-type '(ms-dos windows-nt))
|
||||
(memq window-system '(w32 ns))
|
||||
(and (memq window-system '(x))
|
||||
(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
|
||||
|
|
@ -8701,6 +8701,8 @@ call `normal-erase-is-backspace-mode' (which see) instead."
|
|||
normal-erase-is-backspace)
|
||||
1 0)))))
|
||||
|
||||
(declare-function display-symbol-keys-p "frame" (&optional display))
|
||||
|
||||
(define-minor-mode normal-erase-is-backspace-mode
|
||||
"Toggle the Erase and Delete mode of the Backspace and Delete keys.
|
||||
|
||||
|
|
@ -8736,8 +8738,7 @@ See also `normal-erase-is-backspace'."
|
|||
(let ((enabled (eq 1 (terminal-parameter
|
||||
nil 'normal-erase-is-backspace))))
|
||||
|
||||
(cond ((or (memq window-system '(x w32 ns pc))
|
||||
(memq system-type '(ms-dos windows-nt)))
|
||||
(cond ((display-symbol-keys-p)
|
||||
(let ((bindings
|
||||
'(([M-delete] [M-backspace])
|
||||
([C-M-delete] [C-M-backspace])
|
||||
|
|
|
|||
Loading…
Reference in a new issue