comparison lisp/menu-bar.el @ 91204:53108e6cea98

Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-294
author Miles Bader <miles@gnu.org>
date Thu, 06 Dec 2007 09:51:45 +0000
parents 4bc33ffdda1a b59436080a4c
children 56a72e2bd635
comparison
equal deleted inserted replaced
91203:db40129142b2 91204:53108e6cea98
502 (kill-ring-save beg end))) 502 (kill-ring-save beg end)))
503 503
504 ;; These are alternative definitions for the cut, paste and copy 504 ;; These are alternative definitions for the cut, paste and copy
505 ;; menu items. Use them if your system expects these to use the clipboard. 505 ;; menu items. Use them if your system expects these to use the clipboard.
506 506
507 (put 'clipboard-kill-region 'menu-enable 'mark-active) 507 (put 'clipboard-kill-region 'menu-enable
508 '(and mark-active (not buffer-read-only)))
508 (put 'clipboard-kill-ring-save 'menu-enable 'mark-active) 509 (put 'clipboard-kill-ring-save 'menu-enable 'mark-active)
509 (put 'clipboard-yank 'menu-enable 510 (put 'clipboard-yank 'menu-enable
510 '(or (and (fboundp 'x-selection-exists-p) (x-selection-exists-p)) 511 '(and (or (and (fboundp 'x-selection-exists-p)
511 (x-selection-exists-p 'CLIPBOARD))) 512 (x-selection-exists-p))
513 (x-selection-exists-p 'CLIPBOARD))
514 (not buffer-read-only)))
512 515
513 (defun clipboard-yank () 516 (defun clipboard-yank ()
514 "Insert the clipboard contents, or the last stretch of killed text." 517 "Insert the clipboard contents, or the last stretch of killed text."
515 (interactive "*") 518 (interactive "*")
516 (let ((x-select-enable-clipboard t)) 519 (let ((x-select-enable-clipboard t))
1338 :help "Read the Emacs Lisp Reference manual")) 1341 :help "Read the Emacs Lisp Reference manual"))
1339 (define-key menu-bar-manuals-menu [emac-lisp-intro] 1342 (define-key menu-bar-manuals-menu [emac-lisp-intro]
1340 '(menu-item "Introduction to Emacs Lisp" menu-bar-read-lispintro 1343 '(menu-item "Introduction to Emacs Lisp" menu-bar-read-lispintro
1341 :help "Read the Introduction to Emacs Lisp Programming")) 1344 :help "Read the Introduction to Emacs Lisp Programming"))
1342 1345
1343 (define-key menu-bar-help-menu [describe-project] 1346 (define-key menu-bar-help-menu [about-gnu-project]
1344 '(menu-item "About GNU" describe-project 1347 '(menu-item "About GNU" describe-project
1345 :help "About the GNU System, GNU Project, and GNU/Linux")) 1348 :help "About the GNU System, GNU Project, and GNU/Linux"))
1346 (define-key menu-bar-help-menu [about] 1349 (define-key menu-bar-help-menu [about-emacs]
1347 '(menu-item "About Emacs" about-emacs 1350 '(menu-item "About Emacs" about-emacs
1348 :help "Display version number, copyright info, and basic help")) 1351 :help "Display version number, copyright info, and basic help"))
1349 (define-key menu-bar-help-menu [sep4] 1352 (define-key menu-bar-help-menu [sep4]
1350 '("--")) 1353 '("--"))
1351 (define-key menu-bar-help-menu [describe-no-warranty] 1354 (define-key menu-bar-help-menu [describe-no-warranty]
1352 '(menu-item "(Non)Warranty" describe-no-warranty 1355 '(menu-item "(Non)Warranty" describe-no-warranty
1353 :help "Explain that Emacs has NO WARRANTY")) 1356 :help "Explain that Emacs has NO WARRANTY"))
1354 (define-key menu-bar-help-menu [describe-copying] 1357 (define-key menu-bar-help-menu [describe-copying]
1355 '(menu-item "Copying Conditions" describe-copying 1358 '(menu-item "Copying Conditions" describe-copying
1356 :help "Show the Emacs license (GPL)")) 1359 :help "Show the Emacs license (GPL)"))
1357 (define-key menu-bar-help-menu [describe-distribution] 1360 (define-key menu-bar-help-menu [getting-new-versions]
1358 '(menu-item "Getting New Versions" describe-distribution 1361 '(menu-item "Getting New Versions" describe-distribution
1359 :help "How to get latest versions of Emacs")) 1362 :help "How to get latest versions of Emacs"))
1360 (defun menu-bar-help-extra-packages () 1363 (defun menu-bar-help-extra-packages ()
1361 "Display help about some additional packages available for Emacs." 1364 "Display help about some additional packages available for Emacs."
1362 (interactive) 1365 (interactive)
1364 (view-file (expand-file-name "MORE.STUFF" 1367 (view-file (expand-file-name "MORE.STUFF"
1365 data-directory)) 1368 data-directory))
1366 (goto-address))) 1369 (goto-address)))
1367 (define-key menu-bar-help-menu [sep2] 1370 (define-key menu-bar-help-menu [sep2]
1368 '("--")) 1371 '("--"))
1369 (define-key menu-bar-help-menu [more] 1372 (define-key menu-bar-help-menu [external-packages]
1370 '(menu-item "External Packages" menu-bar-help-extra-packages 1373 '(menu-item "External Packages" menu-bar-help-extra-packages
1371 :help "Lisp packages distributed separately for use in Emacs")) 1374 :help "Lisp packages distributed separately for use in Emacs"))
1372 (define-key menu-bar-help-menu [finder-by-keyword] 1375 (define-key menu-bar-help-menu [find-emacs-packages]
1373 '(menu-item "Find Emacs Packages" finder-by-keyword 1376 '(menu-item "Find Emacs Packages" finder-by-keyword
1374 :help "Find packages and features by keyword")) 1377 :help "Find packages and features by keyword"))
1375 (define-key menu-bar-help-menu [more-manuals] 1378 (define-key menu-bar-help-menu [more-manuals]
1376 (list 'menu-item "More Manuals" menu-bar-manuals-menu)) 1379 (list 'menu-item "More Manuals" menu-bar-manuals-menu))
1377 (define-key menu-bar-help-menu [emacs-manual] 1380 (define-key menu-bar-help-menu [emacs-manual]
1381 (list 'menu-item "Describe" menu-bar-describe-menu)) 1384 (list 'menu-item "Describe" menu-bar-describe-menu))
1382 (define-key menu-bar-help-menu [search-documentation] 1385 (define-key menu-bar-help-menu [search-documentation]
1383 (list 'menu-item "Search Documentation" menu-bar-search-documentation-menu)) 1386 (list 'menu-item "Search Documentation" menu-bar-search-documentation-menu))
1384 (define-key menu-bar-help-menu [sep1] 1387 (define-key menu-bar-help-menu [sep1]
1385 '("--")) 1388 '("--"))
1386 (define-key menu-bar-help-menu [eliza] 1389 (define-key menu-bar-help-menu [emacs-psychotherapist]
1387 '(menu-item "Emacs Psychotherapist" doctor 1390 '(menu-item "Emacs Psychotherapist" doctor
1388 :help "Our doctor will help you feel better")) 1391 :help "Our doctor will help you feel better"))
1389 (define-key menu-bar-help-menu [report-emacs-bug] 1392 (define-key menu-bar-help-menu [send-emacs-bug-report]
1390 '(menu-item "Send Bug Report..." report-emacs-bug 1393 '(menu-item "Send Bug Report..." report-emacs-bug
1391 :help "Send e-mail to Emacs maintainers")) 1394 :help "Send e-mail to Emacs maintainers"))
1392 (define-key menu-bar-help-menu [emacs-known-problems] 1395 (define-key menu-bar-help-menu [emacs-known-problems]
1393 '(menu-item "Emacs Known Problems" view-emacs-problems 1396 '(menu-item "Emacs Known Problems" view-emacs-problems
1394 :help "Read about known problems with Emacs")) 1397 :help "Read about known problems with Emacs"))
1770 (interactive (list (or current-prefix-arg 'toggle))) 1773 (interactive (list (or current-prefix-arg 'toggle)))
1771 (if (eq arg 'toggle) 1774 (if (eq arg 'toggle)
1772 (menu-bar-mode (if (> (frame-parameter nil 'menu-bar-lines) 0) 0 1)) 1775 (menu-bar-mode (if (> (frame-parameter nil 'menu-bar-lines) 0) 0 1))
1773 (menu-bar-mode arg))) 1776 (menu-bar-mode arg)))
1774 1777
1778 (declare-function x-menu-bar-open "term/x-win" (&optional frame))
1779
1775 (defun menu-bar-open (&optional frame) 1780 (defun menu-bar-open (&optional frame)
1776 "Start key navigation of the menu bar in FRAME. 1781 "Start key navigation of the menu bar in FRAME.
1777 1782
1778 This function decides which method to use to access the menu 1783 This function decides which method to use to access the menu
1779 depending on FRAME's terminal device. On X displays, it calls 1784 depending on FRAME's terminal device. On X displays, it calls