]> git.eshelyaron.com Git - emacs.git/commitdiff
2007-06-12 Michael Kifer <kifer@cs.stonybrook.edu>
authorMichael Kifer <kifer@cs.stonybrook.edu>
Tue, 12 Jun 2007 19:20:25 +0000 (19:20 +0000)
committerMichael Kifer <kifer@cs.stonybrook.edu>
Tue, 12 Jun 2007 19:20:25 +0000 (19:20 +0000)
* 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.

lisp/ChangeLog
lisp/diff-mode.el
lisp/ediff-mult.el
lisp/ediff-ptch.el
lisp/emulation/viper-cmd.el
lisp/emulation/viper-init.el
lisp/emulation/viper-keym.el
lisp/emulation/viper-util.el
lisp/emulation/viper.el

index 11397368f6dacc2383277ba5b9b5b38357b08a69..2bf7ad7cb4c3d8c2a0a5d8ad96c13b7684f1885f 100644 (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>
 
        * log-view.el (log-view-file-re, log-view-message-re): Use \(?1:...\).
index 87fade841ca8570c5f0809dc91f5077e200e4d09..7346de8567abf5c519b57602b8ad62c14944bfcb 100644 (file)
@@ -338,7 +338,7 @@ when editing big diffs)."
     ("^--- .+ ----$"             . diff-hunk-header-face) ;context
     ("^[0-9,]+[acd][0-9,]+$"     . diff-hunk-header-face) ;normal
     ("^---$"                     . diff-hunk-header-face) ;normal
-    ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n"
+    ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t]+\\)\\(.*[^*-]\\)?\n"
      (0 diff-header-face) (2 diff-file-header-face prepend))
     ("^\\([-<]\\)\\(.*\n\\)"
      (1 diff-indicator-removed-face) (2 diff-removed-face))
index 8fdd319746ca303c5f947470a0cc47d359e28b8d..12dca168412f0212eeab0bc2356a11729bd04e94 100644 (file)
 ;; the registry buffer
 (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
      M:\tin sessions invoked from here, brings back this group panel
      R:\tdisplay the registry of active Ediff sessions
@@ -360,10 +366,24 @@ buffers."
        (if (stringp (ediff-get-session-objC-name session-info))
           (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
 (defun ediff-setup-meta-map ()
   (setq ediff-meta-buffer-map (make-sparse-keymap))
   (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 "T" 'ediff-toggle-filename-truncation)
   (define-key ediff-meta-buffer-map "R" 'ediff-show-registry)
@@ -924,27 +944,31 @@ behavior."
        (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)
            merge-autostore-dir
            (ediff-get-group-merge-autostore-dir meta-list))
 
-      (cond ((ediff-collect-diffs-metajob)
-            (insert
-             "     P:\tcollect custom diffs of all marked sessions\n"))
-           ((ediff-patch-metajob)
-            (insert
-             "     P:\tshow patch appropriately for the context (session or group)\n")))
-      (insert
-       "     ^:\tshow parent session group\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 those sessions for hiding\n"
-          "    =m:\tlike ==, but also marks those sessions for operation\n\n"))
+      (if ediff-verbose-help-enabled
+         (progn
+           (insert (format ediff-meta-buffer-verbose-message
+                           (ediff-abbrev-jobname ediff-metajob-name)))
+
+           (cond ((ediff-collect-diffs-metajob)
+                  (insert
+                   "     P:\tcollect custom diffs of all marked sessions\n"))
+                 ((ediff-patch-metajob)
+                  (insert
+                   "     P:\tshow patch appropriately for the context (session or group)\n")))
+           (insert
+            "     ^:\tshow parent session group\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")
       (if (and (stringp regexp) (> (length regexp) 0))
index c8a8b70f16218ae163a1e18660c1b52c27b80483..5b345a8d4d670b4157dfd57a86ab89c2ef210e25 100644 (file)
@@ -136,10 +136,10 @@ patch.  So, don't change these variables, unless the default doesn't work."
 
 (defcustom ediff-context-diff-label-regexp
   (concat "\\("        ; context diff 2-liner
-         "^\\*\\*\\* \\([^ \t]+\\)[^*]+[\t ]*\n--- \\([^ \t]+\\)"
+         "^\\*\\*\\* \\([^\t]+\\)[^*]+[\t ]*\n--- \\([^\t]+\\)"
          "\\|"         ; 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.
 You probably don't want to change that, unless you are using an obscure patch
 program."
@@ -231,7 +231,7 @@ program."
            ;; possible-file-names is holding the new file names until we
            ;; insert the old file name in the patch map
            ;; 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
                  (cons (if (and beg1 end1)
                            (buffer-substring beg1 end1)
@@ -309,12 +309,13 @@ program."
                ;; these dirs lead to the actual files starting at the present
                ;; directory. So, we don't strip these relative dirs from the
                ;; file names. This is a heuristic intended to improve guessing
-               (unless (or (file-name-absolute-p base-dir1)
-                           (file-name-absolute-p base-dir2)
-                           (not (file-exists-p base-dir1))
-                           (not (file-exists-p base-dir2)))
-                 (setq base-dir1 ""
-                       base-dir2 ""))
+               (let ((default-directory (file-name-directory filename)))
+                 (unless (or (file-name-absolute-p base-dir1)
+                             (file-name-absolute-p base-dir2)
+                             (not (file-exists-p base-dir1))
+                             (not (file-exists-p base-dir2)))
+                   (setq base-dir1 ""
+                         base-dir2 "")))
                (or (string= (car proposed-file-names) "/dev/null")
                    (setcar proposed-file-names
                            (ediff-file-name-sans-prefix
index 9bd1654020bb1aec6cc632ef702b03d39be0c95c..f4c0650b1c8c2b5db54f84086d4c0a45c7b0a5db 100644 (file)
 ;; define viper-charpair-command-p
 (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 ?$ ?%
                                     ?^ ?( ?) ?- ?+ ?| ?{ ?} ?[ ?] ?' ?`
                                     ?\; ?, ?0 ?? ?/ ?\  ?\C-m
@@ -1321,10 +1321,10 @@ as a Meta key and any number of multiple escapes is allowed."
          (setq last-command-event
                (viper-copy-event
                 (if viper-xemacs-p (character-to-event char) char)))
-         (condition-case nil
+         (condition-case err
              (funcall cmd-to-exec-at-end cmd-info)
            (error
-            (error "")))))
+            (error "%s" (error-message-string err))))))
     ))
 
 (defun viper-describe-arg (arg)
@@ -1902,7 +1902,7 @@ With prefix argument, find next destructive command."
        (setq viper-intermediate-command
              'repeating-display-destructive-command)
       ;; 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
                  (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))))
          )
       ;;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)
     ;; so that things will be undone properly
     (setq buffer-undo-list (cons nil buffer-undo-list))
index 86e0e0446416ad8b539275eee6bd743969effaee..4a1bae82711c4bcc1c99b4704f63a4b7e36d6855 100644 (file)
   :tag "Is it VMS?"
   :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
   "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
@@ -326,7 +333,8 @@ Use `M-x viper-set-expert-level' to change this.")
     ;; turn off special input methods in vi-state
     (if (eq viper-current-state 'vi-state)
        (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"
                 (if (or current-input-method default-input-method)
                     (format " %S"
@@ -339,7 +347,8 @@ Use `M-x viper-set-expert-level' to change this.")
   (if (null viper-mule-hook-flag)
       ()
     (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"
                 (if (or current-input-method default-input-method)
                     (format " %S"
@@ -369,7 +378,7 @@ Use `M-x viper-set-expert-level' to change this.")
 ;; Set quail-mode to ARG
 (defun viper-set-input-method (arg)
   (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)
           ;; activate input method
           (viper-activate-input-method))
index 9dd78ce8aa132c3d0842af9ed8100135e06324e5..1d158274198bfbb082c4f1f13cd84481d9e7564d 100644 (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-u" 'viper-scroll-down)
 (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-r" 'viper-isearch-backward)
+;;(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-c/" 'viper-toggle-search-style)
 (define-key viper-vi-basic-map "\C-c\C-g" 'viper-info-on-file)
 
index 0419af5fedfa335032dd167bb20ad97bca22dd60..eef92106de2e8f0fd295505561c66ac4ff94afe7 100644 (file)
 
 (defun viper-set-cursor-color-according-to-state (&optional frame)
   (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)
              viper-emacs-state-cursor-color)
         (viper-change-cursor-color viper-emacs-state-cursor-color frame))
 ;; Sit for VAL milliseconds.  XEmacs doesn't support the millisecond arg
 ;; in sit-for, so this function smoothes out the differences.
 (defsubst viper-sit-for-short (val &optional nodisp)
-  (if viper-xemacs-p
-      (sit-for (/ val 1000.0) nodisp)
-    (sit-for 0 val nodisp)))
+  (sit-for (/ val 1000.0) nodisp))
 
 ;; EVENT may be a single event of a sequence of events
 (defsubst viper-ESC-event-p (event)
index 67ec3660c65427eb0b031efb6aec11c7d2070122..3cc8974248c2b6fb136df807070419c815b6f55d 100644 (file)
 ;;; Code:
 
 (require 'advice)
-(require 'cl)
 (require 'ring)
 
 ;; compiler pacifier
@@ -457,6 +456,7 @@ unless it is coming up in a wrong Viper state."
 (defcustom viper-insert-state-mode-list
   '(internal-ange-ftp-mode
     comint-mode
+    gud-mode
     inferior-emacs-lisp-mode
     erc-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)
     (comint-mode insert-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)
     (inferior-emacs-lisp-mode insert-state viper-comint-mode-modifier-map)
     (shell-mode vi-state viper-comint-mode-modifier-map)