1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

2007-06-12 Michael Kifer <kifer@cs.stonybrook.edu>

* viper-cmd.el (viper-prefix-arg-com,viper-prefix-arg-value): display
	error messages
	(viper-prev-destructive-command,viper-insert-prev-from-insertion-ring):
	get rid of cl.el dependencies.

	* viper-init.el (viper-suppress-input-method-change-message): new
	variable.
	(viper-activate-input-method-action,viper-inactivate-input-method-action):
	use viper-suppress-input-method-change-message.

	* viper-kem.el (viper-vi-basic-map): disable the bindings for C-s, C-r.

	* viper-util.el (viper-set-cursor-color-according-to-state): use
	viper-replace-overlay-cursor-color instead of
	viper-replace-overlay-cursor-color.
	(viper-sit-for-short): use sit-for with 3 arguments.

	* viper.el (viper-insert-state-mode-list): add gud-mode.
	(viper-major-mode-modifier-list): add viper-comint-mode-modifier-map to
	gud-mode.

	* ediff-mult.el
	(ediff-meta-buffer-brief-message,ediff-meta-buffer-verbose-message):
	new variables.
	(ediff-meta-buffer-message): variable deleted.
	(ediff-verbose-help-enabled): new variable.
	(ediff-toggle-verbose-help-meta-buffer): new function.
	(ediff-redraw-directory-group-buffer): made aware of short/verbose
	message options

	* ediff-ptch.el (ediff-context-diff-label-regexp): better regexp.
	(ediff-fixup-patch-map): improved heuristic.
This commit is contained in:
Michael Kifer 2007-06-12 19:20:25 +00:00
parent 95588f91ba
commit ac64a7284e
9 changed files with 113 additions and 45 deletions

View file

@ -1,3 +1,38 @@
2007-06-12 Michael Kifer <kifer@cs.stonybrook.edu>
* emulation/viper-cmd.el (viper-prefix-arg-com,viper-prefix-arg-value): display
error messages
(viper-prev-destructive-command,viper-insert-prev-from-insertion-ring):
get rid of cl.el dependencies.
* emulation/viper-init.el (viper-suppress-input-method-change-message): new
variable.
(viper-activate-input-method-action,viper-inactivate-input-method-action):
use viper-suppress-input-method-change-message.
* emulation/viper-kem.el (viper-vi-basic-map): disable the bindings for C-s, C-r.
* emulation/viper-util.el (viper-set-cursor-color-according-to-state): use
viper-replace-overlay-cursor-color instead of
viper-replace-overlay-cursor-color.
(viper-sit-for-short): use sit-for with 3 arguments.
* emulation/viper.el (viper-insert-state-mode-list): add gud-mode.
(viper-major-mode-modifier-list): add viper-comint-mode-modifier-map to
gud-mode.
* ediff-mult.el
(ediff-meta-buffer-brief-message,ediff-meta-buffer-verbose-message):
new variables.
(ediff-meta-buffer-message): variable deleted.
(ediff-verbose-help-enabled): new variable.
(ediff-toggle-verbose-help-meta-buffer): new function.
(ediff-redraw-directory-group-buffer): made aware of short/verbose
message options
* ediff-ptch.el (ediff-context-diff-label-regexp): better regexp.
(ediff-fixup-patch-map): improved heuristic.
2007-06-12 Stefan Monnier <monnier@iro.umontreal.ca> 2007-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
* log-view.el (log-view-file-re, log-view-message-re): Use \(?1:...\). * log-view.el (log-view-file-re, log-view-message-re): Use \(?1:...\).

View file

@ -338,7 +338,7 @@ when editing big diffs)."
("^--- .+ ----$" . diff-hunk-header-face) ;context ("^--- .+ ----$" . diff-hunk-header-face) ;context
("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ;normal ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ;normal
("^---$" . diff-hunk-header-face) ;normal ("^---$" . diff-hunk-header-face) ;normal
("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n" ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t]+\\)\\(.*[^*-]\\)?\n"
(0 diff-header-face) (2 diff-file-header-face prepend)) (0 diff-header-face) (2 diff-file-header-face prepend))
("^\\([-<]\\)\\(.*\n\\)" ("^\\([-<]\\)\\(.*\n\\)"
(1 diff-indicator-removed-face) (2 diff-removed-face)) (1 diff-indicator-removed-face) (2 diff-removed-face))

View file

@ -129,9 +129,15 @@
;; the registry buffer ;; the registry buffer
(defvar ediff-registry-buffer nil) (defvar ediff-registry-buffer nil)
(defconst ediff-meta-buffer-message "This is an Ediff Session Group Panel: %s (defconst ediff-meta-buffer-brief-message "Ediff Session Group Panel: %s
Useful commands: Type ? to show useful commands in this buffer
")
(defconst ediff-meta-buffer-verbose-message "Ediff Session Group Panel: %s
Useful commands (type ? to hide them and free up screen):
button2, v, or RET over session record: start that Ediff session button2, v, or RET over session record: start that Ediff session
M:\tin sessions invoked from here, brings back this group panel M:\tin sessions invoked from here, brings back this group panel
R:\tdisplay the registry of active Ediff sessions R:\tdisplay the registry of active Ediff sessions
@ -360,10 +366,24 @@ buffers."
(if (stringp (ediff-get-session-objC-name session-info)) (if (stringp (ediff-get-session-objC-name session-info))
(file-directory-p (ediff-get-session-objC-name session-info)) t))) (file-directory-p (ediff-get-session-objC-name session-info)) t)))
(ediff-defvar-local ediff-verbose-help-enabled nil
"If t, display redundant help in ediff-directories and other meta buffers.
Toggled by ediff-toggle-verbose-help-meta-buffer" )
;; Toggle verbose help in meta-buffers
;; TODO: Someone who understands all this can make it better.
(defun ediff-toggle-verbose-help-meta-buffer ()
"Toggle showing tediously verbose help in meta buffers."
(interactive)
(setq ediff-verbose-help-enabled (not ediff-verbose-help-enabled))
(ediff-update-meta-buffer (current-buffer) 'must-redraw))
;; set up the keymap in the meta buffer ;; set up the keymap in the meta buffer
(defun ediff-setup-meta-map () (defun ediff-setup-meta-map ()
(setq ediff-meta-buffer-map (make-sparse-keymap)) (setq ediff-meta-buffer-map (make-sparse-keymap))
(suppress-keymap ediff-meta-buffer-map) (suppress-keymap ediff-meta-buffer-map)
(define-key ediff-meta-buffer-map "?" 'ediff-toggle-verbose-help-meta-buffer)
(define-key ediff-meta-buffer-map "q" 'ediff-quit-meta-buffer) (define-key ediff-meta-buffer-map "q" 'ediff-quit-meta-buffer)
(define-key ediff-meta-buffer-map "T" 'ediff-toggle-filename-truncation) (define-key ediff-meta-buffer-map "T" 'ediff-toggle-filename-truncation)
(define-key ediff-meta-buffer-map "R" 'ediff-show-registry) (define-key ediff-meta-buffer-map "R" 'ediff-show-registry)
@ -924,27 +944,31 @@ behavior."
(mapcar 'delete-overlay (overlays-in 1 1)) ; emacs (mapcar 'delete-overlay (overlays-in 1 1)) ; emacs
) )
(insert (format ediff-meta-buffer-message
(ediff-abbrev-jobname ediff-metajob-name)))
(setq regexp (ediff-get-group-regexp meta-list) (setq regexp (ediff-get-group-regexp meta-list)
merge-autostore-dir merge-autostore-dir
(ediff-get-group-merge-autostore-dir meta-list)) (ediff-get-group-merge-autostore-dir meta-list))
(cond ((ediff-collect-diffs-metajob) (if ediff-verbose-help-enabled
(insert (progn
" P:\tcollect custom diffs of all marked sessions\n")) (insert (format ediff-meta-buffer-verbose-message
((ediff-patch-metajob) (ediff-abbrev-jobname ediff-metajob-name)))
(insert
" P:\tshow patch appropriately for the context (session or group)\n"))) (cond ((ediff-collect-diffs-metajob)
(insert (insert
" ^:\tshow parent session group\n") " P:\tcollect custom diffs of all marked sessions\n"))
(or (ediff-one-filegroup-metajob) ((ediff-patch-metajob)
(insert (insert
" D:\tshow differences among directories\n" " P:\tshow patch appropriately for the context (session or group)\n")))
" ==:\tfor each session, show which files are identical\n" (insert
" =h:\tlike ==, but also marks those sessions for hiding\n" " ^:\tshow parent session group\n")
" =m:\tlike ==, but also marks those sessions for operation\n\n")) (or (ediff-one-filegroup-metajob)
(insert
" D:\tshow differences among directories\n"
" ==:\tfor each session, show which files are identical\n"
" =h:\tlike ==, but also marks sessions for hiding\n"
" =m:\tlike ==, but also marks sessions for operation\n\n")))
(insert (format ediff-meta-buffer-brief-message
(ediff-abbrev-jobname ediff-metajob-name))))
(insert "\n") (insert "\n")
(if (and (stringp regexp) (> (length regexp) 0)) (if (and (stringp regexp) (> (length regexp) 0))

View file

@ -136,10 +136,10 @@ patch. So, don't change these variables, unless the default doesn't work."
(defcustom ediff-context-diff-label-regexp (defcustom ediff-context-diff-label-regexp
(concat "\\(" ; context diff 2-liner (concat "\\(" ; context diff 2-liner
"^\\*\\*\\* \\([^ \t]+\\)[^*]+[\t ]*\n--- \\([^ \t]+\\)" "^\\*\\*\\* \\([^\t]+\\)[^*]+[\t ]*\n--- \\([^\t]+\\)"
"\\|" ; GNU unified format diff 2-liner "\\|" ; GNU unified format diff 2-liner
"^--- \\([^ \t]+\\)[\t ]+.*\n\\+\\+\\+ \\([^ \t]+\\)" "^--- \\([^\t]+\\)[\t ]+.*\n\\+\\+\\+ \\([^\t]+\\)"
"\\)") "\\)"))
"*Regexp matching filename 2-liners at the start of each context diff. "*Regexp matching filename 2-liners at the start of each context diff.
You probably don't want to change that, unless you are using an obscure patch You probably don't want to change that, unless you are using an obscure patch
program." program."
@ -231,7 +231,7 @@ program."
;; possible-file-names is holding the new file names until we ;; possible-file-names is holding the new file names until we
;; insert the old file name in the patch map ;; insert the old file name in the patch map
;; It is a pair ;; It is a pair
;; (filename-from-1st-header-line . fn from 2nd line) ;; (filename-from-1st-header-line . filename-from-2nd-line)
(setq possible-file-names (setq possible-file-names
(cons (if (and beg1 end1) (cons (if (and beg1 end1)
(buffer-substring beg1 end1) (buffer-substring beg1 end1)
@ -309,12 +309,13 @@ program."
;; these dirs lead to the actual files starting at the present ;; these dirs lead to the actual files starting at the present
;; directory. So, we don't strip these relative dirs from the ;; directory. So, we don't strip these relative dirs from the
;; file names. This is a heuristic intended to improve guessing ;; file names. This is a heuristic intended to improve guessing
(unless (or (file-name-absolute-p base-dir1) (let ((default-directory (file-name-directory filename)))
(file-name-absolute-p base-dir2) (unless (or (file-name-absolute-p base-dir1)
(not (file-exists-p base-dir1)) (file-name-absolute-p base-dir2)
(not (file-exists-p base-dir2))) (not (file-exists-p base-dir1))
(setq base-dir1 "" (not (file-exists-p base-dir2)))
base-dir2 "")) (setq base-dir1 ""
base-dir2 "")))
(or (string= (car proposed-file-names) "/dev/null") (or (string= (car proposed-file-names) "/dev/null")
(setcar proposed-file-names (setcar proposed-file-names
(ediff-file-name-sans-prefix (ediff-file-name-sans-prefix

View file

@ -106,7 +106,7 @@
;; define viper-charpair-command-p ;; define viper-charpair-command-p
(viper-test-com-defun viper-charpair-command) (viper-test-com-defun viper-charpair-command)
(defconst viper-movement-commands '(?b ?B ?e ?E ?f ?F ?G ?h ?H ?j ?k ?l (defconst viper-movement-commands '(?b ?B ?e ?E ?f ?F ?G ?h ?j ?k ?l
?H ?M ?L ?n ?t ?T ?w ?W ?$ ?% ?H ?M ?L ?n ?t ?T ?w ?W ?$ ?%
?^ ?( ?) ?- ?+ ?| ?{ ?} ?[ ?] ?' ?` ?^ ?( ?) ?- ?+ ?| ?{ ?} ?[ ?] ?' ?`
?\; ?, ?0 ?? ?/ ?\ ?\C-m ?\; ?, ?0 ?? ?/ ?\ ?\C-m
@ -1321,10 +1321,10 @@ as a Meta key and any number of multiple escapes is allowed."
(setq last-command-event (setq last-command-event
(viper-copy-event (viper-copy-event
(if viper-xemacs-p (character-to-event char) char))) (if viper-xemacs-p (character-to-event char) char)))
(condition-case nil (condition-case err
(funcall cmd-to-exec-at-end cmd-info) (funcall cmd-to-exec-at-end cmd-info)
(error (error
(error ""))))) (error "%s" (error-message-string err))))))
)) ))
(defun viper-describe-arg (arg) (defun viper-describe-arg (arg)
@ -1902,7 +1902,7 @@ With prefix argument, find next destructive command."
(setq viper-intermediate-command (setq viper-intermediate-command
'repeating-display-destructive-command) 'repeating-display-destructive-command)
;; first search through command history--set temp ring ;; first search through command history--set temp ring
(setq viper-temp-command-ring (copy-list viper-command-ring))) (setq viper-temp-command-ring (copy-sequence viper-command-ring)))
(setq cmd (if next (setq cmd (if next
(viper-special-ring-rotate1 viper-temp-command-ring 1) (viper-special-ring-rotate1 viper-temp-command-ring 1)
(viper-special-ring-rotate1 viper-temp-command-ring -1))) (viper-special-ring-rotate1 viper-temp-command-ring -1)))
@ -1936,7 +1936,7 @@ to in the global map, instead of cycling through the insertion ring."
(length viper-last-inserted-string-from-insertion-ring)))) (length viper-last-inserted-string-from-insertion-ring))))
) )
;;first search through insertion history ;;first search through insertion history
(setq viper-temp-insertion-ring (copy-list viper-insertion-ring))) (setq viper-temp-insertion-ring (copy-sequence viper-insertion-ring)))
(setq this-command 'viper-insert-from-insertion-ring) (setq this-command 'viper-insert-from-insertion-ring)
;; so that things will be undone properly ;; so that things will be undone properly
(setq buffer-undo-list (cons nil buffer-undo-list)) (setq buffer-undo-list (cons nil buffer-undo-list))

View file

@ -97,6 +97,13 @@
:tag "Is it VMS?" :tag "Is it VMS?"
:group 'viper-misc) :group 'viper-misc)
(defcustom viper-suppress-input-method-change-message nil
"If t, the message notifying about changes in the input method is not displayed.
Normally, a message is displayed each time on enters the vi, insert or replace
state."
:type 'boolean
:group 'viper-misc)
(defcustom viper-force-faces nil (defcustom viper-force-faces nil
"If t, Viper will think that it is running on a display that supports faces. "If t, Viper will think that it is running on a display that supports faces.
This is provided as a temporary relief for users of graphics-capable terminals This is provided as a temporary relief for users of graphics-capable terminals
@ -326,7 +333,8 @@ Use `M-x viper-set-expert-level' to change this.")
;; turn off special input methods in vi-state ;; turn off special input methods in vi-state
(if (eq viper-current-state 'vi-state) (if (eq viper-current-state 'vi-state)
(viper-set-input-method nil)) (viper-set-input-method nil))
(if (memq viper-current-state '(vi-state insert-state replace-state)) (if (and (memq viper-current-state '(vi-state insert-state replace-state))
(not viper-suppress-input-method-change-message))
(message "Viper special input method%s: on" (message "Viper special input method%s: on"
(if (or current-input-method default-input-method) (if (or current-input-method default-input-method)
(format " %S" (format " %S"
@ -339,7 +347,8 @@ Use `M-x viper-set-expert-level' to change this.")
(if (null viper-mule-hook-flag) (if (null viper-mule-hook-flag)
() ()
(setq viper-special-input-method nil) (setq viper-special-input-method nil)
(if (memq viper-current-state '(vi-state insert-state replace-state)) (if (and (memq viper-current-state '(vi-state insert-state replace-state))
(not viper-suppress-input-method-change-message))
(message "Viper special input method%s: off" (message "Viper special input method%s: off"
(if (or current-input-method default-input-method) (if (or current-input-method default-input-method)
(format " %S" (format " %S"
@ -369,7 +378,7 @@ Use `M-x viper-set-expert-level' to change this.")
;; Set quail-mode to ARG ;; Set quail-mode to ARG
(defun viper-set-input-method (arg) (defun viper-set-input-method (arg)
(setq viper-mule-hook-flag t) ; just a precaution (setq viper-mule-hook-flag t) ; just a precaution
(let (viper-mule-hook-flag) ; temporarily inactivate viper mule hooks (let (viper-mule-hook-flag) ; temporarily deactivate viper mule hooks
(cond ((and arg (> (prefix-numeric-value arg) 0) default-input-method) (cond ((and arg (> (prefix-numeric-value arg) 0) default-input-method)
;; activate input method ;; activate input method
(viper-activate-input-method)) (viper-activate-input-method))

View file

@ -339,8 +339,8 @@ If running in a terminal, [(escape)] is not understood, so must use \"\\e\"."
(define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol) (define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol)
(define-key viper-vi-basic-map "\C-u" 'viper-scroll-down) (define-key viper-vi-basic-map "\C-u" 'viper-scroll-down)
(define-key viper-vi-basic-map "\C-y" 'viper-scroll-down-one) (define-key viper-vi-basic-map "\C-y" 'viper-scroll-down-one)
(define-key viper-vi-basic-map "\C-s" 'viper-isearch-forward) ;;(define-key viper-vi-basic-map "\C-s" 'viper-isearch-forward)
(define-key viper-vi-basic-map "\C-r" 'viper-isearch-backward) ;;(define-key viper-vi-basic-map "\C-r" 'viper-isearch-backward)
(define-key viper-vi-basic-map "\C-c/" 'viper-toggle-search-style) (define-key viper-vi-basic-map "\C-c/" 'viper-toggle-search-style)
(define-key viper-vi-basic-map "\C-c\C-g" 'viper-info-on-file) (define-key viper-vi-basic-map "\C-c\C-g" 'viper-info-on-file)

View file

@ -168,7 +168,7 @@
(defun viper-set-cursor-color-according-to-state (&optional frame) (defun viper-set-cursor-color-according-to-state (&optional frame)
(cond ((eq viper-current-state 'replace-state) (cond ((eq viper-current-state 'replace-state)
(viper-change-cursor-color viper-replace-state-cursor-color frame)) (viper-change-cursor-color viper-replace-overlay-cursor-color frame))
((and (eq viper-current-state 'emacs-state) ((and (eq viper-current-state 'emacs-state)
viper-emacs-state-cursor-color) viper-emacs-state-cursor-color)
(viper-change-cursor-color viper-emacs-state-cursor-color frame)) (viper-change-cursor-color viper-emacs-state-cursor-color frame))
@ -889,9 +889,7 @@
;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg ;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg
;; in sit-for, so this function smoothes out the differences. ;; in sit-for, so this function smoothes out the differences.
(defsubst viper-sit-for-short (val &optional nodisp) (defsubst viper-sit-for-short (val &optional nodisp)
(if viper-xemacs-p (sit-for (/ val 1000.0) nodisp))
(sit-for (/ val 1000.0) nodisp)
(sit-for 0 val nodisp)))
;; EVENT may be a single event of a sequence of events ;; EVENT may be a single event of a sequence of events
(defsubst viper-ESC-event-p (event) (defsubst viper-ESC-event-p (event)

View file

@ -298,7 +298,6 @@
;;; Code: ;;; Code:
(require 'advice) (require 'advice)
(require 'cl)
(require 'ring) (require 'ring)
;; compiler pacifier ;; compiler pacifier
@ -457,6 +456,7 @@ unless it is coming up in a wrong Viper state."
(defcustom viper-insert-state-mode-list (defcustom viper-insert-state-mode-list
'(internal-ange-ftp-mode '(internal-ange-ftp-mode
comint-mode comint-mode
gud-mode
inferior-emacs-lisp-mode inferior-emacs-lisp-mode
erc-mode erc-mode
eshell-mode eshell-mode
@ -481,6 +481,7 @@ unless it is coming up in a wrong Viper state."
'((help-mode emacs-state viper-slash-and-colon-map) '((help-mode emacs-state viper-slash-and-colon-map)
(comint-mode insert-state viper-comint-mode-modifier-map) (comint-mode insert-state viper-comint-mode-modifier-map)
(comint-mode vi-state viper-comint-mode-modifier-map) (comint-mode vi-state viper-comint-mode-modifier-map)
(gud-mode insert-state viper-comint-mode-modifier-map)
(shell-mode insert-state viper-comint-mode-modifier-map) (shell-mode insert-state viper-comint-mode-modifier-map)
(inferior-emacs-lisp-mode insert-state viper-comint-mode-modifier-map) (inferior-emacs-lisp-mode insert-state viper-comint-mode-modifier-map)
(shell-mode vi-state viper-comint-mode-modifier-map) (shell-mode vi-state viper-comint-mode-modifier-map)