[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is there symbol-plist functionality in Emacs Lisp?
From: |
Jean Louis |
Subject: |
Is there symbol-plist functionality in Emacs Lisp? |
Date: |
Sat, 08 May 2021 10:28:05 +0300 |
The function `symbol-plist' in Emacs Lisp returns only properties:
> (symbol-plist SYMBOL)
> This function does not change global state, including the match data.
While `symbol-plist' in Common Lisp returns the definition as below.
Is there equivalent Emacs Lisp function that could return me the full
definition of a function?
(symbol-plist 'save-function)
(SYSTEM::DEFINITION
((DEFUN SAVE-FUNCTION (F)
"Saves the function in the file *my-function-dir*/function-name.lisp.
Invoke it as: (SAVE-FUNCTION 'FUNCTION-NAME) or (SAVE-FUNCTION
\"FUNCTION-NAME\")"
(LET
((FUNCTION-NAME (CAR (CADR (SYMBOL-PLIST (INTERN (STRING-UPCASE F))))))
(FUNCTION-FILE
(FORMAT NIL "~a/~a.lisp" *MY-FUNCTION-DIR*
(STRING-DOWNCASE
(SUBSTITUTE #\- #\? (IF (SYMBOLP F) (SYMBOL-NAME F) (SYMBOL-NAME
(INTERN (STRING-UPCASE F)))))))))
(WITH-OPEN-FILE (STR FUNCTION-FILE :DIRECTION :OUTPUT :IF-DOES-NOT-EXIST
:CREATE)
(PRINT FUNCTION-NAME STR))))
.
#(NIL NIL NIL NIL
((DECLARATION OPTIMIZE DECLARATION DYNAMICALLY-MODIFIABLE
SYSTEM::IMPLEMENTATION-DEPENDENT))))
SYSTEM::DOC (SYSTEM::FILE ((SYSTEM::DEFUN/DEFMACRO
#P"/home/data1/protected/bin/rcd/save-lisp.lisp" 8 8))))
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/
- Is there symbol-plist functionality in Emacs Lisp?,
Jean Louis <=