registered in variable `mu-cite-get-field-value-method-alist' is called."
(or (std11-field-body name)
(let ((method (assq major-mode mu-cite-get-field-value-method-alist)))
- (when method
- (funcall (cdr method) name)))))
+ (if method
+ (funcall (cdr method) name)))))
;;; @ item methods
(interactive)
(mu-cite-make-methods)
(save-restriction
- (when (< (mark t) (point))
- (exchange-point-and-mark))
+ (if (< (mark t) (point))
+ (exchange-point-and-mark))
(narrow-to-region (point)(point-max))
(run-hooks 'mu-cite-pre-cite-hook)
(let ((last-point (point))
(top (mu-cite-eval-format mu-cite-top-format))
(prefix (mu-cite-eval-format mu-cite-prefix-format)))
- (when (re-search-forward "^-*$" nil nil)
- (forward-line 1))
+ (if (re-search-forward "^-*$" nil nil)
+ (forward-line 1))
(widen)
(delete-region last-point (point))
(insert top)
(setq last-point (point))
(while (< (point)(mark t))
- (unless (looking-at mu-cite-cited-prefix-regexp)
- (insert prefix))
+ (or (looking-at mu-cite-cited-prefix-regexp)
+ (insert prefix))
(forward-line 1))
(goto-char last-point))
(run-hooks 'mu-cite-post-cite-hook)))
(goto-char (point-min))
(let ((i 0)
(prefix
- (buffer-substring
- (progn (beginning-of-line)(point))
- (progn (end-of-line)(point))))
+ (buffer-substring (line-beginning-position)
+ (line-end-position)))
str ret)
(while (and (= (forward-line) 0)
(setq str (buffer-substring
(if (stringp ret)
ret
(cadr ret)))
- (incf i))
+ (setq i (1+ i)))
(cond ((> i 1) prefix)
((> i 0)
(goto-char (point-min))
(concat "[" citation-mark-chars "]") nil t)
(progn
(goto-char (match-end 0))
- (when (looking-at "[ \t]+")
- (goto-char (match-end 0)))
+ (if (looking-at "[ \t]+")
+ (goto-char (match-end 0)))
(buffer-substring (point-min)(point)))
prefix)))
((progn
(re-search-backward
(concat "[" citation-mark-chars "]") nil t))
(goto-char (match-end 0))
- (when (looking-at "[ \t]+")
- (goto-char (match-end 0)))
+ (if (looking-at "[ \t]+")
+ (goto-char (match-end 0)))
(buffer-substring (point-min)(point)))
(t "")))))
(let ((b (match-beginning 0))
(e (match-end 0)))
(delete-region b e)
- (when (and (> b (point-min))
- (let ((cat (char-category
- (char-before b))))
- (or (string-match "a" cat)
- (string-match "l" cat))))
- (insert " "))))
+ (if (and (> b (point-min))
+ (let ((cat (char-category
+ (char-before b))))
+ (or (string-match "a" cat)
+ (string-match "l" cat))))
+ (insert " "))))
(goto-char (point-min))
(fill-region (point-min) (point-max))))))
(prefix (buffer-substring b e))
ps pe (s 0)
(nest (let ((i 0))
- (when (string-match "<[^<>]+>" prefix)
- (setq prefix (substring prefix 0 (match-beginning 0))))
+ (if (string-match "<[^<>]+>" prefix)
+ (setq prefix
+ (substring prefix 0 (match-beginning 0))))
(while (string-match
(concat "\\([" citation-mark-chars "]+\\)[ \t]*")
prefix s)
c1 c2)
(while (and (< p len)
(progn
- (setq c1 (aref str1 p)
- c2 (aref str2 p))
+ (setq c1 (sref str1 p)
+ c2 (sref str2 p))
(eq c1 c2)))
- (setq p (+ p (char-length c1))))
+ (setq p (char-next-index c1 p)))
(and (> p 0)
(let ((matched (substring str1 0 p))
(r1 (and (< p len1)(substring str1 p)))