bongo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bongo-devel] Re: Wildcards in bongo-insert-file


From: Daniel Brockman
Subject: [bongo-devel] Re: Wildcards in bongo-insert-file
Date: Wed, 29 Nov 2006 05:27:21 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

address@hidden (Daniel Jensen) writes:

> This patch adds functionality to `bongo-insert-file' for inserting
> multiple files using wildcards.

Good idea, thanks.

I changed a couple of things --- I'll comment below.

> [Expand wildcards in interactive use of `bongo-insert-file'
> Daniel Jensen <address@hidden>**20061128145340] {
> hunk ./bongo.el 4943
> -If FILE-NAME names a directory, call `bongo-insert-directory'."
> -  (interactive (list (expand-file-name
> +If FILE-NAME names a directory, call `bongo-insert-directory'.
> +Interactively, expand wildcards and insert all matching files."
> +  (interactive (list (file-expand-wildcards
> hunk ./bongo.el 4947
> -                                      default-directory nil t
> +                                      default-directory nil nil
> hunk ./bongo.el 4949
> -                                        (dired-get-filename t))))))
> -  (if (file-directory-p file-name)
> -      (bongo-insert-directory-tree file-name)
> -    (bongo-insert-line 'bongo-file-name file-name)
> -    (when (and (interactive-p) (not (bongo-buffer-p)))
> -      (message "Inserted track: %s"
> -               (bongo-format-infoset
> -                (bongo-infoset-from-file-name file-name))))))
> +                                        (dired-get-filename t))) t)))
> +  (cond ((null file-name)
> +         (and (interactive-p) (error "No matching file found")))

You should almost never use `interactive-p' for anything
other than deciding whether to display a message.  In this
case, it is better to use `called-interactively-p'.

> +        ((consp file-name)
> +         (let ((beginning (point)))
> +           (mapcar 'bongo-insert-file file-name)

I changed this to `mapc'.

-- 
Daniel Brockman <address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]