emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/integration-of-dictionary-el a557a10 08/17: * lisp/net/dictionar


From: Torsten Hilbrich
Subject: feature/integration-of-dictionary-el a557a10 08/17: * lisp/net/dictionary-connection.el: Prefer defsubst
Date: Mon, 14 Dec 2020 05:46:38 -0500 (EST)

branch: feature/integration-of-dictionary-el
commit a557a103cc576c97a82346760a84947fe296000c
Author: Torsten Hilbrich <torsten.hilbrich@gmx.net>
Commit: Torsten Hilbrich <torsten.hilbrich@gmx.net>

    * lisp/net/dictionary-connection.el: Prefer defsubst
    
    Use defsubst instead of defmacro here. It was suggested by Stefan
    Kangas to replace the defmacro here and, looking at the lispref,
    defsubst seems to be a suitable replacement providing the same
    benefit of inlining functionality as the defmacro.
---
 lisp/net/dictionary-connection.el | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/lisp/net/dictionary-connection.el 
b/lisp/net/dictionary-connection.el
index f8a6679..c762b35 100644
--- a/lisp/net/dictionary-connection.el
+++ b/lisp/net/dictionary-connection.el
@@ -27,33 +27,33 @@
 
 ;;; Code:
 
-(defmacro dictionary-connection-p (connection)
+(defsubst dictionary-connection-p (connection)
   "Returns non-nil if `connection' is a connection object"
-  (list 'get connection ''connection))
+  (get connection 'connection))
 
-(defmacro dictionary-connection-read-point (connection)
+(defsubst dictionary-connection-read-point (connection)
   "Return the read point of the connection object."
-  (list 'get connection ''dictionary-connection-read-point))
+  (get connection 'dictionary-connection-read-point))
 
-(defmacro dictionary-connection-process (connection)
+(defsubst dictionary-connection-process (connection)
   "Return the process of the connection object."
-  (list 'get connection ''dictionary-connection-process))
+  (get connection 'dictionary-connection-process))
 
-(defmacro dictionary-connection-buffer (connection)
+(defsubst dictionary-connection-buffer (connection)
   "Return the buffer of the connection object."
-  (list 'get connection ''dictionary-connection-buffer))
+  (get connection 'dictionary-connection-buffer))
 
-(defmacro dictionary-connection-set-read-point (connection point)
+(defsubst dictionary-connection-set-read-point (connection point)
   "Set the read-point for `connection' to `point'."
-  (list 'put connection ''dictionary-connection-read-point point))
+  (put connection 'dictionary-connection-read-point point))
 
-(defmacro dictionary-connection-set-process (connection process)
+(defsubst dictionary-connection-set-process (connection process)
   "Set the process for `connection' to `process'."
-  (list 'put connection ''dictionary-connection-process process))
+  (put connection 'dictionary-connection-process process))
 
-(defmacro dictionary-connection-set-buffer (connection buffer)
+(defsubst dictionary-connection-set-buffer (connection buffer)
   "Set the buffer for `connection' to `buffer'."
-  (list 'put connection ''dictionary-connection-buffer buffer))
+  (put connection 'dictionary-connection-buffer buffer))
 
 (defun dictionary-connection-create-data (buffer process point)
   "Create a new connection data based on `buffer', `process', and `point'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]