(defsubst icalendar--rris (regexp rep string &optional fixedcase literal)
"Replace regular expression in string.
Pass arguments REGEXP REP STRING FIXEDCASE LITERAL to
-`replace-regexp-in-string' (Emacs) or to `replace-in-string' (XEmacs)."
- (cond ((fboundp 'replace-regexp-in-string)
- ;; Emacs:
- (replace-regexp-in-string regexp rep string fixedcase literal))
- ((fboundp 'replace-in-string)
- ;; XEmacs:
- (save-match-data ;; apparently XEmacs needs save-match-data
- (replace-in-string string regexp rep literal)))))
+`replace-regexp-in-string'."
+ (declare (obsolete replace-regexp-in-string "27.1"))
+ (replace-regexp-in-string regexp rep string fixedcase literal))
(defun icalendar--read-element (invalue inparams)
"Recursively read the next iCalendar element in the current buffer.
(defun icalendar--convert-string-for-export (string)
"Escape comma and other critical characters in STRING."
- (icalendar--rris "," "\\\\," string))
+ (replace-regexp-in-string "," "\\\\," string))
(defun icalendar--convert-string-for-import (string)
"Remove escape chars for comma, semicolon etc. from STRING."
- (icalendar--rris
- "\\\\n" "\n " (icalendar--rris
- "\\\\\"" "\"" (icalendar--rris
- "\\\\;" ";" (icalendar--rris
+ (replace-regexp-in-string
+ "\\\\n" "\n " (replace-regexp-in-string
+ "\\\\\"" "\"" (replace-regexp-in-string
+ "\\\\;" ";" (replace-regexp-in-string
"\\\\," "," string)))))
;; ======================================================================
(setq ct (+ ct 1))
(setq pos-uid (* 2 ct)))) )
(mapc (lambda (ij)
- (setq s (icalendar--rris (car ij) (cadr ij) s t t)))
+ (setq s (replace-regexp-in-string (car ij) (cadr ij) s t t)))
(list
;; summary must be first! because of %s
(list "%s"
(concat "\\(" icalendar-import-format-uid "\\)??"))))
;; Need the \' regexp in order to detect multi-line items
(setq s (concat "\\`"
- (icalendar--rris "%s" "\\(.*?\\)" s nil t)
+ (replace-regexp-in-string "%s" "\\(.*?\\)" s nil t)
"\\'"))
(if (string-match s summary-and-rest)
(let (cla des loc org sta url uid) ;; sum
(when starttimestring
(unless endtimestring
(let ((time
- (read (icalendar--rris "^T0?" ""
+ (read (replace-regexp-in-string "^T0?" ""
starttimestring))))
(if (< time 230000)
;; Case: ends on same day
(when starttimestring
(unless endtimestring
(let ((time (read
- (icalendar--rris "^T0?" ""
+ (replace-regexp-in-string "^T0?" ""
starttimestring))))
(setq endtimestring (format "T%06d"
(+ 10000 time))))))
(when starttimestring
(unless endtimestring
(let ((time (read
- (icalendar--rris "^T0?" ""
+ (replace-regexp-in-string "^T0?" ""
starttimestring))))
(setq endtimestring (format "T%06d"
(+ 10000 time))))))
(when starttimestring
(unless endtimestring
(let ((time
- (read (icalendar--rris "^T0?" ""
+ (read (replace-regexp-in-string "^T0?" ""
starttimestring))))
(setq endtimestring (format "T%06d"
(+ 10000 time))))))
(n (nth 3 sexp))
(day (nth 4 sexp))
(summary
- (replace-regexp-in-string
+ (replace-regexp-in-string
"\\(^\s+\\|\s+$\\)" ""
(buffer-substring (point) (point-max)))))
(when starttimestring
(unless endtimestring
(let ((time
- (read (icalendar--rris "^T0?" ""
+ (read (replace-regexp-in-string "^T0?" ""
starttimestring))))
(setq endtimestring (format "T%06d"
(+ 10000 time))))))
(when starttimestring
(unless endtimestring
(let ((time
- (read (icalendar--rris "^T0?" ""
+ (read (replace-regexp-in-string "^T0?" ""
starttimestring))))
(setq endtimestring (format "T%06d"
(+ 10000 time))))))
(formatted-contents ""))
(when (and contents (> (length contents) 0))
(setq formatted-contents
- (icalendar--rris "%s"
+ (replace-regexp-in-string "%s"
(icalendar--convert-string-for-import
contents)
(symbol-value format)
t t)))
- (setq string (icalendar--rris spec
+ (setq string (replace-regexp-in-string spec
formatted-contents
string
t t))))
(ex-d (icalendar--datetime-to-diary-date
ex-start)))
(setq result
- (icalendar--rris "^%%(\\(and \\)?"
+ (replace-regexp-in-string "^%%(\\(and \\)?"
(format
"%%%%(and (not (diary-date %s)) "
ex-d)