summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/dired.el2
-rw-r--r--lisp/progmodes/compile.el22
-rw-r--r--lisp/version.el94
-rw-r--r--lisp/window.el7
5 files changed, 97 insertions, 41 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c9aa7e99356..a7538e50d82 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,18 @@
+2012-09-16 Chong Yidong <cyd@gnu.org>
+
+ * window.el (special-display-popup-frame): Doc fix (Bug#8853).
+ (display-buffer-function): Mark as obsolete.
+
+ * progmodes/compile.el (compilation-parse-errors): Accept list
+ values similar to font-lock-keywords (Bug#12136). Suggested by
+ Oleksandr Manzyuk.
+ (compilation-error-regexp-alist): Doc fix.
+
2012-09-15 Glenn Morris <rgm@gnu.org>
+ * version.el (emacs-bzr-version-bzr): New function.
+ (emacs-bzr-get-version): Add optional EXTERNAL argument.
+
* vc/vc-bzr.el (vc-bzr-working-revision): For lightweight local
checkouts, check the parent dirstate matches the branch.
Add "--tree" to "bzr revno" arguments. Don't try to shorten the
diff --git a/lisp/dired.el b/lisp/dired.el
index ebc8f5da6d5..54921a4ea66 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3744,7 +3744,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown
;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
-;;;;;; dired-diff) "dired-aux" "dired-aux.el" "22ce64daa7ccb5698cb6b1279aa59ec2")
+;;;;;; dired-diff) "dired-aux" "dired-aux.el" "3c768e470d5d053d0049e0286ce38da7")
;;; Generated autoloads from dired-aux.el
(autoload 'dired-diff "dired-aux" "\
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index fbb0c9e204a..f5dedf0cd59 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -488,9 +488,12 @@ What matched the HYPERLINK'th subexpression has `mouse-face' and
`compilation-message-face' applied. If this is nil, the text
matched by the whole REGEXP becomes the hyperlink.
-Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where SUBMATCH is
-the number of a submatch that should be highlighted when it matches,
-and FACE is an expression returning the face to use for that submatch.."
+Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where
+SUBMATCH is the number of a submatch and FACE is an expression
+which evaluates to a face name (a symbol or string).
+Alternatively, FACE can evaluate to a property list of the
+form (face FACE PROP1 VAL1 PROP2 VAL2 ...), in which case all the
+listed text properties PROP# are given values VAL# as well."
:type '(repeat (choice (symbol :tag "Predefined symbol")
(sexp :tag "Error specification")))
:link `(file-link :tag "example file"
@@ -1328,16 +1331,27 @@ to `compilation-error-regexp-alist' if RULES is nil."
(compilation--put-prop
end-col 'font-lock-face compilation-column-face)
+ ;; Obey HIGHLIGHT.
(dolist (extra-item (nthcdr 6 item))
(let ((mn (pop extra-item)))
(when (match-beginning mn)
(let ((face (eval (car extra-item))))
(cond
((null face))
- ((symbolp face)
+ ((or (symbolp face) (stringp face))
(put-text-property
(match-beginning mn) (match-end mn)
'font-lock-face face))
+ ((and (listp face)
+ (eq (car face) 'face)
+ (or (symbolp (cadr face))
+ (stringp (cadr face))))
+ (put-text-property
+ (match-beginning mn) (match-end mn)
+ 'font-lock-face (cadr face))
+ (add-text-properties
+ (match-beginning mn) (match-end mn)
+ (nthcdr 2 face)))
(t
(error "Don't know how to handle face %S"
face)))))))
diff --git a/lisp/version.el b/lisp/version.el
index 47476cb268a..1fb3828e15d 100644
--- a/lisp/version.el
+++ b/lisp/version.el
@@ -104,48 +104,74 @@ Returns nil if unable to find this information."
(looking-at "[0-9]+\0\\([^\0\n]+\\)\0")
(match-string 1))))))
-(defun emacs-bzr-get-version (&optional dir)
+(defun emacs-bzr-version-bzr (dir)
+ "Ask bzr itself for the version information for directory DIR."
+ ;; Comments on `bzr version-info':
+ ;; i) Unknown files also cause clean != 1.
+ ;; ii) It can be slow, contacting the upstream repo to get the
+ ;; branch nick if one is not set locally, even with a custom
+ ;; template that is not asking for the nick (as used here). You'd
+ ;; think the latter part would be trivial to fix:
+ ;; https://bugs.launchpad.net/bzr/+bug/882541/comments/3
+ ;; https://bugs.launchpad.net/bzr/+bug/629150
+ ;; You can set the nick locally with `bzr nick ...', which speeds
+ ;; things up enormously. `bzr revno' does not have this issue, but
+ ;; has no way to print the revision_id AFAICS.
+ (message "Waiting for bzr...")
+ (with-temp-buffer
+ (if (zerop
+ (call-process "bzr" nil '(t nil) nil "version-info"
+ "--custom"
+ "--template={revno} {revision_id} (clean = {clean})"
+ "dir"))
+ (buffer-string))))
+
+(defun emacs-bzr-get-version (&optional dir external)
"Try to return as a string the bzr revision of the Emacs sources.
The format is: [revno] revision_id, where revno may be absent.
Value is nil if the sources do not seem to be under bzr, or if we could
not determine the revision. Note that this reports on the current state
of the sources, which may not correspond to the running Emacs.
-Optional argument DIR is a directory to use instead of `source-directory'."
+Optional argument DIR is a directory to use instead of `source-directory'.
+Optional argument EXTERNAL non-nil means to maybe ask `bzr' itself,
+if the sources appear to be under bzr. If `force', always ask bzr.
+Otherwise only ask bzr if we cannot find any information ourselves."
(or dir (setq dir source-directory))
(when (file-directory-p (expand-file-name ".bzr/branch" dir))
- (let (file loc rev)
- (cond ((file-readable-p
- (setq file (expand-file-name ".bzr/branch/last-revision" dir)))
- (with-temp-buffer
- (insert-file-contents file)
- (goto-char (point-max))
- (if (looking-back "\n")
- (delete-char -1))
- (buffer-string)))
- ;; OK, no last-revision. Is it a lightweight checkout?
- ((file-readable-p
- (setq file (expand-file-name ".bzr/branch/location" dir)))
- (setq rev (emacs-bzr-version-dirstate dir))
- ;; If the parent branch is local, try looking there for the rev.
- ;; Note: there is no guarantee that the parent branch's rev
- ;; corresponds to this branch. This branch could have
- ;; been made with a specific -r revno argument, or the
- ;; parent could have been updated since this branch was created.
- ;; To try and detect this, we check the dirstate revids
- ;; to see if they match.
- (if (and (setq loc (with-temp-buffer
- (insert-file-contents file)
- (if (looking-at "file://\\(.*\\)")
- (match-string 1))))
- (equal rev (emacs-bzr-version-dirstate loc)))
- (emacs-bzr-get-version loc)
- ;; If parent does not match, the best we can do without
- ;; calling external commands is to use the dirstate rev.
- rev))
- ;; At this point, could fall back to:
- ;; bzr version-info --custom --template='{revno} {revision_id}\n'
- ))))
+ (if (eq external 'force)
+ (emacs-bzr-version-bzr dir)
+ (let (file loc rev)
+ (cond ((file-readable-p
+ (setq file (expand-file-name ".bzr/branch/last-revision" dir)))
+ (with-temp-buffer
+ (insert-file-contents file)
+ (goto-char (point-max))
+ (if (looking-back "\n")
+ (delete-char -1))
+ (buffer-string)))
+ ;; OK, no last-revision. Is it a lightweight checkout?
+ ((file-readable-p
+ (setq file (expand-file-name ".bzr/branch/location" dir)))
+ (setq rev (emacs-bzr-version-dirstate dir))
+ ;; If the parent branch is local, try looking there for the rev.
+ ;; Note: there is no guarantee that the parent branch's rev
+ ;; corresponds to this branch. This branch could have
+ ;; been made with a specific -r revno argument, or the
+ ;; parent could have been updated since this branch was created.
+ ;; To try and detect this, we check the dirstate revids
+ ;; to see if they match.
+ (if (and (setq loc (with-temp-buffer
+ (insert-file-contents file)
+ (if (looking-at "file://\\(.*\\)")
+ (match-string 1))))
+ (equal rev (emacs-bzr-version-dirstate loc)))
+ (emacs-bzr-get-version loc)
+ ;; If parent does not match, the best we can do without
+ ;; calling external commands is to use the dirstate rev.
+ rev))
+ (external
+ (emacs-bzr-version-bzr dir)))))))
;; We put version info into the executable in the form that `ident' uses.
(purecopy (concat "\n$Id: " (subst-char-in-string ?\n ?\s (emacs-version))
diff --git a/lisp/window.el b/lisp/window.el
index dd1f55450c3..fccb68bd94a 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4551,6 +4551,9 @@ of the window used."
(function :tag "function"))
:group 'windows)
+(make-obsolete-variable 'display-buffer-function
+ 'display-buffer-alist "24.3")
+
;; Eventually, we want to turn this into a defvar; instead of
;; customizing this, the user should use a `pop-up-frame-parameters'
;; alist entry in `display-buffer-base-action'.
@@ -4768,8 +4771,8 @@ the selected window. If they contain (same-frame . t), display
BUFFER in a window of the selected frame.
If ARGS is a list whose car is a symbol, use (car ARGS) as a
-function to do the work. Pass it BUFFER as first argument,
-and (cdr ARGS) as second."
+function to do the work. Pass it BUFFER as first argument, and
+pass the elements of (cdr ARGS) as the remaining arguments."
(if (and args (symbolp (car args)))
(apply (car args) buffer (cdr args))
(let ((window (get-buffer-window buffer 0)))