Mercurial > hg > xemacs-beta
comparison lisp/packages/add-log.el @ 207:e45d5e7c476e r20-4b2
Import from CVS: tag r20-4b2
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:03:52 +0200 |
parents | 8eaf7971accc |
children | 78478c60bfcd |
comparison
equal
deleted
inserted
replaced
206:d3e9274cbc4e | 207:e45d5e7c476e |
---|---|
111 | 111 |
112 (defvar change-log-mode-map nil | 112 (defvar change-log-mode-map nil |
113 "Keymap for Change Log major mode.") | 113 "Keymap for Change Log major mode.") |
114 (if change-log-mode-map | 114 (if change-log-mode-map |
115 nil | 115 nil |
116 (setq change-log-mode-map (make-sparse-keymap))) | 116 (setq change-log-mode-map (make-sparse-keymap)) |
117 (define-key change-log-mode-map "\C-c\C-c" 'change-log-exit) | |
118 (define-key change-log-mode-map "\C-c\C-k" 'change-log-cancel)) | |
117 | 119 |
118 (defvar change-log-time-zone-rule nil | 120 (defvar change-log-time-zone-rule nil |
119 "Time zone used for calculating change log time stamps. | 121 "Time zone used for calculating change log time stamps. |
120 It takes the same format as the TZ argument of `set-time-zone-rule'. | 122 It takes the same format as the TZ argument of `set-time-zone-rule'. |
121 If nil, use local time.") | 123 If nil, use local time.") |
267 (concat "^" (regexp-quote (file-name-directory | 269 (concat "^" (regexp-quote (file-name-directory |
268 file-name))) | 270 file-name))) |
269 buffer-file-name) | 271 buffer-file-name) |
270 (substring buffer-file-name (match-end 0)) | 272 (substring buffer-file-name (match-end 0)) |
271 (file-name-nondirectory buffer-file-name)))) | 273 (file-name-nondirectory buffer-file-name)))) |
274 | |
275 (push-window-configuration) | |
272 | 276 |
273 (if (and other-window (not (equal file-name buffer-file-name))) | 277 (if (and other-window (not (equal file-name buffer-file-name))) |
274 (find-file-other-window file-name) | 278 (find-file-other-window file-name) |
275 (find-file file-name)) | 279 (find-file file-name)) |
276 (or (eq major-mode 'change-log-mode) | 280 (or (eq major-mode 'change-log-mode) |
385 (set (make-local-variable 'page-delimiter) "^\\<\\|^\f") | 389 (set (make-local-variable 'page-delimiter) "^\\<\\|^\f") |
386 (set (make-local-variable 'version-control) 'never) | 390 (set (make-local-variable 'version-control) 'never) |
387 (set (make-local-variable 'adaptive-fill-regexp) "\\s *") | 391 (set (make-local-variable 'adaptive-fill-regexp) "\\s *") |
388 ;;(set (make-local-variable 'font-lock-defaults) | 392 ;;(set (make-local-variable 'font-lock-defaults) |
389 ;;'(change-log-font-lock-keywords t)) | 393 ;;'(change-log-font-lock-keywords t)) |
394 (when (boundp 'filladapt-mode) | |
395 ;; Filladapt works badly with ChangeLogs. Still, we disable it | |
396 ;; before change-log-mode-hook, so the users can override this | |
397 ;; choice. | |
398 (setq filladapt-mode nil)) | |
390 (run-hooks 'change-log-mode-hook)) | 399 (run-hooks 'change-log-mode-hook)) |
400 | |
401 (defun change-log-exit () | |
402 "Save the change-log buffer, and restores the old window configuration. | |
403 Buries the buffer." | |
404 (interactive) | |
405 (save-buffer) | |
406 (let ((buf (current-buffer))) | |
407 (pop-window-configuration) | |
408 (bury-buffer buf))) | |
409 | |
410 (defun change-log-cancel () | |
411 "Cancel the changes to change-log buffer. | |
412 This kills the buffer without saving, and restores the old window | |
413 configuration." | |
414 (interactive) | |
415 (kill-buffer (current-buffer)) | |
416 (pop-window-configuration)) | |
391 | 417 |
392 ;; It might be nice to have a general feature to replace this. The idea I | 418 ;; It might be nice to have a general feature to replace this. The idea I |
393 ;; have is a variable giving a regexp matching text which should not be | 419 ;; have is a variable giving a regexp matching text which should not be |
394 ;; moved from bol by filling. change-log-mode would set this to "^\\s *\\s(". | 420 ;; moved from bol by filling. change-log-mode would set this to "^\\s *\\s(". |
395 ;; But I don't feel up to implementing that today. | 421 ;; But I don't feel up to implementing that today. |