Changeset View
Changeset View
Standalone View
Standalone View
editors/apel/files/patch-poe.el
Show First 20 Lines • Show All 708 Lines • ▼ Show 20 Lines | |||||
+ `(let ((standard-output | + `(let ((standard-output | ||||
+ (get-buffer-create (generate-new-buffer-name " *string-output*")))) | + (get-buffer-create (generate-new-buffer-name " *string-output*")))) | ||||
+ (let ((standard-output standard-output)) | + (let ((standard-output standard-output)) | ||||
+ ,@body) | + ,@body) | ||||
+ (with-current-buffer standard-output | + (with-current-buffer standard-output | ||||
+ (prog1 | + (prog1 | ||||
+ (buffer-string) | + (buffer-string) | ||||
+ (kill-buffer nil))))) | + (kill-buffer nil))))) | ||||
;; Emacs 20.1 and later: (combine-after-change-calls &rest BODY) | ;; Emacs 20.1 and later: (combine-after-change-calls &rest BODY) | ||||
(defmacro-maybe combine-after-change-calls (&rest body) | (defmacro-maybe combine-after-change-calls (&rest body) | ||||
@@ -1056,20 +1056,20 @@ STRING should be given if the last searc | @@ -1056,20 +1056,20 @@ STRING should be given if the last searc | ||||
;; We support following API. | ;; We support following API. | ||||
;; (replace-match NEWTEXT &optional FIXEDCASE LITERAL STRING) | ;; (replace-match NEWTEXT &optional FIXEDCASE LITERAL STRING) | ||||
(static-condition-case nil | (static-condition-case nil | ||||
- ;; compile-time check | - ;; compile-time check | ||||
- (progn | - (progn | ||||
Show All 21 Lines | |||||
+ (progn | + (progn | ||||
+ (fset 'si:replace-match (symbol-function 'replace-match)) | + (fset 'si:replace-match (symbol-function 'replace-match)) | ||||
+ (put 'replace-match 'defun-maybe t) | + (put 'replace-match 'defun-maybe t) | ||||
+ (defun replace-match (newtext &optional fixedcase literal string) | + (defun replace-match (newtext &optional fixedcase literal string) | ||||
+ "Replace text matched by last search with NEWTEXT. | + "Replace text matched by last search with NEWTEXT. | ||||
If second arg FIXEDCASE is non-nil, do not alter case of replacement text. | If second arg FIXEDCASE is non-nil, do not alter case of replacement text. | ||||
Otherwise maybe capitalize the whole text, or maybe just word initials, | Otherwise maybe capitalize the whole text, or maybe just word initials, | ||||
based on the replaced text. | based on the replaced text. | ||||
@@ -1090,38 +1090,38 @@ Leaves point at end of replacement text. | @@ -1080,48 +1080,48 @@ then capitalize each word in NEWTEXT. | ||||
If third arg LITERAL is non-nil, insert NEWTEXT literally. | |||||
Otherwise treat `\' as special: | |||||
- `\&' in NEWTEXT means substitute original matched text. | |||||
- `\N' means substitute what matched the Nth `\(...\)'. | |||||
+ `\\&' in NEWTEXT means substitute original matched text. | |||||
+ `\\N' means substitute what matched the Nth `\\(...\\)'. | |||||
If Nth parens didn't match, substitute nothing. | |||||
- `\\' means insert one `\'. | |||||
+ `\\\\' means insert one `\\'. | |||||
FIXEDCASE and LITERAL are optional arguments. | |||||
Leaves point at end of replacement text. | |||||
The optional fourth argument STRING can be a string to modify. | The optional fourth argument STRING can be a string to modify. | ||||
In that case, this function creates and returns a new string | In that case, this function creates and returns a new string | ||||
which is made by replacing the part of STRING that was matched." | which is made by replacing the part of STRING that was matched." | ||||
- (if string | - (if string | ||||
- (with-temp-buffer | - (with-temp-buffer | ||||
- (save-match-data | - (save-match-data | ||||
- (insert string) | - (insert string) | ||||
- (let* ((matched (match-data)) | - (let* ((matched (match-data)) | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
+ (progn | + (progn | ||||
+ (fset 'si:replace-match (symbol-function 'replace-match)) | + (fset 'si:replace-match (symbol-function 'replace-match)) | ||||
+ (put 'replace-match 'defun-maybe t) | + (put 'replace-match 'defun-maybe t) | ||||
+ (defun replace-match (newtext &optional fixedcase literal string) | + (defun replace-match (newtext &optional fixedcase literal string) | ||||
+ "Replace text matched by last search with NEWTEXT. | + "Replace text matched by last search with NEWTEXT. | ||||
If second arg FIXEDCASE is non-nil, do not alter case of replacement text. | If second arg FIXEDCASE is non-nil, do not alter case of replacement text. | ||||
Otherwise maybe capitalize the whole text, or maybe just word initials, | Otherwise maybe capitalize the whole text, or maybe just word initials, | ||||
based on the replaced text. | based on the replaced text. | ||||
@@ -1142,24 +1142,24 @@ Leaves point at end of replacement text. | @@ -1132,34 +1132,34 @@ then capitalize each word in NEWTEXT. | ||||
If third arg LITERAL is non-nil, insert NEWTEXT literally. | |||||
Otherwise treat `\' as special: | |||||
- `\&' in NEWTEXT means substitute original matched text. | |||||
- `\N' means substitute what matched the Nth `\(...\)'. | |||||
+ `\\&' in NEWTEXT means substitute original matched text. | |||||
+ `\\N' means substitute what matched the Nth `\\(...\\)'. | |||||
If Nth parens didn't match, substitute nothing. | |||||
- `\\' means insert one `\'. | |||||
+ `\\\\' means insert one `\'. | |||||
FIXEDCASE and LITERAL are optional arguments. | |||||
Leaves point at end of replacement text. | |||||
The optional fourth argument STRING can be a string to modify. | The optional fourth argument STRING can be a string to modify. | ||||
In that case, this function creates and returns a new string | In that case, this function creates and returns a new string | ||||
which is made by replacing the part of STRING that was matched." | which is made by replacing the part of STRING that was matched." | ||||
- (if string | - (if string | ||||
- (with-temp-buffer | - (with-temp-buffer | ||||
- (save-match-data | - (save-match-data | ||||
- (insert string) | - (insert string) | ||||
- (let* ((matched (match-data)) | - (let* ((matched (match-data)) | ||||
▲ Show 20 Lines • Show All 583 Lines • Show Last 20 Lines |