summaryrefslogtreecommitdiff
path: root/lisp/term
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/mac-win.el46
-rw-r--r--lisp/term/x-win.el6
-rw-r--r--lisp/term/xterm.el104
3 files changed, 120 insertions, 36 deletions
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 9e3393b04a1..3e86c2a8ead 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1287,14 +1287,19 @@ correspoinding TextEncodingBase value."
(find-coding-systems-string string)))
(setq coding-system
(coding-system-change-eol-conversion coding-system 'mac))
- (when (and (eq system-type 'darwin)
- (eq coding-system 'japanese-shift-jis-mac))
- (setq encoding mac-text-encoding-mac-japanese-basic-variant)
- (setq string (subst-char-in-string ?\\ ?\x80 string))
- (subst-char-in-string ?\¥ ?\x5c string t))
- (setq data (mac-code-convert-string
- (encode-coding-string string coding-system)
- (or encoding coding-system) nil)))
+ (let ((str string))
+ (when (and (eq system-type 'darwin)
+ (eq coding-system 'japanese-shift-jis-mac))
+ (setq encoding mac-text-encoding-mac-japanese-basic-variant)
+ (setq str (subst-char-in-string ?\\ ?\x80 str))
+ (subst-char-in-string ?\¥ ?\x5c str t)
+ ;; ASCII-only?
+ (if (string-match "\\`[\x00-\x7f]*\\'" str)
+ (setq str nil)))
+ (and str
+ (setq data (mac-code-convert-string
+ (encode-coding-string str coding-system)
+ (or encoding coding-system) nil)))))
(or data (encode-coding-string string (if (eq (byteorder) ?B)
'utf-16be-mac
'utf-16le-mac)))))
@@ -1528,19 +1533,20 @@ in `selection-converter-alist', which see."
;;; Event IDs
;; kCoreEventClass
-(put 'open-application 'mac-apple-event-id "oapp") ; kAEOpenApplication
-(put 'reopen-application 'mac-apple-event-id "rapp") ; kAEReopenApplication
-(put 'open-documents 'mac-apple-event-id "odoc") ; kAEOpenDocuments
-(put 'print-documents 'mac-apple-event-id "pdoc") ; kAEPrintDocuments
-(put 'open-contents 'mac-apple-event-id "ocon") ; kAEOpenContents
-(put 'quit-application 'mac-apple-event-id "quit") ; kAEQuitApplication
-(put 'application-died 'mac-apple-event-id "obit") ; kAEApplicationDied
-(put 'show-preferences 'mac-apple-event-id "pref") ; kAEShowPreferences
-(put 'autosave-now 'mac-apple-event-id "asav") ; kAEAutosaveNow
+(put 'open-application 'mac-apple-event-id "oapp") ; kAEOpenApplication
+(put 'reopen-application 'mac-apple-event-id "rapp") ; kAEReopenApplication
+(put 'open-documents 'mac-apple-event-id "odoc") ; kAEOpenDocuments
+(put 'print-documents 'mac-apple-event-id "pdoc") ; kAEPrintDocuments
+(put 'open-contents 'mac-apple-event-id "ocon") ; kAEOpenContents
+(put 'quit-application 'mac-apple-event-id "quit") ; kAEQuitApplication
+(put 'application-died 'mac-apple-event-id "obit") ; kAEApplicationDied
+(put 'show-preferences 'mac-apple-event-id "pref") ; kAEShowPreferences
+(put 'autosave-now 'mac-apple-event-id "asav") ; kAEAutosaveNow
;; kAEInternetEventClass
-(put 'get-url 'mac-apple-event-id "GURL") ; kAEGetURL
+(put 'get-url 'mac-apple-event-id "GURL") ; kAEGetURL
;; Converted HI command events
-(put 'about 'mac-apple-event-id "abou") ; kHICommandAbout
+(put 'about 'mac-apple-event-id "abou") ; kHICommandAbout
+(put 'show-hide-font-panel 'mac-apple-event-id "shfp") ; kHICommandShowHideFontPanel
(defmacro mac-event-spec (event)
`(nth 1 ,event))
@@ -1796,6 +1802,8 @@ With numeric ARG, display the font panel if and only if ARG is positive."
'mac-handle-font-panel-closed)
;; kEventClassFont/kEventFontSelection
(define-key mac-apple-event-map [font selection] 'mac-handle-font-selection)
+(define-key mac-apple-event-map [hi-command show-hide-font-panel]
+ 'mac-font-panel-mode)
(define-key-after menu-bar-showhide-menu [mac-font-panel-mode]
(menu-bar-make-mm-toggle mac-font-panel-mode
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index fe774a4125f..967d9918b59 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -2393,6 +2393,12 @@ order until succeed.")
(kill-new clipboard-text))
(yank)))
+(defun x-menu-bar-open (&optional frame)
+ "Open the menu bar if `menu-bar-mode' is on. otherwise call `tmm-menubar'."
+ (interactive "i")
+ (if menu-bar-mode (menu-bar-open frame)
+ (tmm-menubar)))
+
;;; Window system initialization.
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 2e498a8de86..e574c34543f 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -162,17 +162,20 @@
;; These keys are available in xterm starting from version 216
;; if the modifyOtherKeys resource is set to 1.
+(define-key xterm-function-map "\e[27;5;9~" [C-tab])
+(define-key xterm-function-map "\e[27;5;13~" [C-return])
(define-key xterm-function-map "\e[27;5;39~" [?\C-\'])
+(define-key xterm-function-map "\e[27;5;44~" [?\C-,])
(define-key xterm-function-map "\e[27;5;45~" [?\C--])
-
+(define-key xterm-function-map "\e[27;5;46~" [?\C-.])
+(define-key xterm-function-map "\e[27;5;47~" [?\C-/])
(define-key xterm-function-map "\e[27;5;48~" [?\C-0])
(define-key xterm-function-map "\e[27;5;49~" [?\C-1])
;; Not all C-DIGIT keys have a distinct binding.
(define-key xterm-function-map "\e[27;5;57~" [?\C-9])
-
-(define-key xterm-function-map "\e[27;5;59~" [?\C-\;])
+(define-key xterm-function-map "\e[27;5;59~" [(C-\;)])
(define-key xterm-function-map "\e[27;5;61~" [?\C-=])
-
+(define-key xterm-function-map "\e[27;5;92~" [?\C-\\])
(define-key xterm-function-map "\e[27;6;33~" [?\C-!])
(define-key xterm-function-map "\e[27;6;34~" [?\C-\"])
@@ -184,26 +187,93 @@
(define-key xterm-function-map "\e[27;6;41~" [?\C-)])
(define-key xterm-function-map "\e[27;6;42~" [?\C-*])
(define-key xterm-function-map "\e[27;6;43~" [?\C-+])
-
(define-key xterm-function-map "\e[27;6;58~" [?\C-:])
(define-key xterm-function-map "\e[27;6;60~" [?\C-<])
(define-key xterm-function-map "\e[27;6;62~" [?\C->])
(define-key xterm-function-map "\e[27;6;63~" [(C-\?)])
-(define-key xterm-function-map "\e[27;5;9~" [C-tab])
-(define-key xterm-function-map "\e[27;5;13~" [C-return])
-(define-key xterm-function-map "\e[27;5;44~" [?\C-,])
-(define-key xterm-function-map "\e[27;5;46~" [?\C-.])
-(define-key xterm-function-map "\e[27;5;47~" [?\C-/])
-(define-key xterm-function-map "\e[27;5;92~" [?\C-\\])
-
-(define-key xterm-function-map "\e[27;2;9~" [S-tab])
-(define-key xterm-function-map "\e[27;2;13~" [S-return])
-
-(define-key xterm-function-map "\e[27;6;9~" [(C-S-tab)])
+;; These are the strings emitted for various C-M- combinations
+;; for keyboards that the Meta and Alt modifiers are on the same
+;; key (usually labeled "Alt").
+(define-key xterm-function-map "\e[27;13;9~" [(C-M-tab)])
+(define-key xterm-function-map "\e[27;13;13~" [(C-M-return)])
+(define-key xterm-function-map "\e[27;13;39~" [?\C-\M-\'])
+(define-key xterm-function-map "\e[27;13;44~" [?\C-\M-,])
+(define-key xterm-function-map "\e[27;13;45~" [?\C-\M--])
(define-key xterm-function-map "\e[27;13;46~" [?\C-\M-.])
-
+(define-key xterm-function-map "\e[27;13;47~" [?\C-\M-/])
+(define-key xterm-function-map "\e[27;13;48~" [?\C-\M-0])
+(define-key xterm-function-map "\e[27;13;49~" [?\C-\M-1])
+(define-key xterm-function-map "\e[27;13;50~" [?\C-\M-2])
+(define-key xterm-function-map "\e[27;13;51~" [?\C-\M-3])
+(define-key xterm-function-map "\e[27;13;52~" [?\C-\M-4])
+(define-key xterm-function-map "\e[27;13;53~" [?\C-\M-5])
+(define-key xterm-function-map "\e[27;13;54~" [?\C-\M-6])
+(define-key xterm-function-map "\e[27;13;55~" [?\C-\M-7])
+(define-key xterm-function-map "\e[27;13;56~" [?\C-\M-8])
+(define-key xterm-function-map "\e[27;13;57~" [?\C-\M-9])
+(define-key xterm-function-map "\e[27;13;59~" [?\C-\M-\;])
+(define-key xterm-function-map "\e[27;13;61~" [?\C-\M-=])
+(define-key xterm-function-map "\e[27;13;92~" [?\C-\M-\\])
+
+(define-key xterm-function-map "\e[27;14;33~" [?\C-\M-!])
+(define-key xterm-function-map "\e[27;14;34~" [?\C-\M-\"])
+(define-key xterm-function-map "\e[27;14;35~" [?\C-\M-#])
+(define-key xterm-function-map "\e[27;14;36~" [?\C-\M-$])
+(define-key xterm-function-map "\e[27;14;37~" [?\C-\M-%])
+(define-key xterm-function-map "\e[27;14;38~" [(C-M-&)])
+(define-key xterm-function-map "\e[27;14;40~" [?\C-\M-(])
+(define-key xterm-function-map "\e[27;14;41~" [?\C-\M-)])
+(define-key xterm-function-map "\e[27;14;42~" [?\C-\M-*])
+(define-key xterm-function-map "\e[27;14;43~" [?\C-\M-+])
+(define-key xterm-function-map "\e[27;14;58~" [?\C-\M-:])
+(define-key xterm-function-map "\e[27;14;60~" [?\C-\M-<])
+(define-key xterm-function-map "\e[27;14;62~" [?\C-\M->])
+(define-key xterm-function-map "\e[27;14;63~" [(C-M-\?)])
+
+(define-key xterm-function-map "\e[27;7;9~" [(C-M-tab)])
+(define-key xterm-function-map "\e[27;7;13~" [(C-M-return)])
+
+(define-key xterm-function-map "\e[27;7;39~" [?\C-\M-\'])
+(define-key xterm-function-map "\e[27;7;44~" [?\C-\M-,])
+(define-key xterm-function-map "\e[27;7;45~" [?\C-\M--])
+(define-key xterm-function-map "\e[27;7;46~" [?\C-\M-.])
+(define-key xterm-function-map "\e[27;7;47~" [?\C-\M-/])
+(define-key xterm-function-map "\e[27;7;48~" [?\C-\M-0])
+(define-key xterm-function-map "\e[27;7;49~" [?\C-\M-1])
+(define-key xterm-function-map "\e[27;7;50~" [?\C-\M-2])
+(define-key xterm-function-map "\e[27;7;51~" [?\C-\M-3])
+(define-key xterm-function-map "\e[27;7;52~" [?\C-\M-4])
+(define-key xterm-function-map "\e[27;7;53~" [?\C-\M-5])
+(define-key xterm-function-map "\e[27;7;54~" [?\C-\M-6])
+(define-key xterm-function-map "\e[27;7;55~" [?\C-\M-7])
+(define-key xterm-function-map "\e[27;7;56~" [?\C-\M-8])
+(define-key xterm-function-map "\e[27;7;57~" [?\C-\M-9])
+(define-key xterm-function-map "\e[27;7;59~" [?\C-\M-\;])
+(define-key xterm-function-map "\e[27;7;61~" [?\C-\M-=])
+(define-key xterm-function-map "\e[27;7;92~" [?\C-\M-\\])
+
+(define-key xterm-function-map "\e[27;8;33~" [?\C-\M-!])
+(define-key xterm-function-map "\e[27;8;34~" [?\C-\M-\"])
+(define-key xterm-function-map "\e[27;8;35~" [?\C-\M-#])
+(define-key xterm-function-map "\e[27;8;36~" [?\C-\M-$])
+(define-key xterm-function-map "\e[27;8;37~" [?\C-\M-%])
+(define-key xterm-function-map "\e[27;8;38~" [(C-M-&)])
+(define-key xterm-function-map "\e[27;8;40~" [?\C-\M-(])
+(define-key xterm-function-map "\e[27;8;41~" [?\C-\M-)])
+(define-key xterm-function-map "\e[27;8;42~" [?\C-\M-*])
+(define-key xterm-function-map "\e[27;8;43~" [?\C-\M-+])
+(define-key xterm-function-map "\e[27;8;58~" [?\C-\M-:])
+(define-key xterm-function-map "\e[27;8;60~" [?\C-\M-<])
+(define-key xterm-function-map "\e[27;8;62~" [?\C-\M->])
+(define-key xterm-function-map "\e[27;8;63~" [(C-M-\?)])
+
+(define-key xterm-function-map "\e[27;2;9~" [S-tab])
+(define-key xterm-function-map "\e[27;2;13~" [S-return])
+
+(define-key xterm-function-map "\e[27;6;9~" [(C-S-tab)])
+(define-key xterm-function-map "\e[27;6;13~" [(C-S-return)])
;; Other versions of xterm might emit these.
(define-key xterm-function-map "\e[A" [up])