;;
;; NOTE: This is GNU Make specific.
(if (and (oref this automatic-dependencies) df)
- (insert "DEPS_MAGIC := $(shell mkdir .deps > /dev/null "
+ (insert "DEPS_MAGIC := $(shell mkdir .deps > " null-device " "
"2>&1 || :)\n"
"-include $(DEP_FILES)\n\n"))
;;
"Set handle INDEX, using MODE, to point to TARGET."
(when target
(if (and (stringp target)
- (or (string= target null-device)
- (string= target "/dev/null")))
+ (string= target (null-device)))
(aset eshell-current-handles index nil)
(let ((where (eshell-get-target target mode))
(current (car (aref eshell-current-handles index))))
(defun filesets-select-command (cmd-list)
"Select one command from CMD-LIST -- a string with space separated names."
(let ((this (shell-command-to-string
- (format "which --skip-alias %s 2> /dev/null | head -n 1"
- cmd-list))))
+ (format "which --skip-alias %s 2> %s | head -n 1"
+ cmd-list null-device))))
(if (equal this "")
nil
(file-name-nondirectory (substring this 0 (- (length this) 1))))))
(setq file (car file))
(with-temp-buffer
(shell-command
- (format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | ppmnorm 2>/dev/null | pnmscale -width 48 | ppmtopgm | pgmtopbm -threshold -value 0.92 | pbmtoxbm | compface"
- file)
+ (format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | ppmnorm 2>%s | pnmscale -width 48 | ppmtopgm | pgmtopbm -threshold -value 0.92 | pbmtoxbm | compface"
+ file null-device)
(current-buffer))
;;(sleep-for 3)
(delete-file file)
(let* ((coding-system-for-write 'binary)
(coding-system-for-read 'binary)
(data (shell-command-to-string
- (format "%s --list-options no-show-photos --attribute-fd 3 --list-keys %s 3>&1 >/dev/null 2>&1"
- (shell-quote-argument epg-gpg-program) key-id))))
+ (format "%s --list-options no-show-photos --attribute-fd 3 --list-keys %s 3>&1 >%s 2>&1"
+ (shell-quote-argument epg-gpg-program)
+ key-id null-device))))
(when (> (length data) 0)
(insert (substring data 16))
(condition-case nil
`smime-details-buffer'."
(smime-new-details-buffer)
(if (apply 'smime-call-openssl-region b e (list smime-details-buffer t)
- "smime" "-verify" "-noverify" "-out" '("/dev/null"))
+ "smime" "-verify" "-noverify" "-out" `(,null-device))
t
(insert-buffer-substring smime-details-buffer)
nil))
(cond
((or (member "code" result-params)
(member "pp" result-params))
- (format "(pretty (out \"/dev/null\" %s))" full-body))
+ (format "(pretty (out \"%s\" %s))" null-device full-body))
((and (member "value" result-params) (not session))
- (format "(print (out \"/dev/null\" %s))" full-body))
+ (format "(print (out \"%s\" %s))" null-device full-body))
((member "value" result-params)
- (format "(out \"/dev/null\" %s)" full-body))
+ (format "(out \"%s\" %s)" null-device full-body))
(t full-body)))
(result
(if (not (string= session-name "none"))
(process-name (concat "org-babel: terminal (" session ")")))
(apply 'start-process process-name "*Messages*"
terminal `("-T" ,(concat "org-babel: " session) "-e" ,org-babel-screen-location
- "-c" "/dev/null" "-mS" ,(concat "org-babel-session-" session)
+ "-c" ,null-device "-mS" ,(concat "org-babel-session-" session)
,cmd))
;; XXX: Is there a better way than the following?
(while (not (org-babel-screen-session-socketname session))
"Options to pass to the strfile program (a string)."
:type 'string)
-(defcustom fortune-quiet-strfile-options "> /dev/null"
+(defcustom fortune-quiet-strfile-options (concat "> " null-device)
"Text added to the command for running `strfile'.
By default it discards the output produced by `strfile'.
Set this to \"\" if you would like to see the output."
(defun cperl-pod2man-build-command ()
"Builds the entire background manpage and cleaning command."
- (let ((command (concat pod2man-program " %s 2>/dev/null"))
+ (let ((command (concat pod2man-program " %s 2>" null-device))
(flist (and (boundp 'Man-filter-list) Man-filter-list)))
(while (and flist (car flist))
(let ((pcom (car (car flist)))
(not (bolp))
?\n)
"exit:\n"
- "rm $tmp* >&/dev/null" > \n)
+ "rm $tmp* >&" null-device > \n)
(es (file-name-nondirectory (buffer-file-name))
> "local( signals = $signals sighup sigint;" \n
> "tmp = `{ mktemp -t " str ".XXXXXX } ) {" \n
> "catch @ e {" \n
- > "rm $tmp^* >[2]/dev/null" \n
+ > "rm $tmp^* >[2]" null-device \n
"throw $e" \n
"} {" > \n
_ \n
7 "EXIT")
(rc (file-name-nondirectory (buffer-file-name))
> "tmp = `{ mktemp -t " str ".XXXXXX }" \n
- "fn sigexit { rm $tmp^* >[2]/dev/null }" \n)
+ "fn sigexit { rm $tmp^* >[2]" null-device " }" \n)
(sh (file-name-nondirectory (buffer-file-name))
> "TMP=`mktemp -t " str ".XXXXXX`" \n
- "trap \"rm $TMP* 2>/dev/null\" " ?0 \n))
+ "trap \"rm $TMP* 2>" null-device "\" " ?0 \n))
(t "~/.history")))))
(if (or (equal comint-input-ring-file-name "")
(equal (file-truename comint-input-ring-file-name)
- (file-truename "/dev/null")))
+ (file-truename null-device)))
(setq comint-input-ring-file-name nil))
;; Arrange to write out the input ring on exit, if the shell doesn't
;; do this itself.
process-environment))
(apply #'start-process name buffer
"/bin/sh" "-c"
- (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\
+ (format "stty -nl echo rows %d columns %d sane 2>%s;\
if [ $1 = .. ]; then shift; fi; exec \"$@\""
- term-height term-width)
+ term-height term-width null-device)
".."
command switches)))
;; would look for non-existent files like
;; /dev/null.
(diff-find-source-location
- (not (equal "/dev/null"
+ (not (equal null-device
(car (diff-hunk-file-names t))))))
(other-buf nil)
(goto-otherbuf
(concat "diff.*\n"
"\\(?:\\(?:new file\\|deleted\\).*\n\\)?"
"\\(?:index.*\n\\)?"
- "--- \\(?:/dev/null\\|a/\\(.*\\)\\)\n"
- "\\+\\+\\+ \\(?:/dev/null\\|b/\\(.*\\)\\)\n"))))
+ "--- \\(?:" null-device "\\|a/\\(.*\\)\\)\n"
+ "\\+\\+\\+ \\(?:" null-device "\\|b/\\(.*\\)\\)\n"))))
(put-text-property (match-beginning 0)
(or (match-beginning 2) (match-beginning 1))
'display (propertize
(meta-patchbuf ediff-meta-patchbufer)
session-buf beg-marker end-marker)
- (if (or (file-directory-p file) (string-match "/dev/null" file))
+ (if (or (file-directory-p file) (string-match null-device file))
(user-error "`%s' is not an ordinary file" (file-name-as-directory file)))
(setq session-buf (ediff-get-session-buffer info)
beg-marker (ediff-get-session-objB-name info)
(let ((count 0)
(mark1 (point-min-marker))
(mark1-end (point-min))
- (possible-file-names '("/dev/null" . "/dev/null"))
+ (possible-file-names `(,null-device . ,null-device))
mark2-end mark2 filenames
beg1 beg2 end1 end2
patch-map opoint)
(setq possible-file-names
(cons (if (and beg1 end1)
(buffer-substring beg1 end1)
- "/dev/null")
+ null-device)
(if (and beg2 end2)
(buffer-substring beg2 end2)
- "/dev/null")))
+ null-device)))
;; Remove file junk (Bug#26084).
(while (re-search-backward
(concat "^\\(?:" diff-file-junk-re "\\)") mark1-end t)
(file-exists-p (cdr m2)))
(setq base-dir1 (car m1)
base-dir2 (car m2))))))))
- (or (string= (car proposed-file-names) "/dev/null")
+ (or (string= (car proposed-file-names) null-device)
(setcar proposed-file-names
(ediff-file-name-sans-prefix
(car proposed-file-names) base-dir1)))
(or (string=
- (cdr proposed-file-names) "/dev/null")
+ (cdr proposed-file-names) null-device)
(setcdr proposed-file-names
(ediff-file-name-sans-prefix
(cdr proposed-file-names) base-dir2)))
;; take the given file name into account
(or (file-directory-p filename)
- (string= "/dev/null" filename)
+ (string= null-device filename)
(setcar (ediff-get-session-objA (car ediff-patch-map))
(cons (file-name-nondirectory filename)
(file-name-nondirectory filename))))
patch-buf
(if (and ediff-patch-map
(not (string-match-p
- "^/dev/null"
+ (concat "^" null-device)
;; this is the file to patch
(ediff-get-session-objA-name (car ediff-patch-map))))
(> (length
;; Diff it against /dev/null.
(apply #'vc-do-command buffer
(if async 'async 1) "diff" file
- (append (vc-switches nil 'diff) '("/dev/null"))))))
+ (append (vc-switches nil 'diff) `(,(null-device)))))))
(setq files (nreverse filtered))))
(vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer async)
(set-buffer buffer)
(unless (equal link-to-new link-to-ori)
(setq changes t)
(if (equal link-to-new "") ;empty filename!
- (setq link-to-new "/dev/null"))
+ (setq link-to-new (null-device)))
(condition-case err
(progn
(delete-file link-from)