diff options
| author | Dan Nicolaescu | 2007-08-25 20:07:23 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2007-08-25 20:07:23 +0000 |
| commit | 3a44b2ae7a16ee3cb5b5f706d6e80c53c801a7f2 (patch) | |
| tree | 32301e6ceab2cce4b467a7b77d2468339de40fa0 | |
| parent | 6f222162a7b840f73ad4e645af5bcdf5649ef7b8 (diff) | |
| download | emacs-3a44b2ae7a16ee3cb5b5f706d6e80c53c801a7f2.tar.gz emacs-3a44b2ae7a16ee3cb5b5f706d6e80c53c801a7f2.zip | |
(log-view-marked-list): Delete variable.
(log-view-mode): Don't use it.
(log-view-toggle-mark-entry): Likewise, simplify.
(log-view-current-tag): Don't return properties.
(log-view-get-marked): New function.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/log-view.el | 41 |
2 files changed, 27 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1e061579124..cb8fe202793 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2007-08-25 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * log-view.el (log-view-marked-list): Delete variable. | ||
| 4 | (log-view-mode): Don't use it. | ||
| 5 | (log-view-toggle-mark-entry): Likewise, simplify. | ||
| 6 | (log-view-current-tag): Don't return properties. | ||
| 7 | (log-view-get-marked): New function. | ||
| 8 | |||
| 1 | 2007-08-25 Alexandre Julliard <julliard@winehq.org> | 9 | 2007-08-25 Alexandre Julliard <julliard@winehq.org> |
| 2 | 10 | ||
| 3 | * vc-git.el (vc-git-mode-line-string): New function. | 11 | * vc-git.el (vc-git-mode-line-string): New function. |
diff --git a/lisp/log-view.el b/lisp/log-view.el index 4ff80ff21a5..4fe2200b4ea 100644 --- a/lisp/log-view.el +++ b/lisp/log-view.el | |||
| @@ -178,8 +178,6 @@ The match group number 1 should match the revision number itself.") | |||
| 178 | (defconst log-view-font-lock-defaults | 178 | (defconst log-view-font-lock-defaults |
| 179 | '(log-view-font-lock-keywords t nil nil nil)) | 179 | '(log-view-font-lock-keywords t nil nil nil)) |
| 180 | 180 | ||
| 181 | (defvar log-view-marked-list nil) | ||
| 182 | |||
| 183 | ;;;; | 181 | ;;;; |
| 184 | ;;;; Actual code | 182 | ;;;; Actual code |
| 185 | ;;;; | 183 | ;;;; |
| @@ -188,7 +186,6 @@ The match group number 1 should match the revision number itself.") | |||
| 188 | (define-derived-mode log-view-mode fundamental-mode "Log-View" | 186 | (define-derived-mode log-view-mode fundamental-mode "Log-View" |
| 189 | "Major mode for browsing CVS log output." | 187 | "Major mode for browsing CVS log output." |
| 190 | (setq buffer-read-only t) | 188 | (setq buffer-read-only t) |
| 191 | (make-local-variable 'log-view-marked-list) | ||
| 192 | (set (make-local-variable 'font-lock-defaults) log-view-font-lock-defaults) | 189 | (set (make-local-variable 'font-lock-defaults) log-view-font-lock-defaults) |
| 193 | (set (make-local-variable 'cvs-minor-wrap-function) 'log-view-minor-wrap)) | 190 | (set (make-local-variable 'cvs-minor-wrap-function) 'log-view-minor-wrap)) |
| 194 | 191 | ||
| @@ -236,12 +233,11 @@ The match group number 1 should match the revision number itself.") | |||
| 236 | (forward-line 1) | 233 | (forward-line 1) |
| 237 | (let ((pt (point))) | 234 | (let ((pt (point))) |
| 238 | (when (re-search-backward log-view-message-re nil t) | 235 | (when (re-search-backward log-view-message-re nil t) |
| 239 | (let ((rev (match-string 1))) | 236 | (let ((rev (match-string-no-properties 1))) |
| 240 | (unless (re-search-forward log-view-file-re pt t) | 237 | (unless (re-search-forward log-view-file-re pt t) |
| 241 | rev)))))) | 238 | rev)))))) |
| 242 | 239 | ||
| 243 | (defun log-view-toggle-mark-entry () | 240 | (defun log-view-toggle-mark-entry () |
| 244 | "Toggle marking for on log entry." | ||
| 245 | (interactive) | 241 | (interactive) |
| 246 | (save-excursion | 242 | (save-excursion |
| 247 | (forward-line 1) | 243 | (forward-line 1) |
| @@ -250,33 +246,34 @@ The match group number 1 should match the revision number itself.") | |||
| 250 | (let ((beg (match-beginning 0)) | 246 | (let ((beg (match-beginning 0)) |
| 251 | end ov ovlist found tag) | 247 | end ov ovlist found tag) |
| 252 | (unless (re-search-forward log-view-file-re pt t) | 248 | (unless (re-search-forward log-view-file-re pt t) |
| 253 | ;; Look to see if the current entry is marked by looking | 249 | ;; Look to see if the current entry is marked. |
| 254 | ;; at the overlays at point. | 250 | (setq found (get-char-property (point) 'log-view-self)) |
| 255 | (setq ovlist (overlays-at (point))) | ||
| 256 | (dolist (ovl ovlist) | ||
| 257 | (when (overlay-get ovl 'log-view-marked) | ||
| 258 | (setq found ovl))) | ||
| 259 | (if found | 251 | (if found |
| 260 | (progn | 252 | (delete-overlay found) |
| 261 | ;; Remove this entry from the marked list and remove | 253 | ;; Create an overlay that covers this entry and change |
| 262 | ;; the overlay. | 254 | ;; it's color. |
| 263 | (setq log-view-marked-list | ||
| 264 | (delq (overlay-get found 'log-view-marked) | ||
| 265 | log-view-marked-list)) | ||
| 266 | (delete-overlay found)) | ||
| 267 | ;; Add this entry to the marked list and create an | ||
| 268 | ;; overlay that covers it. | ||
| 269 | (setq tag (log-view-current-tag (point))) | 255 | (setq tag (log-view-current-tag (point))) |
| 270 | (push tag log-view-marked-list) | ||
| 271 | (forward-line 1) | 256 | (forward-line 1) |
| 272 | (setq end | 257 | (setq end |
| 273 | (if (re-search-forward log-view-message-re nil t) | 258 | (if (re-search-forward log-view-message-re nil t) |
| 274 | (match-beginning 0) | 259 | (match-beginning 0) |
| 275 | (point-max))) | 260 | (point-max))) |
| 276 | (setq ov (make-overlay beg end)) | 261 | (setq ov (make-overlay beg end)) |
| 277 | (overlay-put ov 'face 'log-view-file) | 262 | (overlay-put ov 'face 'log-view-file) |
| 263 | ;; This is used to check if the overlay is present. | ||
| 264 | (overlay-put ov 'log-view-self ov) | ||
| 278 | (overlay-put ov 'log-view-marked tag)))))))) | 265 | (overlay-put ov 'log-view-marked tag)))))))) |
| 279 | 266 | ||
| 267 | (defun log-view-get-marked () | ||
| 268 | (save-excursion | ||
| 269 | (let ((pos (point-min)) | ||
| 270 | marked-list ov) | ||
| 271 | (while (setq pos (next-single-property-change pos 'face)) | ||
| 272 | (when (setq ov (get-char-property pos 'log-view-self)) | ||
| 273 | (push (overlay-get ov 'log-view-marked) marked-list) | ||
| 274 | (setq pos (overlay-end ov)))) | ||
| 275 | marked-list))) | ||
| 276 | |||
| 280 | (defvar cvs-minor-current-files) | 277 | (defvar cvs-minor-current-files) |
| 281 | (defvar cvs-branch-prefix) | 278 | (defvar cvs-branch-prefix) |
| 282 | (defvar cvs-secondary-branch-prefix) | 279 | (defvar cvs-secondary-branch-prefix) |