diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-09-09 15:39:04 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-09-09 15:39:04 +0000 |
commit | 91945aae61a6c443d74b2b031edb0cd88c7ca629 (patch) | |
tree | acf1531f379241bd29204a7eb1d9ced435ae025c /elisp | |
parent | c125054cbeb1de7c71b8806034a264e7f3d1f53c (diff) | |
download | gsc-91945aae61a6c443d74b2b031edb0cd88c7ca629.tar.gz gsc-91945aae61a6c443d74b2b031edb0cd88c7ca629.tar.bz2 |
Minor modifications
git-svn-id: file:///svnroot/gsc/trunk@139 d2de0444-eb31-0410-8365-af798a554d48
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/links-mode.el | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/elisp/links-mode.el b/elisp/links-mode.el index 932275b..c990c34 100644 --- a/elisp/links-mode.el +++ b/elisp/links-mode.el @@ -243,17 +243,27 @@ Variable LINKS-TEMPLATE-FILE specifies name of template file. (insert-file template) (beginning-of-buffer) (while (not (eobp)) - (when (search-forward-regexp "\\$[^\\$]+\\$" nil t) - (save-excursion - (cond - ((string= (match-string 0) "$contents$") - (delete-region (match-beginning 0) (match-end 0)) - (out-contents tree)) - ((string= (match-string 0) "$index$") - (setq has-index t) - (delete-region (match-beginning 0) (match-end 0)) - (out-index tree))))) - (forward-line)))))) + (if (search-forward-regexp "\\$[^\\$]+\\$" nil t) + (save-excursion + (cond + ((string= (match-string 0) "$contents$") + (delete-region (match-beginning 0) (match-end 0)) + (out-contents tree)) + ((string= (match-string 0) "$index$") + (setq has-index t) + (delete-region (match-beginning 0) (match-end 0)) + (out-index tree)) + ((string= (match-string 0) "$date$") + (replace-match (format-time-string "%Y-%m-%d" (current-time)))) + ((string= (match-string 0) "$time$") + (replace-match (format-time-string "%H:%M:%S" (current-time)))) + ((string= (match-string 0) "$user$") + (replace-match (user-real-login-name))) + ((string= (match-string 0) "$fullname$") + (replace-match (user-full-name))) + ((string= (match-string 0) "$email$") + (replace-match user-mail-address)))) + (forward-line))))))) ;;;###autoload (define-derived-mode links-mode outline-mode "Links" |