• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/gnus/

Lines Matching +defs:create +defs:file +defs:buffer

9 ;; This file is part of GNU Emacs.
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
28 ;; Nothing in this file depends on any other parts of Gnus -- all
29 ;; functions and macros in this file are utility functions that are
43 (defvar nnmail-active-file-coding-system)
47 (defvar gnus-original-article-buffer)
55 (autoload 'gnus-get-buffer-window "gnus-win")
56 (autoload 'rmail-insert-rmail-file-header "rmail")
103 (defmacro gnus-eval-in-buffer-window (buffer &rest forms)
109 (,buf ,buffer)
110 (,w (gnus-get-buffer-window ,buf 'visible)))
116 (set-buffer (window-buffer ,w)))
117 (pop-to-buffer ,buf))
121 (put 'gnus-eval-in-buffer-window 'lisp-indent-function 1)
122 (put 'gnus-eval-in-buffer-window 'edebug-form-spec '(form body))
143 (defmacro gnus-buffer-exists-p (buffer)
144 `(let ((buffer ,buffer))
145 (when buffer
146 (funcall (if (stringp buffer) 'get-buffer 'buffer-name)
147 buffer))))
245 (with-current-buffer gnus-original-article-buffer
265 "Delete all text in the current buffer with text property PROP."
295 (defun gnus-file-newer-than (file date)
296 (let ((fdate (nth 5 (file-attributes file))))
472 (make-vector (if hashsize (max (gnus-create-hash-size hashsize) 256) 256) 0))
480 (defun gnus-create-hash-size (min)
543 (defun gnus-buffer-live-p (buffer)
545 (and buffer
546 (get-buffer buffer)
547 (buffer-name (get-buffer buffer))))
550 "Recenter the current buffer horizontally."
552 (set-window-hscroll (gnus-get-buffer-window (current-buffer) t) 0)
554 (end (window-end (gnus-get-buffer-window (current-buffer) t)))
568 (gnus-get-buffer-window (current-buffer) t)
571 (set-window-hscroll (gnus-get-buffer-window (current-buffer) t) 0))
584 (defun gnus-copy-file (file &optional to)
587 (list (read-file-name "Copy file: " default-directory)
588 (read-file-name "Copy file to: " default-directory)))
590 (setq to (read-file-name "Copy file to: " default-directory)))
591 (when (file-directory-p to)
592 (setq to (concat (file-name-as-directory to)
593 (file-name-nondirectory file))))
594 (copy-file file to))
596 (defvar gnus-work-buffer " *gnus work*")
598 (defun gnus-set-work-buffer ()
599 "Put point in the empty Gnus work buffer."
600 (if (get-buffer gnus-work-buffer)
602 (set-buffer gnus-work-buffer)
603 (erase-buffer))
604 (set-buffer (gnus-get-buffer-create gnus-work-buffer))
692 "Use `prin1' on FORM in the current buffer.
695 (gnus-bind-print-variables (prin1 form (current-buffer))))
704 "Use `pp' on FORM in the current buffer.
707 (gnus-bind-print-variables (pp form (current-buffer))))
718 (let ((file-name-coding-system nnmail-pathname-coding-system))
720 (not (file-exists-p directory)))
724 (defun gnus-write-buffer (file)
725 "Write the current buffer's contents to FILE."
727 (gnus-make-directory (file-name-directory file))
728 (let ((file-name-coding-system nnmail-pathname-coding-system))
729 ;; Write the buffer.
730 (write-region (point-min) (point-max) file nil 'quietly)))
732 (defun gnus-delete-file (file)
734 (when (file-exists-p file)
735 (delete-file file)))
740 (when (file-directory-p directory)
743 file dir)
745 (setq file (pop files))
746 (if (eq t (car (file-attributes file)))
747 ;; `file' is a subdirectory.
749 ;; `file' is a file or a symlink.
750 (delete-file file)))
824 nil (current-buffer) pos pos nil 'face))
927 (defvar rmail-default-rmail-file)
931 "Append the current article to an Rmail file named FILENAME."
935 (setq filename (expand-file-name filename))
936 (setq rmail-default-rmail-file filename)
937 (let ((artbuf (current-buffer))
938 (tmpbuf (get-buffer-create " *Gnus-output*")))
940 (or (get-file-buffer filename)
941 (file-exists-p filename)
944 (concat "\"" filename "\" does not exist, create it? ")))
945 (let ((file-buffer (create-file-buffer filename)))
947 (set-buffer file-buffer)
948 (rmail-insert-rmail-file-header)
951 (gnus-write-buffer filename)))
952 (kill-buffer file-buffer))
953 (error "Output file does not exist")))
954 (set-buffer tmpbuf)
955 (erase-buffer)
956 (insert-buffer-substring artbuf)
958 ;; Decide whether to append to a file or to an Emacs buffer.
959 (let ((outbuf (get-file-buffer filename)))
961 (let ((file-name-coding-system nnmail-pathname-coding-system))
962 (mm-append-to-file (point-min) (point-max) filename))
963 ;; File has been visited, in buffer OUTBUF.
964 (set-buffer outbuf)
965 (let ((buffer-read-only nil)
968 ;; If MSG is non-nil, buffer is in RMAIL mode.
972 (insert-buffer-substring tmpbuf)
984 (save-buffer)))))
985 (kill-buffer tmpbuf)))
988 "Append the current article to a mail file named FILENAME."
989 (setq filename (expand-file-name filename))
990 (let ((artbuf (current-buffer))
991 (tmpbuf (get-buffer-create " *Gnus-output*")))
993 ;; Create the file, if it doesn't exist.
994 (when (and (not (get-file-buffer filename))
995 (not (file-exists-p filename)))
998 (concat "\"" filename "\" does not exist, create it? ")))
999 (let ((file-buffer (create-file-buffer filename)))
1001 (set-buffer file-buffer)
1004 (gnus-write-buffer filename)))
1005 (kill-buffer file-buffer))
1006 (error "Output file does not exist")))
1007 (set-buffer tmpbuf)
1008 (erase-buffer)
1009 (insert-buffer-substring artbuf)
1018 ;; Decide whether to append to a file or to an Emacs buffer.
1019 (let ((outbuf (get-file-buffer filename)))
1021 (let ((buffer-read-only nil))
1031 (let ((file-name-coding-system nnmail-pathname-coding-system))
1032 (mm-append-to-file (point-min) (point-max) filename))))
1033 ;; File has been visited, in buffer OUTBUF.
1034 (set-buffer outbuf)
1035 (let ((buffer-read-only nil))
1040 (insert-buffer-substring tmpbuf)))))
1041 (kill-buffer tmpbuf)))
1044 "Convert article in current buffer to Rmail message format."
1045 (let ((buffer-read-only nil))
1062 "Does the same as `run-hooks', but saves the current buffer."
1063 (save-current-buffer
1068 This function saves the current buffer."
1070 (save-current-buffer (apply 'run-mode-hooks funcs))
1071 (save-current-buffer (apply 'run-hooks funcs))))
1075 (defvar gnus-group-buffer) ; Compiler directive
1078 (and (boundp 'gnus-group-buffer)
1079 (get-buffer gnus-group-buffer)
1081 (set-buffer gnus-group-buffer)
1118 (let ((win (gnus-get-buffer-window (current-buffer) t)))
1142 (defun gnus-write-active-file (file hashtb &optional full-names)
1143 (let ((coding-system-for-write nnmail-active-file-coding-system))
1144 (with-temp-file file
1162 ;; Fixme: Why not use `with-output-to-temp-buffer'?
1163 (defmacro gnus-with-output-to-file (file &rest body)
1164 (let ((buffer (make-symbol "output-buffer"))
1165 (size (make-symbol "output-buffer-size"))
1166 (leng (make-symbol "output-buffer-length"))
1167 (append (make-symbol "output-buffer-append")))
1169 (,buffer (make-string ,size 0))
1174 (aset ,buffer ,leng c)
1177 (progn (write-region ,buffer nil ,file ,append 'no-msg)
1183 (write-region (substring ,buffer 0 ,leng) nil ,file
1186 (put 'gnus-with-output-to-file 'lisp-indent-function 1)
1187 (put 'gnus-with-output-to-file 'edebug-form-spec '(form body))
1280 (defun gnus-create-info-command (node)
1286 (setq gnus-info-buffer (current-buffer))
1402 (defun gnus-cache-file-contents (file variable function)
1404 (let ((time (nth 5 (file-attributes file)))
1407 (not (equal (car value) file))
1410 (setq contents (funcall function file))
1411 (set variable (list file time contents))
1430 (setq buf (get-buffer-create "*Gnus Help*"))
1431 (pop-to-buffer buf)
1433 (buffer-disable-undo)
1434 (erase-buffer)
1463 (if (buffer-live-p buf)
1464 (kill-buffer buf))
1619 (defun gnus-rename-file (old-path new-path &optional trim)
1622 (when (file-exists-p old-path)
1623 (let* ((old-dir (file-name-directory old-path))
1624 (old-name (file-name-nondirectory old-path))
1625 (new-dir (file-name-directory new-path))
1626 (new-name (file-name-nondirectory new-path))
1629 (rename-file old-path new-path t)
1636 (setq old-dir (file-name-as-directory
1637 (file-truename