From: tlp00@climb.as (Tibor Polgar)
Newsgroups: alt.lucid-emacs.help
Subject: Dired Goodies
Date: 12 Nov 92 03:50:48 GMT
Reply-To: tlp00@climb.as
Organization: Sun Microsystems

Since pop-up menus and mode motion are so great, here are some goodies to make them
more useful for dired.

-------------------------------------------------------------------------------------;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Nice dired hooks
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
					
(add-hook 'dired-mode-hook
             '(lambda ()
		 (require 'mode-motion)
		 (setq mode-motion-hook 'mode-motion-highlight-line)
		     (define-key dired-mode-map 'button2
		            '(lambda () (interactive)
		        	  (mouse-set-point last-command-event)
				  (dired-find-file)
		      ))
		     (define-key dired-mode-map 'button3 
		         '(lambda () (interactive)
		        	(mouse-set-point last-command-event)
				(setq zmacs-region-stays t)
				(popup-menu 'dired-popup)
		      ))
))


(defvar dired-popup
 '("Dired-Menu"
    ["Edit File/Directory" dired-find-file t]
    ["Edit Other Window" dired-find-file-other-window t]
    ["View File" dired-view-file t]
    ["Create Directory" dired-create-directory t]
    ["Copy" dired-do-copy t]
    ["Move File" dired-do-move t]
    ["Print File" dired-do-print t]
    "----"
    ["Mark Subdir Or File" dired-mark-subdir-or-file t]
    ["Flag File Deleted" dired-flag-file-deleted t]
    ["Flag Auto Save Files" dired-flag-auto-save-files t]
    ["Flag Backup Files" dired-flag-backup-files t]
    ["Unflag Backup" dired-backup-unflag t]
    ["Unflag All Files" dired-unflag-all-files t]
    ["Unflag Subdir Or File" dired-unmark-subdir-or-file t]
    "----"
    ["Undo last mark" dired-undo t]
    ["Delete Flaged Files" dired-do-deletions t]
    "----"
    ["Re-Read Directory" revert-buffer t]
    ["Toggle Dir sort name/date" dired-sort-toggle-or-edit t]
    ["Shell Command" dired-do-shell-command t]
    ["Up Directory" dired-up-directory t]
 ("File Management"
    ["Compress" dired-do-compress t]
    ["Chgrp" dired-do-chgrp t]
    ["Chmod" dired-do-chmod t]
    ["Chown" dired-do-chown t]
    ["Hardlink" dired-do-hardlink t]
    ["Symlink" dired-do-symlink t]
    ["Uncompress" dired-do-uncompress t]
    "----"
    ["Mark Directories" dired-mark-directories t]
    ["Mark Executables" dired-mark-executables t]
    ["Mark Subdir Or File" dired-mark-subdir-or-file t]
    ["Mark Symlinks" dired-mark-symlinks t]
    ["Unmark Subdir Or File" dired-unmark-subdir-or-file t]
    )
 ("Special"
    ["Byte Compile" dired-do-byte-compile t]
    ["Load Elisp File" dired-do-load t]
    ["Downcase Marked Filenames" dired-downcase t]
    ["Upcase Marked Filenames" dired-upcase t]
    ["Backup Diff" dired-backup-diff t]
    ["Diff" dired-diff t]
    )
 ("More 1" 
    ["Clean Directory" dired-clean-directory t]
    ["Kill" dired-do-kill t]
    ["Hide All" dired-hide-all t]
    ["Hide Subdir" dired-hide-subdir t]
    ["Kill Line Or Subdir" dired-kill-line-or-subdir t]
    ["Maybe Insert Subdir" dired-maybe-insert-subdir t]
    ["Next Dirline" dired-next-dirline t]
    ["Next Line" dired-next-line t]
    ["Next Marked File" dired-next-marked-file t]
    ["Next Subdir" dired-next-subdir t]
    ["Prev Dirline" dired-prev-dirline t]
    ["Prev Marked File" dired-prev-marked-file t]
    ["Prev Subdir" dired-prev-subdir t]
    ["Previous Line" dired-previous-line t]
    )
 ("More 2"    
    ["Quit" dired-quit t]
    ["Redisplay" dired-do-redisplay t]
    ["Summary" dired-summary t]
    ["Tree Down" dired-tree-down t]
    ["Tree Up" dired-tree-up t]
    ["Undo" dired-undo t]
    ["Why" dired-why t])
 ("% Prefix"    
    ["Copy Regexp" dired-do-copy-regexp t]
    ["Hardlink Regexp" dired-do-hardlink-regexp t]
    ["Rename Regexp" dired-do-rename-regexp t]
    ["Symlink Regexp" dired-do-symlink-regexp t]
    ["Flag Regexp Files" dired-flag-regexp-files t]
    ["Mark Files Regexp" dired-mark-files-regexp t])
))
x-gateway: rodan.UU.NET from help-lucid-emacs to alt.lucid-emacs.help; Fri, 6 Nov 1992 00:16:50 EST
Date: Thu, 5 Nov 1992 21:17:13 PST
X-Windows: Don't get frustrated without it.
From: jwz@lucid.com (Jamie Zawinski)
Subject: Re: GC idea
Newsgroups: alt.lucid-emacs.help