From: Stefan Monnier Date: Sat, 30 Jan 2021 19:15:19 +0000 (-0500) Subject: * lisp/gnus: Demote some macros and defsubsts, plus a fix X-Git-Tag: emacs-28.0.90~3991^2~5 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f0ca9ad5dcbcf7ab9789087a1f053427e30b3fe4;p=emacs.git * lisp/gnus: Demote some macros and defsubsts, plus a fix * lisp/gnus/gnus-sum.el (gnus-summary-thread-level) (gnus-summary-article-mark): Turn macros into `defsubst`. * lisp/gnus/mail-source.el (mail-source-bind-common): Actually use its arg. * lisp/gnus/nntp.el (nntp-copy-to-buffer): Turn macro into a `defsubst`. (nntp-wait-for, nntp-retrieve-data, nntp-send-command): Don't inline those, it's not worth it. --- diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index b0f9ed4c6f0..05e49be093d 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -3339,18 +3339,18 @@ article number." ,(or number (inline-quote (gnus-summary-article-number))))))) -(defmacro gnus-summary-thread-level (&optional number) +(defsubst gnus-summary-thread-level (&optional number) "Return the level of thread that starts with article NUMBER." - `(if (and (eq gnus-summary-make-false-root 'dummy) - (get-text-property (point) 'gnus-intangible)) - 0 - (gnus-data-level (gnus-data-find - ,(or number '(gnus-summary-article-number)))))) + (if (and (eq gnus-summary-make-false-root 'dummy) + (get-text-property (point) 'gnus-intangible)) + 0 + (gnus-data-level (gnus-data-find + (or number (gnus-summary-article-number)))))) -(defmacro gnus-summary-article-mark (&optional number) +(defsubst gnus-summary-article-mark (&optional number) "Return the mark of article NUMBER." - `(gnus-data-mark (gnus-data-find - ,(or number '(gnus-summary-article-number))))) + (gnus-data-mark (gnus-data-find + (or number (gnus-summary-article-number))))) (defmacro gnus-summary-article-pos (&optional number) "Return the position of the line of article NUMBER." diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index c954f657936..2427977ca82 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/mail-source.el @@ -515,7 +515,7 @@ the `mail-source-keyword-map' variable." See `mail-source-bind'." (declare (indent 1) (debug (sexp body))) `(let ,(mail-source-bind-common-1) - (mail-source-set-common-1 source) + (mail-source-set-common-1 ,source) ,@body)) (defun mail-source-value (value) diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index c2bb960f945..cf89eebbbbb 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -335,16 +335,16 @@ retried once before actually displaying the error report." (apply #'error args))) -(defmacro nntp-copy-to-buffer (buffer start end) +(defsubst nntp-copy-to-buffer (buffer start end) "Copy string from unibyte current buffer to multibyte buffer." - `(let ((string (buffer-substring ,start ,end))) - (with-current-buffer ,buffer + (let ((string (buffer-substring start end))) + (with-current-buffer buffer (erase-buffer) (insert string) (goto-char (point-min)) nil))) -(defsubst nntp-wait-for (process wait-for buffer &optional decode discard) +(defun nntp-wait-for (process wait-for buffer &optional decode discard) "Wait for WAIT-FOR to arrive from PROCESS." (with-current-buffer (process-buffer process) @@ -436,7 +436,7 @@ retried once before actually displaying the error report." (when process (process-buffer process)))) -(defsubst nntp-retrieve-data (command address _port buffer +(defun nntp-retrieve-data (command address _port buffer &optional wait-for callback decode) "Use COMMAND to retrieve data into BUFFER from PORT on ADDRESS." (let ((process (or (nntp-find-connection buffer) @@ -469,7 +469,7 @@ retried once before actually displaying the error report." nil))) (nnheader-report 'nntp "Couldn't open connection to %s" address)))) -(defsubst nntp-send-command (wait-for &rest strings) +(defun nntp-send-command (wait-for &rest strings) "Send STRINGS to server and wait until WAIT-FOR returns." (when (not (or nnheader-callback-function nntp-inhibit-output))