Mercurial > hg > xemacs-beta
comparison lisp/gnus/gnus-util.el @ 22:8fc7fe29b841 r19-15b94
Import from CVS: tag r19-15b94
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:50:29 +0200 |
parents | d95e72db5c07 |
children | 1917ad0d78d7 |
comparison
equal
deleted
inserted
replaced
21:b88636d63495 | 22:8fc7fe29b841 |
---|---|
565 (and (not (,(car funs) t2 t1)) | 565 (and (not (,(car funs) t2 t1)) |
566 ,(gnus-make-sort-function-1 (cdr funs)))) | 566 ,(gnus-make-sort-function-1 (cdr funs)))) |
567 `(,(car funs) t1 t2))) | 567 `(,(car funs) t1 t2))) |
568 | 568 |
569 (defun gnus-turn-off-edit-menu (type) | 569 (defun gnus-turn-off-edit-menu (type) |
570 "Turn off edit meny in `gnus-TYPE-mode-map'." | 570 "Turn off edit menu in `gnus-TYPE-mode-map'." |
571 (define-key (symbol-value (intern (format "gnus-%s-mode-map" type))) | 571 (define-key (symbol-value (intern (format "gnus-%s-mode-map" type))) |
572 [menu-bar edit] 'undefined)) | 572 [menu-bar edit] 'undefined)) |
573 | 573 |
574 (defun gnus-prin1 (form) | 574 (defun gnus-prin1 (form) |
575 "Use `prin1' on FORM in the current buffer. | 575 "Use `prin1' on FORM in the current buffer. |
762 (save-excursion | 762 (save-excursion |
763 ;; Create the file, if it doesn't exist. | 763 ;; Create the file, if it doesn't exist. |
764 (when (and (not (get-file-buffer filename)) | 764 (when (and (not (get-file-buffer filename)) |
765 (not (file-exists-p filename))) | 765 (not (file-exists-p filename))) |
766 (if (or (not ask) | 766 (if (or (not ask) |
767 (gnus-yes-or-no-p | 767 (gnus-y-or-n-p |
768 (concat "\"" filename "\" does not exist, create it? "))) | 768 (concat "\"" filename "\" does not exist, create it? "))) |
769 (let ((file-buffer (create-file-buffer filename))) | 769 (let ((file-buffer (create-file-buffer filename))) |
770 (save-excursion | 770 (save-excursion |
771 (set-buffer file-buffer) | 771 (set-buffer file-buffer) |
772 (let ((require-final-newline nil)) | 772 (let ((require-final-newline nil)) |
780 (unless (looking-at "From ") | 780 (unless (looking-at "From ") |
781 (insert "From nobody " (current-time-string) "\n")) | 781 (insert "From nobody " (current-time-string) "\n")) |
782 ;; Decide whether to append to a file or to an Emacs buffer. | 782 ;; Decide whether to append to a file or to an Emacs buffer. |
783 (let ((outbuf (get-file-buffer filename))) | 783 (let ((outbuf (get-file-buffer filename))) |
784 (if (not outbuf) | 784 (if (not outbuf) |
785 (append-to-file (point-min) (point-max) filename) | 785 (let ((buffer-read-only nil)) |
786 (save-excursion | |
787 (goto-char (point-max)) | |
788 (forward-char -2) | |
789 (unless (looking-at "\n\n") | |
790 (goto-char (point-max)) | |
791 (unless (bolp) | |
792 (insert "\n")) | |
793 (insert "\n")) | |
794 (goto-char (point-max)) | |
795 (append-to-file (point-min) (point-max) filename))) | |
786 ;; File has been visited, in buffer OUTBUF. | 796 ;; File has been visited, in buffer OUTBUF. |
787 (set-buffer outbuf) | 797 (set-buffer outbuf) |
788 (let ((buffer-read-only nil)) | 798 (let ((buffer-read-only nil)) |
789 (goto-char (point-max)) | 799 (goto-char (point-max)) |
800 (unless (eobp) | |
801 (insert "\n")) | |
802 (insert "\n") | |
790 (insert-buffer-substring tmpbuf))))) | 803 (insert-buffer-substring tmpbuf))))) |
791 (kill-buffer tmpbuf))) | 804 (kill-buffer tmpbuf))) |
792 | 805 |
793 (defun gnus-convert-article-to-rmail () | 806 (defun gnus-convert-article-to-rmail () |
794 "Convert article in current buffer to Rmail message format." | 807 "Convert article in current buffer to Rmail message format." |