Merge pull request #25 from mlang/emacs25

Use `cl-gensym' to fix Emacs 25 compatibility (Fixes #24)
This commit is contained in:
Brian Heim 2020-04-02 09:05:01 -05:00 committed by GitHub
commit 0e95a1884d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -192,9 +192,9 @@
`(push (cons ,font-id (intern ,font-name)) (sclang-rtf-state-font-table ,state))) `(push (cons ,font-id (intern ,font-name)) (sclang-rtf-state-font-table ,state)))
(defmacro sclang-rtf-state-apply (state) (defmacro sclang-rtf-state-apply (state)
(let ((pos (gensym)) (let ((pos (cl-gensym))
(font (gensym)) (font (cl-gensym))
(face (gensym))) (face (cl-gensym)))
`(with-current-buffer (sclang-rtf-state-output ,state) `(with-current-buffer (sclang-rtf-state-output ,state)
(let ((,pos (or (sclang-rtf-state-pos ,state) (point-min))) (let ((,pos (or (sclang-rtf-state-pos ,state) (point-min)))
(,font (cdr (assq (,font (cdr (assq
@ -216,7 +216,7 @@
(setf (sclang-rtf-state-font ,state) ,font))) (setf (sclang-rtf-state-font ,state) ,font)))
(defmacro sclang-rtf-state-push-face (state face) (defmacro sclang-rtf-state-push-face (state face)
(let ((list (gensym))) (let ((list (cl-gensym)))
`(let ((,list (sclang-rtf-state-face state))) `(let ((,list (sclang-rtf-state-face state)))
(sclang-rtf-state-apply ,state) (sclang-rtf-state-apply ,state)
(unless (memq ,face ,list) (unless (memq ,face ,list)
@ -224,7 +224,7 @@
(append ,list (list ,face))))))) (append ,list (list ,face)))))))
(defmacro sclang-rtf-state-pop-face (state face) (defmacro sclang-rtf-state-pop-face (state face)
(let ((list (gensym))) (let ((list (cl-gensym)))
`(let* ((,list (sclang-rtf-state-face ,state))) `(let* ((,list (sclang-rtf-state-face ,state)))
(sclang-rtf-state-apply ,state) (sclang-rtf-state-apply ,state)
(setf (sclang-rtf-state-face ,state) (delq ,face ,list))))) (setf (sclang-rtf-state-face ,state) (delq ,face ,list)))))
@ -326,9 +326,9 @@
(define-key map "\C-c\C-v" 'sclang-edit-help-file)) (define-key map "\C-c\C-v" 'sclang-edit-help-file))
(defmacro sclang-help-mode-limit-point-to-code (&rest body) (defmacro sclang-help-mode-limit-point-to-code (&rest body)
(let ((min (gensym)) (let ((min (cl-gensym))
(max (gensym)) (max (cl-gensym))
(res (gensym))) (res (cl-gensym)))
`(if (and (sclang-code-p (point)) `(if (and (sclang-code-p (point))
(not (or (bobp) (eobp))) (not (or (bobp) (eobp)))
(sclang-code-p (1- (point))) (sclang-code-p (1- (point)))