From b8d5a8fd1a16a30ac42883bfea3f25ecef1e7fde Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 19 Apr 2016 01:20:59 +0300 Subject: [PATCH 01/11] Remove the Meta-CVS VC backend * lisp/obsolete/vc-mcvs.el: Remove the file (bug#20475). * lisp/vc/log-view.el (log-view-extract-comment): Remove the MCVS reference. * doc/misc/efaq-w32.texi (Version control): Same. --- doc/misc/efaq-w32.texi | 1 - etc/NEWS | 3 + lisp/obsolete/vc-mcvs.el | 593 --------------------------------------- lisp/vc/log-view.el | 2 +- lisp/vc/vc-hooks.el | 2 +- 5 files changed, 5 insertions(+), 596 deletions(-) delete mode 100644 lisp/obsolete/vc-mcvs.el diff --git a/doc/misc/efaq-w32.texi b/doc/misc/efaq-w32.texi index fe65da6d612..28c09f69744 100644 --- a/doc/misc/efaq-w32.texi +++ b/doc/misc/efaq-w32.texi @@ -2061,7 +2061,6 @@ Jonathan Arnold has written an @cindex mercurial, version control integration with Emacs @cindex hg, version control integration with Emacs @cindex monotone, version control integration with Emacs -@cindex mcvs, version control integration with Emacs If you are using a graphical revision control tool already, check if it comes with command-line tools. Many such GUI tools are just diff --git a/etc/NEWS b/etc/NEWS index bae42af6d6d..8e78b728b74 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1020,6 +1020,9 @@ customization group. "Copyright-paperwork-exempt: yes". Set 'log-edit-rewrite-tiny-change' nil to disable this. ++++ +*** vc-mcvs.el has been removed. + --- ** VHDL mode now supports VHDL'08. diff --git a/lisp/obsolete/vc-mcvs.el b/lisp/obsolete/vc-mcvs.el deleted file mode 100644 index 4214e4d2d19..00000000000 --- a/lisp/obsolete/vc-mcvs.el +++ /dev/null @@ -1,593 +0,0 @@ -;;; vc-mcvs.el --- VC backend for the Meta-CVS version-control system - -;; Copyright (C) 2003-2016 Free Software Foundation, Inc. - -;; Author: FSF (see vc.el for full credits) -;; Maintainer: None -;; Obsolete-since: 23.1 - -;; 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 . - -;;; Commentary: - -;; ********** READ THIS! ********** -;; -;; This file apparently does not work with the new (as of Emacs 23) -;; VC code. Use at your own risk. Please contact emacs-devel if you -;; can maintain this file and update it to work correctly. -;; -;; ********** READ THIS! ********** - -;; The home page of the Meta-CVS version control system is at -;; -;; http://users.footprints.net/~kaz/mcvs.html -;; -;; This is derived from vc-cvs.el as follows: -;; - cp vc-cvs.el vc-mcvs.el -;; - Replace CVS/ with MCVS/CVS/ -;; - Replace 'CVS with 'MCVS -;; - Replace -cvs- with -mcvs- -;; - Replace most of the rest of CVS to Meta-CVS -;; -;; Then of course started the hacking. Only a small part of the code -;; has been touched and not much more than that was tested, so if -;; you bump into a bug, don't be surprised: just report it to me. -;; -;; What has been partly tested: -;; - C-x v v to start editing a file that was checked out with CVSREAD on. -;; - C-x v v to commit a file -;; - C-x v = -;; - C-x v l -;; - C-x v i -;; - C-x v g -;; - M-x vc-rename-file RET - -;;; Bugs: - -;; - Retrieving tags doesn't filter `cvs update' output and thus -;; parses bogus filenames. Don't know if it harms. - -;;; Code: - -(eval-when-compile (require 'vc)) -(require 'vc-cvs) - -;;; -;;; Customization options -;;; - -(defcustom vc-mcvs-global-switches nil - "Global switches to pass to any Meta-CVS command." - :type '(choice (const :tag "None" nil) - (string :tag "Argument String") - (repeat :tag "Argument List" :value ("") string)) - :version "22.1" - :group 'vc) - -(defcustom vc-mcvs-register-switches nil - "Switches for registering a file into Meta-CVS. -A string or list of strings passed to the checkin program by -\\[vc-register]. If nil, use the value of `vc-register-switches'. -If t, use no switches." - :type '(choice (const :tag "Unspecified" nil) - (const :tag "None" t) - (string :tag "Argument String") - (repeat :tag "Argument List" :value ("") string)) - :version "22.1" - :group 'vc) - -(defcustom vc-mcvs-diff-switches nil - "String or list of strings specifying switches for Meta-CVS diff under VC. -If nil, use the value of `vc-diff-switches'. If t, use no switches." - :type '(choice (const :tag "Unspecified" nil) - (const :tag "None" t) - (string :tag "Argument String") - (repeat :tag "Argument List" :value ("") string)) - :version "22.1" - :group 'vc) - -(defcustom vc-mcvs-header vc-cvs-header - "Header keywords to be inserted by `vc-insert-headers'." - :version "24.1" ; no longer consult the obsolete vc-header-alist - :type '(repeat string) - :group 'vc) - -(defcustom vc-mcvs-use-edit vc-cvs-use-edit - "Non-nil means to use `cvs edit' to \"check out\" a file. -This is only meaningful if you don't use the implicit checkout model -\(i.e. if you have $CVSREAD set)." - :type 'boolean - :version "22.1" - :group 'vc) - -;;; Properties of the backend - -(defalias 'vc-mcvs-revision-granularity 'vc-cvs-revision-granularity) -(defalias 'vc-mcvs-checkout-model 'vc-cvs-checkout-model) - -;;; -;;; State-querying functions -;;; - -;;;###autoload (defun vc-mcvs-registered (file) -;;;###autoload (if (vc-find-root file "MCVS/CVS") -;;;###autoload (progn -;;;###autoload (load "vc-mcvs") -;;;###autoload (vc-mcvs-registered file)))) - -(defun vc-mcvs-root (file) - "Return the root directory of a Meta-CVS project, if any." - (or (vc-file-getprop file 'mcvs-root) - (vc-file-setprop file 'mcvs-root (vc-find-root file "MCVS/CVS")))) - -(defun vc-mcvs-read (file) - (if (file-readable-p file) - (with-temp-buffer - (insert-file-contents file) - (goto-char (point-min)) - (read (current-buffer))))) - -(defun vc-mcvs-map-file (dir file) - (let ((map (vc-mcvs-read (expand-file-name "MCVS/MAP" dir))) - inode) - (dolist (x map inode) - (if (equal (nth 2 x) file) (setq inode (nth 1 x)))))) - -(defun vc-mcvs-registered (file) - (let (root inode cvsfile) - (when (and (setq root (vc-mcvs-root file)) - (setq inode (vc-mcvs-map-file - root (file-relative-name file root)))) - (vc-file-setprop file 'mcvs-inode inode) - ;; Avoid calling `mcvs diff' in vc-workfile-unchanged-p. - (vc-file-setprop file 'vc-checkout-time - (if (vc-cvs-registered - (setq cvsfile (expand-file-name inode root))) - (vc-file-getprop cvsfile 'vc-checkout-time) - ;; The file might not be registered yet because - ;; of lazy-adding. - 0)) - t))) - -(defun vc-mcvs-state (file) - ;; This would assume the Meta-CVS sandbox is synchronized. - ;; (vc-mcvs-cvs state file)) - "Meta-CVS-specific version of `vc-state'." - (if (vc-stay-local-p file) - (let ((state (vc-file-getprop file 'vc-state))) - ;; If we should stay local, use the heuristic but only if - ;; we don't have a more precise state already available. - (if (memq state '(up-to-date edited)) - (vc-mcvs-state-heuristic file) - state)) - (with-temp-buffer - (setq default-directory (vc-mcvs-root file)) - (vc-mcvs-command t 0 file "status") - (vc-cvs-parse-status t)))) - - -(defalias 'vc-mcvs-state-heuristic 'vc-cvs-state-heuristic) - -(defun vc-mcvs-working-revision (file) - (vc-cvs-working-revision - (expand-file-name (vc-file-getprop file 'mcvs-inode) - (vc-file-getprop file 'mcvs-root)))) - -;;; -;;; State-changing functions -;;; -(autoload 'vc-checkout "vc") -(autoload 'vc-switches "vc") - -(defun vc-mcvs-register (files &optional rev comment) - "Register FILES into the Meta-CVS version-control system. -COMMENT can be used to provide an initial description of FILE. -Passes either `vc-mcvs-register-switches' or `vc-register-switches' -to the Meta-CVS command." - ;; FIXME: multiple-file case should be made to work. - (if (> (length files) 1) (error "Registering filesets is not yet supported")) - (let* ((file (car files)) - (filename (file-name-nondirectory file)) - (extpos (string-match "\\." filename)) - (ext (if extpos (substring filename (1+ extpos)))) - (root (vc-mcvs-root file)) - (types-file (expand-file-name "MCVS/TYPES" root)) - (map-file (expand-file-name "MCVS/MAP" root)) - (types (vc-mcvs-read types-file))) - ;; Make sure meta files like MCVS/MAP are not read-only (happens with - ;; CVSREAD) since Meta-CVS doesn't pay attention to it at all and goes - ;; belly-up. - (unless (file-writable-p map-file) - (vc-checkout map-file t)) - (unless (or (file-writable-p types-file) (not (file-exists-p types-file))) - (vc-checkout types-file t)) - ;; Make sure the `mcvs add' will not fire up the CVSEDITOR - ;; to add a rule for the given file's extension. - (when (and ext (not (assoc ext types))) - (let ((type (completing-read "Type to use (default): " - '("default" "name-only" "keep-old" - "binary" "value-only") - nil t nil nil "default"))) - (push (list ext (make-symbol (upcase (concat ":" type)))) types) - (setq types (sort types (lambda (x y) (string< (car x) (car y))))) - (with-current-buffer (find-file-noselect types-file) - (erase-buffer) - (pp types (current-buffer)) - (save-buffer) - (unless (get-buffer-window (current-buffer) t) - (kill-buffer (current-buffer)))))) - ;; Now do the ADD. - (prog1 (apply 'vc-mcvs-command nil 0 file - "add" - (and comment (string-match "[^\t\n ]" comment) - (concat "-m" comment)) - (vc-switches 'MCVS 'register)) - ;; I'm not sure exactly why, but if we don't setup the inode and root - ;; prop of the file, things break later on in vc-mode-line that - ;; ends up calling vc-mcvs-working-revision. - ;; We also need to set vc-checkout-time so that vc-workfile-unchanged-p - ;; doesn't try to call `mcvs diff' on the file. - (vc-mcvs-registered file)))) - -(defalias 'vc-mcvs-responsible-p 'vc-mcvs-root - "Return non-nil if CVS thinks it is responsible for FILE.") - -(defalias 'vc-cvs-could-register 'vc-cvs-responsible-p - "Return non-nil if FILE could be registered in Meta-CVS. -This is only possible if Meta-CVS is responsible for FILE's directory.") - -(defun vc-mcvs-checkin (files rev comment) - "Meta-CVS-specific version of `vc-backend-checkin'." - (unless (or (not rev) (vc-mcvs-valid-revision-number-p rev)) - (if (not (vc-mcvs-valid-symbolic-tag-name-p rev)) - (error "%s is not a valid symbolic tag name" rev) - ;; If the input revision is a valid symbolic tag name, we create it - ;; as a branch, commit and switch to it. - ;; This file-specific form of branching is deprecated. - ;; We can't use `mcvs branch' and `mcvs switch' because they cannot - ;; be applied just to this one file. - (apply 'vc-mcvs-command nil 0 files "tag" "-b" (list rev)) - (apply 'vc-mcvs-command nil 0 files "update" "-r" (list rev)) - (mapc (lambda (file) (vc-file-setprop file 'vc-mcvs-sticky-tag rev)) - files) - (setq rev nil))) - ;; This commit might cvs-commit several files (e.g. MAP and TYPES) - ;; so using numbered revs here is dangerous and somewhat meaningless. - (when rev (error "Cannot commit to a specific revision number")) - (let ((status (apply 'vc-mcvs-command nil 1 files - "ci" "-m" comment - (vc-switches 'MCVS 'checkin)))) - (set-buffer "*vc*") - (goto-char (point-min)) - (when (not (zerop status)) - ;; Check checkin problem. - (cond - ((re-search-forward "Up-to-date check failed" nil t) - (mapc (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge)) - files) - (error "%s" (substitute-command-keys - (concat "Up-to-date check failed: " - "type \\[vc-next-action] to merge in changes")))) - (t - (pop-to-buffer (current-buffer)) - (goto-char (point-min)) - (shrink-window-if-larger-than-buffer) - (error "Check-in failed")))) - ;; Single-file commit? Then update the revision by parsing the buffer. - ;; Otherwise we can't necessarily tell what goes with what; clear - ;; its properties so they have to be refetched. - (if (= (length files) 1) - (vc-file-setprop - (car files) 'vc-working-revision - (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2)) - (mapc (lambda (file) (vc-file-clearprops file)) files)) - ;; Anyway, forget the checkout model of the file, because we might have - ;; guessed wrong when we found the file. After commit, we can - ;; tell it from the permissions of the file (see - ;; vc-mcvs-checkout-model). - (mapc (lambda (file) (vc-file-setprop file 'vc-checkout-model nil)) - files) - - ;; if this was an explicit check-in (does not include creation of - ;; a branch), remove the sticky tag. - (if (and rev (not (vc-mcvs-valid-symbolic-tag-name-p rev))) - (vc-mcvs-command nil 0 files "update" "-A")))) - -(defun vc-mcvs-find-revision (file rev buffer) - (apply 'vc-mcvs-command - buffer 0 file - "-Q" ; suppress diagnostic output - "update" - (and rev (not (string= rev "")) - (concat "-r" rev)) - "-p" - (vc-switches 'MCVS 'checkout))) - -(defun vc-mcvs-checkout (file &optional editable rev) - (message "Checking out %s..." file) - (with-current-buffer (or (get-file-buffer file) (current-buffer)) - (vc-mcvs-update file editable rev (vc-switches 'MCVS 'checkout))) - (vc-mode-line file) - (message "Checking out %s...done" file)) - -(defun vc-mcvs-update (file editable rev switches) - (if (and (file-exists-p file) (not rev)) - ;; If no revision was specified, just make the file writable - ;; if necessary (using `cvs-edit' if requested). - (and editable (not (eq (vc-mcvs-checkout-model (list file)) 'implicit)) - (if vc-mcvs-use-edit - (vc-mcvs-command nil 0 file "edit") - (set-file-modes file (logior (file-modes file) 128)) - (if (equal file buffer-file-name) (read-only-mode -1)))) - ;; Check out a particular revision (or recreate the file). - (vc-file-setprop file 'vc-working-revision nil) - (apply 'vc-mcvs-command nil 0 file - (if editable "-w") - "update" - ;; default for verbose checkout: clear the sticky tag so - ;; that the actual update will get the head of the trunk - (if (or (not rev) (string= rev "")) - "-A" - (concat "-r" rev)) - switches))) - -(defun vc-mcvs-rename-file (old new) - (vc-mcvs-command nil 0 new "move" (file-relative-name old))) - -(autoload 'vc-default-revert "vc") - -(defun vc-mcvs-revert (file &optional contents-done) - "Revert FILE to the working revision it was based on." - (vc-default-revert 'MCVS file contents-done) - (unless (eq (vc-mcvs-checkout-model (list file)) 'implicit) - (if vc-mcvs-use-edit - (vc-mcvs-command nil 0 file "unedit") - ;; Make the file read-only by switching off all w-bits - (set-file-modes file (logand (file-modes file) 3950))))) - -(defun vc-mcvs-merge (file first-revision &optional second-revision) - "Merge changes into current working copy of FILE. -The changes are between FIRST-REVISION and SECOND-REVISION." - (vc-mcvs-command nil 0 file - "update" "-kk" - (concat "-j" first-revision) - (concat "-j" second-revision)) - (vc-file-setprop file 'vc-state 'edited) - (with-current-buffer (get-buffer "*vc*") - (goto-char (point-min)) - (if (re-search-forward "conflicts during merge" nil t) - 1 ; signal error - 0))) ; signal success - -(defun vc-mcvs-merge-news (file) - "Merge in any new changes made to FILE." - (message "Merging changes into %s..." file) - ;; (vc-file-setprop file 'vc-working-revision nil) - (vc-file-setprop file 'vc-checkout-time 0) - (vc-mcvs-command nil 0 file "update") - ;; Analyze the merge result reported by Meta-CVS, and set - ;; file properties accordingly. - (with-current-buffer (get-buffer "*vc*") - (goto-char (point-min)) - ;; get new working revision - (if (re-search-forward - "^Merging differences between [0-9.]* and \\([0-9.]*\\) into" nil t) - (vc-file-setprop file 'vc-working-revision (match-string 1)) - (vc-file-setprop file 'vc-working-revision nil)) - ;; get file status - (prog1 - (if (eq (buffer-size) 0) - 0 ;; there were no news; indicate success - (if (re-search-forward - (concat "^\\([CMUP] \\)?" - ".*" - "\\( already contains the differences between \\)?") - nil t) - (cond - ;; Merge successful, we are in sync with repository now - ((or (match-string 2) - (string= (match-string 1) "U ") - (string= (match-string 1) "P ")) - (vc-file-setprop file 'vc-state 'up-to-date) - (vc-file-setprop file 'vc-checkout-time - (nth 5 (file-attributes file))) - 0);; indicate success to the caller - ;; Merge successful, but our own changes are still in the file - ((string= (match-string 1) "M ") - (vc-file-setprop file 'vc-state 'edited) - 0);; indicate success to the caller - ;; Conflicts detected! - (t - (vc-file-setprop file 'vc-state 'edited) - 1);; signal the error to the caller - ) - (pop-to-buffer "*vc*") - (error "Couldn't analyze mcvs update result"))) - (message "Merging changes into %s...done" file)))) - -(defun vc-mcvs-modify-change-comment (files rev comment) - "Modify the change comments for FILES on a specified REV. -Will fail unless you have administrative privileges on the repo." - (vc-mcvs-command nil 0 files "rcs" (concat "-m" comment ":" rev))) - - -;;; -;;; History functions -;;; - -(defun vc-mcvs-print-log (files &optional buffer) - "Get change log associated with FILES." - (let ((default-directory (vc-mcvs-root (car files)))) - ;; Run the command from the root dir so that `mcvs filt' returns - ;; valid relative names. - (vc-mcvs-command - buffer - (if (vc-stay-local-p files) 'async 0) - files "log"))) - -(defun vc-mcvs-diff (files &optional oldvers newvers buffer) - "Get a difference report using Meta-CVS between two revisions of FILES." - (let* ((async (and (not vc-disable-async-diff) - (vc-stay-local-p files))) - ;; Run the command from the root dir so that `mcvs filt' returns - ;; valid relative names. - (default-directory (vc-mcvs-root (car files))) - (status - (apply 'vc-mcvs-command (or buffer "*vc-diff*") - (if async 'async 1) - files "diff" - (and oldvers (concat "-r" oldvers)) - (and newvers (concat "-r" newvers)) - (vc-switches 'MCVS 'diff)))) - (if async 1 status))) ; async diff, pessimistic assumption. - -(defun vc-mcvs-annotate-command (file buffer &optional revision) - "Execute \"mcvs annotate\" on FILE, inserting the contents in BUFFER. -Optional arg REVISION is a revision to annotate from." - (vc-mcvs-command - buffer - (if (vc-stay-local-p file) 'async 0) - file "annotate" (if revision (concat "-r" revision))) - (with-current-buffer buffer - (goto-char (point-min)) - (re-search-forward "^[0-9]") - (delete-region (point-min) (1- (point))))) - -(defalias 'vc-mcvs-annotate-current-time 'vc-cvs-annotate-current-time) -(defalias 'vc-mcvs-annotate-time 'vc-cvs-annotate-time) - -;;; -;;; Tag system -;;; - -(defun vc-mcvs-create-tag (dir name branchp) - "Assign to DIR's current revision a given NAME. -If BRANCHP is non-nil, the name is created as a branch (and the current -workspace is immediately moved to that new branch)." - (if (not branchp) - (vc-mcvs-command nil 0 dir "tag" "-c" name) - (vc-mcvs-command nil 0 dir "branch" name) - (vc-mcvs-command nil 0 dir "switch" name))) - -;; vc-mcvs-command calls the autoloaded vc-do-command from vc-dispatcher. -(declare-function vc-resynch-buffer "vc-dispatcher" - (file &optional keep noquery reset-vc-info)) - -(defun vc-mcvs-retrieve-tag (dir name update) - "Retrieve a tag at and below DIR. -NAME is the name of the tag; if it is empty, do a `cvs update'. -If UPDATE is non-nil, then update (resynch) any affected buffers." - (with-current-buffer (get-buffer-create "*vc*") - (let ((default-directory dir) - (sticky-tag)) - (erase-buffer) - (if (or (not name) (string= name "")) - (vc-mcvs-command t 0 nil "update") - (vc-mcvs-command t 0 nil "update" "-r" name) - (setq sticky-tag name)) - (when update - (goto-char (point-min)) - (while (not (eobp)) - (if (looking-at "\\([CMUP]\\) \\(.*\\)") - (let* ((file (expand-file-name (match-string 2) dir)) - (state (match-string 1)) - (buffer (find-buffer-visiting file))) - (when buffer - (cond - ((or (string= state "U") - (string= state "P")) - (vc-file-setprop file 'vc-state 'up-to-date) - (vc-file-setprop file 'vc-working-revision nil) - (vc-file-setprop file 'vc-checkout-time - (nth 5 (file-attributes file)))) - ((or (string= state "M") - (string= state "C")) - (vc-file-setprop file 'vc-state 'edited) - (vc-file-setprop file 'vc-working-revision nil) - (vc-file-setprop file 'vc-checkout-time 0))) - (vc-file-setprop file 'vc-mcvs-sticky-tag sticky-tag) - (vc-resynch-buffer file t t)))) - (forward-line 1)))))) - - -;;; -;;; Miscellaneous -;;; - -(defalias 'vc-mcvs-make-version-backups-p 'vc-stay-local-p - "Return non-nil if version backups should be made for FILE.") -(defalias 'vc-mcvs-check-headers 'vc-cvs-check-headers) - - -;;; -;;; Internal functions -;;; - -(defun vc-mcvs-command (buffer okstatus file &rest flags) - "A wrapper around `vc-do-command' for use in vc-mcvs.el. -The difference to vc-do-command is that this function always invokes `mcvs', -and that it passes `vc-mcvs-global-switches' to it before FLAGS." - (let ((args (append '("--error-terminate") - (if (stringp vc-mcvs-global-switches) - (cons vc-mcvs-global-switches flags) - (append vc-mcvs-global-switches flags))))) - (if (not (member (car flags) '("diff" "log" "status"))) - ;; No need to filter: do it the easy way. - (apply 'vc-do-command (or buffer "*vc*") okstatus "mcvs" file args) - ;; We need to filter the output. - ;; The output of the filter uses filenames relative to the root, - ;; so we need to change the default-directory. - ;; (assert (equal default-directory (vc-mcvs-root file))) - (vc-do-command - (or buffer "*vc*") okstatus "sh" nil "-c" - (concat "mcvs " - (mapconcat - 'shell-quote-argument - (append (remq nil args) - (if file (list (file-relative-name file)))) - " ") - " | mcvs filt"))))) - -(defun vc-mcvs-repository-hostname (dirname) - (vc-cvs-repository-hostname (vc-mcvs-root dirname))) - -(defun vc-mcvs-dir-state-heuristic (dir) - "Find the Meta-CVS state of all files in DIR, using only local information." - (with-temp-buffer - (vc-cvs-get-entries dir) - (goto-char (point-min)) - (while (not (eobp)) - ;; Meta-MCVS-removed files are not taken under VC control. - (when (looking-at "/\\([^/]*\\)/[^/-]") - (let ((file (expand-file-name (match-string 1) dir))) - (unless (vc-file-getprop file 'vc-state) - (vc-cvs-parse-entry file t)))) - (forward-line 1)))) - -(defalias 'vc-mcvs-valid-symbolic-tag-name-p 'vc-cvs-valid-symbolic-tag-name-p) -(defalias 'vc-mcvs-valid-revision-number-p 'vc-cvs-valid-revision-number-p) - -(provide 'vc-mcvs) - -;; ********** READ THIS! ********** -;; -;; This file apparently does not work with the new (as of Emacs 23) -;; VC code. Use at your own risk. Please contact emacs-devel if you -;; can maintain this file and update it to work correctly. -;; -;; ********** READ THIS! ********** - -;;; vc-mcvs.el ends here diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el index 34ffb3c93b5..63d50033eec 100644 --- a/lisp/vc/log-view.el +++ b/lisp/vc/log-view.el @@ -542,7 +542,7 @@ If called interactively, visit the version at point." (setq en (point)) (or (log-view-current-entry nil t) (throw 'beginning-of-buffer nil)) - (cond ((memq backend '(SCCS RCS CVS MCVS SVN)) + (cond ((memq backend '(SCCS RCS CVS SVN)) (forward-line 2)) ((eq backend 'Hg) (forward-line 4) diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 4b5ec27d3ca..b3644cc1ac5 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -122,7 +122,7 @@ An empty list disables VC altogether." :group 'vc) ;; Note: we don't actually have a darcs back end yet. -;; Also, Meta-CVS (corresponding to MCVS) and Arch are unsupported. +;; Also, Arch is unsupported, and the Meta-CVS back end has been removed. ;; The Arch back end will be retrieved and fixed if it is ever required. (defcustom vc-directory-exclusion-list (purecopy '("SCCS" "RCS" "CVS" "MCVS" ".src" ".svn" ".git" ".hg" ".bzr" From ce0d8c7f2d8187942a8b45c3a71c22c5f30fa37d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 19 Apr 2016 18:06:52 +0300 Subject: [PATCH 02/11] Make tmm-menubar work in correct order again * lisp/tmm.el (tmm-prompt): Don't reverse 'tmm-km-list' right at the beginning; instead, pass a reversed copy to 'tmm--completion-table'. (Bug#23309) (tmm-menubar): Fix an off-by-one error in determining the menu item when the function is called with a non-nil 'x-position' argument. --- lisp/tmm.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lisp/tmm.el b/lisp/tmm.el index 714de9230e7..d1a08ab2623 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -72,13 +72,15 @@ to invoke `tmm-menubar' instead, customize the variable (tmm-get-keybind [menu-bar])) (setq menu-bar `(keymap ,@(nreverse menu-bar) ,@(nreverse menu-end))) (if x-position - (let ((column 0)) + (let ((column 0) + prev-key) (catch 'done (map-keymap (lambda (key binding) (when (> column x-position) - (setq menu-bar-item key) + (setq menu-bar-item prev-key) (throw 'done nil)) + (setq prev-key key) (pcase binding ((or `(,(and (pred stringp) name) . ,_) ;Simple menu item. `(menu-item ,name ,_cmd ;Extended menu item. @@ -187,7 +189,6 @@ Its value should be an event that has a binding in MENU." ((vectorp elt) (dotimes (i (length elt)) (tmm-get-keymap (cons i (aref elt i)) not-menu)))))) - (setq tmm-km-list (nreverse tmm-km-list)) ;; Choose an element of tmm-km-list; put it in choice. (if (and not-menu (= 1 (length tmm-km-list))) ;; If this is the top-level of an x-popup-menu menu, @@ -239,10 +240,17 @@ Its value should be an event that has a binding in MENU." (if default-item (car (nth index-of-default tmm-km-list)) (minibuffer-with-setup-hook #'tmm-add-prompt + ;; tmm-km-list is reversed, because history + ;; needs it in LIFO order. But completion + ;; needs it in non-reverse order, so that the + ;; menu items are displayed as completion + ;; candidates in the order they are shown on + ;; the menu bar. So pass completing-read the + ;; reversed copy of the list. (completing-read (concat gl-str " (up/down to change, PgUp to menu): ") - (tmm--completion-table tmm-km-list) nil t nil + (tmm--completion-table (reverse tmm-km-list)) nil t nil (cons 'tmm--history (- (* 2 history-len) index-of-default)))))))) (setq choice (cdr (assoc out tmm-km-list))) From aa03257cb341691562101fcae8a6d6d54d420a99 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 20 Apr 2016 17:52:25 +0300 Subject: [PATCH 03/11] Clarify documentation of 'dired-mark-files-containing-regexp' * doc/emacs/dired.texi (Marks vs Flags): Clarify that for files visited in buffers, 'dired-mark-files-containing-regexp' searches the buffer rather than the file on disk. (Bug#22694) * lisp/dired.el (dired-mark-files-containing-regexp): Clarify that for files visited in buffers, 'dired-mark-files-containing-regexp' searches the buffer rather than the file on disk. (Bug#22694) --- doc/emacs/dired.texi | 8 +++++++- lisp/dired.el | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 8a72805f7fc..ea48a26500c 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -550,7 +550,13 @@ Mark (with @samp{*}) all files whose @emph{contents} contain a match for the regular expression @var{regexp} (@code{dired-mark-files-containing-regexp}). This command is like @kbd{% m}, except that it searches the file contents instead of the file -name. +name. Note that if a file is visited in an Emacs buffer, this command +will look in the buffer without revisiting the file, so the results +might be inconsistent with the file on disk if its contents has changed +since it was last visited. If you don't want this, you may wish +reverting the files you have visited in your buffers, or turning on +the @code{auto-revert} mode in those buffers, before invoking this +command. @xref{Reverting}. @item C-/ @itemx C-x u diff --git a/lisp/dired.el b/lisp/dired.el index 5741872cfc8..f1adcb4c3db 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3353,7 +3353,12 @@ object files--just `.o' will mark more than you might think." (defun dired-mark-files-containing-regexp (regexp &optional marker-char) "Mark all files with contents containing REGEXP for use in later commands. A prefix argument means to unmark them instead. -`.' and `..' are never marked." +`.' and `..' are never marked. + +Note that if a file is visited in an Emacs buffer, this command will +look in the buffer without revisiting the file, so the results might +be inconsistent with the file on disk if its contents has changed +since it was last visited." (interactive (list (read-regexp (concat (if current-prefix-arg "Unmark" "Mark") " files containing (regexp): ") From 645f4ef13e6658e570cb6366ee3f2bc2dda8cce3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 21 Apr 2016 05:06:26 +0300 Subject: [PATCH 04/11] Revert "Use 'grep-find-program' in check-declare.el" This reverts commit 33bef6e90bfd20609d044b8a076c1570c627684a. --- lisp/emacs-lisp/check-declare.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el index b8a00b3fb4e..b6fa0546088 100644 --- a/lisp/emacs-lisp/check-declare.el +++ b/lisp/emacs-lisp/check-declare.el @@ -339,7 +339,7 @@ Returns non-nil if any false statements are found." errlist files) (message "%s" m) (message "%s" m2) - (setq files (process-lines grep-find-program root + (setq files (process-lines find-program root "-name" "*.el" "-exec" grep-program "-l" "^[ \t]*(declare-function" "{}" ";")) From 570e0fa357eabb76babf87343d5b9c8ae13e9e53 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 21 Apr 2016 05:07:27 +0300 Subject: [PATCH 05/11] Revert "Don't use 'find-program'" This reverts commit 10597c977d55cbf9304b51c3b364ce58199384a0. --- lisp/progmodes/project.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 82059c91363..9c8a88c80fc 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -162,7 +162,7 @@ end it with `/'. DIR must be one of `project-roots' or DIRS is a list of absolute directories; it should be some subset of the project roots and external roots. -The default implementation uses `grep-find-program'. PROJECT is used +The default implementation uses `find-program'. PROJECT is used to find the list of ignores for each directory." ;; FIXME: Uniquely abbreviate the roots? (require 'xref) @@ -171,7 +171,7 @@ to find the list of ignores for each directory." (lambda (dir) (let ((command (format "%s %s %s -type f -print0" - grep-find-program + find-program dir (xref--find-ignores-arguments (project-ignores project dir) From 1ba947f275b9675e4c2802cfca52468ff84cfc5e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 21 Apr 2016 05:08:29 +0300 Subject: [PATCH 06/11] Revert "Allow to customize names of executables used by grep.el" This reverts commit c93ae7a1e5a94541189a8f36984014344d561ffc. --- lisp/progmodes/grep.el | 48 ++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 5d1b68a192d..f04a7226d18 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -411,34 +411,21 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies This gets tacked on the end of the generated expressions.") ;;;###autoload -(defcustom grep-program (purecopy "grep") +(defvar grep-program (purecopy "grep") "The default grep program for `grep-command' and `grep-find-command'. -This variable's value takes effect when `grep-compute-defaults' is called." - :type 'string - :version "25.1" - :group 'grep) +This variable's value takes effect when `grep-compute-defaults' is called.") ;;;###autoload -(defcustom grep-find-program (purecopy "find") +(defvar find-program (purecopy "find") "The default find program. This is used by commands like `grep-find-command', `find-dired' -and others." - :type 'string - :version "25.1" - :group 'grep) - -(define-obsolete-variable-alias 'find-program 'grep-find-program "25.1") +and others.") ;;;###autoload -(defcustom grep-xargs-program (purecopy "xargs") +(defvar xargs-program (purecopy "xargs") "The default xargs program for `grep-find-command'. See `grep-find-use-xargs'. -This variable's value takes effect when `grep-compute-defaults' is called." - :type 'string - :version "25.1" - :group 'grep) - -(define-obsolete-variable-alias 'xargs-program 'grep-xargs-program "25.1") +This variable's value takes effect when `grep-compute-defaults' is called.") ;;;###autoload (defvar grep-find-use-xargs nil @@ -608,14 +595,13 @@ This function is called from `compilation-filter-hook'." (unless grep-find-use-xargs (setq grep-find-use-xargs (cond - ((grep-probe grep-find-program + ((grep-probe find-program `(nil nil nil ,null-device "-exec" "echo" "{}" "+")) 'exec-plus) ((and - (grep-probe grep-find-program - `(nil nil nil ,null-device "-print0")) - (grep-probe grep-xargs-program `(nil nil nil "-0" "echo"))) + (grep-probe find-program `(nil nil nil ,null-device "-print0")) + (grep-probe xargs-program `(nil nil nil "-0" "echo"))) 'gnu) (t 'exec)))) @@ -626,11 +612,10 @@ This function is called from `compilation-filter-hook'." ;; after the pipe symbol be quoted if they use ;; forward slashes as directory separators. (format "%s . -type f -print0 | \"%s\" -0 %s" - grep-find-program grep-xargs-program - grep-command)) + find-program xargs-program grep-command)) ((memq grep-find-use-xargs '(exec exec-plus)) (let ((cmd0 (format "%s . -type f -exec %s" - grep-find-program grep-command)) + find-program grep-command)) (null (if grep-use-null-device (format "%s " null-device) ""))) @@ -642,8 +627,7 @@ This function is called from `compilation-filter-hook'." (1+ (length cmd0))))) (t (format "%s . -type f -print | \"%s\" %s" - grep-find-program grep-xargs-program - grep-command))))) + find-program xargs-program grep-command))))) (unless grep-find-template (setq grep-find-template (let ((gcmd (format "%s %s " @@ -653,17 +637,17 @@ This function is called from `compilation-filter-hook'." ""))) (cond ((eq grep-find-use-xargs 'gnu) (format "%s -type f -print0 | \"%s\" -0 %s" - grep-find-program grep-xargs-program gcmd)) + find-program xargs-program gcmd)) ((eq grep-find-use-xargs 'exec) (format "%s -type f -exec %s {} %s%s" - grep-find-program gcmd null + find-program gcmd null (shell-quote-argument ";"))) ((eq grep-find-use-xargs 'exec-plus) (format "%s -type f -exec %s %s{} +" - grep-find-program gcmd null)) + find-program gcmd null)) (t (format "%s -type f -print | \"%s\" %s" - grep-find-program grep-xargs-program gcmd)))))))) + find-program xargs-program gcmd)))))))) ;; Save defaults for this host. (setq grep-host-defaults-alist From a77cf24ada2f89194c0ac64aae27bcdf7021e697 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 21 Apr 2016 05:27:58 +0300 Subject: [PATCH 07/11] Document 'help-go-forward' * doc/emacs/help.texi (Help Mode): Document and index 'help-go-forward'. (Bug#23323) --- doc/emacs/help.texi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index ed813ff0bf6..172d058f857 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -410,6 +410,8 @@ Follow a hyperlink that you click on. @item C-c C-c Show all documentation about the symbol at point (@code{help-follow-symbol}). +@item C-c C-f +Go forward to the next help topic (@code{help-go-forward}). @item C-c C-b Go back to the previous help topic (@code{help-go-back}). @end table @@ -417,15 +419,18 @@ Go back to the previous help topic (@code{help-go-back}). @cindex hyperlink @findex help-follow @findex help-go-back +@findex help-go-forward @kindex RET @r{(Help mode)} @kindex C-c C-b @r{(Help mode)} +@kindex C-c C-f @r{(Help mode)} When a function name, variable name, or face name (@pxref{Faces}) appears in the documentation in the help buffer, it is normally an underlined @dfn{hyperlink}. To view the associated documentation, move point there and type @key{RET} (@code{help-follow}), or click on the hyperlink with @kbd{Mouse-1} or @kbd{Mouse-2}. Doing so replaces the contents of the help buffer; to retrace your steps, type @kbd{C-c -C-b} (@code{help-go-back}). +C-b} (@code{help-go-back}). While retracing your steps, you can go +forward by using @kbd{C-c C-b} (@code{help-go-forward}). @cindex URL, viewing in help @cindex help, viewing web pages From 401857eda39c57bd59a1e3a1dee57fd6420eeab5 Mon Sep 17 00:00:00 2001 From: Ilya Zakharevich Date: Thu, 21 Apr 2016 19:08:16 +0300 Subject: [PATCH 08/11] Fix Alt-modified keys on some European MS-Windows keyboards * src/w32fns.c (deliver_wm_chars): If the reported character is ASCII, AND Meta modifier is a candidate, behave as if Meta is present, i.e. fall back to the legacy code. (Bug#23251) --- src/w32fns.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/w32fns.c b/src/w32fns.c index b9002bae770..c57b5a188b2 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -3154,9 +3154,45 @@ deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, UINT wParam, SHORT r = VkKeyScanW (*b), bitmap = 0x1FF; FPRINTF_WM_CHARS((stderr, "VkKeyScanW %#06x %#04x\n", (int)r, - wParam)); + wParam)); if ((r & 0xFF) == wParam) bitmap = r>>8; /* *b is reachable via simple interface */ + else + { + /* VkKeyScanW() (essentially) returns the FIRST key with + the specified character; so here the pressed key is the + SECONDARY key producing the character. + + Essentially, we have no information about the "role" of + modifiers on this key: which contribute into the + produced character (so "are consumed"), and which are + "extra" (must attache to bindable events). + + The default above would consume ALL modifiers, so the + character is reported "as is". However, on many layouts + the ordering of the keys (in the layout table) is not + thought out well, so the "secondary" keys are often those + which the users would prefer to use with Alt-CHAR. + (Moreover - with e.g. Czech-QWERTY - the ASCII + punctuation is accessible from two equally [nu]preferable + AltGr-keys.) + + SO: Heuristic: if the reported char is ASCII, AND Meta + modifier is a candidate, behave as if Meta is present + (fallback to the legacy branch; bug#23251). + + (This would break layouts + - delivering ASCII characters + - on SECONDARY keys + - with not Shift/AltGr-like modifier combinations. + All 3 conditions together must be pretty exotic + cases - and a workaround exists: use "primary" keys!) */ + if (*b < 0x80 + && (wmsg.dwModifiers + & (alt_modifier | meta_modifier + | super_modifier | hyper_modifier))) + return 0; + } if (*type_CtrlAlt == 'a') /* Simple Alt seen */ { if ((bitmap & ~1) == 0) /* 1: KBDSHIFT */ From 2b31a0c21e51d39a82572a32d2d31b5a2aa174a3 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 22 Apr 2016 11:56:03 +0200 Subject: [PATCH 09/11] In x_set_window_size restore do_pending_window_change calls * src/xterm.c (x_set_window_size): * src/w32term.c (x_set_window_size): Restore do_pending_window_change calls after their stupid removal on 2015-08-31. --- src/w32term.c | 2 ++ src/xterm.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/w32term.c b/src/w32term.c index 62ad4eb086b..51743f8f94d 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -6231,6 +6231,8 @@ x_set_window_size (struct frame *f, bool change_gravity, } unblock_input (); + + do_pending_window_change (false); } /* Mouse warping. */ diff --git a/src/xterm.c b/src/xterm.c index ba9bf50de31..2f8e0775909 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10746,6 +10746,8 @@ x_set_window_size (struct frame *f, bool change_gravity, cancel_mouse_face (f); unblock_input (); + + do_pending_window_change (false); } /* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F. */ From 162e549c4e1b2461bd5e86f9bd062da036c230fe Mon Sep 17 00:00:00 2001 From: Nicolas Petton Date: Fri, 22 Apr 2016 18:50:26 +0200 Subject: [PATCH 10/11] * admin/authors.el (authors-ignored-files): Additions. --- admin/authors.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/admin/authors.el b/admin/authors.el index ecdd5ca7741..f1aa2fa4428 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -279,7 +279,7 @@ Changes to files matching one of the regexps in this list are not listed.") "ChangeLog.nextstep" "Emacs.clr" "spec.txt" "gfdl.1" "texi/Makefile.in" - "lwlib/autodeps.mk" + "autodeps.mk" "oldXMenu/autodeps.mk" "src/autodeps.mk" "Imakefile" "icons/sink.ico" "aixcc.lex" @@ -371,7 +371,7 @@ Changes to files matching one of the regexps in this list are not listed.") "lib/qset-acl.c" "lib/qcopy-acl.c" "lib/file-has-acl.c" ;; files from old MS Windows build procedures "makefile.w32-in" - "admin/unidata/makefile.w32-in" + "unidata/makefile.w32-in" "lib/makefile.w32-in" "leim/makefile.w32-in" "src/makefile.w32-in" @@ -691,7 +691,8 @@ Changes to files in this list are not listed.") "mh-exec.el" "mh-init.el" "mh-customize.el" "net/zone-mode.el" "xesam.el" "term/mac-win.el" "sup-mouse.el" - "term/vt102.el" "term/vt201.el" "term/vt220.el" "term/vt300.el" + "term/apollo.el" + "term/vt102.el" "term/vt125.el" "term/vt201.el" "term/vt220.el" "term/vt300.el" "term/vt320.el" "term/vt400.el" "term/vt420.el" "url-https.el" "org-mac-message.el" "org-mew.el" "org-w3m.el" "org-vm.el" "org-wl.el" From 78f9af707f711121ba24d8dce88d6757683a4dfe Mon Sep 17 00:00:00 2001 From: Nicolas Petton Date: Fri, 22 Apr 2016 18:54:52 +0200 Subject: [PATCH 11/11] ; ChangeLog fixes * ChangeLog.2: * lisp/ChangeLog.17: Fix ChangeLog entries --- ChangeLog.2 | 2 +- lisp/ChangeLog.17 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.2 b/ChangeLog.2 index 2197c41b1c4..eb336c767e9 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -10064,7 +10064,7 @@ * lisp/net/soap-inspect.el: Remove version header. - * soap-client.el, soap-inspect.el, jira2.el: Fix first line header + * lisp/net/soap-client.el, lisp/net/soap-inspect.el: Fix first line header format. 2015-11-11 Alan Mackenzie diff --git a/lisp/ChangeLog.17 b/lisp/ChangeLog.17 index ee03661ece0..29081d3f3cd 100644 --- a/lisp/ChangeLog.17 +++ b/lisp/ChangeLog.17 @@ -6835,7 +6835,7 @@ console as well (bug#18629). * w32-common-fns.el: Remove. * loadup.el: Don't load w32-common-fns.el. - * w32-fns.elc: Don't require w32-common-fns. + * w32-fns.el: Don't require w32-common-fns. * icomplete.el: Move Iswitchb autoload here. Much simpler. * obsolete/iswitchb.el (iswitchb-mode): Use normal autoload cookie.