comparison lisp/emulation/viper-util.el @ 16136:de1340e6ddb4

*** empty log message ***
author Michael Kifer <kifer@cs.stonybrook.edu>
date Fri, 06 Sep 1996 02:13:39 +0000
parents a0933adcee9e
children b2fae8abc5b0
comparison
equal deleted inserted replaced
16135:102e7d27c135 16136:de1340e6ddb4
201 (defsubst vip-get-cursor-color () 201 (defsubst vip-get-cursor-color ()
202 (if vip-emacs-p 202 (if vip-emacs-p
203 (cdr (assoc 'cursor-color (frame-parameters))) 203 (cdr (assoc 'cursor-color (frame-parameters)))
204 (color-instance-name (frame-property (selected-frame) 'cursor-color)))) 204 (color-instance-name (frame-property (selected-frame) 'cursor-color))))
205 205
206 (defun vip-set-face-pixmap (face pixmap)
207 "Set face pixmap on a monochrome display."
208 (if (and (vip-window-display-p) (not (vip-color-display-p)))
209 (condition-case nil
210 (set-face-background-pixmap face pixmap)
211 (error
212 (message "Pixmap not found for %S: %s" (face-name face) pixmap)
213 (sit-for 1)))))
214
206 215
207 ;; OS/2 216 ;; OS/2
208 (cond ((eq (vip-device-type) 'pm) 217 (cond ((eq (vip-device-type) 'pm)
209 (fset 'vip-color-defined-p 218 (fset 'vip-color-defined-p
210 (function (lambda (color) (assoc color pm-color-alist)))))) 219 (function (lambda (color) (assoc color pm-color-alist))))))
424 (t "sh"))) ; probably Unix anyway 433 (t "sh"))) ; probably Unix anyway
425 (gshell-options 434 (gshell-options
426 ;; using cond in anticipation of further additions 435 ;; using cond in anticipation of further additions
427 (cond (ex-unix-type-shell-options) 436 (cond (ex-unix-type-shell-options)
428 )) 437 ))
429 (command (cond (vip-ms-style-os-p (format "\"ls -1 %s\"" filespec)) 438 (command (cond (vip-ms-style-os-p (format "\"ls -1 -d %s\"" filespec))
430 (t (format "ls -1 %s" filespec)))) 439 (t (format "ls -1 -d %s" filespec))))
431 file-list) 440 file-list status)
432 (save-excursion 441 (save-excursion
433 (set-buffer (setq tmp-buf (get-buffer-create vip-ex-tmp-buf-name))) 442 (set-buffer (get-buffer-create vip-ex-tmp-buf-name))
434 (erase-buffer) 443 (erase-buffer)
435 (setq status 444 (setq status
436 (if gshell-options 445 (if gshell-options
437 (call-process gshell nil t nil 446 (call-process gshell nil t nil
438 gshell-options 447 gshell-options
468 The users of Unix-type shells should be able to use 477 The users of Unix-type shells should be able to use
469 `vip-ex-nontrivial-find-file-unix', making it into the value of the variable 478 `vip-ex-nontrivial-find-file-unix', making it into the value of the variable
470 `ex-nontrivial-find-file-function'. If this doesn't work, the user may have 479 `ex-nontrivial-find-file-function'. If this doesn't work, the user may have
471 to write a custom function, similar to `vip-ex-nontrivial-find-file-unix'." 480 to write a custom function, similar to `vip-ex-nontrivial-find-file-unix'."
472 (save-excursion 481 (save-excursion
473 (set-buffer (setq tmp-buf (get-buffer-create vip-ex-tmp-buf-name))) 482 (set-buffer (get-buffer-create vip-ex-tmp-buf-name))
474 (erase-buffer) 483 (erase-buffer)
475 (insert filespec) 484 (insert filespec)
476 (goto-char (point-min)) 485 (goto-char (point-min))
477 (mapcar 'find-file 486 (mapcar 'find-file
478 (vip-glob-ms-windows-files (vip-get-filenames-from-buffer))) 487 (vip-glob-ms-windows-files (vip-get-filenames-from-buffer)))
506 result)) 515 result))
507 516
508 ;; convert MS-DOS wildcards to regexp 517 ;; convert MS-DOS wildcards to regexp
509 (defun vip-wildcard-to-regexp (wcard) 518 (defun vip-wildcard-to-regexp (wcard)
510 (save-excursion 519 (save-excursion
511 (set-buffer (setq tmp-buf (get-buffer-create vip-ex-tmp-buf-name))) 520 (set-buffer (get-buffer-create vip-ex-tmp-buf-name))
512 (erase-buffer) 521 (erase-buffer)
513 (insert wcard) 522 (insert wcard)
514 (goto-char (point-min)) 523 (goto-char (point-min))
515 (while (not (eobp)) 524 (while (not (eobp))
516 (skip-chars-forward "^*?.\\\\") 525 (skip-chars-forward "^*?.\\\\")
742 (progn 751 (progn
743 (vip-overlay-put vip-search-overlay 'face vip-search-face) 752 (vip-overlay-put vip-search-overlay 'face vip-search-face)
744 (sit-for 2) 753 (sit-for 2)
745 (vip-overlay-put vip-search-overlay 'face nil)))) 754 (vip-overlay-put vip-search-overlay 'face nil))))
746 755
756
747 ;; Replace state 757 ;; Replace state
748 758
749 (defsubst vip-move-replace-overlay (beg end) 759 (defsubst vip-move-replace-overlay (beg end)
750 (vip-move-overlay vip-replace-overlay beg end)) 760 (vip-move-overlay vip-replace-overlay beg end))
751 761
1134 (vip-deflocalvar vip-SEP-char-class " -" 1144 (vip-deflocalvar vip-SEP-char-class " -"
1135 "String of syntax classes for Vi separators. 1145 "String of syntax classes for Vi separators.
1136 Usually contains ` ', linefeed, TAB or formfeed.") 1146 Usually contains ` ', linefeed, TAB or formfeed.")
1137 1147
1138 (defun vip-update-alphanumeric-class () 1148 (defun vip-update-alphanumeric-class ()
1139 "Set the syntactic class of Viper alphanumeric symbols according to 1149 "Set the syntax class of Viper alphanumerals according to `vip-syntax-preference'.
1140 the variable `vip-ALPHA-char-class'. Should be called in order for changes to 1150 Must be called in order for changes to `vip-syntax-preference' to take effect."
1141 `vip-ALPHA-char-class' to take effect."
1142 (interactive) 1151 (interactive)
1143 (setq-default 1152 (setq-default
1144 vip-ALPHA-char-class 1153 vip-ALPHA-char-class
1145 (cond ((eq vip-syntax-preference 'emacs) "w") ; only word constituents 1154 (cond ((eq vip-syntax-preference 'emacs) "w") ; only word constituents
1146 ((eq vip-syntax-preference 'extended) "w_") ; word & symbol chars 1155 ((eq vip-syntax-preference 'extended) "w_") ; word & symbol chars