all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.