mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-21 06:55:39 +00:00
Trailing whitespace deleted.
This commit is contained in:
parent
693ff6134c
commit
71296446d3
@ -229,7 +229,7 @@ Don't use this function in a Lisp program; use `define-abbrev' instead."
|
||||
(interactive "p")
|
||||
(add-abbrev
|
||||
(if only-global-abbrevs
|
||||
global-abbrev-table
|
||||
global-abbrev-table
|
||||
(or local-abbrev-table
|
||||
(error "No per-mode abbrev table")))
|
||||
"Mode" arg))
|
||||
|
@ -5,7 +5,7 @@
|
||||
;; Author: Ken Manheimer <klm@python.org>
|
||||
;; Maintainer: Ken Manheimer <klm@python.org>
|
||||
;; 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
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
@ -33,23 +33,23 @@
|
||||
;; exposure. It also provides for syntax-sensitive text like
|
||||
;; programming languages. (For an example, see the allout code
|
||||
;; itself, which is organized in ;; an outline framework.)
|
||||
;;
|
||||
;;
|
||||
;; In addition to outline navigation and exposure, allout includes:
|
||||
;;
|
||||
;;
|
||||
;; - topic-oriented repositioning, cut, and paste
|
||||
;; - integral outline exposure-layout
|
||||
;; - incremental search with dynamic exposure and reconcealment of hidden text
|
||||
;; - automatic topic-number maintenance
|
||||
;; - "Hot-spot" operation, for single-keystroke maneuvering and
|
||||
;; exposure control. (See the `allout-mode' docstring.)
|
||||
;;
|
||||
;;
|
||||
;; and many other features.
|
||||
;;
|
||||
;;
|
||||
;; The outline menubar additions provide quick reference to many of
|
||||
;; the features, and see the docstring of the function `allout-init'
|
||||
;; for instructions on priming your emacs session for automatic
|
||||
;; activation of `allout-mode'.
|
||||
;;
|
||||
;;
|
||||
;; See the docstring of the variables `allout-layout' and
|
||||
;; `allout-auto-activation' for details on automatic activation of
|
||||
;; 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
|
||||
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.
|
||||
|
||||
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
|
||||
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
|
||||
choices for rebulleting. They are not altered by the above automatic
|
||||
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
|
||||
can use `allout-mode-leaders' to override this behavior, when
|
||||
incorrect.]"
|
||||
:type '(choice (const t) (const nil) string
|
||||
:type '(choice (const t) (const nil) string
|
||||
(const allout-mode-leaders)
|
||||
(const comment-start))
|
||||
:group 'allout)
|
||||
@ -508,7 +508,7 @@ behavior."
|
||||
;;;_ : Version
|
||||
;;;_ = allout-version
|
||||
(defvar allout-version
|
||||
(let ((rcs-rev "$Revision: 1.37 $"))
|
||||
(let ((rcs-rev "$Revision: 1.38 $"))
|
||||
(condition-case err
|
||||
(save-match-data
|
||||
(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, numbered"
|
||||
allout-flatten-exposed-to-buffer t]
|
||||
allout-flatten-exposed-to-buffer t]
|
||||
["Duplicate Exposed, indented"
|
||||
allout-indented-exposed-to-buffer t]
|
||||
allout-indented-exposed-to-buffer t]
|
||||
"----"
|
||||
["Set Header Lead" allout-reset-header-lead t]
|
||||
["Set New Exposure" allout-expose-topic t])))
|
||||
@ -1006,7 +1006,7 @@ the following two lines in your emacs init file:
|
||||
((message
|
||||
"Outline mode auto-activation and -layout enabled.")
|
||||
'full)))))))
|
||||
|
||||
|
||||
;;;_ > allout-setup-menubar ()
|
||||
(defun allout-setup-menubar ()
|
||||
"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)
|
||||
(if (fboundp 'allout-real-isearch-abort)
|
||||
;;
|
||||
;;
|
||||
nil
|
||||
; Ensure load of isearch-mode:
|
||||
(if (or (and (fboundp 'isearch-mode)
|
||||
(fboundp 'isearch-abort))
|
||||
(condition-case error
|
||||
(condition-case error
|
||||
(load-library "isearch-mode")
|
||||
('file-error (message
|
||||
"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))))
|
||||
;; Isearch-mode loaded, encapsulate specific entry points for
|
||||
;; outline dynamic-exposure business:
|
||||
(progn
|
||||
(progn
|
||||
;; stash crucial isearch-mode funcs under known, private
|
||||
;; names, then register wrapper functions under the old
|
||||
;; names, in their stead:
|
||||
@ -4053,7 +4053,7 @@ and retains start position."
|
||||
|
||||
Optional arg CONTEXT indicates interior levels to include."
|
||||
(let ((delim ".")
|
||||
result
|
||||
result
|
||||
numstr
|
||||
(context-depth (or (and context 2) 1)))
|
||||
;; 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)
|
||||
"Convert list representing section/subsection/... to document string."
|
||||
(let ((delim ".")
|
||||
result
|
||||
result
|
||||
numstr)
|
||||
;; Take care of the explicit context:
|
||||
(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)
|
||||
body-content bop)
|
||||
; Do the head line:
|
||||
(insert (concat "\\OneHeadLine{\\verb\1 "
|
||||
(insert (concat "\\OneHeadLine{\\verb\1 "
|
||||
(allout-latex-verb-quote bullet)
|
||||
"\1}{"
|
||||
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
|
||||
`ansi-color-context-region' to nil if you don't want this."
|
||||
(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)))
|
||||
(end-marker (copy-marker end))
|
||||
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)
|
||||
"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 XEmacs, we create a temporary face and return it."
|
||||
|
@ -247,7 +247,7 @@ before finding a label."
|
||||
(concat "\\("
|
||||
(mapconcat 'identity words "\\|")
|
||||
"\\)" wild
|
||||
(if (cdr words)
|
||||
(if (cdr words)
|
||||
(concat "\\("
|
||||
(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)
|
||||
(setq score (+ score 50 (/ (* (- l s) 50) l)))))
|
||||
0))
|
||||
|
||||
|
||||
(defun apropos-score-symbol (symbol &optional weight)
|
||||
"Return apropos score for SYMBOL."
|
||||
(setq symbol (symbol-name symbol))
|
||||
@ -413,7 +413,7 @@ satisfy the predicate VAR-PREDICATE."
|
||||
(if (functionp symbol)
|
||||
(if (setq doc (documentation symbol t))
|
||||
(progn
|
||||
(setq score (+ score (apropos-score-doc doc)))
|
||||
(setq score (+ score (apropos-score-doc doc)))
|
||||
(substring doc 0 (string-match "\n" doc)))
|
||||
"(not documented)")))
|
||||
(and var-predicate
|
||||
@ -531,7 +531,7 @@ Returns list of symbols and values found."
|
||||
(if (apropos-false-hit-str p)
|
||||
(setq p nil))
|
||||
(if (or f v p)
|
||||
(setq apropos-accumulator (cons (list symbol
|
||||
(setq apropos-accumulator (cons (list symbol
|
||||
(+ (apropos-score-str f)
|
||||
(apropos-score-str v)
|
||||
(apropos-score-str p))
|
||||
@ -580,7 +580,7 @@ Returns list of symbols and documentation found."
|
||||
(setcar (nthcdr 2 apropos-item) v)
|
||||
(setcar apropos-item (+ (car apropos-item) sv)))))
|
||||
(setq apropos-accumulator
|
||||
(cons (list symbol
|
||||
(cons (list symbol
|
||||
(+ (apropos-score-symbol symbol 2) sf sv)
|
||||
f v)
|
||||
apropos-accumulator)))))))
|
||||
@ -665,7 +665,7 @@ Returns list of symbols and documentation found."
|
||||
(or (and (setq apropos-item (assq symbol apropos-accumulator))
|
||||
(setcar (cdr apropos-item)
|
||||
(+ (cadr apropos-item) (apropos-score-doc doc))))
|
||||
(setq apropos-item (list symbol
|
||||
(setq apropos-item (list symbol
|
||||
(+ (apropos-score-symbol symbol 2)
|
||||
(apropos-score-doc doc))
|
||||
nil nil)
|
||||
@ -755,7 +755,7 @@ Will return nil instead."
|
||||
(defun apropos-print (do-keys spacing)
|
||||
"Output result of apropos searching into buffer `*Apropos*'.
|
||||
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]).
|
||||
The return value is the list that was in `apropos-accumulator', sorted
|
||||
alphabetically by symbol name; but this function also sets
|
||||
|
@ -757,7 +757,7 @@ when parsing the archive."
|
||||
(apply
|
||||
(function concat)
|
||||
(mapcar
|
||||
(function
|
||||
(function
|
||||
(lambda (fil)
|
||||
;; Using `concat' here copies the text also, so we can add
|
||||
;; properties without problems.
|
||||
|
@ -58,7 +58,7 @@
|
||||
(defvar array-respect-tabs))
|
||||
|
||||
;;; Internal information functions.
|
||||
|
||||
|
||||
(defun array-cursor-in-array-range ()
|
||||
"Return t if the cursor is in a valid array cell.
|
||||
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))
|
||||
(move-to-column array-buffer-column)
|
||||
(setq count (1- count)))))
|
||||
|
||||
|
||||
(defun array-copy-to-column (a-column)
|
||||
"Copy current field horizontally into every cell up to and including A-COLUMN.
|
||||
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")
|
||||
|
||||
(html-mode . (lambda () (sgml-tag "html")))
|
||||
|
||||
|
||||
(plain-tex-mode . "tex-insert.tex")
|
||||
(bibtex-mode . "tex-insert.tex")
|
||||
(latex-mode
|
||||
@ -130,7 +130,7 @@ If this contains a %s, that will be replaced by the matching rule."
|
||||
lambda ()
|
||||
(if (eq major-mode default-major-mode)
|
||||
(sh-mode)))
|
||||
|
||||
|
||||
(ada-mode . ada-header)
|
||||
|
||||
(("\\.[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
|
||||
;; file in which it appears; this does nothing when evaluated, and when loaded
|
||||
;; from a .el file.
|
||||
;;
|
||||
;;
|
||||
;; Each argument to this macro must be a list of a key and a value.
|
||||
;;
|
||||
;;
|
||||
;; Keys: Values: Corresponding variable:
|
||||
;;
|
||||
;;
|
||||
;; verbose t, nil byte-compile-verbose
|
||||
;; optimize t, nil, source, byte byte-compile-optimize
|
||||
;; warnings list of warnings byte-compile-warnings
|
||||
;; Legal elements: (callargs redefine free-vars unresolved)
|
||||
;; file-format emacs18, emacs19 byte-compile-compatibility
|
||||
;;
|
||||
;;
|
||||
;; For example, this might appear at the top of a source file:
|
||||
;;
|
||||
;;
|
||||
;; (byte-compiler-options
|
||||
;; (optimize t)
|
||||
;; (warnings (- free-vars)) ; Don't warn about free variables
|
||||
|
@ -47,19 +47,19 @@
|
||||
;; character to the scheme process. Cmuscheme mode does *not* provide this
|
||||
;; functionality. If you are a cscheme user, you may prefer to use the
|
||||
;; xscheme.el/cscheme -emacs interaction.
|
||||
;;
|
||||
;;
|
||||
;; Here's a summary of the pros and cons, as I see them.
|
||||
;; xscheme: Tightly integrated with inferior cscheme process! A few commands
|
||||
;; not in cmuscheme. But. Integration is a bit of a hack. Input
|
||||
;; history only keeps the immediately prior input. Bizarre
|
||||
;; keybindings.
|
||||
;;
|
||||
;;
|
||||
;; cmuscheme: Not tightly integrated with inferior cscheme process. But.
|
||||
;; Carefully integrated functionality with the entire suite of
|
||||
;; comint-derived CMU process modes. Keybindings reminiscent of
|
||||
;; Zwei and Hemlock. Good input history. A few commands not in
|
||||
;; xscheme.
|
||||
;;
|
||||
;;
|
||||
;; 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*
|
||||
;; 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."
|
||||
:type 'hook
|
||||
:group 'cmuscheme)
|
||||
|
||||
|
||||
(run-hooks 'cmuscheme-load-hook)
|
||||
|
||||
(provide 'cmuscheme)
|
||||
|
@ -37,36 +37,36 @@
|
||||
;;
|
||||
;; 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
|
||||
;; 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
|
||||
;; through all the words it knows about.
|
||||
;;
|
||||
;; 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.
|
||||
;;
|
||||
;; 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"
|
||||
;; the word. So does moving a cursor over the word. If no words are found,
|
||||
;; 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,
|
||||
;; it uses an extended version of the dabbrev style completion.
|
||||
;;
|
||||
;; You automatically save the completions you use to a file between
|
||||
;; sessions.
|
||||
;; You automatically save the completions you use to a file between
|
||||
;; 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.
|
||||
;;
|
||||
;;
|
||||
;; 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.]
|
||||
;; 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
|
||||
@ -82,27 +82,27 @@
|
||||
;; Completions are automatically saved from one session to another
|
||||
;; (unless save-completions-flag or enable-completion is nil).
|
||||
;; 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
|
||||
;; completions that you
|
||||
;; completions that you
|
||||
;; often use. When you next start, EMACS loads in the saved completion file.
|
||||
;;
|
||||
;; The number of completions saved depends loosely on
|
||||
;; *saved-completions-decay-factor*. Completions that have never been
|
||||
;; The number of completions saved depends loosely on
|
||||
;; *saved-completions-decay-factor*. Completions that have never been
|
||||
;; inserted via "complete" are not saved. You are encouraged to experiment
|
||||
;; with different functions (see compute-completion-min-num-uses).
|
||||
;;
|
||||
;; Some completions are permanent and are always saved out. These
|
||||
;; completions have their num-uses slot set to T. Use
|
||||
;; Some completions are permanent and are always saved out. These
|
||||
;; completions have their num-uses slot set to T. Use
|
||||
;; add-permanent-completion to do this
|
||||
;;
|
||||
;; 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.
|
||||
;;
|
||||
;; COMPLETE KEY OPTIONS
|
||||
;; The complete function takes a numeric arguments.
|
||||
;; control-u :: leave the point at the beginning of the completion rather
|
||||
;; The complete function takes a numeric arguments.
|
||||
;; control-u :: leave the point at the beginning of the completion rather
|
||||
;; than the middle.
|
||||
;; a number :: rotate through the possible completions by that amount
|
||||
;; `-' :: same as -1 (insert previous completion)
|
||||
@ -111,17 +111,17 @@
|
||||
;; <write>
|
||||
;;
|
||||
;; UPDATING THE DATABASE MANUALLY
|
||||
;; m-x kill-completion
|
||||
;; m-x kill-completion
|
||||
;; kills the completion at point.
|
||||
;; m-x add-completion
|
||||
;; m-x add-permanent-completion
|
||||
;;
|
||||
;;
|
||||
;; UPDATING THE DATABASE FROM A SOURCE CODE FILE
|
||||
;; m-x add-completions-from-buffer
|
||||
;; Parses all the definition names from a C or LISP mode buffer and
|
||||
;; 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
|
||||
;; adds them to the completion database.
|
||||
;;
|
||||
@ -133,16 +133,16 @@
|
||||
;; <write>
|
||||
;;
|
||||
;; 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
|
||||
;; entry is coerced appropriately.
|
||||
;; [E.G. APP --> APPROPRIATELY app --> appropriately
|
||||
;; entry is coerced appropriately.
|
||||
;; [E.G. APP --> APPROPRIATELY app --> appropriately
|
||||
;; App --> Appropriately]
|
||||
;;
|
||||
;; INITIALIZATION
|
||||
;; The form `(initialize-completions)' initializes the completion system by
|
||||
;; 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
|
||||
;; The form `(initialize-completions)' initializes the completion system by
|
||||
;; 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
|
||||
;; site's standard site-init file.
|
||||
;;
|
||||
;;---------------------------------------------------------------------------
|
||||
@ -180,10 +180,10 @@
|
||||
;; Inserts a completion at point
|
||||
;;
|
||||
;; 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-completions-to-file &optional filename
|
||||
;; save-completions-to-file &optional filename
|
||||
;; load-completions-from-file &optional filename
|
||||
;;
|
||||
;;-----------------------------------------------
|
||||
@ -194,11 +194,11 @@
|
||||
;;
|
||||
;; These things are for manipulating the structure
|
||||
;; make-completion string num-uses
|
||||
;; completion-num-uses completion
|
||||
;; completion-num-uses completion
|
||||
;; completion-string completion
|
||||
;; set-completion-num-uses completion num-uses
|
||||
;; set-completion-string completion string
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
|
||||
;;-----------------------------------------------
|
||||
@ -215,16 +215,16 @@
|
||||
;;-----------------------------------------------
|
||||
;;; Change Log:
|
||||
;;-----------------------------------------------
|
||||
;; Sometime in '84 Brewster implemented a somewhat buggy version for
|
||||
;; Sometime in '84 Brewster implemented a somewhat buggy version for
|
||||
;; 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.
|
||||
;; With input from many users at TMC, (rose, craig, and gls come to mind),
|
||||
;; the current style of interface was developed.
|
||||
;; 9/87, Jim and Brewster took terminals home. Yuck. After
|
||||
;; complaining for a while Brewster implemented a subset of the current
|
||||
;; LISPM version for GNU Emacs.
|
||||
;; 8/88 After complaining for a while (and with sufficient
|
||||
;; the current style of interface was developed.
|
||||
;; 9/87, Jim and Brewster took terminals home. Yuck. After
|
||||
;; complaining for a while Brewster implemented a subset of the current
|
||||
;; LISPM version for GNU Emacs.
|
||||
;; 8/88 After complaining for a while (and with sufficient
|
||||
;; promised rewards), Jim reimplemented a version of GNU completion
|
||||
;; superior to that of the LISPM version.
|
||||
;;
|
||||
@ -269,7 +269,7 @@
|
||||
;; - minor fix to capitalization code
|
||||
;; - added *completion-auto-save-period* to variables recorded.
|
||||
;; - 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)
|
||||
|
||||
;;; Code:
|
||||
@ -375,7 +375,7 @@ DON'T CHANGE WITHOUT RECOMPILING ! This is used by macros.")
|
||||
(setq completion-prefix-min-length 3)))
|
||||
|
||||
(completion-eval-when)
|
||||
|
||||
|
||||
;;---------------------------------------------------------------------------
|
||||
;; Internal Variables
|
||||
;;---------------------------------------------------------------------------
|
||||
@ -476,17 +476,17 @@ Used to decide whether to save completions.")
|
||||
;; of syntax in these "symbol" syntax tables ::
|
||||
;;
|
||||
;; 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
|
||||
;;
|
||||
;; 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" ?
|
||||
;; 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,
|
||||
;; 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
|
||||
;; probably used as a period.
|
||||
|
||||
@ -503,7 +503,7 @@ Used to decide whether to save completions.")
|
||||
;; C diffs ->
|
||||
;; Separator chars :: + * / : %
|
||||
;; 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
|
||||
;; concerned.
|
||||
;;
|
||||
@ -556,7 +556,7 @@ Used to decide whether to save completions.")
|
||||
(dolist (char symbol-chars)
|
||||
(modify-syntax-entry char "_" table))
|
||||
table))
|
||||
|
||||
|
||||
(defun cmpl-make-c-completion-syntax-table ()
|
||||
(let ((table (copy-syntax-table cmpl-standard-syntax-table))
|
||||
(separator-chars '(?+ ?* ?/ ?: ?%)))
|
||||
@ -598,9 +598,9 @@ But only if it is longer than `completion-min-length'."
|
||||
(unwind-protect
|
||||
(progn
|
||||
(set-syntax-table cmpl-syntax-table)
|
||||
(cond
|
||||
(cond
|
||||
;; 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)
|
||||
cmpl-symbol-start (scan-sexps (1+ 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 ()
|
||||
"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 !
|
||||
(setq cmpl-saved-syntax (syntax-table))
|
||||
(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."
|
||||
;; (list 'cond
|
||||
;; (list* '*record-cmpl-statistics-p* body)
|
||||
;; ))
|
||||
;; ))
|
||||
|
||||
;;-----------------------------------------------
|
||||
;; Completion Sources
|
||||
@ -797,7 +797,7 @@ Returns nil if there isn't one longer than `completion-min-length'."
|
||||
;; 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 :
|
||||
;; 1) Faster (we don't use regexps)
|
||||
;; 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
|
||||
;; Bug: won't pick up an expansion that starts at the top of buffer
|
||||
(if cdabbrev-current-window
|
||||
(let (saved-point
|
||||
(let (saved-point
|
||||
saved-syntax
|
||||
(expansion nil)
|
||||
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
|
||||
;; 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.
|
||||
|
||||
;; READER MACROS
|
||||
@ -1013,7 +1013,7 @@ Each symbol is bound to a single completion entry.")
|
||||
(list 'car 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."
|
||||
(list 'car (list 'cdr completion-entry)))
|
||||
|
||||
@ -1291,7 +1291,7 @@ Returns the completion entry."
|
||||
(note-added-completion))
|
||||
;; Add it to the symbol
|
||||
(set cmpl-db-symbol (car entry)))))
|
||||
|
||||
|
||||
(defun delete-completion (completion-string)
|
||||
"Delete the completion from the database.
|
||||
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 (setq cmpl-db-entry (find-exact-completion completion-string))
|
||||
;; found
|
||||
(let* ((prefix-entry (find-cmpl-prefix-entry
|
||||
(let* ((prefix-entry (find-cmpl-prefix-entry
|
||||
(substring cmpl-db-downcase-string 0
|
||||
(cmpl-read-time-eval
|
||||
completion-prefix-min-length))))
|
||||
@ -1339,16 +1339,16 @@ String must be longer than `completion-prefix-min-length'."
|
||||
;;
|
||||
;; - Deleting -
|
||||
;; (add-completion-to-head "banner") --> ("banner" 0 nil 0)
|
||||
;; (delete-completion "banner")
|
||||
;; (delete-completion "banner")
|
||||
;; (find-exact-completion "banner") --> nil
|
||||
;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...))
|
||||
;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...))
|
||||
;; (add-completion-to-head "banner") --> ("banner" 0 nil 0)
|
||||
;; (delete-completion "banana")
|
||||
;; (add-completion-to-head "banner") --> ("banner" 0 nil 0)
|
||||
;; (delete-completion "banana")
|
||||
;; (car (find-cmpl-prefix-entry "ban")) --> (("banner" ...) ("banish" ...))
|
||||
;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...))
|
||||
;; (delete-completion "banner")
|
||||
;; (delete-completion "banish")
|
||||
;; (delete-completion "banner")
|
||||
;; (delete-completion "banish")
|
||||
;; (find-cmpl-prefix-entry "ban") --> nil
|
||||
;; (delete-completion "banner") --> error
|
||||
;;
|
||||
@ -1365,7 +1365,7 @@ String must be longer than `completion-prefix-min-length'."
|
||||
;;---------------------------------------------------------------------------
|
||||
;; Database Update :: Interface level routines
|
||||
;;---------------------------------------------------------------------------
|
||||
;;
|
||||
;;
|
||||
;; These lie on top of the database ref. functions but below the standard
|
||||
;; 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)
|
||||
"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."
|
||||
(interactive (interactive-completion-string-reader "Completion to add"))
|
||||
(check-completion-length string)
|
||||
@ -1396,7 +1396,7 @@ specified."
|
||||
cmpl-source-interactive
|
||||
current-completion-source))
|
||||
(entry (add-completion-to-head string)))
|
||||
|
||||
|
||||
(if num-uses (set-completion-num-uses entry num-uses))
|
||||
(if last-use-time
|
||||
(set-completion-last-use-time entry last-use-time))))
|
||||
@ -1417,7 +1417,7 @@ specified."
|
||||
|
||||
(defun accept-completion ()
|
||||
"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'."
|
||||
(let ((string completion-to-accept)
|
||||
;; 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)))
|
||||
(current-completion-source cmpl-source-cursor-moves))
|
||||
(if string (add-completion-to-head string))))
|
||||
|
||||
|
||||
(defun use-completion-before-point ()
|
||||
"Add the completion symbol before point into the completion buffer."
|
||||
(let ((string (and enable-completion (symbol-before-point)))
|
||||
@ -1465,25 +1465,25 @@ Completions added this way will automatically be saved if
|
||||
|
||||
;; Tests --
|
||||
;; - Add and Find -
|
||||
;; (add-completion "banana" 5 10)
|
||||
;; (add-completion "banana" 5 10)
|
||||
;; (find-exact-completion "banana") --> ("banana" 5 10 0)
|
||||
;; (add-completion "banana" 6)
|
||||
;; (add-completion "banana" 6)
|
||||
;; (find-exact-completion "banana") --> ("banana" 6 10 0)
|
||||
;; (add-completion "banish")
|
||||
;; (car (find-cmpl-prefix-entry "ban")) --> (("banish" ...) ("banana" ...))
|
||||
;;
|
||||
;; - Accepting -
|
||||
;; (setq completion-to-accept "banana")
|
||||
;; (accept-completion)
|
||||
;; (accept-completion)
|
||||
;; (find-exact-completion "banana") --> ("banana" 7 10)
|
||||
;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...))
|
||||
;; (setq completion-to-accept "banish")
|
||||
;; (add-completion "banner")
|
||||
;; (add-completion "banner")
|
||||
;; (car (find-cmpl-prefix-entry "ban"))
|
||||
;; --> (("banner" ...) ("banish" 1 ...) ("banana" 7 ...))
|
||||
;;
|
||||
;; - Deleting -
|
||||
;; (kill-completion "banish")
|
||||
;; (kill-completion "banish")
|
||||
;; (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 "")
|
||||
;; "The current string used by completion-search-next."
|
||||
(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)"
|
||||
(defvar cmpl-last-index 0)
|
||||
;; "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))
|
||||
;; If no more possibilities, leave it that way
|
||||
((= -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
|
||||
(setq cmpl-next-possibilities cmpl-starting-possibilities))
|
||||
(t
|
||||
@ -1574,11 +1574,11 @@ If there are no more entries, try cdabbrev and returns only a string."
|
||||
(prog1
|
||||
cmpl-next-possibility
|
||||
(setq cmpl-next-possibility nil)))
|
||||
|
||||
|
||||
|
||||
(defun completion-search-peek (use-cdabbrev)
|
||||
"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'.
|
||||
If there are no more entries, try cdabbrev and then return only a string."
|
||||
(cond
|
||||
@ -1609,14 +1609,14 @@ If there are no more entries, try cdabbrev and then return only a string."
|
||||
|
||||
;; Tests --
|
||||
;; - Add and Find -
|
||||
;; (add-completion "banana")
|
||||
;; (completion-search-reset "ban")
|
||||
;; (add-completion "banana")
|
||||
;; (completion-search-reset "ban")
|
||||
;; (completion-search-next 0) --> "banana"
|
||||
;;
|
||||
;; - Discrimination -
|
||||
;; (add-completion "cumberland")
|
||||
;; (add-completion "cumberbund")
|
||||
;; cumbering
|
||||
;; (add-completion "cumberland")
|
||||
;; (add-completion "cumberbund")
|
||||
;; cumbering
|
||||
;; (completion-search-reset "cumb")
|
||||
;; (completion-search-peek t) --> "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 -
|
||||
;; (kill-completion "cumberland")
|
||||
;; cummings
|
||||
;; cummings
|
||||
;; (completion-search-reset "cum")
|
||||
;; (completion-search-next 0) --> "cumberbund"
|
||||
;; (completion-search-next 1) --> "cummings"
|
||||
@ -1657,17 +1657,17 @@ If there are no more entries, try cdabbrev and then return only a string."
|
||||
(interactive)
|
||||
(setq enable-completion (not enable-completion))
|
||||
(message "Completion mode is now %s." (if enable-completion "ON" "OFF")))
|
||||
|
||||
|
||||
(defvar cmpl-current-index 0)
|
||||
(defvar cmpl-original-string nil)
|
||||
(defvar cmpl-last-insert-location -1)
|
||||
(defvar cmpl-leave-point-at-start nil)
|
||||
|
||||
(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.
|
||||
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.
|
||||
a number :: rotate through the possible completions by that amount
|
||||
`-' :: same as -1 (insert previous completion)
|
||||
@ -1693,7 +1693,7 @@ Prefix args ::
|
||||
(setq this-command 'failed-complete)
|
||||
(error "To complete, point must be after a symbol at least %d character long"
|
||||
completion-prefix-min-length)))
|
||||
;; get index
|
||||
;; get index
|
||||
(setq cmpl-current-index (if current-prefix-arg arg 0))
|
||||
;; statistics
|
||||
(cmpl-statistics-block
|
||||
@ -1748,7 +1748,7 @@ Prefix args ::
|
||||
(setq string (cmpl-merge-string-cases
|
||||
string cmpl-original-string))
|
||||
(message "Next completion: %s" string))))
|
||||
(t;; none found, insert old
|
||||
(t;; none found, insert old
|
||||
(insert cmpl-original-string)
|
||||
;; Don't accept completions
|
||||
(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(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.
|
||||
(defun add-completions-from-lisp-buffer ()
|
||||
;;; 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* "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.
|
||||
(defun add-completions-from-c-buffer ()
|
||||
;; Benchmark --
|
||||
@ -2089,7 +2089,7 @@ If file name is not specified, use `save-completions-file-name'."
|
||||
(total-perm 0)
|
||||
(total-saved 0)
|
||||
(backup-filename (completion-backup-filename filename)))
|
||||
|
||||
|
||||
(save-excursion
|
||||
(get-buffer-create " *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))
|
||||
(insert (prin1-to-string (cons (completion-string completion)
|
||||
last-use-time)) "\n"))))
|
||||
|
||||
|
||||
;; write the buffer
|
||||
(condition-case e
|
||||
(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 . . .
|
||||
;; 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!)
|
||||
|
||||
|
||||
;; If backup doesn't exit, Rename current to backup
|
||||
;; {If backup exists the primary file is probably messed up}
|
||||
(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
|
||||
(clear-visited-file-modtime)
|
||||
(erase-buffer)
|
||||
|
||||
|
||||
(let ((insert-okay-p nil)
|
||||
(buffer (current-buffer))
|
||||
(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)
|
||||
(setq insert-okay-p t))
|
||||
|
||||
(file-error
|
||||
(file-error
|
||||
(message "File error trying to load completion file %s."
|
||||
filename)))
|
||||
;; parse it
|
||||
;; parse it
|
||||
(if insert-okay-p
|
||||
(progn
|
||||
(goto-char (point-min))
|
||||
@ -2234,7 +2234,7 @@ If file is not specified, then use `save-completions-file-name'."
|
||||
(completion-last-use-time
|
||||
(setq cmpl-entry
|
||||
(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
|
||||
(not (eq cmpl-last-use-time t))
|
||||
(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
|
||||
to make one entry in the kill ring.
|
||||
Patched to remove the most recent completion."
|
||||
(interactive "r")
|
||||
(interactive "r")
|
||||
(cond ((eq last-command 'complete)
|
||||
(delete-region (point) cmpl-last-insert-location)
|
||||
(insert cmpl-original-string)
|
||||
@ -2311,7 +2311,7 @@ Patched to remove the most recent completion."
|
||||
;; All common separators (eg. space "(" ")" """) characters go through a
|
||||
;; function to add new words to the list of words to complete from:
|
||||
;; 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).
|
||||
|
||||
(defun completion-separator-self-insert-command (arg)
|
||||
@ -2330,7 +2330,7 @@ Patched to remove the most recent completion."
|
||||
;; 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.
|
||||
|
||||
(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))
|
||||
|
||||
;;; Enable completion mode.
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun dynamic-completion-mode ()
|
||||
"Enable dynamic word-completion."
|
||||
@ -2522,8 +2522,8 @@ TYPE is the type of the wrapper to be added. Can be :before or :under."
|
||||
|
||||
;; Tests --
|
||||
;; foobarbiz
|
||||
;; foobar
|
||||
;; fooquux
|
||||
;; foobar
|
||||
;; fooquux
|
||||
;; fooper
|
||||
|
||||
(cmpl-statistics-block
|
||||
|
@ -95,7 +95,7 @@ follows (the point `*' corresponds to both reference points):
|
||||
(or (integerp nref)
|
||||
(setq nref (cdr (assq nref reference-point-alist))))
|
||||
(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))))
|
||||
|
||||
;; 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
|
||||
(save-match-data
|
||||
(save-excursion
|
||||
(while (and tail (not func))
|
||||
(while (and tail (not func))
|
||||
(setq pattern (car (car tail))
|
||||
func (cdr (car tail)))
|
||||
(goto-char pos)
|
||||
|
@ -92,7 +92,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
|
||||
(when members
|
||||
;; So x and no-x builds won't differ.
|
||||
(setq members
|
||||
(sort (copy-sequence members)
|
||||
(sort (copy-sequence members)
|
||||
(lambda (x y) (string< (car x) (car y)))))
|
||||
(while 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))
|
||||
(if found
|
||||
(insert " ")
|
||||
(insert "(put '" (symbol-name symbol)
|
||||
(insert "(put '" (symbol-name symbol)
|
||||
" 'custom-loads '("))
|
||||
(prin1 where (current-buffer))
|
||||
(push where found)))
|
||||
@ -110,7 +110,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
|
||||
(insert "))\n"))))))
|
||||
(insert "\
|
||||
;;; 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
|
||||
;;; `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)
|
||||
(let ((version (get symbol 'custom-version))
|
||||
where)
|
||||
(when version
|
||||
(when version
|
||||
(setq where (get symbol 'custom-where))
|
||||
(when where
|
||||
(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.
|
||||
(progn
|
||||
(if (assoc version version-alist)
|
||||
(unless
|
||||
(member where
|
||||
(unless
|
||||
(member where
|
||||
(cdr (assoc version version-alist)))
|
||||
(push where (cdr (assoc version version-alist))))
|
||||
(push (cons version (list where)) version-alist)))
|
||||
;; This is a group
|
||||
(insert "(custom-put-if-not '" (symbol-name symbol)
|
||||
(insert "(custom-put-if-not '" (symbol-name symbol)
|
||||
" 'custom-version ")
|
||||
(prin1 version (current-buffer))
|
||||
(insert ")\n")
|
||||
@ -169,7 +169,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
|
||||
(if version-alist "'" ""))
|
||||
(prin1 version-alist (current-buffer))
|
||||
(insert "\n \"For internal use by custom.\")\n"))
|
||||
|
||||
|
||||
(insert "\
|
||||
|
||||
\(provide '" (file-name-sans-extension
|
||||
|
@ -86,7 +86,7 @@
|
||||
(const :tag "ultracondensed" ultra-condensed)
|
||||
(const :tag "ultraexpanded" ultra-expanded)
|
||||
(const :tag "wide" extra-expanded)))
|
||||
|
||||
|
||||
(:height
|
||||
(choice :tag "Height"
|
||||
:help-echo "Face's font height."
|
||||
@ -113,7 +113,7 @@
|
||||
(const :tag "semilight" semi-light)
|
||||
(const :tag "ultralight" ultra-light)
|
||||
(const :tag "ultrabold" ultra-bold)))
|
||||
|
||||
|
||||
(:slant
|
||||
(choice :tag "Slant"
|
||||
:help-echo "Font slant."
|
||||
@ -121,28 +121,28 @@
|
||||
(const :tag "italic" italic)
|
||||
(const :tag "oblique" oblique)
|
||||
(const :tag "normal" normal)))
|
||||
|
||||
|
||||
(:underline
|
||||
(choice :tag "Underline"
|
||||
:help-echo "Control text underlining."
|
||||
(const :tag "Off" nil)
|
||||
(const :tag "On" t)
|
||||
(color :tag "Colored")))
|
||||
|
||||
|
||||
(:overline
|
||||
(choice :tag "Overline"
|
||||
:help-echo "Control text overlining."
|
||||
(const :tag "Off" nil)
|
||||
(const :tag "On" t)
|
||||
(color :tag "Colored")))
|
||||
|
||||
|
||||
(:strike-through
|
||||
(choice :tag "Strike-through"
|
||||
:help-echo "Control text strike-through."
|
||||
(const :tag "Off" nil)
|
||||
(const :tag "On" t)
|
||||
(color :tag "Colored")))
|
||||
|
||||
|
||||
(:box
|
||||
;; Fixme: this can probably be done better.
|
||||
(choice :tag "Box around text"
|
||||
@ -190,21 +190,21 @@
|
||||
(nconc (and lwidth `(:line-width ,lwidth))
|
||||
(and color `(:color ,color))
|
||||
(and style `(:style ,style)))))))))
|
||||
|
||||
|
||||
(:inverse-video
|
||||
(choice :tag "Inverse-video"
|
||||
:help-echo "Control whether text should be in inverse-video."
|
||||
(const :tag "Off" nil)
|
||||
(const :tag "On" t)))
|
||||
|
||||
|
||||
(:foreground
|
||||
(color :tag "Foreground"
|
||||
:help-echo "Set foreground color."))
|
||||
|
||||
|
||||
(:background
|
||||
(color :tag "Background"
|
||||
:help-echo "Set background color."))
|
||||
|
||||
|
||||
(:stipple
|
||||
(choice :tag "Stipple"
|
||||
:help-echo "Background bit-mask"
|
||||
@ -230,7 +230,7 @@
|
||||
(if (and (consp cus-value) (null (cdr cus-value)))
|
||||
(car cus-value)
|
||||
cus-value))))
|
||||
|
||||
|
||||
"Alist of face attributes.
|
||||
|
||||
The elements are of the form (KEY TYPE PRE-FILTER POST-FILTER),
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
(let ((all '(;; abbrev.c
|
||||
(let ((all '(;; abbrev.c
|
||||
(abbrev-all-caps abbrev-mode boolean)
|
||||
(pre-abbrev-expand-hook abbrev-mode hook)
|
||||
;; alloc.c
|
||||
@ -88,7 +88,7 @@
|
||||
(function :value ignore))))
|
||||
(selection-coding-system mule coding-system)
|
||||
;; dired.c
|
||||
(completion-ignored-extensions dired
|
||||
(completion-ignored-extensions dired
|
||||
(repeat (string :format "%v")))
|
||||
;; dispnew.c
|
||||
(baud-rate display integer)
|
||||
@ -106,7 +106,7 @@
|
||||
:value (nil)
|
||||
(symbol :format "%v"))
|
||||
(const :tag "always" t)))
|
||||
(debug-on-error debug
|
||||
(debug-on-error debug
|
||||
(choice (const :tag "off")
|
||||
(repeat :menu-tag "When"
|
||||
:value (nil)
|
||||
@ -155,7 +155,7 @@
|
||||
;; version-specific directories when you upgrade. We need
|
||||
;; customization of the front of the list, maintaining the standard
|
||||
;; value intact at the back.
|
||||
;;; (load-path environment
|
||||
;;; (load-path environment
|
||||
;;; (repeat (choice :tag "[Current dir?]"
|
||||
;;; :format "%[Current dir?%] %v"
|
||||
;;; (const :tag " current dir" nil)
|
||||
@ -205,8 +205,8 @@
|
||||
(display-buffer-function windows (choice (const nil) function))
|
||||
(pop-up-frames frames boolean)
|
||||
(pop-up-frame-function frames function)
|
||||
(special-display-buffer-names
|
||||
frames
|
||||
(special-display-buffer-names
|
||||
frames
|
||||
(repeat (choice :tag "Buffer"
|
||||
:value ""
|
||||
(string :format "%v")
|
||||
@ -219,7 +219,7 @@
|
||||
(symbol :tag "Parameter")
|
||||
(sexp :tag "Value")))))))
|
||||
(special-display-regexps
|
||||
frames
|
||||
frames
|
||||
(repeat (choice :tag "Buffer"
|
||||
:value ""
|
||||
(regexp :format "%v")
|
||||
@ -283,7 +283,7 @@
|
||||
(numberp sexp))
|
||||
sexp
|
||||
(list 'quote sexp)))))
|
||||
(while all
|
||||
(while all
|
||||
(setq this (car all)
|
||||
all (cdr all)
|
||||
symbol (nth 0 this)
|
||||
@ -307,7 +307,7 @@
|
||||
(message "Note, built-in variable `%S' not bound" symbol))
|
||||
;; Save the standard value, unless we already did.
|
||||
(or (get symbol 'standard-value)
|
||||
(put symbol 'standard-value
|
||||
(put symbol 'standard-value
|
||||
(list (funcall quoter (default-value symbol)))))
|
||||
;; If this is NOT while dumping Emacs,
|
||||
;; 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))
|
||||
(widget-insert "\n\nDocumentation:\n")
|
||||
(setq custom-theme-description
|
||||
(widget-create 'text
|
||||
(widget-create 'text
|
||||
:value (format-time-string "Created %Y-%m-%d.")))
|
||||
(widget-insert "\nVariables:\n\n")
|
||||
(setq custom-theme-variables
|
||||
|
@ -191,27 +191,27 @@ The following keywords are meaningful:
|
||||
Include an external link after the documentation string for this
|
||||
item. This is a sentence containing an active field which
|
||||
references some other documentation.
|
||||
|
||||
|
||||
There are three alternatives you can use for LINK-DATA:
|
||||
|
||||
|
||||
(custom-manual INFO-NODE)
|
||||
Link to an Info node; INFO-NODE is a string which specifies
|
||||
the node name, as in \"(emacs)Top\". The link appears as
|
||||
`[manual]' in the customization buffer.
|
||||
|
||||
|
||||
(info-link INFO-NODE)
|
||||
Like `custom-manual' except that the link appears in the
|
||||
customization buffer with the Info node name.
|
||||
|
||||
|
||||
(url-link URL)
|
||||
Link to a web page; URL is a string which specifies the URL.
|
||||
The link appears in the customization buffer as URL.
|
||||
|
||||
|
||||
You can specify the text to use in the customization buffer by
|
||||
adding `:tag NAME' after the first element of the LINK-DATA; for
|
||||
example, (info-link :tag \"foo\" \"(emacs)Top\") makes a link to the
|
||||
Emacs manual which appears in the buffer as `foo'.
|
||||
|
||||
|
||||
An item can have more than one external link; however, most items
|
||||
have none at all.
|
||||
:initialize
|
||||
@ -772,7 +772,7 @@ in SYMBOL's list property `theme-value' \(using `custom-push-theme')."
|
||||
((default-boundp symbol)
|
||||
;; Something already set this, overwrite it.
|
||||
(funcall set symbol (eval value))))
|
||||
(error
|
||||
(error
|
||||
(message "Error setting %s: %s" symbol data)))
|
||||
(setq args (cdr args))
|
||||
(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)
|
||||
"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
|
||||
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)
|
||||
"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
|
||||
`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.
|
||||
|
||||
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))))
|
||||
;; Mark default value as set iff different from old value.
|
||||
(if (or (null old)
|
||||
(not (equal value (condition-case nil
|
||||
(not (equal value (condition-case nil
|
||||
(eval (car old))
|
||||
(error nil)))))
|
||||
(put symbol 'customized-value (list (custom-quote value)))
|
||||
|
@ -86,7 +86,7 @@
|
||||
(1 font-lock-function-name-face)))))
|
||||
(defconst cvs-status-font-lock-defaults
|
||||
'(cvs-status-font-lock-keywords t nil nil nil (font-lock-multiline . t)))
|
||||
|
||||
|
||||
|
||||
(put 'cvs-status-mode 'mode-class 'special)
|
||||
;;;###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,
|
||||
if several nodes where merged into one.
|
||||
The tree will be printed no closer than column COLUMN."
|
||||
|
||||
|
||||
(let* ((eol (save-excursion (end-of-line) (current-column)))
|
||||
(column (max (+ eol 2) column)))
|
||||
(if (null tags) column
|
||||
@ -487,9 +487,9 @@ Optional prefix ARG chooses between two representations."
|
||||
(setq pe eq)))
|
||||
(nreverse nas))))
|
||||
|
||||
;;;;
|
||||
;;;;
|
||||
;;;; Merged trees from different files
|
||||
;;;;
|
||||
;;;;
|
||||
|
||||
(defun cvs-tree-fuzzy-merge-1 (trees tree prev)
|
||||
)
|
||||
@ -509,7 +509,7 @@ Optional prefix ARG chooses between two representations."
|
||||
(erase-buffer)
|
||||
(let ((cvs-tag-print-rev nil))
|
||||
(cvs-tree-print tree 'cvs-tag->string 3)))))
|
||||
|
||||
|
||||
|
||||
(provide 'cvs-status)
|
||||
|
||||
|
@ -751,7 +751,7 @@ DIRECTION = 0 means try both backward and forward.
|
||||
IGNORE-CASE non-nil means ignore case when searching.
|
||||
This sets `dabbrev--last-direction' to 1 or -1 according
|
||||
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."
|
||||
(save-excursion
|
||||
;; 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,
|
||||
;; in order to do likewise for subsequent words.
|
||||
(and record-case-pattern
|
||||
(setq dabbrev--last-case-pattern
|
||||
(setq dabbrev--last-case-pattern
|
||||
(and use-case-replace
|
||||
(cond ((equal abbrev (upcase abbrev)) 'upcase)
|
||||
((equal abbrev (downcase abbrev)) 'downcase)))))
|
||||
|
@ -35,12 +35,12 @@
|
||||
(delete-window)
|
||||
(bury-buffer)))
|
||||
|
||||
(defvar describe-text-mode-map
|
||||
(defvar describe-text-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map widget-keymap)
|
||||
map)
|
||||
"Keymap for `describe-text-mode'.")
|
||||
|
||||
|
||||
(defcustom describe-text-mode-hook nil
|
||||
"List of hook functions ran by `describe-text-mode'."
|
||||
:type 'hook
|
||||
@ -67,7 +67,7 @@ if that value is non-nil."
|
||||
(widget-create 'link
|
||||
:notify `(lambda (&rest ignore)
|
||||
(widget-browse ',widget))
|
||||
(format "%S" (if (symbolp widget)
|
||||
(format "%S" (if (symbolp widget)
|
||||
widget
|
||||
(car widget))))
|
||||
(widget-insert " ")
|
||||
@ -197,7 +197,7 @@ otherwise."
|
||||
;; Buttons
|
||||
(when (and button (not (widgetp wid-button)))
|
||||
(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"))
|
||||
;; Overlays
|
||||
(when overlays
|
||||
@ -207,7 +207,7 @@ otherwise."
|
||||
(widget-insert "There are " (format "%d" (length overlays))
|
||||
" overlays here:\n"))
|
||||
(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")
|
||||
(describe-property-list (overlay-properties overlay)))
|
||||
(widget-insert "\n"))
|
||||
@ -336,7 +336,7 @@ as well as widgets, buttons, overlays, and text properties."
|
||||
(t (concat (substring composed 0 (- pos (car composition)))
|
||||
"' and `"
|
||||
(substring composed (- (1+ pos) (car composition))))))
|
||||
|
||||
|
||||
"' to form `" composed "'")
|
||||
(if (nth 3 composition)
|
||||
(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")
|
||||
;; Fix the original hunk-header.
|
||||
(diff-fixup-modifs start pos))))
|
||||
|
||||
|
||||
|
||||
;;;;
|
||||
;;;; jump to other buffers
|
||||
@ -519,9 +519,9 @@ Non-nil OLD means that we want the old file."
|
||||
(ediff-patch-file nil (current-buffer))
|
||||
(wrong-number-of-arguments (ediff-patch-file))))
|
||||
|
||||
;;;;
|
||||
;;;;
|
||||
;;;; Conversion functions
|
||||
;;;;
|
||||
;;;;
|
||||
|
||||
;;(defvar diff-inhibit-after-change nil
|
||||
;; "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))))))
|
||||
(setq space 0 plus 0 minus 0 bang 0)))))))
|
||||
|
||||
;;;;
|
||||
;;;;
|
||||
;;;; Hooks
|
||||
;;;;
|
||||
;;;;
|
||||
|
||||
(defun diff-write-contents-hooks ()
|
||||
"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)))))
|
||||
(setq diff-unhandled-changes nil)))
|
||||
|
||||
;;;;
|
||||
;;;;
|
||||
;;;; The main function
|
||||
;;;;
|
||||
;;;;
|
||||
|
||||
;;;###autoload
|
||||
(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
|
||||
;; Emacs. All suggestions or comments are most welcomed.
|
||||
|
||||
;;
|
||||
;;
|
||||
;; Please, PLEASE, *PLEASE* see the info pages.
|
||||
;;
|
||||
;;
|
||||
|
||||
;; 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)
|
||||
"Display character C as character UC plus underlining."
|
||||
(aset standard-display-table c
|
||||
(vector
|
||||
(vector
|
||||
(if window-system
|
||||
(logior uc (lsh (face-id 'underline) 19))
|
||||
(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)))
|
||||
;; If FILENAME has a trailing slash, remove it and recurse.
|
||||
(if (memq (aref filename (1- flen)) '(?/ ?\\))
|
||||
(concat (convert-standard-filename
|
||||
(concat (convert-standard-filename
|
||||
(substring filename 0 (1- flen)))
|
||||
"/")
|
||||
(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
|
||||
;; number of extra letters not available on the keyboard.
|
||||
;;
|
||||
;;
|
||||
;; Examples includes Scandinavian and German with an US keyboard.
|
||||
;;
|
||||
;; 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
|
||||
;; keys on a US keyboard to generate characters according to the local
|
||||
;; 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
|
||||
;; 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)
|
||||
(load-library "isearch"))
|
||||
|
||||
(define-key isearch-mode-map [ignore]
|
||||
(define-key isearch-mode-map [ignore]
|
||||
(function (lambda () (interactive) (isearch-update))))
|
||||
|
||||
(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))
|
||||
(entry (assoc double-last-event double-map)))
|
||||
(if (eq new double-last-event)
|
||||
(progn
|
||||
(progn
|
||||
(setq unread-command-events
|
||||
(append (make-list (1- (length (nth 1 entry)))
|
||||
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.
|
||||
|
||||
\\{electric-buffer-menu-mode-map}"
|
||||
\\{electric-buffer-menu-mode-map}"
|
||||
(interactive "P")
|
||||
(let (select buffer)
|
||||
(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 [mouse-2] 'Electric-buffer-menu-mouse-select)
|
||||
(setq electric-buffer-menu-mode-map map)))
|
||||
|
||||
|
||||
(defun Electric-buffer-menu-exit ()
|
||||
(interactive)
|
||||
(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 "\n" '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-p" 'previous-line)
|
||||
(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)
|
||||
|
||||
(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
|
||||
`-w', to ignore space, and `-i', to ignore case of letters.
|
||||
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)
|
||||
(ediff-defvar-local ediff-diff-status "" "")
|
||||
|
||||
|
||||
|
||||
;;; Fine differences
|
||||
|
||||
(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
|
||||
"*Auto-refine only the regions of this size \(in bytes\) or less.")
|
||||
|
||||
|
||||
;;; General
|
||||
|
||||
(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
|
||||
one optional arguments, diff-number to refine.")
|
||||
|
||||
|
||||
|
||||
;;; Functions
|
||||
|
||||
;; 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
|
||||
(if (string-match "^-c\\| -c\\|-[^- ]+c" ediff-diff-options)
|
||||
(error "Option `-c' is not allowed in `ediff-diff-options'"))
|
||||
|
||||
|
||||
;; create, if it doesn't exist
|
||||
(or (ediff-buffer-live-p ediff-diff-buffer)
|
||||
(setq ediff-diff-buffer
|
||||
@ -268,9 +268,9 @@ one optional arguments, diff-number to refine.")
|
||||
(message "")
|
||||
(ediff-with-current-buffer diff-buffer
|
||||
(buffer-size))))))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; If file-A/B/C is nil, do 2-way comparison with the non-nil buffers
|
||||
;; This function works for diff3 and diff2 jobs
|
||||
(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
|
||||
(get-buffer-create
|
||||
(ediff-unique-buffer-name "*ediff-fine-diff" "*"))))
|
||||
|
||||
|
||||
(let (diff3-job diff-program diff-options ok-regexp diff-list)
|
||||
(setq diff3-job ediff-3way-job
|
||||
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
|
||||
ediff-diff3-ok-lines-regexp
|
||||
ediff-diff-ok-lines-regexp))
|
||||
|
||||
|
||||
(ediff-message-if-verbose "Refining difference region %d ..." (1+ reg-num))
|
||||
(ediff-exec-process diff-program ediff-fine-diff-buffer 'synchronize
|
||||
diff-options
|
||||
@ -298,12 +298,12 @@ one optional arguments, diff-number to refine.")
|
||||
(if diff3-job
|
||||
(if file-C file-C file-B))
|
||||
) ; exec process
|
||||
|
||||
|
||||
(ediff-prepare-error-list ok-regexp ediff-fine-diff-buffer)
|
||||
(ediff-message-if-verbose
|
||||
"")
|
||||
;; "Refining difference region %d ... done" (1+ reg-num))
|
||||
|
||||
|
||||
(setq diff-list
|
||||
(if diff3-job
|
||||
(ediff-extract-diffs3
|
||||
@ -327,11 +327,11 @@ one optional arguments, diff-number to refine.")
|
||||
(aset elt 5 nil))
|
||||
(cdr diff-list)))
|
||||
))
|
||||
|
||||
|
||||
(ediff-convert-fine-diffs-to-overlays diff-list reg-num)
|
||||
))
|
||||
|
||||
|
||||
|
||||
|
||||
(defun ediff-prepare-error-list (ok-regexp diff-buff)
|
||||
(or (ediff-buffer-live-p ediff-error-buffer)
|
||||
(setq ediff-error-buffer
|
||||
@ -368,7 +368,7 @@ one optional arguments, diff-number to refine.")
|
||||
(c-prev 1)
|
||||
diff-list shift-A shift-B
|
||||
)
|
||||
|
||||
|
||||
;; diff list contains word numbers, unless changed later
|
||||
(setq diff-list (cons (if word-mode 'words 'points)
|
||||
diff-list))
|
||||
@ -380,7 +380,7 @@ one optional arguments, diff-number to refine.")
|
||||
shift-B
|
||||
(ediff-overlay-start
|
||||
(ediff-get-value-according-to-buffer-type 'B bounds))))
|
||||
|
||||
|
||||
;; reset point in buffers A/B/C
|
||||
(ediff-with-current-buffer A-buffer
|
||||
(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)
|
||||
(ediff-with-current-buffer C-buffer
|
||||
(goto-char (point-min))))
|
||||
|
||||
|
||||
(ediff-with-current-buffer diff-buffer
|
||||
(goto-char (point-min))
|
||||
(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")
|
||||
(setq a-end (1+ a-end)
|
||||
b-end (1+ b-end))))
|
||||
|
||||
|
||||
(if (eq ediff-default-variant 'default-B)
|
||||
(setq c-begin b-begin
|
||||
c-end b-end)
|
||||
(setq c-begin a-begin
|
||||
c-end a-end))
|
||||
|
||||
|
||||
;; compute main diff vector
|
||||
(if word-mode
|
||||
;; make diff-list contain word numbers
|
||||
@ -500,11 +500,11 @@ one optional arguments, diff-number to refine.")
|
||||
nil ; dummy state of ancestor
|
||||
)))
|
||||
)))
|
||||
|
||||
|
||||
))) ; end ediff-with-current-buffer
|
||||
diff-list
|
||||
))
|
||||
|
||||
|
||||
|
||||
(defun ediff-convert-diffs-to-overlays (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"))
|
||||
|
||||
|
||||
|
||||
(defun ediff-set-diff-overlays-in-one-buffer (buf-type diff-list)
|
||||
(let* ((current-diff -1)
|
||||
(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 total-diffs (length diff-list))
|
||||
|
||||
|
||||
;; shift, if necessary
|
||||
(ediff-with-current-buffer buff (setq pt-saved shift))
|
||||
|
||||
|
||||
(while diff-list
|
||||
(setq current-diff (1+ current-diff)
|
||||
list-element (car diff-list)
|
||||
@ -565,7 +565,7 @@ one optional arguments, diff-number to refine.")
|
||||
(t 7))) ; Ancestor
|
||||
state-of-diff (aref list-element 8)
|
||||
)
|
||||
|
||||
|
||||
(cond ((and (not (eq buf-type state-of-diff))
|
||||
(not (eq buf-type 'Ancestor))
|
||||
(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))
|
||||
)
|
||||
(t (setq state-of-diff nil)))
|
||||
|
||||
|
||||
;; Put overlays at appropriate places in buffer
|
||||
;; convert word numbers to points, if necessary
|
||||
(if (eq diff-list-type 'words)
|
||||
@ -586,7 +586,7 @@ one optional arguments, diff-number to refine.")
|
||||
(if (> begin end) (setq begin end))
|
||||
(setq pt-saved (ediff-with-current-buffer buff (point)))))
|
||||
(setq overlay (ediff-make-bullet-proof-overlay begin end buff))
|
||||
|
||||
|
||||
(ediff-overlay-put overlay 'priority ediff-shadow-overlay-priority)
|
||||
(ediff-overlay-put overlay 'ediff-diff-num current-diff)
|
||||
(if (and (ediff-has-face-support-p)
|
||||
@ -609,7 +609,7 @@ one optional arguments, diff-number to refine.")
|
||||
diff-list
|
||||
(cdr diff-list))
|
||||
) ; while
|
||||
|
||||
|
||||
(set (ediff-get-symbol-from-alist buf-type ediff-difference-vector-alist)
|
||||
(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.
|
||||
(defun ediff-make-fine-diffs (&optional n flag)
|
||||
(or n (setq n ediff-current-difference))
|
||||
|
||||
|
||||
(if (< ediff-number-of-differences 1)
|
||||
(error ediff-NO-DIFFERENCES))
|
||||
|
||||
|
||||
(if ediff-word-mode
|
||||
(setq flag 'skip
|
||||
ediff-auto-refine 'nix))
|
||||
|
||||
|
||||
(or (< n 0)
|
||||
(>= n ediff-number-of-differences)
|
||||
;; 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-C (ediff-whitespace-diff-region-p n 'C))
|
||||
cumulative-fine-diff-length)
|
||||
|
||||
|
||||
(cond ;; If one of the regions is empty (or 2 in 3way comparison)
|
||||
;; then don't refine.
|
||||
;; 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)
|
||||
(setq file-A
|
||||
(ediff-make-temp-file tmp-buffer "fineDiffA" file-A))
|
||||
|
||||
|
||||
(ediff-wordify
|
||||
(ediff-get-diff-posn 'B 'beg n)
|
||||
(ediff-get-diff-posn 'B 'end n)
|
||||
@ -715,7 +715,7 @@ one optional arguments, diff-number to refine.")
|
||||
ediff-control-buffer)
|
||||
(setq file-B
|
||||
(ediff-make-temp-file tmp-buffer "fineDiffB" file-B))
|
||||
|
||||
|
||||
(if ediff-3way-job
|
||||
(progn
|
||||
(ediff-wordify
|
||||
@ -727,12 +727,12 @@ one optional arguments, diff-number to refine.")
|
||||
(setq file-C
|
||||
(ediff-make-temp-file
|
||||
tmp-buffer "fineDiffC" file-C))))
|
||||
|
||||
|
||||
;; save temp file names.
|
||||
(setq ediff-temp-file-A file-A
|
||||
ediff-temp-file-B file-B
|
||||
ediff-temp-file-C file-C)
|
||||
|
||||
|
||||
;; set the new vector of fine diffs, if none exists
|
||||
(cond ((and ediff-3way-job whitespace-A)
|
||||
(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))
|
||||
(t
|
||||
(ediff-setup-fine-diff-regions file-A file-B file-C n)))
|
||||
|
||||
|
||||
(setq cumulative-fine-diff-length
|
||||
(+ (length (ediff-get-fine-diff-vector n 'A))
|
||||
(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))
|
||||
(length (ediff-get-fine-diff-vector n 'C))
|
||||
0)))
|
||||
|
||||
|
||||
(cond ((or
|
||||
;; all regions are white space
|
||||
(and whitespace-A whitespace-B whitespace-C)
|
||||
@ -781,7 +781,7 @@ one optional arguments, diff-number to refine.")
|
||||
) ; end cond
|
||||
(ediff-set-fine-diff-properties n)
|
||||
)))
|
||||
|
||||
|
||||
;; Interface to ediff-make-fine-diffs. Checks for auto-refine limit, etc.
|
||||
(defun ediff-install-fine-diff-if-necessary (n)
|
||||
(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-make-fine-diffs n 'noforce)
|
||||
(ediff-make-fine-diffs n 'skip)))
|
||||
|
||||
|
||||
;; highlight iff fine diffs already exist
|
||||
((eq ediff-auto-refine 'off)
|
||||
(ediff-make-fine-diffs n 'skip))))
|
||||
|
||||
|
||||
|
||||
|
||||
;; if fine diff vector is not set for diff N, then do nothing
|
||||
(defun ediff-set-fine-diff-properties (n &optional default)
|
||||
(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)
|
||||
(if ediff-3way-job
|
||||
(ediff-set-fine-diff-properties-in-one-buffer 'C n default)))))
|
||||
|
||||
|
||||
(defun ediff-set-fine-diff-properties-in-one-buffer (buf-type
|
||||
n &optional default)
|
||||
(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-overlay-put overl 'priority priority))
|
||||
fine-diff-vector)))
|
||||
|
||||
|
||||
;; Set overlays over the regions that denote delimiters
|
||||
(defun ediff-set-fine-overlays-for-combined-merge (diff-list reg-num)
|
||||
(let (overlay overlay-list)
|
||||
@ -856,8 +856,8 @@ delimiter regions"))
|
||||
(ediff-set-fine-diff-vector
|
||||
reg-num 'C (apply 'vector overlay-list))
|
||||
))
|
||||
|
||||
|
||||
|
||||
|
||||
;; Convert diff list to overlays for a given DIFF-REGION
|
||||
;; in buffer of type BUF-TYPE
|
||||
(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)
|
||||
(setq diff-list (cdr diff-list)) ; discard list type (words or points)
|
||||
(ediff-with-current-buffer buff (goto-char reg-start))
|
||||
|
||||
|
||||
;; if it is a combined merge then set overlays in buff C specially
|
||||
(if (and ediff-merge-job (eq buf-type 'C)
|
||||
(setq combined-merge-diff-list
|
||||
@ -897,7 +897,7 @@ delimiter regions"))
|
||||
(setq overlay (ediff-make-bullet-proof-overlay begin end buff))
|
||||
;; record all overlays for this difference region
|
||||
(setq diff-overlay-list (nconc diff-overlay-list (list overlay))))
|
||||
|
||||
|
||||
(setq diff-list (cdr diff-list))
|
||||
) ; while
|
||||
;; convert the list of difference information into a vector
|
||||
@ -964,7 +964,7 @@ delimiter regions"))
|
||||
(anc-prev 1)
|
||||
diff-list shift-A shift-B shift-C
|
||||
)
|
||||
|
||||
|
||||
;; diff list contains word numbers or points, depending on word-mode
|
||||
(setq diff-list (cons (if word-mode 'words 'points)
|
||||
diff-list))
|
||||
@ -979,7 +979,7 @@ delimiter regions"))
|
||||
(if three-way-comp
|
||||
(ediff-overlay-start
|
||||
(ediff-get-value-according-to-buffer-type 'C bounds)))))
|
||||
|
||||
|
||||
;; reset point in buffers A, B, C
|
||||
(ediff-with-current-buffer A-buffer
|
||||
(goto-char (if shift-A shift-A (point-min))))
|
||||
@ -991,7 +991,7 @@ delimiter regions"))
|
||||
(if (ediff-buffer-live-p anc-buffer)
|
||||
(ediff-with-current-buffer anc-buffer
|
||||
(goto-char (point-min))))
|
||||
|
||||
|
||||
(ediff-with-current-buffer diff-buffer
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward ediff-match-diff3-line nil t)
|
||||
@ -1023,7 +1023,7 @@ delimiter regions"))
|
||||
b-begin-pt b-end-pt
|
||||
c-begin-pt c-end-pt
|
||||
anc-begin-pt anc-end-pt)
|
||||
|
||||
|
||||
(setq state-of-ancestor
|
||||
(= c-or-anc-begin c-or-anc-end))
|
||||
|
||||
@ -1036,7 +1036,7 @@ delimiter regions"))
|
||||
(t
|
||||
(setq c-begin a-begin
|
||||
c-end a-end)))
|
||||
|
||||
|
||||
;; compute main diff vector
|
||||
(if word-mode
|
||||
;; make diff-list contain word numbers
|
||||
@ -1105,11 +1105,11 @@ delimiter regions"))
|
||||
)))
|
||||
)))
|
||||
))
|
||||
|
||||
|
||||
))) ; end ediff-with-current-buffer
|
||||
diff-list
|
||||
))
|
||||
|
||||
|
||||
;; Generate the difference vector and overlays for three files
|
||||
;; File-C is either the third file to compare (in case of 3-way comparison)
|
||||
;; or it is the ancestor file.
|
||||
@ -1117,11 +1117,11 @@ delimiter regions"))
|
||||
(or (ediff-buffer-live-p ediff-diff-buffer)
|
||||
(setq ediff-diff-buffer
|
||||
(get-buffer-create (ediff-unique-buffer-name "*ediff-diff" "*"))))
|
||||
|
||||
|
||||
(message "Computing differences ...")
|
||||
(ediff-exec-process ediff-diff3-program ediff-diff-buffer 'synchronize
|
||||
ediff-diff3-options file-A file-B file-C)
|
||||
|
||||
|
||||
(ediff-prepare-error-list ediff-diff3-ok-lines-regexp ediff-diff-buffer)
|
||||
;;(message "Computing differences ... done")
|
||||
(ediff-convert-diffs-to-overlays
|
||||
@ -1129,7 +1129,7 @@ delimiter regions"))
|
||||
ediff-diff-buffer
|
||||
ediff-word-mode ediff-3way-comparison-job ediff-narrow-bounds)
|
||||
))
|
||||
|
||||
|
||||
|
||||
;; 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
|
||||
@ -1176,7 +1176,7 @@ delimiter regions"))
|
||||
(set-process-filter proc 'ediff-process-filter)
|
||||
)))
|
||||
(store-match-data data))))
|
||||
|
||||
|
||||
;; This is shell-command-filter from simple.el in Emacs.
|
||||
;; Copied here because XEmacs doesn't have it.
|
||||
(defun ediff-process-filter (proc string)
|
||||
@ -1200,7 +1200,7 @@ delimiter regions"))
|
||||
(if opoint
|
||||
(goto-char opoint))
|
||||
(set-buffer obuf))))
|
||||
|
||||
|
||||
;; 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
|
||||
;; so shell-command-sentinel displays a confusing message to the user
|
||||
@ -1212,7 +1212,7 @@ delimiter regions"))
|
||||
(set-buffer (process-buffer process))
|
||||
(setq mode-line-process nil))
|
||||
(delete-process process))))
|
||||
|
||||
|
||||
|
||||
;;; Word functions used to refine the current diff
|
||||
|
||||
@ -1297,14 +1297,14 @@ arguments to `skip-chars-forward'."
|
||||
(goto-char (point-min))
|
||||
(skip-chars-forward ediff-whitespace)
|
||||
(delete-region (point-min) (point))
|
||||
|
||||
|
||||
(while (not (eobp))
|
||||
(funcall forward-word-function)
|
||||
(setq sv-point (point))
|
||||
(skip-chars-forward ediff-whitespace)
|
||||
(delete-region sv-point (point))
|
||||
(insert "\n")))))
|
||||
|
||||
|
||||
;; copy string specified as BEG END from IN-BUF to OUT-BUF
|
||||
(defun ediff-copy-to-buffer (beg end in-buffer out-buffer)
|
||||
(with-current-buffer out-buffer
|
||||
|
@ -24,7 +24,7 @@
|
||||
;;; Commentary:
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
||||
(provide 'ediff-help)
|
||||
|
||||
;; Compiler pacifier start
|
||||
@ -47,9 +47,9 @@
|
||||
"The head of the full help message.")
|
||||
(defconst ediff-long-help-message-tail
|
||||
"=====================|===========================|=============================
|
||||
R -show registry | = -compare regions | M -show session group
|
||||
D -diff output | E -browse Ediff manual| G -send bug report
|
||||
i -status info | ? -help off | z/q -suspend/quit
|
||||
R -show registry | = -compare regions | M -show session group
|
||||
D -diff output | E -browse Ediff manual| G -send bug report
|
||||
i -status info | ? -help off | z/q -suspend/quit
|
||||
-------------------------------------------------------------------------------
|
||||
For help on a specific command: Click Button 2 over it; or
|
||||
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
|
||||
n,SPC -next diff | h -hilighting | rx -restore buf X's old diff
|
||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||
gx -goto X's point| | ! -update diff regions
|
||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||
gx -goto X's point| | ! -update diff regions
|
||||
C-l -recenter | ## -ignore whitespace |
|
||||
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
|
||||
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
|
||||
~ -rotate buffers| m -wide display |
|
||||
"
|
||||
"Help message usually used for 3-way comparison.
|
||||
Normally, not a user option. See `ediff-help-message' for details.")
|
||||
|
||||
|
||||
(defconst ediff-long-help-message-compare2
|
||||
"
|
||||
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
|
||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||
gx -goto X's point| | ! -update diff regions
|
||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||
gx -goto X's point| | ! -update diff regions
|
||||
C-l -recenter | ## -ignore whitespace |
|
||||
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
|
||||
~ -swap variants | m -wide display |
|
||||
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
|
||||
~ -swap variants | m -wide display |
|
||||
"
|
||||
"Help message usually used for 2-way comparison.
|
||||
Normally, not a user option. See `ediff-help-message' for details.")
|
||||
|
||||
|
||||
(defconst ediff-long-help-message-narrow2
|
||||
"
|
||||
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
|
||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||
gx -goto X's point| % -narrow/widen buffs | ! -update diff regions
|
||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||
gx -goto X's point| % -narrow/widen buffs | ! -update diff regions
|
||||
C-l -recenter | ## -ignore whitespace |
|
||||
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
|
||||
~ -swap variants | m -wide display |
|
||||
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
|
||||
~ -swap variants | m -wide display |
|
||||
"
|
||||
"Help message when comparing windows or regions line-by-line.
|
||||
Normally, not a user option. See `ediff-help-message' for details.")
|
||||
|
||||
|
||||
(defconst ediff-long-help-message-word-mode
|
||||
"
|
||||
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
|
||||
j -jump to diff | |
|
||||
gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs
|
||||
j -jump to diff | |
|
||||
gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs
|
||||
C-l -recenter | |
|
||||
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
|
||||
~ -swap variants | m -wide display |
|
||||
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
|
||||
~ -swap variants | m -wide display |
|
||||
"
|
||||
"Help message when comparing windows or regions word-by-word.
|
||||
Normally, not a user option. See `ediff-help-message' for details.")
|
||||
|
||||
|
||||
(defconst ediff-long-help-message-merge
|
||||
"
|
||||
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
|
||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||
gx -goto X's point| ## -ignore whitespace | ! -update 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
|
||||
</> -scroll lt/rt | m -wide display | wd -save diff output
|
||||
~ -swap variants | s -shrink window C | / -show ancestor buff
|
||||
| $$ -show clashes only | & -merge w/new default
|
||||
j -jump to diff | @ -auto-refinement | * -refine current region
|
||||
gx -goto X's point| ## -ignore whitespace | ! -update 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
|
||||
</> -scroll lt/rt | m -wide display | wd -save diff output
|
||||
~ -swap variants | s -shrink window C | / -show ancestor buff
|
||||
| $$ -show clashes only | & -merge w/new default
|
||||
| $* -skip changed regions |
|
||||
"
|
||||
"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.
|
||||
(ediff-defvar-local ediff-long-help-message ""
|
||||
"Normally, not a user option. See `ediff-help-message' for details.")
|
||||
|
||||
|
||||
(defconst ediff-brief-message-string
|
||||
" ? -quick help "
|
||||
"Contents of the brief help message.")
|
||||
;; The actual brief help message
|
||||
(ediff-defvar-local ediff-brief-help-message ""
|
||||
"Normally, not a user option. See `ediff-help-message' for details.")
|
||||
|
||||
|
||||
(ediff-defvar-local ediff-brief-help-message-function nil
|
||||
"The brief help message that the user can customize.
|
||||
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
|
||||
start up with different help messages for different jobs, you can change
|
||||
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
|
||||
@ -199,12 +199,12 @@ the value of this variable and the variables `ediff-help-message-*' in
|
||||
(overlay-get elt 'ediff-help-info))
|
||||
(overlays-at pos))))
|
||||
)
|
||||
|
||||
|
||||
(if (not (stringp cmd))
|
||||
(error "Hmm... I don't see an Ediff command around here..."))
|
||||
|
||||
|
||||
(ediff-documentation "Quick Help Commands")
|
||||
|
||||
|
||||
(let (case-fold-search)
|
||||
(cond ((string= cmd "?") (re-search-forward "^`\\?'"))
|
||||
((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))
|
||||
(end-of-line)
|
||||
(current-column)))
|
||||
|
||||
|
||||
|
||||
(defun ediff-indent-help-message ()
|
||||
(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)
|
||||
(beginning-of-line)
|
||||
(forward-line 1)))))
|
||||
|
||||
|
||||
|
||||
;; compose the help message as a string
|
||||
(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)
|
||||
(consp ediff-long-help-message-function)))
|
||||
(funcall ediff-long-help-message-function))
|
||||
(ediff-word-mode
|
||||
(ediff-word-mode
|
||||
(concat ediff-long-help-message-head
|
||||
ediff-long-help-message-word-mode
|
||||
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
|
||||
ediff-long-help-message-narrow2
|
||||
ediff-long-help-message-tail))
|
||||
(ediff-merge-job
|
||||
(ediff-merge-job
|
||||
(concat ediff-long-help-message-head
|
||||
ediff-long-help-message-merge
|
||||
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
|
||||
ediff-long-help-message-compare3
|
||||
ediff-long-help-message-tail))
|
||||
(t
|
||||
(t
|
||||
(concat ediff-long-help-message-head
|
||||
ediff-long-help-message-compare2
|
||||
ediff-long-help-message-tail))))
|
||||
(setq ediff-brief-help-message
|
||||
(setq ediff-brief-help-message
|
||||
(cond ((and ediff-brief-help-message-function
|
||||
(or (symbolp 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)
|
||||
(if (string-match "XEmacs" emacs-version)
|
||||
xemacs-form emacs-form))
|
||||
|
||||
|
||||
;; This autoload is useless in Emacs because ediff-hook.el is dumped with
|
||||
;; emacs, but it is needed in XEmacs
|
||||
;;;###autoload
|
||||
@ -147,12 +147,12 @@
|
||||
:selected (if (featurep 'ediff-tbar)
|
||||
(ediff-use-toolbar-p))]
|
||||
))
|
||||
|
||||
|
||||
;; put these menus before Object-Oriented-Browser in Tools menu
|
||||
(if (and (featurep 'menubar) (not (featurep 'infodock))
|
||||
(not (featurep 'ediff-hook)))
|
||||
(ediff-xemacs-init-menus)))
|
||||
|
||||
|
||||
;; Emacs--only if menu-bar is loaded
|
||||
(if (featurep 'menu-bar)
|
||||
(progn
|
||||
@ -164,7 +164,7 @@
|
||||
(defvar menu-bar-epatch-menu (make-sparse-keymap "Apply Patch"))
|
||||
(fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu))
|
||||
(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))
|
||||
(defvar menu-bar-ediff-menu (make-sparse-keymap "Compare"))
|
||||
(fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu))
|
||||
@ -222,7 +222,7 @@
|
||||
. ediff-merge-directories-with-ancestor))
|
||||
(define-key menu-bar-ediff-merge-menu [ediff-merge-directories]
|
||||
'("Directories..." . ediff-merge-directories))
|
||||
(define-key
|
||||
(define-key
|
||||
menu-bar-ediff-merge-menu [separator-ediff-merge-dirs] '("--"))
|
||||
(define-key
|
||||
menu-bar-ediff-merge-menu [ediff-merge-buffers-with-ancestor]
|
||||
@ -251,7 +251,7 @@
|
||||
(define-key menu-bar-ediff-misc-menu [ediff-doc]
|
||||
'("Ediff Manual..." . ediff-documentation))
|
||||
)
|
||||
|
||||
|
||||
) ; emacs case
|
||||
) ; ediff-cond-compile-for-xemacs-or-emacs
|
||||
|
||||
@ -273,13 +273,13 @@
|
||||
(autoload 'ediff-revision "ediff" "Compare versions of a file" t)
|
||||
|
||||
;; compare regions and windows
|
||||
(autoload 'ediff-windows-wordwise
|
||||
(autoload 'ediff-windows-wordwise
|
||||
"ediff" "Compare two windows word-by-word." t)
|
||||
(autoload 'ediff-regions-wordwise
|
||||
(autoload 'ediff-regions-wordwise
|
||||
"ediff" "Compare two regions word-by-word." t)
|
||||
(autoload 'ediff-windows-linewise
|
||||
(autoload 'ediff-windows-linewise
|
||||
"ediff" "Compare two windows line-by-line." t)
|
||||
(autoload 'ediff-regions-linewise
|
||||
(autoload 'ediff-regions-linewise
|
||||
"ediff" "Compare two regions line-by-line." t)
|
||||
|
||||
;; patch
|
||||
@ -308,9 +308,9 @@
|
||||
(autoload
|
||||
'ediff-directories3 "ediff" "Compare files in three directories." t)
|
||||
|
||||
(autoload 'edir-revisions
|
||||
(autoload 'edir-revisions
|
||||
"ediff" "Compare two versions of a file." t)
|
||||
(autoload 'ediff-directory-revisions
|
||||
(autoload 'ediff-directory-revisions
|
||||
"ediff" "Compare two versions of a file." t)
|
||||
|
||||
;; merge directories
|
||||
@ -326,9 +326,9 @@
|
||||
"Merge files in two directories using files in a third dir as ancestors."
|
||||
t)
|
||||
|
||||
(autoload 'edir-merge-revisions
|
||||
(autoload 'edir-merge-revisions
|
||||
"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)
|
||||
(autoload 'ediff-merge-directory-revisions-with-ancestor
|
||||
"ediff"
|
||||
@ -364,7 +364,7 @@
|
||||
"ediff-util"
|
||||
"Toggle the use of Ediff toolbar."
|
||||
t)
|
||||
|
||||
|
||||
) ; if purify-flag
|
||||
|
||||
|
||||
|
@ -740,7 +740,7 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
|
||||
:group 'ediff)
|
||||
|
||||
(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
|
||||
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,
|
||||
@ -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
|
||||
;; in effect for this buffer: `face', `ascii',
|
||||
;; `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)
|
||||
"")
|
||||
|
||||
@ -1549,7 +1549,7 @@ This default should work without changes."
|
||||
(t nil))))
|
||||
|
||||
(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
|
||||
(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))
|
||||
:group 'ediff-merge)
|
||||
|
||||
(defcustom ediff-combination-pattern
|
||||
(defcustom ediff-combination-pattern
|
||||
'("<<<<<<< variant A" A ">>>>>>> variant B" B "####### Ancestor" Ancestor "======= end")
|
||||
"*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)
|
||||
where bufspec is the symbol A, B, or Ancestor. For instance, if the value is
|
||||
'(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
|
||||
default (`default-A', `default-B', `combined') and it hasn't been marked as
|
||||
`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
|
||||
Buffer A or if it is marked as `prefer-B' and is different from the region in
|
||||
Buffer B."
|
||||
@ -111,7 +111,7 @@ Buffer B."
|
||||
;; 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
|
||||
;; 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)
|
||||
(and ediff-skip-merge-regions-that-differ-from-default
|
||||
(ediff-merge-changed-from-default-p n 'prefers-too)))
|
||||
@ -137,7 +137,7 @@ Buffer B."
|
||||
(setq combo-region
|
||||
(concat combo-region
|
||||
region-delim "\n"
|
||||
(ediff-get-region-contents
|
||||
(ediff-get-region-contents
|
||||
n region-spec ediff-control-buffer)))
|
||||
(error ""))
|
||||
(setq pattern-list (cdr (cdr pattern-list)))
|
||||
@ -161,7 +161,7 @@ Buffer B."
|
||||
(while (< n ediff-number-of-differences)
|
||||
(ediff-set-state-of-diff-in-all-buffers n ctl-buf)
|
||||
(setq n (1+ n)))))
|
||||
|
||||
|
||||
(defun ediff-set-state-of-diff-in-all-buffers (n ctl-buf)
|
||||
(let ((regA (ediff-get-region-contents n 'A 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 'C nil)))
|
||||
))
|
||||
|
||||
|
||||
(defun ediff-set-merge-mode ()
|
||||
(normal-mode t)
|
||||
(remove-hook 'local-write-file-hooks 'ediff-set-merge-mode))
|
||||
|
||||
|
||||
|
||||
;; Go over all diffs starting with DIFF-NUM and copy regions into buffer C
|
||||
;; according to the state of the difference.
|
||||
;; Since ediff-copy-diff refuses to copy identical diff regions, there is
|
||||
@ -217,7 +217,7 @@ Buffer B."
|
||||
(if remerging "Re-merging" "Merging")
|
||||
n
|
||||
ediff-number-of-differences))
|
||||
|
||||
|
||||
(setq state-of-merge (ediff-get-state-of-merge n))
|
||||
|
||||
(if remerging
|
||||
@ -225,36 +225,36 @@ Buffer B."
|
||||
;; (reg-B (ediff-get-region-contents n 'B ediff-control-buffer))
|
||||
;; (reg-C (ediff-get-region-contents n 'C ediff-control-buffer)))
|
||||
(let ()
|
||||
|
||||
|
||||
;; if region was edited since it was first set by default
|
||||
(if (or (ediff-merge-changed-from-default-p n)
|
||||
;; was preferred
|
||||
(string-match "prefer" state-of-merge))
|
||||
;; then ignore
|
||||
(setq do-not-copy t))
|
||||
|
||||
|
||||
;; change state of merge for this diff, if necessary
|
||||
(if (and (string-match "\\(default\\|combined\\)" state-of-merge)
|
||||
(not do-not-copy))
|
||||
(ediff-set-state-of-merge
|
||||
n (format "%S" ediff-default-variant)))
|
||||
))
|
||||
|
||||
|
||||
;; state-of-merge may have changed via ediff-set-state-of-merge, so
|
||||
;; check it once again
|
||||
(setq state-of-merge (ediff-get-state-of-merge n))
|
||||
|
||||
|
||||
(or do-not-copy
|
||||
(if (string= state-of-merge "combined")
|
||||
;; use n+1 because ediff-combine-diffs works via user numbering
|
||||
;; of diffs, which is 1+ to what ediff uses internally
|
||||
(ediff-combine-diffs (1+ n) 'batch)
|
||||
(ediff-copy-diff
|
||||
(ediff-copy-diff
|
||||
n (if (string-match "-A" state-of-merge) 'A 'B) 'C 'batch)))
|
||||
(setq n (1+ n)))
|
||||
(message "Merging buffers A & B into C ... Done")
|
||||
))
|
||||
|
||||
|
||||
|
||||
(defun ediff-re-merge ()
|
||||
"Remerge unmodified diff regions using a new default. Start with the current region."
|
||||
@ -266,14 +266,14 @@ Buffer B."
|
||||
default-variant-alist)))
|
||||
(setq ediff-default-variant
|
||||
(intern
|
||||
(completing-read
|
||||
(completing-read
|
||||
(format "Current merge default is `%S'. New default: "
|
||||
ediff-default-variant)
|
||||
actual-alist nil 'must-match)))
|
||||
(ediff-do-merge ediff-current-difference 'remerge)
|
||||
(ediff-recenter)
|
||||
))
|
||||
|
||||
|
||||
(defun ediff-shrink-window-C (arg)
|
||||
"Shrink window C to just one line.
|
||||
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'."
|
||||
(interactive "P")
|
||||
(setq n (if (numberp n) (1- n) ediff-current-difference))
|
||||
|
||||
|
||||
(let (reg-combined)
|
||||
;;(setq regA (ediff-get-region-contents n 'A 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-get-combined-region n))
|
||||
|
||||
|
||||
(ediff-copy-diff n nil 'C batch-invocation reg-combined))
|
||||
(or batch-invocation (ediff-jump-to-difference (1+ n))))
|
||||
|
||||
|
||||
|
||||
;; 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)
|
||||
@ -331,7 +331,7 @@ Combining is done according to the specifications in variable
|
||||
(mrgreg-end (ediff-get-diff-posn 'C 'end region-num))
|
||||
(pattern-list ediff-combination-pattern)
|
||||
delim reg-beg reg-end delim-regs-list)
|
||||
|
||||
|
||||
(if combined
|
||||
(ediff-with-current-buffer ediff-buffer-C
|
||||
(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)))
|
||||
|
||||
(setq state-of-merge (ediff-get-state-of-merge diff-num))
|
||||
|
||||
|
||||
;; if region was edited since it was first set by default
|
||||
(or (and (string= state-of-merge "default-A")
|
||||
(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")
|
||||
(not (string= reg-B reg-C)))
|
||||
)))
|
||||
|
||||
|
||||
|
||||
;;; Local Variables:
|
||||
;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
|
||||
|
@ -24,7 +24,7 @@
|
||||
;;; Commentary:
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
||||
(provide 'ediff-ptch)
|
||||
|
||||
(defgroup ediff-ptch nil
|
||||
@ -76,7 +76,7 @@ case the default value for this variable should be changed."
|
||||
(defconst ediff-default-backup-extension
|
||||
(if (memq system-type '(vax-vms axp-vms emx ms-dos))
|
||||
"_orig" ".orig"))
|
||||
|
||||
|
||||
|
||||
(defcustom ediff-backup-extension ediff-default-backup-extension
|
||||
"Backup extension used by the patch program.
|
||||
@ -94,7 +94,7 @@ See also `ediff-backup-specs'."
|
||||
(t 'traditional))
|
||||
(file-error nil)))
|
||||
|
||||
(defcustom ediff-backup-specs
|
||||
(defcustom ediff-backup-specs
|
||||
(let ((type (ediff-test-patch-utility)))
|
||||
(cond ((eq type 'gnu)
|
||||
;; GNU `patch' v. >= 2.2
|
||||
@ -184,10 +184,10 @@ program."
|
||||
(setq count (1+ 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-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.
|
||||
;; nin, nil are placeholders. See ediff-make-new-meta-list-element in
|
||||
;; ediff-meta.el for the explanations.
|
||||
@ -240,7 +240,7 @@ program."
|
||||
(move-marker mark2 (match-beginning 0)))
|
||||
|
||||
(goto-char mark2-end)
|
||||
|
||||
|
||||
(if filenames
|
||||
(setq patch-map
|
||||
(cons (ediff-make-new-meta-list-element
|
||||
@ -274,7 +274,7 @@ program."
|
||||
;; directory part of filename
|
||||
(file-name-as-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
|
||||
;; directory part of the first file in the patch
|
||||
(base-dir1 (file-name-directory
|
||||
@ -349,10 +349,10 @@ other files, enter /dev/null
|
||||
(setcar (ediff-get-session-objA session-info)
|
||||
(cons user-file user-file))))
|
||||
(setcar proposed-file-names
|
||||
(expand-file-name
|
||||
(expand-file-name
|
||||
(concat actual-dir (car proposed-file-names))))
|
||||
(setcdr proposed-file-names
|
||||
(expand-file-name
|
||||
(expand-file-name
|
||||
(concat actual-dir (cdr proposed-file-names)))))
|
||||
))
|
||||
ediff-patch-map)
|
||||
@ -418,7 +418,7 @@ are two possible targets for this patch. However, these files do not exist."
|
||||
(let ((directory t)
|
||||
target)
|
||||
(while directory
|
||||
(setq target (read-file-name
|
||||
(setq target (read-file-name
|
||||
"Please enter a patch target: "
|
||||
actual-dir actual-dir t))
|
||||
(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? ")
|
||||
(ediff-prompt-for-patch-buffer)
|
||||
(ediff-prompt-for-patch-file)))))
|
||||
|
||||
|
||||
(ediff-with-current-buffer patch-buf
|
||||
(goto-char (point-min))
|
||||
(or (ediff-get-visible-buffer-window patch-buf)
|
||||
@ -529,7 +529,7 @@ optional argument, then use it."
|
||||
"^/dev/null"
|
||||
;; this is the file to patch
|
||||
(ediff-get-session-objA-name (car ediff-patch-map))))
|
||||
(> (length
|
||||
(> (length
|
||||
(ediff-get-session-objA-name (car ediff-patch-map)))
|
||||
1))
|
||||
(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
|
||||
(setq default-directory default-dir)
|
||||
)
|
||||
|
||||
|
||||
;; dispatch a patch function
|
||||
(setq ctl-buf (ediff-dispatch-file-patching-job
|
||||
patch-buf file-name startup-hooks))
|
||||
|
||||
|
||||
(ediff-with-current-buffer ctl-buf
|
||||
(delete-file (buffer-file-name ediff-buffer-A))
|
||||
(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
|
||||
(if default-dir (setq default-directory default-dir))
|
||||
(set-visited-file-name nil)
|
||||
(rename-buffer (ediff-unique-buffer-name
|
||||
(rename-buffer (ediff-unique-buffer-name
|
||||
(concat buf-to-patch-name "_patched") ""))
|
||||
(set-buffer-modified-p t)))
|
||||
))
|
||||
@ -607,7 +607,7 @@ optional argument, then use it."
|
||||
(defun ediff-patch-file-internal (patch-buf source-filename
|
||||
&optional startup-hooks)
|
||||
(setq source-filename (expand-file-name source-filename))
|
||||
|
||||
|
||||
(let* ((shell-file-name ediff-shell)
|
||||
(patch-diagnostics (get-buffer-create "*ediff patch diagnostics*"))
|
||||
;; 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)
|
||||
;; this ensures that the patch process gets patch buffer in the
|
||||
;; 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))
|
||||
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)
|
||||
|
||||
|
||||
(if (string-match "V" ediff-patch-options)
|
||||
(error
|
||||
"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
|
||||
;; it is handled via auto-mode-alist and similar magic).
|
||||
;; 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.
|
||||
(setq file-name-magic-p (not (equal (file-truename true-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.
|
||||
(ediff-maybe-checkout buf-to-patch)
|
||||
|
||||
@ -674,7 +674,7 @@ optional argument, then use it."
|
||||
|
||||
(switch-to-buffer patch-diagnostics)
|
||||
(sit-for 0) ; synchronize - let the user see diagnostics
|
||||
|
||||
|
||||
(or (and (ediff-patch-return-code-ok patch-return-code)
|
||||
(file-exists-p
|
||||
(concat true-source-filename ediff-backup-extension)))
|
||||
@ -682,7 +682,7 @@ optional argument, then use it."
|
||||
(with-output-to-temp-buffer ediff-msg-buffer
|
||||
(ediff-with-current-buffer standard-output
|
||||
(fundamental-mode))
|
||||
(princ (format
|
||||
(princ (format
|
||||
"Patch program has failed due to a bad patch file,
|
||||
it couldn't apply all hunks, OR
|
||||
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
|
||||
|
||||
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.
|
||||
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))))
|
||||
(switch-to-buffer-other-window patch-diagnostics)
|
||||
(error "Patch appears to have failed")))
|
||||
|
||||
|
||||
;; 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
|
||||
;; 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
|
||||
(concat source-filename ediff-backup-extension))
|
||||
(set-buffer-modified-p nil))
|
||||
|
||||
|
||||
;; Black magic in effect.
|
||||
;; 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
|
||||
@ -738,20 +738,20 @@ you can still examine the changes via M-x ediff-files"
|
||||
true-source-filename
|
||||
source-filename)
|
||||
"_patched"))
|
||||
|
||||
|
||||
(rename-file true-source-filename target-filename t)
|
||||
|
||||
|
||||
;; arrange that the temp copy of orig will be deleted
|
||||
(rename-file (concat true-source-filename ediff-backup-extension)
|
||||
true-source-filename t))
|
||||
|
||||
|
||||
;; make orig buffer read-only
|
||||
(setq startup-hooks
|
||||
(cons 'ediff-set-read-only-in-buf-A startup-hooks))
|
||||
|
||||
|
||||
;; set up a buf for the patched file
|
||||
(setq target-buf (find-file-noselect target-filename))
|
||||
|
||||
|
||||
(setq ctl-buf
|
||||
(ediff-buffers-internal
|
||||
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
|
||||
(setq ediff-patchbufer patch-buf
|
||||
ediff-patch-diagnostics patch-diagnostics))
|
||||
|
||||
|
||||
(bury-buffer patch-diagnostics)
|
||||
(message "Type `P', if you need to see patch diagnostics")
|
||||
ctl-buf))
|
||||
@ -775,7 +775,7 @@ you can still examine the changes via M-x ediff-files"
|
||||
'ediff-patch-file-form-meta
|
||||
ediff-meta-patchbufer patch-buf) )
|
||||
startup-hooks))
|
||||
(setq meta-buf (ediff-prepare-meta-buffer
|
||||
(setq meta-buf (ediff-prepare-meta-buffer
|
||||
'ediff-filegroup-action
|
||||
(ediff-with-current-buffer patch-buf
|
||||
(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)
|
||||
))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;;; Local Variables:
|
||||
;;; 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))
|
||||
)))
|
||||
;; end pacifier
|
||||
|
||||
|
||||
;; VC.el support
|
||||
|
||||
(defun ediff-vc-latest-version (file)
|
||||
@ -72,7 +72,7 @@
|
||||
;; 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.
|
||||
(let (file1 file2 rev1buf rev2buf)
|
||||
(if (string= rev1 "")
|
||||
(if (string= rev1 "")
|
||||
(setq rev1 (ediff-vc-latest-version (buffer-file-name))))
|
||||
(save-window-excursion
|
||||
(save-excursion
|
||||
@ -93,12 +93,12 @@
|
||||
rev1buf rev2buf
|
||||
startup-hooks
|
||||
'ediff-revision)))
|
||||
|
||||
|
||||
;; RCS.el support
|
||||
(defun rcs-ediff-view-revision (&optional rev)
|
||||
;; View previous RCS revision of current file.
|
||||
;; With prefix argument, prompts for a revision name.
|
||||
(interactive (list (if current-prefix-arg
|
||||
(interactive (list (if current-prefix-arg
|
||||
(read-string "Revision: "))))
|
||||
(let* ((filename (buffer-file-name (current-buffer)))
|
||||
(switches (append '("-p")
|
||||
@ -116,10 +116,10 @@
|
||||
(apply 'call-process "co" nil t nil
|
||||
;; -q: quiet (no diagnostics)
|
||||
(append switches rcs-default-co-switches
|
||||
(list "-q" filename)))))
|
||||
(list "-q" filename)))))
|
||||
(message "")
|
||||
buff)))
|
||||
|
||||
buff)))
|
||||
|
||||
(defun ediff-rcs-get-output-buffer (file name)
|
||||
;; 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*'.
|
||||
@ -143,7 +143,7 @@
|
||||
(current-buffer)
|
||||
(rcs-ediff-view-revision rev2))
|
||||
rev1buf (rcs-ediff-view-revision rev1)))
|
||||
|
||||
|
||||
;; rcs.el doesn't create temp version files, so we don't have to delete
|
||||
;; anything in startup hooks to ediff-buffers
|
||||
(ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision)
|
||||
@ -177,7 +177,7 @@
|
||||
|
||||
;;; 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)
|
||||
;; If ANCESTOR-REV non-nil, merge with ancestor
|
||||
(let (buf1 buf2 ancestor-buf)
|
||||
@ -195,9 +195,9 @@
|
||||
(setq ancestor-rev (vc-workfile-version buffer-file-name)))
|
||||
(vc-version-other-window ancestor-rev)
|
||||
(setq ancestor-buf (current-buffer))))
|
||||
(setq startup-hooks
|
||||
(cons
|
||||
`(lambda ()
|
||||
(setq startup-hooks
|
||||
(cons
|
||||
`(lambda ()
|
||||
(delete-file ,(buffer-file-name buf1))
|
||||
(or ,(string= rev2 "")
|
||||
(delete-file ,(buffer-file-name buf2)))
|
||||
@ -278,11 +278,11 @@
|
||||
(default-directory
|
||||
(file-name-as-directory (cvs-fileinfo->dir fileinfo)))
|
||||
ancestor-file)
|
||||
|
||||
|
||||
(or (memq type '(MERGED CONFLICT MODIFIED))
|
||||
(error
|
||||
"Can only merge `Modified', `Merged' or `Conflict' files"))
|
||||
|
||||
|
||||
(cond ((memq type '(MERGED CONFLICT))
|
||||
(setq ancestor-file
|
||||
(cvs-retrieve-revision-to-tmpfile
|
||||
|
@ -24,7 +24,7 @@
|
||||
;;; Commentary:
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
||||
(provide 'ediff-wind)
|
||||
|
||||
;; Compiler pacifier
|
||||
@ -281,7 +281,7 @@ into icons, regardless of the window manager."
|
||||
)
|
||||
)
|
||||
))
|
||||
|
||||
|
||||
|
||||
;; Select the lowest window on the frame.
|
||||
(defun ediff-select-lowest-window ()
|
||||
@ -301,7 +301,7 @@ into icons, regardless of the window manager."
|
||||
(progn
|
||||
(setq bottom-edge next-bottom-edge)
|
||||
(setq lowest-window this-window)))
|
||||
|
||||
|
||||
(select-window this-window)
|
||||
(if (eq last-window this-window)
|
||||
(progn
|
||||
@ -322,11 +322,11 @@ into icons, regardless of the window manager."
|
||||
(run-hooks 'ediff-before-setup-windows-hook)
|
||||
(if (eq (selected-window) (minibuffer-window))
|
||||
(other-window 1))
|
||||
|
||||
|
||||
;; in case user did a no-no on a tty
|
||||
(or (ediff-window-display-p)
|
||||
(setq ediff-window-setup-function 'ediff-setup-windows-plain))
|
||||
|
||||
|
||||
(or (ediff-keep-window-config control-buffer)
|
||||
(funcall
|
||||
(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)
|
||||
(ediff-setup-windows-plain-compare
|
||||
buffer-A buffer-B buffer-C control-buffer)))
|
||||
|
||||
|
||||
(defun ediff-setup-windows-plain-merge (buf-A buf-B buf-C control-buffer)
|
||||
;; skip dedicated and unsplittable frames
|
||||
(ediff-destroy-control-frame control-buffer)
|
||||
@ -360,43 +360,43 @@ into icons, regardless of the window manager."
|
||||
(split-window-vertically)
|
||||
(ediff-select-lowest-window)
|
||||
(ediff-setup-control-buffer control-buffer)
|
||||
|
||||
|
||||
;; go to the upper window and split it betw A, B, and possibly C
|
||||
(other-window 1)
|
||||
(setq merge-window-lines
|
||||
(max 2 (round (* (window-height) merge-window-share))))
|
||||
(switch-to-buffer buf-A)
|
||||
(setq wind-A (selected-window))
|
||||
|
||||
|
||||
;; XEmacs used to have a lot of trouble with display
|
||||
;; It did't set things right unless we tell it to sit still
|
||||
;; 19.12 seems ok.
|
||||
;;(if ediff-xemacs-p (sit-for 0))
|
||||
|
||||
|
||||
(split-window-vertically (max 2 (- (window-height) merge-window-lines)))
|
||||
(if (eq (selected-window) wind-A)
|
||||
(other-window 1))
|
||||
(setq wind-C (selected-window))
|
||||
(switch-to-buffer buf-C)
|
||||
|
||||
|
||||
(select-window wind-A)
|
||||
(funcall split-window-function)
|
||||
|
||||
|
||||
(if (eq (selected-window) wind-A)
|
||||
(other-window 1))
|
||||
(switch-to-buffer buf-B)
|
||||
(setq wind-B (selected-window))
|
||||
|
||||
|
||||
(ediff-with-current-buffer control-buffer
|
||||
(setq ediff-window-A wind-A
|
||||
ediff-window-B wind-B
|
||||
ediff-window-C wind-C))
|
||||
|
||||
|
||||
(ediff-select-lowest-window)
|
||||
(ediff-setup-control-buffer control-buffer)
|
||||
))
|
||||
|
||||
|
||||
|
||||
;; This function handles all comparison jobs, including 3way jobs
|
||||
(defun ediff-setup-windows-plain-compare (buf-A buf-B buf-C control-buffer)
|
||||
;; skip dedicated and unsplittable frames
|
||||
@ -419,7 +419,7 @@ into icons, regardless of the window manager."
|
||||
(split-window-vertically)
|
||||
(ediff-select-lowest-window)
|
||||
(ediff-setup-control-buffer control-buffer)
|
||||
|
||||
|
||||
;; go to the upper window and split it betw A, B, and possibly C
|
||||
(other-window 1)
|
||||
(switch-to-buffer buf-A)
|
||||
@ -430,19 +430,19 @@ into icons, regardless of the window manager."
|
||||
(window-height wind-A)
|
||||
(window-width wind-A))
|
||||
3)))
|
||||
|
||||
|
||||
;; XEmacs used to have a lot of trouble with display
|
||||
;; It did't set things right unless we told it to sit still
|
||||
;; 19.12 seems ok.
|
||||
;;(if ediff-xemacs-p (sit-for 0))
|
||||
|
||||
|
||||
(funcall split-window-function wind-width-or-height)
|
||||
|
||||
|
||||
(if (eq (selected-window) wind-A)
|
||||
(other-window 1))
|
||||
(switch-to-buffer buf-B)
|
||||
(setq wind-B (selected-window))
|
||||
|
||||
|
||||
(if three-way-comparison
|
||||
(progn
|
||||
(funcall split-window-function) ; equally
|
||||
@ -450,24 +450,24 @@ into icons, regardless of the window manager."
|
||||
(other-window 1))
|
||||
(switch-to-buffer buf-C)
|
||||
(setq wind-C (selected-window))))
|
||||
|
||||
|
||||
(ediff-with-current-buffer control-buffer
|
||||
(setq ediff-window-A wind-A
|
||||
ediff-window-B wind-B
|
||||
ediff-window-C wind-C))
|
||||
|
||||
|
||||
;; It is unlikely that we will want to implement 3way window comparison.
|
||||
;; So, only buffers A and B are used here.
|
||||
(if ediff-windows-job
|
||||
(progn
|
||||
(set-window-start wind-A wind-A-start)
|
||||
(set-window-start wind-B wind-B-start)))
|
||||
|
||||
|
||||
(ediff-select-lowest-window)
|
||||
(ediff-setup-control-buffer control-buffer)
|
||||
))
|
||||
|
||||
|
||||
|
||||
;; dispatch an appropriate window setup function
|
||||
(defun ediff-setup-windows-multiframe (buf-A buf-B buf-C control-buf)
|
||||
(ediff-with-current-buffer control-buf
|
||||
@ -475,7 +475,7 @@ into icons, regardless of the window manager."
|
||||
(if ediff-merge-job
|
||||
(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)))
|
||||
|
||||
|
||||
(defun ediff-setup-windows-multiframe-merge (buf-A buf-B buf-C control-buf)
|
||||
;;; Algorithm:
|
||||
;;; 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.
|
||||
;; Unsplittable frames are taken care of later.
|
||||
(ediff-skip-unsuitable-frames 'ok-unsplittable)
|
||||
|
||||
|
||||
(let* ((window-min-height 1)
|
||||
(wind-A (ediff-get-visible-buffer-window buf-A))
|
||||
(wind-B (ediff-get-visible-buffer-window buf-B))
|
||||
@ -531,7 +531,7 @@ into icons, regardless of the window manager."
|
||||
merge-window-lines
|
||||
designated-minibuffer-frame
|
||||
done-A done-B done-C)
|
||||
|
||||
|
||||
;; buf-A on its own
|
||||
(if (and (window-live-p wind-A)
|
||||
(null use-same-frame) ; implies wind-A is suitable
|
||||
@ -542,7 +542,7 @@ into icons, regardless of the window manager."
|
||||
(delete-other-windows)
|
||||
(setq wind-A (selected-window))
|
||||
(setq done-A t)))
|
||||
|
||||
|
||||
;; buf-B on its own
|
||||
(if (and (window-live-p wind-B)
|
||||
(null use-same-frame) ; implies wind-B is suitable
|
||||
@ -553,7 +553,7 @@ into icons, regardless of the window manager."
|
||||
(delete-other-windows)
|
||||
(setq wind-B (selected-window))
|
||||
(setq done-B t)))
|
||||
|
||||
|
||||
;; buf-C on its own
|
||||
(if (and (window-live-p wind-C)
|
||||
(ediff-window-ok-for-display wind-C)
|
||||
@ -564,7 +564,7 @@ into icons, regardless of the window manager."
|
||||
(delete-other-windows)
|
||||
(setq wind-C (selected-window))
|
||||
(setq done-C t)))
|
||||
|
||||
|
||||
(if (and use-same-frame-for-AB ; implies wind A and B are suitable
|
||||
(window-live-p wind-A))
|
||||
(progn
|
||||
@ -572,16 +572,16 @@ into icons, regardless of the window manager."
|
||||
(select-window wind-A)
|
||||
(delete-other-windows)
|
||||
(setq wind-A (selected-window))
|
||||
|
||||
|
||||
(funcall split-window-function)
|
||||
(if (eq (selected-window) wind-A)
|
||||
(other-window 1))
|
||||
(switch-to-buffer buf-B)
|
||||
(setq wind-B (selected-window))
|
||||
|
||||
|
||||
(setq done-A t
|
||||
done-B t)))
|
||||
|
||||
|
||||
(if use-same-frame
|
||||
(let ((window-min-height 1))
|
||||
(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))))
|
||||
(switch-to-buffer buf-A)
|
||||
(setq wind-A (selected-window))
|
||||
|
||||
|
||||
(split-window-vertically
|
||||
(max 2 (- (window-height) merge-window-lines)))
|
||||
(if (eq (selected-window) wind-A)
|
||||
(other-window 1))
|
||||
(setq wind-C (selected-window))
|
||||
(switch-to-buffer buf-C)
|
||||
|
||||
|
||||
(select-window wind-A)
|
||||
|
||||
|
||||
(funcall split-window-function)
|
||||
(if (eq (selected-window) wind-A)
|
||||
(other-window 1))
|
||||
(switch-to-buffer buf-B)
|
||||
(setq wind-B (selected-window))
|
||||
|
||||
|
||||
(setq done-A t
|
||||
done-B t
|
||||
done-C t)
|
||||
))
|
||||
|
||||
|
||||
(or done-A ; Buf A to be set in its own frame,
|
||||
;;; or it was set before because use-same-frame = 1
|
||||
(progn
|
||||
@ -636,7 +636,7 @@ into icons, regardless of the window manager."
|
||||
(switch-to-buffer buf-B)
|
||||
(setq wind-B (selected-window))
|
||||
))
|
||||
|
||||
|
||||
(or done-C ; Buf C to be set in its own frame,
|
||||
;;; or it was set before because use-same-frame = 1
|
||||
(progn
|
||||
@ -647,7 +647,7 @@ into icons, regardless of the window manager."
|
||||
(switch-to-buffer buf-C)
|
||||
(setq wind-C (selected-window))
|
||||
))
|
||||
|
||||
|
||||
(ediff-with-current-buffer control-buf
|
||||
(setq ediff-window-A wind-A
|
||||
ediff-window-B wind-B
|
||||
@ -655,11 +655,11 @@ into icons, regardless of the window manager."
|
||||
(setq frame-A (window-frame ediff-window-A)
|
||||
designated-minibuffer-frame
|
||||
(window-frame (minibuffer-window frame-A))))
|
||||
|
||||
|
||||
(ediff-setup-control-frame control-buf designated-minibuffer-frame)
|
||||
))
|
||||
|
||||
|
||||
|
||||
;; Window setup for all comparison jobs, including 3way comparisons
|
||||
(defun ediff-setup-windows-multiframe-compare (buf-A buf-B buf-C control-buf)
|
||||
;;; 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
|
||||
;;; put both buffers there, event if one of this buffers is visible in
|
||||
;;; another frame.
|
||||
|
||||
|
||||
;; Skip dedicated or iconified frames.
|
||||
;; Unsplittable frames are taken care of later.
|
||||
(ediff-skip-unsuitable-frames 'ok-unsplittable)
|
||||
|
||||
|
||||
(let* ((window-min-height 1)
|
||||
(wind-A (ediff-get-visible-buffer-window buf-A))
|
||||
(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
|
||||
designated-minibuffer-frame
|
||||
done-A done-B done-C)
|
||||
|
||||
|
||||
(ediff-with-current-buffer control-buf
|
||||
(setq wind-A-start (ediff-overlay-start
|
||||
(ediff-get-value-according-to-buffer-type
|
||||
@ -724,7 +724,7 @@ into icons, regardless of the window manager."
|
||||
wind-B-start (ediff-overlay-start
|
||||
(ediff-get-value-according-to-buffer-type
|
||||
'B ediff-narrow-bounds))))
|
||||
|
||||
|
||||
(if (and (window-live-p wind-A) (null use-same-frame)) ; buf-A on its own
|
||||
(progn
|
||||
;; buffer buf-A is seen in live wind-A
|
||||
@ -732,7 +732,7 @@ into icons, regardless of the window manager."
|
||||
(delete-other-windows)
|
||||
(setq wind-A (selected-window))
|
||||
(setq done-A t)))
|
||||
|
||||
|
||||
(if (and (window-live-p wind-B) (null use-same-frame)) ; buf B on its own
|
||||
(progn
|
||||
;; buffer buf-B is seen in live wind-B
|
||||
@ -740,7 +740,7 @@ into icons, regardless of the window manager."
|
||||
(delete-other-windows)
|
||||
(setq wind-B (selected-window))
|
||||
(setq done-B t)))
|
||||
|
||||
|
||||
(if (and (window-live-p wind-C) (null use-same-frame)) ; buf C on its own
|
||||
(progn
|
||||
;; buffer buf-C is seen in live wind-C
|
||||
@ -748,7 +748,7 @@ into icons, regardless of the window manager."
|
||||
(delete-other-windows)
|
||||
(setq wind-C (selected-window))
|
||||
(setq done-C t)))
|
||||
|
||||
|
||||
(if use-same-frame
|
||||
(let (wind-width-or-height) ; this affects 3way setups only
|
||||
(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)
|
||||
(switch-to-buffer buf-A)
|
||||
(setq wind-A (selected-window))
|
||||
|
||||
|
||||
(if three-way-comparison
|
||||
(setq wind-width-or-height
|
||||
(/
|
||||
@ -766,13 +766,13 @@ into icons, regardless of the window manager."
|
||||
(window-height wind-A)
|
||||
(window-width wind-A))
|
||||
3)))
|
||||
|
||||
|
||||
(funcall split-window-function wind-width-or-height)
|
||||
(if (eq (selected-window) wind-A)
|
||||
(other-window 1))
|
||||
(switch-to-buffer buf-B)
|
||||
(setq wind-B (selected-window))
|
||||
|
||||
|
||||
(if three-way-comparison
|
||||
(progn
|
||||
(funcall split-window-function) ; equally
|
||||
@ -784,7 +784,7 @@ into icons, regardless of the window manager."
|
||||
done-B t
|
||||
done-C t)
|
||||
))
|
||||
|
||||
|
||||
(or done-A ; Buf A to be set in its own frame
|
||||
;;; or it was set before because use-same-frame = 1
|
||||
(progn
|
||||
@ -805,7 +805,7 @@ into icons, regardless of the window manager."
|
||||
(switch-to-buffer buf-B)
|
||||
(setq wind-B (selected-window))
|
||||
))
|
||||
|
||||
|
||||
(if three-way-comparison
|
||||
(or done-C ; Buf C to be set in its own frame
|
||||
;;; 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)
|
||||
(setq wind-C (selected-window))
|
||||
)))
|
||||
|
||||
|
||||
(ediff-with-current-buffer control-buf
|
||||
(setq ediff-window-A wind-A
|
||||
ediff-window-B wind-B
|
||||
@ -826,14 +826,14 @@ into icons, regardless of the window manager."
|
||||
(setq frame-A (window-frame ediff-window-A)
|
||||
designated-minibuffer-frame
|
||||
(window-frame (minibuffer-window frame-A))))
|
||||
|
||||
|
||||
;; 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.
|
||||
(if ediff-windows-job
|
||||
(progn
|
||||
(set-window-start wind-A wind-A-start)
|
||||
(set-window-start wind-B wind-B-start)))
|
||||
|
||||
|
||||
(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)
|
||||
(let (ans)
|
||||
(walk-windows
|
||||
(walk-windows
|
||||
(lambda (wind) (if (window-dedicated-p wind)
|
||||
(setq ans t)))
|
||||
'ignore-minibuffer
|
||||
@ -896,7 +896,7 @@ into icons, regardless of the window manager."
|
||||
ctl-frame old-ctl-frame lines
|
||||
;; user-grabbed-mouse
|
||||
fheight fwidth adjusted-parameters)
|
||||
|
||||
|
||||
(ediff-with-current-buffer ctl-buffer
|
||||
(ediff-cond-compile-for-xemacs-or-emacs
|
||||
(set-buffer-menubar nil) ; xemacs
|
||||
@ -904,7 +904,7 @@ into icons, regardless of the window manager."
|
||||
)
|
||||
;;(setq user-grabbed-mouse (ediff-user-grabbed-mouse))
|
||||
(run-hooks 'ediff-before-setup-control-frame-hook))
|
||||
|
||||
|
||||
(setq old-ctl-frame (ediff-with-current-buffer ctl-buffer ediff-control-frame))
|
||||
(ediff-with-current-buffer ctl-buffer
|
||||
(setq ctl-frame (if (frame-live-p old-ctl-frame)
|
||||
@ -920,28 +920,28 @@ into icons, regardless of the window manager."
|
||||
)
|
||||
(error))
|
||||
)
|
||||
|
||||
|
||||
(setq ctl-frame-iconified-p (ediff-frame-iconified-p ctl-frame))
|
||||
(select-frame ctl-frame)
|
||||
(if (window-dedicated-p (selected-window))
|
||||
()
|
||||
(delete-other-windows)
|
||||
(switch-to-buffer ctl-buffer))
|
||||
|
||||
|
||||
;; must be before ediff-setup-control-buffer
|
||||
;; just a precaution--we should be in ctl-buffer already
|
||||
(ediff-with-current-buffer ctl-buffer
|
||||
(make-local-variable 'frame-title-format)
|
||||
(make-local-variable 'frame-icon-title-format) ; XEmacs
|
||||
(make-local-variable 'icon-title-format)) ; Emacs
|
||||
|
||||
|
||||
(ediff-setup-control-buffer ctl-buffer)
|
||||
(setq dont-iconify-ctl-frame
|
||||
(not (string= ediff-help-message ediff-brief-help-message)))
|
||||
(setq deiconify-ctl-frame
|
||||
(and (eq this-command 'ediff-toggle-help)
|
||||
dont-iconify-ctl-frame))
|
||||
|
||||
|
||||
;; 1 more line for the modeline
|
||||
(setq lines (1+ (count-lines (point-min) (point-max)))
|
||||
fheight lines
|
||||
@ -963,7 +963,7 @@ into icons, regardless of the window manager."
|
||||
'(auto-raise . nil)
|
||||
'(auto-raise . t))
|
||||
adjusted-parameters))
|
||||
|
||||
|
||||
;; In XEmacs, buffer menubar needs to be killed before frame parameters
|
||||
;; are changed.
|
||||
(if (ediff-has-toolbar-support-p)
|
||||
@ -980,7 +980,7 @@ into icons, regardless of the window manager."
|
||||
nil ; emacs
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; 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
|
||||
;; 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.
|
||||
(if (memq system-type '(emx windows-nt windows-95))
|
||||
(modify-frame-parameters ctl-frame adjusted-parameters))
|
||||
|
||||
|
||||
;; make or zap toolbar (if not requested)
|
||||
(ediff-make-bottom-toolbar ctl-frame)
|
||||
|
||||
|
||||
(goto-char (point-min))
|
||||
|
||||
(modify-frame-parameters ctl-frame adjusted-parameters)
|
||||
(make-frame-visible ctl-frame)
|
||||
|
||||
|
||||
;; 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
|
||||
;; becomes exposed as a result of this iconification.
|
||||
;; So, we make sure the current buffer doesn't change.
|
||||
(select-frame ctl-frame)
|
||||
(ediff-refresh-control-frame)
|
||||
|
||||
|
||||
(cond ((and ediff-prefer-iconified-control-frame
|
||||
(not ctl-frame-iconified-p) (not dont-iconify-ctl-frame))
|
||||
(iconify-frame ctl-frame))
|
||||
((or deiconify-ctl-frame (not ctl-frame-iconified-p))
|
||||
(raise-frame ctl-frame)))
|
||||
|
||||
|
||||
(set-window-dedicated-p (selected-window) t)
|
||||
|
||||
;; 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
|
||||
ctl-frame
|
||||
(funcall ediff-control-frame-position-function ctl-buffer fwidth fheight))
|
||||
|
||||
|
||||
;; synchronize so the cursor will move to control frame
|
||||
;; per RMS suggestion
|
||||
(if (ediff-window-display-p)
|
||||
@ -1032,7 +1032,7 @@ into icons, regardless of the window manager."
|
||||
(ediff-reset-mouse ctl-frame
|
||||
(or (eq this-command 'ediff-quit)
|
||||
(not (eq ediff-grab-mouse t)))))
|
||||
|
||||
|
||||
(if ediff-xemacs-p
|
||||
(ediff-with-current-buffer ctl-buffer
|
||||
(ediff-cond-compile-for-xemacs-or-emacs
|
||||
@ -1042,12 +1042,12 @@ into icons, regardless of the window manager."
|
||||
(add-hook
|
||||
'select-frame-hook 'ediff-xemacs-select-frame-hook nil 'local)
|
||||
))
|
||||
|
||||
|
||||
(ediff-with-current-buffer ctl-buffer
|
||||
(run-hooks 'ediff-after-setup-control-frame-hook))
|
||||
))
|
||||
|
||||
|
||||
|
||||
(defun ediff-destroy-control-frame (ctl-buffer)
|
||||
(ediff-with-current-buffer ctl-buffer
|
||||
(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-reset-mouse nil)
|
||||
)
|
||||
|
||||
|
||||
|
||||
;; finds a good place to clip control frame
|
||||
(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)
|
||||
horizontal-adjustment upward-adjustment
|
||||
ctl-frame-top ctl-frame-left)
|
||||
|
||||
|
||||
;; Multiple control frames are clipped based on the value of
|
||||
;; ediff-control-buffer-number. This is done in order not to obscure
|
||||
;; other active control panels.
|
||||
@ -1107,16 +1107,16 @@ into icons, regardless of the window manager."
|
||||
;; keep ctl frame within the visible bounds
|
||||
(setq ctl-frame-top (max ctl-frame-top 1)
|
||||
ctl-frame-left (max ctl-frame-left 1))
|
||||
|
||||
|
||||
(list (cons 'top ctl-frame-top)
|
||||
(cons 'left ctl-frame-left))
|
||||
)))
|
||||
|
||||
|
||||
(defun ediff-xemacs-select-frame-hook ()
|
||||
(if (and (equal (selected-frame) ediff-control-frame)
|
||||
(not ediff-use-long-help-message))
|
||||
(raise-frame ediff-control-frame)))
|
||||
|
||||
|
||||
(defun ediff-make-wide-display ()
|
||||
"Construct an alist of parameters for the wide display.
|
||||
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)
|
||||
(modify-frame-parameters frame-A (list (cons 'left cw)
|
||||
(cons 'width wd)))))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; Revise the mode line to display which difference we have selected
|
||||
;; Also resets modelines of buffers A/B, since they may be clobbered by
|
||||
;; anothe invocations of Ediff.
|
||||
(defun ediff-refresh-mode-lines ()
|
||||
(let (buf-A-state-diff buf-B-state-diff buf-C-state-diff buf-C-state-merge)
|
||||
|
||||
|
||||
(if (ediff-valid-difference-p)
|
||||
(setq
|
||||
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 ""
|
||||
buf-B-state-diff ""
|
||||
buf-C-state-diff ""))
|
||||
|
||||
|
||||
;; control buffer format
|
||||
(setq mode-line-format
|
||||
(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)))
|
||||
;; Force mode-line redisplay
|
||||
(force-mode-line-update)
|
||||
|
||||
|
||||
(if (and (ediff-window-display-p) (frame-live-p ediff-control-frame))
|
||||
(ediff-refresh-control-frame))
|
||||
|
||||
|
||||
(ediff-with-current-buffer ediff-buffer-A
|
||||
(setq ediff-diff-status buf-A-state-diff)
|
||||
(ediff-strip-mode-line-format)
|
||||
@ -1225,8 +1225,8 @@ It assumes that it is called from within the control buffer."
|
||||
(t ""))
|
||||
mode-line-format))))
|
||||
))
|
||||
|
||||
|
||||
|
||||
|
||||
(defun ediff-refresh-control-frame ()
|
||||
(if ediff-emacs-p
|
||||
;; 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))
|
||||
;; force an update of the frame title
|
||||
(modify-frame-parameters ediff-control-frame '(()))))
|
||||
|
||||
|
||||
|
||||
|
||||
(defun ediff-make-narrow-control-buffer-id (&optional skip-name)
|
||||
(concat
|
||||
(if skip-name
|
||||
@ -1260,7 +1260,7 @@ It assumes that it is called from within the control buffer."
|
||||
(concat
|
||||
(cdr (assoc 'name ediff-control-frame-parameters))
|
||||
ediff-control-buffer-suffix))
|
||||
|
||||
|
||||
(defun ediff-make-wide-control-buffer-id ()
|
||||
(cond ((< ediff-current-difference 0)
|
||||
(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
|
||||
(get-buffer-window buff t)
|
||||
(get-buffer-window buff 'visible))))
|
||||
|
||||
|
||||
|
||||
;;; Functions to decide when to redraw windows
|
||||
|
||||
|
||||
(defun ediff-keep-window-config (control-buf)
|
||||
(and (eq control-buf (current-buffer))
|
||||
(/= (buffer-size) 0)
|
||||
@ -1293,7 +1293,7 @@ It assumes that it is called from within the control buffer."
|
||||
(A-wind ediff-window-A)
|
||||
(B-wind ediff-window-B)
|
||||
(C-wind ediff-window-C))
|
||||
|
||||
|
||||
(and
|
||||
(ediff-window-visible-p A-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
|
||||
|
||||
(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.
|
||||
@ -200,13 +200,13 @@
|
||||
dir-B f)
|
||||
(list (setq f (ediff-read-file-name
|
||||
"File A to compare"
|
||||
dir-A
|
||||
dir-A
|
||||
(ediff-get-default-file-name)
|
||||
'no-dirs))
|
||||
(ediff-read-file-name "File B to compare"
|
||||
(ediff-read-file-name "File B to compare"
|
||||
(setq dir-B
|
||||
(if ediff-use-last-dir
|
||||
ediff-last-dir-B
|
||||
ediff-last-dir-B
|
||||
(file-name-directory f)))
|
||||
(progn
|
||||
(setq file-name-history
|
||||
@ -217,7 +217,7 @@
|
||||
file-name-history))
|
||||
(ediff-get-default-file-name f 1)))
|
||||
)))
|
||||
(ediff-files-internal file-A
|
||||
(ediff-files-internal file-A
|
||||
(if (file-directory-p file-B)
|
||||
(expand-file-name
|
||||
(file-name-nondirectory file-A) file-B)
|
||||
@ -225,7 +225,7 @@
|
||||
nil ; file-C
|
||||
startup-hooks
|
||||
'ediff-files))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun ediff-files3 (file-A file-B file-C &optional startup-hooks)
|
||||
"Run Ediff on three files, FILE-A, FILE-B, and FILE-C."
|
||||
@ -239,7 +239,7 @@
|
||||
dir-A
|
||||
(ediff-get-default-file-name)
|
||||
'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
|
||||
(if ediff-use-last-dir
|
||||
ediff-last-dir-B
|
||||
@ -253,7 +253,7 @@
|
||||
dir-B))
|
||||
file-name-history))
|
||||
(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
|
||||
ediff-last-dir-C
|
||||
(file-name-directory ff)))
|
||||
@ -266,7 +266,7 @@
|
||||
file-name-history))
|
||||
(ediff-get-default-file-name ff 2)))
|
||||
)))
|
||||
(ediff-files-internal file-A
|
||||
(ediff-files-internal file-A
|
||||
(if (file-directory-p file-B)
|
||||
(expand-file-name
|
||||
(file-name-nondirectory file-A) file-B)
|
||||
@ -282,7 +282,7 @@
|
||||
(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.
|
||||
;; BUFFER-NAME is a variable symbol, which will get the buffer object into
|
||||
;; which FILE is read.
|
||||
@ -299,17 +299,17 @@
|
||||
(error "File `%s' does not exist or is not readable" file))
|
||||
((file-directory-p file)
|
||||
(error "File `%s' is a directory" file)))
|
||||
|
||||
|
||||
;; some of the commands, below, require full file name
|
||||
(setq file (expand-file-name file))
|
||||
|
||||
|
||||
;; Record the directory of the file
|
||||
(if last-dir
|
||||
(set last-dir (expand-file-name (file-name-directory file))))
|
||||
|
||||
|
||||
;; Setup the buffer
|
||||
(set buffer-name (find-file-noselect file))
|
||||
|
||||
|
||||
(ediff-with-current-buffer (symbol-value buffer-name)
|
||||
(widen) ; Make sure the entire file is seen
|
||||
(cond (file-magic ; file has a handler, such as jka-compr-handler or
|
||||
@ -362,7 +362,7 @@
|
||||
startup-hooks
|
||||
(list (cons 'ediff-job-name job-name))
|
||||
merge-buffer-file)))
|
||||
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defalias 'ediff 'ediff-files)
|
||||
@ -387,7 +387,7 @@ If this file is a backup, `ediff' it with its original."
|
||||
;;;###autoload
|
||||
(defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name)
|
||||
"Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B."
|
||||
(interactive
|
||||
(interactive
|
||||
(let (bf)
|
||||
(list (setq bf (read-buffer "Buffer A to compare: "
|
||||
(ediff-other-buffer "") t))
|
||||
@ -404,12 +404,12 @@ If this file is a backup, `ediff' it with its original."
|
||||
;;;###autoload
|
||||
(defalias 'ebuffers 'ediff-buffers)
|
||||
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun ediff-buffers3 (buffer-A buffer-B buffer-C
|
||||
&optional startup-hooks job-name)
|
||||
"Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C."
|
||||
(interactive
|
||||
(interactive
|
||||
(let (bf bff)
|
||||
(list (setq bf (read-buffer "Buffer A to compare: "
|
||||
(ediff-other-buffer "") t))
|
||||
@ -433,9 +433,9 @@ If this file is a backup, `ediff' it with its original."
|
||||
|
||||
;;;###autoload
|
||||
(defalias 'ebuffers3 'ediff-buffers3)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; 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
|
||||
&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)))
|
||||
(if (stringp 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)
|
||||
file-B (ediff-make-temp-file buf-B buf-B-file-name))
|
||||
(if buf-C-is-alive
|
||||
(setq file-C (ediff-make-temp-file buf-C buf-C-file-name)))
|
||||
|
||||
|
||||
(ediff-setup (get-buffer buf-A) file-A
|
||||
(get-buffer buf-B) file-B
|
||||
(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))
|
||||
f)
|
||||
(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
|
||||
ediff-last-dir-B
|
||||
ediff-last-dir-B
|
||||
(ediff-strip-last-dir f))
|
||||
nil)
|
||||
(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))
|
||||
f)
|
||||
(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
|
||||
ediff-last-dir-B
|
||||
ediff-last-dir-B
|
||||
(ediff-strip-last-dir f))
|
||||
nil))
|
||||
(ediff-read-file-name "Directory C to compare:"
|
||||
(ediff-read-file-name "Directory C to compare:"
|
||||
(if ediff-use-last-dir
|
||||
ediff-last-dir-C
|
||||
ediff-last-dir-C
|
||||
(ediff-strip-last-dir f))
|
||||
nil)
|
||||
(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))
|
||||
f)
|
||||
(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
|
||||
ediff-last-dir-B
|
||||
ediff-last-dir-B
|
||||
(ediff-strip-last-dir f))
|
||||
nil)
|
||||
(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))
|
||||
f)
|
||||
(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
|
||||
ediff-last-dir-B
|
||||
ediff-last-dir-B
|
||||
(ediff-strip-last-dir f))
|
||||
nil))
|
||||
(ediff-read-file-name "Ancestor directory:"
|
||||
(if ediff-use-last-dir
|
||||
ediff-last-dir-C
|
||||
ediff-last-dir-C
|
||||
(ediff-strip-last-dir f))
|
||||
nil)
|
||||
(read-string "Filter through regular expression: "
|
||||
@ -670,7 +670,7 @@ names. Only the files that are under revision control are taken into account."
|
||||
;;;###autoload
|
||||
(defalias
|
||||
'edir-merge-revisions-with-ancestor
|
||||
'ediff-merge-directory-revisions-with-ancestor)
|
||||
'ediff-merge-directory-revisions-with-ancestor)
|
||||
|
||||
;;;###autoload
|
||||
(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.
|
||||
;; JOBNAME is the symbol indicating the meta-job to be performed.
|
||||
;; 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
|
||||
merge-autostore-dir)
|
||||
;; 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)
|
||||
(error "%s: Directory for storing merged files must be a string"
|
||||
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
|
||||
;; commonalities and differences among directories
|
||||
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
|
||||
(ediff-merge-metajob jobname)
|
||||
(not merge-autostore-dir))
|
||||
(setq merge-autostore-dir
|
||||
(setq merge-autostore-dir
|
||||
(read-file-name "Save merged files in directory: "
|
||||
(if ediff-use-last-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
|
||||
"Directory for saving merged files = Ancestor Directory. Sure? ")
|
||||
(error "Directory merge aborted")))))
|
||||
|
||||
(setq dir-diff-struct (ediff-intersect-directories
|
||||
|
||||
(setq dir-diff-struct (ediff-intersect-directories
|
||||
jobname
|
||||
regexp dir1 dir2 dir3 merge-autostore-dir))
|
||||
(setq startup-hooks
|
||||
@ -744,11 +744,11 @@ names. Only the files that are under revision control are taken into account."
|
||||
(cons `(lambda ()
|
||||
;; tell what to do if the user clicks on a session record
|
||||
(setq ediff-session-action-function (quote ,action))
|
||||
;; set ediff-dir-difference-list
|
||||
;; set ediff-dir-difference-list
|
||||
(setq ediff-dir-difference-list
|
||||
(cdr (quote ,dir-diff-struct))))
|
||||
startup-hooks))
|
||||
(setq meta-buf (ediff-prepare-meta-buffer
|
||||
(setq meta-buf (ediff-prepare-meta-buffer
|
||||
'ediff-filegroup-action
|
||||
(car dir-diff-struct)
|
||||
"*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
|
||||
;; files
|
||||
(defun ediff-directory-revisions-internal (dir1 regexp action jobname
|
||||
(defun ediff-directory-revisions-internal (dir1 regexp action jobname
|
||||
&optional startup-hooks
|
||||
merge-autostore-dir)
|
||||
(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"
|
||||
jobname)))
|
||||
(let (file-list meta-buf)
|
||||
(if (and ediff-autostore-merges
|
||||
(if (and ediff-autostore-merges
|
||||
(ediff-merge-metajob jobname)
|
||||
(not merge-autostore-dir))
|
||||
(setq merge-autostore-dir
|
||||
(setq merge-autostore-dir
|
||||
(read-file-name "Save merged files in directory: "
|
||||
(if ediff-use-last-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
|
||||
"Directory for saving merged file = directory A. Sure? ")
|
||||
(error "Merge of directory revisions aborted")))
|
||||
|
||||
|
||||
(setq file-list
|
||||
(ediff-get-directory-files-under-revision
|
||||
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
|
||||
(setq ediff-session-action-function (quote ,action)))
|
||||
startup-hooks))
|
||||
(setq meta-buf (ediff-prepare-meta-buffer
|
||||
(setq meta-buf (ediff-prepare-meta-buffer
|
||||
'ediff-filegroup-action
|
||||
file-list
|
||||
"*Ediff Session Group Panel"
|
||||
@ -821,7 +821,7 @@ If WIND-B is nil, use window next to WIND-A."
|
||||
(interactive "P")
|
||||
(ediff-windows dumb-mode wind-A wind-B
|
||||
startup-hooks 'ediff-windows-wordwise 'word-mode))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(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.
|
||||
@ -832,7 +832,7 @@ If WIND-B is nil, use window next to WIND-A."
|
||||
(interactive "P")
|
||||
(ediff-windows dumb-mode wind-A wind-B
|
||||
startup-hooks 'ediff-windows-linewise nil))
|
||||
|
||||
|
||||
;; Compare WIND-A and WIND-B, which are selected by clicking.
|
||||
;; With prefix argument, DUMB-MODE, or on a non-windowing display,
|
||||
;; 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))
|
||||
(setq wind-A (ediff-get-window-by-clicking wind-A nil 1)
|
||||
wind-B (ediff-get-window-by-clicking wind-B wind-A 2)))
|
||||
|
||||
|
||||
(let ((buffer-A (window-buffer wind-A))
|
||||
(buffer-B (window-buffer wind-B))
|
||||
beg-A end-A beg-B end-B)
|
||||
|
||||
|
||||
(save-excursion
|
||||
(save-window-excursion
|
||||
(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
|
||||
buffer-A beg-A end-A buffer-B beg-B end-B
|
||||
startup-hooks job-name word-mode nil)))
|
||||
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(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.
|
||||
This function is effective only for relatively small regions, up to 200
|
||||
lines. For large regions, use `ediff-regions-linewise'."
|
||||
(interactive
|
||||
(interactive
|
||||
(let (bf)
|
||||
(list (setq bf (read-buffer "Region's A buffer: "
|
||||
(ediff-other-buffer "") t))
|
||||
@ -893,8 +893,8 @@ lines. For large regions, use `ediff-regions-linewise'."
|
||||
(error "Buffer %S doesn't exist" buffer-A))
|
||||
(if (not (ediff-buffer-live-p buffer-B))
|
||||
(error "Buffer %S doesn't exist" buffer-B))
|
||||
|
||||
|
||||
|
||||
|
||||
(let ((buffer-A
|
||||
(ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-"))
|
||||
(buffer-B
|
||||
@ -907,12 +907,12 @@ lines. For large regions, use `ediff-regions-linewise'."
|
||||
(set-buffer buffer-B)
|
||||
(setq reg-B-beg (region-beginning)
|
||||
reg-B-end (region-end)))
|
||||
|
||||
|
||||
(ediff-regions-internal
|
||||
(get-buffer buffer-A) reg-A-beg reg-A-end
|
||||
(get-buffer buffer-B) reg-B-beg reg-B-end
|
||||
startup-hooks 'ediff-regions-wordwise 'word-mode nil)))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun ediff-regions-linewise (buffer-A buffer-B &optional startup-hooks)
|
||||
"Run Ediff on a pair of regions in specified buffers.
|
||||
@ -923,7 +923,7 @@ region.
|
||||
Each region is enlarged to contain full lines.
|
||||
This function is effective for large regions, over 100-200
|
||||
lines. For small regions, use `ediff-regions-wordwise'."
|
||||
(interactive
|
||||
(interactive
|
||||
(let (bf)
|
||||
(list (setq bf (read-buffer "Region A's buffer: "
|
||||
(ediff-other-buffer "") t))
|
||||
@ -938,7 +938,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
(error "Buffer %S doesn't exist" buffer-A))
|
||||
(if (not (ediff-buffer-live-p buffer-B))
|
||||
(error "Buffer %S doesn't exist" buffer-B))
|
||||
|
||||
|
||||
(let ((buffer-A
|
||||
(ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-"))
|
||||
(buffer-B
|
||||
@ -949,41 +949,41 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
(setq reg-A-beg (region-beginning)
|
||||
reg-A-end (region-end))
|
||||
;; enlarge the region to hold full lines
|
||||
(goto-char reg-A-beg)
|
||||
(goto-char reg-A-beg)
|
||||
(beginning-of-line)
|
||||
(setq reg-A-beg (point))
|
||||
(goto-char reg-A-end)
|
||||
(goto-char reg-A-end)
|
||||
(end-of-line)
|
||||
(or (eobp) (forward-char)) ; include the newline char
|
||||
(setq reg-A-end (point))
|
||||
|
||||
|
||||
(set-buffer buffer-B)
|
||||
(setq reg-B-beg (region-beginning)
|
||||
reg-B-end (region-end))
|
||||
;; enlarge the region to hold full lines
|
||||
(goto-char reg-B-beg)
|
||||
(goto-char reg-B-beg)
|
||||
(beginning-of-line)
|
||||
(setq reg-B-beg (point))
|
||||
(goto-char reg-B-end)
|
||||
(goto-char reg-B-end)
|
||||
(end-of-line)
|
||||
(or (eobp) (forward-char)) ; include the newline char
|
||||
(setq reg-B-end (point))
|
||||
) ; save excursion
|
||||
|
||||
|
||||
(ediff-regions-internal
|
||||
(get-buffer buffer-A) reg-A-beg reg-A-end
|
||||
(get-buffer buffer-B) reg-B-beg reg-B-end
|
||||
startup-hooks 'ediff-regions-linewise nil nil))) ; no word mode
|
||||
|
||||
|
||||
;; 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
|
||||
startup-hooks job-name word-mode
|
||||
setup-parameters)
|
||||
(let ((tmp-buffer (get-buffer-create ediff-tmp-buffer))
|
||||
overl-A overl-B
|
||||
file-A file-B)
|
||||
|
||||
|
||||
;; in case beg/end-A/B aren't markers--make them into markers
|
||||
(ediff-with-current-buffer buffer-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
|
||||
(setq beg-B (move-marker (make-marker) beg-B)
|
||||
end-B (move-marker (make-marker) end-B)))
|
||||
|
||||
|
||||
;; make file-A
|
||||
(if word-mode
|
||||
(ediff-wordify 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"))
|
||||
|
||||
|
||||
;; make file-B
|
||||
(if word-mode
|
||||
(ediff-wordify 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 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))
|
||||
(ediff-setup buffer-A file-A
|
||||
@ -1019,13 +1019,13 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
(cons 'ediff-job-name job-name))
|
||||
setup-parameters))
|
||||
))
|
||||
|
||||
|
||||
|
||||
|
||||
;;; Merge files and buffers
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defalias 'ediff-merge 'ediff-merge-files)
|
||||
|
||||
|
||||
(defsubst ediff-merge-on-startup ()
|
||||
(ediff-do-merge 0)
|
||||
(ediff-with-current-buffer ediff-buffer-C
|
||||
@ -1034,7 +1034,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
;;;###autoload
|
||||
(defun ediff-merge-files (file-A file-B
|
||||
;; MERGE-BUFFER-FILE is the file to be
|
||||
;; associated with the merge buffer
|
||||
;; associated with the merge buffer
|
||||
&optional startup-hooks merge-buffer-file)
|
||||
"Merge two files without ancestor."
|
||||
(interactive
|
||||
@ -1047,10 +1047,10 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
dir-A
|
||||
(ediff-get-default-file-name)
|
||||
'no-dirs))
|
||||
(ediff-read-file-name "File B to merge"
|
||||
(ediff-read-file-name "File B to merge"
|
||||
(setq dir-B
|
||||
(if ediff-use-last-dir
|
||||
ediff-last-dir-B
|
||||
ediff-last-dir-B
|
||||
(file-name-directory f)))
|
||||
(progn
|
||||
(setq file-name-history
|
||||
@ -1062,7 +1062,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
(ediff-get-default-file-name f 1)))
|
||||
)))
|
||||
(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)
|
||||
(expand-file-name
|
||||
(file-name-nondirectory file-A) file-B)
|
||||
@ -1071,7 +1071,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
startup-hooks
|
||||
'ediff-merge-files
|
||||
merge-buffer-file))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun ediff-merge-files-with-ancestor (file-A file-B file-ancestor
|
||||
&optional
|
||||
@ -1091,10 +1091,10 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
dir-A
|
||||
(ediff-get-default-file-name)
|
||||
'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
|
||||
(if ediff-use-last-dir
|
||||
ediff-last-dir-B
|
||||
ediff-last-dir-B
|
||||
(file-name-directory f)))
|
||||
(progn
|
||||
(setq file-name-history
|
||||
@ -1105,7 +1105,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
dir-B))
|
||||
file-name-history))
|
||||
(ediff-get-default-file-name f 1))))
|
||||
(ediff-read-file-name "Ancestor file"
|
||||
(ediff-read-file-name "Ancestor file"
|
||||
(setq dir-ancestor
|
||||
(if ediff-use-last-dir
|
||||
ediff-last-dir-ancestor
|
||||
@ -1120,7 +1120,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
(ediff-get-default-file-name ff 2)))
|
||||
)))
|
||||
(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)
|
||||
(expand-file-name
|
||||
(file-name-nondirectory file-A) file-B)
|
||||
@ -1129,10 +1129,10 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
startup-hooks
|
||||
'ediff-merge-files-with-ancestor
|
||||
merge-buffer-file))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defalias 'ediff-merge-with-ancestor 'ediff-merge-files-with-ancestor)
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun ediff-merge-buffers (buffer-A buffer-B
|
||||
&optional
|
||||
@ -1140,7 +1140,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
;; associated with the merge buffer
|
||||
startup-hooks job-name merge-buffer-file)
|
||||
"Merge buffers without ancestor."
|
||||
(interactive
|
||||
(interactive
|
||||
(let (bf)
|
||||
(list (setq bf (read-buffer "Buffer A to merge: "
|
||||
(ediff-other-buffer "") t))
|
||||
@ -1151,12 +1151,12 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
(save-window-excursion (other-window 1))
|
||||
(ediff-other-buffer bf))
|
||||
t))))
|
||||
|
||||
|
||||
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
|
||||
(or job-name (setq job-name 'ediff-merge-buffers))
|
||||
(ediff-buffers-internal
|
||||
buffer-A buffer-B nil startup-hooks job-name merge-buffer-file))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun ediff-merge-buffers-with-ancestor (buffer-A buffer-B buffer-ancestor
|
||||
&optional
|
||||
@ -1167,7 +1167,7 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
;; with the merge buffer
|
||||
merge-buffer-file)
|
||||
"Merge buffers with ancestor."
|
||||
(interactive
|
||||
(interactive
|
||||
(let (bf bff)
|
||||
(list (setq bf (read-buffer "Buffer A to merge: "
|
||||
(ediff-other-buffer "") t))
|
||||
@ -1186,12 +1186,12 @@ lines. For small regions, use `ediff-regions-wordwise'."
|
||||
(ediff-other-buffer (list bf bff)))
|
||||
t)
|
||||
)))
|
||||
|
||||
|
||||
(setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks))
|
||||
(or job-name (setq job-name 'ediff-merge-buffers-with-ancestor))
|
||||
(ediff-buffers-internal
|
||||
buffer-A buffer-B buffer-ancestor startup-hooks job-name merge-buffer-file))
|
||||
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file)
|
||||
@ -1219,7 +1219,7 @@ buffer."
|
||||
(funcall
|
||||
(intern (format "ediff-%S-merge-internal" ediff-version-control-package))
|
||||
rev1 rev2 nil startup-hooks merge-buffer-file)))
|
||||
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun ediff-merge-revisions-with-ancestor (&optional
|
||||
@ -1269,8 +1269,8 @@ file and then run `run-ediff-from-cvs-buffer'."
|
||||
(if tin
|
||||
(cvs-run-ediff-on-file-descriptor tin)
|
||||
(error "There is no file to merge"))))
|
||||
|
||||
|
||||
|
||||
|
||||
;;; Apply patch
|
||||
|
||||
;;;###autoload
|
||||
@ -1294,7 +1294,7 @@ buffer. If odd -- assume it is in a file."
|
||||
(buffer-file-name patch-buf))))
|
||||
(t default-directory)))
|
||||
(setq source-file
|
||||
(read-file-name
|
||||
(read-file-name
|
||||
"File to patch (directory, if multifile patch): "
|
||||
;; use an explicit initial file
|
||||
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
|
||||
"Which buffer to patch? "
|
||||
(current-buffer))))
|
||||
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(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
|
||||
(defun ediff-revision (&optional file startup-hooks)
|
||||
"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
|
||||
default-directory)
|
||||
(ediff-get-default-file-name)
|
||||
'no-dirs)))
|
||||
'no-dirs)))
|
||||
(find-file file)
|
||||
(if (and (buffer-modified-p)
|
||||
(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): "
|
||||
(file-name-nondirectory file)))
|
||||
rev2
|
||||
(read-string
|
||||
(read-string
|
||||
(format "Revision 2 to compare (default: %s's current state): "
|
||||
(file-name-nondirectory file))))
|
||||
(ediff-load-version-control)
|
||||
@ -1368,8 +1368,8 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
|
||||
|
||||
;;;###autoload
|
||||
(defalias 'erevision 'ediff-revision)
|
||||
|
||||
|
||||
|
||||
|
||||
;; 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.
|
||||
(defun ediff-load-version-control (&optional silent)
|
||||
@ -1420,7 +1420,7 @@ With optional NODE, goes to that node."
|
||||
(progn
|
||||
(select-window ctl-window)
|
||||
(set-window-buffer ctl-window ctl-buf)))))))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
;; in a special buffer. It prompts you to type a key sequence,
|
||||
;; 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.
|
||||
;;
|
||||
;; * `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
|
||||
(setq mac keys)
|
||||
(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))
|
||||
(member keys '("\r" [return])))
|
||||
(or last-kbd-macro
|
||||
|
@ -181,7 +181,7 @@ BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit."
|
||||
(condition-case ()
|
||||
(funcall (or default-major-mode 'fundamental-mode))
|
||||
(error nil))
|
||||
|
||||
|
||||
(set-window-configuration config)
|
||||
(when bury
|
||||
;;>> 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
|
||||
'exit
|
||||
(function (lambda ()
|
||||
(sit-for 0) ;necessary if last command was end-of-buffer or
|
||||
;beginning-of-buffer - otherwise pos-visible-in-window-p
|
||||
(sit-for 0) ;necessary if last command was end-of-buffer or
|
||||
;beginning-of-buffer - otherwise pos-visible-in-window-p
|
||||
;will yield a wrong result.
|
||||
(let ((min (pos-visible-in-window-p (point-min)))
|
||||
(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.
|
||||
(defun electric-help-execute-extended (prefixarg)
|
||||
(interactive "p")
|
||||
@ -407,7 +407,7 @@ will select it.)"
|
||||
(defvar ehelp-map ())
|
||||
(if ehelp-map
|
||||
nil
|
||||
(let ((map (copy-keymap help-map)))
|
||||
(let ((map (copy-keymap help-map)))
|
||||
(substitute-key-definition 'apropos 'electric-apropos map)
|
||||
(substitute-key-definition 'command-apropos 'electric-command-apropos map)
|
||||
(substitute-key-definition 'describe-key 'electric-describe-key map)
|
||||
@ -421,6 +421,6 @@ will select it.)"
|
||||
(setq ehelp-map map)
|
||||
(fset 'ehelp-command map)))
|
||||
|
||||
(provide 'ehelp)
|
||||
(provide 'ehelp)
|
||||
|
||||
;;; ehelp.el ends here
|
||||
|
@ -55,8 +55,8 @@
|
||||
&optional prompt inhibit-quit
|
||||
loop-function loop-state)
|
||||
|
||||
(let (cmd
|
||||
(err nil)
|
||||
(let (cmd
|
||||
(err nil)
|
||||
(prompt-string prompt))
|
||||
(while t
|
||||
(if (not (or (stringp prompt) (eq prompt nil) (eq prompt 'noprompt)))
|
||||
@ -123,7 +123,7 @@
|
||||
(ding)
|
||||
(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
|
||||
;; If there is a window displaying buffer
|
||||
;; Select it
|
||||
|
@ -64,11 +64,11 @@ Differs from `save-excursion' in that it doesn't save the point and mark."
|
||||
,@forms)
|
||||
(set-buffer StartBuffer))))
|
||||
|
||||
(defmacro emerge-defvar-local (var value doc)
|
||||
"Defines SYMBOL as an advertised variable.
|
||||
(defmacro emerge-defvar-local (var value doc)
|
||||
"Defines SYMBOL as an advertised variable.
|
||||
Performs a defvar, then executes `make-variable-buffer-local' on
|
||||
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."
|
||||
`(progn
|
||||
(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
|
||||
;; are given is fixed.
|
||||
;; 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 `~'.
|
||||
;; The code which processes the diff/diff3 output depends on all the
|
||||
;; 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
|
||||
(setq emerge-last-dir-output (file-name-directory output-file)))
|
||||
;; Make sure the entire files are seen, and they reflect what is on disk
|
||||
(emerge-eval-in-buffer
|
||||
(emerge-eval-in-buffer
|
||||
buffer-A
|
||||
(widen)
|
||||
(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 (not (string-equal agreement "2"))
|
||||
(setq list
|
||||
(cons
|
||||
(cons
|
||||
(let (group-1 group-3 pos)
|
||||
(setq pos (point))
|
||||
(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
|
||||
file-a file-b file-anc nil
|
||||
(list `(lambda () (emerge-command-exit ,file-out))))))
|
||||
|
||||
|
||||
(defun emerge-command-exit (file-out)
|
||||
(emerge-write-and-delete file-out)
|
||||
(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
|
||||
nil
|
||||
;; When done, return to this buffer.
|
||||
(list
|
||||
(list
|
||||
`(lambda ()
|
||||
(switch-to-buffer ,(current-buffer))
|
||||
(message "Merge done.")))))
|
||||
@ -1294,7 +1294,7 @@ Otherwise, the A or B file present is copied to the output file."
|
||||
|
||||
;;;###autoload
|
||||
(defun emerge-merge-directories (a-dir b-dir ancestor-dir output-dir)
|
||||
(interactive
|
||||
(interactive
|
||||
(list
|
||||
(read-file-name "A 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
|
||||
(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 ()
|
||||
(let ((n 0))
|
||||
(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."
|
||||
(interactive "P")
|
||||
(emerge-operate-on-windows
|
||||
'scroll-up
|
||||
'scroll-up
|
||||
;; calculate argument to scroll-up
|
||||
;; if there is an explicit argument
|
||||
(if (and arg (not (equal arg '-)))
|
||||
@ -1906,7 +1906,7 @@ buffer after this will cause serious problems."
|
||||
(run-hooks 'emerge-quit-hook)))
|
||||
|
||||
(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
|
||||
is neither the A nor the B variant.
|
||||
A prefix argument forces the variant to be selected
|
||||
@ -2579,15 +2579,15 @@ been edited."
|
||||
(if (= c ?%)
|
||||
(progn
|
||||
(setq i (1+ i))
|
||||
(setq c
|
||||
(setq c
|
||||
(condition-case nil
|
||||
(aref template i)
|
||||
(error ?%)))
|
||||
(cond ((= c ?a)
|
||||
(insert-buffer-substring emerge-A-buffer A-begin A-end))
|
||||
((= c ?b)
|
||||
((= c ?b)
|
||||
(insert-buffer-substring emerge-B-buffer B-begin B-end))
|
||||
((= c ?%)
|
||||
((= c ?%)
|
||||
(insert ?%))
|
||||
(t
|
||||
(insert c))))
|
||||
@ -2848,7 +2848,7 @@ keymap. Leaves merge in fast mode."
|
||||
(while (< x-begin x-end)
|
||||
;; bite off and compare no more than 1000 characters at a time
|
||||
(let* ((compare-length (min (- x-end x-begin) 1000))
|
||||
(x-string (emerge-eval-in-buffer
|
||||
(x-string (emerge-eval-in-buffer
|
||||
buffer-x
|
||||
(buffer-substring x-begin
|
||||
(+ x-begin compare-length))))
|
||||
@ -2863,7 +2863,7 @@ keymap. Leaves merge in fast mode."
|
||||
t)))
|
||||
|
||||
;; 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.
|
||||
(defun emerge-unique-buffer-name (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
|
||||
the value of that variable. The variable name should be terminated
|
||||
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."
|
||||
(let ((start 0))
|
||||
(while (string-match
|
||||
(while (string-match
|
||||
(rx (or (and "$" (submatch (1+ (in "a-zA-Z0-9_"))))
|
||||
(and "${" (submatch (minimal-match (0+ anything))) "}")
|
||||
"$$"))
|
||||
@ -101,13 +101,13 @@ This function works by modifying `process-environment'."
|
||||
(when value
|
||||
(push value setenv-history))
|
||||
;; Here finally we specify the args to give call setenv with.
|
||||
(list var
|
||||
(list var
|
||||
(read-from-minibuffer (format "Set %s to value: " var)
|
||||
nil nil nil 'setenv-history
|
||||
value)
|
||||
nil
|
||||
nil
|
||||
t))))
|
||||
(if unset
|
||||
(if unset
|
||||
(setq value nil)
|
||||
(if substitute-env-vars
|
||||
(setq value (substitute-env-vars value))))
|
||||
|
@ -38,7 +38,7 @@
|
||||
;; insertion. It will be forgotten if you move point or make other
|
||||
;; 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:
|
||||
;; M-g i = "set italic", M-g b = "set bold", etc.
|
||||
|
||||
@ -86,14 +86,14 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
(eval-when-compile
|
||||
(eval-when-compile
|
||||
(require 'help)
|
||||
(require 'button))
|
||||
|
||||
;;; Provide some binding for startup:
|
||||
;;;###autoload (define-key global-map "\M-g" 'facemenu-keymap)
|
||||
;;;###autoload (autoload 'facemenu-keymap "facemenu" "Keymap for face-changing commands." t 'keymap)
|
||||
|
||||
|
||||
;; Global bindings:
|
||||
(define-key global-map [C-down-mouse-2] 'facemenu-menu)
|
||||
(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 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.
|
||||
|
||||
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)
|
||||
|
||||
;;;###autoload
|
||||
(defvar facemenu-foreground-menu
|
||||
(defvar facemenu-foreground-menu
|
||||
(let ((map (make-sparse-keymap "Foreground Color")))
|
||||
(define-key map "o" (cons "Other..." 'facemenu-set-foreground))
|
||||
map)
|
||||
@ -182,7 +182,7 @@ when they are created."
|
||||
(defalias 'facemenu-background-menu facemenu-background-menu)
|
||||
|
||||
;;;###autoload
|
||||
(defvar facemenu-special-menu
|
||||
(defvar facemenu-special-menu
|
||||
(let ((map (make-sparse-keymap "Special")))
|
||||
(define-key map [?s] (cons (purecopy "Remove Special")
|
||||
'facemenu-remove-special))
|
||||
@ -213,7 +213,7 @@ when they are created."
|
||||
;;;###autoload
|
||||
(defvar facemenu-indentation-menu
|
||||
(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))
|
||||
(define-key map [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 "--"))))
|
||||
;;;###autoload
|
||||
(let ((map facemenu-menu))
|
||||
(define-key map [in] (cons (purecopy "Indentation")
|
||||
(define-key map [in] (cons (purecopy "Indentation")
|
||||
'facemenu-indentation-menu))
|
||||
(define-key map [ju] (cons (purecopy "Justification")
|
||||
'facemenu-justification-menu))
|
||||
(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))
|
||||
(define-key map [bg] (cons (purecopy "Background Color")
|
||||
(define-key map [bg] (cons (purecopy "Background Color")
|
||||
'facemenu-background-menu))
|
||||
(define-key map [fg] (cons (purecopy "Foreground Color")
|
||||
(define-key map [fg] (cons (purecopy "Foreground Color")
|
||||
'facemenu-foreground-menu))
|
||||
(define-key map [fc] (cons (purecopy "Face")
|
||||
(define-key map [fc] (cons (purecopy "Face")
|
||||
'facemenu-face-menu)))
|
||||
;;;###autoload
|
||||
(defalias 'facemenu-menu facemenu-menu)
|
||||
|
||||
(defvar facemenu-keymap
|
||||
(defvar facemenu-keymap
|
||||
(let ((map (make-sparse-keymap "Set face")))
|
||||
(define-key map "o" (cons (purecopy "Other...") 'facemenu-set-face))
|
||||
map)
|
||||
@ -328,7 +328,7 @@ requested face.
|
||||
|
||||
Otherwise, this command specifies the face for the next character
|
||||
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
|
||||
(barf-if-buffer-read-only)
|
||||
(read-face-name "Use face"))
|
||||
@ -350,7 +350,7 @@ requested face.
|
||||
|
||||
Otherwise, this command specifies the face for the next character
|
||||
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
|
||||
(barf-if-buffer-read-only)
|
||||
(facemenu-read-color "Foreground color: "))
|
||||
@ -374,7 +374,7 @@ requested face.
|
||||
|
||||
Otherwise, this command specifies the face for the next character
|
||||
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
|
||||
(barf-if-buffer-read-only)
|
||||
(facemenu-read-color "Background color: "))
|
||||
@ -399,7 +399,7 @@ requested face.
|
||||
|
||||
Otherwise, this command specifies the face for the next character
|
||||
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
|
||||
(if (and mark-active (not current-prefix-arg))
|
||||
(region-beginning))
|
||||
@ -407,7 +407,7 @@ typing a character to insert cancels the specification."
|
||||
(region-end))))
|
||||
(barf-if-buffer-read-only)
|
||||
(facemenu-get-face face)
|
||||
(if start
|
||||
(if start
|
||||
(facemenu-add-face face start end)
|
||||
(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."
|
||||
(interactive "*r") ; error if buffer is read-only despite the next line.
|
||||
(let ((inhibit-read-only t))
|
||||
(remove-text-properties
|
||||
(remove-text-properties
|
||||
start end '(face nil mouse-face nil))))
|
||||
|
||||
;;;###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'."
|
||||
(interactive "*r") ; error if buffer is read-only despite the next line.
|
||||
(let ((inhibit-read-only t))
|
||||
(remove-text-properties
|
||||
(remove-text-properties
|
||||
start end '(invisible nil intangible nil read-only nil))))
|
||||
|
||||
;;;###autoload
|
||||
(defun facemenu-read-color (&optional prompt)
|
||||
"Read a color using the minibuffer."
|
||||
(let ((col (completing-read (or prompt "Color: ")
|
||||
(let ((col (completing-read (or prompt "Color: ")
|
||||
(or facemenu-color-alist
|
||||
(defined-colors))
|
||||
nil t)))
|
||||
@ -498,11 +498,11 @@ of colors that the current display can handle."
|
||||
(setq s (point))
|
||||
(insert (car list))
|
||||
(indent-to 20)
|
||||
(put-text-property s (point) 'face
|
||||
(put-text-property s (point) 'face
|
||||
(cons 'background-color (car list)))
|
||||
(setq s (point))
|
||||
(insert " " (car list) "\n")
|
||||
(put-text-property s (point) 'face
|
||||
(put-text-property s (point) 'face
|
||||
(cons 'foreground-color (car 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 menu key (cons name function)))
|
||||
((facemenu-iterate ; check if equivalent face is already in the menu
|
||||
(lambda (m) (and (listp m)
|
||||
(lambda (m) (and (listp m)
|
||||
(symbolp (car m))
|
||||
(face-equal (car m) symbol)))
|
||||
(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."
|
||||
name))))
|
||||
(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))
|
||||
(stringp (cadr m))
|
||||
(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)
|
||||
"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.
|
||||
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."
|
||||
(let ((list (nreverse (mapcar 'car oldlist))))
|
||||
(facemenu-iterate
|
||||
(lambda (new-face)
|
||||
(facemenu-iterate
|
||||
(lambda (new-face)
|
||||
(if (not (memq new-face list))
|
||||
(setq list (cons new-face list)))
|
||||
nil)
|
||||
|
@ -69,7 +69,7 @@
|
||||
;; 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).
|
||||
;; 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:
|
||||
|
@ -109,7 +109,7 @@ as the final argument."
|
||||
(delete-process find))
|
||||
(error nil))
|
||||
(error "Cannot have two processes in `%s' at once" (buffer-name)))))
|
||||
|
||||
|
||||
(widen)
|
||||
(kill-all-local-variables)
|
||||
(setq buffer-read-only nil)
|
||||
@ -134,7 +134,7 @@ as the final argument."
|
||||
;; and later)
|
||||
(dired-simple-subdir-alist)
|
||||
;; 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)
|
||||
(list (cons default-directory (point-min-marker)))))
|
||||
(setq buffer-read-only nil)
|
||||
@ -142,7 +142,7 @@ as the final argument."
|
||||
;; subdir-alist points there.
|
||||
(insert " " dir ":\n")
|
||||
;; Make second line a ``find'' line in analogy to the ``total'' or
|
||||
;; ``wildcard'' line.
|
||||
;; ``wildcard'' line.
|
||||
(insert " " args "\n")
|
||||
;; Start the find process.
|
||||
(let ((proc (start-process-shell-command find-dired-find-program (current-buffer) args)))
|
||||
|
@ -70,9 +70,9 @@
|
||||
;; ("\\.hh$" ff-cc-hh-converter)
|
||||
;; ("\\.c$" (".h"))
|
||||
;; ("\\.h$" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp"))))
|
||||
;;
|
||||
;;
|
||||
;; 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
|
||||
;; 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
|
||||
(format "Find or create %s in: " default-name)
|
||||
default-directory default-name nil)))
|
||||
|
||||
|
||||
(setq pathname
|
||||
(if (file-directory-p name)
|
||||
(concat (file-name-as-directory name) default-name)
|
||||
(setq found name)))
|
||||
|
||||
|
||||
(ff-find-file pathname in-other-window t)))
|
||||
|
||||
(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
|
||||
corresponding to the name of the first file found, or nil."
|
||||
(let ((filename (ff-get-file-name search-dirs filename suffix-list)))
|
||||
|
||||
|
||||
(cond
|
||||
((not filename)
|
||||
nil)
|
||||
@ -627,7 +627,7 @@ corresponding to the name of the first file found, or nil."
|
||||
((bufferp (get-file-buffer filename))
|
||||
(ff-switch-to-buffer (get-file-buffer filename) other-window)
|
||||
filename)
|
||||
|
||||
|
||||
((file-exists-p filename)
|
||||
(ff-find-file filename other-window nil)
|
||||
filename)
|
||||
@ -659,7 +659,7 @@ name of the first file found."
|
||||
(setq this-suffix (car suffixes))
|
||||
(setq this-suffix "")
|
||||
(setq suffixes (list "")))
|
||||
|
||||
|
||||
;; find whether the file is in a buffer first
|
||||
(while (and suffixes (not found))
|
||||
(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 (and dir (not (string-match "\\([^*]*\\)/\\\*\\(/.*\\)*" dir)))
|
||||
(progn
|
||||
|
||||
|
||||
;; suffixes is nil => fname-stub is the file we are looking for
|
||||
;; otherwise fname-stub is a stub, and we append a suffix
|
||||
(if suffixes
|
||||
(setq this-suffix (car suffixes))
|
||||
(setq this-suffix "")
|
||||
(setq suffixes (list "")))
|
||||
|
||||
|
||||
(while (and suffixes (not found))
|
||||
|
||||
(setq filename (concat fname-stub this-suffix))
|
||||
(setq file (concat dir "/" filename))
|
||||
|
||||
|
||||
(if (not ff-quiet-mode)
|
||||
(message "Finding %s..." file))
|
||||
|
||||
(if (file-exists-p file)
|
||||
(setq found file))
|
||||
|
||||
|
||||
(setq suffixes (cdr suffixes))
|
||||
(setq this-suffix (car suffixes))))
|
||||
|
||||
@ -935,7 +935,7 @@ and the name of the file passed in."
|
||||
))
|
||||
(t
|
||||
nil))
|
||||
|
||||
|
||||
return-list))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -29,14 +29,14 @@
|
||||
;; Terminals that use XON/XOFF flow control can cause problems with
|
||||
;; 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
|
||||
;; terminal.
|
||||
;;
|
||||
;; terminal.
|
||||
;;
|
||||
;; 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
|
||||
;; .emacs file. As arguments, give it the names of one or more terminal
|
||||
;; 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")
|
||||
|
||||
;; 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 ?\^q flow-control-c-q-replacement)
|
||||
(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-q-replacement))
|
||||
(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
|
||||
((zerop num-folds)
|
||||
(setq num-folds (length foldout-fold-list)))
|
||||
|
||||
|
||||
;; have we been told not to hide the fold?
|
||||
((< num-folds 0)
|
||||
(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)
|
||||
(font-lock-unfontify-buffer)
|
||||
(font-lock-turn-off-thing-lock))))
|
||||
|
||||
|
||||
(defun turn-on-font-lock ()
|
||||
"Turn on Font Lock mode (only if the terminal can display it)."
|
||||
(unless font-lock-mode
|
||||
|
@ -258,7 +258,7 @@ For most purposes, consider using `format-decode-region' instead."
|
||||
(unwind-protect
|
||||
(progn
|
||||
;; Don't record undo information for the decoding.
|
||||
|
||||
|
||||
(if (null format)
|
||||
;; Figure out which format it is in, remember list in `format'.
|
||||
(let ((try format-alist))
|
||||
@ -296,7 +296,7 @@ For most purposes, consider using `format-decode-region' instead."
|
||||
(setq format (reverse format)))
|
||||
(if visit-flag
|
||||
(setq buffer-file-format format)))
|
||||
|
||||
|
||||
(set-buffer-modified-p mod))
|
||||
|
||||
;; Return new length of region
|
||||
@ -486,7 +486,7 @@ the value of `foo'."
|
||||
;; Now (cdr p) is the cons to delete
|
||||
(setcdr p (cdr cons))
|
||||
list)))
|
||||
|
||||
|
||||
(defun format-make-relatively-unique (a b)
|
||||
"Delete common elements of lists A and B, return as pair.
|
||||
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))
|
||||
(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.
|
||||
Prepends newline if needed. The optional FILL should be a character,
|
||||
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
|
||||
;; 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.
|
||||
;; 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.
|
||||
;;
|
||||
;; === How it works ===
|
||||
@ -60,9 +60,9 @@
|
||||
;; You may also visit the control file, and switch to forms mode by hand
|
||||
;; 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.
|
||||
;;
|
||||
;;
|
||||
;; The control file is visited, evaluated using `eval-current-buffer',
|
||||
;; and should set at least the following variables:
|
||||
;;
|
||||
@ -79,17 +79,17 @@
|
||||
;;
|
||||
;; - a string, e.g. "hello". The string is inserted in the forms
|
||||
;; "as is".
|
||||
;;
|
||||
;;
|
||||
;; - an integer, denoting a field number.
|
||||
;; The contents of this field are inserted at this point.
|
||||
;; Fields are numbered starting with number one.
|
||||
;;
|
||||
;;
|
||||
;; - a function call, e.g. (insert "text").
|
||||
;; This function call is dynamically evaluated and should return a
|
||||
;; string. It should *NOT* have side-effects on the forms being
|
||||
;; constructed. The current fields are available to the function
|
||||
;; in the variable `forms-fields', they should *NOT* be modified.
|
||||
;;
|
||||
;;
|
||||
;; - a lisp symbol, that must evaluate to one of the above.
|
||||
;;
|
||||
;; Optional variables which may be set in the control file:
|
||||
@ -102,7 +102,7 @@
|
||||
;; Non-nil means that the data file is visited
|
||||
;; read-only (view mode) as opposed to edit mode.
|
||||
;; 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]
|
||||
;; If non-nil, a warning will be issued whenever
|
||||
@ -138,26 +138,26 @@
|
||||
;; first record.
|
||||
;;
|
||||
;; 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
|
||||
;; has been read. It can be used to transform
|
||||
;; the contents of the file into a format more suitable
|
||||
;; for forms-mode processing.
|
||||
;;
|
||||
;; 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
|
||||
;; is written (saved) to disk. It can be used to undo
|
||||
;; the effects of `forms-read-file-filter', if any.
|
||||
;;
|
||||
;; 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
|
||||
;; record is created. It can be used to fill in
|
||||
;; the new record with default fields, for example.
|
||||
;;
|
||||
;; 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
|
||||
;; been modified. It is called after the fields
|
||||
;; are parsed. It can be used to register
|
||||
@ -199,7 +199,7 @@
|
||||
;; Normal operation is to transfer one line (record) from the data file,
|
||||
;; split it into fields (into `forms--the-record-list'), and display it
|
||||
;; 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'.
|
||||
;;
|
||||
;; When a form is changed the record is updated as soon as this form
|
||||
@ -236,7 +236,7 @@
|
||||
;; contents of the buffer.
|
||||
;;
|
||||
;; Edit mode commands:
|
||||
;;
|
||||
;;
|
||||
;; TAB forms-next-field
|
||||
;; \C-c TAB forms-next-field
|
||||
;; \C-c < forms-first-record
|
||||
@ -251,9 +251,9 @@
|
||||
;; \C-c \C-r forms-search-backward
|
||||
;; \C-c \C-s forms-search-forward
|
||||
;; \C-c \C-x forms-exit
|
||||
;;
|
||||
;;
|
||||
;; Read-only mode commands:
|
||||
;;
|
||||
;;
|
||||
;; SPC forms-next-record
|
||||
;; DEL forms-prev-record
|
||||
;; ? describe-mode
|
||||
@ -264,12 +264,12 @@
|
||||
;; r forms-search-backward
|
||||
;; s forms-search-forward
|
||||
;; x forms-exit
|
||||
;;
|
||||
;;
|
||||
;; Of course, it is also possible to use the \C-c prefix to obtain the
|
||||
;; 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
|
||||
;; [prior] forms-prev-record
|
||||
;; [begin] forms-first-record
|
||||
@ -301,10 +301,10 @@
|
||||
(provide 'forms) ;;; official
|
||||
(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:
|
||||
|
||||
$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
|
||||
"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
|
||||
"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.")
|
||||
|
||||
(defcustom forms-use-text-properties t
|
||||
@ -417,7 +417,7 @@ Also, initial position is at last record."
|
||||
(defvar forms--dyntexts nil
|
||||
"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.")
|
||||
|
||||
(defvar forms--search-regexp nil
|
||||
@ -445,13 +445,13 @@ Also, initial position is at last record."
|
||||
(defvar forms--rw-face nil
|
||||
"Face used to represent read-write data on the screen.")
|
||||
|
||||
;;;###autoload
|
||||
;;;###autoload
|
||||
(defun forms-mode (&optional primary)
|
||||
"Major mode to visit files in a field-structured manner using a form.
|
||||
|
||||
Commands: Equivalent keys in read-only mode:
|
||||
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-last-record >
|
||||
C-c ? describe-mode ?
|
||||
@ -510,7 +510,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
(setq forms-new-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.
|
||||
(if (fboundp 'make-face)
|
||||
(progn
|
||||
@ -521,7 +521,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
;;(message "forms: processing control file...")
|
||||
;; If enable-local-eval is not set to t the user is asked first.
|
||||
(if (or (eq enable-local-eval t)
|
||||
(yes-or-no-p
|
||||
(yes-or-no-p
|
||||
(concat "Evaluate lisp code in buffer "
|
||||
(buffer-name) " to display forms ")))
|
||||
(eval-current-buffer)
|
||||
@ -529,7 +529,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
|
||||
;; Check if the mandatory variables make sense.
|
||||
(or forms-file
|
||||
(error (concat "Forms control file error: "
|
||||
(error (concat "Forms control file error: "
|
||||
"`forms-file' has not been set")))
|
||||
|
||||
;; 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)
|
||||
(eq (length forms-multi-line) 1))
|
||||
(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'")))
|
||||
(error (concat "Forms control file error: "
|
||||
"`forms-multi-line' must be nil or a one-character string"))))
|
||||
(or (fboundp 'set-text-properties)
|
||||
(setq forms-use-text-properties nil))
|
||||
|
||||
|
||||
;; Validate and process forms-format-list.
|
||||
;;(message "forms: pre-processing format list...")
|
||||
(make-local-variable 'forms--elements)
|
||||
@ -699,7 +699,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
(if (= forms--total-records 0)
|
||||
;;(message "forms: proceeding setup (new file)...")
|
||||
(progn
|
||||
(insert
|
||||
(insert
|
||||
"GNU Emacs Forms Mode version " forms-version "\n\n"
|
||||
(if (file-exists-p forms-file)
|
||||
(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
|
||||
;; concatenated.
|
||||
;; 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
|
||||
;; from the form on the screen.
|
||||
;; 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
|
||||
(this-item 0) ; element in list
|
||||
(prev-item nil)
|
||||
(field-num 0)) ; highest field number
|
||||
(field-num 0)) ; highest field number
|
||||
|
||||
(setq forms-format-list nil) ; gonna rebuild
|
||||
|
||||
@ -785,7 +785,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
(setq prev-item el)))
|
||||
|
||||
;; Try numeric ...
|
||||
((numberp el)
|
||||
((numberp el)
|
||||
|
||||
;; Validate range.
|
||||
(if (or (<= el 0)
|
||||
@ -862,8 +862,8 @@ Commands: Equivalent keys in read-only mode:
|
||||
(defun forms--iif-hook (begin end)
|
||||
"`insert-in-front-hooks' function for read-only segments."
|
||||
|
||||
;; Note start location. By making it a marker that points one
|
||||
;; character beyond the actual location, it is guaranteed to move
|
||||
;; Note start location. By making it a marker that points one
|
||||
;; character beyond the actual location, it is guaranteed to move
|
||||
;; correctly if text is inserted.
|
||||
(or forms--iif-start
|
||||
(setq forms--iif-start (copy-marker (1+ (point)))))
|
||||
@ -874,12 +874,12 @@ Commands: Equivalent keys in read-only mode:
|
||||
'read-only))
|
||||
(progn
|
||||
;; Fetch current properties.
|
||||
(setq forms--iif-properties
|
||||
(setq forms--iif-properties
|
||||
(text-properties-at (1- forms--iif-start)))
|
||||
|
||||
;; Replace them.
|
||||
(let ((inhibit-read-only t))
|
||||
(set-text-properties
|
||||
(set-text-properties
|
||||
(1- forms--iif-start) forms--iif-start
|
||||
(list 'face forms--rw-face 'front-sticky '(face))))
|
||||
|
||||
@ -900,7 +900,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
;; Restore properties.
|
||||
(if forms--iif-start
|
||||
(let ((inhibit-read-only t))
|
||||
(set-text-properties
|
||||
(set-text-properties
|
||||
(1- forms--iif-start) forms--iif-start
|
||||
forms--iif-properties)))
|
||||
|
||||
@ -920,9 +920,9 @@ Commands: Equivalent keys in read-only mode:
|
||||
|
||||
(let ((forms--marker 0)
|
||||
(forms--dyntext 0))
|
||||
(setq
|
||||
(setq
|
||||
forms--format
|
||||
(if forms-use-text-properties
|
||||
(if forms-use-text-properties
|
||||
`(lambda (arg)
|
||||
(let ((inhibit-read-only t))
|
||||
,@(apply 'append
|
||||
@ -957,9 +957,9 @@ Commands: Equivalent keys in read-only mode:
|
||||
;; (let ((inhibit-read-only t))
|
||||
;;
|
||||
;; ;; A string, e.g. "text: ".
|
||||
;; (set-text-properties
|
||||
;; (set-text-properties
|
||||
;; (point)
|
||||
;; (progn (insert "text: ") (point))
|
||||
;; (progn (insert "text: ") (point))
|
||||
;; (list 'face forms--ro-face
|
||||
;; 'read-only 1
|
||||
;; 'insert-in-front-hooks 'forms--iif-hook
|
||||
@ -970,7 +970,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
;; (aset forms--markers 0 (point-marker))
|
||||
;; (insert (elt arg 5))
|
||||
;; (or (= (point) here)
|
||||
;; (set-text-properties
|
||||
;; (set-text-properties
|
||||
;; here (point)
|
||||
;; (list 'face forms--rw-face
|
||||
;; 'front-sticky '(face))))
|
||||
@ -1008,8 +1008,8 @@ Commands: Equivalent keys in read-only mode:
|
||||
|
||||
(cond
|
||||
((stringp el)
|
||||
|
||||
`((set-text-properties
|
||||
|
||||
`((set-text-properties
|
||||
(point) ; start at point
|
||||
(progn ; until after insertion
|
||||
(insert ,el)
|
||||
@ -1020,16 +1020,16 @@ Commands: Equivalent keys in read-only mode:
|
||||
'insert-in-front-hooks '(forms--iif-hook)
|
||||
'rear-nonsticky '(face read-only insert-in-front-hooks
|
||||
intangible)))))
|
||||
|
||||
|
||||
((numberp el)
|
||||
`((let ((here (point)))
|
||||
(aset forms--markers
|
||||
(aset forms--markers
|
||||
,(prog1 forms--marker
|
||||
(setq forms--marker (1+ forms--marker)))
|
||||
(point-marker))
|
||||
(insert (elt arg ,(1- el)))
|
||||
(or (= (point) here)
|
||||
(set-text-properties
|
||||
(set-text-properties
|
||||
here (point)
|
||||
(list 'face forms--rw-face
|
||||
'front-sticky '(face)))))))
|
||||
@ -1038,7 +1038,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
`((set-text-properties
|
||||
(point)
|
||||
(progn
|
||||
(insert (aset forms--dyntexts
|
||||
(insert (aset forms--dyntexts
|
||||
,(prog1 forms--dyntext
|
||||
(setq forms--dyntext (1+ forms--dyntext)))
|
||||
,el))
|
||||
@ -1071,7 +1071,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
;; (insert (aset forms--dyntexts 0 (tocol 40)))
|
||||
;; ... )
|
||||
|
||||
(cond
|
||||
(cond
|
||||
((stringp el)
|
||||
`((insert ,el)))
|
||||
((numberp el)
|
||||
@ -1110,8 +1110,8 @@ Commands: Equivalent keys in read-only mode:
|
||||
(let (here)
|
||||
(goto-char (point-min))
|
||||
,@(apply 'append
|
||||
(mapcar
|
||||
'forms--make-parser-elt
|
||||
(mapcar
|
||||
'forms--make-parser-elt
|
||||
(append forms-format-list (list nil)))))))))
|
||||
|
||||
(forms--debug 'forms--parser))
|
||||
@ -1128,7 +1128,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
(goto-char (setq here (aref forms--markers i)))
|
||||
(if (get-text-property here 'read-only)
|
||||
(aset forms--recordv (aref forms--elements i) nil)
|
||||
(if (setq there
|
||||
(if (setq there
|
||||
(next-single-property-change here 'read-only))
|
||||
(aset forms--recordv (aref forms--elements i)
|
||||
(buffer-substring-no-properties here there))
|
||||
@ -1144,12 +1144,12 @@ Commands: Equivalent keys in read-only mode:
|
||||
;; (lambda nil
|
||||
;; (let (here)
|
||||
;; (goto-char (point-min))
|
||||
;;
|
||||
;;
|
||||
;; ;; "text: "
|
||||
;; (if (not (looking-at "text: "))
|
||||
;; (error "Parse error: cannot find \"text: \""))
|
||||
;; (forward-char 6) ; past "text: "
|
||||
;;
|
||||
;;
|
||||
;; ;; 6
|
||||
;; ;; "\nmore text: "
|
||||
;; (setq here (point))
|
||||
@ -1163,7 +1163,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
;; (error "Parse error: not looking at \"%s\"" forms--dyntext))
|
||||
;; (forward-char (length forms--dyntext))
|
||||
;; (setq forms--dynamic-text (cdr-safe forms--dynamic-text)))
|
||||
;; ...
|
||||
;; ...
|
||||
;; ;; final flush (due to terminator sentinel, see below)
|
||||
;; (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))
|
||||
(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.
|
||||
(kill-buffer forms--file-buffer)
|
||||
|
||||
@ -1260,8 +1260,8 @@ Commands: Equivalent keys in read-only mode:
|
||||
(defun forms--set-keymaps ()
|
||||
"Set the keymaps used in this mode."
|
||||
|
||||
(use-local-map (if forms-read-only
|
||||
forms-mode-ro-map
|
||||
(use-local-map (if forms-read-only
|
||||
forms-mode-ro-map
|
||||
forms-mode-edit-map)))
|
||||
|
||||
(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))
|
||||
)
|
||||
|
||||
(defun forms--mode-commands1 (map)
|
||||
(defun forms--mode-commands1 (map)
|
||||
"Helper routine to define keys."
|
||||
(define-key map [TAB] 'forms-next-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"
|
||||
(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
|
||||
(make-list
|
||||
(- forms-number-of-fields
|
||||
(make-list
|
||||
(- forms-number-of-fields
|
||||
(length forms--the-record-list))
|
||||
"")))))
|
||||
|
||||
@ -1549,7 +1549,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
"Parse contents of form into list of strings."
|
||||
;; The contents of the form are parsed, and a new list of strings
|
||||
;; 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
|
||||
;; fields which were not in the form are not modified.
|
||||
;; 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 the-record
|
||||
(mapconcat 'identity forms--the-record-list forms-field-sep))
|
||||
|
||||
|
||||
(if (string-match (regexp-quote forms-field-sep)
|
||||
(mapconcat 'identity forms--the-record-list ""))
|
||||
(error "Field separator occurs in record - update refused"))
|
||||
|
||||
|
||||
;; Handle multi-line fields, if allowed.
|
||||
(if 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."
|
||||
(interactive)
|
||||
(let
|
||||
((numrec
|
||||
((numrec
|
||||
(save-excursion
|
||||
(set-buffer forms--file-buffer)
|
||||
(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)
|
||||
"Create a new record before 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.
|
||||
If `forms-insert-after is non-nil, the default behavior is to insert
|
||||
after the current record."
|
||||
@ -1808,7 +1808,7 @@ after the current record."
|
||||
(open-line 1)
|
||||
(insert the-record)
|
||||
(beginning-of-line))
|
||||
|
||||
|
||||
(setq forms--current-record ln))
|
||||
|
||||
(setq forms--total-records (1+ forms--total-records))
|
||||
@ -1841,8 +1841,8 @@ after the current record."
|
||||
|
||||
(defun forms-search-forward (regexp)
|
||||
"Search forward for record containing REGEXP."
|
||||
(interactive
|
||||
(list (read-string (concat "Search forward for"
|
||||
(interactive
|
||||
(list (read-string (concat "Search forward for"
|
||||
(if forms--search-regexp
|
||||
(concat " ("
|
||||
forms--search-regexp
|
||||
@ -1877,8 +1877,8 @@ after the current record."
|
||||
|
||||
(defun forms-search-backward (regexp)
|
||||
"Search backward for record containing REGEXP."
|
||||
(interactive
|
||||
(list (read-string (concat "Search backward for"
|
||||
(interactive
|
||||
(list (read-string (concat "Search backward for"
|
||||
(if forms--search-regexp
|
||||
(concat " ("
|
||||
forms--search-regexp
|
||||
@ -1925,8 +1925,8 @@ after writing out the data."
|
||||
(set-buffer forms--file-buffer)
|
||||
(let ((inhibit-read-only t))
|
||||
;; Write file hooks are run via local-write-file-hooks.
|
||||
;; (if write-file-filter
|
||||
;; (save-excursion
|
||||
;; (if write-file-filter
|
||||
;; (save-excursion
|
||||
;; (run-hooks 'write-file-filter)))
|
||||
|
||||
;; 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 "<unbound>" "\n")))
|
||||
(if (fboundp el)
|
||||
(setq ret (concat ret (prin1-to-string (symbol-function el))
|
||||
(setq ret (concat ret (prin1-to-string (symbol-function el))
|
||||
"\n"))))))
|
||||
(save-excursion
|
||||
(set-buffer (get-buffer-create "*forms-mode debug*"))
|
||||
|
@ -41,7 +41,7 @@
|
||||
;; developing the mode itself, then see the Annotations section in the GDB
|
||||
;; 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.
|
||||
|
||||
;;; Code:
|
||||
@ -116,7 +116,7 @@ The following interactive lisp functions help control operation :
|
||||
|
||||
`gdb-many-windows' - Toggle the number of windows gdb uses.
|
||||
`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."
|
||||
;;
|
||||
(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)
|
||||
; 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
|
||||
; annotations.
|
||||
; annotations.
|
||||
; ("error-begin" gdb-error-begin)
|
||||
("display-number-end" gdb-display-number-end)
|
||||
("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
|
||||
(car (cdr (gdb-get-current-item)))))
|
||||
(save-excursion
|
||||
(set-buffer (gdb-get-create-buffer
|
||||
(set-buffer (gdb-get-create-buffer
|
||||
'gdb-partial-output-buffer))
|
||||
(funcall handler))))
|
||||
(t
|
||||
@ -590,7 +590,7 @@ output from a previous command if that happens to be in effect."
|
||||
(error "Output sink phase error 1")))))
|
||||
|
||||
(defun gdb-prompt (ignored)
|
||||
"An annotation handler for `prompt'.
|
||||
"An annotation handler for `prompt'.
|
||||
This sends the next command (if any) to gdb."
|
||||
(let ((sink (gdb-get-output-sink)))
|
||||
(cond
|
||||
@ -714,7 +714,7 @@ output from the current command if that happens to be appropriate."
|
||||
(if (string-equal (frame-parameter frame 'name)
|
||||
gdb-expression-buffer-name)
|
||||
(throw 'frame-exists nil)))
|
||||
(make-frame `((height . ,gdb-window-height)
|
||||
(make-frame `((height . ,gdb-window-height)
|
||||
(width . ,gdb-window-width)
|
||||
(tool-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
|
||||
;; elsewhere.
|
||||
(setq output
|
||||
(gdb-concat-output
|
||||
(gdb-concat-output
|
||||
output
|
||||
(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)
|
||||
|
||||
(defvar gdb-cdir nil "Compilation directory.")
|
||||
(defvar breakpoint-enabled-icon)
|
||||
(defvar breakpoint-enabled-icon)
|
||||
(defvar breakpoint-disabled-icon)
|
||||
|
||||
;;-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)
|
||||
(save-excursion
|
||||
(set-buffer
|
||||
(find-file-noselect
|
||||
(find-file-noselect
|
||||
(if (file-exists-p file) file
|
||||
(expand-file-name file gdb-cdir))))
|
||||
(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
|
||||
(save-excursion
|
||||
(goto-line (string-to-number line))
|
||||
(let ((start (progn (beginning-of-line)
|
||||
(let ((start (progn (beginning-of-line)
|
||||
(- (point) 1)))
|
||||
(end (progn (end-of-line) (+ (point) 1))))
|
||||
(if (display-graphic-p)
|
||||
(progn
|
||||
(remove-images start end)
|
||||
(if (eq ?y flag)
|
||||
(put-image breakpoint-enabled-icon
|
||||
(put-image breakpoint-enabled-icon
|
||||
(point)
|
||||
"breakpoint icon enabled"
|
||||
'left-margin)
|
||||
@ -1387,7 +1387,7 @@ output from the current command if that happens to be appropriate."
|
||||
(list
|
||||
(concat
|
||||
(if (eq ?y (char-after (match-beginning 2)))
|
||||
"server disable "
|
||||
"server disable "
|
||||
"server enable ")
|
||||
(match-string 1) "\n")
|
||||
'ignore)))))
|
||||
@ -1564,7 +1564,7 @@ the source buffer."
|
||||
gdb-info-locals-handler
|
||||
gdb-info-locals-custom)
|
||||
|
||||
;; Abbreviate for arrays and structures.
|
||||
;; Abbreviate for arrays and structures.
|
||||
;; These can be expanded using gud-display.
|
||||
(defun gdb-info-locals-handler nil
|
||||
(gdb-set-pending-triggers (delq 'gdb-invalidate-locals
|
||||
@ -1646,7 +1646,7 @@ the source buffer."
|
||||
(while (< (point) (- (point-max) 1))
|
||||
(forward-line 1)
|
||||
(if (looking-at "\\([0-9]+\\): \\([ny]\\)")
|
||||
(setq display-list
|
||||
(setq display-list
|
||||
(cons (string-to-int (match-string 1)) display-list)))
|
||||
(end-of-line)))
|
||||
(if (not (display-graphic-p))
|
||||
@ -1654,10 +1654,10 @@ the source buffer."
|
||||
(dolist (buffer (buffer-list))
|
||||
(if (string-match "\\*display \\([0-9]+\\)\\*" (buffer-name buffer))
|
||||
(progn
|
||||
(let ((number
|
||||
(let ((number
|
||||
(match-string 1 (buffer-name buffer))))
|
||||
(if (not (memq (string-to-int number) display-list))
|
||||
(kill-buffer
|
||||
(kill-buffer
|
||||
(get-buffer (concat "*display " number "*")))))))))
|
||||
(gdb-delete-frames display-list))))
|
||||
|
||||
@ -2233,17 +2233,17 @@ BUFFER nil or omitted means use the current buffer."
|
||||
|
||||
(defun gdb-get-current-frame ()
|
||||
(if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers)))
|
||||
(progn
|
||||
(progn
|
||||
(gdb-enqueue-idle-input
|
||||
(list (concat "server frame\n") 'gdb-frame-handler))
|
||||
(gdb-set-pending-triggers
|
||||
(gdb-set-pending-triggers
|
||||
(cons 'gdb-get-current-frame
|
||||
(gdb-get-pending-triggers))))))
|
||||
|
||||
(defun gdb-frame-handler ()
|
||||
(gdb-set-pending-triggers
|
||||
(gdb-set-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))
|
||||
(goto-char (point-min))
|
||||
(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
|
||||
(cons file-found
|
||||
(string-to-int
|
||||
(let
|
||||
(let
|
||||
((numstr (match-string 4 gud-marker-acc)))
|
||||
(if (string-match "," 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))
|
||||
(progn
|
||||
(if
|
||||
(yes-or-no-p
|
||||
(yes-or-no-p
|
||||
(format "File %s changed on disk. Reread from disk? "
|
||||
(buffer-name)))
|
||||
(revert-buffer t t)
|
||||
@ -2576,8 +2576,8 @@ Obeying it means displaying in another window the specified file and line."
|
||||
((eq key ?a)
|
||||
(setq subst (gud-read-address)))
|
||||
((eq key ?c)
|
||||
(setq subst
|
||||
(gud-find-class
|
||||
(setq subst
|
||||
(gud-find-class
|
||||
(if insource
|
||||
(buffer-file-name)
|
||||
(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
|
||||
;; with the 'topmost-intro symbol, there may be
|
||||
;; nested classes...
|
||||
(while (not (eq 'topmost-intro
|
||||
(while (not (eq 'topmost-intro
|
||||
(car (car (c-guess-basic-syntax)))))
|
||||
;; Check if the current position c-syntactic
|
||||
;; analysis has 'inclass
|
||||
(setq syntax (c-guess-basic-syntax))
|
||||
(while
|
||||
(while
|
||||
(and (not (eq 'inclass (car (car 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)))
|
||||
))
|
||||
(string-match (concat (car nclass) "$") class-found)
|
||||
(setq class-found
|
||||
(setq class-found
|
||||
(replace-match (mapconcat 'identity nclass "$")
|
||||
t t class-found)))))
|
||||
(if (not class-found)
|
||||
|
@ -91,7 +91,7 @@ With ARG, you are asked to choose which language."
|
||||
(newline n))
|
||||
;; Some people get confused by the large gap.
|
||||
(newline (/ n 2))
|
||||
|
||||
|
||||
;; Skip the [...] line (don't delete it).
|
||||
(forward-line 1)
|
||||
(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)
|
||||
string
|
||||
(format "%s (translated from %s)" string otherstring))))))
|
||||
|
||||
|
||||
(defun describe-key-briefly (key &optional insert untranslated)
|
||||
"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.
|
||||
|
@ -130,10 +130,10 @@ A sample format:
|
||||
00000050: 6162 6c65 2041 5343 4949 2063 6861 7261 able ASCII chara
|
||||
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
|
||||
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
|
||||
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..
|
||||
|
||||
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.
|
||||
Customize the variable `hexl-follow-ascii' to disable this feature."
|
||||
(interactive "P")
|
||||
(let ((on-p (if arg
|
||||
(let ((on-p (if arg
|
||||
(> (prefix-numeric-value arg) 0)
|
||||
(not hexl-ascii-overlay))))
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
;; Boston, MA 02111-1307, USA.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;;
|
||||
;; With the hi-lock commands text matching interactively entered
|
||||
;; regexp's can be highlighted. For example, `M-x highlight-regexp
|
||||
;; RET clearly RET RET' will highlight all occurrences of `clearly'
|
||||
@ -58,7 +58,7 @@
|
||||
;; to the edit menu.
|
||||
;;
|
||||
;; (hi-lock-mode 1)
|
||||
;;
|
||||
;;
|
||||
;; You might also want to bind the hi-lock commands to more
|
||||
;; finger-friendly sequences:
|
||||
|
||||
@ -259,7 +259,7 @@ which can be called interactively, are:
|
||||
Highlight matches of phrase PHRASE in current buffer with FACE.
|
||||
(PHRASE can be any REGEXP, but spaces will be replaced by matches
|
||||
to whitespace and initial lower-case letters will become case insensitive.)
|
||||
|
||||
|
||||
\\[highlight-lines-matching-regexp] REGEXP 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
|
||||
;; it on to active mode to see them, then toggle it back off to avoid
|
||||
;; distraction.
|
||||
;;
|
||||
;;
|
||||
;; When active, changes are displayed in `highlight-changes-face'. When
|
||||
;; text is deleted, the following character is displayed in
|
||||
;; `highlight-changes-delete-face' face.
|
||||
@ -75,18 +75,18 @@
|
||||
;; modes. The variable
|
||||
;; `highlight-changes-mode' contains the new
|
||||
;; state (`active' or `passive'.)
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
;; Example usage:
|
||||
;; (defun my-highlight-changes-enable-hook ()
|
||||
;; (add-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)
|
||||
;; )
|
||||
;;
|
||||
;;
|
||||
;; (defun my-highlight-changes-disable-hook ()
|
||||
;; (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-disable-hook
|
||||
;; 'my-highlight-changes-disable-hook)
|
||||
@ -99,29 +99,29 @@
|
||||
;;
|
||||
;; If you prefer to have it automatically invoked you can do it as
|
||||
;; follows.
|
||||
;;
|
||||
;;
|
||||
;; 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:
|
||||
;; (add-hook 'c-mode-hook 'highlight-changes-mode)
|
||||
;;
|
||||
;; If you want to make it start up in passive mode (regardless of the
|
||||
;; setting of highlight-changes-initial-state):
|
||||
;; (add-hook 'emacs-lisp-mode-hook
|
||||
;; (add-hook 'emacs-lisp-mode-hook
|
||||
;; (lambda ()
|
||||
;; (highlight-changes-mode 'passive)))
|
||||
;;
|
||||
;; However, this cannot be done for Fundamental mode for there is no
|
||||
;; 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,
|
||||
;; toggles on or off global Highlight Changes mode. When activated, it turns
|
||||
;; on Highlight Changes mode in all "suitable" existing buffers and will turn
|
||||
;; it on in new "suitable" buffers to be created.
|
||||
;;
|
||||
;;
|
||||
;; A buffer's "suitability" is determined by variable
|
||||
;; `highlight-changes-global-modes', as follows. If the variable is
|
||||
;; * nil -- then no buffers are suitable;
|
||||
@ -148,7 +148,7 @@
|
||||
;; highlight-changes-rotate-faces
|
||||
;; highlight-compare-with-file
|
||||
|
||||
;;
|
||||
;;
|
||||
;; You can automatically rotate faces when the buffer is saved;
|
||||
;; see function `highlight-changes-rotate-faces' for how to do this.
|
||||
;;
|
||||
@ -177,7 +177,7 @@
|
||||
;; R Sharman (rsharman@magma.ca) Feb 1998:
|
||||
;; - initial release as change-mode.
|
||||
;; 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
|
||||
;; Marijn Ros <J.M.Ros@fys.ruu.nl> Mar 98
|
||||
;; - suggested turning it on by default
|
||||
@ -225,7 +225,7 @@
|
||||
|
||||
;; 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)
|
||||
;; defaults for light background:
|
||||
'( "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'."
|
||||
:type '(repeat color)
|
||||
:group 'highlight-changes)
|
||||
|
||||
|
||||
|
||||
;; If you invoke highlight-changes-mode with no argument, should it start in
|
||||
;; active or passive mode?
|
||||
@ -299,7 +299,7 @@ Examples:
|
||||
(c-mode c++-mode)
|
||||
means that Highlight Changes mode is turned on for buffers in C and C++
|
||||
modes only."
|
||||
:type '(choice
|
||||
:type '(choice
|
||||
(const :tag "all non-special buffers visiting files" t)
|
||||
(set :menu-tag "specific modes" :tag "modes"
|
||||
: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
|
||||
`highlight-changes-colours'."
|
||||
:type '(choice
|
||||
(repeat
|
||||
(repeat
|
||||
:notify hilit-chg-cust-fix-changes-face-list
|
||||
face )
|
||||
(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)))
|
||||
|
||||
;;;###autoload
|
||||
(defun highlight-changes-remove-highlight (beg end)
|
||||
"Remove the change face from the region between BEG and END.
|
||||
(defun highlight-changes-remove-highlight (beg end)
|
||||
"Remove the change face from the region between BEG and END.
|
||||
This allows you to manually remove highlighting from uninteresting changes."
|
||||
(interactive "r")
|
||||
(let ((after-change-functions nil))
|
||||
(remove-text-properties beg end '(hilit-chg nil))
|
||||
(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)
|
||||
"Record changes and optionally display them in a distinctive face.
|
||||
`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
|
||||
(progn
|
||||
;; 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
|
||||
;; immediately makes a correction, and when deleting first
|
||||
;; 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)
|
||||
(let ((after-change-functions nil))
|
||||
(hilit-chg-hide-changes)
|
||||
(hilit-chg-map-changes
|
||||
(hilit-chg-map-changes
|
||||
'(lambda (prop start stop)
|
||||
(remove-text-properties start stop '(hilit-chg nil))))
|
||||
)
|
||||
@ -616,7 +616,7 @@ This removes all saved change information."
|
||||
(defun highlight-changes-mode (&optional arg)
|
||||
"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
|
||||
or passive state as determined by the variable
|
||||
`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:
|
||||
\\[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
|
||||
buffer with the contents of a file
|
||||
\\[highlight-changes-remove-highlight] - remove the change face from the region
|
||||
\\[highlight-changes-rotate-faces] - rotate different \"ages\" of changes \
|
||||
through
|
||||
through
|
||||
various faces.
|
||||
|
||||
Hook variables:
|
||||
@ -732,20 +732,20 @@ Hook variables:
|
||||
;; so we pick up any changes?
|
||||
(if (or (null highlight-changes-face-list) ; Don't do it if it
|
||||
force) ; already exists unless FORCE non-nil.
|
||||
(let ((p highlight-changes-colours)
|
||||
(let ((p highlight-changes-colours)
|
||||
(n 1) name)
|
||||
(setq highlight-changes-face-list nil)
|
||||
(while p
|
||||
(setq name (intern (format "highlight-changes-face-%d" n)))
|
||||
(copy-face 'highlight-changes-face name)
|
||||
(set-face-foreground name (car p))
|
||||
(setq highlight-changes-face-list
|
||||
(setq highlight-changes-face-list
|
||||
(append highlight-changes-face-list (list name)))
|
||||
(setq p (cdr p))
|
||||
(setq n (1+ n)))))
|
||||
(setq hilit-chg-list (list 'hilit-chg 'highlight-changes-face))
|
||||
(let ((p highlight-changes-face-list)
|
||||
(n 1)
|
||||
(n 1)
|
||||
last-category last-face)
|
||||
(while p
|
||||
(setq last-category (intern (format "change-%d" n)))
|
||||
@ -829,7 +829,7 @@ changes are made, so \\[highlight-changes-next-change] and
|
||||
"" ;; directory
|
||||
nil ;; default
|
||||
'yes ;; must exist
|
||||
(let ((f (make-backup-file-name
|
||||
(let ((f (make-backup-file-name
|
||||
(or (buffer-file-name (current-buffer))
|
||||
(error "no file for this buffer")))))
|
||||
(if (file-exists-p f) f "")))))
|
||||
@ -885,7 +885,7 @@ changes are made, so \\[highlight-changes-next-change] and
|
||||
(setq p (cdr p))
|
||||
(setq q (cdr q)))
|
||||
(if existing-buf
|
||||
(set-buffer-modified-p nil)
|
||||
(set-buffer-modified-p nil)
|
||||
(kill-buffer buf-b))))
|
||||
|
||||
|
||||
@ -901,7 +901,7 @@ changes are made, so \\[highlight-changes-next-change] and
|
||||
|
||||
|
||||
(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
|
||||
(defvar x) ;; placate the byte-compiler
|
||||
(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
|
||||
;; 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
|
||||
;; 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.
|
||||
(if (string-match "^[ *]" (buffer-name))
|
||||
nil ;; (message "ignoring this 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.
|
||||
(or highlight-changes-mode ;; don't turn it on if it already is
|
||||
(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 `active', turn it on in active 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
|
||||
on for future \"suitable\" buffers (and for \"suitable\" existing buffers if
|
||||
variable `highlight-changes-global-changes-existing-buffers' is non-nil).
|
||||
\"Suitability\" is determined by variable `highlight-changes-global-modes'."
|
||||
|
||||
(interactive
|
||||
(interactive
|
||||
(list
|
||||
(cond
|
||||
((null current-prefix-arg)
|
||||
@ -1023,7 +1023,7 @@ variable `highlight-changes-global-changes-existing-buffers' is non-nil).
|
||||
'passive)
|
||||
;; negative interactive arg - turn it off
|
||||
(t
|
||||
(setq global-highlight-changes nil)
|
||||
(setq global-highlight-changes nil)
|
||||
nil))))
|
||||
|
||||
(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 'find-file-hooks 'hilit-chg-check-global)
|
||||
(if highlight-changes-global-changes-existing-buffers
|
||||
(hilit-chg-update-all-buffers
|
||||
(hilit-chg-update-all-buffers
|
||||
highlight-changes-global-initial-state)))
|
||||
|
||||
|
||||
(message "Turning OFF global Highlight Changes mode")
|
||||
(remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
|
||||
(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.
|
||||
|
||||
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 ` ')
|
||||
- the buffer's mode is suitable as per variable
|
||||
`highlight-changes-global-modes'
|
||||
- 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."
|
||||
(or highlight-changes-mode ; do nothing if already on
|
||||
(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)))
|
||||
(memq major-mode highlight-changes-global-modes)))
|
||||
(t
|
||||
(and
|
||||
(and
|
||||
(not (string-match "^[ *]" (buffer-name)))
|
||||
(buffer-file-name))))
|
||||
(progn
|
||||
(hilit-chg-set value)
|
||||
(run-hooks 'highlight-changes-enable-hook)))))
|
||||
|
||||
|
||||
|
||||
(defun hilit-chg-turn-off-maybe ()
|
||||
(if highlight-changes-mode
|
||||
@ -1111,7 +1111,7 @@ from `global-highlight-changes' when turning on global Highlight Changes mode."
|
||||
;; )
|
||||
;; beg end
|
||||
;; ))
|
||||
;;
|
||||
;;
|
||||
;; ================== end of debug ===============
|
||||
|
||||
(provide 'hilit-chg)
|
||||
|
@ -88,7 +88,7 @@ regardless of any active filters in this buffer."
|
||||
|
||||
(defvar ibuffer-tmp-hide-regexps nil
|
||||
"A list of regexps which should match buffer names to not show.")
|
||||
|
||||
|
||||
(defvar ibuffer-tmp-show-regexps nil
|
||||
"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 . idl-mode)
|
||||
(mode . lisp-mode)))))
|
||||
|
||||
|
||||
"An alist of filter qualifiers to switch between.
|
||||
|
||||
This variable should look like ((\"STRING\" QUALIFIERS)
|
||||
@ -170,7 +170,7 @@ The QUALIFIER should be the same as QUALIFIER in
|
||||
:group 'ibuffer)
|
||||
|
||||
(defcustom ibuffer-saved-filter-groups nil
|
||||
|
||||
|
||||
"An alist of filtering groups to switch between.
|
||||
|
||||
This variable should look like ((\"STRING\" QUALIFIERS)
|
||||
@ -921,7 +921,7 @@ of replacing the current filters."
|
||||
(concat "Filter: " (mapconcat #'ibuffer-format-qualifier
|
||||
(cdr (assq filter ibuffer-filter-groups))
|
||||
" ") "\n")))
|
||||
|
||||
|
||||
(defun ibuffer-format-qualifier (qualifier)
|
||||
(if (eq (car-safe qualifier) 'not)
|
||||
(concat " [NOT" (ibuffer-format-qualifier-1 (cdr qualifier)) "]")
|
||||
@ -939,7 +939,7 @@ of replacing the current filters."
|
||||
(unless qualifier
|
||||
(error "Ibuffer: bad qualifier %s" qualifier))
|
||||
(concat " [" (cadr type) ": " (format "%s]" (cdr qualifier)))))))
|
||||
|
||||
|
||||
|
||||
(defun ibuffer-list-buffer-modes ()
|
||||
"Create an alist of buffer modes currently in use.
|
||||
|
@ -125,7 +125,7 @@ change its definition, you should explicitly call
|
||||
|
||||
;;;###autoload
|
||||
(defmacro* define-ibuffer-sorter (name documentation
|
||||
(&key
|
||||
(&key
|
||||
description)
|
||||
&rest body)
|
||||
"Define a method of sorting named NAME.
|
||||
@ -152,7 +152,7 @@ value if and only if `a' is \"less than\" `b'."
|
||||
;;;###autoload
|
||||
(defmacro* define-ibuffer-op (op args
|
||||
documentation
|
||||
(&key
|
||||
(&key
|
||||
interactive
|
||||
mark
|
||||
modifier-p
|
||||
@ -253,7 +253,7 @@ macro for exactly what it does."
|
||||
|
||||
;;;###autoload
|
||||
(defmacro* define-ibuffer-filter (name documentation
|
||||
(&key
|
||||
(&key
|
||||
reader
|
||||
description)
|
||||
&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
|
||||
bound to the current value of the filter."
|
||||
(let ((fn-name (intern (concat "ibuffer-filter-by-" (symbol-name name)))))
|
||||
`(progn
|
||||
`(progn
|
||||
(defun ,fn-name (qualifier)
|
||||
,(concat (or documentation "This filter is not documented."))
|
||||
(interactive (list ,reader))
|
||||
|
@ -364,12 +364,12 @@ directory, like `default-directory'."
|
||||
(define-key map (kbd "* e") 'ibuffer-mark-dissociated-buffers)
|
||||
(define-key map (kbd "* h") 'ibuffer-mark-help-buffers)
|
||||
(define-key map (kbd ".") 'ibuffer-mark-old-buffers)
|
||||
|
||||
|
||||
(define-key map (kbd "d") 'ibuffer-mark-for-delete)
|
||||
(define-key map (kbd "C-d") 'ibuffer-mark-for-delete-backwards)
|
||||
(define-key map (kbd "k") 'ibuffer-mark-for-delete)
|
||||
(define-key map (kbd "x") 'ibuffer-do-kill-on-deletion-marks)
|
||||
|
||||
|
||||
;; immediate operations
|
||||
(define-key map (kbd "n") '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 "/ X") 'ibuffer-delete-saved-filter-groups)
|
||||
(define-key map (kbd "/ \\") 'ibuffer-clear-filter-groups)
|
||||
|
||||
|
||||
(define-key map (kbd "q") 'ibuffer-quit)
|
||||
(define-key map (kbd "h") '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 "% m") 'ibuffer-mark-by-mode-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 "|") '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 "W") 'ibuffer-do-view-and-eval)
|
||||
(define-key map (kbd "X") 'ibuffer-do-shell-command-pipe)
|
||||
|
||||
|
||||
(define-key map (kbd "k") 'ibuffer-do-kill-lines)
|
||||
(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"))
|
||||
(define-key-after map [menu-bar mark unmark-all]
|
||||
'(menu-item "Unmark All" ibuffer-unmark-all))
|
||||
|
||||
|
||||
(define-key-after map [menu-bar mark dashes]
|
||||
'("--"))
|
||||
|
||||
|
||||
(define-key-after map [menu-bar mark mark-by-name-regexp]
|
||||
'(menu-item "Mark by buffer name (regexp)..." ibuffer-mark-by-name-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]
|
||||
'(menu-item "Eval (viewing buffer)..." ibuffer-do-view-and-eval
|
||||
:help "Evaluate a Lisp form in each marked buffer while viewing it"))
|
||||
|
||||
|
||||
(setq ibuffer-mode-map map
|
||||
ibuffer-mode-operate-map operate-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
|
||||
(if (or (> (incf attempts) 4)
|
||||
(and (stringp (cadr err))
|
||||
;; This definitely falls in the
|
||||
;; This definitely falls in the
|
||||
;; ghetto hack category...
|
||||
(not (string-match "too small" (cadr err)))))
|
||||
(apply #'signal err)
|
||||
@ -1338,7 +1338,7 @@ If point is on a group name, this function operates on that group."
|
||||
(if uncompiledp
|
||||
ibuffer-filter-format-alist
|
||||
ibuffer-compiled-filter-formats))))))
|
||||
|
||||
|
||||
(defun ibuffer-current-format (&optional uncompiledp)
|
||||
(or ibuffer-current-format
|
||||
(setq ibuffer-current-format 0))
|
||||
@ -1366,7 +1366,7 @@ If point is on a group name, this function operates on that group."
|
||||
elide nil))
|
||||
(list sym min max align elide)))
|
||||
form))
|
||||
|
||||
|
||||
(defun ibuffer-compile-make-eliding-form (strvar elide from-end-p)
|
||||
(let ((ellipsis (propertize ibuffer-eliding-string 'font-lock-face 'bold)))
|
||||
(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)
|
||||
(get (car form) 'ibuffer-column-summarizer))
|
||||
(put (car form) 'ibuffer-column-summary nil))))
|
||||
|
||||
|
||||
(defun ibuffer-check-formats ()
|
||||
(when (null ibuffer-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
|
||||
'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)))
|
||||
|
||||
|
||||
(define-ibuffer-column size (:inline t)
|
||||
(format "%s" (buffer-size)))
|
||||
|
||||
@ -1698,7 +1698,7 @@ If point is on a group name, this function operates on that group."
|
||||
(ibuffer-current-format)))
|
||||
(when ibuffer-shrink-to-minimum-size
|
||||
(ibuffer-shrink-to-fit)))))))
|
||||
|
||||
|
||||
(defun ibuffer-map-on-mark (mark func)
|
||||
(ibuffer-map-lines
|
||||
#'(lambda (buf mk)
|
||||
@ -1817,7 +1817,7 @@ the value of point at the beginning of the line for that buffer."
|
||||
(funcall pred buf))
|
||||
(setq hit t)))
|
||||
hit))
|
||||
|
||||
|
||||
(defun ibuffer-filter-buffers (ibuffer-buf last bmarklist all)
|
||||
(let ((ext-loaded (featurep 'ibuf-ext)))
|
||||
(delq nil
|
||||
@ -2300,7 +2300,7 @@ Filter group commands:
|
||||
'\\[ibuffer-save-filter-groups]' - Save the current groups with a name.
|
||||
'\\[ibuffer-switch-to-saved-filter-groups]' - Restore previously saved groups.
|
||||
'\\[ibuffer-delete-saved-filter-groups]' - Delete previously saved groups.
|
||||
|
||||
|
||||
Sorting commands:
|
||||
|
||||
'\\[ibuffer-toggle-sorting-mode]' - Rotate between the various sorting modes.
|
||||
|
@ -71,7 +71,7 @@
|
||||
|
||||
(defcustom icomplete-mode nil
|
||||
"*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.
|
||||
Setting this variable directly does not take effect;
|
||||
use either \\[customize] or the function `icomplete-mode'."
|
||||
|
208
lisp/ido.el
208
lisp/ido.el
@ -26,7 +26,7 @@
|
||||
;;; Acknowledgements
|
||||
|
||||
;; 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.
|
||||
;; 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
|
||||
;; presented with the list of all the buffers
|
||||
;;
|
||||
;; Buffer: {123456,123}
|
||||
;; Buffer: {123456,123}
|
||||
;;
|
||||
;; If I then press 2:
|
||||
;; Buffer: 2[3]{123456,123}
|
||||
@ -156,7 +156,7 @@
|
||||
;; drive, enter X:/ where X is the drive letter. You can also visit
|
||||
;; files on other hosts using the ange-ftp notations `/host:' and
|
||||
;; `/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
|
||||
;; 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
|
||||
should be enabled. The following values are possible:
|
||||
- `buffer': Turn only on ido buffer behavior \(switching, killing,
|
||||
displaying...)
|
||||
displaying...)
|
||||
- `file': Turn only on ido file behavior \(finding, writing, inserting...)
|
||||
- `both': Turn on ido buffer and file behavior.
|
||||
- `nil': Turn off any ido switching.
|
||||
@ -359,7 +359,7 @@ use either \\[customize] or the function `ido-mode'."
|
||||
:link '(emacs-commentary-link "ido.el")
|
||||
:set-after '(ido-save-directory-list-file)
|
||||
: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 both buffer and file" both)
|
||||
(const :tag "Switch off all" nil))
|
||||
@ -446,10 +446,10 @@ Possible values:
|
||||
frame or in the other frame.
|
||||
`always-frame' If a file is visible in another frame, raise that
|
||||
frame. Otherwise, visit the file in the same window."
|
||||
:type '(choice (const samewindow)
|
||||
:type '(choice (const samewindow)
|
||||
(const otherwindow)
|
||||
(const display)
|
||||
(const otherframe)
|
||||
(const otherframe)
|
||||
(const maybe-frame)
|
||||
(const always-frame))
|
||||
:group 'ido)
|
||||
@ -457,10 +457,10 @@ Possible values:
|
||||
(defcustom ido-default-buffer-method 'always-frame
|
||||
"*How to switch to new buffer when using `ido-switch-buffer'.
|
||||
See ido-default-file-method for details."
|
||||
:type '(choice (const samewindow)
|
||||
:type '(choice (const samewindow)
|
||||
(const otherwindow)
|
||||
(const display)
|
||||
(const otherframe)
|
||||
(const otherframe)
|
||||
(const maybe-frame)
|
||||
(const always-frame))
|
||||
: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
|
||||
"*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."
|
||||
:type '(choice (const :tag "Never" nil)
|
||||
:type '(choice (const :tag "Never" nil)
|
||||
(const :tag "When typing /" slash)
|
||||
(other :tag "Always" t))
|
||||
: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.
|
||||
Choices are 'always to create new buffers unconditionally, 'prompt to
|
||||
ask user whether to create buffer, or 'never to never create new buffer."
|
||||
:type '(choice (const always)
|
||||
:type '(choice (const always)
|
||||
(const prompt)
|
||||
(const never))
|
||||
: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,
|
||||
5th and 6th elements are used as brackets around the common match string which
|
||||
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)."
|
||||
:type '(repeat string)
|
||||
:group 'ido)
|
||||
@ -694,19 +694,19 @@ subdirs in the alternatives."
|
||||
"*Font used by ido for highlighting first match."
|
||||
:group 'ido)
|
||||
|
||||
(defface ido-only-match-face '((((class color))
|
||||
(defface ido-only-match-face '((((class color))
|
||||
(:foreground "ForestGreen"))
|
||||
(t (:italic t)))
|
||||
"*Font used by ido for highlighting only match."
|
||||
:group 'ido)
|
||||
|
||||
(defface ido-subdir-face '((((class color))
|
||||
(defface ido-subdir-face '((((class color))
|
||||
(:foreground "red"))
|
||||
(t (:underline t)))
|
||||
"*Font used by ido for highlighting subdirs in the alternatives."
|
||||
:group 'ido)
|
||||
|
||||
(defface ido-indicator-face '((((class color))
|
||||
(defface ido-indicator-face '((((class color))
|
||||
(:foreground "yellow"
|
||||
:background "red"
|
||||
: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
|
||||
with other packages. For instance:
|
||||
|
||||
\(add-hook 'ido-minibuffer-setup-hook
|
||||
\(add-hook 'ido-minibuffer-setup-hook
|
||||
\(function
|
||||
\(lambda ()
|
||||
\(make-local-variable 'max-mini-window-height)
|
||||
@ -884,8 +884,8 @@ Copied from `icomplete-eoinput'.")
|
||||
(defvar ido-report-no-match t
|
||||
"Report [No Match] when no completions matches ido-text.")
|
||||
|
||||
(defvar ido-exit nil
|
||||
"Flag to monitor how `ido-find-file' exits.
|
||||
(defvar ido-exit nil
|
||||
"Flag to monitor how `ido-find-file' exits.
|
||||
If equal to `takeprompt', we use the prompt as the file name to be
|
||||
selected.")
|
||||
|
||||
@ -896,7 +896,7 @@ selected.")
|
||||
"Delay timer for auto merge.")
|
||||
|
||||
(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
|
||||
it doesn't interfere with other minibuffer usage.")
|
||||
|
||||
@ -1008,7 +1008,7 @@ it doesn't interfere with other minibuffer usage.")
|
||||
(string-match "\\`/[^:/][^:/]+:\\'" dir))))
|
||||
|
||||
(defun ido-is-ftp-directory (&optional dir)
|
||||
(string-match
|
||||
(string-match
|
||||
(if ido-enable-tramp-completion
|
||||
"\\`/[^/:][^/:]+:" ;; 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))
|
||||
;; (featurep 'ange-ftp)
|
||||
;; (ange-ftp-ftp-name dir)
|
||||
(string-match
|
||||
(string-match
|
||||
(if ido-enable-tramp-completion
|
||||
"\\`/\\([^/]+[@:]\\)*\\([^@/:][^@/:]+\\):"
|
||||
"\\`/\\([^/:]*@\\)?\\([^@/:][^@/:]+\\):/")
|
||||
@ -1130,7 +1130,7 @@ Removes badly formatted data and ignored directories."
|
||||
(setq r (cons (car l) r)))
|
||||
(setq l (cdr l)))
|
||||
(nreverse r))))
|
||||
(setq ido-work-directory-list
|
||||
(setq ido-work-directory-list
|
||||
(and (listp ido-work-directory-list)
|
||||
(let ((l ido-work-directory-list) r)
|
||||
(while l
|
||||
@ -1140,7 +1140,7 @@ Removes badly formatted data and ignored directories."
|
||||
(setq r (cons (car l) r)))
|
||||
(setq l (cdr l)))
|
||||
(nreverse r))))
|
||||
(setq ido-work-file-list
|
||||
(setq ido-work-file-list
|
||||
(and (listp ido-work-file-list)
|
||||
(let ((l ido-work-file-list) r)
|
||||
(while l
|
||||
@ -1148,7 +1148,7 @@ Removes badly formatted data and ignored directories."
|
||||
(setq r (cons (car l) r)))
|
||||
(setq l (cdr l)))
|
||||
(nreverse r))))
|
||||
(setq ido-dir-file-cache
|
||||
(setq ido-dir-file-cache
|
||||
(and (listp ido-dir-file-cache)
|
||||
(let ((l ido-dir-file-cache) r)
|
||||
(while l
|
||||
@ -1223,15 +1223,15 @@ Removes badly formatted data and ignored directories."
|
||||
"Toggle ido speed-ups on or off.
|
||||
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,
|
||||
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
|
||||
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.
|
||||
This function also adds a hook to the minibuffer."
|
||||
(interactive "P")
|
||||
(setq ido-mode
|
||||
(cond
|
||||
(cond
|
||||
((null arg) (if ido-mode nil 'both))
|
||||
((eq arg t) 'both)
|
||||
((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."
|
||||
(interactive "P")
|
||||
(setq ido-everywhere (if arg
|
||||
(> (prefix-numeric-value arg) 0)
|
||||
(> (prefix-numeric-value arg) 0)
|
||||
(not ido-everywhere)))
|
||||
(setq read-file-name-function
|
||||
(setq read-file-name-function
|
||||
(and ido-everywhere (memq ido-mode '(both file))
|
||||
'ido-read-file-name))
|
||||
(setq read-buffer-function
|
||||
@ -1289,7 +1289,7 @@ This function also adds a hook to the minibuffer."
|
||||
'ido-read-buffer)))
|
||||
|
||||
|
||||
;;; IDO KEYMAP
|
||||
;;; IDO KEYMAP
|
||||
(defun ido-define-mode-map ()
|
||||
"Set up the keymap for `ido'."
|
||||
(let (map)
|
||||
@ -1421,14 +1421,14 @@ This function also adds a hook to the minibuffer."
|
||||
(funcall (cdr (car rule)) dirname))))
|
||||
(setq rule (cdr rule))))
|
||||
(run-hooks 'ido-rewrite-file-prompt-functions)
|
||||
(concat prompt
|
||||
(concat prompt
|
||||
; (if ido-process-ignore-lists "" "&")
|
||||
(or literal "")
|
||||
(or vc-off "")
|
||||
(or prefix "")
|
||||
(let ((l (length dirname)))
|
||||
(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)))
|
||||
(concat "..." (if i (substring s i) s)))
|
||||
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)
|
||||
"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.
|
||||
DEFAULT if given is the default directory to start with.
|
||||
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))
|
||||
((stringp default) default)
|
||||
((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)))
|
||||
(and d (cdr d)))))))
|
||||
(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-trace "Merged" t)
|
||||
))))
|
||||
|
||||
|
||||
(cond
|
||||
(ido-keep-item-list
|
||||
(setq ido-keep-item-list nil
|
||||
@ -1586,7 +1586,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||
(ido-set-matches)
|
||||
(if (and ido-matches (eq ido-try-merged-list 'auto))
|
||||
(setq ido-try-merged-list t))
|
||||
(let
|
||||
(let
|
||||
((minibuffer-local-completion-map ido-mode-map)
|
||||
(max-mini-window-height (or ido-max-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-final-text
|
||||
(catch 'ido
|
||||
(completing-read
|
||||
(completing-read
|
||||
(ido-make-prompt item prompt)
|
||||
'(("dummy" . 1)) nil nil ; table predicate require-match
|
||||
(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
|
||||
((eq ido-exit 'refresh)
|
||||
(if (and (eq ido-use-merged-list 'auto)
|
||||
(if (and (eq ido-use-merged-list 'auto)
|
||||
(or (input-pending-p)))
|
||||
(setq ido-use-merged-list nil
|
||||
ido-keep-item-list t))
|
||||
@ -1623,7 +1623,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||
ido-exit nil))
|
||||
|
||||
((memq ido-exit '(edit chdir))
|
||||
(cond
|
||||
(cond
|
||||
((memq ido-cur-item '(file dir))
|
||||
(let* ((process-environment (cons "HOME=/" process-environment)) ;; cheat read-file-name
|
||||
(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) "/")
|
||||
f (file-name-nondirectory new)
|
||||
edit t)
|
||||
(if (or
|
||||
(if (or
|
||||
(file-directory-p d)
|
||||
(and (yes-or-no-p (format "Create directory %s? " d))
|
||||
(condition-case nil
|
||||
(condition-case nil
|
||||
(progn (make-directory d t) t)
|
||||
(error
|
||||
(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
|
||||
;; of the list of matches
|
||||
|
||||
(cond
|
||||
(cond
|
||||
((eq ido-exit 'findfile)
|
||||
(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
|
||||
(defun ido-read-buffer (prompt &optional default require-match initial)
|
||||
"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
|
||||
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.
|
||||
@ -1820,7 +1820,7 @@ If INITIAL is non-nil, it specifies the initial input string."
|
||||
ido-text-init ido-text
|
||||
ido-rotate-temp t)
|
||||
(exit-minibuffer))))
|
||||
|
||||
|
||||
(defun ido-record-work-file (name)
|
||||
;; Save NAME in ido-work-file-list
|
||||
(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)
|
||||
(ido-record-work-file filename)
|
||||
(setq filename (concat ido-current-directory filename))
|
||||
(ido-record-command
|
||||
(ido-record-command
|
||||
(if ido-find-literal 'insert-file-literally 'insert-file)
|
||||
filename)
|
||||
(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."
|
||||
(interactive)
|
||||
(let (res)
|
||||
(cond
|
||||
(cond
|
||||
((and (memq ido-cur-item '(file dir))
|
||||
(string-match "[$]" 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)
|
||||
(when ido-completion-buffer
|
||||
(call-interactively (setq this-command ido-cannot-complete-command))))
|
||||
|
||||
|
||||
((and (= 1 (length ido-matches))
|
||||
(not (and ido-enable-tramp-completion
|
||||
(string-equal ido-current-directory "/")
|
||||
(string-match "..[@:]\\'" (car ido-matches)))))
|
||||
;; only one choice, so select it.
|
||||
(exit-minibuffer))
|
||||
|
||||
|
||||
(t ;; else there could be some completions
|
||||
(setq res ido-common-match-string)
|
||||
(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))
|
||||
((not ido-use-merged-list)
|
||||
(ido-merge-work-directories))))
|
||||
|
||||
|
||||
;;; TOGGLE FUNCTIONS
|
||||
|
||||
(defun ido-toggle-case ()
|
||||
@ -2087,7 +2087,7 @@ If no merge has yet taken place, toggle automatic merging option."
|
||||
(interactive)
|
||||
(if (and ido-mode (eq ido-cur-item 'file))
|
||||
(progn
|
||||
(setq vc-master-templates
|
||||
(setq vc-master-templates
|
||||
(if vc-master-templates nil ido-saved-vc-mt))
|
||||
(setq ido-text-init ido-text)
|
||||
(setq ido-exit 'keep)
|
||||
@ -2323,8 +2323,8 @@ If repeated, insert text from buffer instead."
|
||||
(let* ((bfname (buffer-file-name ido-entry-buffer))
|
||||
(name (and bfname (file-name-nondirectory bfname))))
|
||||
(when name
|
||||
(setq ido-text-init
|
||||
(if (or all
|
||||
(setq ido-text-init
|
||||
(if (or all
|
||||
(not (equal (file-name-directory bfname) ido-current-directory))
|
||||
(not (string-match "\\.[^.]*\\'" name)))
|
||||
name
|
||||
@ -2332,7 +2332,7 @@ If repeated, insert text from buffer instead."
|
||||
(setq ido-exit 'refresh
|
||||
ido-try-merged-list nil)
|
||||
(exit-minibuffer))))
|
||||
|
||||
|
||||
(defun ido-copy-current-word (all)
|
||||
"Insert current word (file or directory name) from current buffer."
|
||||
(interactive "P")
|
||||
@ -2367,7 +2367,7 @@ If repeated, insert text from buffer instead."
|
||||
ido-exit 'refresh)))
|
||||
(exit-minibuffer))))
|
||||
|
||||
(defun ido-next-match ()
|
||||
(defun ido-next-match ()
|
||||
"Put first element of `ido-matches' at the end of the list."
|
||||
(interactive)
|
||||
(if ido-matches
|
||||
@ -2376,7 +2376,7 @@ If repeated, insert text from buffer instead."
|
||||
(setq ido-rescan 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."
|
||||
(interactive)
|
||||
(if ido-matches
|
||||
@ -2385,7 +2385,7 @@ If repeated, insert text from buffer instead."
|
||||
(setq ido-rescan t)
|
||||
(setq ido-rotate t))))
|
||||
|
||||
(defun ido-next-match-dir ()
|
||||
(defun ido-next-match-dir ()
|
||||
"Find next directory in match list.
|
||||
If work directories have been merged, cycle through directories for
|
||||
first matching file."
|
||||
@ -2404,7 +2404,7 @@ first matching file."
|
||||
(if (< i cnt)
|
||||
(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.
|
||||
If work directories have been merged, cycle through directories
|
||||
for first matching file."
|
||||
@ -2423,7 +2423,7 @@ for first matching file."
|
||||
(if (> i 0)
|
||||
(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."
|
||||
(interactive)
|
||||
(when ido-matches
|
||||
@ -2492,8 +2492,8 @@ for first matching file."
|
||||
|
||||
(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")
|
||||
(let ((filenames
|
||||
(split-string
|
||||
(let ((filenames
|
||||
(split-string
|
||||
(shell-command-to-string
|
||||
(concat "find " dir " -name \"" (if prefix "" "*") file "*\" -type " (if finddir "d" "f") " -print"))))
|
||||
filename d f
|
||||
@ -2598,7 +2598,7 @@ for first matching file."
|
||||
|
||||
(defun ido-make-buffer-list1 (&optional frame visible)
|
||||
;; Return list of non-ignored buffer names
|
||||
(delq nil
|
||||
(delq nil
|
||||
(mapcar
|
||||
(lambda (x)
|
||||
(let ((name (buffer-name x)))
|
||||
@ -2609,7 +2609,7 @@ for first matching file."
|
||||
(defun ido-make-buffer-list (default)
|
||||
;; Return the current list of buffers.
|
||||
;; 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
|
||||
;; in this list. If DEFAULT is non-nil, and corresponds to an existing buffer,
|
||||
;; it is put to the start of the list.
|
||||
@ -2620,17 +2620,17 @@ for first matching file."
|
||||
(setq ido-temp-list ido-current-buffers))
|
||||
(if default
|
||||
(progn
|
||||
(setq ido-temp-list
|
||||
(setq ido-temp-list
|
||||
(delete default ido-temp-list))
|
||||
(setq ido-temp-list
|
||||
(setq ido-temp-list
|
||||
(cons default ido-temp-list))))
|
||||
(run-hooks 'ido-make-buffer-list-hook)
|
||||
ido-temp-list))
|
||||
|
||||
(defun ido-to-end (items)
|
||||
;; Move the elements from ITEMS to the end of `ido-temp-list'
|
||||
(mapcar
|
||||
(lambda (elem)
|
||||
(mapcar
|
||||
(lambda (elem)
|
||||
(setq ido-temp-list (delq elem ido-temp-list)))
|
||||
items)
|
||||
(if ido-temp-list
|
||||
@ -2670,7 +2670,7 @@ for first matching file."
|
||||
(stringp dir) (> (length dir) 0)
|
||||
(ido-may-cache-directory dir))
|
||||
(let* ((cached (assoc dir ido-dir-file-cache))
|
||||
(ctime (nth 1 cached))
|
||||
(ctime (nth 1 cached))
|
||||
(ftp (ido-is-ftp-directory dir))
|
||||
(attr (if ftp nil (file-attributes dir)))
|
||||
(mtime (nth 5 attr))
|
||||
@ -2710,7 +2710,7 @@ for first matching file."
|
||||
;; Return list of non-ignored files in DIR
|
||||
;; If MERGED is non-nil, each file is cons'ed with DIR
|
||||
(and (or (ido-is-tramp-root dir) (file-directory-p dir))
|
||||
(delq nil
|
||||
(delq nil
|
||||
(mapcar
|
||||
(lambda (name)
|
||||
(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)
|
||||
;; Return the current list of files.
|
||||
;; 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
|
||||
;; in this list.
|
||||
(let ((ido-temp-list (ido-make-file-list1 ido-current-directory)))
|
||||
(setq ido-temp-list (ido-sort-list ido-temp-list))
|
||||
(let ((default-directory ido-current-directory))
|
||||
(ido-to-end ;; move ftp hosts and visited files to end
|
||||
(delq nil (mapcar
|
||||
(lambda (x) (if (or (string-match "..:\\'" x)
|
||||
(delq nil (mapcar
|
||||
(lambda (x) (if (or (string-match "..:\\'" x)
|
||||
(and (not (ido-final-slash x))
|
||||
(get-file-buffer x))) x))
|
||||
ido-temp-list))))
|
||||
(ido-to-end ;; move . files to end
|
||||
(delq nil (mapcar
|
||||
(delq nil (mapcar
|
||||
(lambda (x) (if (string-equal (substring x 0 1) ".") x))
|
||||
ido-temp-list)))
|
||||
(if (and default (member default ido-temp-list))
|
||||
@ -2746,9 +2746,9 @@ for first matching file."
|
||||
(setcdr l nil)
|
||||
(nconc k ido-temp-list)
|
||||
(setq ido-temp-list k)))
|
||||
(setq ido-temp-list
|
||||
(setq ido-temp-list
|
||||
(delete default ido-temp-list))
|
||||
(setq ido-temp-list
|
||||
(setq ido-temp-list
|
||||
(cons default ido-temp-list))))
|
||||
(when ido-show-dot-for-dired
|
||||
(setq ido-temp-list (delete "." ido-temp-list))
|
||||
@ -2760,7 +2760,7 @@ for first matching file."
|
||||
;; Return list of non-ignored subdirs in DIR
|
||||
;; If MERGED is non-nil, each subdir is cons'ed with DIR
|
||||
(and (or (ido-is-tramp-root dir) (file-directory-p dir))
|
||||
(delq nil
|
||||
(delq nil
|
||||
(mapcar
|
||||
(lambda (name)
|
||||
(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)
|
||||
;; 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
|
||||
;; directory names in this list.
|
||||
(let ((ido-temp-list (ido-make-dir-list1 ido-current-directory)))
|
||||
(setq ido-temp-list (ido-sort-list ido-temp-list))
|
||||
(ido-to-end ;; move . files to end
|
||||
(delq nil (mapcar
|
||||
(delq nil (mapcar
|
||||
(lambda (x) (if (string-equal (substring x 0 1) ".") x))
|
||||
ido-temp-list)))
|
||||
(if (and default (member default ido-temp-list))
|
||||
@ -2788,9 +2788,9 @@ for first matching file."
|
||||
(setcdr l nil)
|
||||
(nconc k ido-temp-list)
|
||||
(setq ido-temp-list k)))
|
||||
(setq ido-temp-list
|
||||
(setq ido-temp-list
|
||||
(delete default ido-temp-list))
|
||||
(setq ido-temp-list
|
||||
(setq ido-temp-list
|
||||
(cons default ido-temp-list))))
|
||||
(setq ido-temp-list (delete "." ido-temp-list))
|
||||
(setq ido-temp-list (cons "." ido-temp-list))
|
||||
@ -2807,7 +2807,7 @@ for first matching file."
|
||||
;; `ido-all-frames'.
|
||||
(let ((ido-bufs-in-frame nil))
|
||||
(walk-windows 'ido-get-bufname nil
|
||||
(if current
|
||||
(if current
|
||||
nil
|
||||
ido-all-frames))
|
||||
ido-bufs-in-frame))
|
||||
@ -2869,14 +2869,14 @@ for first matching file."
|
||||
(setq matches (cons item matches)))))
|
||||
items))
|
||||
matches))
|
||||
|
||||
|
||||
|
||||
(defun ido-set-matches ()
|
||||
;; Set `ido-matches' to the list of items matching prompt
|
||||
(when ido-rescan
|
||||
(setq ido-matches (ido-set-matches1 (reverse ido-cur-list) (not ido-rotate))
|
||||
ido-rotate nil)))
|
||||
|
||||
|
||||
(defun ido-ignore-item-p (name re-list &optional ignore-ext)
|
||||
;; Return t if the buffer or file NAME should be ignored.
|
||||
(or (member name ido-ignore-item-temp-list)
|
||||
@ -2885,7 +2885,7 @@ for first matching file."
|
||||
(let ((data (match-data))
|
||||
(ext-list (and ignore-ext ido-ignore-extensions
|
||||
completion-ignored-extensions))
|
||||
ignorep nextstr
|
||||
ignorep nextstr
|
||||
(flen (length name)) slen)
|
||||
(while ext-list
|
||||
(setq nextstr (car ext-list))
|
||||
@ -2941,7 +2941,7 @@ for first matching file."
|
||||
(defun ido-word-matching-substring (word)
|
||||
;; Return part of WORD before 1st match to `ido-change-word-sub'.
|
||||
;; 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))))
|
||||
(if m
|
||||
(substring (ido-name word) m)
|
||||
@ -3009,7 +3009,7 @@ for first matching file."
|
||||
(let ((f 'display-completion-list))
|
||||
(funcall f completion-list
|
||||
:help-string "ido "
|
||||
:activate-callback
|
||||
:activate-callback
|
||||
'(lambda (x y z) (message "doesn't work yet, sorry!"))))
|
||||
;; else running Emacs
|
||||
;;(add-hook 'completion-setup-hook 'completion-setup-function)
|
||||
@ -3026,7 +3026,7 @@ for first matching file."
|
||||
;; Check if buffer still exists.
|
||||
(if (get-buffer buf)
|
||||
;; buffer couldn't be killed.
|
||||
(setq ido-rescan t)
|
||||
(setq ido-rescan t)
|
||||
;; else buffer was killed so remove name from list.
|
||||
(setq ido-cur-list (delq buf ido-cur-list))))))
|
||||
|
||||
@ -3047,7 +3047,7 @@ for first matching file."
|
||||
;; Check if file still exists.
|
||||
(if (file-exists-p file)
|
||||
;; file could not be deleted
|
||||
(setq ido-rescan t)
|
||||
(setq ido-rescan t)
|
||||
;; else file was killed so remove name from 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-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.
|
||||
If there is no common suffix, show a list of all matching buffers
|
||||
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-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.
|
||||
If there is no common suffix, show a list of all matching files
|
||||
in a separate window.
|
||||
@ -3429,7 +3429,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||
|
||||
((ido-final-slash contents) ;; xxx/
|
||||
(ido-trace "final slash" contents)
|
||||
(cond
|
||||
(cond
|
||||
((string-equal contents "~/")
|
||||
(ido-set-current-home)
|
||||
(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))
|
||||
(setq refresh t))
|
||||
((string-equal (substring contents -2 -1) "/")
|
||||
(ido-set-current-directory
|
||||
(ido-set-current-directory
|
||||
(if (memq system-type '(windows-nt ms-dos))
|
||||
(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
|
||||
(eq ido-enter-single-matching-directory t)))
|
||||
(ido-trace "single match" (car ido-matches))
|
||||
(ido-set-current-directory
|
||||
(ido-set-current-directory
|
||||
(concat ido-current-directory (car ido-matches)))
|
||||
(setq ido-exit 'refresh)
|
||||
(exit-minibuffer))
|
||||
@ -3554,10 +3554,10 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||
(ido-trace "\n*start timer*")
|
||||
(setq ido-auto-merge-timer
|
||||
(run-with-timer ido-auto-merge-delay-time nil 'ido-initiate-auto-merge (current-buffer))))))
|
||||
|
||||
|
||||
(setq ido-rescan t)
|
||||
|
||||
(if (and ido-use-merged-list
|
||||
(if (and ido-use-merged-list
|
||||
ido-matches
|
||||
(not (string-equal (car (cdr (car ido-matches))) ido-current-directory)))
|
||||
(progn
|
||||
@ -3569,7 +3569,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||
|
||||
;; Insert the match-status information:
|
||||
(ido-set-common-completion)
|
||||
(let ((inf (ido-completions
|
||||
(let ((inf (ido-completions
|
||||
contents
|
||||
minibuffer-completion-table
|
||||
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)
|
||||
;; Return the string that is displayed after the user's text.
|
||||
;; Modified from `icomplete-completions'.
|
||||
|
||||
|
||||
(let* ((comps ido-matches)
|
||||
(ind (and (consp (car comps)) (> (length (cdr (car comps))) 1)
|
||||
ido-merged-indicator))
|
||||
@ -3589,7 +3589,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||
|
||||
(if (and ind ido-use-faces)
|
||||
(put-text-property 0 1 'face 'ido-indicator-face ind))
|
||||
|
||||
|
||||
(if (and ido-use-faces comps)
|
||||
(let* ((fn (ido-name (car comps)))
|
||||
(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))
|
||||
(alternatives
|
||||
(apply
|
||||
#'concat
|
||||
#'concat
|
||||
(cdr (apply
|
||||
#'nconc
|
||||
(mapcar
|
||||
@ -3654,7 +3654,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
|
||||
(defun ido-minibuffer-setup ()
|
||||
"Minibuffer setup hook for `ido'."
|
||||
;; Copied from `icomplete-minibuffer-setup-hook'.
|
||||
(when (and (boundp 'ido-completing-read)
|
||||
(when (and (boundp 'ido-completing-read)
|
||||
(or (featurep 'xemacs)
|
||||
(= ido-use-mycompletion-depth (minibuffer-depth))))
|
||||
(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)))
|
||||
(if (and (boundp 'ido-eoinput)
|
||||
ido-eoinput)
|
||||
|
||||
|
||||
(if (> ido-eoinput (point-max))
|
||||
;; Oops, got rug pulled out from under us - reinit:
|
||||
(setq ido-eoinput (point-max))
|
||||
(let ((buffer-undo-list t))
|
||||
(delete-region ido-eoinput (point-max))))
|
||||
|
||||
|
||||
;; Reestablish the local variable 'cause minibuffer-setup is weird:
|
||||
(make-local-variable 'ido-eoinput)
|
||||
(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
|
||||
;; `ido-make-buffer-list-hook'. Any buffer matching the regexps
|
||||
;; `Summary' or `output\*$'are put to the end of the list.
|
||||
(let ((summaries (delq nil (mapcar
|
||||
(lambda (x)
|
||||
(if (or
|
||||
(let ((summaries (delq nil (mapcar
|
||||
(lambda (x)
|
||||
(if (or
|
||||
(string-match "Summary" x)
|
||||
(string-match "output\\*\\'" x))
|
||||
x))
|
||||
|
@ -114,7 +114,7 @@ such as `edebug-defun' to work with such inputs."
|
||||
"During IELM evaluation, most recent value evaluated in IELM.
|
||||
Normally identical to `*'. However, if the working buffer is an IELM
|
||||
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.")
|
||||
|
||||
(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")))
|
||||
(process-kill-without-query (ielm-process))
|
||||
(goto-char (point-max))
|
||||
|
||||
|
||||
;; Lisp output can include raw characters that confuse comint's
|
||||
;; carriage control code.
|
||||
(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)))
|
||||
(when (and (>= code #xe0) (<= code #xef))
|
||||
;; APP0 LEN1 LEN2 "JFIF\0"
|
||||
(throw 'jfif
|
||||
(throw 'jfif
|
||||
(string-match "JFIF\\|Exif" (substring data i (+ i nbytes)))))
|
||||
(setq i (+ i 1 nbytes))))))))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user