From ee9272ffeacaae4fa98f9d9c94304360f5feba24 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 31 Jul 2007 13:14:33 +0000 Subject: [PATCH 01/31] (server-window): Add switch-to-buffer-other-frame option. --- lisp/ChangeLog | 4 ++++ lisp/server.el | 1 + 2 files changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 78d0aca39f0..15d80adef57 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-07-31 Stefan Monnier + + * server.el (server-window): Add switch-to-buffer-other-frame option. + 2007-07-30 Dan Nicolaescu * vc-git.el: (vc-directory-exclusion-list, vc-handled-backends): diff --git a/lisp/server.el b/lisp/server.el index 1b64e443752..8f7f7785392 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -164,6 +164,7 @@ Only programs can do so." :match (lambda (widget value) (not (functionp value))) nil) + (function-item :tag "Display in new frame" switch-to-buffer-other-frame) (function-item :tag "Use pop-to-buffer" pop-to-buffer) (function :tag "Other function"))) From a0e5e0759c5d41e10732f6db7b80033ad78c8060 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 31 Jul 2007 15:26:05 +0000 Subject: [PATCH 02/31] * vc-bzr.el: New file (copied from the trunk). * vc-hooks.el (vc-handled-backends): Add BZR. --- lisp/ChangeLog | 4 + lisp/vc-bzr.el | 511 +++++++++++++++++++++++++++++++++++++++++++++++ lisp/vc-hooks.el | 2 +- 3 files changed, 516 insertions(+), 1 deletion(-) create mode 100644 lisp/vc-bzr.el diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 15d80adef57..0d97b7b6ea5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2007-07-31 Stefan Monnier + * vc-bzr.el: New file (copied from the trunk). + + * vc-hooks.el (vc-handled-backends): Add BZR. + * server.el (server-window): Add switch-to-buffer-other-frame option. 2007-07-30 Dan Nicolaescu diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el new file mode 100644 index 00000000000..6a8f930f00f --- /dev/null +++ b/lisp/vc-bzr.el @@ -0,0 +1,511 @@ +;;; vc-bzr.el --- VC backend for the bzr revision control system + +;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. + +;; NOTE: THIS IS A MODIFIED VERSION OF Dave Love's vc-bzr.el, +;; which you can find at: http://www.loveshack.ukfsn.org/emacs/vc-bzr.el +;; I could not get in touch with Dave Love by email, so +;; I am releasing my changes separately. -- Riccardo + +;; Author: Dave Love , Riccardo Murri +;; Keywords: tools +;; Created: Sept 2006 +;; Version: 2007-05-24 +;; URL: http://launchpad.net/vc-bzr + +;; This file 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, or (at your option) +;; any later version. + +;; This file 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; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + + +;;; Commentary: + +;; NOTE: THIS IS A MODIFIED VERSION OF Dave Love's vc-bzr.el, +;; which you can find at: http://www.loveshack.ukfsn.org/emacs/vc-bzr.el + +;; See concerning bzr. + +;; Load this library to register bzr support in VC. It covers basic VC +;; functionality, but was only lightly exercised with a few Emacs/bzr +;; version combinations, namely those current on the authors' PCs. +;; See various Fixmes below. + + +;; Known bugs +;; ========== + +;; When edititing a symlink and *both* the symlink and its target +;; are bzr-versioned, `vc-bzr` presently runs `bzr status` on the +;; symlink, thereby not detecting whether the actual contents +;; (that is, the target contents) are changed. +;; See https://bugs.launchpad.net/vc-bzr/+bug/116607 + +;; For an up-to-date list of bugs, please see: +;; https://bugs.launchpad.net/vc-bzr/+bugs + + +;;; Code: + +(eval-when-compile + (require 'cl) + (require 'vc)) ; for vc-exec-after + +;; Clear up the cache to force vc-call to check again and discover +;; new functions when we reload this file. +(put 'BZR 'vc-functions nil) + +(defgroup vc-bzr nil + "VC bzr backend." +;; :version "22" + :group 'vc) + +(defcustom vc-bzr-program "bzr" + "Name of the bzr command (excluding any arguments)." + :group 'vc-bzr + :type 'string) + +;; Fixme: there's probably no call for this. +(defcustom vc-bzr-program-args nil + "List of global arguments to pass to `vc-bzr-program'." + :group 'vc-bzr + :type '(repeat string)) + +(defcustom vc-bzr-diff-switches nil + "String/list of strings specifying extra switches for bzr diff under VC." + :type '(choice (const :tag "None" nil) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :group 'vc-bzr) + +;; since v0.9, bzr supports removing the progress indicators +;; by setting environment variable BZR_PROGRESS_BAR to "none". +(defun vc-bzr-command (bzr-command buffer okstatus file-or-list &rest args) + "Wrapper round `vc-do-command' using `vc-bzr-program' as COMMAND. +Invoke the bzr command adding `BZR_PROGRESS_BAR=none' to the environment." + (let ((process-environment + (list* "BZR_PROGRESS_BAR=none" ; Suppress progress output (bzr >=0.9) + "LC_ALL=C" ; Force English output + process-environment)) + ;; bzr may attempt some kind of user interaction if its stdin/stdout + ;; is connected to a PTY; therefore, ask Emacs to use a pipe to + ;; communicate with it. + ;; This is redundant because vc-do-command does it already. --Stef + (process-connection-type nil)) + (apply 'vc-do-command buffer okstatus vc-bzr-program + file-or-list bzr-command (append vc-bzr-program-args args)))) + + +;;;###autoload +(defconst vc-bzr-admin-dirname ".bzr") ; FIXME: "_bzr" on w32? + +;;;###autoload (defun vc-bzr-registered (file) +;;;###autoload (if (vc-find-root file vc-bzr-admin-dirname) +;;;###autoload (progn +;;;###autoload (load "vc-bzr") +;;;###autoload (vc-bzr-registered file)))) + +(defun vc-bzr-root-dir (file) + "Return the root directory in the hierarchy above FILE. +Return nil if there isn't one." + (vc-find-root file vc-bzr-admin-dirname)) + +(defun vc-bzr-registered (file) + "Return non-nil if FILE is registered with bzr." + (if (vc-bzr-root-dir file) ; Short cut. + (vc-bzr-state file))) ; Expensive. + +(defun vc-bzr-buffer-nonblank-p (&optional buffer) + "Return non-nil if BUFFER contains any non-blank characters." + (or (> (buffer-size buffer) 0) + (save-excursion + (set-buffer (or buffer (current-buffer))) + (goto-char (point-min)) + (re-search-forward "[^ \t\n]" (point-max) t)))) + +(defconst vc-bzr-state-words + "added\\|ignored\\|modified\\|removed\\|renamed\\|unknown" + "Regexp matching file status words as reported in `bzr' output.") + +;; FIXME: Also get this in a non-registered sub-directory. +(defun vc-bzr-state (file) + (with-temp-buffer + (cd (file-name-directory file)) + (let ((ret (vc-bzr-command "status" t 255 file)) + (state 'up-to-date)) + ;; the only secure status indication in `bzr status' output + ;; is a couple of lines following the pattern:: + ;; | : + ;; | + ;; if the file is up-to-date, we get no status report from `bzr', + ;; so if the regexp search for the above pattern fails, we consider + ;; the file to be up-to-date. + (goto-char (point-min)) + (when + (re-search-forward + (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+" + (file-name-nondirectory file) "[ \t\n]*$") + (point-max) t) + (let ((start (match-beginning 0)) + (end (match-end 0))) + (goto-char start) + (setq state + (cond + ((not (equal ret 0)) nil) + ((looking-at "added\\|renamed\\|modified\\|removed") 'edited) + ((looking-at "unknown\\|ignored") nil))) + ;; erase the status text that matched + (delete-region start end))) + (when (vc-bzr-buffer-nonblank-p) + ;; "bzr" will output some warnings and informational messages + ;; to the user to stderr; due to Emacs' `vc-do-command' (and, + ;; it seems, `start-process' itself), we cannot catch stderr + ;; and stdout into different buffers. So, if there's anything + ;; left in the buffer after removing the above status + ;; keywords, let us just presume that any other message from + ;; "bzr" is a user warning, and display it. + (message "Warnings in `bzr' output: %s" + (buffer-substring (point-min) (point-max)))) + (when state + (vc-file-setprop file 'vc-workfile-version + (vc-bzr-workfile-version file)) + (vc-file-setprop file 'vc-state state)) + state))) + +(defun vc-bzr-workfile-unchanged-p (file) + (eq 'up-to-date (vc-bzr-state file))) + +(defun vc-bzr-workfile-version (file) + ;; Looks like this could be obtained via counting lines in + ;; .bzr/branch/revision-history. + (with-temp-buffer + (vc-bzr-command "revno" t 0 file) + (goto-char (point-min)) + (buffer-substring (point) (line-end-position)))) + +(defun vc-bzr-checkout-model (file) + 'implicit) + +(defun vc-bzr-create-repo () + "Create a new BZR repository." + (vc-bzr-command "init" nil 0 nil)) + +(defun vc-bzr-register (files &optional rev comment) + "Register FILE under bzr. +Signal an error unless REV is nil. +COMMENT is ignored." + (if rev (error "Can't register explicit version with bzr")) + (vc-bzr-command "add" nil 0 files)) + +;; Could run `bzr status' in the directory and see if it succeeds, but +;; that's relatively expensive. +(defalias 'vc-bzr-responsible-p 'vc-bzr-root-dir + "Return non-nil if FILE is (potentially) controlled by bzr. +The criterion is that there is a `.bzr' directory in the same +or a superior directory.") + +(defun vc-bzr-could-register (file) + "Return non-nil if FILE could be registered under bzr." + (and (vc-bzr-responsible-p file) ; shortcut + (condition-case () + (with-temp-buffer + (vc-bzr-command "add" t 0 file "--dry-run") + ;; The command succeeds with no output if file is + ;; registered (in bzr 0.8). + (goto-char (point-min)) + (looking-at "added ")) + (error)))) + +(defun vc-bzr-unregister (file) + "Unregister FILE from bzr." + (vc-bzr-command "remove" nil 0 file)) + +(defun vc-bzr-checkin (files rev comment) + "Check FILE in to bzr with log message COMMENT. +REV non-nil gets an error." + (if rev (error "Can't check in a specific version with bzr")) + (vc-bzr-command "commit" nil 0 files "-m" comment)) + +(defun vc-bzr-checkout (file &optional editable rev destfile) + "Checkout revision REV of FILE from bzr to DESTFILE. +EDITABLE is ignored." + (unless destfile + (setq destfile (vc-version-backup-file-name file rev))) + (let ((coding-system-for-read 'binary) + (coding-system-for-write 'binary)) + (with-temp-file destfile + (if rev + (vc-bzr-command "cat" t 0 file "-r" rev) + (vc-bzr-command "cat" t 0 file))))) + +(defun vc-bzr-revert (file &optional contents-done) + (unless contents-done + (with-temp-buffer (vc-bzr-command "revert" t 'async file)))) + +(defvar log-view-message-re) +(defvar log-view-file-re) +(defvar log-view-font-lock-keywords) +(defvar log-view-current-tag-function) + +(define-derived-mode vc-bzr-log-view-mode log-view-mode "Bzr-Log-View" + (remove-hook 'log-view-mode-hook 'vc-bzr-log-view-mode) ;Deactivate the hack. + (require 'add-log) + ;; Don't have file markers, so use impossible regexp. + (set (make-local-variable 'log-view-file-re) "\\'\\`") + (set (make-local-variable 'log-view-message-re) + "^ *-+\n *\\(?:revno: \\([0-9]+\\)\\|merged: .+\\)") + (set (make-local-variable 'log-view-font-lock-keywords) + ;; log-view-font-lock-keywords is careful to use the buffer-local + ;; value of log-view-message-re only since Emacs-23. + (append `((,log-view-message-re . 'log-view-message-face)) + ;; log-view-font-lock-keywords + '(("^ *committer: \ +\\([^<(]+?\\)[ ]*[(<]\\([[:alnum:]_.+-]+@[[:alnum:]_.-]+\\)[>)]" + (1 'change-log-name) + (2 'change-log-email)) + ("^ *timestamp: \\(.*\\)" (1 'change-log-date-face)))))) + +(defun vc-bzr-print-log (files &optional buffer) ; get buffer arg in Emacs 22 + "Get bzr change log for FILES into specified BUFFER." + ;; Fixme: This might need the locale fixing up if things like `revno' + ;; got localized, but certainly it shouldn't use LC_ALL=C. + ;; NB. Can't be async -- see `vc-bzr-post-command-function'. + (vc-bzr-command "log" buffer 0 files) + ;; FIXME: Until Emacs-23, VC was missing a hook to sort out the mode for + ;; the buffer, or at least set the regexps right. + (unless (fboundp 'vc-default-log-view-mode) + (add-hook 'log-view-mode-hook 'vc-bzr-log-view-mode))) + +(defun vc-bzr-show-log-entry (version) + "Find entry for patch name VERSION in bzr change log buffer." + (goto-char (point-min)) + (let (case-fold-search) + (if (re-search-forward (concat "^-+\nrevno: " version "$") nil t) + (beginning-of-line 0) + (goto-char (point-min))))) + +;; Fixem: vc-bzr-wash-log + +(autoload 'vc-diff-switches-list "vc" nil nil t) + +(defun vc-bzr-diff (files &optional rev1 rev2 buffer) + "VC bzr backend for diff." + (let ((working (vc-workfile-version (car files)))) + (if (and (equal rev1 working) (not rev2)) + (setq rev1 nil)) + (if (and (not rev1) rev2) + (setq rev1 working)) + ;; NB. Can't be async -- see `vc-bzr-post-command-function'. + ;; bzr diff produces condition code 1 for some reason. + (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*") 1 files + "--diff-options" (mapconcat 'identity (vc-diff-switches-list bzr) + " ") + (when rev1 + (if rev2 + (list "-r" (format "%s..%s" rev1 rev2)) + (list "-r" rev1)))))) + +(defalias 'vc-bzr-diff-tree 'vc-bzr-diff) + +;; Fixme: implement vc-bzr-dir-state, vc-bzr-dired-state-info + +;; Fixme: vc-{next,previous}-version need fixing in vc.el to deal with +;; straight integer versions. + +(defun vc-bzr-delete-file (file) + "Delete FILE and delete it in the bzr repository." + (condition-case () + (delete-file file) + (file-error nil)) + (vc-bzr-command "remove" nil 0 file)) + +(defun vc-bzr-rename-file (old new) + "Rename file from OLD to NEW using `bzr mv'." + (vc-bzr-command "mv" nil 0 new old)) + +(defvar vc-bzr-annotation-table nil + "Internal use.") +(make-variable-buffer-local 'vc-bzr-annotation-table) + +(defun vc-bzr-annotate-command (file buffer &optional version) + "Prepare BUFFER for `vc-annotate' on FILE. +Each line is tagged with the revision number, which has a `help-echo' +property containing author and date information." + (apply #'vc-bzr-command "annotate" buffer 0 file "-l" "--all" + (if version (list "-r" version))) + (with-current-buffer buffer + ;; Store the tags for the annotated source lines in a hash table + ;; to allow saving space by sharing the text properties. + (setq vc-bzr-annotation-table (make-hash-table :test 'equal)) + (goto-char (point-min)) + (while (re-search-forward "^\\( *[0-9]+\\) \\(.+\\) +\\([0-9]\\{8\\}\\) |" + nil t) + (let* ((rev (match-string 1)) + (author (match-string 2)) + (date (match-string 3)) + (key (match-string 0)) + (tag (gethash key vc-bzr-annotation-table))) + (unless tag + (save-match-data + (string-match " +\\'" author) + (setq author (substring author 0 (match-beginning 0)))) + (setq tag (propertize rev 'help-echo (concat "Author: " author + ", date: " date) + 'mouse-face 'highlight)) + (puthash key tag vc-bzr-annotation-table)) + (replace-match "") + (insert tag " |"))))) + +;; Definition from Emacs 22 +(unless (fboundp 'vc-annotate-convert-time) +(defun vc-annotate-convert-time (time) + "Convert a time value to a floating-point number of days. +The argument TIME is a list as returned by `current-time' or +`encode-time', only the first two elements of that list are considered." + (/ (+ (* (float (car time)) (lsh 1 16)) (cadr time)) 24 3600))) + +(defun vc-bzr-annotate-time () + (when (re-search-forward "^ *[0-9]+ |" nil t) + (let ((prop (get-text-property (line-beginning-position) 'help-echo))) + (string-match "[0-9]+\\'" prop) + (vc-annotate-convert-time + (encode-time 0 0 0 + (string-to-number (substring (match-string 0 prop) 6 8)) + (string-to-number (substring (match-string 0 prop) 4 6)) + (string-to-number (substring (match-string 0 prop) 0 4)) + ))))) + +(defun vc-bzr-annotate-extract-revision-at-line () + "Return revision for current line of annoation buffer, or nil. +Return nil if current line isn't annotated." + (save-excursion + (beginning-of-line) + (if (looking-at " *\\([0-9]+\\) | ") + (match-string-no-properties 1)))) + +;; Not needed for Emacs 22 +(defun vc-bzr-annotate-difference (point) + (let ((next-time (vc-bzr-annotate-time))) + (if next-time + (- (vc-annotate-convert-time (current-time)) next-time)))) + +;; FIXME: `bzr root' will return the real path to the repository root, +;; that is, it can differ from the buffer's current directory name +;; if there are any symbolic links. +(defun vc-bzr-root (dir) + "Return the root directory of the bzr repository containing DIR." + ;; Cache technique copied from vc-arch.el. + (or (vc-file-getprop dir 'bzr-root) + (vc-file-setprop + dir 'bzr-root + (substring + (shell-command-to-string (concat vc-bzr-program " root " dir)) 0 -1)))) + +;; TODO: it would be nice to mark the conflicted files in VC Dired, +;; and implement a command to run ediff and `bzr resolve' once the +;; changes have been merged. +(defun vc-bzr-dir-state (dir &optional localp) + "Find the VC state of all files in DIR. +Optional argument LOCALP is always ignored." + (let ((bzr-root-directory (vc-bzr-root dir)) + (at-start t) + current-bzr-state current-vc-state) + ;; Check that DIR is a bzr repository. + (unless (file-name-absolute-p bzr-root-directory) + (error "Cannot find bzr repository for directory `%s'" dir)) + ;; `bzr ls --versioned' lists all versioned files; + ;; assume they are up-to-date, unless we are given + ;; evidence of the contrary. + (setq at-start t) + (with-temp-buffer + (vc-bzr-command "ls" t 0 nil "--versioned" "--non-recursive") + (goto-char (point-min)) + (while (or at-start + (eq 0 (forward-line))) + (setq at-start nil) + (let ((file (expand-file-name + (buffer-substring-no-properties + (line-beginning-position) (line-end-position)) + bzr-root-directory))) + (vc-file-setprop file 'vc-state 'up-to-date) + ;; XXX: is this correct? what happens if one + ;; mixes different SCMs in the same dir? + (vc-file-setprop file 'vc-backend 'BZR)))) + ;; `bzr status' reports on added/modified/renamed and unknown/ignored files + (setq at-start t) + (with-temp-buffer + (vc-bzr-command "status" t 0 nil) + (goto-char (point-min)) + (while (or at-start + (eq 0 (forward-line))) + (setq at-start nil) + (cond + ((looking-at "^added") + (setq current-vc-state 'edited) + (setq current-bzr-state 'added)) + ((looking-at "^modified") + (setq current-vc-state 'edited) + (setq current-bzr-state 'modified)) + ((looking-at "^renamed") + (setq current-vc-state 'edited) + (setq current-bzr-state 'renamed)) + ((looking-at "^\\(unknown\\|ignored\\)") + (setq current-vc-state nil) + (setq current-bzr-state 'not-versioned)) + ((looking-at " ") + ;; file names are indented by two spaces + (when current-vc-state + (let ((file (expand-file-name + (buffer-substring-no-properties + (match-end 0) (line-end-position)) + bzr-root-directory))) + (vc-file-setprop file 'vc-state current-vc-state) + (vc-file-setprop file 'vc-bzr-state current-bzr-state) + (when (eq 'added current-bzr-state) + (vc-file-setprop file 'vc-workfile-version "0")))) + (when (eq 'not-versioned current-bzr-state) + (let ((file (expand-file-name + (buffer-substring-no-properties + (match-end 0) (line-end-position)) + bzr-root-directory))) + (vc-file-setprop file 'vc-backend 'none) + (vc-file-setprop file 'vc-state nil)))) + (t + ;; skip this part of `bzr status' output + (setq current-vc-state nil) + (setq current-bzr-state nil))))))) + +(defun vc-bzr-dired-state-info (file) + "Bzr-specific version of `vc-dired-state-info'." + (if (eq 'edited (vc-state file)) + (let ((bzr-state (vc-file-getprop file 'vc-bzr-state))) + (if bzr-state + (concat "(" (symbol-name bzr-state) ")") + ;; else fall back to default vc representation + (vc-default-dired-state-info 'BZR file))))) + +;; In case of just `(load "vc-bzr")', but that's probably the wrong +;; way to do it. +(add-to-list 'vc-handled-backends 'BZR) + +(eval-after-load "vc" + '(add-to-list 'vc-directory-exclusion-list ".bzr" t)) + +(defconst vc-bzr-unload-hook + (lambda () + (setq vc-handled-backends (delq 'BZR vc-handled-backends)) + (remove-hook 'vc-post-command-functions 'vc-bzr-post-command-function))) + +(provide 'vc-bzr) +;; arch-tag: 8101bad8-4e92-4e7d-85ae-d8e08b4e7c06 +;;; vc-bzr.el ends here diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 5a0c5395b96..3afc3468e02 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -62,7 +62,7 @@ interpreted as hostnames." :type 'regexp :group 'vc) -(defcustom vc-handled-backends '(RCS CVS SVN SCCS GIT HG Arch MCVS) +(defcustom vc-handled-backends '(RCS CVS SVN SCCS GIT HG BZR Arch MCVS) ;; GIT, HG, Arch and MCVS come last because they are per-tree rather ;; than per-dir. "*List of version control backends for which VC will be used. From 5b5485e6fdd091eb5fb99ab4e4fab430ae87f351 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 31 Jul 2007 15:28:16 +0000 Subject: [PATCH 03/31] (vc-find-file-hook): Failsafe if the backend's `registered' function burps. --- lisp/ChangeLog | 1 + lisp/vc-hooks.el | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0d97b7b6ea5..dc0c05462c8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,7 @@ * vc-bzr.el: New file (copied from the trunk). * vc-hooks.el (vc-handled-backends): Add BZR. + (vc-find-file-hook): Failsafe if the backend's `registered' function burps. * server.el (server-window): Add switch-to-buffer-other-frame option. diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 3afc3468e02..00c7f09f345 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -787,7 +787,7 @@ current, and kill the buffer that visits the link." (when buffer-file-name (vc-file-clearprops buffer-file-name) (cond - ((vc-backend buffer-file-name) + ((ignore-errors (vc-backend buffer-file-name)) ;; Compute the state and put it in the modeline. (vc-mode-line buffer-file-name) (unless vc-make-backup-files From 2d17b4d5dc5821d766bef1646461d31e6ab607e6 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 31 Jul 2007 17:34:15 +0000 Subject: [PATCH 04/31] (face-normalize-spec): New function. (frame-set-background-mode): Normalize face-spec before calling face-spec-match-p. --- lisp/ChangeLog | 6 ++++++ lisp/faces.el | 25 ++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dc0c05462c8..066ae1fef13 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-07-31 Daiki Ueno + + * faces.el (face-normalize-spec): New function. + (frame-set-background-mode): Normalize face-spec before calling + face-spec-match-p. + 2007-07-31 Stefan Monnier * vc-bzr.el: New file (copied from the trunk). diff --git a/lisp/faces.el b/lisp/faces.el index 090fbdba035..daf5f39fbc1 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1505,6 +1505,28 @@ If there is neither a user setting nor a default for FACE, return nil." (get face 'saved-face) (face-default-spec face))) +(defsubst face-normalize-spec (spec) + "Return a normalized face-spec of SPEC." + (let (normalized-spec) + (while spec + (let ((attribute (car spec)) + (value (car (cdr spec)))) + ;; Support some old-style attribute names and values. + (case attribute + (:bold (setq attribute :weight value (if value 'bold 'normal))) + (:italic (setq attribute :slant value (if value 'italic 'normal))) + ((:foreground :background) + ;; Compatibility with 20.x. Some bogus face specs seem to + ;; exist containing things like `:foreground nil'. + (if (null value) (setq value 'unspecified))) + (t (unless (assq attribute face-x-resources) + (setq attribute nil)))) + (when attribute + (push attribute normalized-spec) + (push value normalized-spec))) + (setq spec (cdr (cdr spec)))) + (nreverse normalized-spec))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Frame-type independent color support. @@ -1647,7 +1669,8 @@ according to the `background-mode' and `display-type' frame parameters." ;; be unmodified, so we can avoid consing in the common case. (dolist (face (face-list)) (when (not (face-spec-match-p face - (face-user-default-spec face) + (face-normalize-spec + (face-user-default-spec face)) (selected-frame))) (push face locally-modified-faces))) ;; Now change to the new frame parameters From 6b8e7bc2ccbda8daf8f6ec16d69bfbe1339ae953 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 31 Jul 2007 18:26:24 +0000 Subject: [PATCH 05/31] *** empty log message *** --- admin/FOR-RELEASE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index c707ac7a754..53a5a09f4c1 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -42,6 +42,8 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem. ** dksw@eircom.net, 3 Jul: Telnet mode (rsh/ssh) +** n_schumacher@web.de, 16 Jul: modification hooks called only once in c-mode + * FIXES FOR EMACS 22.2 Here we list small fixes that arrived too late for Emacs 22.1, but From aa96d4d57d2c5405e62d479492fa324f273646e9 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Wed, 1 Aug 2007 01:18:37 +0000 Subject: [PATCH 06/31] Fix parent groups link --- lisp/ChangeLog | 5 +++++ lisp/cus-edit.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 066ae1fef13..8eed90ca0e8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-07-31 Drew Adams + + * cus-edit.el (custom-group-value-create, custom-goto-parent): Fix + parent groups link. + 2007-07-31 Daiki Ueno * faces.el (face-normalize-spec): New function. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index b75f780097b..ed9db15a7cf 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -3935,7 +3935,7 @@ If GROUPS-ONLY non-nil, return only those members that are groups." ;;; was made to display a group. (when (eq level 1) (if (custom-add-parent-links widget - "Go to parent group:") + "Parent groups:") (insert "\n")))) ;; Create level indicator. (insert-char ?\ (* custom-buffer-indent (1- level))) @@ -4531,7 +4531,7 @@ If several parents are listed, go to the first of them." (interactive) (save-excursion (goto-char (point-min)) - (if (search-forward "\nGo to parent group: " nil t) + (if (search-forward "\nParent groups: " nil t) (let* ((button (get-char-property (point) 'button)) (parent (downcase (widget-get button :tag)))) (customize-group parent))))) From 9f3df1e5cf2a29dcf828a1ed834e450f0f2ce551 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Wed, 1 Aug 2007 09:10:27 +0000 Subject: [PATCH 07/31] *** empty log message *** --- man/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/man/ChangeLog b/man/ChangeLog index 904dfb3ed33..7e673a8c184 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2007-08-01 Alan Mackenzie + + * cc-mode.texi (Mailing Lists and Bug Reports): Correct "-no-site-file" + to "--no-site-file". + 2007-07-30 Dan Nicolaescu * vc2-xtra.texi (Customizing VC): Add GIT and HG. From eae7d61c530e5fa146f6ff63b511c97d98297419 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Wed, 1 Aug 2007 09:18:11 +0000 Subject: [PATCH 08/31] (Mailing Lists and Bug Reports): Correct "-no-site-file" to "--no-site-file". --- man/cc-mode.texi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/man/cc-mode.texi b/man/cc-mode.texi index 3cb670b3b53..423892d7d30 100644 --- a/man/cc-mode.texi +++ b/man/cc-mode.texi @@ -540,7 +540,7 @@ section @ref{Minor Modes}. @item Making the @key{RET} key indent the new line The standard Emacs binding for @key{RET} just adds a new line. If you want it to reindent the new line as well, rebind the key. Note that -the action of rebinding will fail if the pertinent keymap doesn't yet +the action of rebinding would fail if the pertinent keymap didn't yet exist---we thus need to delay the action until after @ccmode{} has been loaded. Put the following code into your @file{.emacs}: @@ -881,8 +881,8 @@ lines. @ccmode{} contains some useful commands for moving around in C code. @table @asis -@item @kbd{C-M-a} -@itemx @kbd{C-M-e} +@item @kbd{C-M-a} (@code{c-beginning-of-defun}) +@itemx @kbd{C-M-e} (@code{c-end-of-defun}) @findex c-beginning-of-defun @findex c-end-of-defun @@ -6911,11 +6911,11 @@ to include any code that appears @emph{before} your bug example, if you think it might affect our ability to reproduce it. Please try to produce the problem in an Emacs instance without any -customizations loaded (i.e. start it with the @samp{-q -no-site-file} +customizations loaded (i.e. start it with the @samp{-q --no-site-file} arguments). If it works correctly there, the problem might be caused by faulty customizations in either your own or your site -configuration. In that case, we'd appreciate if you isolate the Emacs -Lisp code that triggers the bug and include it in your report. +configuration. In that case, we'd appreciate it if you isolate the +Emacs Lisp code that triggers the bug and include it in your report. @cindex bug report mailing list Bug reports should be sent to @email{bug-cc-mode@@gnu.org}. You can From 1605972ed10cbccf370abf7ab02aad68c7535737 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 1 Aug 2007 13:29:01 +0000 Subject: [PATCH 09/31] *** empty log message *** --- admin/FOR-RELEASE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 53a5a09f4c1..e67f01832df 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -44,6 +44,8 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem. ** n_schumacher@web.de, 16 Jul: modification hooks called only once in c-mode +** sdl.web@gmail.com: problem with transparent PNG image display + * FIXES FOR EMACS 22.2 Here we list small fixes that arrived too late for Emacs 22.1, but From 67de6223a93e70eae55614cafc408244ab54c75c Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Wed, 1 Aug 2007 17:36:31 +0000 Subject: [PATCH 10/31] Docstring fix --- lisp/ChangeLog | 4 ++++ lisp/ibuf-ext.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8eed90ca0e8..a93f50ecb33 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-08-01 Eric Hanchrow + + * ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix. + 2007-07-31 Drew Adams * cus-edit.el (custom-group-value-create, custom-goto-parent): Fix diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 4f510472d54..b077342e5f5 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -1482,7 +1482,7 @@ You can then feed the file name(s) to other commands with \\[yank]." ;;;###autoload (defun ibuffer-mark-old-buffers () - "Mark buffers which have not been viewed in `ibuffer-old-time' days." + "Mark buffers which have not been viewed in `ibuffer-old-time' hours." (interactive) (ibuffer-mark-on-buffer #'(lambda (buf) From 1a1c4e2ebf7194e66278312690072d2601b23145 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 1 Aug 2007 18:28:48 +0000 Subject: [PATCH 11/31] *** empty log message *** --- admin/FOR-RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index e67f01832df..ecd3de8c726 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -42,7 +42,7 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem. ** dksw@eircom.net, 3 Jul: Telnet mode (rsh/ssh) -** n_schumacher@web.de, 16 Jul: modification hooks called only once in c-mode +** bojohan+news@dd.chalmers.se, 1 Aug: n_schumacher@web.de: modification hooks called only once in ** sdl.web@gmail.com: problem with transparent PNG image display From ec96293f2d44298b54a84f308a3d5d735701f122 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Wed, 1 Aug 2007 21:43:46 +0000 Subject: [PATCH 12/31] Adjust load-path --- src/ChangeLog | 5 +++++ src/mac.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 835379d9cde..4a175882a98 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-08-01 Seiji Zenitani + + * mac.c (init_mac_osx_environment): Adjust load-path on self-contained + build. + 2007-07-30 Stefan Monnier * eval.c (init_eval_once): Bump max_lisp_eval_depth to 400. diff --git a/src/mac.c b/src/mac.c index 0321e8f2ae1..7f22c19936b 100644 --- a/src/mac.c +++ b/src/mac.c @@ -5331,12 +5331,12 @@ init_mac_osx_environment () q[0] = '\0'; strcpy (p, app_bundle_pathname); - strcat (p, "/Contents/Resources/lisp"); + strcat (p, "/Contents/Resources/site-lisp"); if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) strcat (q, p); strcpy (p, app_bundle_pathname); - strcat (p, "/Contents/Resources/leim"); + strcat (p, "/Contents/Resources/lisp"); if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) { if (q[0] != '\0') @@ -5345,7 +5345,7 @@ init_mac_osx_environment () } strcpy (p, app_bundle_pathname); - strcat (p, "/Contents/Resources/site-lisp"); + strcat (p, "/Contents/Resources/leim"); if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) { if (q[0] != '\0') From 40921745e5d237cd0bf1c6957caab6e274535b99 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Wed, 1 Aug 2007 22:20:41 +0000 Subject: [PATCH 13/31] Adjust load-path comment --- src/mac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mac.c b/src/mac.c index 7f22c19936b..a641b07dc08 100644 --- a/src/mac.c +++ b/src/mac.c @@ -5322,8 +5322,8 @@ init_mac_osx_environment () /* P should have sufficient room for the pathname of the bundle plus the subpath in it leading to the respective directories. Q should have three times that much room because EMACSLOADPATH can - have the value "::". */ + have the value "::". */ p = (char *) alloca (app_bundle_pathname_len + 50); q = (char *) alloca (3 * app_bundle_pathname_len + 150); if (!getenv ("EMACSLOADPATH")) From d73a9dd7027b166baf389f9ba157b3f989908f9a Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Thu, 2 Aug 2007 00:05:13 +0000 Subject: [PATCH 14/31] Adjust load-path comment --- src/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4a175882a98..96da8d4ee78 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,4 @@ -2007-08-01 Seiji Zenitani +2007-08-01 Ryo Yoshitake (tiny change) * mac.c (init_mac_osx_environment): Adjust load-path on self-contained build. From c47647ca1bee7ddcdc539e23de2e70dbc5c3ddd4 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Thu, 2 Aug 2007 00:22:22 +0000 Subject: [PATCH 15/31] Insert tiny change --- lisp/ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a93f50ecb33..7bdc6c928ea 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,8 +1,8 @@ -2007-08-01 Eric Hanchrow +2007-08-01 Eric Hanchrow (tiny change) * ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix. -2007-07-31 Drew Adams +2007-07-31 Drew Adams (tiny change) * cus-edit.el (custom-group-value-create, custom-goto-parent): Fix parent groups link. From 51f6595da78d04b49bd6602d60dbe65ad367ffa3 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 2 Aug 2007 17:08:53 +0000 Subject: [PATCH 16/31] (vc-bzr-admin-dirstate): Rename from `...-dirname'. Make it more discriminating and more useful. (vc-bzr-root-dir): Use new name. (vc-bzr-registered): Use new name and look at the dirstate file to determine if it's registered or not without running `bzr'. --- lisp/ChangeLog | 21 +++++++++++++++------ lisp/vc-bzr.el | Bin 20357 -> 21032 bytes 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7bdc6c928ea..66f1618be60 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,24 +1,33 @@ +2007-08-02 Stefan Monnier + + * vc-bzr.el (vc-bzr-admin-dirstate): Rename from `...-dirname'. + Make it more discriminating and more useful. + (vc-bzr-root-dir): Use new name. + (vc-bzr-registered): Use new name and look at the dirstate file to + determine if it's registered or not without running `bzr'. + 2007-08-01 Eric Hanchrow (tiny change) * ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix. 2007-07-31 Drew Adams (tiny change) - * cus-edit.el (custom-group-value-create, custom-goto-parent): Fix - parent groups link. + * cus-edit.el (custom-group-value-create, custom-goto-parent): + Fix parent groups link. 2007-07-31 Daiki Ueno - * faces.el (face-normalize-spec): New function. - (frame-set-background-mode): Normalize face-spec before calling - face-spec-match-p. + * faces.el (face-normalize-spec): New function. + (frame-set-background-mode): Normalize face-spec before calling + face-spec-match-p. 2007-07-31 Stefan Monnier * vc-bzr.el: New file (copied from the trunk). * vc-hooks.el (vc-handled-backends): Add BZR. - (vc-find-file-hook): Failsafe if the backend's `registered' function burps. + (vc-find-file-hook): Failsafe if the backend's `registered' + function burps. * server.el (server-window): Add switch-to-buffer-other-frame option. diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index 6a8f930f00f7004d6783bf5addc795d857131c40..e611828c929c082566be4807a7b3c73dfca10ec0 100644 GIT binary patch delta 626 zcmZpj&$wa<B`5C{5T86zAaU|%fw`Pu5lu}luE}x&3X^vTnsMc%mMCaw z6y@iaO#UD!UazUirJ$gopplrDq5u+9uvQ4p$S*2UNG>hW151IV6|AilLNYRo6>{?P zvx^lHOB6EmN>YpR5_1&NGILUk^%N9*6Dt*xic%A^6*AKlN-|O_6_PU&^U_mM%qYo7 z%`8$#%P-1JgqY5xpfK6cRdn(M5!OhsMG6WUnR&&jMJ2i*gLRYh^GZ_lN{SJtfE=4z zQIMFI0#T8dn479lmaLmpRivAklAD>Q3kxN%e?b15JW*V9@?1p;J&l~y5-pJLQ*%J3 zD`&18`bNccy$1x~PX7m&{)5uH%DFho*l$xGeQJ`B`nqQKtpplYU1ThH7 zD-i26H9@vd-k{IQtOPNJR|8q^!8?lpxUwatj3KW#%Z9z}=^ypfK4^ NMvPH&v$c?yEdZ6Sz(fE5 delta 156 zcmZ3ngt2u#SgTxf_^AyUB zjV6l Date: Thu, 2 Aug 2007 17:40:54 +0000 Subject: [PATCH 17/31] (compilation-find-buffer): Return current buffer immediately if suitable. (compile, compilation-buffer-name, compilation-start): Doc fixes. --- lisp/ChangeLog | 10 ++++++++-- lisp/progmodes/compile.el | 31 ++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 66f1618be60..cdb89b36942 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-02 Richard Stallman + + * progmodes/compile.el (compilation-find-buffer): Return current + buffer immediately if suitable. + (compile, compilation-buffer-name, compilation-start): Doc fixes. + 2007-08-02 Stefan Monnier * vc-bzr.el (vc-bzr-admin-dirstate): Rename from `...-dirname'. @@ -10,7 +16,7 @@ * ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix. -2007-07-31 Drew Adams (tiny change) +2007-07-31 Drew Adams * cus-edit.el (custom-group-value-create, custom-goto-parent): Fix parent groups link. @@ -12319,7 +12325,7 @@ (name, size, mode) : Add a header-mouse-map property. -2006-04-02 Drew Adams (tiny change) +2006-04-02 Drew Adams * speedbar.el (speedbar-after-create-hook): Doc fix. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 13e4e40044b..529194ffa7e 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -888,11 +888,13 @@ non-nil; otherwise uses `compile-command'. With prefix arg, always prompts. Additionally, with universal prefix arg, compilation buffer will be in comint mode, i.e. interactive. -To run more than one compilation at once, start one and rename +To run more than one compilation at once, start one then rename the \`*compilation*' buffer to some other name with -\\[rename-buffer]. Then start the next one. On most systems, -termination of the main compilation process kills its -subprocesses. +\\[rename-buffer]. Then _switch buffers_ and start the new compilation. +It will create a new \`*compilation*' buffer. + +On most systems, termination of the main compilation process +kills its subprocesses. The name used for the buffer is actually whatever is returned by the function in `compilation-buffer-name-function', so you can set that @@ -944,7 +946,7 @@ visible rather than the beginning." If NAME-FUNCTION is non-nil, call it with one argument MODE-NAME to determine the buffer name. Likewise if `compilation-buffer-name-function' is non-nil. -If current buffer is the mode MODE-COMMAND, +If current buffer has the major mode MODE-COMMAND, return the name of the current buffer, so that it gets reused. Otherwise, construct a buffer name from MODE-NAME." (cond (name-function @@ -983,8 +985,11 @@ The rest of the arguments are optional; for them, nil means use the default. MODE is the major mode to set in the compilation buffer. Mode may also be t meaning use `compilation-shell-minor-mode' under `comint-mode'. + If NAME-FUNCTION is non-nil, call it with one argument (the mode name) -to determine the buffer name. +to determine the buffer name. Otherwise, the default is to +reuses the current buffer if it has the proper major mode, +else use or create a buffer with name based on the major mode. If HIGHLIGHT-REGEXP is non-nil, `next-error' will temporarily highlight the matching section of the visited source line; the default is to use the @@ -1604,12 +1609,16 @@ Use this command in a compilation log buffer. Sets the mark at point there." (setq compilation-current-error (point)) (next-error-internal))) -;; Return a compilation buffer. -;; If the current buffer is a compilation buffer, return it. -;; Otherwise, look for a compilation buffer and signal an error -;; if there are none. (defun compilation-find-buffer (&optional avoid-current) - (next-error-find-buffer avoid-current 'compilation-buffer-internal-p)) + "Return a compilation buffer. +If AVOID-CURRENT is nil, and +the current buffer is a compilation buffer, return it. +If AVOID-CURRENT is non-nil, return the current buffer +only as a last resort." + (if (and (compilation-buffer-internal-p (current-buffer)) + (not avoid-current)) + (current-buffer) + (next-error-find-buffer avoid-current 'compilation-buffer-internal-p))) ;;;###autoload (defun compilation-next-error-function (n &optional reset) From 77b4381a2d7ba5205acb93a5462cea409a7d24d7 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 2 Aug 2007 17:43:00 +0000 Subject: [PATCH 18/31] (next-line-internal): Setting deleted. All callers use line-move. --- lisp/emulation/tpu-edt.el | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index f164fb8eb29..414ae7bf14e 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el @@ -1069,13 +1069,6 @@ This is useful for inserting control characters." (defalias 'tpu-error 'error) -;; Around emacs version 18.57, function line-move was renamed to -;; next-line-internal. If we're running under an older emacs, -;; make next-line-internal equivalent to line-move. - -(if (not (fboundp 'next-line-internal)) (fset 'next-line-internal 'line-move)) - - ;;; ;;; Help ;;; @@ -2026,14 +2019,14 @@ With argument, do this that many times." "Move to next line. Prefix argument serves as a repeat count." (interactive "p") - (next-line-internal num) + (line-move num) (setq this-command 'next-line)) (defun tpu-previous-line (num) "Move to previous line. Prefix argument serves as a repeat count." (interactive "p") - (next-line-internal (- num)) + (line-move (- num)) (setq this-command 'previous-line)) (defun tpu-next-beginning-of-line (num) @@ -2156,7 +2149,7 @@ A repeat count means scroll that many sections." (let* ((beg (tpu-current-line)) (height (1- (window-height))) (lines (* num (/ (* height tpu-percent-scroll) 100)))) - (next-line-internal (- lines)) + (line-move (- lines)) (if (> lines beg) (recenter 0)))) (defun tpu-scroll-window-up (num) @@ -2166,7 +2159,7 @@ A repeat count means scroll that many sections." (let* ((beg (tpu-current-line)) (height (1- (window-height))) (lines (* num (/ (* height tpu-percent-scroll) 100)))) - (next-line-internal lines) + (line-move lines) (if (>= (+ lines beg) height) (recenter -1)))) (defun tpu-pan-right (num) From 257792a8db92797a61590970f9114fa2f9b1dab0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 2 Aug 2007 17:49:33 +0000 Subject: [PATCH 19/31] (fancy-splash-head, startup-echo-area-message): Change message text. --- lisp/startup.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/startup.el b/lisp/startup.el index 3853ba4fe80..19ef664a2fe 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1677,9 +1677,9 @@ Type \\[describe-distribution] for information on getting the latest version.")) (defun startup-echo-area-message () (if (eq (key-binding "\C-h\C-p") 'describe-project) - "For information about the GNU Project and its goals, type C-h C-p." + "For information about the GNU system and GNU/Linux, type C-h C-p." (substitute-command-keys - "For information about the GNU Project and its goals, type \ + "For information about the GNU system and GNU/Linux, type \ \\[describe-project]."))) From 69a7537f47c12c41ab01ee4cf6cbd505593a22a8 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 2 Aug 2007 17:52:26 +0000 Subject: [PATCH 20/31] (menu-bar-help-menu): Add "About GNU" menu item. --- lisp/menu-bar.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index a0044dcc2da..0c9ff964e30 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1351,6 +1351,9 @@ key, a click, or a menu-item")) (define-key menu-bar-help-menu [describe-copying] '(menu-item "Copying Conditions" describe-copying :help "Show the Emacs license (GPL)")) +(define-key menu-bar-help-menu [describe-project] + '(menu-item "About GNU" describe-project + :help "About the GNU System, GNU Project, and GNU/Linux")) (define-key menu-bar-help-menu [describe-distribution] '(menu-item "Getting New Versions" describe-distribution :help "How to get latest versions of Emacs")) From bd18cd1928fc6405408ef9b5ab714b1a7583abb1 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 2 Aug 2007 17:53:19 +0000 Subject: [PATCH 21/31] (customize-apropos, customize-apropos-options) (customize-apropos-faces, customize-apropos-groups): Improve prompt. --- lisp/cus-edit.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index ed9db15a7cf..29840b8fb5c 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1384,7 +1384,7 @@ If ALL is `groups', include only groups. If ALL is t (interactively, with prefix arg), include variables that are not customizable options, as well as faces and groups \(but we recommend using `apropos-variable' instead)." - (interactive "sCustomize regexp: \nP") + (interactive "sCustomize (regexp): \nP") (let ((found nil)) (mapatoms (lambda (symbol) (when (string-match regexp (symbol-name symbol)) @@ -1413,19 +1413,19 @@ that are not customizable options, as well as faces and groups "Customize all loaded customizable options matching REGEXP. With prefix arg, include variables that are not customizable options \(but we recommend using `apropos-variable' instead)." - (interactive "sCustomize regexp: \nP") + (interactive "sCustomize options (regexp): \nP") (customize-apropos regexp (or arg 'options))) ;;;###autoload (defun customize-apropos-faces (regexp) "Customize all loaded faces matching REGEXP." - (interactive "sCustomize regexp: \n") + (interactive "sCustomize faces (regexp): \n") (customize-apropos regexp 'faces)) ;;;###autoload (defun customize-apropos-groups (regexp) "Customize all loaded groups matching REGEXP." - (interactive "sCustomize regexp: \n") + (interactive "sCustomize groups (regexp): \n") (customize-apropos regexp 'groups)) ;;; Buffer. From 7d7d10b874929e0e46a96c870017db26c59b44c8 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 2 Aug 2007 17:56:38 +0000 Subject: [PATCH 22/31] (rmail-make-summary-line): Find end of msg number to update deleted flag. --- lisp/ChangeLog | 14 ++++++++++++++ lisp/mail/rmailsum.el | 10 ++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cdb89b36942..1fd9ad36d9c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,19 @@ 2007-08-02 Richard Stallman + * mail/rmailsum.el (rmail-make-summary-line): Find end of msg number + to update deleted flag. + + * cus-edit.el (customize-apropos, customize-apropos-options) + (customize-apropos-faces, customize-apropos-groups): Improve prompt. + + * menu-bar.el (menu-bar-help-menu): Add "About GNU" menu item. + + * startup.el (fancy-splash-head, startup-echo-area-message): + Change message text. + + * emulation/tpu-edt.el (next-line-internal): Setting deleted. + All callers use line-move. + * progmodes/compile.el (compilation-find-buffer): Return current buffer immediately if suitable. (compile, compilation-buffer-name, compilation-start): Doc fixes. diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 85527e59f67..fd5931fdef9 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -288,12 +288,14 @@ nil for FUNCTION means all messages." (if (zerop (% rmail-new-summary-line-count 10)) (message "Computing summary lines...%d" rmail-new-summary-line-count)) - (rmail-make-summary-line-1 msg))))) + (rmail-make-summary-line-1 msg)))) + delpos) ;; Fix up the part of the summary that says "deleted" or "unseen". - (aset line 5 - (if (rmail-message-deleted-p msg) ?\D + (string-match "[0-9]+" line) + (aset line (match-end 0) + (if (rmail-message-deleted-p msg) ?D (if (= ?0 (char-after (+ 3 (rmail-msgbeg msg)))) - ?\- ?\ ))) + ?- ?\s))) line)) ;;;###autoload From fd2a7b94b3d89d6d46e7ec2776b25d27842ec34b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 3 Aug 2007 03:14:34 +0000 Subject: [PATCH 23/31] Drew Adams (pp-eval-expression): Add progress message. Make buffer writable. --- lisp/emacs-lisp/pp.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 21175a03b4d..a5cefff399f 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -103,6 +103,7 @@ Also add the value to the front of the list in the variable `values'." (interactive (list (read-from-minibuffer "Eval: " nil read-expression-map t 'read-expression-history))) + (message "Evaluating...") (setq values (cons (eval expression) values)) (let* ((old-show-function temp-buffer-show-function) ;; Use this function to display the buffer. @@ -126,13 +127,16 @@ Also add the value to the front of the list in the variable `values'." (progn (select-window window) (run-hooks 'temp-buffer-show-hook)) - (select-window old-selected))) + (select-window old-selected) + (message "Evaluating...done. \ +See buffer *Pp Eval Output*."))) (message "%s" (buffer-substring (point-min) (point))) )))))) (with-output-to-temp-buffer "*Pp Eval Output*" (pp (car values)) (with-current-buffer standard-output (emacs-lisp-mode) + (setq buffer-read-only nil) (set (make-local-variable 'font-lock-verbose) nil))))) ;;;###autoload From 501d63d62db20dedc26a803bcc601d89915f5c52 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 3 Aug 2007 03:19:07 +0000 Subject: [PATCH 24/31] Revert previous change, which was only supposed to be in trunk. --- lisp/emacs-lisp/pp.el | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index a5cefff399f..21175a03b4d 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -103,7 +103,6 @@ Also add the value to the front of the list in the variable `values'." (interactive (list (read-from-minibuffer "Eval: " nil read-expression-map t 'read-expression-history))) - (message "Evaluating...") (setq values (cons (eval expression) values)) (let* ((old-show-function temp-buffer-show-function) ;; Use this function to display the buffer. @@ -127,16 +126,13 @@ Also add the value to the front of the list in the variable `values'." (progn (select-window window) (run-hooks 'temp-buffer-show-hook)) - (select-window old-selected) - (message "Evaluating...done. \ -See buffer *Pp Eval Output*."))) + (select-window old-selected))) (message "%s" (buffer-substring (point-min) (point))) )))))) (with-output-to-temp-buffer "*Pp Eval Output*" (pp (car values)) (with-current-buffer standard-output (emacs-lisp-mode) - (setq buffer-read-only nil) (set (make-local-variable 'font-lock-verbose) nil))))) ;;;###autoload From 3ff67968417a2e78d5ff5bbed1878de9dca64557 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 3 Aug 2007 03:21:13 +0000 Subject: [PATCH 25/31] (telnet-mode): Set comint-use-prompt-regexp to t. --- lisp/ChangeLog | 6 +++++- lisp/net/telnet.el | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1fd9ad36d9c..8b616275fa3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-08-03 Glenn Morris + + * net/telnet.el (telnet-mode): Set comint-use-prompt-regexp to t. + 2007-08-02 Richard Stallman * mail/rmailsum.el (rmail-make-summary-line): Find end of msg number @@ -8,7 +12,7 @@ * menu-bar.el (menu-bar-help-menu): Add "About GNU" menu item. - * startup.el (fancy-splash-head, startup-echo-area-message): + * startup.el (fancy-splash-head, startup-echo-area-message): Change message text. * emulation/tpu-edt.el (next-line-internal): Setting deleted. diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el index c7b37050ed2..28f7d1ddb46 100644 --- a/lisp/net/telnet.el +++ b/lisp/net/telnet.el @@ -247,7 +247,8 @@ It has most of the same commands as comint-mode. There is a variable ``telnet-interrupt-string'' which is the character sent to try to stop execution of a job on the remote host. Data is sent to the remote host when RET is typed." - (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern)) + (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern) + (setq comint-use-prompt-regexp t)) ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)") From 1ad08acd2bf7e17cd3222f8636bb6dd662b60df7 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 3 Aug 2007 03:38:24 +0000 Subject: [PATCH 26/31] Comment change. --- src/xselect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xselect.c b/src/xselect.c index 0204abb2d96..fc3659faedd 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1854,9 +1854,9 @@ selection_data_to_lisp_data (display, data, size, type, format) } } - /* Convert a single 16 or small 32 bit number to a Lisp_Int. - If the number is > 16 bits, convert it to a cons of integers, - 16 bits in each half. + /* Convert a single 16-bit number or a small 32-bit number to a Lisp_Int. + If the number is 32 bits and won't fit in a Lisp_Int, + convert it to a cons of integers, 16 bits in each half. */ else if (format == 32 && size == sizeof (int)) return long_to_cons (((unsigned int *) data) [0]); From 73ff9d42c45fed4c2202feeb1a2acbfe00fd3ad9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 3 Aug 2007 03:39:09 +0000 Subject: [PATCH 27/31] (Fvisited_file_modtime): Use make_time. --- src/ChangeLog | 4 ++++ src/fileio.c | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 96da8d4ee78..a1128d19c58 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2007-08-03 Richard Stallman + + * fileio.c (Fvisited_file_modtime): Use make_time. + 2007-08-01 Ryo Yoshitake (tiny change) * mac.c (init_mac_osx_environment): Adjust load-path on self-contained diff --git a/src/fileio.c b/src/fileio.c index 3859f9e35aa..1962035e0bd 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5692,11 +5692,9 @@ file modification time, this function returns 0. See Info node `(elisp)Modification Time' for more details. */) () { - Lisp_Object tcons; - tcons = long_to_cons ((unsigned long) current_buffer->modtime); - if (CONSP (tcons)) - return list2 (XCAR (tcons), XCDR (tcons)); - return tcons; + if (! current_buffer->modtime) + return make_number (0); + return make_time ((time_t) current_buffer->modtime); } DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime, From 5716cebdd05ad26a4c3aa57c8ebf2890d4b937f6 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 3 Aug 2007 05:09:21 +0000 Subject: [PATCH 28/31] Change capitalization of VC backend names for new backends Revision: emacs@sv.gnu.org/emacs--rel--22--patch-87 --- lisp/ChangeLog | 11 +++++++++++ lisp/vc-bzr.el | Bin 21032 -> 21032 bytes lisp/vc-git.el | 10 +++++----- lisp/vc-hg.el | 6 +++--- lisp/vc-hooks.el | 6 +++--- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8b616275fa3..f1103f0e126 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2007-08-03 Miles Bader + + * vc-hooks.el (vc-handled-backends): Change capitalization of VC + backend names for new backends to `Git', `Hg', and `Bzr'. + * vc-hg.el (vc-hg-dired-state-info): Use `Hg' as VC backend name, + not `HG'. + * vc-git.el (vc-git-dired-state-info): Use `Git' as VC backend + name, not `GIT'. + * vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info) + (vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'. + 2007-08-03 Glenn Morris * net/telnet.el (telnet-mode): Set comint-use-prompt-regexp to t. diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index e611828c929c082566be4807a7b3c73dfca10ec0..c2128de90c9e0615352109c7ed516167364ef4bd 100644 GIT binary patch delta 54 zcmZ3ngmJ|Z#tr72OjSjjEjf+EL3FOdFEtRI>3)%esj6tQO+YJ%IvlVFM5PBF1OO&D B6!8E6 delta 54 zcmZ3ngmJ|Z#tr72Oi@9bEjf+EL3FOdFEtRI>3)%eDJp2PO+YJ%IvlVFM5PBF1ONg! B6LA0l diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 256be2c6f03..8dd6562f24b 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el @@ -30,11 +30,11 @@ ;;; Installation: -;; To install: put this file on the load-path and add GIT to the list +;; To install: put this file on the load-path and add Git to the list ;; of supported backends in `vc-handled-backends'; the following line, ;; placed in your ~/.emacs, will accomplish this: ;; -;; (add-to-list 'vc-handled-backends 'GIT) +;; (add-to-list 'vc-handled-backends 'Git) ;;; Todo: ;; - check if more functions could use vc-git-command instead @@ -214,12 +214,12 @@ (if (eq git-state 'edited) "(modified)" ;; fall back to the default VC representation - (vc-default-dired-state-info 'GIT file)))) + (vc-default-dired-state-info 'Git file)))) ;;; STATE-CHANGING FUNCTIONS (defun vc-git-create-repo () - "Create a new GIT repository." + "Create a new Git repository." (vc-git-command "init" nil 0 nil)) (defun vc-git-register (files &optional rev comment) @@ -287,7 +287,7 @@ (defvar log-view-file-re) (defvar log-view-font-lock-keywords) -(define-derived-mode vc-git-log-view-mode log-view-mode "GIT-Log-View" +(define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View" (require 'add-log) ;; we need the faces add-log ;; Don't have file markers, so use impossible regexp. (set (make-local-variable 'log-view-file-re) "^File:[ \t]+\\(.+\\)") diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index c9a69a7e5ea..a7c10eeb027 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el @@ -245,7 +245,7 @@ (defvar log-view-file-re) (defvar log-view-font-lock-keywords) -(define-derived-mode vc-hg-log-view-mode log-view-mode "HG-Log-View" +(define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-Log-View" (require 'add-log) ;; we need the faces add-log ;; Don't have file markers, so use impossible regexp. (set (make-local-variable 'log-view-file-re) "^File:[ \t]+\\(.+\\)") @@ -383,7 +383,7 @@ COMMENT is ignored." ;; (vc-hg-command nil nil file "remove")) (defun vc-hg-checkin (file rev comment) - "HG-specific version of `vc-backend-checkin'. + "Hg-specific version of `vc-backend-checkin'. REV is ignored." (vc-hg-command nil 0 file "commit" "-m" comment)) @@ -420,7 +420,7 @@ REV is the revision to check out into WORKFILE." (if (equal (vc-workfile-version file) "0") "(added)" "(modified)") ;; fall back to the default VC representation - (vc-default-dired-state-info 'HG file)))) + (vc-default-dired-state-info 'Hg file)))) ;; Modelled after the similar function in vc-bzr.el (defun vc-hg-revert (file &optional contents-done) diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 00c7f09f345..052365945f2 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -62,9 +62,9 @@ interpreted as hostnames." :type 'regexp :group 'vc) -(defcustom vc-handled-backends '(RCS CVS SVN SCCS GIT HG BZR Arch MCVS) - ;; GIT, HG, Arch and MCVS come last because they are per-tree rather - ;; than per-dir. +(defcustom vc-handled-backends '(RCS CVS SVN SCCS Bzr Git Hg Arch MCVS) + ;; Bzr, Git, Hg, Arch and MCVS come last because they are per-tree + ;; rather than per-dir. "*List of version control backends for which VC will be used. Entries in this list will be tried in order to determine whether a file is under that sort of version control. From 6a599ca51fa11aacb38da5bef9c6ffad5cb1ea36 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Fri, 3 Aug 2007 05:21:43 +0000 Subject: [PATCH 29/31] (math-get-value,math-get-sdev,math-contains-sdev): New functions. --- lisp/calc/calc-ext.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index b517a54c6f0..5a334778aa5 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -2213,6 +2213,25 @@ calc-kill calc-kill-region calc-yank)))) a (math-reject-arg a 'constp))) +;;; Some functions for working with error forms. +(defun math-get-value (x) + "Get the mean value of the error form X. +If X is not an error form, return X." + (if (eq (car-safe x) 'sdev) + (nth 1 x) + x)) + +(defun math-get-sdev (x &optional one) + "Get the standard deviation of the error form X. +If X is not an error form, return 1." + (if (eq (car-safe x) 'sdev) + (nth 2 x) + (if one 1 0))) + +(defun math-contains-sdev-p (ls) + "Non-nil if the list LS contains an error form." + (let ((ls (if (eq (car-safe ls) 'vec) (cdr ls) ls))) + (memq t (mapcar (lambda (x) (eq (car-safe x) 'sdev)) ls)))) ;;; Coerce integer A to be a small integer. [S I] (defun math-fixnum (a) From 480e4ad15679ae8ac1a5cb04d1f65cd45559696e Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Fri, 3 Aug 2007 05:25:03 +0000 Subject: [PATCH 30/31] (calc-graph-format-data,calc-graph-add-curve): Check for error forms. (calc-graph-set-styles): Add option for error forms. --- lisp/ChangeLog | 9 +++++ lisp/calc/calc-graph.el | 74 +++++++++++++++++++++++++++-------------- 2 files changed, 58 insertions(+), 25 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 19014a996f9..2363853356c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2007-08-03 Jay Belanger + + * calc/calc-ext.el (math-get-value,math-get-sdev) + (math-contains-sdev): New functions. + + * calc/calc-graph.el (calc-graph-format-data) + (calc-graph-add-curve): Check for error forms. + (calc-graph-set-styles): Add option for error forms. + 2007-08-03 Miles Bader * vc-hooks.el (vc-handled-backends): Change capitalization of VC diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 48bdecf59a6..a7e85d9fa85 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -218,7 +218,8 @@ 0) (or (and (Math-num-integerp pstyle) (math-trunc pstyle)) (if (eq (car-safe (calc-var-value (nth 2 ydata))) 'vec) - 0 -1))))) + 0 -1)) + (math-contains-sdev-p (eval (nth 2 ydata)))))) (defun calc-graph-lookup (thing) (if (and (eq (car-safe thing) 'var) @@ -792,6 +793,10 @@ calc-graph-numsteps (1- (* calc-graph-numsteps (1+ calc-graph-numsteps3)))))) (defun calc-graph-format-data () + (if (math-contains-sdev-p calc-graph-yp) + (let ((yp calc-graph-yp)) + (setq calc-graph-yp (cons 'vec (mapcar 'math-get-value (cdr yp)))) + (setq calc-graph-zp (cons 'vec (mapcar 'math-get-sdev (cdr yp)))))) (while (<= (setq calc-graph-stepcount (1+ calc-graph-stepcount)) calc-graph-numsteps) (if calc-graph-xvec (setq calc-graph-xp (cdr calc-graph-xp) @@ -1059,7 +1064,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (interactive "P") (calc-graph-set-styles t (and style (prefix-numeric-value style)))) -(defun calc-graph-set-styles (lines points) +(defun calc-graph-set-styles (lines points &optional yerr) (calc-graph-init) (save-excursion (set-buffer calc-gnuplot-input) @@ -1067,7 +1072,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (error "No data points have been set!")) (let ((base (point)) (mode nil) (lstyle nil) (pstyle nil) - start end lenbl penbl) + start end lenbl penbl errform) (re-search-forward "[,\n]") (forward-char -1) (setq end (point) start end) @@ -1087,29 +1092,48 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (setq pstyle (string-to-number (buffer-substring (match-beginning 1) (match-end 1))))))) - (setq lenbl (or (equal mode "lines") (equal mode "linespoints")) - penbl (or (equal mode "points") (equal mode "linespoints"))) - (if lines - (or (eq lines t) - (setq lstyle lines - lenbl (>= lines 0))) - (setq lenbl (not lenbl))) - (if points - (or (eq points t) - (setq pstyle points - penbl (>= points 0))) - (setq penbl (not penbl))) - (delete-region start end) + (unless yerr + (setq lenbl (or (equal mode "lines") + (equal mode "linespoints")) + penbl (or (equal mode "points") + (equal mode "linespoints"))) + (if lines + (or (eq lines t) + (setq lstyle lines + lenbl (>= lines 0))) + (setq lenbl (not lenbl))) + (if points + (or (eq points t) + (setq pstyle points + penbl (>= points 0))) + (setq penbl (not penbl)))) + (delete-region start end) (goto-char start) - (insert " with " - (if lenbl - (if penbl "linespoints" "lines") - (if penbl "points" "dots"))) - (if (and pstyle (> pstyle 0)) - (insert " " (if (and lstyle (> lstyle 0)) (int-to-string lstyle) "1") - " " (int-to-string pstyle)) - (if (and lstyle (> lstyle 0)) - (insert " " (int-to-string lstyle)))))) + (setq errform + (condition-case nil + (math-contains-sdev-p + (eval (intern + (concat "var-" + (save-excursion + (re-search-backward ":\\(.*\\)\\}") + (match-string 1)))))) + (error nil))) + (if yerr + (insert " with yerrorbars") + (insert " with " + (if (and errform + (equal mode "dots") + (eq lines t)) + "yerrorbars" + (if lenbl + (if penbl "linespoints" "lines") + (if penbl "points" "dots")))) + (if (and pstyle (> pstyle 0)) + (insert " " + (if (and lstyle (> lstyle 0)) (int-to-string lstyle) "1") + " " (int-to-string pstyle)) + (if (and lstyle (> lstyle 0)) + (insert " " (int-to-string lstyle))))))) (calc-graph-view-commands)) (defun calc-graph-zero-x (flag) From 84d04702f47babb6e1323acc6c1bd4c761b53231 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Fri, 3 Aug 2007 05:46:27 +0000 Subject: [PATCH 31/31] (Basic Graphics): Mention graphing error forms. (Graphics Options): Mention how ` g s' handles error forms. --- man/ChangeLog | 6 ++++++ man/calc.texi | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 80ddad0085d..18cd4b72bc6 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,9 @@ +2007-08-03 Jay Belanger + + * calc.texi (Basic Graphics): Mention the graphing of error + forms. + (Graphics Options): Mention how `g s' handles error forms. + 2007-08-01 Alan Mackenzie * cc-mode.texi (Mailing Lists and Bug Reports): Correct "-no-site-file" diff --git a/man/calc.texi b/man/calc.texi index 3085e2e8dd8..9e50629a3b2 100644 --- a/man/calc.texi +++ b/man/calc.texi @@ -28417,7 +28417,10 @@ variables. The ``x'' and ``y'' values for the data points (as pulled from the vectors, calculated from the formulas, or interpolated from the intervals) should -be real numbers (integers, fractions, or floats). If either the ``x'' +be real numbers (integers, fractions, or floats). One exception to this +is that the ``y'' entry can consist of a vector of numbers combined with +error forms, in which case the points will be plotted with the +appropriate error bars. Other than this, if either the ``x'' value or the ``y'' value of a given data point is not a real number, that data point will be omitted from the graph. The points on either side of the invalid point will @emph{not} be connected by a line. @@ -28815,7 +28818,9 @@ available for any device. The @kbd{g S} (@code{calc-graph-point-style}) command similarly turns the symbols at the data points on or off, or sets the point style. If you turn both lines and points off, the data points will show as -tiny dots. +tiny dots. If the ``y'' values being plotted contain error forms and +the connecting lines are turned off, then this command will also turn +the error bars on or off. @cindex @code{LineStyles} variable @cindex @code{PointStyles} variable