comparison lisp/x-init.el @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 3ecd8885ac67
children 54fa1a5c2d12
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
53 ;; and not be hilighted, if it is in the active state and then some other 53 ;; and not be hilighted, if it is in the active state and then some other
54 ;; application asserts the selection. This is probably not a big deal. 54 ;; application asserts the selection. This is probably not a big deal.
55 55
56 (defun x-activate-region-as-selection () 56 (defun x-activate-region-as-selection ()
57 (if (marker-buffer (mark-marker t)) 57 (if (marker-buffer (mark-marker t))
58 (x-own-selection (cons (point-marker t) (mark-marker t))))) 58 (own-selection (cons (point-marker t) (mark-marker t)))))
59 59
60 ;; OpenWindows-like "find" processing. These functions are really Sunisms, 60 ;; OpenWindows-like "find" processing. These functions are really Sunisms,
61 ;; but we put them here instead of in x-win-sun.el in case someone wants 61 ;; but we put them here instead of in x-win-sun.el in case someone wants
62 ;; to use them when not running on a Sun console (presumably after binding 62 ;; to use them when not running on a Sun console (presumably after binding
63 ;; them to different keys, or putting them on menus.) 63 ;; them to different keys, or putting them on menus.)
66 (defvar ow-find-last-clipboard nil) 66 (defvar ow-find-last-clipboard nil)
67 67
68 (defun ow-find (&optional backward-p) 68 (defun ow-find (&optional backward-p)
69 "Search forward the next occurrence of the text of the selection." 69 "Search forward the next occurrence of the text of the selection."
70 (interactive) 70 (interactive)
71 (let ((sel (condition-case () (x-get-selection) (error nil))) 71 (let ((sel (ignore-errors (get-selection)))
72 (clip (condition-case () (x-get-clipboard) (error nil))) 72 (clip (ignore-errors (get-clipboard)))
73 text) 73 text)
74 (setq text (cond 74 (setq text (cond
75 (sel) 75 (sel)
76 ((not (equal clip ow-find-last-clipboard)) 76 ((not (equal clip ow-find-last-clipboard))
77 (setq ow-find-last-clipboard clip)) 77 (setq ow-find-last-clipboard clip))
303 ;; any toolbar-related color resources. 303 ;; any toolbar-related color resources.
304 (if (and (not (featurep 'infodock)) (featurep 'toolbar)) 304 (if (and (not (featurep 'infodock)) (featurep 'toolbar))
305 (init-x-toolbar)) 305 (init-x-toolbar))
306 (if (and (featurep 'infodock) (featurep 'toolbar)) 306 (if (and (featurep 'infodock) (featurep 'toolbar))
307 (require 'id-x-toolbar)) 307 (require 'id-x-toolbar))
308 (if (featurep 'mule) 308 (if (featurep 'gutter) (init-gutter))
309 (init-mule-x-win)) 309 (if (featurep 'mule) (init-mule-x-win))
310 ;; these are only ever called if zmacs-regions is true. 310 ;; these are only ever called if zmacs-regions is true.
311 (add-hook 'zmacs-deactivate-region-hook 311 (add-hook 'zmacs-deactivate-region-hook
312 (lambda () 312 (lambda ()
313 (when (console-on-window-system-p) 313 (when (console-on-window-system-p)
314 (x-disown-selection)))) 314 (disown-selection))))
315 (add-hook 'zmacs-activate-region-hook 315 (add-hook 'zmacs-activate-region-hook
316 (lambda () 316 (lambda ()
317 (when (console-on-window-system-p) 317 (when (console-on-window-system-p)
318 (x-activate-region-as-selection)))) 318 (x-activate-region-as-selection))))
319 (add-hook 'zmacs-update-region-hook 319 (add-hook 'zmacs-update-region-hook