mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-23 22:20:24 -08:00
Trailing whitespace deleted.
This commit is contained in:
parent
693ff6134c
commit
71296446d3
65 changed files with 1261 additions and 1261 deletions
|
|
@ -229,7 +229,7 @@ Don't use this function in a Lisp program; use `define-abbrev' instead."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
(add-abbrev
|
(add-abbrev
|
||||||
(if only-global-abbrevs
|
(if only-global-abbrevs
|
||||||
global-abbrev-table
|
global-abbrev-table
|
||||||
(or local-abbrev-table
|
(or local-abbrev-table
|
||||||
(error "No per-mode abbrev table")))
|
(error "No per-mode abbrev table")))
|
||||||
"Mode" arg))
|
"Mode" arg))
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
;; Author: Ken Manheimer <klm@python.org>
|
;; Author: Ken Manheimer <klm@python.org>
|
||||||
;; Maintainer: Ken Manheimer <klm@python.org>
|
;; Maintainer: Ken Manheimer <klm@python.org>
|
||||||
;; Created: Dec 1991 - first release to usenet
|
;; Created: Dec 1991 - first release to usenet
|
||||||
;; Version: $Id: allout.el,v 1.37 2002/12/16 00:42:23 rost Exp $||
|
;; Version: $Id: allout.el,v 1.38 2002/12/16 01:00:51 rost Exp $||
|
||||||
;; Keywords: outlines mode wp languages
|
;; Keywords: outlines mode wp languages
|
||||||
|
|
||||||
;; This file is part of GNU Emacs.
|
;; This file is part of GNU Emacs.
|
||||||
|
|
@ -33,23 +33,23 @@
|
||||||
;; exposure. It also provides for syntax-sensitive text like
|
;; exposure. It also provides for syntax-sensitive text like
|
||||||
;; programming languages. (For an example, see the allout code
|
;; programming languages. (For an example, see the allout code
|
||||||
;; itself, which is organized in ;; an outline framework.)
|
;; itself, which is organized in ;; an outline framework.)
|
||||||
;;
|
;;
|
||||||
;; In addition to outline navigation and exposure, allout includes:
|
;; In addition to outline navigation and exposure, allout includes:
|
||||||
;;
|
;;
|
||||||
;; - topic-oriented repositioning, cut, and paste
|
;; - topic-oriented repositioning, cut, and paste
|
||||||
;; - integral outline exposure-layout
|
;; - integral outline exposure-layout
|
||||||
;; - incremental search with dynamic exposure and reconcealment of hidden text
|
;; - incremental search with dynamic exposure and reconcealment of hidden text
|
||||||
;; - automatic topic-number maintenance
|
;; - automatic topic-number maintenance
|
||||||
;; - "Hot-spot" operation, for single-keystroke maneuvering and
|
;; - "Hot-spot" operation, for single-keystroke maneuvering and
|
||||||
;; exposure control. (See the `allout-mode' docstring.)
|
;; exposure control. (See the `allout-mode' docstring.)
|
||||||
;;
|
;;
|
||||||
;; and many other features.
|
;; and many other features.
|
||||||
;;
|
;;
|
||||||
;; The outline menubar additions provide quick reference to many of
|
;; The outline menubar additions provide quick reference to many of
|
||||||
;; the features, and see the docstring of the function `allout-init'
|
;; the features, and see the docstring of the function `allout-init'
|
||||||
;; for instructions on priming your emacs session for automatic
|
;; for instructions on priming your emacs session for automatic
|
||||||
;; activation of `allout-mode'.
|
;; activation of `allout-mode'.
|
||||||
;;
|
;;
|
||||||
;; See the docstring of the variables `allout-layout' and
|
;; See the docstring of the variables `allout-layout' and
|
||||||
;; `allout-auto-activation' for details on automatic activation of
|
;; `allout-auto-activation' for details on automatic activation of
|
||||||
;; allout `allout-mode' as a minor mode. (It has changed since allout
|
;; allout `allout-mode' as a minor mode. (It has changed since allout
|
||||||
|
|
@ -89,7 +89,7 @@ With value `t', auto-mode-activation and auto-layout are enabled.
|
||||||
With value `ask', auto-mode-activation is enabled, and endorsement for
|
With value `ask', auto-mode-activation is enabled, and endorsement for
|
||||||
performing auto-layout is asked of the user each time.
|
performing auto-layout is asked of the user each time.
|
||||||
|
|
||||||
With value `activate', only auto-mode-activation is enabled,
|
With value `activate', only auto-mode-activation is enabled,
|
||||||
auto-layout is not.
|
auto-layout is not.
|
||||||
|
|
||||||
With value `nil', neither auto-mode-activation nor auto-layout are
|
With value `nil', neither auto-mode-activation nor auto-layout are
|
||||||
|
|
@ -189,7 +189,7 @@ of this var to take effect."
|
||||||
|
|
||||||
These bullets are used to distinguish topics from the run-of-the-mill
|
These bullets are used to distinguish topics from the run-of-the-mill
|
||||||
ones. They are not used in the standard topic headers created by
|
ones. They are not used in the standard topic headers created by
|
||||||
the topic-opening, shifting, and rebulleting \(eg, on topic shift,
|
the topic-opening, shifting, and rebulleting \(eg, on topic shift,
|
||||||
topic paste, blanket rebulleting) routines, but are offered among the
|
topic paste, blanket rebulleting) routines, but are offered among the
|
||||||
choices for rebulleting. They are not altered by the above automatic
|
choices for rebulleting. They are not altered by the above automatic
|
||||||
rebulleting, so they can be used to characterize topics, eg:
|
rebulleting, so they can be used to characterize topics, eg:
|
||||||
|
|
@ -242,7 +242,7 @@ tripled, but an underscore is substituted for the space. [This
|
||||||
presumes that the space is for appearance, not comment syntax. You
|
presumes that the space is for appearance, not comment syntax. You
|
||||||
can use `allout-mode-leaders' to override this behavior, when
|
can use `allout-mode-leaders' to override this behavior, when
|
||||||
incorrect.]"
|
incorrect.]"
|
||||||
:type '(choice (const t) (const nil) string
|
:type '(choice (const t) (const nil) string
|
||||||
(const allout-mode-leaders)
|
(const allout-mode-leaders)
|
||||||
(const comment-start))
|
(const comment-start))
|
||||||
:group 'allout)
|
:group 'allout)
|
||||||
|
|
@ -508,7 +508,7 @@ behavior."
|
||||||
;;;_ : Version
|
;;;_ : Version
|
||||||
;;;_ = allout-version
|
;;;_ = allout-version
|
||||||
(defvar allout-version
|
(defvar allout-version
|
||||||
(let ((rcs-rev "$Revision: 1.37 $"))
|
(let ((rcs-rev "$Revision: 1.38 $"))
|
||||||
(condition-case err
|
(condition-case err
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev)
|
(string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev)
|
||||||
|
|
@ -789,9 +789,9 @@ activation. Being deprecated.")
|
||||||
"----"
|
"----"
|
||||||
["Duplicate Exposed" allout-copy-exposed-to-buffer t]
|
["Duplicate Exposed" allout-copy-exposed-to-buffer t]
|
||||||
["Duplicate Exposed, numbered"
|
["Duplicate Exposed, numbered"
|
||||||
allout-flatten-exposed-to-buffer t]
|
allout-flatten-exposed-to-buffer t]
|
||||||
["Duplicate Exposed, indented"
|
["Duplicate Exposed, indented"
|
||||||
allout-indented-exposed-to-buffer t]
|
allout-indented-exposed-to-buffer t]
|
||||||
"----"
|
"----"
|
||||||
["Set Header Lead" allout-reset-header-lead t]
|
["Set Header Lead" allout-reset-header-lead t]
|
||||||
["Set New Exposure" allout-expose-topic t])))
|
["Set New Exposure" allout-expose-topic t])))
|
||||||
|
|
@ -1006,7 +1006,7 @@ the following two lines in your emacs init file:
|
||||||
((message
|
((message
|
||||||
"Outline mode auto-activation and -layout enabled.")
|
"Outline mode auto-activation and -layout enabled.")
|
||||||
'full)))))))
|
'full)))))))
|
||||||
|
|
||||||
;;;_ > allout-setup-menubar ()
|
;;;_ > allout-setup-menubar ()
|
||||||
(defun allout-setup-menubar ()
|
(defun allout-setup-menubar ()
|
||||||
"Populate the current buffer's menubar with `allout-mode' stuff."
|
"Populate the current buffer's menubar with `allout-mode' stuff."
|
||||||
|
|
@ -2459,12 +2459,12 @@ The function checks to ensure that the rebinding is done only once."
|
||||||
|
|
||||||
(add-hook 'isearch-mode-end-hook 'allout-isearch-rectification)
|
(add-hook 'isearch-mode-end-hook 'allout-isearch-rectification)
|
||||||
(if (fboundp 'allout-real-isearch-abort)
|
(if (fboundp 'allout-real-isearch-abort)
|
||||||
;;
|
;;
|
||||||
nil
|
nil
|
||||||
; Ensure load of isearch-mode:
|
; Ensure load of isearch-mode:
|
||||||
(if (or (and (fboundp 'isearch-mode)
|
(if (or (and (fboundp 'isearch-mode)
|
||||||
(fboundp 'isearch-abort))
|
(fboundp 'isearch-abort))
|
||||||
(condition-case error
|
(condition-case error
|
||||||
(load-library "isearch-mode")
|
(load-library "isearch-mode")
|
||||||
('file-error (message
|
('file-error (message
|
||||||
"Skipping isearch-mode provisions - %s '%s'"
|
"Skipping isearch-mode provisions - %s '%s'"
|
||||||
|
|
@ -2475,7 +2475,7 @@ The function checks to ensure that the rebinding is done only once."
|
||||||
(setq allout-isearch-dynamic-expose nil))))
|
(setq allout-isearch-dynamic-expose nil))))
|
||||||
;; Isearch-mode loaded, encapsulate specific entry points for
|
;; Isearch-mode loaded, encapsulate specific entry points for
|
||||||
;; outline dynamic-exposure business:
|
;; outline dynamic-exposure business:
|
||||||
(progn
|
(progn
|
||||||
;; stash crucial isearch-mode funcs under known, private
|
;; stash crucial isearch-mode funcs under known, private
|
||||||
;; names, then register wrapper functions under the old
|
;; names, then register wrapper functions under the old
|
||||||
;; names, in their stead:
|
;; names, in their stead:
|
||||||
|
|
@ -4053,7 +4053,7 @@ and retains start position."
|
||||||
|
|
||||||
Optional arg CONTEXT indicates interior levels to include."
|
Optional arg CONTEXT indicates interior levels to include."
|
||||||
(let ((delim ".")
|
(let ((delim ".")
|
||||||
result
|
result
|
||||||
numstr
|
numstr
|
||||||
(context-depth (or (and context 2) 1)))
|
(context-depth (or (and context 2) 1)))
|
||||||
;; Take care of the explicit context:
|
;; Take care of the explicit context:
|
||||||
|
|
@ -4096,7 +4096,7 @@ Optional arg CONTEXT indicates interior levels to include."
|
||||||
(defun allout-stringify-flat-index-indented (flat-index)
|
(defun allout-stringify-flat-index-indented (flat-index)
|
||||||
"Convert list representing section/subsection/... to document string."
|
"Convert list representing section/subsection/... to document string."
|
||||||
(let ((delim ".")
|
(let ((delim ".")
|
||||||
result
|
result
|
||||||
numstr)
|
numstr)
|
||||||
;; Take care of the explicit context:
|
;; Take care of the explicit context:
|
||||||
(setq numstr (int-to-string (car flat-index))
|
(setq numstr (int-to-string (car flat-index))
|
||||||
|
|
@ -4534,7 +4534,7 @@ BULLET string, and a list of TEXT strings for the body."
|
||||||
(curr-line)
|
(curr-line)
|
||||||
body-content bop)
|
body-content bop)
|
||||||
; Do the head line:
|
; Do the head line:
|
||||||
(insert (concat "\\OneHeadLine{\\verb\1 "
|
(insert (concat "\\OneHeadLine{\\verb\1 "
|
||||||
(allout-latex-verb-quote bullet)
|
(allout-latex-verb-quote bullet)
|
||||||
"\1}{"
|
"\1}{"
|
||||||
depth
|
depth
|
||||||
|
|
|
||||||
|
|
@ -415,7 +415,7 @@ information will be used for the next call to
|
||||||
start of the region and set the face with which to start. Set
|
start of the region and set the face with which to start. Set
|
||||||
`ansi-color-context-region' to nil if you don't want this."
|
`ansi-color-context-region' to nil if you don't want this."
|
||||||
(let ((face (car ansi-color-context-region))
|
(let ((face (car ansi-color-context-region))
|
||||||
(start-marker (or (cadr ansi-color-context-region)
|
(start-marker (or (cadr ansi-color-context-region)
|
||||||
(copy-marker begin)))
|
(copy-marker begin)))
|
||||||
(end-marker (copy-marker end))
|
(end-marker (copy-marker end))
|
||||||
escape-sequence)
|
escape-sequence)
|
||||||
|
|
@ -481,7 +481,7 @@ start of the region and set the face with which to start. Set
|
||||||
|
|
||||||
(defun ansi-color-make-face (property color)
|
(defun ansi-color-make-face (property color)
|
||||||
"Return a face with PROPERTY set to COLOR.
|
"Return a face with PROPERTY set to COLOR.
|
||||||
PROPERTY can be either symbol `foreground' or symbol `background'.
|
PROPERTY can be either symbol `foreground' or symbol `background'.
|
||||||
|
|
||||||
For Emacs, we just return the cons cell \(PROPERTY . COLOR).
|
For Emacs, we just return the cons cell \(PROPERTY . COLOR).
|
||||||
For XEmacs, we create a temporary face and return it."
|
For XEmacs, we create a temporary face and return it."
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ before finding a label."
|
||||||
(concat "\\("
|
(concat "\\("
|
||||||
(mapconcat 'identity words "\\|")
|
(mapconcat 'identity words "\\|")
|
||||||
"\\)" wild
|
"\\)" wild
|
||||||
(if (cdr words)
|
(if (cdr words)
|
||||||
(concat "\\("
|
(concat "\\("
|
||||||
(mapconcat 'identity words "\\|")
|
(mapconcat 'identity words "\\|")
|
||||||
"\\)")
|
"\\)")
|
||||||
|
|
@ -314,7 +314,7 @@ Value is a list of offsets of the words into the string."
|
||||||
(dolist (s (apropos-calc-scores doc apropos-all-words) score)
|
(dolist (s (apropos-calc-scores doc apropos-all-words) score)
|
||||||
(setq score (+ score 50 (/ (* (- l s) 50) l)))))
|
(setq score (+ score 50 (/ (* (- l s) 50) l)))))
|
||||||
0))
|
0))
|
||||||
|
|
||||||
(defun apropos-score-symbol (symbol &optional weight)
|
(defun apropos-score-symbol (symbol &optional weight)
|
||||||
"Return apropos score for SYMBOL."
|
"Return apropos score for SYMBOL."
|
||||||
(setq symbol (symbol-name symbol))
|
(setq symbol (symbol-name symbol))
|
||||||
|
|
@ -413,7 +413,7 @@ satisfy the predicate VAR-PREDICATE."
|
||||||
(if (functionp symbol)
|
(if (functionp symbol)
|
||||||
(if (setq doc (documentation symbol t))
|
(if (setq doc (documentation symbol t))
|
||||||
(progn
|
(progn
|
||||||
(setq score (+ score (apropos-score-doc doc)))
|
(setq score (+ score (apropos-score-doc doc)))
|
||||||
(substring doc 0 (string-match "\n" doc)))
|
(substring doc 0 (string-match "\n" doc)))
|
||||||
"(not documented)")))
|
"(not documented)")))
|
||||||
(and var-predicate
|
(and var-predicate
|
||||||
|
|
@ -531,7 +531,7 @@ Returns list of symbols and values found."
|
||||||
(if (apropos-false-hit-str p)
|
(if (apropos-false-hit-str p)
|
||||||
(setq p nil))
|
(setq p nil))
|
||||||
(if (or f v p)
|
(if (or f v p)
|
||||||
(setq apropos-accumulator (cons (list symbol
|
(setq apropos-accumulator (cons (list symbol
|
||||||
(+ (apropos-score-str f)
|
(+ (apropos-score-str f)
|
||||||
(apropos-score-str v)
|
(apropos-score-str v)
|
||||||
(apropos-score-str p))
|
(apropos-score-str p))
|
||||||
|
|
@ -580,7 +580,7 @@ Returns list of symbols and documentation found."
|
||||||
(setcar (nthcdr 2 apropos-item) v)
|
(setcar (nthcdr 2 apropos-item) v)
|
||||||
(setcar apropos-item (+ (car apropos-item) sv)))))
|
(setcar apropos-item (+ (car apropos-item) sv)))))
|
||||||
(setq apropos-accumulator
|
(setq apropos-accumulator
|
||||||
(cons (list symbol
|
(cons (list symbol
|
||||||
(+ (apropos-score-symbol symbol 2) sf sv)
|
(+ (apropos-score-symbol symbol 2) sf sv)
|
||||||
f v)
|
f v)
|
||||||
apropos-accumulator)))))))
|
apropos-accumulator)))))))
|
||||||
|
|
@ -665,7 +665,7 @@ Returns list of symbols and documentation found."
|
||||||
(or (and (setq apropos-item (assq symbol apropos-accumulator))
|
(or (and (setq apropos-item (assq symbol apropos-accumulator))
|
||||||
(setcar (cdr apropos-item)
|
(setcar (cdr apropos-item)
|
||||||
(+ (cadr apropos-item) (apropos-score-doc doc))))
|
(+ (cadr apropos-item) (apropos-score-doc doc))))
|
||||||
(setq apropos-item (list symbol
|
(setq apropos-item (list symbol
|
||||||
(+ (apropos-score-symbol symbol 2)
|
(+ (apropos-score-symbol symbol 2)
|
||||||
(apropos-score-doc doc))
|
(apropos-score-doc doc))
|
||||||
nil nil)
|
nil nil)
|
||||||
|
|
@ -755,7 +755,7 @@ Will return nil instead."
|
||||||
(defun apropos-print (do-keys spacing)
|
(defun apropos-print (do-keys spacing)
|
||||||
"Output result of apropos searching into buffer `*Apropos*'.
|
"Output result of apropos searching into buffer `*Apropos*'.
|
||||||
The value of `apropos-accumulator' is the list of items to output.
|
The value of `apropos-accumulator' is the list of items to output.
|
||||||
Each element should have the format
|
Each element should have the format
|
||||||
(SYMBOL SCORE FN-DOC VAR-DOC [PLIST-DOC WIDGET-DOC FACE-DOC GROUP-DOC]).
|
(SYMBOL SCORE FN-DOC VAR-DOC [PLIST-DOC WIDGET-DOC FACE-DOC GROUP-DOC]).
|
||||||
The return value is the list that was in `apropos-accumulator', sorted
|
The return value is the list that was in `apropos-accumulator', sorted
|
||||||
alphabetically by symbol name; but this function also sets
|
alphabetically by symbol name; but this function also sets
|
||||||
|
|
|
||||||
|
|
@ -757,7 +757,7 @@ when parsing the archive."
|
||||||
(apply
|
(apply
|
||||||
(function concat)
|
(function concat)
|
||||||
(mapcar
|
(mapcar
|
||||||
(function
|
(function
|
||||||
(lambda (fil)
|
(lambda (fil)
|
||||||
;; Using `concat' here copies the text also, so we can add
|
;; Using `concat' here copies the text also, so we can add
|
||||||
;; properties without problems.
|
;; properties without problems.
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
(defvar array-respect-tabs))
|
(defvar array-respect-tabs))
|
||||||
|
|
||||||
;;; Internal information functions.
|
;;; Internal information functions.
|
||||||
|
|
||||||
(defun array-cursor-in-array-range ()
|
(defun array-cursor-in-array-range ()
|
||||||
"Return t if the cursor is in a valid array cell.
|
"Return t if the cursor is in a valid array cell.
|
||||||
Its ok to be on a row number line."
|
Its ok to be on a row number line."
|
||||||
|
|
@ -385,7 +385,7 @@ Leave point at the beginning of the field."
|
||||||
(insert array-copy-string))
|
(insert array-copy-string))
|
||||||
(move-to-column array-buffer-column)
|
(move-to-column array-buffer-column)
|
||||||
(setq count (1- count)))))
|
(setq count (1- count)))))
|
||||||
|
|
||||||
(defun array-copy-to-column (a-column)
|
(defun array-copy-to-column (a-column)
|
||||||
"Copy current field horizontally into every cell up to and including A-COLUMN.
|
"Copy current field horizontally into every cell up to and including A-COLUMN.
|
||||||
Leave point at the beginning of the field."
|
Leave point at the beginning of the field."
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ If this contains a %s, that will be replaced by the matching rule."
|
||||||
(("[Mm]akefile\\'" . "Makefile") . "makefile.inc")
|
(("[Mm]akefile\\'" . "Makefile") . "makefile.inc")
|
||||||
|
|
||||||
(html-mode . (lambda () (sgml-tag "html")))
|
(html-mode . (lambda () (sgml-tag "html")))
|
||||||
|
|
||||||
(plain-tex-mode . "tex-insert.tex")
|
(plain-tex-mode . "tex-insert.tex")
|
||||||
(bibtex-mode . "tex-insert.tex")
|
(bibtex-mode . "tex-insert.tex")
|
||||||
(latex-mode
|
(latex-mode
|
||||||
|
|
@ -130,7 +130,7 @@ If this contains a %s, that will be replaced by the matching rule."
|
||||||
lambda ()
|
lambda ()
|
||||||
(if (eq major-mode default-major-mode)
|
(if (eq major-mode default-major-mode)
|
||||||
(sh-mode)))
|
(sh-mode)))
|
||||||
|
|
||||||
(ada-mode . ada-header)
|
(ada-mode . ada-header)
|
||||||
|
|
||||||
(("\\.[1-9]\\'" . "Man page skeleton")
|
(("\\.[1-9]\\'" . "Man page skeleton")
|
||||||
|
|
|
||||||
|
|
@ -144,19 +144,19 @@ The result of the body appears to the compiler as a quoted constant."
|
||||||
;; "Set some compilation-parameters for this file. This will affect only the
|
;; "Set some compilation-parameters for this file. This will affect only the
|
||||||
;; file in which it appears; this does nothing when evaluated, and when loaded
|
;; file in which it appears; this does nothing when evaluated, and when loaded
|
||||||
;; from a .el file.
|
;; from a .el file.
|
||||||
;;
|
;;
|
||||||
;; Each argument to this macro must be a list of a key and a value.
|
;; Each argument to this macro must be a list of a key and a value.
|
||||||
;;
|
;;
|
||||||
;; Keys: Values: Corresponding variable:
|
;; Keys: Values: Corresponding variable:
|
||||||
;;
|
;;
|
||||||
;; verbose t, nil byte-compile-verbose
|
;; verbose t, nil byte-compile-verbose
|
||||||
;; optimize t, nil, source, byte byte-compile-optimize
|
;; optimize t, nil, source, byte byte-compile-optimize
|
||||||
;; warnings list of warnings byte-compile-warnings
|
;; warnings list of warnings byte-compile-warnings
|
||||||
;; Legal elements: (callargs redefine free-vars unresolved)
|
;; Legal elements: (callargs redefine free-vars unresolved)
|
||||||
;; file-format emacs18, emacs19 byte-compile-compatibility
|
;; file-format emacs18, emacs19 byte-compile-compatibility
|
||||||
;;
|
;;
|
||||||
;; For example, this might appear at the top of a source file:
|
;; For example, this might appear at the top of a source file:
|
||||||
;;
|
;;
|
||||||
;; (byte-compiler-options
|
;; (byte-compiler-options
|
||||||
;; (optimize t)
|
;; (optimize t)
|
||||||
;; (warnings (- free-vars)) ; Don't warn about free variables
|
;; (warnings (- free-vars)) ; Don't warn about free variables
|
||||||
|
|
|
||||||
|
|
@ -47,19 +47,19 @@
|
||||||
;; character to the scheme process. Cmuscheme mode does *not* provide this
|
;; character to the scheme process. Cmuscheme mode does *not* provide this
|
||||||
;; functionality. If you are a cscheme user, you may prefer to use the
|
;; functionality. If you are a cscheme user, you may prefer to use the
|
||||||
;; xscheme.el/cscheme -emacs interaction.
|
;; xscheme.el/cscheme -emacs interaction.
|
||||||
;;
|
;;
|
||||||
;; Here's a summary of the pros and cons, as I see them.
|
;; Here's a summary of the pros and cons, as I see them.
|
||||||
;; xscheme: Tightly integrated with inferior cscheme process! A few commands
|
;; xscheme: Tightly integrated with inferior cscheme process! A few commands
|
||||||
;; not in cmuscheme. But. Integration is a bit of a hack. Input
|
;; not in cmuscheme. But. Integration is a bit of a hack. Input
|
||||||
;; history only keeps the immediately prior input. Bizarre
|
;; history only keeps the immediately prior input. Bizarre
|
||||||
;; keybindings.
|
;; keybindings.
|
||||||
;;
|
;;
|
||||||
;; cmuscheme: Not tightly integrated with inferior cscheme process. But.
|
;; cmuscheme: Not tightly integrated with inferior cscheme process. But.
|
||||||
;; Carefully integrated functionality with the entire suite of
|
;; Carefully integrated functionality with the entire suite of
|
||||||
;; comint-derived CMU process modes. Keybindings reminiscent of
|
;; comint-derived CMU process modes. Keybindings reminiscent of
|
||||||
;; Zwei and Hemlock. Good input history. A few commands not in
|
;; Zwei and Hemlock. Good input history. A few commands not in
|
||||||
;; xscheme.
|
;; xscheme.
|
||||||
;;
|
;;
|
||||||
;; It's a tradeoff. Pay your money; take your choice. If you use a Scheme
|
;; It's a tradeoff. Pay your money; take your choice. If you use a Scheme
|
||||||
;; that isn't Cscheme, of course, there isn't a choice. Xscheme.el is *very*
|
;; that isn't Cscheme, of course, there isn't a choice. Xscheme.el is *very*
|
||||||
;; Cscheme-specific; you must use cmuscheme.el. Interested parties are
|
;; Cscheme-specific; you must use cmuscheme.el. Interested parties are
|
||||||
|
|
@ -432,7 +432,7 @@ for a minimal, simple implementation. Feel free to extend it.")
|
||||||
This is a good place to put keybindings."
|
This is a good place to put keybindings."
|
||||||
:type 'hook
|
:type 'hook
|
||||||
:group 'cmuscheme)
|
:group 'cmuscheme)
|
||||||
|
|
||||||
(run-hooks 'cmuscheme-load-hook)
|
(run-hooks 'cmuscheme-load-hook)
|
||||||
|
|
||||||
(provide 'cmuscheme)
|
(provide 'cmuscheme)
|
||||||
|
|
|
||||||
|
|
@ -37,36 +37,36 @@
|
||||||
;;
|
;;
|
||||||
;; Introduction
|
;; Introduction
|
||||||
;;---------------
|
;;---------------
|
||||||
;;
|
|
||||||
;; After you type a few characters, pressing the "complete" key inserts
|
|
||||||
;; the rest of the word you are likely to type.
|
|
||||||
;;
|
;;
|
||||||
;; This watches all the words that you type and remembers them. When
|
;; After you type a few characters, pressing the "complete" key inserts
|
||||||
|
;; the rest of the word you are likely to type.
|
||||||
|
;;
|
||||||
|
;; This watches all the words that you type and remembers them. When
|
||||||
;; typing a new word, pressing "complete" (meta-return) "completes" the
|
;; typing a new word, pressing "complete" (meta-return) "completes" the
|
||||||
;; word by inserting the most recently used word that begins with the
|
;; word by inserting the most recently used word that begins with the
|
||||||
;; same characters. If you press meta-return repeatedly, it cycles
|
;; same characters. If you press meta-return repeatedly, it cycles
|
||||||
;; through all the words it knows about.
|
;; through all the words it knows about.
|
||||||
;;
|
;;
|
||||||
;; If you like the completion then just continue typing, it is as if you
|
;; If you like the completion then just continue typing, it is as if you
|
||||||
;; entered the text by hand. If you want the inserted extra characters
|
;; entered the text by hand. If you want the inserted extra characters
|
||||||
;; to go away, type control-w or delete. More options are described below.
|
;; to go away, type control-w or delete. More options are described below.
|
||||||
;;
|
;;
|
||||||
;; The guesses are made in the order of the most recently "used". Typing
|
;; The guesses are made in the order of the most recently "used". Typing
|
||||||
;; in a word and then typing a separator character (such as a space) "uses"
|
;; in a word and then typing a separator character (such as a space) "uses"
|
||||||
;; the word. So does moving a cursor over the word. If no words are found,
|
;; the word. So does moving a cursor over the word. If no words are found,
|
||||||
;; it uses an extended version of the dabbrev style completion.
|
;; it uses an extended version of the dabbrev style completion.
|
||||||
;;
|
;;
|
||||||
;; You automatically save the completions you use to a file between
|
;; You automatically save the completions you use to a file between
|
||||||
;; sessions.
|
;; sessions.
|
||||||
;;
|
;;
|
||||||
;; Completion enables programmers to enter longer, more descriptive
|
;; Completion enables programmers to enter longer, more descriptive
|
||||||
;; variable names while typing fewer keystrokes than they normally would.
|
;; variable names while typing fewer keystrokes than they normally would.
|
||||||
;;
|
;;
|
||||||
;;
|
;;
|
||||||
;; Full documentation
|
;; Full documentation
|
||||||
;;---------------------
|
;;---------------------
|
||||||
;;
|
;;
|
||||||
;; A "word" is any string containing characters with either word or symbol
|
;; A "word" is any string containing characters with either word or symbol
|
||||||
;; syntax. [E.G. Any alphanumeric string with hyphens, underscores, etc.]
|
;; syntax. [E.G. Any alphanumeric string with hyphens, underscores, etc.]
|
||||||
;; Unless you change the constants, you must type at least three characters
|
;; Unless you change the constants, you must type at least three characters
|
||||||
;; for the word to be recognized. Only words longer than 6 characters are
|
;; for the word to be recognized. Only words longer than 6 characters are
|
||||||
|
|
@ -82,27 +82,27 @@
|
||||||
;; Completions are automatically saved from one session to another
|
;; Completions are automatically saved from one session to another
|
||||||
;; (unless save-completions-flag or enable-completion is nil).
|
;; (unless save-completions-flag or enable-completion is nil).
|
||||||
;; Loading this file (or calling initialize-completions) causes EMACS
|
;; Loading this file (or calling initialize-completions) causes EMACS
|
||||||
;; to load a completions database for a saved completions file
|
;; to load a completions database for a saved completions file
|
||||||
;; (default: ~/.completions). When you exit, EMACS saves a copy of the
|
;; (default: ~/.completions). When you exit, EMACS saves a copy of the
|
||||||
;; completions that you
|
;; completions that you
|
||||||
;; often use. When you next start, EMACS loads in the saved completion file.
|
;; often use. When you next start, EMACS loads in the saved completion file.
|
||||||
;;
|
;;
|
||||||
;; The number of completions saved depends loosely on
|
;; The number of completions saved depends loosely on
|
||||||
;; *saved-completions-decay-factor*. Completions that have never been
|
;; *saved-completions-decay-factor*. Completions that have never been
|
||||||
;; inserted via "complete" are not saved. You are encouraged to experiment
|
;; inserted via "complete" are not saved. You are encouraged to experiment
|
||||||
;; with different functions (see compute-completion-min-num-uses).
|
;; with different functions (see compute-completion-min-num-uses).
|
||||||
;;
|
;;
|
||||||
;; Some completions are permanent and are always saved out. These
|
;; Some completions are permanent and are always saved out. These
|
||||||
;; completions have their num-uses slot set to T. Use
|
;; completions have their num-uses slot set to T. Use
|
||||||
;; add-permanent-completion to do this
|
;; add-permanent-completion to do this
|
||||||
;;
|
;;
|
||||||
;; Completions are saved only if enable-completion is T. The number of old
|
;; Completions are saved only if enable-completion is T. The number of old
|
||||||
;; versions kept of the saved completions file is controlled by
|
;; versions kept of the saved completions file is controlled by
|
||||||
;; completions-file-versions-kept.
|
;; completions-file-versions-kept.
|
||||||
;;
|
;;
|
||||||
;; COMPLETE KEY OPTIONS
|
;; COMPLETE KEY OPTIONS
|
||||||
;; The complete function takes a numeric arguments.
|
;; The complete function takes a numeric arguments.
|
||||||
;; control-u :: leave the point at the beginning of the completion rather
|
;; control-u :: leave the point at the beginning of the completion rather
|
||||||
;; than the middle.
|
;; than the middle.
|
||||||
;; a number :: rotate through the possible completions by that amount
|
;; a number :: rotate through the possible completions by that amount
|
||||||
;; `-' :: same as -1 (insert previous completion)
|
;; `-' :: same as -1 (insert previous completion)
|
||||||
|
|
@ -111,17 +111,17 @@
|
||||||
;; <write>
|
;; <write>
|
||||||
;;
|
;;
|
||||||
;; UPDATING THE DATABASE MANUALLY
|
;; UPDATING THE DATABASE MANUALLY
|
||||||
;; m-x kill-completion
|
;; m-x kill-completion
|
||||||
;; kills the completion at point.
|
;; kills the completion at point.
|
||||||
;; m-x add-completion
|
;; m-x add-completion
|
||||||
;; m-x add-permanent-completion
|
;; m-x add-permanent-completion
|
||||||
;;
|
;;
|
||||||
;; UPDATING THE DATABASE FROM A SOURCE CODE FILE
|
;; UPDATING THE DATABASE FROM A SOURCE CODE FILE
|
||||||
;; m-x add-completions-from-buffer
|
;; m-x add-completions-from-buffer
|
||||||
;; Parses all the definition names from a C or LISP mode buffer and
|
;; Parses all the definition names from a C or LISP mode buffer and
|
||||||
;; adds them to the completion database.
|
;; adds them to the completion database.
|
||||||
;;
|
;;
|
||||||
;; m-x add-completions-from-lisp-file
|
;; m-x add-completions-from-lisp-file
|
||||||
;; Parses all the definition names from a C or Lisp mode file and
|
;; Parses all the definition names from a C or Lisp mode file and
|
||||||
;; adds them to the completion database.
|
;; adds them to the completion database.
|
||||||
;;
|
;;
|
||||||
|
|
@ -133,16 +133,16 @@
|
||||||
;; <write>
|
;; <write>
|
||||||
;;
|
;;
|
||||||
;; STRING CASING
|
;; STRING CASING
|
||||||
;; Completion is string case independent if case-fold-search has its
|
;; Completion is string case independent if case-fold-search has its
|
||||||
;; normal default of T. Also when the completion is inserted the case of the
|
;; normal default of T. Also when the completion is inserted the case of the
|
||||||
;; entry is coerced appropriately.
|
;; entry is coerced appropriately.
|
||||||
;; [E.G. APP --> APPROPRIATELY app --> appropriately
|
;; [E.G. APP --> APPROPRIATELY app --> appropriately
|
||||||
;; App --> Appropriately]
|
;; App --> Appropriately]
|
||||||
;;
|
;;
|
||||||
;; INITIALIZATION
|
;; INITIALIZATION
|
||||||
;; The form `(initialize-completions)' initializes the completion system by
|
;; The form `(initialize-completions)' initializes the completion system by
|
||||||
;; trying to load in the user's completions. After the first cal, further
|
;; trying to load in the user's completions. After the first cal, further
|
||||||
;; calls have no effect so one should be careful not to put the form in a
|
;; calls have no effect so one should be careful not to put the form in a
|
||||||
;; site's standard site-init file.
|
;; site's standard site-init file.
|
||||||
;;
|
;;
|
||||||
;;---------------------------------------------------------------------------
|
;;---------------------------------------------------------------------------
|
||||||
|
|
@ -180,10 +180,10 @@
|
||||||
;; Inserts a completion at point
|
;; Inserts a completion at point
|
||||||
;;
|
;;
|
||||||
;; initialize-completions
|
;; initialize-completions
|
||||||
;; Loads the completions file and sets up so that exiting emacs will
|
;; Loads the completions file and sets up so that exiting emacs will
|
||||||
;; save them.
|
;; save them.
|
||||||
;;
|
;;
|
||||||
;; save-completions-to-file &optional filename
|
;; save-completions-to-file &optional filename
|
||||||
;; load-completions-from-file &optional filename
|
;; load-completions-from-file &optional filename
|
||||||
;;
|
;;
|
||||||
;;-----------------------------------------------
|
;;-----------------------------------------------
|
||||||
|
|
@ -194,11 +194,11 @@
|
||||||
;;
|
;;
|
||||||
;; These things are for manipulating the structure
|
;; These things are for manipulating the structure
|
||||||
;; make-completion string num-uses
|
;; make-completion string num-uses
|
||||||
;; completion-num-uses completion
|
;; completion-num-uses completion
|
||||||
;; completion-string completion
|
;; completion-string completion
|
||||||
;; set-completion-num-uses completion num-uses
|
;; set-completion-num-uses completion num-uses
|
||||||
;; set-completion-string completion string
|
;; set-completion-string completion string
|
||||||
;;
|
;;
|
||||||
;;
|
;;
|
||||||
|
|
||||||
;;-----------------------------------------------
|
;;-----------------------------------------------
|
||||||
|
|
@ -215,16 +215,16 @@
|
||||||
;;-----------------------------------------------
|
;;-----------------------------------------------
|
||||||
;;; Change Log:
|
;;; Change Log:
|
||||||
;;-----------------------------------------------
|
;;-----------------------------------------------
|
||||||
;; Sometime in '84 Brewster implemented a somewhat buggy version for
|
;; Sometime in '84 Brewster implemented a somewhat buggy version for
|
||||||
;; Symbolics LISPMs.
|
;; Symbolics LISPMs.
|
||||||
;; Jan. '85 Jim became enamored of the idea and implemented a faster,
|
;; Jan. '85 Jim became enamored of the idea and implemented a faster,
|
||||||
;; more robust version.
|
;; more robust version.
|
||||||
;; With input from many users at TMC, (rose, craig, and gls come to mind),
|
;; With input from many users at TMC, (rose, craig, and gls come to mind),
|
||||||
;; the current style of interface was developed.
|
;; the current style of interface was developed.
|
||||||
;; 9/87, Jim and Brewster took terminals home. Yuck. After
|
;; 9/87, Jim and Brewster took terminals home. Yuck. After
|
||||||
;; complaining for a while Brewster implemented a subset of the current
|
;; complaining for a while Brewster implemented a subset of the current
|
||||||
;; LISPM version for GNU Emacs.
|
;; LISPM version for GNU Emacs.
|
||||||
;; 8/88 After complaining for a while (and with sufficient
|
;; 8/88 After complaining for a while (and with sufficient
|
||||||
;; promised rewards), Jim reimplemented a version of GNU completion
|
;; promised rewards), Jim reimplemented a version of GNU completion
|
||||||
;; superior to that of the LISPM version.
|
;; superior to that of the LISPM version.
|
||||||
;;
|
;;
|
||||||
|
|
@ -269,7 +269,7 @@
|
||||||
;; - minor fix to capitalization code
|
;; - minor fix to capitalization code
|
||||||
;; - added *completion-auto-save-period* to variables recorded.
|
;; - added *completion-auto-save-period* to variables recorded.
|
||||||
;; - added reenter protection to cmpl-record-statistics-filter
|
;; - added reenter protection to cmpl-record-statistics-filter
|
||||||
;; - added backup protection to save-completions-to-file (prevents
|
;; - added backup protection to save-completions-to-file (prevents
|
||||||
;; problems with disk full errors)
|
;; problems with disk full errors)
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
@ -375,7 +375,7 @@ DON'T CHANGE WITHOUT RECOMPILING ! This is used by macros.")
|
||||||
(setq completion-prefix-min-length 3)))
|
(setq completion-prefix-min-length 3)))
|
||||||
|
|
||||||
(completion-eval-when)
|
(completion-eval-when)
|
||||||
|
|
||||||
;;---------------------------------------------------------------------------
|
;;---------------------------------------------------------------------------
|
||||||
;; Internal Variables
|
;; Internal Variables
|
||||||
;;---------------------------------------------------------------------------
|
;;---------------------------------------------------------------------------
|
||||||
|
|
@ -476,17 +476,17 @@ Used to decide whether to save completions.")
|
||||||
;; of syntax in these "symbol" syntax tables ::
|
;; of syntax in these "symbol" syntax tables ::
|
||||||
;;
|
;;
|
||||||
;; syntax (?_) - "symbol" chars (e.g. alphanumerics)
|
;; syntax (?_) - "symbol" chars (e.g. alphanumerics)
|
||||||
;; syntax (?w) - symbol chars to ignore at end of words (e.g. period).
|
;; syntax (?w) - symbol chars to ignore at end of words (e.g. period).
|
||||||
;; syntax (? ) - everything else
|
;; syntax (? ) - everything else
|
||||||
;;
|
;;
|
||||||
;; Thus by judicious use of scan-sexps and forward-word, we can get
|
;; Thus by judicious use of scan-sexps and forward-word, we can get
|
||||||
;; the word we want relatively fast and without consing.
|
;; the word we want relatively fast and without consing.
|
||||||
;;
|
;;
|
||||||
;; Why do we need a separate category for "symbol chars to ignore at ends" ?
|
;; Why do we need a separate category for "symbol chars to ignore at ends" ?
|
||||||
;; For example, in LISP we want starting :'s trimmed
|
;; For example, in LISP we want starting :'s trimmed
|
||||||
;; so keyword argument specifiers also define the keyword completion. And,
|
;; so keyword argument specifiers also define the keyword completion. And,
|
||||||
;; for example, in C we want `.' appearing in a structure ref. to
|
;; for example, in C we want `.' appearing in a structure ref. to
|
||||||
;; be kept intact in order to store the whole structure ref.; however, if
|
;; be kept intact in order to store the whole structure ref.; however, if
|
||||||
;; it appears at the end of a symbol it should be discarded because it is
|
;; it appears at the end of a symbol it should be discarded because it is
|
||||||
;; probably used as a period.
|
;; probably used as a period.
|
||||||
|
|
||||||
|
|
@ -503,7 +503,7 @@ Used to decide whether to save completions.")
|
||||||
;; C diffs ->
|
;; C diffs ->
|
||||||
;; Separator chars :: + * / : %
|
;; Separator chars :: + * / : %
|
||||||
;; A note on the hyphen (`-'). Perhaps the hyphen should also be a separator
|
;; A note on the hyphen (`-'). Perhaps the hyphen should also be a separator
|
||||||
;; char., however, we wanted to have completion symbols include pointer
|
;; char., however, we wanted to have completion symbols include pointer
|
||||||
;; references. For example, "foo->bar" is a symbol as far as completion is
|
;; references. For example, "foo->bar" is a symbol as far as completion is
|
||||||
;; concerned.
|
;; concerned.
|
||||||
;;
|
;;
|
||||||
|
|
@ -556,7 +556,7 @@ Used to decide whether to save completions.")
|
||||||
(dolist (char symbol-chars)
|
(dolist (char symbol-chars)
|
||||||
(modify-syntax-entry char "_" table))
|
(modify-syntax-entry char "_" table))
|
||||||
table))
|
table))
|
||||||
|
|
||||||
(defun cmpl-make-c-completion-syntax-table ()
|
(defun cmpl-make-c-completion-syntax-table ()
|
||||||
(let ((table (copy-syntax-table cmpl-standard-syntax-table))
|
(let ((table (copy-syntax-table cmpl-standard-syntax-table))
|
||||||
(separator-chars '(?+ ?* ?/ ?: ?%)))
|
(separator-chars '(?+ ?* ?/ ?: ?%)))
|
||||||
|
|
@ -598,9 +598,9 @@ But only if it is longer than `completion-min-length'."
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn
|
(progn
|
||||||
(set-syntax-table cmpl-syntax-table)
|
(set-syntax-table cmpl-syntax-table)
|
||||||
(cond
|
(cond
|
||||||
;; Cursor is on following-char and after preceding-char
|
;; Cursor is on following-char and after preceding-char
|
||||||
((memq (char-syntax (following-char)) '(?w ?_))
|
((memq (char-syntax (following-char)) '(?w ?_))
|
||||||
(setq cmpl-saved-point (point)
|
(setq cmpl-saved-point (point)
|
||||||
cmpl-symbol-start (scan-sexps (1+ cmpl-saved-point) -1)
|
cmpl-symbol-start (scan-sexps (1+ cmpl-saved-point) -1)
|
||||||
cmpl-symbol-end (scan-sexps cmpl-saved-point 1))
|
cmpl-symbol-end (scan-sexps cmpl-saved-point 1))
|
||||||
|
|
@ -638,7 +638,7 @@ But only if it is longer than `completion-min-length'."
|
||||||
|
|
||||||
(defun symbol-before-point ()
|
(defun symbol-before-point ()
|
||||||
"Returns a string of the symbol immediately before point.
|
"Returns a string of the symbol immediately before point.
|
||||||
Returns nil if there isn't one longer than `completion-min-length'."
|
Returns nil if there isn't one longer than `completion-min-length'."
|
||||||
;; This is called when a word separator is typed so it must be FAST !
|
;; This is called when a word separator is typed so it must be FAST !
|
||||||
(setq cmpl-saved-syntax (syntax-table))
|
(setq cmpl-saved-syntax (syntax-table))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
|
|
@ -774,7 +774,7 @@ Returns nil if there isn't one longer than `completion-min-length'."
|
||||||
;; "Only executes body if we are recording statistics."
|
;; "Only executes body if we are recording statistics."
|
||||||
;; (list 'cond
|
;; (list 'cond
|
||||||
;; (list* '*record-cmpl-statistics-p* body)
|
;; (list* '*record-cmpl-statistics-p* body)
|
||||||
;; ))
|
;; ))
|
||||||
|
|
||||||
;;-----------------------------------------------
|
;;-----------------------------------------------
|
||||||
;; Completion Sources
|
;; Completion Sources
|
||||||
|
|
@ -797,7 +797,7 @@ Returns nil if there isn't one longer than `completion-min-length'."
|
||||||
;; Completion Method #2: dabbrev-expand style
|
;; Completion Method #2: dabbrev-expand style
|
||||||
;;---------------------------------------------------------------------------
|
;;---------------------------------------------------------------------------
|
||||||
;;
|
;;
|
||||||
;; This method is used if there are no useful stored completions. It is
|
;; This method is used if there are no useful stored completions. It is
|
||||||
;; based on dabbrev-expand with these differences :
|
;; based on dabbrev-expand with these differences :
|
||||||
;; 1) Faster (we don't use regexps)
|
;; 1) Faster (we don't use regexps)
|
||||||
;; 2) case coercion handled correctly
|
;; 2) case coercion handled correctly
|
||||||
|
|
@ -880,7 +880,7 @@ This is sensitive to `case-fold-search'."
|
||||||
;; note that case-fold-search affects the behavior of this function
|
;; note that case-fold-search affects the behavior of this function
|
||||||
;; Bug: won't pick up an expansion that starts at the top of buffer
|
;; Bug: won't pick up an expansion that starts at the top of buffer
|
||||||
(if cdabbrev-current-window
|
(if cdabbrev-current-window
|
||||||
(let (saved-point
|
(let (saved-point
|
||||||
saved-syntax
|
saved-syntax
|
||||||
(expansion nil)
|
(expansion nil)
|
||||||
downcase-expansion tried-list syntax saved-point-2)
|
downcase-expansion tried-list syntax saved-point-2)
|
||||||
|
|
@ -1004,7 +1004,7 @@ Each symbol is bound to a single completion entry.")
|
||||||
;; last-use-time is t if the string should be kept permanently
|
;; last-use-time is t if the string should be kept permanently
|
||||||
;; num-uses is incremented every time the completion is used.
|
;; num-uses is incremented every time the completion is used.
|
||||||
|
|
||||||
;; We chose lists because (car foo) is faster than (aref foo 0) and the
|
;; We chose lists because (car foo) is faster than (aref foo 0) and the
|
||||||
;; creation time is about the same.
|
;; creation time is about the same.
|
||||||
|
|
||||||
;; READER MACROS
|
;; READER MACROS
|
||||||
|
|
@ -1013,7 +1013,7 @@ Each symbol is bound to a single completion entry.")
|
||||||
(list 'car completion-entry))
|
(list 'car completion-entry))
|
||||||
|
|
||||||
(defmacro completion-num-uses (completion-entry)
|
(defmacro completion-num-uses (completion-entry)
|
||||||
;; "The number of times it has used. Used to decide whether to save
|
;; "The number of times it has used. Used to decide whether to save
|
||||||
;; it."
|
;; it."
|
||||||
(list 'car (list 'cdr completion-entry)))
|
(list 'car (list 'cdr completion-entry)))
|
||||||
|
|
||||||
|
|
@ -1291,7 +1291,7 @@ Returns the completion entry."
|
||||||
(note-added-completion))
|
(note-added-completion))
|
||||||
;; Add it to the symbol
|
;; Add it to the symbol
|
||||||
(set cmpl-db-symbol (car entry)))))
|
(set cmpl-db-symbol (car entry)))))
|
||||||
|
|
||||||
(defun delete-completion (completion-string)
|
(defun delete-completion (completion-string)
|
||||||
"Delete the completion from the database.
|
"Delete the completion from the database.
|
||||||
String must be longer than `completion-prefix-min-length'."
|
String must be longer than `completion-prefix-min-length'."
|
||||||
|
|
@ -1299,7 +1299,7 @@ String must be longer than `completion-prefix-min-length'."
|
||||||
(if completion-to-accept (accept-completion))
|
(if completion-to-accept (accept-completion))
|
||||||
(if (setq cmpl-db-entry (find-exact-completion completion-string))
|
(if (setq cmpl-db-entry (find-exact-completion completion-string))
|
||||||
;; found
|
;; found
|
||||||
(let* ((prefix-entry (find-cmpl-prefix-entry
|
(let* ((prefix-entry (find-cmpl-prefix-entry
|
||||||
(substring cmpl-db-downcase-string 0
|
(substring cmpl-db-downcase-string 0
|
||||||
(cmpl-read-time-eval
|
(cmpl-read-time-eval
|
||||||
completion-prefix-min-length))))
|
completion-prefix-min-length))))
|
||||||
|
|
@ -1339,16 +1339,16 @@ String must be longer than `completion-prefix-min-length'."
|
||||||
;;
|
;;
|
||||||
;; - Deleting -
|
;; - Deleting -
|
||||||
;; (add-completion-to-head "banner") --> ("banner" 0 nil 0)
|
;; (add-completion-to-head "banner") --> ("banner" 0 nil 0)
|
||||||
;; (delete-completion "banner")
|
;; (delete-completion "banner")
|
||||||
;; (find-exact-completion "banner") --> nil
|
;; (find-exact-completion "banner") --> nil
|
||||||
;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...))
|
;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...))
|
||||||
;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...))
|
;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...))
|
||||||
;; (add-completion-to-head "banner") --> ("banner" 0 nil 0)
|
;; (add-completion-to-head "banner") --> ("banner" 0 nil 0)
|
||||||
;; (delete-completion "banana")
|
;; (delete-completion "banana")
|
||||||
;; (car (find-cmpl-prefix-entry "ban")) --> (("banner" ...) ("banish" ...))
|
;; (car (find-cmpl-prefix-entry "ban")) --> (("banner" ...) ("banish" ...))
|
||||||
;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...))
|
;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...))
|
||||||
;; (delete-completion "banner")
|
;; (delete-completion "banner")
|
||||||
;; (delete-completion "banish")
|
;; (delete-completion "banish")
|
||||||
;; (find-cmpl-prefix-entry "ban") --> nil
|
;; (find-cmpl-prefix-entry "ban") --> nil
|
||||||
;; (delete-completion "banner") --> error
|
;; (delete-completion "banner") --> error
|
||||||
;;
|
;;
|
||||||
|
|
@ -1365,7 +1365,7 @@ String must be longer than `completion-prefix-min-length'."
|
||||||
;;---------------------------------------------------------------------------
|
;;---------------------------------------------------------------------------
|
||||||
;; Database Update :: Interface level routines
|
;; Database Update :: Interface level routines
|
||||||
;;---------------------------------------------------------------------------
|
;;---------------------------------------------------------------------------
|
||||||
;;
|
;;
|
||||||
;; These lie on top of the database ref. functions but below the standard
|
;; These lie on top of the database ref. functions but below the standard
|
||||||
;; user interface level
|
;; user interface level
|
||||||
|
|
||||||
|
|
@ -1388,7 +1388,7 @@ String must be longer than `completion-prefix-min-length'."
|
||||||
|
|
||||||
(defun add-completion (string &optional num-uses last-use-time)
|
(defun add-completion (string &optional num-uses last-use-time)
|
||||||
"Add STRING to completion list, or move it to head of list.
|
"Add STRING to completion list, or move it to head of list.
|
||||||
The completion is altered appropriately if num-uses and/or last-use-time is
|
The completion is altered appropriately if num-uses and/or last-use-time is
|
||||||
specified."
|
specified."
|
||||||
(interactive (interactive-completion-string-reader "Completion to add"))
|
(interactive (interactive-completion-string-reader "Completion to add"))
|
||||||
(check-completion-length string)
|
(check-completion-length string)
|
||||||
|
|
@ -1396,7 +1396,7 @@ specified."
|
||||||
cmpl-source-interactive
|
cmpl-source-interactive
|
||||||
current-completion-source))
|
current-completion-source))
|
||||||
(entry (add-completion-to-head string)))
|
(entry (add-completion-to-head string)))
|
||||||
|
|
||||||
(if num-uses (set-completion-num-uses entry num-uses))
|
(if num-uses (set-completion-num-uses entry num-uses))
|
||||||
(if last-use-time
|
(if last-use-time
|
||||||
(set-completion-last-use-time entry last-use-time))))
|
(set-completion-last-use-time entry last-use-time))))
|
||||||
|
|
@ -1417,7 +1417,7 @@ specified."
|
||||||
|
|
||||||
(defun accept-completion ()
|
(defun accept-completion ()
|
||||||
"Accepts the pending completion in `completion-to-accept'.
|
"Accepts the pending completion in `completion-to-accept'.
|
||||||
This bumps num-uses. Called by `add-completion-to-head' and
|
This bumps num-uses. Called by `add-completion-to-head' and
|
||||||
`completion-search-reset'."
|
`completion-search-reset'."
|
||||||
(let ((string completion-to-accept)
|
(let ((string completion-to-accept)
|
||||||
;; if this is added afresh here, then it must be a cdabbrev
|
;; if this is added afresh here, then it must be a cdabbrev
|
||||||
|
|
@ -1433,7 +1433,7 @@ This bumps num-uses. Called by `add-completion-to-head' and
|
||||||
(let ((string (and enable-completion (symbol-under-point)))
|
(let ((string (and enable-completion (symbol-under-point)))
|
||||||
(current-completion-source cmpl-source-cursor-moves))
|
(current-completion-source cmpl-source-cursor-moves))
|
||||||
(if string (add-completion-to-head string))))
|
(if string (add-completion-to-head string))))
|
||||||
|
|
||||||
(defun use-completion-before-point ()
|
(defun use-completion-before-point ()
|
||||||
"Add the completion symbol before point into the completion buffer."
|
"Add the completion symbol before point into the completion buffer."
|
||||||
(let ((string (and enable-completion (symbol-before-point)))
|
(let ((string (and enable-completion (symbol-before-point)))
|
||||||
|
|
@ -1465,25 +1465,25 @@ Completions added this way will automatically be saved if
|
||||||
|
|
||||||
;; Tests --
|
;; Tests --
|
||||||
;; - Add and Find -
|
;; - Add and Find -
|
||||||
;; (add-completion "banana" 5 10)
|
;; (add-completion "banana" 5 10)
|
||||||
;; (find-exact-completion "banana") --> ("banana" 5 10 0)
|
;; (find-exact-completion "banana") --> ("banana" 5 10 0)
|
||||||
;; (add-completion "banana" 6)
|
;; (add-completion "banana" 6)
|
||||||
;; (find-exact-completion "banana") --> ("banana" 6 10 0)
|
;; (find-exact-completion "banana") --> ("banana" 6 10 0)
|
||||||
;; (add-completion "banish")
|
;; (add-completion "banish")
|
||||||
;; (car (find-cmpl-prefix-entry "ban")) --> (("banish" ...) ("banana" ...))
|
;; (car (find-cmpl-prefix-entry "ban")) --> (("banish" ...) ("banana" ...))
|
||||||
;;
|
;;
|
||||||
;; - Accepting -
|
;; - Accepting -
|
||||||
;; (setq completion-to-accept "banana")
|
;; (setq completion-to-accept "banana")
|
||||||
;; (accept-completion)
|
;; (accept-completion)
|
||||||
;; (find-exact-completion "banana") --> ("banana" 7 10)
|
;; (find-exact-completion "banana") --> ("banana" 7 10)
|
||||||
;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...))
|
;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...))
|
||||||
;; (setq completion-to-accept "banish")
|
;; (setq completion-to-accept "banish")
|
||||||
;; (add-completion "banner")
|
;; (add-completion "banner")
|
||||||
;; (car (find-cmpl-prefix-entry "ban"))
|
;; (car (find-cmpl-prefix-entry "ban"))
|
||||||
;; --> (("banner" ...) ("banish" 1 ...) ("banana" 7 ...))
|
;; --> (("banner" ...) ("banish" 1 ...) ("banana" 7 ...))
|
||||||
;;
|
;;
|
||||||
;; - Deleting -
|
;; - Deleting -
|
||||||
;; (kill-completion "banish")
|
;; (kill-completion "banish")
|
||||||
;; (car (find-cmpl-prefix-entry "ban")) --> (("banner" ...) ("banana" ...))
|
;; (car (find-cmpl-prefix-entry "ban")) --> (("banner" ...) ("banana" ...))
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1499,7 +1499,7 @@ Completions added this way will automatically be saved if
|
||||||
(defvar cmpl-test-string "")
|
(defvar cmpl-test-string "")
|
||||||
;; "The current string used by completion-search-next."
|
;; "The current string used by completion-search-next."
|
||||||
(defvar cmpl-test-regexp "")
|
(defvar cmpl-test-regexp "")
|
||||||
;; "The current regexp used by completion-search-next.
|
;; "The current regexp used by completion-search-next.
|
||||||
;; (derived from cmpl-test-string)"
|
;; (derived from cmpl-test-string)"
|
||||||
(defvar cmpl-last-index 0)
|
(defvar cmpl-last-index 0)
|
||||||
;; "The last index that completion-search-next was called with."
|
;; "The last index that completion-search-next was called with."
|
||||||
|
|
@ -1554,7 +1554,7 @@ If there are no more entries, try cdabbrev and returns only a string."
|
||||||
(cond ((not cmpl-next-possibilities))
|
(cond ((not cmpl-next-possibilities))
|
||||||
;; If no more possibilities, leave it that way
|
;; If no more possibilities, leave it that way
|
||||||
((= -1 cmpl-last-index)
|
((= -1 cmpl-last-index)
|
||||||
;; next completion is at index 0. reset next-possibility list
|
;; next completion is at index 0. reset next-possibility list
|
||||||
;; to start at beginning
|
;; to start at beginning
|
||||||
(setq cmpl-next-possibilities cmpl-starting-possibilities))
|
(setq cmpl-next-possibilities cmpl-starting-possibilities))
|
||||||
(t
|
(t
|
||||||
|
|
@ -1574,11 +1574,11 @@ If there are no more entries, try cdabbrev and returns only a string."
|
||||||
(prog1
|
(prog1
|
||||||
cmpl-next-possibility
|
cmpl-next-possibility
|
||||||
(setq cmpl-next-possibility nil)))
|
(setq cmpl-next-possibility nil)))
|
||||||
|
|
||||||
|
|
||||||
(defun completion-search-peek (use-cdabbrev)
|
(defun completion-search-peek (use-cdabbrev)
|
||||||
"Returns the next completion entry without actually moving the pointers.
|
"Returns the next completion entry without actually moving the pointers.
|
||||||
Calling this again or calling `completion-search-next' results in the same
|
Calling this again or calling `completion-search-next' results in the same
|
||||||
string being returned. Depends on `case-fold-search'.
|
string being returned. Depends on `case-fold-search'.
|
||||||
If there are no more entries, try cdabbrev and then return only a string."
|
If there are no more entries, try cdabbrev and then return only a string."
|
||||||
(cond
|
(cond
|
||||||
|
|
@ -1609,14 +1609,14 @@ If there are no more entries, try cdabbrev and then return only a string."
|
||||||
|
|
||||||
;; Tests --
|
;; Tests --
|
||||||
;; - Add and Find -
|
;; - Add and Find -
|
||||||
;; (add-completion "banana")
|
;; (add-completion "banana")
|
||||||
;; (completion-search-reset "ban")
|
;; (completion-search-reset "ban")
|
||||||
;; (completion-search-next 0) --> "banana"
|
;; (completion-search-next 0) --> "banana"
|
||||||
;;
|
;;
|
||||||
;; - Discrimination -
|
;; - Discrimination -
|
||||||
;; (add-completion "cumberland")
|
;; (add-completion "cumberland")
|
||||||
;; (add-completion "cumberbund")
|
;; (add-completion "cumberbund")
|
||||||
;; cumbering
|
;; cumbering
|
||||||
;; (completion-search-reset "cumb")
|
;; (completion-search-reset "cumb")
|
||||||
;; (completion-search-peek t) --> "cumberbund"
|
;; (completion-search-peek t) --> "cumberbund"
|
||||||
;; (completion-search-next 0) --> "cumberbund"
|
;; (completion-search-next 0) --> "cumberbund"
|
||||||
|
|
@ -1637,7 +1637,7 @@ If there are no more entries, try cdabbrev and then return only a string."
|
||||||
;;
|
;;
|
||||||
;; - Deleting -
|
;; - Deleting -
|
||||||
;; (kill-completion "cumberland")
|
;; (kill-completion "cumberland")
|
||||||
;; cummings
|
;; cummings
|
||||||
;; (completion-search-reset "cum")
|
;; (completion-search-reset "cum")
|
||||||
;; (completion-search-next 0) --> "cumberbund"
|
;; (completion-search-next 0) --> "cumberbund"
|
||||||
;; (completion-search-next 1) --> "cummings"
|
;; (completion-search-next 1) --> "cummings"
|
||||||
|
|
@ -1657,17 +1657,17 @@ If there are no more entries, try cdabbrev and then return only a string."
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq enable-completion (not enable-completion))
|
(setq enable-completion (not enable-completion))
|
||||||
(message "Completion mode is now %s." (if enable-completion "ON" "OFF")))
|
(message "Completion mode is now %s." (if enable-completion "ON" "OFF")))
|
||||||
|
|
||||||
(defvar cmpl-current-index 0)
|
(defvar cmpl-current-index 0)
|
||||||
(defvar cmpl-original-string nil)
|
(defvar cmpl-original-string nil)
|
||||||
(defvar cmpl-last-insert-location -1)
|
(defvar cmpl-last-insert-location -1)
|
||||||
(defvar cmpl-leave-point-at-start nil)
|
(defvar cmpl-leave-point-at-start nil)
|
||||||
|
|
||||||
(defun complete (&optional arg)
|
(defun complete (&optional arg)
|
||||||
"Fill out a completion of the word before point.
|
"Fill out a completion of the word before point.
|
||||||
Point is left at end. Consecutive calls rotate through all possibilities.
|
Point is left at end. Consecutive calls rotate through all possibilities.
|
||||||
Prefix args ::
|
Prefix args ::
|
||||||
control-u :: leave the point at the beginning of the completion rather
|
control-u :: leave the point at the beginning of the completion rather
|
||||||
than at the end.
|
than at the end.
|
||||||
a number :: rotate through the possible completions by that amount
|
a number :: rotate through the possible completions by that amount
|
||||||
`-' :: same as -1 (insert previous completion)
|
`-' :: same as -1 (insert previous completion)
|
||||||
|
|
@ -1693,7 +1693,7 @@ Prefix args ::
|
||||||
(setq this-command 'failed-complete)
|
(setq this-command 'failed-complete)
|
||||||
(error "To complete, point must be after a symbol at least %d character long"
|
(error "To complete, point must be after a symbol at least %d character long"
|
||||||
completion-prefix-min-length)))
|
completion-prefix-min-length)))
|
||||||
;; get index
|
;; get index
|
||||||
(setq cmpl-current-index (if current-prefix-arg arg 0))
|
(setq cmpl-current-index (if current-prefix-arg arg 0))
|
||||||
;; statistics
|
;; statistics
|
||||||
(cmpl-statistics-block
|
(cmpl-statistics-block
|
||||||
|
|
@ -1748,7 +1748,7 @@ Prefix args ::
|
||||||
(setq string (cmpl-merge-string-cases
|
(setq string (cmpl-merge-string-cases
|
||||||
string cmpl-original-string))
|
string cmpl-original-string))
|
||||||
(message "Next completion: %s" string))))
|
(message "Next completion: %s" string))))
|
||||||
(t;; none found, insert old
|
(t;; none found, insert old
|
||||||
(insert cmpl-original-string)
|
(insert cmpl-original-string)
|
||||||
;; Don't accept completions
|
;; Don't accept completions
|
||||||
(setq completion-to-accept nil)
|
(setq completion-to-accept nil)
|
||||||
|
|
@ -1862,7 +1862,7 @@ Prefix args ::
|
||||||
;; (and (string-match *lisp-def-regexp* "\n(def-bar foo")(match-end 0)) -> 10
|
;; (and (string-match *lisp-def-regexp* "\n(def-bar foo")(match-end 0)) -> 10
|
||||||
;; (and (string-match *lisp-def-regexp* "\n(defun (foo") (match-end 0)) -> 9
|
;; (and (string-match *lisp-def-regexp* "\n(defun (foo") (match-end 0)) -> 9
|
||||||
|
|
||||||
;; Parses all the definition names from a Lisp mode buffer and adds them to
|
;; Parses all the definition names from a Lisp mode buffer and adds them to
|
||||||
;; the completion database.
|
;; the completion database.
|
||||||
(defun add-completions-from-lisp-buffer ()
|
(defun add-completions-from-lisp-buffer ()
|
||||||
;;; Benchmarks
|
;;; Benchmarks
|
||||||
|
|
@ -1955,7 +1955,7 @@ Prefix args ::
|
||||||
;; (test-c-def-regexp *c-cont-regexp* "oo {trout =1} my_carp;") -> 14
|
;; (test-c-def-regexp *c-cont-regexp* "oo {trout =1} my_carp;") -> 14
|
||||||
;; (test-c-def-regexp *c-cont-regexp* "truct_p complex foon") -> nil
|
;; (test-c-def-regexp *c-cont-regexp* "truct_p complex foon") -> nil
|
||||||
|
|
||||||
;; Parses all the definition names from a C mode buffer and adds them to the
|
;; Parses all the definition names from a C mode buffer and adds them to the
|
||||||
;; completion database.
|
;; completion database.
|
||||||
(defun add-completions-from-c-buffer ()
|
(defun add-completions-from-c-buffer ()
|
||||||
;; Benchmark --
|
;; Benchmark --
|
||||||
|
|
@ -2089,7 +2089,7 @@ If file name is not specified, use `save-completions-file-name'."
|
||||||
(total-perm 0)
|
(total-perm 0)
|
||||||
(total-saved 0)
|
(total-saved 0)
|
||||||
(backup-filename (completion-backup-filename filename)))
|
(backup-filename (completion-backup-filename filename)))
|
||||||
|
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(get-buffer-create " *completion-save-buffer*")
|
(get-buffer-create " *completion-save-buffer*")
|
||||||
(set-buffer " *completion-save-buffer*")
|
(set-buffer " *completion-save-buffer*")
|
||||||
|
|
@ -2130,7 +2130,7 @@ If file name is not specified, use `save-completions-file-name'."
|
||||||
(setq total-saved (1+ total-saved))
|
(setq total-saved (1+ total-saved))
|
||||||
(insert (prin1-to-string (cons (completion-string completion)
|
(insert (prin1-to-string (cons (completion-string completion)
|
||||||
last-use-time)) "\n"))))
|
last-use-time)) "\n"))))
|
||||||
|
|
||||||
;; write the buffer
|
;; write the buffer
|
||||||
(condition-case e
|
(condition-case e
|
||||||
(let ((file-exists-p (file-exists-p filename)))
|
(let ((file-exists-p (file-exists-p filename)))
|
||||||
|
|
@ -2139,7 +2139,7 @@ If file name is not specified, use `save-completions-file-name'."
|
||||||
;; If file exists . . .
|
;; If file exists . . .
|
||||||
;; Save a backup(so GNU doesn't screw us when we're out of disk)
|
;; Save a backup(so GNU doesn't screw us when we're out of disk)
|
||||||
;; (GNU leaves a 0 length file if it gets a disk full error!)
|
;; (GNU leaves a 0 length file if it gets a disk full error!)
|
||||||
|
|
||||||
;; If backup doesn't exit, Rename current to backup
|
;; If backup doesn't exit, Rename current to backup
|
||||||
;; {If backup exists the primary file is probably messed up}
|
;; {If backup exists the primary file is probably messed up}
|
||||||
(or (file-exists-p backup-filename)
|
(or (file-exists-p backup-filename)
|
||||||
|
|
@ -2189,7 +2189,7 @@ If file is not specified, then use `save-completions-file-name'."
|
||||||
;; prepare the buffer to be modified
|
;; prepare the buffer to be modified
|
||||||
(clear-visited-file-modtime)
|
(clear-visited-file-modtime)
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
|
|
||||||
(let ((insert-okay-p nil)
|
(let ((insert-okay-p nil)
|
||||||
(buffer (current-buffer))
|
(buffer (current-buffer))
|
||||||
(current-time (cmpl-hours-since-origin))
|
(current-time (cmpl-hours-since-origin))
|
||||||
|
|
@ -2205,10 +2205,10 @@ If file is not specified, then use `save-completions-file-name'."
|
||||||
(progn (insert-file-contents filename t)
|
(progn (insert-file-contents filename t)
|
||||||
(setq insert-okay-p t))
|
(setq insert-okay-p t))
|
||||||
|
|
||||||
(file-error
|
(file-error
|
||||||
(message "File error trying to load completion file %s."
|
(message "File error trying to load completion file %s."
|
||||||
filename)))
|
filename)))
|
||||||
;; parse it
|
;; parse it
|
||||||
(if insert-okay-p
|
(if insert-okay-p
|
||||||
(progn
|
(progn
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
|
|
@ -2234,7 +2234,7 @@ If file is not specified, then use `save-completions-file-name'."
|
||||||
(completion-last-use-time
|
(completion-last-use-time
|
||||||
(setq cmpl-entry
|
(setq cmpl-entry
|
||||||
(add-completion-to-tail-if-new string))))
|
(add-completion-to-tail-if-new string))))
|
||||||
(if (or (eq last-use-time t)
|
(if (or (eq last-use-time t)
|
||||||
(and (> last-use-time 1000);;backcompatibility
|
(and (> last-use-time 1000);;backcompatibility
|
||||||
(not (eq cmpl-last-use-time t))
|
(not (eq cmpl-last-use-time t))
|
||||||
(or (not cmpl-last-use-time)
|
(or (not cmpl-last-use-time)
|
||||||
|
|
@ -2290,7 +2290,7 @@ If the previous command was also a kill command,
|
||||||
the text killed this time appends to the text killed last time
|
the text killed this time appends to the text killed last time
|
||||||
to make one entry in the kill ring.
|
to make one entry in the kill ring.
|
||||||
Patched to remove the most recent completion."
|
Patched to remove the most recent completion."
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(cond ((eq last-command 'complete)
|
(cond ((eq last-command 'complete)
|
||||||
(delete-region (point) cmpl-last-insert-location)
|
(delete-region (point) cmpl-last-insert-location)
|
||||||
(insert cmpl-original-string)
|
(insert cmpl-original-string)
|
||||||
|
|
@ -2311,7 +2311,7 @@ Patched to remove the most recent completion."
|
||||||
;; All common separators (eg. space "(" ")" """) characters go through a
|
;; All common separators (eg. space "(" ")" """) characters go through a
|
||||||
;; function to add new words to the list of words to complete from:
|
;; function to add new words to the list of words to complete from:
|
||||||
;; COMPLETION-SEPARATOR-SELF-INSERT-COMMAND (arg).
|
;; COMPLETION-SEPARATOR-SELF-INSERT-COMMAND (arg).
|
||||||
;; If the character before this was an alpha-numeric then this adds the
|
;; If the character before this was an alpha-numeric then this adds the
|
||||||
;; symbol before point to the completion list (using ADD-COMPLETION).
|
;; symbol before point to the completion list (using ADD-COMPLETION).
|
||||||
|
|
||||||
(defun completion-separator-self-insert-command (arg)
|
(defun completion-separator-self-insert-command (arg)
|
||||||
|
|
@ -2330,7 +2330,7 @@ Patched to remove the most recent completion."
|
||||||
;; Wrapping Macro
|
;; Wrapping Macro
|
||||||
;;-----------------------------------------------
|
;;-----------------------------------------------
|
||||||
|
|
||||||
;; Note that because of the way byte compiling works, none of
|
;; Note that because of the way byte compiling works, none of
|
||||||
;; the functions defined with this macro get byte compiled.
|
;; the functions defined with this macro get byte compiled.
|
||||||
|
|
||||||
(defmacro def-completion-wrapper (function-name type &optional new-name)
|
(defmacro def-completion-wrapper (function-name type &optional new-name)
|
||||||
|
|
@ -2397,7 +2397,7 @@ TYPE is the type of the wrapper to be added. Can be :before or :under."
|
||||||
(define-key fortran-mode-map "/" 'completion-separator-self-insert-command))
|
(define-key fortran-mode-map "/" 'completion-separator-self-insert-command))
|
||||||
|
|
||||||
;;; Enable completion mode.
|
;;; Enable completion mode.
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun dynamic-completion-mode ()
|
(defun dynamic-completion-mode ()
|
||||||
"Enable dynamic word-completion."
|
"Enable dynamic word-completion."
|
||||||
|
|
@ -2522,8 +2522,8 @@ TYPE is the type of the wrapper to be added. Can be :before or :under."
|
||||||
|
|
||||||
;; Tests --
|
;; Tests --
|
||||||
;; foobarbiz
|
;; foobarbiz
|
||||||
;; foobar
|
;; foobar
|
||||||
;; fooquux
|
;; fooquux
|
||||||
;; fooper
|
;; fooper
|
||||||
|
|
||||||
(cmpl-statistics-block
|
(cmpl-statistics-block
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ follows (the point `*' corresponds to both reference points):
|
||||||
(or (integerp nref)
|
(or (integerp nref)
|
||||||
(setq nref (cdr (assq nref reference-point-alist))))
|
(setq nref (cdr (assq nref reference-point-alist))))
|
||||||
(or (and (>= gref 0) (< gref 12) (>= nref 0) (< nref 12))
|
(or (and (>= gref 0) (< gref 12) (>= nref 0) (< nref 12))
|
||||||
(error "Invalid composition rule: %S" rule))
|
(error "Invalid composition rule: %S" rule))
|
||||||
(+ (* gref 12) nref))))
|
(+ (* gref 12) nref))))
|
||||||
|
|
||||||
;; Decode encoded composition rule RULE-CODE. The value is a cons of
|
;; Decode encoded composition rule RULE-CODE. The value is a cons of
|
||||||
|
|
@ -331,7 +331,7 @@ This function is the default value of `compose-chars-after-function'."
|
||||||
(when tail
|
(when tail
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(while (and tail (not func))
|
(while (and tail (not func))
|
||||||
(setq pattern (car (car tail))
|
(setq pattern (car (car tail))
|
||||||
func (cdr (car tail)))
|
func (cdr (car tail)))
|
||||||
(goto-char pos)
|
(goto-char pos)
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
|
||||||
(when members
|
(when members
|
||||||
;; So x and no-x builds won't differ.
|
;; So x and no-x builds won't differ.
|
||||||
(setq members
|
(setq members
|
||||||
(sort (copy-sequence members)
|
(sort (copy-sequence members)
|
||||||
(lambda (x y) (string< (car x) (car y)))))
|
(lambda (x y) (string< (car x) (car y)))))
|
||||||
(while members
|
(while members
|
||||||
(setq item (car (car members))
|
(setq item (car (car members))
|
||||||
|
|
@ -102,7 +102,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
|
||||||
(member where found))
|
(member where found))
|
||||||
(if found
|
(if found
|
||||||
(insert " ")
|
(insert " ")
|
||||||
(insert "(put '" (symbol-name symbol)
|
(insert "(put '" (symbol-name symbol)
|
||||||
" 'custom-loads '("))
|
" 'custom-loads '("))
|
||||||
(prin1 where (current-buffer))
|
(prin1 where (current-buffer))
|
||||||
(push where found)))
|
(push where found)))
|
||||||
|
|
@ -110,7 +110,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
|
||||||
(insert "))\n"))))))
|
(insert "))\n"))))))
|
||||||
(insert "\
|
(insert "\
|
||||||
;;; These are for handling :version. We need to have a minimum of
|
;;; These are for handling :version. We need to have a minimum of
|
||||||
;;; information so `customize-changed-options' could do its job.
|
;;; information so `customize-changed-options' could do its job.
|
||||||
|
|
||||||
;;; For groups we set `custom-version', `group-documentation' and
|
;;; For groups we set `custom-version', `group-documentation' and
|
||||||
;;; `custom-tag' (which are shown in the customize buffer), so we
|
;;; `custom-tag' (which are shown in the customize buffer), so we
|
||||||
|
|
@ -136,7 +136,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
|
||||||
(mapatoms (lambda (symbol)
|
(mapatoms (lambda (symbol)
|
||||||
(let ((version (get symbol 'custom-version))
|
(let ((version (get symbol 'custom-version))
|
||||||
where)
|
where)
|
||||||
(when version
|
(when version
|
||||||
(setq where (get symbol 'custom-where))
|
(setq where (get symbol 'custom-where))
|
||||||
(when where
|
(when where
|
||||||
(if (or (custom-variable-p symbol)
|
(if (or (custom-variable-p symbol)
|
||||||
|
|
@ -144,13 +144,13 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
|
||||||
;; This means it's a variable or a face.
|
;; This means it's a variable or a face.
|
||||||
(progn
|
(progn
|
||||||
(if (assoc version version-alist)
|
(if (assoc version version-alist)
|
||||||
(unless
|
(unless
|
||||||
(member where
|
(member where
|
||||||
(cdr (assoc version version-alist)))
|
(cdr (assoc version version-alist)))
|
||||||
(push where (cdr (assoc version version-alist))))
|
(push where (cdr (assoc version version-alist))))
|
||||||
(push (cons version (list where)) version-alist)))
|
(push (cons version (list where)) version-alist)))
|
||||||
;; This is a group
|
;; This is a group
|
||||||
(insert "(custom-put-if-not '" (symbol-name symbol)
|
(insert "(custom-put-if-not '" (symbol-name symbol)
|
||||||
" 'custom-version ")
|
" 'custom-version ")
|
||||||
(prin1 version (current-buffer))
|
(prin1 version (current-buffer))
|
||||||
(insert ")\n")
|
(insert ")\n")
|
||||||
|
|
@ -169,7 +169,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
|
||||||
(if version-alist "'" ""))
|
(if version-alist "'" ""))
|
||||||
(prin1 version-alist (current-buffer))
|
(prin1 version-alist (current-buffer))
|
||||||
(insert "\n \"For internal use by custom.\")\n"))
|
(insert "\n \"For internal use by custom.\")\n"))
|
||||||
|
|
||||||
(insert "\
|
(insert "\
|
||||||
|
|
||||||
\(provide '" (file-name-sans-extension
|
\(provide '" (file-name-sans-extension
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
(const :tag "ultracondensed" ultra-condensed)
|
(const :tag "ultracondensed" ultra-condensed)
|
||||||
(const :tag "ultraexpanded" ultra-expanded)
|
(const :tag "ultraexpanded" ultra-expanded)
|
||||||
(const :tag "wide" extra-expanded)))
|
(const :tag "wide" extra-expanded)))
|
||||||
|
|
||||||
(:height
|
(:height
|
||||||
(choice :tag "Height"
|
(choice :tag "Height"
|
||||||
:help-echo "Face's font height."
|
:help-echo "Face's font height."
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
(const :tag "semilight" semi-light)
|
(const :tag "semilight" semi-light)
|
||||||
(const :tag "ultralight" ultra-light)
|
(const :tag "ultralight" ultra-light)
|
||||||
(const :tag "ultrabold" ultra-bold)))
|
(const :tag "ultrabold" ultra-bold)))
|
||||||
|
|
||||||
(:slant
|
(:slant
|
||||||
(choice :tag "Slant"
|
(choice :tag "Slant"
|
||||||
:help-echo "Font slant."
|
:help-echo "Font slant."
|
||||||
|
|
@ -121,28 +121,28 @@
|
||||||
(const :tag "italic" italic)
|
(const :tag "italic" italic)
|
||||||
(const :tag "oblique" oblique)
|
(const :tag "oblique" oblique)
|
||||||
(const :tag "normal" normal)))
|
(const :tag "normal" normal)))
|
||||||
|
|
||||||
(:underline
|
(:underline
|
||||||
(choice :tag "Underline"
|
(choice :tag "Underline"
|
||||||
:help-echo "Control text underlining."
|
:help-echo "Control text underlining."
|
||||||
(const :tag "Off" nil)
|
(const :tag "Off" nil)
|
||||||
(const :tag "On" t)
|
(const :tag "On" t)
|
||||||
(color :tag "Colored")))
|
(color :tag "Colored")))
|
||||||
|
|
||||||
(:overline
|
(:overline
|
||||||
(choice :tag "Overline"
|
(choice :tag "Overline"
|
||||||
:help-echo "Control text overlining."
|
:help-echo "Control text overlining."
|
||||||
(const :tag "Off" nil)
|
(const :tag "Off" nil)
|
||||||
(const :tag "On" t)
|
(const :tag "On" t)
|
||||||
(color :tag "Colored")))
|
(color :tag "Colored")))
|
||||||
|
|
||||||
(:strike-through
|
(:strike-through
|
||||||
(choice :tag "Strike-through"
|
(choice :tag "Strike-through"
|
||||||
:help-echo "Control text strike-through."
|
:help-echo "Control text strike-through."
|
||||||
(const :tag "Off" nil)
|
(const :tag "Off" nil)
|
||||||
(const :tag "On" t)
|
(const :tag "On" t)
|
||||||
(color :tag "Colored")))
|
(color :tag "Colored")))
|
||||||
|
|
||||||
(:box
|
(:box
|
||||||
;; Fixme: this can probably be done better.
|
;; Fixme: this can probably be done better.
|
||||||
(choice :tag "Box around text"
|
(choice :tag "Box around text"
|
||||||
|
|
@ -190,21 +190,21 @@
|
||||||
(nconc (and lwidth `(:line-width ,lwidth))
|
(nconc (and lwidth `(:line-width ,lwidth))
|
||||||
(and color `(:color ,color))
|
(and color `(:color ,color))
|
||||||
(and style `(:style ,style)))))))))
|
(and style `(:style ,style)))))))))
|
||||||
|
|
||||||
(:inverse-video
|
(:inverse-video
|
||||||
(choice :tag "Inverse-video"
|
(choice :tag "Inverse-video"
|
||||||
:help-echo "Control whether text should be in inverse-video."
|
:help-echo "Control whether text should be in inverse-video."
|
||||||
(const :tag "Off" nil)
|
(const :tag "Off" nil)
|
||||||
(const :tag "On" t)))
|
(const :tag "On" t)))
|
||||||
|
|
||||||
(:foreground
|
(:foreground
|
||||||
(color :tag "Foreground"
|
(color :tag "Foreground"
|
||||||
:help-echo "Set foreground color."))
|
:help-echo "Set foreground color."))
|
||||||
|
|
||||||
(:background
|
(:background
|
||||||
(color :tag "Background"
|
(color :tag "Background"
|
||||||
:help-echo "Set background color."))
|
:help-echo "Set background color."))
|
||||||
|
|
||||||
(:stipple
|
(:stipple
|
||||||
(choice :tag "Stipple"
|
(choice :tag "Stipple"
|
||||||
:help-echo "Background bit-mask"
|
:help-echo "Background bit-mask"
|
||||||
|
|
@ -230,7 +230,7 @@
|
||||||
(if (and (consp cus-value) (null (cdr cus-value)))
|
(if (and (consp cus-value) (null (cdr cus-value)))
|
||||||
(car cus-value)
|
(car cus-value)
|
||||||
cus-value))))
|
cus-value))))
|
||||||
|
|
||||||
"Alist of face attributes.
|
"Alist of face attributes.
|
||||||
|
|
||||||
The elements are of the form (KEY TYPE PRE-FILTER POST-FILTER),
|
The elements are of the form (KEY TYPE PRE-FILTER POST-FILTER),
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(let ((all '(;; abbrev.c
|
(let ((all '(;; abbrev.c
|
||||||
(abbrev-all-caps abbrev-mode boolean)
|
(abbrev-all-caps abbrev-mode boolean)
|
||||||
(pre-abbrev-expand-hook abbrev-mode hook)
|
(pre-abbrev-expand-hook abbrev-mode hook)
|
||||||
;; alloc.c
|
;; alloc.c
|
||||||
|
|
@ -88,7 +88,7 @@
|
||||||
(function :value ignore))))
|
(function :value ignore))))
|
||||||
(selection-coding-system mule coding-system)
|
(selection-coding-system mule coding-system)
|
||||||
;; dired.c
|
;; dired.c
|
||||||
(completion-ignored-extensions dired
|
(completion-ignored-extensions dired
|
||||||
(repeat (string :format "%v")))
|
(repeat (string :format "%v")))
|
||||||
;; dispnew.c
|
;; dispnew.c
|
||||||
(baud-rate display integer)
|
(baud-rate display integer)
|
||||||
|
|
@ -106,7 +106,7 @@
|
||||||
:value (nil)
|
:value (nil)
|
||||||
(symbol :format "%v"))
|
(symbol :format "%v"))
|
||||||
(const :tag "always" t)))
|
(const :tag "always" t)))
|
||||||
(debug-on-error debug
|
(debug-on-error debug
|
||||||
(choice (const :tag "off")
|
(choice (const :tag "off")
|
||||||
(repeat :menu-tag "When"
|
(repeat :menu-tag "When"
|
||||||
:value (nil)
|
:value (nil)
|
||||||
|
|
@ -155,7 +155,7 @@
|
||||||
;; version-specific directories when you upgrade. We need
|
;; version-specific directories when you upgrade. We need
|
||||||
;; customization of the front of the list, maintaining the standard
|
;; customization of the front of the list, maintaining the standard
|
||||||
;; value intact at the back.
|
;; value intact at the back.
|
||||||
;;; (load-path environment
|
;;; (load-path environment
|
||||||
;;; (repeat (choice :tag "[Current dir?]"
|
;;; (repeat (choice :tag "[Current dir?]"
|
||||||
;;; :format "%[Current dir?%] %v"
|
;;; :format "%[Current dir?%] %v"
|
||||||
;;; (const :tag " current dir" nil)
|
;;; (const :tag " current dir" nil)
|
||||||
|
|
@ -205,8 +205,8 @@
|
||||||
(display-buffer-function windows (choice (const nil) function))
|
(display-buffer-function windows (choice (const nil) function))
|
||||||
(pop-up-frames frames boolean)
|
(pop-up-frames frames boolean)
|
||||||
(pop-up-frame-function frames function)
|
(pop-up-frame-function frames function)
|
||||||
(special-display-buffer-names
|
(special-display-buffer-names
|
||||||
frames
|
frames
|
||||||
(repeat (choice :tag "Buffer"
|
(repeat (choice :tag "Buffer"
|
||||||
:value ""
|
:value ""
|
||||||
(string :format "%v")
|
(string :format "%v")
|
||||||
|
|
@ -219,7 +219,7 @@
|
||||||
(symbol :tag "Parameter")
|
(symbol :tag "Parameter")
|
||||||
(sexp :tag "Value")))))))
|
(sexp :tag "Value")))))))
|
||||||
(special-display-regexps
|
(special-display-regexps
|
||||||
frames
|
frames
|
||||||
(repeat (choice :tag "Buffer"
|
(repeat (choice :tag "Buffer"
|
||||||
:value ""
|
:value ""
|
||||||
(regexp :format "%v")
|
(regexp :format "%v")
|
||||||
|
|
@ -283,7 +283,7 @@
|
||||||
(numberp sexp))
|
(numberp sexp))
|
||||||
sexp
|
sexp
|
||||||
(list 'quote sexp)))))
|
(list 'quote sexp)))))
|
||||||
(while all
|
(while all
|
||||||
(setq this (car all)
|
(setq this (car all)
|
||||||
all (cdr all)
|
all (cdr all)
|
||||||
symbol (nth 0 this)
|
symbol (nth 0 this)
|
||||||
|
|
@ -307,7 +307,7 @@
|
||||||
(message "Note, built-in variable `%S' not bound" symbol))
|
(message "Note, built-in variable `%S' not bound" symbol))
|
||||||
;; Save the standard value, unless we already did.
|
;; Save the standard value, unless we already did.
|
||||||
(or (get symbol 'standard-value)
|
(or (get symbol 'standard-value)
|
||||||
(put symbol 'standard-value
|
(put symbol 'standard-value
|
||||||
(list (funcall quoter (default-value symbol)))))
|
(list (funcall quoter (default-value symbol)))))
|
||||||
;; If this is NOT while dumping Emacs,
|
;; If this is NOT while dumping Emacs,
|
||||||
;; set up the rest of the customization info.
|
;; set up the rest of the customization info.
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ This will help you share your customizations with other people.\n\n")
|
||||||
user-login-name))
|
user-login-name))
|
||||||
(widget-insert "\n\nDocumentation:\n")
|
(widget-insert "\n\nDocumentation:\n")
|
||||||
(setq custom-theme-description
|
(setq custom-theme-description
|
||||||
(widget-create 'text
|
(widget-create 'text
|
||||||
:value (format-time-string "Created %Y-%m-%d.")))
|
:value (format-time-string "Created %Y-%m-%d.")))
|
||||||
(widget-insert "\nVariables:\n\n")
|
(widget-insert "\nVariables:\n\n")
|
||||||
(setq custom-theme-variables
|
(setq custom-theme-variables
|
||||||
|
|
|
||||||
|
|
@ -191,27 +191,27 @@ The following keywords are meaningful:
|
||||||
Include an external link after the documentation string for this
|
Include an external link after the documentation string for this
|
||||||
item. This is a sentence containing an active field which
|
item. This is a sentence containing an active field which
|
||||||
references some other documentation.
|
references some other documentation.
|
||||||
|
|
||||||
There are three alternatives you can use for LINK-DATA:
|
There are three alternatives you can use for LINK-DATA:
|
||||||
|
|
||||||
(custom-manual INFO-NODE)
|
(custom-manual INFO-NODE)
|
||||||
Link to an Info node; INFO-NODE is a string which specifies
|
Link to an Info node; INFO-NODE is a string which specifies
|
||||||
the node name, as in \"(emacs)Top\". The link appears as
|
the node name, as in \"(emacs)Top\". The link appears as
|
||||||
`[manual]' in the customization buffer.
|
`[manual]' in the customization buffer.
|
||||||
|
|
||||||
(info-link INFO-NODE)
|
(info-link INFO-NODE)
|
||||||
Like `custom-manual' except that the link appears in the
|
Like `custom-manual' except that the link appears in the
|
||||||
customization buffer with the Info node name.
|
customization buffer with the Info node name.
|
||||||
|
|
||||||
(url-link URL)
|
(url-link URL)
|
||||||
Link to a web page; URL is a string which specifies the URL.
|
Link to a web page; URL is a string which specifies the URL.
|
||||||
The link appears in the customization buffer as URL.
|
The link appears in the customization buffer as URL.
|
||||||
|
|
||||||
You can specify the text to use in the customization buffer by
|
You can specify the text to use in the customization buffer by
|
||||||
adding `:tag NAME' after the first element of the LINK-DATA; for
|
adding `:tag NAME' after the first element of the LINK-DATA; for
|
||||||
example, (info-link :tag \"foo\" \"(emacs)Top\") makes a link to the
|
example, (info-link :tag \"foo\" \"(emacs)Top\") makes a link to the
|
||||||
Emacs manual which appears in the buffer as `foo'.
|
Emacs manual which appears in the buffer as `foo'.
|
||||||
|
|
||||||
An item can have more than one external link; however, most items
|
An item can have more than one external link; however, most items
|
||||||
have none at all.
|
have none at all.
|
||||||
:initialize
|
:initialize
|
||||||
|
|
@ -772,7 +772,7 @@ in SYMBOL's list property `theme-value' \(using `custom-push-theme')."
|
||||||
((default-boundp symbol)
|
((default-boundp symbol)
|
||||||
;; Something already set this, overwrite it.
|
;; Something already set this, overwrite it.
|
||||||
(funcall set symbol (eval value))))
|
(funcall set symbol (eval value))))
|
||||||
(error
|
(error
|
||||||
(message "Error setting %s: %s" symbol data)))
|
(message "Error setting %s: %s" symbol data)))
|
||||||
(setq args (cdr args))
|
(setq args (cdr args))
|
||||||
(and (or now (default-boundp symbol))
|
(and (or now (default-boundp symbol))
|
||||||
|
|
@ -815,7 +815,7 @@ this sets the local binding in that buffer instead."
|
||||||
(defun customize-mark-to-save (symbol)
|
(defun customize-mark-to-save (symbol)
|
||||||
"Mark SYMBOL for later saving.
|
"Mark SYMBOL for later saving.
|
||||||
|
|
||||||
If the default value of SYMBOL is different from the standard value,
|
If the default value of SYMBOL is different from the standard value,
|
||||||
set the `saved-value' property to a list whose car evaluates to the
|
set the `saved-value' property to a list whose car evaluates to the
|
||||||
default value. Otherwise, set it to nil.
|
default value. Otherwise, set it to nil.
|
||||||
|
|
||||||
|
|
@ -844,9 +844,9 @@ Return non-nil iff the `saved-value' property actually changed."
|
||||||
(defun customize-mark-as-set (symbol)
|
(defun customize-mark-as-set (symbol)
|
||||||
"Mark current value of SYMBOL as being set from customize.
|
"Mark current value of SYMBOL as being set from customize.
|
||||||
|
|
||||||
If the default value of SYMBOL is different from the saved value if any,
|
If the default value of SYMBOL is different from the saved value if any,
|
||||||
or else if it is different from the standard value, set the
|
or else if it is different from the standard value, set the
|
||||||
`customized-value' property to a list whose car evaluates to the
|
`customized-value' property to a list whose car evaluates to the
|
||||||
default value. Otherwise, set it to nil.
|
default value. Otherwise, set it to nil.
|
||||||
|
|
||||||
Return non-nil iff the `customized-value' property actually changed."
|
Return non-nil iff the `customized-value' property actually changed."
|
||||||
|
|
@ -856,7 +856,7 @@ Return non-nil iff the `customized-value' property actually changed."
|
||||||
(old (or (get symbol 'saved-value) (get symbol 'standard-value))))
|
(old (or (get symbol 'saved-value) (get symbol 'standard-value))))
|
||||||
;; Mark default value as set iff different from old value.
|
;; Mark default value as set iff different from old value.
|
||||||
(if (or (null old)
|
(if (or (null old)
|
||||||
(not (equal value (condition-case nil
|
(not (equal value (condition-case nil
|
||||||
(eval (car old))
|
(eval (car old))
|
||||||
(error nil)))))
|
(error nil)))))
|
||||||
(put symbol 'customized-value (list (custom-quote value)))
|
(put symbol 'customized-value (list (custom-quote value)))
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
(1 font-lock-function-name-face)))))
|
(1 font-lock-function-name-face)))))
|
||||||
(defconst cvs-status-font-lock-defaults
|
(defconst cvs-status-font-lock-defaults
|
||||||
'(cvs-status-font-lock-keywords t nil nil nil (font-lock-multiline . t)))
|
'(cvs-status-font-lock-keywords t nil nil nil (font-lock-multiline . t)))
|
||||||
|
|
||||||
|
|
||||||
(put 'cvs-status-mode 'mode-class 'special)
|
(put 'cvs-status-mode 'mode-class 'special)
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
@ -218,7 +218,7 @@ or a string (in which case it should simply return its argument).
|
||||||
A tag cannot be a CONS. The return value can also be a list of strings,
|
A tag cannot be a CONS. The return value can also be a list of strings,
|
||||||
if several nodes where merged into one.
|
if several nodes where merged into one.
|
||||||
The tree will be printed no closer than column COLUMN."
|
The tree will be printed no closer than column COLUMN."
|
||||||
|
|
||||||
(let* ((eol (save-excursion (end-of-line) (current-column)))
|
(let* ((eol (save-excursion (end-of-line) (current-column)))
|
||||||
(column (max (+ eol 2) column)))
|
(column (max (+ eol 2) column)))
|
||||||
(if (null tags) column
|
(if (null tags) column
|
||||||
|
|
@ -487,9 +487,9 @@ Optional prefix ARG chooses between two representations."
|
||||||
(setq pe eq)))
|
(setq pe eq)))
|
||||||
(nreverse nas))))
|
(nreverse nas))))
|
||||||
|
|
||||||
;;;;
|
;;;;
|
||||||
;;;; Merged trees from different files
|
;;;; Merged trees from different files
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
(defun cvs-tree-fuzzy-merge-1 (trees tree prev)
|
(defun cvs-tree-fuzzy-merge-1 (trees tree prev)
|
||||||
)
|
)
|
||||||
|
|
@ -509,7 +509,7 @@ Optional prefix ARG chooses between two representations."
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(let ((cvs-tag-print-rev nil))
|
(let ((cvs-tag-print-rev nil))
|
||||||
(cvs-tree-print tree 'cvs-tag->string 3)))))
|
(cvs-tree-print tree 'cvs-tag->string 3)))))
|
||||||
|
|
||||||
|
|
||||||
(provide 'cvs-status)
|
(provide 'cvs-status)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -751,7 +751,7 @@ DIRECTION = 0 means try both backward and forward.
|
||||||
IGNORE-CASE non-nil means ignore case when searching.
|
IGNORE-CASE non-nil means ignore case when searching.
|
||||||
This sets `dabbrev--last-direction' to 1 or -1 according
|
This sets `dabbrev--last-direction' to 1 or -1 according
|
||||||
to the direction in which the occurrence was actually found.
|
to the direction in which the occurrence was actually found.
|
||||||
It sets `dabbrev--last-expansion-location' to the location
|
It sets `dabbrev--last-expansion-location' to the location
|
||||||
of the start of the occurrence."
|
of the start of the occurrence."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
;; If we were scanning something other than the current buffer,
|
;; If we were scanning something other than the current buffer,
|
||||||
|
|
@ -921,7 +921,7 @@ to record whether we upcased the expansion, downcased it, or did neither."
|
||||||
;; record if we upcased or downcased the first word,
|
;; record if we upcased or downcased the first word,
|
||||||
;; in order to do likewise for subsequent words.
|
;; in order to do likewise for subsequent words.
|
||||||
(and record-case-pattern
|
(and record-case-pattern
|
||||||
(setq dabbrev--last-case-pattern
|
(setq dabbrev--last-case-pattern
|
||||||
(and use-case-replace
|
(and use-case-replace
|
||||||
(cond ((equal abbrev (upcase abbrev)) 'upcase)
|
(cond ((equal abbrev (upcase abbrev)) 'upcase)
|
||||||
((equal abbrev (downcase abbrev)) 'downcase)))))
|
((equal abbrev (downcase abbrev)) 'downcase)))))
|
||||||
|
|
|
||||||
|
|
@ -35,12 +35,12 @@
|
||||||
(delete-window)
|
(delete-window)
|
||||||
(bury-buffer)))
|
(bury-buffer)))
|
||||||
|
|
||||||
(defvar describe-text-mode-map
|
(defvar describe-text-mode-map
|
||||||
(let ((map (make-sparse-keymap)))
|
(let ((map (make-sparse-keymap)))
|
||||||
(set-keymap-parent map widget-keymap)
|
(set-keymap-parent map widget-keymap)
|
||||||
map)
|
map)
|
||||||
"Keymap for `describe-text-mode'.")
|
"Keymap for `describe-text-mode'.")
|
||||||
|
|
||||||
(defcustom describe-text-mode-hook nil
|
(defcustom describe-text-mode-hook nil
|
||||||
"List of hook functions ran by `describe-text-mode'."
|
"List of hook functions ran by `describe-text-mode'."
|
||||||
:type 'hook
|
:type 'hook
|
||||||
|
|
@ -67,7 +67,7 @@ if that value is non-nil."
|
||||||
(widget-create 'link
|
(widget-create 'link
|
||||||
:notify `(lambda (&rest ignore)
|
:notify `(lambda (&rest ignore)
|
||||||
(widget-browse ',widget))
|
(widget-browse ',widget))
|
||||||
(format "%S" (if (symbolp widget)
|
(format "%S" (if (symbolp widget)
|
||||||
widget
|
widget
|
||||||
(car widget))))
|
(car widget))))
|
||||||
(widget-insert " ")
|
(widget-insert " ")
|
||||||
|
|
@ -197,7 +197,7 @@ otherwise."
|
||||||
;; Buttons
|
;; Buttons
|
||||||
(when (and button (not (widgetp wid-button)))
|
(when (and button (not (widgetp wid-button)))
|
||||||
(newline)
|
(newline)
|
||||||
(widget-insert "Here is a " (format "%S" button-type)
|
(widget-insert "Here is a " (format "%S" button-type)
|
||||||
" button labeled `" button-label "'.\n\n"))
|
" button labeled `" button-label "'.\n\n"))
|
||||||
;; Overlays
|
;; Overlays
|
||||||
(when overlays
|
(when overlays
|
||||||
|
|
@ -207,7 +207,7 @@ otherwise."
|
||||||
(widget-insert "There are " (format "%d" (length overlays))
|
(widget-insert "There are " (format "%d" (length overlays))
|
||||||
" overlays here:\n"))
|
" overlays here:\n"))
|
||||||
(dolist (overlay overlays)
|
(dolist (overlay overlays)
|
||||||
(widget-insert " From " (format "%d" (overlay-start overlay))
|
(widget-insert " From " (format "%d" (overlay-start overlay))
|
||||||
" to " (format "%d" (overlay-end overlay)) "\n")
|
" to " (format "%d" (overlay-end overlay)) "\n")
|
||||||
(describe-property-list (overlay-properties overlay)))
|
(describe-property-list (overlay-properties overlay)))
|
||||||
(widget-insert "\n"))
|
(widget-insert "\n"))
|
||||||
|
|
@ -336,7 +336,7 @@ as well as widgets, buttons, overlays, and text properties."
|
||||||
(t (concat (substring composed 0 (- pos (car composition)))
|
(t (concat (substring composed 0 (- pos (car composition)))
|
||||||
"' and `"
|
"' and `"
|
||||||
(substring composed (- (1+ pos) (car composition))))))
|
(substring composed (- (1+ pos) (car composition))))))
|
||||||
|
|
||||||
"' to form `" composed "'")
|
"' to form `" composed "'")
|
||||||
(if (nth 3 composition)
|
(if (nth 3 composition)
|
||||||
(insert ".\n")
|
(insert ".\n")
|
||||||
|
|
|
||||||
|
|
@ -417,7 +417,7 @@ If the prefix ARG is given, restrict the view to the current file instead."
|
||||||
(number-to-string newstart2) ",1 @@\n")
|
(number-to-string newstart2) ",1 @@\n")
|
||||||
;; Fix the original hunk-header.
|
;; Fix the original hunk-header.
|
||||||
(diff-fixup-modifs start pos))))
|
(diff-fixup-modifs start pos))))
|
||||||
|
|
||||||
|
|
||||||
;;;;
|
;;;;
|
||||||
;;;; jump to other buffers
|
;;;; jump to other buffers
|
||||||
|
|
@ -519,9 +519,9 @@ Non-nil OLD means that we want the old file."
|
||||||
(ediff-patch-file nil (current-buffer))
|
(ediff-patch-file nil (current-buffer))
|
||||||
(wrong-number-of-arguments (ediff-patch-file))))
|
(wrong-number-of-arguments (ediff-patch-file))))
|
||||||
|
|
||||||
;;;;
|
;;;;
|
||||||
;;;; Conversion functions
|
;;;; Conversion functions
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
;;(defvar diff-inhibit-after-change nil
|
;;(defvar diff-inhibit-after-change nil
|
||||||
;; "Non-nil means inhibit `diff-mode's after-change functions.")
|
;; "Non-nil means inhibit `diff-mode's after-change functions.")
|
||||||
|
|
@ -791,9 +791,9 @@ else cover the whole bufer."
|
||||||
(unless (string= new old) (replace-match new t t nil 2))))))
|
(unless (string= new old) (replace-match new t t nil 2))))))
|
||||||
(setq space 0 plus 0 minus 0 bang 0)))))))
|
(setq space 0 plus 0 minus 0 bang 0)))))))
|
||||||
|
|
||||||
;;;;
|
;;;;
|
||||||
;;;; Hooks
|
;;;; Hooks
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
(defun diff-write-contents-hooks ()
|
(defun diff-write-contents-hooks ()
|
||||||
"Fixup hunk headers if necessary."
|
"Fixup hunk headers if necessary."
|
||||||
|
|
@ -847,9 +847,9 @@ See `after-change-functions' for the meaning of BEG, END and LEN."
|
||||||
(diff-fixup-modifs (point) (cdr diff-unhandled-changes)))))
|
(diff-fixup-modifs (point) (cdr diff-unhandled-changes)))))
|
||||||
(setq diff-unhandled-changes nil)))
|
(setq diff-unhandled-changes nil)))
|
||||||
|
|
||||||
;;;;
|
;;;;
|
||||||
;;;; The main function
|
;;;; The main function
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(define-derived-mode diff-mode fundamental-mode "Diff"
|
(define-derived-mode diff-mode fundamental-mode "Diff"
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,9 @@
|
||||||
;; been removed or renamed in order to work properly with dired of GNU
|
;; been removed or renamed in order to work properly with dired of GNU
|
||||||
;; Emacs. All suggestions or comments are most welcomed.
|
;; Emacs. All suggestions or comments are most welcomed.
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Please, PLEASE, *PLEASE* see the info pages.
|
;; Please, PLEASE, *PLEASE* see the info pages.
|
||||||
;;
|
;;
|
||||||
|
|
||||||
;; BUGS: Type M-x dired-x-submit-report and a report will be generated.
|
;; BUGS: Type M-x dired-x-submit-report and a report will be generated.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ X frame."
|
||||||
(defun standard-display-underline (c uc)
|
(defun standard-display-underline (c uc)
|
||||||
"Display character C as character UC plus underlining."
|
"Display character C as character UC plus underlining."
|
||||||
(aset standard-display-table c
|
(aset standard-display-table c
|
||||||
(vector
|
(vector
|
||||||
(if window-system
|
(if window-system
|
||||||
(logior uc (lsh (face-id 'underline) 19))
|
(logior uc (lsh (face-id 'underline) 19))
|
||||||
(create-glyph (concat "\e[4m" (char-to-string uc) "\e[m"))))))
|
(create-glyph (concat "\e[4m" (char-to-string uc) "\e[m"))))))
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ with a definition that really does change some file names."
|
||||||
(let ((flen (length filename)))
|
(let ((flen (length filename)))
|
||||||
;; If FILENAME has a trailing slash, remove it and recurse.
|
;; If FILENAME has a trailing slash, remove it and recurse.
|
||||||
(if (memq (aref filename (1- flen)) '(?/ ?\\))
|
(if (memq (aref filename (1- flen)) '(?/ ?\\))
|
||||||
(concat (convert-standard-filename
|
(concat (convert-standard-filename
|
||||||
(substring filename 0 (1- flen)))
|
(substring filename 0 (1- flen)))
|
||||||
"/")
|
"/")
|
||||||
(let* (;; ange-ftp gets in the way for names like "/foo:bar".
|
(let* (;; ange-ftp gets in the way for names like "/foo:bar".
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
;; This mode is intended for use with languages that adds a small
|
;; This mode is intended for use with languages that adds a small
|
||||||
;; number of extra letters not available on the keyboard.
|
;; number of extra letters not available on the keyboard.
|
||||||
;;
|
;;
|
||||||
;; Examples includes Scandinavian and German with an US keyboard.
|
;; Examples includes Scandinavian and German with an US keyboard.
|
||||||
;;
|
;;
|
||||||
;; The idea is that certain keys are overloaded. When you press it
|
;; The idea is that certain keys are overloaded. When you press it
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
;; string will be replaced by another. This can be used for mapping
|
;; string will be replaced by another. This can be used for mapping
|
||||||
;; keys on a US keyboard to generate characters according to the local
|
;; keys on a US keyboard to generate characters according to the local
|
||||||
;; keyboard convention when pressed once, and according to US keyboard
|
;; keyboard convention when pressed once, and according to US keyboard
|
||||||
;; convention when pressed twice.
|
;; convention when pressed twice.
|
||||||
;;
|
;;
|
||||||
;; To use this mode, you must define the variable `double-map' and
|
;; To use this mode, you must define the variable `double-map' and
|
||||||
;; then enable double mode with `M-x double-mode'. Read the
|
;; then enable double mode with `M-x double-mode'. Read the
|
||||||
|
|
@ -99,7 +99,7 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
|
||||||
(or (boundp 'isearch-mode-map)
|
(or (boundp 'isearch-mode-map)
|
||||||
(load-library "isearch"))
|
(load-library "isearch"))
|
||||||
|
|
||||||
(define-key isearch-mode-map [ignore]
|
(define-key isearch-mode-map [ignore]
|
||||||
(function (lambda () (interactive) (isearch-update))))
|
(function (lambda () (interactive) (isearch-update))))
|
||||||
|
|
||||||
(defun double-translate-key (prompt)
|
(defun double-translate-key (prompt)
|
||||||
|
|
@ -117,7 +117,7 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
|
||||||
(let ((new (double-read-event prompt))
|
(let ((new (double-read-event prompt))
|
||||||
(entry (assoc double-last-event double-map)))
|
(entry (assoc double-last-event double-map)))
|
||||||
(if (eq new double-last-event)
|
(if (eq new double-last-event)
|
||||||
(progn
|
(progn
|
||||||
(setq unread-command-events
|
(setq unread-command-events
|
||||||
(append (make-list (1- (length (nth 1 entry)))
|
(append (make-list (1- (length (nth 1 entry)))
|
||||||
127)
|
127)
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ much like those of buffer-menu-mode.
|
||||||
|
|
||||||
Calls value of `electric-buffer-menu-mode-hook' on entry if non-nil.
|
Calls value of `electric-buffer-menu-mode-hook' on entry if non-nil.
|
||||||
|
|
||||||
\\{electric-buffer-menu-mode-map}"
|
\\{electric-buffer-menu-mode-map}"
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(let (select buffer)
|
(let (select buffer)
|
||||||
(save-window-excursion
|
(save-window-excursion
|
||||||
|
|
@ -209,7 +209,7 @@ electric-buffer-menu-mode-hook if it is non-nil."
|
||||||
(define-key map [escape escape escape] 'Electric-buffer-menu-quit)
|
(define-key map [escape escape escape] 'Electric-buffer-menu-quit)
|
||||||
(define-key map [mouse-2] 'Electric-buffer-menu-mouse-select)
|
(define-key map [mouse-2] 'Electric-buffer-menu-mouse-select)
|
||||||
(setq electric-buffer-menu-mode-map map)))
|
(setq electric-buffer-menu-mode-map map)))
|
||||||
|
|
||||||
(defun Electric-buffer-menu-exit ()
|
(defun Electric-buffer-menu-exit ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq unread-command-events (listify-key-sequence (this-command-keys)))
|
(setq unread-command-events (listify-key-sequence (this-command-keys)))
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ With prefix arg NOCONFIRM, execute current line as-is without editing."
|
||||||
(define-key electric-history-map "\e<" 'beginning-of-buffer)
|
(define-key electric-history-map "\e<" 'beginning-of-buffer)
|
||||||
(define-key electric-history-map "\n" 'next-line)
|
(define-key electric-history-map "\n" 'next-line)
|
||||||
(define-key electric-history-map "\r" 'next-line)
|
(define-key electric-history-map "\r" 'next-line)
|
||||||
(define-key electric-history-map "\177" 'previous-line)
|
(define-key electric-history-map "\177" 'previous-line)
|
||||||
(define-key electric-history-map "\C-n" 'next-line)
|
(define-key electric-history-map "\C-n" 'next-line)
|
||||||
(define-key electric-history-map "\C-p" 'previous-line)
|
(define-key electric-history-map "\C-p" 'previous-line)
|
||||||
(define-key electric-history-map "\ev" 'scroll-down)
|
(define-key electric-history-map "\ev" 'scroll-down)
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ are `-I REGEXP', to ignore changes whose lines match the REGEXP."
|
||||||
:group 'ediff-diff)
|
:group 'ediff-diff)
|
||||||
|
|
||||||
(defcustom ediff-diff-options ""
|
(defcustom ediff-diff-options ""
|
||||||
"*Options to pass to `ediff-diff-program'.
|
"*Options to pass to `ediff-diff-program'.
|
||||||
If Unix diff is used as `ediff-diff-program', then the most useful options are
|
If Unix diff is used as `ediff-diff-program', then the most useful options are
|
||||||
`-w', to ignore space, and `-i', to ignore case of letters.
|
`-w', to ignore space, and `-i', to ignore case of letters.
|
||||||
At present, the option `-c' is not allowed."
|
At present, the option `-c' is not allowed."
|
||||||
|
|
@ -164,7 +164,7 @@ Lines that do not match are assumed to be error messages."
|
||||||
;; the status can be =diff(A), =diff(B), or =diff(A+B)
|
;; the status can be =diff(A), =diff(B), or =diff(A+B)
|
||||||
(ediff-defvar-local ediff-diff-status "" "")
|
(ediff-defvar-local ediff-diff-status "" "")
|
||||||
|
|
||||||
|
|
||||||
;;; Fine differences
|
;;; Fine differences
|
||||||
|
|
||||||
(ediff-defvar-local ediff-auto-refine (if (ediff-has-face-support-p) 'on 'nix)
|
(ediff-defvar-local ediff-auto-refine (if (ediff-has-face-support-p) 'on 'nix)
|
||||||
|
|
@ -182,7 +182,7 @@ Use `setq-default' if setting it in .emacs")
|
||||||
|
|
||||||
(ediff-defvar-local ediff-auto-refine-limit 1400
|
(ediff-defvar-local ediff-auto-refine-limit 1400
|
||||||
"*Auto-refine only the regions of this size \(in bytes\) or less.")
|
"*Auto-refine only the regions of this size \(in bytes\) or less.")
|
||||||
|
|
||||||
;;; General
|
;;; General
|
||||||
|
|
||||||
(defvar ediff-diff-ok-lines-regexp
|
(defvar ediff-diff-ok-lines-regexp
|
||||||
|
|
@ -215,7 +215,7 @@ The function should take three mandatory arguments, file-A, file-B, and
|
||||||
file-C. It may ignore file C for diff2 jobs. It should also take
|
file-C. It may ignore file C for diff2 jobs. It should also take
|
||||||
one optional arguments, diff-number to refine.")
|
one optional arguments, diff-number to refine.")
|
||||||
|
|
||||||
|
|
||||||
;;; Functions
|
;;; Functions
|
||||||
|
|
||||||
;; Generate the difference vector and overlays for the two files
|
;; Generate the difference vector and overlays for the two files
|
||||||
|
|
@ -228,7 +228,7 @@ one optional arguments, diff-number to refine.")
|
||||||
;; looking either for '-c' or a 'c' in a set of clustered non-long options
|
;; looking either for '-c' or a 'c' in a set of clustered non-long options
|
||||||
(if (string-match "^-c\\| -c\\|-[^- ]+c" ediff-diff-options)
|
(if (string-match "^-c\\| -c\\|-[^- ]+c" ediff-diff-options)
|
||||||
(error "Option `-c' is not allowed in `ediff-diff-options'"))
|
(error "Option `-c' is not allowed in `ediff-diff-options'"))
|
||||||
|
|
||||||
;; create, if it doesn't exist
|
;; create, if it doesn't exist
|
||||||
(or (ediff-buffer-live-p ediff-diff-buffer)
|
(or (ediff-buffer-live-p ediff-diff-buffer)
|
||||||
(setq ediff-diff-buffer
|
(setq ediff-diff-buffer
|
||||||
|
|
@ -268,9 +268,9 @@ one optional arguments, diff-number to refine.")
|
||||||
(message "")
|
(message "")
|
||||||
(ediff-with-current-buffer diff-buffer
|
(ediff-with-current-buffer diff-buffer
|
||||||
(buffer-size))))))
|
(buffer-size))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; If file-A/B/C is nil, do 2-way comparison with the non-nil buffers
|
;; If file-A/B/C is nil, do 2-way comparison with the non-nil buffers
|
||||||
;; This function works for diff3 and diff2 jobs
|
;; This function works for diff3 and diff2 jobs
|
||||||
(defun ediff-setup-fine-diff-regions (file-A file-B file-C reg-num)
|
(defun ediff-setup-fine-diff-regions (file-A file-B file-C reg-num)
|
||||||
|
|
@ -278,7 +278,7 @@ one optional arguments, diff-number to refine.")
|
||||||
(setq ediff-fine-diff-buffer
|
(setq ediff-fine-diff-buffer
|
||||||
(get-buffer-create
|
(get-buffer-create
|
||||||
(ediff-unique-buffer-name "*ediff-fine-diff" "*"))))
|
(ediff-unique-buffer-name "*ediff-fine-diff" "*"))))
|
||||||
|
|
||||||
(let (diff3-job diff-program diff-options ok-regexp diff-list)
|
(let (diff3-job diff-program diff-options ok-regexp diff-list)
|
||||||
(setq diff3-job ediff-3way-job
|
(setq diff3-job ediff-3way-job
|
||||||
diff-program (if diff3-job ediff-diff3-program ediff-diff-program)
|
diff-program (if diff3-job ediff-diff3-program ediff-diff-program)
|
||||||
|
|
@ -286,7 +286,7 @@ one optional arguments, diff-number to refine.")
|
||||||
ok-regexp (if diff3-job
|
ok-regexp (if diff3-job
|
||||||
ediff-diff3-ok-lines-regexp
|
ediff-diff3-ok-lines-regexp
|
||||||
ediff-diff-ok-lines-regexp))
|
ediff-diff-ok-lines-regexp))
|
||||||
|
|
||||||
(ediff-message-if-verbose "Refining difference region %d ..." (1+ reg-num))
|
(ediff-message-if-verbose "Refining difference region %d ..." (1+ reg-num))
|
||||||
(ediff-exec-process diff-program ediff-fine-diff-buffer 'synchronize
|
(ediff-exec-process diff-program ediff-fine-diff-buffer 'synchronize
|
||||||
diff-options
|
diff-options
|
||||||
|
|
@ -298,12 +298,12 @@ one optional arguments, diff-number to refine.")
|
||||||
(if diff3-job
|
(if diff3-job
|
||||||
(if file-C file-C file-B))
|
(if file-C file-C file-B))
|
||||||
) ; exec process
|
) ; exec process
|
||||||
|
|
||||||
(ediff-prepare-error-list ok-regexp ediff-fine-diff-buffer)
|
(ediff-prepare-error-list ok-regexp ediff-fine-diff-buffer)
|
||||||
(ediff-message-if-verbose
|
(ediff-message-if-verbose
|
||||||
"")
|
"")
|
||||||
;; "Refining difference region %d ... done" (1+ reg-num))
|
;; "Refining difference region %d ... done" (1+ reg-num))
|
||||||
|
|
||||||
(setq diff-list
|
(setq diff-list
|
||||||
(if diff3-job
|
(if diff3-job
|
||||||
(ediff-extract-diffs3
|
(ediff-extract-diffs3
|
||||||
|
|
@ -327,11 +327,11 @@ one optional arguments, diff-number to refine.")
|
||||||
(aset elt 5 nil))
|
(aset elt 5 nil))
|
||||||
(cdr diff-list)))
|
(cdr diff-list)))
|
||||||
))
|
))
|
||||||
|
|
||||||
(ediff-convert-fine-diffs-to-overlays diff-list reg-num)
|
(ediff-convert-fine-diffs-to-overlays diff-list reg-num)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
(defun ediff-prepare-error-list (ok-regexp diff-buff)
|
(defun ediff-prepare-error-list (ok-regexp diff-buff)
|
||||||
(or (ediff-buffer-live-p ediff-error-buffer)
|
(or (ediff-buffer-live-p ediff-error-buffer)
|
||||||
(setq ediff-error-buffer
|
(setq ediff-error-buffer
|
||||||
|
|
@ -368,7 +368,7 @@ one optional arguments, diff-number to refine.")
|
||||||
(c-prev 1)
|
(c-prev 1)
|
||||||
diff-list shift-A shift-B
|
diff-list shift-A shift-B
|
||||||
)
|
)
|
||||||
|
|
||||||
;; diff list contains word numbers, unless changed later
|
;; diff list contains word numbers, unless changed later
|
||||||
(setq diff-list (cons (if word-mode 'words 'points)
|
(setq diff-list (cons (if word-mode 'words 'points)
|
||||||
diff-list))
|
diff-list))
|
||||||
|
|
@ -380,7 +380,7 @@ one optional arguments, diff-number to refine.")
|
||||||
shift-B
|
shift-B
|
||||||
(ediff-overlay-start
|
(ediff-overlay-start
|
||||||
(ediff-get-value-according-to-buffer-type 'B bounds))))
|
(ediff-get-value-according-to-buffer-type 'B bounds))))
|
||||||
|
|
||||||
;; reset point in buffers A/B/C
|
;; reset point in buffers A/B/C
|
||||||
(ediff-with-current-buffer A-buffer
|
(ediff-with-current-buffer A-buffer
|
||||||
(goto-char (if shift-A shift-A (point-min))))
|
(goto-char (if shift-A shift-A (point-min))))
|
||||||
|
|
@ -389,7 +389,7 @@ one optional arguments, diff-number to refine.")
|
||||||
(if (ediff-buffer-live-p C-buffer)
|
(if (ediff-buffer-live-p C-buffer)
|
||||||
(ediff-with-current-buffer C-buffer
|
(ediff-with-current-buffer C-buffer
|
||||||
(goto-char (point-min))))
|
(goto-char (point-min))))
|
||||||
|
|
||||||
(ediff-with-current-buffer diff-buffer
|
(ediff-with-current-buffer diff-buffer
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(while (re-search-forward ediff-match-diff-line nil t)
|
(while (re-search-forward ediff-match-diff-line nil t)
|
||||||
|
|
@ -423,13 +423,13 @@ one optional arguments, diff-number to refine.")
|
||||||
;; (string-equal diff-type "c")
|
;; (string-equal diff-type "c")
|
||||||
(setq a-end (1+ a-end)
|
(setq a-end (1+ a-end)
|
||||||
b-end (1+ b-end))))
|
b-end (1+ b-end))))
|
||||||
|
|
||||||
(if (eq ediff-default-variant 'default-B)
|
(if (eq ediff-default-variant 'default-B)
|
||||||
(setq c-begin b-begin
|
(setq c-begin b-begin
|
||||||
c-end b-end)
|
c-end b-end)
|
||||||
(setq c-begin a-begin
|
(setq c-begin a-begin
|
||||||
c-end a-end))
|
c-end a-end))
|
||||||
|
|
||||||
;; compute main diff vector
|
;; compute main diff vector
|
||||||
(if word-mode
|
(if word-mode
|
||||||
;; make diff-list contain word numbers
|
;; make diff-list contain word numbers
|
||||||
|
|
@ -500,11 +500,11 @@ one optional arguments, diff-number to refine.")
|
||||||
nil ; dummy state of ancestor
|
nil ; dummy state of ancestor
|
||||||
)))
|
)))
|
||||||
)))
|
)))
|
||||||
|
|
||||||
))) ; end ediff-with-current-buffer
|
))) ; end ediff-with-current-buffer
|
||||||
diff-list
|
diff-list
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
(defun ediff-convert-diffs-to-overlays (diff-list)
|
(defun ediff-convert-diffs-to-overlays (diff-list)
|
||||||
(ediff-set-diff-overlays-in-one-buffer 'A diff-list)
|
(ediff-set-diff-overlays-in-one-buffer 'A diff-list)
|
||||||
|
|
@ -530,7 +530,7 @@ one optional arguments, diff-number to refine.")
|
||||||
)))
|
)))
|
||||||
(message "Processing difference regions ... done"))
|
(message "Processing difference regions ... done"))
|
||||||
|
|
||||||
|
|
||||||
(defun ediff-set-diff-overlays-in-one-buffer (buf-type diff-list)
|
(defun ediff-set-diff-overlays-in-one-buffer (buf-type diff-list)
|
||||||
(let* ((current-diff -1)
|
(let* ((current-diff -1)
|
||||||
(buff (ediff-get-buffer buf-type))
|
(buff (ediff-get-buffer buf-type))
|
||||||
|
|
@ -548,10 +548,10 @@ one optional arguments, diff-number to refine.")
|
||||||
|
|
||||||
(setq diff-list (cdr diff-list)) ; discard diff list type
|
(setq diff-list (cdr diff-list)) ; discard diff list type
|
||||||
(setq total-diffs (length diff-list))
|
(setq total-diffs (length diff-list))
|
||||||
|
|
||||||
;; shift, if necessary
|
;; shift, if necessary
|
||||||
(ediff-with-current-buffer buff (setq pt-saved shift))
|
(ediff-with-current-buffer buff (setq pt-saved shift))
|
||||||
|
|
||||||
(while diff-list
|
(while diff-list
|
||||||
(setq current-diff (1+ current-diff)
|
(setq current-diff (1+ current-diff)
|
||||||
list-element (car diff-list)
|
list-element (car diff-list)
|
||||||
|
|
@ -565,7 +565,7 @@ one optional arguments, diff-number to refine.")
|
||||||
(t 7))) ; Ancestor
|
(t 7))) ; Ancestor
|
||||||
state-of-diff (aref list-element 8)
|
state-of-diff (aref list-element 8)
|
||||||
)
|
)
|
||||||
|
|
||||||
(cond ((and (not (eq buf-type state-of-diff))
|
(cond ((and (not (eq buf-type state-of-diff))
|
||||||
(not (eq buf-type 'Ancestor))
|
(not (eq buf-type 'Ancestor))
|
||||||
(memq state-of-diff '(A B C)))
|
(memq state-of-diff '(A B C)))
|
||||||
|
|
@ -574,7 +574,7 @@ one optional arguments, diff-number to refine.")
|
||||||
(setq state-of-diff (format "=diff(%S)" state-of-diff))
|
(setq state-of-diff (format "=diff(%S)" state-of-diff))
|
||||||
)
|
)
|
||||||
(t (setq state-of-diff nil)))
|
(t (setq state-of-diff nil)))
|
||||||
|
|
||||||
;; Put overlays at appropriate places in buffer
|
;; Put overlays at appropriate places in buffer
|
||||||
;; convert word numbers to points, if necessary
|
;; convert word numbers to points, if necessary
|
||||||
(if (eq diff-list-type 'words)
|
(if (eq diff-list-type 'words)
|
||||||
|
|
@ -586,7 +586,7 @@ one optional arguments, diff-number to refine.")
|
||||||
(if (> begin end) (setq begin end))
|
(if (> begin end) (setq begin end))
|
||||||
(setq pt-saved (ediff-with-current-buffer buff (point)))))
|
(setq pt-saved (ediff-with-current-buffer buff (point)))))
|
||||||
(setq overlay (ediff-make-bullet-proof-overlay begin end buff))
|
(setq overlay (ediff-make-bullet-proof-overlay begin end buff))
|
||||||
|
|
||||||
(ediff-overlay-put overlay 'priority ediff-shadow-overlay-priority)
|
(ediff-overlay-put overlay 'priority ediff-shadow-overlay-priority)
|
||||||
(ediff-overlay-put overlay 'ediff-diff-num current-diff)
|
(ediff-overlay-put overlay 'ediff-diff-num current-diff)
|
||||||
(if (and (ediff-has-face-support-p)
|
(if (and (ediff-has-face-support-p)
|
||||||
|
|
@ -609,7 +609,7 @@ one optional arguments, diff-number to refine.")
|
||||||
diff-list
|
diff-list
|
||||||
(cdr diff-list))
|
(cdr diff-list))
|
||||||
) ; while
|
) ; while
|
||||||
|
|
||||||
(set (ediff-get-symbol-from-alist buf-type ediff-difference-vector-alist)
|
(set (ediff-get-symbol-from-alist buf-type ediff-difference-vector-alist)
|
||||||
(vconcat diff-overlay-list))
|
(vconcat diff-overlay-list))
|
||||||
))
|
))
|
||||||
|
|
@ -620,14 +620,14 @@ one optional arguments, diff-number to refine.")
|
||||||
;; if `flag' is 'skip then don't compute fine diffs for this region.
|
;; if `flag' is 'skip then don't compute fine diffs for this region.
|
||||||
(defun ediff-make-fine-diffs (&optional n flag)
|
(defun ediff-make-fine-diffs (&optional n flag)
|
||||||
(or n (setq n ediff-current-difference))
|
(or n (setq n ediff-current-difference))
|
||||||
|
|
||||||
(if (< ediff-number-of-differences 1)
|
(if (< ediff-number-of-differences 1)
|
||||||
(error ediff-NO-DIFFERENCES))
|
(error ediff-NO-DIFFERENCES))
|
||||||
|
|
||||||
(if ediff-word-mode
|
(if ediff-word-mode
|
||||||
(setq flag 'skip
|
(setq flag 'skip
|
||||||
ediff-auto-refine 'nix))
|
ediff-auto-refine 'nix))
|
||||||
|
|
||||||
(or (< n 0)
|
(or (< n 0)
|
||||||
(>= n ediff-number-of-differences)
|
(>= n ediff-number-of-differences)
|
||||||
;; n is within the range
|
;; n is within the range
|
||||||
|
|
@ -642,7 +642,7 @@ one optional arguments, diff-number to refine.")
|
||||||
(whitespace-B (ediff-whitespace-diff-region-p n 'B))
|
(whitespace-B (ediff-whitespace-diff-region-p n 'B))
|
||||||
(whitespace-C (ediff-whitespace-diff-region-p n 'C))
|
(whitespace-C (ediff-whitespace-diff-region-p n 'C))
|
||||||
cumulative-fine-diff-length)
|
cumulative-fine-diff-length)
|
||||||
|
|
||||||
(cond ;; If one of the regions is empty (or 2 in 3way comparison)
|
(cond ;; If one of the regions is empty (or 2 in 3way comparison)
|
||||||
;; then don't refine.
|
;; then don't refine.
|
||||||
;; If the region happens to be entirely whitespace or empty then
|
;; If the region happens to be entirely whitespace or empty then
|
||||||
|
|
@ -706,7 +706,7 @@ one optional arguments, diff-number to refine.")
|
||||||
ediff-control-buffer)
|
ediff-control-buffer)
|
||||||
(setq file-A
|
(setq file-A
|
||||||
(ediff-make-temp-file tmp-buffer "fineDiffA" file-A))
|
(ediff-make-temp-file tmp-buffer "fineDiffA" file-A))
|
||||||
|
|
||||||
(ediff-wordify
|
(ediff-wordify
|
||||||
(ediff-get-diff-posn 'B 'beg n)
|
(ediff-get-diff-posn 'B 'beg n)
|
||||||
(ediff-get-diff-posn 'B 'end n)
|
(ediff-get-diff-posn 'B 'end n)
|
||||||
|
|
@ -715,7 +715,7 @@ one optional arguments, diff-number to refine.")
|
||||||
ediff-control-buffer)
|
ediff-control-buffer)
|
||||||
(setq file-B
|
(setq file-B
|
||||||
(ediff-make-temp-file tmp-buffer "fineDiffB" file-B))
|
(ediff-make-temp-file tmp-buffer "fineDiffB" file-B))
|
||||||
|
|
||||||
(if ediff-3way-job
|
(if ediff-3way-job
|
||||||
(progn
|
(progn
|
||||||
(ediff-wordify
|
(ediff-wordify
|
||||||
|
|
@ -727,12 +727,12 @@ one optional arguments, diff-number to refine.")
|
||||||
(setq file-C
|
(setq file-C
|
||||||
(ediff-make-temp-file
|
(ediff-make-temp-file
|
||||||
tmp-buffer "fineDiffC" file-C))))
|
tmp-buffer "fineDiffC" file-C))))
|
||||||
|
|
||||||
;; save temp file names.
|
;; save temp file names.
|
||||||
(setq ediff-temp-file-A file-A
|
(setq ediff-temp-file-A file-A
|
||||||
ediff-temp-file-B file-B
|
ediff-temp-file-B file-B
|
||||||
ediff-temp-file-C file-C)
|
ediff-temp-file-C file-C)
|
||||||
|
|
||||||
;; set the new vector of fine diffs, if none exists
|
;; set the new vector of fine diffs, if none exists
|
||||||
(cond ((and ediff-3way-job whitespace-A)
|
(cond ((and ediff-3way-job whitespace-A)
|
||||||
(ediff-setup-fine-diff-regions nil file-B file-C n))
|
(ediff-setup-fine-diff-regions nil file-B file-C n))
|
||||||
|
|
@ -745,7 +745,7 @@ one optional arguments, diff-number to refine.")
|
||||||
(ediff-setup-fine-diff-regions file-A file-B nil n))
|
(ediff-setup-fine-diff-regions file-A file-B nil n))
|
||||||
(t
|
(t
|
||||||
(ediff-setup-fine-diff-regions file-A file-B file-C n)))
|
(ediff-setup-fine-diff-regions file-A file-B file-C n)))
|
||||||
|
|
||||||
(setq cumulative-fine-diff-length
|
(setq cumulative-fine-diff-length
|
||||||
(+ (length (ediff-get-fine-diff-vector n 'A))
|
(+ (length (ediff-get-fine-diff-vector n 'A))
|
||||||
(length (ediff-get-fine-diff-vector n 'B))
|
(length (ediff-get-fine-diff-vector n 'B))
|
||||||
|
|
@ -753,7 +753,7 @@ one optional arguments, diff-number to refine.")
|
||||||
(if (and file-C (not ediff-merge-job))
|
(if (and file-C (not ediff-merge-job))
|
||||||
(length (ediff-get-fine-diff-vector n 'C))
|
(length (ediff-get-fine-diff-vector n 'C))
|
||||||
0)))
|
0)))
|
||||||
|
|
||||||
(cond ((or
|
(cond ((or
|
||||||
;; all regions are white space
|
;; all regions are white space
|
||||||
(and whitespace-A whitespace-B whitespace-C)
|
(and whitespace-A whitespace-B whitespace-C)
|
||||||
|
|
@ -781,7 +781,7 @@ one optional arguments, diff-number to refine.")
|
||||||
) ; end cond
|
) ; end cond
|
||||||
(ediff-set-fine-diff-properties n)
|
(ediff-set-fine-diff-properties n)
|
||||||
)))
|
)))
|
||||||
|
|
||||||
;; Interface to ediff-make-fine-diffs. Checks for auto-refine limit, etc.
|
;; Interface to ediff-make-fine-diffs. Checks for auto-refine limit, etc.
|
||||||
(defun ediff-install-fine-diff-if-necessary (n)
|
(defun ediff-install-fine-diff-if-necessary (n)
|
||||||
(cond ((and (eq ediff-auto-refine 'on)
|
(cond ((and (eq ediff-auto-refine 'on)
|
||||||
|
|
@ -797,12 +797,12 @@ one optional arguments, diff-number to refine.")
|
||||||
(ediff-get-diff-posn 'B 'beg n))))
|
(ediff-get-diff-posn 'B 'beg n))))
|
||||||
(ediff-make-fine-diffs n 'noforce)
|
(ediff-make-fine-diffs n 'noforce)
|
||||||
(ediff-make-fine-diffs n 'skip)))
|
(ediff-make-fine-diffs n 'skip)))
|
||||||
|
|
||||||
;; highlight iff fine diffs already exist
|
;; highlight iff fine diffs already exist
|
||||||
((eq ediff-auto-refine 'off)
|
((eq ediff-auto-refine 'off)
|
||||||
(ediff-make-fine-diffs n 'skip))))
|
(ediff-make-fine-diffs n 'skip))))
|
||||||
|
|
||||||
|
|
||||||
;; if fine diff vector is not set for diff N, then do nothing
|
;; if fine diff vector is not set for diff N, then do nothing
|
||||||
(defun ediff-set-fine-diff-properties (n &optional default)
|
(defun ediff-set-fine-diff-properties (n &optional default)
|
||||||
(or (not (ediff-has-face-support-p))
|
(or (not (ediff-has-face-support-p))
|
||||||
|
|
@ -814,7 +814,7 @@ one optional arguments, diff-number to refine.")
|
||||||
(ediff-set-fine-diff-properties-in-one-buffer 'B n default)
|
(ediff-set-fine-diff-properties-in-one-buffer 'B n default)
|
||||||
(if ediff-3way-job
|
(if ediff-3way-job
|
||||||
(ediff-set-fine-diff-properties-in-one-buffer 'C n default)))))
|
(ediff-set-fine-diff-properties-in-one-buffer 'C n default)))))
|
||||||
|
|
||||||
(defun ediff-set-fine-diff-properties-in-one-buffer (buf-type
|
(defun ediff-set-fine-diff-properties-in-one-buffer (buf-type
|
||||||
n &optional default)
|
n &optional default)
|
||||||
(let ((fine-diff-vector (ediff-get-fine-diff-vector n buf-type))
|
(let ((fine-diff-vector (ediff-get-fine-diff-vector n buf-type))
|
||||||
|
|
@ -836,7 +836,7 @@ one optional arguments, diff-number to refine.")
|
||||||
(ediff-set-overlay-face overl face)
|
(ediff-set-overlay-face overl face)
|
||||||
(ediff-overlay-put overl 'priority priority))
|
(ediff-overlay-put overl 'priority priority))
|
||||||
fine-diff-vector)))
|
fine-diff-vector)))
|
||||||
|
|
||||||
;; Set overlays over the regions that denote delimiters
|
;; Set overlays over the regions that denote delimiters
|
||||||
(defun ediff-set-fine-overlays-for-combined-merge (diff-list reg-num)
|
(defun ediff-set-fine-overlays-for-combined-merge (diff-list reg-num)
|
||||||
(let (overlay overlay-list)
|
(let (overlay overlay-list)
|
||||||
|
|
@ -856,8 +856,8 @@ delimiter regions"))
|
||||||
(ediff-set-fine-diff-vector
|
(ediff-set-fine-diff-vector
|
||||||
reg-num 'C (apply 'vector overlay-list))
|
reg-num 'C (apply 'vector overlay-list))
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
;; Convert diff list to overlays for a given DIFF-REGION
|
;; Convert diff list to overlays for a given DIFF-REGION
|
||||||
;; in buffer of type BUF-TYPE
|
;; in buffer of type BUF-TYPE
|
||||||
(defun ediff-set-fine-overlays-in-one-buffer (buf-type diff-list region-num)
|
(defun ediff-set-fine-overlays-in-one-buffer (buf-type diff-list region-num)
|
||||||
|
|
@ -871,7 +871,7 @@ delimiter regions"))
|
||||||
(ediff-clear-fine-differences-in-one-buffer region-num buf-type)
|
(ediff-clear-fine-differences-in-one-buffer region-num buf-type)
|
||||||
(setq diff-list (cdr diff-list)) ; discard list type (words or points)
|
(setq diff-list (cdr diff-list)) ; discard list type (words or points)
|
||||||
(ediff-with-current-buffer buff (goto-char reg-start))
|
(ediff-with-current-buffer buff (goto-char reg-start))
|
||||||
|
|
||||||
;; if it is a combined merge then set overlays in buff C specially
|
;; if it is a combined merge then set overlays in buff C specially
|
||||||
(if (and ediff-merge-job (eq buf-type 'C)
|
(if (and ediff-merge-job (eq buf-type 'C)
|
||||||
(setq combined-merge-diff-list
|
(setq combined-merge-diff-list
|
||||||
|
|
@ -897,7 +897,7 @@ delimiter regions"))
|
||||||
(setq overlay (ediff-make-bullet-proof-overlay begin end buff))
|
(setq overlay (ediff-make-bullet-proof-overlay begin end buff))
|
||||||
;; record all overlays for this difference region
|
;; record all overlays for this difference region
|
||||||
(setq diff-overlay-list (nconc diff-overlay-list (list overlay))))
|
(setq diff-overlay-list (nconc diff-overlay-list (list overlay))))
|
||||||
|
|
||||||
(setq diff-list (cdr diff-list))
|
(setq diff-list (cdr diff-list))
|
||||||
) ; while
|
) ; while
|
||||||
;; convert the list of difference information into a vector
|
;; convert the list of difference information into a vector
|
||||||
|
|
@ -964,7 +964,7 @@ delimiter regions"))
|
||||||
(anc-prev 1)
|
(anc-prev 1)
|
||||||
diff-list shift-A shift-B shift-C
|
diff-list shift-A shift-B shift-C
|
||||||
)
|
)
|
||||||
|
|
||||||
;; diff list contains word numbers or points, depending on word-mode
|
;; diff list contains word numbers or points, depending on word-mode
|
||||||
(setq diff-list (cons (if word-mode 'words 'points)
|
(setq diff-list (cons (if word-mode 'words 'points)
|
||||||
diff-list))
|
diff-list))
|
||||||
|
|
@ -979,7 +979,7 @@ delimiter regions"))
|
||||||
(if three-way-comp
|
(if three-way-comp
|
||||||
(ediff-overlay-start
|
(ediff-overlay-start
|
||||||
(ediff-get-value-according-to-buffer-type 'C bounds)))))
|
(ediff-get-value-according-to-buffer-type 'C bounds)))))
|
||||||
|
|
||||||
;; reset point in buffers A, B, C
|
;; reset point in buffers A, B, C
|
||||||
(ediff-with-current-buffer A-buffer
|
(ediff-with-current-buffer A-buffer
|
||||||
(goto-char (if shift-A shift-A (point-min))))
|
(goto-char (if shift-A shift-A (point-min))))
|
||||||
|
|
@ -991,7 +991,7 @@ delimiter regions"))
|
||||||
(if (ediff-buffer-live-p anc-buffer)
|
(if (ediff-buffer-live-p anc-buffer)
|
||||||
(ediff-with-current-buffer anc-buffer
|
(ediff-with-current-buffer anc-buffer
|
||||||
(goto-char (point-min))))
|
(goto-char (point-min))))
|
||||||
|
|
||||||
(ediff-with-current-buffer diff-buffer
|
(ediff-with-current-buffer diff-buffer
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(while (re-search-forward ediff-match-diff3-line nil t)
|
(while (re-search-forward ediff-match-diff3-line nil t)
|
||||||
|
|
@ -1023,7 +1023,7 @@ delimiter regions"))
|
||||||
b-begin-pt b-end-pt
|
b-begin-pt b-end-pt
|
||||||
c-begin-pt c-end-pt
|
c-begin-pt c-end-pt
|
||||||
anc-begin-pt anc-end-pt)
|
anc-begin-pt anc-end-pt)
|
||||||
|
|
||||||
(setq state-of-ancestor
|
(setq state-of-ancestor
|
||||||
(= c-or-anc-begin c-or-anc-end))
|
(= c-or-anc-begin c-or-anc-end))
|
||||||
|
|
||||||
|
|
@ -1036,7 +1036,7 @@ delimiter regions"))
|
||||||
(t
|
(t
|
||||||
(setq c-begin a-begin
|
(setq c-begin a-begin
|
||||||
c-end a-end)))
|
c-end a-end)))
|
||||||
|
|
||||||
;; compute main diff vector
|
;; compute main diff vector
|
||||||
(if word-mode
|
(if word-mode
|
||||||
;; make diff-list contain word numbers
|
;; make diff-list contain word numbers
|
||||||
|
|
@ -1105,11 +1105,11 @@ delimiter regions"))
|
||||||
)))
|
)))
|
||||||
)))
|
)))
|
||||||
))
|
))
|
||||||
|
|
||||||
))) ; end ediff-with-current-buffer
|
))) ; end ediff-with-current-buffer
|
||||||
diff-list
|
diff-list
|
||||||
))
|
))
|
||||||
|
|
||||||
;; Generate the difference vector and overlays for three files
|
;; Generate the difference vector and overlays for three files
|
||||||
;; File-C is either the third file to compare (in case of 3-way comparison)
|
;; File-C is either the third file to compare (in case of 3-way comparison)
|
||||||
;; or it is the ancestor file.
|
;; or it is the ancestor file.
|
||||||
|
|
@ -1117,11 +1117,11 @@ delimiter regions"))
|
||||||
(or (ediff-buffer-live-p ediff-diff-buffer)
|
(or (ediff-buffer-live-p ediff-diff-buffer)
|
||||||
(setq ediff-diff-buffer
|
(setq ediff-diff-buffer
|
||||||
(get-buffer-create (ediff-unique-buffer-name "*ediff-diff" "*"))))
|
(get-buffer-create (ediff-unique-buffer-name "*ediff-diff" "*"))))
|
||||||
|
|
||||||
(message "Computing differences ...")
|
(message "Computing differences ...")
|
||||||
(ediff-exec-process ediff-diff3-program ediff-diff-buffer 'synchronize
|
(ediff-exec-process ediff-diff3-program ediff-diff-buffer 'synchronize
|
||||||
ediff-diff3-options file-A file-B file-C)
|
ediff-diff3-options file-A file-B file-C)
|
||||||
|
|
||||||
(ediff-prepare-error-list ediff-diff3-ok-lines-regexp ediff-diff-buffer)
|
(ediff-prepare-error-list ediff-diff3-ok-lines-regexp ediff-diff-buffer)
|
||||||
;;(message "Computing differences ... done")
|
;;(message "Computing differences ... done")
|
||||||
(ediff-convert-diffs-to-overlays
|
(ediff-convert-diffs-to-overlays
|
||||||
|
|
@ -1129,7 +1129,7 @@ delimiter regions"))
|
||||||
ediff-diff-buffer
|
ediff-diff-buffer
|
||||||
ediff-word-mode ediff-3way-comparison-job ediff-narrow-bounds)
|
ediff-word-mode ediff-3way-comparison-job ediff-narrow-bounds)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
;; Execute PROGRAM asynchronously, unless OS/2, Windows-*, or DOS, or unless
|
;; Execute PROGRAM asynchronously, unless OS/2, Windows-*, or DOS, or unless
|
||||||
;; SYNCH is non-nil. BUFFER must be a buffer object, and must be alive. The
|
;; SYNCH is non-nil. BUFFER must be a buffer object, and must be alive. The
|
||||||
|
|
@ -1176,7 +1176,7 @@ delimiter regions"))
|
||||||
(set-process-filter proc 'ediff-process-filter)
|
(set-process-filter proc 'ediff-process-filter)
|
||||||
)))
|
)))
|
||||||
(store-match-data data))))
|
(store-match-data data))))
|
||||||
|
|
||||||
;; This is shell-command-filter from simple.el in Emacs.
|
;; This is shell-command-filter from simple.el in Emacs.
|
||||||
;; Copied here because XEmacs doesn't have it.
|
;; Copied here because XEmacs doesn't have it.
|
||||||
(defun ediff-process-filter (proc string)
|
(defun ediff-process-filter (proc string)
|
||||||
|
|
@ -1200,7 +1200,7 @@ delimiter regions"))
|
||||||
(if opoint
|
(if opoint
|
||||||
(goto-char opoint))
|
(goto-char opoint))
|
||||||
(set-buffer obuf))))
|
(set-buffer obuf))))
|
||||||
|
|
||||||
;; like shell-command-sentinel but doesn't print an exit status message
|
;; like shell-command-sentinel but doesn't print an exit status message
|
||||||
;; we do this because diff always exits with status 1, if diffs are found
|
;; we do this because diff always exits with status 1, if diffs are found
|
||||||
;; so shell-command-sentinel displays a confusing message to the user
|
;; so shell-command-sentinel displays a confusing message to the user
|
||||||
|
|
@ -1212,7 +1212,7 @@ delimiter regions"))
|
||||||
(set-buffer (process-buffer process))
|
(set-buffer (process-buffer process))
|
||||||
(setq mode-line-process nil))
|
(setq mode-line-process nil))
|
||||||
(delete-process process))))
|
(delete-process process))))
|
||||||
|
|
||||||
|
|
||||||
;;; Word functions used to refine the current diff
|
;;; Word functions used to refine the current diff
|
||||||
|
|
||||||
|
|
@ -1297,14 +1297,14 @@ arguments to `skip-chars-forward'."
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(skip-chars-forward ediff-whitespace)
|
(skip-chars-forward ediff-whitespace)
|
||||||
(delete-region (point-min) (point))
|
(delete-region (point-min) (point))
|
||||||
|
|
||||||
(while (not (eobp))
|
(while (not (eobp))
|
||||||
(funcall forward-word-function)
|
(funcall forward-word-function)
|
||||||
(setq sv-point (point))
|
(setq sv-point (point))
|
||||||
(skip-chars-forward ediff-whitespace)
|
(skip-chars-forward ediff-whitespace)
|
||||||
(delete-region sv-point (point))
|
(delete-region sv-point (point))
|
||||||
(insert "\n")))))
|
(insert "\n")))))
|
||||||
|
|
||||||
;; copy string specified as BEG END from IN-BUF to OUT-BUF
|
;; copy string specified as BEG END from IN-BUF to OUT-BUF
|
||||||
(defun ediff-copy-to-buffer (beg end in-buffer out-buffer)
|
(defun ediff-copy-to-buffer (beg end in-buffer out-buffer)
|
||||||
(with-current-buffer out-buffer
|
(with-current-buffer out-buffer
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(provide 'ediff-help)
|
(provide 'ediff-help)
|
||||||
|
|
||||||
;; Compiler pacifier start
|
;; Compiler pacifier start
|
||||||
|
|
@ -47,9 +47,9 @@
|
||||||
"The head of the full help message.")
|
"The head of the full help message.")
|
||||||
(defconst ediff-long-help-message-tail
|
(defconst ediff-long-help-message-tail
|
||||||
"=====================|===========================|=============================
|
"=====================|===========================|=============================
|
||||||
R -show registry | = -compare regions | M -show session group
|
R -show registry | = -compare regions | M -show session group
|
||||||
D -diff output | E -browse Ediff manual| G -send bug report
|
D -diff output | E -browse Ediff manual| G -send bug report
|
||||||
i -status info | ? -help off | z/q -suspend/quit
|
i -status info | ? -help off | z/q -suspend/quit
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
For help on a specific command: Click Button 2 over it; or
|
For help on a specific command: Click Button 2 over it; or
|
||||||
Put the cursor over it and type RET."
|
Put the cursor over it and type RET."
|
||||||
|
|
@ -59,69 +59,69 @@ For help on a specific command: Click Button 2 over it; or
|
||||||
"
|
"
|
||||||
p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y
|
p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y
|
||||||
n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
|
n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
|
||||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||||
gx -goto X's point| | ! -update diff regions
|
gx -goto X's point| | ! -update diff regions
|
||||||
C-l -recenter | ## -ignore whitespace |
|
C-l -recenter | ## -ignore whitespace |
|
||||||
v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
|
v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
|
||||||
</> -scroll lt/rt | X -read-only in buf X | wd -save diff output
|
</> -scroll lt/rt | X -read-only in buf X | wd -save diff output
|
||||||
~ -rotate buffers| m -wide display |
|
~ -rotate buffers| m -wide display |
|
||||||
"
|
"
|
||||||
"Help message usually used for 3-way comparison.
|
"Help message usually used for 3-way comparison.
|
||||||
Normally, not a user option. See `ediff-help-message' for details.")
|
Normally, not a user option. See `ediff-help-message' for details.")
|
||||||
|
|
||||||
(defconst ediff-long-help-message-compare2
|
(defconst ediff-long-help-message-compare2
|
||||||
"
|
"
|
||||||
p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A
|
p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A
|
||||||
n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
|
n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
|
||||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||||
gx -goto X's point| | ! -update diff regions
|
gx -goto X's point| | ! -update diff regions
|
||||||
C-l -recenter | ## -ignore whitespace |
|
C-l -recenter | ## -ignore whitespace |
|
||||||
v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
|
v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
|
||||||
</> -scroll lt/rt | X -read-only in buf X | wd -save diff output
|
</> -scroll lt/rt | X -read-only in buf X | wd -save diff output
|
||||||
~ -swap variants | m -wide display |
|
~ -swap variants | m -wide display |
|
||||||
"
|
"
|
||||||
"Help message usually used for 2-way comparison.
|
"Help message usually used for 2-way comparison.
|
||||||
Normally, not a user option. See `ediff-help-message' for details.")
|
Normally, not a user option. See `ediff-help-message' for details.")
|
||||||
|
|
||||||
(defconst ediff-long-help-message-narrow2
|
(defconst ediff-long-help-message-narrow2
|
||||||
"
|
"
|
||||||
p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A
|
p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A
|
||||||
n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
|
n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
|
||||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||||
gx -goto X's point| % -narrow/widen buffs | ! -update diff regions
|
gx -goto X's point| % -narrow/widen buffs | ! -update diff regions
|
||||||
C-l -recenter | ## -ignore whitespace |
|
C-l -recenter | ## -ignore whitespace |
|
||||||
v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
|
v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
|
||||||
</> -scroll lt/rt | X -read-only in buf X | wd -save diff output
|
</> -scroll lt/rt | X -read-only in buf X | wd -save diff output
|
||||||
~ -swap variants | m -wide display |
|
~ -swap variants | m -wide display |
|
||||||
"
|
"
|
||||||
"Help message when comparing windows or regions line-by-line.
|
"Help message when comparing windows or regions line-by-line.
|
||||||
Normally, not a user option. See `ediff-help-message' for details.")
|
Normally, not a user option. See `ediff-help-message' for details.")
|
||||||
|
|
||||||
(defconst ediff-long-help-message-word-mode
|
(defconst ediff-long-help-message-word-mode
|
||||||
"
|
"
|
||||||
p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y
|
p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y
|
||||||
n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
|
n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
|
||||||
j -jump to diff | |
|
j -jump to diff | |
|
||||||
gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs
|
gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs
|
||||||
C-l -recenter | |
|
C-l -recenter | |
|
||||||
v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
|
v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
|
||||||
</> -scroll lt/rt | X -read-only in buf X | wd -save diff output
|
</> -scroll lt/rt | X -read-only in buf X | wd -save diff output
|
||||||
~ -swap variants | m -wide display |
|
~ -swap variants | m -wide display |
|
||||||
"
|
"
|
||||||
"Help message when comparing windows or regions word-by-word.
|
"Help message when comparing windows or regions word-by-word.
|
||||||
Normally, not a user option. See `ediff-help-message' for details.")
|
Normally, not a user option. See `ediff-help-message' for details.")
|
||||||
|
|
||||||
(defconst ediff-long-help-message-merge
|
(defconst ediff-long-help-message-merge
|
||||||
"
|
"
|
||||||
p,DEL -previous diff | | -vert/horiz split | x -copy buf X's region to C
|
p,DEL -previous diff | | -vert/horiz split | x -copy buf X's region to C
|
||||||
n,SPC -next diff | h -hilighting | r -restore buf C's old diff
|
n,SPC -next diff | h -hilighting | r -restore buf C's old diff
|
||||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||||
gx -goto X's point| ## -ignore whitespace | ! -update diff regions
|
gx -goto X's point| ## -ignore whitespace | ! -update diff regions
|
||||||
C-l -recenter | #f/#h -focus/hide regions | + -combine diff regions
|
C-l -recenter | #f/#h -focus/hide regions | + -combine diff regions
|
||||||
v/V -scroll up/dn | X -read-only in buf X | wx -save buf X
|
v/V -scroll up/dn | X -read-only in buf X | wx -save buf X
|
||||||
</> -scroll lt/rt | m -wide display | wd -save diff output
|
</> -scroll lt/rt | m -wide display | wd -save diff output
|
||||||
~ -swap variants | s -shrink window C | / -show ancestor buff
|
~ -swap variants | s -shrink window C | / -show ancestor buff
|
||||||
| $$ -show clashes only | & -merge w/new default
|
| $$ -show clashes only | & -merge w/new default
|
||||||
| $* -skip changed regions |
|
| $* -skip changed regions |
|
||||||
"
|
"
|
||||||
"Help message for merge sessions.
|
"Help message for merge sessions.
|
||||||
|
|
@ -130,14 +130,14 @@ Normally, not a user option. See `ediff-help-message' for details.")
|
||||||
;; The actual long help message.
|
;; The actual long help message.
|
||||||
(ediff-defvar-local ediff-long-help-message ""
|
(ediff-defvar-local ediff-long-help-message ""
|
||||||
"Normally, not a user option. See `ediff-help-message' for details.")
|
"Normally, not a user option. See `ediff-help-message' for details.")
|
||||||
|
|
||||||
(defconst ediff-brief-message-string
|
(defconst ediff-brief-message-string
|
||||||
" ? -quick help "
|
" ? -quick help "
|
||||||
"Contents of the brief help message.")
|
"Contents of the brief help message.")
|
||||||
;; The actual brief help message
|
;; The actual brief help message
|
||||||
(ediff-defvar-local ediff-brief-help-message ""
|
(ediff-defvar-local ediff-brief-help-message ""
|
||||||
"Normally, not a user option. See `ediff-help-message' for details.")
|
"Normally, not a user option. See `ediff-help-message' for details.")
|
||||||
|
|
||||||
(ediff-defvar-local ediff-brief-help-message-function nil
|
(ediff-defvar-local ediff-brief-help-message-function nil
|
||||||
"The brief help message that the user can customize.
|
"The brief help message that the user can customize.
|
||||||
If the user sets this to a parameter-less function, Ediff will use it to
|
If the user sets this to a parameter-less function, Ediff will use it to
|
||||||
|
|
@ -157,7 +157,7 @@ See `ediff-brief-help-message-function' for more.")
|
||||||
Normally, the user shouldn't touch this. However, if you want Ediff to
|
Normally, the user shouldn't touch this. However, if you want Ediff to
|
||||||
start up with different help messages for different jobs, you can change
|
start up with different help messages for different jobs, you can change
|
||||||
the value of this variable and the variables `ediff-help-message-*' in
|
the value of this variable and the variables `ediff-help-message-*' in
|
||||||
`ediff-startup-hook'.")
|
`ediff-startup-hook'.")
|
||||||
|
|
||||||
|
|
||||||
;; the keymap that defines clicks over the quick help regions
|
;; the keymap that defines clicks over the quick help regions
|
||||||
|
|
@ -199,12 +199,12 @@ the value of this variable and the variables `ediff-help-message-*' in
|
||||||
(overlay-get elt 'ediff-help-info))
|
(overlay-get elt 'ediff-help-info))
|
||||||
(overlays-at pos))))
|
(overlays-at pos))))
|
||||||
)
|
)
|
||||||
|
|
||||||
(if (not (stringp cmd))
|
(if (not (stringp cmd))
|
||||||
(error "Hmm... I don't see an Ediff command around here..."))
|
(error "Hmm... I don't see an Ediff command around here..."))
|
||||||
|
|
||||||
(ediff-documentation "Quick Help Commands")
|
(ediff-documentation "Quick Help Commands")
|
||||||
|
|
||||||
(let (case-fold-search)
|
(let (case-fold-search)
|
||||||
(cond ((string= cmd "?") (re-search-forward "^`\\?'"))
|
(cond ((string= cmd "?") (re-search-forward "^`\\?'"))
|
||||||
((string= cmd "G") (re-search-forward "^`G'"))
|
((string= cmd "G") (re-search-forward "^`G'"))
|
||||||
|
|
@ -260,7 +260,7 @@ the value of this variable and the variables `ediff-help-message-*' in
|
||||||
(next-line 1))
|
(next-line 1))
|
||||||
(end-of-line)
|
(end-of-line)
|
||||||
(current-column)))
|
(current-column)))
|
||||||
|
|
||||||
|
|
||||||
(defun ediff-indent-help-message ()
|
(defun ediff-indent-help-message ()
|
||||||
(let* ((shift (/ (max 0 (- (window-width (selected-window))
|
(let* ((shift (/ (max 0 (- (window-width (selected-window))
|
||||||
|
|
@ -273,7 +273,7 @@ the value of this variable and the variables `ediff-help-message-*' in
|
||||||
(insert str)
|
(insert str)
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(forward-line 1)))))
|
(forward-line 1)))))
|
||||||
|
|
||||||
|
|
||||||
;; compose the help message as a string
|
;; compose the help message as a string
|
||||||
(defun ediff-set-help-message ()
|
(defun ediff-set-help-message ()
|
||||||
|
|
@ -282,7 +282,7 @@ the value of this variable and the variables `ediff-help-message-*' in
|
||||||
(or (symbolp ediff-long-help-message-function)
|
(or (symbolp ediff-long-help-message-function)
|
||||||
(consp ediff-long-help-message-function)))
|
(consp ediff-long-help-message-function)))
|
||||||
(funcall ediff-long-help-message-function))
|
(funcall ediff-long-help-message-function))
|
||||||
(ediff-word-mode
|
(ediff-word-mode
|
||||||
(concat ediff-long-help-message-head
|
(concat ediff-long-help-message-head
|
||||||
ediff-long-help-message-word-mode
|
ediff-long-help-message-word-mode
|
||||||
ediff-long-help-message-tail))
|
ediff-long-help-message-tail))
|
||||||
|
|
@ -290,7 +290,7 @@ the value of this variable and the variables `ediff-help-message-*' in
|
||||||
(concat ediff-long-help-message-head
|
(concat ediff-long-help-message-head
|
||||||
ediff-long-help-message-narrow2
|
ediff-long-help-message-narrow2
|
||||||
ediff-long-help-message-tail))
|
ediff-long-help-message-tail))
|
||||||
(ediff-merge-job
|
(ediff-merge-job
|
||||||
(concat ediff-long-help-message-head
|
(concat ediff-long-help-message-head
|
||||||
ediff-long-help-message-merge
|
ediff-long-help-message-merge
|
||||||
ediff-long-help-message-tail))
|
ediff-long-help-message-tail))
|
||||||
|
|
@ -298,11 +298,11 @@ the value of this variable and the variables `ediff-help-message-*' in
|
||||||
(concat ediff-long-help-message-head
|
(concat ediff-long-help-message-head
|
||||||
ediff-long-help-message-compare3
|
ediff-long-help-message-compare3
|
||||||
ediff-long-help-message-tail))
|
ediff-long-help-message-tail))
|
||||||
(t
|
(t
|
||||||
(concat ediff-long-help-message-head
|
(concat ediff-long-help-message-head
|
||||||
ediff-long-help-message-compare2
|
ediff-long-help-message-compare2
|
||||||
ediff-long-help-message-tail))))
|
ediff-long-help-message-tail))))
|
||||||
(setq ediff-brief-help-message
|
(setq ediff-brief-help-message
|
||||||
(cond ((and ediff-brief-help-message-function
|
(cond ((and ediff-brief-help-message-function
|
||||||
(or (symbolp ediff-brief-help-message-function)
|
(or (symbolp ediff-brief-help-message-function)
|
||||||
(consp ediff-brief-help-message-function)))
|
(consp ediff-brief-help-message-function)))
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
(defmacro ediff-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form)
|
(defmacro ediff-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form)
|
||||||
(if (string-match "XEmacs" emacs-version)
|
(if (string-match "XEmacs" emacs-version)
|
||||||
xemacs-form emacs-form))
|
xemacs-form emacs-form))
|
||||||
|
|
||||||
;; This autoload is useless in Emacs because ediff-hook.el is dumped with
|
;; This autoload is useless in Emacs because ediff-hook.el is dumped with
|
||||||
;; emacs, but it is needed in XEmacs
|
;; emacs, but it is needed in XEmacs
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
@ -147,12 +147,12 @@
|
||||||
:selected (if (featurep 'ediff-tbar)
|
:selected (if (featurep 'ediff-tbar)
|
||||||
(ediff-use-toolbar-p))]
|
(ediff-use-toolbar-p))]
|
||||||
))
|
))
|
||||||
|
|
||||||
;; put these menus before Object-Oriented-Browser in Tools menu
|
;; put these menus before Object-Oriented-Browser in Tools menu
|
||||||
(if (and (featurep 'menubar) (not (featurep 'infodock))
|
(if (and (featurep 'menubar) (not (featurep 'infodock))
|
||||||
(not (featurep 'ediff-hook)))
|
(not (featurep 'ediff-hook)))
|
||||||
(ediff-xemacs-init-menus)))
|
(ediff-xemacs-init-menus)))
|
||||||
|
|
||||||
;; Emacs--only if menu-bar is loaded
|
;; Emacs--only if menu-bar is loaded
|
||||||
(if (featurep 'menu-bar)
|
(if (featurep 'menu-bar)
|
||||||
(progn
|
(progn
|
||||||
|
|
@ -164,7 +164,7 @@
|
||||||
(defvar menu-bar-epatch-menu (make-sparse-keymap "Apply Patch"))
|
(defvar menu-bar-epatch-menu (make-sparse-keymap "Apply Patch"))
|
||||||
(fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu))
|
(fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu))
|
||||||
(defvar menu-bar-ediff-merge-menu (make-sparse-keymap "Merge"))
|
(defvar menu-bar-ediff-merge-menu (make-sparse-keymap "Merge"))
|
||||||
(fset 'menu-bar-ediff-merge-menu
|
(fset 'menu-bar-ediff-merge-menu
|
||||||
(symbol-value 'menu-bar-ediff-merge-menu))
|
(symbol-value 'menu-bar-ediff-merge-menu))
|
||||||
(defvar menu-bar-ediff-menu (make-sparse-keymap "Compare"))
|
(defvar menu-bar-ediff-menu (make-sparse-keymap "Compare"))
|
||||||
(fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu))
|
(fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu))
|
||||||
|
|
@ -222,7 +222,7 @@
|
||||||
. ediff-merge-directories-with-ancestor))
|
. ediff-merge-directories-with-ancestor))
|
||||||
(define-key menu-bar-ediff-merge-menu [ediff-merge-directories]
|
(define-key menu-bar-ediff-merge-menu [ediff-merge-directories]
|
||||||
'("Directories..." . ediff-merge-directories))
|
'("Directories..." . ediff-merge-directories))
|
||||||
(define-key
|
(define-key
|
||||||
menu-bar-ediff-merge-menu [separator-ediff-merge-dirs] '("--"))
|
menu-bar-ediff-merge-menu [separator-ediff-merge-dirs] '("--"))
|
||||||
(define-key
|
(define-key
|
||||||
menu-bar-ediff-merge-menu [ediff-merge-buffers-with-ancestor]
|
menu-bar-ediff-merge-menu [ediff-merge-buffers-with-ancestor]
|
||||||
|
|
@ -251,7 +251,7 @@
|
||||||
(define-key menu-bar-ediff-misc-menu [ediff-doc]
|
(define-key menu-bar-ediff-misc-menu [ediff-doc]
|
||||||
'("Ediff Manual..." . ediff-documentation))
|
'("Ediff Manual..." . ediff-documentation))
|
||||||
)
|
)
|
||||||
|
|
||||||
) ; emacs case
|
) ; emacs case
|
||||||
) ; ediff-cond-compile-for-xemacs-or-emacs
|
) ; ediff-cond-compile-for-xemacs-or-emacs
|
||||||
|
|
||||||
|
|
@ -273,13 +273,13 @@
|
||||||
(autoload 'ediff-revision "ediff" "Compare versions of a file" t)
|
(autoload 'ediff-revision "ediff" "Compare versions of a file" t)
|
||||||
|
|
||||||
;; compare regions and windows
|
;; compare regions and windows
|
||||||
(autoload 'ediff-windows-wordwise
|
(autoload 'ediff-windows-wordwise
|
||||||
"ediff" "Compare two windows word-by-word." t)
|
"ediff" "Compare two windows word-by-word." t)
|
||||||
(autoload 'ediff-regions-wordwise
|
(autoload 'ediff-regions-wordwise
|
||||||
"ediff" "Compare two regions word-by-word." t)
|
"ediff" "Compare two regions word-by-word." t)
|
||||||
(autoload 'ediff-windows-linewise
|
(autoload 'ediff-windows-linewise
|
||||||
"ediff" "Compare two windows line-by-line." t)
|
"ediff" "Compare two windows line-by-line." t)
|
||||||
(autoload 'ediff-regions-linewise
|
(autoload 'ediff-regions-linewise
|
||||||
"ediff" "Compare two regions line-by-line." t)
|
"ediff" "Compare two regions line-by-line." t)
|
||||||
|
|
||||||
;; patch
|
;; patch
|
||||||
|
|
@ -308,9 +308,9 @@
|
||||||
(autoload
|
(autoload
|
||||||
'ediff-directories3 "ediff" "Compare files in three directories." t)
|
'ediff-directories3 "ediff" "Compare files in three directories." t)
|
||||||
|
|
||||||
(autoload 'edir-revisions
|
(autoload 'edir-revisions
|
||||||
"ediff" "Compare two versions of a file." t)
|
"ediff" "Compare two versions of a file." t)
|
||||||
(autoload 'ediff-directory-revisions
|
(autoload 'ediff-directory-revisions
|
||||||
"ediff" "Compare two versions of a file." t)
|
"ediff" "Compare two versions of a file." t)
|
||||||
|
|
||||||
;; merge directories
|
;; merge directories
|
||||||
|
|
@ -326,9 +326,9 @@
|
||||||
"Merge files in two directories using files in a third dir as ancestors."
|
"Merge files in two directories using files in a third dir as ancestors."
|
||||||
t)
|
t)
|
||||||
|
|
||||||
(autoload 'edir-merge-revisions
|
(autoload 'edir-merge-revisions
|
||||||
"ediff" "Merge versions of files in a directory." t)
|
"ediff" "Merge versions of files in a directory." t)
|
||||||
(autoload 'ediff-merge-directory-revisions
|
(autoload 'ediff-merge-directory-revisions
|
||||||
"ediff" "Merge versions of files in a directory." t)
|
"ediff" "Merge versions of files in a directory." t)
|
||||||
(autoload 'ediff-merge-directory-revisions-with-ancestor
|
(autoload 'ediff-merge-directory-revisions-with-ancestor
|
||||||
"ediff"
|
"ediff"
|
||||||
|
|
@ -364,7 +364,7 @@
|
||||||
"ediff-util"
|
"ediff-util"
|
||||||
"Toggle the use of Ediff toolbar."
|
"Toggle the use of Ediff toolbar."
|
||||||
t)
|
t)
|
||||||
|
|
||||||
) ; if purify-flag
|
) ; if purify-flag
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -740,7 +740,7 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
|
||||||
:group 'ediff)
|
:group 'ediff)
|
||||||
|
|
||||||
(defcustom ediff-coding-system-for-read 'raw-text
|
(defcustom ediff-coding-system-for-read 'raw-text
|
||||||
"*The coding system for read to use when running the diff program as a subprocess.
|
"*The coding system for read to use when running the diff program as a subprocess.
|
||||||
In most cases, the default will do. However, under certain circumstances in
|
In most cases, the default will do. However, under certain circumstances in
|
||||||
Windows NT/98/95 you might need to use something like 'raw-text-dos here.
|
Windows NT/98/95 you might need to use something like 'raw-text-dos here.
|
||||||
So, if the output that your diff program sends to Emacs contains extra ^M's,
|
So, if the output that your diff program sends to Emacs contains extra ^M's,
|
||||||
|
|
@ -811,7 +811,7 @@ to temp files when Ediff needs to find fine differences."
|
||||||
;; A var local to each control panel buffer. Indicates highlighting style
|
;; A var local to each control panel buffer. Indicates highlighting style
|
||||||
;; in effect for this buffer: `face', `ascii',
|
;; in effect for this buffer: `face', `ascii',
|
||||||
;; `off' -- turned off \(on a dumb terminal only\).
|
;; `off' -- turned off \(on a dumb terminal only\).
|
||||||
(ediff-defvar-local ediff-highlighting-style
|
(ediff-defvar-local ediff-highlighting-style
|
||||||
(if (and (ediff-has-face-support-p) ediff-use-faces) 'face 'ascii)
|
(if (and (ediff-has-face-support-p) ediff-use-faces) 'face 'ascii)
|
||||||
"")
|
"")
|
||||||
|
|
||||||
|
|
@ -1549,7 +1549,7 @@ This default should work without changes."
|
||||||
(t nil))))
|
(t nil))))
|
||||||
|
|
||||||
(defsubst ediff-frame-char-height (frame)
|
(defsubst ediff-frame-char-height (frame)
|
||||||
(ediff-cond-compile-for-xemacs-or-emacs
|
(ediff-cond-compile-for-xemacs-or-emacs
|
||||||
(glyph-height ediff-H-glyph (frame-selected-window frame)) ; xemacs case
|
(glyph-height ediff-H-glyph (frame-selected-window frame)) ; xemacs case
|
||||||
(frame-char-height frame) ; emacs case
|
(frame-char-height frame) ; emacs case
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -58,10 +58,10 @@ Valid values are the symbols `default-A', `default-B', and `combined'."
|
||||||
:type '(radio (const default-A) (const default-B) (const combined))
|
:type '(radio (const default-A) (const default-B) (const combined))
|
||||||
:group 'ediff-merge)
|
:group 'ediff-merge)
|
||||||
|
|
||||||
(defcustom ediff-combination-pattern
|
(defcustom ediff-combination-pattern
|
||||||
'("<<<<<<< variant A" A ">>>>>>> variant B" B "####### Ancestor" Ancestor "======= end")
|
'("<<<<<<< variant A" A ">>>>>>> variant B" B "####### Ancestor" Ancestor "======= end")
|
||||||
"*Pattern to be used for combining difference regions in buffers A and B.
|
"*Pattern to be used for combining difference regions in buffers A and B.
|
||||||
The value must be a list of the form
|
The value must be a list of the form
|
||||||
(STRING1 bufspec1 STRING2 bufspec2 STRING3 bufspec3 STRING4)
|
(STRING1 bufspec1 STRING2 bufspec2 STRING3 bufspec3 STRING4)
|
||||||
where bufspec is the symbol A, B, or Ancestor. For instance, if the value is
|
where bufspec is the symbol A, B, or Ancestor. For instance, if the value is
|
||||||
'(STRING1 A STRING2 Ancestor STRING3 B STRING4) then the
|
'(STRING1 A STRING2 Ancestor STRING3 B STRING4) then the
|
||||||
|
|
@ -93,7 +93,7 @@ skipped over. nil means show all regions."
|
||||||
A region is considered to have been changed if it is different from the current
|
A region is considered to have been changed if it is different from the current
|
||||||
default (`default-A', `default-B', `combined') and it hasn't been marked as
|
default (`default-A', `default-B', `combined') and it hasn't been marked as
|
||||||
`prefer-A' or `prefer-B'.
|
`prefer-A' or `prefer-B'.
|
||||||
A region is considered to have been changed also when it is marked as
|
A region is considered to have been changed also when it is marked as
|
||||||
as `prefer-A', but is different from the corresponding difference region in
|
as `prefer-A', but is different from the corresponding difference region in
|
||||||
Buffer A or if it is marked as `prefer-B' and is different from the region in
|
Buffer A or if it is marked as `prefer-B' and is different from the region in
|
||||||
Buffer B."
|
Buffer B."
|
||||||
|
|
@ -111,7 +111,7 @@ Buffer B."
|
||||||
;; If ediff-skip-changed-regions, check if the merge region differs from
|
;; If ediff-skip-changed-regions, check if the merge region differs from
|
||||||
;; the current default. If a region is different from the default, it means
|
;; the current default. If a region is different from the default, it means
|
||||||
;; that the user has made determination as to how to merge for this particular
|
;; that the user has made determination as to how to merge for this particular
|
||||||
;; region.
|
;; region.
|
||||||
(defsubst ediff-skip-merge-region-if-changed-from-default-p (n)
|
(defsubst ediff-skip-merge-region-if-changed-from-default-p (n)
|
||||||
(and ediff-skip-merge-regions-that-differ-from-default
|
(and ediff-skip-merge-regions-that-differ-from-default
|
||||||
(ediff-merge-changed-from-default-p n 'prefers-too)))
|
(ediff-merge-changed-from-default-p n 'prefers-too)))
|
||||||
|
|
@ -137,7 +137,7 @@ Buffer B."
|
||||||
(setq combo-region
|
(setq combo-region
|
||||||
(concat combo-region
|
(concat combo-region
|
||||||
region-delim "\n"
|
region-delim "\n"
|
||||||
(ediff-get-region-contents
|
(ediff-get-region-contents
|
||||||
n region-spec ediff-control-buffer)))
|
n region-spec ediff-control-buffer)))
|
||||||
(error ""))
|
(error ""))
|
||||||
(setq pattern-list (cdr (cdr pattern-list)))
|
(setq pattern-list (cdr (cdr pattern-list)))
|
||||||
|
|
@ -161,7 +161,7 @@ Buffer B."
|
||||||
(while (< n ediff-number-of-differences)
|
(while (< n ediff-number-of-differences)
|
||||||
(ediff-set-state-of-diff-in-all-buffers n ctl-buf)
|
(ediff-set-state-of-diff-in-all-buffers n ctl-buf)
|
||||||
(setq n (1+ n)))))
|
(setq n (1+ n)))))
|
||||||
|
|
||||||
(defun ediff-set-state-of-diff-in-all-buffers (n ctl-buf)
|
(defun ediff-set-state-of-diff-in-all-buffers (n ctl-buf)
|
||||||
(let ((regA (ediff-get-region-contents n 'A ctl-buf))
|
(let ((regA (ediff-get-region-contents n 'A ctl-buf))
|
||||||
(regB (ediff-get-region-contents n 'B ctl-buf))
|
(regB (ediff-get-region-contents n 'B ctl-buf))
|
||||||
|
|
@ -190,12 +190,12 @@ Buffer B."
|
||||||
(ediff-set-state-of-diff n 'B nil)
|
(ediff-set-state-of-diff n 'B nil)
|
||||||
(ediff-set-state-of-diff n 'C nil)))
|
(ediff-set-state-of-diff n 'C nil)))
|
||||||
))
|
))
|
||||||
|
|
||||||
(defun ediff-set-merge-mode ()
|
(defun ediff-set-merge-mode ()
|
||||||
(normal-mode t)
|
(normal-mode t)
|
||||||
(remove-hook 'local-write-file-hooks 'ediff-set-merge-mode))
|
(remove-hook 'local-write-file-hooks 'ediff-set-merge-mode))
|
||||||
|
|
||||||
|
|
||||||
;; Go over all diffs starting with DIFF-NUM and copy regions into buffer C
|
;; Go over all diffs starting with DIFF-NUM and copy regions into buffer C
|
||||||
;; according to the state of the difference.
|
;; according to the state of the difference.
|
||||||
;; Since ediff-copy-diff refuses to copy identical diff regions, there is
|
;; Since ediff-copy-diff refuses to copy identical diff regions, there is
|
||||||
|
|
@ -217,7 +217,7 @@ Buffer B."
|
||||||
(if remerging "Re-merging" "Merging")
|
(if remerging "Re-merging" "Merging")
|
||||||
n
|
n
|
||||||
ediff-number-of-differences))
|
ediff-number-of-differences))
|
||||||
|
|
||||||
(setq state-of-merge (ediff-get-state-of-merge n))
|
(setq state-of-merge (ediff-get-state-of-merge n))
|
||||||
|
|
||||||
(if remerging
|
(if remerging
|
||||||
|
|
@ -225,36 +225,36 @@ Buffer B."
|
||||||
;; (reg-B (ediff-get-region-contents n 'B ediff-control-buffer))
|
;; (reg-B (ediff-get-region-contents n 'B ediff-control-buffer))
|
||||||
;; (reg-C (ediff-get-region-contents n 'C ediff-control-buffer)))
|
;; (reg-C (ediff-get-region-contents n 'C ediff-control-buffer)))
|
||||||
(let ()
|
(let ()
|
||||||
|
|
||||||
;; if region was edited since it was first set by default
|
;; if region was edited since it was first set by default
|
||||||
(if (or (ediff-merge-changed-from-default-p n)
|
(if (or (ediff-merge-changed-from-default-p n)
|
||||||
;; was preferred
|
;; was preferred
|
||||||
(string-match "prefer" state-of-merge))
|
(string-match "prefer" state-of-merge))
|
||||||
;; then ignore
|
;; then ignore
|
||||||
(setq do-not-copy t))
|
(setq do-not-copy t))
|
||||||
|
|
||||||
;; change state of merge for this diff, if necessary
|
;; change state of merge for this diff, if necessary
|
||||||
(if (and (string-match "\\(default\\|combined\\)" state-of-merge)
|
(if (and (string-match "\\(default\\|combined\\)" state-of-merge)
|
||||||
(not do-not-copy))
|
(not do-not-copy))
|
||||||
(ediff-set-state-of-merge
|
(ediff-set-state-of-merge
|
||||||
n (format "%S" ediff-default-variant)))
|
n (format "%S" ediff-default-variant)))
|
||||||
))
|
))
|
||||||
|
|
||||||
;; state-of-merge may have changed via ediff-set-state-of-merge, so
|
;; state-of-merge may have changed via ediff-set-state-of-merge, so
|
||||||
;; check it once again
|
;; check it once again
|
||||||
(setq state-of-merge (ediff-get-state-of-merge n))
|
(setq state-of-merge (ediff-get-state-of-merge n))
|
||||||
|
|
||||||
(or do-not-copy
|
(or do-not-copy
|
||||||
(if (string= state-of-merge "combined")
|
(if (string= state-of-merge "combined")
|
||||||
;; use n+1 because ediff-combine-diffs works via user numbering
|
;; use n+1 because ediff-combine-diffs works via user numbering
|
||||||
;; of diffs, which is 1+ to what ediff uses internally
|
;; of diffs, which is 1+ to what ediff uses internally
|
||||||
(ediff-combine-diffs (1+ n) 'batch)
|
(ediff-combine-diffs (1+ n) 'batch)
|
||||||
(ediff-copy-diff
|
(ediff-copy-diff
|
||||||
n (if (string-match "-A" state-of-merge) 'A 'B) 'C 'batch)))
|
n (if (string-match "-A" state-of-merge) 'A 'B) 'C 'batch)))
|
||||||
(setq n (1+ n)))
|
(setq n (1+ n)))
|
||||||
(message "Merging buffers A & B into C ... Done")
|
(message "Merging buffers A & B into C ... Done")
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
(defun ediff-re-merge ()
|
(defun ediff-re-merge ()
|
||||||
"Remerge unmodified diff regions using a new default. Start with the current region."
|
"Remerge unmodified diff regions using a new default. Start with the current region."
|
||||||
|
|
@ -266,14 +266,14 @@ Buffer B."
|
||||||
default-variant-alist)))
|
default-variant-alist)))
|
||||||
(setq ediff-default-variant
|
(setq ediff-default-variant
|
||||||
(intern
|
(intern
|
||||||
(completing-read
|
(completing-read
|
||||||
(format "Current merge default is `%S'. New default: "
|
(format "Current merge default is `%S'. New default: "
|
||||||
ediff-default-variant)
|
ediff-default-variant)
|
||||||
actual-alist nil 'must-match)))
|
actual-alist nil 'must-match)))
|
||||||
(ediff-do-merge ediff-current-difference 'remerge)
|
(ediff-do-merge ediff-current-difference 'remerge)
|
||||||
(ediff-recenter)
|
(ediff-recenter)
|
||||||
))
|
))
|
||||||
|
|
||||||
(defun ediff-shrink-window-C (arg)
|
(defun ediff-shrink-window-C (arg)
|
||||||
"Shrink window C to just one line.
|
"Shrink window C to just one line.
|
||||||
With a prefix argument, returns window C to its normal size.
|
With a prefix argument, returns window C to its normal size.
|
||||||
|
|
@ -307,16 +307,16 @@ Combining is done according to the specifications in variable
|
||||||
`ediff-combination-pattern'."
|
`ediff-combination-pattern'."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(setq n (if (numberp n) (1- n) ediff-current-difference))
|
(setq n (if (numberp n) (1- n) ediff-current-difference))
|
||||||
|
|
||||||
(let (reg-combined)
|
(let (reg-combined)
|
||||||
;;(setq regA (ediff-get-region-contents n 'A ediff-control-buffer)
|
;;(setq regA (ediff-get-region-contents n 'A ediff-control-buffer)
|
||||||
;; regB (ediff-get-region-contents n 'B ediff-control-buffer))
|
;; regB (ediff-get-region-contents n 'B ediff-control-buffer))
|
||||||
;;(setq reg-combined (ediff-make-combined-diff regA regB))
|
;;(setq reg-combined (ediff-make-combined-diff regA regB))
|
||||||
(setq reg-combined (ediff-get-combined-region n))
|
(setq reg-combined (ediff-get-combined-region n))
|
||||||
|
|
||||||
(ediff-copy-diff n nil 'C batch-invocation reg-combined))
|
(ediff-copy-diff n nil 'C batch-invocation reg-combined))
|
||||||
(or batch-invocation (ediff-jump-to-difference (1+ n))))
|
(or batch-invocation (ediff-jump-to-difference (1+ n))))
|
||||||
|
|
||||||
|
|
||||||
;; Checks if the region in buff C looks like a combination of the regions
|
;; Checks if the region in buff C looks like a combination of the regions
|
||||||
;; in buffers A and B. Return a list (reg-a-beg reg-a-end reg-b-beg reg-b-end)
|
;; in buffers A and B. Return a list (reg-a-beg reg-a-end reg-b-beg reg-b-end)
|
||||||
|
|
@ -331,7 +331,7 @@ Combining is done according to the specifications in variable
|
||||||
(mrgreg-end (ediff-get-diff-posn 'C 'end region-num))
|
(mrgreg-end (ediff-get-diff-posn 'C 'end region-num))
|
||||||
(pattern-list ediff-combination-pattern)
|
(pattern-list ediff-combination-pattern)
|
||||||
delim reg-beg reg-end delim-regs-list)
|
delim reg-beg reg-end delim-regs-list)
|
||||||
|
|
||||||
(if combined
|
(if combined
|
||||||
(ediff-with-current-buffer ediff-buffer-C
|
(ediff-with-current-buffer ediff-buffer-C
|
||||||
(while pattern-list
|
(while pattern-list
|
||||||
|
|
@ -364,7 +364,7 @@ Combining is done according to the specifications in variable
|
||||||
(reg-C (ediff-get-region-contents diff-num 'C ediff-control-buffer)))
|
(reg-C (ediff-get-region-contents diff-num 'C ediff-control-buffer)))
|
||||||
|
|
||||||
(setq state-of-merge (ediff-get-state-of-merge diff-num))
|
(setq state-of-merge (ediff-get-state-of-merge diff-num))
|
||||||
|
|
||||||
;; if region was edited since it was first set by default
|
;; if region was edited since it was first set by default
|
||||||
(or (and (string= state-of-merge "default-A")
|
(or (and (string= state-of-merge "default-A")
|
||||||
(not (string= reg-A reg-C)))
|
(not (string= reg-A reg-C)))
|
||||||
|
|
@ -380,7 +380,7 @@ Combining is done according to the specifications in variable
|
||||||
(string= state-of-merge "prefer-B")
|
(string= state-of-merge "prefer-B")
|
||||||
(not (string= reg-B reg-C)))
|
(not (string= reg-B reg-C)))
|
||||||
)))
|
)))
|
||||||
|
|
||||||
|
|
||||||
;;; Local Variables:
|
;;; Local Variables:
|
||||||
;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
|
;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(provide 'ediff-ptch)
|
(provide 'ediff-ptch)
|
||||||
|
|
||||||
(defgroup ediff-ptch nil
|
(defgroup ediff-ptch nil
|
||||||
|
|
@ -76,7 +76,7 @@ case the default value for this variable should be changed."
|
||||||
(defconst ediff-default-backup-extension
|
(defconst ediff-default-backup-extension
|
||||||
(if (memq system-type '(vax-vms axp-vms emx ms-dos))
|
(if (memq system-type '(vax-vms axp-vms emx ms-dos))
|
||||||
"_orig" ".orig"))
|
"_orig" ".orig"))
|
||||||
|
|
||||||
|
|
||||||
(defcustom ediff-backup-extension ediff-default-backup-extension
|
(defcustom ediff-backup-extension ediff-default-backup-extension
|
||||||
"Backup extension used by the patch program.
|
"Backup extension used by the patch program.
|
||||||
|
|
@ -94,7 +94,7 @@ See also `ediff-backup-specs'."
|
||||||
(t 'traditional))
|
(t 'traditional))
|
||||||
(file-error nil)))
|
(file-error nil)))
|
||||||
|
|
||||||
(defcustom ediff-backup-specs
|
(defcustom ediff-backup-specs
|
||||||
(let ((type (ediff-test-patch-utility)))
|
(let ((type (ediff-test-patch-utility)))
|
||||||
(cond ((eq type 'gnu)
|
(cond ((eq type 'gnu)
|
||||||
;; GNU `patch' v. >= 2.2
|
;; GNU `patch' v. >= 2.2
|
||||||
|
|
@ -184,10 +184,10 @@ program."
|
||||||
(setq count (1+ count)))))
|
(setq count (1+ count)))))
|
||||||
count)))
|
count)))
|
||||||
|
|
||||||
;; Scan BUF (which is supposed to contain a patch) and make a list of the form
|
;; Scan BUF (which is supposed to contain a patch) and make a list of the form
|
||||||
;; ((nil nil filename-spec1 marker1 marker2)
|
;; ((nil nil filename-spec1 marker1 marker2)
|
||||||
;; (nil nil filename-spec2 marker1 marker2) ...)
|
;; (nil nil filename-spec2 marker1 marker2) ...)
|
||||||
;; where filename-spec[12] are files to which the `patch' program would
|
;; where filename-spec[12] are files to which the `patch' program would
|
||||||
;; have applied the patch.
|
;; have applied the patch.
|
||||||
;; nin, nil are placeholders. See ediff-make-new-meta-list-element in
|
;; nin, nil are placeholders. See ediff-make-new-meta-list-element in
|
||||||
;; ediff-meta.el for the explanations.
|
;; ediff-meta.el for the explanations.
|
||||||
|
|
@ -240,7 +240,7 @@ program."
|
||||||
(move-marker mark2 (match-beginning 0)))
|
(move-marker mark2 (match-beginning 0)))
|
||||||
|
|
||||||
(goto-char mark2-end)
|
(goto-char mark2-end)
|
||||||
|
|
||||||
(if filenames
|
(if filenames
|
||||||
(setq patch-map
|
(setq patch-map
|
||||||
(cons (ediff-make-new-meta-list-element
|
(cons (ediff-make-new-meta-list-element
|
||||||
|
|
@ -274,7 +274,7 @@ program."
|
||||||
;; directory part of filename
|
;; directory part of filename
|
||||||
(file-name-as-directory filename)
|
(file-name-as-directory filename)
|
||||||
(file-name-directory filename)))
|
(file-name-directory filename)))
|
||||||
;; Filename-spec is objA; at this point it is represented as
|
;; Filename-spec is objA; at this point it is represented as
|
||||||
;; (file1 . file2). We get it using ediff-get-session-objA
|
;; (file1 . file2). We get it using ediff-get-session-objA
|
||||||
;; directory part of the first file in the patch
|
;; directory part of the first file in the patch
|
||||||
(base-dir1 (file-name-directory
|
(base-dir1 (file-name-directory
|
||||||
|
|
@ -349,10 +349,10 @@ other files, enter /dev/null
|
||||||
(setcar (ediff-get-session-objA session-info)
|
(setcar (ediff-get-session-objA session-info)
|
||||||
(cons user-file user-file))))
|
(cons user-file user-file))))
|
||||||
(setcar proposed-file-names
|
(setcar proposed-file-names
|
||||||
(expand-file-name
|
(expand-file-name
|
||||||
(concat actual-dir (car proposed-file-names))))
|
(concat actual-dir (car proposed-file-names))))
|
||||||
(setcdr proposed-file-names
|
(setcdr proposed-file-names
|
||||||
(expand-file-name
|
(expand-file-name
|
||||||
(concat actual-dir (cdr proposed-file-names)))))
|
(concat actual-dir (cdr proposed-file-names)))))
|
||||||
))
|
))
|
||||||
ediff-patch-map)
|
ediff-patch-map)
|
||||||
|
|
@ -418,7 +418,7 @@ are two possible targets for this patch. However, these files do not exist."
|
||||||
(let ((directory t)
|
(let ((directory t)
|
||||||
target)
|
target)
|
||||||
(while directory
|
(while directory
|
||||||
(setq target (read-file-name
|
(setq target (read-file-name
|
||||||
"Please enter a patch target: "
|
"Please enter a patch target: "
|
||||||
actual-dir actual-dir t))
|
actual-dir actual-dir t))
|
||||||
(if (not (file-directory-p target))
|
(if (not (file-directory-p target))
|
||||||
|
|
@ -502,7 +502,7 @@ optional argument, then use it."
|
||||||
(if (y-or-n-p "Is the patch already in a buffer? ")
|
(if (y-or-n-p "Is the patch already in a buffer? ")
|
||||||
(ediff-prompt-for-patch-buffer)
|
(ediff-prompt-for-patch-buffer)
|
||||||
(ediff-prompt-for-patch-file)))))
|
(ediff-prompt-for-patch-file)))))
|
||||||
|
|
||||||
(ediff-with-current-buffer patch-buf
|
(ediff-with-current-buffer patch-buf
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(or (ediff-get-visible-buffer-window patch-buf)
|
(or (ediff-get-visible-buffer-window patch-buf)
|
||||||
|
|
@ -529,7 +529,7 @@ optional argument, then use it."
|
||||||
"^/dev/null"
|
"^/dev/null"
|
||||||
;; this is the file to patch
|
;; this is the file to patch
|
||||||
(ediff-get-session-objA-name (car ediff-patch-map))))
|
(ediff-get-session-objA-name (car ediff-patch-map))))
|
||||||
(> (length
|
(> (length
|
||||||
(ediff-get-session-objA-name (car ediff-patch-map)))
|
(ediff-get-session-objA-name (car ediff-patch-map)))
|
||||||
1))
|
1))
|
||||||
(ediff-get-session-objA-name (car ediff-patch-map))
|
(ediff-get-session-objA-name (car ediff-patch-map))
|
||||||
|
|
@ -571,11 +571,11 @@ optional argument, then use it."
|
||||||
(set-visited-file-modtime) ; sync buffer and temp file
|
(set-visited-file-modtime) ; sync buffer and temp file
|
||||||
(setq default-directory default-dir)
|
(setq default-directory default-dir)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; dispatch a patch function
|
;; dispatch a patch function
|
||||||
(setq ctl-buf (ediff-dispatch-file-patching-job
|
(setq ctl-buf (ediff-dispatch-file-patching-job
|
||||||
patch-buf file-name startup-hooks))
|
patch-buf file-name startup-hooks))
|
||||||
|
|
||||||
(ediff-with-current-buffer ctl-buf
|
(ediff-with-current-buffer ctl-buf
|
||||||
(delete-file (buffer-file-name ediff-buffer-A))
|
(delete-file (buffer-file-name ediff-buffer-A))
|
||||||
(delete-file (buffer-file-name ediff-buffer-B))
|
(delete-file (buffer-file-name ediff-buffer-B))
|
||||||
|
|
@ -588,7 +588,7 @@ optional argument, then use it."
|
||||||
(setq buffer-auto-save-file-name nil) ; don't create auto-save file
|
(setq buffer-auto-save-file-name nil) ; don't create auto-save file
|
||||||
(if default-dir (setq default-directory default-dir))
|
(if default-dir (setq default-directory default-dir))
|
||||||
(set-visited-file-name nil)
|
(set-visited-file-name nil)
|
||||||
(rename-buffer (ediff-unique-buffer-name
|
(rename-buffer (ediff-unique-buffer-name
|
||||||
(concat buf-to-patch-name "_patched") ""))
|
(concat buf-to-patch-name "_patched") ""))
|
||||||
(set-buffer-modified-p t)))
|
(set-buffer-modified-p t)))
|
||||||
))
|
))
|
||||||
|
|
@ -607,7 +607,7 @@ optional argument, then use it."
|
||||||
(defun ediff-patch-file-internal (patch-buf source-filename
|
(defun ediff-patch-file-internal (patch-buf source-filename
|
||||||
&optional startup-hooks)
|
&optional startup-hooks)
|
||||||
(setq source-filename (expand-file-name source-filename))
|
(setq source-filename (expand-file-name source-filename))
|
||||||
|
|
||||||
(let* ((shell-file-name ediff-shell)
|
(let* ((shell-file-name ediff-shell)
|
||||||
(patch-diagnostics (get-buffer-create "*ediff patch diagnostics*"))
|
(patch-diagnostics (get-buffer-create "*ediff patch diagnostics*"))
|
||||||
;; ediff-find-file may use a temp file to do the patch
|
;; ediff-find-file may use a temp file to do the patch
|
||||||
|
|
@ -618,15 +618,15 @@ optional argument, then use it."
|
||||||
(target-filename source-filename)
|
(target-filename source-filename)
|
||||||
;; this ensures that the patch process gets patch buffer in the
|
;; this ensures that the patch process gets patch buffer in the
|
||||||
;; encoding that Emacs thinks is right for that type of text
|
;; encoding that Emacs thinks is right for that type of text
|
||||||
(coding-system-for-write
|
(coding-system-for-write
|
||||||
(if (boundp 'buffer-file-coding-system) buffer-file-coding-system))
|
(if (boundp 'buffer-file-coding-system) buffer-file-coding-system))
|
||||||
target-buf buf-to-patch file-name-magic-p
|
target-buf buf-to-patch file-name-magic-p
|
||||||
patch-return-code ctl-buf backup-style aux-wind)
|
patch-return-code ctl-buf backup-style aux-wind)
|
||||||
|
|
||||||
(if (string-match "V" ediff-patch-options)
|
(if (string-match "V" ediff-patch-options)
|
||||||
(error
|
(error
|
||||||
"Ediff doesn't take the -V option in `ediff-patch-options'--sorry"))
|
"Ediff doesn't take the -V option in `ediff-patch-options'--sorry"))
|
||||||
|
|
||||||
;; Make a temp file, if source-filename has a magic file handler (or if
|
;; Make a temp file, if source-filename has a magic file handler (or if
|
||||||
;; it is handled via auto-mode-alist and similar magic).
|
;; it is handled via auto-mode-alist and similar magic).
|
||||||
;; Check if there is a buffer visiting source-filename and if they are in
|
;; Check if there is a buffer visiting source-filename and if they are in
|
||||||
|
|
@ -640,8 +640,8 @@ optional argument, then use it."
|
||||||
;; temporary file where we put the after-product of the file handler.
|
;; temporary file where we put the after-product of the file handler.
|
||||||
(setq file-name-magic-p (not (equal (file-truename true-source-filename)
|
(setq file-name-magic-p (not (equal (file-truename true-source-filename)
|
||||||
(file-truename source-filename))))
|
(file-truename source-filename))))
|
||||||
|
|
||||||
;; Checkout orig file, if necessary, so that the patched file
|
;; Checkout orig file, if necessary, so that the patched file
|
||||||
;; could be checked back in.
|
;; could be checked back in.
|
||||||
(ediff-maybe-checkout buf-to-patch)
|
(ediff-maybe-checkout buf-to-patch)
|
||||||
|
|
||||||
|
|
@ -674,7 +674,7 @@ optional argument, then use it."
|
||||||
|
|
||||||
(switch-to-buffer patch-diagnostics)
|
(switch-to-buffer patch-diagnostics)
|
||||||
(sit-for 0) ; synchronize - let the user see diagnostics
|
(sit-for 0) ; synchronize - let the user see diagnostics
|
||||||
|
|
||||||
(or (and (ediff-patch-return-code-ok patch-return-code)
|
(or (and (ediff-patch-return-code-ok patch-return-code)
|
||||||
(file-exists-p
|
(file-exists-p
|
||||||
(concat true-source-filename ediff-backup-extension)))
|
(concat true-source-filename ediff-backup-extension)))
|
||||||
|
|
@ -682,7 +682,7 @@ optional argument, then use it."
|
||||||
(with-output-to-temp-buffer ediff-msg-buffer
|
(with-output-to-temp-buffer ediff-msg-buffer
|
||||||
(ediff-with-current-buffer standard-output
|
(ediff-with-current-buffer standard-output
|
||||||
(fundamental-mode))
|
(fundamental-mode))
|
||||||
(princ (format
|
(princ (format
|
||||||
"Patch program has failed due to a bad patch file,
|
"Patch program has failed due to a bad patch file,
|
||||||
it couldn't apply all hunks, OR
|
it couldn't apply all hunks, OR
|
||||||
it couldn't create the backup for the file being patched.
|
it couldn't create the backup for the file being patched.
|
||||||
|
|
@ -695,7 +695,7 @@ The second problem might be due to an incompatibility among these settings:
|
||||||
ediff-backup-extension = %S ediff-backup-specs = %S
|
ediff-backup-extension = %S ediff-backup-specs = %S
|
||||||
|
|
||||||
See Ediff on-line manual for more details on these variables.
|
See Ediff on-line manual for more details on these variables.
|
||||||
In particular, check the documentation for `ediff-backup-specs'.
|
In particular, check the documentation for `ediff-backup-specs'.
|
||||||
|
|
||||||
In any of the above cases, Ediff doesn't compare files automatically.
|
In any of the above cases, Ediff doesn't compare files automatically.
|
||||||
However, if the patch was applied partially and the backup file was created,
|
However, if the patch was applied partially and the backup file was created,
|
||||||
|
|
@ -713,7 +713,7 @@ you can still examine the changes via M-x ediff-files"
|
||||||
(goto-char (point-max))))
|
(goto-char (point-max))))
|
||||||
(switch-to-buffer-other-window patch-diagnostics)
|
(switch-to-buffer-other-window patch-diagnostics)
|
||||||
(error "Patch appears to have failed")))
|
(error "Patch appears to have failed")))
|
||||||
|
|
||||||
;; If black magic is involved, apply patch to a temp copy of the
|
;; If black magic is involved, apply patch to a temp copy of the
|
||||||
;; file. Otherwise, apply patch to the orig copy. If patch is applied
|
;; file. Otherwise, apply patch to the orig copy. If patch is applied
|
||||||
;; to temp copy, we name the result old-name_patched for local files
|
;; to temp copy, we name the result old-name_patched for local files
|
||||||
|
|
@ -727,7 +727,7 @@ you can still examine the changes via M-x ediff-files"
|
||||||
(set-visited-file-name
|
(set-visited-file-name
|
||||||
(concat source-filename ediff-backup-extension))
|
(concat source-filename ediff-backup-extension))
|
||||||
(set-buffer-modified-p nil))
|
(set-buffer-modified-p nil))
|
||||||
|
|
||||||
;; Black magic in effect.
|
;; Black magic in effect.
|
||||||
;; If orig file was remote, put the patched file in the temp directory.
|
;; If orig file was remote, put the patched file in the temp directory.
|
||||||
;; If orig file is local, put the patched file in the directory of
|
;; If orig file is local, put the patched file in the directory of
|
||||||
|
|
@ -738,20 +738,20 @@ you can still examine the changes via M-x ediff-files"
|
||||||
true-source-filename
|
true-source-filename
|
||||||
source-filename)
|
source-filename)
|
||||||
"_patched"))
|
"_patched"))
|
||||||
|
|
||||||
(rename-file true-source-filename target-filename t)
|
(rename-file true-source-filename target-filename t)
|
||||||
|
|
||||||
;; arrange that the temp copy of orig will be deleted
|
;; arrange that the temp copy of orig will be deleted
|
||||||
(rename-file (concat true-source-filename ediff-backup-extension)
|
(rename-file (concat true-source-filename ediff-backup-extension)
|
||||||
true-source-filename t))
|
true-source-filename t))
|
||||||
|
|
||||||
;; make orig buffer read-only
|
;; make orig buffer read-only
|
||||||
(setq startup-hooks
|
(setq startup-hooks
|
||||||
(cons 'ediff-set-read-only-in-buf-A startup-hooks))
|
(cons 'ediff-set-read-only-in-buf-A startup-hooks))
|
||||||
|
|
||||||
;; set up a buf for the patched file
|
;; set up a buf for the patched file
|
||||||
(setq target-buf (find-file-noselect target-filename))
|
(setq target-buf (find-file-noselect target-filename))
|
||||||
|
|
||||||
(setq ctl-buf
|
(setq ctl-buf
|
||||||
(ediff-buffers-internal
|
(ediff-buffers-internal
|
||||||
buf-to-patch target-buf nil
|
buf-to-patch target-buf nil
|
||||||
|
|
@ -759,7 +759,7 @@ you can still examine the changes via M-x ediff-files"
|
||||||
(ediff-with-current-buffer ctl-buf
|
(ediff-with-current-buffer ctl-buf
|
||||||
(setq ediff-patchbufer patch-buf
|
(setq ediff-patchbufer patch-buf
|
||||||
ediff-patch-diagnostics patch-diagnostics))
|
ediff-patch-diagnostics patch-diagnostics))
|
||||||
|
|
||||||
(bury-buffer patch-diagnostics)
|
(bury-buffer patch-diagnostics)
|
||||||
(message "Type `P', if you need to see patch diagnostics")
|
(message "Type `P', if you need to see patch diagnostics")
|
||||||
ctl-buf))
|
ctl-buf))
|
||||||
|
|
@ -775,7 +775,7 @@ you can still examine the changes via M-x ediff-files"
|
||||||
'ediff-patch-file-form-meta
|
'ediff-patch-file-form-meta
|
||||||
ediff-meta-patchbufer patch-buf) )
|
ediff-meta-patchbufer patch-buf) )
|
||||||
startup-hooks))
|
startup-hooks))
|
||||||
(setq meta-buf (ediff-prepare-meta-buffer
|
(setq meta-buf (ediff-prepare-meta-buffer
|
||||||
'ediff-filegroup-action
|
'ediff-filegroup-action
|
||||||
(ediff-with-current-buffer patch-buf
|
(ediff-with-current-buffer patch-buf
|
||||||
(cons (ediff-make-new-meta-list-header
|
(cons (ediff-make-new-meta-list-header
|
||||||
|
|
@ -793,8 +793,8 @@ you can still examine the changes via M-x ediff-files"
|
||||||
(ediff-show-meta-buffer meta-buf)
|
(ediff-show-meta-buffer meta-buf)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Local Variables:
|
;;; Local Variables:
|
||||||
;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
|
;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -50,7 +50,7 @@
|
||||||
(load "ediff-init.el" nil nil 'nosuffix))
|
(load "ediff-init.el" nil nil 'nosuffix))
|
||||||
)))
|
)))
|
||||||
;; end pacifier
|
;; end pacifier
|
||||||
|
|
||||||
;; VC.el support
|
;; VC.el support
|
||||||
|
|
||||||
(defun ediff-vc-latest-version (file)
|
(defun ediff-vc-latest-version (file)
|
||||||
|
|
@ -72,7 +72,7 @@
|
||||||
;; If the current buffer is named `F', the version is named `F.~REV~'.
|
;; If the current buffer is named `F', the version is named `F.~REV~'.
|
||||||
;; If `F.~REV~' already exists, it is used instead of being re-created.
|
;; If `F.~REV~' already exists, it is used instead of being re-created.
|
||||||
(let (file1 file2 rev1buf rev2buf)
|
(let (file1 file2 rev1buf rev2buf)
|
||||||
(if (string= rev1 "")
|
(if (string= rev1 "")
|
||||||
(setq rev1 (ediff-vc-latest-version (buffer-file-name))))
|
(setq rev1 (ediff-vc-latest-version (buffer-file-name))))
|
||||||
(save-window-excursion
|
(save-window-excursion
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
|
@ -93,12 +93,12 @@
|
||||||
rev1buf rev2buf
|
rev1buf rev2buf
|
||||||
startup-hooks
|
startup-hooks
|
||||||
'ediff-revision)))
|
'ediff-revision)))
|
||||||
|
|
||||||
;; RCS.el support
|
;; RCS.el support
|
||||||
(defun rcs-ediff-view-revision (&optional rev)
|
(defun rcs-ediff-view-revision (&optional rev)
|
||||||
;; View previous RCS revision of current file.
|
;; View previous RCS revision of current file.
|
||||||
;; With prefix argument, prompts for a revision name.
|
;; With prefix argument, prompts for a revision name.
|
||||||
(interactive (list (if current-prefix-arg
|
(interactive (list (if current-prefix-arg
|
||||||
(read-string "Revision: "))))
|
(read-string "Revision: "))))
|
||||||
(let* ((filename (buffer-file-name (current-buffer)))
|
(let* ((filename (buffer-file-name (current-buffer)))
|
||||||
(switches (append '("-p")
|
(switches (append '("-p")
|
||||||
|
|
@ -116,10 +116,10 @@
|
||||||
(apply 'call-process "co" nil t nil
|
(apply 'call-process "co" nil t nil
|
||||||
;; -q: quiet (no diagnostics)
|
;; -q: quiet (no diagnostics)
|
||||||
(append switches rcs-default-co-switches
|
(append switches rcs-default-co-switches
|
||||||
(list "-q" filename)))))
|
(list "-q" filename)))))
|
||||||
(message "")
|
(message "")
|
||||||
buff)))
|
buff)))
|
||||||
|
|
||||||
(defun ediff-rcs-get-output-buffer (file name)
|
(defun ediff-rcs-get-output-buffer (file name)
|
||||||
;; Get a buffer for RCS output for FILE, make it writable and clean it up.
|
;; Get a buffer for RCS output for FILE, make it writable and clean it up.
|
||||||
;; Optional NAME is name to use instead of `*RCS-output*'.
|
;; Optional NAME is name to use instead of `*RCS-output*'.
|
||||||
|
|
@ -143,7 +143,7 @@
|
||||||
(current-buffer)
|
(current-buffer)
|
||||||
(rcs-ediff-view-revision rev2))
|
(rcs-ediff-view-revision rev2))
|
||||||
rev1buf (rcs-ediff-view-revision rev1)))
|
rev1buf (rcs-ediff-view-revision rev1)))
|
||||||
|
|
||||||
;; rcs.el doesn't create temp version files, so we don't have to delete
|
;; rcs.el doesn't create temp version files, so we don't have to delete
|
||||||
;; anything in startup hooks to ediff-buffers
|
;; anything in startup hooks to ediff-buffers
|
||||||
(ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision)
|
(ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision)
|
||||||
|
|
@ -177,7 +177,7 @@
|
||||||
|
|
||||||
;;; Merge with Version Control
|
;;; Merge with Version Control
|
||||||
|
|
||||||
(defun ediff-vc-merge-internal (rev1 rev2 ancestor-rev
|
(defun ediff-vc-merge-internal (rev1 rev2 ancestor-rev
|
||||||
&optional startup-hooks merge-buffer-file)
|
&optional startup-hooks merge-buffer-file)
|
||||||
;; If ANCESTOR-REV non-nil, merge with ancestor
|
;; If ANCESTOR-REV non-nil, merge with ancestor
|
||||||
(let (buf1 buf2 ancestor-buf)
|
(let (buf1 buf2 ancestor-buf)
|
||||||
|
|
@ -195,9 +195,9 @@
|
||||||
(setq ancestor-rev (vc-workfile-version buffer-file-name)))
|
(setq ancestor-rev (vc-workfile-version buffer-file-name)))
|
||||||
(vc-version-other-window ancestor-rev)
|
(vc-version-other-window ancestor-rev)
|
||||||
(setq ancestor-buf (current-buffer))))
|
(setq ancestor-buf (current-buffer))))
|
||||||
(setq startup-hooks
|
(setq startup-hooks
|
||||||
(cons
|
(cons
|
||||||
`(lambda ()
|
`(lambda ()
|
||||||
(delete-file ,(buffer-file-name buf1))
|
(delete-file ,(buffer-file-name buf1))
|
||||||
(or ,(string= rev2 "")
|
(or ,(string= rev2 "")
|
||||||
(delete-file ,(buffer-file-name buf2)))
|
(delete-file ,(buffer-file-name buf2)))
|
||||||
|
|
@ -278,11 +278,11 @@
|
||||||
(default-directory
|
(default-directory
|
||||||
(file-name-as-directory (cvs-fileinfo->dir fileinfo)))
|
(file-name-as-directory (cvs-fileinfo->dir fileinfo)))
|
||||||
ancestor-file)
|
ancestor-file)
|
||||||
|
|
||||||
(or (memq type '(MERGED CONFLICT MODIFIED))
|
(or (memq type '(MERGED CONFLICT MODIFIED))
|
||||||
(error
|
(error
|
||||||
"Can only merge `Modified', `Merged' or `Conflict' files"))
|
"Can only merge `Modified', `Merged' or `Conflict' files"))
|
||||||
|
|
||||||
(cond ((memq type '(MERGED CONFLICT))
|
(cond ((memq type '(MERGED CONFLICT))
|
||||||
(setq ancestor-file
|
(setq ancestor-file
|
||||||
(cvs-retrieve-revision-to-tmpfile
|
(cvs-retrieve-revision-to-tmpfile
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(provide 'ediff-wind)
|
(provide 'ediff-wind)
|
||||||
|
|
||||||
;; Compiler pacifier
|
;; Compiler pacifier
|
||||||
|
|
@ -281,7 +281,7 @@ into icons, regardless of the window manager."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
;; Select the lowest window on the frame.
|
;; Select the lowest window on the frame.
|
||||||
(defun ediff-select-lowest-window ()
|
(defun ediff-select-lowest-window ()
|
||||||
|
|
@ -301,7 +301,7 @@ into icons, regardless of the window manager."
|
||||||
(progn
|
(progn
|
||||||
(setq bottom-edge next-bottom-edge)
|
(setq bottom-edge next-bottom-edge)
|
||||||
(setq lowest-window this-window)))
|
(setq lowest-window this-window)))
|
||||||
|
|
||||||
(select-window this-window)
|
(select-window this-window)
|
||||||
(if (eq last-window this-window)
|
(if (eq last-window this-window)
|
||||||
(progn
|
(progn
|
||||||
|
|
@ -322,11 +322,11 @@ into icons, regardless of the window manager."
|
||||||
(run-hooks 'ediff-before-setup-windows-hook)
|
(run-hooks 'ediff-before-setup-windows-hook)
|
||||||
(if (eq (selected-window) (minibuffer-window))
|
(if (eq (selected-window) (minibuffer-window))
|
||||||
(other-window 1))
|
(other-window 1))
|
||||||
|
|
||||||
;; in case user did a no-no on a tty
|
;; in case user did a no-no on a tty
|
||||||
(or (ediff-window-display-p)
|
(or (ediff-window-display-p)
|
||||||
(setq ediff-window-setup-function 'ediff-setup-windows-plain))
|
(setq ediff-window-setup-function 'ediff-setup-windows-plain))
|
||||||
|
|
||||||
(or (ediff-keep-window-config control-buffer)
|
(or (ediff-keep-window-config control-buffer)
|
||||||
(funcall
|
(funcall
|
||||||
(ediff-with-current-buffer control-buffer ediff-window-setup-function)
|
(ediff-with-current-buffer control-buffer ediff-window-setup-function)
|
||||||
|
|
@ -344,7 +344,7 @@ into icons, regardless of the window manager."
|
||||||
buffer-A buffer-B buffer-C control-buffer)
|
buffer-A buffer-B buffer-C control-buffer)
|
||||||
(ediff-setup-windows-plain-compare
|
(ediff-setup-windows-plain-compare
|
||||||
buffer-A buffer-B buffer-C control-buffer)))
|
buffer-A buffer-B buffer-C control-buffer)))
|
||||||
|
|
||||||
(defun ediff-setup-windows-plain-merge (buf-A buf-B buf-C control-buffer)
|
(defun ediff-setup-windows-plain-merge (buf-A buf-B buf-C control-buffer)
|
||||||
;; skip dedicated and unsplittable frames
|
;; skip dedicated and unsplittable frames
|
||||||
(ediff-destroy-control-frame control-buffer)
|
(ediff-destroy-control-frame control-buffer)
|
||||||
|
|
@ -360,43 +360,43 @@ into icons, regardless of the window manager."
|
||||||
(split-window-vertically)
|
(split-window-vertically)
|
||||||
(ediff-select-lowest-window)
|
(ediff-select-lowest-window)
|
||||||
(ediff-setup-control-buffer control-buffer)
|
(ediff-setup-control-buffer control-buffer)
|
||||||
|
|
||||||
;; go to the upper window and split it betw A, B, and possibly C
|
;; go to the upper window and split it betw A, B, and possibly C
|
||||||
(other-window 1)
|
(other-window 1)
|
||||||
(setq merge-window-lines
|
(setq merge-window-lines
|
||||||
(max 2 (round (* (window-height) merge-window-share))))
|
(max 2 (round (* (window-height) merge-window-share))))
|
||||||
(switch-to-buffer buf-A)
|
(switch-to-buffer buf-A)
|
||||||
(setq wind-A (selected-window))
|
(setq wind-A (selected-window))
|
||||||
|
|
||||||
;; XEmacs used to have a lot of trouble with display
|
;; XEmacs used to have a lot of trouble with display
|
||||||
;; It did't set things right unless we tell it to sit still
|
;; It did't set things right unless we tell it to sit still
|
||||||
;; 19.12 seems ok.
|
;; 19.12 seems ok.
|
||||||
;;(if ediff-xemacs-p (sit-for 0))
|
;;(if ediff-xemacs-p (sit-for 0))
|
||||||
|
|
||||||
(split-window-vertically (max 2 (- (window-height) merge-window-lines)))
|
(split-window-vertically (max 2 (- (window-height) merge-window-lines)))
|
||||||
(if (eq (selected-window) wind-A)
|
(if (eq (selected-window) wind-A)
|
||||||
(other-window 1))
|
(other-window 1))
|
||||||
(setq wind-C (selected-window))
|
(setq wind-C (selected-window))
|
||||||
(switch-to-buffer buf-C)
|
(switch-to-buffer buf-C)
|
||||||
|
|
||||||
(select-window wind-A)
|
(select-window wind-A)
|
||||||
(funcall split-window-function)
|
(funcall split-window-function)
|
||||||
|
|
||||||
(if (eq (selected-window) wind-A)
|
(if (eq (selected-window) wind-A)
|
||||||
(other-window 1))
|
(other-window 1))
|
||||||
(switch-to-buffer buf-B)
|
(switch-to-buffer buf-B)
|
||||||
(setq wind-B (selected-window))
|
(setq wind-B (selected-window))
|
||||||
|
|
||||||
(ediff-with-current-buffer control-buffer
|
(ediff-with-current-buffer control-buffer
|
||||||
(setq ediff-window-A wind-A
|
(setq ediff-window-A wind-A
|
||||||
ediff-window-B wind-B
|
ediff-window-B wind-B
|
||||||
ediff-window-C wind-C))
|
ediff-window-C wind-C))
|
||||||
|
|
||||||
(ediff-select-lowest-window)
|
(ediff-select-lowest-window)
|
||||||
(ediff-setup-control-buffer control-buffer)
|
(ediff-setup-control-buffer control-buffer)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
;; This function handles all comparison jobs, including 3way jobs
|
;; This function handles all comparison jobs, including 3way jobs
|
||||||
(defun ediff-setup-windows-plain-compare (buf-A buf-B buf-C control-buffer)
|
(defun ediff-setup-windows-plain-compare (buf-A buf-B buf-C control-buffer)
|
||||||
;; skip dedicated and unsplittable frames
|
;; skip dedicated and unsplittable frames
|
||||||
|
|
@ -419,7 +419,7 @@ into icons, regardless of the window manager."
|
||||||
(split-window-vertically)
|
(split-window-vertically)
|
||||||
(ediff-select-lowest-window)
|
(ediff-select-lowest-window)
|
||||||
(ediff-setup-control-buffer control-buffer)
|
(ediff-setup-control-buffer control-buffer)
|
||||||
|
|
||||||
;; go to the upper window and split it betw A, B, and possibly C
|
;; go to the upper window and split it betw A, B, and possibly C
|
||||||
(other-window 1)
|
(other-window 1)
|
||||||
(switch-to-buffer buf-A)
|
(switch-to-buffer buf-A)
|
||||||
|
|
@ -430,19 +430,19 @@ into icons, regardless of the window manager."
|
||||||
(window-height wind-A)
|
(window-height wind-A)
|
||||||
(window-width wind-A))
|
(window-width wind-A))
|
||||||
3)))
|
3)))
|
||||||
|
|
||||||
;; XEmacs used to have a lot of trouble with display
|
;; XEmacs used to have a lot of trouble with display
|
||||||
;; It did't set things right unless we told it to sit still
|
;; It did't set things right unless we told it to sit still
|
||||||
;; 19.12 seems ok.
|
;; 19.12 seems ok.
|
||||||
;;(if ediff-xemacs-p (sit-for 0))
|
;;(if ediff-xemacs-p (sit-for 0))
|
||||||
|
|
||||||
(funcall split-window-function wind-width-or-height)
|
(funcall split-window-function wind-width-or-height)
|
||||||
|
|
||||||
(if (eq (selected-window) wind-A)
|
(if (eq (selected-window) wind-A)
|
||||||
(other-window 1))
|
(other-window 1))
|
||||||
(switch-to-buffer buf-B)
|
(switch-to-buffer buf-B)
|
||||||
(setq wind-B (selected-window))
|
(setq wind-B (selected-window))
|
||||||
|
|
||||||
(if three-way-comparison
|
(if three-way-comparison
|
||||||
(progn
|
(progn
|
||||||
(funcall split-window-function) ; equally
|
(funcall split-window-function) ; equally
|
||||||
|
|
@ -450,24 +450,24 @@ into icons, regardless of the window manager."
|
||||||
(other-window 1))
|
(other-window 1))
|
||||||
(switch-to-buffer buf-C)
|
(switch-to-buffer buf-C)
|
||||||
(setq wind-C (selected-window))))
|
(setq wind-C (selected-window))))
|
||||||
|
|
||||||
(ediff-with-current-buffer control-buffer
|
(ediff-with-current-buffer control-buffer
|
||||||
(setq ediff-window-A wind-A
|
(setq ediff-window-A wind-A
|
||||||
ediff-window-B wind-B
|
ediff-window-B wind-B
|
||||||
ediff-window-C wind-C))
|
ediff-window-C wind-C))
|
||||||
|
|
||||||
;; It is unlikely that we will want to implement 3way window comparison.
|
;; It is unlikely that we will want to implement 3way window comparison.
|
||||||
;; So, only buffers A and B are used here.
|
;; So, only buffers A and B are used here.
|
||||||
(if ediff-windows-job
|
(if ediff-windows-job
|
||||||
(progn
|
(progn
|
||||||
(set-window-start wind-A wind-A-start)
|
(set-window-start wind-A wind-A-start)
|
||||||
(set-window-start wind-B wind-B-start)))
|
(set-window-start wind-B wind-B-start)))
|
||||||
|
|
||||||
(ediff-select-lowest-window)
|
(ediff-select-lowest-window)
|
||||||
(ediff-setup-control-buffer control-buffer)
|
(ediff-setup-control-buffer control-buffer)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
;; dispatch an appropriate window setup function
|
;; dispatch an appropriate window setup function
|
||||||
(defun ediff-setup-windows-multiframe (buf-A buf-B buf-C control-buf)
|
(defun ediff-setup-windows-multiframe (buf-A buf-B buf-C control-buf)
|
||||||
(ediff-with-current-buffer control-buf
|
(ediff-with-current-buffer control-buf
|
||||||
|
|
@ -475,7 +475,7 @@ into icons, regardless of the window manager."
|
||||||
(if ediff-merge-job
|
(if ediff-merge-job
|
||||||
(ediff-setup-windows-multiframe-merge buf-A buf-B buf-C control-buf)
|
(ediff-setup-windows-multiframe-merge buf-A buf-B buf-C control-buf)
|
||||||
(ediff-setup-windows-multiframe-compare buf-A buf-B buf-C control-buf)))
|
(ediff-setup-windows-multiframe-compare buf-A buf-B buf-C control-buf)))
|
||||||
|
|
||||||
(defun ediff-setup-windows-multiframe-merge (buf-A buf-B buf-C control-buf)
|
(defun ediff-setup-windows-multiframe-merge (buf-A buf-B buf-C control-buf)
|
||||||
;;; Algorithm:
|
;;; Algorithm:
|
||||||
;;; 1. Never use frames that have dedicated windows in them---it is bad to
|
;;; 1. Never use frames that have dedicated windows in them---it is bad to
|
||||||
|
|
@ -491,7 +491,7 @@ into icons, regardless of the window manager."
|
||||||
;; Skip dedicated or iconified frames.
|
;; Skip dedicated or iconified frames.
|
||||||
;; Unsplittable frames are taken care of later.
|
;; Unsplittable frames are taken care of later.
|
||||||
(ediff-skip-unsuitable-frames 'ok-unsplittable)
|
(ediff-skip-unsuitable-frames 'ok-unsplittable)
|
||||||
|
|
||||||
(let* ((window-min-height 1)
|
(let* ((window-min-height 1)
|
||||||
(wind-A (ediff-get-visible-buffer-window buf-A))
|
(wind-A (ediff-get-visible-buffer-window buf-A))
|
||||||
(wind-B (ediff-get-visible-buffer-window buf-B))
|
(wind-B (ediff-get-visible-buffer-window buf-B))
|
||||||
|
|
@ -531,7 +531,7 @@ into icons, regardless of the window manager."
|
||||||
merge-window-lines
|
merge-window-lines
|
||||||
designated-minibuffer-frame
|
designated-minibuffer-frame
|
||||||
done-A done-B done-C)
|
done-A done-B done-C)
|
||||||
|
|
||||||
;; buf-A on its own
|
;; buf-A on its own
|
||||||
(if (and (window-live-p wind-A)
|
(if (and (window-live-p wind-A)
|
||||||
(null use-same-frame) ; implies wind-A is suitable
|
(null use-same-frame) ; implies wind-A is suitable
|
||||||
|
|
@ -542,7 +542,7 @@ into icons, regardless of the window manager."
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(setq wind-A (selected-window))
|
(setq wind-A (selected-window))
|
||||||
(setq done-A t)))
|
(setq done-A t)))
|
||||||
|
|
||||||
;; buf-B on its own
|
;; buf-B on its own
|
||||||
(if (and (window-live-p wind-B)
|
(if (and (window-live-p wind-B)
|
||||||
(null use-same-frame) ; implies wind-B is suitable
|
(null use-same-frame) ; implies wind-B is suitable
|
||||||
|
|
@ -553,7 +553,7 @@ into icons, regardless of the window manager."
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(setq wind-B (selected-window))
|
(setq wind-B (selected-window))
|
||||||
(setq done-B t)))
|
(setq done-B t)))
|
||||||
|
|
||||||
;; buf-C on its own
|
;; buf-C on its own
|
||||||
(if (and (window-live-p wind-C)
|
(if (and (window-live-p wind-C)
|
||||||
(ediff-window-ok-for-display wind-C)
|
(ediff-window-ok-for-display wind-C)
|
||||||
|
|
@ -564,7 +564,7 @@ into icons, regardless of the window manager."
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(setq wind-C (selected-window))
|
(setq wind-C (selected-window))
|
||||||
(setq done-C t)))
|
(setq done-C t)))
|
||||||
|
|
||||||
(if (and use-same-frame-for-AB ; implies wind A and B are suitable
|
(if (and use-same-frame-for-AB ; implies wind A and B are suitable
|
||||||
(window-live-p wind-A))
|
(window-live-p wind-A))
|
||||||
(progn
|
(progn
|
||||||
|
|
@ -572,16 +572,16 @@ into icons, regardless of the window manager."
|
||||||
(select-window wind-A)
|
(select-window wind-A)
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(setq wind-A (selected-window))
|
(setq wind-A (selected-window))
|
||||||
|
|
||||||
(funcall split-window-function)
|
(funcall split-window-function)
|
||||||
(if (eq (selected-window) wind-A)
|
(if (eq (selected-window) wind-A)
|
||||||
(other-window 1))
|
(other-window 1))
|
||||||
(switch-to-buffer buf-B)
|
(switch-to-buffer buf-B)
|
||||||
(setq wind-B (selected-window))
|
(setq wind-B (selected-window))
|
||||||
|
|
||||||
(setq done-A t
|
(setq done-A t
|
||||||
done-B t)))
|
done-B t)))
|
||||||
|
|
||||||
(if use-same-frame
|
(if use-same-frame
|
||||||
(let ((window-min-height 1))
|
(let ((window-min-height 1))
|
||||||
(if (and (eq frame-A frame-B)
|
(if (and (eq frame-A frame-B)
|
||||||
|
|
@ -595,27 +595,27 @@ into icons, regardless of the window manager."
|
||||||
(max 2 (round (* (window-height) merge-window-share))))
|
(max 2 (round (* (window-height) merge-window-share))))
|
||||||
(switch-to-buffer buf-A)
|
(switch-to-buffer buf-A)
|
||||||
(setq wind-A (selected-window))
|
(setq wind-A (selected-window))
|
||||||
|
|
||||||
(split-window-vertically
|
(split-window-vertically
|
||||||
(max 2 (- (window-height) merge-window-lines)))
|
(max 2 (- (window-height) merge-window-lines)))
|
||||||
(if (eq (selected-window) wind-A)
|
(if (eq (selected-window) wind-A)
|
||||||
(other-window 1))
|
(other-window 1))
|
||||||
(setq wind-C (selected-window))
|
(setq wind-C (selected-window))
|
||||||
(switch-to-buffer buf-C)
|
(switch-to-buffer buf-C)
|
||||||
|
|
||||||
(select-window wind-A)
|
(select-window wind-A)
|
||||||
|
|
||||||
(funcall split-window-function)
|
(funcall split-window-function)
|
||||||
(if (eq (selected-window) wind-A)
|
(if (eq (selected-window) wind-A)
|
||||||
(other-window 1))
|
(other-window 1))
|
||||||
(switch-to-buffer buf-B)
|
(switch-to-buffer buf-B)
|
||||||
(setq wind-B (selected-window))
|
(setq wind-B (selected-window))
|
||||||
|
|
||||||
(setq done-A t
|
(setq done-A t
|
||||||
done-B t
|
done-B t
|
||||||
done-C t)
|
done-C t)
|
||||||
))
|
))
|
||||||
|
|
||||||
(or done-A ; Buf A to be set in its own frame,
|
(or done-A ; Buf A to be set in its own frame,
|
||||||
;;; or it was set before because use-same-frame = 1
|
;;; or it was set before because use-same-frame = 1
|
||||||
(progn
|
(progn
|
||||||
|
|
@ -636,7 +636,7 @@ into icons, regardless of the window manager."
|
||||||
(switch-to-buffer buf-B)
|
(switch-to-buffer buf-B)
|
||||||
(setq wind-B (selected-window))
|
(setq wind-B (selected-window))
|
||||||
))
|
))
|
||||||
|
|
||||||
(or done-C ; Buf C to be set in its own frame,
|
(or done-C ; Buf C to be set in its own frame,
|
||||||
;;; or it was set before because use-same-frame = 1
|
;;; or it was set before because use-same-frame = 1
|
||||||
(progn
|
(progn
|
||||||
|
|
@ -647,7 +647,7 @@ into icons, regardless of the window manager."
|
||||||
(switch-to-buffer buf-C)
|
(switch-to-buffer buf-C)
|
||||||
(setq wind-C (selected-window))
|
(setq wind-C (selected-window))
|
||||||
))
|
))
|
||||||
|
|
||||||
(ediff-with-current-buffer control-buf
|
(ediff-with-current-buffer control-buf
|
||||||
(setq ediff-window-A wind-A
|
(setq ediff-window-A wind-A
|
||||||
ediff-window-B wind-B
|
ediff-window-B wind-B
|
||||||
|
|
@ -655,11 +655,11 @@ into icons, regardless of the window manager."
|
||||||
(setq frame-A (window-frame ediff-window-A)
|
(setq frame-A (window-frame ediff-window-A)
|
||||||
designated-minibuffer-frame
|
designated-minibuffer-frame
|
||||||
(window-frame (minibuffer-window frame-A))))
|
(window-frame (minibuffer-window frame-A))))
|
||||||
|
|
||||||
(ediff-setup-control-frame control-buf designated-minibuffer-frame)
|
(ediff-setup-control-frame control-buf designated-minibuffer-frame)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
;; Window setup for all comparison jobs, including 3way comparisons
|
;; Window setup for all comparison jobs, including 3way comparisons
|
||||||
(defun ediff-setup-windows-multiframe-compare (buf-A buf-B buf-C control-buf)
|
(defun ediff-setup-windows-multiframe-compare (buf-A buf-B buf-C control-buf)
|
||||||
;;; Algorithm:
|
;;; Algorithm:
|
||||||
|
|
@ -673,11 +673,11 @@ into icons, regardless of the window manager."
|
||||||
;;; and the selected frame isn't splittable, we create a new frame and
|
;;; and the selected frame isn't splittable, we create a new frame and
|
||||||
;;; put both buffers there, event if one of this buffers is visible in
|
;;; put both buffers there, event if one of this buffers is visible in
|
||||||
;;; another frame.
|
;;; another frame.
|
||||||
|
|
||||||
;; Skip dedicated or iconified frames.
|
;; Skip dedicated or iconified frames.
|
||||||
;; Unsplittable frames are taken care of later.
|
;; Unsplittable frames are taken care of later.
|
||||||
(ediff-skip-unsuitable-frames 'ok-unsplittable)
|
(ediff-skip-unsuitable-frames 'ok-unsplittable)
|
||||||
|
|
||||||
(let* ((window-min-height 1)
|
(let* ((window-min-height 1)
|
||||||
(wind-A (ediff-get-visible-buffer-window buf-A))
|
(wind-A (ediff-get-visible-buffer-window buf-A))
|
||||||
(wind-B (ediff-get-visible-buffer-window buf-B))
|
(wind-B (ediff-get-visible-buffer-window buf-B))
|
||||||
|
|
@ -716,7 +716,7 @@ into icons, regardless of the window manager."
|
||||||
wind-A-start wind-B-start
|
wind-A-start wind-B-start
|
||||||
designated-minibuffer-frame
|
designated-minibuffer-frame
|
||||||
done-A done-B done-C)
|
done-A done-B done-C)
|
||||||
|
|
||||||
(ediff-with-current-buffer control-buf
|
(ediff-with-current-buffer control-buf
|
||||||
(setq wind-A-start (ediff-overlay-start
|
(setq wind-A-start (ediff-overlay-start
|
||||||
(ediff-get-value-according-to-buffer-type
|
(ediff-get-value-according-to-buffer-type
|
||||||
|
|
@ -724,7 +724,7 @@ into icons, regardless of the window manager."
|
||||||
wind-B-start (ediff-overlay-start
|
wind-B-start (ediff-overlay-start
|
||||||
(ediff-get-value-according-to-buffer-type
|
(ediff-get-value-according-to-buffer-type
|
||||||
'B ediff-narrow-bounds))))
|
'B ediff-narrow-bounds))))
|
||||||
|
|
||||||
(if (and (window-live-p wind-A) (null use-same-frame)) ; buf-A on its own
|
(if (and (window-live-p wind-A) (null use-same-frame)) ; buf-A on its own
|
||||||
(progn
|
(progn
|
||||||
;; buffer buf-A is seen in live wind-A
|
;; buffer buf-A is seen in live wind-A
|
||||||
|
|
@ -732,7 +732,7 @@ into icons, regardless of the window manager."
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(setq wind-A (selected-window))
|
(setq wind-A (selected-window))
|
||||||
(setq done-A t)))
|
(setq done-A t)))
|
||||||
|
|
||||||
(if (and (window-live-p wind-B) (null use-same-frame)) ; buf B on its own
|
(if (and (window-live-p wind-B) (null use-same-frame)) ; buf B on its own
|
||||||
(progn
|
(progn
|
||||||
;; buffer buf-B is seen in live wind-B
|
;; buffer buf-B is seen in live wind-B
|
||||||
|
|
@ -740,7 +740,7 @@ into icons, regardless of the window manager."
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(setq wind-B (selected-window))
|
(setq wind-B (selected-window))
|
||||||
(setq done-B t)))
|
(setq done-B t)))
|
||||||
|
|
||||||
(if (and (window-live-p wind-C) (null use-same-frame)) ; buf C on its own
|
(if (and (window-live-p wind-C) (null use-same-frame)) ; buf C on its own
|
||||||
(progn
|
(progn
|
||||||
;; buffer buf-C is seen in live wind-C
|
;; buffer buf-C is seen in live wind-C
|
||||||
|
|
@ -748,7 +748,7 @@ into icons, regardless of the window manager."
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(setq wind-C (selected-window))
|
(setq wind-C (selected-window))
|
||||||
(setq done-C t)))
|
(setq done-C t)))
|
||||||
|
|
||||||
(if use-same-frame
|
(if use-same-frame
|
||||||
(let (wind-width-or-height) ; this affects 3way setups only
|
(let (wind-width-or-height) ; this affects 3way setups only
|
||||||
(if (and (eq frame-A frame-B) (frame-live-p frame-A))
|
(if (and (eq frame-A frame-B) (frame-live-p frame-A))
|
||||||
|
|
@ -758,7 +758,7 @@ into icons, regardless of the window manager."
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(switch-to-buffer buf-A)
|
(switch-to-buffer buf-A)
|
||||||
(setq wind-A (selected-window))
|
(setq wind-A (selected-window))
|
||||||
|
|
||||||
(if three-way-comparison
|
(if three-way-comparison
|
||||||
(setq wind-width-or-height
|
(setq wind-width-or-height
|
||||||
(/
|
(/
|
||||||
|
|
@ -766,13 +766,13 @@ into icons, regardless of the window manager."
|
||||||
(window-height wind-A)
|
(window-height wind-A)
|
||||||
(window-width wind-A))
|
(window-width wind-A))
|
||||||
3)))
|
3)))
|
||||||
|
|
||||||
(funcall split-window-function wind-width-or-height)
|
(funcall split-window-function wind-width-or-height)
|
||||||
(if (eq (selected-window) wind-A)
|
(if (eq (selected-window) wind-A)
|
||||||
(other-window 1))
|
(other-window 1))
|
||||||
(switch-to-buffer buf-B)
|
(switch-to-buffer buf-B)
|
||||||
(setq wind-B (selected-window))
|
(setq wind-B (selected-window))
|
||||||
|
|
||||||
(if three-way-comparison
|
(if three-way-comparison
|
||||||
(progn
|
(progn
|
||||||
(funcall split-window-function) ; equally
|
(funcall split-window-function) ; equally
|
||||||
|
|
@ -784,7 +784,7 @@ into icons, regardless of the window manager."
|
||||||
done-B t
|
done-B t
|
||||||
done-C t)
|
done-C t)
|
||||||
))
|
))
|
||||||
|
|
||||||
(or done-A ; Buf A to be set in its own frame
|
(or done-A ; Buf A to be set in its own frame
|
||||||
;;; or it was set before because use-same-frame = 1
|
;;; or it was set before because use-same-frame = 1
|
||||||
(progn
|
(progn
|
||||||
|
|
@ -805,7 +805,7 @@ into icons, regardless of the window manager."
|
||||||
(switch-to-buffer buf-B)
|
(switch-to-buffer buf-B)
|
||||||
(setq wind-B (selected-window))
|
(setq wind-B (selected-window))
|
||||||
))
|
))
|
||||||
|
|
||||||
(if three-way-comparison
|
(if three-way-comparison
|
||||||
(or done-C ; Buf C to be set in its own frame
|
(or done-C ; Buf C to be set in its own frame
|
||||||
;;; or it was set before because use-same-frame = 1
|
;;; or it was set before because use-same-frame = 1
|
||||||
|
|
@ -817,7 +817,7 @@ into icons, regardless of the window manager."
|
||||||
(switch-to-buffer buf-C)
|
(switch-to-buffer buf-C)
|
||||||
(setq wind-C (selected-window))
|
(setq wind-C (selected-window))
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(ediff-with-current-buffer control-buf
|
(ediff-with-current-buffer control-buf
|
||||||
(setq ediff-window-A wind-A
|
(setq ediff-window-A wind-A
|
||||||
ediff-window-B wind-B
|
ediff-window-B wind-B
|
||||||
|
|
@ -826,14 +826,14 @@ into icons, regardless of the window manager."
|
||||||
(setq frame-A (window-frame ediff-window-A)
|
(setq frame-A (window-frame ediff-window-A)
|
||||||
designated-minibuffer-frame
|
designated-minibuffer-frame
|
||||||
(window-frame (minibuffer-window frame-A))))
|
(window-frame (minibuffer-window frame-A))))
|
||||||
|
|
||||||
;; It is unlikely that we'll implement a version of ediff-windows that
|
;; It is unlikely that we'll implement a version of ediff-windows that
|
||||||
;; would compare 3 windows at once. So, we don't use buffer C here.
|
;; would compare 3 windows at once. So, we don't use buffer C here.
|
||||||
(if ediff-windows-job
|
(if ediff-windows-job
|
||||||
(progn
|
(progn
|
||||||
(set-window-start wind-A wind-A-start)
|
(set-window-start wind-A wind-A-start)
|
||||||
(set-window-start wind-B wind-B-start)))
|
(set-window-start wind-B wind-B-start)))
|
||||||
|
|
||||||
(ediff-setup-control-frame control-buf designated-minibuffer-frame)
|
(ediff-setup-control-frame control-buf designated-minibuffer-frame)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
@ -868,7 +868,7 @@ into icons, regardless of the window manager."
|
||||||
|
|
||||||
(defun ediff-frame-has-dedicated-windows (frame)
|
(defun ediff-frame-has-dedicated-windows (frame)
|
||||||
(let (ans)
|
(let (ans)
|
||||||
(walk-windows
|
(walk-windows
|
||||||
(lambda (wind) (if (window-dedicated-p wind)
|
(lambda (wind) (if (window-dedicated-p wind)
|
||||||
(setq ans t)))
|
(setq ans t)))
|
||||||
'ignore-minibuffer
|
'ignore-minibuffer
|
||||||
|
|
@ -896,7 +896,7 @@ into icons, regardless of the window manager."
|
||||||
ctl-frame old-ctl-frame lines
|
ctl-frame old-ctl-frame lines
|
||||||
;; user-grabbed-mouse
|
;; user-grabbed-mouse
|
||||||
fheight fwidth adjusted-parameters)
|
fheight fwidth adjusted-parameters)
|
||||||
|
|
||||||
(ediff-with-current-buffer ctl-buffer
|
(ediff-with-current-buffer ctl-buffer
|
||||||
(ediff-cond-compile-for-xemacs-or-emacs
|
(ediff-cond-compile-for-xemacs-or-emacs
|
||||||
(set-buffer-menubar nil) ; xemacs
|
(set-buffer-menubar nil) ; xemacs
|
||||||
|
|
@ -904,7 +904,7 @@ into icons, regardless of the window manager."
|
||||||
)
|
)
|
||||||
;;(setq user-grabbed-mouse (ediff-user-grabbed-mouse))
|
;;(setq user-grabbed-mouse (ediff-user-grabbed-mouse))
|
||||||
(run-hooks 'ediff-before-setup-control-frame-hook))
|
(run-hooks 'ediff-before-setup-control-frame-hook))
|
||||||
|
|
||||||
(setq old-ctl-frame (ediff-with-current-buffer ctl-buffer ediff-control-frame))
|
(setq old-ctl-frame (ediff-with-current-buffer ctl-buffer ediff-control-frame))
|
||||||
(ediff-with-current-buffer ctl-buffer
|
(ediff-with-current-buffer ctl-buffer
|
||||||
(setq ctl-frame (if (frame-live-p old-ctl-frame)
|
(setq ctl-frame (if (frame-live-p old-ctl-frame)
|
||||||
|
|
@ -920,28 +920,28 @@ into icons, regardless of the window manager."
|
||||||
)
|
)
|
||||||
(error))
|
(error))
|
||||||
)
|
)
|
||||||
|
|
||||||
(setq ctl-frame-iconified-p (ediff-frame-iconified-p ctl-frame))
|
(setq ctl-frame-iconified-p (ediff-frame-iconified-p ctl-frame))
|
||||||
(select-frame ctl-frame)
|
(select-frame ctl-frame)
|
||||||
(if (window-dedicated-p (selected-window))
|
(if (window-dedicated-p (selected-window))
|
||||||
()
|
()
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(switch-to-buffer ctl-buffer))
|
(switch-to-buffer ctl-buffer))
|
||||||
|
|
||||||
;; must be before ediff-setup-control-buffer
|
;; must be before ediff-setup-control-buffer
|
||||||
;; just a precaution--we should be in ctl-buffer already
|
;; just a precaution--we should be in ctl-buffer already
|
||||||
(ediff-with-current-buffer ctl-buffer
|
(ediff-with-current-buffer ctl-buffer
|
||||||
(make-local-variable 'frame-title-format)
|
(make-local-variable 'frame-title-format)
|
||||||
(make-local-variable 'frame-icon-title-format) ; XEmacs
|
(make-local-variable 'frame-icon-title-format) ; XEmacs
|
||||||
(make-local-variable 'icon-title-format)) ; Emacs
|
(make-local-variable 'icon-title-format)) ; Emacs
|
||||||
|
|
||||||
(ediff-setup-control-buffer ctl-buffer)
|
(ediff-setup-control-buffer ctl-buffer)
|
||||||
(setq dont-iconify-ctl-frame
|
(setq dont-iconify-ctl-frame
|
||||||
(not (string= ediff-help-message ediff-brief-help-message)))
|
(not (string= ediff-help-message ediff-brief-help-message)))
|
||||||
(setq deiconify-ctl-frame
|
(setq deiconify-ctl-frame
|
||||||
(and (eq this-command 'ediff-toggle-help)
|
(and (eq this-command 'ediff-toggle-help)
|
||||||
dont-iconify-ctl-frame))
|
dont-iconify-ctl-frame))
|
||||||
|
|
||||||
;; 1 more line for the modeline
|
;; 1 more line for the modeline
|
||||||
(setq lines (1+ (count-lines (point-min) (point-max)))
|
(setq lines (1+ (count-lines (point-min) (point-max)))
|
||||||
fheight lines
|
fheight lines
|
||||||
|
|
@ -963,7 +963,7 @@ into icons, regardless of the window manager."
|
||||||
'(auto-raise . nil)
|
'(auto-raise . nil)
|
||||||
'(auto-raise . t))
|
'(auto-raise . t))
|
||||||
adjusted-parameters))
|
adjusted-parameters))
|
||||||
|
|
||||||
;; In XEmacs, buffer menubar needs to be killed before frame parameters
|
;; In XEmacs, buffer menubar needs to be killed before frame parameters
|
||||||
;; are changed.
|
;; are changed.
|
||||||
(if (ediff-has-toolbar-support-p)
|
(if (ediff-has-toolbar-support-p)
|
||||||
|
|
@ -980,7 +980,7 @@ into icons, regardless of the window manager."
|
||||||
nil ; emacs
|
nil ; emacs
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Under OS/2 (emx) we have to call modify frame parameters twice, in order
|
;; Under OS/2 (emx) we have to call modify frame parameters twice, in order
|
||||||
;; to make sure that at least once we do it for non-iconified frame. If
|
;; to make sure that at least once we do it for non-iconified frame. If
|
||||||
;; appears that in the OS/2 port of Emacs, one can't modify frame
|
;; appears that in the OS/2 port of Emacs, one can't modify frame
|
||||||
|
|
@ -988,28 +988,28 @@ into icons, regardless of the window manager."
|
||||||
;; windows-nt.
|
;; windows-nt.
|
||||||
(if (memq system-type '(emx windows-nt windows-95))
|
(if (memq system-type '(emx windows-nt windows-95))
|
||||||
(modify-frame-parameters ctl-frame adjusted-parameters))
|
(modify-frame-parameters ctl-frame adjusted-parameters))
|
||||||
|
|
||||||
;; make or zap toolbar (if not requested)
|
;; make or zap toolbar (if not requested)
|
||||||
(ediff-make-bottom-toolbar ctl-frame)
|
(ediff-make-bottom-toolbar ctl-frame)
|
||||||
|
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
|
|
||||||
(modify-frame-parameters ctl-frame adjusted-parameters)
|
(modify-frame-parameters ctl-frame adjusted-parameters)
|
||||||
(make-frame-visible ctl-frame)
|
(make-frame-visible ctl-frame)
|
||||||
|
|
||||||
;; This works around a bug in 19.25 and earlier. There, if frame gets
|
;; This works around a bug in 19.25 and earlier. There, if frame gets
|
||||||
;; iconified, the current buffer changes to that of the frame that
|
;; iconified, the current buffer changes to that of the frame that
|
||||||
;; becomes exposed as a result of this iconification.
|
;; becomes exposed as a result of this iconification.
|
||||||
;; So, we make sure the current buffer doesn't change.
|
;; So, we make sure the current buffer doesn't change.
|
||||||
(select-frame ctl-frame)
|
(select-frame ctl-frame)
|
||||||
(ediff-refresh-control-frame)
|
(ediff-refresh-control-frame)
|
||||||
|
|
||||||
(cond ((and ediff-prefer-iconified-control-frame
|
(cond ((and ediff-prefer-iconified-control-frame
|
||||||
(not ctl-frame-iconified-p) (not dont-iconify-ctl-frame))
|
(not ctl-frame-iconified-p) (not dont-iconify-ctl-frame))
|
||||||
(iconify-frame ctl-frame))
|
(iconify-frame ctl-frame))
|
||||||
((or deiconify-ctl-frame (not ctl-frame-iconified-p))
|
((or deiconify-ctl-frame (not ctl-frame-iconified-p))
|
||||||
(raise-frame ctl-frame)))
|
(raise-frame ctl-frame)))
|
||||||
|
|
||||||
(set-window-dedicated-p (selected-window) t)
|
(set-window-dedicated-p (selected-window) t)
|
||||||
|
|
||||||
;; Now move the frame. We must do it separately due to an obscure bug in
|
;; Now move the frame. We must do it separately due to an obscure bug in
|
||||||
|
|
@ -1017,7 +1017,7 @@ into icons, regardless of the window manager."
|
||||||
(modify-frame-parameters
|
(modify-frame-parameters
|
||||||
ctl-frame
|
ctl-frame
|
||||||
(funcall ediff-control-frame-position-function ctl-buffer fwidth fheight))
|
(funcall ediff-control-frame-position-function ctl-buffer fwidth fheight))
|
||||||
|
|
||||||
;; synchronize so the cursor will move to control frame
|
;; synchronize so the cursor will move to control frame
|
||||||
;; per RMS suggestion
|
;; per RMS suggestion
|
||||||
(if (ediff-window-display-p)
|
(if (ediff-window-display-p)
|
||||||
|
|
@ -1032,7 +1032,7 @@ into icons, regardless of the window manager."
|
||||||
(ediff-reset-mouse ctl-frame
|
(ediff-reset-mouse ctl-frame
|
||||||
(or (eq this-command 'ediff-quit)
|
(or (eq this-command 'ediff-quit)
|
||||||
(not (eq ediff-grab-mouse t)))))
|
(not (eq ediff-grab-mouse t)))))
|
||||||
|
|
||||||
(if ediff-xemacs-p
|
(if ediff-xemacs-p
|
||||||
(ediff-with-current-buffer ctl-buffer
|
(ediff-with-current-buffer ctl-buffer
|
||||||
(ediff-cond-compile-for-xemacs-or-emacs
|
(ediff-cond-compile-for-xemacs-or-emacs
|
||||||
|
|
@ -1042,12 +1042,12 @@ into icons, regardless of the window manager."
|
||||||
(add-hook
|
(add-hook
|
||||||
'select-frame-hook 'ediff-xemacs-select-frame-hook nil 'local)
|
'select-frame-hook 'ediff-xemacs-select-frame-hook nil 'local)
|
||||||
))
|
))
|
||||||
|
|
||||||
(ediff-with-current-buffer ctl-buffer
|
(ediff-with-current-buffer ctl-buffer
|
||||||
(run-hooks 'ediff-after-setup-control-frame-hook))
|
(run-hooks 'ediff-after-setup-control-frame-hook))
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
(defun ediff-destroy-control-frame (ctl-buffer)
|
(defun ediff-destroy-control-frame (ctl-buffer)
|
||||||
(ediff-with-current-buffer ctl-buffer
|
(ediff-with-current-buffer ctl-buffer
|
||||||
(if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
|
(if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
|
||||||
|
|
@ -1062,7 +1062,7 @@ into icons, regardless of the window manager."
|
||||||
(ediff-skip-unsuitable-frames)
|
(ediff-skip-unsuitable-frames)
|
||||||
;;(ediff-reset-mouse nil)
|
;;(ediff-reset-mouse nil)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
;; finds a good place to clip control frame
|
;; finds a good place to clip control frame
|
||||||
(defun ediff-make-frame-position (ctl-buffer ctl-frame-width ctl-frame-height)
|
(defun ediff-make-frame-position (ctl-buffer ctl-frame-width ctl-frame-height)
|
||||||
|
|
@ -1075,7 +1075,7 @@ into icons, regardless of the window manager."
|
||||||
(ctl-frame ediff-control-frame)
|
(ctl-frame ediff-control-frame)
|
||||||
horizontal-adjustment upward-adjustment
|
horizontal-adjustment upward-adjustment
|
||||||
ctl-frame-top ctl-frame-left)
|
ctl-frame-top ctl-frame-left)
|
||||||
|
|
||||||
;; Multiple control frames are clipped based on the value of
|
;; Multiple control frames are clipped based on the value of
|
||||||
;; ediff-control-buffer-number. This is done in order not to obscure
|
;; ediff-control-buffer-number. This is done in order not to obscure
|
||||||
;; other active control panels.
|
;; other active control panels.
|
||||||
|
|
@ -1107,16 +1107,16 @@ into icons, regardless of the window manager."
|
||||||
;; keep ctl frame within the visible bounds
|
;; keep ctl frame within the visible bounds
|
||||||
(setq ctl-frame-top (max ctl-frame-top 1)
|
(setq ctl-frame-top (max ctl-frame-top 1)
|
||||||
ctl-frame-left (max ctl-frame-left 1))
|
ctl-frame-left (max ctl-frame-left 1))
|
||||||
|
|
||||||
(list (cons 'top ctl-frame-top)
|
(list (cons 'top ctl-frame-top)
|
||||||
(cons 'left ctl-frame-left))
|
(cons 'left ctl-frame-left))
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(defun ediff-xemacs-select-frame-hook ()
|
(defun ediff-xemacs-select-frame-hook ()
|
||||||
(if (and (equal (selected-frame) ediff-control-frame)
|
(if (and (equal (selected-frame) ediff-control-frame)
|
||||||
(not ediff-use-long-help-message))
|
(not ediff-use-long-help-message))
|
||||||
(raise-frame ediff-control-frame)))
|
(raise-frame ediff-control-frame)))
|
||||||
|
|
||||||
(defun ediff-make-wide-display ()
|
(defun ediff-make-wide-display ()
|
||||||
"Construct an alist of parameters for the wide display.
|
"Construct an alist of parameters for the wide display.
|
||||||
Saves the old frame parameters in `ediff-wide-display-orig-parameters'.
|
Saves the old frame parameters in `ediff-wide-display-orig-parameters'.
|
||||||
|
|
@ -1135,15 +1135,15 @@ It assumes that it is called from within the control buffer."
|
||||||
ediff-wide-display-frame frame-A)
|
ediff-wide-display-frame frame-A)
|
||||||
(modify-frame-parameters frame-A (list (cons 'left cw)
|
(modify-frame-parameters frame-A (list (cons 'left cw)
|
||||||
(cons 'width wd)))))
|
(cons 'width wd)))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; Revise the mode line to display which difference we have selected
|
;; Revise the mode line to display which difference we have selected
|
||||||
;; Also resets modelines of buffers A/B, since they may be clobbered by
|
;; Also resets modelines of buffers A/B, since they may be clobbered by
|
||||||
;; anothe invocations of Ediff.
|
;; anothe invocations of Ediff.
|
||||||
(defun ediff-refresh-mode-lines ()
|
(defun ediff-refresh-mode-lines ()
|
||||||
(let (buf-A-state-diff buf-B-state-diff buf-C-state-diff buf-C-state-merge)
|
(let (buf-A-state-diff buf-B-state-diff buf-C-state-diff buf-C-state-merge)
|
||||||
|
|
||||||
(if (ediff-valid-difference-p)
|
(if (ediff-valid-difference-p)
|
||||||
(setq
|
(setq
|
||||||
buf-C-state-diff (ediff-get-state-of-diff ediff-current-difference 'C)
|
buf-C-state-diff (ediff-get-state-of-diff ediff-current-difference 'C)
|
||||||
|
|
@ -1172,7 +1172,7 @@ It assumes that it is called from within the control buffer."
|
||||||
(setq buf-A-state-diff ""
|
(setq buf-A-state-diff ""
|
||||||
buf-B-state-diff ""
|
buf-B-state-diff ""
|
||||||
buf-C-state-diff ""))
|
buf-C-state-diff ""))
|
||||||
|
|
||||||
;; control buffer format
|
;; control buffer format
|
||||||
(setq mode-line-format
|
(setq mode-line-format
|
||||||
(if (ediff-narrow-control-frame-p)
|
(if (ediff-narrow-control-frame-p)
|
||||||
|
|
@ -1185,10 +1185,10 @@ It assumes that it is called from within the control buffer."
|
||||||
(ediff-make-wide-control-buffer-id)))
|
(ediff-make-wide-control-buffer-id)))
|
||||||
;; Force mode-line redisplay
|
;; Force mode-line redisplay
|
||||||
(force-mode-line-update)
|
(force-mode-line-update)
|
||||||
|
|
||||||
(if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
|
(if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
|
||||||
(ediff-refresh-control-frame))
|
(ediff-refresh-control-frame))
|
||||||
|
|
||||||
(ediff-with-current-buffer ediff-buffer-A
|
(ediff-with-current-buffer ediff-buffer-A
|
||||||
(setq ediff-diff-status buf-A-state-diff)
|
(setq ediff-diff-status buf-A-state-diff)
|
||||||
(ediff-strip-mode-line-format)
|
(ediff-strip-mode-line-format)
|
||||||
|
|
@ -1225,8 +1225,8 @@ It assumes that it is called from within the control buffer."
|
||||||
(t ""))
|
(t ""))
|
||||||
mode-line-format))))
|
mode-line-format))))
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
(defun ediff-refresh-control-frame ()
|
(defun ediff-refresh-control-frame ()
|
||||||
(if ediff-emacs-p
|
(if ediff-emacs-p
|
||||||
;; set frame/icon titles for Emacs
|
;; set frame/icon titles for Emacs
|
||||||
|
|
@ -1240,8 +1240,8 @@ It assumes that it is called from within the control buffer."
|
||||||
frame-icon-title-format (ediff-make-narrow-control-buffer-id))
|
frame-icon-title-format (ediff-make-narrow-control-buffer-id))
|
||||||
;; force an update of the frame title
|
;; force an update of the frame title
|
||||||
(modify-frame-parameters ediff-control-frame '(()))))
|
(modify-frame-parameters ediff-control-frame '(()))))
|
||||||
|
|
||||||
|
|
||||||
(defun ediff-make-narrow-control-buffer-id (&optional skip-name)
|
(defun ediff-make-narrow-control-buffer-id (&optional skip-name)
|
||||||
(concat
|
(concat
|
||||||
(if skip-name
|
(if skip-name
|
||||||
|
|
@ -1260,7 +1260,7 @@ It assumes that it is called from within the control buffer."
|
||||||
(concat
|
(concat
|
||||||
(cdr (assoc 'name ediff-control-frame-parameters))
|
(cdr (assoc 'name ediff-control-frame-parameters))
|
||||||
ediff-control-buffer-suffix))
|
ediff-control-buffer-suffix))
|
||||||
|
|
||||||
(defun ediff-make-wide-control-buffer-id ()
|
(defun ediff-make-wide-control-buffer-id ()
|
||||||
(cond ((< ediff-current-difference 0)
|
(cond ((< ediff-current-difference 0)
|
||||||
(list (format "%%b At start of %d diffs"
|
(list (format "%%b At start of %d diffs"
|
||||||
|
|
@ -1281,10 +1281,10 @@ It assumes that it is called from within the control buffer."
|
||||||
(if ediff-xemacs-p
|
(if ediff-xemacs-p
|
||||||
(get-buffer-window buff t)
|
(get-buffer-window buff t)
|
||||||
(get-buffer-window buff 'visible))))
|
(get-buffer-window buff 'visible))))
|
||||||
|
|
||||||
|
|
||||||
;;; Functions to decide when to redraw windows
|
;;; Functions to decide when to redraw windows
|
||||||
|
|
||||||
(defun ediff-keep-window-config (control-buf)
|
(defun ediff-keep-window-config (control-buf)
|
||||||
(and (eq control-buf (current-buffer))
|
(and (eq control-buf (current-buffer))
|
||||||
(/= (buffer-size) 0)
|
(/= (buffer-size) 0)
|
||||||
|
|
@ -1293,7 +1293,7 @@ It assumes that it is called from within the control buffer."
|
||||||
(A-wind ediff-window-A)
|
(A-wind ediff-window-A)
|
||||||
(B-wind ediff-window-B)
|
(B-wind ediff-window-B)
|
||||||
(C-wind ediff-window-C))
|
(C-wind ediff-window-C))
|
||||||
|
|
||||||
(and
|
(and
|
||||||
(ediff-window-visible-p A-wind)
|
(ediff-window-visible-p A-wind)
|
||||||
(ediff-window-visible-p B-wind)
|
(ediff-window-visible-p B-wind)
|
||||||
|
|
|
||||||
206
lisp/ediff.el
206
lisp/ediff.el
|
|
@ -7,7 +7,7 @@
|
||||||
;; Keywords: comparing, merging, patching, tools, unix
|
;; Keywords: comparing, merging, patching, tools, unix
|
||||||
|
|
||||||
(defconst ediff-version "2.78" "The current version of Ediff")
|
(defconst ediff-version "2.78" "The current version of Ediff")
|
||||||
(defconst ediff-date "January 25, 2003" "Date of last update")
|
(defconst ediff-date "January 25, 2003" "Date of last update")
|
||||||
|
|
||||||
|
|
||||||
;; This file is part of GNU Emacs.
|
;; This file is part of GNU Emacs.
|
||||||
|
|
@ -200,13 +200,13 @@
|
||||||
dir-B f)
|
dir-B f)
|
||||||
(list (setq f (ediff-read-file-name
|
(list (setq f (ediff-read-file-name
|
||||||
"File A to compare"
|
"File A to compare"
|
||||||
dir-A
|
dir-A
|
||||||
(ediff-get-default-file-name)
|
(ediff-get-default-file-name)
|
||||||
'no-dirs))
|
'no-dirs))
|
||||||
(ediff-read-file-name "File B to compare"
|
(ediff-read-file-name "File B to compare"
|
||||||
(setq dir-B
|
(setq dir-B
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-dir-B
|
ediff-last-dir-B
|
||||||
(file-name-directory f)))
|
(file-name-directory f)))
|
||||||
(progn
|
(progn
|
||||||
(setq file-name-history
|
(setq file-name-history
|
||||||
|
|
@ -217,7 +217,7 @@
|
||||||
file-name-history))
|
file-name-history))
|
||||||
(ediff-get-default-file-name f 1)))
|
(ediff-get-default-file-name f 1)))
|
||||||
)))
|
)))
|
||||||
(ediff-files-internal file-A
|
(ediff-files-internal file-A
|
||||||
(if (file-directory-p file-B)
|
(if (file-directory-p file-B)
|
||||||
(expand-file-name
|
(expand-file-name
|
||||||
(file-name-nondirectory file-A) file-B)
|
(file-name-nondirectory file-A) file-B)
|
||||||
|
|
@ -225,7 +225,7 @@
|
||||||
nil ; file-C
|
nil ; file-C
|
||||||
startup-hooks
|
startup-hooks
|
||||||
'ediff-files))
|
'ediff-files))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-files3 (file-A file-B file-C &optional startup-hooks)
|
(defun ediff-files3 (file-A file-B file-C &optional startup-hooks)
|
||||||
"Run Ediff on three files, FILE-A, FILE-B, and FILE-C."
|
"Run Ediff on three files, FILE-A, FILE-B, and FILE-C."
|
||||||
|
|
@ -239,7 +239,7 @@
|
||||||
dir-A
|
dir-A
|
||||||
(ediff-get-default-file-name)
|
(ediff-get-default-file-name)
|
||||||
'no-dirs))
|
'no-dirs))
|
||||||
(setq ff (ediff-read-file-name "File B to compare"
|
(setq ff (ediff-read-file-name "File B to compare"
|
||||||
(setq dir-B
|
(setq dir-B
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-dir-B
|
ediff-last-dir-B
|
||||||
|
|
@ -253,7 +253,7 @@
|
||||||
dir-B))
|
dir-B))
|
||||||
file-name-history))
|
file-name-history))
|
||||||
(ediff-get-default-file-name f 1))))
|
(ediff-get-default-file-name f 1))))
|
||||||
(ediff-read-file-name "File C to compare"
|
(ediff-read-file-name "File C to compare"
|
||||||
(setq dir-C (if ediff-use-last-dir
|
(setq dir-C (if ediff-use-last-dir
|
||||||
ediff-last-dir-C
|
ediff-last-dir-C
|
||||||
(file-name-directory ff)))
|
(file-name-directory ff)))
|
||||||
|
|
@ -266,7 +266,7 @@
|
||||||
file-name-history))
|
file-name-history))
|
||||||
(ediff-get-default-file-name ff 2)))
|
(ediff-get-default-file-name ff 2)))
|
||||||
)))
|
)))
|
||||||
(ediff-files-internal file-A
|
(ediff-files-internal file-A
|
||||||
(if (file-directory-p file-B)
|
(if (file-directory-p file-B)
|
||||||
(expand-file-name
|
(expand-file-name
|
||||||
(file-name-nondirectory file-A) file-B)
|
(file-name-nondirectory file-A) file-B)
|
||||||
|
|
@ -282,7 +282,7 @@
|
||||||
(defalias 'ediff3 'ediff-files3)
|
(defalias 'ediff3 'ediff-files3)
|
||||||
|
|
||||||
|
|
||||||
;; Visit FILE and arrange its buffer to Ediff's liking.
|
;; Visit FILE and arrange its buffer to Ediff's liking.
|
||||||
;; FILE is actually a variable symbol that must contain a true file name.
|
;; FILE is actually a variable symbol that must contain a true file name.
|
||||||
;; BUFFER-NAME is a variable symbol, which will get the buffer object into
|
;; BUFFER-NAME is a variable symbol, which will get the buffer object into
|
||||||
;; which FILE is read.
|
;; which FILE is read.
|
||||||
|
|
@ -299,17 +299,17 @@
|
||||||
(error "File `%s' does not exist or is not readable" file))
|
(error "File `%s' does not exist or is not readable" file))
|
||||||
((file-directory-p file)
|
((file-directory-p file)
|
||||||
(error "File `%s' is a directory" file)))
|
(error "File `%s' is a directory" file)))
|
||||||
|
|
||||||
;; some of the commands, below, require full file name
|
;; some of the commands, below, require full file name
|
||||||
(setq file (expand-file-name file))
|
(setq file (expand-file-name file))
|
||||||
|
|
||||||
;; Record the directory of the file
|
;; Record the directory of the file
|
||||||
(if last-dir
|
(if last-dir
|
||||||
(set last-dir (expand-file-name (file-name-directory file))))
|
(set last-dir (expand-file-name (file-name-directory file))))
|
||||||
|
|
||||||
;; Setup the buffer
|
;; Setup the buffer
|
||||||
(set buffer-name (find-file-noselect file))
|
(set buffer-name (find-file-noselect file))
|
||||||
|
|
||||||
(ediff-with-current-buffer (symbol-value buffer-name)
|
(ediff-with-current-buffer (symbol-value buffer-name)
|
||||||
(widen) ; Make sure the entire file is seen
|
(widen) ; Make sure the entire file is seen
|
||||||
(cond (file-magic ; file has a handler, such as jka-compr-handler or
|
(cond (file-magic ; file has a handler, such as jka-compr-handler or
|
||||||
|
|
@ -362,7 +362,7 @@
|
||||||
startup-hooks
|
startup-hooks
|
||||||
(list (cons 'ediff-job-name job-name))
|
(list (cons 'ediff-job-name job-name))
|
||||||
merge-buffer-file)))
|
merge-buffer-file)))
|
||||||
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defalias 'ediff 'ediff-files)
|
(defalias 'ediff 'ediff-files)
|
||||||
|
|
@ -387,7 +387,7 @@ If this file is a backup, `ediff' it with its original."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name)
|
(defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name)
|
||||||
"Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B."
|
"Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B."
|
||||||
(interactive
|
(interactive
|
||||||
(let (bf)
|
(let (bf)
|
||||||
(list (setq bf (read-buffer "Buffer A to compare: "
|
(list (setq bf (read-buffer "Buffer A to compare: "
|
||||||
(ediff-other-buffer "") t))
|
(ediff-other-buffer "") t))
|
||||||
|
|
@ -404,12 +404,12 @@ If this file is a backup, `ediff' it with its original."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defalias 'ebuffers 'ediff-buffers)
|
(defalias 'ebuffers 'ediff-buffers)
|
||||||
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-buffers3 (buffer-A buffer-B buffer-C
|
(defun ediff-buffers3 (buffer-A buffer-B buffer-C
|
||||||
&optional startup-hooks job-name)
|
&optional startup-hooks job-name)
|
||||||
"Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C."
|
"Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C."
|
||||||
(interactive
|
(interactive
|
||||||
(let (bf bff)
|
(let (bf bff)
|
||||||
(list (setq bf (read-buffer "Buffer A to compare: "
|
(list (setq bf (read-buffer "Buffer A to compare: "
|
||||||
(ediff-other-buffer "") t))
|
(ediff-other-buffer "") t))
|
||||||
|
|
@ -433,9 +433,9 @@ If this file is a backup, `ediff' it with its original."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defalias 'ebuffers3 'ediff-buffers3)
|
(defalias 'ebuffers3 'ediff-buffers3)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
|
;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
|
||||||
(defun ediff-buffers-internal (buf-A buf-B buf-C startup-hooks job-name
|
(defun ediff-buffers-internal (buf-A buf-B buf-C startup-hooks job-name
|
||||||
&optional merge-buffer-file)
|
&optional merge-buffer-file)
|
||||||
|
|
@ -459,12 +459,12 @@ If this file is a backup, `ediff' it with its original."
|
||||||
(setq buf-B-file-name (file-name-nondirectory buf-B-file-name)))
|
(setq buf-B-file-name (file-name-nondirectory buf-B-file-name)))
|
||||||
(if (stringp buf-C-file-name)
|
(if (stringp buf-C-file-name)
|
||||||
(setq buf-C-file-name (file-name-nondirectory buf-C-file-name)))
|
(setq buf-C-file-name (file-name-nondirectory buf-C-file-name)))
|
||||||
|
|
||||||
(setq file-A (ediff-make-temp-file buf-A buf-A-file-name)
|
(setq file-A (ediff-make-temp-file buf-A buf-A-file-name)
|
||||||
file-B (ediff-make-temp-file buf-B buf-B-file-name))
|
file-B (ediff-make-temp-file buf-B buf-B-file-name))
|
||||||
(if buf-C-is-alive
|
(if buf-C-is-alive
|
||||||
(setq file-C (ediff-make-temp-file buf-C buf-C-file-name)))
|
(setq file-C (ediff-make-temp-file buf-C buf-C-file-name)))
|
||||||
|
|
||||||
(ediff-setup (get-buffer buf-A) file-A
|
(ediff-setup (get-buffer buf-A) file-A
|
||||||
(get-buffer buf-B) file-B
|
(get-buffer buf-B) file-B
|
||||||
(if buf-C-is-alive (get-buffer buf-C))
|
(if buf-C-is-alive (get-buffer buf-C))
|
||||||
|
|
@ -503,9 +503,9 @@ expression; only file names that match the regexp are considered."
|
||||||
(let ((dir-A (ediff-get-default-directory-name))
|
(let ((dir-A (ediff-get-default-directory-name))
|
||||||
f)
|
f)
|
||||||
(list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil))
|
(list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil))
|
||||||
(ediff-read-file-name "Directory B to compare:"
|
(ediff-read-file-name "Directory B to compare:"
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-dir-B
|
ediff-last-dir-B
|
||||||
(ediff-strip-last-dir f))
|
(ediff-strip-last-dir f))
|
||||||
nil)
|
nil)
|
||||||
(read-string "Filter through regular expression: "
|
(read-string "Filter through regular expression: "
|
||||||
|
|
@ -549,14 +549,14 @@ regular expression; only file names that match the regexp are considered."
|
||||||
(let ((dir-A (ediff-get-default-directory-name))
|
(let ((dir-A (ediff-get-default-directory-name))
|
||||||
f)
|
f)
|
||||||
(list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil))
|
(list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil))
|
||||||
(setq f (ediff-read-file-name "Directory B to compare:"
|
(setq f (ediff-read-file-name "Directory B to compare:"
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-dir-B
|
ediff-last-dir-B
|
||||||
(ediff-strip-last-dir f))
|
(ediff-strip-last-dir f))
|
||||||
nil))
|
nil))
|
||||||
(ediff-read-file-name "Directory C to compare:"
|
(ediff-read-file-name "Directory C to compare:"
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-dir-C
|
ediff-last-dir-C
|
||||||
(ediff-strip-last-dir f))
|
(ediff-strip-last-dir f))
|
||||||
nil)
|
nil)
|
||||||
(read-string "Filter through regular expression: "
|
(read-string "Filter through regular expression: "
|
||||||
|
|
@ -578,9 +578,9 @@ expression; only file names that match the regexp are considered."
|
||||||
(let ((dir-A (ediff-get-default-directory-name))
|
(let ((dir-A (ediff-get-default-directory-name))
|
||||||
f)
|
f)
|
||||||
(list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil))
|
(list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil))
|
||||||
(ediff-read-file-name "Directory B to merge:"
|
(ediff-read-file-name "Directory B to merge:"
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-dir-B
|
ediff-last-dir-B
|
||||||
(ediff-strip-last-dir f))
|
(ediff-strip-last-dir f))
|
||||||
nil)
|
nil)
|
||||||
(read-string "Filter through regular expression: "
|
(read-string "Filter through regular expression: "
|
||||||
|
|
@ -607,14 +607,14 @@ only file names that match the regexp are considered."
|
||||||
(let ((dir-A (ediff-get-default-directory-name))
|
(let ((dir-A (ediff-get-default-directory-name))
|
||||||
f)
|
f)
|
||||||
(list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil))
|
(list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil))
|
||||||
(setq f (ediff-read-file-name "Directory B to merge:"
|
(setq f (ediff-read-file-name "Directory B to merge:"
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-dir-B
|
ediff-last-dir-B
|
||||||
(ediff-strip-last-dir f))
|
(ediff-strip-last-dir f))
|
||||||
nil))
|
nil))
|
||||||
(ediff-read-file-name "Ancestor directory:"
|
(ediff-read-file-name "Ancestor directory:"
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-dir-C
|
ediff-last-dir-C
|
||||||
(ediff-strip-last-dir f))
|
(ediff-strip-last-dir f))
|
||||||
nil)
|
nil)
|
||||||
(read-string "Filter through regular expression: "
|
(read-string "Filter through regular expression: "
|
||||||
|
|
@ -670,7 +670,7 @@ names. Only the files that are under revision control are taken into account."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defalias
|
(defalias
|
||||||
'edir-merge-revisions-with-ancestor
|
'edir-merge-revisions-with-ancestor
|
||||||
'ediff-merge-directory-revisions-with-ancestor)
|
'ediff-merge-directory-revisions-with-ancestor)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defalias 'edirs-merge-with-ancestor 'ediff-merge-directories-with-ancestor)
|
(defalias 'edirs-merge-with-ancestor 'ediff-merge-directories-with-ancestor)
|
||||||
|
|
@ -681,7 +681,7 @@ names. Only the files that are under revision control are taken into account."
|
||||||
;; only file names that match the regexp are considered.
|
;; only file names that match the regexp are considered.
|
||||||
;; JOBNAME is the symbol indicating the meta-job to be performed.
|
;; JOBNAME is the symbol indicating the meta-job to be performed.
|
||||||
;; MERGE-AUTOSTORE-DIR is the directory in which to store merged files.
|
;; MERGE-AUTOSTORE-DIR is the directory in which to store merged files.
|
||||||
(defun ediff-directories-internal (dir1 dir2 dir3 regexp action jobname
|
(defun ediff-directories-internal (dir1 dir2 dir3 regexp action jobname
|
||||||
&optional startup-hooks
|
&optional startup-hooks
|
||||||
merge-autostore-dir)
|
merge-autostore-dir)
|
||||||
;; ediff-read-file-name is set to attach a previously entered file name if
|
;; ediff-read-file-name is set to attach a previously entered file name if
|
||||||
|
|
@ -705,7 +705,7 @@ names. Only the files that are under revision control are taken into account."
|
||||||
(or (stringp merge-autostore-dir)
|
(or (stringp merge-autostore-dir)
|
||||||
(error "%s: Directory for storing merged files must be a string"
|
(error "%s: Directory for storing merged files must be a string"
|
||||||
jobname)))
|
jobname)))
|
||||||
(let (;; dir-diff-struct is of the form (common-list diff-list)
|
(let (;; dir-diff-struct is of the form (common-list diff-list)
|
||||||
;; It is a structure where ediff-intersect-directories returns
|
;; It is a structure where ediff-intersect-directories returns
|
||||||
;; commonalities and differences among directories
|
;; commonalities and differences among directories
|
||||||
dir-diff-struct
|
dir-diff-struct
|
||||||
|
|
@ -713,7 +713,7 @@ names. Only the files that are under revision control are taken into account."
|
||||||
(if (and ediff-autostore-merges
|
(if (and ediff-autostore-merges
|
||||||
(ediff-merge-metajob jobname)
|
(ediff-merge-metajob jobname)
|
||||||
(not merge-autostore-dir))
|
(not merge-autostore-dir))
|
||||||
(setq merge-autostore-dir
|
(setq merge-autostore-dir
|
||||||
(read-file-name "Save merged files in directory: "
|
(read-file-name "Save merged files in directory: "
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-merge-autostore-dir
|
ediff-last-merge-autostore-dir
|
||||||
|
|
@ -734,8 +734,8 @@ names. Only the files that are under revision control are taken into account."
|
||||||
(or (y-or-n-p
|
(or (y-or-n-p
|
||||||
"Directory for saving merged files = Ancestor Directory. Sure? ")
|
"Directory for saving merged files = Ancestor Directory. Sure? ")
|
||||||
(error "Directory merge aborted")))))
|
(error "Directory merge aborted")))))
|
||||||
|
|
||||||
(setq dir-diff-struct (ediff-intersect-directories
|
(setq dir-diff-struct (ediff-intersect-directories
|
||||||
jobname
|
jobname
|
||||||
regexp dir1 dir2 dir3 merge-autostore-dir))
|
regexp dir1 dir2 dir3 merge-autostore-dir))
|
||||||
(setq startup-hooks
|
(setq startup-hooks
|
||||||
|
|
@ -744,11 +744,11 @@ names. Only the files that are under revision control are taken into account."
|
||||||
(cons `(lambda ()
|
(cons `(lambda ()
|
||||||
;; tell what to do if the user clicks on a session record
|
;; tell what to do if the user clicks on a session record
|
||||||
(setq ediff-session-action-function (quote ,action))
|
(setq ediff-session-action-function (quote ,action))
|
||||||
;; set ediff-dir-difference-list
|
;; set ediff-dir-difference-list
|
||||||
(setq ediff-dir-difference-list
|
(setq ediff-dir-difference-list
|
||||||
(cdr (quote ,dir-diff-struct))))
|
(cdr (quote ,dir-diff-struct))))
|
||||||
startup-hooks))
|
startup-hooks))
|
||||||
(setq meta-buf (ediff-prepare-meta-buffer
|
(setq meta-buf (ediff-prepare-meta-buffer
|
||||||
'ediff-filegroup-action
|
'ediff-filegroup-action
|
||||||
(car dir-diff-struct)
|
(car dir-diff-struct)
|
||||||
"*Ediff Session Group Panel"
|
"*Ediff Session Group Panel"
|
||||||
|
|
@ -760,7 +760,7 @@ names. Only the files that are under revision control are taken into account."
|
||||||
|
|
||||||
;; MERGE-AUTOSTORE-DIR can be given to tell ediff where to store the merged
|
;; MERGE-AUTOSTORE-DIR can be given to tell ediff where to store the merged
|
||||||
;; files
|
;; files
|
||||||
(defun ediff-directory-revisions-internal (dir1 regexp action jobname
|
(defun ediff-directory-revisions-internal (dir1 regexp action jobname
|
||||||
&optional startup-hooks
|
&optional startup-hooks
|
||||||
merge-autostore-dir)
|
merge-autostore-dir)
|
||||||
(setq dir1 (if (file-directory-p dir1) dir1 (file-name-directory dir1)))
|
(setq dir1 (if (file-directory-p dir1) dir1 (file-name-directory dir1)))
|
||||||
|
|
@ -770,10 +770,10 @@ names. Only the files that are under revision control are taken into account."
|
||||||
(error "%S: Directory for storing merged files must be a string"
|
(error "%S: Directory for storing merged files must be a string"
|
||||||
jobname)))
|
jobname)))
|
||||||
(let (file-list meta-buf)
|
(let (file-list meta-buf)
|
||||||
(if (and ediff-autostore-merges
|
(if (and ediff-autostore-merges
|
||||||
(ediff-merge-metajob jobname)
|
(ediff-merge-metajob jobname)
|
||||||
(not merge-autostore-dir))
|
(not merge-autostore-dir))
|
||||||
(setq merge-autostore-dir
|
(setq merge-autostore-dir
|
||||||
(read-file-name "Save merged files in directory: "
|
(read-file-name "Save merged files in directory: "
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-merge-autostore-dir
|
ediff-last-merge-autostore-dir
|
||||||
|
|
@ -787,7 +787,7 @@ names. Only the files that are under revision control are taken into account."
|
||||||
(or (y-or-n-p
|
(or (y-or-n-p
|
||||||
"Directory for saving merged file = directory A. Sure? ")
|
"Directory for saving merged file = directory A. Sure? ")
|
||||||
(error "Merge of directory revisions aborted")))
|
(error "Merge of directory revisions aborted")))
|
||||||
|
|
||||||
(setq file-list
|
(setq file-list
|
||||||
(ediff-get-directory-files-under-revision
|
(ediff-get-directory-files-under-revision
|
||||||
jobname regexp dir1 merge-autostore-dir))
|
jobname regexp dir1 merge-autostore-dir))
|
||||||
|
|
@ -798,7 +798,7 @@ names. Only the files that are under revision control are taken into account."
|
||||||
;; tell what to do if the user clicks on a session record
|
;; tell what to do if the user clicks on a session record
|
||||||
(setq ediff-session-action-function (quote ,action)))
|
(setq ediff-session-action-function (quote ,action)))
|
||||||
startup-hooks))
|
startup-hooks))
|
||||||
(setq meta-buf (ediff-prepare-meta-buffer
|
(setq meta-buf (ediff-prepare-meta-buffer
|
||||||
'ediff-filegroup-action
|
'ediff-filegroup-action
|
||||||
file-list
|
file-list
|
||||||
"*Ediff Session Group Panel"
|
"*Ediff Session Group Panel"
|
||||||
|
|
@ -821,7 +821,7 @@ If WIND-B is nil, use window next to WIND-A."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(ediff-windows dumb-mode wind-A wind-B
|
(ediff-windows dumb-mode wind-A wind-B
|
||||||
startup-hooks 'ediff-windows-wordwise 'word-mode))
|
startup-hooks 'ediff-windows-wordwise 'word-mode))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-windows-linewise (dumb-mode &optional wind-A wind-B startup-hooks)
|
(defun ediff-windows-linewise (dumb-mode &optional wind-A wind-B startup-hooks)
|
||||||
"Compare WIND-A and WIND-B, which are selected by clicking, linewise.
|
"Compare WIND-A and WIND-B, which are selected by clicking, linewise.
|
||||||
|
|
@ -832,7 +832,7 @@ If WIND-B is nil, use window next to WIND-A."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(ediff-windows dumb-mode wind-A wind-B
|
(ediff-windows dumb-mode wind-A wind-B
|
||||||
startup-hooks 'ediff-windows-linewise nil))
|
startup-hooks 'ediff-windows-linewise nil))
|
||||||
|
|
||||||
;; Compare WIND-A and WIND-B, which are selected by clicking.
|
;; Compare WIND-A and WIND-B, which are selected by clicking.
|
||||||
;; With prefix argument, DUMB-MODE, or on a non-windowing display,
|
;; With prefix argument, DUMB-MODE, or on a non-windowing display,
|
||||||
;; works as follows:
|
;; works as follows:
|
||||||
|
|
@ -844,11 +844,11 @@ If WIND-B is nil, use window next to WIND-A."
|
||||||
wind-B (ediff-get-next-window wind-B wind-A))
|
wind-B (ediff-get-next-window wind-B wind-A))
|
||||||
(setq wind-A (ediff-get-window-by-clicking wind-A nil 1)
|
(setq wind-A (ediff-get-window-by-clicking wind-A nil 1)
|
||||||
wind-B (ediff-get-window-by-clicking wind-B wind-A 2)))
|
wind-B (ediff-get-window-by-clicking wind-B wind-A 2)))
|
||||||
|
|
||||||
(let ((buffer-A (window-buffer wind-A))
|
(let ((buffer-A (window-buffer wind-A))
|
||||||
(buffer-B (window-buffer wind-B))
|
(buffer-B (window-buffer wind-B))
|
||||||
beg-A end-A beg-B end-B)
|
beg-A end-A beg-B end-B)
|
||||||
|
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(save-window-excursion
|
(save-window-excursion
|
||||||
(sit-for 0) ; sync before using window-start/end -- a precaution
|
(sit-for 0) ; sync before using window-start/end -- a precaution
|
||||||
|
|
@ -867,7 +867,7 @@ If WIND-B is nil, use window next to WIND-A."
|
||||||
(ediff-regions-internal
|
(ediff-regions-internal
|
||||||
buffer-A beg-A end-A buffer-B beg-B end-B
|
buffer-A beg-A end-A buffer-B beg-B end-B
|
||||||
startup-hooks job-name word-mode nil)))
|
startup-hooks job-name word-mode nil)))
|
||||||
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-regions-wordwise (buffer-A buffer-B &optional startup-hooks)
|
(defun ediff-regions-wordwise (buffer-A buffer-B &optional startup-hooks)
|
||||||
|
|
@ -878,7 +878,7 @@ In such a case the user is asked to interactively establish the second
|
||||||
region.
|
region.
|
||||||
This function is effective only for relatively small regions, up to 200
|
This function is effective only for relatively small regions, up to 200
|
||||||
lines. For large regions, use `ediff-regions-linewise'."
|
lines. For large regions, use `ediff-regions-linewise'."
|
||||||
(interactive
|
(interactive
|
||||||
(let (bf)
|
(let (bf)
|
||||||
(list (setq bf (read-buffer "Region's A buffer: "
|
(list (setq bf (read-buffer "Region's A buffer: "
|
||||||
(ediff-other-buffer "") t))
|
(ediff-other-buffer "") t))
|
||||||
|
|
@ -893,8 +893,8 @@ lines. For large regions, use `ediff-regions-linewise'."
|
||||||
(error "Buffer %S doesn't exist" buffer-A))
|
(error "Buffer %S doesn't exist" buffer-A))
|
||||||
(if (not (ediff-buffer-live-p buffer-B))
|
(if (not (ediff-buffer-live-p buffer-B))
|
||||||
(error "Buffer %S doesn't exist" buffer-B))
|
(error "Buffer %S doesn't exist" buffer-B))
|
||||||
|
|
||||||
|
|
||||||
(let ((buffer-A
|
(let ((buffer-A
|
||||||
(ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-"))
|
(ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-"))
|
||||||
(buffer-B
|
(buffer-B
|
||||||
|
|
@ -907,12 +907,12 @@ lines. For large regions, use `ediff-regions-linewise'."
|
||||||
(set-buffer buffer-B)
|
(set-buffer buffer-B)
|
||||||
(setq reg-B-beg (region-beginning)
|
(setq reg-B-beg (region-beginning)
|
||||||
reg-B-end (region-end)))
|
reg-B-end (region-end)))
|
||||||
|
|
||||||
(ediff-regions-internal
|
(ediff-regions-internal
|
||||||
(get-buffer buffer-A) reg-A-beg reg-A-end
|
(get-buffer buffer-A) reg-A-beg reg-A-end
|
||||||
(get-buffer buffer-B) reg-B-beg reg-B-end
|
(get-buffer buffer-B) reg-B-beg reg-B-end
|
||||||
startup-hooks 'ediff-regions-wordwise 'word-mode nil)))
|
startup-hooks 'ediff-regions-wordwise 'word-mode nil)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-regions-linewise (buffer-A buffer-B &optional startup-hooks)
|
(defun ediff-regions-linewise (buffer-A buffer-B &optional startup-hooks)
|
||||||
"Run Ediff on a pair of regions in specified buffers.
|
"Run Ediff on a pair of regions in specified buffers.
|
||||||
|
|
@ -923,7 +923,7 @@ region.
|
||||||
Each region is enlarged to contain full lines.
|
Each region is enlarged to contain full lines.
|
||||||
This function is effective for large regions, over 100-200
|
This function is effective for large regions, over 100-200
|
||||||
lines. For small regions, use `ediff-regions-wordwise'."
|
lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
(interactive
|
(interactive
|
||||||
(let (bf)
|
(let (bf)
|
||||||
(list (setq bf (read-buffer "Region A's buffer: "
|
(list (setq bf (read-buffer "Region A's buffer: "
|
||||||
(ediff-other-buffer "") t))
|
(ediff-other-buffer "") t))
|
||||||
|
|
@ -938,7 +938,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
(error "Buffer %S doesn't exist" buffer-A))
|
(error "Buffer %S doesn't exist" buffer-A))
|
||||||
(if (not (ediff-buffer-live-p buffer-B))
|
(if (not (ediff-buffer-live-p buffer-B))
|
||||||
(error "Buffer %S doesn't exist" buffer-B))
|
(error "Buffer %S doesn't exist" buffer-B))
|
||||||
|
|
||||||
(let ((buffer-A
|
(let ((buffer-A
|
||||||
(ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-"))
|
(ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-"))
|
||||||
(buffer-B
|
(buffer-B
|
||||||
|
|
@ -949,41 +949,41 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
(setq reg-A-beg (region-beginning)
|
(setq reg-A-beg (region-beginning)
|
||||||
reg-A-end (region-end))
|
reg-A-end (region-end))
|
||||||
;; enlarge the region to hold full lines
|
;; enlarge the region to hold full lines
|
||||||
(goto-char reg-A-beg)
|
(goto-char reg-A-beg)
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(setq reg-A-beg (point))
|
(setq reg-A-beg (point))
|
||||||
(goto-char reg-A-end)
|
(goto-char reg-A-end)
|
||||||
(end-of-line)
|
(end-of-line)
|
||||||
(or (eobp) (forward-char)) ; include the newline char
|
(or (eobp) (forward-char)) ; include the newline char
|
||||||
(setq reg-A-end (point))
|
(setq reg-A-end (point))
|
||||||
|
|
||||||
(set-buffer buffer-B)
|
(set-buffer buffer-B)
|
||||||
(setq reg-B-beg (region-beginning)
|
(setq reg-B-beg (region-beginning)
|
||||||
reg-B-end (region-end))
|
reg-B-end (region-end))
|
||||||
;; enlarge the region to hold full lines
|
;; enlarge the region to hold full lines
|
||||||
(goto-char reg-B-beg)
|
(goto-char reg-B-beg)
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(setq reg-B-beg (point))
|
(setq reg-B-beg (point))
|
||||||
(goto-char reg-B-end)
|
(goto-char reg-B-end)
|
||||||
(end-of-line)
|
(end-of-line)
|
||||||
(or (eobp) (forward-char)) ; include the newline char
|
(or (eobp) (forward-char)) ; include the newline char
|
||||||
(setq reg-B-end (point))
|
(setq reg-B-end (point))
|
||||||
) ; save excursion
|
) ; save excursion
|
||||||
|
|
||||||
(ediff-regions-internal
|
(ediff-regions-internal
|
||||||
(get-buffer buffer-A) reg-A-beg reg-A-end
|
(get-buffer buffer-A) reg-A-beg reg-A-end
|
||||||
(get-buffer buffer-B) reg-B-beg reg-B-end
|
(get-buffer buffer-B) reg-B-beg reg-B-end
|
||||||
startup-hooks 'ediff-regions-linewise nil nil))) ; no word mode
|
startup-hooks 'ediff-regions-linewise nil nil))) ; no word mode
|
||||||
|
|
||||||
;; compare region beg-A to end-A of buffer-A
|
;; compare region beg-A to end-A of buffer-A
|
||||||
;; to regions beg-B -- end-B in buffer-B.
|
;; to regions beg-B -- end-B in buffer-B.
|
||||||
(defun ediff-regions-internal (buffer-A beg-A end-A buffer-B beg-B end-B
|
(defun ediff-regions-internal (buffer-A beg-A end-A buffer-B beg-B end-B
|
||||||
startup-hooks job-name word-mode
|
startup-hooks job-name word-mode
|
||||||
setup-parameters)
|
setup-parameters)
|
||||||
(let ((tmp-buffer (get-buffer-create ediff-tmp-buffer))
|
(let ((tmp-buffer (get-buffer-create ediff-tmp-buffer))
|
||||||
overl-A overl-B
|
overl-A overl-B
|
||||||
file-A file-B)
|
file-A file-B)
|
||||||
|
|
||||||
;; in case beg/end-A/B aren't markers--make them into markers
|
;; in case beg/end-A/B aren't markers--make them into markers
|
||||||
(ediff-with-current-buffer buffer-A
|
(ediff-with-current-buffer buffer-A
|
||||||
(setq beg-A (move-marker (make-marker) beg-A)
|
(setq beg-A (move-marker (make-marker) beg-A)
|
||||||
|
|
@ -991,19 +991,19 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
(ediff-with-current-buffer buffer-B
|
(ediff-with-current-buffer buffer-B
|
||||||
(setq beg-B (move-marker (make-marker) beg-B)
|
(setq beg-B (move-marker (make-marker) beg-B)
|
||||||
end-B (move-marker (make-marker) end-B)))
|
end-B (move-marker (make-marker) end-B)))
|
||||||
|
|
||||||
;; make file-A
|
;; make file-A
|
||||||
(if word-mode
|
(if word-mode
|
||||||
(ediff-wordify beg-A end-A buffer-A tmp-buffer)
|
(ediff-wordify beg-A end-A buffer-A tmp-buffer)
|
||||||
(ediff-copy-to-buffer beg-A end-A buffer-A tmp-buffer))
|
(ediff-copy-to-buffer beg-A end-A buffer-A tmp-buffer))
|
||||||
(setq file-A (ediff-make-temp-file tmp-buffer "regA"))
|
(setq file-A (ediff-make-temp-file tmp-buffer "regA"))
|
||||||
|
|
||||||
;; make file-B
|
;; make file-B
|
||||||
(if word-mode
|
(if word-mode
|
||||||
(ediff-wordify beg-B end-B buffer-B tmp-buffer)
|
(ediff-wordify beg-B end-B buffer-B tmp-buffer)
|
||||||
(ediff-copy-to-buffer beg-B end-B buffer-B tmp-buffer))
|
(ediff-copy-to-buffer beg-B end-B buffer-B tmp-buffer))
|
||||||
(setq file-B (ediff-make-temp-file tmp-buffer "regB"))
|
(setq file-B (ediff-make-temp-file tmp-buffer "regB"))
|
||||||
|
|
||||||
(setq overl-A (ediff-make-bullet-proof-overlay beg-A end-A buffer-A))
|
(setq overl-A (ediff-make-bullet-proof-overlay beg-A end-A buffer-A))
|
||||||
(setq overl-B (ediff-make-bullet-proof-overlay beg-B end-B buffer-B))
|
(setq overl-B (ediff-make-bullet-proof-overlay beg-B end-B buffer-B))
|
||||||
(ediff-setup buffer-A file-A
|
(ediff-setup buffer-A file-A
|
||||||
|
|
@ -1019,13 +1019,13 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
(cons 'ediff-job-name job-name))
|
(cons 'ediff-job-name job-name))
|
||||||
setup-parameters))
|
setup-parameters))
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
;;; Merge files and buffers
|
;;; Merge files and buffers
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defalias 'ediff-merge 'ediff-merge-files)
|
(defalias 'ediff-merge 'ediff-merge-files)
|
||||||
|
|
||||||
(defsubst ediff-merge-on-startup ()
|
(defsubst ediff-merge-on-startup ()
|
||||||
(ediff-do-merge 0)
|
(ediff-do-merge 0)
|
||||||
(ediff-with-current-buffer ediff-buffer-C
|
(ediff-with-current-buffer ediff-buffer-C
|
||||||
|
|
@ -1034,7 +1034,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-merge-files (file-A file-B
|
(defun ediff-merge-files (file-A file-B
|
||||||
;; MERGE-BUFFER-FILE is the file to be
|
;; MERGE-BUFFER-FILE is the file to be
|
||||||
;; associated with the merge buffer
|
;; associated with the merge buffer
|
||||||
&optional startup-hooks merge-buffer-file)
|
&optional startup-hooks merge-buffer-file)
|
||||||
"Merge two files without ancestor."
|
"Merge two files without ancestor."
|
||||||
(interactive
|
(interactive
|
||||||
|
|
@ -1047,10 +1047,10 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
dir-A
|
dir-A
|
||||||
(ediff-get-default-file-name)
|
(ediff-get-default-file-name)
|
||||||
'no-dirs))
|
'no-dirs))
|
||||||
(ediff-read-file-name "File B to merge"
|
(ediff-read-file-name "File B to merge"
|
||||||
(setq dir-B
|
(setq dir-B
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-dir-B
|
ediff-last-dir-B
|
||||||
(file-name-directory f)))
|
(file-name-directory f)))
|
||||||
(progn
|
(progn
|
||||||
(setq file-name-history
|
(setq file-name-history
|
||||||
|
|
@ -1062,7 +1062,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
(ediff-get-default-file-name f 1)))
|
(ediff-get-default-file-name f 1)))
|
||||||
)))
|
)))
|
||||||
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
|
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
|
||||||
(ediff-files-internal file-A
|
(ediff-files-internal file-A
|
||||||
(if (file-directory-p file-B)
|
(if (file-directory-p file-B)
|
||||||
(expand-file-name
|
(expand-file-name
|
||||||
(file-name-nondirectory file-A) file-B)
|
(file-name-nondirectory file-A) file-B)
|
||||||
|
|
@ -1071,7 +1071,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
startup-hooks
|
startup-hooks
|
||||||
'ediff-merge-files
|
'ediff-merge-files
|
||||||
merge-buffer-file))
|
merge-buffer-file))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-merge-files-with-ancestor (file-A file-B file-ancestor
|
(defun ediff-merge-files-with-ancestor (file-A file-B file-ancestor
|
||||||
&optional
|
&optional
|
||||||
|
|
@ -1091,10 +1091,10 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
dir-A
|
dir-A
|
||||||
(ediff-get-default-file-name)
|
(ediff-get-default-file-name)
|
||||||
'no-dirs))
|
'no-dirs))
|
||||||
(setq ff (ediff-read-file-name "File B to merge"
|
(setq ff (ediff-read-file-name "File B to merge"
|
||||||
(setq dir-B
|
(setq dir-B
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-dir-B
|
ediff-last-dir-B
|
||||||
(file-name-directory f)))
|
(file-name-directory f)))
|
||||||
(progn
|
(progn
|
||||||
(setq file-name-history
|
(setq file-name-history
|
||||||
|
|
@ -1105,7 +1105,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
dir-B))
|
dir-B))
|
||||||
file-name-history))
|
file-name-history))
|
||||||
(ediff-get-default-file-name f 1))))
|
(ediff-get-default-file-name f 1))))
|
||||||
(ediff-read-file-name "Ancestor file"
|
(ediff-read-file-name "Ancestor file"
|
||||||
(setq dir-ancestor
|
(setq dir-ancestor
|
||||||
(if ediff-use-last-dir
|
(if ediff-use-last-dir
|
||||||
ediff-last-dir-ancestor
|
ediff-last-dir-ancestor
|
||||||
|
|
@ -1120,7 +1120,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
(ediff-get-default-file-name ff 2)))
|
(ediff-get-default-file-name ff 2)))
|
||||||
)))
|
)))
|
||||||
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
|
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
|
||||||
(ediff-files-internal file-A
|
(ediff-files-internal file-A
|
||||||
(if (file-directory-p file-B)
|
(if (file-directory-p file-B)
|
||||||
(expand-file-name
|
(expand-file-name
|
||||||
(file-name-nondirectory file-A) file-B)
|
(file-name-nondirectory file-A) file-B)
|
||||||
|
|
@ -1129,10 +1129,10 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
startup-hooks
|
startup-hooks
|
||||||
'ediff-merge-files-with-ancestor
|
'ediff-merge-files-with-ancestor
|
||||||
merge-buffer-file))
|
merge-buffer-file))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defalias 'ediff-merge-with-ancestor 'ediff-merge-files-with-ancestor)
|
(defalias 'ediff-merge-with-ancestor 'ediff-merge-files-with-ancestor)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-merge-buffers (buffer-A buffer-B
|
(defun ediff-merge-buffers (buffer-A buffer-B
|
||||||
&optional
|
&optional
|
||||||
|
|
@ -1140,7 +1140,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
;; associated with the merge buffer
|
;; associated with the merge buffer
|
||||||
startup-hooks job-name merge-buffer-file)
|
startup-hooks job-name merge-buffer-file)
|
||||||
"Merge buffers without ancestor."
|
"Merge buffers without ancestor."
|
||||||
(interactive
|
(interactive
|
||||||
(let (bf)
|
(let (bf)
|
||||||
(list (setq bf (read-buffer "Buffer A to merge: "
|
(list (setq bf (read-buffer "Buffer A to merge: "
|
||||||
(ediff-other-buffer "") t))
|
(ediff-other-buffer "") t))
|
||||||
|
|
@ -1151,12 +1151,12 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
(save-window-excursion (other-window 1))
|
(save-window-excursion (other-window 1))
|
||||||
(ediff-other-buffer bf))
|
(ediff-other-buffer bf))
|
||||||
t))))
|
t))))
|
||||||
|
|
||||||
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
|
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
|
||||||
(or job-name (setq job-name 'ediff-merge-buffers))
|
(or job-name (setq job-name 'ediff-merge-buffers))
|
||||||
(ediff-buffers-internal
|
(ediff-buffers-internal
|
||||||
buffer-A buffer-B nil startup-hooks job-name merge-buffer-file))
|
buffer-A buffer-B nil startup-hooks job-name merge-buffer-file))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-merge-buffers-with-ancestor (buffer-A buffer-B buffer-ancestor
|
(defun ediff-merge-buffers-with-ancestor (buffer-A buffer-B buffer-ancestor
|
||||||
&optional
|
&optional
|
||||||
|
|
@ -1167,7 +1167,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
;; with the merge buffer
|
;; with the merge buffer
|
||||||
merge-buffer-file)
|
merge-buffer-file)
|
||||||
"Merge buffers with ancestor."
|
"Merge buffers with ancestor."
|
||||||
(interactive
|
(interactive
|
||||||
(let (bf bff)
|
(let (bf bff)
|
||||||
(list (setq bf (read-buffer "Buffer A to merge: "
|
(list (setq bf (read-buffer "Buffer A to merge: "
|
||||||
(ediff-other-buffer "") t))
|
(ediff-other-buffer "") t))
|
||||||
|
|
@ -1186,12 +1186,12 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||||
(ediff-other-buffer (list bf bff)))
|
(ediff-other-buffer (list bf bff)))
|
||||||
t)
|
t)
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
|
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
|
||||||
(or job-name (setq job-name 'ediff-merge-buffers-with-ancestor))
|
(or job-name (setq job-name 'ediff-merge-buffers-with-ancestor))
|
||||||
(ediff-buffers-internal
|
(ediff-buffers-internal
|
||||||
buffer-A buffer-B buffer-ancestor startup-hooks job-name merge-buffer-file))
|
buffer-A buffer-B buffer-ancestor startup-hooks job-name merge-buffer-file))
|
||||||
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file)
|
(defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file)
|
||||||
|
|
@ -1219,7 +1219,7 @@ buffer."
|
||||||
(funcall
|
(funcall
|
||||||
(intern (format "ediff-%S-merge-internal" ediff-version-control-package))
|
(intern (format "ediff-%S-merge-internal" ediff-version-control-package))
|
||||||
rev1 rev2 nil startup-hooks merge-buffer-file)))
|
rev1 rev2 nil startup-hooks merge-buffer-file)))
|
||||||
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-merge-revisions-with-ancestor (&optional
|
(defun ediff-merge-revisions-with-ancestor (&optional
|
||||||
|
|
@ -1269,8 +1269,8 @@ file and then run `run-ediff-from-cvs-buffer'."
|
||||||
(if tin
|
(if tin
|
||||||
(cvs-run-ediff-on-file-descriptor tin)
|
(cvs-run-ediff-on-file-descriptor tin)
|
||||||
(error "There is no file to merge"))))
|
(error "There is no file to merge"))))
|
||||||
|
|
||||||
|
|
||||||
;;; Apply patch
|
;;; Apply patch
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
@ -1294,7 +1294,7 @@ buffer. If odd -- assume it is in a file."
|
||||||
(buffer-file-name patch-buf))))
|
(buffer-file-name patch-buf))))
|
||||||
(t default-directory)))
|
(t default-directory)))
|
||||||
(setq source-file
|
(setq source-file
|
||||||
(read-file-name
|
(read-file-name
|
||||||
"File to patch (directory, if multifile patch): "
|
"File to patch (directory, if multifile patch): "
|
||||||
;; use an explicit initial file
|
;; use an explicit initial file
|
||||||
source-dir nil nil (ediff-get-default-file-name)))
|
source-dir nil nil (ediff-get-default-file-name)))
|
||||||
|
|
@ -1317,7 +1317,7 @@ With prefix arg=2: assumes the patch is in a buffer and prompts for the buffer."
|
||||||
(read-buffer
|
(read-buffer
|
||||||
"Which buffer to patch? "
|
"Which buffer to patch? "
|
||||||
(current-buffer))))
|
(current-buffer))))
|
||||||
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defalias 'epatch 'ediff-patch-file)
|
(defalias 'epatch 'ediff-patch-file)
|
||||||
|
|
@ -1327,8 +1327,8 @@ With prefix arg=2: assumes the patch is in a buffer and prompts for the buffer."
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Versions Control functions
|
;;; Versions Control functions
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ediff-revision (&optional file startup-hooks)
|
(defun ediff-revision (&optional file startup-hooks)
|
||||||
"Run Ediff by comparing versions of a file.
|
"Run Ediff by comparing versions of a file.
|
||||||
|
|
@ -1344,7 +1344,7 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
|
||||||
ediff-last-dir-A
|
ediff-last-dir-A
|
||||||
default-directory)
|
default-directory)
|
||||||
(ediff-get-default-file-name)
|
(ediff-get-default-file-name)
|
||||||
'no-dirs)))
|
'no-dirs)))
|
||||||
(find-file file)
|
(find-file file)
|
||||||
(if (and (buffer-modified-p)
|
(if (and (buffer-modified-p)
|
||||||
(y-or-n-p (message "Buffer %s is modified. Save buffer? "
|
(y-or-n-p (message "Buffer %s is modified. Save buffer? "
|
||||||
|
|
@ -1356,7 +1356,7 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
|
||||||
(format "Revision 1 to compare (default: %s's latest revision): "
|
(format "Revision 1 to compare (default: %s's latest revision): "
|
||||||
(file-name-nondirectory file)))
|
(file-name-nondirectory file)))
|
||||||
rev2
|
rev2
|
||||||
(read-string
|
(read-string
|
||||||
(format "Revision 2 to compare (default: %s's current state): "
|
(format "Revision 2 to compare (default: %s's current state): "
|
||||||
(file-name-nondirectory file))))
|
(file-name-nondirectory file))))
|
||||||
(ediff-load-version-control)
|
(ediff-load-version-control)
|
||||||
|
|
@ -1368,8 +1368,8 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defalias 'erevision 'ediff-revision)
|
(defalias 'erevision 'ediff-revision)
|
||||||
|
|
||||||
|
|
||||||
;; Test if version control package is loaded and load if not
|
;; Test if version control package is loaded and load if not
|
||||||
;; Is SILENT is non-nil, don't report error if package is not found.
|
;; Is SILENT is non-nil, don't report error if package is not found.
|
||||||
(defun ediff-load-version-control (&optional silent)
|
(defun ediff-load-version-control (&optional silent)
|
||||||
|
|
@ -1420,7 +1420,7 @@ With optional NODE, goes to that node."
|
||||||
(progn
|
(progn
|
||||||
(select-window ctl-window)
|
(select-window ctl-window)
|
||||||
(set-window-buffer ctl-window ctl-buf)))))))
|
(set-window-buffer ctl-window ctl-buf)))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
;; in a special buffer. It prompts you to type a key sequence,
|
;; in a special buffer. It prompts you to type a key sequence,
|
||||||
;; which should be one of:
|
;; which should be one of:
|
||||||
;;
|
;;
|
||||||
;; * RET or `C-x e' (call-last-kbd-macro), to edit the most
|
;; * RET or `C-x e' (call-last-kbd-macro), to edit the most
|
||||||
;; recently defined keyboard macro.
|
;; recently defined keyboard macro.
|
||||||
;;
|
;;
|
||||||
;; * `M-x' followed by a command name, to edit a named command
|
;; * `M-x' followed by a command name, to edit a named command
|
||||||
|
|
@ -105,7 +105,7 @@ With a prefix argument, format the macro in a more concise way."
|
||||||
(cond (store-hook
|
(cond (store-hook
|
||||||
(setq mac keys)
|
(setq mac keys)
|
||||||
(setq cmd nil))
|
(setq cmd nil))
|
||||||
((or (memq cmd '(call-last-kbd-macro kmacro-call-macro
|
((or (memq cmd '(call-last-kbd-macro kmacro-call-macro
|
||||||
kmacro-end-or-call-macro kmacro-end-and-call-macro))
|
kmacro-end-or-call-macro kmacro-end-and-call-macro))
|
||||||
(member keys '("\r" [return])))
|
(member keys '("\r" [return])))
|
||||||
(or last-kbd-macro
|
(or last-kbd-macro
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit."
|
||||||
(condition-case ()
|
(condition-case ()
|
||||||
(funcall (or default-major-mode 'fundamental-mode))
|
(funcall (or default-major-mode 'fundamental-mode))
|
||||||
(error nil))
|
(error nil))
|
||||||
|
|
||||||
(set-window-configuration config)
|
(set-window-configuration config)
|
||||||
(when bury
|
(when bury
|
||||||
;;>> Perhaps this shouldn't be done,
|
;;>> Perhaps this shouldn't be done,
|
||||||
|
|
@ -211,8 +211,8 @@ BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit."
|
||||||
(Electric-command-loop
|
(Electric-command-loop
|
||||||
'exit
|
'exit
|
||||||
(function (lambda ()
|
(function (lambda ()
|
||||||
(sit-for 0) ;necessary if last command was end-of-buffer or
|
(sit-for 0) ;necessary if last command was end-of-buffer or
|
||||||
;beginning-of-buffer - otherwise pos-visible-in-window-p
|
;beginning-of-buffer - otherwise pos-visible-in-window-p
|
||||||
;will yield a wrong result.
|
;will yield a wrong result.
|
||||||
(let ((min (pos-visible-in-window-p (point-min)))
|
(let ((min (pos-visible-in-window-p (point-min)))
|
||||||
(max (pos-visible-in-window-p (point-max))))
|
(max (pos-visible-in-window-p (point-max))))
|
||||||
|
|
@ -343,7 +343,7 @@ will select it.)"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; This is to be bound to M-x in ehelp mode. Retains ehelp buffer and then
|
;; This is to be bound to M-x in ehelp mode. Retains ehelp buffer and then
|
||||||
;; continues with execute-extended-command.
|
;; continues with execute-extended-command.
|
||||||
(defun electric-help-execute-extended (prefixarg)
|
(defun electric-help-execute-extended (prefixarg)
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
|
|
@ -407,7 +407,7 @@ will select it.)"
|
||||||
(defvar ehelp-map ())
|
(defvar ehelp-map ())
|
||||||
(if ehelp-map
|
(if ehelp-map
|
||||||
nil
|
nil
|
||||||
(let ((map (copy-keymap help-map)))
|
(let ((map (copy-keymap help-map)))
|
||||||
(substitute-key-definition 'apropos 'electric-apropos map)
|
(substitute-key-definition 'apropos 'electric-apropos map)
|
||||||
(substitute-key-definition 'command-apropos 'electric-command-apropos map)
|
(substitute-key-definition 'command-apropos 'electric-command-apropos map)
|
||||||
(substitute-key-definition 'describe-key 'electric-describe-key map)
|
(substitute-key-definition 'describe-key 'electric-describe-key map)
|
||||||
|
|
@ -421,6 +421,6 @@ will select it.)"
|
||||||
(setq ehelp-map map)
|
(setq ehelp-map map)
|
||||||
(fset 'ehelp-command map)))
|
(fset 'ehelp-command map)))
|
||||||
|
|
||||||
(provide 'ehelp)
|
(provide 'ehelp)
|
||||||
|
|
||||||
;;; ehelp.el ends here
|
;;; ehelp.el ends here
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,8 @@
|
||||||
&optional prompt inhibit-quit
|
&optional prompt inhibit-quit
|
||||||
loop-function loop-state)
|
loop-function loop-state)
|
||||||
|
|
||||||
(let (cmd
|
(let (cmd
|
||||||
(err nil)
|
(err nil)
|
||||||
(prompt-string prompt))
|
(prompt-string prompt))
|
||||||
(while t
|
(while t
|
||||||
(if (not (or (stringp prompt) (eq prompt nil) (eq prompt 'noprompt)))
|
(if (not (or (stringp prompt) (eq prompt nil) (eq prompt 'noprompt)))
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
(ding)
|
(ding)
|
||||||
(throw return-tag nil))
|
(throw return-tag nil))
|
||||||
|
|
||||||
;; This function is like pop-to-buffer, sort of.
|
;; This function is like pop-to-buffer, sort of.
|
||||||
;; The algorithm is
|
;; The algorithm is
|
||||||
;; If there is a window displaying buffer
|
;; If there is a window displaying buffer
|
||||||
;; Select it
|
;; Select it
|
||||||
|
|
|
||||||
|
|
@ -64,11 +64,11 @@ Differs from `save-excursion' in that it doesn't save the point and mark."
|
||||||
,@forms)
|
,@forms)
|
||||||
(set-buffer StartBuffer))))
|
(set-buffer StartBuffer))))
|
||||||
|
|
||||||
(defmacro emerge-defvar-local (var value doc)
|
(defmacro emerge-defvar-local (var value doc)
|
||||||
"Defines SYMBOL as an advertised variable.
|
"Defines SYMBOL as an advertised variable.
|
||||||
Performs a defvar, then executes `make-variable-buffer-local' on
|
Performs a defvar, then executes `make-variable-buffer-local' on
|
||||||
the variable. Also sets the `preserved' property, so that
|
the variable. Also sets the `preserved' property, so that
|
||||||
`kill-all-local-variables' (called by major-mode setting commands)
|
`kill-all-local-variables' (called by major-mode setting commands)
|
||||||
won't destroy Emerge control variables."
|
won't destroy Emerge control variables."
|
||||||
`(progn
|
`(progn
|
||||||
(defvar ,var ,value ,doc)
|
(defvar ,var ,value ,doc)
|
||||||
|
|
@ -127,7 +127,7 @@ When called interactively, displays the version."
|
||||||
;; to be provided (emerge-diff-options). The order in which the file names
|
;; to be provided (emerge-diff-options). The order in which the file names
|
||||||
;; are given is fixed.
|
;; are given is fixed.
|
||||||
;; The file names are always expanded (see expand-file-name) before being
|
;; The file names are always expanded (see expand-file-name) before being
|
||||||
;; passed to diff, thus they need not be invoked under a shell that
|
;; passed to diff, thus they need not be invoked under a shell that
|
||||||
;; understands `~'.
|
;; understands `~'.
|
||||||
;; The code which processes the diff/diff3 output depends on all the
|
;; The code which processes the diff/diff3 output depends on all the
|
||||||
;; finicky details of their output, including the somewhat strange
|
;; finicky details of their output, including the somewhat strange
|
||||||
|
|
@ -578,7 +578,7 @@ This is *not* a user option, since Emerge uses it for its own processing.")
|
||||||
(if output-file
|
(if output-file
|
||||||
(setq emerge-last-dir-output (file-name-directory output-file)))
|
(setq emerge-last-dir-output (file-name-directory output-file)))
|
||||||
;; Make sure the entire files are seen, and they reflect what is on disk
|
;; Make sure the entire files are seen, and they reflect what is on disk
|
||||||
(emerge-eval-in-buffer
|
(emerge-eval-in-buffer
|
||||||
buffer-A
|
buffer-A
|
||||||
(widen)
|
(widen)
|
||||||
(let ((temp (file-local-copy file-A)))
|
(let ((temp (file-local-copy file-A)))
|
||||||
|
|
@ -842,7 +842,7 @@ This is *not* a user option, since Emerge uses it for its own processing.")
|
||||||
;; if the A and B files are the same, ignore the difference
|
;; if the A and B files are the same, ignore the difference
|
||||||
(if (not (string-equal agreement "2"))
|
(if (not (string-equal agreement "2"))
|
||||||
(setq list
|
(setq list
|
||||||
(cons
|
(cons
|
||||||
(let (group-1 group-3 pos)
|
(let (group-1 group-3 pos)
|
||||||
(setq pos (point))
|
(setq pos (point))
|
||||||
(setq group-1 (emerge-get-diff3-group "1"))
|
(setq group-1 (emerge-get-diff3-group "1"))
|
||||||
|
|
@ -1022,7 +1022,7 @@ This is *not* a user option, since Emerge uses it for its own processing.")
|
||||||
(emerge-files-with-ancestor-internal
|
(emerge-files-with-ancestor-internal
|
||||||
file-a file-b file-anc nil
|
file-a file-b file-anc nil
|
||||||
(list `(lambda () (emerge-command-exit ,file-out))))))
|
(list `(lambda () (emerge-command-exit ,file-out))))))
|
||||||
|
|
||||||
(defun emerge-command-exit (file-out)
|
(defun emerge-command-exit (file-out)
|
||||||
(emerge-write-and-delete file-out)
|
(emerge-write-and-delete file-out)
|
||||||
(kill-emacs (if emerge-prefix-argument 1 0)))
|
(kill-emacs (if emerge-prefix-argument 1 0)))
|
||||||
|
|
@ -1270,7 +1270,7 @@ Otherwise, the A or B file present is copied to the output file."
|
||||||
(emerge-files (not (not file-out)) file-A file-B file-out
|
(emerge-files (not (not file-out)) file-A file-B file-out
|
||||||
nil
|
nil
|
||||||
;; When done, return to this buffer.
|
;; When done, return to this buffer.
|
||||||
(list
|
(list
|
||||||
`(lambda ()
|
`(lambda ()
|
||||||
(switch-to-buffer ,(current-buffer))
|
(switch-to-buffer ,(current-buffer))
|
||||||
(message "Merge done.")))))
|
(message "Merge done.")))))
|
||||||
|
|
@ -1294,7 +1294,7 @@ Otherwise, the A or B file present is copied to the output file."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun emerge-merge-directories (a-dir b-dir ancestor-dir output-dir)
|
(defun emerge-merge-directories (a-dir b-dir ancestor-dir output-dir)
|
||||||
(interactive
|
(interactive
|
||||||
(list
|
(list
|
||||||
(read-file-name "A directory: " nil nil 'confirm)
|
(read-file-name "A directory: " nil nil 'confirm)
|
||||||
(read-file-name "B directory: " nil nil 'confirm)
|
(read-file-name "B directory: " nil nil 'confirm)
|
||||||
|
|
@ -1539,7 +1539,7 @@ These characteristics are restored by `emerge-restore-buffer-characteristics'."
|
||||||
;; fast access
|
;; fast access
|
||||||
(setq emerge-difference-list (apply 'vector (nreverse marker-list)))))
|
(setq emerge-difference-list (apply 'vector (nreverse marker-list)))))
|
||||||
|
|
||||||
;; If we have an ancestor, select all B variants that we prefer
|
;; If we have an ancestor, select all B variants that we prefer
|
||||||
(defun emerge-select-prefer-Bs ()
|
(defun emerge-select-prefer-Bs ()
|
||||||
(let ((n 0))
|
(let ((n 0))
|
||||||
(while (< n emerge-number-of-differences)
|
(while (< n emerge-number-of-differences)
|
||||||
|
|
@ -1663,7 +1663,7 @@ the height of the merge window.
|
||||||
`C-u -' alone as argument scrolls half the height of the merge window."
|
`C-u -' alone as argument scrolls half the height of the merge window."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(emerge-operate-on-windows
|
(emerge-operate-on-windows
|
||||||
'scroll-up
|
'scroll-up
|
||||||
;; calculate argument to scroll-up
|
;; calculate argument to scroll-up
|
||||||
;; if there is an explicit argument
|
;; if there is an explicit argument
|
||||||
(if (and arg (not (equal arg '-)))
|
(if (and arg (not (equal arg '-)))
|
||||||
|
|
@ -1906,7 +1906,7 @@ buffer after this will cause serious problems."
|
||||||
(run-hooks 'emerge-quit-hook)))
|
(run-hooks 'emerge-quit-hook)))
|
||||||
|
|
||||||
(defun emerge-select-A (&optional force)
|
(defun emerge-select-A (&optional force)
|
||||||
"Select the A variant of this difference.
|
"Select the A variant of this difference.
|
||||||
Refuses to function if this difference has been edited, i.e., if it
|
Refuses to function if this difference has been edited, i.e., if it
|
||||||
is neither the A nor the B variant.
|
is neither the A nor the B variant.
|
||||||
A prefix argument forces the variant to be selected
|
A prefix argument forces the variant to be selected
|
||||||
|
|
@ -2579,15 +2579,15 @@ been edited."
|
||||||
(if (= c ?%)
|
(if (= c ?%)
|
||||||
(progn
|
(progn
|
||||||
(setq i (1+ i))
|
(setq i (1+ i))
|
||||||
(setq c
|
(setq c
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(aref template i)
|
(aref template i)
|
||||||
(error ?%)))
|
(error ?%)))
|
||||||
(cond ((= c ?a)
|
(cond ((= c ?a)
|
||||||
(insert-buffer-substring emerge-A-buffer A-begin A-end))
|
(insert-buffer-substring emerge-A-buffer A-begin A-end))
|
||||||
((= c ?b)
|
((= c ?b)
|
||||||
(insert-buffer-substring emerge-B-buffer B-begin B-end))
|
(insert-buffer-substring emerge-B-buffer B-begin B-end))
|
||||||
((= c ?%)
|
((= c ?%)
|
||||||
(insert ?%))
|
(insert ?%))
|
||||||
(t
|
(t
|
||||||
(insert c))))
|
(insert c))))
|
||||||
|
|
@ -2848,7 +2848,7 @@ keymap. Leaves merge in fast mode."
|
||||||
(while (< x-begin x-end)
|
(while (< x-begin x-end)
|
||||||
;; bite off and compare no more than 1000 characters at a time
|
;; bite off and compare no more than 1000 characters at a time
|
||||||
(let* ((compare-length (min (- x-end x-begin) 1000))
|
(let* ((compare-length (min (- x-end x-begin) 1000))
|
||||||
(x-string (emerge-eval-in-buffer
|
(x-string (emerge-eval-in-buffer
|
||||||
buffer-x
|
buffer-x
|
||||||
(buffer-substring x-begin
|
(buffer-substring x-begin
|
||||||
(+ x-begin compare-length))))
|
(+ x-begin compare-length))))
|
||||||
|
|
@ -2863,7 +2863,7 @@ keymap. Leaves merge in fast mode."
|
||||||
t)))
|
t)))
|
||||||
|
|
||||||
;; Construct a unique buffer name.
|
;; Construct a unique buffer name.
|
||||||
;; The first one tried is prefixsuffix, then prefix<2>suffix,
|
;; The first one tried is prefixsuffix, then prefix<2>suffix,
|
||||||
;; prefix<3>suffix, etc.
|
;; prefix<3>suffix, etc.
|
||||||
(defun emerge-unique-buffer-name (prefix suffix)
|
(defun emerge-unique-buffer-name (prefix suffix)
|
||||||
(if (null (get-buffer (concat prefix suffix)))
|
(if (null (get-buffer (concat prefix suffix)))
|
||||||
|
|
|
||||||
10
lisp/env.el
10
lisp/env.el
|
|
@ -55,10 +55,10 @@ If it is also not t, RET does not exit if it does non-null completion."
|
||||||
`$FOO' where FOO is an environment variable name means to substitute
|
`$FOO' where FOO is an environment variable name means to substitute
|
||||||
the value of that variable. The variable name should be terminated
|
the value of that variable. The variable name should be terminated
|
||||||
with a character not a letter, digit or underscore; otherwise, enclose
|
with a character not a letter, digit or underscore; otherwise, enclose
|
||||||
the entire variable name in braces. Use `$$' to insert a single
|
the entire variable name in braces. Use `$$' to insert a single
|
||||||
dollar sign."
|
dollar sign."
|
||||||
(let ((start 0))
|
(let ((start 0))
|
||||||
(while (string-match
|
(while (string-match
|
||||||
(rx (or (and "$" (submatch (1+ (in "a-zA-Z0-9_"))))
|
(rx (or (and "$" (submatch (1+ (in "a-zA-Z0-9_"))))
|
||||||
(and "${" (submatch (minimal-match (0+ anything))) "}")
|
(and "${" (submatch (minimal-match (0+ anything))) "}")
|
||||||
"$$"))
|
"$$"))
|
||||||
|
|
@ -101,13 +101,13 @@ This function works by modifying `process-environment'."
|
||||||
(when value
|
(when value
|
||||||
(push value setenv-history))
|
(push value setenv-history))
|
||||||
;; Here finally we specify the args to give call setenv with.
|
;; Here finally we specify the args to give call setenv with.
|
||||||
(list var
|
(list var
|
||||||
(read-from-minibuffer (format "Set %s to value: " var)
|
(read-from-minibuffer (format "Set %s to value: " var)
|
||||||
nil nil nil 'setenv-history
|
nil nil nil 'setenv-history
|
||||||
value)
|
value)
|
||||||
nil
|
nil
|
||||||
t))))
|
t))))
|
||||||
(if unset
|
(if unset
|
||||||
(setq value nil)
|
(setq value nil)
|
||||||
(if substitute-env-vars
|
(if substitute-env-vars
|
||||||
(setq value (substitute-env-vars value))))
|
(setq value (substitute-env-vars value))))
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
;; insertion. It will be forgotten if you move point or make other
|
;; insertion. It will be forgotten if you move point or make other
|
||||||
;; modifications before inserting or typing anything.
|
;; modifications before inserting or typing anything.
|
||||||
;;
|
;;
|
||||||
;; Faces can be selected from the keyboard as well.
|
;; Faces can be selected from the keyboard as well.
|
||||||
;; The standard keybindings are M-g (or ESC g) + letter:
|
;; The standard keybindings are M-g (or ESC g) + letter:
|
||||||
;; M-g i = "set italic", M-g b = "set bold", etc.
|
;; M-g i = "set italic", M-g b = "set bold", etc.
|
||||||
|
|
||||||
|
|
@ -86,14 +86,14 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(eval-when-compile
|
(eval-when-compile
|
||||||
(require 'help)
|
(require 'help)
|
||||||
(require 'button))
|
(require 'button))
|
||||||
|
|
||||||
;;; Provide some binding for startup:
|
;;; Provide some binding for startup:
|
||||||
;;;###autoload (define-key global-map "\M-g" 'facemenu-keymap)
|
;;;###autoload (define-key global-map "\M-g" 'facemenu-keymap)
|
||||||
;;;###autoload (autoload 'facemenu-keymap "facemenu" "Keymap for face-changing commands." t 'keymap)
|
;;;###autoload (autoload 'facemenu-keymap "facemenu" "Keymap for face-changing commands." t 'keymap)
|
||||||
|
|
||||||
;; Global bindings:
|
;; Global bindings:
|
||||||
(define-key global-map [C-down-mouse-2] 'facemenu-menu)
|
(define-key global-map [C-down-mouse-2] 'facemenu-menu)
|
||||||
(define-key global-map "\M-g" 'facemenu-keymap)
|
(define-key global-map "\M-g" 'facemenu-keymap)
|
||||||
|
|
@ -116,7 +116,7 @@ the binding is made in `facemenu-keymap'.
|
||||||
|
|
||||||
The faces specifically mentioned in this list are put at the top of
|
The faces specifically mentioned in this list are put at the top of
|
||||||
the menu, in the order specified. All other faces which are defined,
|
the menu, in the order specified. All other faces which are defined,
|
||||||
except for those in `facemenu-unlisted-faces', are listed after them,
|
except for those in `facemenu-unlisted-faces', are listed after them,
|
||||||
but get no keyboard equivalents.
|
but get no keyboard equivalents.
|
||||||
|
|
||||||
If you change this variable after loading facemenu.el, you will need to call
|
If you change this variable after loading facemenu.el, you will need to call
|
||||||
|
|
@ -164,7 +164,7 @@ when they are created."
|
||||||
(defalias 'facemenu-face-menu facemenu-face-menu)
|
(defalias 'facemenu-face-menu facemenu-face-menu)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defvar facemenu-foreground-menu
|
(defvar facemenu-foreground-menu
|
||||||
(let ((map (make-sparse-keymap "Foreground Color")))
|
(let ((map (make-sparse-keymap "Foreground Color")))
|
||||||
(define-key map "o" (cons "Other..." 'facemenu-set-foreground))
|
(define-key map "o" (cons "Other..." 'facemenu-set-foreground))
|
||||||
map)
|
map)
|
||||||
|
|
@ -182,7 +182,7 @@ when they are created."
|
||||||
(defalias 'facemenu-background-menu facemenu-background-menu)
|
(defalias 'facemenu-background-menu facemenu-background-menu)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defvar facemenu-special-menu
|
(defvar facemenu-special-menu
|
||||||
(let ((map (make-sparse-keymap "Special")))
|
(let ((map (make-sparse-keymap "Special")))
|
||||||
(define-key map [?s] (cons (purecopy "Remove Special")
|
(define-key map [?s] (cons (purecopy "Remove Special")
|
||||||
'facemenu-remove-special))
|
'facemenu-remove-special))
|
||||||
|
|
@ -213,7 +213,7 @@ when they are created."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defvar facemenu-indentation-menu
|
(defvar facemenu-indentation-menu
|
||||||
(let ((map (make-sparse-keymap "Indentation")))
|
(let ((map (make-sparse-keymap "Indentation")))
|
||||||
(define-key map [decrease-right-margin]
|
(define-key map [decrease-right-margin]
|
||||||
(cons (purecopy "Indent Right Less") 'decrease-right-margin))
|
(cons (purecopy "Indent Right Less") 'decrease-right-margin))
|
||||||
(define-key map [increase-right-margin]
|
(define-key map [increase-right-margin]
|
||||||
(cons (purecopy "Indent Right More") 'increase-right-margin))
|
(cons (purecopy "Indent Right More") 'increase-right-margin))
|
||||||
|
|
@ -245,23 +245,23 @@ when they are created."
|
||||||
(define-key map [s1] (list (purecopy "--"))))
|
(define-key map [s1] (list (purecopy "--"))))
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(let ((map facemenu-menu))
|
(let ((map facemenu-menu))
|
||||||
(define-key map [in] (cons (purecopy "Indentation")
|
(define-key map [in] (cons (purecopy "Indentation")
|
||||||
'facemenu-indentation-menu))
|
'facemenu-indentation-menu))
|
||||||
(define-key map [ju] (cons (purecopy "Justification")
|
(define-key map [ju] (cons (purecopy "Justification")
|
||||||
'facemenu-justification-menu))
|
'facemenu-justification-menu))
|
||||||
(define-key map [s2] (list (purecopy "--")))
|
(define-key map [s2] (list (purecopy "--")))
|
||||||
(define-key map [sp] (cons (purecopy "Special Properties")
|
(define-key map [sp] (cons (purecopy "Special Properties")
|
||||||
'facemenu-special-menu))
|
'facemenu-special-menu))
|
||||||
(define-key map [bg] (cons (purecopy "Background Color")
|
(define-key map [bg] (cons (purecopy "Background Color")
|
||||||
'facemenu-background-menu))
|
'facemenu-background-menu))
|
||||||
(define-key map [fg] (cons (purecopy "Foreground Color")
|
(define-key map [fg] (cons (purecopy "Foreground Color")
|
||||||
'facemenu-foreground-menu))
|
'facemenu-foreground-menu))
|
||||||
(define-key map [fc] (cons (purecopy "Face")
|
(define-key map [fc] (cons (purecopy "Face")
|
||||||
'facemenu-face-menu)))
|
'facemenu-face-menu)))
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defalias 'facemenu-menu facemenu-menu)
|
(defalias 'facemenu-menu facemenu-menu)
|
||||||
|
|
||||||
(defvar facemenu-keymap
|
(defvar facemenu-keymap
|
||||||
(let ((map (make-sparse-keymap "Set face")))
|
(let ((map (make-sparse-keymap "Set face")))
|
||||||
(define-key map "o" (cons (purecopy "Other...") 'facemenu-set-face))
|
(define-key map "o" (cons (purecopy "Other...") 'facemenu-set-face))
|
||||||
map)
|
map)
|
||||||
|
|
@ -328,7 +328,7 @@ requested face.
|
||||||
|
|
||||||
Otherwise, this command specifies the face for the next character
|
Otherwise, this command specifies the face for the next character
|
||||||
inserted. Moving point or switching buffers before
|
inserted. Moving point or switching buffers before
|
||||||
typing a character to insert cancels the specification."
|
typing a character to insert cancels the specification."
|
||||||
(interactive (list (progn
|
(interactive (list (progn
|
||||||
(barf-if-buffer-read-only)
|
(barf-if-buffer-read-only)
|
||||||
(read-face-name "Use face"))
|
(read-face-name "Use face"))
|
||||||
|
|
@ -350,7 +350,7 @@ requested face.
|
||||||
|
|
||||||
Otherwise, this command specifies the face for the next character
|
Otherwise, this command specifies the face for the next character
|
||||||
inserted. Moving point or switching buffers before
|
inserted. Moving point or switching buffers before
|
||||||
typing a character to insert cancels the specification."
|
typing a character to insert cancels the specification."
|
||||||
(interactive (list (progn
|
(interactive (list (progn
|
||||||
(barf-if-buffer-read-only)
|
(barf-if-buffer-read-only)
|
||||||
(facemenu-read-color "Foreground color: "))
|
(facemenu-read-color "Foreground color: "))
|
||||||
|
|
@ -374,7 +374,7 @@ requested face.
|
||||||
|
|
||||||
Otherwise, this command specifies the face for the next character
|
Otherwise, this command specifies the face for the next character
|
||||||
inserted. Moving point or switching buffers before
|
inserted. Moving point or switching buffers before
|
||||||
typing a character to insert cancels the specification."
|
typing a character to insert cancels the specification."
|
||||||
(interactive (list (progn
|
(interactive (list (progn
|
||||||
(barf-if-buffer-read-only)
|
(barf-if-buffer-read-only)
|
||||||
(facemenu-read-color "Background color: "))
|
(facemenu-read-color "Background color: "))
|
||||||
|
|
@ -399,7 +399,7 @@ requested face.
|
||||||
|
|
||||||
Otherwise, this command specifies the face for the next character
|
Otherwise, this command specifies the face for the next character
|
||||||
inserted. Moving point or switching buffers before
|
inserted. Moving point or switching buffers before
|
||||||
typing a character to insert cancels the specification."
|
typing a character to insert cancels the specification."
|
||||||
(interactive (list last-command-event
|
(interactive (list last-command-event
|
||||||
(if (and mark-active (not current-prefix-arg))
|
(if (and mark-active (not current-prefix-arg))
|
||||||
(region-beginning))
|
(region-beginning))
|
||||||
|
|
@ -407,7 +407,7 @@ typing a character to insert cancels the specification."
|
||||||
(region-end))))
|
(region-end))))
|
||||||
(barf-if-buffer-read-only)
|
(barf-if-buffer-read-only)
|
||||||
(facemenu-get-face face)
|
(facemenu-get-face face)
|
||||||
(if start
|
(if start
|
||||||
(facemenu-add-face face start end)
|
(facemenu-add-face face start end)
|
||||||
(facemenu-add-face face)))
|
(facemenu-add-face face)))
|
||||||
|
|
||||||
|
|
@ -440,7 +440,7 @@ This sets the `read-only' text property; it can be undone with
|
||||||
"Remove `face' and `mouse-face' text properties."
|
"Remove `face' and `mouse-face' text properties."
|
||||||
(interactive "*r") ; error if buffer is read-only despite the next line.
|
(interactive "*r") ; error if buffer is read-only despite the next line.
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
(remove-text-properties
|
(remove-text-properties
|
||||||
start end '(face nil mouse-face nil))))
|
start end '(face nil mouse-face nil))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
@ -456,13 +456,13 @@ This sets the `read-only' text property; it can be undone with
|
||||||
These special properties include `invisible', `intangible' and `read-only'."
|
These special properties include `invisible', `intangible' and `read-only'."
|
||||||
(interactive "*r") ; error if buffer is read-only despite the next line.
|
(interactive "*r") ; error if buffer is read-only despite the next line.
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
(remove-text-properties
|
(remove-text-properties
|
||||||
start end '(invisible nil intangible nil read-only nil))))
|
start end '(invisible nil intangible nil read-only nil))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun facemenu-read-color (&optional prompt)
|
(defun facemenu-read-color (&optional prompt)
|
||||||
"Read a color using the minibuffer."
|
"Read a color using the minibuffer."
|
||||||
(let ((col (completing-read (or prompt "Color: ")
|
(let ((col (completing-read (or prompt "Color: ")
|
||||||
(or facemenu-color-alist
|
(or facemenu-color-alist
|
||||||
(defined-colors))
|
(defined-colors))
|
||||||
nil t)))
|
nil t)))
|
||||||
|
|
@ -498,11 +498,11 @@ of colors that the current display can handle."
|
||||||
(setq s (point))
|
(setq s (point))
|
||||||
(insert (car list))
|
(insert (car list))
|
||||||
(indent-to 20)
|
(indent-to 20)
|
||||||
(put-text-property s (point) 'face
|
(put-text-property s (point) 'face
|
||||||
(cons 'background-color (car list)))
|
(cons 'background-color (car list)))
|
||||||
(setq s (point))
|
(setq s (point))
|
||||||
(insert " " (car list) "\n")
|
(insert " " (car list) "\n")
|
||||||
(put-text-property s (point) 'face
|
(put-text-property s (point) 'face
|
||||||
(cons 'foreground-color (car list)))
|
(cons 'foreground-color (car list)))
|
||||||
(setq list (cdr list)))))))
|
(setq list (cdr list)))))))
|
||||||
|
|
||||||
|
|
@ -652,7 +652,7 @@ This is called whenever you create a new face."
|
||||||
(define-key 'facemenu-keymap key (cons name function))
|
(define-key 'facemenu-keymap key (cons name function))
|
||||||
(define-key menu key (cons name function)))
|
(define-key menu key (cons name function)))
|
||||||
((facemenu-iterate ; check if equivalent face is already in the menu
|
((facemenu-iterate ; check if equivalent face is already in the menu
|
||||||
(lambda (m) (and (listp m)
|
(lambda (m) (and (listp m)
|
||||||
(symbolp (car m))
|
(symbolp (car m))
|
||||||
(face-equal (car m) symbol)))
|
(face-equal (car m) symbol)))
|
||||||
(cdr (symbol-function menu))))
|
(cdr (symbol-function menu))))
|
||||||
|
|
@ -693,7 +693,7 @@ This is called whenever you use a new color."
|
||||||
(format "Select background color %s for subsequent insertion."
|
(format "Select background color %s for subsequent insertion."
|
||||||
name))))
|
name))))
|
||||||
(cond ((facemenu-iterate ; check if equivalent face is already in the menu
|
(cond ((facemenu-iterate ; check if equivalent face is already in the menu
|
||||||
(lambda (m) (and (listp m)
|
(lambda (m) (and (listp m)
|
||||||
(symbolp (car m))
|
(symbolp (car m))
|
||||||
(stringp (cadr m))
|
(stringp (cadr m))
|
||||||
(string-equal (cadr m) color)))
|
(string-equal (cadr m) color)))
|
||||||
|
|
@ -711,13 +711,13 @@ This is called whenever you use a new color."
|
||||||
|
|
||||||
(defun facemenu-complete-face-list (&optional oldlist)
|
(defun facemenu-complete-face-list (&optional oldlist)
|
||||||
"Return list of all faces that look different.
|
"Return list of all faces that look different.
|
||||||
Starts with given ALIST of faces, and adds elements only if they display
|
Starts with given ALIST of faces, and adds elements only if they display
|
||||||
differently from any face already on the list.
|
differently from any face already on the list.
|
||||||
The faces on ALIST will end up at the end of the returned list, in reverse
|
The faces on ALIST will end up at the end of the returned list, in reverse
|
||||||
order."
|
order."
|
||||||
(let ((list (nreverse (mapcar 'car oldlist))))
|
(let ((list (nreverse (mapcar 'car oldlist))))
|
||||||
(facemenu-iterate
|
(facemenu-iterate
|
||||||
(lambda (new-face)
|
(lambda (new-face)
|
||||||
(if (not (memq new-face list))
|
(if (not (memq new-face list))
|
||||||
(setq list (cons new-face list)))
|
(setq list (cons new-face list)))
|
||||||
nil)
|
nil)
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URL's.
|
;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URL's.
|
||||||
;; For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site).
|
;; For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site).
|
||||||
;; Also, you can add `ffap-menu-rescan' to various hooks to fontify
|
;; Also, you can add `ffap-menu-rescan' to various hooks to fontify
|
||||||
;; the file and URL references within a buffer.
|
;; the file and URL references within a buffer.
|
||||||
|
|
||||||
|
|
||||||
;;; Change Log:
|
;;; Change Log:
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ as the final argument."
|
||||||
(delete-process find))
|
(delete-process find))
|
||||||
(error nil))
|
(error nil))
|
||||||
(error "Cannot have two processes in `%s' at once" (buffer-name)))))
|
(error "Cannot have two processes in `%s' at once" (buffer-name)))))
|
||||||
|
|
||||||
(widen)
|
(widen)
|
||||||
(kill-all-local-variables)
|
(kill-all-local-variables)
|
||||||
(setq buffer-read-only nil)
|
(setq buffer-read-only nil)
|
||||||
|
|
@ -134,7 +134,7 @@ as the final argument."
|
||||||
;; and later)
|
;; and later)
|
||||||
(dired-simple-subdir-alist)
|
(dired-simple-subdir-alist)
|
||||||
;; else we have an ancient tree dired (or classic dired, where
|
;; else we have an ancient tree dired (or classic dired, where
|
||||||
;; this does no harm)
|
;; this does no harm)
|
||||||
(set (make-local-variable 'dired-subdir-alist)
|
(set (make-local-variable 'dired-subdir-alist)
|
||||||
(list (cons default-directory (point-min-marker)))))
|
(list (cons default-directory (point-min-marker)))))
|
||||||
(setq buffer-read-only nil)
|
(setq buffer-read-only nil)
|
||||||
|
|
@ -142,7 +142,7 @@ as the final argument."
|
||||||
;; subdir-alist points there.
|
;; subdir-alist points there.
|
||||||
(insert " " dir ":\n")
|
(insert " " dir ":\n")
|
||||||
;; Make second line a ``find'' line in analogy to the ``total'' or
|
;; Make second line a ``find'' line in analogy to the ``total'' or
|
||||||
;; ``wildcard'' line.
|
;; ``wildcard'' line.
|
||||||
(insert " " args "\n")
|
(insert " " args "\n")
|
||||||
;; Start the find process.
|
;; Start the find process.
|
||||||
(let ((proc (start-process-shell-command find-dired-find-program (current-buffer) args)))
|
(let ((proc (start-process-shell-command find-dired-find-program (current-buffer) args)))
|
||||||
|
|
|
||||||
|
|
@ -70,9 +70,9 @@
|
||||||
;; ("\\.hh$" ff-cc-hh-converter)
|
;; ("\\.hh$" ff-cc-hh-converter)
|
||||||
;; ("\\.c$" (".h"))
|
;; ("\\.c$" (".h"))
|
||||||
;; ("\\.h$" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp"))))
|
;; ("\\.h$" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp"))))
|
||||||
;;
|
;;
|
||||||
;; ff-cc-hh-converter is included at the end of this file as a reference.
|
;; ff-cc-hh-converter is included at the end of this file as a reference.
|
||||||
;;
|
;;
|
||||||
;; SEARCHING is carried out in a set of directories specified by the
|
;; SEARCHING is carried out in a set of directories specified by the
|
||||||
;; ff-search-directories variable:
|
;; ff-search-directories variable:
|
||||||
;;
|
;;
|
||||||
|
|
@ -500,12 +500,12 @@ If optional IN-OTHER-WINDOW is non-nil, find the file in another window."
|
||||||
(read-file-name
|
(read-file-name
|
||||||
(format "Find or create %s in: " default-name)
|
(format "Find or create %s in: " default-name)
|
||||||
default-directory default-name nil)))
|
default-directory default-name nil)))
|
||||||
|
|
||||||
(setq pathname
|
(setq pathname
|
||||||
(if (file-directory-p name)
|
(if (file-directory-p name)
|
||||||
(concat (file-name-as-directory name) default-name)
|
(concat (file-name-as-directory name) default-name)
|
||||||
(setq found name)))
|
(setq found name)))
|
||||||
|
|
||||||
(ff-find-file pathname in-other-window t)))
|
(ff-find-file pathname in-other-window t)))
|
||||||
|
|
||||||
(t ;; don't create the file, just whinge
|
(t ;; don't create the file, just whinge
|
||||||
|
|
@ -619,7 +619,7 @@ If (optional) SUFFIX-LIST is nil, search for fname, otherwise search
|
||||||
for fname with each of the given suffixes. Get the file or the buffer
|
for fname with each of the given suffixes. Get the file or the buffer
|
||||||
corresponding to the name of the first file found, or nil."
|
corresponding to the name of the first file found, or nil."
|
||||||
(let ((filename (ff-get-file-name search-dirs filename suffix-list)))
|
(let ((filename (ff-get-file-name search-dirs filename suffix-list)))
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
((not filename)
|
((not filename)
|
||||||
nil)
|
nil)
|
||||||
|
|
@ -627,7 +627,7 @@ corresponding to the name of the first file found, or nil."
|
||||||
((bufferp (get-file-buffer filename))
|
((bufferp (get-file-buffer filename))
|
||||||
(ff-switch-to-buffer (get-file-buffer filename) other-window)
|
(ff-switch-to-buffer (get-file-buffer filename) other-window)
|
||||||
filename)
|
filename)
|
||||||
|
|
||||||
((file-exists-p filename)
|
((file-exists-p filename)
|
||||||
(ff-find-file filename other-window nil)
|
(ff-find-file filename other-window nil)
|
||||||
filename)
|
filename)
|
||||||
|
|
@ -659,7 +659,7 @@ name of the first file found."
|
||||||
(setq this-suffix (car suffixes))
|
(setq this-suffix (car suffixes))
|
||||||
(setq this-suffix "")
|
(setq this-suffix "")
|
||||||
(setq suffixes (list "")))
|
(setq suffixes (list "")))
|
||||||
|
|
||||||
;; find whether the file is in a buffer first
|
;; find whether the file is in a buffer first
|
||||||
(while (and suffixes (not found))
|
(while (and suffixes (not found))
|
||||||
(setq filename (concat fname-stub this-suffix))
|
(setq filename (concat fname-stub this-suffix))
|
||||||
|
|
@ -693,25 +693,25 @@ name of the first file found."
|
||||||
;; if dir does not contain '/*', look for the file
|
;; if dir does not contain '/*', look for the file
|
||||||
(if (and dir (not (string-match "\\([^*]*\\)/\\\*\\(/.*\\)*" dir)))
|
(if (and dir (not (string-match "\\([^*]*\\)/\\\*\\(/.*\\)*" dir)))
|
||||||
(progn
|
(progn
|
||||||
|
|
||||||
;; suffixes is nil => fname-stub is the file we are looking for
|
;; suffixes is nil => fname-stub is the file we are looking for
|
||||||
;; otherwise fname-stub is a stub, and we append a suffix
|
;; otherwise fname-stub is a stub, and we append a suffix
|
||||||
(if suffixes
|
(if suffixes
|
||||||
(setq this-suffix (car suffixes))
|
(setq this-suffix (car suffixes))
|
||||||
(setq this-suffix "")
|
(setq this-suffix "")
|
||||||
(setq suffixes (list "")))
|
(setq suffixes (list "")))
|
||||||
|
|
||||||
(while (and suffixes (not found))
|
(while (and suffixes (not found))
|
||||||
|
|
||||||
(setq filename (concat fname-stub this-suffix))
|
(setq filename (concat fname-stub this-suffix))
|
||||||
(setq file (concat dir "/" filename))
|
(setq file (concat dir "/" filename))
|
||||||
|
|
||||||
(if (not ff-quiet-mode)
|
(if (not ff-quiet-mode)
|
||||||
(message "Finding %s..." file))
|
(message "Finding %s..." file))
|
||||||
|
|
||||||
(if (file-exists-p file)
|
(if (file-exists-p file)
|
||||||
(setq found file))
|
(setq found file))
|
||||||
|
|
||||||
(setq suffixes (cdr suffixes))
|
(setq suffixes (cdr suffixes))
|
||||||
(setq this-suffix (car suffixes))))
|
(setq this-suffix (car suffixes))))
|
||||||
|
|
||||||
|
|
@ -935,7 +935,7 @@ and the name of the file passed in."
|
||||||
))
|
))
|
||||||
(t
|
(t
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
return-list))
|
return-list))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,14 @@
|
||||||
;; Terminals that use XON/XOFF flow control can cause problems with
|
;; Terminals that use XON/XOFF flow control can cause problems with
|
||||||
;; GNU Emacs users. This file contains Emacs Lisp code that makes it
|
;; GNU Emacs users. This file contains Emacs Lisp code that makes it
|
||||||
;; easy for a user to deal with this problem, when using such a
|
;; easy for a user to deal with this problem, when using such a
|
||||||
;; terminal.
|
;; terminal.
|
||||||
;;
|
;;
|
||||||
;; To invoke these adjustments, a user need only invoke the function
|
;; To invoke these adjustments, a user need only invoke the function
|
||||||
;; enable-flow-control-on with a list of terminal types in his/her own
|
;; enable-flow-control-on with a list of terminal types in his/her own
|
||||||
;; .emacs file. As arguments, give it the names of one or more terminal
|
;; .emacs file. As arguments, give it the names of one or more terminal
|
||||||
;; types in use by that user which require flow control adjustments.
|
;; types in use by that user which require flow control adjustments.
|
||||||
;; Here's an example:
|
;; Here's an example:
|
||||||
;;
|
;;
|
||||||
;; (enable-flow-control-on "vt200" "vt300" "vt101" "vt131")
|
;; (enable-flow-control-on "vt200" "vt300" "vt101" "vt131")
|
||||||
|
|
||||||
;; Portability note: This uses (getenv "TERM"), and therefore probably
|
;; Portability note: This uses (getenv "TERM"), and therefore probably
|
||||||
|
|
@ -96,7 +96,7 @@ With arg, enable flow control mode if arg is positive, otherwise disable."
|
||||||
(aset keyboard-translate-table flow-control-c-q-replacement ?\^q)
|
(aset keyboard-translate-table flow-control-c-q-replacement ?\^q)
|
||||||
(aset keyboard-translate-table ?\^q flow-control-c-q-replacement)
|
(aset keyboard-translate-table ?\^q flow-control-c-q-replacement)
|
||||||
(message "XON/XOFF adjustment for %s: use %s for C-s, and use %s for C-q"
|
(message "XON/XOFF adjustment for %s: use %s for C-s, and use %s for C-q"
|
||||||
(getenv "TERM")
|
(getenv "TERM")
|
||||||
(single-key-description flow-control-c-s-replacement)
|
(single-key-description flow-control-c-s-replacement)
|
||||||
(single-key-description flow-control-c-q-replacement))
|
(single-key-description flow-control-c-q-replacement))
|
||||||
(sleep-for 2))) ; Give user a chance to see message.
|
(sleep-for 2))) ; Give user a chance to see message.
|
||||||
|
|
|
||||||
|
|
@ -318,7 +318,7 @@ exited and text is left visible."
|
||||||
;; catch a request to leave all folds
|
;; catch a request to leave all folds
|
||||||
((zerop num-folds)
|
((zerop num-folds)
|
||||||
(setq num-folds (length foldout-fold-list)))
|
(setq num-folds (length foldout-fold-list)))
|
||||||
|
|
||||||
;; have we been told not to hide the fold?
|
;; have we been told not to hide the fold?
|
||||||
((< num-folds 0)
|
((< num-folds 0)
|
||||||
(setq hide-fold nil
|
(setq hide-fold nil
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ this function onto `change-major-mode-hook'."
|
||||||
(remove-hook 'after-change-functions 'font-lock-after-change-function t)
|
(remove-hook 'after-change-functions 'font-lock-after-change-function t)
|
||||||
(font-lock-unfontify-buffer)
|
(font-lock-unfontify-buffer)
|
||||||
(font-lock-turn-off-thing-lock))))
|
(font-lock-turn-off-thing-lock))))
|
||||||
|
|
||||||
(defun turn-on-font-lock ()
|
(defun turn-on-font-lock ()
|
||||||
"Turn on Font Lock mode (only if the terminal can display it)."
|
"Turn on Font Lock mode (only if the terminal can display it)."
|
||||||
(unless font-lock-mode
|
(unless font-lock-mode
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,7 @@ For most purposes, consider using `format-decode-region' instead."
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn
|
(progn
|
||||||
;; Don't record undo information for the decoding.
|
;; Don't record undo information for the decoding.
|
||||||
|
|
||||||
(if (null format)
|
(if (null format)
|
||||||
;; Figure out which format it is in, remember list in `format'.
|
;; Figure out which format it is in, remember list in `format'.
|
||||||
(let ((try format-alist))
|
(let ((try format-alist))
|
||||||
|
|
@ -296,7 +296,7 @@ For most purposes, consider using `format-decode-region' instead."
|
||||||
(setq format (reverse format)))
|
(setq format (reverse format)))
|
||||||
(if visit-flag
|
(if visit-flag
|
||||||
(setq buffer-file-format format)))
|
(setq buffer-file-format format)))
|
||||||
|
|
||||||
(set-buffer-modified-p mod))
|
(set-buffer-modified-p mod))
|
||||||
|
|
||||||
;; Return new length of region
|
;; Return new length of region
|
||||||
|
|
@ -486,7 +486,7 @@ the value of `foo'."
|
||||||
;; Now (cdr p) is the cons to delete
|
;; Now (cdr p) is the cons to delete
|
||||||
(setcdr p (cdr cons))
|
(setcdr p (cdr cons))
|
||||||
list)))
|
list)))
|
||||||
|
|
||||||
(defun format-make-relatively-unique (a b)
|
(defun format-make-relatively-unique (a b)
|
||||||
"Delete common elements of lists A and B, return as pair.
|
"Delete common elements of lists A and B, return as pair.
|
||||||
Compares using `equal'."
|
Compares using `equal'."
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ The optional FILL should be a character, used to fill to the column."
|
||||||
(concat "\n" (make-string target fill))
|
(concat "\n" (make-string target fill))
|
||||||
(make-string (- target (current-column)) fill)))
|
(make-string (- target (current-column)) fill)))
|
||||||
;;
|
;;
|
||||||
(defun arch-rj (target field &optional fill)
|
(defun arch-rj (target field &optional fill)
|
||||||
"Produces a string to skip to column TARGET minus the width of field FIELD.
|
"Produces a string to skip to column TARGET minus the width of field FIELD.
|
||||||
Prepends newline if needed. The optional FILL should be a character,
|
Prepends newline if needed. The optional FILL should be a character,
|
||||||
used to fill to the column."
|
used to fill to the column."
|
||||||
|
|
|
||||||
156
lisp/forms.el
156
lisp/forms.el
|
|
@ -31,9 +31,9 @@
|
||||||
;; Names which start with 'forms--' are intended for internal use, and
|
;; Names which start with 'forms--' are intended for internal use, and
|
||||||
;; should *NOT* be used from the outside.
|
;; should *NOT* be used from the outside.
|
||||||
;;
|
;;
|
||||||
;; All variables are buffer-local, to enable multiple forms visits
|
;; All variables are buffer-local, to enable multiple forms visits
|
||||||
;; simultaneously.
|
;; simultaneously.
|
||||||
;; Variable `forms--mode-setup' is local to *ALL* buffers, for it
|
;; Variable `forms--mode-setup' is local to *ALL* buffers, for it
|
||||||
;; controls if forms-mode has been enabled in a buffer.
|
;; controls if forms-mode has been enabled in a buffer.
|
||||||
;;
|
;;
|
||||||
;; === How it works ===
|
;; === How it works ===
|
||||||
|
|
@ -60,9 +60,9 @@
|
||||||
;; You may also visit the control file, and switch to forms mode by hand
|
;; You may also visit the control file, and switch to forms mode by hand
|
||||||
;; with M-x `forms-mode'.
|
;; with M-x `forms-mode'.
|
||||||
;;
|
;;
|
||||||
;; Automatic mode switching is supported if you specify
|
;; Automatic mode switching is supported if you specify
|
||||||
;; "-*- forms -*-" in the first line of the control file.
|
;; "-*- forms -*-" in the first line of the control file.
|
||||||
;;
|
;;
|
||||||
;; The control file is visited, evaluated using `eval-current-buffer',
|
;; The control file is visited, evaluated using `eval-current-buffer',
|
||||||
;; and should set at least the following variables:
|
;; and should set at least the following variables:
|
||||||
;;
|
;;
|
||||||
|
|
@ -79,17 +79,17 @@
|
||||||
;;
|
;;
|
||||||
;; - a string, e.g. "hello". The string is inserted in the forms
|
;; - a string, e.g. "hello". The string is inserted in the forms
|
||||||
;; "as is".
|
;; "as is".
|
||||||
;;
|
;;
|
||||||
;; - an integer, denoting a field number.
|
;; - an integer, denoting a field number.
|
||||||
;; The contents of this field are inserted at this point.
|
;; The contents of this field are inserted at this point.
|
||||||
;; Fields are numbered starting with number one.
|
;; Fields are numbered starting with number one.
|
||||||
;;
|
;;
|
||||||
;; - a function call, e.g. (insert "text").
|
;; - a function call, e.g. (insert "text").
|
||||||
;; This function call is dynamically evaluated and should return a
|
;; This function call is dynamically evaluated and should return a
|
||||||
;; string. It should *NOT* have side-effects on the forms being
|
;; string. It should *NOT* have side-effects on the forms being
|
||||||
;; constructed. The current fields are available to the function
|
;; constructed. The current fields are available to the function
|
||||||
;; in the variable `forms-fields', they should *NOT* be modified.
|
;; in the variable `forms-fields', they should *NOT* be modified.
|
||||||
;;
|
;;
|
||||||
;; - a lisp symbol, that must evaluate to one of the above.
|
;; - a lisp symbol, that must evaluate to one of the above.
|
||||||
;;
|
;;
|
||||||
;; Optional variables which may be set in the control file:
|
;; Optional variables which may be set in the control file:
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
;; Non-nil means that the data file is visited
|
;; Non-nil means that the data file is visited
|
||||||
;; read-only (view mode) as opposed to edit mode.
|
;; read-only (view mode) as opposed to edit mode.
|
||||||
;; If no write access to the data file is
|
;; If no write access to the data file is
|
||||||
;; possible, view mode is enforced.
|
;; possible, view mode is enforced.
|
||||||
;;
|
;;
|
||||||
;; forms-check-number-of-fields [bool, default t]
|
;; forms-check-number-of-fields [bool, default t]
|
||||||
;; If non-nil, a warning will be issued whenever
|
;; If non-nil, a warning will be issued whenever
|
||||||
|
|
@ -138,26 +138,26 @@
|
||||||
;; first record.
|
;; first record.
|
||||||
;;
|
;;
|
||||||
;; forms-read-file-filter [symbol, default nil]
|
;; forms-read-file-filter [symbol, default nil]
|
||||||
;; If not nil: this should be the name of a
|
;; If not nil: this should be the name of a
|
||||||
;; function that is called after the forms data file
|
;; function that is called after the forms data file
|
||||||
;; has been read. It can be used to transform
|
;; has been read. It can be used to transform
|
||||||
;; the contents of the file into a format more suitable
|
;; the contents of the file into a format more suitable
|
||||||
;; for forms-mode processing.
|
;; for forms-mode processing.
|
||||||
;;
|
;;
|
||||||
;; forms-write-file-filter [symbol, default nil]
|
;; forms-write-file-filter [symbol, default nil]
|
||||||
;; If not nil: this should be the name of a
|
;; If not nil: this should be the name of a
|
||||||
;; function that is called before the forms data file
|
;; function that is called before the forms data file
|
||||||
;; is written (saved) to disk. It can be used to undo
|
;; is written (saved) to disk. It can be used to undo
|
||||||
;; the effects of `forms-read-file-filter', if any.
|
;; the effects of `forms-read-file-filter', if any.
|
||||||
;;
|
;;
|
||||||
;; forms-new-record-filter [symbol, default nil]
|
;; forms-new-record-filter [symbol, default nil]
|
||||||
;; If not nil: this should be the name of a
|
;; If not nil: this should be the name of a
|
||||||
;; function that is called when a new
|
;; function that is called when a new
|
||||||
;; record is created. It can be used to fill in
|
;; record is created. It can be used to fill in
|
||||||
;; the new record with default fields, for example.
|
;; the new record with default fields, for example.
|
||||||
;;
|
;;
|
||||||
;; forms-modified-record-filter [symbol, default nil]
|
;; forms-modified-record-filter [symbol, default nil]
|
||||||
;; If not nil: this should be the name of a
|
;; If not nil: this should be the name of a
|
||||||
;; function that is called when a record has
|
;; function that is called when a record has
|
||||||
;; been modified. It is called after the fields
|
;; been modified. It is called after the fields
|
||||||
;; are parsed. It can be used to register
|
;; are parsed. It can be used to register
|
||||||
|
|
@ -199,7 +199,7 @@
|
||||||
;; Normal operation is to transfer one line (record) from the data file,
|
;; Normal operation is to transfer one line (record) from the data file,
|
||||||
;; split it into fields (into `forms--the-record-list'), and display it
|
;; split it into fields (into `forms--the-record-list'), and display it
|
||||||
;; using the specs in `forms-format-list'.
|
;; using the specs in `forms-format-list'.
|
||||||
;; A format routine `forms--format' is built upon startup to format
|
;; A format routine `forms--format' is built upon startup to format
|
||||||
;; the records according to `forms-format-list'.
|
;; the records according to `forms-format-list'.
|
||||||
;;
|
;;
|
||||||
;; When a form is changed the record is updated as soon as this form
|
;; When a form is changed the record is updated as soon as this form
|
||||||
|
|
@ -236,7 +236,7 @@
|
||||||
;; contents of the buffer.
|
;; contents of the buffer.
|
||||||
;;
|
;;
|
||||||
;; Edit mode commands:
|
;; Edit mode commands:
|
||||||
;;
|
;;
|
||||||
;; TAB forms-next-field
|
;; TAB forms-next-field
|
||||||
;; \C-c TAB forms-next-field
|
;; \C-c TAB forms-next-field
|
||||||
;; \C-c < forms-first-record
|
;; \C-c < forms-first-record
|
||||||
|
|
@ -251,9 +251,9 @@
|
||||||
;; \C-c \C-r forms-search-backward
|
;; \C-c \C-r forms-search-backward
|
||||||
;; \C-c \C-s forms-search-forward
|
;; \C-c \C-s forms-search-forward
|
||||||
;; \C-c \C-x forms-exit
|
;; \C-c \C-x forms-exit
|
||||||
;;
|
;;
|
||||||
;; Read-only mode commands:
|
;; Read-only mode commands:
|
||||||
;;
|
;;
|
||||||
;; SPC forms-next-record
|
;; SPC forms-next-record
|
||||||
;; DEL forms-prev-record
|
;; DEL forms-prev-record
|
||||||
;; ? describe-mode
|
;; ? describe-mode
|
||||||
|
|
@ -264,12 +264,12 @@
|
||||||
;; r forms-search-backward
|
;; r forms-search-backward
|
||||||
;; s forms-search-forward
|
;; s forms-search-forward
|
||||||
;; x forms-exit
|
;; x forms-exit
|
||||||
;;
|
;;
|
||||||
;; Of course, it is also possible to use the \C-c prefix to obtain the
|
;; Of course, it is also possible to use the \C-c prefix to obtain the
|
||||||
;; same command keys as in edit mode.
|
;; same command keys as in edit mode.
|
||||||
;;
|
;;
|
||||||
;; The following bindings are available, independent of the mode:
|
;; The following bindings are available, independent of the mode:
|
||||||
;;
|
;;
|
||||||
;; [next] forms-next-record
|
;; [next] forms-next-record
|
||||||
;; [prior] forms-prev-record
|
;; [prior] forms-prev-record
|
||||||
;; [begin] forms-first-record
|
;; [begin] forms-first-record
|
||||||
|
|
@ -301,10 +301,10 @@
|
||||||
(provide 'forms) ;;; official
|
(provide 'forms) ;;; official
|
||||||
(provide 'forms-mode) ;;; for compatibility
|
(provide 'forms-mode) ;;; for compatibility
|
||||||
|
|
||||||
(defconst forms-version (substring "$Revision: 2.43 $" 11 -2)
|
(defconst forms-version (substring "$Revision: 2.44 $" 11 -2)
|
||||||
"The version number of forms-mode (as string). The complete RCS id is:
|
"The version number of forms-mode (as string). The complete RCS id is:
|
||||||
|
|
||||||
$Id: forms.el,v 2.43 2002/05/18 08:04:49 pj Exp $")
|
$Id: forms.el,v 2.44 2003/01/12 20:47:48 schwab Exp $")
|
||||||
|
|
||||||
(defcustom forms-mode-hooks nil
|
(defcustom forms-mode-hooks nil
|
||||||
"Hook run upon entering Forms mode."
|
"Hook run upon entering Forms mode."
|
||||||
|
|
@ -368,7 +368,7 @@ This can be used to undo the effects of `form-read-file-hook'.")
|
||||||
|
|
||||||
(defvar forms-fields nil
|
(defvar forms-fields nil
|
||||||
"List with fields of the current forms. First field has number 1.
|
"List with fields of the current forms. First field has number 1.
|
||||||
This variable is for use by the filter routines only.
|
This variable is for use by the filter routines only.
|
||||||
The contents may NOT be modified.")
|
The contents may NOT be modified.")
|
||||||
|
|
||||||
(defcustom forms-use-text-properties t
|
(defcustom forms-use-text-properties t
|
||||||
|
|
@ -417,7 +417,7 @@ Also, initial position is at last record."
|
||||||
(defvar forms--dyntexts nil
|
(defvar forms--dyntexts nil
|
||||||
"Dynamic texts (resulting from function calls) on the screen.")
|
"Dynamic texts (resulting from function calls) on the screen.")
|
||||||
|
|
||||||
(defvar forms--the-record-list nil
|
(defvar forms--the-record-list nil
|
||||||
"List of strings of the current record, as parsed from the file.")
|
"List of strings of the current record, as parsed from the file.")
|
||||||
|
|
||||||
(defvar forms--search-regexp nil
|
(defvar forms--search-regexp nil
|
||||||
|
|
@ -445,13 +445,13 @@ Also, initial position is at last record."
|
||||||
(defvar forms--rw-face nil
|
(defvar forms--rw-face nil
|
||||||
"Face used to represent read-write data on the screen.")
|
"Face used to represent read-write data on the screen.")
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun forms-mode (&optional primary)
|
(defun forms-mode (&optional primary)
|
||||||
"Major mode to visit files in a field-structured manner using a form.
|
"Major mode to visit files in a field-structured manner using a form.
|
||||||
|
|
||||||
Commands: Equivalent keys in read-only mode:
|
Commands: Equivalent keys in read-only mode:
|
||||||
TAB forms-next-field TAB
|
TAB forms-next-field TAB
|
||||||
C-c TAB forms-next-field
|
C-c TAB forms-next-field
|
||||||
C-c < forms-first-record <
|
C-c < forms-first-record <
|
||||||
C-c > forms-last-record >
|
C-c > forms-last-record >
|
||||||
C-c ? describe-mode ?
|
C-c ? describe-mode ?
|
||||||
|
|
@ -510,7 +510,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(setq forms-new-record-filter nil)
|
(setq forms-new-record-filter nil)
|
||||||
(setq forms-modified-record-filter nil)
|
(setq forms-modified-record-filter nil)
|
||||||
|
|
||||||
;; If running Emacs 19 under X, setup faces to show read-only and
|
;; If running Emacs 19 under X, setup faces to show read-only and
|
||||||
;; read-write fields.
|
;; read-write fields.
|
||||||
(if (fboundp 'make-face)
|
(if (fboundp 'make-face)
|
||||||
(progn
|
(progn
|
||||||
|
|
@ -521,7 +521,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
;;(message "forms: processing control file...")
|
;;(message "forms: processing control file...")
|
||||||
;; If enable-local-eval is not set to t the user is asked first.
|
;; If enable-local-eval is not set to t the user is asked first.
|
||||||
(if (or (eq enable-local-eval t)
|
(if (or (eq enable-local-eval t)
|
||||||
(yes-or-no-p
|
(yes-or-no-p
|
||||||
(concat "Evaluate lisp code in buffer "
|
(concat "Evaluate lisp code in buffer "
|
||||||
(buffer-name) " to display forms ")))
|
(buffer-name) " to display forms ")))
|
||||||
(eval-current-buffer)
|
(eval-current-buffer)
|
||||||
|
|
@ -529,7 +529,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
|
|
||||||
;; Check if the mandatory variables make sense.
|
;; Check if the mandatory variables make sense.
|
||||||
(or forms-file
|
(or forms-file
|
||||||
(error (concat "Forms control file error: "
|
(error (concat "Forms control file error: "
|
||||||
"`forms-file' has not been set")))
|
"`forms-file' has not been set")))
|
||||||
|
|
||||||
;; Check forms-field-sep first, since it can be needed to
|
;; Check forms-field-sep first, since it can be needed to
|
||||||
|
|
@ -554,13 +554,13 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(if (and (stringp forms-multi-line)
|
(if (and (stringp forms-multi-line)
|
||||||
(eq (length forms-multi-line) 1))
|
(eq (length forms-multi-line) 1))
|
||||||
(if (string= forms-multi-line forms-field-sep)
|
(if (string= forms-multi-line forms-field-sep)
|
||||||
(error (concat "Forms control file error: "
|
(error (concat "Forms control file error: "
|
||||||
"`forms-multi-line' is equal to 'forms-field-sep'")))
|
"`forms-multi-line' is equal to 'forms-field-sep'")))
|
||||||
(error (concat "Forms control file error: "
|
(error (concat "Forms control file error: "
|
||||||
"`forms-multi-line' must be nil or a one-character string"))))
|
"`forms-multi-line' must be nil or a one-character string"))))
|
||||||
(or (fboundp 'set-text-properties)
|
(or (fboundp 'set-text-properties)
|
||||||
(setq forms-use-text-properties nil))
|
(setq forms-use-text-properties nil))
|
||||||
|
|
||||||
;; Validate and process forms-format-list.
|
;; Validate and process forms-format-list.
|
||||||
;;(message "forms: pre-processing format list...")
|
;;(message "forms: pre-processing format list...")
|
||||||
(make-local-variable 'forms--elements)
|
(make-local-variable 'forms--elements)
|
||||||
|
|
@ -699,7 +699,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(if (= forms--total-records 0)
|
(if (= forms--total-records 0)
|
||||||
;;(message "forms: proceeding setup (new file)...")
|
;;(message "forms: proceeding setup (new file)...")
|
||||||
(progn
|
(progn
|
||||||
(insert
|
(insert
|
||||||
"GNU Emacs Forms Mode version " forms-version "\n\n"
|
"GNU Emacs Forms Mode version " forms-version "\n\n"
|
||||||
(if (file-exists-p forms-file)
|
(if (file-exists-p forms-file)
|
||||||
(concat "No records available in file `" forms-file "'\n\n")
|
(concat "No records available in file `" forms-file "'\n\n")
|
||||||
|
|
@ -736,7 +736,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
;; Symbols in the list are evaluated, and consecutive strings are
|
;; Symbols in the list are evaluated, and consecutive strings are
|
||||||
;; concatenated.
|
;; concatenated.
|
||||||
;; Array `forms--elements' is constructed that contains the order
|
;; Array `forms--elements' is constructed that contains the order
|
||||||
;; of the fields on the display. This array is used by
|
;; of the fields on the display. This array is used by
|
||||||
;; `forms--parser-using-text-properties' to extract the fields data
|
;; `forms--parser-using-text-properties' to extract the fields data
|
||||||
;; from the form on the screen.
|
;; from the form on the screen.
|
||||||
;; Upon completion, `forms-format-list' is guaranteed correct, so
|
;; Upon completion, `forms-format-list' is guaranteed correct, so
|
||||||
|
|
@ -759,7 +759,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(let ((the-list forms-format-list) ; the list of format elements
|
(let ((the-list forms-format-list) ; the list of format elements
|
||||||
(this-item 0) ; element in list
|
(this-item 0) ; element in list
|
||||||
(prev-item nil)
|
(prev-item nil)
|
||||||
(field-num 0)) ; highest field number
|
(field-num 0)) ; highest field number
|
||||||
|
|
||||||
(setq forms-format-list nil) ; gonna rebuild
|
(setq forms-format-list nil) ; gonna rebuild
|
||||||
|
|
||||||
|
|
@ -785,7 +785,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(setq prev-item el)))
|
(setq prev-item el)))
|
||||||
|
|
||||||
;; Try numeric ...
|
;; Try numeric ...
|
||||||
((numberp el)
|
((numberp el)
|
||||||
|
|
||||||
;; Validate range.
|
;; Validate range.
|
||||||
(if (or (<= el 0)
|
(if (or (<= el 0)
|
||||||
|
|
@ -862,8 +862,8 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(defun forms--iif-hook (begin end)
|
(defun forms--iif-hook (begin end)
|
||||||
"`insert-in-front-hooks' function for read-only segments."
|
"`insert-in-front-hooks' function for read-only segments."
|
||||||
|
|
||||||
;; Note start location. By making it a marker that points one
|
;; Note start location. By making it a marker that points one
|
||||||
;; character beyond the actual location, it is guaranteed to move
|
;; character beyond the actual location, it is guaranteed to move
|
||||||
;; correctly if text is inserted.
|
;; correctly if text is inserted.
|
||||||
(or forms--iif-start
|
(or forms--iif-start
|
||||||
(setq forms--iif-start (copy-marker (1+ (point)))))
|
(setq forms--iif-start (copy-marker (1+ (point)))))
|
||||||
|
|
@ -874,12 +874,12 @@ Commands: Equivalent keys in read-only mode:
|
||||||
'read-only))
|
'read-only))
|
||||||
(progn
|
(progn
|
||||||
;; Fetch current properties.
|
;; Fetch current properties.
|
||||||
(setq forms--iif-properties
|
(setq forms--iif-properties
|
||||||
(text-properties-at (1- forms--iif-start)))
|
(text-properties-at (1- forms--iif-start)))
|
||||||
|
|
||||||
;; Replace them.
|
;; Replace them.
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
(set-text-properties
|
(set-text-properties
|
||||||
(1- forms--iif-start) forms--iif-start
|
(1- forms--iif-start) forms--iif-start
|
||||||
(list 'face forms--rw-face 'front-sticky '(face))))
|
(list 'face forms--rw-face 'front-sticky '(face))))
|
||||||
|
|
||||||
|
|
@ -900,7 +900,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
;; Restore properties.
|
;; Restore properties.
|
||||||
(if forms--iif-start
|
(if forms--iif-start
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
(set-text-properties
|
(set-text-properties
|
||||||
(1- forms--iif-start) forms--iif-start
|
(1- forms--iif-start) forms--iif-start
|
||||||
forms--iif-properties)))
|
forms--iif-properties)))
|
||||||
|
|
||||||
|
|
@ -920,9 +920,9 @@ Commands: Equivalent keys in read-only mode:
|
||||||
|
|
||||||
(let ((forms--marker 0)
|
(let ((forms--marker 0)
|
||||||
(forms--dyntext 0))
|
(forms--dyntext 0))
|
||||||
(setq
|
(setq
|
||||||
forms--format
|
forms--format
|
||||||
(if forms-use-text-properties
|
(if forms-use-text-properties
|
||||||
`(lambda (arg)
|
`(lambda (arg)
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
,@(apply 'append
|
,@(apply 'append
|
||||||
|
|
@ -957,9 +957,9 @@ Commands: Equivalent keys in read-only mode:
|
||||||
;; (let ((inhibit-read-only t))
|
;; (let ((inhibit-read-only t))
|
||||||
;;
|
;;
|
||||||
;; ;; A string, e.g. "text: ".
|
;; ;; A string, e.g. "text: ".
|
||||||
;; (set-text-properties
|
;; (set-text-properties
|
||||||
;; (point)
|
;; (point)
|
||||||
;; (progn (insert "text: ") (point))
|
;; (progn (insert "text: ") (point))
|
||||||
;; (list 'face forms--ro-face
|
;; (list 'face forms--ro-face
|
||||||
;; 'read-only 1
|
;; 'read-only 1
|
||||||
;; 'insert-in-front-hooks 'forms--iif-hook
|
;; 'insert-in-front-hooks 'forms--iif-hook
|
||||||
|
|
@ -970,7 +970,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
;; (aset forms--markers 0 (point-marker))
|
;; (aset forms--markers 0 (point-marker))
|
||||||
;; (insert (elt arg 5))
|
;; (insert (elt arg 5))
|
||||||
;; (or (= (point) here)
|
;; (or (= (point) here)
|
||||||
;; (set-text-properties
|
;; (set-text-properties
|
||||||
;; here (point)
|
;; here (point)
|
||||||
;; (list 'face forms--rw-face
|
;; (list 'face forms--rw-face
|
||||||
;; 'front-sticky '(face))))
|
;; 'front-sticky '(face))))
|
||||||
|
|
@ -1008,8 +1008,8 @@ Commands: Equivalent keys in read-only mode:
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
((stringp el)
|
((stringp el)
|
||||||
|
|
||||||
`((set-text-properties
|
`((set-text-properties
|
||||||
(point) ; start at point
|
(point) ; start at point
|
||||||
(progn ; until after insertion
|
(progn ; until after insertion
|
||||||
(insert ,el)
|
(insert ,el)
|
||||||
|
|
@ -1020,16 +1020,16 @@ Commands: Equivalent keys in read-only mode:
|
||||||
'insert-in-front-hooks '(forms--iif-hook)
|
'insert-in-front-hooks '(forms--iif-hook)
|
||||||
'rear-nonsticky '(face read-only insert-in-front-hooks
|
'rear-nonsticky '(face read-only insert-in-front-hooks
|
||||||
intangible)))))
|
intangible)))))
|
||||||
|
|
||||||
((numberp el)
|
((numberp el)
|
||||||
`((let ((here (point)))
|
`((let ((here (point)))
|
||||||
(aset forms--markers
|
(aset forms--markers
|
||||||
,(prog1 forms--marker
|
,(prog1 forms--marker
|
||||||
(setq forms--marker (1+ forms--marker)))
|
(setq forms--marker (1+ forms--marker)))
|
||||||
(point-marker))
|
(point-marker))
|
||||||
(insert (elt arg ,(1- el)))
|
(insert (elt arg ,(1- el)))
|
||||||
(or (= (point) here)
|
(or (= (point) here)
|
||||||
(set-text-properties
|
(set-text-properties
|
||||||
here (point)
|
here (point)
|
||||||
(list 'face forms--rw-face
|
(list 'face forms--rw-face
|
||||||
'front-sticky '(face)))))))
|
'front-sticky '(face)))))))
|
||||||
|
|
@ -1038,7 +1038,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
`((set-text-properties
|
`((set-text-properties
|
||||||
(point)
|
(point)
|
||||||
(progn
|
(progn
|
||||||
(insert (aset forms--dyntexts
|
(insert (aset forms--dyntexts
|
||||||
,(prog1 forms--dyntext
|
,(prog1 forms--dyntext
|
||||||
(setq forms--dyntext (1+ forms--dyntext)))
|
(setq forms--dyntext (1+ forms--dyntext)))
|
||||||
,el))
|
,el))
|
||||||
|
|
@ -1071,7 +1071,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
;; (insert (aset forms--dyntexts 0 (tocol 40)))
|
;; (insert (aset forms--dyntexts 0 (tocol 40)))
|
||||||
;; ... )
|
;; ... )
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
((stringp el)
|
((stringp el)
|
||||||
`((insert ,el)))
|
`((insert ,el)))
|
||||||
((numberp el)
|
((numberp el)
|
||||||
|
|
@ -1110,8 +1110,8 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(let (here)
|
(let (here)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
,@(apply 'append
|
,@(apply 'append
|
||||||
(mapcar
|
(mapcar
|
||||||
'forms--make-parser-elt
|
'forms--make-parser-elt
|
||||||
(append forms-format-list (list nil)))))))))
|
(append forms-format-list (list nil)))))))))
|
||||||
|
|
||||||
(forms--debug 'forms--parser))
|
(forms--debug 'forms--parser))
|
||||||
|
|
@ -1128,7 +1128,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(goto-char (setq here (aref forms--markers i)))
|
(goto-char (setq here (aref forms--markers i)))
|
||||||
(if (get-text-property here 'read-only)
|
(if (get-text-property here 'read-only)
|
||||||
(aset forms--recordv (aref forms--elements i) nil)
|
(aset forms--recordv (aref forms--elements i) nil)
|
||||||
(if (setq there
|
(if (setq there
|
||||||
(next-single-property-change here 'read-only))
|
(next-single-property-change here 'read-only))
|
||||||
(aset forms--recordv (aref forms--elements i)
|
(aset forms--recordv (aref forms--elements i)
|
||||||
(buffer-substring-no-properties here there))
|
(buffer-substring-no-properties here there))
|
||||||
|
|
@ -1144,12 +1144,12 @@ Commands: Equivalent keys in read-only mode:
|
||||||
;; (lambda nil
|
;; (lambda nil
|
||||||
;; (let (here)
|
;; (let (here)
|
||||||
;; (goto-char (point-min))
|
;; (goto-char (point-min))
|
||||||
;;
|
;;
|
||||||
;; ;; "text: "
|
;; ;; "text: "
|
||||||
;; (if (not (looking-at "text: "))
|
;; (if (not (looking-at "text: "))
|
||||||
;; (error "Parse error: cannot find \"text: \""))
|
;; (error "Parse error: cannot find \"text: \""))
|
||||||
;; (forward-char 6) ; past "text: "
|
;; (forward-char 6) ; past "text: "
|
||||||
;;
|
;;
|
||||||
;; ;; 6
|
;; ;; 6
|
||||||
;; ;; "\nmore text: "
|
;; ;; "\nmore text: "
|
||||||
;; (setq here (point))
|
;; (setq here (point))
|
||||||
|
|
@ -1163,7 +1163,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
;; (error "Parse error: not looking at \"%s\"" forms--dyntext))
|
;; (error "Parse error: not looking at \"%s\"" forms--dyntext))
|
||||||
;; (forward-char (length forms--dyntext))
|
;; (forward-char (length forms--dyntext))
|
||||||
;; (setq forms--dynamic-text (cdr-safe forms--dynamic-text)))
|
;; (setq forms--dynamic-text (cdr-safe forms--dynamic-text)))
|
||||||
;; ...
|
;; ...
|
||||||
;; ;; final flush (due to terminator sentinel, see below)
|
;; ;; final flush (due to terminator sentinel, see below)
|
||||||
;; (aset forms--recordv 7 (buffer-substring-no-properties (point) (point-max)))
|
;; (aset forms--recordv 7 (buffer-substring-no-properties (point) (point-max)))
|
||||||
|
|
||||||
|
|
@ -1233,7 +1233,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(forms--get-record)))
|
(forms--get-record)))
|
||||||
|
|
||||||
;; This may be overkill, but try to avoid interference with
|
;; This may be overkill, but try to avoid interference with
|
||||||
;; the normal processing.
|
;; the normal processing.
|
||||||
(kill-buffer forms--file-buffer)
|
(kill-buffer forms--file-buffer)
|
||||||
|
|
||||||
|
|
@ -1260,8 +1260,8 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(defun forms--set-keymaps ()
|
(defun forms--set-keymaps ()
|
||||||
"Set the keymaps used in this mode."
|
"Set the keymaps used in this mode."
|
||||||
|
|
||||||
(use-local-map (if forms-read-only
|
(use-local-map (if forms-read-only
|
||||||
forms-mode-ro-map
|
forms-mode-ro-map
|
||||||
forms-mode-edit-map)))
|
forms-mode-edit-map)))
|
||||||
|
|
||||||
(defun forms--mode-commands ()
|
(defun forms--mode-commands ()
|
||||||
|
|
@ -1403,7 +1403,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(put 'forms-delete-record 'menu-enable '(not forms-read-only))
|
(put 'forms-delete-record 'menu-enable '(not forms-read-only))
|
||||||
)
|
)
|
||||||
|
|
||||||
(defun forms--mode-commands1 (map)
|
(defun forms--mode-commands1 (map)
|
||||||
"Helper routine to define keys."
|
"Helper routine to define keys."
|
||||||
(define-key map [TAB] 'forms-next-field)
|
(define-key map [TAB] 'forms-next-field)
|
||||||
(define-key map [S-tab] 'forms-prev-field)
|
(define-key map [S-tab] 'forms-prev-field)
|
||||||
|
|
@ -1526,10 +1526,10 @@ Commands: Equivalent keys in read-only mode:
|
||||||
(message "Warning: this record has %d fields instead of %d"
|
(message "Warning: this record has %d fields instead of %d"
|
||||||
(length forms--the-record-list) forms-number-of-fields))
|
(length forms--the-record-list) forms-number-of-fields))
|
||||||
(if (< (length forms--the-record-list) forms-number-of-fields)
|
(if (< (length forms--the-record-list) forms-number-of-fields)
|
||||||
(setq forms--the-record-list
|
(setq forms--the-record-list
|
||||||
(append forms--the-record-list
|
(append forms--the-record-list
|
||||||
(make-list
|
(make-list
|
||||||
(- forms-number-of-fields
|
(- forms-number-of-fields
|
||||||
(length forms--the-record-list))
|
(length forms--the-record-list))
|
||||||
"")))))
|
"")))))
|
||||||
|
|
||||||
|
|
@ -1549,7 +1549,7 @@ Commands: Equivalent keys in read-only mode:
|
||||||
"Parse contents of form into list of strings."
|
"Parse contents of form into list of strings."
|
||||||
;; The contents of the form are parsed, and a new list of strings
|
;; The contents of the form are parsed, and a new list of strings
|
||||||
;; is constructed.
|
;; is constructed.
|
||||||
;; A vector with the strings from the original record is
|
;; A vector with the strings from the original record is
|
||||||
;; constructed, which is updated with the new contents. Therefore
|
;; constructed, which is updated with the new contents. Therefore
|
||||||
;; fields which were not in the form are not modified.
|
;; fields which were not in the form are not modified.
|
||||||
;; Finally, the vector is transformed into a list for further processing.
|
;; Finally, the vector is transformed into a list for further processing.
|
||||||
|
|
@ -1585,11 +1585,11 @@ As a side effect: sets `forms--the-record-list'."
|
||||||
(setq forms--the-record-list (forms--parse-form))
|
(setq forms--the-record-list (forms--parse-form))
|
||||||
(setq the-record
|
(setq the-record
|
||||||
(mapconcat 'identity forms--the-record-list forms-field-sep))
|
(mapconcat 'identity forms--the-record-list forms-field-sep))
|
||||||
|
|
||||||
(if (string-match (regexp-quote forms-field-sep)
|
(if (string-match (regexp-quote forms-field-sep)
|
||||||
(mapconcat 'identity forms--the-record-list ""))
|
(mapconcat 'identity forms--the-record-list ""))
|
||||||
(error "Field separator occurs in record - update refused"))
|
(error "Field separator occurs in record - update refused"))
|
||||||
|
|
||||||
;; Handle multi-line fields, if allowed.
|
;; Handle multi-line fields, if allowed.
|
||||||
(if forms-multi-line
|
(if forms-multi-line
|
||||||
(forms--trans the-record "\n" forms-multi-line))
|
(forms--trans the-record "\n" forms-multi-line))
|
||||||
|
|
@ -1713,7 +1713,7 @@ As a side effect: sets `forms--the-record-list'."
|
||||||
As a side effect: re-calculates the number of records in the data file."
|
As a side effect: re-calculates the number of records in the data file."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let
|
(let
|
||||||
((numrec
|
((numrec
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(set-buffer forms--file-buffer)
|
(set-buffer forms--file-buffer)
|
||||||
(count-lines (point-min) (point-max)))))
|
(count-lines (point-min) (point-max)))))
|
||||||
|
|
@ -1769,7 +1769,7 @@ Otherwise enables edit mode if the visited file is writable."
|
||||||
(defun forms-insert-record (arg)
|
(defun forms-insert-record (arg)
|
||||||
"Create a new record before the current one.
|
"Create a new record before the current one.
|
||||||
With ARG: store the record after the current one.
|
With ARG: store the record after the current one.
|
||||||
If `forms-new-record-filter' contains the name of a function,
|
If `forms-new-record-filter' contains the name of a function,
|
||||||
it is called to fill (some of) the fields with default values.
|
it is called to fill (some of) the fields with default values.
|
||||||
If `forms-insert-after is non-nil, the default behavior is to insert
|
If `forms-insert-after is non-nil, the default behavior is to insert
|
||||||
after the current record."
|
after the current record."
|
||||||
|
|
@ -1808,7 +1808,7 @@ after the current record."
|
||||||
(open-line 1)
|
(open-line 1)
|
||||||
(insert the-record)
|
(insert the-record)
|
||||||
(beginning-of-line))
|
(beginning-of-line))
|
||||||
|
|
||||||
(setq forms--current-record ln))
|
(setq forms--current-record ln))
|
||||||
|
|
||||||
(setq forms--total-records (1+ forms--total-records))
|
(setq forms--total-records (1+ forms--total-records))
|
||||||
|
|
@ -1841,8 +1841,8 @@ after the current record."
|
||||||
|
|
||||||
(defun forms-search-forward (regexp)
|
(defun forms-search-forward (regexp)
|
||||||
"Search forward for record containing REGEXP."
|
"Search forward for record containing REGEXP."
|
||||||
(interactive
|
(interactive
|
||||||
(list (read-string (concat "Search forward for"
|
(list (read-string (concat "Search forward for"
|
||||||
(if forms--search-regexp
|
(if forms--search-regexp
|
||||||
(concat " ("
|
(concat " ("
|
||||||
forms--search-regexp
|
forms--search-regexp
|
||||||
|
|
@ -1877,8 +1877,8 @@ after the current record."
|
||||||
|
|
||||||
(defun forms-search-backward (regexp)
|
(defun forms-search-backward (regexp)
|
||||||
"Search backward for record containing REGEXP."
|
"Search backward for record containing REGEXP."
|
||||||
(interactive
|
(interactive
|
||||||
(list (read-string (concat "Search backward for"
|
(list (read-string (concat "Search backward for"
|
||||||
(if forms--search-regexp
|
(if forms--search-regexp
|
||||||
(concat " ("
|
(concat " ("
|
||||||
forms--search-regexp
|
forms--search-regexp
|
||||||
|
|
@ -1925,8 +1925,8 @@ after writing out the data."
|
||||||
(set-buffer forms--file-buffer)
|
(set-buffer forms--file-buffer)
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
;; Write file hooks are run via local-write-file-hooks.
|
;; Write file hooks are run via local-write-file-hooks.
|
||||||
;; (if write-file-filter
|
;; (if write-file-filter
|
||||||
;; (save-excursion
|
;; (save-excursion
|
||||||
;; (run-hooks 'write-file-filter)))
|
;; (run-hooks 'write-file-filter)))
|
||||||
|
|
||||||
;; If they have a write-file-filter, force the buffer to be
|
;; If they have a write-file-filter, force the buffer to be
|
||||||
|
|
@ -2076,7 +2076,7 @@ Usage: (setq forms-number-of-fields
|
||||||
(setq ret (concat ret (prin1-to-string vel) "\n")))
|
(setq ret (concat ret (prin1-to-string vel) "\n")))
|
||||||
(setq ret (concat ret "<unbound>" "\n")))
|
(setq ret (concat ret "<unbound>" "\n")))
|
||||||
(if (fboundp el)
|
(if (fboundp el)
|
||||||
(setq ret (concat ret (prin1-to-string (symbol-function el))
|
(setq ret (concat ret (prin1-to-string (symbol-function el))
|
||||||
"\n"))))))
|
"\n"))))))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(set-buffer (get-buffer-create "*forms-mode debug*"))
|
(set-buffer (get-buffer-create "*forms-mode debug*"))
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
;; developing the mode itself, then see the Annotations section in the GDB
|
;; developing the mode itself, then see the Annotations section in the GDB
|
||||||
;; info manual.
|
;; info manual.
|
||||||
;;
|
;;
|
||||||
;; Known Bugs: Does not auto-display arrays of structures or structures
|
;; Known Bugs: Does not auto-display arrays of structures or structures
|
||||||
;; containing arrays.
|
;; containing arrays.
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
@ -116,7 +116,7 @@ The following interactive lisp functions help control operation :
|
||||||
|
|
||||||
`gdb-many-windows' - Toggle the number of windows gdb uses.
|
`gdb-many-windows' - Toggle the number of windows gdb uses.
|
||||||
`gdb-restore-windows' - To restore the window layout.
|
`gdb-restore-windows' - To restore the window layout.
|
||||||
`gdb-quit' - To delete (most) of the buffers used by GDB-UI and
|
`gdb-quit' - To delete (most) of the buffers used by GDB-UI and
|
||||||
reset variables."
|
reset variables."
|
||||||
;;
|
;;
|
||||||
(interactive (list (gud-query-cmdline 'gdba)))
|
(interactive (list (gud-query-cmdline 'gdba)))
|
||||||
|
|
@ -530,7 +530,7 @@ This filter may simply queue output for a later time."
|
||||||
("display-end" gdb-display-end)
|
("display-end" gdb-display-end)
|
||||||
; GDB commands info stack, info locals and frame generate an error-begin
|
; GDB commands info stack, info locals and frame generate an error-begin
|
||||||
; annotation at start when there is no stack but this is a quirk/bug in
|
; annotation at start when there is no stack but this is a quirk/bug in
|
||||||
; annotations.
|
; annotations.
|
||||||
; ("error-begin" gdb-error-begin)
|
; ("error-begin" gdb-error-begin)
|
||||||
("display-number-end" gdb-display-number-end)
|
("display-number-end" gdb-display-number-end)
|
||||||
("array-section-begin" gdb-array-section-begin)
|
("array-section-begin" gdb-array-section-begin)
|
||||||
|
|
@ -582,7 +582,7 @@ output from a previous command if that happens to be in effect."
|
||||||
(let ((handler
|
(let ((handler
|
||||||
(car (cdr (gdb-get-current-item)))))
|
(car (cdr (gdb-get-current-item)))))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(set-buffer (gdb-get-create-buffer
|
(set-buffer (gdb-get-create-buffer
|
||||||
'gdb-partial-output-buffer))
|
'gdb-partial-output-buffer))
|
||||||
(funcall handler))))
|
(funcall handler))))
|
||||||
(t
|
(t
|
||||||
|
|
@ -590,7 +590,7 @@ output from a previous command if that happens to be in effect."
|
||||||
(error "Output sink phase error 1")))))
|
(error "Output sink phase error 1")))))
|
||||||
|
|
||||||
(defun gdb-prompt (ignored)
|
(defun gdb-prompt (ignored)
|
||||||
"An annotation handler for `prompt'.
|
"An annotation handler for `prompt'.
|
||||||
This sends the next command (if any) to gdb."
|
This sends the next command (if any) to gdb."
|
||||||
(let ((sink (gdb-get-output-sink)))
|
(let ((sink (gdb-get-output-sink)))
|
||||||
(cond
|
(cond
|
||||||
|
|
@ -714,7 +714,7 @@ output from the current command if that happens to be appropriate."
|
||||||
(if (string-equal (frame-parameter frame 'name)
|
(if (string-equal (frame-parameter frame 'name)
|
||||||
gdb-expression-buffer-name)
|
gdb-expression-buffer-name)
|
||||||
(throw 'frame-exists nil)))
|
(throw 'frame-exists nil)))
|
||||||
(make-frame `((height . ,gdb-window-height)
|
(make-frame `((height . ,gdb-window-height)
|
||||||
(width . ,gdb-window-width)
|
(width . ,gdb-window-width)
|
||||||
(tool-bar-lines . nil)
|
(tool-bar-lines . nil)
|
||||||
(menu-bar-lines . nil)
|
(menu-bar-lines . nil)
|
||||||
|
|
@ -1082,7 +1082,7 @@ output from the current command if that happens to be appropriate."
|
||||||
;; It is either concatenated to OUTPUT or directed
|
;; It is either concatenated to OUTPUT or directed
|
||||||
;; elsewhere.
|
;; elsewhere.
|
||||||
(setq output
|
(setq output
|
||||||
(gdb-concat-output
|
(gdb-concat-output
|
||||||
output
|
output
|
||||||
(substring burst 0 (match-beginning 0))))
|
(substring burst 0 (match-beginning 0))))
|
||||||
|
|
||||||
|
|
@ -1262,7 +1262,7 @@ output from the current command if that happens to be appropriate."
|
||||||
gdb-info-breakpoints-custom)
|
gdb-info-breakpoints-custom)
|
||||||
|
|
||||||
(defvar gdb-cdir nil "Compilation directory.")
|
(defvar gdb-cdir nil "Compilation directory.")
|
||||||
(defvar breakpoint-enabled-icon)
|
(defvar breakpoint-enabled-icon)
|
||||||
(defvar breakpoint-disabled-icon)
|
(defvar breakpoint-disabled-icon)
|
||||||
|
|
||||||
;;-put breakpoint icons in relevant margins (even those set in the GUD buffer)
|
;;-put breakpoint icons in relevant margins (even those set in the GUD buffer)
|
||||||
|
|
@ -1299,7 +1299,7 @@ output from the current command if that happens to be appropriate."
|
||||||
'mouse-face 'highlight)
|
'mouse-face 'highlight)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(set-buffer
|
(set-buffer
|
||||||
(find-file-noselect
|
(find-file-noselect
|
||||||
(if (file-exists-p file) file
|
(if (file-exists-p file) file
|
||||||
(expand-file-name file gdb-cdir))))
|
(expand-file-name file gdb-cdir))))
|
||||||
(save-current-buffer
|
(save-current-buffer
|
||||||
|
|
@ -1315,14 +1315,14 @@ output from the current command if that happens to be appropriate."
|
||||||
;; only want one breakpoint icon at each location
|
;; only want one breakpoint icon at each location
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-line (string-to-number line))
|
(goto-line (string-to-number line))
|
||||||
(let ((start (progn (beginning-of-line)
|
(let ((start (progn (beginning-of-line)
|
||||||
(- (point) 1)))
|
(- (point) 1)))
|
||||||
(end (progn (end-of-line) (+ (point) 1))))
|
(end (progn (end-of-line) (+ (point) 1))))
|
||||||
(if (display-graphic-p)
|
(if (display-graphic-p)
|
||||||
(progn
|
(progn
|
||||||
(remove-images start end)
|
(remove-images start end)
|
||||||
(if (eq ?y flag)
|
(if (eq ?y flag)
|
||||||
(put-image breakpoint-enabled-icon
|
(put-image breakpoint-enabled-icon
|
||||||
(point)
|
(point)
|
||||||
"breakpoint icon enabled"
|
"breakpoint icon enabled"
|
||||||
'left-margin)
|
'left-margin)
|
||||||
|
|
@ -1387,7 +1387,7 @@ output from the current command if that happens to be appropriate."
|
||||||
(list
|
(list
|
||||||
(concat
|
(concat
|
||||||
(if (eq ?y (char-after (match-beginning 2)))
|
(if (eq ?y (char-after (match-beginning 2)))
|
||||||
"server disable "
|
"server disable "
|
||||||
"server enable ")
|
"server enable ")
|
||||||
(match-string 1) "\n")
|
(match-string 1) "\n")
|
||||||
'ignore)))))
|
'ignore)))))
|
||||||
|
|
@ -1564,7 +1564,7 @@ the source buffer."
|
||||||
gdb-info-locals-handler
|
gdb-info-locals-handler
|
||||||
gdb-info-locals-custom)
|
gdb-info-locals-custom)
|
||||||
|
|
||||||
;; Abbreviate for arrays and structures.
|
;; Abbreviate for arrays and structures.
|
||||||
;; These can be expanded using gud-display.
|
;; These can be expanded using gud-display.
|
||||||
(defun gdb-info-locals-handler nil
|
(defun gdb-info-locals-handler nil
|
||||||
(gdb-set-pending-triggers (delq 'gdb-invalidate-locals
|
(gdb-set-pending-triggers (delq 'gdb-invalidate-locals
|
||||||
|
|
@ -1646,7 +1646,7 @@ the source buffer."
|
||||||
(while (< (point) (- (point-max) 1))
|
(while (< (point) (- (point-max) 1))
|
||||||
(forward-line 1)
|
(forward-line 1)
|
||||||
(if (looking-at "\\([0-9]+\\): \\([ny]\\)")
|
(if (looking-at "\\([0-9]+\\): \\([ny]\\)")
|
||||||
(setq display-list
|
(setq display-list
|
||||||
(cons (string-to-int (match-string 1)) display-list)))
|
(cons (string-to-int (match-string 1)) display-list)))
|
||||||
(end-of-line)))
|
(end-of-line)))
|
||||||
(if (not (display-graphic-p))
|
(if (not (display-graphic-p))
|
||||||
|
|
@ -1654,10 +1654,10 @@ the source buffer."
|
||||||
(dolist (buffer (buffer-list))
|
(dolist (buffer (buffer-list))
|
||||||
(if (string-match "\\*display \\([0-9]+\\)\\*" (buffer-name buffer))
|
(if (string-match "\\*display \\([0-9]+\\)\\*" (buffer-name buffer))
|
||||||
(progn
|
(progn
|
||||||
(let ((number
|
(let ((number
|
||||||
(match-string 1 (buffer-name buffer))))
|
(match-string 1 (buffer-name buffer))))
|
||||||
(if (not (memq (string-to-int number) display-list))
|
(if (not (memq (string-to-int number) display-list))
|
||||||
(kill-buffer
|
(kill-buffer
|
||||||
(get-buffer (concat "*display " number "*")))))))))
|
(get-buffer (concat "*display " number "*")))))))))
|
||||||
(gdb-delete-frames display-list))))
|
(gdb-delete-frames display-list))))
|
||||||
|
|
||||||
|
|
@ -2233,17 +2233,17 @@ BUFFER nil or omitted means use the current buffer."
|
||||||
|
|
||||||
(defun gdb-get-current-frame ()
|
(defun gdb-get-current-frame ()
|
||||||
(if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers)))
|
(if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers)))
|
||||||
(progn
|
(progn
|
||||||
(gdb-enqueue-idle-input
|
(gdb-enqueue-idle-input
|
||||||
(list (concat "server frame\n") 'gdb-frame-handler))
|
(list (concat "server frame\n") 'gdb-frame-handler))
|
||||||
(gdb-set-pending-triggers
|
(gdb-set-pending-triggers
|
||||||
(cons 'gdb-get-current-frame
|
(cons 'gdb-get-current-frame
|
||||||
(gdb-get-pending-triggers))))))
|
(gdb-get-pending-triggers))))))
|
||||||
|
|
||||||
(defun gdb-frame-handler ()
|
(defun gdb-frame-handler ()
|
||||||
(gdb-set-pending-triggers
|
(gdb-set-pending-triggers
|
||||||
(delq 'gdb-get-current-frame (gdb-get-pending-triggers)))
|
(delq 'gdb-get-current-frame (gdb-get-pending-triggers)))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(set-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer))
|
(set-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(if (looking-at "^#[0-9]*\\s-*0x\\S-* in \\(\\S-*\\)")
|
(if (looking-at "^#[0-9]*\\s-*0x\\S-* in \\(\\S-*\\)")
|
||||||
|
|
|
||||||
14
lisp/gud.el
14
lisp/gud.el
|
|
@ -1934,7 +1934,7 @@ nil)
|
||||||
(setq gud-last-frame
|
(setq gud-last-frame
|
||||||
(cons file-found
|
(cons file-found
|
||||||
(string-to-int
|
(string-to-int
|
||||||
(let
|
(let
|
||||||
((numstr (match-string 4 gud-marker-acc)))
|
((numstr (match-string 4 gud-marker-acc)))
|
||||||
(if (string-match "," numstr)
|
(if (string-match "," numstr)
|
||||||
(replace-match "" nil nil numstr)
|
(replace-match "" nil nil numstr)
|
||||||
|
|
@ -2519,7 +2519,7 @@ Obeying it means displaying in another window the specified file and line."
|
||||||
(if (not (or (verify-visited-file-modtime buffer) gud-keep-buffer))
|
(if (not (or (verify-visited-file-modtime buffer) gud-keep-buffer))
|
||||||
(progn
|
(progn
|
||||||
(if
|
(if
|
||||||
(yes-or-no-p
|
(yes-or-no-p
|
||||||
(format "File %s changed on disk. Reread from disk? "
|
(format "File %s changed on disk. Reread from disk? "
|
||||||
(buffer-name)))
|
(buffer-name)))
|
||||||
(revert-buffer t t)
|
(revert-buffer t t)
|
||||||
|
|
@ -2576,8 +2576,8 @@ Obeying it means displaying in another window the specified file and line."
|
||||||
((eq key ?a)
|
((eq key ?a)
|
||||||
(setq subst (gud-read-address)))
|
(setq subst (gud-read-address)))
|
||||||
((eq key ?c)
|
((eq key ?c)
|
||||||
(setq subst
|
(setq subst
|
||||||
(gud-find-class
|
(gud-find-class
|
||||||
(if insource
|
(if insource
|
||||||
(buffer-file-name)
|
(buffer-file-name)
|
||||||
(car frame))
|
(car frame))
|
||||||
|
|
@ -2830,12 +2830,12 @@ class of the file (using s to separate nested class ids)."
|
||||||
;; While the c-syntactic information does not start
|
;; While the c-syntactic information does not start
|
||||||
;; with the 'topmost-intro symbol, there may be
|
;; with the 'topmost-intro symbol, there may be
|
||||||
;; nested classes...
|
;; nested classes...
|
||||||
(while (not (eq 'topmost-intro
|
(while (not (eq 'topmost-intro
|
||||||
(car (car (c-guess-basic-syntax)))))
|
(car (car (c-guess-basic-syntax)))))
|
||||||
;; Check if the current position c-syntactic
|
;; Check if the current position c-syntactic
|
||||||
;; analysis has 'inclass
|
;; analysis has 'inclass
|
||||||
(setq syntax (c-guess-basic-syntax))
|
(setq syntax (c-guess-basic-syntax))
|
||||||
(while
|
(while
|
||||||
(and (not (eq 'inclass (car (car syntax))))
|
(and (not (eq 'inclass (car (car syntax))))
|
||||||
(cdr syntax))
|
(cdr syntax))
|
||||||
(setq syntax (cdr syntax)))
|
(setq syntax (cdr syntax)))
|
||||||
|
|
@ -2855,7 +2855,7 @@ class of the file (using s to separate nested class ids)."
|
||||||
(goto-char (cdr (car syntax)))
|
(goto-char (cdr (car syntax)))
|
||||||
))
|
))
|
||||||
(string-match (concat (car nclass) "$") class-found)
|
(string-match (concat (car nclass) "$") class-found)
|
||||||
(setq class-found
|
(setq class-found
|
||||||
(replace-match (mapconcat 'identity nclass "$")
|
(replace-match (mapconcat 'identity nclass "$")
|
||||||
t t class-found)))))
|
t t class-found)))))
|
||||||
(if (not class-found)
|
(if (not class-found)
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ With ARG, you are asked to choose which language."
|
||||||
(newline n))
|
(newline n))
|
||||||
;; Some people get confused by the large gap.
|
;; Some people get confused by the large gap.
|
||||||
(newline (/ n 2))
|
(newline (/ n 2))
|
||||||
|
|
||||||
;; Skip the [...] line (don't delete it).
|
;; Skip the [...] line (don't delete it).
|
||||||
(forward-line 1)
|
(forward-line 1)
|
||||||
(newline (- n (/ n 2)))))
|
(newline (- n (/ n 2)))))
|
||||||
|
|
|
||||||
|
|
@ -483,7 +483,7 @@ or `keymap' property, return the binding of KEY in the string's keymap."
|
||||||
(if (equal string otherstring)
|
(if (equal string otherstring)
|
||||||
string
|
string
|
||||||
(format "%s (translated from %s)" string otherstring))))))
|
(format "%s (translated from %s)" string otherstring))))))
|
||||||
|
|
||||||
(defun describe-key-briefly (key &optional insert untranslated)
|
(defun describe-key-briefly (key &optional insert untranslated)
|
||||||
"Print the name of the function KEY invokes. KEY is a string.
|
"Print the name of the function KEY invokes. KEY is a string.
|
||||||
If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
|
If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
|
||||||
|
|
|
||||||
|
|
@ -130,10 +130,10 @@ A sample format:
|
||||||
00000050: 6162 6c65 2041 5343 4949 2063 6861 7261 able ASCII chara
|
00000050: 6162 6c65 2041 5343 4949 2063 6861 7261 able ASCII chara
|
||||||
00000060: 6374 6572 732e 2020 416e 7920 636f 6e74 cters. Any cont
|
00000060: 6374 6572 732e 2020 416e 7920 636f 6e74 cters. Any cont
|
||||||
00000070: 726f 6c20 6f72 206e 6f6e 2d41 5343 4949 rol or non-ASCII
|
00000070: 726f 6c20 6f72 206e 6f6e 2d41 5343 4949 rol or non-ASCII
|
||||||
00000080: 2063 6861 7261 6374 6572 730a 6172 6520 characters.are
|
00000080: 2063 6861 7261 6374 6572 730a 6172 6520 characters.are
|
||||||
00000090: 6469 7370 6c61 7965 6420 6173 2070 6572 displayed as per
|
00000090: 6469 7370 6c61 7965 6420 6173 2070 6572 displayed as per
|
||||||
000000a0: 696f 6473 2069 6e20 7468 6520 7072 696e iods in the prin
|
000000a0: 696f 6473 2069 6e20 7468 6520 7072 696e iods in the prin
|
||||||
000000b0: 7461 626c 6520 6368 6172 6163 7465 7220 table character
|
000000b0: 7461 626c 6520 6368 6172 6163 7465 7220 table character
|
||||||
000000c0: 7265 6769 6f6e 2e0a region..
|
000000c0: 7265 6769 6f6e 2e0a region..
|
||||||
|
|
||||||
Movement is as simple as movement in a normal emacs text buffer. Most
|
Movement is as simple as movement in a normal emacs text buffer. Most
|
||||||
|
|
@ -827,7 +827,7 @@ When following is enabled, the ASCII character corresponding to the
|
||||||
element under the point is highlighted.
|
element under the point is highlighted.
|
||||||
Customize the variable `hexl-follow-ascii' to disable this feature."
|
Customize the variable `hexl-follow-ascii' to disable this feature."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(let ((on-p (if arg
|
(let ((on-p (if arg
|
||||||
(> (prefix-numeric-value arg) 0)
|
(> (prefix-numeric-value arg) 0)
|
||||||
(not hexl-ascii-overlay))))
|
(not hexl-ascii-overlay))))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
;; Boston, MA 02111-1307, USA.
|
;; Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;
|
;;
|
||||||
;; With the hi-lock commands text matching interactively entered
|
;; With the hi-lock commands text matching interactively entered
|
||||||
;; regexp's can be highlighted. For example, `M-x highlight-regexp
|
;; regexp's can be highlighted. For example, `M-x highlight-regexp
|
||||||
;; RET clearly RET RET' will highlight all occurrences of `clearly'
|
;; RET clearly RET RET' will highlight all occurrences of `clearly'
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
;; to the edit menu.
|
;; to the edit menu.
|
||||||
;;
|
;;
|
||||||
;; (hi-lock-mode 1)
|
;; (hi-lock-mode 1)
|
||||||
;;
|
;;
|
||||||
;; You might also want to bind the hi-lock commands to more
|
;; You might also want to bind the hi-lock commands to more
|
||||||
;; finger-friendly sequences:
|
;; finger-friendly sequences:
|
||||||
|
|
||||||
|
|
@ -259,7 +259,7 @@ which can be called interactively, are:
|
||||||
Highlight matches of phrase PHRASE in current buffer with FACE.
|
Highlight matches of phrase PHRASE in current buffer with FACE.
|
||||||
(PHRASE can be any REGEXP, but spaces will be replaced by matches
|
(PHRASE can be any REGEXP, but spaces will be replaced by matches
|
||||||
to whitespace and initial lower-case letters will become case insensitive.)
|
to whitespace and initial lower-case letters will become case insensitive.)
|
||||||
|
|
||||||
\\[highlight-lines-matching-regexp] REGEXP FACE
|
\\[highlight-lines-matching-regexp] REGEXP FACE
|
||||||
Highlight lines containing matches of REGEXP in current buffer with FACE.
|
Highlight lines containing matches of REGEXP in current buffer with FACE.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
;; Highlight Changes mode in passive state while you make your changes, toggle
|
;; Highlight Changes mode in passive state while you make your changes, toggle
|
||||||
;; it on to active mode to see them, then toggle it back off to avoid
|
;; it on to active mode to see them, then toggle it back off to avoid
|
||||||
;; distraction.
|
;; distraction.
|
||||||
;;
|
;;
|
||||||
;; When active, changes are displayed in `highlight-changes-face'. When
|
;; When active, changes are displayed in `highlight-changes-face'. When
|
||||||
;; text is deleted, the following character is displayed in
|
;; text is deleted, the following character is displayed in
|
||||||
;; `highlight-changes-delete-face' face.
|
;; `highlight-changes-delete-face' face.
|
||||||
|
|
@ -75,18 +75,18 @@
|
||||||
;; modes. The variable
|
;; modes. The variable
|
||||||
;; `highlight-changes-mode' contains the new
|
;; `highlight-changes-mode' contains the new
|
||||||
;; state (`active' or `passive'.)
|
;; state (`active' or `passive'.)
|
||||||
;;
|
|
||||||
;;
|
;;
|
||||||
;;
|
;;
|
||||||
|
;;
|
||||||
;; Example usage:
|
;; Example usage:
|
||||||
;; (defun my-highlight-changes-enable-hook ()
|
;; (defun my-highlight-changes-enable-hook ()
|
||||||
;; (add-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)
|
;; (add-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)
|
||||||
;; )
|
;; )
|
||||||
;;
|
;;
|
||||||
;; (defun my-highlight-changes-disable-hook ()
|
;; (defun my-highlight-changes-disable-hook ()
|
||||||
;; (remove-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)
|
;; (remove-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)
|
||||||
;; )
|
;; )
|
||||||
;;
|
;;
|
||||||
;; (add-hook 'highlight-changes-enable-hook 'my-highlight-changes-enable-hook)
|
;; (add-hook 'highlight-changes-enable-hook 'my-highlight-changes-enable-hook)
|
||||||
;; (add-hook 'highlight-changes-disable-hook
|
;; (add-hook 'highlight-changes-disable-hook
|
||||||
;; 'my-highlight-changes-disable-hook)
|
;; 'my-highlight-changes-disable-hook)
|
||||||
|
|
@ -99,29 +99,29 @@
|
||||||
;;
|
;;
|
||||||
;; If you prefer to have it automatically invoked you can do it as
|
;; If you prefer to have it automatically invoked you can do it as
|
||||||
;; follows.
|
;; follows.
|
||||||
;;
|
;;
|
||||||
;; 1. Most modes have a major-hook, typically called MODE-hook. You
|
;; 1. Most modes have a major-hook, typically called MODE-hook. You
|
||||||
;; can use `add-hook' to call `highlight-changes-mode'.
|
;; can use `add-hook' to call `highlight-changes-mode'.
|
||||||
;;
|
;;
|
||||||
;; Example:
|
;; Example:
|
||||||
;; (add-hook 'c-mode-hook 'highlight-changes-mode)
|
;; (add-hook 'c-mode-hook 'highlight-changes-mode)
|
||||||
;;
|
;;
|
||||||
;; If you want to make it start up in passive mode (regardless of the
|
;; If you want to make it start up in passive mode (regardless of the
|
||||||
;; setting of highlight-changes-initial-state):
|
;; setting of highlight-changes-initial-state):
|
||||||
;; (add-hook 'emacs-lisp-mode-hook
|
;; (add-hook 'emacs-lisp-mode-hook
|
||||||
;; (lambda ()
|
;; (lambda ()
|
||||||
;; (highlight-changes-mode 'passive)))
|
;; (highlight-changes-mode 'passive)))
|
||||||
;;
|
;;
|
||||||
;; However, this cannot be done for Fundamental mode for there is no
|
;; However, this cannot be done for Fundamental mode for there is no
|
||||||
;; such hook.
|
;; such hook.
|
||||||
;;
|
;;
|
||||||
;; 2. You can use the function `global-highlight-changes'
|
;; 2. You can use the function `global-highlight-changes'
|
||||||
;;
|
;;
|
||||||
;; This function, which is fashioned after the way `global-font-lock' works,
|
;; This function, which is fashioned after the way `global-font-lock' works,
|
||||||
;; toggles on or off global Highlight Changes mode. When activated, it turns
|
;; toggles on or off global Highlight Changes mode. When activated, it turns
|
||||||
;; on Highlight Changes mode in all "suitable" existing buffers and will turn
|
;; on Highlight Changes mode in all "suitable" existing buffers and will turn
|
||||||
;; it on in new "suitable" buffers to be created.
|
;; it on in new "suitable" buffers to be created.
|
||||||
;;
|
;;
|
||||||
;; A buffer's "suitability" is determined by variable
|
;; A buffer's "suitability" is determined by variable
|
||||||
;; `highlight-changes-global-modes', as follows. If the variable is
|
;; `highlight-changes-global-modes', as follows. If the variable is
|
||||||
;; * nil -- then no buffers are suitable;
|
;; * nil -- then no buffers are suitable;
|
||||||
|
|
@ -148,7 +148,7 @@
|
||||||
;; highlight-changes-rotate-faces
|
;; highlight-changes-rotate-faces
|
||||||
;; highlight-compare-with-file
|
;; highlight-compare-with-file
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; You can automatically rotate faces when the buffer is saved;
|
;; You can automatically rotate faces when the buffer is saved;
|
||||||
;; see function `highlight-changes-rotate-faces' for how to do this.
|
;; see function `highlight-changes-rotate-faces' for how to do this.
|
||||||
;;
|
;;
|
||||||
|
|
@ -177,7 +177,7 @@
|
||||||
;; R Sharman (rsharman@magma.ca) Feb 1998:
|
;; R Sharman (rsharman@magma.ca) Feb 1998:
|
||||||
;; - initial release as change-mode.
|
;; - initial release as change-mode.
|
||||||
;; Jari Aalto <jari.aalto@ntc.nokia.com> Mar 1998
|
;; Jari Aalto <jari.aalto@ntc.nokia.com> Mar 1998
|
||||||
;; - fixes for byte compile errors
|
;; - fixes for byte compile errors
|
||||||
;; - use eval-and-compile for autoload
|
;; - use eval-and-compile for autoload
|
||||||
;; Marijn Ros <J.M.Ros@fys.ruu.nl> Mar 98
|
;; Marijn Ros <J.M.Ros@fys.ruu.nl> Mar 98
|
||||||
;; - suggested turning it on by default
|
;; - suggested turning it on by default
|
||||||
|
|
@ -225,7 +225,7 @@
|
||||||
|
|
||||||
;; A (not very good) default list of colours to rotate through.
|
;; A (not very good) default list of colours to rotate through.
|
||||||
;;
|
;;
|
||||||
(defcustom highlight-changes-colours
|
(defcustom highlight-changes-colours
|
||||||
(if (eq (frame-parameter nil 'background-mode) 'light)
|
(if (eq (frame-parameter nil 'background-mode) 'light)
|
||||||
;; defaults for light background:
|
;; defaults for light background:
|
||||||
'( "magenta" "blue" "darkgreen" "chocolate" "sienna4" "NavyBlue")
|
'( "magenta" "blue" "darkgreen" "chocolate" "sienna4" "NavyBlue")
|
||||||
|
|
@ -241,7 +241,7 @@ colours then use this, if you want fancier faces then set
|
||||||
`highlight-changes-face-list'."
|
`highlight-changes-face-list'."
|
||||||
:type '(repeat color)
|
:type '(repeat color)
|
||||||
:group 'highlight-changes)
|
:group 'highlight-changes)
|
||||||
|
|
||||||
|
|
||||||
;; If you invoke highlight-changes-mode with no argument, should it start in
|
;; If you invoke highlight-changes-mode with no argument, should it start in
|
||||||
;; active or passive mode?
|
;; active or passive mode?
|
||||||
|
|
@ -299,7 +299,7 @@ Examples:
|
||||||
(c-mode c++-mode)
|
(c-mode c++-mode)
|
||||||
means that Highlight Changes mode is turned on for buffers in C and C++
|
means that Highlight Changes mode is turned on for buffers in C and C++
|
||||||
modes only."
|
modes only."
|
||||||
:type '(choice
|
:type '(choice
|
||||||
(const :tag "all non-special buffers visiting files" t)
|
(const :tag "all non-special buffers visiting files" t)
|
||||||
(set :menu-tag "specific modes" :tag "modes"
|
(set :menu-tag "specific modes" :tag "modes"
|
||||||
:value (not)
|
:value (not)
|
||||||
|
|
@ -377,7 +377,7 @@ don't just differ from `highlight-changes-face' by the foreground colour.
|
||||||
Otherwise, this list will be constructed when needed from
|
Otherwise, this list will be constructed when needed from
|
||||||
`highlight-changes-colours'."
|
`highlight-changes-colours'."
|
||||||
:type '(choice
|
:type '(choice
|
||||||
(repeat
|
(repeat
|
||||||
:notify hilit-chg-cust-fix-changes-face-list
|
:notify hilit-chg-cust-fix-changes-face-list
|
||||||
face )
|
face )
|
||||||
(const :tag "Derive from highlight-changes-colours" nil)
|
(const :tag "Derive from highlight-changes-colours" nil)
|
||||||
|
|
@ -513,15 +513,15 @@ the text properties of type `hilit-chg' ."
|
||||||
(hilit-chg-display-changes beg end)))
|
(hilit-chg-display-changes beg end)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun highlight-changes-remove-highlight (beg end)
|
(defun highlight-changes-remove-highlight (beg end)
|
||||||
"Remove the change face from the region between BEG and END.
|
"Remove the change face from the region between BEG and END.
|
||||||
This allows you to manually remove highlighting from uninteresting changes."
|
This allows you to manually remove highlighting from uninteresting changes."
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(let ((after-change-functions nil))
|
(let ((after-change-functions nil))
|
||||||
(remove-text-properties beg end '(hilit-chg nil))
|
(remove-text-properties beg end '(hilit-chg nil))
|
||||||
(hilit-chg-fixup beg end)))
|
(hilit-chg-fixup beg end)))
|
||||||
|
|
||||||
(defun hilit-chg-set-face-on-change (beg end leng-before
|
(defun hilit-chg-set-face-on-change (beg end leng-before
|
||||||
&optional no-property-change)
|
&optional no-property-change)
|
||||||
"Record changes and optionally display them in a distinctive face.
|
"Record changes and optionally display them in a distinctive face.
|
||||||
`hilit-chg-set' adds this function to the `after-change-functions' hook."
|
`hilit-chg-set' adds this function to the `after-change-functions' hook."
|
||||||
|
|
@ -544,7 +544,7 @@ This allows you to manually remove highlighting from uninteresting changes."
|
||||||
;; deletion
|
;; deletion
|
||||||
(progn
|
(progn
|
||||||
;; The eolp and bolp tests are a kludge! But they prevent
|
;; The eolp and bolp tests are a kludge! But they prevent
|
||||||
;; rather nasty looking displays when deleting text at the end
|
;; rather nasty looking displays when deleting text at the end
|
||||||
;; of line, such as normal corrections as one is typing and
|
;; of line, such as normal corrections as one is typing and
|
||||||
;; immediately makes a correction, and when deleting first
|
;; immediately makes a correction, and when deleting first
|
||||||
;; character of a line.
|
;; character of a line.
|
||||||
|
|
@ -601,7 +601,7 @@ This removes all saved change information."
|
||||||
(remove-hook 'after-change-functions 'hilit-chg-set-face-on-change t)
|
(remove-hook 'after-change-functions 'hilit-chg-set-face-on-change t)
|
||||||
(let ((after-change-functions nil))
|
(let ((after-change-functions nil))
|
||||||
(hilit-chg-hide-changes)
|
(hilit-chg-hide-changes)
|
||||||
(hilit-chg-map-changes
|
(hilit-chg-map-changes
|
||||||
'(lambda (prop start stop)
|
'(lambda (prop start stop)
|
||||||
(remove-text-properties start stop '(hilit-chg nil))))
|
(remove-text-properties start stop '(hilit-chg nil))))
|
||||||
)
|
)
|
||||||
|
|
@ -616,7 +616,7 @@ This removes all saved change information."
|
||||||
(defun highlight-changes-mode (&optional arg)
|
(defun highlight-changes-mode (&optional arg)
|
||||||
"Toggle (or initially set) Highlight Changes mode.
|
"Toggle (or initially set) Highlight Changes mode.
|
||||||
|
|
||||||
Without an argument:
|
Without an argument:
|
||||||
If Highlight Changes mode is not enabled, then enable it (in either active
|
If Highlight Changes mode is not enabled, then enable it (in either active
|
||||||
or passive state as determined by the variable
|
or passive state as determined by the variable
|
||||||
`highlight-changes-initial-state'); otherwise, toggle between active
|
`highlight-changes-initial-state'); otherwise, toggle between active
|
||||||
|
|
@ -633,12 +633,12 @@ Passive state - means changes are kept and new ones recorded but are
|
||||||
|
|
||||||
Functions:
|
Functions:
|
||||||
\\[highlight-changes-next-change] - move point to beginning of next change
|
\\[highlight-changes-next-change] - move point to beginning of next change
|
||||||
\\[highlight-changes-previous-change] - move to beginning of previous change
|
\\[highlight-changes-previous-change] - move to beginning of previous change
|
||||||
\\[highlight-compare-with-file] - mark text as changed by comparing this
|
\\[highlight-compare-with-file] - mark text as changed by comparing this
|
||||||
buffer with the contents of a file
|
buffer with the contents of a file
|
||||||
\\[highlight-changes-remove-highlight] - remove the change face from the region
|
\\[highlight-changes-remove-highlight] - remove the change face from the region
|
||||||
\\[highlight-changes-rotate-faces] - rotate different \"ages\" of changes \
|
\\[highlight-changes-rotate-faces] - rotate different \"ages\" of changes \
|
||||||
through
|
through
|
||||||
various faces.
|
various faces.
|
||||||
|
|
||||||
Hook variables:
|
Hook variables:
|
||||||
|
|
@ -732,20 +732,20 @@ Hook variables:
|
||||||
;; so we pick up any changes?
|
;; so we pick up any changes?
|
||||||
(if (or (null highlight-changes-face-list) ; Don't do it if it
|
(if (or (null highlight-changes-face-list) ; Don't do it if it
|
||||||
force) ; already exists unless FORCE non-nil.
|
force) ; already exists unless FORCE non-nil.
|
||||||
(let ((p highlight-changes-colours)
|
(let ((p highlight-changes-colours)
|
||||||
(n 1) name)
|
(n 1) name)
|
||||||
(setq highlight-changes-face-list nil)
|
(setq highlight-changes-face-list nil)
|
||||||
(while p
|
(while p
|
||||||
(setq name (intern (format "highlight-changes-face-%d" n)))
|
(setq name (intern (format "highlight-changes-face-%d" n)))
|
||||||
(copy-face 'highlight-changes-face name)
|
(copy-face 'highlight-changes-face name)
|
||||||
(set-face-foreground name (car p))
|
(set-face-foreground name (car p))
|
||||||
(setq highlight-changes-face-list
|
(setq highlight-changes-face-list
|
||||||
(append highlight-changes-face-list (list name)))
|
(append highlight-changes-face-list (list name)))
|
||||||
(setq p (cdr p))
|
(setq p (cdr p))
|
||||||
(setq n (1+ n)))))
|
(setq n (1+ n)))))
|
||||||
(setq hilit-chg-list (list 'hilit-chg 'highlight-changes-face))
|
(setq hilit-chg-list (list 'hilit-chg 'highlight-changes-face))
|
||||||
(let ((p highlight-changes-face-list)
|
(let ((p highlight-changes-face-list)
|
||||||
(n 1)
|
(n 1)
|
||||||
last-category last-face)
|
last-category last-face)
|
||||||
(while p
|
(while p
|
||||||
(setq last-category (intern (format "change-%d" n)))
|
(setq last-category (intern (format "change-%d" n)))
|
||||||
|
|
@ -829,7 +829,7 @@ changes are made, so \\[highlight-changes-next-change] and
|
||||||
"" ;; directory
|
"" ;; directory
|
||||||
nil ;; default
|
nil ;; default
|
||||||
'yes ;; must exist
|
'yes ;; must exist
|
||||||
(let ((f (make-backup-file-name
|
(let ((f (make-backup-file-name
|
||||||
(or (buffer-file-name (current-buffer))
|
(or (buffer-file-name (current-buffer))
|
||||||
(error "no file for this buffer")))))
|
(error "no file for this buffer")))))
|
||||||
(if (file-exists-p f) f "")))))
|
(if (file-exists-p f) f "")))))
|
||||||
|
|
@ -885,7 +885,7 @@ changes are made, so \\[highlight-changes-next-change] and
|
||||||
(setq p (cdr p))
|
(setq p (cdr p))
|
||||||
(setq q (cdr q)))
|
(setq q (cdr q)))
|
||||||
(if existing-buf
|
(if existing-buf
|
||||||
(set-buffer-modified-p nil)
|
(set-buffer-modified-p nil)
|
||||||
(kill-buffer buf-b))))
|
(kill-buffer buf-b))))
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -901,7 +901,7 @@ changes are made, so \\[highlight-changes-next-change] and
|
||||||
|
|
||||||
|
|
||||||
(defun hilit-chg-get-diff-list-hk ()
|
(defun hilit-chg-get-diff-list-hk ()
|
||||||
;; x and y are dynamically bound by hilit-chg-get-diff-info
|
;; x and y are dynamically bound by hilit-chg-get-diff-info
|
||||||
;; which calls this function as a hook
|
;; which calls this function as a hook
|
||||||
(defvar x) ;; placate the byte-compiler
|
(defvar x) ;; placate the byte-compiler
|
||||||
(defvar y)
|
(defvar y)
|
||||||
|
|
@ -971,12 +971,12 @@ changes are made, so \\[highlight-changes-next-change] and
|
||||||
;; This is called after changing a major mode, but also after each
|
;; This is called after changing a major mode, but also after each
|
||||||
;; M-x command, in which case the current buffer is a minibuffer.
|
;; M-x command, in which case the current buffer is a minibuffer.
|
||||||
;; In that case, do not act on it here, but don't turn it off
|
;; In that case, do not act on it here, but don't turn it off
|
||||||
;; either, we will get called here again soon-after.
|
;; either, we will get called here again soon-after.
|
||||||
;; Also, don't enable it for other special buffers.
|
;; Also, don't enable it for other special buffers.
|
||||||
(if (string-match "^[ *]" (buffer-name))
|
(if (string-match "^[ *]" (buffer-name))
|
||||||
nil ;; (message "ignoring this post-command-hook")
|
nil ;; (message "ignoring this post-command-hook")
|
||||||
(remove-hook 'post-command-hook 'hilit-chg-post-command-hook)
|
(remove-hook 'post-command-hook 'hilit-chg-post-command-hook)
|
||||||
;; The following check isn't necessary, since
|
;; The following check isn't necessary, since
|
||||||
;; hilit-chg-turn-on-maybe makes this check too.
|
;; hilit-chg-turn-on-maybe makes this check too.
|
||||||
(or highlight-changes-mode ;; don't turn it on if it already is
|
(or highlight-changes-mode ;; don't turn it on if it already is
|
||||||
(hilit-chg-turn-on-maybe highlight-changes-global-initial-state))))
|
(hilit-chg-turn-on-maybe highlight-changes-global-initial-state))))
|
||||||
|
|
@ -1000,14 +1000,14 @@ When called from a program:
|
||||||
- if ARG is nil or omitted, turn it off
|
- if ARG is nil or omitted, turn it off
|
||||||
- if ARG is `active', turn it on in active mode
|
- if ARG is `active', turn it on in active mode
|
||||||
- if ARG is `passive', turn it on in passive mode
|
- if ARG is `passive', turn it on in passive mode
|
||||||
- otherwise just turn it on
|
- otherwise just turn it on
|
||||||
|
|
||||||
When global Highlight Changes mode is enabled, Highlight Changes mode is turned
|
When global Highlight Changes mode is enabled, Highlight Changes mode is turned
|
||||||
on for future \"suitable\" buffers (and for \"suitable\" existing buffers if
|
on for future \"suitable\" buffers (and for \"suitable\" existing buffers if
|
||||||
variable `highlight-changes-global-changes-existing-buffers' is non-nil).
|
variable `highlight-changes-global-changes-existing-buffers' is non-nil).
|
||||||
\"Suitability\" is determined by variable `highlight-changes-global-modes'."
|
\"Suitability\" is determined by variable `highlight-changes-global-modes'."
|
||||||
|
|
||||||
(interactive
|
(interactive
|
||||||
(list
|
(list
|
||||||
(cond
|
(cond
|
||||||
((null current-prefix-arg)
|
((null current-prefix-arg)
|
||||||
|
|
@ -1023,7 +1023,7 @@ variable `highlight-changes-global-changes-existing-buffers' is non-nil).
|
||||||
'passive)
|
'passive)
|
||||||
;; negative interactive arg - turn it off
|
;; negative interactive arg - turn it off
|
||||||
(t
|
(t
|
||||||
(setq global-highlight-changes nil)
|
(setq global-highlight-changes nil)
|
||||||
nil))))
|
nil))))
|
||||||
|
|
||||||
(if arg
|
(if arg
|
||||||
|
|
@ -1038,9 +1038,9 @@ variable `highlight-changes-global-changes-existing-buffers' is non-nil).
|
||||||
(add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
|
(add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
|
||||||
(add-hook 'find-file-hooks 'hilit-chg-check-global)
|
(add-hook 'find-file-hooks 'hilit-chg-check-global)
|
||||||
(if highlight-changes-global-changes-existing-buffers
|
(if highlight-changes-global-changes-existing-buffers
|
||||||
(hilit-chg-update-all-buffers
|
(hilit-chg-update-all-buffers
|
||||||
highlight-changes-global-initial-state)))
|
highlight-changes-global-initial-state)))
|
||||||
|
|
||||||
(message "Turning OFF global Highlight Changes mode")
|
(message "Turning OFF global Highlight Changes mode")
|
||||||
(remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
|
(remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
|
||||||
(remove-hook 'find-file-hooks 'hilit-chg-check-global)
|
(remove-hook 'find-file-hooks 'hilit-chg-check-global)
|
||||||
|
|
@ -1055,13 +1055,13 @@ variable `highlight-changes-global-changes-existing-buffers' is non-nil).
|
||||||
"Turn on Highlight Changes mode if it is appropriate for this buffer.
|
"Turn on Highlight Changes mode if it is appropriate for this buffer.
|
||||||
|
|
||||||
A buffer is appropriate for Highlight Changes mode if all these are true:
|
A buffer is appropriate for Highlight Changes mode if all these are true:
|
||||||
- the buffer is not a special buffer (one whose name begins with
|
- the buffer is not a special buffer (one whose name begins with
|
||||||
`*' or ` ')
|
`*' or ` ')
|
||||||
- the buffer's mode is suitable as per variable
|
- the buffer's mode is suitable as per variable
|
||||||
`highlight-changes-global-modes'
|
`highlight-changes-global-modes'
|
||||||
- Highlight Changes mode is not already on for this buffer.
|
- Highlight Changes mode is not already on for this buffer.
|
||||||
|
|
||||||
This function is called from `hilit-chg-update-all-buffers' or
|
This function is called from `hilit-chg-update-all-buffers' or
|
||||||
from `global-highlight-changes' when turning on global Highlight Changes mode."
|
from `global-highlight-changes' when turning on global Highlight Changes mode."
|
||||||
(or highlight-changes-mode ; do nothing if already on
|
(or highlight-changes-mode ; do nothing if already on
|
||||||
(if
|
(if
|
||||||
|
|
@ -1075,13 +1075,13 @@ from `global-highlight-changes' when turning on global Highlight Changes mode."
|
||||||
(not (memq major-mode (cdr highlight-changes-global-modes)))
|
(not (memq major-mode (cdr highlight-changes-global-modes)))
|
||||||
(memq major-mode highlight-changes-global-modes)))
|
(memq major-mode highlight-changes-global-modes)))
|
||||||
(t
|
(t
|
||||||
(and
|
(and
|
||||||
(not (string-match "^[ *]" (buffer-name)))
|
(not (string-match "^[ *]" (buffer-name)))
|
||||||
(buffer-file-name))))
|
(buffer-file-name))))
|
||||||
(progn
|
(progn
|
||||||
(hilit-chg-set value)
|
(hilit-chg-set value)
|
||||||
(run-hooks 'highlight-changes-enable-hook)))))
|
(run-hooks 'highlight-changes-enable-hook)))))
|
||||||
|
|
||||||
|
|
||||||
(defun hilit-chg-turn-off-maybe ()
|
(defun hilit-chg-turn-off-maybe ()
|
||||||
(if highlight-changes-mode
|
(if highlight-changes-mode
|
||||||
|
|
@ -1111,7 +1111,7 @@ from `global-highlight-changes' when turning on global Highlight Changes mode."
|
||||||
;; )
|
;; )
|
||||||
;; beg end
|
;; beg end
|
||||||
;; ))
|
;; ))
|
||||||
;;
|
;;
|
||||||
;; ================== end of debug ===============
|
;; ================== end of debug ===============
|
||||||
|
|
||||||
(provide 'hilit-chg)
|
(provide 'hilit-chg)
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ regardless of any active filters in this buffer."
|
||||||
|
|
||||||
(defvar ibuffer-tmp-hide-regexps nil
|
(defvar ibuffer-tmp-hide-regexps nil
|
||||||
"A list of regexps which should match buffer names to not show.")
|
"A list of regexps which should match buffer names to not show.")
|
||||||
|
|
||||||
(defvar ibuffer-tmp-show-regexps nil
|
(defvar ibuffer-tmp-show-regexps nil
|
||||||
"A list of regexps which should match buffer names to always show.")
|
"A list of regexps which should match buffer names to always show.")
|
||||||
|
|
||||||
|
|
@ -112,7 +112,7 @@ Do not set this variable directly! Use the function
|
||||||
(mode . java-mode)
|
(mode . java-mode)
|
||||||
(mode . idl-mode)
|
(mode . idl-mode)
|
||||||
(mode . lisp-mode)))))
|
(mode . lisp-mode)))))
|
||||||
|
|
||||||
"An alist of filter qualifiers to switch between.
|
"An alist of filter qualifiers to switch between.
|
||||||
|
|
||||||
This variable should look like ((\"STRING\" QUALIFIERS)
|
This variable should look like ((\"STRING\" QUALIFIERS)
|
||||||
|
|
@ -170,7 +170,7 @@ The QUALIFIER should be the same as QUALIFIER in
|
||||||
:group 'ibuffer)
|
:group 'ibuffer)
|
||||||
|
|
||||||
(defcustom ibuffer-saved-filter-groups nil
|
(defcustom ibuffer-saved-filter-groups nil
|
||||||
|
|
||||||
"An alist of filtering groups to switch between.
|
"An alist of filtering groups to switch between.
|
||||||
|
|
||||||
This variable should look like ((\"STRING\" QUALIFIERS)
|
This variable should look like ((\"STRING\" QUALIFIERS)
|
||||||
|
|
@ -921,7 +921,7 @@ of replacing the current filters."
|
||||||
(concat "Filter: " (mapconcat #'ibuffer-format-qualifier
|
(concat "Filter: " (mapconcat #'ibuffer-format-qualifier
|
||||||
(cdr (assq filter ibuffer-filter-groups))
|
(cdr (assq filter ibuffer-filter-groups))
|
||||||
" ") "\n")))
|
" ") "\n")))
|
||||||
|
|
||||||
(defun ibuffer-format-qualifier (qualifier)
|
(defun ibuffer-format-qualifier (qualifier)
|
||||||
(if (eq (car-safe qualifier) 'not)
|
(if (eq (car-safe qualifier) 'not)
|
||||||
(concat " [NOT" (ibuffer-format-qualifier-1 (cdr qualifier)) "]")
|
(concat " [NOT" (ibuffer-format-qualifier-1 (cdr qualifier)) "]")
|
||||||
|
|
@ -939,7 +939,7 @@ of replacing the current filters."
|
||||||
(unless qualifier
|
(unless qualifier
|
||||||
(error "Ibuffer: bad qualifier %s" qualifier))
|
(error "Ibuffer: bad qualifier %s" qualifier))
|
||||||
(concat " [" (cadr type) ": " (format "%s]" (cdr qualifier)))))))
|
(concat " [" (cadr type) ": " (format "%s]" (cdr qualifier)))))))
|
||||||
|
|
||||||
|
|
||||||
(defun ibuffer-list-buffer-modes ()
|
(defun ibuffer-list-buffer-modes ()
|
||||||
"Create an alist of buffer modes currently in use.
|
"Create an alist of buffer modes currently in use.
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ change its definition, you should explicitly call
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defmacro* define-ibuffer-sorter (name documentation
|
(defmacro* define-ibuffer-sorter (name documentation
|
||||||
(&key
|
(&key
|
||||||
description)
|
description)
|
||||||
&rest body)
|
&rest body)
|
||||||
"Define a method of sorting named NAME.
|
"Define a method of sorting named NAME.
|
||||||
|
|
@ -152,7 +152,7 @@ value if and only if `a' is \"less than\" `b'."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defmacro* define-ibuffer-op (op args
|
(defmacro* define-ibuffer-op (op args
|
||||||
documentation
|
documentation
|
||||||
(&key
|
(&key
|
||||||
interactive
|
interactive
|
||||||
mark
|
mark
|
||||||
modifier-p
|
modifier-p
|
||||||
|
|
@ -253,7 +253,7 @@ macro for exactly what it does."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defmacro* define-ibuffer-filter (name documentation
|
(defmacro* define-ibuffer-filter (name documentation
|
||||||
(&key
|
(&key
|
||||||
reader
|
reader
|
||||||
description)
|
description)
|
||||||
&rest body)
|
&rest body)
|
||||||
|
|
@ -267,7 +267,7 @@ not a particular buffer should be displayed or not. The forms in BODY
|
||||||
will be evaluated with BUF bound to the buffer object, and QUALIFIER
|
will be evaluated with BUF bound to the buffer object, and QUALIFIER
|
||||||
bound to the current value of the filter."
|
bound to the current value of the filter."
|
||||||
(let ((fn-name (intern (concat "ibuffer-filter-by-" (symbol-name name)))))
|
(let ((fn-name (intern (concat "ibuffer-filter-by-" (symbol-name name)))))
|
||||||
`(progn
|
`(progn
|
||||||
(defun ,fn-name (qualifier)
|
(defun ,fn-name (qualifier)
|
||||||
,(concat (or documentation "This filter is not documented."))
|
,(concat (or documentation "This filter is not documented."))
|
||||||
(interactive (list ,reader))
|
(interactive (list ,reader))
|
||||||
|
|
|
||||||
|
|
@ -364,12 +364,12 @@ directory, like `default-directory'."
|
||||||
(define-key map (kbd "* e") 'ibuffer-mark-dissociated-buffers)
|
(define-key map (kbd "* e") 'ibuffer-mark-dissociated-buffers)
|
||||||
(define-key map (kbd "* h") 'ibuffer-mark-help-buffers)
|
(define-key map (kbd "* h") 'ibuffer-mark-help-buffers)
|
||||||
(define-key map (kbd ".") 'ibuffer-mark-old-buffers)
|
(define-key map (kbd ".") 'ibuffer-mark-old-buffers)
|
||||||
|
|
||||||
(define-key map (kbd "d") 'ibuffer-mark-for-delete)
|
(define-key map (kbd "d") 'ibuffer-mark-for-delete)
|
||||||
(define-key map (kbd "C-d") 'ibuffer-mark-for-delete-backwards)
|
(define-key map (kbd "C-d") 'ibuffer-mark-for-delete-backwards)
|
||||||
(define-key map (kbd "k") 'ibuffer-mark-for-delete)
|
(define-key map (kbd "k") 'ibuffer-mark-for-delete)
|
||||||
(define-key map (kbd "x") 'ibuffer-do-kill-on-deletion-marks)
|
(define-key map (kbd "x") 'ibuffer-do-kill-on-deletion-marks)
|
||||||
|
|
||||||
;; immediate operations
|
;; immediate operations
|
||||||
(define-key map (kbd "n") 'ibuffer-forward-line)
|
(define-key map (kbd "n") 'ibuffer-forward-line)
|
||||||
(define-key map (kbd "<down>") 'ibuffer-forward-line)
|
(define-key map (kbd "<down>") 'ibuffer-forward-line)
|
||||||
|
|
@ -425,7 +425,7 @@ directory, like `default-directory'."
|
||||||
(define-key map (kbd "/ R") 'ibuffer-switch-to-saved-filter-groups)
|
(define-key map (kbd "/ R") 'ibuffer-switch-to-saved-filter-groups)
|
||||||
(define-key map (kbd "/ X") 'ibuffer-delete-saved-filter-groups)
|
(define-key map (kbd "/ X") 'ibuffer-delete-saved-filter-groups)
|
||||||
(define-key map (kbd "/ \\") 'ibuffer-clear-filter-groups)
|
(define-key map (kbd "/ \\") 'ibuffer-clear-filter-groups)
|
||||||
|
|
||||||
(define-key map (kbd "q") 'ibuffer-quit)
|
(define-key map (kbd "q") 'ibuffer-quit)
|
||||||
(define-key map (kbd "h") 'describe-mode)
|
(define-key map (kbd "h") 'describe-mode)
|
||||||
(define-key map (kbd "?") 'describe-mode)
|
(define-key map (kbd "?") 'describe-mode)
|
||||||
|
|
@ -433,7 +433,7 @@ directory, like `default-directory'."
|
||||||
(define-key map (kbd "% n") 'ibuffer-mark-by-name-regexp)
|
(define-key map (kbd "% n") 'ibuffer-mark-by-name-regexp)
|
||||||
(define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp)
|
(define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp)
|
||||||
(define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp)
|
(define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp)
|
||||||
|
|
||||||
(define-key map (kbd "C-t") 'ibuffer-visit-tags-table)
|
(define-key map (kbd "C-t") 'ibuffer-visit-tags-table)
|
||||||
|
|
||||||
(define-key map (kbd "|") 'ibuffer-do-shell-command-pipe)
|
(define-key map (kbd "|") 'ibuffer-do-shell-command-pipe)
|
||||||
|
|
@ -458,7 +458,7 @@ directory, like `default-directory'."
|
||||||
(define-key map (kbd "V") 'ibuffer-do-revert)
|
(define-key map (kbd "V") 'ibuffer-do-revert)
|
||||||
(define-key map (kbd "W") 'ibuffer-do-view-and-eval)
|
(define-key map (kbd "W") 'ibuffer-do-view-and-eval)
|
||||||
(define-key map (kbd "X") 'ibuffer-do-shell-command-pipe)
|
(define-key map (kbd "X") 'ibuffer-do-shell-command-pipe)
|
||||||
|
|
||||||
(define-key map (kbd "k") 'ibuffer-do-kill-lines)
|
(define-key map (kbd "k") 'ibuffer-do-kill-lines)
|
||||||
(define-key map (kbd "w") 'ibuffer-copy-filename-as-kill)
|
(define-key map (kbd "w") 'ibuffer-copy-filename-as-kill)
|
||||||
|
|
||||||
|
|
@ -683,10 +683,10 @@ directory, like `default-directory'."
|
||||||
:help "Mark buffers which have not been viewed recently"))
|
:help "Mark buffers which have not been viewed recently"))
|
||||||
(define-key-after map [menu-bar mark unmark-all]
|
(define-key-after map [menu-bar mark unmark-all]
|
||||||
'(menu-item "Unmark All" ibuffer-unmark-all))
|
'(menu-item "Unmark All" ibuffer-unmark-all))
|
||||||
|
|
||||||
(define-key-after map [menu-bar mark dashes]
|
(define-key-after map [menu-bar mark dashes]
|
||||||
'("--"))
|
'("--"))
|
||||||
|
|
||||||
(define-key-after map [menu-bar mark mark-by-name-regexp]
|
(define-key-after map [menu-bar mark mark-by-name-regexp]
|
||||||
'(menu-item "Mark by buffer name (regexp)..." ibuffer-mark-by-name-regexp
|
'(menu-item "Mark by buffer name (regexp)..." ibuffer-mark-by-name-regexp
|
||||||
:help "Mark buffers whose name matches a regexp"))
|
:help "Mark buffers whose name matches a regexp"))
|
||||||
|
|
@ -744,7 +744,7 @@ directory, like `default-directory'."
|
||||||
(define-key-after operate-map [do-view-and-eval]
|
(define-key-after operate-map [do-view-and-eval]
|
||||||
'(menu-item "Eval (viewing buffer)..." ibuffer-do-view-and-eval
|
'(menu-item "Eval (viewing buffer)..." ibuffer-do-view-and-eval
|
||||||
:help "Evaluate a Lisp form in each marked buffer while viewing it"))
|
:help "Evaluate a Lisp form in each marked buffer while viewing it"))
|
||||||
|
|
||||||
(setq ibuffer-mode-map map
|
(setq ibuffer-mode-map map
|
||||||
ibuffer-mode-operate-map operate-map
|
ibuffer-mode-operate-map operate-map
|
||||||
ibuffer-mode-groups-popup (copy-keymap groups-map))))
|
ibuffer-mode-groups-popup (copy-keymap groups-map))))
|
||||||
|
|
@ -1094,7 +1094,7 @@ a new window in the current frame, splitting vertically."
|
||||||
;; Handle a failure
|
;; Handle a failure
|
||||||
(if (or (> (incf attempts) 4)
|
(if (or (> (incf attempts) 4)
|
||||||
(and (stringp (cadr err))
|
(and (stringp (cadr err))
|
||||||
;; This definitely falls in the
|
;; This definitely falls in the
|
||||||
;; ghetto hack category...
|
;; ghetto hack category...
|
||||||
(not (string-match "too small" (cadr err)))))
|
(not (string-match "too small" (cadr err)))))
|
||||||
(apply #'signal err)
|
(apply #'signal err)
|
||||||
|
|
@ -1338,7 +1338,7 @@ If point is on a group name, this function operates on that group."
|
||||||
(if uncompiledp
|
(if uncompiledp
|
||||||
ibuffer-filter-format-alist
|
ibuffer-filter-format-alist
|
||||||
ibuffer-compiled-filter-formats))))))
|
ibuffer-compiled-filter-formats))))))
|
||||||
|
|
||||||
(defun ibuffer-current-format (&optional uncompiledp)
|
(defun ibuffer-current-format (&optional uncompiledp)
|
||||||
(or ibuffer-current-format
|
(or ibuffer-current-format
|
||||||
(setq ibuffer-current-format 0))
|
(setq ibuffer-current-format 0))
|
||||||
|
|
@ -1366,7 +1366,7 @@ If point is on a group name, this function operates on that group."
|
||||||
elide nil))
|
elide nil))
|
||||||
(list sym min max align elide)))
|
(list sym min max align elide)))
|
||||||
form))
|
form))
|
||||||
|
|
||||||
(defun ibuffer-compile-make-eliding-form (strvar elide from-end-p)
|
(defun ibuffer-compile-make-eliding-form (strvar elide from-end-p)
|
||||||
(let ((ellipsis (propertize ibuffer-eliding-string 'font-lock-face 'bold)))
|
(let ((ellipsis (propertize ibuffer-eliding-string 'font-lock-face 'bold)))
|
||||||
(if (or elide ibuffer-elide-long-columns)
|
(if (or elide ibuffer-elide-long-columns)
|
||||||
|
|
@ -1566,7 +1566,7 @@ If point is on a group name, this function operates on that group."
|
||||||
(ibuffer-awhen (and (consp form)
|
(ibuffer-awhen (and (consp form)
|
||||||
(get (car form) 'ibuffer-column-summarizer))
|
(get (car form) 'ibuffer-column-summarizer))
|
||||||
(put (car form) 'ibuffer-column-summary nil))))
|
(put (car form) 'ibuffer-column-summary nil))))
|
||||||
|
|
||||||
(defun ibuffer-check-formats ()
|
(defun ibuffer-check-formats ()
|
||||||
(when (null ibuffer-formats)
|
(when (null ibuffer-formats)
|
||||||
(error "No formats!"))
|
(error "No formats!"))
|
||||||
|
|
@ -1614,7 +1614,7 @@ If point is on a group name, this function operates on that group."
|
||||||
'ibuffer-name-column t
|
'ibuffer-name-column t
|
||||||
'help-echo "mouse-1: mark this buffer\nmouse-2: select this buffer\nmouse-3: operate on this buffer"))
|
'help-echo "mouse-1: mark this buffer\nmouse-2: select this buffer\nmouse-3: operate on this buffer"))
|
||||||
(propertize (buffer-name) 'font-lock-face (ibuffer-buffer-name-face buffer mark)))
|
(propertize (buffer-name) 'font-lock-face (ibuffer-buffer-name-face buffer mark)))
|
||||||
|
|
||||||
(define-ibuffer-column size (:inline t)
|
(define-ibuffer-column size (:inline t)
|
||||||
(format "%s" (buffer-size)))
|
(format "%s" (buffer-size)))
|
||||||
|
|
||||||
|
|
@ -1698,7 +1698,7 @@ If point is on a group name, this function operates on that group."
|
||||||
(ibuffer-current-format)))
|
(ibuffer-current-format)))
|
||||||
(when ibuffer-shrink-to-minimum-size
|
(when ibuffer-shrink-to-minimum-size
|
||||||
(ibuffer-shrink-to-fit)))))))
|
(ibuffer-shrink-to-fit)))))))
|
||||||
|
|
||||||
(defun ibuffer-map-on-mark (mark func)
|
(defun ibuffer-map-on-mark (mark func)
|
||||||
(ibuffer-map-lines
|
(ibuffer-map-lines
|
||||||
#'(lambda (buf mk)
|
#'(lambda (buf mk)
|
||||||
|
|
@ -1817,7 +1817,7 @@ the value of point at the beginning of the line for that buffer."
|
||||||
(funcall pred buf))
|
(funcall pred buf))
|
||||||
(setq hit t)))
|
(setq hit t)))
|
||||||
hit))
|
hit))
|
||||||
|
|
||||||
(defun ibuffer-filter-buffers (ibuffer-buf last bmarklist all)
|
(defun ibuffer-filter-buffers (ibuffer-buf last bmarklist all)
|
||||||
(let ((ext-loaded (featurep 'ibuf-ext)))
|
(let ((ext-loaded (featurep 'ibuf-ext)))
|
||||||
(delq nil
|
(delq nil
|
||||||
|
|
@ -2300,7 +2300,7 @@ Filter group commands:
|
||||||
'\\[ibuffer-save-filter-groups]' - Save the current groups with a name.
|
'\\[ibuffer-save-filter-groups]' - Save the current groups with a name.
|
||||||
'\\[ibuffer-switch-to-saved-filter-groups]' - Restore previously saved groups.
|
'\\[ibuffer-switch-to-saved-filter-groups]' - Restore previously saved groups.
|
||||||
'\\[ibuffer-delete-saved-filter-groups]' - Delete previously saved groups.
|
'\\[ibuffer-delete-saved-filter-groups]' - Delete previously saved groups.
|
||||||
|
|
||||||
Sorting commands:
|
Sorting commands:
|
||||||
|
|
||||||
'\\[ibuffer-toggle-sorting-mode]' - Rotate between the various sorting modes.
|
'\\[ibuffer-toggle-sorting-mode]' - Rotate between the various sorting modes.
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
|
|
||||||
(defcustom icomplete-mode nil
|
(defcustom icomplete-mode nil
|
||||||
"*Toggle incremental minibuffer completion.
|
"*Toggle incremental minibuffer completion.
|
||||||
As text is typed into the minibuffer, prospective completions are indicated
|
As text is typed into the minibuffer, prospective completions are indicated
|
||||||
in the minibuffer.
|
in the minibuffer.
|
||||||
Setting this variable directly does not take effect;
|
Setting this variable directly does not take effect;
|
||||||
use either \\[customize] or the function `icomplete-mode'."
|
use either \\[customize] or the function `icomplete-mode'."
|
||||||
|
|
|
||||||
208
lisp/ido.el
208
lisp/ido.el
|
|
@ -26,7 +26,7 @@
|
||||||
;;; Acknowledgements
|
;;; Acknowledgements
|
||||||
|
|
||||||
;; Infinite amounts of gratitude goes to Stephen Eglen <stephen@cns.ed.ac.uk>
|
;; Infinite amounts of gratitude goes to Stephen Eglen <stephen@cns.ed.ac.uk>
|
||||||
;; who wrote iswitch-buffer mode - from which I ripped off 99% of the code
|
;; who wrote iswitch-buffer mode - from which I ripped off 99% of the code
|
||||||
;; for ido-switch-buffer and found the inspiration for ido-find-file.
|
;; for ido-switch-buffer and found the inspiration for ido-find-file.
|
||||||
;; The ido package would never have existed without his work.
|
;; The ido package would never have existed without his work.
|
||||||
|
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
;; most recent, when I use ido-switch-buffer, I first of all get
|
;; most recent, when I use ido-switch-buffer, I first of all get
|
||||||
;; presented with the list of all the buffers
|
;; presented with the list of all the buffers
|
||||||
;;
|
;;
|
||||||
;; Buffer: {123456,123}
|
;; Buffer: {123456,123}
|
||||||
;;
|
;;
|
||||||
;; If I then press 2:
|
;; If I then press 2:
|
||||||
;; Buffer: 2[3]{123456,123}
|
;; Buffer: 2[3]{123456,123}
|
||||||
|
|
@ -156,7 +156,7 @@
|
||||||
;; drive, enter X:/ where X is the drive letter. You can also visit
|
;; drive, enter X:/ where X is the drive letter. You can also visit
|
||||||
;; files on other hosts using the ange-ftp notations `/host:' and
|
;; files on other hosts using the ange-ftp notations `/host:' and
|
||||||
;; `/user@host:'. See the variable `ido-slow-ftp-hosts' if you want
|
;; `/user@host:'. See the variable `ido-slow-ftp-hosts' if you want
|
||||||
;; to inhibit the ido substring matching for ftp access.
|
;; to inhibit the ido substring matching for ftp access.
|
||||||
;;
|
;;
|
||||||
;; If for some reason you cannot specify the proper file using
|
;; If for some reason you cannot specify the proper file using
|
||||||
;; ido-find-file, you can press C-f to enter the normal find-file.
|
;; ido-find-file, you can press C-f to enter the normal find-file.
|
||||||
|
|
@ -345,7 +345,7 @@
|
||||||
"Determines for which functional group \(buffer and files) ido behavior
|
"Determines for which functional group \(buffer and files) ido behavior
|
||||||
should be enabled. The following values are possible:
|
should be enabled. The following values are possible:
|
||||||
- `buffer': Turn only on ido buffer behavior \(switching, killing,
|
- `buffer': Turn only on ido buffer behavior \(switching, killing,
|
||||||
displaying...)
|
displaying...)
|
||||||
- `file': Turn only on ido file behavior \(finding, writing, inserting...)
|
- `file': Turn only on ido file behavior \(finding, writing, inserting...)
|
||||||
- `both': Turn on ido buffer and file behavior.
|
- `both': Turn on ido buffer and file behavior.
|
||||||
- `nil': Turn off any ido switching.
|
- `nil': Turn off any ido switching.
|
||||||
|
|
@ -359,7 +359,7 @@ use either \\[customize] or the function `ido-mode'."
|
||||||
:link '(emacs-commentary-link "ido.el")
|
:link '(emacs-commentary-link "ido.el")
|
||||||
:set-after '(ido-save-directory-list-file)
|
:set-after '(ido-save-directory-list-file)
|
||||||
:version "21.4"
|
:version "21.4"
|
||||||
:type '(choice (const :tag "Turn on only buffer" buffer)
|
:type '(choice (const :tag "Turn on only buffer" buffer)
|
||||||
(const :tag "Turn on only file" file)
|
(const :tag "Turn on only file" file)
|
||||||
(const :tag "Turn on both buffer and file" both)
|
(const :tag "Turn on both buffer and file" both)
|
||||||
(const :tag "Switch off all" nil))
|
(const :tag "Switch off all" nil))
|
||||||
|
|
@ -446,10 +446,10 @@ Possible values:
|
||||||
frame or in the other frame.
|
frame or in the other frame.
|
||||||
`always-frame' If a file is visible in another frame, raise that
|
`always-frame' If a file is visible in another frame, raise that
|
||||||
frame. Otherwise, visit the file in the same window."
|
frame. Otherwise, visit the file in the same window."
|
||||||
:type '(choice (const samewindow)
|
:type '(choice (const samewindow)
|
||||||
(const otherwindow)
|
(const otherwindow)
|
||||||
(const display)
|
(const display)
|
||||||
(const otherframe)
|
(const otherframe)
|
||||||
(const maybe-frame)
|
(const maybe-frame)
|
||||||
(const always-frame))
|
(const always-frame))
|
||||||
:group 'ido)
|
:group 'ido)
|
||||||
|
|
@ -457,10 +457,10 @@ Possible values:
|
||||||
(defcustom ido-default-buffer-method 'always-frame
|
(defcustom ido-default-buffer-method 'always-frame
|
||||||
"*How to switch to new buffer when using `ido-switch-buffer'.
|
"*How to switch to new buffer when using `ido-switch-buffer'.
|
||||||
See ido-default-file-method for details."
|
See ido-default-file-method for details."
|
||||||
:type '(choice (const samewindow)
|
:type '(choice (const samewindow)
|
||||||
(const otherwindow)
|
(const otherwindow)
|
||||||
(const display)
|
(const display)
|
||||||
(const otherframe)
|
(const otherframe)
|
||||||
(const maybe-frame)
|
(const maybe-frame)
|
||||||
(const always-frame))
|
(const always-frame))
|
||||||
:group 'ido)
|
:group 'ido)
|
||||||
|
|
@ -646,7 +646,7 @@ See also `ido-dir-file-cache' and `ido-save-directory-list-file'."
|
||||||
(defcustom ido-enter-single-matching-directory 'slash
|
(defcustom ido-enter-single-matching-directory 'slash
|
||||||
"*Automatically enter sub-directory if it is the only matching item, if non-nil.
|
"*Automatically enter sub-directory if it is the only matching item, if non-nil.
|
||||||
If value is 'slash, only enter if typing final slash, else do it always."
|
If value is 'slash, only enter if typing final slash, else do it always."
|
||||||
:type '(choice (const :tag "Never" nil)
|
:type '(choice (const :tag "Never" nil)
|
||||||
(const :tag "When typing /" slash)
|
(const :tag "When typing /" slash)
|
||||||
(other :tag "Always" t))
|
(other :tag "Always" t))
|
||||||
:group 'ido)
|
:group 'ido)
|
||||||
|
|
@ -655,7 +655,7 @@ If value is 'slash, only enter if typing final slash, else do it always."
|
||||||
"*Specify whether a new buffer is created if no buffer matches substring.
|
"*Specify whether a new buffer is created if no buffer matches substring.
|
||||||
Choices are 'always to create new buffers unconditionally, 'prompt to
|
Choices are 'always to create new buffers unconditionally, 'prompt to
|
||||||
ask user whether to create buffer, or 'never to never create new buffer."
|
ask user whether to create buffer, or 'never to never create new buffer."
|
||||||
:type '(choice (const always)
|
:type '(choice (const always)
|
||||||
(const prompt)
|
(const prompt)
|
||||||
(const never))
|
(const never))
|
||||||
:group 'ido)
|
:group 'ido)
|
||||||
|
|
@ -679,7 +679,7 @@ There are 8 elements in this list, each is a pair of strings:
|
||||||
4th element is the string inserted at the end of a truncated list of prospects,
|
4th element is the string inserted at the end of a truncated list of prospects,
|
||||||
5th and 6th elements are used as brackets around the common match string which
|
5th and 6th elements are used as brackets around the common match string which
|
||||||
can be completed using TAB,
|
can be completed using TAB,
|
||||||
7th element is the string displayed when there are a no matches, and
|
7th element is the string displayed when there are a no matches, and
|
||||||
8th element displayed if there is a single match (and faces are not used)."
|
8th element displayed if there is a single match (and faces are not used)."
|
||||||
:type '(repeat string)
|
:type '(repeat string)
|
||||||
:group 'ido)
|
:group 'ido)
|
||||||
|
|
@ -694,19 +694,19 @@ subdirs in the alternatives."
|
||||||
"*Font used by ido for highlighting first match."
|
"*Font used by ido for highlighting first match."
|
||||||
:group 'ido)
|
:group 'ido)
|
||||||
|
|
||||||
(defface ido-only-match-face '((((class color))
|
(defface ido-only-match-face '((((class color))
|
||||||
(:foreground "ForestGreen"))
|
(:foreground "ForestGreen"))
|
||||||
(t (:italic t)))
|
(t (:italic t)))
|
||||||
"*Font used by ido for highlighting only match."
|
"*Font used by ido for highlighting only match."
|
||||||
:group 'ido)
|
:group 'ido)
|
||||||
|
|
||||||
(defface ido-subdir-face '((((class color))
|
(defface ido-subdir-face '((((class color))
|
||||||
(:foreground "red"))
|
(:foreground "red"))
|
||||||
(t (:underline t)))
|
(t (:underline t)))
|
||||||
"*Font used by ido for highlighting subdirs in the alternatives."
|
"*Font used by ido for highlighting subdirs in the alternatives."
|
||||||
:group 'ido)
|
:group 'ido)
|
||||||
|
|
||||||
(defface ido-indicator-face '((((class color))
|
(defface ido-indicator-face '((((class color))
|
||||||
(:foreground "yellow"
|
(:foreground "yellow"
|
||||||
:background "red"
|
:background "red"
|
||||||
:width condensed))
|
:width condensed))
|
||||||
|
|
@ -786,7 +786,7 @@ This hook is run during minibuffer setup iff `ido' will be active.
|
||||||
It is intended for use in customizing ido for interoperation
|
It is intended for use in customizing ido for interoperation
|
||||||
with other packages. For instance:
|
with other packages. For instance:
|
||||||
|
|
||||||
\(add-hook 'ido-minibuffer-setup-hook
|
\(add-hook 'ido-minibuffer-setup-hook
|
||||||
\(function
|
\(function
|
||||||
\(lambda ()
|
\(lambda ()
|
||||||
\(make-local-variable 'max-mini-window-height)
|
\(make-local-variable 'max-mini-window-height)
|
||||||
|
|
@ -884,8 +884,8 @@ Copied from `icomplete-eoinput'.")
|
||||||
(defvar ido-report-no-match t
|
(defvar ido-report-no-match t
|
||||||
"Report [No Match] when no completions matches ido-text.")
|
"Report [No Match] when no completions matches ido-text.")
|
||||||
|
|
||||||
(defvar ido-exit nil
|
(defvar ido-exit nil
|
||||||
"Flag to monitor how `ido-find-file' exits.
|
"Flag to monitor how `ido-find-file' exits.
|
||||||
If equal to `takeprompt', we use the prompt as the file name to be
|
If equal to `takeprompt', we use the prompt as the file name to be
|
||||||
selected.")
|
selected.")
|
||||||
|
|
||||||
|
|
@ -896,7 +896,7 @@ selected.")
|
||||||
"Delay timer for auto merge.")
|
"Delay timer for auto merge.")
|
||||||
|
|
||||||
(defvar ido-use-mycompletion-depth 0
|
(defvar ido-use-mycompletion-depth 0
|
||||||
"Non-nil means use `ido' completion feedback.
|
"Non-nil means use `ido' completion feedback.
|
||||||
Is set by ido functions to the current minibuffer-depth, so that
|
Is set by ido functions to the current minibuffer-depth, so that
|
||||||
it doesn't interfere with other minibuffer usage.")
|
it doesn't interfere with other minibuffer usage.")
|
||||||
|
|
||||||
|
|
@ -1008,7 +1008,7 @@ it doesn't interfere with other minibuffer usage.")
|
||||||
(string-match "\\`/[^:/][^:/]+:\\'" dir))))
|
(string-match "\\`/[^:/][^:/]+:\\'" dir))))
|
||||||
|
|
||||||
(defun ido-is-ftp-directory (&optional dir)
|
(defun ido-is-ftp-directory (&optional dir)
|
||||||
(string-match
|
(string-match
|
||||||
(if ido-enable-tramp-completion
|
(if ido-enable-tramp-completion
|
||||||
"\\`/[^/:][^/:]+:" ;; like tramp-file-name-regexp-unified, but doesn't match single drive letters
|
"\\`/[^/:][^/:]+:" ;; like tramp-file-name-regexp-unified, but doesn't match single drive letters
|
||||||
"\\`/[^/:][^/:]+:/")
|
"\\`/[^/:][^/:]+:/")
|
||||||
|
|
@ -1019,7 +1019,7 @@ it doesn't interfere with other minibuffer usage.")
|
||||||
(setq dir (or dir ido-current-directory))
|
(setq dir (or dir ido-current-directory))
|
||||||
;; (featurep 'ange-ftp)
|
;; (featurep 'ange-ftp)
|
||||||
;; (ange-ftp-ftp-name dir)
|
;; (ange-ftp-ftp-name dir)
|
||||||
(string-match
|
(string-match
|
||||||
(if ido-enable-tramp-completion
|
(if ido-enable-tramp-completion
|
||||||
"\\`/\\([^/]+[@:]\\)*\\([^@/:][^@/:]+\\):"
|
"\\`/\\([^/]+[@:]\\)*\\([^@/:][^@/:]+\\):"
|
||||||
"\\`/\\([^/:]*@\\)?\\([^@/:][^@/:]+\\):/")
|
"\\`/\\([^/:]*@\\)?\\([^@/:][^@/:]+\\):/")
|
||||||
|
|
@ -1130,7 +1130,7 @@ Removes badly formatted data and ignored directories."
|
||||||
(setq r (cons (car l) r)))
|
(setq r (cons (car l) r)))
|
||||||
(setq l (cdr l)))
|
(setq l (cdr l)))
|
||||||
(nreverse r))))
|
(nreverse r))))
|
||||||
(setq ido-work-directory-list
|
(setq ido-work-directory-list
|
||||||
(and (listp ido-work-directory-list)
|
(and (listp ido-work-directory-list)
|
||||||
(let ((l ido-work-directory-list) r)
|
(let ((l ido-work-directory-list) r)
|
||||||
(while l
|
(while l
|
||||||
|
|
@ -1140,7 +1140,7 @@ Removes badly formatted data and ignored directories."
|
||||||
(setq r (cons (car l) r)))
|
(setq r (cons (car l) r)))
|
||||||
(setq l (cdr l)))
|
(setq l (cdr l)))
|
||||||
(nreverse r))))
|
(nreverse r))))
|
||||||
(setq ido-work-file-list
|
(setq ido-work-file-list
|
||||||
(and (listp ido-work-file-list)
|
(and (listp ido-work-file-list)
|
||||||
(let ((l ido-work-file-list) r)
|
(let ((l ido-work-file-list) r)
|
||||||
(while l
|
(while l
|
||||||
|
|
@ -1148,7 +1148,7 @@ Removes badly formatted data and ignored directories."
|
||||||
(setq r (cons (car l) r)))
|
(setq r (cons (car l) r)))
|
||||||
(setq l (cdr l)))
|
(setq l (cdr l)))
|
||||||
(nreverse r))))
|
(nreverse r))))
|
||||||
(setq ido-dir-file-cache
|
(setq ido-dir-file-cache
|
||||||
(and (listp ido-dir-file-cache)
|
(and (listp ido-dir-file-cache)
|
||||||
(let ((l ido-dir-file-cache) r)
|
(let ((l ido-dir-file-cache) r)
|
||||||
(while l
|
(while l
|
||||||
|
|
@ -1223,15 +1223,15 @@ Removes badly formatted data and ignored directories."
|
||||||
"Toggle ido speed-ups on or off.
|
"Toggle ido speed-ups on or off.
|
||||||
With ARG, turn ido speed-up on if arg is positive, off otherwise.
|
With ARG, turn ido speed-up on if arg is positive, off otherwise.
|
||||||
If second argument NOBIND is non-nil, no keys are rebound; otherwise,
|
If second argument NOBIND is non-nil, no keys are rebound; otherwise,
|
||||||
turning on ido-mode will modify the default keybindings for the
|
turning on ido-mode will modify the default keybindings for the
|
||||||
find-file and switch-to-buffer families of commands to the ido
|
find-file and switch-to-buffer families of commands to the ido
|
||||||
versions of these functions.
|
versions of these functions.
|
||||||
However, if second arg equals 'files, bind only for files, or if it
|
However, if second arg equals 'files, bind only for files, or if it
|
||||||
equals 'buffers, bind only for buffers.
|
equals 'buffers, bind only for buffers.
|
||||||
This function also adds a hook to the minibuffer."
|
This function also adds a hook to the minibuffer."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(setq ido-mode
|
(setq ido-mode
|
||||||
(cond
|
(cond
|
||||||
((null arg) (if ido-mode nil 'both))
|
((null arg) (if ido-mode nil 'both))
|
||||||
((eq arg t) 'both)
|
((eq arg t) 'both)
|
||||||
((eq arg 'files) 'file)
|
((eq arg 'files) 'file)
|
||||||
|
|
@ -1279,9 +1279,9 @@ This function also adds a hook to the minibuffer."
|
||||||
"Enable ido everywhere file and directory names are read."
|
"Enable ido everywhere file and directory names are read."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(setq ido-everywhere (if arg
|
(setq ido-everywhere (if arg
|
||||||
(> (prefix-numeric-value arg) 0)
|
(> (prefix-numeric-value arg) 0)
|
||||||
(not ido-everywhere)))
|
(not ido-everywhere)))
|
||||||
(setq read-file-name-function
|
(setq read-file-name-function
|
||||||
(and ido-everywhere (memq ido-mode '(both file))
|
(and ido-everywhere (memq ido-mode '(both file))
|
||||||
'ido-read-file-name))
|
'ido-read-file-name))
|
||||||
(setq read-buffer-function
|
(setq read-buffer-function
|
||||||
|
|
@ -1289,7 +1289,7 @@ This function also adds a hook to the minibuffer."
|
||||||
'ido-read-buffer)))
|
'ido-read-buffer)))
|
||||||
|
|
||||||
|
|
||||||
;;; IDO KEYMAP
|
;;; IDO KEYMAP
|
||||||
(defun ido-define-mode-map ()
|
(defun ido-define-mode-map ()
|
||||||
"Set up the keymap for `ido'."
|
"Set up the keymap for `ido'."
|
||||||
(let (map)
|
(let (map)
|
||||||
|
|
@ -1421,14 +1421,14 @@ This function also adds a hook to the minibuffer."
|
||||||
(funcall (cdr (car rule)) dirname))))
|
(funcall (cdr (car rule)) dirname))))
|
||||||
(setq rule (cdr rule))))
|
(setq rule (cdr rule))))
|
||||||
(run-hooks 'ido-rewrite-file-prompt-functions)
|
(run-hooks 'ido-rewrite-file-prompt-functions)
|
||||||
(concat prompt
|
(concat prompt
|
||||||
; (if ido-process-ignore-lists "" "&")
|
; (if ido-process-ignore-lists "" "&")
|
||||||
(or literal "")
|
(or literal "")
|
||||||
(or vc-off "")
|
(or vc-off "")
|
||||||
(or prefix "")
|
(or prefix "")
|
||||||
(let ((l (length dirname)))
|
(let ((l (length dirname)))
|
||||||
(if (and max-width (> max-width 0) (> l max-width))
|
(if (and max-width (> max-width 0) (> l max-width))
|
||||||
(let* ((s (substring dirname (- max-width)))
|
(let* ((s (substring dirname (- max-width)))
|
||||||
(i (string-match "/" s)))
|
(i (string-match "/" s)))
|
||||||
(concat "..." (if i (substring s i) s)))
|
(concat "..." (if i (substring s i) s)))
|
||||||
dirname)))))
|
dirname)))))
|
||||||
|
|
@ -1468,7 +1468,7 @@ This function also adds a hook to the minibuffer."
|
||||||
|
|
||||||
(defun ido-read-internal (item prompt history &optional default require-match initial)
|
(defun ido-read-internal (item prompt history &optional default require-match initial)
|
||||||
"Perform the ido-read-buffer and ido-read-file-name functions.
|
"Perform the ido-read-buffer and ido-read-file-name functions.
|
||||||
Return the name of a buffer or file selected.
|
Return the name of a buffer or file selected.
|
||||||
PROMPT is the prompt to give to the user.
|
PROMPT is the prompt to give to the user.
|
||||||
DEFAULT if given is the default directory to start with.
|
DEFAULT if given is the default directory to start with.
|
||||||
If REQUIRE-MATCH is non-nil, an existing file must be selected.
|
If REQUIRE-MATCH is non-nil, an existing file must be selected.
|
||||||
|
|
@ -1512,7 +1512,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
(if (bufferp default) (buffer-name default) default))
|
(if (bufferp default) (buffer-name default) default))
|
||||||
((stringp default) default)
|
((stringp default) default)
|
||||||
((eq item 'file)
|
((eq item 'file)
|
||||||
(and ido-enable-last-directory-history
|
(and ido-enable-last-directory-history
|
||||||
(let ((d (assoc ido-current-directory ido-last-directory-list)))
|
(let ((d (assoc ido-current-directory ido-last-directory-list)))
|
||||||
(and d (cdr d)))))))
|
(and d (cdr d)))))))
|
||||||
(if (member ido-default-item ido-ignore-item-temp-list)
|
(if (member ido-default-item ido-ignore-item-temp-list)
|
||||||
|
|
@ -1562,7 +1562,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
ido-use-merged-list t)
|
ido-use-merged-list t)
|
||||||
(ido-trace "Merged" t)
|
(ido-trace "Merged" t)
|
||||||
))))
|
))))
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
(ido-keep-item-list
|
(ido-keep-item-list
|
||||||
(setq ido-keep-item-list nil
|
(setq ido-keep-item-list nil
|
||||||
|
|
@ -1586,7 +1586,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
(ido-set-matches)
|
(ido-set-matches)
|
||||||
(if (and ido-matches (eq ido-try-merged-list 'auto))
|
(if (and ido-matches (eq ido-try-merged-list 'auto))
|
||||||
(setq ido-try-merged-list t))
|
(setq ido-try-merged-list t))
|
||||||
(let
|
(let
|
||||||
((minibuffer-local-completion-map ido-mode-map)
|
((minibuffer-local-completion-map ido-mode-map)
|
||||||
(max-mini-window-height (or ido-max-window-height
|
(max-mini-window-height (or ido-max-window-height
|
||||||
(and (boundp 'max-mini-window-height) max-mini-window-height)))
|
(and (boundp 'max-mini-window-height) max-mini-window-height)))
|
||||||
|
|
@ -1598,7 +1598,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
(setq ido-exit nil)
|
(setq ido-exit nil)
|
||||||
(setq ido-final-text
|
(setq ido-final-text
|
||||||
(catch 'ido
|
(catch 'ido
|
||||||
(completing-read
|
(completing-read
|
||||||
(ido-make-prompt item prompt)
|
(ido-make-prompt item prompt)
|
||||||
'(("dummy" . 1)) nil nil ; table predicate require-match
|
'(("dummy" . 1)) nil nil ; table predicate require-match
|
||||||
(prog1 ido-text-init (setq ido-text-init nil)) ;initial-contents
|
(prog1 ido-text-init (setq ido-text-init nil)) ;initial-contents
|
||||||
|
|
@ -1611,7 +1611,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
((eq ido-exit 'refresh)
|
((eq ido-exit 'refresh)
|
||||||
(if (and (eq ido-use-merged-list 'auto)
|
(if (and (eq ido-use-merged-list 'auto)
|
||||||
(or (input-pending-p)))
|
(or (input-pending-p)))
|
||||||
(setq ido-use-merged-list nil
|
(setq ido-use-merged-list nil
|
||||||
ido-keep-item-list t))
|
ido-keep-item-list t))
|
||||||
|
|
@ -1623,7 +1623,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
ido-exit nil))
|
ido-exit nil))
|
||||||
|
|
||||||
((memq ido-exit '(edit chdir))
|
((memq ido-exit '(edit chdir))
|
||||||
(cond
|
(cond
|
||||||
((memq ido-cur-item '(file dir))
|
((memq ido-cur-item '(file dir))
|
||||||
(let* ((process-environment (cons "HOME=/" process-environment)) ;; cheat read-file-name
|
(let* ((process-environment (cons "HOME=/" process-environment)) ;; cheat read-file-name
|
||||||
(read-file-name-function nil)
|
(read-file-name-function nil)
|
||||||
|
|
@ -1639,10 +1639,10 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
d (or (file-name-directory new) "/")
|
d (or (file-name-directory new) "/")
|
||||||
f (file-name-nondirectory new)
|
f (file-name-nondirectory new)
|
||||||
edit t)
|
edit t)
|
||||||
(if (or
|
(if (or
|
||||||
(file-directory-p d)
|
(file-directory-p d)
|
||||||
(and (yes-or-no-p (format "Create directory %s? " d))
|
(and (yes-or-no-p (format "Create directory %s? " d))
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(progn (make-directory d t) t)
|
(progn (make-directory d t) t)
|
||||||
(error
|
(error
|
||||||
(message "Could not create directory")
|
(message "Could not create directory")
|
||||||
|
|
@ -1748,7 +1748,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
;; Choose the buffer name: either the text typed in, or the head
|
;; Choose the buffer name: either the text typed in, or the head
|
||||||
;; of the list of matches
|
;; of the list of matches
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
((eq ido-exit 'findfile)
|
((eq ido-exit 'findfile)
|
||||||
(ido-file-internal ido-default-file-method nil nil nil nil ido-text))
|
(ido-file-internal ido-default-file-method nil nil nil nil ido-text))
|
||||||
|
|
||||||
|
|
@ -1786,7 +1786,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun ido-read-buffer (prompt &optional default require-match initial)
|
(defun ido-read-buffer (prompt &optional default require-match initial)
|
||||||
"Replacement for the built-in `read-buffer'.
|
"Replacement for the built-in `read-buffer'.
|
||||||
Return the name of a buffer selected.
|
Return the name of a buffer selected.
|
||||||
PROMPT is the prompt to give to the user. DEFAULT if given is the default
|
PROMPT is the prompt to give to the user. DEFAULT if given is the default
|
||||||
buffer to be selected, which will go to the front of the list.
|
buffer to be selected, which will go to the front of the list.
|
||||||
If REQUIRE-MATCH is non-nil, an existing-buffer must be selected.
|
If REQUIRE-MATCH is non-nil, an existing-buffer must be selected.
|
||||||
|
|
@ -1820,7 +1820,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
ido-text-init ido-text
|
ido-text-init ido-text
|
||||||
ido-rotate-temp t)
|
ido-rotate-temp t)
|
||||||
(exit-minibuffer))))
|
(exit-minibuffer))))
|
||||||
|
|
||||||
(defun ido-record-work-file (name)
|
(defun ido-record-work-file (name)
|
||||||
;; Save NAME in ido-work-file-list
|
;; Save NAME in ido-work-file-list
|
||||||
(when (and (numberp ido-max-work-file-list) (> ido-max-work-file-list 0))
|
(when (and (numberp ido-max-work-file-list) (> ido-max-work-file-list 0))
|
||||||
|
|
@ -1924,7 +1924,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
((eq method 'insert)
|
((eq method 'insert)
|
||||||
(ido-record-work-file filename)
|
(ido-record-work-file filename)
|
||||||
(setq filename (concat ido-current-directory filename))
|
(setq filename (concat ido-current-directory filename))
|
||||||
(ido-record-command
|
(ido-record-command
|
||||||
(if ido-find-literal 'insert-file-literally 'insert-file)
|
(if ido-find-literal 'insert-file-literally 'insert-file)
|
||||||
filename)
|
filename)
|
||||||
(ido-record-work-directory)
|
(ido-record-work-directory)
|
||||||
|
|
@ -1962,7 +1962,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
"Try and complete the current pattern amongst the file names."
|
"Try and complete the current pattern amongst the file names."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let (res)
|
(let (res)
|
||||||
(cond
|
(cond
|
||||||
((and (memq ido-cur-item '(file dir))
|
((and (memq ido-cur-item '(file dir))
|
||||||
(string-match "[$]" ido-text))
|
(string-match "[$]" ido-text))
|
||||||
(let ((evar (substitute-in-file-name (concat ido-current-directory ido-text))))
|
(let ((evar (substitute-in-file-name (concat ido-current-directory ido-text))))
|
||||||
|
|
@ -1981,14 +1981,14 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||||
((not ido-matches)
|
((not ido-matches)
|
||||||
(when ido-completion-buffer
|
(when ido-completion-buffer
|
||||||
(call-interactively (setq this-command ido-cannot-complete-command))))
|
(call-interactively (setq this-command ido-cannot-complete-command))))
|
||||||
|
|
||||||
((and (= 1 (length ido-matches))
|
((and (= 1 (length ido-matches))
|
||||||
(not (and ido-enable-tramp-completion
|
(not (and ido-enable-tramp-completion
|
||||||
(string-equal ido-current-directory "/")
|
(string-equal ido-current-directory "/")
|
||||||
(string-match "..[@:]\\'" (car ido-matches)))))
|
(string-match "..[@:]\\'" (car ido-matches)))))
|
||||||
;; only one choice, so select it.
|
;; only one choice, so select it.
|
||||||
(exit-minibuffer))
|
(exit-minibuffer))
|
||||||
|
|
||||||
(t ;; else there could be some completions
|
(t ;; else there could be some completions
|
||||||
(setq res ido-common-match-string)
|
(setq res ido-common-match-string)
|
||||||
(if (and (not (memq res '(t nil)))
|
(if (and (not (memq res '(t nil)))
|
||||||
|
|
@ -2050,7 +2050,7 @@ If no merge has yet taken place, toggle automatic merging option."
|
||||||
(setq ido-try-merged-list t))
|
(setq ido-try-merged-list t))
|
||||||
((not ido-use-merged-list)
|
((not ido-use-merged-list)
|
||||||
(ido-merge-work-directories))))
|
(ido-merge-work-directories))))
|
||||||
|
|
||||||
;;; TOGGLE FUNCTIONS
|
;;; TOGGLE FUNCTIONS
|
||||||
|
|
||||||
(defun ido-toggle-case ()
|
(defun ido-toggle-case ()
|
||||||
|
|
@ -2087,7 +2087,7 @@ If no merge has yet taken place, toggle automatic merging option."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (and ido-mode (eq ido-cur-item 'file))
|
(if (and ido-mode (eq ido-cur-item 'file))
|
||||||
(progn
|
(progn
|
||||||
(setq vc-master-templates
|
(setq vc-master-templates
|
||||||
(if vc-master-templates nil ido-saved-vc-mt))
|
(if vc-master-templates nil ido-saved-vc-mt))
|
||||||
(setq ido-text-init ido-text)
|
(setq ido-text-init ido-text)
|
||||||
(setq ido-exit 'keep)
|
(setq ido-exit 'keep)
|
||||||
|
|
@ -2323,8 +2323,8 @@ If repeated, insert text from buffer instead."
|
||||||
(let* ((bfname (buffer-file-name ido-entry-buffer))
|
(let* ((bfname (buffer-file-name ido-entry-buffer))
|
||||||
(name (and bfname (file-name-nondirectory bfname))))
|
(name (and bfname (file-name-nondirectory bfname))))
|
||||||
(when name
|
(when name
|
||||||
(setq ido-text-init
|
(setq ido-text-init
|
||||||
(if (or all
|
(if (or all
|
||||||
(not (equal (file-name-directory bfname) ido-current-directory))
|
(not (equal (file-name-directory bfname) ido-current-directory))
|
||||||
(not (string-match "\\.[^.]*\\'" name)))
|
(not (string-match "\\.[^.]*\\'" name)))
|
||||||
name
|
name
|
||||||
|
|
@ -2332,7 +2332,7 @@ If repeated, insert text from buffer instead."
|
||||||
(setq ido-exit 'refresh
|
(setq ido-exit 'refresh
|
||||||
ido-try-merged-list nil)
|
ido-try-merged-list nil)
|
||||||
(exit-minibuffer))))
|
(exit-minibuffer))))
|
||||||
|
|
||||||
(defun ido-copy-current-word (all)
|
(defun ido-copy-current-word (all)
|
||||||
"Insert current word (file or directory name) from current buffer."
|
"Insert current word (file or directory name) from current buffer."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
|
|
@ -2367,7 +2367,7 @@ If repeated, insert text from buffer instead."
|
||||||
ido-exit 'refresh)))
|
ido-exit 'refresh)))
|
||||||
(exit-minibuffer))))
|
(exit-minibuffer))))
|
||||||
|
|
||||||
(defun ido-next-match ()
|
(defun ido-next-match ()
|
||||||
"Put first element of `ido-matches' at the end of the list."
|
"Put first element of `ido-matches' at the end of the list."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if ido-matches
|
(if ido-matches
|
||||||
|
|
@ -2376,7 +2376,7 @@ If repeated, insert text from buffer instead."
|
||||||
(setq ido-rescan t)
|
(setq ido-rescan t)
|
||||||
(setq ido-rotate t))))
|
(setq ido-rotate t))))
|
||||||
|
|
||||||
(defun ido-prev-match ()
|
(defun ido-prev-match ()
|
||||||
"Put last element of `ido-matches' at the front of the list."
|
"Put last element of `ido-matches' at the front of the list."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if ido-matches
|
(if ido-matches
|
||||||
|
|
@ -2385,7 +2385,7 @@ If repeated, insert text from buffer instead."
|
||||||
(setq ido-rescan t)
|
(setq ido-rescan t)
|
||||||
(setq ido-rotate t))))
|
(setq ido-rotate t))))
|
||||||
|
|
||||||
(defun ido-next-match-dir ()
|
(defun ido-next-match-dir ()
|
||||||
"Find next directory in match list.
|
"Find next directory in match list.
|
||||||
If work directories have been merged, cycle through directories for
|
If work directories have been merged, cycle through directories for
|
||||||
first matching file."
|
first matching file."
|
||||||
|
|
@ -2404,7 +2404,7 @@ first matching file."
|
||||||
(if (< i cnt)
|
(if (< i cnt)
|
||||||
(setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches)))))))
|
(setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches)))))))
|
||||||
|
|
||||||
(defun ido-prev-match-dir ()
|
(defun ido-prev-match-dir ()
|
||||||
"Find previous directory in match list.
|
"Find previous directory in match list.
|
||||||
If work directories have been merged, cycle through directories
|
If work directories have been merged, cycle through directories
|
||||||
for first matching file."
|
for first matching file."
|
||||||
|
|
@ -2423,7 +2423,7 @@ for first matching file."
|
||||||
(if (> i 0)
|
(if (> i 0)
|
||||||
(setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches)))))))
|
(setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches)))))))
|
||||||
|
|
||||||
(defun ido-restrict-to-matches ()
|
(defun ido-restrict-to-matches ()
|
||||||
"Set current item list to the currently matched items."
|
"Set current item list to the currently matched items."
|
||||||
(interactive)
|
(interactive)
|
||||||
(when ido-matches
|
(when ido-matches
|
||||||
|
|
@ -2492,8 +2492,8 @@ for first matching file."
|
||||||
|
|
||||||
(defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir)
|
(defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir)
|
||||||
;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir")
|
;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir")
|
||||||
(let ((filenames
|
(let ((filenames
|
||||||
(split-string
|
(split-string
|
||||||
(shell-command-to-string
|
(shell-command-to-string
|
||||||
(concat "find " dir " -name \"" (if prefix "" "*") file "*\" -type " (if finddir "d" "f") " -print"))))
|
(concat "find " dir " -name \"" (if prefix "" "*") file "*\" -type " (if finddir "d" "f") " -print"))))
|
||||||
filename d f
|
filename d f
|
||||||
|
|
@ -2598,7 +2598,7 @@ for first matching file."
|
||||||
|
|
||||||
(defun ido-make-buffer-list1 (&optional frame visible)
|
(defun ido-make-buffer-list1 (&optional frame visible)
|
||||||
;; Return list of non-ignored buffer names
|
;; Return list of non-ignored buffer names
|
||||||
(delq nil
|
(delq nil
|
||||||
(mapcar
|
(mapcar
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(let ((name (buffer-name x)))
|
(let ((name (buffer-name x)))
|
||||||
|
|
@ -2609,7 +2609,7 @@ for first matching file."
|
||||||
(defun ido-make-buffer-list (default)
|
(defun ido-make-buffer-list (default)
|
||||||
;; Return the current list of buffers.
|
;; Return the current list of buffers.
|
||||||
;; Currently visible buffers are put at the end of the list.
|
;; Currently visible buffers are put at the end of the list.
|
||||||
;; The hook `ido-make-buflist-hook' is run after the list has been
|
;; The hook `ido-make-buflist-hook' is run after the list has been
|
||||||
;; created to allow the user to further modify the order of the buffer names
|
;; created to allow the user to further modify the order of the buffer names
|
||||||
;; in this list. If DEFAULT is non-nil, and corresponds to an existing buffer,
|
;; in this list. If DEFAULT is non-nil, and corresponds to an existing buffer,
|
||||||
;; it is put to the start of the list.
|
;; it is put to the start of the list.
|
||||||
|
|
@ -2620,17 +2620,17 @@ for first matching file."
|
||||||
(setq ido-temp-list ido-current-buffers))
|
(setq ido-temp-list ido-current-buffers))
|
||||||
(if default
|
(if default
|
||||||
(progn
|
(progn
|
||||||
(setq ido-temp-list
|
(setq ido-temp-list
|
||||||
(delete default ido-temp-list))
|
(delete default ido-temp-list))
|
||||||
(setq ido-temp-list
|
(setq ido-temp-list
|
||||||
(cons default ido-temp-list))))
|
(cons default ido-temp-list))))
|
||||||
(run-hooks 'ido-make-buffer-list-hook)
|
(run-hooks 'ido-make-buffer-list-hook)
|
||||||
ido-temp-list))
|
ido-temp-list))
|
||||||
|
|
||||||
(defun ido-to-end (items)
|
(defun ido-to-end (items)
|
||||||
;; Move the elements from ITEMS to the end of `ido-temp-list'
|
;; Move the elements from ITEMS to the end of `ido-temp-list'
|
||||||
(mapcar
|
(mapcar
|
||||||
(lambda (elem)
|
(lambda (elem)
|
||||||
(setq ido-temp-list (delq elem ido-temp-list)))
|
(setq ido-temp-list (delq elem ido-temp-list)))
|
||||||
items)
|
items)
|
||||||
(if ido-temp-list
|
(if ido-temp-list
|
||||||
|
|
@ -2670,7 +2670,7 @@ for first matching file."
|
||||||
(stringp dir) (> (length dir) 0)
|
(stringp dir) (> (length dir) 0)
|
||||||
(ido-may-cache-directory dir))
|
(ido-may-cache-directory dir))
|
||||||
(let* ((cached (assoc dir ido-dir-file-cache))
|
(let* ((cached (assoc dir ido-dir-file-cache))
|
||||||
(ctime (nth 1 cached))
|
(ctime (nth 1 cached))
|
||||||
(ftp (ido-is-ftp-directory dir))
|
(ftp (ido-is-ftp-directory dir))
|
||||||
(attr (if ftp nil (file-attributes dir)))
|
(attr (if ftp nil (file-attributes dir)))
|
||||||
(mtime (nth 5 attr))
|
(mtime (nth 5 attr))
|
||||||
|
|
@ -2710,7 +2710,7 @@ for first matching file."
|
||||||
;; Return list of non-ignored files in DIR
|
;; Return list of non-ignored files in DIR
|
||||||
;; If MERGED is non-nil, each file is cons'ed with DIR
|
;; If MERGED is non-nil, each file is cons'ed with DIR
|
||||||
(and (or (ido-is-tramp-root dir) (file-directory-p dir))
|
(and (or (ido-is-tramp-root dir) (file-directory-p dir))
|
||||||
(delq nil
|
(delq nil
|
||||||
(mapcar
|
(mapcar
|
||||||
(lambda (name)
|
(lambda (name)
|
||||||
(if (not (ido-ignore-item-p name ido-ignore-files t))
|
(if (not (ido-ignore-item-p name ido-ignore-files t))
|
||||||
|
|
@ -2720,20 +2720,20 @@ for first matching file."
|
||||||
(defun ido-make-file-list (default)
|
(defun ido-make-file-list (default)
|
||||||
;; Return the current list of files.
|
;; Return the current list of files.
|
||||||
;; Currently visible files are put at the end of the list.
|
;; Currently visible files are put at the end of the list.
|
||||||
;; The hook `ido-make-file-list-hook' is run after the list has been
|
;; The hook `ido-make-file-list-hook' is run after the list has been
|
||||||
;; created to allow the user to further modify the order of the file names
|
;; created to allow the user to further modify the order of the file names
|
||||||
;; in this list.
|
;; in this list.
|
||||||
(let ((ido-temp-list (ido-make-file-list1 ido-current-directory)))
|
(let ((ido-temp-list (ido-make-file-list1 ido-current-directory)))
|
||||||
(setq ido-temp-list (ido-sort-list ido-temp-list))
|
(setq ido-temp-list (ido-sort-list ido-temp-list))
|
||||||
(let ((default-directory ido-current-directory))
|
(let ((default-directory ido-current-directory))
|
||||||
(ido-to-end ;; move ftp hosts and visited files to end
|
(ido-to-end ;; move ftp hosts and visited files to end
|
||||||
(delq nil (mapcar
|
(delq nil (mapcar
|
||||||
(lambda (x) (if (or (string-match "..:\\'" x)
|
(lambda (x) (if (or (string-match "..:\\'" x)
|
||||||
(and (not (ido-final-slash x))
|
(and (not (ido-final-slash x))
|
||||||
(get-file-buffer x))) x))
|
(get-file-buffer x))) x))
|
||||||
ido-temp-list))))
|
ido-temp-list))))
|
||||||
(ido-to-end ;; move . files to end
|
(ido-to-end ;; move . files to end
|
||||||
(delq nil (mapcar
|
(delq nil (mapcar
|
||||||
(lambda (x) (if (string-equal (substring x 0 1) ".") x))
|
(lambda (x) (if (string-equal (substring x 0 1) ".") x))
|
||||||
ido-temp-list)))
|
ido-temp-list)))
|
||||||
(if (and default (member default ido-temp-list))
|
(if (and default (member default ido-temp-list))
|
||||||
|
|
@ -2746,9 +2746,9 @@ for first matching file."
|
||||||
(setcdr l nil)
|
(setcdr l nil)
|
||||||
(nconc k ido-temp-list)
|
(nconc k ido-temp-list)
|
||||||
(setq ido-temp-list k)))
|
(setq ido-temp-list k)))
|
||||||
(setq ido-temp-list
|
(setq ido-temp-list
|
||||||
(delete default ido-temp-list))
|
(delete default ido-temp-list))
|
||||||
(setq ido-temp-list
|
(setq ido-temp-list
|
||||||
(cons default ido-temp-list))))
|
(cons default ido-temp-list))))
|
||||||
(when ido-show-dot-for-dired
|
(when ido-show-dot-for-dired
|
||||||
(setq ido-temp-list (delete "." ido-temp-list))
|
(setq ido-temp-list (delete "." ido-temp-list))
|
||||||
|
|
@ -2760,7 +2760,7 @@ for first matching file."
|
||||||
;; Return list of non-ignored subdirs in DIR
|
;; Return list of non-ignored subdirs in DIR
|
||||||
;; If MERGED is non-nil, each subdir is cons'ed with DIR
|
;; If MERGED is non-nil, each subdir is cons'ed with DIR
|
||||||
(and (or (ido-is-tramp-root dir) (file-directory-p dir))
|
(and (or (ido-is-tramp-root dir) (file-directory-p dir))
|
||||||
(delq nil
|
(delq nil
|
||||||
(mapcar
|
(mapcar
|
||||||
(lambda (name)
|
(lambda (name)
|
||||||
(and (ido-final-slash name) (not (ido-ignore-item-p name ido-ignore-directories))
|
(and (ido-final-slash name) (not (ido-ignore-item-p name ido-ignore-directories))
|
||||||
|
|
@ -2769,13 +2769,13 @@ for first matching file."
|
||||||
|
|
||||||
(defun ido-make-dir-list (default)
|
(defun ido-make-dir-list (default)
|
||||||
;; Return the current list of directories.
|
;; Return the current list of directories.
|
||||||
;; The hook `ido-make-dir-list-hook' is run after the list has been
|
;; The hook `ido-make-dir-list-hook' is run after the list has been
|
||||||
;; created to allow the user to further modify the order of the
|
;; created to allow the user to further modify the order of the
|
||||||
;; directory names in this list.
|
;; directory names in this list.
|
||||||
(let ((ido-temp-list (ido-make-dir-list1 ido-current-directory)))
|
(let ((ido-temp-list (ido-make-dir-list1 ido-current-directory)))
|
||||||
(setq ido-temp-list (ido-sort-list ido-temp-list))
|
(setq ido-temp-list (ido-sort-list ido-temp-list))
|
||||||
(ido-to-end ;; move . files to end
|
(ido-to-end ;; move . files to end
|
||||||
(delq nil (mapcar
|
(delq nil (mapcar
|
||||||
(lambda (x) (if (string-equal (substring x 0 1) ".") x))
|
(lambda (x) (if (string-equal (substring x 0 1) ".") x))
|
||||||
ido-temp-list)))
|
ido-temp-list)))
|
||||||
(if (and default (member default ido-temp-list))
|
(if (and default (member default ido-temp-list))
|
||||||
|
|
@ -2788,9 +2788,9 @@ for first matching file."
|
||||||
(setcdr l nil)
|
(setcdr l nil)
|
||||||
(nconc k ido-temp-list)
|
(nconc k ido-temp-list)
|
||||||
(setq ido-temp-list k)))
|
(setq ido-temp-list k)))
|
||||||
(setq ido-temp-list
|
(setq ido-temp-list
|
||||||
(delete default ido-temp-list))
|
(delete default ido-temp-list))
|
||||||
(setq ido-temp-list
|
(setq ido-temp-list
|
||||||
(cons default ido-temp-list))))
|
(cons default ido-temp-list))))
|
||||||
(setq ido-temp-list (delete "." ido-temp-list))
|
(setq ido-temp-list (delete "." ido-temp-list))
|
||||||
(setq ido-temp-list (cons "." ido-temp-list))
|
(setq ido-temp-list (cons "." ido-temp-list))
|
||||||
|
|
@ -2807,7 +2807,7 @@ for first matching file."
|
||||||
;; `ido-all-frames'.
|
;; `ido-all-frames'.
|
||||||
(let ((ido-bufs-in-frame nil))
|
(let ((ido-bufs-in-frame nil))
|
||||||
(walk-windows 'ido-get-bufname nil
|
(walk-windows 'ido-get-bufname nil
|
||||||
(if current
|
(if current
|
||||||
nil
|
nil
|
||||||
ido-all-frames))
|
ido-all-frames))
|
||||||
ido-bufs-in-frame))
|
ido-bufs-in-frame))
|
||||||
|
|
@ -2869,14 +2869,14 @@ for first matching file."
|
||||||
(setq matches (cons item matches)))))
|
(setq matches (cons item matches)))))
|
||||||
items))
|
items))
|
||||||
matches))
|
matches))
|
||||||
|
|
||||||
|
|
||||||
(defun ido-set-matches ()
|
(defun ido-set-matches ()
|
||||||
;; Set `ido-matches' to the list of items matching prompt
|
;; Set `ido-matches' to the list of items matching prompt
|
||||||
(when ido-rescan
|
(when ido-rescan
|
||||||
(setq ido-matches (ido-set-matches1 (reverse ido-cur-list) (not ido-rotate))
|
(setq ido-matches (ido-set-matches1 (reverse ido-cur-list) (not ido-rotate))
|
||||||
ido-rotate nil)))
|
ido-rotate nil)))
|
||||||
|
|
||||||
(defun ido-ignore-item-p (name re-list &optional ignore-ext)
|
(defun ido-ignore-item-p (name re-list &optional ignore-ext)
|
||||||
;; Return t if the buffer or file NAME should be ignored.
|
;; Return t if the buffer or file NAME should be ignored.
|
||||||
(or (member name ido-ignore-item-temp-list)
|
(or (member name ido-ignore-item-temp-list)
|
||||||
|
|
@ -2885,7 +2885,7 @@ for first matching file."
|
||||||
(let ((data (match-data))
|
(let ((data (match-data))
|
||||||
(ext-list (and ignore-ext ido-ignore-extensions
|
(ext-list (and ignore-ext ido-ignore-extensions
|
||||||
completion-ignored-extensions))
|
completion-ignored-extensions))
|
||||||
ignorep nextstr
|
ignorep nextstr
|
||||||
(flen (length name)) slen)
|
(flen (length name)) slen)
|
||||||
(while ext-list
|
(while ext-list
|
||||||
(setq nextstr (car ext-list))
|
(setq nextstr (car ext-list))
|
||||||
|
|
@ -2941,7 +2941,7 @@ for first matching file."
|
||||||
(defun ido-word-matching-substring (word)
|
(defun ido-word-matching-substring (word)
|
||||||
;; Return part of WORD before 1st match to `ido-change-word-sub'.
|
;; Return part of WORD before 1st match to `ido-change-word-sub'.
|
||||||
;; If `ido-change-word-sub' cannot be found in WORD, return nil.
|
;; If `ido-change-word-sub' cannot be found in WORD, return nil.
|
||||||
(let ((case-fold-search ido-case-fold))
|
(let ((case-fold-search ido-case-fold))
|
||||||
(let ((m (string-match ido-change-word-sub (ido-name word))))
|
(let ((m (string-match ido-change-word-sub (ido-name word))))
|
||||||
(if m
|
(if m
|
||||||
(substring (ido-name word) m)
|
(substring (ido-name word) m)
|
||||||
|
|
@ -3009,7 +3009,7 @@ for first matching file."
|
||||||
(let ((f 'display-completion-list))
|
(let ((f 'display-completion-list))
|
||||||
(funcall f completion-list
|
(funcall f completion-list
|
||||||
:help-string "ido "
|
:help-string "ido "
|
||||||
:activate-callback
|
:activate-callback
|
||||||
'(lambda (x y z) (message "doesn't work yet, sorry!"))))
|
'(lambda (x y z) (message "doesn't work yet, sorry!"))))
|
||||||
;; else running Emacs
|
;; else running Emacs
|
||||||
;;(add-hook 'completion-setup-hook 'completion-setup-function)
|
;;(add-hook 'completion-setup-hook 'completion-setup-function)
|
||||||
|
|
@ -3026,7 +3026,7 @@ for first matching file."
|
||||||
;; Check if buffer still exists.
|
;; Check if buffer still exists.
|
||||||
(if (get-buffer buf)
|
(if (get-buffer buf)
|
||||||
;; buffer couldn't be killed.
|
;; buffer couldn't be killed.
|
||||||
(setq ido-rescan t)
|
(setq ido-rescan t)
|
||||||
;; else buffer was killed so remove name from list.
|
;; else buffer was killed so remove name from list.
|
||||||
(setq ido-cur-list (delq buf ido-cur-list))))))
|
(setq ido-cur-list (delq buf ido-cur-list))))))
|
||||||
|
|
||||||
|
|
@ -3047,7 +3047,7 @@ for first matching file."
|
||||||
;; Check if file still exists.
|
;; Check if file still exists.
|
||||||
(if (file-exists-p file)
|
(if (file-exists-p file)
|
||||||
;; file could not be deleted
|
;; file could not be deleted
|
||||||
(setq ido-rescan t)
|
(setq ido-rescan t)
|
||||||
;; else file was killed so remove name from list.
|
;; else file was killed so remove name from list.
|
||||||
(setq ido-cur-list (delq (car ido-matches) ido-cur-list))))))
|
(setq ido-cur-list (delq (car ido-matches) ido-cur-list))))))
|
||||||
|
|
||||||
|
|
@ -3140,7 +3140,7 @@ If no buffer is found, prompt for a new one.
|
||||||
|
|
||||||
\\[ido-next-match] Put the first element at the end of the list.
|
\\[ido-next-match] Put the first element at the end of the list.
|
||||||
\\[ido-prev-match] Put the last element at the start of the list.
|
\\[ido-prev-match] Put the last element at the start of the list.
|
||||||
\\[ido-complete] Complete a common suffix to the current string that
|
\\[ido-complete] Complete a common suffix to the current string that
|
||||||
matches all buffers. If there is only one match, select that buffer.
|
matches all buffers. If there is only one match, select that buffer.
|
||||||
If there is no common suffix, show a list of all matching buffers
|
If there is no common suffix, show a list of all matching buffers
|
||||||
in a separate window.
|
in a separate window.
|
||||||
|
|
@ -3228,7 +3228,7 @@ If no buffer or file is found, prompt for a new one.
|
||||||
|
|
||||||
\\[ido-next-match] Put the first element at the end of the list.
|
\\[ido-next-match] Put the first element at the end of the list.
|
||||||
\\[ido-prev-match] Put the last element at the start of the list.
|
\\[ido-prev-match] Put the last element at the start of the list.
|
||||||
\\[ido-complete] Complete a common suffix to the current string that
|
\\[ido-complete] Complete a common suffix to the current string that
|
||||||
matches all files. If there is only one match, select that file.
|
matches all files. If there is only one match, select that file.
|
||||||
If there is no common suffix, show a list of all matching files
|
If there is no common suffix, show a list of all matching files
|
||||||
in a separate window.
|
in a separate window.
|
||||||
|
|
@ -3429,7 +3429,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||||
|
|
||||||
((ido-final-slash contents) ;; xxx/
|
((ido-final-slash contents) ;; xxx/
|
||||||
(ido-trace "final slash" contents)
|
(ido-trace "final slash" contents)
|
||||||
(cond
|
(cond
|
||||||
((string-equal contents "~/")
|
((string-equal contents "~/")
|
||||||
(ido-set-current-home)
|
(ido-set-current-home)
|
||||||
(setq refresh t))
|
(setq refresh t))
|
||||||
|
|
@ -3458,7 +3458,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||||
(ido-set-current-directory (file-name-directory contents))
|
(ido-set-current-directory (file-name-directory contents))
|
||||||
(setq refresh t))
|
(setq refresh t))
|
||||||
((string-equal (substring contents -2 -1) "/")
|
((string-equal (substring contents -2 -1) "/")
|
||||||
(ido-set-current-directory
|
(ido-set-current-directory
|
||||||
(if (memq system-type '(windows-nt ms-dos))
|
(if (memq system-type '(windows-nt ms-dos))
|
||||||
(expand-file-name "/" ido-current-directory)
|
(expand-file-name "/" ido-current-directory)
|
||||||
"/"))
|
"/"))
|
||||||
|
|
@ -3513,7 +3513,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||||
(or try-single-dir-match
|
(or try-single-dir-match
|
||||||
(eq ido-enter-single-matching-directory t)))
|
(eq ido-enter-single-matching-directory t)))
|
||||||
(ido-trace "single match" (car ido-matches))
|
(ido-trace "single match" (car ido-matches))
|
||||||
(ido-set-current-directory
|
(ido-set-current-directory
|
||||||
(concat ido-current-directory (car ido-matches)))
|
(concat ido-current-directory (car ido-matches)))
|
||||||
(setq ido-exit 'refresh)
|
(setq ido-exit 'refresh)
|
||||||
(exit-minibuffer))
|
(exit-minibuffer))
|
||||||
|
|
@ -3554,10 +3554,10 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||||
(ido-trace "\n*start timer*")
|
(ido-trace "\n*start timer*")
|
||||||
(setq ido-auto-merge-timer
|
(setq ido-auto-merge-timer
|
||||||
(run-with-timer ido-auto-merge-delay-time nil 'ido-initiate-auto-merge (current-buffer))))))
|
(run-with-timer ido-auto-merge-delay-time nil 'ido-initiate-auto-merge (current-buffer))))))
|
||||||
|
|
||||||
(setq ido-rescan t)
|
(setq ido-rescan t)
|
||||||
|
|
||||||
(if (and ido-use-merged-list
|
(if (and ido-use-merged-list
|
||||||
ido-matches
|
ido-matches
|
||||||
(not (string-equal (car (cdr (car ido-matches))) ido-current-directory)))
|
(not (string-equal (car (cdr (car ido-matches))) ido-current-directory)))
|
||||||
(progn
|
(progn
|
||||||
|
|
@ -3569,7 +3569,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||||
|
|
||||||
;; Insert the match-status information:
|
;; Insert the match-status information:
|
||||||
(ido-set-common-completion)
|
(ido-set-common-completion)
|
||||||
(let ((inf (ido-completions
|
(let ((inf (ido-completions
|
||||||
contents
|
contents
|
||||||
minibuffer-completion-table
|
minibuffer-completion-table
|
||||||
minibuffer-completion-predicate
|
minibuffer-completion-predicate
|
||||||
|
|
@ -3581,7 +3581,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||||
(defun ido-completions (name candidates predicate require-match)
|
(defun ido-completions (name candidates predicate require-match)
|
||||||
;; Return the string that is displayed after the user's text.
|
;; Return the string that is displayed after the user's text.
|
||||||
;; Modified from `icomplete-completions'.
|
;; Modified from `icomplete-completions'.
|
||||||
|
|
||||||
(let* ((comps ido-matches)
|
(let* ((comps ido-matches)
|
||||||
(ind (and (consp (car comps)) (> (length (cdr (car comps))) 1)
|
(ind (and (consp (car comps)) (> (length (cdr (car comps))) 1)
|
||||||
ido-merged-indicator))
|
ido-merged-indicator))
|
||||||
|
|
@ -3589,7 +3589,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||||
|
|
||||||
(if (and ind ido-use-faces)
|
(if (and ind ido-use-faces)
|
||||||
(put-text-property 0 1 'face 'ido-indicator-face ind))
|
(put-text-property 0 1 'face 'ido-indicator-face ind))
|
||||||
|
|
||||||
(if (and ido-use-faces comps)
|
(if (and ido-use-faces comps)
|
||||||
(let* ((fn (ido-name (car comps)))
|
(let* ((fn (ido-name (car comps)))
|
||||||
(ln (length fn)))
|
(ln (length fn)))
|
||||||
|
|
@ -3619,7 +3619,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||||
(let* ((items (if (> ido-max-prospects 0) (1+ ido-max-prospects) 999))
|
(let* ((items (if (> ido-max-prospects 0) (1+ ido-max-prospects) 999))
|
||||||
(alternatives
|
(alternatives
|
||||||
(apply
|
(apply
|
||||||
#'concat
|
#'concat
|
||||||
(cdr (apply
|
(cdr (apply
|
||||||
#'nconc
|
#'nconc
|
||||||
(mapcar
|
(mapcar
|
||||||
|
|
@ -3654,7 +3654,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||||
(defun ido-minibuffer-setup ()
|
(defun ido-minibuffer-setup ()
|
||||||
"Minibuffer setup hook for `ido'."
|
"Minibuffer setup hook for `ido'."
|
||||||
;; Copied from `icomplete-minibuffer-setup-hook'.
|
;; Copied from `icomplete-minibuffer-setup-hook'.
|
||||||
(when (and (boundp 'ido-completing-read)
|
(when (and (boundp 'ido-completing-read)
|
||||||
(or (featurep 'xemacs)
|
(or (featurep 'xemacs)
|
||||||
(= ido-use-mycompletion-depth (minibuffer-depth))))
|
(= ido-use-mycompletion-depth (minibuffer-depth))))
|
||||||
(add-hook 'pre-command-hook 'ido-tidy nil t)
|
(add-hook 'pre-command-hook 'ido-tidy nil t)
|
||||||
|
|
@ -3679,13 +3679,13 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||||
(= ido-use-mycompletion-depth (minibuffer-depth)))
|
(= ido-use-mycompletion-depth (minibuffer-depth)))
|
||||||
(if (and (boundp 'ido-eoinput)
|
(if (and (boundp 'ido-eoinput)
|
||||||
ido-eoinput)
|
ido-eoinput)
|
||||||
|
|
||||||
(if (> ido-eoinput (point-max))
|
(if (> ido-eoinput (point-max))
|
||||||
;; Oops, got rug pulled out from under us - reinit:
|
;; Oops, got rug pulled out from under us - reinit:
|
||||||
(setq ido-eoinput (point-max))
|
(setq ido-eoinput (point-max))
|
||||||
(let ((buffer-undo-list t))
|
(let ((buffer-undo-list t))
|
||||||
(delete-region ido-eoinput (point-max))))
|
(delete-region ido-eoinput (point-max))))
|
||||||
|
|
||||||
;; Reestablish the local variable 'cause minibuffer-setup is weird:
|
;; Reestablish the local variable 'cause minibuffer-setup is weird:
|
||||||
(make-local-variable 'ido-eoinput)
|
(make-local-variable 'ido-eoinput)
|
||||||
(setq ido-eoinput 1))))
|
(setq ido-eoinput 1))))
|
||||||
|
|
@ -3695,9 +3695,9 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||||
;; This is an example function which can be hooked on to
|
;; This is an example function which can be hooked on to
|
||||||
;; `ido-make-buffer-list-hook'. Any buffer matching the regexps
|
;; `ido-make-buffer-list-hook'. Any buffer matching the regexps
|
||||||
;; `Summary' or `output\*$'are put to the end of the list.
|
;; `Summary' or `output\*$'are put to the end of the list.
|
||||||
(let ((summaries (delq nil (mapcar
|
(let ((summaries (delq nil (mapcar
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(if (or
|
(if (or
|
||||||
(string-match "Summary" x)
|
(string-match "Summary" x)
|
||||||
(string-match "output\\*\\'" x))
|
(string-match "output\\*\\'" x))
|
||||||
x))
|
x))
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ such as `edebug-defun' to work with such inputs."
|
||||||
"During IELM evaluation, most recent value evaluated in IELM.
|
"During IELM evaluation, most recent value evaluated in IELM.
|
||||||
Normally identical to `*'. However, if the working buffer is an IELM
|
Normally identical to `*'. However, if the working buffer is an IELM
|
||||||
buffer, distinct from the process buffer, then `*' gives the value in
|
buffer, distinct from the process buffer, then `*' gives the value in
|
||||||
the working buffer, `*1' the value in the process buffer.
|
the working buffer, `*1' the value in the process buffer.
|
||||||
The intended value is only accessible during IELM evaluation.")
|
The intended value is only accessible during IELM evaluation.")
|
||||||
|
|
||||||
(defvar *2 nil
|
(defvar *2 nil
|
||||||
|
|
@ -505,7 +505,7 @@ Customised bindings may be defined in `ielm-map', which currently contains:
|
||||||
(file-error (start-process "ielm" (current-buffer) "cat")))
|
(file-error (start-process "ielm" (current-buffer) "cat")))
|
||||||
(process-kill-without-query (ielm-process))
|
(process-kill-without-query (ielm-process))
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
|
|
||||||
;; Lisp output can include raw characters that confuse comint's
|
;; Lisp output can include raw characters that confuse comint's
|
||||||
;; carriage control code.
|
;; carriage control code.
|
||||||
(set (make-local-variable 'comint-inhibit-carriage-motion) t)
|
(set (make-local-variable 'comint-inhibit-carriage-motion) t)
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ We accept the tag Exif because that is the same format."
|
||||||
(code (aref data i)))
|
(code (aref data i)))
|
||||||
(when (and (>= code #xe0) (<= code #xef))
|
(when (and (>= code #xe0) (<= code #xef))
|
||||||
;; APP0 LEN1 LEN2 "JFIF\0"
|
;; APP0 LEN1 LEN2 "JFIF\0"
|
||||||
(throw 'jfif
|
(throw 'jfif
|
||||||
(string-match "JFIF\\|Exif" (substring data i (+ i nbytes)))))
|
(string-match "JFIF\\|Exif" (substring data i (+ i nbytes)))))
|
||||||
(setq i (+ i 1 nbytes))))))))
|
(setq i (+ i 1 nbytes))))))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue