diff options
| author | Miles Bader | 2007-10-20 02:30:26 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-10-20 02:30:26 +0000 |
| commit | 03c19041455f679a452b2803106ab8c739c5de3b (patch) | |
| tree | 18f1a50f57b5f0b8f1f55d0f26eb6f95e740e8d1 | |
| parent | 5fcd436bab49a3374be4571969abbcf02803bf71 (diff) | |
| parent | f76840f36cf60feecaf21d55d24ace948800fef7 (diff) | |
| download | emacs-03c19041455f679a452b2803106ab8c739c5de3b.tar.gz emacs-03c19041455f679a452b2803106ab8c739c5de3b.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 901)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-273
| -rw-r--r-- | etc/NEWS | 8 | ||||
| -rw-r--r-- | etc/TODO | 3 | ||||
| -rw-r--r-- | lisp/ChangeLog | 19 | ||||
| -rw-r--r-- | lisp/diff-mode.el | 48 | ||||
| -rw-r--r-- | lisp/help-fns.el | 45 | ||||
| -rw-r--r-- | lisp/smerge-mode.el | 14 |
6 files changed, 110 insertions, 27 deletions
| @@ -166,8 +166,14 @@ its usage. | |||
| 166 | 166 | ||
| 167 | * Changes in Specialized Modes and Packages in Emacs 23.1 | 167 | * Changes in Specialized Modes and Packages in Emacs 23.1 |
| 168 | 168 | ||
| 169 | ** diff-fine-highlight highlights char-level details of changes in a diff hunk. | 169 | ** smerge-refine highlights word-level details of changes in conflict. |
| 170 | It's used automatically as you move through conflicts, see smerge-auto-refine. | ||
| 171 | |||
| 172 | ** diff-refine-hunk highlights word-level details of changes in a diff hunk. | ||
| 173 | It's used automatically as you move through hunks, see diff-auto-refine. | ||
| 174 | |||
| 170 | ** archive-mode has basic support to browse Rar archives. | 175 | ** archive-mode has basic support to browse Rar archives. |
| 176 | |||
| 171 | ** talk.el has been extended for multiple tty support. | 177 | ** talk.el has been extended for multiple tty support. |
| 172 | 178 | ||
| 173 | ** compilation-auto-jump-to-first-error tells `compile' to jump to | 179 | ** compilation-auto-jump-to-first-error tells `compile' to jump to |
| @@ -181,6 +181,8 @@ specified filters, specified timers, and specified hooks. | |||
| 181 | 181 | ||
| 182 | * Other features we would like: | 182 | * Other features we would like: |
| 183 | 183 | ||
| 184 | ** Allow frames(terminals) created by emacsclient to inherit their environment | ||
| 185 | from the emacsclient process. | ||
| 184 | ** Remove the default toggling behavior of minor modes when called from elisp | 186 | ** Remove the default toggling behavior of minor modes when called from elisp |
| 185 | rather than interactively. This a trivial one-liner in easy-mode.el. | 187 | rather than interactively. This a trivial one-liner in easy-mode.el. |
| 186 | 188 | ||
| @@ -609,6 +611,7 @@ but which can also be used as a modifier). | |||
| 609 | 611 | ||
| 610 | * Other known bugs: | 612 | * Other known bugs: |
| 611 | 613 | ||
| 614 | ** `make-frame' forgets unhandled parameters, at least for X11 frames. | ||
| 612 | ** The \\{...} keymap dump output does not correctly remove shadowed entries: | 615 | ** The \\{...} keymap dump output does not correctly remove shadowed entries: |
| 613 | From: "Drew Adams" <drew.adams@oracle.com> | 616 | From: "Drew Adams" <drew.adams@oracle.com> |
| 614 | 617 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ab50949e639..d13483c822d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -5,6 +5,25 @@ | |||
| 5 | 5 | ||
| 6 | 2007-10-20 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2007-10-20 Stefan Monnier <monnier@iro.umontreal.ca> |
| 7 | 7 | ||
| 8 | * diff-mode.el (diff-auto-refine): New var. | ||
| 9 | (diff-hunk): Use it. | ||
| 10 | (diff-ignore-whitespace-hunk): Rename diff-refine-ignore-spaces-hunk. | ||
| 11 | (diff-refine-change): Rename from diff-fine-change. Change it. | ||
| 12 | (diff-refine-preproc): Rename from diff-fine-highlight-preproc. | ||
| 13 | (diff-refine-hunk): Rename from diff-fine-highlight. | ||
| 14 | |||
| 15 | 2007-10-20 John Paul Wallington <jpw@pobox.com> | ||
| 16 | |||
| 17 | * help-fns.el (describe-variable-custom-version-info): New function | ||
| 18 | to return variable's version or package version note. | ||
| 19 | (describe-variable): Use it, display result. | ||
| 20 | |||
| 21 | 2007-10-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 22 | |||
| 23 | * smerge-mode.el (smerge-auto-refine): New var. | ||
| 24 | (smerge-next, smerge-prev): Use it. | ||
| 25 | (smerge-batch-resolve): Ad-hoc trick for Arch's .rej files. | ||
| 26 | |||
| 8 | * emacs-lisp/easy-mmode.el (easy-mmode-define-navigation): | 27 | * emacs-lisp/easy-mmode.el (easy-mmode-define-navigation): |
| 9 | Add `body' arg. Cleanup the check-narrow-maybe/re-narrow-maybe mess. | 28 | Add `body' arg. Cleanup the check-narrow-maybe/re-narrow-maybe mess. |
| 10 | 29 | ||
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index 972e7972e75..0208660c1a9 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el | |||
| @@ -90,6 +90,9 @@ when editing big diffs)." | |||
| 90 | :type 'boolean | 90 | :type 'boolean |
| 91 | :group 'diff-mode) | 91 | :group 'diff-mode) |
| 92 | 92 | ||
| 93 | (defcustom diff-auto-refine t | ||
| 94 | "Automatically highlight changes in detail as the user visits hunks." | ||
| 95 | :type 'boolean) | ||
| 93 | 96 | ||
| 94 | (defcustom diff-mode-hook nil | 97 | (defcustom diff-mode-hook nil |
| 95 | "Run after setting up the `diff-mode' major mode." | 98 | "Run after setting up the `diff-mode' major mode." |
| @@ -149,14 +152,14 @@ when editing big diffs)." | |||
| 149 | ("\C-c\C-a" . diff-apply-hunk) | 152 | ("\C-c\C-a" . diff-apply-hunk) |
| 150 | ("\C-c\C-e" . diff-ediff-patch) | 153 | ("\C-c\C-e" . diff-ediff-patch) |
| 151 | ("\C-c\C-n" . diff-restrict-view) | 154 | ("\C-c\C-n" . diff-restrict-view) |
| 152 | ("\C-c\C-r" . diff-reverse-direction) | ||
| 153 | ("\C-c\C-s" . diff-split-hunk) | 155 | ("\C-c\C-s" . diff-split-hunk) |
| 154 | ("\C-c\C-t" . diff-test-hunk) | 156 | ("\C-c\C-t" . diff-test-hunk) |
| 157 | ("\C-c\C-r" . diff-reverse-direction) | ||
| 155 | ("\C-c\C-u" . diff-context->unified) | 158 | ("\C-c\C-u" . diff-context->unified) |
| 156 | ;; `d' because it duplicates the context :-( --Stef | 159 | ;; `d' because it duplicates the context :-( --Stef |
| 157 | ("\C-c\C-d" . diff-unified->context) | 160 | ("\C-c\C-d" . diff-unified->context) |
| 158 | ("\C-c\C-w" . diff-refine-ignore-spaces-hunk) | 161 | ("\C-c\C-w" . diff-ignore-whitespace-hunk) |
| 159 | ("\C-c\C-b" . diff-fine-highlight) ;No reason for `b' :-( | 162 | ("\C-c\C-b" . diff-refine-hunk) ;No reason for `b' :-( |
| 160 | ("\C-c\C-f" . next-error-follow-minor-mode)) | 163 | ("\C-c\C-f" . next-error-follow-minor-mode)) |
| 161 | "Keymap for `diff-mode'. See also `diff-mode-shared-map'.") | 164 | "Keymap for `diff-mode'. See also `diff-mode-shared-map'.") |
| 162 | 165 | ||
| @@ -174,8 +177,8 @@ when editing big diffs)." | |||
| 174 | ;;["Fixup Headers" diff-fixup-modifs (not buffer-read-only)] | 177 | ;;["Fixup Headers" diff-fixup-modifs (not buffer-read-only)] |
| 175 | "-----" | 178 | "-----" |
| 176 | ["Split hunk" diff-split-hunk (diff-splittable-p)] | 179 | ["Split hunk" diff-split-hunk (diff-splittable-p)] |
| 177 | ["Ignore whitespace changes" diff-refine-ignore-spaces-hunk t] | 180 | ["Ignore whitespace changes" diff-ignore-whitespace-hunk t] |
| 178 | ["Highlight fine changes" diff-fine-highlight t] | 181 | ["Highlight fine changes" diff-refine-hunk t] |
| 179 | ["Kill current hunk" diff-hunk-kill t] | 182 | ["Kill current hunk" diff-hunk-kill t] |
| 180 | ["Kill current file's hunks" diff-file-kill t] | 183 | ["Kill current file's hunks" diff-file-kill t] |
| 181 | "-----" | 184 | "-----" |
| @@ -458,7 +461,10 @@ but in the file header instead, in which case move forward to the first hunk." | |||
| 458 | 461 | ||
| 459 | ;; Define diff-{hunk,file}-{prev,next} | 462 | ;; Define diff-{hunk,file}-{prev,next} |
| 460 | (easy-mmode-define-navigation | 463 | (easy-mmode-define-navigation |
| 461 | diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view) | 464 | diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view |
| 465 | (if diff-auto-refine | ||
| 466 | (condition-case-no-debug nil (diff-refine-hunk) (error nil)))) | ||
| 467 | |||
| 462 | (easy-mmode-define-navigation | 468 | (easy-mmode-define-navigation |
| 463 | diff-file diff-file-header-re "file" diff-end-of-hunk) | 469 | diff-file diff-file-header-re "file" diff-end-of-hunk) |
| 464 | 470 | ||
| @@ -1604,8 +1610,8 @@ For use in `add-log-current-defun-function'." | |||
| 1604 | (goto-char (+ (car pos) (cdr src))) | 1610 | (goto-char (+ (car pos) (cdr src))) |
| 1605 | (add-log-current-defun)))))) | 1611 | (add-log-current-defun)))))) |
| 1606 | 1612 | ||
| 1607 | (defun diff-refine-ignore-spaces-hunk () | 1613 | (defun diff-ignore-whitespace-hunk () |
| 1608 | "Refine the current hunk by ignoring space differences." | 1614 | "Re-diff the current hunk, ignoring whitespace differences." |
| 1609 | (interactive) | 1615 | (interactive) |
| 1610 | (let* ((char-offset (- (point) (progn (diff-beginning-of-hunk 'try-harder) | 1616 | (let* ((char-offset (- (point) (progn (diff-beginning-of-hunk 'try-harder) |
| 1611 | (point)))) | 1617 | (point)))) |
| @@ -1651,12 +1657,20 @@ For use in `add-log-current-defun-function'." | |||
| 1651 | 1657 | ||
| 1652 | ;;; Fine change highlighting. | 1658 | ;;; Fine change highlighting. |
| 1653 | 1659 | ||
| 1654 | (defface diff-fine-change | 1660 | (defface diff-refine-change |
| 1655 | '((t :background "yellow")) | 1661 | '((((class color) (min-colors 88) (background light)) |
| 1656 | "Face used for char-based changes shown by `diff-fine-highlight'." | 1662 | :background "grey90") |
| 1663 | (((class color) (min-colors 88) (background dark)) | ||
| 1664 | :background "grey40") | ||
| 1665 | (((class color) (background light)) | ||
| 1666 | :background "yellow") | ||
| 1667 | (((class color) (background dark)) | ||
| 1668 | :background "green") | ||
| 1669 | (t :weight bold)) | ||
| 1670 | "Face used for char-based changes shown by `diff-refine-hunk'." | ||
| 1657 | :group 'diff-mode) | 1671 | :group 'diff-mode) |
| 1658 | 1672 | ||
| 1659 | (defun diff-fine-highlight-preproc () | 1673 | (defun diff-refine-preproc () |
| 1660 | (while (re-search-forward "^[+>]" nil t) | 1674 | (while (re-search-forward "^[+>]" nil t) |
| 1661 | ;; Remove spurious changes due to the fact that one side of the hunk is | 1675 | ;; Remove spurious changes due to the fact that one side of the hunk is |
| 1662 | ;; marked with leading + or > and the other with leading - or <. | 1676 | ;; marked with leading + or > and the other with leading - or <. |
| @@ -1668,7 +1682,7 @@ For use in `add-log-current-defun-function'." | |||
| 1668 | (replace-match (cdr (assq (char-before) '((?+ . "-") (?> . "<")))))) | 1682 | (replace-match (cdr (assq (char-before) '((?+ . "-") (?> . "<")))))) |
| 1669 | ) | 1683 | ) |
| 1670 | 1684 | ||
| 1671 | (defun diff-fine-highlight () | 1685 | (defun diff-refine-hunk () |
| 1672 | "Highlight changes of hunk at point at a finer granularity." | 1686 | "Highlight changes of hunk at point at a finer granularity." |
| 1673 | (interactive) | 1687 | (interactive) |
| 1674 | (require 'smerge-mode) | 1688 | (require 'smerge-mode) |
| @@ -1676,7 +1690,7 @@ For use in `add-log-current-defun-function'." | |||
| 1676 | (diff-beginning-of-hunk 'try-harder) | 1690 | (diff-beginning-of-hunk 'try-harder) |
| 1677 | (let* ((style (diff-hunk-style)) ;Skips the hunk header as well. | 1691 | (let* ((style (diff-hunk-style)) ;Skips the hunk header as well. |
| 1678 | (beg (point)) | 1692 | (beg (point)) |
| 1679 | (props '((diff-mode . fine) (face diff-fine-change))) | 1693 | (props '((diff-mode . fine) (face diff-refine-change))) |
| 1680 | (end (progn (diff-end-of-hunk) (point)))) | 1694 | (end (progn (diff-end-of-hunk) (point)))) |
| 1681 | 1695 | ||
| 1682 | (remove-overlays beg end 'diff-mode 'fine) | 1696 | (remove-overlays beg end 'diff-mode 'fine) |
| @@ -1688,7 +1702,7 @@ For use in `add-log-current-defun-function'." | |||
| 1688 | end t) | 1702 | end t) |
| 1689 | (smerge-refine-subst (match-beginning 0) (match-end 1) | 1703 | (smerge-refine-subst (match-beginning 0) (match-end 1) |
| 1690 | (match-end 1) (match-end 0) | 1704 | (match-end 1) (match-end 0) |
| 1691 | props 'diff-fine-highlight-preproc))) | 1705 | props 'diff-refine-preproc))) |
| 1692 | (context | 1706 | (context |
| 1693 | (let* ((middle (save-excursion (re-search-forward "^---"))) | 1707 | (let* ((middle (save-excursion (re-search-forward "^---"))) |
| 1694 | (other middle)) | 1708 | (other middle)) |
| @@ -1700,14 +1714,14 @@ For use in `add-log-current-defun-function'." | |||
| 1700 | (setq other (match-end 0)) | 1714 | (setq other (match-end 0)) |
| 1701 | (match-beginning 0)) | 1715 | (match-beginning 0)) |
| 1702 | other | 1716 | other |
| 1703 | props 'diff-fine-highlight-preproc)))) | 1717 | props 'diff-refine-preproc)))) |
| 1704 | (t ;; Normal diffs. | 1718 | (t ;; Normal diffs. |
| 1705 | (let ((beg1 (1+ (point)))) | 1719 | (let ((beg1 (1+ (point)))) |
| 1706 | (when (re-search-forward "^---.*\n" end t) | 1720 | (when (re-search-forward "^---.*\n" end t) |
| 1707 | ;; It's a combined add&remove, so there's something to do. | 1721 | ;; It's a combined add&remove, so there's something to do. |
| 1708 | (smerge-refine-subst beg1 (match-beginning 0) | 1722 | (smerge-refine-subst beg1 (match-beginning 0) |
| 1709 | (match-end 0) end | 1723 | (match-end 0) end |
| 1710 | props 'diff-fine-highlight-preproc)))))))) | 1724 | props 'diff-refine-preproc)))))))) |
| 1711 | 1725 | ||
| 1712 | 1726 | ||
| 1713 | ;; provide the package | 1727 | ;; provide the package |
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index f62fadc22b5..bf57824dcf0 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -456,6 +456,28 @@ If ANY-SYMBOL is non-nil, don't insist the symbol be bound." | |||
| 456 | (and (or any-symbol (boundp sym)) sym))))) | 456 | (and (or any-symbol (boundp sym)) sym))))) |
| 457 | 0)) | 457 | 0)) |
| 458 | 458 | ||
| 459 | (defun describe-variable-custom-version-info (variable) | ||
| 460 | (let ((custom-version (get variable 'custom-version)) | ||
| 461 | (cpv (get variable 'custom-package-version)) | ||
| 462 | (output nil)) | ||
| 463 | (if custom-version | ||
| 464 | (setq output | ||
| 465 | (format "This variable was introduced, or its default value was changed, in\nversion %s of Emacs.\n" | ||
| 466 | custom-version)) | ||
| 467 | (when cpv | ||
| 468 | (let* ((package (car-safe cpv)) | ||
| 469 | (version (car (cdr-safe cpv))) | ||
| 470 | (pkg-versions (assq package customize-package-emacs-version-alist)) | ||
| 471 | (emacsv (cdr (assoc version pkg-versions)))) | ||
| 472 | (if (and package version) | ||
| 473 | (setq output | ||
| 474 | (format (concat "This variable was introduced, or its default value was changed, in\nversion %s of the %s package" | ||
| 475 | (if emacsv | ||
| 476 | (format " that is part of Emacs %s" emacsv)) | ||
| 477 | ".\n") | ||
| 478 | version package)))))) | ||
| 479 | output)) | ||
| 480 | |||
| 459 | ;;;###autoload | 481 | ;;;###autoload |
| 460 | (defun describe-variable (variable &optional buffer frame) | 482 | (defun describe-variable (variable &optional buffer frame) |
| 461 | "Display the full documentation of VARIABLE (a symbol). | 483 | "Display the full documentation of VARIABLE (a symbol). |
| @@ -646,16 +668,23 @@ it is displayed along with the global value." | |||
| 646 | (with-current-buffer standard-output | 668 | (with-current-buffer standard-output |
| 647 | (insert (or doc "Not documented as a variable.")))) | 669 | (insert (or doc "Not documented as a variable.")))) |
| 648 | ;; Make a link to customize if this variable can be customized. | 670 | ;; Make a link to customize if this variable can be customized. |
| 649 | (if (custom-variable-p variable) | 671 | (when (custom-variable-p variable) |
| 650 | (let ((customize-label "customize")) | 672 | (let ((customize-label "customize")) |
| 673 | (terpri) | ||
| 674 | (terpri) | ||
| 675 | (princ (concat "You can " customize-label " this variable.")) | ||
| 676 | (with-current-buffer standard-output | ||
| 677 | (save-excursion | ||
| 678 | (re-search-backward | ||
| 679 | (concat "\\(" customize-label "\\)") nil t) | ||
| 680 | (help-xref-button 1 'help-customize-variable variable)))) | ||
| 681 | ;; Note variable's version or package version | ||
| 682 | (let ((output (describe-variable-custom-version-info variable))) | ||
| 683 | (when output | ||
| 651 | (terpri) | 684 | (terpri) |
| 652 | (terpri) | 685 | (terpri) |
| 653 | (princ (concat "You can " customize-label " this variable.")) | 686 | (princ output)))) |
| 654 | (with-current-buffer standard-output | 687 | |
| 655 | (save-excursion | ||
| 656 | (re-search-backward | ||
| 657 | (concat "\\(" customize-label "\\)") nil t) | ||
| 658 | (help-xref-button 1 'help-customize-variable variable))))) | ||
| 659 | (print-help-return-message) | 688 | (print-help-return-message) |
| 660 | (save-excursion | 689 | (save-excursion |
| 661 | (set-buffer standard-output) | 690 | (set-buffer standard-output) |
diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el index a33d21925b7..16693f8a5e3 100644 --- a/lisp/smerge-mode.el +++ b/lisp/smerge-mode.el | |||
| @@ -79,6 +79,10 @@ Used in `smerge-diff-base-mine' and related functions." | |||
| 79 | :group 'smerge | 79 | :group 'smerge |
| 80 | :type 'boolean) | 80 | :type 'boolean) |
| 81 | 81 | ||
| 82 | (defcustom smerge-auto-refine t | ||
| 83 | "Automatically highlight changes in detail as the user visits conflicts." | ||
| 84 | :type 'boolean) | ||
| 85 | |||
| 82 | (defface smerge-mine | 86 | (defface smerge-mine |
| 83 | '((((min-colors 88) (background light)) | 87 | '((((min-colors 88) (background light)) |
| 84 | (:foreground "blue1")) | 88 | (:foreground "blue1")) |
| @@ -252,7 +256,9 @@ Can be nil if the style is undecided, or else: | |||
| 252 | ;;;; | 256 | ;;;; |
| 253 | 257 | ||
| 254 | ;; Define smerge-next and smerge-prev | 258 | ;; Define smerge-next and smerge-prev |
| 255 | (easy-mmode-define-navigation smerge smerge-begin-re "conflict") | 259 | (easy-mmode-define-navigation smerge smerge-begin-re "conflict" nil nil |
| 260 | (if smerge-auto-refine | ||
| 261 | (condition-case nil (smerge-refine) (error nil)))) | ||
| 256 | 262 | ||
| 257 | (defconst smerge-match-names ["conflict" "mine" "base" "other"]) | 263 | (defconst smerge-match-names ["conflict" "mine" "base" "other"]) |
| 258 | 264 | ||
| @@ -433,6 +439,12 @@ some major modes. Uses `smerge-resolve-function' to do the actual work." | |||
| 433 | (error "`smerge-batch-resolve' is to be used only with -batch")) | 439 | (error "`smerge-batch-resolve' is to be used only with -batch")) |
| 434 | (while command-line-args-left | 440 | (while command-line-args-left |
| 435 | (let ((file (pop command-line-args-left))) | 441 | (let ((file (pop command-line-args-left))) |
| 442 | (if (string-match "\\.rej\\'" file) | ||
| 443 | ;; .rej files should never contain diff3 markers, on the other hand, | ||
| 444 | ;; in Arch, .rej files are sometimes used to indicate that the | ||
| 445 | ;; main file has diff3 markers. So you can pass **/*.rej and | ||
| 446 | ;; it will DTRT. | ||
| 447 | (setq file (substring file 0 (match-beginning 0)))) | ||
| 436 | (message "Resolving conflicts in %s..." file) | 448 | (message "Resolving conflicts in %s..." file) |
| 437 | (when (file-readable-p file) | 449 | (when (file-readable-p file) |
| 438 | (with-current-buffer (find-file-noselect file) | 450 | (with-current-buffer (find-file-noselect file) |