From: Chong Yidong Date: Fri, 16 Jul 2010 15:42:15 +0000 (-0400) Subject: Merge changes from emacs-23 branch. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~51^2~39 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fea9cabd275c3d5809b824a6e4a1446441a6793e;p=emacs.git Merge changes from emacs-23 branch. --- fea9cabd275c3d5809b824a6e4a1446441a6793e diff --cc lisp/ChangeLog index 199c8243188,0ce0e8e3073..f0ea29a5d89 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@@ -1,149 -1,39 +1,180 @@@ + 2010-07-16 Reiner Steib + + * vc.el (vc-coding-system-inherit-eol): New defvar. + (vc-coding-system-for-diff): Use it to decide whether to inherit + from the file the EOL format for reading the diffs of that file. + (Bug#4451) + + 2010-07-16 Eli Zaretskii + + * mail/rmailmm.el (rmail-mime-save): Make the temp buffer + unibyte, so compressed attachments are not compressed again. + +2010-07-16 Michael Albinus + + * net/tramp.el (tramp-handle-shell-command): Don't use hard-wired + "/bin/sh" but `tramp-remote-sh' from `tramp-methods'. + (tramp-find-shell): Simplify setting connection property. + (tramp-get-ls-command): Make test for "--color=never" stronger. + +2010-07-15 Simon South + + * progmodes/delphi.el (delphi-previous-indent-of): Indent case + blocks within record declarations (i.e. variant parts) correctly. + +2010-07-15 Simon South + + * progmodes/delphi.el (delphi-token-at): Give newlines precedence + over literal tokens when parsing so newlines aren't "absorbed" by + single-line comments. Corrects the indentation of case blocks + that have a comment on the first line. + +2010-07-14 Karl Fogel + + * bookmark.el (bookmark-load-hook): Fix doc string as suggested + by Drew Adams (Bug#5504). + + 2010-07-14 Jan Djärv + + * xt-mouse.el (xterm-mouse-event-read): Fix for characters > 127 + now that unicode is used (Bug#6594). + 2010-07-14 Chong Yidong - * simple.el (push-mark-command): Set the selection if - select-active-regions is non-nil. + * term/x-win.el (x-select-enable-clipboard): Default to t. + (x-initialize-window-system): Don't overwrite Paste menu item. + + * simple.el (select-active-regions): Default to t. + (push-mark-command): Don't overwrite primary with empty string. + + * mouse.el: Bind mouse-2 to mouse-yank-primary. + (mouse-drag-copy-region): Default to nil. + + * menu-bar.el (menu-bar-enable-clipboard): Don't overwrite + Cut/Copy/Paste menu bar items. + +2010-07-13 Thierry Volpiatto + + Allow C-w when setting a bookmark in a Gnus Article buffer (Bug#5975). + Patch applied by Karl Fogel. + + * bookmark.el (bookmark-set): Don't set `bookmark-yank-point' + and `bookmark-current-buffer' if they have been already set in + another buffer (e.g gnus-art). + +2010-07-13 Karl Fogel + Thierry Volpiatto + + Preparation for setting bookmarks in Gnus article buffers (Bug#5975). + + * bookmark.el (bookmark-make-record-default): Allow unneeded + information to be omitted from the record. + + Adjust declarations and calls: + + * info.el (bookmark-make-record-default): Adjust declaration. + (Info-bookmark-make-record): Adjust call. + + * woman.el (bookmark-make-record-default): Adjust declaration. + (woman-bookmark-make-record): Adjust call. + + * man.el (bookmark-make-record-default): Adjust declaration. + (Man-bookmark-make-record): Adjust call. + + * image-mode.el (bookmark-make-record-default): Adjust declaration. + + * doc-view.el (bookmark-make-record-default): Adjust declaration. + +2010-07-13 Karl Fogel + + * bookmark.el (bookmark-show-annotation): Use `when' instead of `if'. + This is also from Thierry Volpiatto's patch in bug #6444. However, + because it was extraneous to the functional change in that patch, + and causes a re-indendation, I am committing it separately. + +2010-07-13 Thierry Volpiatto + + * bookmark.el (bookmark-show-annotation): Ensure annotations show, + e.g. in Info bookmarks, by using `switch-to-buffer-other-window'. + Patch applied by Karl Fogel (Bug#6444). + +2010-07-13 Chong Yidong + + * frame.el (make-frame): Fix typo in 2010-06-30 change (Bug#6625). + +2010-07-13 Adrian Robert + + * term/ns-win.el: Bind M-~ to 'ns-prev-frame (due to Matthew + Dempsky; bug#5084). Remove incorrect binding for S-tab. + (ns-alternatives-map): Change S-tab binding to backtab + (bug#6616). + + * simple.el (normal-erase-is-backspace-setup-frame): Set mode on + under ns. + +2010-07-12 Andreas Schwab + + * language/tai-viet.el ("TaiViet"): Try to fix re-encoding + bugs. (Bug#5806) + + * language/tv-util.el (tai-viet-re): Remove format. + +2010-07-12 Kenichi Handa + + * language/hebrew.el: Remove no-byte-compile declaration. Change + coding: tag to utf-8. Register hebrew-shape-gstring in + composition-function-table for 3-character looking back. + (hebrew-font-get-precomposed): New function. + (hebrew-shape-gstring): Utilize precomposed glyphs if available. + +2010-07-11 Chong Yidong + + * mouse.el (mouse-drag-track): Handle select-active-regions + (Bug#6612). + +2010-07-11 Magnus Henoch + + * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass + empty argument to gvfs-copy. + 2010-07-10 Glenn Morris + + * calendar/calendar.el (calendar-week-end-day): New function. + * calendar/cal-tex.el (cal-tex-cursor-month): Remove unused vars. + Respect calendar-week-start-day. (Bug#6606) + (cal-tex-insert-day-names, cal-tex-insert-blank-days) + (cal-tex-insert-blank-days-at-end): Respect calendar-week-start-day. + (cal-tex-first-blank-p, cal-tex-last-blank-p): Simplify, and + respect calendar-week-start-day. + + 2010-07-10 Chong Yidong + + * simple.el (use-region-p): Doc fix (Bug#6607). + +2010-07-10 Aleksei Gusev (tiny change) + + * progmodes/compile.el (compilation-error-regexp-alist-alist): Add + regexps for cucumber and ruby. + +2010-07-08 Daiki Ueno + + * epa-file.el (epa-file-error, epa-file--find-file-not-found-function) + (epa-file-insert-file-contents): Hack to prevent + find-file from opening empty buffer when decryptin failed + (bug#6568). + +2010-07-07 Agustín Martín + + * ispell.el (ispell-alternate-dictionary): Use file-readable-p. + Return nil if no word-list is found at default locations. + (ispell-complete-word-dict): Default to nil. + (ispell-command-loop): Use 'word-list' when using lookup-words. + (lookup-words): Use ispell-complete-word-dict or + ispell-alternate-dictionary. Check for word-list availability + and handle errors if needed with better messages (Bug#6539). + (ispell-complete-word): Use ispell-complete-word-dict or + ispell-alternate-dictionary. + 2010-07-07 Christoph Scholtes * progmodes/python.el (python-font-lock-keywords): Add Python 2.7 diff --cc lisp/vc/vc.el index 434c2a10e14,00000000000..20e56bbd42f mode 100644,000000..100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@@ -1,2706 -1,0 +1,2721 @@@ +;;; vc.el --- drive a version-control system from within Emacs + +;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, +;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. + +;; Author: FSF (see below for full credits) +;; Maintainer: Andre Spiegel +;; Keywords: vc tools + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Credits: + +;; VC was initially designed and implemented by Eric S. Raymond +;; in 1992. Over the years, many other people have +;; contributed substantial amounts of work to VC. These include: +;; +;; Per Cederqvist +;; Paul Eggert +;; Sebastian Kremer +;; Martin Lorentzson +;; Dave Love +;; Stefan Monnier +;; Thien-Thi Nguyen +;; Dan Nicolaescu +;; J.D. Smith +;; Andre Spiegel +;; Richard Stallman +;; +;; In July 2007 ESR returned and redesigned the mode to cope better +;; with modern version-control systems that do commits by fileset +;; rather than per individual file. +;; +;; If you maintain a client of the mode or customize it in your .emacs, +;; note that some backend functions which formerly took single file arguments +;; now take a list of files. These include: register, checkin, print-log, +;; rollback, and diff. + +;;; Commentary: + +;; This mode is fully documented in the Emacs user's manual. +;; +;; Supported version-control systems presently include CVS, RCS, GNU +;; Arch, Subversion, Bzr, Git, Mercurial, Monotone and SCCS +;; (or its free replacement, CSSC). +;; +;; If your site uses the ChangeLog convention supported by Emacs, the +;; function `log-edit-comment-to-change-log' could prove a useful checkin hook, +;; although you might prefer to use C-c C-a (i.e. `log-edit-insert-changelog') +;; from the commit buffer instead or to set `log-edit-setup-invert'. +;; +;; When using SCCS, RCS, CVS: be careful not to do repo surgery, or +;; operations like registrations and deletions and renames, outside VC +;; while VC is running. The support for these systems was designed +;; when disks were much slower, and the code maintains a lot of +;; internal state in order to reduce expensive operations to a +;; minimum. Thus, if you mess with the repo while VC's back is turned, +;; VC may get seriously confused. +;; +;; When using Subversion or a later system, anything you do outside VC +;; *through the VCS tools* should safely interlock with VC +;; operations. Under these VC does little state caching, because local +;; operations are assumed to be fast. The dividing line is +;; +;; ADDING SUPPORT FOR OTHER BACKENDS +;; +;; VC can use arbitrary version control systems as a backend. To add +;; support for a new backend named SYS, write a library vc-sys.el that +;; contains functions of the form `vc-sys-...' (note that SYS is in lower +;; case for the function and library names). VC will use that library if +;; you put the symbol SYS somewhere into the list of +;; `vc-handled-backends'. Then, for example, if `vc-sys-registered' +;; returns non-nil for a file, all SYS-specific versions of VC commands +;; will be available for that file. +;; +;; VC keeps some per-file information in the form of properties (see +;; vc-file-set/getprop in vc-hooks.el). The backend-specific functions +;; do not generally need to be aware of these properties. For example, +;; `vc-sys-working-revision' should compute the working revision and +;; return it; it should not look it up in the property, and it needn't +;; store it there either. However, if a backend-specific function does +;; store a value in a property, that value takes precedence over any +;; value that the generic code might want to set (check for uses of +;; the macro `with-vc-properties' in vc.el). +;; +;; In the list of functions below, each identifier needs to be prepended +;; with `vc-sys-'. Some of the functions are mandatory (marked with a +;; `*'), others are optional (`-'). +;; +;; BACKEND PROPERTIES +;; +;; * revision-granularity +;; +;; Takes no arguments. Returns either 'file or 'repository. Backends +;; that return 'file have per-file revision numbering; backends +;; that return 'repository have per-repository revision numbering, +;; so a revision level implicitly identifies a changeset +;; +;; STATE-QUERYING FUNCTIONS +;; +;; * registered (file) +;; +;; Return non-nil if FILE is registered in this backend. Both this +;; function as well as `state' should be careful to fail gracefully +;; in the event that the backend executable is absent. It is +;; preferable that this function's body is autoloaded, that way only +;; calling vc-registered does not cause the backend to be loaded +;; (all the vc-FOO-registered functions are called to try to find +;; the controlling backend for FILE. +;; +;; * state (file) +;; +;; Return the current version control state of FILE. For a list of +;; possible values, see `vc-state'. This function should do a full and +;; reliable state computation; it is usually called immediately after +;; C-x v v. If you want to use a faster heuristic when visiting a +;; file, put that into `state-heuristic' below. Note that under most +;; VCSes this won't be called at all, dir-status is used instead. +;; +;; - state-heuristic (file) +;; +;; If provided, this function is used to estimate the version control +;; state of FILE at visiting time. It should be considerably faster +;; than the implementation of `state'. For a list of possible values, +;; see the doc string of `vc-state'. +;; +;; - dir-status (dir update-function) +;; +;; Produce RESULT: a list of lists of the form (FILE VC-STATE EXTRA) +;; for the files in DIR. +;; EXTRA can be used for backend specific information about FILE. +;; If a command needs to be run to compute this list, it should be +;; run asynchronously using (current-buffer) as the buffer for the +;; command. When RESULT is computed, it should be passed back by +;; doing: (funcall UPDATE-FUNCTION RESULT nil). +;; If the backend uses a process filter, hence it produces partial results, +;; they can be passed back by doing: +;; (funcall UPDATE-FUNCTION RESULT t) +;; and then do a (funcall UPDATE-FUNCTION RESULT nil) +;; when all the results have been computed. +;; To provide more backend specific functionality for `vc-dir' +;; the following functions might be needed: `dir-extra-headers', +;; `dir-printer', `extra-dir-menu' and `dir-status-files'. +;; +;; - dir-status-files (dir files default-state update-function) +;; +;; This function is identical to dir-status except that it should +;; only report status for the specified FILES. Also it needs to +;; report on all requested files, including up-to-date or ignored +;; files. If not provided, the default is to consider that the files +;; are in DEFAULT-STATE. +;; +;; - dir-extra-headers (dir) +;; +;; Return a string that will be added to the *vc-dir* buffer header. +;; +;; - dir-printer (fileinfo) +;; +;; Pretty print the `vc-dir-fileinfo' FILEINFO. +;; If a backend needs to show more information than the default FILE +;; and STATE in the vc-dir listing, it can store that extra +;; information in `vc-dir-fileinfo->extra'. This function can be +;; used to display that extra information in the *vc-dir* buffer. +;; +;; - status-fileinfo-extra (file) +;; +;; Compute `vc-dir-fileinfo->extra' for FILE. +;; +;; * working-revision (file) +;; +;; Return the working revision of FILE. This is the revision fetched +;; by the last checkout or upate, not necessarily the same thing as the +;; head or tip revision. Should return "0" for a file added but not yet +;; committed. +;; +;; - latest-on-branch-p (file) +;; +;; Return non-nil if the working revision of FILE is the latest revision +;; on its branch (many VCSes call this the 'tip' or 'head' revision). +;; The default implementation always returns t, which means that +;; working with non-current revisions is not supported by default. +;; +;; * checkout-model (files) +;; +;; Indicate whether FILES need to be "checked out" before they can be +;; edited. See `vc-checkout-model' for a list of possible values. +;; +;; - workfile-unchanged-p (file) +;; +;; Return non-nil if FILE is unchanged from the working revision. +;; This function should do a brief comparison of FILE's contents +;; with those of the repository copy of the working revision. If +;; the backend does not have such a brief-comparison feature, the +;; default implementation of this function can be used, which +;; delegates to a full vc-BACKEND-diff. (Note that vc-BACKEND-diff +;; must not run asynchronously in this case, see variable +;; `vc-disable-async-diff'.) +;; +;; - mode-line-string (file) +;; +;; If provided, this function should return the VC-specific mode +;; line string for FILE. The returned string should have a +;; `help-echo' property which is the text to be displayed as a +;; tooltip when the mouse hovers over the VC entry on the mode-line. +;; The default implementation deals well with all states that +;; `vc-state' can return. +;; +;; STATE-CHANGING FUNCTIONS +;; +;; * create-repo (backend) +;; +;; Create an empty repository in the current directory and initialize +;; it so VC mode can add files to it. For file-oriented systems, this +;; need do no more than create a subdirectory with the right name. +;; +;; * register (files &optional rev comment) +;; +;; Register FILES in this backend. Optionally, an initial revision REV +;; and an initial description of the file, COMMENT, may be specified, +;; but it is not guaranteed that the backend will do anything with this. +;; The implementation should pass the value of vc-register-switches +;; to the backend command. (Note: in older versions of VC, this +;; command took a single file argument and not a list.) +;; +;; - init-revision (file) +;; +;; The initial revision to use when registering FILE if one is not +;; specified by the user. If not provided, the variable +;; vc-default-init-revision is used instead. +;; +;; - responsible-p (file) +;; +;; Return non-nil if this backend considers itself "responsible" for +;; FILE, which can also be a directory. This function is used to find +;; out what backend to use for registration of new files and for things +;; like change log generation. The default implementation always +;; returns nil. +;; +;; - could-register (file) +;; +;; Return non-nil if FILE could be registered under this backend. The +;; default implementation always returns t. +;; +;; - receive-file (file rev) +;; +;; Let this backend "receive" a file that is already registered under +;; another backend. The default implementation simply calls `register' +;; for FILE, but it can be overridden to do something more specific, +;; e.g. keep revision numbers consistent or choose editing modes for +;; FILE that resemble those of the other backend. +;; +;; - unregister (file) +;; +;; Unregister FILE from this backend. This is only needed if this +;; backend may be used as a "more local" backend for temporary editing. +;; +;; * checkin (files rev comment) +;; +;; Commit changes in FILES to this backend. REV is a historical artifact +;; and should be ignored. COMMENT is used as a check-in comment. +;; The implementation should pass the value of vc-checkin-switches to +;; the backend command. +;; +;; * find-revision (file rev buffer) +;; +;; Fetch revision REV of file FILE and put it into BUFFER. +;; If REV is the empty string, fetch the head of the trunk. +;; The implementation should pass the value of vc-checkout-switches +;; to the backend command. +;; +;; * checkout (file &optional editable rev) +;; +;; Check out revision REV of FILE into the working area. If EDITABLE +;; is non-nil, FILE should be writable by the user and if locking is +;; used for FILE, a lock should also be set. If REV is non-nil, that +;; is the revision to check out (default is the working revision). +;; If REV is t, that means to check out the head of the current branch; +;; if it is the empty string, check out the head of the trunk. +;; The implementation should pass the value of vc-checkout-switches +;; to the backend command. +;; +;; * revert (file &optional contents-done) +;; +;; Revert FILE back to the working revision. If optional +;; arg CONTENTS-DONE is non-nil, then the contents of FILE have +;; already been reverted from a version backup, and this function +;; only needs to update the status of FILE within the backend. +;; If FILE is in the `added' state it should be returned to the +;; `unregistered' state. +;; +;; - rollback (files) +;; +;; Remove the tip revision of each of FILES from the repository. If +;; this function is not provided, trying to cancel a revision is +;; caught as an error. (Most backends don't provide it.) (Also +;; note that older versions of this backend command were called +;; 'cancel-version' and took a single file arg, not a list of +;; files.) +;; +;; - merge (file rev1 rev2) +;; +;; Merge the changes between REV1 and REV2 into the current working file. +;; +;; - merge-news (file) +;; +;; Merge recent changes from the current branch into FILE. +;; +;; - steal-lock (file &optional revision) +;; +;; Steal any lock on the working revision of FILE, or on REVISION if +;; that is provided. This function is only needed if locking is +;; used for files under this backend, and if files can indeed be +;; locked by other users. +;; +;; - modify-change-comment (files rev comment) +;; +;; Modify the change comments associated with the files at the +;; given revision. This is optional, many backends do not support it. +;; +;; - mark-resolved (files) +;; +;; Mark conflicts as resolved. Some VC systems need to run a +;; command to mark conflicts as resolved. +;; +;; HISTORY FUNCTIONS +;; +;; * print-log (files buffer &optional shortlog start-revision limit) +;; +;; Insert the revision log for FILES into BUFFER. +;; If SHORTLOG is true insert a short version of the log. +;; If LIMIT is true insert only insert LIMIT log entries. If the +;; backend does not support limiting the number of entries to show +;; it should return `limit-unsupported'. +;; If START-REVISION is given, then show the log starting from the +;; revision. At this point START-REVISION is only required to work +;; in conjunction with LIMIT = 1. +;; +;; * log-outgoing (backend remote-location) +;; +;; Insert in BUFFER the revision log for the changes that will be +;; sent when performing a push operation to REMOTE-LOCATION. +;; +;; * log-incoming (backend remote-location) +;; +;; Insert in BUFFER the revision log for the changes that will be +;; received when performing a pull operation from REMOTE-LOCATION. +;; +;; - log-view-mode () +;; +;; Mode to use for the output of print-log. This defaults to +;; `log-view-mode' and is expected to be changed (if at all) to a derived +;; mode of `log-view-mode'. +;; +;; - show-log-entry (revision) +;; +;; If provided, search the log entry for REVISION in the current buffer, +;; and make sure it is displayed in the buffer's window. The default +;; implementation of this function works for RCS-style logs. +;; +;; - comment-history (file) +;; +;; Return a string containing all log entries that were made for FILE. +;; This is used for transferring a file from one backend to another, +;; retaining comment information. +;; +;; - update-changelog (files) +;; +;; Using recent log entries, create ChangeLog entries for FILES, or for +;; all files at or below the default-directory if FILES is nil. The +;; default implementation runs rcs2log, which handles RCS- and +;; CVS-style logs. +;; +;; * diff (files &optional rev1 rev2 buffer) +;; +;; Insert the diff for FILE into BUFFER, or the *vc-diff* buffer if +;; BUFFER is nil. If REV1 and REV2 are non-nil, report differences +;; from REV1 to REV2. If REV1 is nil, use the working revision (as +;; found in the repository) as the older revision; if REV2 is nil, +;; use the current working-copy contents as the newer revision. This +;; function should pass the value of (vc-switches BACKEND 'diff) to +;; the backend command. It should return a status of either 0 (no +;; differences found), or 1 (either non-empty diff or the diff is +;; run asynchronously). +;; +;; - revision-completion-table (files) +;; +;; Return a completion table for existing revisions of FILES. +;; The default is to not use any completion table. +;; +;; - annotate-command (file buf &optional rev) +;; +;; If this function is provided, it should produce an annotated display +;; of FILE in BUF, relative to revision REV. Annotation means each line +;; of FILE displayed is prefixed with version information associated with +;; its addition (deleted lines leave no history) and that the text of the +;; file is fontified according to age. +;; +;; - annotate-time () +;; +;; Only required if `annotate-command' is defined for the backend. +;; Return the time of the next line of annotation at or after point, +;; as a floating point fractional number of days. The helper +;; function `vc-annotate-convert-time' may be useful for converting +;; multi-part times as returned by `current-time' and `encode-time' +;; to this format. Return nil if no more lines of annotation appear +;; in the buffer. You can safely assume that point is placed at the +;; beginning of each line, starting at `point-min'. The buffer that +;; point is placed in is the Annotate output, as defined by the +;; relevant backend. This function also affects how much of the line +;; is fontified; where it leaves point is where fontification begins. +;; +;; - annotate-current-time () +;; +;; Only required if `annotate-command' is defined for the backend, +;; AND you'd like the current time considered to be anything besides +;; (vc-annotate-convert-time (current-time)) -- i.e. the current +;; time with hours, minutes, and seconds included. Probably safe to +;; ignore. Return the current-time, in units of fractional days. +;; +;; - annotate-extract-revision-at-line () +;; +;; Only required if `annotate-command' is defined for the backend. +;; Invoked from a buffer in vc-annotate-mode, return the revision +;; corresponding to the current line, or nil if there is no revision +;; corresponding to the current line. +;; If the backend supports annotating through copies and renames, +;; and displays a file name and a revision, then return a cons +;; (REVISION . FILENAME). +;; +;; TAG SYSTEM +;; +;; - create-tag (dir name branchp) +;; +;; Attach the tag NAME to the state of the working copy. This +;; should make sure that files are up-to-date before proceeding with +;; the action. DIR can also be a file and if BRANCHP is specified, +;; NAME should be created as a branch and DIR should be checked out +;; under this new branch. The default implementation does not +;; support branches but does a sanity check, a tree traversal and +;; assigns the tag to each file. +;; +;; - retrieve-tag (dir name update) +;; +;; Retrieve the version tagged by NAME of all registered files at or below DIR. +;; If UPDATE is non-nil, then update buffers of any files in the +;; tag that are currently visited. The default implementation +;; does a sanity check whether there aren't any uncommitted changes at +;; or below DIR, and then performs a tree walk, using the `checkout' +;; function to retrieve the corresponding revisions. +;; +;; MISCELLANEOUS +;; +;; - make-version-backups-p (file) +;; +;; Return non-nil if unmodified repository revisions of FILE should be +;; backed up locally. If this is done, VC can perform `diff' and +;; `revert' operations itself, without calling the backend system. The +;; default implementation always returns nil. +;; +;; - root (file) +;; Return the root of the VC controlled hierarchy for file. +;; +;; - repository-hostname (dirname) +;; +;; Return the hostname that the backend will have to contact +;; in order to operate on a file in DIRNAME. If the return value +;; is nil, it means that the repository is local. +;; This function is used in `vc-stay-local-p' which backends can use +;; for their convenience. +;; +;; - previous-revision (file rev) +;; +;; Return the revision number that precedes REV for FILE, or nil if no such +;; revision exists. +;; +;; - next-revision (file rev) +;; +;; Return the revision number that follows REV for FILE, or nil if no such +;; revision exists. +;; +;; - log-edit-mode () +;; +;; Turn on the mode used for editing the check in log. This +;; defaults to `log-edit-mode'. If changed, it should use a mode +;; derived from`log-edit-mode'. +;; +;; - check-headers () +;; +;; Return non-nil if the current buffer contains any version headers. +;; +;; - clear-headers () +;; +;; In the current buffer, reset all version headers to their unexpanded +;; form. This function should be provided if the state-querying code +;; for this backend uses the version headers to determine the state of +;; a file. This function will then be called whenever VC changes the +;; version control state in such a way that the headers would give +;; wrong information. +;; +;; - delete-file (file) +;; +;; Delete FILE and mark it as deleted in the repository. If this +;; function is not provided, the command `vc-delete-file' will +;; signal an error. +;; +;; - rename-file (old new) +;; +;; Rename file OLD to NEW, both in the working area and in the +;; repository. If this function is not provided, the renaming +;; will be done by (vc-delete-file old) and (vc-register new). +;; +;; - find-file-hook () +;; +;; Operation called in current buffer when opening a file. This can +;; be used by the backend to setup some local variables it might need. +;; +;; - extra-menu () +;; +;; Return a menu keymap, the items in the keymap will appear at the +;; end of the Version Control menu. The goal is to allow backends +;; to specify extra menu items that appear in the VC menu. This way +;; you can provide menu entries for functionality that is specific +;; to your backend and which does not map to any of the VC generic +;; concepts. +;; +;; - extra-dir-menu () +;; +;; Return a menu keymap, the items in the keymap will appear at the +;; end of the VC Status menu. The goal is to allow backends to +;; specify extra menu items that appear in the VC Status menu. This +;; makes it possible to provide menu entries for functionality that +;; is specific to a backend and which does not map to any of the VC +;; generic concepts. +;; +;; - conflicted-files (dir) +;; +;; Return the list of files where conflict resolution is needed in +;; the project that contains DIR. +;; FIXME: what should it do with non-text conflicts? + +;;; Todo: + +;; - Get rid of the "master file" terminology. + +;; - Add key-binding for vc-delete-file. + +;;;; New Primitives: +;; +;; - deal with push/pull operations. +;; +;; - add a mechanism for editing the underlying VCS's list of files +;; to be ignored, when that's possible. +;; +;;;; Primitives that need changing: +;; +;; - vc-update/vc-merge should deal with VC systems that don't +;; update/merge on a file basis, but on a whole repository basis. +;; vc-update and vc-merge assume the arguments are always files, +;; they don't deal with directories. Make sure the *vc-dir* buffer +;; is updated after these operations. +;; At least bzr, git and hg should benefit from this. +;; +;;;; Improved branch and tag handling: +;; +;; - add a generic mechanism for remembering the current branch names, +;; display the branch name in the mode-line. Replace +;; vc-cvs-sticky-tag with that. +;; +;;;; Internal cleanups: +;; +;; - backends that care about vc-stay-local should try to take it into +;; account for vc-dir. Is this likely to be useful??? YES! +;; +;; - vc-expand-dirs should take a backend parameter and only look for +;; files managed by that backend. +;; +;; - Another important thing: merge all the status-like backend operations. +;; We should remove dir-status, state, and dir-status-files, and +;; replace them with just `status' which takes a fileset and a continuation +;; (like dir-status) and returns a buffer in which the process(es) are run +;; (or nil if it worked synchronously). Hopefully we can define the old +;; 4 operations in term of this one. +;; +;;;; Other +;; +;; - when a file is in `conflict' state, turn on smerge-mode. +;; +;; - figure out what to do with conflicts that are not caused by the +;; file contents, but by metadata or other causes. Example: File A +;; gets renamed to B in one branch and to C in another and you merge +;; the two branches. Or you locally add file FOO and then pull a +;; change that also adds a new file FOO, ... +;; +;; - make it easier to write logs. Maybe C-x 4 a should add to the log +;; buffer, if one is present, instead of adding to the ChangeLog. +;; +;; - When vc-next-action calls vc-checkin it could pre-fill the +;; *VC-log* buffer with some obvious items: the list of files that +;; were added, the list of files that were removed. If the diff is +;; available, maybe it could even call something like +;; `diff-add-change-log-entries-other-window' to create a detailed +;; skeleton for the log... +;; +;; - most vc-dir backends need more work. They might need to +;; provide custom headers, use the `extra' field and deal with all +;; possible VC states. +;; +;; - add a function that calls vc-dir to `find-directory-functions'. +;; +;; - vc-diff, vc-annotate, etc. need to deal better with unregistered +;; files. Now that unregistered and ignored files are shown in +;; vc-dir, it is possible that these commands are called +;; for unregistered/ignored files. +;; +;; - vc-next-action needs work in order to work with multiple +;; backends: `vc-state' returns the state for the default backend, +;; not for the backend in the current *vc-dir* buffer. +;; +;; - vc-dir-kill-dir-status-process should not be specific to dir-status, +;; it should work for other async commands done through vc-do-command +;; as well, +;; +;; - vc-dir toolbar needs more icons. +;; +;; - The backends should avoid using `vc-file-setprop' and `vc-file-getprop'. +;; +;;; Code: + +(require 'vc-hooks) +(require 'vc-dispatcher) + +(eval-when-compile + (require 'cl) + (require 'dired)) + +(unless (assoc 'vc-parent-buffer minor-mode-alist) + (setq minor-mode-alist + (cons '(vc-parent-buffer vc-parent-buffer-name) + minor-mode-alist))) + +;; General customization + +(defgroup vc nil + "Version-control system in Emacs." + :group 'tools) + +(defcustom vc-initial-comment nil + "If non-nil, prompt for initial comment when a file is registered." + :type 'boolean + :group 'vc) + +(defcustom vc-default-init-revision "1.1" + "A string used as the default revision number when a new file is registered. +This can be overridden by giving a prefix argument to \\[vc-register]. This +can also be overridden by a particular VC backend." + :type 'string + :group 'vc + :version "20.3") + +(defcustom vc-checkin-switches nil + "A string or list of strings specifying extra switches for checkin. +These are passed to the checkin program by \\[vc-checkin]." + :type '(choice (const :tag "None" nil) + (string :tag "Argument String") + (repeat :tag "Argument List" + :value ("") + string)) + :group 'vc) + +(defcustom vc-checkout-switches nil + "A string or list of strings specifying extra switches for checkout. +These are passed to the checkout program by \\[vc-checkout]." + :type '(choice (const :tag "None" nil) + (string :tag "Argument String") + (repeat :tag "Argument List" + :value ("") + string)) + :group 'vc) + +(defcustom vc-register-switches nil + "A string or list of strings; extra switches for registering a file. +These are passed to the checkin program by \\[vc-register]." + :type '(choice (const :tag "None" nil) + (string :tag "Argument String") + (repeat :tag "Argument List" + :value ("") + string)) + :group 'vc) + +(defcustom vc-diff-switches nil + "A string or list of strings specifying switches for diff under VC. +When running diff under a given BACKEND, VC uses the first +non-nil value of `vc-BACKEND-diff-switches', `vc-diff-switches', +and `diff-switches', in that order. Since nil means to check the +next variable in the sequence, either of the first two may use +the value t to mean no switches at all. `vc-diff-switches' +should contain switches that are specific to version control, but +not specific to any particular backend." + :type '(choice (const :tag "Unspecified" nil) + (const :tag "None" t) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :group 'vc + :version "21.1") + +(defcustom vc-diff-knows-L nil + "Indicates whether diff understands the -L option. +The value is either `yes', `no', or nil. If it is nil, VC tries +to use -L and sets this variable to remember whether it worked." + :type '(choice (const :tag "Work out" nil) (const yes) (const no)) + :group 'vc) + +(defcustom vc-log-show-limit 2000 + "Limit the number of items shown by the VC log commands. +Zero means unlimited. +Not all VC backends are able to support this feature." + :type 'integer + :group 'vc) + +(defcustom vc-allow-async-revert nil + "Specifies whether the diff during \\[vc-revert] may be asynchronous. +Enabling this option means that you can confirm a revert operation even +if the local changes in the file have not been found and displayed yet." + :type '(choice (const :tag "No" nil) + (const :tag "Yes" t)) + :group 'vc + :version "22.1") + +;;;###autoload +(defcustom vc-checkout-hook nil + "Normal hook (list of functions) run after checking out a file. +See `run-hooks'." + :type 'hook + :group 'vc + :version "21.1") + +;;;###autoload +(defcustom vc-checkin-hook nil + "Normal hook (list of functions) run after commit or file checkin. +See also `log-edit-done-hook'." + :type 'hook + :options '(log-edit-comment-to-change-log) + :group 'vc) + +;;;###autoload +(defcustom vc-before-checkin-hook nil + "Normal hook (list of functions) run before a commit or a file checkin. +See `run-hooks'." + :type 'hook + :group 'vc) + +;; Header-insertion hair + +(defcustom vc-static-header-alist + '(("\\.c\\'" . + "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n#endif /* lint */\n")) + "Associate static header string templates with file types. +A \%s in the template is replaced with the first string associated with +the file's version control type in `vc-header-alist'." + :type '(repeat (cons :format "%v" + (regexp :tag "File Type") + (string :tag "Header String"))) + :group 'vc) + +(defcustom vc-comment-alist + '((nroff-mode ".\\\"" "")) + "Special comment delimiters for generating VC headers. +Add an entry in this list if you need to override the normal `comment-start' +and `comment-end' variables. This will only be necessary if the mode language +is sensitive to blank lines." + :type '(repeat (list :format "%v" + (symbol :tag "Mode") + (string :tag "Comment Start") + (string :tag "Comment End"))) + :group 'vc) + +(defcustom vc-checkout-carefully (= (user-uid) 0) + "Non-nil means be extra-careful in checkout. +Verify that the file really is not locked +and that its contents match what the repository version says." + :type 'boolean + :group 'vc) +(make-obsolete-variable 'vc-checkout-carefully + "the corresponding checks are always done now." + "21.1") + + +;; Variables users don't need to see + +(defvar vc-disable-async-diff nil + "VC sets this to t locally to disable some async diff operations. +Backends that offer asynchronous diffs should respect this variable +in their implementation of vc-BACKEND-diff.") + +;; File property caching + +(defun vc-clear-context () + "Clear all cached file properties." + (interactive) + (fillarray vc-file-prop-obarray 0)) + +(defmacro with-vc-properties (files form settings) + "Execute FORM, then maybe set per-file properties for FILES. +If any of FILES is actually a directory, then do the same for all +buffers for files in that directory. +SETTINGS is an association list of property/value pairs. After +executing FORM, set those properties from SETTINGS that have not yet +been updated to their corresponding values." + (declare (debug t)) + `(let ((vc-touched-properties (list t)) + (flist nil)) + (dolist (file ,files) + (if (file-directory-p file) + (dolist (buffer (buffer-list)) + (let ((fname (buffer-file-name buffer))) + (when (and fname (vc-string-prefix-p file fname)) + (push fname flist)))) + (push file flist))) + ,form + (dolist (file flist) + (dolist (setting ,settings) + (let ((property (car setting))) + (unless (memq property vc-touched-properties) + (put (intern file vc-file-prop-obarray) + property (cdr setting)))))))) + +;;; Code for deducing what fileset and backend to assume + +(defun vc-backend-for-registration (file) + "Return a backend that can be used for registering FILE. + +If no backend declares itself responsible for FILE, then FILE +must not be in a version controlled directory, so try to create a +repository, prompting for the directory and the VC backend to +use." + (catch 'found + ;; First try: find a responsible backend, it must be a backend + ;; under which FILE is not yet registered. + (dolist (backend vc-handled-backends) + (and (not (vc-call-backend backend 'registered file)) + (vc-call-backend backend 'responsible-p file) + (throw 'found backend))) + ;; no responsible backend + (let* ((possible-backends + (let (pos) + (dolist (crt vc-handled-backends) + (when (vc-find-backend-function crt 'create-repo) + (push crt pos))) + pos)) + (bk + (intern + ;; Read the VC backend from the user, only + ;; complete with the backends that have the + ;; 'create-repo method. + (completing-read + (format "%s is not in a version controlled directory.\nUse VC backend: " file) + (mapcar 'symbol-name possible-backends) nil t))) + (repo-dir + (let ((def-dir (file-name-directory file))) + ;; read the directory where to create the + ;; repository, make sure it's a parent of + ;; file. + (read-file-name + (format "create %s repository in: " bk) + default-directory def-dir t nil + (lambda (arg) + (message "arg %s" arg) + (and (file-directory-p arg) + (vc-string-prefix-p (expand-file-name arg) def-dir))))))) + (let ((default-directory repo-dir)) + (vc-call-backend bk 'create-repo)) + (throw 'found bk)))) + +(defun vc-responsible-backend (file) + "Return the name of a backend system that is responsible for FILE. + +If FILE is already registered, return the +backend of FILE. If FILE is not registered, then the +first backend in `vc-handled-backends' that declares itself +responsible for FILE is returned." + (or (and (not (file-directory-p file)) (vc-backend file)) + (catch 'found + ;; First try: find a responsible backend. If this is for registration, + ;; it must be a backend under which FILE is not yet registered. + (dolist (backend vc-handled-backends) + (and (vc-call-backend backend 'responsible-p file) + (throw 'found backend)))) + (error "No VC backend is responsible for %s" file))) + +(defun vc-expand-dirs (file-or-dir-list) + "Expands directories in a file list specification. +Within directories, only files already under version control are noticed." + (let ((flattened '())) + (dolist (node file-or-dir-list) + (when (file-directory-p node) + (vc-file-tree-walk + node (lambda (f) (when (vc-backend f) (push f flattened))))) + (unless (file-directory-p node) (push node flattened))) + (nreverse flattened))) + +(defvar vc-dir-backend) +(defvar log-view-vc-backend) +(defvar diff-vc-backend) + +(defun vc-deduce-backend () + (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) + ((derived-mode-p 'log-view-mode) log-view-vc-backend) + ((derived-mode-p 'diff-mode) diff-vc-backend) + ((derived-mode-p 'dired-mode) + (vc-responsible-backend default-directory)) + (vc-mode (vc-backend buffer-file-name)))) + +(declare-function vc-dir-current-file "vc-dir" ()) +(declare-function vc-dir-deduce-fileset "vc-dir" (&optional state-model-only-files)) + +(defun vc-deduce-fileset (&optional observer allow-unregistered + state-model-only-files) + "Deduce a set of files and a backend to which to apply an operation. + +Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL). +If we're in VC-dir mode, the fileset is the list of marked files. +Otherwise, if we're looking at a buffer visiting a version-controlled file, +the fileset is a singleton containing this file. +If none of these conditions is met, but ALLOW_UNREGISTERED is on and the +visited file is not registered, return a singleton fileset containing it. +Otherwise, throw an error. + +STATE-MODEL-ONLY-FILES if non-nil, means that the caller needs +the FILESET-ONLY-FILES STATE and MODEL info. Otherwise, that +part may be skipped. +BEWARE: this function may change the +current buffer." + ;; FIXME: OBSERVER is unused. The name is not intuitive and is not + ;; documented. It's set to t when called from diff and print-log. + (let (backend) + (cond + ((derived-mode-p 'vc-dir-mode) + (vc-dir-deduce-fileset state-model-only-files)) + ((derived-mode-p 'dired-mode) + (if observer + (vc-dired-deduce-fileset) + (error "State changing VC operations not supported in `dired-mode'"))) + ((setq backend (vc-backend buffer-file-name)) + (if state-model-only-files + (list backend (list buffer-file-name) + (list buffer-file-name) + (vc-state buffer-file-name) + (vc-checkout-model backend buffer-file-name)) + (list backend (list buffer-file-name)))) + ((and (buffer-live-p vc-parent-buffer) + ;; FIXME: Why this test? --Stef + (or (buffer-file-name vc-parent-buffer) + (with-current-buffer vc-parent-buffer + (derived-mode-p 'vc-dir-mode)))) + (progn ;FIXME: Why not `with-current-buffer'? --Stef. + (set-buffer vc-parent-buffer) + (vc-deduce-fileset observer allow-unregistered state-model-only-files))) + ((not buffer-file-name) + (error "Buffer %s is not associated with a file" (buffer-name))) + ((and allow-unregistered (not (vc-registered buffer-file-name))) + (if state-model-only-files + (list (vc-backend-for-registration (buffer-file-name)) + (list buffer-file-name) + (list buffer-file-name) + (when state-model-only-files 'unregistered) + nil) + (list (vc-backend-for-registration (buffer-file-name)) + (list buffer-file-name)))) + (t (error "No fileset is available here"))))) + +(defun vc-dired-deduce-fileset () + (let ((backend (vc-responsible-backend default-directory))) + (unless backend (error "Directory not under VC")) + (list backend + (dired-map-over-marks (dired-get-filename nil t) nil)))) + +(defun vc-ensure-vc-buffer () + "Make sure that the current buffer visits a version-controlled file." + (cond + ((derived-mode-p 'vc-dir-mode) + (set-buffer (find-file-noselect (vc-dir-current-file)))) + (t + (while (and vc-parent-buffer + (buffer-live-p vc-parent-buffer) + ;; Avoid infinite looping when vc-parent-buffer and + ;; current buffer are the same buffer. + (not (eq vc-parent-buffer (current-buffer)))) + (set-buffer vc-parent-buffer)) + (if (not buffer-file-name) + (error "Buffer %s is not associated with a file" (buffer-name)) + (unless (vc-backend buffer-file-name) + (error "File %s is not under version control" buffer-file-name)))))) + +;;; Support for the C-x v v command. +;; This is where all the single-file-oriented code from before the fileset +;; rewrite lives. + +(defsubst vc-editable-p (file) + "Return non-nil if FILE can be edited." + (let ((backend (vc-backend file))) + (and backend + (or (eq (vc-checkout-model backend (list file)) 'implicit) + (memq (vc-state file) '(edited needs-merge conflict)))))) + +(defun vc-compatible-state (p q) + "Controls which states can be in the same commit." + (or + (eq p q) + (and (member p '(edited added removed)) (member q '(edited added removed))))) + +;; Here's the major entry point. + +;;;###autoload +(defun vc-next-action (verbose) + "Do the next logical version control operation on the current fileset. +This requires that all files in the fileset be in the same state. + +For locking systems: + If every file is not already registered, this registers each for version +control. + If every file is registered and not locked by anyone, this checks out +a writable and locked file of each ready for editing. + If every file is checked out and locked by the calling user, this +first checks to see if each file has changed since checkout. If not, +it performs a revert on that file. + If every file has been changed, this pops up a buffer for entry +of a log message; when the message has been entered, it checks in the +resulting changes along with the log message as change commentary. If +the variable `vc-keep-workfiles' is non-nil (which is its default), a +read-only copy of each changed file is left in place afterwards. + If the affected file is registered and locked by someone else, you are +given the option to steal the lock(s). + +For merging systems: + If every file is not already registered, this registers each one for version +control. This does an add, but not a commit. + If every file is added but not committed, each one is committed. + If every working file is changed, but the corresponding repository file is +unchanged, this pops up a buffer for entry of a log message; when the +message has been entered, it checks in the resulting changes along +with the logmessage as change commentary. A writable file is retained. + If the repository file is changed, you are asked if you want to +merge in the changes into your working copy." + (interactive "P") + (let* ((vc-fileset (vc-deduce-fileset nil t 'state-model-only-files)) + (backend (car vc-fileset)) + (files (nth 1 vc-fileset)) + (fileset-only-files (nth 2 vc-fileset)) + ;; FIXME: We used to call `vc-recompute-state' here. + (state (nth 3 vc-fileset)) + ;; The backend should check that the checkout-model is consistent + ;; among all the `files'. + (model (nth 4 vc-fileset))) + + ;; Do the right thing + (cond + ((eq state 'missing) + (error "Fileset files are missing, so cannot be operated on")) + ((eq state 'ignored) + (error "Fileset files are ignored by the version-control system")) + ((or (null state) (eq state 'unregistered)) + (vc-register nil vc-fileset)) + ;; Files are up-to-date, or need a merge and user specified a revision + ((or (eq state 'up-to-date) (and verbose (eq state 'needs-update))) + (cond + (verbose + ;; go to a different revision + (let* ((revision + (read-string "Branch, revision, or backend to move to: ")) + (revision-downcase (downcase revision))) + (if (member + revision-downcase + (mapcar (lambda (arg) (downcase (symbol-name arg))) + vc-handled-backends)) + (let ((vsym (intern-soft revision-downcase))) + (dolist (file files) (vc-transfer-file file vsym))) + (dolist (file files) + (vc-checkout file (eq model 'implicit) revision))))) + ((not (eq model 'implicit)) + ;; check the files out + (dolist (file files) (vc-checkout file t))) + (t + ;; do nothing + (message "Fileset is up-to-date")))) + ;; Files have local changes + ((vc-compatible-state state 'edited) + (let ((ready-for-commit files)) + ;; If files are edited but read-only, give user a chance to correct + (dolist (file files) + (unless (file-writable-p file) + ;; Make the file+buffer read-write. + (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue?" file)) + (error "Aborted")) + (set-file-modes file (logior (file-modes file) 128)) + (let ((visited (get-file-buffer file))) + (when visited + (with-current-buffer visited + (toggle-read-only -1)))))) + ;; Allow user to revert files with no changes + (save-excursion + (dolist (file files) + (let ((visited (get-file-buffer file))) + ;; For files with locking, if the file does not contain + ;; any changes, just let go of the lock, i.e. revert. + (when (and (not (eq model 'implicit)) + (vc-workfile-unchanged-p file) + ;; If buffer is modified, that means the user just + ;; said no to saving it; in that case, don't revert, + ;; because the user might intend to save after + ;; finishing the log entry and committing. + (not (and visited (buffer-modified-p)))) + (vc-revert-file file) + (setq ready-for-commit (delete file ready-for-commit)))))) + ;; Remaining files need to be committed + (if (not ready-for-commit) + (message "No files remain to be committed") + (if (not verbose) + (vc-checkin ready-for-commit backend) + (let* ((revision (read-string "New revision or backend: ")) + (revision-downcase (downcase revision))) + (if (member + revision-downcase + (mapcar (lambda (arg) (downcase (symbol-name arg))) + vc-handled-backends)) + (let ((vsym (intern revision-downcase))) + (dolist (file files) (vc-transfer-file file vsym))) + (vc-checkin ready-for-commit backend revision))))))) + ;; locked by somebody else (locking VCSes only) + ((stringp state) + ;; In the old days, we computed the revision once and used it on + ;; the single file. Then, for the 2007-2008 fileset rewrite, we + ;; computed the revision once (incorrectly, using a free var) and + ;; used it on all files. To fix the free var bug, we can either + ;; use `(car files)' or do what we do here: distribute the + ;; revision computation among `files'. Although this may be + ;; tedious for those backends where a "revision" is a trans-file + ;; concept, it is nonetheless correct for both those and (more + ;; importantly) for those where "revision" is a per-file concept. + ;; If the intersection of the former group and "locking VCSes" is + ;; non-empty [I vaguely doubt it --ttn], we can reinstate the + ;; pre-computation approach of yore. + (dolist (file files) + (vc-steal-lock + file (if verbose + (read-string (format "%s revision to steal: " file)) + (vc-working-revision file)) + state))) + ;; conflict + ((eq state 'conflict) + ;; FIXME: Is it really the UI we want to provide? + ;; In my experience, the conflicted files should be marked as resolved + ;; one-by-one when saving the file after resolving the conflicts. + ;; I.e. stating explicitly that the conflicts are resolved is done + ;; very rarely. + (vc-mark-resolved backend files)) + ;; needs-update + ((eq state 'needs-update) + (dolist (file files) + (if (yes-or-no-p (format + "%s is not up-to-date. Get latest revision? " + (file-name-nondirectory file))) + (vc-checkout file (eq model 'implicit) t) + (when (and (not (eq model 'implicit)) + (yes-or-no-p "Lock this revision? ")) + (vc-checkout file t))))) + ;; needs-merge + ((eq state 'needs-merge) + (dolist (file files) + (when (yes-or-no-p (format + "%s is not up-to-date. Merge in changes now? " + (file-name-nondirectory file))) + (vc-maybe-resolve-conflicts + file (vc-call-backend backend 'merge-news file))))) + + ;; unlocked-changes + ((eq state 'unlocked-changes) + (dolist (file files) + (when (not (equal buffer-file-name file)) + (find-file-other-window file)) + (if (save-window-excursion + (vc-diff-internal nil + (cons (car vc-fileset) (cons (cadr vc-fileset) (list file))) + (vc-working-revision file) nil) + (goto-char (point-min)) + (let ((inhibit-read-only t)) + (insert + (format "Changes to %s since last lock:\n\n" file))) + (not (beep)) + (yes-or-no-p (concat "File has unlocked changes. " + "Claim lock retaining changes? "))) + (progn (vc-call-backend backend 'steal-lock file) + (clear-visited-file-modtime) + ;; Must clear any headers here because they wouldn't + ;; show that the file is locked now. + (vc-clear-headers file) + (write-file buffer-file-name) + (vc-mode-line file backend)) + (if (not (yes-or-no-p + "Revert to checked-in revision, instead? ")) + (error "Checkout aborted") + (vc-revert-buffer-internal t t) + (vc-checkout file t))))) + ;; Unknown fileset state + (t + (error "Fileset is in an unknown state %s" state))))) + +(defun vc-create-repo (backend) + "Create an empty repository in the current directory." + (interactive + (list + (intern + (upcase + (completing-read + "Create repository for: " + (mapcar (lambda (b) (list (downcase (symbol-name b)))) vc-handled-backends) + nil t))))) + (vc-call-backend backend 'create-repo)) + +(declare-function vc-dir-move-to-goal-column "vc-dir" ()) + +;;;###autoload +(defun vc-register (&optional set-revision vc-fileset comment) + "Register into a version control system. +If VC-FILESET is given, register the files in that fileset. +Otherwise register the current file. +With prefix argument SET-REVISION, allow user to specify initial revision +level. If COMMENT is present, use that as an initial comment. + +The version control system to use is found by cycling through the list +`vc-handled-backends'. The first backend in that list which declares +itself responsible for the file (usually because other files in that +directory are already registered under that backend) will be used to +register the file. If no backend declares itself responsible, the +first backend that could register the file is used." + (interactive "P") + (let* ((fileset-arg (or vc-fileset (vc-deduce-fileset nil t))) + (backend (car fileset-arg)) + (files (nth 1 fileset-arg))) + ;; We used to operate on `only-files', but VC wants to provide the + ;; possibility to register directories rather than files only, since + ;; many VCS allow that as well. + (dolist (fname files) + (let ((bname (get-file-buffer fname))) + (unless fname (setq fname buffer-file-name)) + (when (vc-backend fname) + (if (vc-registered fname) + (error "This file is already registered") + (unless (y-or-n-p "Previous master file has vanished. Make a new one? ") + (error "Aborted")))) + ;; Watch out for new buffers of size 0: the corresponding file + ;; does not exist yet, even though buffer-modified-p is nil. + (when bname + (with-current-buffer bname + (when (and (not (buffer-modified-p)) + (zerop (buffer-size)) + (not (file-exists-p buffer-file-name))) + (set-buffer-modified-p t)) + (vc-buffer-sync))))) + (message "Registering %s... " files) + (mapc 'vc-file-clearprops files) + (vc-call-backend backend 'register files + (if set-revision + (read-string (format "Initial revision level for %s: " files)) + (vc-call-backend backend 'init-revision)) + comment) + (mapc + (lambda (file) + (vc-file-setprop file 'vc-backend backend) + ;; FIXME: This is wrong: it should set `backup-inhibited' in all + ;; the buffers visiting files affected by this `vc-register', not + ;; in the current-buffer. + ;; (unless vc-make-backup-files + ;; (make-local-variable 'backup-inhibited) + ;; (setq backup-inhibited t)) + + (vc-resynch-buffer file vc-keep-workfiles t)) + files) + (when (derived-mode-p 'vc-dir-mode) + (vc-dir-move-to-goal-column)) + (message "Registering %s... done" files))) + +(defun vc-register-with (backend) + "Register the current file with a specified back end." + (interactive "SBackend: ") + (when (not (member backend vc-handled-backends)) + (error "Unknown back end")) + (let ((vc-handled-backends (list backend))) + (call-interactively 'vc-register))) + +(defun vc-checkout (file &optional writable rev) + "Retrieve a copy of the revision REV of FILE. +If WRITABLE is non-nil, make sure the retrieved file is writable. +REV defaults to the latest revision. + +After check-out, runs the normal hook `vc-checkout-hook'." + (and writable + (not rev) + (vc-call make-version-backups-p file) + (vc-up-to-date-p file) + (vc-make-version-backup file)) + (let ((backend (vc-backend file))) + (with-vc-properties (list file) + (condition-case err + (vc-call-backend backend 'checkout file writable rev) + (file-error + ;; Maybe the backend is not installed ;-( + (when writable + (let ((buf (get-file-buffer file))) + (when buf (with-current-buffer buf (toggle-read-only -1))))) + (signal (car err) (cdr err)))) + `((vc-state . ,(if (or (eq (vc-checkout-model backend (list file)) 'implicit) + (not writable)) + (if (vc-call-backend backend 'latest-on-branch-p file) + 'up-to-date + 'needs-update) + 'edited)) + (vc-checkout-time . ,(nth 5 (file-attributes file)))))) + (vc-resynch-buffer file t t) + (run-hooks 'vc-checkout-hook)) + +(defun vc-mark-resolved (backend files) + (prog1 (with-vc-properties + files + (vc-call-backend backend 'mark-resolved files) + ;; FIXME: Is this TRTD? Might not be. + `((vc-state . edited))) + (message + (substitute-command-keys + "Conflicts have been resolved in %s. \ +Type \\[vc-next-action] to check in changes.") + (if (> (length files) 1) + (format "%d files" (length files)) + "this file")))) + +(defun vc-steal-lock (file rev owner) + "Steal the lock on FILE." + (let (file-description) + (if rev + (setq file-description (format "%s:%s" file rev)) + (setq file-description file)) + (when (not (yes-or-no-p (format "Steal the lock on %s from %s? " + file-description owner))) + (error "Steal canceled")) + (message "Stealing lock on %s..." file) + (with-vc-properties + (list file) + (vc-call steal-lock file rev) + `((vc-state . edited))) + (vc-resynch-buffer file t t) + (message "Stealing lock on %s...done" file) + ;; Write mail after actually stealing, because if the stealing + ;; goes wrong, we don't want to send any mail. + (compose-mail owner (format "Stolen lock on %s" file-description)) + (setq default-directory (expand-file-name "~/")) + (goto-char (point-max)) + (insert + (format "I stole the lock on %s, " file-description) + (current-time-string) + ".\n") + (message "Please explain why you stole the lock. Type C-c C-c when done."))) + +(defun vc-checkin (files backend &optional rev comment initial-contents) + "Check in FILES. +The optional argument REV may be a string specifying the new revision +level (strongly deprecated). COMMENT is a comment +string; if omitted, a buffer is popped up to accept a comment. If +INITIAL-CONTENTS is non-nil, then COMMENT is used as the initial contents +of the log entry buffer. + +If `vc-keep-workfiles' is nil, FILE is deleted afterwards, provided +that the version control system supports this mode of operation. + +Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'." + (when vc-before-checkin-hook + (run-hooks 'vc-before-checkin-hook)) + (lexical-let + ((backend backend)) + (vc-start-logentry + files comment initial-contents + "Enter a change comment." + "*VC-log*" + (lambda () + (vc-call-backend backend 'log-edit-mode)) + (lexical-let ((rev rev)) + (lambda (files comment) + (message "Checking in %s..." (vc-delistify files)) + ;; "This log message intentionally left almost blank". + ;; RCS 5.7 gripes about white-space-only comments too. + (or (and comment (string-match "[^\t\n ]" comment)) + (setq comment "*** empty log message ***")) + (with-vc-properties + files + ;; We used to change buffers to get local value of + ;; vc-checkin-switches, but 'the' local buffer is + ;; not a well-defined concept for filesets. + (progn + (vc-call-backend backend 'checkin files rev comment) + (mapc 'vc-delete-automatic-version-backups files)) + `((vc-state . up-to-date) + (vc-checkout-time . ,(nth 5 (file-attributes file))) + (vc-working-revision . nil))) + (message "Checking in %s...done" (vc-delistify files)))) + 'vc-checkin-hook))) + +;;; Additional entry points for examining version histories + +;; (defun vc-default-diff-tree (backend dir rev1 rev2) +;; "List differences for all registered files at and below DIR. +;; The meaning of REV1 and REV2 is the same as for `vc-revision-diff'." +;; ;; This implementation does an explicit tree walk, and calls +;; ;; vc-BACKEND-diff directly for each file. An optimization +;; ;; would be to use `vc-diff-internal', so that diffs can be local, +;; ;; and to call it only for files that are actually changed. +;; ;; However, this is expensive for some backends, and so it is left +;; ;; to backend-specific implementations. +;; (setq default-directory dir) +;; (vc-file-tree-walk +;; default-directory +;; (lambda (f) +;; (vc-exec-after +;; `(let ((coding-system-for-read (vc-coding-system-for-diff ',f))) +;; (message "Looking at %s" ',f) +;; (vc-call-backend ',(vc-backend f) +;; 'diff (list ',f) ',rev1 ',rev2)))))) + ++(defvar vc-coding-system-inherit-eol t ++ "When non-nil, inherit the EOL format for reading Diff output from the file. ++ ++Used in `vc-coding-system-for-diff' to determine the EOL format to use ++for reading Diff output for a file. If non-nil, the EOL format is ++inherited from the file itself. ++Set this variable to nil if your Diff tool might use a different ++EOL. Then Emacs will auto-detect the EOL format in Diff output, which ++gives better results.") ;; Cf. bug#4451. ++ +(defun vc-coding-system-for-diff (file) + "Return the coding system for reading diff output for FILE." + (or coding-system-for-read + ;; if we already have this file open, + ;; use the buffer's coding system + (let ((buf (find-buffer-visiting file))) + (when buf (with-current-buffer buf - buffer-file-coding-system))) ++ (if vc-coding-system-inherit-eol ++ buffer-file-coding-system ++ ;; Don't inherit the EOL part of the coding-system, ++ ;; because some Diff tools may choose to use ++ ;; a different one. bug#4451. ++ (coding-system-base buffer-file-coding-system))))) + ;; otherwise, try to find one based on the file name + (car (find-operation-coding-system 'insert-file-contents file)) + ;; and a final fallback + 'undecided)) + +(defun vc-switches (backend op) + "Return a list of vc-BACKEND switches for operation OP. +BACKEND is a symbol such as `CVS', which will be downcased. +OP is a symbol such as `diff'. + +In decreasing order of preference, return the value of: +vc-BACKEND-OP-switches (e.g. `vc-cvs-diff-switches'); +vc-OP-switches (e.g. `vc-diff-switches'); or, in the case of +diff only, `diff-switches'. + +If the chosen value is not a string or a list, return nil. +This is so that you may set, e.g. `vc-svn-diff-switches' to t in order +to override the value of `vc-diff-switches' and `diff-switches'." + (let ((switches + (or (when backend + (let ((sym (vc-make-backend-sym + backend (intern (concat (symbol-name op) + "-switches"))))) + (when (boundp sym) (symbol-value sym)))) + (let ((sym (intern (format "vc-%s-switches" (symbol-name op))))) + (when (boundp sym) (symbol-value sym))) + (cond + ((eq op 'diff) diff-switches))))) + (if (stringp switches) (list switches) + ;; If not a list, return nil. + ;; This is so we can set vc-diff-switches to t to override + ;; any switches in diff-switches. + (when (listp switches) switches)))) + +;; Old def for compatibility with Emacs-21.[123]. +(defmacro vc-diff-switches-list (backend) `(vc-switches ',backend 'diff)) +(make-obsolete 'vc-diff-switches-list 'vc-switches "22.1") + +(defun vc-diff-finish (buffer messages) + ;; The empty sync output case has already been handled, so the only + ;; possibility of an empty output is for an async process. + (when (buffer-live-p buffer) + (let ((window (get-buffer-window buffer t)) + (emptyp (zerop (buffer-size buffer)))) + (with-current-buffer buffer + (and messages emptyp + (let ((inhibit-read-only t)) + (insert (cdr messages) ".\n") + (message "%s" (cdr messages)))) + (goto-char (point-min)) + (when window + (shrink-window-if-larger-than-buffer window))) + (when (and messages (not emptyp)) + (message "%sdone" (car messages)))))) + +(defvar vc-diff-added-files nil + "If non-nil, diff added files by comparing them to /dev/null.") + +(defun vc-diff-internal (async vc-fileset rev1 rev2 &optional verbose) + "Report diffs between two revisions of a fileset. +Diff output goes to the *vc-diff* buffer. The function +returns t if the buffer had changes, nil otherwise." + (let* ((files (cadr vc-fileset)) + (messages (cons (format "Finding changes in %s..." + (vc-delistify files)) + (format "No changes between %s and %s" + (or rev1 "working revision") + (or rev2 "workfile")))) + ;; Set coding system based on the first file. It's a kluge, + ;; but the only way to set it for each file included would + ;; be to call the back end separately for each file. + (coding-system-for-read + (if files (vc-coding-system-for-diff (car files)) 'undecided))) + (vc-setup-buffer "*vc-diff*") + (message "%s" (car messages)) + ;; Many backends don't handle well the case of a file that has been + ;; added but not yet committed to the repo (notably CVS and Subversion). + ;; Do that work here so the backends don't have to futz with it. --ESR + ;; + ;; Actually most backends (including CVS) have options to control the + ;; behavior since which one is better depends on the user and on the + ;; situation). Worse yet: this code does not handle the case where + ;; `file' is a directory which contains added files. + ;; I made it conditional on vc-diff-added-files but it should probably + ;; just be removed (or copied/moved to specific backends). --Stef. + (when vc-diff-added-files + (let ((filtered '()) + process-file-side-effects) + (dolist (file files) + (if (or (file-directory-p file) + (not (string= (vc-working-revision file) "0"))) + (push file filtered) + ;; This file is added but not yet committed; + ;; there is no repository version to diff against. + (if (or rev1 rev2) + (error "No revisions of %s exist" file) + ;; We regard this as "changed". + ;; Diff it against /dev/null. + (apply 'vc-do-command "*vc-diff*" + 1 "diff" file + (append (vc-switches nil 'diff) '("/dev/null")))))) + (setq files (nreverse filtered)))) + (let ((vc-disable-async-diff (not async))) + (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 "*vc-diff*")) + (set-buffer "*vc-diff*") + (if (and (zerop (buffer-size)) + (not (get-buffer-process (current-buffer)))) + ;; Treat this case specially so as not to pop the buffer. + (progn + (message "%s" (cdr messages)) + nil) + (diff-mode) + (set (make-local-variable 'diff-vc-backend) (car vc-fileset)) + (set (make-local-variable 'revert-buffer-function) + `(lambda (ignore-auto noconfirm) + (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose))) + ;; Make the *vc-diff* buffer read only, the diff-mode key + ;; bindings are nicer for read only buffers. pcl-cvs does the + ;; same thing. + (setq buffer-read-only t) + (vc-exec-after `(vc-diff-finish ,(current-buffer) ',(when verbose + messages))) + ;; Display the buffer, but at the end because it can change point. + (pop-to-buffer (current-buffer)) + ;; In the async case, we return t even if there are no differences + ;; because we don't know that yet. + t))) + +(defun vc-read-revision (prompt &optional files backend default initial-input) + (cond + ((null files) + (let ((vc-fileset (vc-deduce-fileset t))) ;FIXME: why t? --Stef + (setq files (cadr vc-fileset)) + (setq backend (car vc-fileset)))) + ((null backend) (setq backend (vc-backend (car files))))) + (let ((completion-table + (vc-call-backend backend 'revision-completion-table files))) + (if completion-table + (completing-read prompt completion-table + nil nil initial-input nil default) + (read-string prompt initial-input nil default)))) + +;;;###autoload +(defun vc-version-diff (files rev1 rev2) + "Report diffs between revisions of the fileset in the repository history." + (interactive + (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: why t? --Stef + (files (cadr vc-fileset)) + (backend (car vc-fileset)) + (first (car files)) + (rev1-default nil) + (rev2-default nil)) + (cond + ;; someday we may be able to do revision completion on non-singleton + ;; filesets, but not yet. + ((/= (length files) 1) + nil) + ;; if it's a directory, don't supply any revision default + ((file-directory-p first) + nil) + ;; if the file is not up-to-date, use working revision as older revision + ((not (vc-up-to-date-p first)) + (setq rev1-default (vc-working-revision first))) + ;; if the file is not locked, use last and previous revisions as defaults + (t + (setq rev1-default (vc-call-backend backend 'previous-revision first + (vc-working-revision first))) + (when (string= rev1-default "") (setq rev1-default nil)) + (setq rev2-default (vc-working-revision first)))) + ;; construct argument list + (let* ((rev1-prompt (if rev1-default + (concat "Older revision (default " + rev1-default "): ") + "Older revision: ")) + (rev2-prompt (concat "Newer revision (default " + (or rev2-default "current source") "): ")) + (rev1 (vc-read-revision rev1-prompt files backend rev1-default)) + (rev2 (vc-read-revision rev2-prompt files backend rev2-default))) + (when (string= rev1 "") (setq rev1 nil)) + (when (string= rev2 "") (setq rev2 nil)) + (list files rev1 rev2)))) + ;; All that was just so we could do argument completion! + (when (and (not rev1) rev2) + (error "Not a valid revision range")) + ;; Yes, it's painful to call (vc-deduce-fileset) again. Alas, the + ;; placement rules for (interactive) don't actually leave us a choice. + (vc-diff-internal t (vc-deduce-fileset t) rev1 rev2 + (called-interactively-p 'interactive))) + +;;;###autoload +(defun vc-diff (historic &optional not-urgent) + "Display diffs between file revisions. +Normally this compares the currently selected fileset with their +working revisions. With a prefix argument HISTORIC, it reads two revision +designators specifying which revisions to compare. + +The optional argument NOT-URGENT non-nil means it is ok to say no to +saving the buffer." + (interactive (list current-prefix-arg t)) + (if historic + (call-interactively 'vc-version-diff) + (when buffer-file-name (vc-buffer-sync not-urgent)) + (vc-diff-internal t (vc-deduce-fileset t) nil nil + (called-interactively-p 'interactive)))) + +;;;###autoload +(defun vc-root-diff (historic &optional not-urgent) + "Display diffs between VC-controlled whole tree revisions. +Normally, this compares the tree corresponding to the current +fileset with the working revision. +With a prefix argument HISTORIC, prompt for two revision +designators specifying which revisions to compare. + +The optional argument NOT-URGENT non-nil means it is ok to say no to +saving the buffer." + (interactive (list current-prefix-arg t)) + (if historic + ;; FIXME: this does not work right, `vc-version-diff' ends up + ;; calling `vc-deduce-fileset' to find the files to diff, and + ;; that's not what we want here, we want the diff for the VC root dir. + (call-interactively 'vc-version-diff) + (when buffer-file-name (vc-buffer-sync not-urgent)) + (let ((backend (vc-deduce-backend)) + rootdir working-revision) + (unless backend + (error "Buffer is not version controlled")) + (setq rootdir (vc-call-backend backend 'root default-directory)) + (setq working-revision (vc-working-revision rootdir)) + ;; VC diff for the root directory produces output that is + ;; relative to it. Bind default-directory to the root directory + ;; here, this way the *vc-diff* buffer is setup correctly, so + ;; relative file names work. + (let ((default-directory rootdir)) + (vc-diff-internal + t (list backend (list rootdir) working-revision) nil nil + (called-interactively-p 'interactive)))))) + +;;;###autoload +(defun vc-revision-other-window (rev) + "Visit revision REV of the current file in another window. +If the current file is named `F', the revision is named `F.~REV~'. +If `F.~REV~' already exists, use it instead of checking it out again." + (interactive + (save-current-buffer + (vc-ensure-vc-buffer) + (list + (vc-read-revision "Revision to visit (default is working revision): " + (list buffer-file-name))))) + (vc-ensure-vc-buffer) + (let* ((file buffer-file-name) + (revision (if (string-equal rev "") + (vc-working-revision file) + rev))) + (switch-to-buffer-other-window (vc-find-revision file revision)))) + +(defun vc-find-revision (file revision &optional backend) + "Read REVISION of FILE into a buffer and return the buffer. +Use BACKEND as the VC backend if specified." + (let ((automatic-backup (vc-version-backup-file-name file revision)) + (filebuf (or (get-file-buffer file) (current-buffer))) + (filename (vc-version-backup-file-name file revision 'manual))) + (unless (file-exists-p filename) + (if (file-exists-p automatic-backup) + (rename-file automatic-backup filename nil) + (message "Checking out %s..." filename) + (with-current-buffer filebuf + (let ((failed t)) + (unwind-protect + (let ((coding-system-for-read 'no-conversion) + (coding-system-for-write 'no-conversion)) + (with-temp-file filename + (let ((outbuf (current-buffer))) + ;; Change buffer to get local value of + ;; vc-checkout-switches. + (with-current-buffer filebuf + (if backend + (vc-call-backend backend 'find-revision file revision outbuf) + (vc-call find-revision file revision outbuf))))) + (setq failed nil)) + (when (and failed (file-exists-p filename)) + (delete-file filename)))) + (vc-mode-line file)) + (message "Checking out %s...done" filename))) + (let ((result-buf (find-file-noselect filename))) + (with-current-buffer result-buf + ;; Set the parent buffer so that things like + ;; C-x v g, C-x v l, ... etc work. + (set (make-local-variable 'vc-parent-buffer) filebuf)) + result-buf))) + +;; Header-insertion code + +;;;###autoload +(defun vc-insert-headers () + "Insert headers into a file for use with a version control system. +Headers desired are inserted at point, and are pulled from +the variable `vc-BACKEND-header'." + (interactive) + (vc-ensure-vc-buffer) + (save-excursion + (save-restriction + (widen) + (when (or (not (vc-check-headers)) + (y-or-n-p "Version headers already exist. Insert another set? ")) + (let* ((delims (cdr (assq major-mode vc-comment-alist))) + (comment-start-vc (or (car delims) comment-start "#")) + (comment-end-vc (or (car (cdr delims)) comment-end "")) + (hdsym (vc-make-backend-sym (vc-backend buffer-file-name) + 'header)) + (hdstrings (and (boundp hdsym) (symbol-value hdsym)))) + (dolist (s hdstrings) + (insert comment-start-vc "\t" s "\t" + comment-end-vc "\n")) + (when vc-static-header-alist + (dolist (f vc-static-header-alist) + (when (string-match (car f) buffer-file-name) + (insert (format (cdr f) (car hdstrings))))))))))) + +(defun vc-clear-headers (&optional file) + "Clear all version headers in the current buffer (or FILE). +The headers are reset to their non-expanded form." + (let* ((filename (or file buffer-file-name)) + (visited (find-buffer-visiting filename)) + (backend (vc-backend filename))) + (when (vc-find-backend-function backend 'clear-headers) + (if visited + (let ((context (vc-buffer-context))) + ;; save-excursion may be able to relocate point and mark + ;; properly. If it fails, vc-restore-buffer-context + ;; will give it a second try. + (save-excursion + (vc-call-backend backend 'clear-headers)) + (vc-restore-buffer-context context)) + (set-buffer (find-file-noselect filename)) + (vc-call-backend backend 'clear-headers) + (kill-buffer filename))))) + +(defun vc-modify-change-comment (files rev oldcomment) + "Edit the comment associated with the given files and revision." + ;; Less of a kluge than it looks like; log-view mode only passes + ;; this function a singleton list. Arguments left in this form in + ;; case the more general operation ever becomes meaningful. + (let ((backend (vc-responsible-backend (car files)))) + (vc-start-logentry + files oldcomment t + "Enter a replacement change comment." + "*VC-log*" + (lambda () (vc-call-backend backend 'log-edit-mode)) + (lexical-let ((rev rev)) + (lambda (files comment) + (vc-call-backend backend + 'modify-change-comment files rev comment)))))) + +;;;###autoload +(defun vc-merge () + "Merge changes between two revisions into the current buffer's file. +This asks for two revisions to merge from in the minibuffer. If the +first revision is a branch number, then merge all changes from that +branch. If the first revision is empty, merge news, i.e. recent changes +from the current branch. + +See Info node `Merging'." + (interactive) + (vc-ensure-vc-buffer) + (vc-buffer-sync) + (let* ((file buffer-file-name) + (backend (vc-backend file)) + (state (vc-state file)) + first-revision second-revision status) + (cond + ((stringp state) ;; Locking VCses only + (error "File is locked by %s" state)) + ((not (vc-editable-p file)) + (if (y-or-n-p + "File must be checked out for merging. Check out now? ") + (vc-checkout file t) + (error "Merge aborted")))) + (setq first-revision + (vc-read-revision + (concat "Branch or revision to merge from " + "(default news on current branch): ") + (list file) + backend)) + (if (string= first-revision "") + (setq status (vc-call-backend backend 'merge-news file)) + (if (not (vc-find-backend-function backend 'merge)) + (error "Sorry, merging is not implemented for %s" backend) + (if (not (vc-branch-p first-revision)) + (setq second-revision + (vc-read-revision + "Second revision: " + (list file) backend nil + ;; FIXME: This is CVS/RCS/SCCS specific. + (concat (vc-branch-part first-revision) "."))) + ;; We want to merge an entire branch. Set revisions + ;; accordingly, so that vc-BACKEND-merge understands us. + (setq second-revision first-revision) + ;; first-revision must be the starting point of the branch + (setq first-revision (vc-branch-part first-revision))) + (setq status (vc-call-backend backend 'merge file + first-revision second-revision)))) + (vc-maybe-resolve-conflicts file status "WORKFILE" "MERGE SOURCE"))) + +(defun vc-maybe-resolve-conflicts (file status &optional name-A name-B) + (vc-resynch-buffer file t (not (buffer-modified-p))) + (if (zerop status) (message "Merge successful") + (smerge-mode 1) + (message "File contains conflicts."))) + +;;;###autoload +(defalias 'vc-resolve-conflicts 'smerge-ediff) + +;; TODO: This is OK but maybe we could integrate it better. +;; E.g. it could be run semi-automatically (via a prompt?) when saving a file +;; that was conflicted (i.e. upon mark-resolved). +;; FIXME: should we add an "other-window" version? Or maybe we should +;; hook it inside find-file so it automatically works for +;; find-file-other-window as well. E.g. find-file could use a new +;; `default-next-file' variable for its default file (M-n), and +;; we could then set it upon mark-resolve, so C-x C-s C-x C-f M-n would +;; automatically offer the next conflicted file. +(defun vc-find-conflicted-file () + "Visit the next conflicted file in the current project." + (interactive) + (let* ((backend (or (if buffer-file-name (vc-backend buffer-file-name)) + (vc-responsible-backend default-directory) + (error "No VC backend"))) + (files (vc-call-backend backend + 'conflicted-files default-directory))) + ;; Don't try and visit the current file. + (if (equal (car files) buffer-file-name) (pop files)) + (if (null files) + (message "No more conflicted files") + (find-file (pop files)) + (message "%s more conflicted files after this one" + (if files (length files) "No"))))) + +;; Named-configuration entry points + +(defun vc-tag-precondition (dir) + "Scan the tree below DIR, looking for files not up-to-date. +If any file is not up-to-date, return the name of the first such file. +\(This means, neither tag creation nor retrieval is allowed.\) +If one or more of the files are currently visited, return `visited'. +Otherwise, return nil." + (let ((status nil)) + (catch 'vc-locked-example + (vc-file-tree-walk + dir + (lambda (f) + (if (not (vc-up-to-date-p f)) (throw 'vc-locked-example f) + (when (get-file-buffer f) (setq status 'visited))))) + status))) + +;;;###autoload +(defun vc-create-tag (dir name branchp) + "Descending recursively from DIR, make a tag called NAME. +For each registered file, the working revision becomes part of +the named configuration. If the prefix argument BRANCHP is +given, the tag is made as a new branch and the files are +checked out in that new branch." + (interactive + (let ((granularity + (vc-call-backend (vc-responsible-backend default-directory) + 'revision-granularity))) + (list + (if (eq granularity 'repository) + ;; For VC's that do not work at file level, it's pointless + ;; to ask for a directory, branches are created at repository level. + default-directory + (read-file-name "Directory: " default-directory default-directory t)) + (read-string (if current-prefix-arg "New branch name: " "New tag name: ")) + current-prefix-arg))) + (message "Making %s... " (if branchp "branch" "tag")) + (when (file-directory-p dir) (setq dir (file-name-as-directory dir))) + (vc-call-backend (vc-responsible-backend dir) + 'create-tag dir name branchp) + (vc-resynch-buffer dir t t t) + (message "Making %s... done" (if branchp "branch" "tag"))) + +;;;###autoload +(defun vc-retrieve-tag (dir name) + "Descending recursively from DIR, retrieve the tag called NAME. +If NAME is empty, it refers to the latest revisions. +If locking is used for the files in DIR, then there must not be any +locked files at or below DIR (but if NAME is empty, locked files are +allowed and simply skipped)." + (interactive + (let ((granularity + (vc-call-backend (vc-responsible-backend default-directory) + 'revision-granularity))) + (list + (if (eq granularity 'repository) + ;; For VC's that do not work at file level, it's pointless + ;; to ask for a directory, branches are created at repository level. + default-directory + (read-file-name "Directory: " default-directory default-directory t)) + (read-string "Tag name to retrieve (default latest revisions): ")))) + (let ((update (yes-or-no-p "Update any affected buffers? ")) + (msg (if (or (not name) (string= name "")) + (format "Updating %s... " (abbreviate-file-name dir)) + (format "Retrieving tag into %s... " + (abbreviate-file-name dir))))) + (message "%s" msg) + (vc-call-backend (vc-responsible-backend dir) + 'retrieve-tag dir name update) + (vc-resynch-buffer dir t t t) + (message "%s" (concat msg "done")))) + + +;; Miscellaneous other entry points + +;; FIXME: this should be a defcustom +;; FIXME: maybe add another choice: +;; `root-directory' (or somesuch), which would mean show a short log +;; for the root directory. +(defvar vc-log-short-style '(directory) + "Whether or not to show a short log. +If it contains `directory' then if the fileset contains a directory show a short log. +If it contains `file' then show short logs for files. +Not all VC backends support short logs!") + +(defvar log-view-vc-fileset) + +(defun vc-print-log-setup-buttons (working-revision is-start-revision limit pl-return) + (when (and limit (not (eq 'limit-unsupported pl-return)) + (not is-start-revision)) + (goto-char (point-max)) + (lexical-let ((working-revision working-revision) + (limit limit)) + (widget-create 'push-button + :notify (lambda (&rest ignore) + (vc-print-log-internal + log-view-vc-backend log-view-vc-fileset + working-revision nil (* 2 limit))) + :help-echo "Show the log again, and double the number of log entries shown" + "Show 2X entries") + (widget-insert " ") + (widget-create 'push-button + :notify (lambda (&rest ignore) + (vc-print-log-internal + log-view-vc-backend log-view-vc-fileset + working-revision nil nil)) + :help-echo "Show the log again, showing all entries" + "Show unlimited entries")) + (widget-setup))) + +(defun vc-print-log-internal (backend files working-revision + &optional is-start-revision limit) + ;; Don't switch to the output buffer before running the command, + ;; so that any buffer-local settings in the vc-controlled + ;; buffer can be accessed by the command. + (let ((dir-present nil) + (vc-short-log nil) + (buffer-name "*vc-change-log*") + type + pl-return) + (dolist (file files) + (when (file-directory-p file) + (setq dir-present t))) + (setq vc-short-log + (not (null (if dir-present + (memq 'directory vc-log-short-style) + (memq 'file vc-log-short-style))))) + (setq type (if vc-short-log 'short 'long)) + (lexical-let + ((working-revision working-revision) + (limit limit) + (shortlog vc-short-log) + (is-start-revision is-start-revision)) + (vc-log-internal-common + backend buffer-name files type + (lambda (bk buf type-arg files-arg) + (vc-call-backend bk 'print-log files-arg buf + shortlog (when is-start-revision working-revision) limit)) + (lambda (bk files-arg ret) + (vc-print-log-setup-buttons working-revision + is-start-revision limit ret)) + (lambda (bk) + (vc-call-backend bk 'show-log-entry working-revision)))))) + +(defvar vc-log-view-type nil + "Set this to differentiate the different types of logs.") +(put 'vc-log-view-type 'permanent-local t) + +(defun vc-log-internal-common (backend + buffer-name + files + type + backend-func + setup-buttons-func + goto-location-func) + (let (retval) + (with-current-buffer (get-buffer-create buffer-name) + (set (make-local-variable 'vc-log-view-type) type)) + (setq retval (funcall backend-func backend buffer-name type files)) + (pop-to-buffer buffer-name) + (let ((inhibit-read-only t)) + ;; log-view-mode used to be called with inhibit-read-only bound + ;; to t, so let's keep doing it, just in case. + (vc-call-backend backend 'log-view-mode) + (set (make-local-variable 'log-view-vc-backend) backend) + (set (make-local-variable 'log-view-vc-fileset) files)) + (vc-exec-after + `(let ((inhibit-read-only t)) + (funcall ',setup-buttons-func ',backend ',files ',retval) + (shrink-window-if-larger-than-buffer) + (funcall ',goto-location-func ',backend) + (setq vc-sentinel-movepoint (point)) + (set-buffer-modified-p nil))))) + +(defun vc-incoming-outgoing-internal (backend remote-location buffer-name type) + (vc-log-internal-common + backend buffer-name nil type + (lexical-let + ((remote-location remote-location)) + (lambda (bk buf type-arg files) + (vc-call-backend bk type-arg buf remote-location))) + (lambda (bk files-arg ret)) + (lambda (bk) + (goto-char (point-min))))) + +;;;###autoload +(defun vc-print-log (&optional working-revision limit) + "List the change log of the current fileset in a window. +If WORKING-REVISION is non-nil, leave point at that revision. +If LIMIT is non-nil, it should be a number specifying the maximum +number of revisions to show; the default is `vc-log-show-limit'. + +When called interactively with a prefix argument, prompt for +WORKING-REVISION and LIMIT." + (interactive + (cond + (current-prefix-arg + (let ((rev (read-from-minibuffer "Log from revision (default: last revision): " nil + nil nil nil)) + (lim (string-to-number + (read-from-minibuffer + "Limit display (unlimited: 0): " + (format "%s" vc-log-show-limit) + nil nil nil)))) + (when (string= rev "") (setq rev nil)) + (when (<= lim 0) (setq lim nil)) + (list rev lim))) + (t + (list nil (when (> vc-log-show-limit 0) vc-log-show-limit))))) + (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef + (backend (car vc-fileset)) + (files (cadr vc-fileset)) + (working-revision (or working-revision (vc-working-revision (car files))))) + (vc-print-log-internal backend files working-revision nil limit))) + +;;;###autoload +(defun vc-print-root-log (&optional limit) + "List the change log for the current VC controlled tree in a window. +If LIMIT is non-nil, it should be a number specifying the maximum +number of revisions to show; the default is `vc-log-show-limit'. +When called interactively with a prefix argument, prompt for LIMIT." + (interactive + (cond + (current-prefix-arg + (let ((lim (string-to-number + (read-from-minibuffer + "Limit display (unlimited: 0): " + (format "%s" vc-log-show-limit) + nil nil nil)))) + (when (<= lim 0) (setq lim nil)) + (list lim))) + (t + (list (when (> vc-log-show-limit 0) vc-log-show-limit))))) + (let ((backend (vc-deduce-backend)) + rootdir working-revision) + (unless backend + (error "Buffer is not version controlled")) + (setq rootdir (vc-call-backend backend 'root default-directory)) + (setq working-revision (vc-working-revision rootdir)) + (vc-print-log-internal backend (list rootdir) working-revision nil limit))) + +;;;###autoload +(defun vc-log-incoming (&optional remote-location) + "Show a log of changes that will be received with a pull operation from REMOTE-LOCATION." + (interactive "sRemote location (empty for default): ") + (let ((backend (vc-deduce-backend)) + rootdir working-revision) + (unless backend + (error "Buffer is not version controlled")) + (vc-incoming-outgoing-internal backend remote-location "*vc-incoming*" 'log-incoming))) + +;;;###autoload +(defun vc-log-outgoing (&optional remote-location) + "Show a log of changes that will be sent with a push operation to REMOTE-LOCATION." + (interactive "sRemote location (empty for default): ") + (let ((backend (vc-deduce-backend)) + rootdir working-revision) + (unless backend + (error "Buffer is not version controlled")) + (vc-incoming-outgoing-internal backend remote-location "*vc-outgoing*" 'log-outgoing))) + +;;;###autoload +(defun vc-revert () + "Revert working copies of the selected fileset to their repository contents. +This asks for confirmation if the buffer contents are not identical +to the working revision (except for keyword expansion)." + (interactive) + (let* ((vc-fileset (vc-deduce-fileset)) + (files (cadr vc-fileset))) + ;; If any of the files is visited by the current buffer, make + ;; sure buffer is saved. If the user says `no', abort since + ;; we cannot show the changes and ask for confirmation to + ;; discard them. + (when (or (not files) (memq (buffer-file-name) files)) + (vc-buffer-sync nil)) + (dolist (file files) + (let ((buf (get-file-buffer file))) + (when (and buf (buffer-modified-p buf)) + (error "Please kill or save all modified buffers before reverting"))) + (when (vc-up-to-date-p file) + (unless (yes-or-no-p (format "%s seems up-to-date. Revert anyway? " file)) + (error "Revert canceled")))) + (when (vc-diff-internal vc-allow-async-revert vc-fileset nil nil) + (unless (yes-or-no-p + (format "Discard changes in %s? " + (let ((str (vc-delistify files)) + (nfiles (length files))) + (if (< (length str) 50) + str + (format "%d file%s" nfiles + (if (= nfiles 1) "" "s")))))) + (error "Revert canceled")) + (delete-windows-on "*vc-diff*") + (kill-buffer "*vc-diff*")) + (dolist (file files) + (message "Reverting %s..." (vc-delistify files)) + (vc-revert-file file) + (message "Reverting %s...done" (vc-delistify files))))) + +;;;###autoload +(defun vc-rollback () + "Roll back (remove) the most recent changeset committed to the repository. +This may be either a file-level or a repository-level operation, +depending on the underlying version-control system." + (interactive) + (let* ((vc-fileset (vc-deduce-fileset)) + (backend (car vc-fileset)) + (files (cadr vc-fileset)) + (granularity (vc-call-backend backend 'revision-granularity))) + (unless (vc-find-backend-function backend 'rollback) + (error "Rollback is not supported in %s" backend)) + (when (and (not (eq granularity 'repository)) (/= (length files) 1)) + (error "Rollback requires a singleton fileset or repository versioning")) + ;; FIXME: latest-on-branch-p should take the fileset. + (when (not (vc-call-backend backend 'latest-on-branch-p (car files))) + (error "Rollback is only possible at the tip revision")) + ;; If any of the files is visited by the current buffer, make + ;; sure buffer is saved. If the user says `no', abort since + ;; we cannot show the changes and ask for confirmation to + ;; discard them. + (when (or (not files) (memq (buffer-file-name) files)) + (vc-buffer-sync nil)) + (dolist (file files) + (when (buffer-modified-p (get-file-buffer file)) + (error "Please kill or save all modified buffers before rollback")) + (when (not (vc-up-to-date-p file)) + (error "Please revert all modified workfiles before rollback"))) + ;; Accumulate changes associated with the fileset + (vc-setup-buffer "*vc-diff*") + (not-modified) + (message "Finding changes...") + (let* ((tip (vc-working-revision (car files))) + ;; FIXME: `previous-revision' should take the fileset. + (previous (vc-call-backend backend 'previous-revision + (car files) tip))) + (vc-diff-internal nil vc-fileset previous tip)) + ;; Display changes + (unless (yes-or-no-p "Discard these revisions? ") + (error "Rollback canceled")) + (delete-windows-on "*vc-diff*") + (kill-buffer"*vc-diff*") + ;; Do the actual reversions + (message "Rolling back %s..." (vc-delistify files)) + (with-vc-properties + files + (vc-call-backend backend 'rollback files) + `((vc-state . ,'up-to-date) + (vc-checkout-time . , (nth 5 (file-attributes file))) + (vc-working-revision . nil))) + (dolist (f files) (vc-resynch-buffer f t t)) + (message "Rolling back %s...done" (vc-delistify files)))) + +;;;###autoload +(define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1") + +;;;###autoload +(defun vc-update () + "Update the current fileset's files to their tip revisions. +For each one that contains no changes, and is not locked, then this simply +replaces the work file with the latest revision on its branch. If the file +contains changes, and the backend supports merging news, then any recent +changes from the current branch are merged into the working file." + (interactive) + (let* ((vc-fileset (vc-deduce-fileset)) + (backend (car vc-fileset)) + (files (cadr vc-fileset))) + (save-some-buffers ; save buffers visiting files + nil (lambda () + (and (buffer-modified-p) + (let ((file (buffer-file-name))) + (and file (member file files)))))) + (dolist (file files) + (if (vc-up-to-date-p file) + (vc-checkout file nil t) + (if (eq (vc-checkout-model backend (list file)) 'locking) + (if (eq (vc-state file) 'edited) + (error "%s" + (substitute-command-keys + "File is locked--type \\[vc-revert] to discard changes")) + (error "Unexpected file state (%s) -- type %s" + (vc-state file) + (substitute-command-keys + "\\[vc-next-action] to correct"))) + (vc-maybe-resolve-conflicts + file (vc-call-backend backend 'merge-news file))))))) + +(defun vc-version-backup-file (file &optional rev) + "Return name of backup file for revision REV of FILE. +If version backups should be used for FILE, and there exists +such a backup for REV or the working revision of file, return +its name; otherwise return nil." + (when (vc-call make-version-backups-p file) + (let ((backup-file (vc-version-backup-file-name file rev))) + (if (file-exists-p backup-file) + backup-file + ;; there is no automatic backup, but maybe the user made one manually + (setq backup-file (vc-version-backup-file-name file rev 'manual)) + (when (file-exists-p backup-file) + backup-file))))) + +(defun vc-revert-file (file) + "Revert FILE back to the repository working revision it was based on." + (with-vc-properties + (list file) + (let ((backup-file (vc-version-backup-file file))) + (when backup-file + (copy-file backup-file file 'ok-if-already-exists 'keep-date) + (vc-delete-automatic-version-backups file)) + (vc-call revert file backup-file)) + `((vc-state . up-to-date) + (vc-checkout-time . ,(nth 5 (file-attributes file))))) + (vc-resynch-buffer file t t)) + +;;;###autoload +(defun vc-switch-backend (file backend) + "Make BACKEND the current version control system for FILE. +FILE must already be registered in BACKEND. The change is not +permanent, only for the current session. This function only changes +VC's perspective on FILE, it does not register or unregister it. +By default, this command cycles through the registered backends. +To get a prompt, use a prefix argument." + (interactive + (list + (or buffer-file-name + (error "There is no version-controlled file in this buffer")) + (let ((crt-bk (vc-backend buffer-file-name)) + (backends nil)) + (unless crt-bk + (error "File %s is not under version control" buffer-file-name)) + ;; Find the registered backends. + (dolist (crt vc-handled-backends) + (when (and (vc-call-backend crt 'registered buffer-file-name) + (not (eq crt-bk crt))) + (push crt backends))) + ;; Find the next backend. + (let ((def (car backends)) + (others backends)) + (cond + ((null others) (error "No other backend to switch to")) + (current-prefix-arg + (intern + (upcase + (completing-read + (format "Switch to backend [%s]: " def) + (mapcar (lambda (b) (list (downcase (symbol-name b)))) backends) + nil t nil nil (downcase (symbol-name def)))))) + (t def)))))) + (unless (eq backend (vc-backend file)) + (vc-file-clearprops file) + (vc-file-setprop file 'vc-backend backend) + ;; Force recomputation of the state + (unless (vc-call-backend backend 'registered file) + (vc-file-clearprops file) + (error "%s is not registered in %s" file backend)) + (vc-mode-line file))) + +;;;###autoload +(defun vc-transfer-file (file new-backend) + "Transfer FILE to another version control system NEW-BACKEND. +If NEW-BACKEND has a higher precedence than FILE's current backend +\(i.e. it comes earlier in `vc-handled-backends'), then register FILE in +NEW-BACKEND, using the revision number from the current backend as the +base level. If NEW-BACKEND has a lower precedence than the current +backend, then commit all changes that were made under the current +backend to NEW-BACKEND, and unregister FILE from the current backend. +\(If FILE is not yet registered under NEW-BACKEND, register it.)" + (let* ((old-backend (vc-backend file)) + (edited (memq (vc-state file) '(edited needs-merge))) + (registered (vc-call-backend new-backend 'registered file)) + (move + (and registered ; Never move if not registered in new-backend yet. + ;; move if new-backend comes later in vc-handled-backends + (or (memq new-backend (memq old-backend vc-handled-backends)) + (y-or-n-p "Final transfer? ")))) + (comment nil)) + (when (eq old-backend new-backend) + (error "%s is the current backend of %s" new-backend file)) + (if registered + (set-file-modes file (logior (file-modes file) 128)) + ;; `registered' might have switched under us. + (vc-switch-backend file old-backend) + (let* ((rev (vc-working-revision file)) + (modified-file (and edited (make-temp-file file))) + (unmodified-file (and modified-file (vc-version-backup-file file)))) + ;; Go back to the base unmodified file. + (unwind-protect + (progn + (when modified-file + (copy-file file modified-file 'ok-if-already-exists) + ;; If we have a local copy of the unmodified file, handle that + ;; here and not in vc-revert-file because we don't want to + ;; delete that copy -- it is still useful for OLD-BACKEND. + (if unmodified-file + (copy-file unmodified-file file + 'ok-if-already-exists 'keep-date) + (when (y-or-n-p "Get base revision from repository? ") + (vc-revert-file file)))) + (vc-call-backend new-backend 'receive-file file rev)) + (when modified-file + (vc-switch-backend file new-backend) + (unless (eq (vc-checkout-model new-backend (list file)) 'implicit) + (vc-checkout file t nil)) + (rename-file modified-file file 'ok-if-already-exists) + (vc-file-setprop file 'vc-checkout-time nil))))) + (when move + (vc-switch-backend file old-backend) + (setq comment (vc-call-backend old-backend 'comment-history file)) + (vc-call-backend old-backend 'unregister file)) + (vc-switch-backend file new-backend) + (when (or move edited) + (vc-file-setprop file 'vc-state 'edited) + (vc-mode-line file new-backend) + (vc-checkin file new-backend nil comment (stringp comment))))) + +(defun vc-rename-master (oldmaster newfile templates) + "Rename OLDMASTER to be the master file for NEWFILE based on TEMPLATES." + (let* ((dir (file-name-directory (expand-file-name oldmaster))) + (newdir (or (file-name-directory newfile) "")) + (newbase (file-name-nondirectory newfile)) + (masters + ;; List of potential master files for `newfile' + (mapcar + (lambda (s) (vc-possible-master s newdir newbase)) + templates))) + (when (or (file-symlink-p oldmaster) + (file-symlink-p (file-name-directory oldmaster))) + (error "This is unsafe in the presence of symbolic links")) + (rename-file + oldmaster + (catch 'found + ;; If possible, keep the master file in the same directory. + (dolist (f masters) + (when (and f (string= (file-name-directory (expand-file-name f)) dir)) + (throw 'found f))) + ;; If not, just use the first possible place. + (dolist (f masters) + (and f (or (not (setq dir (file-name-directory f))) + (file-directory-p dir)) + (throw 'found f))) + (error "New file lacks a version control directory"))))) + +;;;###autoload +(defun vc-delete-file (file) + "Delete file and mark it as such in the version control system." + (interactive "fVC delete file: ") + (setq file (expand-file-name file)) + (let ((buf (get-file-buffer file)) + (backend (vc-backend file))) + (unless backend + (error "File %s is not under version control" + (file-name-nondirectory file))) + (unless (vc-find-backend-function backend 'delete-file) + (error "Deleting files under %s is not supported in VC" backend)) + (when (and buf (buffer-modified-p buf)) + (error "Please save or undo your changes before deleting %s" file)) + (let ((state (vc-state file))) + (when (eq state 'edited) + (error "Please commit or undo your changes before deleting %s" file)) + (when (eq state 'conflict) + (error "Please resolve the conflicts before deleting %s" file))) + (unless (y-or-n-p (format "Really want to delete %s? " + (file-name-nondirectory file))) + (error "Abort!")) + (unless (or (file-directory-p file) (null make-backup-files) + (not (file-exists-p file))) + (with-current-buffer (or buf (find-file-noselect file)) + (let ((backup-inhibited nil)) + (backup-buffer)))) + ;; Bind `default-directory' so that the command that the backend + ;; runs to remove the file is invoked in the correct context. + (let ((default-directory (file-name-directory file))) + (vc-call-backend backend 'delete-file file)) + ;; If the backend hasn't deleted the file itself, let's do it for him. + (when (file-exists-p file) (delete-file file)) + ;; Forget what VC knew about the file. + (vc-file-clearprops file) + ;; Make sure the buffer is deleted and the *vc-dir* buffers are + ;; updated after this. + (vc-resynch-buffer file nil t))) + +;;;###autoload +(defun vc-rename-file (old new) + "Rename file OLD to NEW in both work area and repository." + (interactive "fVC rename file: \nFRename to: ") + ;; in CL I would have said (setq new (merge-pathnames new old)) + (let ((old-base (file-name-nondirectory old))) + (when (and (not (string= "" old-base)) + (string= "" (file-name-nondirectory new))) + (setq new (concat new old-base)))) + (let ((oldbuf (get-file-buffer old))) + (when (and oldbuf (buffer-modified-p oldbuf)) + (error "Please save files before moving them")) + (when (get-file-buffer new) + (error "Already editing new file name")) + (when (file-exists-p new) + (error "New file already exists")) + (let ((state (vc-state old))) + (unless (memq state '(up-to-date edited)) + (error "Please %s files before moving them" + (if (stringp state) "check in" "update")))) + (vc-call rename-file old new) + (vc-file-clearprops old) + ;; Move the actual file (unless the backend did it already) + (when (file-exists-p old) (rename-file old new)) + ;; ?? Renaming a file might change its contents due to keyword expansion. + ;; We should really check out a new copy if the old copy was precisely equal + ;; to some checked-in revision. However, testing for this is tricky.... + (when oldbuf + (with-current-buffer oldbuf + (let ((buffer-read-only buffer-read-only)) + (set-visited-file-name new)) + (vc-mode-line new (vc-backend new)) + (set-buffer-modified-p nil))))) + +;;;###autoload +(defun vc-update-change-log (&rest args) + "Find change log file and add entries from recent version control logs. +Normally, find log entries for all registered files in the default +directory. + +With prefix arg of \\[universal-argument], only find log entries for the current buffer's file. + +With any numeric prefix arg, find log entries for all currently visited +files that are under version control. This puts all the entries in the +log for the default directory, which may not be appropriate. + +From a program, any ARGS are assumed to be filenames for which +log entries should be gathered." + (interactive + (cond ((consp current-prefix-arg) ;C-u + (list buffer-file-name)) + (current-prefix-arg ;Numeric argument. + (let ((files nil) + (buffers (buffer-list)) + file) + (while buffers + (setq file (buffer-file-name (car buffers))) + (and file (vc-backend file) + (setq files (cons file files))) + (setq buffers (cdr buffers))) + files)) + (t + ;; Don't supply any filenames to backend; this means + ;; it should find all relevant files relative to + ;; the default-directory. + nil))) + (vc-call-backend (vc-responsible-backend default-directory) + 'update-changelog args)) + +;; functions that operate on RCS revision numbers. This code should +;; also be moved into the backends. It stays for now, however, since +;; it is used in code below. +(defun vc-branch-p (rev) + "Return t if REV is a branch revision." + (not (eq nil (string-match "\\`[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*\\'" rev)))) + +;;;###autoload +(defun vc-branch-part (rev) + "Return the branch part of a revision number REV." + (let ((index (string-match "\\.[0-9]+\\'" rev))) + (when index + (substring rev 0 index)))) + +(define-obsolete-function-alias + 'vc-default-previous-version 'vc-default-previous-revision "23.1") + +(defun vc-default-responsible-p (backend file) + "Indicate whether BACKEND is reponsible for FILE. +The default is to return nil always." + nil) + +(defun vc-default-could-register (backend file) + "Return non-nil if BACKEND could be used to register FILE. +The default implementation returns t for all files." + t) + +(defun vc-default-latest-on-branch-p (backend file) + "Return non-nil if FILE is the latest on its branch. +This default implementation always returns non-nil, which means that +editing non-current revisions is not supported by default." + t) + +(defun vc-default-init-revision (backend) vc-default-init-revision) + +(defun vc-default-find-revision (backend file rev buffer) + "Provide the new `find-revision' op based on the old `checkout' op. +This is only for compatibility with old backends. They should be updated +to provide the `find-revision' operation instead." + (let ((tmpfile (make-temp-file (expand-file-name file)))) + (unwind-protect + (progn + (vc-call-backend backend 'checkout file nil rev tmpfile) + (with-current-buffer buffer + (insert-file-contents-literally tmpfile))) + (delete-file tmpfile)))) + +(defun vc-default-rename-file (backend old new) + (condition-case nil + (add-name-to-file old new) + (error (rename-file old new))) + (vc-delete-file old) + (with-current-buffer (find-file-noselect new) + (vc-register))) + +(defalias 'vc-default-check-headers 'ignore) + +(declare-function log-edit-mode "log-edit" ()) + +(defun vc-default-log-edit-mode (backend) (log-edit-mode)) + +(defun vc-default-log-view-mode (backend) (log-view-mode)) + +(defun vc-default-show-log-entry (backend rev) + (with-no-warnings + (log-view-goto-rev rev))) + +(defun vc-default-comment-history (backend file) + "Return a string with all log entries stored in BACKEND for FILE." + (when (vc-find-backend-function backend 'print-log) + (with-current-buffer "*vc*" + (vc-call-backend backend 'print-log (list file)) + (buffer-string)))) + +(defun vc-default-receive-file (backend file rev) + "Let BACKEND receive FILE from another version control system." + (vc-call-backend backend 'register (list file) rev "")) + +(defun vc-default-retrieve-tag (backend dir name update) + (if (string= name "") + (progn + (vc-file-tree-walk + dir + (lambda (f) (and + (vc-up-to-date-p f) + (vc-error-occurred + (vc-call-backend backend 'checkout f nil "") + (when update (vc-resynch-buffer f t t))))))) + (let ((result (vc-tag-precondition dir))) + (if (stringp result) + (error "File %s is locked" result) + (setq update (and (eq result 'visited) update)) + (vc-file-tree-walk + dir + (lambda (f) (vc-error-occurred + (vc-call-backend backend 'checkout f nil name) + (when update (vc-resynch-buffer f t t))))))))) + +(defun vc-default-revert (backend file contents-done) + (unless contents-done + (let ((rev (vc-working-revision file)) + (file-buffer (or (get-file-buffer file) (current-buffer)))) + (message "Checking out %s..." file) + (let ((failed t) + (backup-name (car (find-backup-file-name file)))) + (when backup-name + (copy-file file backup-name 'ok-if-already-exists 'keep-date) + (unless (file-writable-p file) + (set-file-modes file (logior (file-modes file) 128)))) + (unwind-protect + (let ((coding-system-for-read 'no-conversion) + (coding-system-for-write 'no-conversion)) + (with-temp-file file + (let ((outbuf (current-buffer))) + ;; Change buffer to get local value of vc-checkout-switches. + (with-current-buffer file-buffer + (let ((default-directory (file-name-directory file))) + (vc-call-backend backend 'find-revision + file rev outbuf))))) + (setq failed nil)) + (when backup-name + (if failed + (rename-file backup-name file 'ok-if-already-exists) + (and (not vc-make-backup-files) (delete-file backup-name)))))) + (message "Checking out %s...done" file)))) + +(defalias 'vc-default-revision-completion-table 'ignore) +(defalias 'vc-default-mark-resolved 'ignore) + +(defun vc-default-dir-status-files (backend dir files default-state update-function) + (funcall update-function + (mapcar (lambda (file) (list file default-state)) files))) + +(defun vc-check-headers () + "Check if the current file has any headers in it." + (interactive) + (vc-call-backend (vc-backend buffer-file-name) 'check-headers)) + + + +;; These things should probably be generally available + +(defun vc-string-prefix-p (prefix string) + (let ((lpref (length prefix))) + (and (>= (length string) lpref) + (eq t (compare-strings prefix nil nil string nil lpref))))) + +(defun vc-file-tree-walk (dirname func &rest args) + "Walk recursively through DIRNAME. +Invoke FUNC f ARGS on each VC-managed file f underneath it." + (vc-file-tree-walk-internal (expand-file-name dirname) func args) + (message "Traversing directory %s...done" dirname)) + +(defun vc-file-tree-walk-internal (file func args) + (if (not (file-directory-p file)) + (when (vc-backend file) (apply func file args)) + (message "Traversing directory %s..." (abbreviate-file-name file)) + (let ((dir (file-name-as-directory file))) + (mapcar + (lambda (f) (or + (string-equal f ".") + (string-equal f "..") + (member f vc-directory-exclusion-list) + (let ((dirf (expand-file-name f dir))) + (or + (file-symlink-p dirf) ;; Avoid possible loops. + (vc-file-tree-walk-internal dirf func args))))) + (directory-files dir))))) + +(provide 'vc) + +;; arch-tag: ca82c1de-3091-4e26-af92-460abc6213a6 +;;; vc.el ends here diff --cc src/ChangeLog index 04e74667bc3,c00d4febc2d..02c2969242f --- a/src/ChangeLog +++ b/src/ChangeLog @@@ -1,2944 -1,197 +1,2966 @@@ + 2010-07-14 Jan Djärv + + * xterm.h (x_menubar_window_to_frame): Second parameter is XEvent*. + + * xterm.c (handle_one_xevent): Pass event to x_menubar_window_to_frame. + + * xmenu.c (x_activate_menubar): Revert previous fix for Bug#6499, + i.e. don't put back ButtonRelease (Bug#6608). + + * xfns.c (x_menubar_window_to_frame): Take XEvent as second parameter + instead of Window. Call xg_event_is_for_menubar when + USE_GTK (Bug#6499). + + * gtkutil.h (xg_event_is_for_menubar): Declare. + + * gtkutil.c (xg_event_is_for_menubar): New function (Bug#6499). + + 2010-07-14 Eli Zaretskii + + * w32fns.c (x_set_foreground_color): Fix setting the cursor color + when it's the same as the old foreground. (Bug#6609) + +2010-07-16 Jan Djärv + + * xmenu.c (free_frame_menubar): Only call x_set_window_size if + widget is non-null (Bug#6645). + +2010-07-15 Andreas Schwab + + * xterm.c (x_fully_uncatch_errors, x_trace_wire, x_check_font): + Convert old-style definition. + + * xmenu.c (create_and_show_popup_menu, xmenu_show): Fix type of + timestamp argument. + +2010-07-15 Eli Zaretskii + + * fringe.c (update_window_fringes): Restore mistakenly reverted + code from 2010-04-17T12:33:05Z!eliz@gnu.org merged in 2010-04-20T13:31:28Z!eliz@gnu.org. + +2010-07-14 Jan Djärv + + * xterm.c (xm_scroll_callback, x_process_timeouts): K&R => prototype. + (SET_SAVED_KEY_EVENT): Remove (not used). + (SET_SAVED_MENU_EVENT): Rename to SET_SAVED_BUTTON_EVENT and + remove size parameter. + (handle_one_xevent): Check popup_activated () for menu for Xt also. + Remove #ifdef USE_GTK around finish = X_EVENT_DROP. + Remove #ifdef USE_MOTIF code that did SET_SAVED_BUTTON_EVENT for + ButtonRelease. + (x_set_window_size_1): scroll_bar_actual_width is always + SCROLL_BAR_COLS * COLUMN_WIDTH for the purpose of frame sizing. + + * xdisp.c (pending_menu_activation): Remove extern declaration. + (prepare_menu_bars): Remove setting of pending_menu_activation. + + * xmenu.c (pending_menu_activation): Remove. + (x_activate_menubar): Set popup_activated_flag for Xt also. Remove + setting of pending_menu_activation. + (set_frame_menubar): Remove check of pending_menu_activation. + Declare menubar_size before code. Correct spelling in comment. + +2010-07-14 Kenichi Handa + + * font.c (font_open_entity): Cancel previous change. + (Ffont_get): Don't check FONT_ENTITY_INDEX of a font-object. + +2010-07-13 Eli Zaretskii + + Remove subprocesses #ifdefs. + * process.c : Move to the common part. + (Fwaiting_for_user_input_p): Move to the common part; return nil + if async subprocesses aren't supported. + * sysdep.c (wait_for_termination) [!MSDOS]: Don't compile on + MS-DOS. Remove "#ifdef subprocesses". + (sys_subshell, sys_select): Remove "#ifdef subprocesses". + (gettimeofday): Remove "#ifdef subprocesses". + (wait_without_blocking): Remove function. + (flush_pending_output, child_setup_tty): Don't compile on MS-DOS. + Remove "#ifdef subprocesses". + (child_setup_tty): Use WINDOWSNT instead of DOS_NT, since not + compiled on MS-DOS. + * callproc.c (Fcall_process) [!MSDOS]: Don't call + wait_for_termination on MS-DOS. + * emacs.c (shut_down_emacs): Remove "#ifndef subprocesses" from + initialization of inhibit_sentinels. + * keyboard.c (record_asynch_buffer_change): Remove "#ifdef + subprocesses" conditional. + * callproc.c (Fcall_process) [!subprocesses]: Don't call + wait_for_termination, since `buffer' cannot be an integer when + async subprocesses are not supported + * xdisp.c (decode_mode_spec): Use `MSDOS' instead of `subprocesses' + for ifdefing away the call to Fprocess_status. + + * process.c (add_keyboard_wait_descriptor) [!subprocesses]: Ifdef + away the entire body of the function. + +2010-07-13 Dan Nicolaescu + + Remove subprocesses #ifdefs from term.c. + * process.c (add_keyboard_wait_descriptor) + (delete_keyboard_wait_descriptor): Move to common section, do + nothing when subprocesses is not defined. + * term.c (Fsuspend_tty, Fresume_tty, init_tty): Remove subprocesses #ifdefs. + + Convert maybe_fatal to standard C. + * lisp.h (verror): Declare. + * eval.c (verror): New function containing the code from ... + (error): ... this. Call verror. + * term.c (vfatal): New function containing the code from ... + (fatal): ... this. Call vfatal. + (maybe_fatal): Convert to standard C, use variable number of + arguments. Declare as non-return. + (init_tty): Fix maybe_fatal call. + +2010-07-12 Dan Nicolaescu + + * xterm.c (x_scroll_bar_set_handle, x_scroll_bar_expose) + (_scroll_bar_note_movement): Convert definitions to standard C. + * xmenu.c (menu_help_callback, pop_down_menu, xmenu_show): + * xfns.c (hack_wm_protocols, x_window, x_window): Likewise. + +2010-07-12 Dan Nicolaescu + + * xterm.c (x_frame_of_widget, x_alloc_nearest_color_for_widget) + (x_alloc_lighter_color_for_widget, cvt_string_to_pixel) + (cvt_pixel_dtor, x_window_to_menu_bar, xt_action_hook) + (xaw_jump_callback, xaw_scroll_callback) + (x_create_toolkit_scroll_bar, x_set_toolkit_scroll_bar_thumb) + (x_wm_set_size_hint, x_activate_timeout_atimer): Convert + definitions to standard C. + * xmenu.c (menubar_id_to_frame, popup_get_selection) + (popup_activate_callback, popup_deactivate_callback) + (menu_highlight_callback, menubar_selection_callback) + (apply_systemfont_to_dialog, apply_systemfont_to_menu) + (free_frame_menubar, popup_selection_callback, as) + (create_and_show_popup_menu, dialog_selection_callback) + (create_and_show_dialog): + * xfns.c (hack_wm_protocols, x_window): + * xfaces.c (x_update_menu_appearance): + * widget.c (get_default_char_pixel_size, pixel_to_char_size) + (char_to_pixel_size, round_size_to_char, get_wm_shell) + (set_frame_size, update_wm_hints, setup_frame_gcs) + (update_various_frame_slots, update_from_various_frame_slots) + (EmacsFrameInitialize, EmacsFrameRealize, EmacsFrameResize) + (EmacsFrameSetValues, EmacsFrameQueryGeometry) + (EmacsFrameSetCharSize, widget_store_internal_border): Likewise. + +2010-07-12 Andreas Schwab + + * dbusbind.c (xd_initialize): Don't compare boolean with a + constant. + +2010-07-12 Eli Zaretskii + + * process.c (setup_process_coding_systems): Move to the part + shared by non-subprocesses systems, and make its body empty when + subprocesses is not defined. + (close_process_descs): Move to the part shared by non-subprocesses + systems. + (wait_reading_process_output) [!subprocesses]: Convert arg list to + ANSI C. + +2010-07-12 Andreas Schwab + + * editfns.c (transpose_markers): Convert old-style definition. + * emacs.c (abort, shut_down_emacs, fixup_locale) + (synchronize_system_time_locale) + (synchronize_system_messages_locale, syms_of_emacs): Likewise. + * floatfns.c (extract_float, matherr, init_floatfns) + (syms_of_floatfns): Likewise. + * fns.c (make_hash_table): Likewise. + * ftfont.c (ftfont_get_otf, ftfont_otf_features) + (ftfont_otf_capability, ftfont_get_glyph_id, ftfont_get_metrics) + (ftfont_drive_otf, ftfont_shape_by_flt, ftfont_shape) + (ftfont_variation_glyphs): Likewise. + * gtkutil.c (xg_create_widget, xg_modify_menubar_widgets): Likewise. + * keymap.c (describe_map_tree, describe_map, describe_vector): Likewise. + * lread.c (read_filtered_event): Likewise. + * minibuf.c (read_minibuf_noninteractive, read_minibuf): Likewise. + * process.c (wait_reading_process_output): Likewise. + * scroll.c (do_line_insertion_deletion_costs): Likewise. + * search.c (search_buffer, boyer_moore): Likewise. + * syntax.c (scan_sexps_forward): Likewise. + * xdisp.c (try_scrolling): Likewise. + * xfaces.c (face_at_buffer_position, face_for_overlay_string) + (face_at_string_position): Likewise. + * xfns.c (x_default_scroll_bar_color_parameter): Likewise. + * xselect.c (x_get_window_property, receive_incremental_selection) + (x_get_window_property_as_lisp_data, lisp_data_to_selection_data): + Likewise. + * xterm.c (x_draw_relief_rect, x_draw_box_rect): Likewise. + +2010-07-12 Dan Nicolaescu + + * callproc.c (child_setup): Remove subprocesses conditional. + Remove code dealing with SET_EMACS_PRIORITY, unused. + + * buffer.c (Fset_buffer_multibyte): Remove subprocesses conditional. + * process.c (close_process_descs): Use DOS_NT instead of WINDOWSNT. + + * emacs.c (__do_global_ctors, __do_global_ctors_aux) + (__do_global_dtors, __main): Use void in definition. + (main): Remove code dealing with SET_EMACS_PRIORITY, unused. + Remove SYMS_MACHINE code, unused. Remove SYMS_SYSTEM, inline + the only users from ... + * s/ms-w32.h (SYMS_SYSTEM): ... here and ... + * s/msdos.h (SYMS_SYSTEM): ... here. Remove. + (HAVE_VOLATILE): Remove, unused. + + Convert more function definitions to standard C. + * xdisp.c (window_box_edges, handle_single_display_spec) + (display_string): Convert definition to standard C. + * scroll.c (do_direct_scrolling, scrolling_1): + * dispnew.c (allocate_matrices_for_frame_redisplay) + (mirrored_line_dance): + * coding.c (code_convert_string): + * charset.c (map_charset_chars): + * ccl.c (Fccl_program_p, Fccl_execute, Fccl_execute_on_string) + (Fregister_ccl_program, Fregister_code_conversion_map): + * keyboard.c (kbd_buffer_nr_stored): Likewise. + (head_table): Make static and const. + +2010-07-12 Andreas Schwab + + * Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS) + (PROFILING_LDFLAGS): Set from substitution. + (ALL_CFLAGS): Add C_WARNINGS_SWITCH and PROFILING_CFLAGS, put + CFLAGS last. + +2010-07-12 Kenichi Handa + + * Makefile.in (lisp): Change hebrew.el to hebrew.elc. + (shortlisp): Likewise. + + * font.h (enum font_property_index): New member FONT_ENTITY_INDEX. + + * font.c (font_open_entity): Record ENTITY in FONT_OBJECT's slot + of FONT_ENTITY_INDEX. + (Ffont_get): If KEY is :otf and the font-object doesn't have the + property, get the property value dynamically. + (Ffont_put): Accept font-entity and font-object too. + (Ffont_get_glyhphs): Renamed from Fget_font_glyphs. Arguments and + return value changed. + (syms_of_font): Adjusted for the above change. + +2010-07-11 Andreas Schwab + + * blockinput.h: Remove obsolete comment. + + * lisp.h: Include . + (OFFSETOF): Don't define. + (VECSIZE): Use offsetof instead of OFFSETOF. + (PSEUDOVECSIZE): Likewise. + * process.c (conv_sockaddr_to_lisp): Likewise. + * alloc.c: Don't include . + * buffer.h (PER_BUFFER_VAR_OFFSET): Use offsetof. + + * process.c: Remove obsolete comment. + +2010-07-11 Chong Yidong + + * xfaces.c (Vface_remapping_alist): Doc fix (Bug#6091). + +2010-07-11 Andreas Schwab + + * callint.c (Fcall_interactively): Use strchr, strrchr instead of + index, rindex. + * doc.c (get_doc_string, Fsnarf_documentation): Likewise. + * editfns.c (Fuser_full_name, Fformat): Likewise. + * emacs.c (argmatch, sort_args, decode_env_path): Likewise. + * fileio.c (Ffile_symlink_p): Likewise. + * filelock.c (current_lock_owner): Likewise. + * font.c (font_parse_name, font_parse_family_registry): Likewise. + * fontset.c (fontset_pattern_regexp): Likewise. + * lread.c (read1): Likewise. + * sysdep.c (init_system_name): Likewise. + * xfns.c (select_visual): Likewise. + * s/hpux10-20.h (index, rindex): Don't define. + * s/ms-w32.h (index): Likewise. + * s/usg5-4.h: Likewise. + + * callproc.c (relocate_fd): Use F_DUPFD if defined. + + * alloc.c (pending_malloc_warning, malloc_warning): Add const. + * callproc.c (relocate_fd, getenv_internal_1, getenv_internal) + (egetenv): Likewise. + * doprnt.c (doprnt): Likewise. + * editfns.c (set_time_zone_rule, format2): Likewise. + * emacs.c (decode_env_path): Likewise. + * eval.c (signal_error, error): Likewise. + * insdel.c (replace_range_2): Likewise. + * keyboard.c (cmd_error_internal): Likewise. + * lread.c (isfloat_string, make_symbol, dir_warning): Likewise. + * print.c (write_string, write_string_1, print_error_message): + Likewise. + * vm-limit.c (warn_function, memory_warnings): Likewise. + * xdisp.c (message1, message1_nolog, message_with_string) + (vmessage, message, message_nolog): Likewise. + * emacs.c: Remove duplicate declaration. + * keyboard.h: Likewise. + * lisp.h: Update prototypes. + + * eval.c: Fix indentation problem. + + * keyboard.c: Include "process.h" + + * eval.c: Remove obsolete noinline declaration. + * fns.c: Likewise. + +2010-07-11 Ken Raeburn + + * doprnt.c (doprnt): Take a va_list argument instead of count and + pointer. + * eval.c (error): Change to a standard-C variadic function. + * xdisp.c (vmessage): Renamed from message, made static, and + changed to take a va_list argument. + (message): New variadic wrapper. + (message_nolog): Now a variadic function, calling vmessage. + * lisp.h: Include stdarg.h for va_list. + (doprnt, error, message, message_nolog): Decls updated. + +2010-07-11 Eli Zaretskii + + * process.c (syms_of_process) : Define + even if !subprocesses. + (delete_exited_processes): Ditto. + + * msdos.c (syms_of_msdos) : Remove DEFVAR. + (delete_exited_processes): Don't define. + 2010-07-10 Chong Yidong - * xfaces.c (realize_face): Garbage the frame if a face is removed - (Bug#6593). + * frame.c (make_frame): Initialize menu_bar_lines and + tool_bar_lines members. + (make_initial_frame, make_terminal_frame): Initialize + menu_bar_lines using value of menu-bar-mode. -2010-07-05 Andreas Schwab + * msdos.c (IT_set_frame_parameters): Don't set menu-bar-lines. - * keyboard.c: Remove duplicate . - (read_key_sequence): Remove volatile qualifiers. +2010-07-10 Eli Zaretskii -2010-07-05 YAMAMOTO Mitsuharu + * process.c: Reshuffle #include's. Condition some of the global + and static variables on `subprocesses'. + (hold_keyboard_input, unhold_keyboard_input, kbd_on_hold_p): + Leave only one implementation. + (Fget_buffer_process, Fprocess_inherit_coding_system_flag) + (kill_buffer_processes, Flist_system_processes) + (Fprocess_attributes, init_process, syms_of_process): Unify the + implementations for with subprocesses and without them. - * dispextern.h (FRINGE_HEIGHT_BITS): New define. - (struct glyph_row): New members left_fringe_offset and - right_fringe_offset. +2010-07-09 Jan Djärv + + * xmenu.c (set_frame_menubar): Must realize menubar_widget to get the + correct size for Motif. + (free_frame_menubar): Call x_set_window_size to update frame size. + + * xfns.c (x_window): Set borderWidth to 0 for pane and + EmacsFrame. Frame size calculation is wrong otherwise. + +2010-07-09 Michael Albinus + + * dbusbind.c (xd_initialize): Add new argument RAISE_ERROR, which + allows to suppress errors when polling in Emacs' main loop. + (Fdbus_init_bus, Fdbus_get_unique_name, Fdbus_call_method) + (Fdbus_call_method_asynchronously, Fdbus_method_return_internal) + (Fdbus_method_error_internal, Fdbus_send_signal) + (xd_get_dispatch_status, xd_read_message, Fdbus_register_signal) + (Fdbus_register_method): Use it. (Bug#6579) + +2010-07-08 Dan Nicolaescu + + * alloc.c: Convert DEFUNs to standard C. + * buffer.c: + * bytecode.c: + * callint.c: + * callproc.c: + * casefiddle.c: + * casetab.c: + * category.c: + * character.c: + * charset.c: + * chartab.c: + * cmds.c: + * coding.c: + * composite.c: + * data.c: + * dbusbind.c: + * dired.c: + * dispnew.c: + * doc.c: + * dosfns.c: + * editfns.c: + * emacs.c: + * eval.c: + * fileio.c: + * filelock.c: + * floatfns.c: + * fns.c: + * font.c: + * fontset.c: + * frame.c: + * fringe.c: + * image.c: + * indent.c: + * insdel.c: + * keyboard.c: + * keymap.c: + * lread.c: + * macros.c: + * marker.c: + * menu.c: + * minibuf.c: + * msdos.c: + * nsfns.m: + * nsmenu.m: + * nsselect.m: + * print.c: + * process.c: + * search.c: + * sound.c: + * syntax.c: + * term.c: + * terminal.c: + * textprop.c: + * undo.c: + * w16select.c: + * w32console.c: + * w32fns.c: + * w32font.c: + * w32menu.c: + * w32proc.c: + * w32select.c: + * window.c: + * xdisp.c: + * xfaces.c: + * xfns.c: + * xmenu.c: + * xselect.c: + * xsettings.c: + * xsmfns.c: Likewise. + + +2010-07-08 Eli Zaretskii + + * process.c (kbd_is_on_hold, hold_keyboard_input) + (unhold_keyboard_input, kbd_on_hold_p) [!subprocesses]: Define. + +2010-07-08 Jan Djärv + + * xmenu.c (set_frame_menubar, create_and_show_popup_menu) + (create_and_show_dialog): Don't call apply_systemfont_to_(menu|dialog) + unless USE_LUCID. + +2010-07-08 Dan Nicolaescu + + * xdisp.c (store_mode_line_noprop_char): Remove K&R alternative declaration. + + Clean up include guards. + * tparam.c: Remove include guards for config.h, string.h and code + that assumes #ifndef emacs. + * termcap.c: + * unexalpha.c: + * sysdep.c: + * filemode.c: + * filelock.c: + * bidi.c: Likewise. + + Remove prefix-args.c + * prefix-args.c: Remove file. + * autodeps.mk (ALLOBJS): Remove reference to prefix-args. + * Makefile.in (temacs${EXEEXT}): Remove references to + PRE_EDIT_LDFLAGS and POST_EDIT_LDFLAGS. + (mostlyclean): Remove reference to prefix-args. + (prefix-args): Remove. + + Simplify cstart_of_data, start_of_code and related code. + * mem-limits.h: Remove !emacs and _LIBC conditional code. + (start_of_data): Merge into start_of_data function. + * sysdep.c (start_of_text): Remove. Move simplified versions of + it in the only users: unexaix.c and unexec.c. + (read_input_waiting): Remove local declaration of quit_char. + (start, etext): Remove declarations. + (start_of_data): Merge with the version in mem-limits.h and move + to vm-limits.c. + * vm-limit.c (start_of_data): Merged and simplified version of the + code formerly in mem-limits.h and sysdep.c. + * unexec.c (start): New declaration, moved from sysdep.c. + (start_of_text): Simplified version of the code formerly in sysdep.c. + * unexaix.c (start_of_text): Simplified version of the code + formerly in sysdep.c. + * m/alpha.h (HAVE_TEXT_START): Remove. + (TEXT_START): Move ... + * unexalpha.c (TEXT_START): ... here. + * s/hpux10-20.h (TEXT_START): Remove. + * s/darwin.h (TEXT_START): + * m/mips.h (TEXT_START): + * m/macppc.h (HAVE_TEXT_START): + * m/m68k.h (TEXT_START): + * m/iris4d.h (TEXT_START): + * m/intel386.h (TEXT_START): + * m/ibmrs6000.h (TEXT_START): + * m/ia64.h (HAVE_TEXT_START): + * s/msdos.h (TEXT_START): Likewise. + +2010-07-07 Andreas Schwab + + * alloc.c (overrun_check_malloc, overrun_check_realloc) + (overrun_check_free, xstrdup, allocate_string) + (allocate_string_data, compact_small_strings, Fmake_string) + (make_unibyte_string, make_multibyte_string) + (make_string_from_bytes, make_specified_string, make_float) + (Fcons, allocate_terminal, allocate_frame, make_pure_string) + (Fgarbage_collect): Replace bcopy, safe_bcopy, bzero, bcmp by + memcpy, memmove, memset, memcmp. + * atimer.c (start_atimer, set_alarm): Likewise. + * buffer.c (clone_per_buffer_values, report_overlay_modification) + (mmap_realloc, init_buffer_once): Likewise. + * callint.c (Fcall_interactively): Likewise. + * callproc.c (Fcall_process, Fcall_process_region, child_setup) + (getenv_internal_1): Likewise. + * casefiddle.c (casify_object): Likewise. + * ccl.c (ccl_driver): Likewise. + * character.c (str_as_multibyte, str_to_multibyte): Likewise. + * charset.c (load_charset_map_from_file) + (load_charset_map_from_file, load_charset_map_from_vector) + (Fdefine_charset_internal): Likewise. + * cm.c (Wcm_clear): Likewise. + * coding.c (decode_eol, decode_coding_object) + (Fset_coding_system_priority, make_subsidiaries): Likewise. + * data.c (Faset): Likewise. + * dired.c (directory_files_internal, file_name_completion_stat): + Likewise. + * dispnew.c (new_glyph_matrix, adjust_glyph_matrix) + (clear_glyph_row, copy_row_except_pointers) + (copy_glyph_row_contents, new_glyph_pool, realloc_glyph_pool) + (save_current_matrix, restore_current_matrix) + (build_frame_matrix_from_leaf_window, mirrored_line_dance) + (mirror_line_dance, scrolling_window): Likewise. + * doc.c (Fsnarf_documentation, Fsubstitute_command_keys): + Likewise. + * doprnt.c (doprnt): Likewise. + * editfns.c (Fuser_full_name, make_buffer_string_both) + (Fmessage_box, Fformat, Ftranspose_regions): Likewise. + * emacs.c (sort_args): Likewise. + * eval.c (Fapply, Ffuncall): Likewise. + * fileio.c (Ffile_name_directory, make_temp_name) + (Fexpand_file_name, search_embedded_absfilename) + (Fsubstitute_in_file_name, Ffile_symlink_p, Finsert_file_contents) + (auto_save_error): Likewise. + * fns.c (Fstring_equal, Fcopy_sequence, concat) + (string_to_multibyte, Fstring_as_unibyte, Fstring_as_multibyte) + (internal_equal, Fclear_string, larger_vector, copy_hash_table) + (Fmake_hash_table): Likewise. + * fringe.c (Fdefine_fringe_bitmap): Likewise. + * ftfont.c (ftfont_text_extents): Likewise. + * getloadavg.c (getloadavg): Likewise. + * image.c (define_image_type, make_image, make_image_cache) + (x_create_x_image_and_pixmap, xbm_image_p) + (w32_create_pixmap_from_bitmap_data, xbm_load, xpm_lookup_color) + (xpm_image_p, x_create_bitmap_from_xpm_data, xpm_load) + (init_color_table, x_build_heuristic_mask, pbm_image_p, pbm_load) + (png_image_p, png_read_from_memory, png_load, jpeg_image_p) + (tiff_image_p, tiff_read_from_memory, gif_image_p) + (gif_read_from_memory, gif_load, svg_image_p, gs_image_p): + Likewise. + * indent.c (scan_for_column, compute_motion): Likewise. + * insdel.c (gap_left, gap_right, make_gap_smaller, copy_text) + (insert_1_both, insert_from_gap, replace_range_2): Likewise. + * intervals.c (reproduce_tree, reproduce_tree_obj): Likewise. + * keyboard.c (echo_char, save_getcjmp, restore_getcjmp) + (kbd_buffer_store_event_hold, apply_modifiers_uncached) + (store_user_signal_events, menu_bar_items, tool_bar_items) + (process_tool_bar_item, append_tool_bar_item) + (read_char_minibuf_menu_prompt, read_key_sequence) + (Fread_key_sequence, Fread_key_sequence_vector, Frecent_keys): + Likewise. + * keymap.c (current_minor_maps, Fdescribe_buffer_bindings): + Likewise. + * lisp.h (STRING_COPYIN): Likewise. + * lread.c (Fload, read1, oblookup): Likewise. + * msdos.c (Frecent_doskeys): Likewise. + * nsfns.m (Fx_create_frame): Likewise. + * nsfont.m (nsfont_open, nsfont_text_extents, ns_glyph_metrics): + Likewise. + * nsimage.m (EmacsImage-initFromSkipXBM:width:height:) + (EmacsImage-initForXPMWithDepth:width:height:flip:length:): + Likewise. + * nsmenu.m (ns_update_menubar): Likewise. + * nsterm.m (ns_draw_fringe_bitmap, ns_term_init): Likewise. + * print.c (print_unwind, printchar, strout, print_string) + (print_error_message): Likewise. + * process.c (conv_lisp_to_sockaddr, set_socket_option) + (Fmake_network_process, Fnetwork_interface_list) + (Fnetwork_interface_info, read_process_output, Fprocess_send_eof) + (init_process): Likewise. + * ralloc.c (resize_bloc, r_alloc_sbrk, r_alloc_init): Likewise. + * regex.c (init_syntax_once, regex_compile, re_compile_fastmap): + Likewise. + * scroll.c (do_scrolling, do_direct_scrolling) + (scrolling_max_lines_saved): Likewise. + * search.c (search_buffer, wordify, Freplace_match): Likewise. + * sound.c (wav_init, au_init, Fplay_sound_internal): Likewise. + * syntax.c (skip_chars, skip_syntaxes): Likewise. + * sysdep.c (child_setup_tty, sys_subshell, emacs_get_tty) + (emacs_set_tty): Likewise. + * term.c (encode_terminal_code, calculate_costs) + (produce_special_glyphs, create_tty_output, init_tty, delete_tty): + Likewise. + * termcap.c (tgetst1, gobble_line): Likewise. + * termhooks.h (EVENT_INIT): Likewise. + * tparam.c (tparam1): Likewise. + * unexalpha.c (unexec): Likewise. + * unexec.c (write_segment): Likewise. + * unexmacosx.c (unexec_write_zero): Likewise. + * w32fns.c (w32_wnd_proc, Fx_create_frame, x_create_tip_frame) + (Fx_file_dialog, Fsystem_move_file_to_trash): Likewise. + * w32font.c (w32font_list_family, w32font_text_extents) + (w32font_list_internal, w32font_match_internal) + (w32font_open_internal, compute_metrics, Fx_select_font): + Likewise. + * w32menu.c (set_frame_menubar, add_menu_item) + (w32_menu_display_help, w32_free_submenu_strings): Likewise. + * w32term.c (XCreateGC, w32_initialize_display_info): Likewise. + * w32uniscribe.c (uniscribe_list_family): Likewise. + * w32xfns.c (get_next_msg, post_msg, prepend_msg): Likewise. + * window.c (make_window, replace_window, set_window_buffer) + (Fsplit_window): Likewise. + * xdisp.c (init_iterator, RECORD_OVERLAY_STRING, reseat_to_string) + (add_to_log, message3, x_consider_frame_title) + (append_space_for_newline, extend_face_to_end_of_line) + (decode_mode_spec_coding, init_glyph_string): Likewise. + * xfaces.c (x_create_gc, get_lface_attributes_no_remap) + (Finternal_copy_lisp_face, Finternal_merge_in_global_face) + (face_attr_equal_p, make_realized_face, make_face_cache) + (free_realized_faces, lookup_named_face, smaller_face) + (face_with_height, lookup_derived_face) + (x_supports_face_attributes_p, Finternal_set_font_selection_order) + (Finternal_set_font_selection_order, realize_default_face) + (compute_char_face, face_at_buffer_position) + (face_for_overlay_string, face_at_string_position, merge_faces): + Likewise. + * xfns.c (xic_create_fontsetname, Fx_create_frame) + (Fx_window_property, x_create_tip_frame) + (Fx_backspace_delete_keys_p): Likewise. + * xfont.c (xfont_list, xfont_match, xfont_list_family) + (xfont_text_extents): Likewise. + * xmenu.c (set_frame_menubar, xmenu_show): Likewise. + * xrdb.c (magic_file_p, x_get_resource): Likewise. + * xselect.c (x_queue_event, x_get_window_property) + (receive_incremental_selection): Likewise. + * xsmfns.c (x_session_check_input): Likewise. + * xterm.c (x_send_scroll_bar_event, SET_SAVED_MENU_EVENT) + (handle_one_xevent, x_check_errors, xim_initialize, x_term_init): + Likewise. + * character.h (BCOPY_SHORT): Removed. + * config.in: Regenerate. + * dispnew.c (safe_bcopy): Only define as dummy if PROFILING. + * emacs.c (main) [PROFILING]: Don't declare + dump_opcode_frequencies. + * lisp.h (safe_bcopy): Remove declaration. + (memset) [!HAVE_MEMSET]: Declare. + (memcpy) [!HAVE_MEMCPY]: Likewise. + (memmove) [!HAVE_MEMMOVE]: Likewise. + (memcmp) [!HAVE_MEMCMP]: Likewise. + * s/ms-w32.h (bzero, bcopy, bcmp, GAP_USE_BCOPY) + (BCOPY_UPWARD_SAFE, BCOPY_DOWNWARD_SAFE, HAVE_BCOPY, HAVE_BCMP): + Don't define. + (HAVE_MEMCMP, HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET): Define. + * s/msdos.h (GAP_USE_BCOPY, BCOPY_UPWARD_SAFE) + (BCOPY_DOWNWARD_SAFE): Don't define. + * sysdep.c (memset) [!HAVE_MEMSET]: Define. + (memcpy) [!HAVE_MEMCPY]: Define. + (memmove) [!HAVE_MEMMOVE]: Define. + (memcmp) [!HAVE_MEMCMP]: Define. + +2010-07-07 Jan Djärv + + * process.c (kbd_is_on_hold): New variable. + (hold_keyboard_input, unhold_keyboard_input, kbd_on_hold_p): New + functions. + (wait_reading_process_output): If kbd_on_hold_p returns non-zero, + select on empty input mask. + (init_process): Initialize kbd_is_on_hold to 0. + + * process.h (hold_keyboard_input, unhold_keyboard_input) + (kbd_on_hold_p): Declare. + + * keyboard.c (input_available_signal): Declare. + (kbd_buffer_nr_stored): New function. + (kbd_buffer_store_event_hold): If kbd_buffer_nr_stored returns + more than KBD_BUFFER_SIZE/2, stop reding input (Bug#6571). + (kbd_buffer_get_event): If input is suspended and kbd_buffer_nr_stored + returns less than KBD_BUFFER_SIZE/4, resume reding input (Bug#6571). + (tty_read_avail_input): If input is on hold, return. + Don't read more that free slots in kbd_buffer (Bug#6571). + +2010-07-07 Eli Zaretskii + + * msdos.h: + * msdos.c: + * dosfns.c: + * w16select.c: Convert function definitions to ANSI C. + + * msdos.h (ctrl_break_func, install_ctrl_break_check): Remove + unused prototypes. + +2010-07-07 Juanma Barranquero + + * coding.c, sysdep.c: Convert some more functions to standard C. + +2010-07-07 Juanma Barranquero + + * coding.c (decode_coding_gap, encode_coding_gap, decode_coding_object) + (encode_coding_object): Use SPECPDL_INDEX. + (syms_of_coding): Use DOS_NT. + +2010-07-07 Dan Nicolaescu + + * intervals.h (interval): Use EMACS_UINT instead of unsigned EMACS_INT. + + Make the function member of Lisp_Subr use standard C prototypes. + * lisp.h (struct Lisp_Subr): Use a union for the function member. + (DECL_ALIGN): Add a cast for the function. + * eval.c (Feval, Ffuncall): Use the proper type for each type + function call. + +2010-07-06 Chong Yidong + + * fringe.c (draw_fringe_bitmap_1): Use lookup_named_face to get + fringe face id, so face-remapping-alist works (Bug#6091). + +2010-07-06 Juanma Barranquero + + * w32.c, w32console.c, w32fns.c, w32font.c, w32heap.c, w32inevt.c + * w32menu.c, w32proc.c, w32reg.c, w32select.c, w32term.c + * w32uniscribe.c, w32xfns.c: Convert function definitions to standard C. + +2010-07-06 Andreas Schwab + + * xterm.c (x_get_keysym_name): Change type of parameter to int. + * lisp.h: Declare x_get_keysym_name. + * keyboard.c (modify_event_symbol): Don't declare + x_get_keysym_name here. + +2010-07-06 Dan Nicolaescu + + * ecrt0.c: Revert conversion to standard C. + +2010-07-05 Dan Nicolaescu + + * vm-limit.c (memory_warnings): + * keyboard.c (modify_event_symbol): + * floatfns.c (rounding_driver, ceiling2, floor2, truncate2) + (round2, emacs_rint): + * process.c (send_process, old_sigpipe): Convert function + definitions and declarations to standard C. + +2010-07-05 Juanma Barranquero + + * buffer.c, cm.c, eval.c, keyboard.c, process.c, term.c, vm-limit.c, + * xdisp.c: Convert function definitions to standard C. + + * cm.c (cmputc): Arg C is now int, not char. + * process.c (Fmake_network_process): Cast sockaddr_in* to sockaddr*. + +2010-07-05 James Cloos + + * xterm.h (Xatom_net_wm_name, Xatom_net_wm_icon_name): New. + + * xterm.c (x_term_init): Intern the _NET_WM_NAME and + _NET_WM_ICON_NAME atoms. + + * xfns.c (x_set_name_internal): Set the EWMH _NET_WM_NAME + and _NET_WM_ICON_NAME properties, too, matching what is + done in the Gtk+ case. + +2010-07-05 Jan Djärv + + * xterm.c (XTring_bell, XTset_terminal_window): Fix wrong prototype. + + * xsmfns.c (SSDATA): New macro. + (smc_save_yourself_CB, x_session_initialize): Use SSDATA for strings + passed to strlen/strcpy/strcat. + (create_client_leader_window): Surround with #ifndef USE_GTK. Cast + 7:th arg to XChangeProperty to (unsigned char *) + + * xsettings.c (something_changedCB, parse_settings) + (apply_xft_settings): Reformat prototype. + (something_changedCB, init_gconf): Remove unused variable i. + (read_settings): Remove unused variable long_len. + + * gtkutil.c (xg_get_pixbuf_from_pix_and_mask) + (xg_get_image_for_pixmap, create_dialog) + (xg_get_file_with_selection, xg_get_file_name, update_cl_data) + (menuitem_highlight_callback, make_menu_item) + (xg_create_one_menuitem, create_menus, xg_update_menu_item) + (xg_create_scroll_bar, xg_update_scrollbar_pos) + (xg_set_toolkit_scroll_bar_thumb, xg_tool_bar_button_cb) + (xg_tool_bar_proxy_help_callback, xg_tool_bar_detach_callback) + (xg_tool_bar_attach_callback, xg_tool_bar_help_callback) + (xg_tool_bar_item_expose_callback): Reformat prototype. + (xg_update_menubar): GList *group => GSList *group. + (xg_modify_menubar_widgets): Initialize witem to 0, check witem != 0 + before use. + (update_frame_tool_bar): 4:th param to xg_get_image_for_pixmap changed + to GTK_IMAGE (wimage). + +2010-07-05 Dan Nicolaescu + + * atimer.c: Use "" instead of <> for local includes for + consistency with the rest of the code. + + * xsmfns.c (smc_save_yourself_CB, smc_error_handler): + * xrdb.c (get_system_name): + * window.c (shrink_windows): + * syntax.c (forw_comment): + * scroll.c (calculate_scrolling, calculate_direct_scrolling) + (ins_del_costs): + * mem-limits.h (start_of_data): + * lread.c (readevalloop): + * gtkutil.c (xg_dialog_response_cb, xg_get_file_with_chooser) + (xg_get_file_with_selection, xg_update_menubar, xg_update_submenu): + * frame.c (x_get_focus_frame): + * floatfns.c (fmod_float): + * fileio.c (choose_write_coding_system): + * emacs.c (fatal_error_signal, init_cmdargs, argmatch) + (malloc_initialize_hook, sort_args, synchronize_locale): + * doprnt.c (doprnt): + * dired.c (compile_pattern): + * data.c (fmod_float): + * chartab.c (map_sub_char_table, map_sub_char_table_for_charset) + (map_char_table_for_charset): + * charset.c (define_charset_internal): + * alloc.c (Fgarbage_collect): Convert declarations or definitions + to standard C. + +2010-07-04 Tetsurou Okazaki (tiny change) + Stefan Monnier + + * lread.c (read1): Fix up last change to not mess up `c'. + +2010-07-04 Juanma Barranquero + + * strftime.c: Revert conversion to standard C (2010-07-04T07:50:25Z!dann@ics.uci.edu). + +2010-07-04 Juanma Barranquero + + Fix prototypes. + + * atimer.c (start_atimer): Use EMACS_TIME, not struct timeval. + * dired.c (file_name_completion_stat): Use DIRENTRY, not struct dirent. + * fileio.c (read_non_regular, read_non_regular_quit): Add Lisp_Object + arg, as required by internal_condition_case_1. + * print.c (strout): Use const char* for arg PTR. + * regex.c (bcmp_translate): Use RE_TRANSLATE_TYPE, not Lisp_Object. + (analyse_first): Fix "const const". + * sysdep.c (set_file_times): Use EMACS_TIME, not struct timeval. + * unexelf.c (round_up, find_section): Use ElfW macro for arguments. + * xgselect.c (xg_select): Use SELECT_TYPE, EMACS_TIME. + +2010-07-04 Dan Nicolaescu + + * alloc.c: Convert function definitions to standard C. + * atimer.c: + * bidi.c: + * bytecode.c: + * callint.c: + * callproc.c: + * casefiddle.c: + * casetab.c: + * category.c: + * ccl.c: + * character.c: + * charset.c: + * chartab.c: + * cmds.c: + * coding.c: + * composite.c: + * data.c: + * dbusbind.c: + * dired.c: + * dispnew.c: + * doc.c: + * doprnt.c: + * ecrt0.c: + * editfns.c: + * fileio.c: + * filelock.c: + * filemode.c: + * fns.c: + * font.c: + * fontset.c: + * frame.c: + * fringe.c: + * ftfont.c: + * ftxfont.c: + * gtkutil.c: + * indent.c: + * insdel.c: + * intervals.c: + * keymap.c: + * lread.c: + * macros.c: + * marker.c: + * md5.c: + * menu.c: + * minibuf.c: + * prefix-args.c: + * print.c: + * ralloc.c: + * regex.c: + * region-cache.c: + * scroll.c: + * search.c: + * sound.c: + * strftime.c: + * syntax.c: + * sysdep.c: + * termcap.c: + * terminal.c: + * terminfo.c: + * textprop.c: + * tparam.c: + * undo.c: + * unexelf.c: + * window.c: + * xfaces.c: + * xfns.c: + * xfont.c: + * xftfont.c: + * xgselect.c: + * xmenu.c: + * xrdb.c: + * xselect.c: + * xsettings.c: + * xsmfns.c: + * xterm.c: Likewise. + +2010-07-03 Eli Zaretskii + + * msdos.c (IT_set_frame_parameters): Fix setting of colors in + frames other than the initial one. Fix reversal of colors when + `reverse' is specified in the frame parameters. Call + update_face_from_frame_parameter instead of + internal-set-lisp-face-attribute. Initialize screen colors from + initial_screen_colors[] when f->default_face_done_p is zero, + instead of depending on being called with default-frame-alist as + the alist argument. + + * xfaces.c (update_face_from_frame_parameter): Move out of + HAVE_WINDOW_SYSTEM portion. Condition window-system only parts + with HAVE_WINDOW_SYSTEM. + + * msdos.c (IT_set_frame_parameters): Set menu-bar-lines according + to menu-bar-mode, if not set in the frame parameters or in + default-frame-alist. + + * w32console.c (sys_tputs): Adjust argument list to prototype in + term.c. + +2010-07-03 Juanma Barranquero + + * lisp.h (memory_warnings): Fix prototype. + + * cm.h (evalcost): Fix prototype. + + * cm.c (evalcost): Fix arg type. + +2010-07-02 Dan Nicolaescu + + * term.c (term_clear_mouse_face, Fidentity): + * syssignal.h (signal_handler_t): + * lisp.h (memory_warnings): + * coding.h (preferred_coding_system): + * cm.h (evalcost): + * blockinput.h (reinvoke_input_signal): Convert to standard C prototypes. + +2010-07-02 Eli Zaretskii + + * dosfns.h (msdos_stdcolor_idx, msdos_stdcolor_name): Remove P_ + from prototypes. + + * msdos.h (load_pixmap): Don't define away. + +2010-07-02 Jan Djärv + + * lisp.h: + * atimer.h: Remove define for P_. + + * alloc.c: Remove __P and P_ from .c and .m files. + * atimer.c: + * buffer.c: + * callint.c: + * category.c: + * charset.c: + * chartab.c: + * cm.c: + * coding.c: + * composite.c: + * data.c: + * dired.c: + * dispnew.c: + * doc.c: + * editfns.c: + * emacs.c: + * eval.c: + * fileio.c: + * filelock.c: + * fns.c: + * font.c: + * fontset.c: + * frame.c: + * ftfont.c: + * ftxfont.c: + * gmalloc.c: + * gtkutil.c: + * image.c: + * indent.c: + * intervals.c: + * keyboard.c: + * keymap.c: + * lread.c: + * marker.c: + * menu.c: + * minibuf.c: + * print.c: + * process.c: + * scroll.c: + * search.c: + * sound.c: + * strftime.c: + * syntax.c: + * sysdep.c: + * term.c: + * terminal.c: + * textprop.c: + * unexalpha.c: + * w32console.c: + * w32fns.c: + * w32font.c: + * w32menu.c: + * w32term.c: + * w32uniscribe.c: + * window.c: + * xdisp.c: + * xfaces.c: + * xfns.c: + * xfont.c: + * xftfont.c: + * xmenu.c: + * xselect.c: + * xterm.c: Likewise. + + Remove P_ and __P macros. + * atimer.h: Remove P_ and __P macros. + * buffer.h: + * category.h: + * ccl.h: + * character.h: + * charset.h: + * cm.h: + * coding.h: + * composite.h: + * dispextern.h: + * disptab.h: + * dosfns.h: + * font.h: + * fontset.h: + * frame.h: + * gtkutil.h: + * indent.h: + * intervals.h: + * keyboard.h: + * keymap.h: + * lisp.h: + * macros.h: + * md5.h: + * menu.h: + * msdos.h: + * nsterm.h: + * puresize.h: + * region-cache.h: + * syntax.h: + * syssignal.h: + * systime.h: + * termhooks.h: + * w32font.h: + * w32term.h: + * widget.h: + * window.h: + * xgselect.h: + * xsettings.h: + * xterm.h: Likewise. + +2010-07-02 Dan Nicolaescu + + * lisp.h: Document that USE_LISP_UNION_TYPE is now enabled using autoconf. + + Cleanup old code. + * dired.c (BSD4_3): Remove all uses, redundant with BSD4_2. + * syssignal.h: Remove code for Lynx, not supported anymore. + * vm-limit.c: Remove unused code the depends on emacs not being + defined and NO_LIM_DATA being defined. + * mem-limits.h: Remove dead code. + +2010-07-01 Jan Djärv + + * window.c (Fwindow_absolute_pixel_edges): Doc fix. + + * window.c (calc_absolute_offset, Fwindow_absolute_pixel_edges) + (Fwindow_inside_absolute_pixel_edges): New functions (bug#5721). + + * nsfns.m (compute_tip_xy): Do not convert coordinates from frame + parameters, they are already absolute. + + * nsterm.m (x_set_window_size, initFrameFromEmacs): Renamed + FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT. + + * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGH + + * nsmenu.m (update_frame_tool_bar, free_frame_tool_bar): Update + FRAME_TOOLBAR_HEIGHT. + + * nsmenu.m (free_frame_tool_bar, update_frame_tool_bar): Add + BLOCK/UNBLOCK_INPUT so asserts don't trigger. + +2010-06-30 Chong Yidong + + * frame.c (get_future_frame_param, Fmake_terminal_frame): Don't + check default-frame-alist. + +2010-06-30 Andreas Schwab + + * process.c (create_process): Avoid using invalid file descriptors. + + * callproc.c (child_setup): Avoid closing a file descriptor twice. + +2010-06-30 Jan Djärv + + * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font): + Improve documentation. Return font regardless of use_system_font. + (syms_of_xsettings): Improve documentation for font-use-system-font. + +2010-07-10 Chong Yidong + + * xfaces.c (realize_face): Garbage the frame if a face is removed + (Bug#6593). + +2010-07-05 Andreas Schwab + + * keyboard.c: Remove duplicate . + (read_key_sequence): Remove volatile qualifiers. + +2010-07-05 YAMAMOTO Mitsuharu + + * dispextern.h (FRINGE_HEIGHT_BITS): New define. + (struct glyph_row): New members left_fringe_offset and + right_fringe_offset. + + * xterm.c (x_draw_fringe_bitmap): Don't clip bottom aligned bitmap + specially. + * w32term.c (w32_draw_fringe_bitmap): Likewise. + * nsterm.m (ns_draw_fringe_bitmap): Likewise. + + * fringe.c (draw_fringe_bitmap_1): Don't clip bitmap here. + Take account of bitmap offset. + (draw_window_fringes): Take account of window vscroll. + (update_window_fringes): Likewise. Extend top-aligned top indicator + or bottom-aligned bottom indicator to adjacent rows if it doesn't fit + in one row. Don't set redraw_fringe_bitmaps_p outside row comparison. + Set left_fringe_offset and right_fringe_offset (Bug#5634, Bug#6325). + +2010-07-04 Juanma Barranquero + + * w32fns.c (Qtooltip): Declare. + Suggested by Andy Moreton . + +2010-07-03 Jan Djärv + + * xmenu.c (x_activate_menubar): Send Press/Release for Gtk+ to avoid + grab on just Press (Bug#6499). + +2010-07-02 Chong Yidong + + * frame.c (Qtooltip): New var. + (delete_frame): Use it. Fix faulty if statement. Don't update + mode line for tooltip frames. Suggested by Martin Rudalics. + + * xfns.c (x_create_tip_frame): + * w32fns.c (x_create_tip_frame): Use it. + +2010-06-17 Naohiro Aota (tiny change) + + * xftfont.c (xftfont_open): Check font width one by one also when + spacing is dual. + + * ftfont.c (ftfont_open): Ditto. + +2010-06-30 Glenn Morris + + * s/sol2-6.h (INHIBIT_X11R6_XIM): Remove, handled by configure now. + + * Makefile.in (CANNOT_DUMP): Update for configure name change. + + * s/freebsd.h (USE_MMAP_FOR_BUFFERS): + * s/irix6-5.h (USE_MMAP_FOR_BUFFERS): + * s/darwin.h (SYSTEM_MALLOC): + * s/sol2-10.h (SYSTEM_MALLOC): Move to configure. + +2010-06-29 Jan Djärv + + * nsfns.m: extern declare Vmenu_bar_mode, Vtool_bar_mode. + (ns_get_screen): Don't assign integer to f. + (Fx_display_color_cells): Declarations before statements. + +2010-06-28 Jan Djärv + + * xfns.c (x_default_font_parameter): Remove got_from_system + (Bug#6526). + + * xterm.h (gtk_widget_get_window, gtk_widget_get_mapped) + (gtk_adjustment_get_page_size, gtk_adjustment_get_upper): New + defines based on what configure finds. + + * xterm.c (XTflash): Use gtk_widget_get_window. + (xg_scroll_callback): Use gtk_adjustment_get_upper and + gtk_adjustment_get_page_size. + (handle_one_xevent): Use gtk_widget_get_mapped. + (x_term_init): Remove HAVE_GTK_MULTIDISPLAY and associated error + messages. + + * xmenu.c (create_and_show_popup_menu): Call gtk_widget_get_mapped. + + * gtkutil.h: Replace HAVE_GTK_FILE_BOTH with + HAVE_GTK_FILE_SELECTION_NEW. + + * gtkutil.c (xg_display_open, xg_display_close): Remove + HAVE_GTK_MULTIDISPLAY, it is always defined. + (xg_display_open): Return type is void. + (gtk_widget_set_has_window) + (gtk_dialog_get_action_area, gtk_dialog_get_content_area) + (gtk_widget_get_sensitive, gtk_adjustment_set_page_size) + (gtk_adjustment_set_page_increment) + (gtk_adjustment_get_step_increment): #define these if not found + by configure. + (remove_submenu): New define based on Gtk+ version. + (xg_set_cursor, xg_frame_resized, xg_event_is_for_scrollbar): Use + gtk_widget_get_window. + (xg_frame_resized, xg_update_frame_menubar): Use gtk_widget_get_mapped. + (xg_create_frame_widgets): Use gtk_widget_set_has_window. + (create_dialog): Use gtk_dialog_get_action_area and + gtk_dialog_get_content_area. + (xg_uses_old_file_dialog, xg_get_file_name): Remove HAVE_GTK_FILE_BOTH + and HAVE_GTK_FILE_CHOOSER_DIALOG_NEW. File chooser is always + available, so checking for HAVE_GTK_FILE_SELECTION_NEW is enough. + (xg_update_menubar, xg_update_submenu, xg_show_toolbar_item): Use + g_object_ref and g_object_unref. + (xg_update_menu_item, xg_tool_bar_menu_proxy): Use + gtk_widget_get_sensitive. + (xg_update_submenu): Use remove_submenu. + (xg_update_scrollbar_pos): Don't use GtkFixedChild, use child + properties instead to get old x and y position. + (xg_set_toolkit_scroll_bar_thumb): Use gtk_adjustment_get_page_size, + gtk_adjustment_get_step_increment, gtk_adjustment_set_page_size, + gtk_adjustment_set_step_increment and gtk_adjustment_set_page_increment. + (xg_get_tool_bar_widgets): New function. + (xg_tool_bar_menu_proxy, xg_show_toolbar_item) + (update_frame_tool_bar): Call xg_get_tool_bar_widgets. + (toolbar_set_orientation): New #define based on if configure + finds gtk_orientable_set_orientation. + (xg_create_tool_bar): Call toolbar_set_orientation. + (xg_make_tool_item, xg_show_toolbar_item): Call gtk_box_pack_start + instead of gtk_box_pack_start_defaults. + +2010-06-28 Chong Yidong + + * cmds.c (Fdelete_backward_char): Move into Lisp. + +2010-06-27 Dan Nicolaescu + + * s/freebsd.h (BSD4_2): Remove redundant definition. + bsd-common.h defines it already. + +2010-06-27 Chong Yidong + + * xfns.c (Fx_create_frame): Don't consult X resouces when setting + menu-bar-lines and tool-bar-lines. Use menu-bar-mode and + tool-bar-mode, which are now set using these X resources at + startup, to determine the defaults (Bug#2249). + + * w32fns.c (Fx_create_frame): + * nsfns.m (Fx_create_frame): Likewise. + + * frame.c (Vmenu_bar_mode, Vtool_bar_mode): New vars. + +2010-06-24 Juanma Barranquero + + * gtkutil.c (xg_update_scrollbar_pos): + Avoid C99 mid-block variable declaration. + +2010-06-22 Jan Djärv + + * xterm.c (x_scroll_bar_create): Remove call to xg_show_scroll_bar. + + * gtkutil.h (xg_show_scroll_bar): Remove. + + * gtkutil.c (xg_update_scrollbar_pos): Show/hide scroll bar as needed + if height is less than scroll bar min size. + (xg_show_scroll_bar): Remove, show moved to xg_update_scrollbar_pos. + + * xfns.c (x_default_font_parameter): Try to open font from system + before using it (bug#6478). Rename got_from_gconf to got_from_system. + +2010-06-22 Keith Packard (tiny change) + + * font.c (font_parse_fcname): Allow . for sizes like 7.5 (bug#6437). + +2010-06-20 Eli Zaretskii + + * xdisp.c (try_scrolling): When scroll-conservatively is set to + most-positive-fixnum, be extra accurate when scrolling window + start, to avoid missing the cursor line. + +2010-06-19 Eli Zaretskii + + * xdisp.c (try_scrolling): Compute the limit for searching point + in forward scroll from scroll_max, instead of an arbitrary limit + of 10 screen lines. See + http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00766.html + and + http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00773.html + for details. + +2010-06-16 Glenn Morris + + * editfns.c (Fbyte_to_string): Pacify compiler. + +2010-06-16 Stefan Monnier + + * lread.c (read1): Phase out old-style backquotes a bit more. + +2010-06-12 Eli Zaretskii + + * makefile.w32-in ($(BLD)/bidi.$(O)): Depend on biditype.h and + bidimirror.h. + + * deps.mk (bidi.o): Depend on biditype.h and bidimirror.h. + + * bidi.c (bidi_initialize): Remove explicit initialization of + bidi_type_table; include biditype.h instead. Don't support + entries whose second codepoint is zero. Initialize bidi_mirror_table. + (bidi_mirror_char): Use bidi_mirror_table. + + * biditype.h: New file. + + * bidimirror.h: New file. + + * window.c (syms_of_window): Doc fix (bug#6409). + +2010-06-12 Romain Francoise + + * Makefile.in (lisp, shortlisp): Use new location of vc-hooks and + ediff-hook. + +2010-06-10 Glenn Morris + + * editfns.c (Fbyte_to_string): Pacify compiler. + + * m/ibms390x.h: Rather than duplicating ibms390.h, just include it. + +2010-06-26 Andreas Schwab + + * alloc.c (Fmake_byte_code): Don't access undefined argument + (Bug#6517). + +2010-06-25 Chong Yidong + + * xdisp.c (next_element_from_image): Ensure that after-strings are + read the next time we hit handle_stop (Bug#1336). + +2010-06-23 Andreas Schwab + + * lread.c (read1): Signal error if #s is not followed by paren. + +2010-06-19 Chong Yidong + + * image.c (free_image): Mark frame as garbaged (Bug#6426). + + * keymap.c (Fdefine_key): Doc fix (Bug#6460). + +2010-06-15 Glenn Morris + + * editfns.c (Fbyte_to_string): Pacify compiler. + +2010-06-09 Stefan Monnier + + * dbusbind.c (xd_append_arg): Don't "make-unibyte" the string. + Check `object's type before accessing its guts. + +2010-06-09 Dan Nicolaescu + + * s/usg5-4.h: Fix previous change. + Suggested by Lawrence Mitchell + +2010-06-08 Andreas Schwab + + * minibuf.c (Fall_completions): Add more checks. + +2010-06-08 Juanma Barranquero + + * minibuf.c (Fall_completions): Check COLLECTION's size (bug#6378). + +2010-06-08 Dan Nicolaescu + + * lread.c (X_OK): Remove, unused. + + * dispnew.c: Remove obsolete comment. + + Remove INCLUDED_FCNTL. + * xterm.c (INCLUDED_FCNTL): + * callproc.c (INCLUDED_FCNTL): + * alloc.c (INCLUDED_FCNTL): + * systty.h (INCLUDED_FCNTL): Remove all uses, not needed anymore. + (emacs_get_tty, emacs_set_tty): Declare unconditionally. + +2010-06-07 Martin Rudalics + + * window.c (Fselect_window): Move `record_buffer' up to the + beginning of this function, so the buffer gets recorded + even if the selected window does not change. + http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00137.html + +2010-06-07 Juanma Barranquero + + * cmds.c (Fforward_char, Fbackward_char): Fix typos in docstrings. + (Fforward_line, Fbeginning_of_line): Reflow docstrings. + +2010-06-06 Dan Nicolaescu + + Remove BSTRING related code, all platforms define it. + * s/usg5-4.h (BSTRING): Remove definition. + * s/template.h (BSTRING): + * s/msdos.h (BSTRING): + * s/ms-w32.h (BSTRING): + * s/hpux10-20.h (BSTRING): + * s/gnu-linux.h (BSTRING): + * s/darwin.h (BSTRING): + * s/cygwin.h (BSTRING): + * s/bsd-common.h (BSTRING): + * s/aix4-2.h (BSTRING): Likewise. + * sysdep.c: Remove code depending on BSTRING not being defined. + +2010-06-05 Juanma Barranquero + + Remove obsolete macro BASE_LEADING_CODE_P. + * character.h (BASE_LEADING_CODE_P): Remove. + * regex.c [!emacs] (BASE_LEADING_CODE_P): Remove. + * buffer.c (Fset_buffer_multibyte): + * indent.c (scan_for_column, compute_motion): + * insdel.c (count_combining_before, count_combining_after): + Use LEADING_CODE_P instead of BASE_LEADING_CODE_P. + +2010-06-04 Juanma Barranquero + + Turn `directory-sep-char' into a noop. + + * lisp.h [WINDOWSNT] (Vdirectory_sep_char): Don't declare. + (DIRECTORY_SEP): Define unconditionally. + + * s/ms-w32.h (DIRECTORY_SEP): Remove. + + * emacs.c (decode_env_path): Don't check DIRECTORY_SEP, + call dostounix_filename directly. + + * fileio.c (CORRECT_DIR_SEPS): Remove. + (Ffile_name_directory, directory_file_name, Fexpand_file_name) + (Fsubstitute_in_file_name): Use dostounix_filename instead. + (file_name_as_directory): Use dostounix_filename, DIRECTORY_SEP. + (syms_of_fileio) : Move to subr.el. + + * w32proc.c (CORRECT_DIR_SEPS): Remove. + (Fw32_short_file_name, Fw32_long_file_name): Use dostounix_filename. + +2010-06-03 Andreas Schwab + + * process.c (conv_lisp_to_sockaddr): Fix conversion of IPv4 + address. (Bug#6346) + +2010-06-03 Juanma Barranquero + + * ccl.c (Fccl_program_p): Fix typo in docstring. + +2010-06-03 Dan Nicolaescu + + Move UNEXEC definition to autoconf. + * s/usg5-4.h (UNEXEC): Remove, move to configure.in. + * s/sol2-10.h (UNEXEC): + * s/irix6-5.h (UNEXEC): + * s/hpux10-20.h (UNEXEC): + * s/gnu-linux.h (UNEXEC): + * s/darwin.h (UNEXEC): + * s/cygwin.h (UNEXEC): + * s/bsd-common.h (UNEXEC): + * s/aix4-2.h (UNEXEC): + * m/alpha.h (UNEXEC): Likewise. + * Makefile.in (UNEXEC_OBJ): Define using @UNEXEC_OBJ@. + +2010-06-03 Juanma Barranquero + + Remove obsolete pre-unicode2 macros. + * character.h (MULTIBYTE_FORM_LENGTH, PARSE_MULTIBYTE_SEQ): Remove. + * composite.c (composition_reseat_it): + * data.c (Faset): + * fns.c (Ffillarray): + * regex.c (re_search_2): Use BYTES_BY_CHAR_HEAD. + [!emacs] (BYTES_BY_CHAR_HEAD): Define instead of MULTIBYTE_FORM_LENGTH. + +2010-06-03 Juri Linkov + + * buffer.c (Fother_buffer): Add CHECK_FRAME. + (Fswitch_to_buffer): Remove unused variable `err'. + +2010-06-03 Glenn Morris + + * m/template.h (NO_SOCK_SIGIO): Remove, no longer used. + + * m/hp800.h (alloca) [__NetBSD__ && __GNUC__]: No need to define it, + now that AH_BOTTOM does it. + + * m/hp800.h (HAVE_ALLOCA): + * m/ibms390x.h (HAVE_ALLOCA): Do not define, no longer needed. + + * m/ia64.h, s/gnu-linux.h, s/gnu.h, s/netbsd.h, s/usg5-4.h: + Remove NOT_C_CODE tests, it is always true now. + +2010-06-02 Dan Nicolaescu + + Fix config.h includes. + * xsettings.c: + * xgselect.c: + * nsterm.m: + * nsselect.m: + * nsimage.m: + * nsfont.m: + * nsfns.m: + * dbusbind.c: Use #include instead of "config.h" as all + other files do. + + * gmalloc.c: Remove BROKEN_PROTOTYPES reference, unused. + + * s/sol2-6.h: Remove obsolete comments. + + Remove unnecessary alloca.h includes. + * keymap.c: Do not include alloca.h, config.h does that. + * sysdep.c: Likewise. Do not define fwrite, not used. + +2010-06-01 Stefan Monnier + + * sysdep.c (child_setup_tty): Move the non-canonical initialization to + the HAVE_TERMIO where it belongs (bug#6149). + +2010-05-31 Stefan Monnier + + * keymap.c (Fwhere_is_internal): Fix handling of remapping (in thread + of bug#6305). + +2010-05-30 Eli Zaretskii + + * bidi.c (bidi_move_to_visually_next): Make sure the sentinel + state is always cached (bug#6306). + +2010-05-29 Eli Zaretskii + + Fix cursor motion in bidi-reordered continued lines. + * xdisp.c (try_cursor_movement): Backup to non-continuation line + only after finding point's row. Fix the logic. Rewrite the loop + over continuation lines in bidi-reordered buffers. Return + CURSOR_MOVEMENT_MUST_SCROLL upon failure to find a suitable row, + rather than CURSOR_MOVEMENT_CANNOT_BE_USED. + +2010-05-28 Michael Albinus + + * fileio.c (Fdelete_file): Pass TRASH arg to handler call. + +2010-05-28 Kenichi Handa + + * font.c (font_delete_unmatched): Check Vface_ignored_fonts. + Don't sheck SPEC if it is nil. + (font_list_entities): Call font_delete_unmatched if + Vface_ignored_fonts is non-nil. (Bug#6287) + +2010-05-28 Glenn Morris + + * Makefile.in (LIBES): Remove $LOADLIBES, it is never set. + +2010-05-27 Chong Yidong + + * fileio.c (Fdelete_file): Change meaning of optional arg to mean + whether to trash. + (internal_delete_file, Frename_file): Callers changed. + (delete_by_moving_to_trash): Doc fix. + (Fdelete_directory_internal): Don't move to trash. + + * callproc.c (delete_temp_file): + * buffer.c (Fkill_buffer): Callers changed. + + * lisp.h: Update prototype. + +2010-05-27 Chong Yidong + + * xdisp.c (redisplay_window): After redisplay, check if point is + still valid before setting it (Bug#6177). + +2010-05-27 Glenn Morris + + * Makefile.in, autodeps.mk, deps.mk, ns.mk: + Convert comments to Makefile format. + + * Makefile.in (bootstrap-clean): No more Makefile.c. + +2010-05-26 Glenn Morris + + * Makefile.in (YMF_PASS_LDFLAGS): Remove. + (temacs${EXEEXT}): Use PRE_EDIT_LDFLAGS, POST_EDIT_LDFLAGS. + + * Makefile.in (NS_IMPL_GNUSTEP_INC, NS_IMPL_GNUSTEP_TEMACS_LDFLAGS): + Remove. + (TEMACS_LDFLAGS): Do not use NS_IMPL_GNUSTEP_TEMACS_LDFLAGS. + +2010-05-26 Kenichi Handa + + * composite.c (composition_compute_stop_pos): Fix condition for + backward scanning. + +2010-05-25 Glenn Morris + + * Makefile.in (@NS_IMPL_GNUSTEP_INC@, NS_IMPL_GNUSTEP_TEMACS_LDFLAGS): + Move before TEMACS_LDFLAGS. + (TEMACS_LDFLAGS): Use $NS_IMPL_GNUSTEP_TEMACS_LDFLAGS. + (temacs${EXEEXT}): Do not use $NS_IMPL_GNUSTEP_TEMACS_LDFLAGS. + + * Makefile.in (NOT_C_CODE): No longer define. + (config.h): No longer include. + + * Makefile.in (LD_SWITCH_SYSTEM_TEMACS): Move definition after some + variables it may reference. + + * Makefile.in (LD_SWITCH_SYSTEM_EXTRA): Remove. + (TEMACS_LDFLAGS): Remove LD_SWITCH_SYSTEM_EXTRA. + +2010-05-25 Kenichi Handa + + * dispextern.h (struct composition_it): New members rule_idx and + charpos. + + * xdisp.c (set_iterator_to_next): While scanning backward, assume + that the character positions of IT point the last character of the + current grapheme cluster. + (next_element_from_composition): Don't change character positions + of IT. + (append_composite_glyph): Set glyph->charpos to + it->cmp_it.charpos. + + * composite.c (autocmp_chars): Change the first argument to RULE, + and try composition with RULE only. + (composition_compute_stop_pos): Record the index number of the + composition rule in CMP_IT->rule_idx. + (composition_reseat_it): Call autocmp_chars repeatedly until the + correct rule of the composition is found. + (composition_update_it): Set CMP_IT->charpos. Assume the CHARPOS + is at the last character of the current grapheme cluster when + CMP_IT->reversed_p is nonzero. + +2010-05-24 Stefan Monnier + + * editfns.c (Fbyte_to_string): New function. + +2010-05-24 Stefan Monnier + + * process.c (Fmake_network_process): Set :host to nil if it's not used. + Suggested by Masatake YAMATO . + +2010-05-23 Eli Zaretskii + + * dispextern.h (init_iterator): Sync prototype with changed definition. + +2010-05-20 enami tsugutomo + + * s/netbsd.h: If terminfo is found, use it in preference to + termcap. (Bug#6190) [Backport from trunk] + +2010-05-19 Eli Zaretskii + + Redesign and reimplement bidi-aware edge positions of glyph rows. + + * dispextern.h (struct glyph_row): New members minpos and maxpos. + (MATRIX_ROW_START_CHARPOS, MATRIX_ROW_START_BYTEPOS) + (MATRIX_ROW_END_CHARPOS, MATRIX_ROW_END_BYTEPOS): Reference minpos + and maxpos members instead of start.pos and end.pos, respectively. + + * xdisp.c (display_line): Compare IT_CHARPOS with the position in + row->start.pos, rather than with MATRIX_ROW_START_CHARPOS. + (cursor_row_p): Use row->end.pos rather than MATRIX_ROW_END_CHARPOS. + (try_window_reusing_current_matrix, try_window_id): + Use ROW->minpos rather than ROW->start.pos. + (init_from_display_pos, init_iterator): Use EMACS_INT for + character and byte positions. + (find_row_edges): Rename from find_row_end. Accept additional + arguments for minimum and maximum buffer positions seen by + display_line for this row. Don't use iterator to find the + position following the maximum one; instead, increment the + position found by display_line directly. Fix logic; eol_pos + should be tested before the rest. Handle the case of characters + delivered from display vector (bug#6036). Fix tests related to + it->method. Handle the truncated_on_right_p rows. + (RECORD_MAX_MIN_POS): New macro. + (display_line): Use it to record the minimum and maximum buffer + positions for glyphs in the row being assembled. Record the + position of the newline that terminates the line. If word wrap is + in effect, restore minimum and maximum positions seen up to the + wrap point, when iterator returns to it. + (try_window_reusing_current_matrix): Give up if in bidi-reordered + row and cursor not already at point. Restore original pre-bidi + code for unidirectional buffers. + + * dispnew.c (increment_row_positions, check_matrix_invariants): + Increment and check row->start.pos and row->end.pos, in addition + to MATRIX_ROW_START_CHARPOS and MATRIX_ROW_END_CHARPOS. + + * .gdbinit (prowlims): Display row->minpos and row->maxpos. + Display truncated_on_left_p and truncated_on_right_p flags. + Formatting fixes. + (pmtxrows): Display the ordinal number of each row. Don't display + rows beyond the last one. + + * bidi.c (bidi_cache_iterator_state): Don't zero out new_paragraph: + it is not copied by bidi_copy_it. + +2010-05-22 Eli Zaretskii + + * w32.c (sys_write): Break writes into chunks smaller than 32MB. + (Bug#6237) + +2010-05-22 Chong Yidong + + * image.c (Fimage_flush): Rename from image-refresh. + +2010-05-21 Chong Yidong + + * xdisp.c (redisplay_internal): Clear caches even if redisplaying + just one window. + + * image.c (Vimage_cache_eviction_delay): Decrease to 300. + (clear_image_cache): If the number of cached images is unusually + large, decrease the cache eviction delay (Bug#6230). + +2010-05-21 Glenn Morris + + * Makefile.in (${ns_appdir}, ${ns_appbindir}Emacs, ns-app): + Move these rules to ns.mk. + * ns.mk: New file. + + * Makefile.in (../src/$(OLDXMENU), $(OLDXMENU)): Always define rules. + + * Makefile.in (CANNOT_DUMP): New, set by configure. + (emacs${EXEEXT}, bootstrap-emacs${EXEEXT}): Use $CANNOT_DUMP. + +2010-05-20 Juri Linkov + + * fileio.c (Fdelete_file): Change interative spec to use + `read-file-name' like in `find-file-read-args' where the default + value is `default-directory' instead of `buffer-file-name'. + http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00533.html + +2010-05-20 Kevin Ryde + + * keyboard.c (Vlast_command, Vkeyboard_translate_table) + (Voverriding_terminal_local_map, Vsystem_key_alist) + (Vlocal_function_key_map): Fix manual link in docstring (Bug#6224). + +2010-05-20 Glenn Morris + + * Makefile.in (DEPDIR): New constant. + (DEPFLAGS): Set with configure, not cpp. + (MKDEPDIR): New, set by configure. + (.c.o, .m.o, ecrt0.o): Use $MKDEPDIR. + (clean): Use $DEPDIR. + (deps_frag): Include from configure. + Move static/dynamic dependency stuff to deps.mk/autodeps.mk. + * deps.mk, autodeps.mk: New files, extracted from Makefile.in. + + * bidi.c (bidi_cache_shrink, bidi_cache_iterator_state): Fix + reallocation of the cache. (Bug#6210) + +2010-05-19 Glenn Morris + + * s/msdos.h (ORDINARY_LINK): Move to sed2v2.inp. + + * Makefile.in (LD, YMF_PASS_LDFLAGS): Set with configure, not cpp. + (GNULIB_VAR): Remove. + (LIBES): Use LIB_GCC instead of GNULIB_VAR. + + * m/ibms390x.h (LINKER): + * m/macppc.h (LINKER) [GNU_LINUX]: + * s/aix4-2.h (ORDINARY_LINK): + * s/cygwin.h (LINKER): + * s/darwin.h (ORDINARY_LINK): + * s/gnu.h (ORDINARY_LINK): + * s/netbsd.h (LINKER): + * s/usg5-4.h (ORDINARY_LINK): + Move to configure. + + * s/aix4-2.h (LINKER): Remove; this file sets ORDINARY_LINK. + +2010-05-18 Chong Yidong + + * character.c (Fstring, Funibyte_string): Use SAFE_ALLOCA to + prevent stack overflow if number of arguments is too large + (Bug#6214). + +2010-05-18 Juanma Barranquero + + * charset.c (load_charset_map_from_file): Don't call close after fclose. + +2010-05-18 Glenn Morris + + * s/gnu-linux.h: Combine two conditionals. + + * Makefile.in (otherobj): Include $(VMLIMIT_OBJ) separately from + $(POST_ALLOC_OBJ). + + * Makefile.in (RALLOC_OBJ): New, set by configure. + (rallocobj): Replace with the previous variable. + (otherobj): Use $RALLOC_OBJ. + + * s/gnu.h (REL_ALLOC) [DOUG_LEA_MALLOC]: + * s/gnu-linux.h (REL_ALLOC) [DOUG_LEA_MALLOC]: Move undef to configure. + + * Makefile.in (GMALLOC_OBJ, VMLIMIT_OBJ): New, set by configure. + (gmallocobj, vmlimitobj): Replace with previous two variables. + (otherobj): Use $GMALLOC_OBJ, $VMLIMIT_OBJ. + +2010-05-17 Glenn Morris + + * Makefile.in (OLDXMENU_DEPS): New, set by configure. + (stamp-oldxmenu): Use $OLDXMENU_DEPS. + +2010-05-16 Glenn Morris + + * Makefile.in (${ns_appbindir}Emacs, ns-app): Always define these rules. + + * Makefile.in (clean): Get rid of HAVE_NS conditional. + + * Makefile.in (ns_appdir, ns_appbindir): Now configure adds the + trailing "/". + + * Makefile.in (TEMACS_LDFLAGS2): New, set by configure. + (temacs${EXEEXT}): Combine the NS_IMPL_GNUSTEP case with the default. + + * Makefile.in (GNUSTEP_SYSTEM_LIBRARIES): Remove, unused. + (NS_IMPL_GNUSTEP_TEMACS_LDFLAGS): New, set by configure. + (LD) [NS_IMPL_GNUSTEP]: Set to $(CC) -rdynamic. + (temacs${EXEEXT}): Remove $LOCALCPP, never defined or referenced. + Make most of the NS_IMPL_GNUSTEP case the same as the default case. + + * Makefile.in (temacs${EXEEXT}) [!NS_IMPL_GNUSTEP]: + Remove ${STARTFLAGS}, nothing ever sets it. + +2010-05-16 Dan Nicolaescu + + * m/ia64.h (UNEXEC): Remove, set in s/*.h. + +2010-05-16 Glenn Morris + + * Makefile.in (LIBX_BASE): Always define. + + * Makefile.in (LIBX_OTHER): Move out of cpp section. + + * Makefile.in (LIBXT): Always define. + +2010-05-15 Glenn Morris + + * Makefile.in (OLDXMENU, LIBXMENU, LIBX_OTHER): Always define. + + * Makefile.in (FONT_DRIVERS): Remove, replace with $FONT_OBJ. + (obj, SOME_MACHINE_OBJECTS): Use $FONT_OBJ. + +2010-05-15 Ken Raeburn + + * lisp.h (XFLOAT_DATA): Use "0?x:x" to generate an rvalue. (Bug#5916) + (LISP_MAKE_RVALUE) [!USE_LISP_UNION_TYPE && !__GNUC__]: Likewise. + + * emacs.c (main): Initialize initial-environment and + process-environment before generating from env, not after. + + Handle --version reasonably in CANNOT_DUMP configuration. + * emacs.c (emacs_version, emacs_copyright): New string variables. + (Vemacs_version, Vemacs_copyright): New Lisp_Object variables. + (syms_of_emacs): Defvar them, and initialize them from the C + string variables. + (main): If initialization hasn't been done, print initial version + info from the C strings, instead of starting an interactive session. + +2010-05-15 Eli Zaretskii + + * bidi.c (bidi_paragraph_init): Don't leave alone garbage values + of bidi_it->paragraph_dir. Call bidi_initialize if needed. + (bidi_paragraph_init): Remove redundant assertion that we are at + the beginning of a line after call to bidi_find_paragraph_start. + + * xdisp.c (Fcurrent_bidi_paragraph_direction): New function. + (syms_of_xdisp): Defsubr it. + + * cmds.c (Fforward_char, Fbackward_char): Doc fix. + + * Makefile.in: Fix MSDOS-related comments. + +2010-05-15 Glenn Morris + + * Makefile.in (OLDXMENU_TARGET): New, set by configure. + (really-lwlib, really-oldXMenu): Always define. + ($OLDXMENU): Depend on $OLDXMENU_TARGET. + + * Makefile.in: Simplify cpp conditional. + + * Makefile.in (${ns_appdir}): Simplify using umask. + + * Makefile.in (${ns_appdir}): Remove references to CVS-related files. + +2010-05-14 Stefan Monnier + + * eval.c (specbind): Remove left-over duplicate test. + Disallow let-binding frame-local vars. Add comment. + +2010-05-14 Eli Zaretskii + + Make the cache of bidi iterator states dynamically allocated. + * bidi.c (bidi_cache_shrink): New function. + (bidi_init_it): Call it. + (bidi_cache_iterator_state): Enlarge the cache if needed. + + * bidi.c (bidi_move_to_visually_next): Rename from + bidi_get_next_char_visually. All callers changed. + +2010-05-14 Kenichi Handa + + * dispextern.h (struct composition_it): New member reversed_p. + + * composite.c (composition_compute_stop_pos): Search backward if + ENDPOS < CHARPOS. + (composition_reseat_it): Handle the case that ENDPOS < CHARPOS. + Set CMP_IT->reversed_p. + (composition_update_it): Pay attention to CMP_IT->reversed_p. + + * xdisp.c (set_iterator_to_next): + Call composition_compute_stop_pos with negative ENDPOS if we are + scanning backward. Call composition_compute_stop_pos if scan + direction is changed. + (next_element_from_buffer): Call composition_compute_stop_pos with + negative ENDPOS if we are scanning backward. + (next_element_from_composition): Pay attention to + IT->cmp_it.reversed_p. + +2010-05-14 Kenichi Handa + + * font.c (font_range): Return the range for the font found at first. + +2010-05-14 Glenn Morris + + * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Always define. + + * Makefile.in (mktime, X11, register): Move undefs to configure. + + * Makefile.in (MSDOS_OBJ): Default to empty, let msdos scripts set it. + (MSDOS_X_OBJ): New variable. + (MSDOS_SUPPORT_REAL): New constant. + (MSDOS_SUPPORT): Set as a variable, not with cpp. + (obj): Use MSDOS_X_OBJ. + (lisp): Use MSDOS_SUPPORT as a variable. + + * Makefile.in (REAL_MOUSE_SUPPORT): New constant. + (GPM_MOUSE_SUPPORT): Now it's a constant. + (MOUSE_SUPPORT, TOOLTIP_SUPPORT, WINDOW_SUPPORT): Set with configure, + not cpp. + + * Makefile.in (@NS_IMPL_GNUSTEP_INC@): Use in place of #ifdef. + (ns_appresdir): Remove, unused. + + * Makefile.in (SHELL): Move outside cpp section. + + * s/netbsd.h (AMPERSAND_FULL_NAME): Remove (defined in AH_BOTTOM). + +2010-05-13 Glenn Morris + + * Makefile.in (FONT_DRIVERS): Place with other HAVE_X_WINDOWS stuff. + (TOOLTIP_SUPPORT): Place with other HAVE_WINDOW_SYSTEM stuff. + + * Makefile.in (FONT_DRIVERS): If HAVE_X_WINDOWS is defined, + HAVE_WINDOW_SYSTEM must be too. + + * Makefile.in (WINNT_SUPPORT): Remove, nt build does not use this file. + (lisp): Remove WINNT_SUPPORT. + + * Makefile.in (OLDXMENU, LIBXMENU) [!HAVE_MENUS]: + Let configure set these variables (to empty) in this case as well. + + * Makefile.in (LD_SWITCH_X_SITE): Define as a variable, not via cpp. + (LIBX_BASE): Use $LD_SWITCH_X_SITE. + + * Makefile.in (C_SWITCH_X_SYSTEM, C_SWITCH_X_SITE, LIB_STANDARD) + (LIB_MATH, FONTCONFIG_CFLAGS, FONTCONFIG_LIBS, FREETYPE_CFLAGS) + (FREETYPE_LIBS, LIBOTF_CFLAGS, LIBOTF_LIBS, M17N_FLT_CFLAGS) + (M17N_FLT_LIBS, GNU_OBJC_CFLAGS, GNUSTEP_SYSTEM_LIBRARIES, LIBGPM) + (LIBRESOLV, UNEXEC_OBJ): For clarity, define variables to hold + the values output by configure. + (ALL_CFLAGS, obj, LIBES, temacs${EXEEXT}): Use the above variables. + +2010-05-12 Glenn Morris + + * Makefile.in (YMF_PASS_LDFLAGS, LD, LINKER): Simplify the logic. + (LINKER_WAS_SPECIFIED): Remove. + + * Makefile.in (LIB_GCC): Set using configure, not cpp. + (GNULIB_VAR) [!ORDINARY_LINK]: Always set to $LIB_GCC. + * m/arm.h (LIB_GCC) [GNU_LINUX]: + * s/cygwin.h (LIB_GCC): + * s/freebsd.h (LIB_GCC): + * s/gnu-linux.h (LIB_GCC): + * s/msdos.h (LIB_GCC): + * s/netbsd.h (LIB_GCC): + Move to configure. + +2010-05-11 Karel Klic + + * ftfont.c: Fix incorrect parentheses of #if condition for + definining M17N_FLT_USE_NEW_FEATURE. + +2010-05-11 Glenn Morris + + * Makefile.in (LIBS_SYSTEM) [MSDOS]: Do not reset. + * s/msdos.h (MSDOS_LIBS_SYSTEM): Remove. + +2010-05-10 Eli Zaretskii + + * xdisp.c (init_iterator): Don't turn on bidi reordering in + unibyte buffers. See + http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00263.html. + +2010-05-10 Glenn Morris + + * Makefile.in (LIBS_SYSTEM): Set using configure, not cpp. + (LIBS_SYSTEM) [MSDOS]: Reset with MSDOS_LIBS_SYSTEM. + (LIBES): Use LIBS_SYSTEM as a variable. + * s/msdos.h (LIBS_SYSTEM): Rename to MSDOS_LIBS_SYSTEM. Always define. + * s/aix4-2.h (LIBS_SYSTEM): + * s/freebsd.h (LIBS_SYSTEM): + * s/hpux10-20.h (LIBS_SYSTEM): + * s/sol2-6.h (LIBS_SYSTEM): + * s/unixware.h (LIBS_SYSTEM): + Move to configure. + + * s/aix4-2.h (MAIL_USE_LOCKF): + * s/bsd-common.h (MAIL_USE_FLOCK): + * s/darwin.h (MAIL_USE_FLOCK): + * s/gnu-linux.h (MAIL_USE_FLOCK): + * s/irix6-5.h (MAIL_USE_FLOCK): + * s/template.h (MAIL_USE_FLOCK): + Move to configure. + +2010-05-08 Chong Yidong + + * Version 23.2 released. + +2010-05-08 Andreas Schwab + + * composite.c (autocmp_chars): Save point as marker before calling + auto-composition-function (Bug#5984). + + * lisp.h (restore_point_unwind): Add prototype. + + * fileio.c (restore_point_unwind): Remove static attribute. + +2010-05-08 Kenichi Handa + + * ftfont.c (M17N_FLT_USE_NEW_FEATURE): Define it if we can use the + new feature of libotf and m17n-flt. + (ftfont_check_otf) [M17N_FLT_USE_NEW_FEATURE]: + Call OTF_check_features even if no specific feature is given. + (PACK_OTF_TAG) [M17N_FLT_USE_NEW_FEATURE]: New macro. + (ftfont_drive_otf) [M17N_FLT_USE_NEW_FEATURE]: Handle the case + that OUT is NULL. Use OTF_drive_gsub_with_log and + OTF_drive_gpos_with_log instead of OTF_drive_gsub and + OTF_drive_gpos. + (ftfont_try_otf) [M17N_FLT_USE_NEW_FEATURE]: New function. + (ftfont_shape_by_flt) [M17N_FLT_USE_NEW_FEATURE]: + Setup mflt_enable_new_feature and mflt_try_otf. + +2010-05-08 Jan Djärv + + * xsettings.c (Ftool_bar_get_system_style): Correct comment. + + * gtkutil.c (xg_pack_tool_bar): Change show_all to show for handle + box and toolbar (Bug #6139). + (xg_create_tool_bar): Remove comment (Bug #6139). + (xg_make_tool_item): Remove gtk_widget_show_all (Bug #6139). + (xg_show_toolbar_item): Add gtk_widget_show for weventbox (Bug #6139). + +2010-05-08 Juanma Barranquero + + * makefile.w32-in ($(BLD)/eval.$(O), $(BLD)/w32fns.$(O)): + Update dependencies. + +2010-05-08 Eli Zaretskii + + * fringe.c (update_window_fringes): Set up truncation bitmaps for + R2L lines. + +2010-05-08 Glenn Morris + + * Makefile.in (THIS_IS_MAKEFILE): Remove, unused. + + * Makefile.in (LIBS_TERMCAP): Set with configure, not cpp. + (TERMCAP_OBJ): New, set by configure, replacing termcapobj. + (termcapobj): Replace with TERMCAP_OBJ. + (otherobj): Use $TERMCAP_OBJ instead of $termcapobj. + (LIBES): Use LIBS_TERMCAP as a variable. + + * s/freebsd.h (osreldate.h): No longer include, since this file + does not use __FreeBSD_version any more. + + * s/aix4-2.h (TERMINFO): + * s/cygwin.h (TERMINFO): + * s/darwin.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]: + * s/freebsd.h (TERMINFO, LIBS_TERMCAP): + * s/gnu-linux.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]: + * s/gnu.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]: + * s/hpux10-20.h (TERMINFO, LIBS_TERMCAP): + * s/irix6-5.h (TERMINFO): + * s/netbsd.h (LIBS_TERMCAP): + * s/openbsd.h (TERMINFO, LIBS_TERMCAP): + * s/sol2-6.h (LIBS_TERMCAP) [!TERMINFO]: + * s/usg5-4.h (TERMINFO): + Move to configure. + +2010-05-07 Stefan Monnier + + * eval.c (unbind_to): Don't unbind a local binding into the global + binding when the local binding disappeared. Inversely, don't unbind + a global binding into a newly created local binding. + * data.c (set_internal): Make its `buf' arg into a `where' arg so we + can specify the frame to use, when applicable. Adjust callers. + +2010-05-07 Vincent Belaïche + Stefan Monnier + + * floatfns.c (Fisnan, Fcopysign, Ffrexp, Fldexp): New functions. + +2010-05-07 Eli Zaretskii + + * w32fns.c: Include w32.h. + (Fw32_shell_execute): Decode the error message before passing it + to `error'. (Bug#6126) + + * msdos.c (dos_set_window_size): + * w16select.c (Fx_selection_exists_p): Use `Fsymbol_value (foo)' + instead of `XSYMBOL (foo)->value'. + +2010-05-07 Eli Zaretskii + + Fix the MS-DOS build, broken by autoconfiscation. + + * Makefile.in: Don't use Make-style comments past the "start of + cpp stuff" line. + (MSDOS_OBJ): Remove xmenu.o (it is now defined by XMENU_OBJ). + + * s/msdos.h (UNEXEC): Don't define (@unexec@ in Makefile.in is + edited directly by msdos/sed1v2.inp). + +2010-05-07 Glenn Morris + + * Makefile.in (LD_SWITCH_SYSTEM): Set with configure, not cpp. + (LD_SWITCH_SYSTEM_EXTRA): New variable, set by configure. + (TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM and $LD_SWITCH_SYSTEM_EXTRA, + move out of cpp section. + * s/freebsd.h (LD_SWITCH_SYSTEM): + * s/gnu-linux.h (LD_SWITCH_SYSTEM): + * s/netbsd.h (LD_SWITCH_SYSTEM): + * s/openbsd.h (LD_SWITCH_SYSTEM): Move to configure.in. + +2010-05-07 Dan Nicolaescu + + Define LIB_STANDARD and START_FILES using autoconf. + * s/usg5-4.h (LIB_STANDARD): + * s/netbsd.h (START_FILES): + * s/irix6-5.h (LIB_STANDARD): + * s/hpux10-20.h (LIB_STANDARD, START_FILES): + * s/gnu-linux.h (START_FILES, LIB_STANDARD): + * s/freebsd.h (START_FILES): + * s/darwin.h (START_FILES): + * s/cygwin.h (START_FILES): + * s/aix4-2.h (LIB_STANDARD): + * m/ibmrs6000.h (START_FILES): Remove, move logic to configure.in. + * Makefile.in (STARTFILES): Rename to START_FILES, define using + autoconf, not cpp. + +2010-05-06 Dan Nicolaescu + + Remove NEED_BSDTTY and NEED_UNISTD_H. + * s/hpux10-20.h (NEED_BSDTTY): Remove. + * s/aix4-2.h (NEED_UNISTD_H): Remove. + * systty.h: Simplify conditionals for including , + and . + + * emacs.c (main): Remove NO_DIR_LIBRARY conditional, unused. + + * Makefile.in (STARTFILES): Conditionally define to make the usage clear. + * s/gnu.h (START_FILES): Remove empty definition. + +2010-05-06 Jan Djärv + + * xterm.c (x_draw_image_relief): Move declaration of extra to beginning. + +2010-05-06 Glenn Morris + + * Makefile.in (CPP, LN_S): Remove unused variables. + +2010-05-05 Stefan Monnier + + * syntax.c (Fchar_syntax): Check the arg is a character (bug#6080). + +2010-05-05 Lawrence Mitchell + + * m/sparc.h: Fix typo in earlier change. + +2010-05-04 Stefan Monnier + + Misc tweaks. + * eval.c (Fdefvaralias): Remove unintended nested if. + (internal_condition_case_2, internal_condition_case_n): Use ANSI type. + +2010-05-04 Bernhard Herzog (tiny change) + + * xsmfns.c (smc_save_yourself_CB): strlen(client_id) => strlen(cwd). + +2010-05-04 Dan Nicolaescu + + Remove BSD_PGRPS. + * s/bsd-common.h (BSD_PGRPS): Remove undef. + * s/gnu-linux.h (BSD_PGRPS): Remove. + * term.c (dissociate_if_controlling_tty): + * sysdep.c (narrow_foreground_group, widen_foreground_group) + (init_sys_modes, reset_sys_modes): + * emacs.c (main): + * callproc.c (Fcall_process, child_setup): Remove code depending + on BSD_PGRPS. + + Remove POSIX_SIGNALS. + * s/usg5-4.h (POSIX_SIGNALS): + * s/netbsd.h (POSIX_SIGNALS): + * s/msdos.h (POSIX_SIGNALS): + * s/ms-w32.h (POSIX_SIGNALS): + * s/hpux11.h (POSIX_SIGNALS): + * s/gnu.h (POSIX_SIGNALS): + * s/gnu-linux.h (POSIX_SIGNALS): + * s/freebsd.h (POSIX_SIGNALS): + * s/darwin.h (POSIX_SIGNALS): + * s/cygwin.h (POSIX_SIGNALS): + * s/aix4-2.h (POSIX_SIGNALS): Remove definition. + * s/unixware.h: + * s/sol2-6.h: Remove comments on POSIX_SIGNALS. + * process.c (create_process): + * syssignal.h: + * sysdep.c (wait_for_termination, init_signals): + * process.c (create_process): + * msdos.c: POSIX_SIGNALS is always defined on all platforms, + remove all code that assumes the contrary. + +2010-05-04 Glenn Morris + + * s/gnu-linux.h (LD_SWITCH_SYSTEM): Use LD_SWITCH_X_SITE_AUX as a shell + variable. + * s/netbsd.h (LD_SWITCH_SYSTEM_tmp): Remove. + (LD_SWITCH_SYSTEM): Use $LD_SWITCH_X_SITE_AUX_RPATH. + * s/openbsd.h (LD_SWITCH_SYSTEM_tmp): Remove. + (LD_SWITCH_SYSTEM): Use $LD_SWITCH_X_SITE_AUX_RPATH instead of + LD_SWITCH_SYSTEM_tmp. + * Makefile.in (LD_SWITCH_X_SITE_AUX, LD_SWITCH_X_SITE_AUX_RPATH): + New variables, set by configure. + + * s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. + * s/darwin.h (HEADERPAD_EXTRA, LIBS_NSGUI): Remove. + (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. + * Makefile.in (LD_SWITCH_SYSTEM_TEMACS): New variable, set by configure. + (TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM_TEMACS. + + * s/aix4-2.h (C_SWITCH_SYSTEM): + * m/alpha.h (C_SWITCH_MACHINE): + Move to configure.in. + * Makefile.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): + New variables, set by configure. + (ALL_CFLAGS): Use $C_SWITCH_MACHINE and $C_SWITCH_SYSTEM in place of + $c_switch_machine and $c_switch_system. + +2010-05-04 Dan Nicolaescu + + * s/hpux10-20.h (LIB_STANDARD): New definition. + * Makefile.in (ORDINARY_LINK): Remove setting LIB_STANDARD based + on it, not used anymore. + +2010-05-03 Chong Yidong + + * eval.c (internal_condition_case_n): Rename from + internal_condition_case_2. + (internal_condition_case_2): New function. + + * xdisp.c (safe_call): Use internal_condition_case_n. + + * fileio.c (Fdelete_file, internal_delete_file): New arg FORCE. + (internal_delete_file, Frename_file): Callers changed. + + * buffer.c (Fkill_buffer): + * callproc.c (delete_temp_file): Callers changed (Bug#6070). + + * lisp.h: Update prototypes. + +2010-05-03 Glenn Morris + + * Makefile.in (LIBX_EXTRA, LIBX_BASE): New variables. + (LIBXT_OTHER, LIBX_OTHER): New, set by configure. + (LIBXT): Set with configure, not cpp. + (LIBX): Remove. + (LIBES): Replace $LIBX with $LIBX_BASE and $LIBX_OTHER. + +2010-05-02 Dan Nicolaescu + + * m/amdx86-64.h (START_FILES, LIB_STANDARD): Remove. + The FreeBSD is not needed, the default works, Solaris version is + not needed, and the remaining case is not supported by configure. + +2010-05-02 Jan Djärv + + * xsmfns.c (CHDIR_OPT): New define. + (smc_save_yourself_CB): Add CHDIR_OPT to options to use when + restarting emacs. + + * xterm.c (x_connection_closed): Call Fkill_emacs instead of + shut_down_emacs. + + * emacs.c (USAGE1): Mention --chdir. + (main): Handle --chdir. + (standard_args): Add --chdir. + (fatal_error_signal): Call Fkill_emacs for SIGTERM and SIGHUP (Bug + #5552). + +2010-05-01 Dan Nicolaescu + + Remove LD_SWITCH_MACHINE. + * Makefile.in (LD_SWITCH_MACHINE): Remove definition, unused. + (TEMACS_LDFLAGS): Do not use LD_SWITCH_MACHINE. + + Clean up IRIX code. + * m/iris4d.h (TERMINFO, FIRST_PTY_LETTER): Move definitions ... + * s/irix6-5.h (TERMINFO, FIRST_PTY_LETTER): ... here. + + Clean up AIX code. + * m/ibmrs6000.inp: Remove file, unused. + * m/ibmrs6000.h (IBMR2AIX): Remove, unused. + (LD_SWITCH_MACHINE): Rename to LD_SWITCH_SYSTEM_TEMACS, and move + definition ... + * s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): ... here. + + * sysdep.c (child_setup_tty, init_sys_modes): Remove !IBMR2AIX code, + unused. + +2010-05-01 Eli Zaretskii + + Emulate POSIX_SIGNALS on MS-Windows. + + * s/ms-w32.h (POSIX_SIGNALS, struct sigaction, SIG_BLOCK) + (SIG_SETMASK, SIG_UNBLOCK): Define. + + * sysdep.c (sys_signal) [WINDOWSNT]: #ifdef away. + (wait_for_termination) [WINDOWSNT]: Move MS-Windows specific code + from non-POSIX_SIGNALS section to POSIX_SIGNALS section. - * xterm.c (x_draw_fringe_bitmap): Don't clip bottom aligned bitmap - specially. - * w32term.c (w32_draw_fringe_bitmap): Likewise. - * nsterm.m (ns_draw_fringe_bitmap): Likewise. + * w32.c (sigemptyset, sigaddset, sigfillset, sigprocmask): + New stubs. - * fringe.c (draw_fringe_bitmap_1): Don't clip bitmap here. - Take account of bitmap offset. - (draw_window_fringes): Take account of window vscroll. - (update_window_fringes): Likewise. Extend top-aligned top indicator - or bottom-aligned bottom indicator to adjacent rows if it doesn't fit - in one row. Don't set redraw_fringe_bitmaps_p outside row comparison. - Set left_fringe_offset and right_fringe_offset (Bug#5634, Bug#6325). + Miscellaneous fixes of bidi display. -2010-07-04 Juanma Barranquero + * xdisp.c (find_row_end): New function, refactored from display_line. + (display_line): Use it. + (extend_face_to_end_of_line): In almost-filled rows, extend only + if the row is R2L and not continued. + (display_line): Fix prepending of truncation glyphs to R2L rows. + Preserve overlay and string info in row->end. + (insert_left_trunc_glyphs): Support addition of left truncation + glyphs to R2L rows. + (set_cursor_from_row): Don't place cursor on the vertical border + glyph between adjacent windows. Fix a crash when a display string + is continued to the next line. Don't return zero if cursor was + found by `cursor' property of a display string. + (try_cursor_movement): Don't assume that row->end == (row+1)->start, + test for that explicitly. - * w32fns.c (Qtooltip): Declare. - Suggested by Andy Moreton . +2010-05-01 Glenn Morris -2010-07-03 Jan Djärv + * Makefile.in (gmallocobj, rallocobj, vmlimitobj): Initialize to null, + for clarity. + (OTHER_OBJ): Remove. + (PRE_ALLOC_OBJ, POST_ALLOC_OBJ): New, set by configure. + (otherobj): Use PRE_ALLOC_OBJ, POST_ALLOC_OBJ rather than OTHER_OBJ. - * xmenu.c (x_activate_menubar): Send Press/Release for Gtk+ to avoid - grab on just Press (Bug#6499). +2010-05-01 Karel Klíč -2010-07-02 Chong Yidong + * fileio.c (Ffile_selinux_context): Context functions may return null. - * frame.c (Qtooltip): New var. - (delete_frame): Use it. Fix faulty if statement. Don't update - mode line for tooltip frames. Suggested by Martin Rudalics. +2010-04-30 Dan Nicolaescu - * xfns.c (x_create_tip_frame): - * w32fns.c (x_create_tip_frame): Use it. + * s/gnu.h (POSIX_SIGNALS, START_FILES): New definitions. -2010-06-30 Naohiro Aota (tiny change) +2010-04-30 Glenn Morris - * xftfont.c (xftfont_open): Check font width one by one also when - spacing is dual. + * Makefile.in (vmlimitobj) [!SYSTEM_MALLOC]: New variable. (Bug#6065) + (OTHER_OBJ): Define as a separate variable, for clarity. - * ftfont.c (ftfont_open): Ditto. +2010-04-30 Jan Djärv -2010-06-26 Andreas Schwab + * xsettings.c: include limits.h and update file comment. - * alloc.c (Fmake_byte_code): Don't access undefined argument - (Bug#6517). +2010-04-30 Glenn Morris -2010-06-25 Chong Yidong + * Makefile.in (OLDXMENU, LIBXMENU) [HAVE_MENUS]: + Set with configure, not cpp. + (LIBW): Remove, replace with $TOOLKIT_LIBW. - * xdisp.c (next_element_from_image): Ensure that after-strings are - read the next time we hit handle_stop (Bug#1336). + * Makefile.in (mallocobj): Remove. + (otherobj): Simplify using @OTHER_OBJ@. -2010-06-23 Andreas Schwab + * Makefile.in (dispnew.o, frame.o, fringe.o, font.o, fontset.o) + (keyboard.o, window.o, xdisp.o, xfaces.o, menu.o): + Don't bother making nsgui.h dependency platform-specific. - * lread.c (read1): Signal error if #s is not followed by paren. + * Makefile.in (nsfns.o): Remove duplicate nsgui.h dependency. -2010-06-19 Chong Yidong +2010-04-29 Stefan Monnier - * image.c (free_image): Mark frame as garbaged (Bug#6426). + * process.c (read_process_output, exec_sentinel): Don't burp if the + sentinel/filter kills the current buffer (bug#6060). - * keymap.c (Fdefine_key): Doc fix (Bug#6460). + Fix wrong-docstring problem introduced with hash-consing. (Bug#6008) + * eval.c (Fautoload): Set doc to a unique number rather than to 0. + Remove unused var `args'. + * lisp.h (XSETCARFASTINT, XSETCDRFASTINT): Remove. + (LOADHIST_ATTACH): Wrap with do...while to avoid surprises for callers. + * doc.c (store_function_docstring): Use XSETCAR. -2010-06-15 Glenn Morris +2010-04-28 Glenn Morris - * editfns.c (Fbyte_to_string): Pacify compiler. + * Makefile.in (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT): New variables. + (WINDOW_SUPPORT) [HAVE_WINDOW_SYSTEM]: Use them. -2010-06-09 Stefan Monnier + * Makefile.in (CYGWIN_OBJ): Set with configure, not cpp. - * dbusbind.c (xd_append_arg): Don't "make-unibyte" the string. - Check `object's type before accessing its guts. + * Makefile.in (GPM_MOUSE_SUPPORT): New, set by configure. + (MOUSE_SUPPORT) [!HAVE_MOUSE]: Use $GPM_MOUSE_SUPPORT. -2010-06-08 Andreas Schwab + * Makefile.in (FONT_OBJ): New, set by configure. + (FONT_DRIVERS): Use $FONT_OBJ. - * minibuf.c (Fall_completions): Add more checks. + * Makefile.in (LIBXMU): Set with configure, not cpp. + * s/aix4-2.h (LIBXMU): + * s/hpux10-20.h (LIBXMU): + Remove definition, now set in configure. -2010-06-08 Juanma Barranquero + * Makefile.in (NS_OBJ, NS_SUPPORT): Set with configure, not cpp. - * minibuf.c (Fall_completions): Check COLLECTION's size (bug#6378). + * m/amdx86-64.h [i386]: Move this test to configure.in. -2010-06-03 Andreas Schwab +2010-04-27 Glenn Morris - * process.c (conv_lisp_to_sockaddr): Fix conversion of IPv4 - address. (Bug#6346) + * Makefile.in (LIBXTR6): Set with configure, not cpp. + * s/unixware.h (NEED_LIBW): Remove definition. -2010-06-03 Juanma Barranquero + * Makefile.in (LUCID_LIBW, MOTIF_LIBW): Remove, replacing by... + (TOOLKIT_LIBW): New, set by configure. + (@X_TOOLKIT_TYPE@): No longer define it. - * ccl.c (Fccl_program_p): Fix typo in docstring. + * Makefile.in (LIBXP): Remove, since included in MOTIF_LIBW. + (MOTIF_LIBW): Set with configure, not cpp. + * s/aix4-2.h (LIB_MOTIF): + * s/gnu-linux.h (LIB_MOTIF): + * s/unixware.h (LIB_MOTIF): Move to configure.in. -2010-05-31 Stefan Monnier +2010-04-27 Dan Nicolaescu - * keymap.c (Fwhere_is_internal): Fix handling of remapping (in thread - of bug#6305). + Reduce CPP usage. + * Makefile.in (LIB_X11_LIB): Remove, inline in the only user. + (obj): Use autoconf for unexec instead of cpp. + (C_SWITCH_SYSTEM, C_SWITCH_MACHINE, C_SWITCH_X_SITE): Remove + definitions and undefs. Inline definitions in the only user. + (ALL_CFLAGS): Substitute C_SWITCH_X_SYSTEM using autoconf. -2010-05-27 Chong Yidong +2010-04-27 Glenn Morris - * xdisp.c (redisplay_window): After redisplay, check if point is - still valid before setting it (Bug#6177). + * m/amdx86-64.h (START_FILES, LIB_STANDARD): Change the logic around, + since the defaults (set by the system file) are fine in most cases. + [GNU_LINUX, __OpenBSD__, __NetBSD__, __APPLE__]: Remove sections. + * m/ibms390x.h (START_FILES, LIB_STANDARD): + * m/macppc.h (START_FILES, LIB_STANDARD) [GNU_LINUX]: + * m/sparc.h (START_FILES, LIB_STANDARD) [__linux__]: + Remove definitions, since they are set correctly in s/gnu-linux.h. + * s/freebsd.h (START_FILES, LIB_STANDARD): + * s/gnu-linux.h (START_FILES, LIB_STANDARD): + * s/hpux10-20.h (START_FILES): + * s/netbsd.h (START_FILES, LIB_STANDARD, START_FILES_1, END_FILES_1): + Use $CRT_DIR in place of fixed /usr/lib, /lib directories. -2010-05-20 enami tsugutomo + * Makefile.in (LIBXP, LUCID_LIBW, WIDGET_OBJ): Set via configure. + (MOTIF_LIBW): Use $LIBXP. + (otherobj): Use $WIDGET_OBJ. - * s/netbsd.h: If terminfo is found, use it in preference to - termcap. (Bug#6190) [Backport from trunk] +2010-04-26 Dan Nicolaescu -2010-05-20 Kevin Ryde + * Makefile.in (LIBS_MACHINE): Remove, unused. - * keyboard.c (Vlast_command, Vkeyboard_translate_table) - (Voverriding_terminal_local_map, Vsystem_key_alist) - (Vlocal_function_key_map): Fix manual link in docstring (Bug#6224). + Use autoconf instead of cpp for LIB_MATH. + * s/darwin.h (LIB_MATH): Do not define here, move to configure. + * s/cygwin.h (LIB_MATH): Likewise. + * Makefile.in (LIB_MATH): Do not define with cpp. + (LIBES): Use autoconf for LIB_MATH. -2010-05-19 Stefan Monnier +2010-04-26 Kenichi Handa - * editfns.c (Fbyte_to_string): New function. + * composite.c (Ffind_composition_internal): Fix the return value + for an automatic composition. -2010-05-18 Chong Yidong +2010-04-25 Dan Nicolaescu - * character.c (Fstring, Funibyte_string): Use SAFE_ALLOCA to - prevent stack overflow if number of arguments is too large - (Bug#6214). + Remove all NO_ARG_ARRAY uses. + * fns.c (concat2, concat3, nconc2): + * eval.c (apply1, call1, call2, call3, call4, call5, call6) + (call7): Remove NO_ARG_ARRAY usage, assume it's always true. + * m/xtensa.h (NO_ARG_ARRAY): + * m/template.h (NO_ARG_ARRAY): + * m/sparc.h (NO_ARG_ARRAY): + * m/sh3.h (NO_ARG_ARRAY): + * m/mips.h (NO_ARG_ARRAY): + * m/macppc.h (NO_ARG_ARRAY): + * m/iris4d.h (NO_ARG_ARRAY): + * m/intel386.h (NO_ARG_ARRAY): + * m/ibms390x.h (NO_ARG_ARRAY): + * m/ibms390.h (NO_ARG_ARRAY): + * m/ibmrs6000.h (NO_ARG_ARRAY): + * m/ia64.h (NO_ARG_ARRAY): + * m/hp800.h (NO_ARG_ARRAY): + * m/arm.h (NO_ARG_ARRAY): + * m/amdx86-64.h (NO_ARG_ARRAY): + * m/alpha.h (NO_ARG_ARRAY): Remove definition. -2010-05-11 Eli Zaretskii +2010-04-25 Eli Zaretskii - * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(SRC)/w32.h. + * xdisp.c (display_line): Don't assume 2nd call to + get_next_display_element cannot return zero. (Bug#6030) + (iterate_out_of_display_property): New function, body from pop_it. + (pop_it): Use it. - * w32fns.c: Include w32.h. - (Fw32_shell_execute): Decode the error message before passing it - to `error'. (Bug#6126) +2010-04-24 Glenn Morris -2010-05-11 Karel Klic + * m/amdx86-64.h (START_FILES, LIB_STANDARD) [__OpenBSD__]: + For clarity, revert to using fixed /usr/lib rather than $CRT_DIR. + (START_FILES, LIB_STANDARD) [__FreeBSD__]: Merge into the generic case, + since CRT_DIR defaults to /usr/lib. Suggested by Dan Nicolaescu. - * ftfont.c: Fix incorrect parentheses of #if condition for - definining M17N_FLT_USE_NEW_FEATURE. +2010-04-24 Eli Zaretskii -2010-05-07 Chong Yidong + * xdisp.c (display_line): Use `reseat' instead of `reseat_1', and + use `get_next_display_element' and `set_iterator_to_next' to + advance to the next character, when looking for the character that + begins the next row. + + * .gdbinit: Add a "set Fmake_symbol" line to force GDB to load the + definition of "struct Lisp_Symbol". + +2010-04-24 Glenn Morris + + * Makefile.in (CRT_DIR): New variable, set by configure. + * m/amdx86-64.h, m/ibms390x.h (START_FILES, LIB_STANDARD): + Use $CRT_DIR rather than HAVE_LIB64_DIR. (Bug#5655) + +2010-04-23 Dan Nicolaescu + + * Makefile.in: Remove C_SWITCH_X_MACHINE, unused. + + * s/cygwin.h (LIBS_DEBUG): Remove, unused. + + Remove redundant flags. + * s/freebsd.h (C_SWITCH_SYSTEM): + * s/hpux10-20.h (C_SWITCH_X_SYSTEM, LD_SWITCH_X_DEFAULT): + * s/netbsd.h (C_SWITCH_SYSTEM): + * s/openbsd.h (LD_SWITCH_X_DEFAULT): Remove, configure takes care + of these. + + Simplify m/intel386.h. + * m/intel386.h (CRT0_DUMMIES): Remove, inline value in the only + user: ecrt0.c. + (SOLARIS2): Remove LOAD_AVE_TYPE, LOAD_AVE_CVT, LIBS_MACHINE, unused. + (USG5_4): Move LOAD_AVE_TYPE, LOAD_AVE_CVT, FSCALE definitions to + the only user: s/unixware.h. + * ecrt0.c: Remove #ifndef static. Inline CRT0_DUMMIES definition + from m/intel386.h. + * s/unixware.h (LOAD_AVE_TYPE, LOAD_AVE_CVT, FSCALE): Definitions + moved here from m/intel386.h. + + * m/mips.h: Remove #if 0 code. + +2010-04-23 Eli Zaretskii + + Fix display of composed characters from L2R scripts in bidi buffers. + * xdisp.c (set_iterator_to_next, next_element_from_composition): + After advancing IT past the composition, resync the bidi iterator + with IT's position. (Bug#5977) + +2010-04-23 Dan Nicolaescu + + * Makefile.in (LD_SWITCH_MACHINE_TEMACS): Remove, unused. + (TEMACS_LDFLAGS): Don't use LD_SWITCH_SYSTEM_TEMACS. + +2010-04-23 Stefan Monnier + + * gtkutil.c: Include xsettings.h for Ftool_bar_get_system_style. + +2010-04-23 Eli Zaretskii + + Support `display' text properties and overlay strings in bidi buffers. + * xdisp.c (pop_it): When the stack is popped after displaying + from a string, bidi-iterate to exit from the text portion covered + by the `display' property or overlay. (Bug#5988, bug#5920) + +2010-04-23 Dan Nicolaescu + + * m/macppc.h (LD_SWITCH_SYSTEM_TEMACS): Remove #undef. + (LD_SWITCH_MACHINE_TEMACS): Remove, configure sets nocombreloc. + + * s/netbsd.h (LD_SWITCH_SYSTEM_TEMACS): Remove, configure sets nocombreloc. + * s/openbsd.h (LD_SWITCH_SYSTEM_TEMACS): Remove. + + Simplify STARTFILES definition. + * s/hpux10-20.h (START_FILES): Explicitly define here instead of + relying on Makefile.in to define it. + * s/cygwin.h (START_FILES): Likewise. + * Makefile.in (STARTFILES): Remove conditional code, not needed anymore. + + Clean up Solaris code. + * s/sol2-6.h (LD_SWITCH_SYSTEM_TEMACS, C_SWITCH_X_SYSTEM) + (LIB_MOTIF): Remove, configure takes care of this. + (NOT_USING_MOTIF): Remove, unused. + * xrdb.c: Remove #if 0-ed #include. + (SYSV): Remove conditional for old SysV. + * sysdep.c (closedir): Remove conditional code for Solaris, + Solaris has closedir. - * Version 23.2 released. +2010-04-22 Jan Djärv + + * xsettings.c (read_and_apply_settings): Check if current_font is + NULL before strcmp (Bug#6001). -2010-04-30 Andreas Schwab +2010-04-21 Dan Nicolaescu - * composite.c (autocmp_chars): Save point as marker before calling - auto-composition-function (Bug#5984). + Clean up HP-UX files. + * m/hp800.h (NO_REMAP, VIRT_ADDR_VARIES, DATA_SEG_BITS) + (DATA_START, TEXT_START, LOAD_AVE_TYPE, LOAD_AVE_CVT) + (LDAV_SYMBOL, index, rindex): Move definitions only used in HP-UX ... + * s/hpux10-20.h: ... to the only user, here. - * lisp.h (restore_point_unwind): Add prototype. +2010-04-21 Eli Zaretskii + + * bidi.c (bidi_find_paragraph_start, bidi_at_paragraph_end): Don't + use buffer-local values of paragraph-start and paragraph-separate. + : Rename from + fallback_paragraph_start_re and fallback_paragraph_separate_re. + (Bug#5992) - * fileio.c (restore_point_unwind): Remove static attribute. +2010-04-21 Jan Djärv + + * xsettings.c: Qmonospace_font_name, Qtool_bar_style and + current_tool_bar_style are new. + (store_config_changed_event): Rename from store_font_changed_event. + (XSETTINGS_TOOL_BAR_STYLE): New define. + (SEEN_FONT, SEEN_TB_STYLE): New enum values. + (struct xsettings): Add font and tb_style, set xft stuff inside #ifdef + HAVE_XFT. + (something_changedCB): store_font_changed_event is now + store_config_changed_event + (parse_settings): Rename from parse_xft_settings. Read + non-xft xsettings outside #ifdef HAVE_XFT. + (read_settings): Renamed from read_xft_settings. + (apply_xft_settings): Take current settings as parameter. Do not + call read_(xft)_settings. + (read_and_apply_settings): New function. + (xft_settings_event): Do non-xft stuff out of HAVE_XFT. Call + read_and_apply_settings if there are settings to be read. + (init_xsettings): Renamed from init_xfd_settings. + Call read_and_apply_settings unconditionally. + (xsettings_initialize): Call init_xsettings. + (Ftool_bar_get_system_style): New function. + (syms_of_xsettings): Define Qmonospace_font_name and + Qtool_bar_style. Initialize current_tool_bar_style to nil. + defsubr Stool_bar_get_system_style. Fprovide on + dynamic-setting. + Move misplaced HAVE_GCONF -2010-04-23 Kenichi Handa + * xsettings.h (Ftool_bar_get_system_style): Declare. - * ftfont.c (M17N_FLT_USE_NEW_FEATURE): Define it if we can use the - new feature of libotf and m17n-flt. - (ftfont_check_otf) [M17N_FLT_USE_NEW_FEATURE]: Call - OTF_check_features even if no specific feature is given. - (PACK_OTF_TAG) [M17N_FLT_USE_NEW_FEATURE]: New macro. - (ftfont_drive_otf) [M17N_FLT_USE_NEW_FEATURE]: Handle the case - that OUT is NULL. Use OTF_drive_gsub_with_log and - OTF_drive_gpos_with_log instead of OTF_drive_gsub and - OTF_drive_gpos. - (ftfont_try_otf) [M17N_FLT_USE_NEW_FEATURE]: New function. - (ftfont_shape_by_flt) [M17N_FLT_USE_NEW_FEATURE]: Setup - mflt_enable_new_feature and mflt_try_otf. + * xdisp.c: Vtool_bar_style, tool_bar_max_label_size, + Qtext, Qboth, Qboth_horiz are new. + (syms_of_xdisp): Intern Qtext, Qboth, Qboth_horiz, DEFVAR + Vtool_bar_style, tool_bar_max_label_size. + + * lisp.h: Extern declare Qtext, Qboth, Qboth_horiz. + + * keyboard.c: QClabel is new. + (parse_tool_bar_item): Take out QClabel from tool bar items. + Try to construct a label if ther is no QClabel. + (syms_of_keyboard): Intern :label as QClabel. + + * dispextern.h (tool_bar_item_idx): TOOL_BAR_ITEM_LABEL is new. + (Vtool_bar_style, tool_bar_max_label_size, DEFAULT_TOOL_BAR_LABEL_SIZE): + New. + + * Makefile.in (SOME_MACHINE_LISP): font-setting.el renamed to + dynamic-setting.el. + + * gtkutil.c (xg_tool_bar_menu_proxy): Handle label in tool bar item. + (xg_make_tool_item, xg_show_toolbar_item): New function. + (update_frame_tool_bar): Take label from TOOL_BAR_ITEM_LABEL. + Call xg_make_tool_item to make a tool bar item. + Call xg_show_toolbar_item. Use wtoolbar instead of x->toolbar_widget. + + * xterm.c (x_draw_image_relief): Take Vtool_bar_button_margin + into account for toolbars. + +2010-04-21 Jan Djärv + + * data.c (make_blv): Declarations before code (Bug#5993). + +2010-04-21 Glenn Morris + + * Makefile.in (DBUS_OBJ, GTK_OBJ, XMENU_OBJ, XOBJ): + Define using autoconf, not cpp. + (LIBXSM): New variable, set by autoconf. + (LIBXT): Use $LIBXSM. + +2010-04-21 Dan Nicolaescu + + Remove NOMULTIPLEJOBS, unused. + * s/template.h (NOMULTIPLEJOBS): + * s/msdos.h (NOMULTIPLEJOBS): Remove, unused. + + Simplify LD_SWITCH_SYSTEM_TEMACS usage. + * s/freebsd.h (LD_SWITCH_SYSTEM_TEMACS): + * s/gnu-linux.h (LD_SWITCH_SYSTEM_TEMACS): Remove, configure + detects -znocombreloc and passes it to the linker + * s/hpux10-20.h (LD_SWITCH_SYSTEM_TEMACS): Remove, empty. + +2010-04-21 Glenn Morris + + * Makefile.in (LIBSELINUX_LIBS): Move out of #ifdef. + +2010-04-21 Karel Klíč + + * Makefile.in (LIBSELINUX_LIBS): New. + (LIBES): Add $LIBSELINUX_LIBS. + * eval.c, lisp.h (call7): New function. + * fileio.c [HAVE_LIBSELINUX]: Include selinux headers. + (Ffile_selinux_context, Fset_file_selinux_context): + New functions. + (Fcopy_file): New parameter preserve-selinux-context. + (Frename_file): Preserve selinux context when renaming by copy-file. + +2010-04-21 Juanma Barranquero + Eli Zaretskii + + Don't depend on cm.c or termcap.c on Windows, use stubs. + * makefile.w32-in (OBJ1): Remove cm.$(O) and termcap.$(O). + ($(BLD)/cm.$(O), $(BLD)/termcap.$(O)): Remove. + * w32console.c (current_tty, cost): New vars; lifted from cm.c. + (evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear) + (sys_tputs, sys_tgetstr): New stubs. + * s/ms-w32.h (chcheckmagic, cmcostinit, cmgoto, cmputc, Wcm_clear) + (tputs, tgetstr): New; define to sys_*. + +2010-04-20 Juanma Barranquero + + * buffer.c (syms_of_buffer) : Doc fix. + +2010-04-20 Stefan Monnier + + * data.c (Fmake_variable_buffer_local, Fmake_local_variable): + Just signal a warning rather than an error when inside a let. + (Fmake_variable_frame_local): Add the same test. + + * font.c (syms_of_font): Make the style table vars read-only. + + * buffer.h (struct buffer): Remove unused var `direction_reversed'. + * buffer.c (init_buffer_once, syms_of_buffer): Remove its initialization. + + * bidi.c (bidi_initialize): Simplify fallback_paragraph_*_re init. + +2010-04-20 Eli Zaretskii + + Fix R2L paragraph display on TTY. + + * xdisp.c (unproduce_glyphs): New function. + (display_line): Use it when produced glyphs are discarded from R2L + glyph rows. + (append_composite_glyph): In R2L rows, prepend the glyph rather + than appending it. + + * term.c (append_composite_glyph): In R2L rows, prepend the glyph + rather than append it. Set up the resolved_level and bidi_type + attributes of the appended glyph. + (produce_special_glyphs): Mirror the backslash continuation + character in R2L lines. + + Implement display of R2L paragraphs in GUI sessions. + + * xdisp.c [HAVE_WINDOW_SYSTEM]: Add prototype for + append_stretch_glyph. + (set_cursor_from_row) : Remove unused variable. Fix + off-by-one error in computing x at end of text in the row. + (append_stretch_glyph): In reversed row, prepend the glyph rather + than append it. Set resolved_level and bidi_type of the glyph. + (extend_face_to_end_of_line): If the row is reversed, prepend a + stretch glyph whose width is such that the rightmost glyph will be + drawn at the right margin of the window. Fix off-by-one error on + TTY frames in testing whether a line needs face extension. Fix + face extension at ZV. If this is the last glyph row, use + DEFAULT_FACE_ID, to avoid painting the rest of the window with the + region face. + (set_cursor_from_row, display_line): Use + MATRIX_ROW_CONTINUATION_LINE_P instead of testing value of + row->continuation_lines_width. + (next_element_from_buffer): Don't call bidi_paragraph_init if we + are at ZV. Fixes a crash when reseated to ZV by + try_window_reusing_current_matrix. + (display_and_set_cursor, erase_phys_cursor): Handle negative HPOS, + which happens with R2L glyph rows. Fixes a crash when inserting a + character at end of an R2L line. + (set_cursor_from_row): Don't be fooled by truncated rows: don't + treat them as having zero-width characters. Improve comments. + Don't reverse pos_before and pos_after for reversed glyph rows. + Set cursor.x to negative value when the cursor might be on the + left fringe. + (IT_OVERFLOW_NEWLINE_INTO_FRINGE): For R2L lines, consider the + left fringe, not the right one. + (notice_overwritten_cursor, draw_phys_cursor_glyph) + (erase_phys_cursor): For reversed cursor_row, support cursor on + the left fringe. + + * fringe.c (update_window_fringes): For R2L rows, swap the bitmaps + of continuation indicators on the fringes. + (draw_fringe_bitmap): For reversed glyph rows, allow cursor on the + left fringe. + + * w32term.c (w32_draw_window_cursor): For reversed glyph rows, + draw cursor on the left fringe. + + * xterm.c (x_draw_window_cursor): For reversed glyph rows, draw + cursor on the left fringe. + + * dispnew.c (update_text_area): Handle reversed desired rows when + the cursor is on the left fringe. + (set_window_cursor_after_update): Limit cursor's hpos by -1 from + below, not by 0, for when the cursor is on the left fringe. + +2010-04-20 Jan Djärv + + * gtkutil.c (xg_event_is_for_scrollbar): Check if grabbed + widget is a scrollbar. + +2010-04-20 Kenichi Handa + + * charset.c (char_charset): Consider Vcharset_non_preferred_head + only when the arg CHARSET_LIST is nil. + +2010-04-20 Stefan Monnier + + Make variable forwarding explicit rather the using special values. + Basically, this makes the structure of buffer-local values and object + forwarding explicit in the type of Lisp_Symbols rather than use + special Lisp_Objects for that. This tends to lead to slightly more + verbose code, but is more C-like, simpler, and makes it easier to make + sure we handled all cases, among other things by letting the compiler + help us check it. + * lisp.h (enum Lisp_Misc_Type, union Lisp_Misc): + Removing forwarding objects. + (enum Lisp_Fwd_Type, enum symbol_redirect, union Lisp_Fwd): New types. + (struct Lisp_Symbol): Make the various forms of variable-forwarding + explicit rather than hiding them inside Lisp_Object "values". + (XFWDTYPE): New macro. + (XINTFWD, XBOOLFWD, XOBJFWD, XKBOARD_OBJFWD): Redefine. + (XBUFFER_LOCAL_VALUE): Remove. + (SYMBOL_VAL, SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL) + (SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD): New macros. + (SYMBOL_VALUE, SET_SYMBOL_VALUE): Remove. + (struct Lisp_Intfwd, struct Lisp_Boolfwd, struct Lisp_Objfwd) + (struct Lisp_Buffer_Objfwd, struct Lisp_Kboard_Objfwd): + Remove the Lisp_Misc_* header. + (struct Lisp_Buffer_Local_Value): Redefine. + (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): New macros. + (struct Lisp_Misc_Any): Add filler to get the right size. + (struct Lisp_Free): Use struct Lisp_Misc_Any rather than struct + Lisp_Intfwd. + (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT) + (DEFVAR_KBOARD): Allocate a forwarding object. + * data.c (do_blv_forwarding, store_blv_forwarding): New macros. + (let_shadows_global_binding_p): New function. + (union Lisp_Val_Fwd): New type. + (make_blv): New function. + (swap_in_symval_forwarding, indirect_variable, do_symval_forwarding) + (store_symval_forwarding, swap_in_global_binding, Fboundp) + (swap_in_symval_forwarding, find_symbol_value, Fset) + (let_shadows_buffer_binding_p, set_internal, default_value) + (Fset_default, Fmake_variable_buffer_local, Fmake_local_variable) + (Fkill_local_variable, Fmake_variable_frame_local) + (Flocal_variable_p, Flocal_variable_if_set_p) + (Fvariable_binding_locus): + * xdisp.c (select_frame_for_redisplay): + * lread.c (Fintern, Funintern, init_obarray, defvar_int) + (defvar_bool, defvar_lisp_nopro, defvar_lisp, defvar_kboard): + * frame.c (store_frame_param): + * eval.c (Fdefvaralias, Fuser_variable_p, specbind, unbind_to): + * bytecode.c (Fbyte_code) : Adapt to the new symbol + value structure. + * buffer.c (PER_BUFFER_SYMBOL): Move from buffer.h. + (clone_per_buffer_values): Only adjust markers into the current buffer. + (reset_buffer_local_variables): PER_BUFFER_IDX is never -2. + (Fbuffer_local_value, set_buffer_internal_1) + (swap_out_buffer_local_variables): + Adapt to the new symbol value structure. + (DEFVAR_PER_BUFFER): Allocate a Lisp_Buffer_Objfwd object. + (defvar_per_buffer): Take a new arg for the fwd object. + (buffer_lisp_local_variables): Return a proper alist (different fix + for bug#4138). + * alloc.c (Fmake_symbol): Use SET_SYMBOL_VAL. + (Fgarbage_collect): Don't handle buffer_defaults specially. + (mark_object): Handle new symbol value structure rather than the old + special Lisp_Misc_* objects. + (gc_sweep) : Free also the buffer-local-value objects. + * term.c (set_tty_color_mode): + * bidi.c (bidi_initialize): Don't access the ->value field directly. + * buffer.h (PER_BUFFER_VAR_OFFSET): Don't bother with + a buffer_local_flags. + * print.c (print_object): Get rid of impossible forwarding objects. + +2010-04-19 Eli Zaretskii + + * bidi.c (bidi_get_type, bidi_get_category) + (bidi_at_paragraph_end, bidi_resolve_weak, bidi_resolve_neutral) + (bidi_type_of_next_char, bidi_level_of_next_char): + Declare static. Use `INLINE' rather than `inline'. 2010-04-19 Juanma Barranquero diff --cc src/gtkutil.h index fcd23b65132,7c1e09a1a5e..14693650de5 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@@ -122,89 -123,92 +122,91 @@@ typedef struct _widget_valu extern int use_old_gtk_file_dialog; #endif -extern widget_value *malloc_widget_value P_ ((void)); -extern void free_widget_value P_ ((widget_value *)); - -extern int xg_uses_old_file_dialog P_ ((void)); - -extern char *xg_get_file_name P_ ((FRAME_PTR f, - char *prompt, - char *default_filename, - int mustmatch_p, - int only_dir_p)); - -extern char *xg_get_font_name P_ ((FRAME_PTR f, char *)); - -extern GtkWidget *xg_create_widget P_ ((char *type, - char *name, - FRAME_PTR f, - widget_value *val, - GCallback select_cb, - GCallback deactivate_cb, - GCallback hightlight_cb)); - -extern void xg_modify_menubar_widgets P_ ((GtkWidget *menubar, - FRAME_PTR f, - widget_value *val, - int deep_p, - GCallback select_cb, - GCallback deactivate_cb, - GCallback hightlight_cb)); - -extern int xg_update_frame_menubar P_ ((FRAME_PTR f)); - -extern int xg_event_is_for_menubar P_ ((FRAME_PTR f, XEvent *event)); - -extern int xg_have_tear_offs P_ ((void)); - -extern int xg_get_scroll_id_for_window P_ ((Display *dpy, Window wid)); - -extern void xg_create_scroll_bar P_ ((FRAME_PTR f, - struct scroll_bar *bar, - GCallback scroll_callback, - GCallback end_callback, - char *scroll_bar_name)); -extern void xg_show_scroll_bar P_ ((int scrollbar_id)); -extern void xg_remove_scroll_bar P_ ((FRAME_PTR f, int scrollbar_id)); - -extern void xg_update_scrollbar_pos P_ ((FRAME_PTR f, - int scrollbar_id, - int top, - int left, - int width, - int height)); - -extern void xg_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *bar, - int portion, - int position, - int whole)); -extern int xg_event_is_for_scrollbar P_ ((FRAME_PTR f, XEvent *event)); - -extern void update_frame_tool_bar P_ ((FRAME_PTR f)); -extern void free_frame_tool_bar P_ ((FRAME_PTR f)); - -extern void xg_frame_resized P_ ((FRAME_PTR f, - int pixelwidth, - int pixelheight)); -extern void xg_frame_set_char_size P_ ((FRAME_PTR f, int cols, int rows)); -extern GtkWidget * xg_win_to_widget P_ ((Display *dpy, Window wdesc)); - -extern int xg_display_open P_ ((char *display_name, Display **dpy)); -extern void xg_display_close P_ ((Display *dpy)); -extern GdkCursor * xg_create_default_cursor P_ ((Display *dpy)); - -extern int xg_create_frame_widgets P_ ((FRAME_PTR f)); -extern void x_wm_set_size_hint P_ ((FRAME_PTR f, - long flags, - int user_position)); -extern void xg_set_background_color P_ ((FRAME_PTR f, unsigned long bg)); - -extern void xg_set_frame_icon P_ ((FRAME_PTR f, - Pixmap icon_pixmap, - Pixmap icon_mask)); +extern widget_value *malloc_widget_value (void); +extern void free_widget_value (widget_value *); + +extern int xg_uses_old_file_dialog (void); + +extern char *xg_get_file_name (FRAME_PTR f, + char *prompt, + char *default_filename, + int mustmatch_p, + int only_dir_p); + +extern char *xg_get_font_name (FRAME_PTR f, char *); + +extern GtkWidget *xg_create_widget (char *type, + char *name, + FRAME_PTR f, + widget_value *val, + GCallback select_cb, + GCallback deactivate_cb, + GCallback hightlight_cb); + +extern void xg_modify_menubar_widgets (GtkWidget *menubar, + FRAME_PTR f, + widget_value *val, + int deep_p, + GCallback select_cb, + GCallback deactivate_cb, + GCallback hightlight_cb); + +extern int xg_update_frame_menubar (FRAME_PTR f); + ++extern int xg_event_is_for_menubar (FRAME_PTR f, XEvent *event); ++ +extern int xg_have_tear_offs (void); + +extern int xg_get_scroll_id_for_window (Display *dpy, Window wid); + +extern void xg_create_scroll_bar (FRAME_PTR f, + struct scroll_bar *bar, + GCallback scroll_callback, + GCallback end_callback, + char *scroll_bar_name); +extern void xg_remove_scroll_bar (FRAME_PTR f, int scrollbar_id); + +extern void xg_update_scrollbar_pos (FRAME_PTR f, + int scrollbar_id, + int top, + int left, + int width, + int height); + +extern void xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, + int portion, + int position, + int whole); +extern int xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event); + +extern void update_frame_tool_bar (FRAME_PTR f); +extern void free_frame_tool_bar (FRAME_PTR f); + +extern void xg_frame_resized (FRAME_PTR f, + int pixelwidth, + int pixelheight); +extern void xg_frame_set_char_size (FRAME_PTR f, int cols, int rows); +extern GtkWidget * xg_win_to_widget (Display *dpy, Window wdesc); + +extern void xg_display_open (char *display_name, Display **dpy); +extern void xg_display_close (Display *dpy); +extern GdkCursor * xg_create_default_cursor (Display *dpy); + +extern int xg_create_frame_widgets (FRAME_PTR f); +extern void x_wm_set_size_hint (FRAME_PTR f, + long flags, + int user_position); +extern void xg_set_background_color (FRAME_PTR f, unsigned long bg); + +extern void xg_set_frame_icon (FRAME_PTR f, + Pixmap icon_pixmap, + Pixmap icon_mask); /* Mark all callback data that are Lisp_object:s during GC. */ -extern void xg_mark_data P_ ((void)); +extern void xg_mark_data (void); /* Initialize GTK specific parts. */ -extern void xg_initialize P_ ((void)); +extern void xg_initialize (void); /* Setting scrollbar values invokes the callback. Use this variable to indicate that the callback should do nothing. */ diff --cc src/xfns.c index c2135781811,458904b326a..ee020371683 --- a/src/xfns.c +++ b/src/xfns.c @@@ -398,8 -404,11 +398,9 @@@ x_any_window_to_frame (struct x_display /* Likewise, but consider only the menu bar widget. */ struct frame * - x_menubar_window_to_frame (struct x_display_info *dpyinfo, int wdesc) -x_menubar_window_to_frame (dpyinfo, event) - struct x_display_info *dpyinfo; - XEvent *event; ++x_menubar_window_to_frame (struct x_display_info *dpyinfo, XEvent *event) { + Window wdesc = event->xany.window; Lisp_Object tail, frame; struct frame *f; struct x_output *x; diff --cc src/xmenu.c index 82b315f83cb,64e55b7413c..2fb39339b98 --- a/src/xmenu.c +++ b/src/xmenu.c @@@ -662,18 -683,10 +662,10 @@@ x_activate_menubar (FRAME_PTR f set_frame_menubar (f, 0, 1); BLOCK_INPUT; + popup_activated_flag = 1; #ifdef USE_GTK - /* If we click outside any menu item, the menu bar still grabs. - So we send Press and the Release. If outside, grab is released. - If on a menu item, it is popped up normally. - PutBack is like a stack, so we put back in reverse order. */ - f->output_data.x->saved_menu_event->type = ButtonRelease; - XPutBackEvent (f->output_data.x->display_info->display, - f->output_data.x->saved_menu_event); - f->output_data.x->saved_menu_event->type = ButtonPress; XPutBackEvent (f->output_data.x->display_info->display, f->output_data.x->saved_menu_event); - popup_activated_flag = 1; #else XtDispatchEvent (f->output_data.x->saved_menu_event); #endif diff --cc src/xterm.h index b22c225fed7,c8601b8c43d..5c1213d2bf1 --- a/src/xterm.h +++ b/src/xterm.h @@@ -381,13 -378,14 +381,16 @@@ extern int use_xim #endif /* This checks to make sure we have a display. */ -extern void check_x P_ ((void)); + -extern struct frame *x_window_to_frame P_ ((struct x_display_info *, int)); +extern void check_x (void); + +extern struct frame *x_window_to_frame (struct x_display_info *, int); -extern struct frame *x_any_window_to_frame P_ ((struct x_display_info *, int)); -extern struct frame *x_menubar_window_to_frame P_ ((struct x_display_info *, - XEvent *)); -extern struct frame *x_top_window_to_frame P_ ((struct x_display_info *, int)); +extern struct frame *x_any_window_to_frame (struct x_display_info *, int); - extern struct frame *x_menubar_window_to_frame (struct x_display_info *, int); ++extern struct frame *x_menubar_window_to_frame (struct x_display_info *, ++ XEvent *); ++ +extern struct frame *x_top_window_to_frame (struct x_display_info *, int); #if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK) #define x_any_window_to_frame x_window_to_frame