Mercurial > hg > xemacs-beta
comparison lisp/utils/passwd.el @ 155:43dd3413c7c7 r20-3b4
Import from CVS: tag r20-3b4
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:39:39 +0200 |
parents | cca96a509cfe |
children | 3bb7ccffb0c0 |
comparison
equal
deleted
inserted
replaced
154:94141801dd7e | 155:43dd3413c7c7 |
---|---|
40 (defgroup passwd nil | 40 (defgroup passwd nil |
41 "Prompting for passwords semi-securely" | 41 "Prompting for passwords semi-securely" |
42 :group 'processes) | 42 :group 'processes) |
43 | 43 |
44 | 44 |
45 (defcustom passwd-invert-frame-when-keyboard-grabbed t | 45 (defcustom passwd-invert-frame-when-keyboard-grabbed (not (featurep 'infodock)) |
46 "*If non-nil swap the foreground and background colors of all faces. | 46 "*If non-nil swap the foreground and background colors of all faces. |
47 This is done while the keyboard is grabbed in order to give a visual | 47 This is done while the keyboard is grabbed in order to give a visual |
48 clue that a grab is in effect." | 48 clue that a grab is in effect." |
49 :type 'boolean | 49 :type 'boolean |
50 :group 'passwd) | 50 :group 'passwd) |
315 (list face | 315 (list face |
316 (color-name fg) | 316 (color-name fg) |
317 (color-name bg)) | 317 (color-name bg)) |
318 (list face fg bg)) | 318 (list face fg bg)) |
319 nil)))) | 319 nil)))) |
320 (if (fboundp 'list-faces) | 320 (face-list) |
321 (list-faces) ; lemacs | 321 ))) |
322 (face-list) ; FSFmacs | |
323 )))) | |
324 (let ((rest passwd-face-data)) | 322 (let ((rest passwd-face-data)) |
325 (while rest | 323 (while rest |
326 (set-face-foreground (nth 0 (car rest)) (nth 2 (car rest))) | 324 (set-face-foreground (nth 0 (car rest)) (nth 2 (car rest))) |
327 (set-face-background (nth 0 (car rest)) (nth 1 (car rest))) | 325 (set-face-background (nth 0 (car rest)) (nth 1 (car rest))) |
328 (setq rest (cdr rest)))))) | 326 (setq rest (cdr rest)))))) |
342 | 340 |
343 (defun passwd-grab-keyboard () | 341 (defun passwd-grab-keyboard () |
344 (cond ((not (and (fboundp 'x-grab-keyboard) ; lemacs 19.10+ | 342 (cond ((not (and (fboundp 'x-grab-keyboard) ; lemacs 19.10+ |
345 (eq 'x (if (fboundp 'frame-type) | 343 (eq 'x (if (fboundp 'frame-type) |
346 (frame-type (selected-frame)) | 344 (frame-type (selected-frame)) |
347 (live-screen-p (selected-screen)))))) | 345 (frame-live-p (selected-frame)))))) |
348 nil) | 346 nil) |
349 ((x-grab-keyboard) | 347 ((x-grab-keyboard) |
350 t) | 348 t) |
351 (t | 349 (t |
352 (message "Unable to grab keyboard - waiting a second...") | 350 (message "Unable to grab keyboard - waiting a second...") |
362 | 360 |
363 (defun passwd-ungrab-keyboard () | 361 (defun passwd-ungrab-keyboard () |
364 (if (and (fboundp 'x-ungrab-keyboard) ; lemacs 19.10+ | 362 (if (and (fboundp 'x-ungrab-keyboard) ; lemacs 19.10+ |
365 (eq 'x (if (fboundp 'frame-type) | 363 (eq 'x (if (fboundp 'frame-type) |
366 (frame-type (selected-frame)) | 364 (frame-type (selected-frame)) |
367 (live-screen-p (selected-screen))))) | 365 (frame-live-p (selected-frame))))) |
368 (x-ungrab-keyboard))) | 366 (x-ungrab-keyboard))) |
369 | 367 |
370 ;; v18 compatibility | 368 ;; v18 compatibility |
371 (or (fboundp 'buffer-disable-undo) | 369 (or (fboundp 'buffer-disable-undo) |
372 (fset 'buffer-disable-undo 'buffer-flush-undo)) | 370 (fset 'buffer-disable-undo 'buffer-flush-undo)) |