/[emacs]/emacs/lisp/menu-bar.el
ViewVC logotype

Diff of /emacs/lisp/menu-bar.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.223 by jas, Sun Jun 30 21:29:39 2002 UTC revision 1.224 by rms, Thu Aug 15 20:15:20 2002 UTC
# Line 352  A large number or nil slows down menu re Line 352  A large number or nil slows down menu re
352                :help "Find function/variables whose names match regexp"))                :help "Find function/variables whose names match regexp"))
353  (define-key menu-bar-goto-menu [next-tag-otherw]  (define-key menu-bar-goto-menu [next-tag-otherw]
354    '(menu-item "Next Tag in Other Window"    '(menu-item "Next Tag in Other Window"
355                (lambda () (interactive)  (find-tag-other-window nil t))                menu-bar-next-tag-other-window
356                :enable (and (boundp 'tags-location-ring)                :enable (and (boundp 'tags-location-ring)
357                             (not (ring-empty-p tags-location-ring)))                             (not (ring-empty-p tags-location-ring)))
358                :help "Find next function/variable matching last tag name in another window"))                :help "Find next function/variable matching last tag name in another window"))
359    
360    (defun menu-bar-next-tag-other-window ()
361      "Find the next definition of the tag already specified."
362      (interactive)
363      (find-tag-other-window nil t))
364    
365    (defun menu-bar-next-tag ()
366      "Find the next definition of the tag already specified."
367      (interactive)
368      (find-tag nil t))
369    
370  (define-key menu-bar-goto-menu [next-tag]  (define-key menu-bar-goto-menu [next-tag]
371    '(menu-item "Find Next Tag"    '(menu-item "Find Next Tag"
372                (lambda () (interactive) (find-tag nil t))                menu-bar-next-tag
373                :enable (and (boundp 'tags-location-ring)                :enable (and (boundp 'tags-location-ring)
374                             (not (ring-empty-p tags-location-ring)))                             (not (ring-empty-p tags-location-ring)))
375                :help "Find next function/variable matching last tag name"))                :help "Find next function/variable matching last tag name"))
# Line 631  Do the same for the keys of the same nam Line 642  Do the same for the keys of the same nam
642    (interactive)    (interactive)
643    (if (display-time-mode)    (if (display-time-mode)
644        (message "Display-time mode enabled.")        (message "Display-time mode enabled.")
645      (message "Display-time mode disabled.")))      (message "Display-time mode disabled."))
646      (customize-mark-as-set 'display-time-mode))
647    
648  (define-key menu-bar-showhide-menu [showhide-date-time]  (define-key menu-bar-showhide-menu [showhide-date-time]
649    '(menu-item "Date and Time" (lambda ()    '(menu-item "Date and Time" showhide-date-time
                                 (interactive)  
                                 (showhide-date-time)  
                                 (customize-mark-as-set 'display-time-mode))  
650                :help "Display date and time in the mode line"                :help "Display date and time in the mode line"
651                :button (:toggle . display-time-mode)))                :button (:toggle . display-time-mode)))
652    
# Line 666  Do the same for the keys of the same nam Line 675  Do the same for the keys of the same nam
675                :visible (display-graphic-p)))                :visible (display-graphic-p)))
676    
677  (defun menu-bar-showhide-fringe-menu-customize-reset ()  (defun menu-bar-showhide-fringe-menu-customize-reset ()
678    "Reset the default fringe mode."    "Reset the fringe mode: display fringes on both sides of a window."
679    (interactive)    (interactive)
680    (customize-set-variable 'fringe-mode nil))    (customize-set-variable 'fringe-mode nil))
681    
# Line 674  Do the same for the keys of the same nam Line 683  Do the same for the keys of the same nam
683    '(menu-item "Default" menu-bar-showhide-fringe-menu-customize-reset    '(menu-item "Default" menu-bar-showhide-fringe-menu-customize-reset
684                :help "Default width fringe on both left and right side"                :help "Default width fringe on both left and right side"
685                :visible (display-graphic-p)                :visible (display-graphic-p)
686                :button (:radio . (or (not (boundp 'fringe-mode))                :button (:radio . (eq fringe-mode nil))))
                                     (eq fringe-mode nil)))))  
687    
688  (defun menu-bar-showhide-fringe-menu-customize-left ()  (defun menu-bar-showhide-fringe-menu-customize-left ()
689    "Make fringes appear only on the left."    "Display fringes only on the left of each window."
690    (interactive)    (interactive)
691    (require 'fringe)    (require 'fringe)
692    (customize-set-variable 'fringe-mode '(nil . 0)))    (customize-set-variable 'fringe-mode '(nil . 0)))
# Line 687  Do the same for the keys of the same nam Line 695  Do the same for the keys of the same nam
695    '(menu-item "On the Left" menu-bar-showhide-fringe-menu-customize-left    '(menu-item "On the Left" menu-bar-showhide-fringe-menu-customize-left
696                :help "Fringe only on the left side"                :help "Fringe only on the left side"
697                :visible (display-graphic-p)                :visible (display-graphic-p)
698                :button (:radio . (and (boundp 'fringe-mode)                :button (:radio . (equal fringe-mode '(nil . 0)))))
                                      (equal fringe-mode '(nil . 0))))))  
699    
700  (defun menu-bar-showhide-fringe-menu-customize-right ()  (defun menu-bar-showhide-fringe-menu-customize-right ()
701    "Make fringes appear only on the right."    "Display fringes only on the right of each window."
702    (interactive)    (interactive)
703    (require 'fringe)    (require 'fringe)
704    (customize-set-variable 'fringe-mode '(0 . nil)))    (customize-set-variable 'fringe-mode '(0 . nil)))
# Line 700  Do the same for the keys of the same nam Line 707  Do the same for the keys of the same nam
707    '(menu-item "On the Right" menu-bar-showhide-fringe-menu-customize-right    '(menu-item "On the Right" menu-bar-showhide-fringe-menu-customize-right
708                :help "Fringe only on the right side"                :help "Fringe only on the right side"
709                :visible (display-graphic-p)                :visible (display-graphic-p)
710                :button (:radio . (and (boundp 'fringe-mode)                :button (:radio . (equal fringe-mode '(0 . nil)))))
                                      (equal fringe-mode '(0 . nil))))))  
711    
712  (defun menu-bar-showhide-fringe-menu-customize-disable ()  (defun menu-bar-showhide-fringe-menu-customize-disable ()
713    "Make fringes disappear."    "Do not display window fringes."
714    (interactive)    (interactive)
715    (require 'fringe)    (require 'fringe)
716    (customize-set-variable 'fringe-mode 0))    (customize-set-variable 'fringe-mode 0))
# Line 713  Do the same for the keys of the same nam Line 719  Do the same for the keys of the same nam
719    '(menu-item "None" menu-bar-showhide-fringe-menu-customize-disable    '(menu-item "None" menu-bar-showhide-fringe-menu-customize-disable
720                :help "Turn off fringe"                :help "Turn off fringe"
721                :visible (display-graphic-p)                :visible (display-graphic-p)
722                :button (:radio . (and (boundp 'fringe-mode)                :button (:radio . (eq fringe-mode 0))))
                                      (eq fringe-mode 0)))))  
723    
724  (define-key menu-bar-showhide-menu [showhide-fringe]  (define-key menu-bar-showhide-menu [showhide-fringe]
725    (list 'menu-item "Fringe" menu-bar-showhide-fringe-menu    (list 'menu-item "Fringe" menu-bar-showhide-fringe-menu
# Line 725  Do the same for the keys of the same nam Line 730  Do the same for the keys of the same nam
730    
731  (define-key menu-bar-showhide-scroll-bar-menu [right]  (define-key menu-bar-showhide-scroll-bar-menu [right]
732    '(menu-item "On the Right"    '(menu-item "On the Right"
733                (lambda ()                menu-bar-right-scroll-bar
                 (interactive)  
                 (customize-set-variable 'scroll-bar-mode 'right))  
734                :help "Scroll-bar on the right side"                :help "Scroll-bar on the right side"
735                :visible (display-graphic-p)                :visible (display-graphic-p)
736                :button (:radio . (eq (cdr (assq 'vertical-scroll-bars                :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
737                                                 (frame-parameters))) 'right))))                                                 (frame-parameters))) 'right))))
738    (defun menu-bar-right-scroll-bar ()
739      "Display scroll bars on the right of each window."
740      (interactive)
741      (customize-set-variable 'scroll-bar-mode 'right))
742    
743  (define-key menu-bar-showhide-scroll-bar-menu [left]  (define-key menu-bar-showhide-scroll-bar-menu [left]
744    '(menu-item "On the Left"    '(menu-item "On the Left"
745                (lambda ()                menu-bar-left-scroll-bar
                 (interactive)  
                 (customize-set-variable 'scroll-bar-mode 'left))  
746                :help "Scroll-bar on the left side"                :help "Scroll-bar on the left side"
747                :visible (display-graphic-p)                :visible (display-graphic-p)
748                :button (:radio . (eq (cdr (assq 'vertical-scroll-bars                :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
749                                                 (frame-parameters))) 'left))))                                                 (frame-parameters))) 'left))))
750    
751    (defun menu-bar-left-scroll-bar ()
752      "Display scroll bars on the left of each window."
753      (interactive)
754      (customize-set-variable 'scroll-bar-mode 'right))
755    
756  (define-key menu-bar-showhide-scroll-bar-menu [none]  (define-key menu-bar-showhide-scroll-bar-menu [none]
757    '(menu-item "None"    '(menu-item "None"
758                (lambda ()                menu-bar-no-scroll-bar
                 (interactive)  
                 (customize-set-variable 'scroll-bar-mode nil))  
759                :help "Turn off scroll-bar"                :help "Turn off scroll-bar"
760                :visible (display-graphic-p)                :visible (display-graphic-p)
761                :button (:radio . (eq (cdr (assq 'vertical-scroll-bars                :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
762                                                 (frame-parameters))) nil))))                                                 (frame-parameters))) nil))))
763    
764    (defun menu-bar-no-scroll-bar ()
765      "Turn off scroll bars."
766      (interactive)
767      (customize-set-variable 'scroll-bar-mode nil))
768    
769  (define-key menu-bar-showhide-menu [showhide-scroll-bar]  (define-key menu-bar-showhide-menu [showhide-scroll-bar]
770    (list 'menu-item "Scroll-bar" menu-bar-showhide-scroll-bar-menu    (list 'menu-item "Scroll-bar" menu-bar-showhide-scroll-bar-menu
771          :visible `(display-graphic-p)          :visible `(display-graphic-p)
# Line 822  Do the same for the keys of the same nam Line 835  Do the same for the keys of the same nam
835    '("--"))    '("--"))
836  (define-key menu-bar-options-menu [toggle-auto-compression]  (define-key menu-bar-options-menu [toggle-auto-compression]
837    '(menu-item "Automatic File De/compression"    '(menu-item "Automatic File De/compression"
838                (lambda ()                menu-bar-toggle-auto-compression-mode
                 (interactive)  
                 (auto-compression-mode)  
                 (customize-mark-as-set 'auto-compression-mode))  
839                :help "Transparently decompress compressed files"                :help "Transparently decompress compressed files"
840                :button (:toggle . (rassq 'jka-compr-handler                :button (:toggle . (rassq 'jka-compr-handler
841                                          file-name-handler-alist))))                                          file-name-handler-alist))))
842    
843    (defun menu-bar-toggle-auto-compression ()
844      "Toggle automatic file compression and uncompression.
845    With prefix argument ARG, turn auto compression on if positive, else off.
846    Returns the new status of auto compression (non-nil means on)."
847      (interactive)
848      (auto-compression-mode)
849      (customize-mark-as-set 'auto-compression-mode))
850    
851  (define-key menu-bar-options-menu [save-place]  (define-key menu-bar-options-menu [save-place]
852    (menu-bar-make-toggle toggle-save-place-globally save-place    (menu-bar-make-toggle toggle-save-place-globally save-place
853                          "Save Place in Files between Sessions"                          "Save Place in Files between Sessions"
# Line 850  Do the same for the keys of the same nam Line 869  Do the same for the keys of the same nam
869    '("--"))    '("--"))
870  (define-key menu-bar-options-menu [cua-mode]  (define-key menu-bar-options-menu [cua-mode]
871    '(menu-item "CUA-style cut and paste"    '(menu-item "CUA-style cut and paste"
872                (lambda ()                menu-bar-toggle-cua-mode
                 (interactive)  
                 (cua-mode nil)  
                 (customize-mark-as-set 'cua-mode)  
                 (message "CUA-style cut and paste %s"  
                          (if cua-mode "enabled" "disabled")))  
873                :help "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste"                :help "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste"
874                :button (:toggle . cua-mode)))                :button (:toggle . cua-mode)))
875    
876    (defun menu-bar-toggle-cua-mode ()
877      "Toggle CUA key-binding mode.
878    When enabled, using shifted movement keys will activate the region (and
879    highlight the region using `transient-mark-mode'), and typed text replaces
880    the active selection.  C-z, C-x, C-c, and C-v will undo, cut, copy, and
881    paste (in addition to the normal Emacs bindings)."
882      (interactive)
883      (cua-mode nil)
884      (customize-mark-as-set 'cua-mode)
885      (message "CUA-style cut and paste %s"
886               (if cua-mode "enabled" "disabled")))
887    
888  (define-key menu-bar-options-menu [case-fold-search]  (define-key menu-bar-options-menu [case-fold-search]
889    (menu-bar-make-toggle toggle-case-fold-search case-fold-search    (menu-bar-make-toggle toggle-case-fold-search case-fold-search
890                          "Case-Insensitive Search"                          "Case-Insensitive Search"
891                          "Case-Insensitive Search %s"                          "Case-Insensitive Search %s"
892                          "Ignore letter-case in search"))                          "Ignore letter-case in search"))
893    
894    (defun menu-bar-text-mode-auto-fill ()
895      (interactive)
896      (toggle-text-mode-auto-fill)
897      ;; This is somewhat questionable, as `text-mode-hook'
898      ;; might have changed outside customize.
899      ;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2002-02-11.
900      (customize-mark-as-set 'text-mode-hook))
901    
902  (define-key menu-bar-options-menu [auto-fill-mode]  (define-key menu-bar-options-menu [auto-fill-mode]
903    '(menu-item "Word Wrap in Text Modes"    '(menu-item "Word Wrap in Text Modes"
904                (lambda ()                menu-bar-text-mode-auto-fill
                 (interactive)  
                 (toggle-text-mode-auto-fill)  
                 ;; This is somewhat questionable, as `text-mode-hook'  
                 ;; might have changed outside customize.  
                 ;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2002-02-11.  
                 (customize-mark-as-set 'text-mode-hook))  
905                :help "Automatically fill text between left and right margins (Auto Fill)"                :help "Automatically fill text between left and right margins (Auto Fill)"
906                :button (:toggle . (if (listp text-mode-hook)                :button (:toggle . (if (listp text-mode-hook)
907                                       (member 'turn-on-auto-fill text-mode-hook)                                       (member 'turn-on-auto-fill text-mode-hook)
908                                     (eq 'turn-on-auto-fill text-mode-hook)))))                                     (eq 'turn-on-auto-fill text-mode-hook)))))
909  (define-key menu-bar-options-menu [truncate-lines]  (define-key menu-bar-options-menu [truncate-lines]
910    '(menu-item "Truncate Long Lines in this Buffer"    '(menu-item "Truncate Long Lines in this Buffer"
911                (lambda ()                toggle-truncate-lines
                 (interactive)  
                 (setq truncate-lines (not truncate-lines))  
                 (set-buffer-modified-p (buffer-modified-p))  
                 (message "Truncate long lines %s"  
                          (if truncate-lines "enabled" "disabled")))  
912                :help "Truncate long lines on the screen"                :help "Truncate long lines on the screen"
913                :button (:toggle . truncate-lines)))                :button (:toggle . truncate-lines)))
914    
# Line 996  Do the same for the keys of the same nam Line 1021  Do the same for the keys of the same nam
1021  (define-key menu-bar-tools-menu [rmail]  (define-key menu-bar-tools-menu [rmail]
1022    (list    (list
1023     'menu-item `(format "Read Mail (with %s)" (read-mail-item-name))     'menu-item `(format "Read Mail (with %s)" (read-mail-item-name))
1024     (lambda ()     'menu-bar-read-mail
      (interactive)  
      (call-interactively read-mail-command))  
1025     :visible `(and read-mail-command (not (eq read-mail-command 'ignore)))     :visible `(and read-mail-command (not (eq read-mail-command 'ignore)))
1026     :help "Read your mail and reply to it"))     :help "Read your mail and reply to it"))
1027    
1028    (defun menu-bar-read-mail ()
1029      "Read manu using `read-mail-command'."
1030      (interactive)
1031      (call-interactively read-mail-command))
1032    
1033  (define-key menu-bar-tools-menu [gnus]  (define-key menu-bar-tools-menu [gnus]
1034    '(menu-item "Read Net News (Gnus)" gnus    '(menu-item "Read Net News (Gnus)" gnus
1035                :help "Read network news groups"))                :help "Read network news groups"))
# Line 1121  key (or menu-item)")) Line 1150  key (or menu-item)"))
1150    (interactive)    (interactive)
1151    (info "eintr"))    (info "eintr"))
1152    
 (defun menu-bar-read-emacs-man ()  
   "Display Emacs User Manual in Info mode."  
   (interactive)  
   (info "emacs"))  
   
1153  (defun search-emacs-glossary ()  (defun search-emacs-glossary ()
1154    "Display the Glossary node of the Emacs manual in Info mode."    "Display the Glossary node of the Emacs manual in Info mode."
1155    (interactive)    (interactive)
# Line 1215  key (or menu-item)")) Line 1239  key (or menu-item)"))
1239                :help "How to get latest versions of Emacs"))                :help "How to get latest versions of Emacs"))
1240  (define-key menu-bar-help-menu [more]  (define-key menu-bar-help-menu [more]
1241    '(menu-item "Find Extra Packages"    '(menu-item "Find Extra Packages"
1242                (lambda ()                menu-bar-help-extra-packages
                 (interactive)  
                 (let (enable-local-variables)  
                   (view-file (expand-file-name "MORE.STUFF"  
                                                data-directory))  
                   (goto-address)))  
1243                :help "Where to find some extra packages and possible updates"))                :help "Where to find some extra packages and possible updates"))
1244    (defun menu-bar-help-extra-packages ()
1245      "Display help about some additional packages available for Emacs."
1246      (interactive)
1247      (let (enable-local-variables)
1248        (view-file (expand-file-name "MORE.STUFF"
1249                                     data-directory))
1250        (goto-address)))
1251  (define-key menu-bar-help-menu [about]  (define-key menu-bar-help-menu [about]
1252    '(menu-item "About Emacs" display-splash-screen    '(menu-item "About Emacs" display-splash-screen
1253                :help "Display version number, copyright info, and basic help"))                :help "Display version number, copyright info, and basic help"))
# Line 1234  key (or menu-item)")) Line 1260  key (or menu-item)"))
1260    (list 'menu-item "More Manuals" menu-bar-manuals-menu    (list 'menu-item "More Manuals" menu-bar-manuals-menu
1261          :help "Search and browse on-line manuals"))          :help "Search and browse on-line manuals"))
1262  (define-key menu-bar-help-menu [emacs-manual]  (define-key menu-bar-help-menu [emacs-manual]
1263    '(menu-item "Read the Emacs Manual" menu-bar-read-emacs-man    '(menu-item "Read the Emacs Manual" info-emacs-manual
1264                :help "Full documentation of Emacs features"))                :help "Full documentation of Emacs features"))
1265  (define-key menu-bar-help-menu [describe]  (define-key menu-bar-help-menu [describe]
1266    (list 'menu-item "Describe" menu-bar-describe-menu    (list 'menu-item "Describe" menu-bar-describe-menu
# Line 1254  key (or menu-item)")) Line 1280  key (or menu-item)"))
1280                :help "New features of this version"))                :help "New features of this version"))
1281  (define-key menu-bar-help-menu [emacs-faq]  (define-key menu-bar-help-menu [emacs-faq]
1282    '(menu-item "Emacs FAQ" view-emacs-FAQ))    '(menu-item "Emacs FAQ" view-emacs-FAQ))
1283    
1284    (defun help-with-tutorial-spec-language ()
1285      "Use the Emacs tutorial, specifying which language you want."
1286      (interactive)
1287      (help-with-tutorial t))
1288    
1289  (define-key menu-bar-help-menu [emacs-tutorial-language-specific]  (define-key menu-bar-help-menu [emacs-tutorial-language-specific]
1290    '(menu-item "Emacs Tutorial (choose language)..."    '(menu-item "Emacs Tutorial (choose language)..."
1291                (lambda () (interactive) (help-with-tutorial t))                help-with-tutorial-spec-language
1292                :help "Learn how to use Emacs (choose a language)"))                :help "Learn how to use Emacs (choose a language)"))
1293  (define-key menu-bar-help-menu [emacs-tutorial]  (define-key menu-bar-help-menu [emacs-tutorial]
1294    '(menu-item "Emacs Tutorial" help-with-tutorial    '(menu-item "Emacs Tutorial" help-with-tutorial

Legend:
Removed from v.1.223  
changed lines
  Added in v.1.224

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26