.emacs-my
changeset 469 a9adec4fbcbf
parent 468 925f1b143a3d
child 470 f859726fcca9
equal deleted inserted replaced
468:925f1b143a3d 469:a9adec4fbcbf
   492 
   492 
   493 (when (>= emacs-major-version 22)
   493 (when (>= emacs-major-version 22)
   494   ;; Enable 'a' command.
   494   ;; Enable 'a' command.
   495   (put 'dired-find-alternate-file 'disabled nil)
   495   (put 'dired-find-alternate-file 'disabled nil)
   496   )
   496   )
       
   497 
       
   498 (defun my-file-name-tmp-p (file)
       
   499   (string-match "\\(^#.*#\\|~\\|\\.orig\\|\\.log\\)\\'" (file-name-nondirectory file)))
       
   500 
       
   501 (defun my-dired-flag-tmp-files ()
       
   502   "Flag all temporary files for deletion."
       
   503   (interactive)
       
   504   (dired-mark-if
       
   505    ;; (let ( (fn (dired-get-filename)) )
       
   506    ;;   (if fn (backup-file-name-p fn)))
       
   507    (let ( (fn (dired-get-filename 'verbatim t)) )
       
   508      (and fn (my-file-name-tmp-p fn)) )
       
   509    "backup file"
       
   510    )
       
   511   )
       
   512 
       
   513 (define-key dired-mode-map (kbd "`") 'my-dired-flag-tmp-files)
   497 
   514 
   498 ;;; ----------------------------------------------------------------
   515 ;;; ----------------------------------------------------------------
   499 ;;; ls-lisp, dired ls.
   516 ;;; ls-lisp, dired ls.
   500 
   517 
   501 ;; If non-nil - use 'insert-directory-program', which I dislike.
   518 ;; If non-nil - use 'insert-directory-program', which I dislike.