• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/gnus/

Lines Matching +defs:file +defs:type

10 ;; This file is part of GNU Emacs.
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
77 "*Default actions to be taken when the user asks to view a file.
84 following in your .emacs file:
89 first string is a regular expression. If the file name matches this
91 the file as an argument.
93 If the command string contains \"%s\", the file name will be inserted
95 command string, the file name will be appended to the command string
101 file. If this variable contains no matches, gnus-uu examines the
106 :type '(repeat (group regexp (string :tag "Command"))))
109 "What actions are to be taken to view a file.
113 :type '(repeat (group regexp (string :tag "Command"))))
116 '(("" "file"))
117 "*What actions are to be taken if no rule matched the file name.
121 :type '(repeat (group regexp (string :tag "Command"))))
137 :type '(repeat (group regexp (string :tag "Command"))))
150 :type '(repeat (group regexp (string :tag "Command"))))
160 `gnus-uu-ignore-files-by-type' variable."
162 :type '(choice (const :tag "off" nil)
165 (defcustom gnus-uu-ignore-files-by-type nil
166 "*A regular expression saying what files that shouldn't be viewed, based on MIME file type.
170 (setq gnus-uu-ignore-files-by-type \"audio/\\\\|video/mpeg\")
175 :type '(choice (const :tag "off" nil)
223 ((boundp 'temporary-file-directory) temporary-file-directory)
228 :type 'directory)
234 :type 'boolean)
240 :type 'boolean)
242 (defcustom gnus-uu-grabbed-file-functions nil
243 "Functions run on each file after successful decoding.
244 They will be called with the name of the file as the argument.
249 :type 'hook)
255 :type 'boolean)
261 :type 'boolean)
266 to guess at a content-type based on file name suffixes. Default
269 :type 'boolean)
275 :type 'boolean)
281 :type 'boolean)
286 file without any embellishments. The digesting almost conforms to RFC1153 -
290 :type 'boolean)
295 :type 'hook)
306 :type '(repeat regexp))
311 :type 'boolean)
318 :type '(choice (const :tag "conservative" nil)
339 (defvar gnus-uu-shar-file-name nil)
346 (defvar gnus-uu-file-name nil)
366 "Decodes and saves the resulting file."
369 (file-name-as-directory
370 (read-file-name "Uudecode and save in dir: "
384 (file-name-as-directory
385 (read-file-name "Unshar and save in dir: "
390 (defun gnus-uu-decode-save (n file)
394 (read-file-name
397 "Save articles in file: ")
400 (setq gnus-uu-saved-article-name file)
407 (file-name-as-directory
408 (read-file-name "Unbinhex and save in dir: "
412 (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir)))
422 "Decodes, views and saves the resulting file."
425 (read-file-name "Uudecode, view and save in dir: "
441 (read-file-name "Unshar, view and save in dir: "
447 (defun gnus-uu-decode-save-view (n file)
451 (read-file-name (if gnus-uu-save-separate-articles
453 "Save articles in file: ")
456 (gnus-uu-decode-save n file)))
458 (defun gnus-uu-decode-binhex-view (n file)
462 (read-file-name "Unbinhex, view and save in dir: "
465 (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir)))
467 (gnus-uu-decode-binhex n file)))
476 (file (mm-make-temp-file (nnheader-concat gnus-uu-tmp-dir "forward")))
489 (gnus-uu-decode-save n file)
717 (file-name-as-directory
718 (read-file-name "Save in dir: "
725 "Decodes, views and saves the resulting file."
728 (read-file-name "Where do you want to save the file(s)? "
744 (not (file-exists-p save)))
763 out file)
764 (while (setq file (pop files))
765 (unless (member (file-name-nondirectory file) '("." ".."))
766 (push (list (cons 'name file)
769 (when (file-directory-p file)
770 (setq out (nconc (gnus-uu-scan-directory file t) out)))))
779 to-file file fromdir)
780 (while (setq file (cdr (assq 'name (pop files))))
781 (when (file-exists-p file)
782 (string-match reg file)
783 (setq fromdir (substring file (match-end 0)))
784 (if (file-directory-p file)
786 (setq to-file (concat dir fromdir))
787 (when (or (not (file-exists-p to-file))
791 to-file))))
792 (copy-file file to-file t t)))))
793 (gnus-message 5 "Saved %d file%s" len (if (= len 1) "" "s"))))
826 (let ((name (file-name-nondirectory gnus-uu-saved-article-name))
843 "<#mml type=message/rfc822>\nSubject: Topics\n\n<#/mml>\n")
893 (insert "\n<#mml type=message/rfc822>\n")
906 (insert "\n<#part type=message/rfc822"
947 (file-name-coding-system nnmail-pathname-coding-system))
974 (setq state (list 'wrong-type))))
976 (if (memq 'wrong-type state)
996 (when (file-exists-p gnus-uu-binhex-article-name)
997 (mm-append-to-file start-char (point) gnus-uu-binhex-article-name))))
1006 start-char end-char file-name)
1011 (setq state (list 'wrong-type))
1015 (setq state (list 'wrong-type))
1019 (setq file-name (concat gnus-uu-work-dir
1021 (write-region (point-min) (point-max) file-name)
1022 (setq state (list file-name 'begin 'end)))))
1036 (cons 'action "file")
1044 (defun gnus-uu-get-action (file-name)
1048 file-name
1058 (gnus-uu-choose-action file-name gnus-uu-ext-to-mime-list))
1214 ;; `begin' if the beginning of an encoded file has been received
1216 ;; the list *must* be a string with the file name of the decoded
1217 ;; file.
1218 ;; `end' if the end of an encoded file has been received
1219 ;; `middle' if the article was a body part of an encoded file
1220 ;; `wrong-type' if the article was not a part of an encoded file
1249 has-been-begin article result-file result-files process-state
1285 ;; If this is the beginning of a decoded file, we push it
1292 ;; If there is a `result-file' here, that means that the
1293 ;; file was unsuccessfully decoded, so we delete it.
1294 (when (and result-file
1295 (file-exists-p result-file)
1299 (format "Delete unsuccessfully decoded file %s? "
1300 result-file))))
1301 (delete-file result-file)))
1303 (setq result-file (car process-state)))
1306 ;; Check whether we have decoded one complete file.
1310 (if (stringp result-file)
1311 (setq files (list result-file))
1312 (setq files result-file))
1313 (setq result-file (car files))
1318 ;; Allow user-defined functions to be run on this file.
1319 (when gnus-uu-grabbed-file-functions
1320 (let ((funcs gnus-uu-grabbed-file-functions))
1324 (funcall (pop funcs) result-file))))
1325 (setq result-file nil)
1332 ;; the partially decoded file.
1335 result-file
1336 (file-exists-p result-file)
1340 (format "Delete incomplete file %s? " result-file)))
1341 (delete-file result-file))
1343 ;; If this was a file of the wrong sort, then
1344 (when (and (or (memq 'wrong-type process-state)
1365 (gnus-message 2 "Wrong type file"))
1370 (gnus-message 2 "End of articles reached before end of file")))
1381 (defun gnus-uu-grab-view (file)
1383 (let ((action (gnus-uu-get-action file)))
1386 (format action file)
1387 (concat action " " file))
1390 (defun gnus-uu-grab-move (file)
1393 (let ((to-file (concat (file-name-as-directory gnus-uu-default-dir)
1394 (file-name-nondirectory file))))
1395 (rename-file file to-file)
1396 (unless (file-exists-p file)
1397 (make-symbolic-link to-file file)))))
1418 ;; Uudecodes a file asynchronously.
1421 (let ((state (list 'wrong-type))
1422 process-connection-type case-fold-search buffer-read-only
1443 (setq gnus-uu-file-name
1445 mm-file-name-rewrite-functions
1446 (file-name-nondirectory (match-string 1))))
1447 (replace-match (concat "begin 644 " gnus-uu-file-name) t t)
1471 shell-file-name shell-command-switch
1478 (push (concat gnus-uu-work-dir gnus-uu-file-name) files))
1503 (setq state (list 'wrong-type)))))
1516 (setq state (list 'wrong-type)))))))
1546 (setq state (list 'wrong-type))
1567 start-char (point-max) shell-file-name nil
1574 ;; Returns the name of what the shar file is going to unpack.
1585 ;; and `gnus-uu-file-action-list'. Returns either nil if no action is
1587 (defun gnus-uu-choose-action (file-name file-action-list &optional no-ignore)
1588 (let ((action-list (copy-sequence file-action-list))
1595 (string-match gnus-uu-ignore-files-by-name file-name)))
1597 (and gnus-uu-ignore-files-by-type
1598 (string-match gnus-uu-ignore-files-by-type
1600 file-name gnus-uu-ext-to-mime-list t)
1605 (when (string-match (car rule) file-name)
1609 (defun gnus-uu-treat-archive (file-path)
1614 file-path (append gnus-uu-user-archive-rules
1620 (error "No unpackers for the file %s" file-path))
1622 (string-match "/[^/]*$" file-path)
1623 (setq dir (substring file-path 0 (match-beginning 0)))
1626 (copy-file file-path (concat file-path "~") t))
1628 (setq command (format "cd %s ; %s" dir (gnus-uu-command action file-path)))
1634 (gnus-message 5 "Unpacking: %s..." (gnus-uu-command action file-path))
1636 (if (eq 0 (call-process shell-file-name nil
1644 (rename-file (concat file-path "~") file-path t))
1650 files file)
1652 (if (file-directory-p (setq file (car dirs)))
1653 (setq files (append files (gnus-uu-dir-files file)))
1654 (push file files))
1662 file did-unpack)
1664 (setq file (cdr (assq 'name (car files))))
1665 (when (and (not (member file ignore))
1666 (equal (gnus-uu-get-action (file-name-nondirectory file))
1668 (push file did-unpack)
1669 (unless (gnus-uu-treat-archive file)
1670 (gnus-message 2 "Error during unpacking of %s" file))
1676 (cons 'original file))
1689 (when (file-directory-p (car files))
1698 (let (files out file)
1701 (setq file (car files))
1703 (unless (member (file-name-nondirectory file) '("." ".."))
1704 (push file out)))
1747 (if (file-exists-p (cdr entry))
1752 (setq gnus-uu-tmp-dir (file-name-as-directory
1753 (expand-file-name gnus-uu-tmp-dir)))
1754 (if (not (file-directory-p gnus-uu-tmp-dir))
1756 (when (not (file-writable-p gnus-uu-tmp-dir))
1761 (mm-make-temp-file (concat gnus-uu-tmp-dir "gnus") 'dir))
1762 (set-file-modes gnus-uu-work-dir 448)
1763 (setq gnus-uu-work-dir (file-name-as-directory gnus-uu-work-dir))
1781 (defun gnus-uu-command (action file)
1782 (let ((quoted-file (mm-quote-arg file)))
1784 (format action quoted-file)
1785 (concat action " " quoted-file))))
1793 (file-exists-p dir))
1795 file)
1796 (while (setq file (pop files))
1797 (unless (member (file-name-nondirectory file) '("." ".."))
1798 (if (file-directory-p file)
1799 (gnus-uu-delete-work-dir file)
1800 (gnus-message 9 "Deleting file %s..." file)
1802 (delete-file file)
1803 (error (gnus-message 3 "Deleting file %s failed... %s" file err))))))
1806 (error (gnus-message 3 "Deleting directory %s failed... %s" file err))))
1833 :type '(radio (function-item gnus-uu-post-encode-uuencode)
1839 "Non-nil means that gnus-uu will ask for a file to encode before you compose the article.
1840 If this variable is t, you can either include an encoded file with
1843 :type 'boolean)
1847 The encoded file will be split into how many articles it takes to
1848 post the entire file."
1850 :type 'integer)
1853 "Non-nil means that gnus-uu will post the encoded file in a thread.
1859 :type 'boolean)
1868 :type 'boolean)
1872 (defvar gnus-uu-post-inserted-file-name nil)
1876 "Compose an article and post an encoded file."
1878 (setq gnus-uu-post-inserted-file-name nil)
1892 (save-excursion (setq gnus-uu-post-inserted-file-name
1896 "Inserts an encoded file in the buffer.
1897 The user will be asked for a file name."
1900 (setq gnus-uu-post-inserted-file-name (gnus-uu-post-insert-binary))))
1903 (defun gnus-uu-post-encode-uuencode (path file-name)
1904 (when (gnus-uu-post-encode-file "uuencode" path file-name)
1912 (defun gnus-uu-post-encode-mime-uuencode (path file-name)
1913 (when (gnus-uu-post-encode-uuencode path file-name)
1914 (gnus-uu-post-make-mime file-name "x-uue")
1918 (defun gnus-uu-post-encode-mime (path file-name)
1919 (when (eq 0 (call-process shell-file-name nil t nil shell-command-switch
1920 (format "%s %s -o %s" "mmencode" path file-name)))
1921 (gnus-uu-post-make-mime file-name "base64")
1925 (defun gnus-uu-post-make-mime (file-name encoding)
1928 (gnus-uu-choose-action file-name gnus-uu-ext-to-mime-list)
1929 file-name))
1942 ;; Encodes a file PATH with COMMAND, leaving the result in the
1944 (defun gnus-uu-post-encode-file (command path file-name)
1945 (eq 0 (call-process shell-file-name nil t nil shell-command-switch
1946 (format "%s %s %s" command path file-name))))
1949 "Posts the composed news article and encoded file.
1950 If no file has been included, the user will be asked for a file."
1953 (let (file-name)
1955 (if gnus-uu-post-inserted-file-name
1956 (setq file-name gnus-uu-post-inserted-file-name)
1957 (setq file-name (gnus-uu-post-insert-binary)))
1959 (gnus-uu-post-encoded file-name gnus-uu-post-threaded))
1960 (setq gnus-uu-post-inserted-file-name nil)
1964 ;; Asks for a file to encode, encodes it and inserts the result in
1965 ;; the current buffer. Returns the file name the user gave.
1968 file-path uubuf file-name)
1970 (setq file-path (read-file-name
1971 "What file do you want to encode? "))
1972 (when (not (file-exists-p file-path))
1973 (error "%s: No such file" file-path))
1979 (when (string-match "^~/" file-path)
1980 (setq file-path (concat "$HOME" (substring file-path 1))))
1982 (if (string-match "/[^/]*$" file-path)
1983 (setq file-name (substring file-path (1+ (match-beginning 0))))
1984 (setq file-name file-path))
1991 (funcall gnus-uu-post-encode-method file-path file-name))
1995 file-name))
1997 ;; Posts the article and all of the encoded file.
1998 (defun gnus-uu-post-encoded (file-name &optional threaded)
2061 (- 62 (length (format top-string "" file-name i parts ""))))
2068 file-name i parts