unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Is there symbol-plist functionality in Emacs Lisp?
@ 2021-05-08  7:28 Jean Louis
  2021-05-08 13:54 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 8+ messages in thread
From: Jean Louis @ 2021-05-08  7:28 UTC (permalink / raw)
  To: Help GNU Emacs

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/




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-05-08 23:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-08  7:28 Is there symbol-plist functionality in Emacs Lisp? Jean Louis
2021-05-08 13:54 ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-08 14:38   ` FW: [External] : " Drew Adams
2021-05-08 16:23     ` Jean Louis
2021-05-08 23:13     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-08 15:32   ` Jean Louis
2021-05-08 15:47     ` Stefan Monnier
2021-05-08 16:36       ` Jean Louis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).