Skip to content
  • Question for Emacs wizards.

    Uncategorized emacs emacslisp elisp askfedi
    1
    1
    0 Votes
    1 Posts
    0 Views
    evgandr@mastodon.bsd.cafeE
    Question for Emacs wizards. I found a strange thing which I could not understand after reading the documentation (https://www.gnu.org/software/emacs/manual/html_node/emacs/Initial-Options.html) and even after reading the startup files, shipped with my Emacs 30.2.If I use the -q option — Emacs will add site-lisp directories to the load-path. But with -Q option — there are no site-lisp catalogs in the load-path. Why is this happens? Note: the option --no-site-lisp is not used in the both examples. So, as I understood after reading the https://www.gnu.org/software/emacs/manual/html_node/eintr/Site_002dwide-Init.html, even with --no-site-file (or -Q) the site-lisp catalogs should be added to the load-path in the both cases #Emacs #EmacsLisp #elisp #AskFedi
  • ### An obscure Emacs Lisp question

    Uncategorized emacslisp
    1
    0 Votes
    1 Posts
    0 Views
    ramin_hal9001@fe.disroot.orgR
    An obscure Emacs Lisp question I'm trying to implement buffer-local variables in my #EmacsLisp interpreter, but in my test programs, there seem to be no functional difference between the "toplevel default" and the "default" value of a variable at all. When reading the documentation, it says this: A variable can be let-bound to a value. This makes its global value shadowed by the binding; default-value will then return the value from that binding, not the global value, and set-default will be prevented from setting the global value (it will change the let-bound value instead). The following two functions allow referencing the global value even if it’s shadowed by a let-binding. But the documentation seems to be wrong, but maybe I am missing something? Here is my test program: (when (intern-soft 'x) (unintern 'x obarray)) (setq record nil) (defun record (where val) (setq record (cons (cons where val) record)) ) (defun record-comment (str) (setq record (cons str record)) ) (defun replay () (princ ";----------------------------\n") (dolist (x (reverse record)) (cond ((stringp x) (princ x) (terpri)) (t (prin1 (car x)) (princ "; x => ") (prin1 (cdr x)) (terpri) )))) (record "lexical-binding" lexical-binding) (defvar x "global") (record 'x x) (make-local-variable 'x) (record '(make-local-variable 'x) x) (setq x "local") (record '(setq x "local") x) (record '(default-value 'x) (default-value 'x)) (set-default 'x "default") (record '(set-default 'x "default") x) (record '(default-value 'x) (default-value 'x)) (record '(default-toplevel-value 'x) (default-toplevel-value 'x)) (set-default-toplevel-value 'x "top-level") (record '(set-default-toplevel-value 'x "toplevel") x) (record '(default-value 'x) (default-value 'x)) (record '(default-toplevel-value 'x) (default-toplevel-value 'x)) (let ((x "inside-let-form")) (defvar x) (record '(let ((x "inside-let-form")) x) x) (setq x "let-local") (record '(let -- (setq x "let-local") x) x) (record '(let -- (default-value 'x)) (default-value 'x)) (set-default 'x "default") (record '(let -- (set-default 'x "default") x) x) (record '(let -- (default-value 'x)) (default-value 'x)) (record '(let -- (default-toplevel-value 'x)) (default-toplevel-value 'x)) (set-default-toplevel-value 'x "top-level") (record '(let -- (set-default-toplevel-value 'x "top-level")) x) (record '(let -- (default-value 'x)) (default-value 'x)) (record '(let -- (default-toplevel-value 'x)) (default-toplevel-value 'x)) ) (record-comment ";;after let") (record 'x x) (record '(default-value 'x) (default-value 'x)) (record '(default-toplevel-value 'x) (default-toplevel-value 'x)) (replay) When you look at the output of the program, (default-value 'x) returns the same value as (default-toplevel-value 'x) regardless of whether it is inside of a let binding. Here is the above program's output: ;---------------------------- x; x => "global" (make-local-variable 'x); x => "global" (setq x "local"); x => "local" (default-value 'x); x => "global" (set-default 'x "default"); x => "local" (default-value 'x); x => "default" (default-toplevel-value 'x); x => "default" (set-default-toplevel-value 'x "toplevel"); x => "local" (default-value 'x); x => "top-level" (default-toplevel-value 'x); x => "top-level" (let ((x "inside-let-form")) x); x => "inside-let-form" (let -- (setq x "let-local") x); x => "let-local" (let -- (default-value 'x)); x => "top-level" (let -- (set-default 'x "default") x); x => "let-local" (let -- (default-value 'x)); x => "default" (let -- (default-toplevel-value 'x)); x => "default" (let -- (set-default-toplevel-value 'x "top-level")); x => "let-local" (let -- (default-value 'x)); x => "top-level" (let -- (default-toplevel-value 'x)); x => "top-level" ;;after let x; x => "local" (default-value 'x); x => "top-level" (default-toplevel-value 'x); x => "top-level"
  • ## #Schemacs update

    Uncategorized emacs emacslisp r7rs schemacs scheme
    3
    0 Votes
    3 Posts
    2 Views
    ramin_hal9001@fe.disroot.orgR
    @baleine@piaille.fr nice to meet you! Yes, it seems Guile-GI is the work of just one person who has been maintaining it for many, many years, and is probably getting tired of doing such a thankless chore. Also, there is a competing project, G-Golf, which does just as well, and is more up-to-date. When I discovered a Guile-GI bug, others here on the Fediverse have told me that the Guile-GI maintianer does participate in discussions on the Guile mailing list, but I haven't tried contacting them about the bug yet.