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

Lines Matching +refs:file +refs:modes

9 ;; This file is part of GNU Emacs.
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
45 (defvar gnus-agent-file-loading-local nil)
46 (defvar gnus-agent-file-loading-cache nil))
48 (defcustom gnus-startup-file (nnheader-concat gnus-home-directory ".newsrc")
49 "Your `.newsrc' file.
52 :type 'file)
54 (defcustom gnus-backup-startup-file 'never
64 (defcustom gnus-save-startup-file-via-temp-buffer t
65 "Whether to write the startup file contents to a buffer then save
66 the buffer or write directly to the file. The buffer is faster
72 (const :tag "Write directly to file" nil)))
74 (defcustom gnus-init-file (nnheader-concat gnus-home-directory ".gnus")
75 "Your Gnus Emacs-Lisp startup file name.
76 If a file with the `.el' or `.elc' suffixes exists, it will be read instead."
78 :type 'file)
80 (defcustom gnus-site-init-file
82 (concat (file-name-directory
83 (directory-file-name installation-directory))
86 "The site-wide Gnus Emacs-Lisp startup file name, or nil if none.
87 If a file with the `.el' or `.elc' suffixes exists, it will be read instead."
89 :type '(choice file (const nil)))
99 (defcustom gnus-use-dribble-file t
100 "*Non-nil means that Gnus will use a dribble file to store user updates.
102 information can be restored from the dribble file."
103 :group 'gnus-dribble-file
110 :group 'gnus-dribble-file
124 3. `gnus-read-active-file' is nil or `some'.
128 `gnus-read-active-file' is nil or `some', then the killed list is no
157 (defcustom gnus-read-active-file 'some
158 "*Non-nil means that Gnus will read the entire active file at startup.
160 `.newsrc' file.
163 parts of the active file from the server. Not all servers support
223 (defcustom gnus-read-newsrc-file t
224 "*Non-nil means that Gnus will read the `.newsrc' file.
225 Gnus always reads its own startup file, which is called
226 \".newsrc.eld\". The file called \".newsrc\" is in a format that can
234 (defcustom gnus-save-newsrc-file t
235 "*Non-nil means that Gnus will save the `.newsrc' file.
236 Gnus always saves its own startup file, which is called
237 \".newsrc.eld\". The file called \".newsrc\" is in a format that can
245 "*If non-nil, save the list of killed groups to the startup file.
271 "*A regexp to match uninteresting newsgroups in the active file.
272 Any lines in the active file matching this regular expression are
312 .newsrc file:
404 "A hook after reading the .newsrc file, but before generating the buffer."
427 "A hook called after reading the newsrc.eld? file."
437 "A hook called just before saving the quick newsrc file.
443 "A hook called just before saving the standard newsrc file.
454 (defcustom gnus-always-read-dribble-file nil
455 "Unconditionally read the dribble file."
461 (defvar gnus-ding-file-coding-system mm-universal-coding-system
462 "Coding system for ding file.")
464 (defvar gnus-newsrc-file-version nil)
468 "Options line in the .newsrc file.")
476 (defvar gnus-current-startup-file nil
477 "Startup file for the current host.")
484 (defun gnus-read-init-file (&optional inhibit-next)
486 (when init-file-user
490 (dolist (file (list gnus-site-init-file gnus-init-file))
491 (when (and file
492 (locate-library file))
494 (load file nil t)
496 (load file nil t)
498 (error "Error in %s: %s" file (cadr var))))))))))
587 (set-buffer (nnheader-find-file-noselect gnus-current-startup-file))
636 (defun gnus-read-active-file-p ()
637 "Say whether the active file has been read from `gnus-select-method'."
638 (memq gnus-select-method gnus-have-read-active-file))
657 (defvar nnmail-spool-file))
674 gnus-have-read-active-file nil
676 gnus-agent-file-loading-local nil
677 gnus-agent-file-loading-cache nil
702 ;; Kill the startup file.
703 (and gnus-current-startup-file
704 (get-file-buffer gnus-current-startup-file)
705 (kill-buffer (get-file-buffer gnus-current-startup-file)))
708 ;; Kill global KILL file buffer.
709 (when (get-file-buffer (gnus-newsgroup-kill-file nil))
710 (kill-buffer (get-file-buffer (gnus-newsgroup-kill-file nil))))
752 (gnus-read-init-file)
778 ;; Find the current startup file name.
779 (setq gnus-current-startup-file
780 (gnus-make-newsrc-file gnus-startup-file))
782 ;; Read the dribble file.
783 (when (or gnus-slave gnus-use-dribble-file)
784 (gnus-dribble-read-file))
821 ;;; Dribble file
825 (defvar gnus-dribble-eval-file nil)
827 (defun gnus-dribble-file-name ()
828 "Return the dribble file for the current .newsrc."
831 (concat (file-name-as-directory gnus-dribble-directory)
832 (file-name-nondirectory gnus-current-startup-file))
833 gnus-current-startup-file)
860 (defun gnus-dribble-read-file ()
861 "Read the dribble file from disk."
862 (let ((dribble-file (gnus-dribble-file-name)))
866 (file-name-nondirectory dribble-file))))
867 (set (make-local-variable 'file-precious-flag) t)
869 (setq buffer-file-name dribble-file)
874 (let ((auto (make-auto-save-file-name))
877 modes)
878 (when (or (file-exists-p auto) (file-exists-p dribble-file))
879 ;; Load whichever file is newest -- the auto save file
880 ;; or the "real" file.
881 (if (file-newer-than-file-p auto dribble-file)
882 (nnheader-insert-file-contents auto)
883 (nnheader-insert-file-contents dribble-file))
886 ;; Set the file modes to reflect the .newsrc file modes.
888 (when (and (file-exists-p gnus-current-startup-file)
889 (file-exists-p dribble-file)
890 (setq modes (file-modes gnus-current-startup-file)))
891 (set-file-modes dribble-file modes))
895 ;; Possibly eval the file later.
896 (when (or gnus-always-read-dribble-file
899 "Gnus exited on purpose without saving; read auto-save file anyway? "
900 "Gnus auto-save file exists. Do you want to read it? ")))
901 (setq gnus-dribble-eval-file t)))))))
903 (defun gnus-dribble-eval-file ()
904 (when gnus-dribble-eval-file
905 (setq gnus-dribble-eval-file nil)
911 (defun gnus-dribble-delete-file ()
912 (when (file-exists-p (gnus-dribble-file-name))
913 (delete-file (gnus-dribble-file-name)))
917 (let ((auto (make-auto-save-file-name)))
918 (when (file-exists-p auto)
919 (delete-file auto))
946 If RAWFILE is non-nil, the .newsrc file will also be read.
958 ;; Read the newsrc file and create `gnus-newsrc-hashtb'.
959 (gnus-read-newsrc-file rawfile))
979 (nnfolder-active-file
987 ;; If we don't read the complete active file, we fill in the
989 (when (or (null gnus-read-active-file)
990 (eq gnus-read-active-file 'some))
998 ;; within gnus-read-active-file to function correctly.
1002 ;; Read the active file and create `gnus-active-hashtb'.
1003 ;; If `gnus-read-active-file' is nil, then we just create an empty
1006 (and gnus-read-active-file
1008 (gnus-read-active-file nil dont-connect))
1017 ;; Possibly eval the dribble file.
1019 (or gnus-use-dribble-file gnus-slave)
1020 (gnus-dribble-eval-file))
1028 ;; See whether we need to read the description file.
1035 gnus-read-active-file)
1047 gnus-read-active-file (not level)
1064 (let ((gnus-read-active-file (and (not level) gnus-read-active-file)))
1097 (null gnus-read-active-file)
1098 (eq gnus-read-active-file 'some))
1114 (unless gnus-have-read-active-file
1115 (gnus-read-active-file))
1170 ;; file. This list has elements on the form
1255 (dolist (file (list (concat gnus-current-startup-file ".el")
1256 (concat gnus-current-startup-file ".eld")
1257 (concat gnus-startup-file ".el")
1258 (concat gnus-startup-file ".eld")))
1259 (when (file-exists-p file)
1262 (unless (gnus-read-active-file-p)
1263 (let ((gnus-read-active-file t))
1264 (gnus-read-active-file)))
1449 (unless (gnus-read-active-file-p)
1450 (gnus-read-active-file t))
1451 (when (gnus-read-active-file-p)
1716 ;; Let the Gnus agent save the active file.
1730 ((not gnus-read-active-file)
1748 (if (listp nnmail-spool-file)
1749 nnmail-spool-file
1750 (list nnmail-spool-file))))))
1774 ;; and fetch a partial active file and use it to find new news.
1782 (gnus-read-active-file-2
1863 ;; Insert the change into the group buffer and the dribble file.
1931 ;; Insert the change into the group buffer and the dribble file.
1948 ;; First make sure active file has been read.
1949 (unless (gnus-read-active-file-p)
1950 (let ((gnus-read-active-file t))
1951 (gnus-read-active-file)))
1972 ;; Get the active file(s) from the backend(s).
1973 (defun gnus-read-active-file (&optional force not-native)
1990 (setq gnus-have-read-active-file nil)
1998 (gnus-read-active-file-1 method force)
2000 (gnus-read-active-file-1 method force)
2004 (message "Quit reading the active file")
2007 (defun gnus-read-active-file-1 (method force)
2010 mesg (format "Reading active file%s via %s..."
2020 ((and (eq gnus-read-active-file 'some)
2035 (gnus-read-active-file-2 groups method)))
2041 (gnus-error 1 "Cannot read active file from %s server"
2045 ;; We mark this active file as read.
2046 (push method gnus-have-read-active-file)
2049 (defun gnus-read-active-file-2 (groups method)
2050 "Read an active file for GROUPS in METHOD using `gnus-retrieve-groups'."
2058 1.2 "Cannot read partial active file from %s server."
2065 ;; Read an active file and place the results in `gnus-active-hashtb'.
2096 ;; Let the Gnus agent save the active file.
2113 ;; Store the active file in a hash table.
2156 ;; Parse a "groups" active file.
2170 ;; Let the Gnus agent save the active file.
2210 (defun gnus-read-newsrc-file (&optional force)
2211 "Read startup file.
2212 If FORCE is non-nil, the .newsrc file is read."
2213 ;; Reset variables that might be defined in the .newsrc.eld file.
2218 (let* ((newsrc-file gnus-current-startup-file)
2219 (quick-file (concat newsrc-file ".el")))
2221 ;; We always load the .newsrc.eld file. If always contains
2223 ;; file (ticked articles, killed groups, foreign methods, etc.)
2224 (gnus-read-newsrc-el-file quick-file)
2226 (when (and gnus-read-newsrc-file
2227 (file-exists-p gnus-current-startup-file)
2229 (and (file-newer-than-file-p newsrc-file quick-file)
2230 (file-newer-than-file-p newsrc-file
2231 (concat quick-file "d")))
2233 ;; We read the .newsrc file. Note that if there if a
2234 ;; .newsrc.eld file exists, it has already been read, and
2236 ;; the .newsrc file, Gnus will only use the information it
2238 ;; i. e., reading the .newsrc file will not trash the data
2241 (gnus-message 5 "Reading %s..." newsrc-file)
2242 (set-buffer (nnheader-find-file-noselect newsrc-file))
2246 (gnus-message 5 "Reading %s...done" newsrc-file)))
2253 (let ((fcv (and gnus-newsrc-file-version
2254 (gnus-continuum-version gnus-newsrc-file-version)))
2257 ;; A newsrc file was loaded.
2265 ;; to bring the newsrc file up to the current
2282 ;; Skip converters older than the file version
2303 gnus-newsrc-file-version gnus-version)
2324 gnus-newsrc-file-version gnus-version)))))))
2354 (defun gnus-load (file)
2357 (insert-file-contents file)
2363 (unless (eq (car type) 'end-of-file)
2364 (let ((error (format "Error in %s line %d" file
2370 (defun gnus-read-newsrc-el-file (file)
2371 (let ((ding-file (concat file "d")))
2372 (when (file-exists-p ding-file)
2373 ;; We always, always read the .eld file.
2374 (gnus-message 5 "Reading %s..." ding-file)
2376 (let ((coding-system-for-read gnus-ding-file-coding-system))
2377 (gnus-load ding-file))
2381 (and gnus-newsrc-file-version
2382 (gnus-continuum-version gnus-newsrc-file-version))))
2389 (when (file-newer-than-file-p file ding-file)
2390 ;; Old format quick file
2391 (gnus-message 5 "Reading %s..." file)
2392 ;; The .el file is newer than the .eld file, so we read that one
2394 (gnus-read-old-newsrc-el-file file)))
2397 ;; Parse the old-style quick startup file
2398 (defun gnus-read-old-newsrc-el-file (file)
2405 (load file t t t))
2436 ;; The .el file version of this variable does not begin with
2452 (defun gnus-make-newsrc-file (file)
2453 "Make server dependent file name by catenating FILE and server host name."
2454 (let* ((file (expand-file-name file nil))
2455 (real-file (concat file "-" (nth 1 gnus-select-method))))
2456 (if (or (file-exists-p real-file)
2457 (file-exists-p (concat real-file ".el"))
2458 (file-exists-p (concat real-file ".eld")))
2459 real-file
2460 file)))
2589 ;; There is an entry for this file in the alist.
2708 (defalias 'gnus-long-file-names
2709 (if (fboundp 'msdos-long-file-names)
2710 'msdos-long-file-names
2713 (defun gnus-save-newsrc-file (&optional force)
2714 "Save .newsrc file."
2715 ;; Note: We cannot save .newsrc file if all newsgroups are removed
2718 gnus-current-startup-file)
2724 (if (and (or gnus-use-dribble-file gnus-slave)
2736 (when gnus-save-newsrc-file
2737 (gnus-message 8 "Saving %s..." gnus-current-startup-file)
2739 (gnus-message 8 "Saving %s...done" gnus-current-startup-file))
2744 (setq version-control gnus-backup-startup-file)
2745 (setq buffer-file-name
2746 (concat gnus-current-startup-file ".eld"))
2747 (setq default-directory (file-name-directory buffer-file-name))
2750 (gnus-message 5 "Saving %s.eld..." gnus-current-startup-file)
2752 (if gnus-save-startup-file-via-temp-buffer
2753 (let ((coding-system-for-write gnus-ding-file-coding-system)
2758 (let ((coding-system-for-write gnus-ding-file-coding-system)
2759 (version-control gnus-backup-startup-file)
2760 (startup-file (concat gnus-current-startup-file ".eld"))
2761 (working-dir (file-name-directory gnus-current-startup-file))
2762 working-file
2764 ;; Generate the name of a non-existent file.
2765 (while (progn (setq working-file
2768 (not (gnus-long-file-names)))
2774 (file-exists-p working-file)))
2778 (gnus-with-output-to-file working-file
2784 ;; file.
2786 (buffer-file-name startup-file)
2787 (file-precious-flag t)
2788 (setmodes (file-modes startup-file)))
2789 ;; Backup the current version of the startup file.
2792 ;; Replace the existing startup file with the temp file.
2793 (rename-file working-file startup-file t)
2794 (set-file-modes startup-file setmodes)))
2796 (delete-file working-file)
2797 (file-error nil)))))
2801 5 "Saving %s.eld...done" gnus-current-startup-file))
2802 (gnus-dribble-delete-file)
2810 (princ ";; Gnus startup file.\n"))
2814 ;; Never delete this file -- if you want to force Gnus to read the
2815 ;; .newsrc file (if you have one), touch .newsrc instead.\n")
2816 (princ "(setq gnus-newsrc-file-version ")
2842 ;; Insert the variables into the file.
2863 ;; Generate and save the .newsrc file.
2865 (set-buffer (create-file-buffer gnus-current-startup-file))
2869 (setq buffer-file-name gnus-current-startup-file)
2870 (setq default-directory (file-name-directory buffer-file-name))
2905 ;; file seems to be off. We really do want to overwrite it, so
2912 (delete-file gnus-startup-file)
2913 (clear-visited-file-modtime))
2935 (mm-make-temp-file (concat gnus-current-startup-file "-slave-")))
2936 (modes (ignore-errors
2937 (file-modes (concat gnus-current-startup-file ".eld")))))
2938 (let ((coding-system-for-write gnus-ding-file-coding-system))
2940 (when modes
2941 (set-file-modes slave-name modes)))))
2946 (file-name-directory gnus-current-startup-file)
2950 (file-name-nondirectory gnus-current-startup-file)
2953 file)
2960 (sort (mapcar (lambda (file)
2961 (list (nth 5 (file-attributes file)) file))
2968 (setq file (nth 1 (car slave-files)))
2969 (nnheader-insert-file-contents file)
2975 (gnus-error 3.2 "Possible error in %s" file)
2979 (delete-file file))))
2997 (gnus-read-descriptions-file (car methods))
3001 (defun gnus-read-descriptions-file (&optional method)
3006 ;; We create the hashtable whether we manage to read the desc file
3011 ;; Mark this method's desc file as read.
3015 (gnus-message 5 "Reading descriptions file via %s..." (car method))
3072 (gnus-message 5 "Reading descriptions file...done")
3097 (file-exists-p gnus-default-directory))
3098 (file-name-as-directory (expand-file-name gnus-default-directory))