url-privacy.el 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ;;; url-privacy.el --- Global history tracking for URL package
  2. ;; Copyright (C) 1996-1999, 2004-2015 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. (require 'url-vars)
  17. (defun url-device-type (&optional device)
  18. (if (fboundp 'device-type)
  19. (device-type device) ; XEmacs
  20. (or window-system 'tty)))
  21. ;;;###autoload
  22. (defun url-setup-privacy-info ()
  23. "Setup variables that expose info about you and your system."
  24. (interactive)
  25. (setq url-system-type
  26. (cond
  27. ((or (eq url-privacy-level 'paranoid)
  28. (and (listp url-privacy-level)
  29. (memq 'os url-privacy-level)))
  30. nil)
  31. ;; First, we handle the inseparable OS/Windowing system
  32. ;; combinations
  33. ((eq system-type 'windows-nt) "Windows-NT; 32bit")
  34. ((eq system-type 'ms-dos) "MS-DOS; 32bit")
  35. ((memq (url-device-type) '(win32 w32)) "Windows; 32bit")
  36. ((eq (url-device-type) 'pm) "OS/2; 32bit")
  37. (t
  38. (pcase (url-device-type)
  39. (`x "X11")
  40. (`ns "OpenStep")
  41. (`tty "TTY")
  42. (_ nil)))))
  43. (setq url-personal-mail-address (or url-personal-mail-address
  44. user-mail-address
  45. (format "%s@%s" (user-real-login-name)
  46. (system-name))))
  47. (if (or (memq url-privacy-level '(paranoid high))
  48. (and (listp url-privacy-level)
  49. (memq 'email url-privacy-level)))
  50. (setq url-personal-mail-address nil))
  51. (setq url-os-type
  52. (cond
  53. ((or (eq url-privacy-level 'paranoid)
  54. (and (listp url-privacy-level)
  55. (memq 'os url-privacy-level)))
  56. nil)
  57. ((boundp 'system-configuration) system-configuration)
  58. ((boundp 'system-type) (symbol-name system-type))
  59. (t nil))))
  60. (provide 'url-privacy)
  61. ;;; url-privacy.el ends here