diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 22 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 22 | ||||
-rw-r--r-- | lisp/gnus/ChangeLog | 16 | ||||
-rw-r--r-- | lisp/gnus/gnus-agent.el | 9 | ||||
-rw-r--r-- | lisp/gnus/gnus-art.el | 11 | ||||
-rw-r--r-- | lisp/gnus/gnus-sum.el | 37 | ||||
-rw-r--r-- | lisp/gnus/gnus.el | 11 | ||||
-rw-r--r-- | lisp/progmodes/gdb-ui.el | 6 | ||||
-rw-r--r-- | lisp/progmodes/perl-mode.el | 12 | ||||
-rw-r--r-- | lisp/smerge-mode.el | 51 | ||||
-rw-r--r-- | lisp/vc-bzr.el | 173 |
11 files changed, 232 insertions, 138 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 045d486b097..028fe5d2db5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,25 @@ +2007-08-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * smerge-mode.el (smerge-resolve): New arg `safe'. + (smerge-resolve-all, smerge-batch-resolve): New function. + (smerge-refine): Make sure `diff' returns the expected result. + (smerge-parsep-re): New const. + (smerge-mode): Use it to adjust paragraph-separate. + + * progmodes/perl-mode.el (perl-font-lock-syntactic-keywords): + Correctly match / regexp matchers as first char on a line when + fontifying only that line. + + * emacs-lisp/cl-macs.el (cl-transform-lambda): Preserve the match-data. + +2007-08-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * vc-bzr.el: Don't fiddle with vc-handled-backend. + (vc-bzr-registered): Don't redundantly protect against + file-error. Actually use the format-specific code. + (vc-bzr-buffer-nonblank-p): Remove. + (vc-bzr-status): Change `kindchange' -> `kindchanged'. + 2007-08-20 Juri Linkov <juri@jurta.org> * startup.el (fancy-splash-text): Change multiple tabs into one diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index a1264940d41..2a4b69d2afc 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -272,15 +272,19 @@ its argument list allows full Common Lisp conventions." (nconc (nreverse simple-args) (list '&rest (car (pop bind-lets)))) (nconc (let ((hdr (nreverse header))) - (require 'help-fns) - (cons (help-add-fundoc-usage - (if (stringp (car hdr)) (pop hdr)) - ;; orig-args can contain &cl-defs (an internal CL - ;; thingy that I do not understand), so remove it. - (let ((x (memq '&cl-defs orig-args))) - (if (null x) orig-args - (delq (car x) (remq (cadr x) orig-args))))) - hdr)) + ;; Macro expansion can take place in the middle of + ;; apparently harmless computation, so it should not + ;; touch the match-data. + (save-match-data + (require 'help-fns) + (cons (help-add-fundoc-usage + (if (stringp (car hdr)) (pop hdr)) + ;; orig-args can contain &cl-defs (an internal + ;; CL thingy I don't understand), so remove it. + (let ((x (memq '&cl-defs orig-args))) + (if (null x) orig-args + (delq (car x) (remq (cadr x) orig-args))))) + hdr))) (list (nconc (list 'let* bind-lets) (nreverse bind-forms) body))))))) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 7fd187a4aeb..201b7fefdcb 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,19 @@ +2007-08-17 Katsumi Yamaoka <yamaoka@jpl.org> + + * gnus-art.el (gnus-article-summary-command-nosave) + (gnus-article-read-summary-keys): Don't use 3rd arg of pop-to-buffer. + +2007-08-14 Katsumi Yamaoka <yamaoka@jpl.org> + + * gnus.el (gnus-maximum-newsgroup): New variable. + + * gnus-agent.el (gnus-agent-fetch-headers): Limit the range of articles + according to gnus-maximum-newsgroup. + + * gnus-sum.el (gnus-articles-to-read, gnus-list-of-unread-articles) + (gnus-list-of-read-articles, gnus-sequence-of-unread-articles): Limit + the range of articles according to gnus-maximum-newsgroup. + 2007-08-10 Katsumi Yamaoka <yamaoka@jpl.org> * nntp.el (nntp-xref-number-is-evil): New server variable. diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index 7b98b1e045a..347b57983e6 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -1765,7 +1765,14 @@ article numbers will be returned." (gnus-agent-find-parameter group 'agent-predicate))))) (articles (if fetch-all - (gnus-uncompress-range (gnus-active group)) + (if gnus-maximum-newsgroup + (let ((active (gnus-active group))) + (gnus-uncompress-range + (cons (max (car active) + (- (cdr active) + gnus-maximum-newsgroup -1)) + (cdr active)))) + (gnus-uncompress-range (gnus-active group))) (gnus-list-of-unread-articles group))) (gnus-decode-encoded-word-function 'identity) (gnus-decode-encoded-address-function 'identity) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 6ccba3b108f..696222e0043 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -5607,7 +5607,7 @@ not have a face in `gnus-article-boring-faces'." "Execute the last keystroke in the summary buffer." (interactive) (let (func) - (pop-to-buffer gnus-article-current-summary nil (not (featurep 'xemacs))) + (pop-to-buffer gnus-article-current-summary) (setq func (lookup-key (current-local-map) (this-command-keys))) (call-interactively func))) @@ -5646,8 +5646,7 @@ not have a face in `gnus-article-boring-faces'." (member keys nosave-in-article)) (let (func) (save-window-excursion - (pop-to-buffer gnus-article-current-summary - nil (not (featurep 'xemacs))) + (pop-to-buffer gnus-article-current-summary) ;; We disable the pick minor mode commands. (let (gnus-pick-mode) (setq func (lookup-key (current-local-map) keys)))) @@ -5659,16 +5658,14 @@ not have a face in `gnus-article-boring-faces'." (call-interactively func) (setq new-sum-point (point))) (when (member keys nosave-but-article) - (pop-to-buffer gnus-article-buffer - nil (not (featurep 'xemacs))))) + (pop-to-buffer gnus-article-buffer))) ;; These commands should restore window configuration. (let ((obuf (current-buffer)) (owin (current-window-configuration)) (opoint (point)) win func in-buffer selected new-sum-start new-sum-hscroll) (cond (not-restore-window - (pop-to-buffer gnus-article-current-summary - nil (not (featurep 'xemacs)))) + (pop-to-buffer gnus-article-current-summary)) ((setq win (get-buffer-window gnus-article-current-summary)) (select-window win)) (t diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 708689fef9e..851ec88c96f 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -5472,7 +5472,13 @@ If SELECT-ARTICLES, only select those articles from GROUP." ;; articles in the group, or (if that's nil), the ;; articles in the cache. (or - (gnus-uncompress-range (gnus-active group)) + (if gnus-maximum-newsgroup + (let ((active (gnus-active group))) + (gnus-uncompress-range + (cons (max (car active) + (- (cdr active) gnus-maximum-newsgroup -1)) + (cdr active)))) + (gnus-uncompress-range (gnus-active group))) (gnus-cache-articles-in-group group)) ;; Select only the "normal" subset of articles. (gnus-sorted-nunion @@ -6534,23 +6540,26 @@ displayed, no centering will be performed." (let* ((read (gnus-info-read (gnus-get-info group))) (active (or (gnus-active group) (gnus-activate-group group))) (last (cdr active)) + (bottom (if gnus-maximum-newsgroup + (max (car active) (- last gnus-maximum-newsgroup -1)) + (car active))) first nlast unread) ;; If none are read, then all are unread. (if (not read) - (setq first (car active)) + (setq first bottom) ;; If the range of read articles is a single range, then the ;; first unread article is the article after the last read ;; article. Sounds logical, doesn't it? (if (and (not (listp (cdr read))) - (or (< (car read) (car active)) + (or (< (car read) bottom) (progn (setq read (list read)) nil))) - (setq first (max (car active) (1+ (cdr read)))) + (setq first (max bottom (1+ (cdr read)))) ;; `read' is a list of ranges. (when (/= (setq nlast (or (and (numberp (car read)) (car read)) (caar read))) 1) - (setq first (car active))) + (setq first bottom)) (while read (when first (while (< first nlast) @@ -6575,7 +6584,12 @@ displayed, no centering will be performed." (gnus-list-range-difference (gnus-list-range-difference (gnus-sorted-complement - (gnus-uncompress-range active) + (gnus-uncompress-range + (if gnus-maximum-newsgroup + (cons (max (car active) + (- (cdr active) gnus-maximum-newsgroup -1)) + (cdr active)) + active)) (gnus-list-of-unread-articles group)) (cdr (assq 'dormant marked))) (cdr (assq 'tick marked)))))) @@ -6587,23 +6601,26 @@ displayed, no centering will be performed." (let* ((read (gnus-info-read (gnus-get-info group))) (active (or (gnus-active group) (gnus-activate-group group))) (last (cdr active)) + (bottom (if gnus-maximum-newsgroup + (max (car active) (- last gnus-maximum-newsgroup -1)) + (car active))) first nlast unread) ;; If none are read, then all are unread. (if (not read) - (setq first (car active)) + (setq first bottom) ;; If the range of read articles is a single range, then the ;; first unread article is the article after the last read ;; article. Sounds logical, doesn't it? (if (and (not (listp (cdr read))) - (or (< (car read) (car active)) + (or (< (car read) bottom) (progn (setq read (list read)) nil))) - (setq first (max (car active) (1+ (cdr read)))) + (setq first (max bottom (1+ (cdr read)))) ;; `read' is a list of ranges. (when (/= (setq nlast (or (and (numberp (car read)) (car read)) (caar read))) 1) - (setq first (car active))) + (setq first bottom)) (while read (when first (push (cons first nlast) unread)) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 0e8e9908cf4..3f75bba6d1c 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -1501,6 +1501,17 @@ If it is nil, no confirmation is required." :type '(choice (const :tag "No limit" nil) integer)) +(defcustom gnus-maximum-newsgroup nil + "The maximum number of articles a newsgroup. +If this is a number, old articles in a newsgroup exceeding this number +are silently ignored. If it is nil, no article is ignored. Note that +setting this variable to a number might prevent you from reading very +old articles." + :group 'gnus-group-select + :version "22.2" + :type '(choice (const :tag "No limit" nil) + integer)) + (defcustom gnus-use-long-file-name (not (memq system-type '(usg-unix-v xenix))) "*Non-nil means that the default name of a file to save articles in is the group name. If it's nil, the directory form of the group name is used instead. diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index c4d14462245..716b79138f9 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -1132,10 +1132,10 @@ This filter may simply queue input for a later time." (let ((item (concat string "\n"))) (if gdb-enable-debug (push (cons 'send item) gdb-debug-log)) (process-send-string proc item))) - (if (and (string-match "\\\\$" string) - (not comint-input-sender-no-newline)) ;;Try to catch C-d. + (if (string-match "\\\\\\'" string) (setq gdb-continuation (concat gdb-continuation string "\n")) - (let ((item (concat gdb-continuation string "\n"))) + (let ((item (concat gdb-continuation string + (if (not comint-input-sender-no-newline) "\n")))) (gdb-enqueue-input item) (setq gdb-continuation nil))))) diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index cfef0eedfe4..f2feff595bb 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -267,8 +267,16 @@ The expansion is entirely correct because it uses the C preprocessor." ("^[ \t]*format.*=[ \t]*\\(\n\\)" (1 '(7))) ;; Funny things in sub arg specifications like `sub myfunc ($$)' ("\\<sub\\s-+\\S-+\\s-*(\\([^)]+\\))" 1 '(1)) - ;; regexp and funny quotes - ("[?:.,;=!~({[][ \t\n]*\\(/\\)" (1 '(7))) + ;; Regexp and funny quotes. + ("\\(?:[?:.,;=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)" + (2 (if (and (match-end 1) + (save-excursion + (goto-char (match-end 1)) + (skip-chars-backward " \t\n") + (not (memq (char-before) + '(?? ?: ?. ?, ?\; ?= ?! ?~ ?\( ?\[))))) + nil ;; A division sign instead of a regexp-match. + '(7)))) ("\\(^\\|[?:.,;=!~({[ \t]\\)\\([msy]\\|q[qxrw]?\\|tr\\)\\>\\s-*\\([^])}> \n\t]\\)" ;; Nasty cases: ;; /foo/m $a->m $#m $m @m %m diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el index ef80ef81679..e3484bb0a48 100644 --- a/lisp/smerge-mode.el +++ b/lisp/smerge-mode.el @@ -324,7 +324,8 @@ Can be nil if the style is undecided, or else: (defvar smerge-resolve-function (lambda () (error "Don't know how to resolve")) "Mode-specific merge function. -The function is called with no argument and with the match data set +The function is called with zero or one argument (non-nil if the resolution +function should only apply safe heuristics) and with the match data set according to `smerge-match-conflict'.") (add-to-list 'debug-ignored-errors "Don't know how to resolve") @@ -378,7 +379,7 @@ according to `smerge-match-conflict'.") (smerge-remove-props (or beg (point-min)) (or end (point-max))) (push event unread-command-events))))) -(defun smerge-resolve () +(defun smerge-resolve (&optional safe) "Resolve the conflict at point intelligently. This relies on mode-specific knowledge and thus only works in some major modes. Uses `smerge-resolve-function' to do the actual work." @@ -393,8 +394,10 @@ some major modes. Uses `smerge-resolve-function' to do the actual work." ;; Mode-specific conflict resolution. ((condition-case nil (atomic-change-group - (funcall smerge-resolve-function) - t) + (if safe + (funcall smerge-resolve-function safe) + (funcall smerge-resolve-function)) + t) (error nil)) ;; Nothing to do: the resolution function has done it already. nil) @@ -412,6 +415,31 @@ some major modes. Uses `smerge-resolve-function' to do the actual work." (error "Don't know how to resolve"))) (smerge-auto-leave)) +(defun smerge-resolve-all () + "Perform automatic resolution on all conflicts." + (interactive) + (save-excursion + (goto-char (point-min)) + (while (re-search-forward smerge-begin-re nil t) + (condition-case nil + (progn + (smerge-match-conflict) + (smerge-resolve 'safe)) + (error nil))))) + +(defun smerge-batch-resolve () + ;; command-line-args-left is what is left of the command line. + (if (not noninteractive) + (error "`smerge-batch-resolve' is to be used only with -batch")) + (while command-line-args-left + (let ((file (pop command-line-args-left))) + (message "Resolving conflicts in %s..." file) + (when (file-readable-p file) + (with-current-buffer (find-file-noselect file) + (smerge-resolve-all) + (save-buffer) + (kill-buffer (current-buffer))))))) + (defun smerge-keep-base () "Revert to the base version." (interactive) @@ -677,7 +705,9 @@ Point is moved to the end of the conflict." (unwind-protect (with-temp-buffer (let ((coding-system-for-read 'emacs-mule)) - (call-process diff-command nil t nil file1 file2)) + ;; Don't forget -a to make sure diff treats it as a text file + ;; even if it contains \0 and such. + (call-process diff-command nil t nil "-a" file1 file2)) ;; Process diff's output. (goto-char (point-min)) (while (not (eobp)) @@ -831,6 +861,10 @@ buffer names." (message "Please resolve conflicts now; exit ediff when done"))) +(defconst smerge-parsep-re + (concat smerge-begin-re "\\|" smerge-end-re "\\|" + smerge-base-re "\\|" smerge-other-re "\\|")) + ;;;###autoload (define-minor-mode smerge-mode "Minor mode to simplify editing output from the diff3 program. @@ -845,6 +879,13 @@ buffer names." (while (smerge-find-conflict) (save-excursion (font-lock-fontify-region (match-beginning 0) (match-end 0) nil))))) + (if (string-match (regexp-quote smerge-parsep-re) paragraph-separate) + (unless smerge-mode + (set (make-local-variable 'paragraph-separate) + (replace-match "" t t paragraph-separate))) + (when smerge-mode + (set (make-local-variable 'paragraph-separate) + (concat smerge-parsep-re paragraph-separate)))) (unless smerge-mode (smerge-remove-props (point-min) (point-max)))) diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index 20a9ca9b2fb..c42a64969f2 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el @@ -59,7 +59,7 @@ (defgroup vc-bzr nil "VC bzr backend." -;; :version "22" + :version "22.2" :group 'vc) (defcustom vc-bzr-program "bzr" @@ -131,38 +131,27 @@ format 3' in the first line. If the `checkout/dirstate' file cannot be parsed, fall back to running `vc-bzr-state'." - (condition-case nil - (lexical-let ((root (vc-bzr-root file))) - (and root ; Short cut. - ;; This looks at internal files. May break if they change - ;; their format. - (lexical-let - ((dirstate-file (expand-file-name vc-bzr-admin-dirstate root))) - (if (file-exists-p dirstate-file) - (with-temp-buffer - (insert-file-contents dirstate-file) - (goto-char (point-min)) - (when (looking-at "#bazaar dirstate flat format 3") - (let* ((relfile (file-relative-name file root)) - (reldir (file-name-directory relfile))) - (re-search-forward - (concat "^\0" - (if reldir (regexp-quote (directory-file-name reldir))) - "\0" - (regexp-quote (file-name-nondirectory relfile)) - "\0") - nil t)))) - t)) - (vc-bzr-state file))) ; Expensive. - (file-error nil))) ; vc-bzr-program not found - -(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)))) + (lexical-let ((root (vc-bzr-root file))) + (when root ; Short cut. + ;; This looks at internal files. May break if they change + ;; their format. + (lexical-let ((dirstate (expand-file-name vc-bzr-admin-dirstate root))) + (if (not (file-readable-p dirstate)) + (vc-bzr-state file) ; Expensive. + (with-temp-buffer + (insert-file-contents dirstate) + (goto-char (point-min)) + (if (not (looking-at "#bazaar dirstate flat format 3")) + (vc-bzr-state file) ; Some other unknown format? + (let* ((relfile (file-relative-name file root)) + (reldir (file-name-directory relfile))) + (re-search-forward + (concat "^\0" + (if reldir (regexp-quote (directory-file-name reldir))) + "\0" + (regexp-quote (file-name-nondirectory relfile)) + "\0") + nil t))))))))) (defconst vc-bzr-state-words "added\\|ignored\\|kind changed\\|modified\\|removed\\|renamed\\|unknown" @@ -181,61 +170,53 @@ running `vc-bzr-state'." (defun vc-bzr-status (file) "Return FILE status according to Bzr. Return value is a cons (STATUS . WARNING), where WARNING is a -string or nil, and STATUS is one of the symbols: 'added, -'ignored, 'kindchange, 'modified, 'removed, 'renamed, 'unknown, +string or nil, and STATUS is one of the symbols: `added', +`ignored', `kindchanged', `modified', `removed', `renamed', `unknown', which directly correspond to `bzr status' output, or 'unchanged for files whose copy in the working tree is identical to the one in the branch repository, or nil for files that are not registered with Bzr. If any error occurred in running `bzr status', then return nil." - (condition-case nil (with-temp-buffer - (let ((ret (vc-bzr-command "status" t 0 file)) - (status 'unchanged)) - ;; the only secure status indication in `bzr status' output - ;; is a couple of lines following the pattern:: - ;; | <status>: - ;; | <file name> - ;; 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 - ;; bzr prints paths relative to the repository root - (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+" - (regexp-quote (vc-bzr-file-name-relative file)) - (if (file-directory-p file) "/?" "") - "[ \t\n]*$") - (point-max) t) - (let ((start (match-beginning 0)) - (end (match-end 0))) - (goto-char start) + (let ((ret (condition-case nil + (vc-bzr-command "status" t 0 file) + (file-error nil))) ; vc-bzr-program not found. + (status 'unchanged)) + ;; the only secure status indication in `bzr status' output + ;; is a couple of lines following the pattern:: + ;; | <status>: + ;; | <file name> + ;; 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 + ;; bzr prints paths relative to the repository root. + (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+" + (regexp-quote (vc-bzr-file-name-relative file)) + (if (file-directory-p file) "/?" "") + "[ \t\n]*$") + nil t) + (let ((status (match-string 1))) + ;; Erase the status text that matched. + (delete-region (match-beginning 0) (match-end 0)) (setq status - (cond - ((not (equal ret 0)) nil) - ((looking-at "added") 'added) - ((looking-at "kind changed") 'kindchange) - ((looking-at "renamed") 'renamed) - ((looking-at "modified") 'modified) - ((looking-at "removed") 'removed) - ((looking-at "ignored") 'ignored) - ((looking-at "unknown") 'unknown))) - ;; erase the status text that matched - (delete-region start end))) - (if status - (cons status - ;; "bzr" will output warnings and informational messages to - ;; stderr; due to Emacs' `vc-do-command' (and, it seems, - ;; `start-process' itself) limitations, 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. - (if (vc-bzr-buffer-nonblank-p) - (buffer-substring (point-min) (point-max))))))) - (file-error nil))) ; vc-bzr-program not found + (and (equal ret 0) ; Seems redundant. --Stef + (intern (replace-regexp-in-string " " "" + status)))))) + (when status + (goto-char (point-min)) + (skip-chars-forward " \n\t") ;Throw away spaces. + (cons status + ;; "bzr" will output warnings and informational messages to + ;; stderr; due to Emacs' `vc-do-command' (and, it seems, + ;; `start-process' itself) limitations, 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. + (unless (eobp) (buffer-substring (point) (point-max)))))))) (defun vc-bzr-state (file) (lexical-let ((result (vc-bzr-status file))) @@ -244,7 +225,7 @@ If any error occurred in running `bzr status', then return nil." (message "Warnings in `bzr' output: %s" (cdr result))) (cdr (assq (car result) '((added . edited) - (kindchange . edited) + (kindchanged . edited) (renamed . edited) (modified . edited) (removed . edited) @@ -265,7 +246,7 @@ If any error occurred in running `bzr status', then return nil." ;; bzr process. This looks at internal files. May break if they ;; change their format. (if (file-exists-p branch-format-file) - (with-temp-buffer + (with-temp-buffer (insert-file-contents branch-format-file) (goto-char (point-min)) (cond @@ -273,7 +254,7 @@ If any error occurred in running `bzr status', then return nil." (looking-at "Bazaar-NG branch, format 0.0.4") (looking-at "Bazaar-NG branch format 5")) ;; count lines in .bzr/branch/revision-history - (insert-file-contents revhistory-file) + (insert-file-contents revhistory-file) (number-to-string (count-lines (line-end-position) (point-max)))) ((looking-at "Bazaar Branch Format 6 (bzr 0.15)") ;; revno is the first number in .bzr/branch/last-revision @@ -341,10 +322,10 @@ EDITABLE is ignored." (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))))) + (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 @@ -377,7 +358,6 @@ EDITABLE is ignored." "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. @@ -401,7 +381,6 @@ EDITABLE is ignored." (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) @@ -463,11 +442,11 @@ property containing author and date information." ;; 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. + (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))) + (/ (+ (* (float (car time)) (lsh 1 16)) (cadr time)) 24 3600))) (defun vc-bzr-annotate-time () (when (re-search-forward "^ *[0-9]+ |" nil t) @@ -549,7 +528,7 @@ Optional argument LOCALP is always ignored." (setq current-bzr-state 'added)) ((looking-at "^kind changed") (setq current-vc-state 'edited) - (setq current-bzr-state 'kindchange)) + (setq current-bzr-state 'kindchanged)) ((looking-at "^modified") (setq current-vc-state 'edited) (setq current-bzr-state 'modified)) @@ -591,17 +570,9 @@ Optional argument LOCALP is always ignored." ;; 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 vc-bzr-admin-dirname 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 |