comparison lisp/dired-x.el @ 8713:fad4e60c964d

(dired-omit-expunge): Avoid setting buffer modified unless it was modified before and some mark is set so `%*' won't appear in mode-line of omitted buffers.
author Richard M. Stallman <rms@gnu.org>
date Tue, 06 Sep 1994 06:56:47 +0000
parents 1dd92ac02141
children d85424a6fb85
comparison
equal deleted inserted replaced
8712:9bc99cd7a6ee 8713:fad4e60c964d
1 ;;; dired-x.el --- Sebastian Kremer's Extra DIRED hacked up for GNU Emacs19 1 ;;; dired-x.el --- Sebastian Kremer's Extra DIRED hacked up for GNU Emacs19
2 2
3 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de> 3 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
4 ;; Lawrence R. Dodd <dodd@roebling.poly.edu> 4 ;; Lawrence R. Dodd <dodd@roebling.poly.edu>
5 ;; Maintainer: Lawrence R. Dodd <dodd@roebling.poly.edu> 5 ;; Maintainer: Lawrence R. Dodd <dodd@roebling.poly.edu>
6 ;; Version: 2.37 6 ;; Version: 2.37+
7 ;; Date: 1994/06/28 15:53:34 7 ;; Date: 1994/08/18 19:27:42
8 ;; Keywords: dired extensions 8 ;; Keywords: dired extensions
9 9
10 ;; Copyright (C) 1993, 1994 Free Software Foundation 10 ;; Copyright (C) 1993, 1994 Free Software Foundation
11 11
12 ;; This file is part of GNU Emacs. 12 ;; This file is part of GNU Emacs.
573 This functions works by temporarily binding `dired-marker-char' to 573 This functions works by temporarily binding `dired-marker-char' to
574 `dired-omit-marker-char' and calling `dired-do-kill-lines'." 574 `dired-omit-marker-char' and calling `dired-do-kill-lines'."
575 (interactive "sOmit files (regexp): ") 575 (interactive "sOmit files (regexp): ")
576 (if dired-omit-files-p 576 (if dired-omit-files-p
577 (let ((omit-re (or regexp (dired-omit-regexp))) 577 (let ((omit-re (or regexp (dired-omit-regexp)))
578 (old-modified-p (buffer-modified-p))
578 count) 579 count)
579 (or (string= omit-re "") 580 (or (string= omit-re "")
580 (let ((dired-marker-char dired-omit-marker-char)) 581 (let ((dired-marker-char dired-omit-marker-char))
581 (message "Omitting...") 582 (message "Omitting...")
582 (if (dired-mark-unmarked-files omit-re nil nil dired-omit-localp) 583 (if (dired-mark-unmarked-files omit-re nil nil dired-omit-localp)
583 (progn 584 (progn
584 (setq count (dired-do-kill-lines nil "Omitted %d line%s.")) 585 (setq count (dired-do-kill-lines nil "Omitted %d line%s."))
585 ;; Force an update of modeline. 586 ;; Force an update of modeline.
586 (set-buffer-modified-p (buffer-modified-p))) 587 (set-buffer-modified-p (buffer-modified-p)))
587 (message "(Nothing to omit)")))) 588 (message "(Nothing to omit)"))))
589 ;; Try to preserve modified state of buffer. So `%*' doesn't appear
590 ;; in mode-line of omitted buffers.
591 (set-buffer-modified-p (and old-modified-p
592 (save-excursion
593 (goto-char (point-min))
594 (re-search-forward dired-re-mark nil t))))
588 count))) 595 count)))
589 596
590 (defun dired-omit-regexp () 597 (defun dired-omit-regexp ()
591 (concat (if dired-omit-files (concat "\\(" dired-omit-files "\\)") "") 598 (concat (if dired-omit-files (concat "\\(" dired-omit-files "\\)") "")
592 (if (and dired-omit-files dired-omit-extensions) "\\|" "") 599 (if (and dired-omit-files dired-omit-extensions) "\\|" "")
1298 "Run man on this file. Display old buffer if buffer name matches filename. 1305 "Run man on this file. Display old buffer if buffer name matches filename.
1299 Uses ../lisp/man.el of \\[manual-entry] fame." 1306 Uses ../lisp/man.el of \\[manual-entry] fame."
1300 (interactive) 1307 (interactive)
1301 (require 'man) 1308 (require 'man)
1302 (let ((file (dired-get-filename)) 1309 (let ((file (dired-get-filename))
1303 (manual-program "nroff -man -h")) 1310 (manual-program "nroff -man -h"))
1304 (Man-getpage-in-background file))) 1311 (Man-getpage-in-background file)))
1305 1312
1306 ;;; Run Info on files. 1313 ;;; Run Info on files.
1307 1314
1308 (defun dired-info () 1315 (defun dired-info ()