1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-29 11:02:01 +00:00

(rmail-input-menu): Don't call expand-file-name.

Do nothing if rmail-secondary-file-menu return nil.
(rmail-secondary-file-menu): If no files match, warn and return nil.
This commit is contained in:
Richard M. Stallman 1994-05-04 22:00:30 +00:00
parent df0e3d0315
commit b1fd1e8d65

View File

@ -678,21 +678,29 @@ Instead, these commands are available:
;; Choose a .xmail file in dir rmail-secondary-file-directory.
(defun rmail-secondary-file-menu (event)
(let* ((files (directory-files rmail-secondary-file-directory nil
rmail-secondary-file-regexp))
(menu (list "Rmail Files"
(cons "Rmail Files"
(mapcar (function (lambda (f) (cons f f)))
files))))
(chosen (x-popup-menu event menu)))
(if chosen
(expand-file-name chosen rmail-secondary-file-directory))))
(let ((files (directory-files rmail-secondary-file-directory nil
rmail-secondary-file-regexp)))
(if files
(let* ((menu (list "Rmail Files"
(cons "Rmail Files"
(mapcar (function (lambda (f) (cons f f)))
files))))
(chosen (x-popup-menu event menu)))
(if chosen
(expand-file-name chosen rmail-secondary-file-directory)))
(message "No files matching %s%s found"
rmail-secondary-file-directory rmail-secondary-file-regexp)
nil)))
(defun rmail-input-menu (event)
"Choose a new Rmail file to edit, with a menu."
"Choose a new Rmail file to edit, with a menu.
The variables `rmail-secondary-file-directory' and
`rmail-secondary-file-regexp' control which files are offered in the menu."
(interactive "e")
(rmail-input (expand-file-name (rmail-secondary-file-menu event)
rmail-secondary-file-directory)))
(let ((file-name (rmail-secondary-file-menu event)))
(if file-name
(rmail-input file-name))))
;;;; *** Rmail input ***