Article View: gnu.emacs.bug
Article #87862(none)
From: pierrest
Date: Mon, 22 Aug 1994 06:37
Date: Mon, 22 Aug 1994 06:37
306 lines
12131 bytes
12131 bytes
> From: Kai Grossjohann <grossjoh@schroeder.informatik.uni-dortmund.de>
> Date: Thu, 18 Aug 94 10:43:08 +0200
> Reply-To: Kai Grossjohann <grossjoh@sally.informatik.uni-dortmund.de>
>
> In GNU Emacs 19.25.2 of Thu Jun 9 1994 on linus (sparc-sun-sunos4.1.3)
>
> The menus in rmail-mode and rmail-summary-mode are inconsistent. To
> reproduce, do the following:
You may want to try this patch. This is an alternative way of using these
menus.
I've reimplemented the way to use a popup menu for
rmail-secondary-file-directory. The current version doesn't open a
cascade pulldown menu but undisplays the pulldown menu and displays
another popup menu below the "Classify" menubar item. This is *wrong*.
Also, the current implementation does not allow to display folders
within the subdirectories.
My implementation displays a cascade pulldown menu from the
"Classify" menubar item and displays folders within subdirectories.
These menus are available from the summary buffer and the rmail buffer.
Mon Aug 1 17:15:30 1994 Frederic Pierresteguy <F.Pierresteguy@frcl.bull.fr>
* rmail.el (find-all-files, list-to-menu, rmail-construct-io-menu):
New functions.
(rmail-input-menu): Function deleted.
(rmail). Call rmail-construct-io-menu.
(rmail-mode-map): 'Input Rmail file (menu)' renamed to
'Input Rmail file'. 'Output (Rmail menu)' renamed to
'Output Rmail file'.
* rmailout.el (rmail-output-menu): Function deleted.
* rmailsum.el (rmail-summary-construct-io-menu): New function.
(rmail-new-summary): Call rmail-summary-construct-io-menu.
(rmail-summary-mode-map): New menu items 'Input Rmail File' and
'Output Rmail File'.
(rmail-summary-output-to-rmail-file): New arg 'file-name'. If it
non-nil, call rmail-output-to-rmail-file.
===================================================================
RCS file: /triton/GNU.rep/emacs19/lisp/rmail.el,v
retrieving revision 1.3
diff -p -c -r1.3 rmail.el
*** 1.3 1994/07/25 07:49:26
--- rmail.el 1994/08/04 09:55:12
*************** have a chance to specify a file name wit
*** 256,262 ****
;; or might have been just read in by rmail-get-new-mail. Must
;; determine already unseen messages first, as rmail-get-new-mail
;; positions on the first new message, thus marking it as seen.
! (rmail-show-message existing-unseen))))
;; Given the value of MAILPATH, return a list of inbox file names.
;; This is turned off because it is not clear that the user wants
--- 270,278 ----
;; or might have been just read in by rmail-get-new-mail. Must
;; determine already unseen messages first, as rmail-get-new-mail
;; positions on the first new message, thus marking it as seen.
! (rmail-show-message existing-unseen))
! (if rmail-display-summary (rmail-summary))
! (rmail-construct-io-menu)))
;; Given the value of MAILPATH, return a list of inbox file names.
;; This is turned off because it is not clear that the user wants
*************** Note: it means the file has no messag
*** 390,399 ****
(cons "Classify" (make-sparse-keymap "Classify")))
(define-key rmail-mode-map [menu-bar classify input-menu]
! '("Input Rmail file (menu)" . rmail-input-menu))
(define-key rmail-mode-map [menu-bar classify output-menu]
! '("Output (Rmail menu)" . rmail-output-menu))
(define-key rmail-mode-map [menu-bar classify output-inbox]
'("Output (inbox)" . rmail-output))
--- 406,415 ----
(cons "Classify" (make-sparse-keymap "Classify")))
(define-key rmail-mode-map [menu-bar classify input-menu]
! '("Input Rmail File"))
(define-key rmail-mode-map [menu-bar classify output-menu]
! '("Output Rmail File"))
(define-key rmail-mode-map [menu-bar classify output-inbox]
'("Output (inbox)" . rmail-output))
*************** Instead, these commands are available:
*** 664,694 ****
(interactive "FRun rmail on RMAIL file: ")
(rmail filename))
! ;; 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)))
! (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.
- The variables `rmail-secondary-file-directory' and
- `rmail-secondary-file-regexp' control which files are offered in the menu."
- (interactive "e")
- (let ((file-name (rmail-secondary-file-menu event)))
- (if file-name
- (rmail-input file-name))))
;;;; *** Rmail input ***
--- 683,745 ----
(interactive "FRun rmail on RMAIL file: ")
(rmail filename))
! (defun find-all-files (start)
! (if (file-accessible-directory-p start)
! (let ((files (directory-files start nil
! rmail-secondary-file-regexp))
! (ret nil))
! (while files
! (setq file (car files))
! (setq files (cdr files))
! (setq ret (cons
! (find-all-files (concat start "/" file))
! ret)))
! (cons (file-name-nondirectory start) ret))
! (file-name-nondirectory start)))
!
! (defun list-to-menu (menu-name l action &optional full-name)
! (let ((menu (make-sparse-keymap menu-name)))
! (mapcar
! (function (lambda (item)
! (if (consp item)
! (progn
! (setq command (list-to-menu (car item) (cdr item)
! action
! (if full-name
! (concat full-name "/"
! (car item))
! (car item))))
! (setq name (car item)))
! (progn
! (setq name item)
! (setq command
! (list 'lambda () '(interactive)
! (list action
! (expand-file-name
! (if full-name
! (concat full-name "/" item)
! item)
! rmail-secondary-file-directory))))))
! (define-key menu (vector (intern name))
! (cons name command))))
! l)
! menu))
!
! (defun rmail-construct-io-menu ()
! (let ((files (find-all-files rmail-secondary-file-directory)))
! (if (not (string= (car files) ""))
! (progn
! (define-key rmail-mode-map [menu-bar classify input-menu]
! (cons "Input Rmail File"
! (list-to-menu "Input Rmail File"
! (cdr files)
! 'rmail-input)))
! (define-key rmail-mode-map [menu-bar classify output-menu]
! (cons "Output Rmail File"
! (list-to-menu "Output Rmail File"
! (cdr files)
! 'rmail-output-to-rmail-file)))))))
;;;; *** Rmail input ***
*************** buffer visiting that file."
*** 2268,2277 ****
(autoload 'rmail-output "rmailout"
"Append this message to Unix mail file named FILE-NAME."
t)
-
- (autoload 'rmail-output-menu "rmailout"
- "Output current message to another Rmail file, chosen with a menu."
- t)
;;;; *** Rmail undigestification ***
--- 2321,2326 ----
===================================================================
RCS file: /triton/GNU.rep/emacs19/lisp/rmailout.el,v
retrieving revision 1.1.1.1
diff -p -c -r1.1.1.1 rmailout.el
*** 1.1.1.1 1994/05/27 12:14:03
--- rmailout.el 1994/08/04 08:47:03
*************** NAME-EXP may be a string constant giving
*** 37,53 ****
or more generally it may be any kind of expression that returns
a file name as a string.")
- (defun rmail-output-menu (event)
- "Output current message to another Rmail file, chosen with a menu.
- Also set the default for subsequent \\[rmail-output-to-rmail-file] commands.
- The variables `rmail-secondary-file-directory' and
- `rmail-secondary-file-regexp' control which files are offered in the menu."
- (interactive "e")
- (let ((file-name (rmail-secondary-file-menu event)))
- (if file-name
- (rmail-output-to-rmail-file
- (setq rmail-default-rmail-file file-name)))))
-
;;; There are functions elsewhere in Emacs that use this function; check
;;; them out before you change the calling method.
(defun rmail-output-to-rmail-file (file-name &optional count)
--- 37,42 ----
===================================================================
RCS file: /triton/GNU.rep/emacs19/lisp/rmailsum.el,v
retrieving revision 1.2
diff -p -c -r1.2 rmailsum.el
*** 1.2 1994/07/25 07:49:28
--- rmailsum.el 1994/08/04 09:24:53
*************** Commands for sorting the summary:
*** 657,662 ****
--- 668,679 ----
(define-key rmail-summary-mode-map [menu-bar classify]
(cons "Classify" (make-sparse-keymap "Classify")))
+ (define-key rmail-summary-mode-map [menu-bar classify input-menu]
+ '("Input Rmail File"))
+
+ (define-key rmail-summary-mode-map [menu-bar classify output-menu]
+ '("Output Rmail File"))
+
(define-key rmail-summary-mode-map [menu-bar classify output-inbox]
'("Output (inbox)" . rmail-summary-output))
*************** see the documentation of `rmail-resend'.
*** 1079,1085 ****
;; Summary output commands.
! (defun rmail-summary-output-to-rmail-file ()
"Append the current message to an Rmail file named FILE-NAME.
If the file does not exist, ask if it should be created.
If file is being visited, the message is appended to the Emacs
--- 1099,1105 ----
;; Summary output commands.
! (defun rmail-summary-output-to-rmail-file (&optional file-name)
"Append the current message to an Rmail file named FILE-NAME.
If the file does not exist, ask if it should be created.
If file is being visited, the message is appended to the Emacs
*************** buffer visiting that file."
*** 1088,1094 ****
(save-excursion
(set-buffer rmail-buffer)
(let ((rmail-delete-after-output nil))
! (call-interactively 'rmail-output-to-rmail-file)))
(if rmail-delete-after-output
(rmail-summary-delete-forward nil)))
--- 1108,1116 ----
(save-excursion
(set-buffer rmail-buffer)
(let ((rmail-delete-after-output nil))
! (if file-name
! (rmail-output-to-rmail-file file-name)
! (call-interactively 'rmail-output-to-rmail-file))))
(if rmail-delete-after-output
(rmail-summary-delete-forward nil)))
*************** buffer visiting that file."
*** 1101,1106 ****
--- 1123,1144 ----
(call-interactively 'rmail-output)))
(if rmail-delete-after-output
(rmail-summary-delete-forward nil)))
+
+ (defun rmail-summary-construct-io-menu ()
+ (let ((files (find-all-files rmail-secondary-file-directory)))
+ (if (not (string= (car files) ""))
+ (progn
+ (define-key rmail-summary-mode-map [menu-bar classify input-menu]
+ (cons "Input Rmail File"
+ (list-to-menu "Input Rmail File"
+ (cdr files)
+ 'rmail-summary-input)))
+ (define-key rmail-summary-mode-map [menu-bar classify output-menu]
+ (cons "Output Rmail File"
+ (list-to-menu "Output Rmail File"
+ (cdr files)
+ 'rmail-summary-output-to-rmail-file)))))))
+
;; Sorting messages in Rmail Summary buffer.
Technical Details
Message-ID:
<199408220637.CAA17022@news.cis.ohio-state.edu>Path:
arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!uunet!cs.utexas.edu!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!papayer.frcl.bull.fr!pierrestShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,b14032349d3cbf65 X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1994-08-22 00:06:07 PST Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!uunet!cs.utexas.edu!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!papayer.frcl.bull.fr!pierrest From: pierrest@papayer.frcl.bull.fr Newsgroups: gnu.emacs.bug Subject: (none) Date: 22 Aug 1994 02:37:30 -0400 Organization: GNUs Not Usenet Lines: 307 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-emacs@prep.ai.mit.edu Distribution: gnu Message-ID: <199408220637.CAA17022@news.cis.ohio-state.edu>