From 71296446d3cec5bb2a27bc5ad6da574df38d0ec8 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 4 Feb 2003 11:26:42 +0000 Subject: [PATCH] Trailing whitespace deleted. --- lisp/abbrev.el | 2 +- lisp/allout.el | 38 ++-- lisp/ansi-color.el | 4 +- lisp/apropos.el | 14 +- lisp/arc-mode.el | 2 +- lisp/array.el | 4 +- lisp/autoinsert.el | 4 +- lisp/byte-run.el | 10 +- lisp/cmuscheme.el | 8 +- lisp/completion.el | 206 ++++++++--------- lisp/composite.el | 4 +- lisp/cus-dep.el | 16 +- lisp/cus-face.el | 22 +- lisp/cus-start.el | 18 +- lisp/cus-theme.el | 2 +- lisp/custom.el | 22 +- lisp/cvs-status.el | 10 +- lisp/dabbrev.el | 4 +- lisp/descr-text.el | 12 +- lisp/diff-mode.el | 14 +- lisp/dired-x.el | 4 +- lisp/disp-table.el | 2 +- lisp/dos-fns.el | 2 +- lisp/double.el | 8 +- lisp/ebuff-menu.el | 4 +- lisp/echistory.el | 2 +- lisp/ediff-diff.el | 126 +++++------ lisp/ediff-help.el | 92 ++++---- lisp/ediff-hook.el | 30 +-- lisp/ediff-init.el | 6 +- lisp/ediff-merg.el | 46 ++-- lisp/ediff-ptch.el | 72 +++--- lisp/ediff-util.el | 536 ++++++++++++++++++++++----------------------- lisp/ediff-vers.el | 28 +-- lisp/ediff-wind.el | 186 ++++++++-------- lisp/ediff.el | 206 ++++++++--------- lisp/edmacro.el | 4 +- lisp/ehelp.el | 12 +- lisp/electric.el | 6 +- lisp/emerge.el | 34 +-- lisp/env.el | 10 +- lisp/facemenu.el | 58 ++--- lisp/ffap.el | 2 +- lisp/find-dired.el | 6 +- lisp/find-file.el | 24 +- lisp/flow-ctrl.el | 10 +- lisp/foldout.el | 2 +- lisp/font-core.el | 2 +- lisp/format.el | 6 +- lisp/forms-d2.el | 2 +- lisp/forms.el | 156 ++++++------- lisp/gdb-ui.el | 40 ++-- lisp/gud.el | 14 +- lisp/help-fns.el | 2 +- lisp/help.el | 2 +- lisp/hexl.el | 6 +- lisp/hi-lock.el | 6 +- lisp/hilit-chg.el | 84 +++---- lisp/ibuf-ext.el | 10 +- lisp/ibuf-macs.el | 8 +- lisp/ibuffer.el | 32 +-- lisp/icomplete.el | 2 +- lisp/ido.el | 208 +++++++++--------- lisp/ielm.el | 4 +- lisp/image.el | 2 +- 65 files changed, 1260 insertions(+), 1260 deletions(-) diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 8d9b762512..929724dd99 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -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)) diff --git a/lisp/allout.el b/lisp/allout.el index 3fc20d9520..b083153d1f 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -5,7 +5,7 @@ ;; Author: Ken Manheimer ;; Maintainer: Ken Manheimer ;; 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 diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index 3c15528d09..45c0bfb667 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -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." diff --git a/lisp/apropos.el b/lisp/apropos.el index 63450adbc6..f5305f3b29 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -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 diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index cc1462c22f..76eaef21c5 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -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. diff --git a/lisp/array.el b/lisp/array.el index 597f4ecf2c..4046296895 100644 --- a/lisp/array.el +++ b/lisp/array.el @@ -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." diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index 4b0cd71306..b13fe3ce50 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -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") diff --git a/lisp/byte-run.el b/lisp/byte-run.el index 09c59818b2..538214b709 100644 --- a/lisp/byte-run.el +++ b/lisp/byte-run.el @@ -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 diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el index 770d5c90c2..2e95658004 100644 --- a/lisp/cmuscheme.el +++ b/lisp/cmuscheme.el @@ -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) diff --git a/lisp/completion.el b/lisp/completion.el index 4bc34cc4ba..2f89a68147 100644 --- a/lisp/completion.el +++ b/lisp/completion.el @@ -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. +;; the rest of the word you are likely to type. ;; -;; This watches all the words that you type and remembers them. When +;; 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 @@ ;; ;; ;; 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 @@ ;; ;; ;; 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 diff --git a/lisp/composite.el b/lisp/composite.el index 49fe76de5e..1f279cd6a1 100644 --- a/lisp/composite.el +++ b/lisp/composite.el @@ -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) diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index 5a472ebcf9..e448f27991 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el @@ -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 diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 4b33f1e4f0..f1744cc9e6 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -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), diff --git a/lisp/cus-start.el b/lisp/cus-start.el index c09662ff60..9ece1e8d2f 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -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. diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index 6faa1a199c..32364763df 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el @@ -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 diff --git a/lisp/custom.el b/lisp/custom.el index b3458bfce4..8ed78fd649 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -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))) diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el index 27cd78e1da..27c5c20649 100644 --- a/lisp/cvs-status.el +++ b/lisp/cvs-status.el @@ -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) diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index fd8b596d53..b31760ff65 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el @@ -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))))) diff --git a/lisp/descr-text.el b/lisp/descr-text.el index b0e091a89d..810c781e8c 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -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") diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index 7899da63ee..30b9467c72 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -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" diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 0cc9c43b2f..ddd0a289ee 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -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. diff --git a/lisp/disp-table.el b/lisp/disp-table.el index 6a8fe08ca2..174b5d2721 100644 --- a/lisp/disp-table.el +++ b/lisp/disp-table.el @@ -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")))))) diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el index 1a979a80d7..ba2aff981e 100644 --- a/lisp/dos-fns.el +++ b/lisp/dos-fns.el @@ -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". diff --git a/lisp/double.el b/lisp/double.el index ed427d056b..b658f00792 100644 --- a/lisp/double.el +++ b/lisp/double.el @@ -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) diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el index 3d2f87b04b..d87a212454 100644 --- a/lisp/ebuff-menu.el +++ b/lisp/ebuff-menu.el @@ -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))) diff --git a/lisp/echistory.el b/lisp/echistory.el index 221d9176f5..dd6b429872 100644 --- a/lisp/echistory.el +++ b/lisp/echistory.el @@ -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) diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el index 37ac8c0e13..99b9a23f7c 100644 --- a/lisp/ediff-diff.el +++ b/lisp/ediff-diff.el @@ -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 diff --git a/lisp/ediff-help.el b/lisp/ediff-help.el index 7d3234db28..640b9e5ec2 100644 --- a/lisp/ediff-help.el +++ b/lisp/ediff-help.el @@ -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))) diff --git a/lisp/ediff-hook.el b/lisp/ediff-hook.el index f1be60e424..e8cf252f99 100644 --- a/lisp/ediff-hook.el +++ b/lisp/ediff-hook.el @@ -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 diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el index 58a37e2566..0ce7e4323e 100644 --- a/lisp/ediff-init.el +++ b/lisp/ediff-init.el @@ -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 ) diff --git a/lisp/ediff-merg.el b/lisp/ediff-merg.el index 8bb1aa0814..e7f6de3e86 100644 --- a/lisp/ediff-merg.el +++ b/lisp/ediff-merg.el @@ -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) diff --git a/lisp/ediff-ptch.el b/lisp/ediff-ptch.el index 29174ff8e9..9590c9a181 100644 --- a/lisp/ediff-ptch.el +++ b/lisp/ediff-ptch.el @@ -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) diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el index 865f14a41c..3dda354be1 100644 --- a/lisp/ediff-util.el +++ b/lisp/ediff-util.el @@ -24,7 +24,7 @@ ;;; Commentary: ;;; Code: - + (provide 'ediff-util) ;; Compiler pacifier @@ -118,7 +118,7 @@ Commands: (setq mode-name "Ediff") (run-hooks 'ediff-mode-hook)) - + ;;; Build keymaps @@ -133,19 +133,19 @@ to invocation.") (if (null ediff-mode-map) (ediff-setup-keymap)) (use-local-map ediff-mode-map)) - + ;; Reload Ediff keymap. For debugging only. (defun ediff-reload-keymap () (interactive) (setq ediff-mode-map nil) (ediff-set-keys)) - + (defun ediff-setup-keymap () "Set up the keymap used in the control buffer of Ediff." (setq ediff-mode-map (make-sparse-keymap)) (suppress-keymap ediff-mode-map) - + (define-key ediff-mode-map (if ediff-emacs-p [mouse-2] [button2]) 'ediff-help-for-quick-help) (define-key ediff-mode-map "\C-m" 'ediff-help-for-quick-help) @@ -246,7 +246,7 @@ to invocation.") )) (define-key ediff-mode-map "m" 'ediff-toggle-wide-display) - + ;; Allow ediff-mode-map to be referenced indirectly (fset 'ediff-mode-map ediff-mode-map) (run-hooks 'ediff-keymap-setup-hook)) @@ -272,26 +272,26 @@ to invocation.") (ediff-convert-standard-filename (expand-file-name file-C)))) (if (stringp merge-buffer-file) (progn - (setq merge-buffer-file + (setq merge-buffer-file (ediff-convert-standard-filename (expand-file-name merge-buffer-file))) ;; check the directory exists (or (file-exists-p (file-name-directory merge-buffer-file)) (error "Directory %s given as place to save the merge doesn't exist" - (abbreviate-file-name + (abbreviate-file-name (file-name-directory merge-buffer-file)))) (if (and (file-exists-p merge-buffer-file) (file-directory-p merge-buffer-file)) (error "The merge buffer file %s must not be a directory" (abbreviate-file-name merge-buffer-file))) )) - (let* ((control-buffer-name + (let* ((control-buffer-name (ediff-unique-buffer-name "*Ediff Control Panel" "*")) (control-buffer (ediff-with-current-buffer buffer-A (get-buffer-create control-buffer-name)))) (ediff-with-current-buffer control-buffer - (ediff-mode) - + (ediff-mode) + (make-local-variable 'ediff-use-long-help-message) (make-local-variable 'ediff-prefer-iconified-control-frame) (make-local-variable 'ediff-split-window-function) @@ -309,7 +309,7 @@ to invocation.") (while setup-parameters (set (car (car setup-parameters)) (cdr (car setup-parameters))) (setq setup-parameters (cdr setup-parameters))) - + ;; set variables classifying the current ediff job ;; must come AFTER setup-parameters (setq ediff-3way-comparison-job (ediff-3way-comparison-job) @@ -334,7 +334,7 @@ to invocation.") (if (ediff-window-display-p) (add-hook 'pre-command-hook 'ediff-spy-after-mouse nil 'local)) (setq ediff-mouse-pixel-position (mouse-pixel-position)) - + ;; adjust for merge jobs (if ediff-merge-job (let ((buf @@ -348,13 +348,13 @@ to invocation.") (cond ((eq ediff-default-variant 'default-B) buffer-B) (t buffer-A)))) - + (setq ediff-split-window-function - ediff-merge-split-window-function) - + ediff-merge-split-window-function) + ;; remember the ancestor buffer, if any (setq ediff-ancestor-buffer buffer-C) - + (setq buffer-C (get-buffer-create (ediff-unique-buffer-name "*ediff-merge" "*"))) @@ -365,14 +365,14 @@ to invocation.") (widen) ; merge buffer is always widened (add-hook 'local-write-file-hooks 'ediff-set-merge-mode nil t) ))) - (setq buffer-read-only nil + (setq buffer-read-only nil ediff-buffer-A buffer-A ediff-buffer-B buffer-B ediff-buffer-C buffer-C ediff-control-buffer control-buffer) (ediff-choose-syntax-table) - + (setq ediff-control-buffer-suffix (if (string-match "<[0-9]*>" control-buffer-name) (substring control-buffer-name @@ -388,10 +388,10 @@ to invocation.") (or (string-match "[0-9]+" ediff-control-buffer-suffix) 0)))))) - + (setq ediff-error-buffer (get-buffer-create (ediff-unique-buffer-name "*ediff-errors" "*"))) - + (ediff-with-current-buffer buffer-A (ediff-strip-mode-line-format)) (ediff-with-current-buffer buffer-B (ediff-strip-mode-line-format)) (if ediff-3way-job @@ -399,16 +399,16 @@ to invocation.") (if (ediff-buffer-live-p ediff-ancestor-buffer) (ediff-with-current-buffer ediff-ancestor-buffer (ediff-strip-mode-line-format))) - + (ediff-save-protected-variables) ; save variables to be restored on exit - + ;; ediff-setup-diff-regions-function must be set after setup ;; parameters are processed. (setq ediff-setup-diff-regions-function (if ediff-diff3-job 'ediff-setup-diff-regions3 'ediff-setup-diff-regions)) - + (setq ediff-wide-bounds (list (ediff-make-bullet-proof-overlay '(point-min) '(point-max) ediff-buffer-A) @@ -416,20 +416,20 @@ to invocation.") '(point-min) '(point-max) ediff-buffer-B) (ediff-make-bullet-proof-overlay '(point-min) '(point-max) ediff-buffer-C))) - + ;; This has effect only on ediff-windows/regions ;; In all other cases, ediff-visible-region sets visibility bounds to ;; ediff-wide-bounds, and ediff-narrow-bounds are ignored. (if ediff-start-narrowed (setq ediff-visible-bounds ediff-narrow-bounds) (setq ediff-visible-bounds ediff-wide-bounds)) - + (ediff-set-keys) ; comes after parameter setup - + ;; set up ediff-narrow-bounds, if not set (or ediff-narrow-bounds (setq ediff-narrow-bounds ediff-wide-bounds)) - + ;; All these must be inside ediff-with-current-buffer control-buffer, ;; since these vars are local to control-buffer ;; These won't run if there are errors in diff @@ -472,7 +472,7 @@ to invocation.") (or (memq control-buffer ediff-this-buffer-ediff-sessions) (setq ediff-this-buffer-ediff-sessions (cons control-buffer - ediff-this-buffer-ediff-sessions))) + ediff-this-buffer-ediff-sessions))) (if ediff-make-buffers-readonly-at-startup (setq buffer-read-only t) (setq buffer-read-only nil)) @@ -488,22 +488,22 @@ to invocation.") (cons control-buffer ediff-this-buffer-ediff-sessions))) )) - + ;; the following must be after setting up ediff-narrow-bounds AND after ;; nuking selective display (funcall ediff-setup-diff-regions-function file-A file-B file-C) (setq ediff-number-of-differences (length ediff-difference-vector-A)) (setq ediff-current-difference -1) - + (ediff-make-current-diff-overlay 'A) (ediff-make-current-diff-overlay 'B) (if ediff-3way-job (ediff-make-current-diff-overlay 'C)) (if ediff-merge-with-ancestor-job (ediff-make-current-diff-overlay 'Ancestor)) - + (ediff-setup-windows buffer-A buffer-B buffer-C control-buffer) - + (let ((shift-A (ediff-overlay-start (ediff-get-value-according-to-buffer-type 'A ediff-narrow-bounds))) @@ -526,10 +526,10 @@ to invocation.") (select-window ediff-window-C) (goto-char shift-C))) ) - + (select-window ediff-control-window) (ediff-visible-region) - + (run-hooks 'startup-hooks) (ediff-arrange-autosave-in-merge-jobs merge-buffer-file) @@ -544,10 +544,10 @@ to invocation.") (run-hooks 'ediff-startup-hook) ) ; eval in control-buffer control-buffer)) - - + + ;; This function assumes that we are in the window where control buffer is -;; to reside. +;; to reside. (defun ediff-setup-control-buffer (ctl-buf) "Set up window for control buffer." (if (window-dedicated-p (selected-window)) @@ -580,7 +580,7 @@ to invocation.") (ediff-make-bottom-toolbar)) ; this checks if toolbar is requested (goto-char (point-min)) (skip-chars-forward ediff-whitespace))) - + ;; This executes in control buffer and sets auto-save, visited file name, etc, ;; in the merge buffer (defun ediff-arrange-autosave-in-merge-jobs (merge-buffer-file) @@ -593,7 +593,7 @@ to invocation.") (progn ;; save before leaving ctl buffer (ediff-verify-file-merge-buffer ediff-merge-store-file) - (setq merge-buffer-file ediff-merge-store-file) + (setq merge-buffer-file ediff-merge-store-file) (ediff-with-current-buffer ediff-buffer-C (set-visited-file-name merge-buffer-file)))) (ediff-with-current-buffer ediff-buffer-C @@ -604,7 +604,7 @@ to invocation.") ;;; Commands for working with Ediff - + (defun ediff-update-diffs () "Recompute difference regions in buffers A, B, and C. Buffers are not synchronized with their respective files, so changes done @@ -617,7 +617,7 @@ if necessary." (y-or-n-p "Ancestor buffer will not be used. Recompute diffs anyway? "))) (error "Recomputation of differences canceled")) - + (let ((point-A (ediff-with-current-buffer ediff-buffer-A (point))) ;;(point-B (ediff-with-current-buffer ediff-buffer-B (point))) (tmp-buffer (get-buffer-create ediff-tmp-buffer)) @@ -643,14 +643,14 @@ if necessary." (setq buf-C-file-name (file-name-nondirectory buf-C-file-name))) (ediff-unselect-and-select-difference -1) - + (setq beg-A (ediff-overlay-start overl-A) beg-B (ediff-overlay-start overl-B) beg-C (ediff-overlay-start overl-C) end-A (ediff-overlay-end overl-A) end-B (ediff-overlay-end overl-B) end-C (ediff-overlay-end overl-C)) - + (if ediff-word-mode (progn (ediff-wordify beg-A end-A ediff-buffer-A tmp-buffer) @@ -668,7 +668,7 @@ if necessary." (if ediff-3way-job (setq file-C (ediff-make-temp-file ediff-buffer-C buf-C-file-name))) ) - + (ediff-clear-diff-vector 'ediff-difference-vector-A 'fine-diffs-also) (ediff-clear-diff-vector 'ediff-difference-vector-B 'fine-diffs-also) (ediff-clear-diff-vector 'ediff-difference-vector-C 'fine-diffs-also) @@ -681,7 +681,7 @@ if necessary." ediff-state-of-merge nil) (setq ediff-killed-diffs-alist nil) ; invalidate saved killed diff regions - + ;; In case of merge job, fool it into thinking that it is just doing ;; comparison (let ((ediff-setup-diff-regions-function ediff-setup-diff-regions-function) @@ -696,20 +696,20 @@ if necessary." ediff-merge-with-ancestor-job nil ediff-job-name 'ediff-files3)) (funcall ediff-setup-diff-regions-function file-A file-B file-C)) - + (setq ediff-number-of-differences (length ediff-difference-vector-A)) (delete-file file-A) (delete-file file-B) (if file-C (delete-file file-C)) - + (if ediff-3way-job (ediff-set-state-of-all-diffs-in-all-buffers ediff-control-buffer)) - + (ediff-jump-to-difference (ediff-diff-at-point 'A point-A)) (message "") )) - + ;; Not bound to any key---to dangerous. A user can do it if necessary. (defun ediff-revert-buffers-then-recompute-diffs (noconfirm) "Revert buffers A, B and C. Then rerun Ediff on file A and file B." @@ -746,7 +746,7 @@ if necessary." (ediff-update-diffs)))) -;; optional NO-REHIGHLIGHT says to not rehighlight buffers +;; optional NO-REHIGHLIGHT says to not rehighlight buffers (defun ediff-recenter (&optional no-rehighlight) "Bring the highlighted region of all buffers being compared into view. Reestablish the default three-window display." @@ -763,7 +763,7 @@ Reestablish the default three-window display." (message ediff-KILLED-VITAL-BUFFER (beep 1))) )) - + ;; set visibility range appropriate to this invocation of Ediff. (ediff-visible-region) ;; raise @@ -797,7 +797,7 @@ Reestablish the default three-window display." (not ediff-use-long-help-message) (not (ediff-frame-iconified-p ediff-control-frame))) (raise-frame ediff-control-frame)) - + ;; Redisplay whatever buffers are showing, if there is a selected difference (let ((control-frame ediff-control-frame) (control-buf ediff-control-buffer)) @@ -808,15 +808,15 @@ Reestablish the default three-window display." (progn (or no-rehighlight (ediff-select-difference ediff-current-difference)) - + (ediff-recenter-one-window 'A) (ediff-recenter-one-window 'B) (if ediff-3way-job (ediff-recenter-one-window 'C)) - + (ediff-with-current-buffer control-buf (ediff-recenter-ancestor) ; check if ancestor is alive - + (if (and (ediff-multiframe-setup-p) (not ediff-use-long-help-message) (not (ediff-frame-iconified-p ediff-control-frame))) @@ -829,7 +829,7 @@ Reestablish the default three-window display." (ediff-restore-highlighting) (ediff-with-current-buffer control-buf (ediff-refresh-mode-lines)) )) - + ;; this function returns to the window it was called from ;; (which was the control window) (defun ediff-recenter-one-window (buf-type) @@ -837,7 +837,7 @@ Reestablish the default three-window display." ;; context must be saved before switching to windows A/B/C (let* ((ctl-wind (selected-window)) (shift (ediff-overlay-start - (ediff-get-value-according-to-buffer-type + (ediff-get-value-according-to-buffer-type buf-type ediff-narrow-bounds))) (job-name ediff-job-name) (control-buf ediff-control-buffer) @@ -845,7 +845,7 @@ Reestablish the default three-window display." buf-type ediff-window-alist)) (window (if (window-live-p (symbol-value window-name)) (symbol-value window-name)))) - + (if (and window ediff-windows-job) (set-window-start window shift)) (if window @@ -883,10 +883,10 @@ Reestablish the default three-window display." (select-window ctl-wind) ))) - + ;; This will have to be refined for 3way jobs (defun ediff-toggle-split () - "Toggle vertical/horizontal window split. + "Toggle vertical/horizontal window split. Does nothing if file-A and file-B are in different frames." (interactive) (ediff-barf-if-not-control-buffer) @@ -908,10 +908,10 @@ Does nothing if file-A and file-B are in different frames." 'split-window-vertically)) (message "Buffers being compared are in different frames")) (ediff-recenter 'no-rehighlight))) - + (defun ediff-toggle-hilit () "Switch between highlighting using ASCII flags and highlighting using faces. -On a dumb terminal, switches between ASCII highlighting and no highlighting." +On a dumb terminal, switches between ASCII highlighting and no highlighting." (interactive) (ediff-barf-if-not-control-buffer) @@ -941,15 +941,15 @@ On a dumb terminal, switches between ASCII highlighting and no highlighting." (setq ediff-use-faces t ediff-highlighting-style 'face ediff-highlight-all-diffs t))) - + (if (and ediff-use-faces ediff-highlight-all-diffs) (ediff-paint-background-regions) (ediff-paint-background-regions 'unhighlight)) - + (ediff-unselect-and-select-difference ediff-current-difference 'select-only)) - + (defun ediff-toggle-autorefine () "Toggle auto-refine mode." (interactive) @@ -981,10 +981,10 @@ On a dumb terminal, switches between ASCII highlighting and no highlighting." (cond ((setq wind (ediff-get-visible-buffer-window ediff-ancestor-buffer)) (raise-frame (window-frame wind))) (t (set-window-buffer ediff-window-C ediff-ancestor-buffer))))) - + (defun ediff-make-or-kill-fine-diffs (arg) "Compute fine diffs. With negative prefix arg, kill fine diffs. -In both cases, operates on the current difference region." +In both cases, operates on the current difference region." (interactive "P") (ediff-barf-if-not-control-buffer) (cond ((eq arg '-) @@ -992,8 +992,8 @@ In both cases, operates on the current difference region." ((and (numberp arg) (< arg 0)) (ediff-clear-fine-differences ediff-current-difference)) (t (ediff-make-fine-diffs)))) - - + + (defun ediff-toggle-help () "Toggle short/long help message." (interactive) @@ -1007,11 +1007,11 @@ In both cases, operates on the current difference region." (if (and ediff-use-long-help-message (ediff-multiframe-setup-p)) (setq ediff-prefer-iconified-control-frame (ediff-frame-iconified-p ediff-control-frame))) - + (setq ediff-window-config-saved "") ; force redisplay (ediff-recenter 'no-rehighlight)) - - + + ;; If BUF, this is the buffer to toggle, not current buffer. (defun ediff-toggle-read-only (&optional buf) "Toggle read-only in current buffer. @@ -1025,7 +1025,7 @@ of the current buffer." (or buf (ediff-recenter)) (or buf (setq buf (ediff-get-buffer buf-type))) - + (ediff-with-current-buffer buf ; eval in buf A/B/C (let* ((file (buffer-file-name buf)) (file-writable (and file @@ -1065,14 +1065,14 @@ of the current buffer." (message "Boy, this is risky! Don't modify this file...") (sit-for 3)))) ; let the user see the warning - (if (and toggle-ro-cmd + (if (and toggle-ro-cmd (string-match "toggle-read-only" (symbol-name toggle-ro-cmd))) (save-excursion (save-window-excursion (select-window (ediff-get-visible-buffer-window buf)) (command-execute toggle-ro-cmd))) (error "Don't know how to toggle read-only in buffer %S" buf)) - + ;; Check if we made the current buffer updatable, but its file is RO. ;; Signal a warning in this case. (if (and file (not buffer-read-only) @@ -1095,7 +1095,7 @@ of the current buffer." (ediff-abbreviate-file-name file)))) (ediff-with-current-buffer buf (command-execute checkout-function))))) - + ;; This is a simple-minded check for whether a file is under version control. ;; If file,v exists but file doesn't, this file is considered to be not checked @@ -1131,7 +1131,7 @@ of the current buffer." ;; XEmacs has no vc-state (vc-locking-user file)) ))) - + (defsubst ediff-file-checked-in-p (file) (and (featurep 'vc-hooks) ;; CVS files are considered not checked in @@ -1151,7 +1151,7 @@ of the current buffer." (if (featurep 'jka-compr) (string-match (jka-compr-build-file-regexp) file))) - + (defun ediff-swap-buffers () "Rotate the display of buffers A, B, and C." (interactive) @@ -1180,7 +1180,7 @@ of the current buffer." ediff-buffer-B buf) (setq ediff-buffer-A ediff-buffer-B ediff-buffer-B buf)) - + ;; swap saved buffer characteristics (if ediff-3way-comparison-job (setq ediff-buffer-values-orig-A ediff-buffer-values-orig-C @@ -1188,7 +1188,7 @@ of the current buffer." ediff-buffer-values-orig-B values) (setq ediff-buffer-values-orig-A ediff-buffer-values-orig-B ediff-buffer-values-orig-B values)) - + ;; swap diff vectors (if ediff-3way-comparison-job (setq ediff-difference-vector-A ediff-difference-vector-C @@ -1196,7 +1196,7 @@ of the current buffer." ediff-difference-vector-B diff-vec) (setq ediff-difference-vector-A ediff-difference-vector-B ediff-difference-vector-B diff-vec)) - + ;; swap hide/focus regexp (if ediff-3way-comparison-job (setq ediff-regexp-hide-A ediff-regexp-hide-C @@ -1209,7 +1209,7 @@ of the current buffer." ediff-regexp-hide-B hide-regexp ediff-regexp-focus-A ediff-regexp-focus-B ediff-regexp-focus-B focus-regexp)) - + ;; The following is needed for XEmacs, since there one can't move ;; overlay to another buffer. In Emacs, this swap is redundant. (if (ediff-has-face-support-p) @@ -1219,7 +1219,7 @@ of the current buffer." ediff-current-diff-overlay-B overlay) (setq ediff-current-diff-overlay-A ediff-current-diff-overlay-B ediff-current-diff-overlay-B overlay))) - + ;; swap wide bounds (setq ediff-wide-bounds (cond (ediff-3way-comparison-job @@ -1230,7 +1230,7 @@ of the current buffer." (list (nth 1 ediff-wide-bounds) (nth 0 ediff-wide-bounds) (nth 2 ediff-wide-bounds))) - (t + (t (list (nth 1 ediff-wide-bounds) (nth 0 ediff-wide-bounds))))) ;; swap narrow bounds @@ -1243,7 +1243,7 @@ of the current buffer." (list (nth 1 ediff-narrow-bounds) (nth 0 ediff-narrow-bounds) (nth 2 ediff-narrow-bounds))) - (t + (t (list (nth 1 ediff-narrow-bounds) (nth 0 ediff-narrow-bounds))))) (if wide-visibility-p @@ -1254,7 +1254,7 @@ of the current buffer." (ediff-set-state-of-all-diffs-in-all-buffers ediff-control-buffer)) (ediff-recenter 'no-rehighlight) ) - + (defun ediff-toggle-wide-display () "Toggle wide/regular display. @@ -1283,7 +1283,7 @@ This is especially useful when comparing buffers side-by-side." (ediff-with-current-buffer ctl-buf (setq ediff-window-B nil) ; force update of window config (ediff-recenter 'no-rehighlight))))) - + ;;;###autoload (defun ediff-toggle-multiframe () "Switch from multiframe display to single-frame display and back. @@ -1328,7 +1328,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see." (ediff-kill-bottom-toolbar)) ;; do this only after killing the toolbar (setq ediff-use-toolbar-p (not ediff-use-toolbar-p)) - + (mapcar (lambda(buf) (ediff-with-current-buffer buf ;; force redisplay @@ -1346,7 +1346,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see." ;;(selected-frame). ;; The problem with this is that any previous bottom-toolbar ;; will not re-appear after our cleanup here. Is there a way - ;; to do "push" and "pop" toolbars ? --marcpa + ;; to do "push" and "pop" toolbars ? --marcpa (if (ediff-use-toolbar-p) (ediff-cond-compile-for-xemacs-or-emacs (progn ; xemacs @@ -1370,7 +1370,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see." bottom-toolbar (list frame (if (ediff-3way-comparison-job) ediff-toolbar-3way ediff-toolbar))) - (set-specifier bottom-toolbar-visible-p (list frame t)) + (set-specifier bottom-toolbar-visible-p (list frame t)) (set-specifier bottom-toolbar-height (list frame ediff-toolbar-height))) nil ; emacs @@ -1384,7 +1384,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see." ) )) )) - + ;; Merging (defun ediff-toggle-show-clashes-only () @@ -1409,7 +1409,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see." (message "Showing regions that differ from default setting"))) - + ;; Widening/narrowing (defun ediff-toggle-narrow-region () @@ -1422,11 +1422,11 @@ Used in ediff-windows/regions only." (setq ediff-visible-bounds ediff-narrow-bounds) (setq ediff-visible-bounds ediff-wide-bounds)) (ediff-recenter 'no-rehighlight)) - + ;; Narrow bufs A/B/C to ediff-visible-bounds. If this is currently set to ;; ediff-wide-bounds, then this actually widens. ;; This function does nothing if job-name is not -;; ediff-regions-wordwise/linewise or ediff-windows-wordwise/linewise. +;; ediff-regions-wordwise/linewise or ediff-windows-wordwise/linewise. ;; Does nothing if buffer-A = buffer-B since we can't narrow ;; to two different regions in one buffer. (defun ediff-visible-region () @@ -1453,13 +1453,13 @@ Used in ediff-windows/regions only." (if (ediff-overlay-buffer overl-B) (narrow-to-region (ediff-overlay-start overl-B) (ediff-overlay-end overl-B)))) - + (if (and ediff-3way-job (ediff-overlay-buffer overl-C)) (ediff-with-current-buffer ediff-buffer-C (narrow-to-region (ediff-overlay-start overl-C) (ediff-overlay-end overl-C)))) ))) - + ;; Window scrolling operations @@ -1468,7 +1468,7 @@ Used in ediff-windows/regions only." ;; Usually, errors come from scrolling off the ;; beginning or end of the buffer, and this gives error messages. (defun ediff-operate-on-windows (operation arg) - + ;; make sure windows aren't dead (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B))) (ediff-recenter 'no-rehighlight)) @@ -1477,7 +1477,7 @@ Used in ediff-windows/regions only." (or (not ediff-3way-job) ediff-buffer-C) )) (error ediff-KILLED-VITAL-BUFFER)) - + (let* ((wind (selected-window)) (wind-A ediff-window-A) (wind-B ediff-window-B) @@ -1487,7 +1487,7 @@ Used in ediff-windows/regions only." (three-way ediff-3way-job) (coefC (if three-way (ediff-get-region-size-coefficient 'C operation)))) - + (select-window wind-A) (condition-case nil (funcall operation (round (* coefA arg))) @@ -1510,7 +1510,7 @@ With optional argument ARG, scroll ARG lines; otherwise scroll by nearly the one half of the height of window-A." (interactive "P") (ediff-barf-if-not-control-buffer) - + ;; make sure windows aren't dead (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B))) (ediff-recenter 'no-rehighlight)) @@ -1520,10 +1520,10 @@ the one half of the height of window-A." (ediff-buffer-live-p ediff-buffer-C)) )) (error ediff-KILLED-VITAL-BUFFER)) - + (ediff-operate-on-windows (if (memq last-command-char '(?v ?\C-v)) - 'scroll-up + 'scroll-up 'scroll-down) ;; calculate argument to scroll-up/down ;; if there is an explicit argument @@ -1532,7 +1532,7 @@ the one half of the height of window-A." (prefix-numeric-value arg) ;; if not, see if we can determine a default amount (the window height) (let (default-amount) - (setq default-amount + (setq default-amount (- (/ (min (window-height ediff-window-A) (window-height ediff-window-B) (if ediff-3way-job @@ -1554,7 +1554,7 @@ If an argument is given, that is how many columns are scrolled, else nearly the width of the A/B/C windows." (interactive "P") (ediff-barf-if-not-control-buffer) - + ;; make sure windows aren't dead (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B))) (ediff-recenter 'no-rehighlight)) @@ -1564,14 +1564,14 @@ the width of the A/B/C windows." (ediff-buffer-live-p ediff-buffer-C)) )) (error ediff-KILLED-VITAL-BUFFER)) - + (ediff-operate-on-windows ;; Arrange for scroll-left and scroll-right being called ;; interactively so that they set the window's min_hscroll. ;; Otherwise, automatic hscrolling will undo the effect of ;; hscrolling. (if (= last-command-char ?<) - (lambda (arg) + (lambda (arg) (let ((prefix-arg arg)) (call-interactively 'scroll-left))) (lambda (arg) @@ -1606,7 +1606,7 @@ the width of the A/B/C windows." ;;BEG, END show the region to be positioned. ;;JOB-NAME holds ediff-job-name. The ediff-windows job positions regions -;;differently. +;;differently. (defun ediff-position-region (beg end pos job-name) (if (> end (point-max)) (setq end (point-max))) @@ -1706,7 +1706,7 @@ the width of the A/B/C windows." (defun ediff-next-difference (&optional arg) - "Advance to the next difference. + "Advance to the next difference. With a prefix argument, go forward that many differences." (interactive "p") (ediff-barf-if-not-control-buffer) @@ -1714,13 +1714,13 @@ With a prefix argument, go forward that many differences." (let ((n (min ediff-number-of-differences (+ ediff-current-difference (or arg 1)))) non-clash-skip skip-changed regexp-skip) - + (ediff-visible-region) (or (>= n ediff-number-of-differences) (setq regexp-skip (funcall ediff-skip-diff-region-function n)) ;; this won't exec if regexp-skip is t (setq non-clash-skip (ediff-merge-region-is-non-clash n) - skip-changed + skip-changed (ediff-skip-merge-region-if-changed-from-default-p n)) (ediff-install-fine-diff-if-necessary n)) ;; Skip loop @@ -1756,20 +1756,20 @@ With a prefix argument, go forward that many differences." (error "At end of the difference list"))) (defun ediff-previous-difference (&optional arg) - "Go to the previous difference. + "Go to the previous difference. With a prefix argument, go back that many differences." (interactive "p") (ediff-barf-if-not-control-buffer) (if (> ediff-current-difference -1) (let ((n (max -1 (- ediff-current-difference (or arg 1)))) non-clash-skip skip-changed regexp-skip) - + (ediff-visible-region) (or (< n 0) (setq regexp-skip (funcall ediff-skip-diff-region-function n)) ;; this won't exec if regexp-skip is t (setq non-clash-skip (ediff-merge-region-is-non-clash n) - skip-changed + skip-changed (ediff-skip-merge-region-if-changed-from-default-p n)) (ediff-install-fine-diff-if-necessary n)) (while (and (> n -1) @@ -1822,7 +1822,7 @@ If the prefix is negative, count differences from the end." (ediff-unselect-and-select-difference difference-number) (error ediff-BAD-DIFF-NUMBER this-command (1+ difference-number) ediff-number-of-differences))) - + (defun ediff-jump-to-difference-at-point (arg) "Go to difference closest to the point in buffer A, B, or C. The buffer depends on last command character \(a, b, or c\) that invoked this @@ -1877,11 +1877,11 @@ in the specified buffer." (select-window ctl-wind) )) )) - - + + ;; find region most related to the current point position (or POS, if given) ;; returns diff number as seen by the user (i.e., 1+ the internal -;; representation) +;; representation) ;; The optional argument WHICH-DIFF can be `after' or `before'. If `after', ;; find the diff after the point. If `before', find the diff before the ;; point. If the point is inside a diff, return that diff. @@ -1894,7 +1894,7 @@ in the specified buffer." (prev-end 0) (beg 0) (end 0)) - + (ediff-with-current-buffer buffer (setq pos (or pos (point))) (while (and (or (< pos prev-beg) (> pos beg)) @@ -1905,7 +1905,7 @@ in the specified buffer." (setq beg (ediff-get-diff-posn buf-type 'beg diff-no ctl-buffer) end (ediff-get-diff-posn buf-type 'end diff-no ctl-buffer)) ) - + ;; boost diff-no by 1, if past the last diff region (if (and (memq which-diff '(after before)) (> pos beg) (= diff-no max-dif-num)) @@ -2003,20 +2003,20 @@ ARG is a prefix argument. If nil, copy the current difference region." messg ediff-verbose-p reg-to-delete reg-to-delete-beg reg-to-delete-end) - + (setq reg-to-delete-beg (ediff-get-diff-posn to-buf-type 'beg n ctrl-buf)) (setq reg-to-delete-end (ediff-get-diff-posn to-buf-type 'end n ctrl-buf)) - + (if reg-to-copy (setq from-buf-type nil) (setq reg-to-copy (ediff-get-region-contents n from-buf-type ctrl-buf))) - + (setq reg-to-delete (ediff-get-region-contents n to-buf-type ctrl-buf reg-to-delete-beg reg-to-delete-end)) - + (if (string= reg-to-delete reg-to-copy) (setq saved-p nil) ; don't copy identical buffers ;; seems ok to copy @@ -2026,15 +2026,15 @@ ARG is a prefix argument. If nil, copy the current difference region." (ediff-with-current-buffer to-buf ;; to prevent flags from interfering if buffer is writable (let ((inhibit-read-only (null buffer-read-only))) - + (goto-char reg-to-delete-end) (insert reg-to-copy) - + (if (> reg-to-delete-end reg-to-delete-beg) (kill-region reg-to-delete-beg reg-to-delete-end)) )) (or batch-invocation - (setq + (setq messg (ediff-save-diff-region n to-buf-type reg-to-delete)))) (error (message "ediff-copy-diff: %s %s" @@ -2045,7 +2045,7 @@ ARG is a prefix argument. If nil, copy the current difference region." (setq saved-p nil) ))) ) - + ;; adjust state of difference in case 3-way and diff was copied ok (if (and saved-p three-way) (ediff-set-state-of-diff-in-all-buffers n ctrl-buf)) @@ -2056,9 +2056,9 @@ ARG is a prefix argument. If nil, copy the current difference region." ;; before reinserting flags (and thus before ediff-recenter). (if (and saved-p three-way) (ediff-clear-fine-differences n)) - + (ediff-refresh-mode-lines) - + ;; For diff2 jobs, don't recompute fine diffs, since we know there ;; aren't any. So we clear diffs after ediff-recenter. (if (and saved-p (not three-way)) @@ -2067,7 +2067,7 @@ ARG is a prefix argument. If nil, copy the current difference region." ;; by the user (message messg)) )) - + ;; Save Nth diff of buffer BUF-TYPE \(A, B, or C\). ;; That is to say, the Nth diff on the `ediff-killed-diffs-alist'. REG ;; is the region to save. It is redundant here, but is passed anyway, for @@ -2076,7 +2076,7 @@ ARG is a prefix argument. If nil, copy the current difference region." (let* ((n-th-diff-saved (assoc n ediff-killed-diffs-alist)) (buf (ediff-get-buffer buf-type)) (this-buf-n-th-diff-saved (assoc buf (cdr n-th-diff-saved)))) - + (if this-buf-n-th-diff-saved ;; either nothing saved for n-th diff and buffer or we OK'ed ;; overriding @@ -2091,22 +2091,22 @@ ARG is a prefix argument. If nil, copy the current difference region." (if ediff-merge-job "" (downcase (symbol-name buf-type)))) )) - + ;; Test if saving Nth difference region of buffer BUF-TYPE is possible. (defun ediff-test-save-region (n buf-type) (let* ((n-th-diff-saved (assoc n ediff-killed-diffs-alist)) (buf (ediff-get-buffer buf-type)) (this-buf-n-th-diff-saved (assoc buf (cdr n-th-diff-saved)))) - + (if this-buf-n-th-diff-saved (if (yes-or-no-p - (format + (format "You've previously copied diff region %d to buffer %S. Confirm " (1+ n) buf-type)) t (error "Quit")) t))) - + (defun ediff-pop-diff (n buf-type) "Pop last killed Nth diff region from buffer BUF-TYPE." (let* ((n-th-record (assoc n ediff-killed-diffs-alist)) @@ -2116,33 +2116,33 @@ ARG is a prefix argument. If nil, copy the current difference region." (ctl-buf ediff-control-buffer) ediff-verbose-p saved-diff reg-beg reg-end recovered) - + (if (cdr saved-rec) (setq saved-diff (cdr saved-rec)) (if (> ediff-number-of-differences 0) (error "Nothing saved for diff %d in buffer %S" (1+ n) buf-type) (error ediff-NO-DIFFERENCES))) - + (setq reg-beg (ediff-get-diff-posn buf-type 'beg n ediff-control-buffer)) (setq reg-end (ediff-get-diff-posn buf-type 'end n ediff-control-buffer)) - + (condition-case conds (ediff-with-current-buffer buf (let ((inhibit-read-only (null buffer-read-only))) - + (goto-char reg-end) (insert saved-diff) - + (if (> reg-end reg-beg) (kill-region reg-beg reg-end)) - + (setq recovered t) )) (error (message "ediff-pop-diff: %s %s" (car conds) (mapconcat 'prin1-to-string (cdr conds) " ")) (beep 1))) - + ;; Clearing fine diffs is necessary for ;; ediff-unselect-and-select-difference to properly recompute them. We ;; can't rely on ediff-copy-diff to clear this vector, as the user might @@ -2150,20 +2150,20 @@ ARG is a prefix argument. If nil, copy the current difference region." ;; fine diffs. (if recovered (ediff-clear-fine-differences n)) - + ;; adjust state of difference (if (and three-way recovered) (ediff-set-state-of-diff-in-all-buffers n ctl-buf)) - + (ediff-refresh-mode-lines) - + (if recovered (progn (setq n-th-record (delq saved-rec n-th-record)) (message "Diff region %d in buffer %S restored" (1+ n) buf-type) )) )) - + (defun ediff-restore-diff (arg &optional key) "Restore ARGth diff from `ediff-killed-diffs-alist'. ARG is a prefix argument. If ARG is nil, restore the current-difference. @@ -2173,7 +2173,7 @@ determine the target buffer instead of last-command-char" (ediff-barf-if-not-control-buffer) (if (numberp arg) (ediff-jump-to-difference arg)) - (ediff-pop-diff ediff-current-difference + (ediff-pop-diff ediff-current-difference (ediff-char-to-buftype (or key last-command-char))) ;; recenter with rehighlighting, but no messages (let (ediff-verbose-p) @@ -2184,8 +2184,8 @@ determine the target buffer instead of last-command-char" ARG is a prefix argument. If nil, restore the current diff." (interactive "P") (ediff-restore-diff arg ?c)) - - + + (defun ediff-toggle-regexp-match () "Toggle between focusing and hiding of difference regions that match a regular expression typed in by the user." @@ -2206,20 +2206,20 @@ a regular expression typed in by the user." (setq ediff-skip-diff-region-function 'ediff-show-all-diffs)) ((eq last-command-char ?h) (setq ediff-skip-diff-region-function ediff-hide-regexp-matches-function - regexp-A + regexp-A (read-string - (format + (format "Ignore A-regions matching this regexp (default \"%s\"): " ediff-regexp-hide-A)) regexp-B (read-string - (format + (format "Ignore B-regions matching this regexp (default \"%s\"): " ediff-regexp-hide-B))) (if ediff-3way-comparison-job (setq regexp-C (read-string - (format + (format "Ignore C-regions matching this regexp (default \"%s\"): " ediff-regexp-hide-C)))) (if (eq ediff-hide-regexp-connective 'and) @@ -2236,7 +2236,7 @@ a regular expression typed in by the user." (message "Will ignore regions that match %s regexps" msg-connective) (setq ediff-hide-regexp-connective alt-connective) (message "Will ignore regions that match %s regexps" - alt-msg-connective)) + alt-msg-connective)) (or (string= regexp-A "") (setq ediff-regexp-hide-A regexp-A)) (or (string= regexp-B "") (setq ediff-regexp-hide-B regexp-B)) @@ -2245,20 +2245,20 @@ a regular expression typed in by the user." ((eq last-command-char ?f) (setq ediff-skip-diff-region-function ediff-focus-on-regexp-matches-function - regexp-A + regexp-A (read-string - (format + (format "Focus on A-regions matching this regexp (default \"%s\"): " ediff-regexp-focus-A)) regexp-B (read-string - (format + (format "Focus on B-regions matching this regexp (default \"%s\"): " ediff-regexp-focus-B))) (if ediff-3way-comparison-job (setq regexp-C (read-string - (format + (format "Focus on C-regions matching this regexp (default \"%s\"): " ediff-regexp-focus-C)))) (if (eq ediff-focus-regexp-connective 'and) @@ -2275,13 +2275,13 @@ a regular expression typed in by the user." (message "Will focus on regions that match %s regexps" msg-connective) (setq ediff-focus-regexp-connective alt-connective) - (message "Will focus on regions that match %s regexps" + (message "Will focus on regions that match %s regexps" alt-msg-connective)) (or (string= regexp-A "") (setq ediff-regexp-focus-A regexp-A)) (or (string= regexp-B "") (setq ediff-regexp-focus-B regexp-B)) (or (string= regexp-C "") (setq ediff-regexp-focus-C regexp-C)))))) - + (defun ediff-toggle-skip-similar () (interactive) (ediff-barf-if-not-control-buffer) @@ -2293,10 +2293,10 @@ a regular expression typed in by the user." (message "Skipping regions that differ only in white space & line breaks") (message "Skipping over white-space differences turned off"))) - + (defun ediff-focus-on-regexp-matches (n) "Focus on diffs that match regexp `ediff-regexp-focus-A/B'. -Regions to be ignored according to this function are those where +Regions to be ignored according to this function are those where buf A region doesn't match `ediff-regexp-focus-A' and buf B region doesn't match `ediff-regexp-focus-B'. This function returns nil if the region number N (specified as @@ -2335,8 +2335,8 @@ the number seen by the user." (list ediff-focus-regexp-connective reg-A-match reg-B-match)))) ))) - -(defun ediff-hide-regexp-matches (n) + +(defun ediff-hide-regexp-matches (n) "Hide diffs that match regexp `ediff-regexp-hide-A/B/C'. Regions to be ignored are those where buf A region matches `ediff-regexp-hide-A' and buf B region matches `ediff-regexp-hide-B'. @@ -2377,7 +2377,7 @@ the number seen by the user." reg-A-match reg-B-match reg-C-match) (list ediff-hide-regexp-connective reg-A-match reg-B-match))) ))) - + ;;; Quitting, suspending, etc. @@ -2389,8 +2389,8 @@ flags of the compared file buffers, kills Ediff buffers for this session \(but not buffers A, B, C\). If `ediff-keep-variants' is nil, the user will be asked whether the buffers -containing the variants should be removed \(if they haven't been modified\). -If it is t, they will be preserved unconditionally. A prefix argument, +containing the variants should be removed \(if they haven't been modified\). +If it is t, they will be preserved unconditionally. A prefix argument, temporarily reverses the meaning of this variable." (interactive "P") (ediff-barf-if-not-control-buffer) @@ -2414,7 +2414,7 @@ temporarily reverses the meaning of this variable." (ediff-clear-diff-vector 'ediff-difference-vector-Ancestor 'fine-diffs-also) (ediff-delete-temp-files) - + ;; Restore the visibility range. This affects only ediff-*-regions/windows. ;; Since for other job names ediff-visible-region sets ;; ediff-visible-bounds to ediff-wide-bounds, the settings below are @@ -2422,7 +2422,7 @@ temporarily reverses the meaning of this variable." (if ediff-quit-widened (setq ediff-visible-bounds ediff-wide-bounds) (setq ediff-visible-bounds ediff-narrow-bounds)) - + ;; Apply selective display to narrow or widen (ediff-visible-region) (mapcar (lambda (overl) @@ -2441,32 +2441,32 @@ temporarily reverses the meaning of this variable." (session-number ediff-meta-session-number) ;; suitable working frame (warp-frame (if (and (ediff-window-display-p) (eq ediff-grab-mouse t)) - (cond ((window-live-p ediff-window-A) + (cond ((window-live-p ediff-window-A) (window-frame ediff-window-A)) - ((window-live-p ediff-window-B) + ((window-live-p ediff-window-B) (window-frame ediff-window-B)) (t (next-frame)))))) (condition-case nil (ediff-with-current-buffer ediff-buffer-A - (setq ediff-this-buffer-ediff-sessions + (setq ediff-this-buffer-ediff-sessions (delq control-buffer ediff-this-buffer-ediff-sessions)) (kill-local-variable 'mode-line-buffer-identification) (kill-local-variable 'mode-line-format) ) (error)) - + (condition-case nil (ediff-with-current-buffer ediff-buffer-B - (setq ediff-this-buffer-ediff-sessions + (setq ediff-this-buffer-ediff-sessions (delq control-buffer ediff-this-buffer-ediff-sessions)) (kill-local-variable 'mode-line-buffer-identification) (kill-local-variable 'mode-line-format) ) (error)) - + (condition-case nil (ediff-with-current-buffer ediff-buffer-C - (setq ediff-this-buffer-ediff-sessions + (setq ediff-this-buffer-ediff-sessions (delq control-buffer ediff-this-buffer-ediff-sessions)) (kill-local-variable 'mode-line-buffer-identification) (kill-local-variable 'mode-line-format) @@ -2475,7 +2475,7 @@ temporarily reverses the meaning of this variable." (condition-case nil (ediff-with-current-buffer ediff-ancestor-buffer - (setq ediff-this-buffer-ediff-sessions + (setq ediff-this-buffer-ediff-sessions (delq control-buffer ediff-this-buffer-ediff-sessions)) (kill-local-variable 'mode-line-buffer-identification) (kill-local-variable 'mode-line-format) @@ -2540,8 +2540,8 @@ temporarily reverses the meaning of this variable." (if (string-match "Minibuf" buf-name) nil frame))) - - + + (defun ediff-delete-temp-files () (if (and (stringp ediff-temp-file-A) (file-exists-p ediff-temp-file-A)) (delete-file ediff-temp-file-A)) @@ -2549,7 +2549,7 @@ temporarily reverses the meaning of this variable." (delete-file ediff-temp-file-B)) (if (and (stringp ediff-temp-file-C) (file-exists-p ediff-temp-file-C)) (delete-file ediff-temp-file-C))) - + ;; Kill control buffer, other auxiliary Ediff buffers. ;; Leave one of the frames split between buffers A/B/C @@ -2561,11 +2561,11 @@ temporarily reverses the meaning of this variable." (ctl-wind (ediff-get-visible-buffer-window ctl-buf)) (ctl-frame ediff-control-frame) (three-way-job ediff-3way-job) - (main-frame (cond ((window-live-p ediff-window-A) + (main-frame (cond ((window-live-p ediff-window-A) (window-frame ediff-window-A)) - ((window-live-p ediff-window-B) + ((window-live-p ediff-window-B) (window-frame ediff-window-B))))) - + (ediff-kill-buffer-carefully ediff-diff-buffer) (ediff-kill-buffer-carefully ediff-custom-diff-buffer) (ediff-kill-buffer-carefully ediff-fine-diff-buffer) @@ -2587,10 +2587,10 @@ temporarily reverses the meaning of this variable." (ediff-kill-bottom-toolbar)) (ediff-kill-buffer-carefully ctl-buf) - + (if (frame-live-p main-frame) (select-frame main-frame)) - + ;; display only if not visible (condition-case nil (or (ediff-get-visible-buffer-window buff-B) @@ -2651,7 +2651,7 @@ delete this buffer in another session as well." ;; Kill indirect buffer even if it is modified, because the base buffer ;; is still there. Note that if the base buffer is dead then so will be ;; the indirect buffer - (ediff-with-current-buffer buff + (ediff-with-current-buffer buff (set-buffer-modified-p nil)) (ediff-kill-buffer-carefully buff) (ediff-with-current-buffer base @@ -2752,11 +2752,11 @@ only if this merge job is part of a group, i.e., was invoked from within (buf-diff ediff-diff-buffer) (buf-custom-diff ediff-custom-diff-buffer) (buf-fine-diff ediff-fine-diff-buffer)) - + ;; hide the control panel (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame)) (iconify-frame ediff-control-frame) - (bury-buffer)) + (bury-buffer)) (if buf-err (bury-buffer buf-err)) (if buf-diff (bury-buffer buf-diff)) (if buf-custom-diff (bury-buffer buf-custom-diff)) @@ -2792,7 +2792,7 @@ only if this merge job is part of a group, i.e., was invoked from within (bury-buffer)))) )) - + (defun ediff-suspend () "Suspend Ediff. To resume, switch to the appropriate `Ediff Control Panel' @@ -2822,20 +2822,20 @@ Hit \\[ediff-recenter] to reset the windows afterward." (if buffer-file-name (princ (format "File A = %S\n" buffer-file-name)) - (princ + (princ (format "Buffer A = %S\n" (buffer-name))))) (ediff-with-current-buffer ediff-buffer-B (if buffer-file-name (princ (format "File B = %S\n" buffer-file-name)) - (princ + (princ (format "Buffer B = %S\n" (buffer-name))))) (if ediff-3way-job (ediff-with-current-buffer ediff-buffer-C (if buffer-file-name (princ (format "File C = %S\n" buffer-file-name)) - (princ + (princ (format "Buffer C = %S\n" (buffer-name)))))) (princ (format "Customized diff output %s\n" (if (ediff-buffer-live-p ediff-custom-diff-buffer) @@ -2847,7 +2847,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." (concat "\tin buffer " (buffer-name ediff-diff-buffer)) " is not available"))) - + (let* ((A-line (ediff-with-current-buffer ediff-buffer-A (1+ (count-lines (point-min) (point))))) (B-line (ediff-with-current-buffer ediff-buffer-B @@ -2860,7 +2860,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." (setq C-line (ediff-with-current-buffer ediff-buffer-C (1+ (count-lines (point-min) (point))))) (princ (format "Buffer C's point is on line %d\n" C-line))))) - + (princ (format "\nCurrent difference number = %S\n" (cond ((< ediff-current-difference 0) 'start) ((>= ediff-current-difference @@ -2877,7 +2877,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." (if (and ediff-skip-merge-regions-that-differ-from-default ediff-merge-job) (princ "\nSkipping merge regions that differ from default setting")) - + (cond ((eq ediff-skip-diff-region-function 'ediff-show-all-diffs) (princ "\nSelective browsing by regexp is off\n")) ((eq ediff-skip-diff-region-function @@ -2885,7 +2885,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." (princ "\nIgnoring regions that match") (princ - (format + (format "\n\t regexp `%s' in buffer A %S\n\t regexp `%s' in buffer B\n" ediff-regexp-hide-A ediff-hide-regexp-connective ediff-regexp-hide-B))) @@ -2899,7 +2899,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." ediff-regexp-focus-A ediff-focus-regexp-connective ediff-regexp-focus-B))) (t (princ "\nSelective browsing via a user-defined method.\n"))) - + (princ (format "\nBugs/suggestions: type `%s' while in Ediff Control Panel." (substitute-command-keys "\\[ediff-submit-report]"))) @@ -2908,7 +2908,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." (ediff-reset-mouse ediff-control-frame)) (if (window-live-p ediff-control-window) (select-window ediff-control-window))) - + @@ -2937,17 +2937,17 @@ Hit \\[ediff-recenter] to reset the windows afterward." (ediff-place-flags-in-buffer 'Ancestor ediff-ancestor-buffer ediff-control-buffer n)) - )) - + )) + (ediff-install-fine-diff-if-necessary n) (run-hooks 'ediff-select-hook)))) - + ;; Unselect a difference by removing the ASCII flags in the buffers. ;; This may have to be modified for buffer C, when it will be supported. (defun ediff-unselect-difference (n) (if (ediff-valid-difference-p n) - (progn + (progn (cond ((and (ediff-has-face-support-p) ediff-use-faces) (ediff-unhighlight-diff)) ((eq ediff-highlighting-style 'ascii) @@ -2966,11 +2966,11 @@ Hit \\[ediff-recenter] to reset the windows afterward." ediff-ancestor-buffer (ediff-get-diff-overlay n 'Ancestor))) )) - + ;; unhighlight fine diffs (ediff-set-fine-diff-properties ediff-current-difference 'default) (run-hooks 'ediff-unselect-hook)))) - + ;; Unselects prev diff and selects a new one, if FLAG has value other than ;; 'select-only or 'unselect-only. If FLAG is 'select-only, the @@ -2982,18 +2982,18 @@ Hit \\[ediff-recenter] to reset the windows afterward." (let ((ediff-current-difference n)) (or no-recenter (ediff-recenter 'no-rehighlight))) - + (let ((control-buf ediff-control-buffer)) - (unwind-protect + (unwind-protect (progn (or (eq flag 'select-only) (ediff-unselect-difference ediff-current-difference)) - + (or (eq flag 'unselect-only) (ediff-select-difference n)) (setq ediff-current-difference n) ) ; end protected section - + (ediff-with-current-buffer control-buf (ediff-refresh-mode-lines))) )) @@ -3133,8 +3133,8 @@ Hit \\[ediff-recenter] to reset the windows afterward." (file-name-nondirectory default-file) f))) (if (and no-dirs (file-directory-p f)) (error "File %s is a directory" f)) - f)) - + f)) + ;; If PREFIX is given, then it is used as a prefix for the temp file ;; name. Otherwise, `ediff' is used. If FILE is given, use this ;; file and don't create a new one. @@ -3151,7 +3151,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." (not (msdos-long-file-names)) (> (length p) 2)) (setq short-p (substring p 0 2))) - + (setq f (concat ediff-temp-file-prefix p) short-f (concat ediff-temp-file-prefix short-p) f (cond (given-file) @@ -3161,7 +3161,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." ;; This is needed so that patches produced by ediff will ;; have more meaningful names (ediff-make-empty-tmp-file short-f)) - (prefix + (prefix ;; Prefix is most often the same as the file name for the ;; variant. Here we are trying to use the original file ;; name but in the temp directory. @@ -3170,14 +3170,14 @@ Hit \\[ediff-recenter] to reset the windows afterward." ;; If don't care about name, add some random stuff ;; to proposed file name. (ediff-make-empty-tmp-file short-f)))) - + ;; create the file (ediff-with-current-buffer buff (write-region (if start start (point-min)) (if end end (point-max)) f nil ; don't append---erase - 'no-message) + 'no-message) (set-file-modes f ediff-temp-file-mode) (expand-file-name f)))) @@ -3232,7 +3232,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." (if (verify-visited-file-modtime (current-buffer)) (if (buffer-modified-p) ;; If buffer is not obsolete and is modified, offer to save - (if (yes-or-no-p + (if (yes-or-no-p (format "Buffer %s has been modified. Save it in file %s? " (buffer-name) buffer-file-name)) @@ -3371,7 +3371,7 @@ Without an argument, it saves customized diff argument, if available (set-mark reg-end) (setq ediff-temp-indirect-buffer t)) cloned-buff)) - + (defun ediff-make-cloned-buffer (buff region-name) @@ -3399,7 +3399,7 @@ Without an argument, it saves customized diff argument, if available (setq buf-B-file-name (file-name-nondirectory buf-B-file-name))) (setq file-A (ediff-make-temp-file ediff-buffer-A buf-A-file-name) file-B (ediff-make-temp-file ediff-buffer-B buf-B-file-name)) - + (or (ediff-buffer-live-p ediff-custom-diff-buffer) (setq ediff-custom-diff-buffer (get-buffer-create @@ -3498,7 +3498,7 @@ Ediff Control Panel to restore highlighting." nil) ((equal answer "")) (t (beep 1) - (message + (message "Valid values are %s" (mapconcat 'char-to-string possibilities " or ")) (sit-for 2) @@ -3517,7 +3517,7 @@ Ediff Control Panel to restore highlighting." nil) ((equal answer "")) (t (beep 1) - (message + (message "Valid values are %s" (mapconcat 'char-to-string possibilities " or ")) (sit-for 2) @@ -3577,8 +3577,8 @@ Ediff Control Panel to restore highlighting." ;; setup param to pass to ediff-setup (list (cons 'ediff-split-window-function ediff-split-window-function))) )) - - + + (defun ediff-remove-flags-from-buffer (buffer overlay) (ediff-with-current-buffer buffer @@ -3586,7 +3586,7 @@ Ediff Control Panel to restore highlighting." (if ediff-xemacs-p (ediff-overlay-put overlay 'begin-glyph nil) (ediff-overlay-put overlay 'before-string nil)) - + (if ediff-xemacs-p (ediff-overlay-put overlay 'end-glyph nil) (ediff-overlay-put overlay 'after-string nil)) @@ -3604,32 +3604,32 @@ Ediff Control Panel to restore highlighting." (ediff-get-diff-overlay diff-no buf-type))) (before (ediff-get-diff-posn buf-type 'beg diff-no ctl-buffer)) after beg-of-line flag) - + ;; insert flag before the difference (goto-char before) (setq beg-of-line (bolp)) - + (setq flag (ediff-with-current-buffer ctl-buffer (if (eq ediff-highlighting-style 'ascii) (if beg-of-line ediff-before-flag-bol ediff-before-flag-mol)))) - + ;; insert the flag itself (if ediff-xemacs-p (ediff-overlay-put curr-overl 'begin-glyph flag) (ediff-overlay-put curr-overl 'before-string flag)) - + ;; insert the flag after the difference ;; `after' must be set here, after the before-flag was inserted (setq after (ediff-get-diff-posn buf-type 'end diff-no ctl-buffer)) (goto-char after) (setq beg-of-line (bolp)) - + (setq flag (ediff-with-current-buffer ctl-buffer (if (eq ediff-highlighting-style 'ascii) (if beg-of-line ediff-after-flag-eol ediff-after-flag-mol)))) - + ;; insert the flag itself (if ediff-xemacs-p (ediff-overlay-put curr-overl 'end-glyph flag) @@ -3670,12 +3670,12 @@ Ediff Control Panel to restore highlighting." (buffer-substring (or start (ediff-get-diff-posn buf-type 'beg n ctrl-buf)) (or end (ediff-get-diff-posn buf-type 'end n ctrl-buf))))) - + ;; Returns positions of difference sectors in the BUF-TYPE buffer. -;; BUF-TYPE should be a symbol -- `A', `B', or `C'. +;; BUF-TYPE should be a symbol -- `A', `B', or `C'. ;; POS is either `beg' or `end'--it specifies whether you want the position at ;; the beginning of a difference or at the end. -;; +;; ;; The optional argument N says which difference (default: ;; `ediff-current-difference'). N is the internal difference number (1- what ;; the user sees). The optional argument CONTROL-BUF says @@ -3706,21 +3706,21 @@ Ediff Control Panel to restore highlighting." ;; ediff-highlighting-style, and ediff-highlight-all-diffs variables. (defun ediff-restore-highlighting (&optional ctl-buf) (ediff-with-current-buffer (or ctl-buf (current-buffer)) - (if (and (ediff-has-face-support-p) + (if (and (ediff-has-face-support-p) ediff-use-faces ediff-highlight-all-diffs) (ediff-paint-background-regions)) (ediff-select-difference ediff-current-difference))) - + ;; null out difference overlays so they won't slow down future ;; editing operations ;; VEC is either a difference vector or a fine-diff vector (defun ediff-clear-diff-vector (vec-var &optional fine-diffs-also) (if (vectorp (symbol-value vec-var)) (mapcar (lambda (elt) - (ediff-delete-overlay + (ediff-delete-overlay (ediff-get-diff-overlay-from-diff-record elt)) (if fine-diffs-also (ediff-clear-fine-diff-vector elt)) @@ -3729,7 +3729,7 @@ Ediff Control Panel to restore highlighting." ;; allow them to be garbage collected (set vec-var nil)) - + ;;; Misc @@ -3749,13 +3749,13 @@ Ediff Control Panel to restore highlighting." (setq beg (eval beg))) (or (number-or-marker-p end) (setq end (eval end))) - (setq overl + (setq overl (ediff-cond-compile-for-xemacs-or-emacs (make-extent beg end buff) ; xemacs ;; advance front and rear of the overlay (make-overlay beg end buff nil 'rear-advance) ; emacs )) - + ;; never detach (ediff-overlay-put overl (if ediff-emacs-p 'evaporate 'detachable) nil) @@ -3763,7 +3763,7 @@ Ediff Control Panel to restore highlighting." ;; In emacs, it is made open ended at creation time (if ediff-xemacs-p (progn - (ediff-overlay-put overl 'start-open nil) + (ediff-overlay-put overl 'start-open nil) (ediff-overlay-put overl 'end-open nil))) (ediff-overlay-put overl 'ediff-diff-num 0) overl)))) @@ -3783,13 +3783,13 @@ Ediff Control Panel to restore highlighting." (ediff-set-overlay-face (symbol-value overlay) face) (ediff-overlay-put (symbol-value overlay) 'ediff ediff-control-buffer)) )) - - + + ;; Like other-buffer, but prefers visible buffers and ignores temporary or ;; other insignificant buffers (those beginning with "^[ *]"). ;; Gets one arg--buffer name or a list of buffer names (it won't return ;; these buffers). -;; EXCL-BUFF-LIST is an exclusion list. +;; EXCL-BUFF-LIST is an exclusion list. (defun ediff-other-buffer (excl-buff-lst) (or (listp excl-buff-lst) (setq excl-buff-lst (list excl-buff-lst))) (let* ((all-buffers (nconc (ediff-get-selected-buffers) (buffer-list))) @@ -3799,8 +3799,8 @@ Ediff Control Panel to restore highlighting." (selected-buffers (ediff-get-selected-buffers)) (prefered-buffer (car all-buffers)) visible-dired-buffers - (excl-buff-name-list - (mapcar + (excl-buff-name-list + (mapcar (lambda (b) (cond ((stringp b) b) ((bufferp b) (buffer-name b)))) excl-buff-lst)) @@ -3857,10 +3857,10 @@ Ediff Control Panel to restore highlighting." (clean-significant-buffers (delq nil significant-buffers)) less-significant-buffers) - (if (and (null clean-significant-buffers) + (if (and (null clean-significant-buffers) (> (length visible-dired-buffers) 0)) (setq clean-significant-buffers visible-dired-buffers)) - + (cond (clean-significant-buffers (car clean-significant-buffers)) ;; try also buffers that are not displayed in windows ((setq less-significant-buffers @@ -3884,7 +3884,7 @@ Ediff Control Panel to restore highlighting." (car less-significant-buffers)) (t "*scratch*")) )) - + ;; If current buffer is a Buffer-menu buffer, then take the selected buffers ;; and append the buffer at the cursor to the end. @@ -3902,9 +3902,9 @@ Ediff Control Panel to restore highlighting." (setq lis (cons (Buffer-menu-buffer t) lis))) lis)) )) - + ;; 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 ediff-unique-buffer-name (prefix suffix) (if (null (get-buffer (concat prefix suffix))) @@ -3913,7 +3913,7 @@ Ediff Control Panel to restore highlighting." (while (get-buffer (format "%s<%d>%s" prefix n suffix)) (setq n (1+ n))) (format "%s<%d>%s" prefix n suffix)))) - + (defun ediff-submit-report () "Submit bug report on Ediff." @@ -3926,7 +3926,7 @@ Ediff Control Panel to restore highlighting." (setq varlist '(ediff-diff-program ediff-diff-options ediff-patch-program ediff-patch-options ediff-shell - ediff-use-faces + ediff-use-faces ediff-auto-refine ediff-highlighting-style ediff-buffer-A ediff-buffer-B ediff-control-buffer ediff-forward-word-function @@ -3948,10 +3948,10 @@ Please make a concise and accurate summary of what happened and mail it to the address above. ----------------------------------------------------------- ") - + (ediff-skip-unsuitable-frames) (ediff-reset-mouse) - + (switch-to-buffer ediff-msg-buffer) (erase-buffer) (delete-other-windows) @@ -3978,7 +3978,7 @@ byte-compilation may produce output like this: ** reference to free variable pm-color-alist ........................ While compiling the end of the data: - ** The following functions are not known to be defined: + ** The following functions are not known to be defined: ediff-valid-color-p, ediff-set-face, ........................ @@ -3988,7 +3988,7 @@ Please do not report those and similar things. However, comments and suggestions are always welcome. Mail anyway? (y or n) ") - + (if (y-or-n-p "Mail anyway? ") (progn (if (ediff-buffer-live-p ctl-buf) @@ -3998,7 +3998,7 @@ Mail anyway? (y or n) ") (reporter-submit-bug-report "kifer@cs.stonybrook.edu" (ediff-version) varlist - nil + nil 'delete-other-windows salutation)) (bury-buffer) @@ -4018,16 +4018,16 @@ Mail anyway? (y or n) ") (defun ediff-choose-syntax-table () (setq ediff-syntax-table (ediff-with-current-buffer ediff-buffer-A - (if (not (memq major-mode + (if (not (memq major-mode '(fundamental-mode text-mode indented-text-mode))) (syntax-table)))) (if (not ediff-syntax-table) - (setq ediff-syntax-table + (setq ediff-syntax-table (ediff-with-current-buffer ediff-buffer-B (syntax-table)))) ) - + (defun ediff-deactivate-mark () (ediff-cond-compile-for-xemacs-or-emacs (zmacs-deactivate-region) ; xemacs @@ -4062,7 +4062,7 @@ Mail anyway? (y or n) ") (setq selective-display nil))))) )) - + ;; The next two are modified versions from emerge.el. ;; VARS must be a list of symbols ;; ediff-save-variables returns an association list: ((var . val) ...) @@ -4083,8 +4083,8 @@ Mail anyway? (y or n) ") (assoc-elt (assoc var assoc-list))) (if assoc-elt (setcdr assoc-elt value)))) - - + + ;; must execute in control buf (defun ediff-save-protected-variables () (setq ediff-buffer-values-orig-A @@ -4144,7 +4144,7 @@ Mail anyway? (y or n) ") (defsubst ediff-save-time () (setq ediff-command-begin-time (current-time))) - + (defun ediff-profile () "Toggle profiling Ediff commands." (interactive) @@ -4165,7 +4165,7 @@ Mail anyway? (y or n) ") (add-hook pre-hook 'ediff-save-time t 'local) (add-hook post-hook 'ediff-calc-command-time nil 'local) (message "Ediff profiling enabled")))) - + (defun ediff-print-diff-vector (diff-vector-var) (princ (format "\n*** %S ***\n" diff-vector-var)) (mapcar (lambda (overl-vec) @@ -4176,7 +4176,7 @@ Mail anyway? (y or n) ") \t\tNo-fine-diff-flag: %S \t\tState-of-diff:\t %S \t\tState-of-merge:\t %S -" +" (1+ (ediff-overlay-get (aref overl-vec 0) 'ediff-diff-num)) (aref overl-vec 0) ;; fine-diff-vector @@ -4190,7 +4190,7 @@ Mail anyway? (y or n) ") ))) (eval diff-vector-var))) - + (defun ediff-debug-info () (interactive) @@ -4233,7 +4233,7 @@ Mail anyway? (y or n) ") (nconc result (list (car lis1)))) (setq lis1 (cdr lis1))) (cdr result))) - + ;; eliminates duplicates using comparison-func (defun ediff-union (lis1 lis2 comparison-func) @@ -4278,7 +4278,7 @@ Mail anyway? (y or n) ") ;;(ediff-load-version-control 'silent) (run-hooks 'ediff-load-hook) - + ;;; Local Variables: ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) diff --git a/lisp/ediff-vers.el b/lisp/ediff-vers.el index 03bc171a65..6438b4b380 100644 --- a/lisp/ediff-vers.el +++ b/lisp/ediff-vers.el @@ -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 diff --git a/lisp/ediff-wind.el b/lisp/ediff-wind.el index 9e95926539..f2a0ccdd79 100644 --- a/lisp/ediff-wind.el +++ b/lisp/ediff-wind.el @@ -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) diff --git a/lisp/ediff.el b/lisp/ediff.el index 351809482a..2525a07658 100644 --- a/lisp/ediff.el +++ b/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))))))) - + diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 2526d3bda6..4ec62152db 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -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 diff --git a/lisp/ehelp.el b/lisp/ehelp.el index a2ea97688a..f599606884 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -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 diff --git a/lisp/electric.el b/lisp/electric.el index d4678a7e3e..87a151b480 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -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 diff --git a/lisp/emerge.el b/lisp/emerge.el index 2fb47ee8ab..170a907afa 100644 --- a/lisp/emerge.el +++ b/lisp/emerge.el @@ -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))) diff --git a/lisp/env.el b/lisp/env.el index e19f9f7f5d..f41677fcf1 100644 --- a/lisp/env.el +++ b/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)))) diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 37399e0d90..78bdfc6115 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -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) diff --git a/lisp/ffap.el b/lisp/ffap.el index 60a700f03c..56294cf6d8 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -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: diff --git a/lisp/find-dired.el b/lisp/find-dired.el index 046a2b7dad..8ea6bbc61d 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -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))) diff --git a/lisp/find-file.el b/lisp/find-file.el index b4db74da75..259a85fa62 100644 --- a/lisp/find-file.el +++ b/lisp/find-file.el @@ -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)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/lisp/flow-ctrl.el b/lisp/flow-ctrl.el index f98ecaa0fb..44b496357a 100644 --- a/lisp/flow-ctrl.el +++ b/lisp/flow-ctrl.el @@ -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. diff --git a/lisp/foldout.el b/lisp/foldout.el index f1905b79a7..21f2208723 100644 --- a/lisp/foldout.el +++ b/lisp/foldout.el @@ -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 diff --git a/lisp/font-core.el b/lisp/font-core.el index 0554d65749..c2c95bfe8a 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -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 diff --git a/lisp/format.el b/lisp/format.el index 0d538c25df..c9259fd31a 100644 --- a/lisp/format.el +++ b/lisp/format.el @@ -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'." diff --git a/lisp/forms-d2.el b/lisp/forms-d2.el index e603927e02..ae338abf10 100644 --- a/lisp/forms-d2.el +++ b/lisp/forms-d2.el @@ -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." diff --git a/lisp/forms.el b/lisp/forms.el index 975b030ad5..c3cffa3d4e 100644 --- a/lisp/forms.el +++ b/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 "" "\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*")) diff --git a/lisp/gdb-ui.el b/lisp/gdb-ui.el index a01a35e88c..ad220ff8ec 100644 --- a/lisp/gdb-ui.el +++ b/lisp/gdb-ui.el @@ -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-*\\)") diff --git a/lisp/gud.el b/lisp/gud.el index 862ecd3e38..3ef5a7ad83 100644 --- a/lisp/gud.el +++ b/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) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 2b61cd88d4..4b5a2e0320 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -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))))) diff --git a/lisp/help.el b/lisp/help.el index 8d0be9b63c..e6f9f173de 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -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. diff --git a/lisp/hexl.el b/lisp/hexl.el index 0844c69720..9330de1a60 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -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)))) diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 85f4427952..2d96ac9848 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -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. diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el index 6bffc6fb5c..8eb3a6ea37 100644 --- a/lisp/hilit-chg.el +++ b/lisp/hilit-chg.el @@ -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 Mar 1998 -;; - fixes for byte compile errors +;; - fixes for byte compile errors ;; - use eval-and-compile for autoload ;; Marijn Ros 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) diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 4aa1ec0874..902b2f7cfb 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -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. diff --git a/lisp/ibuf-macs.el b/lisp/ibuf-macs.el index 03ef2404f4..e12a119993 100644 --- a/lisp/ibuf-macs.el +++ b/lisp/ibuf-macs.el @@ -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)) diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 9fa551e371..dca5667d4a 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -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 "") '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. diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 786c0a5522..4e368c8c80 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -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'." diff --git a/lisp/ido.el b/lisp/ido.el index 0391ec68b4..eda6827eb2 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -26,7 +26,7 @@ ;;; Acknowledgements ;; Infinite amounts of gratitude goes to Stephen Eglen -;; 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)) diff --git a/lisp/ielm.el b/lisp/ielm.el index ad8bb547cb..16235f065e 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -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) diff --git a/lisp/image.el b/lisp/image.el index ac1ef557ed..346c2e72a0 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -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)))))))) -- 2.20.1