Mercurial > emacs
comparison lisp/term/mac-win.el @ 83502:c1e013e3dc0e
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-173
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-174
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-175
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-176
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-177
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-178
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-179
Update from erc--emacs--0
* emacs@sv.gnu.org/emacs--devo--0--patch-180
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-181
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-182
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-183
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-184
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-185
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-186
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-187
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/gnus--rel--5.10--patch-65
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-66
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-67
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-68
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-69
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-70
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-71
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-72
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-542
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 01 Apr 2006 13:24:42 +0000 |
parents | b98066f4aa10 3894622d0c1c |
children | d9f8d2a65d18 |
comparison
equal
deleted
inserted
replaced
83501:9490895469d4 | 83502:c1e013e3dc0e |
---|---|
1101 (25 . chinese-iso-8bit) ; smSimpChinese | 1101 (25 . chinese-iso-8bit) ; smSimpChinese |
1102 (29 . mac-centraleurroman) ; smCentralEuroRoman | 1102 (29 . mac-centraleurroman) ; smCentralEuroRoman |
1103 ) | 1103 ) |
1104 "Alist of Mac script codes vs Emacs coding systems.") | 1104 "Alist of Mac script codes vs Emacs coding systems.") |
1105 | 1105 |
1106 (defconst mac-system-coding-system | |
1107 (let ((base (or (cdr (assq mac-system-script-code | |
1108 mac-script-code-coding-systems)) | |
1109 'mac-roman))) | |
1110 (if (eq system-type 'darwin) | |
1111 base | |
1112 (coding-system-change-eol-conversion base 'mac))) | |
1113 "Coding system derived from the system script code.") | |
1114 | |
1115 (defun mac-add-charset-info (xlfd-charset mac-text-encoding) | 1106 (defun mac-add-charset-info (xlfd-charset mac-text-encoding) |
1116 "Add a character set to display with Mac fonts. | 1107 "Add a character set to display with Mac fonts. |
1117 Create an entry in `mac-charset-info-alist'. | 1108 Create an entry in `mac-charset-info-alist'. |
1118 XLFD-CHARSET is a string which will appear in the XLFD font name | 1109 XLFD-CHARSET is a string which will appear in the XLFD font name |
1119 to identify the character set. MAC-TEXT-ENCODING is the | 1110 to identify the character set. MAC-TEXT-ENCODING is the |
1150 (define-key key-translation-map [?\x80] "\\")))) | 1141 (define-key key-translation-map [?\x80] "\\")))) |
1151 | 1142 |
1152 (define-key special-event-map [language-change] 'mac-handle-language-change) | 1143 (define-key special-event-map [language-change] 'mac-handle-language-change) |
1153 | 1144 |
1154 ;;;; Selections | 1145 ;;;; Selections |
1155 | |
1156 ;; Setup to use the Mac clipboard. | |
1157 (set-selection-coding-system mac-system-coding-system) | |
1158 | 1146 |
1159 ;;; We keep track of the last text selected here, so we can check the | 1147 ;;; We keep track of the last text selected here, so we can check the |
1160 ;;; current selection against it, and avoid passing back our own text | 1148 ;;; current selection against it, and avoid passing back our own text |
1161 ;;; from x-get-selection-value. | 1149 ;;; from x-get-selection-value. |
1162 (defvar x-last-selected-text-clipboard nil | 1150 (defvar x-last-selected-text-clipboard nil |
1334 (encode-coding-string str coding) | 1322 (encode-coding-string str coding) |
1335 coding nil))) | 1323 coding nil))) |
1336 (setq str (or s | 1324 (setq str (or s |
1337 (encode-coding-string str | 1325 (encode-coding-string str |
1338 (if (eq (byteorder) ?B) | 1326 (if (eq (byteorder) ?B) |
1339 'utf-16be 'utf-16le)))))) | 1327 'utf-16be-mac |
1328 'utf-16le-mac)))))) | |
1340 ((eq type 'com.apple.traditional-mac-plain-text) | 1329 ((eq type 'com.apple.traditional-mac-plain-text) |
1341 (let ((encodables (find-coding-systems-string str)) | 1330 (let ((encodables (find-coding-systems-string str)) |
1342 (rest mac-script-code-coding-systems)) | 1331 (rest mac-script-code-coding-systems)) |
1343 (unless (memq coding encodables) | 1332 (unless (memq coding encodables) |
1344 (while (and rest (not (memq (cdar rest) encodables))) | 1333 (while (and rest (not (memq (cdar rest) encodables))) |
1894 (let ((fontset | 1883 (let ((fontset |
1895 (create-fontset-from-ascii-font font resolved-font fontset-name))) | 1884 (create-fontset-from-ascii-font font resolved-font fontset-name))) |
1896 (fontset-add-mac-fonts fontset t) | 1885 (fontset-add-mac-fonts fontset t) |
1897 fontset)) | 1886 fontset)) |
1898 | 1887 |
1888 ;; Adjust Courier font specifications in x-fixed-font-alist. | |
1889 (let ((courier-fonts (assoc "Courier" x-fixed-font-alist))) | |
1890 (if courier-fonts | |
1891 (dolist (label-fonts (cdr courier-fonts)) | |
1892 (setcdr label-fonts | |
1893 (mapcar | |
1894 (lambda (font) | |
1895 (if (string-match "\\`-adobe-courier-\\([^-]*\\)-\\(.\\)-\\(.*\\)-iso8859-1\\'" font) | |
1896 (replace-match | |
1897 (if (string= (match-string 2 font) "o") | |
1898 "-*-courier-\\1-i-\\3-*-*" | |
1899 "-*-courier-\\1-\\2-\\3-*-*") | |
1900 t nil font) | |
1901 font)) | |
1902 (cdr label-fonts)))))) | |
1903 | |
1899 ;; Setup the default fontset. | 1904 ;; Setup the default fontset. |
1900 (setup-default-fontset) | 1905 (setup-default-fontset) |
1901 (cond ((x-list-fonts "*-iso10646-1") | 1906 (cond ((x-list-fonts "*-iso10646-1") |
1902 ;; Use ATSUI (if available) for the following charsets. | 1907 ;; Use ATSUI (if available) for the following charsets. |
1903 (dolist | 1908 (dolist |
2005 | 2010 |
2006 | 2011 |
2007 ;; Enable CLIPBOARD copy/paste through menu bar commands. | 2012 ;; Enable CLIPBOARD copy/paste through menu bar commands. |
2008 (menu-bar-enable-clipboard) | 2013 (menu-bar-enable-clipboard) |
2009 | 2014 |
2015 (defconst mac-system-coding-system | |
2016 (let ((base (or (cdr (assq mac-system-script-code | |
2017 mac-script-code-coding-systems)) | |
2018 'mac-roman))) | |
2019 (if (eq system-type 'darwin) | |
2020 base | |
2021 (coding-system-change-eol-conversion base 'mac))) | |
2022 "Coding system derived from the system script code.") | |
2023 | |
2024 (set-selection-coding-system mac-system-coding-system) | |
2025 | |
2010 (defun mac-drag-n-drop (event) | 2026 (defun mac-drag-n-drop (event) |
2011 "Edit the files listed in the drag-n-drop EVENT. | 2027 "Edit the files listed in the drag-n-drop EVENT. |
2012 Switch to a buffer editing the last file dropped." | 2028 Switch to a buffer editing the last file dropped." |
2013 (interactive "e") | 2029 (interactive "e") |
2014 ;; Make sure the drop target has positive co-ords | 2030 ;; Make sure the drop target has positive co-ords |