Mercurial > hg > xemacs-beta
comparison lisp/viper/viper.el @ 155:43dd3413c7c7 r20-3b4
Import from CVS: tag r20-3b4
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:39:39 +0200 |
parents | 318232e2a3f0 |
children | 0132846995bd |
comparison
equal
deleted
inserted
replaced
154:94141801dd7e | 155:43dd3413c7c7 |
---|---|
6 ;; Keywords: emulations | 6 ;; Keywords: emulations |
7 ;; Author: Michael Kifer <kifer@cs.sunysb.edu> | 7 ;; Author: Michael Kifer <kifer@cs.sunysb.edu> |
8 | 8 |
9 ;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. | 9 ;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. |
10 | 10 |
11 (defconst viper-version "2.93 of March 9, 1997" | 11 (defconst viper-version "2.93 of May 20, 1997" |
12 "The current version of Viper") | 12 "The current version of Viper") |
13 | 13 |
14 ;; This file is part of GNU Emacs. | 14 ;; This file is part of GNU Emacs. |
15 | 15 |
16 ;; GNU Emacs is free software; you can redistribute it and/or modify | 16 ;; GNU Emacs is free software; you can redistribute it and/or modify |
3327 (defun vip-paren-match (arg) | 3327 (defun vip-paren-match (arg) |
3328 "Go to the matching parenthesis." | 3328 "Go to the matching parenthesis." |
3329 (interactive "P") | 3329 (interactive "P") |
3330 (vip-leave-region-active) | 3330 (vip-leave-region-active) |
3331 (let ((com (vip-getcom arg)) | 3331 (let ((com (vip-getcom arg)) |
3332 parse-sexp-ignore-comments anchor-point) | 3332 (parse-sexp-ignore-comments vip-parse-sexp-ignore-comments) |
3333 anchor-point) | |
3333 (if (integerp arg) | 3334 (if (integerp arg) |
3334 (if (or (> arg 99) (< arg 1)) | 3335 (if (or (> arg 99) (< arg 1)) |
3335 (error "Prefix must be between 1 and 99") | 3336 (error "Prefix must be between 1 and 99") |
3336 (goto-char | 3337 (goto-char |
3337 (if (> (point-max) 80000) | 3338 (if (> (point-max) 80000) |
3369 (forward-char) | 3370 (forward-char) |
3370 (if com (vip-move-marker-locally 'vip-com-point (point))) | 3371 (if com (vip-move-marker-locally 'vip-com-point (point))) |
3371 (backward-sexp 1) | 3372 (backward-sexp 1) |
3372 (if com (vip-execute-com 'vip-paren-match nil com))) | 3373 (if com (vip-execute-com 'vip-paren-match nil com))) |
3373 (t (error "")))))) | 3374 (t (error "")))))) |
3375 | |
3376 (defun vip-toggle-parse-sexp-ignore-comments () | |
3377 (interactive) | |
3378 (setq vip-parse-sexp-ignore-comments (not vip-parse-sexp-ignore-comments)) | |
3379 (prin1 (format "`%%' will %signore parentheses inside the comments" | |
3380 (if vip-parse-sexp-ignore-comments "" "NOT "))) | |
3381 ) | |
3374 | 3382 |
3375 | 3383 |
3376 ;; sentence ,paragraph and heading | 3384 ;; sentence ,paragraph and heading |
3377 | 3385 |
3378 (defun vip-forward-sentence (arg) | 3386 (defun vip-forward-sentence (arg) |
5236 (vector vip-repeat-from-history-key '\2) 'vi-state | 5244 (vector vip-repeat-from-history-key '\2) 'vi-state |
5237 [(meta x) v i p - r e p e a t - f r o m - h i s t o r y return] 't) | 5245 [(meta x) v i p - r e p e a t - f r o m - h i s t o r y return] 't) |
5238 | 5246 |
5239 ;; set the toggle case sensitivity and regexp search macros | 5247 ;; set the toggle case sensitivity and regexp search macros |
5240 (vip-set-vi-search-style-macros nil) | 5248 (vip-set-vi-search-style-macros nil) |
5249 | |
5250 ;; Make %%% toggle parsing comments for matching parentheses | |
5251 (vip-record-kbd-macro | |
5252 "%%%" 'vi-state | |
5253 [(meta x) v i p - t o g g l e - p a r s e - s e x p - i g n o r e - c o m m e n t s return] | |
5254 't) | |
5241 | 5255 |
5242 | 5256 |
5243 ;; ~/.vip is loaded if it exists | 5257 ;; ~/.vip is loaded if it exists |
5244 (if (and (file-exists-p vip-custom-file-name) | 5258 (if (and (file-exists-p vip-custom-file-name) |
5245 (not noninteractive)) | 5259 (not noninteractive)) |