url-privacy.el 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ;;; url-privacy.el --- Global history tracking for URL package
  2. ;; Copyright (C) 1996-1999, 2004-2012 Free Software Foundation, Inc.
  3. ;; Keywords: comm, data, processes, hypermedia
  4. ;; This file is part of GNU Emacs.
  5. ;; GNU Emacs is free software: you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation, either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; GNU Emacs is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Code:
  16. (eval-when-compile (require 'cl))
  17. (require 'url-vars)
  18. (defun url-device-type (&optional device)
  19. (if (fboundp 'device-type)
  20. (device-type device) ; XEmacs
  21. (or window-system 'tty)))
  22. ;;;###autoload
  23. (defun url-setup-privacy-info ()
  24. "Setup variables that expose info about you and your system."
  25. (interactive)
  26. (setq url-system-type
  27. (cond
  28. ((or (eq url-privacy-level 'paranoid)
  29. (and (listp url-privacy-level)
  30. (memq 'os url-privacy-level)))
  31. nil)
  32. ;; First, we handle the inseparable OS/Windowing system
  33. ;; combinations
  34. ((eq system-type 'windows-nt) "Windows-NT; 32bit")
  35. ((eq system-type 'ms-dos) "MS-DOS; 32bit")
  36. ((memq (url-device-type) '(win32 w32)) "Windows; 32bit")
  37. ((eq (url-device-type) 'pm) "OS/2; 32bit")
  38. (t
  39. (case (url-device-type)
  40. (x "X11")
  41. (ns "OpenStep")
  42. (tty "TTY")
  43. (otherwise nil)))))
  44. (setq url-personal-mail-address (or url-personal-mail-address
  45. user-mail-address
  46. (format "%s@%s" (user-real-login-name)
  47. (system-name))))
  48. (if (or (memq url-privacy-level '(paranoid high))
  49. (and (listp url-privacy-level)
  50. (memq 'email url-privacy-level)))
  51. (setq url-personal-mail-address nil))
  52. (setq url-os-type
  53. (cond
  54. ((or (eq url-privacy-level 'paranoid)
  55. (and (listp url-privacy-level)
  56. (memq 'os url-privacy-level)))
  57. nil)
  58. ((boundp 'system-configuration) system-configuration)
  59. ((boundp 'system-type) (symbol-name system-type))
  60. (t nil))))
  61. (provide 'url-privacy)
  62. ;;; url-privacy.el ends here