+2001-01-24 Sam Steingold <sds@gnu.org>
+
+ * dired.el (dired-replace-in-string): Removed.
+ (dired-sort-toggle): Use `replace-regexps-in-string'
+ instead of `dired-replace-in-string'.
+ * dired-aux.el (dired-shell-stuff-it, dired-rename-subdir,
+ dired-rename-subdir-2, dired-insert-subdir-doinsert): Ditto.
+ * gs.el (gs-replace-in-string): Removed.
+ (gs-options): Use `replace-regexps-in-string'
+ instead of `gs-replace-in-string'.
+
2001-01-24 Eli Zaretskii <eliz@is.elta.co.il>
* mail/emacsbug.el (report-emacs-bug): Mention the fact that the
the tool-bar.
* frame.el (frame-initialize): Create the initial frame invisible.
-
+
2001-01-24 ShengHuo ZHU <zsh@cs.rochester.edu>
* language/chinese.el (chinese-iso-8bit): MIME:GB2312.
2001-01-24 Gerd Moellmann <gerd@gnu.org>
- * international/mule-cmds.el (universal-coding-system-argument):
+ * international/mule-cmds.el (universal-coding-system-argument):
Handle commands with prefix args.
2001-01-24 Edward M. Reingold <reingold@emr.cs.uiuc.edu>
* textmodes/texinfo.el (texinfo-mode): Use backward-paragraph
as font-lock-beginning-of-syntax-function in font-lock-defaults.
- * jit-lock.el (jit-lock-fontify-now): Don't bind
+ * jit-lock.el (jit-lock-fontify-now): Don't bind
font-lock-beginning-of-syntax-function to nil.
2001-01-19 Eli Zaretskii <eliz@is.elta.co.il>
* font-lock.el (font-lock-default-fontify-region): Fix last
change.
-
+
* font-lock.el (font-lock-multiline): Default to nil.
(font-lock-default-fontify-region): If font-lock-multiline is
nil, don't check the property `font-lock-multiline'.
2001-01-19 Michael Kifer <kifer@cs.sunysb.edu>
* viper.el: Call initial-major-mode on startup.
-
+
* ediff.el (ediff-patch-file): Use better defaults.
-
+
* ediff-vers.el: Fix for 8+3 DOS file systems.
-
+
2001-01-19 Colin Walters <walters@cis.ohio-state.edu>
-
+
* ediff-util.el (ediff-compare-custom-diffs-maybe): Put diff in
diff mode, if available.
-
+
2001-01-19 Michael Kifer <kifer@cs.sunysb.edu>
-
+
* ediff-hook.el (ediff-xemacs-init-menus): Fixed add-menu-button.
-
+
* ediff-init.el (subst-char-in-string): Define and use it, unless
it's already defined.
-
+
2001-01-18 Gerd Moellmann <gerd@gnu.org>
* tooltip.el (tooltip-hide-delay): New user-option.
(setq failures
(dired-bunch-files 10000
(function dired-check-process)
- (append
+ (append
(list operation program new-attribute)
(if (string-match "gnu" system-configuration)
'("--") nil))
nil op-symbol files
(function read-string)
(format prompt (dired-mark-prompt arg files)) initial))
-\f
+
;;; Cleaning a directory: flagging some backups for deletion.
(defvar dired-file-version-alist)
(progn (beginning-of-line)
(delete-char 1)
(insert dired-del-marker)))))
-\f
+
;;; Shell commands
(defun dired-read-shell-command (prompt arg files)
;; your cmd.
(let ((stuff-it
(cond ((string-match "\\*" command)
- (function (lambda (x)
- (dired-replace-in-string "\\*" x command))))
+ (lambda (x) (replace-regexp-in-string "\\*" x command)))
((string-match "\\?" command)
- (function (lambda (x)
- (dired-replace-in-string "\\?" x command))))
- (t (function (lambda (x) (concat command " " x)))))))
+ (lambda (x) (replace-regexp-in-string "\\?" x command)))
+ (t (lambda (x) (concat command " " x))))))
(if on-each
(mapconcat stuff-it (mapcar 'shell-quote-argument file-list) ";")
(let ((fns (mapconcat 'shell-quote-argument
(shell-command command)))
;; Return nil for sake of nconc in dired-bunch-files.
nil)
-\f
+
;; In Emacs 19 this will return program's exit status.
;; This is a separate function so that ange-ftp can redefine it.
(defun dired-call-process (program discard &rest arguments)
(kill-buffer err-buffer)
(message "%s...done" msg)
nil))))
-\f
+
;; Commands that delete or redisplay part of the dired buffer.
(defun dired-kill-line (&optional arg)
count))))
;;;###end dired-cmd.el
-\f
+
;;; 30K
;;;###begin dired-cp.el
(setq suffix (car suffixes) suffixes nil))
(setq suffixes (cdr suffixes))))
;; If so, compute desired new name.
- (if suffix
+ (if suffix
(setq newname (concat (substring file 0 (match-beginning 0))
(nth 1 suffix))))
(cond (handler
"compress" "-f" file))
;; Don't use NEWNAME with `compress'.
(concat file ".Z"))))))))
-\f
+
(defun dired-mark-confirm (op-symbol arg)
;; Request confirmation from the user that the operation described
;; by OP-SYMBOL is to be performed on the marked files.
(apply 'message qprompt qs-args)
(setq char (set qs-var (read-char))))
(memq (cdr elt) '(t y yes)))))))
-\f
+
;;;###autoload
(defun dired-do-compress (&optional arg)
"Compress or uncompress marked (or next ARG) files."
arg)
(dired-move-to-filename)
(message "Redisplaying...done")))
-\f
+
(defun dired-update-file-line (file)
;; Delete the current line, and insert an entry for FILE.
;; If FILE is nil, then just delete the current line.
;; It inserts the file's absolute name, rather than
;; the relative one. That may be hard to fix since it
;; is probably controlled by something in ftp.
- (goto-char opoint)
+ (goto-char opoint)
(let ((inserted-name (dired-get-filename 'verbatim)))
(if (file-name-directory inserted-name)
(progn
(save-excursion (forward-line 1) (point))))
(setq file (directory-file-name file))
(dired-add-entry file (if (eq ?\040 marker) nil marker)))))
-\f
+
;;; Copy, move/rename, making hard and symbolic links
(defcustom dired-recursive-copies nil
(if (and buffer-file-name
(dired-in-this-tree buffer-file-name expanded-from-dir))
(let ((modflag (buffer-modified-p))
- (to-file (dired-replace-in-string
+ (to-file (replace-regexp-in-string
(concat "^" (regexp-quote from-dir))
to-dir
buffer-file-name)))
;; Update buffer-local dired-subdir-alist
(setcar elt
(dired-normalize-subdir
- (dired-replace-in-string regexp newtext (car elt)))))))
-\f
+ (replace-regexp-in-string regexp newtext (car elt)))))))
+
;; The basic function for half a dozen variations on cp/mv/ln/ln -s.
(defun dired-create-files (file-creator operation fn-list name-constructor
&optional marker-char)
(message "%s: %s file%s"
operation success-count (dired-plural-s success-count)))))
(dired-move-to-filename))
-\f
+
(defun dired-do-create-files (op-symbol file-creator operation arg
&optional marker-char op1
how-to)
(dired-current-directory)))))
(or other-dir this-dir))
this-dir)))
-\f
+
;;;###autoload
(defun dired-create-directory (directory)
"Create a directory called DIRECTORY."
(dired-do-create-files 'move (function dired-rename-file)
"Move" arg dired-keep-marker-rename "Rename"))
;;;###end dired-cp.el
-\f
+
;;; 5K
;;;###begin dired-re.el
(defun dired-do-create-files-regexp
(dired-rename-non-directory (function downcase) "Rename downcase" arg))
;;;###end dired-re.el
-\f
+
;;; 13K
;;;###begin dired-ins.el
(message "Reading directory %s..." dirname)
(let ((dired-actual-switches
(or switches
- (dired-replace-in-string "R" "" dired-actual-switches))))
+ (replace-regexp-in-string "R" "" dired-actual-switches))))
(if (equal dirname (car (car (reverse dired-subdir-alist))))
;; top level directory may contain wildcards:
(dired-readin-insert dired-directory)
(setq result
(cons (substring str end) result)))
(nreverse result)))
-\f
+
;;; moving by subdirectories
;;;###autoload
;; at either \r or \n after this function succeeds.
(progn (skip-chars-forward "^\r\n")
(point)))))
-\f
+
;;;###autoload
(defun dired-mark-subdir-files ()
"Mark all files except `.' and `..' in current subdirectory.
(if pos
(goto-char pos)
(error "At the bottom"))))
-\f
+
;;; hiding
(defun dired-unhide-subdir ()
;;;###end dired-ins.el
-\f
+
;; Functions for searching in tags style among marked files.
;;;###autoload
(interactive
"sQuery replace in marked files (regexp): \nsQuery replace %s by: \nP")
(tags-query-replace from to delimited '(dired-get-marked-files)))
-\f
+
;;;###autoload
(defun dired-show-file-type (file &optional deref-symlinks)
"Print the type of FILE, according to the `file' command.
If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is
-true then the type of the file linked to by FILE is printed instead."
+true then the type of the file linked to by FILE is printed instead."
(interactive (list (dired-get-filename t) current-prefix-arg))
- (with-temp-buffer
+ (with-temp-buffer
(if deref-symlinks
(call-process "file" nil t t "-L" file)
(call-process "file" nil t t file))
'(".+" (dired-move-to-filename) nil (0 font-lock-function-name-face)))
;;
;; Symbolic links.
- (list dired-re-sym
+ (list dired-re-sym
'(".+" (dired-move-to-filename) nil (0 font-lock-keyword-face)))
;;
;; Files suffixed with `completion-ignored-extensions'.
(list (concat "\\(" (mapconcat 'identity extensions "\\|") "\\|#\\)$")
'(".+" (dired-move-to-filename) nil (0 font-lock-string-face))))))
"Additional expressions to highlight in Dired mode.")
-\f
+
;;; Macros must be defined before they are used, for the byte compiler.
;; Mark all files for which CONDITION evals to non-nil.
(save-excursion
(nreverse (dired-map-over-marks (dired-get-filename localp) arg))))
-\f
+
;; Function dired-ls is redefinable for VMS, ange-ftp, Prospero or
;; other special applications.
-\f
+
;; The dired command
(defun dired-read-dir-and-switches (str)
(setq buffer (create-file-buffer (directory-file-name dirname)))))
(set-buffer buffer)
(if (not new-buffer-p) ; existing buffer ...
- (cond (switches ; ... but new switches
+ (cond (switches ; ... but new switches
;; file list may have changed
- (if (consp dir-or-list)
+ (if (consp dir-or-list)
(setq dired-directory dir-or-list))
;; this calls dired-revert
- (dired-sort-other switches))
+ (dired-sort-other switches))
;; If directory has changed on disk, offer to revert.
((if (let ((attributes (file-attributes dirname))
(modtime (visited-file-modtime)))
(setq blist (cdr blist))))))
found))
-\f
+
;; Read in a new dired buffer
;; dired-readin differs from dired-insert-subdir in that it accepts
;; boundaries.
(save-excursion (insert " " (directory-file-name dir) ":\n")))
-\f
+
;; Reverting a dired buffer
(defun dired-revert (&optional arg noconfirm)
(let ((handler (find-file-name-handler dir 'dired-uncache)))
(if handler
(funcall handler 'dired-uncache dir))))
-\f
+
;; dired mode key bindings and initialization
(defvar dired-mode-map nil "Local keymap for dired-mode buffers.")
:help "Copy current file or all marked files"))
(setq dired-mode-map map)))
-\f
+
;; Dired mode is suitable only for specially formatted data.
(put 'dired-mode 'mode-class 'special)
(set (make-local-variable 'font-lock-defaults) '(dired-font-lock-keywords t))
(dired-sort-other dired-actual-switches t)
(run-hooks 'dired-mode-hook))
-\f
+
;; Idiosyncratic dired commands that don't deal with marks.
(defun dired-summary ()
(interactive)
(let ((file (file-name-sans-versions (dired-get-filename) t)))
(display-buffer (find-file-noselect file))))
-\f
+
;;; Functions for extracting and manipulating file names in dired buffers.
(defun dired-get-filename (&optional localp no-error-if-not-filep)
;;; (or no-error
;;; (error "%s: not in directory tree growing at %s" file dir))
file))
-\f
+
;;; Functions for finding the file name in a dired buffer line.
(defvar dired-move-to-filename-regexp
;; weiand: changed: month ends potentially with . or , or .,
;;old (month (concat l l "+ *"))
(month (concat l l "+[.]?,? *"))
- ;; Recognize any non-ASCII character.
+ ;; Recognize any non-ASCII character.
;; The purpose is to match a Kanji character.
(k "[^\0-\177]")
;; (k "[^\x00-\x7f\x80-\xff]")
(western (concat "\\(" month s dd "\\|" dd s month "\\)"
;; weiand: changed: year potentially unaligned
;;old s "\\(" HH:MM "\\|" s yyyy "\\|" yyyy s "\\)"))
- s "\\(" HH:MM
+ s "\\(" HH:MM
"\\|" yyyy s s "?"
"\\|" s "?" yyyy
"\\)"))
nil
(point))))
-\f
+
;; Keeping Dired buffers in sync with the filesystem and with each other
(defun dired-buffers-for-dir (dir &optional file)
(substring pattern matched-in-pattern))
"\\'")))
-
+
(defun dired-advertise ()
;;"Advertise in variable `dired-buffers' that we dired `default-directory'."
;; Removing is also done as a side-effect in dired-buffer-for-dir.
(setq dired-buffers
(delq (assoc (expand-file-name dir) dired-buffers) dired-buffers)))
-\f
+
;; Tree Dired
;;; utility functions
;; You may redefine this function as you wish, e.g. like in dired-x.el.
(end-of-line)
(if dired-trivial-filenames (dired-goto-next-nontrivial-file)))
-\f
+
;; These are hooks which make tree dired work.
;; They are in this file because other parts of dired need to call them.
;; But they don't call the rest of tree dired unless there are subdirs loaded.
(if (or (null (cdr dired-subdir-alist)) (not (dired-next-subdir 1 t t)))
(point-max)
(point))))
-\f
+
;; Deleting files
(defcustom dired-recursive-deletes nil ; Default only delete empty directories.
(const :tag "Ask for each top directory only" top))
:group 'dired)
-;; Match anything but `.' and `..'.
+;; Match anything but `.' and `..'.
(defvar dired-re-no-dot "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")
;; Delete file, possibly delete a directory and all its files.
(save-excursion (and (cdr dired-subdir-alist)
(dired-goto-subdir fn)
(dired-kill-subdir))))
-\f
+
;; Confirmation
(defun dired-marker-regexp ()
j (1+ j)
files (cdr files)))
rows))
-\f
+
;; Commands to mark or flag file(s) at or near current line.
(defun dired-repeat-over-lines (arg function)
(list ?\040 dired-marker-char)
(list dired-marker-char ?\040))))
(forward-line 1)))))
-\f
+
;;; Commands to mark or flag files based on their characteristics or names.
(defvar dired-regexp-history nil
"auto save file")))
(defvar dired-garbage-files-regexp
- "\\.log$\\|\\.toc$\\|\\.dvi$\\|\\.bak$\\|\\.orig$\\|\\.rej$"
+ "\\.log$\\|\\.toc$\\|\\.dvi$\\|\\.bak$\\|\\.orig$\\|\\.rej$"
"*Regular expression to match \"garbage\" files for `dired-flag-garbage-files'.")
(defun dired-flag-garbage-files ()
(defun dired-unmark-all-files (mark &optional arg)
"Remove a specific mark (or any mark) from every file.
-After this command, type the mark character to remove,
+After this command, type the mark character to remove,
or type RET to remove all marks.
With prefix arg, query for each marked file.
Type \\[help-command] at that time for help."
(message (if (= count 1) "1 mark removed"
"%d marks removed")
count))))
-\f
+
;; Logging failures operating on files, and showing the results.
(defvar dired-log-buffer "*Dired log*")
;; Log a summary describing a bunch of errors.
(dired-log (concat "\n" string))
(dired-log t))
-\f
+
;;; Sorting
;; Most ls can only sort by name or by date (with -t), nothing else.
(if (string-match " " dired-actual-switches)
;; New toggle scheme: add/remove a trailing " -t"
(if (string-match " -t\\'" dired-actual-switches)
- (dired-replace-in-string " -t\\'" "" dired-actual-switches)
+ (replace-regexp-in-string " -t\\'" "" dired-actual-switches)
(concat dired-actual-switches " -t"))
;; old toggle scheme: look for some 't' switch and add/remove it
(concat
"-l"
- (dired-replace-in-string (concat "[-lt"
- dired-ls-sorting-switches "]")
- ""
- dired-actual-switches)
+ (replace-regexp-in-string (concat "[-lt"
+ dired-ls-sorting-switches "]")
+ ""
+ dired-actual-switches)
(if (string-match (concat "[t" dired-ls-sorting-switches "]")
dired-actual-switches)
""
(dired-sort-set-modeline)
(revert-buffer))
-(defun dired-replace-in-string (regexp newtext string)
- ;; Replace REGEXP with NEWTEXT everywhere in STRING and return result.
- ;; NEWTEXT is taken literally---no \\DIGIT escapes will be recognized.
- (let ((result "") (start 0) mb me)
- (while (string-match regexp string start)
- (setq mb (match-beginning 0)
- me (match-end 0)
- result (concat result (substring string start mb) newtext)
- start me))
- (concat result (substring string start))))
-
(defun dired-sort-other (switches &optional no-revert)
;; Specify new ls SWITCHES for current dired buffer. Values matching
;; `dired-sort-by-date-regexp' or `dired-sort-by-name-regexp' set the
;; No pre-R subdir alist, so revert to main directory
;; listing:
(list (car (reverse dired-subdir-alist))))))))
-\f
+
;; To make this file smaller, the less common commands
;; go in a separate file. But autoload them here
;; to make the separation invisible.
(autoload 'dired-show-file-type "dired-aux"
"Print the type of FILE, according to the `file' command.
If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is
-true then the type of the file linked to by FILE is printed instead."
+true then the type of the file linked to by FILE is printed instead."
t)
-\f
+
(if (eq system-type 'vax-vms)
(load "dired-vms"))
"The Ghostscript device to use to produce images.")
-(defvar gs-options
+(defvar gs-options
'("-q"
;"-dNOPAUSE"
"-dBATCH"
Arguments may contain place-holders `<file>' for the name of the
input file, and `<device>' for the device to use.")
-
-(defun gs-replace-in-string (string find repl)
- "Return STRING with all occurrences of FIND replaced by REPL.
-FIND is a regular expression."
- (while (string-match find string)
- (setq string (replace-match repl nil t string)))
- string)
-
-
(defun gs-options (device file)
"Return a list of command line options with place-holders replaced.
DEVICE is the value to substitute for the place-holder `<device>',
FILE is the value to substitute for the place-holder `<file>'."
(mapcar #'(lambda (option)
- (setq option (gs-replace-in-string option "<device>" device)
- option (gs-replace-in-string option "<file>" file)))
+ (setq option (replace-regexp-in-string "<device>" device option)
+ option (replace-regexp-in-string "<file>" file option)))
gs-options))
-
+
;; The GHOSTVIEW property (taken from gv 3.5.8).
-;;
+;;
;; Type:
;;
;; STRING
-;;
+;;
;; Parameters:
-;;
+;;
;; BPIXMAP ORIENT LLX LLY URX URY XDPI YDPI [LEFT BOTTOM TOP RIGHT]
-;;
+;;
;; Scanf format: "%d %d %d %d %d %d %f %f %d %d %d %d"
-;;
+;;
;; Explanation of parameters:
-;;
+;;
;; BPIXMAP: pixmap id of the backing pixmap for the window. If no
;; pixmap is to be used, this parameter should be zero. This
;; parameter must be zero when drawing on a pixmap.
-;;
+;;
;; ORIENT: orientation of the page. The number represents clockwise
;; rotation of the paper in degrees. Permitted values are 0, 90, 180,
;; 270.
-;;
+;;
;; LLX, LLY, URX, URY: Bounding box of the drawable. The bounding box
;; is specified in PostScript points in default user coordinates.
-;;
+;;
;; XDPI, YDPI: Resolution of window. (This can be derived from the
;; other parameters, but not without roundoff error. These values are
;; included to avoid this error.)
-;;
+;;
;; LEFT, BOTTOM, TOP, RIGHT: (optional) Margins around the window.
;; The margins extend the imageable area beyond the boundaries of the
;; window. This is primarily used for popup zoom windows. I have
(/ (float (x-display-mm-height frame))
(float (x-display-pixel-height frame))))))
(/ (* 25.4 mm) 72.0)))
-
+
(defun gs-set-ghostview-window-prop (frame spec img-width img-height)
"Set the `GHOSTVIEW' window property of FRAME.
(t "Monochrome"))))
(x-change-window-property "GHOSTVIEW_COLORS"
(format "%s %s" mode pixel-colors))))
-
+
;
;;;###autoload
; :bounding-box (22 171 567 738)
; :file ,ps-file)))
; (put-text-property 1 2 'display spec)))
-;
+;
(provide 'gs)