]> code.delx.au - gnu-emacs/commitdiff
Merge from emacs--devo--0
authorMiles Bader <miles@gnu.org>
Sat, 20 Oct 2007 02:30:26 +0000 (02:30 +0000)
committerMiles Bader <miles@gnu.org>
Sat, 20 Oct 2007 02:30:26 +0000 (02:30 +0000)
Patches applied:

 * emacs--devo--0  (patch 901)

   - Update from CVS

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-273

etc/NEWS
etc/TODO
lisp/ChangeLog
lisp/diff-mode.el
lisp/help-fns.el
lisp/smerge-mode.el

index 62258f67ff45111570f1804ed7cbf88076b00daa..00faf92d29a7a262f3d7ccacc710276f758250c9 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -166,8 +166,14 @@ its usage.
 \f
 * Changes in Specialized Modes and Packages in Emacs 23.1
 
-** diff-fine-highlight highlights char-level details of changes in a diff hunk.
+** smerge-refine highlights word-level details of changes in conflict.
+It's used automatically as you move through conflicts, see smerge-auto-refine.
+
+** diff-refine-hunk highlights word-level details of changes in a diff hunk.
+It's used automatically as you move through hunks, see diff-auto-refine.
+
 ** archive-mode has basic support to browse Rar archives.
+
 ** talk.el has been extended for multiple tty support.
 
 ** compilation-auto-jump-to-first-error tells `compile' to jump to
index 2ca4932b93cb68324542ec85c2512e5b6dab51d1..5b438c778f34c27db49125e76beaae46bdcb6564 100644 (file)
--- a/etc/TODO
+++ b/etc/TODO
@@ -181,6 +181,8 @@ specified filters, specified timers, and specified hooks.
 
 * Other features we would like:
 
+** Allow frames(terminals) created by emacsclient to inherit their environment
+from the emacsclient process.
 ** Remove the default toggling behavior of minor modes when called from elisp
 rather than interactively.  This a trivial one-liner in easy-mode.el.
 
@@ -609,6 +611,7 @@ but which can also be used as a modifier).
 
 * Other known bugs:
 
+** `make-frame' forgets unhandled parameters, at least for X11 frames.
 ** The \\{...} keymap dump output does not correctly remove shadowed entries:
 From: "Drew Adams" <drew.adams@oracle.com>
 
index ab50949e6391d5a320adc86506283d5ceaaa640e..d13483c822dc4e31e61cfbebda1765c8965ec334 100644 (file)
@@ -5,6 +5,25 @@
 
 2007-10-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * diff-mode.el (diff-auto-refine): New var.
+       (diff-hunk): Use it.
+       (diff-ignore-whitespace-hunk): Rename diff-refine-ignore-spaces-hunk.
+       (diff-refine-change): Rename from diff-fine-change.  Change it.
+       (diff-refine-preproc): Rename from diff-fine-highlight-preproc.
+       (diff-refine-hunk): Rename from diff-fine-highlight.
+
+2007-10-20  John Paul Wallington  <jpw@pobox.com>
+
+       * help-fns.el (describe-variable-custom-version-info): New function
+       to return variable's version or package version note.
+       (describe-variable): Use it, display result.
+
+2007-10-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * smerge-mode.el (smerge-auto-refine): New var.
+       (smerge-next, smerge-prev): Use it.
+       (smerge-batch-resolve): Ad-hoc trick for Arch's .rej files.
+
        * emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
        Add `body' arg.  Cleanup the check-narrow-maybe/re-narrow-maybe mess.
 
index 972e7972e750649f1491eb8c47a32cbb5d91c227..0208660c1a9618cb15aa89364acbc41f1bf88b09 100644 (file)
@@ -90,6 +90,9 @@ when editing big diffs)."
   :type 'boolean
   :group 'diff-mode)
 
+(defcustom diff-auto-refine t
+  "Automatically highlight changes in detail as the user visits hunks."
+  :type 'boolean)
 
 (defcustom diff-mode-hook nil
   "Run after setting up the `diff-mode' major mode."
@@ -149,14 +152,14 @@ when editing big diffs)."
     ("\C-c\C-a" . diff-apply-hunk)
     ("\C-c\C-e" . diff-ediff-patch)
     ("\C-c\C-n" . diff-restrict-view)
-    ("\C-c\C-r" . diff-reverse-direction)
     ("\C-c\C-s" . diff-split-hunk)
     ("\C-c\C-t" . diff-test-hunk)
+    ("\C-c\C-r" . diff-reverse-direction)
     ("\C-c\C-u" . diff-context->unified)
     ;; `d' because it duplicates the context :-(  --Stef
     ("\C-c\C-d" . diff-unified->context)
-    ("\C-c\C-w" . diff-refine-ignore-spaces-hunk)
-    ("\C-c\C-b" . diff-fine-highlight)  ;No reason for `b' :-(
+    ("\C-c\C-w" . diff-ignore-whitespace-hunk)
+    ("\C-c\C-b" . diff-refine-hunk)  ;No reason for `b' :-(
     ("\C-c\C-f" . next-error-follow-minor-mode))
   "Keymap for `diff-mode'.  See also `diff-mode-shared-map'.")
 
@@ -174,8 +177,8 @@ when editing big diffs)."
     ;;["Fixup Headers"         diff-fixup-modifs       (not buffer-read-only)]
     "-----"
     ["Split hunk"              diff-split-hunk         (diff-splittable-p)]
-    ["Ignore whitespace changes" diff-refine-ignore-spaces-hunk t]
-    ["Highlight fine changes"  diff-fine-highlight     t]
+    ["Ignore whitespace changes" diff-ignore-whitespace-hunk t]
+    ["Highlight fine changes"  diff-refine-hunk        t]
     ["Kill current hunk"       diff-hunk-kill          t]
     ["Kill current file's hunks" diff-file-kill        t]
     "-----"
@@ -458,7 +461,10 @@ but in the file header instead, in which case move forward to the first hunk."
 
 ;; Define diff-{hunk,file}-{prev,next}
 (easy-mmode-define-navigation
- diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view)
+ diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view
+ (if diff-auto-refine
+     (condition-case-no-debug nil (diff-refine-hunk) (error nil))))
+
 (easy-mmode-define-navigation
  diff-file diff-file-header-re "file" diff-end-of-hunk)
 
@@ -1604,8 +1610,8 @@ For use in `add-log-current-defun-function'."
            (goto-char (+ (car pos) (cdr src)))
            (add-log-current-defun))))))
 
-(defun diff-refine-ignore-spaces-hunk ()
-  "Refine the current hunk by ignoring space differences."
+(defun diff-ignore-whitespace-hunk ()
+  "Re-diff the current hunk, ignoring whitespace differences."
   (interactive)
   (let* ((char-offset (- (point) (progn (diff-beginning-of-hunk 'try-harder)
                                         (point))))
@@ -1651,12 +1657,20 @@ For use in `add-log-current-defun-function'."
 
 ;;; Fine change highlighting.
 
-(defface diff-fine-change
-  '((t :background "yellow"))
-  "Face used for char-based changes shown by `diff-fine-highlight'."
+(defface diff-refine-change
+  '((((class color) (min-colors 88) (background light))
+     :background "grey90")
+    (((class color) (min-colors 88) (background dark))
+     :background "grey40")
+    (((class color) (background light))
+     :background "yellow")
+    (((class color) (background dark))
+     :background "green")
+    (t :weight bold))
+  "Face used for char-based changes shown by `diff-refine-hunk'."
   :group 'diff-mode)
 
-(defun diff-fine-highlight-preproc ()
+(defun diff-refine-preproc ()
   (while (re-search-forward "^[+>]" nil t)
     ;; Remove spurious changes due to the fact that one side of the hunk is
     ;; marked with leading + or > and the other with leading - or <.
@@ -1668,7 +1682,7 @@ For use in `add-log-current-defun-function'."
     (replace-match (cdr (assq (char-before) '((?+ . "-") (?> . "<"))))))
   )
 
-(defun diff-fine-highlight ()
+(defun diff-refine-hunk ()
   "Highlight changes of hunk at point at a finer granularity."
   (interactive)
   (require 'smerge-mode)
@@ -1676,7 +1690,7 @@ For use in `add-log-current-defun-function'."
     (diff-beginning-of-hunk 'try-harder)
     (let* ((style (diff-hunk-style))    ;Skips the hunk header as well.
            (beg (point))
-           (props '((diff-mode . fine) (face diff-fine-change)))
+           (props '((diff-mode . fine) (face diff-refine-change)))
            (end (progn (diff-end-of-hunk) (point))))
 
       (remove-overlays beg end 'diff-mode 'fine)
@@ -1688,7 +1702,7 @@ For use in `add-log-current-defun-function'."
                                    end t)
            (smerge-refine-subst (match-beginning 0) (match-end 1)
                                 (match-end 1) (match-end 0)
-                                props 'diff-fine-highlight-preproc)))
+                                props 'diff-refine-preproc)))
         (context
          (let* ((middle (save-excursion (re-search-forward "^---")))
                 (other middle))
@@ -1700,14 +1714,14 @@ For use in `add-log-current-defun-function'."
                                     (setq other (match-end 0))
                                     (match-beginning 0))
                                   other
-                                  props 'diff-fine-highlight-preproc))))
+                                  props 'diff-refine-preproc))))
         (t ;; Normal diffs.
          (let ((beg1 (1+ (point))))
            (when (re-search-forward "^---.*\n" end t)
              ;; It's a combined add&remove, so there's something to do.
              (smerge-refine-subst beg1 (match-beginning 0)
                                   (match-end 0) end
-                                  props 'diff-fine-highlight-preproc))))))))
+                                  props 'diff-refine-preproc))))))))
 
 
 ;; provide the package
index f62fadc22b53b571042a04ab228c2fdf2f8a4abb..bf57824dcf0faaa68a47a9ec0fd778ea3f101600 100644 (file)
@@ -456,6 +456,28 @@ If ANY-SYMBOL is non-nil, don't insist the symbol be bound."
              (and (or any-symbol (boundp sym)) sym)))))
       0))
 
+(defun describe-variable-custom-version-info (variable)
+  (let ((custom-version (get variable 'custom-version))
+       (cpv (get variable 'custom-package-version))
+       (output nil))
+    (if custom-version
+       (setq output
+             (format "This variable was introduced, or its default value was changed, in\nversion %s of Emacs.\n"
+                     custom-version))
+      (when cpv
+       (let* ((package (car-safe cpv))
+              (version (car (cdr-safe cpv)))
+              (pkg-versions (assq package customize-package-emacs-version-alist))
+              (emacsv (cdr (assoc version pkg-versions))))
+         (if (and package version)
+             (setq output
+                   (format (concat "This variable was introduced, or its default value was changed, in\nversion %s of the %s package"
+                                   (if emacsv
+                                       (format " that is part of Emacs %s" emacsv))
+                                   ".\n")
+                           version package))))))
+    output))
+
 ;;;###autoload
 (defun describe-variable (variable &optional buffer frame)
   "Display the full documentation of VARIABLE (a symbol).
@@ -646,16 +668,23 @@ it is displayed along with the global value."
              (with-current-buffer standard-output
                (insert (or doc "Not documented as a variable."))))
            ;; Make a link to customize if this variable can be customized.
-           (if (custom-variable-p variable)
-               (let ((customize-label "customize"))
+           (when (custom-variable-p variable)
+             (let ((customize-label "customize"))
+               (terpri)
+               (terpri)
+               (princ (concat "You can " customize-label " this variable."))
+               (with-current-buffer standard-output
+                 (save-excursion
+                   (re-search-backward
+                    (concat "\\(" customize-label "\\)") nil t)
+                   (help-xref-button 1 'help-customize-variable variable))))
+             ;; Note variable's version or package version
+             (let ((output (describe-variable-custom-version-info variable)))
+               (when output
                  (terpri)
                  (terpri)
-                 (princ (concat "You can " customize-label " this variable."))
-                 (with-current-buffer standard-output
-                   (save-excursion
-                     (re-search-backward
-                      (concat "\\(" customize-label "\\)") nil t)
-                     (help-xref-button 1 'help-customize-variable variable)))))
+                 (princ output))))
+
            (print-help-return-message)
            (save-excursion
              (set-buffer standard-output)
index a33d21925b7cf2b390fc4931ef0522585e2a215c..16693f8a5e3a83d05d1009d540b6b54b33b96cb3 100644 (file)
@@ -79,6 +79,10 @@ Used in `smerge-diff-base-mine' and related functions."
   :group 'smerge
   :type 'boolean)
 
+(defcustom smerge-auto-refine t
+  "Automatically highlight changes in detail as the user visits conflicts."
+  :type 'boolean)
+
 (defface smerge-mine
   '((((min-colors 88) (background light))
      (:foreground "blue1"))
@@ -252,7 +256,9 @@ Can be nil if the style is undecided, or else:
 ;;;;
 
 ;; Define smerge-next and smerge-prev
-(easy-mmode-define-navigation smerge smerge-begin-re "conflict")
+(easy-mmode-define-navigation smerge smerge-begin-re "conflict" nil nil
+  (if smerge-auto-refine
+      (condition-case nil (smerge-refine) (error nil))))
 
 (defconst smerge-match-names ["conflict" "mine" "base" "other"])
 
@@ -433,6 +439,12 @@ some major modes.  Uses `smerge-resolve-function' to do the actual work."
       (error "`smerge-batch-resolve' is to be used only with -batch"))
   (while command-line-args-left
     (let ((file (pop command-line-args-left)))
+      (if (string-match "\\.rej\\'" file)
+          ;; .rej files should never contain diff3 markers, on the other hand,
+          ;; in Arch, .rej files are sometimes used to indicate that the
+          ;; main file has diff3 markers.  So you can pass **/*.rej and
+          ;; it will DTRT.
+          (setq file (substring file 0 (match-beginning 0))))
       (message "Resolving conflicts in %s..." file)
       (when (file-readable-p file)
         (with-current-buffer (find-file-noselect file)