SlowValue

joined 1 year ago
[–] SlowValue@alien.top 1 points 11 months ago

creating a virtual machine build environment so I didn't have to litter my main computer with 100s of packages to build emacs.

That's is a good idea! Despite what all others say. I'm doing this since years with my Linux box(es).

But you need to know, that self compiled programms should be stored below the filesystem tree /usr/local/.
There is a tool called stow, it has a package in most Linux distributions.
Install stow into host and VM and create a directory /usr/local/stow/ in both (host an VM).
When compiling Emacs or other programs use the --prefix option of configure. E.g. cd emacs-src; ./configure --prefix=/usr/local/stow/emacs-v29.1. Then compile Emacs and install it in the virtual machine. After that, tar the folder /usr/local/stow/emacs-v29.1 and unpack it onto the host into the same directory. Then change dir into /usr/local/stow and run sudo stow emacs-v29.1. Maybe you need to install some libraries onto the host, use ldd /usr/local/bin/emacs to see, what libs you need. Then you are ready to use emacs. It is possible to have multiple versions of emacs installed and only one needs to be "activated" via stow.

[–] SlowValue@alien.top 1 points 11 months ago

Thanks for your answer, though it does not help me with the issue (read below , why). I updated my question with screenshots.

What you call online documentation is just the package manual.

I wrote "on-line" within quotation marks. What I called "on-line" documentation is the function documentation (aka docstring). But I feared, when I would use function documentation every one would point me to the official calc manual ...
"On-line documentation" is (imho) just 1980s terminology for documentation readable within the program.

[...] helpful [...] puts links to the calc manual in the function documentation [...].

I updated my Question with screenshots, those screenshots are intended to make it more clear. Using helpful's WWW link in an emacs help buffer is like walking to the public library and reading a book (for my intended use case). (Don't get me wrong, reading a book from a public library is nice, I'm glad such things are possible.)

 

Calc'c elisp functions (imho) all have the prefix calcFunc-. So in order to use a calc function like vlen in an org table lisp formula, one could use calcFunc-vlen. That's nice.

What bothers me is the lack of "on-line" documentation (i.e. usable with eldoc or completion frameworks).

All calc functions are nicely documented here: https://www.gnu.org/software/emacs/manual/html_mono/calc.html , thats good.

It is possible to modify a elisp's function documentation. e.g. like so:

(put 'calcFunc-vlen 'function-documentation
     "Computes the length of a vector.
The length of a non-vector is considered to be zero.
Note that matrices are just vectors of vectors for the purposes of this command.")

Now calcFunc-vlen would have a nice "on-line" documentation, usable with C-h f, autocompletion and eldoc.

Has anyone already bothered to gather some of those strings from the manual, in a more machine processable form? So I could save some work to create "on-line" documentation of the calc functions?

[–] SlowValue@alien.top 1 points 11 months ago

Regarding your second example explanation: you are mixing up dynamic extend and lexical scope.

If only lexical scope would be available for this second source code, then bar could not see the value of 20 for *x* and always would print 10. (Try this example in C/C++, which only uses lexical scope, see below). But since *x* is a special variable and rules of dynamic extend apply, bar sees the value of 20, when called by foo and therefore prints 20.

SBCL returned for both examples the value of 20 on my system, btw.

C-Example:

#include 

int x = 10;

void bar();

void foo() { int x = 20; bar(); }

void bar(){ printf("%i\n",x); }

void main() { foo(); }
// this program prints 10, as expected
[–] SlowValue@alien.top 1 points 11 months ago

It is difficult to find good demonstration videos. Here is another:
https://www.youtube.com/watch?v=jBBS4FeY7XM

Emacs with Elisp btw. is working alike. So you could experience that "Lisp experience" yourself easily, just by modifying Emacs itself. You can change ca. 99% of it on the fly, redefine whole parts of its functionality without need to restart Emacs. Sometimes that's not realized. Together with edebug, its good in-code documented functions and introspectibility it is a nice programming experience. Sometimes I miss that tight integration with Common Lisp.

[–] SlowValue@alien.top 1 points 11 months ago

Thanks for the explanation, that possibility did not cross my mind, since I'm used to use swiper. :)

TIL
So then it is / n.

[–] SlowValue@alien.top 1 points 11 months ago

Let me cite RMS to answer that:

The editor itself was written entirely in Lisp. Multics Emacs proved to be a great success—programming new editing commands was so convenient that even the secretaries in his office started learning how to use it. They used a manual someone had written which showed how to extend Emacs, but didn't say it was a programming. So the secretaries, who believed they couldn't do programming, weren't scared off. They read the manual, discovered they could do useful things and they learned to program.

source: https://www.gnu.org/gnu/rms-lisp.html

Programming in elisp is fun, too. Since it's (typical for Lisp!) interactive programming features.

[–] SlowValue@alien.top 1 points 11 months ago (2 children)

What is the meaning of that?
Just typing this at the swiper prompt searches for /-n....

[–] SlowValue@alien.top 1 points 11 months ago
(lisp-implementation-type)
;; ⇒ "SBCL"
(lisp-implementation-version)
;; ⇒ "2.3.10"
(setf (symbol-function 'foo) #'1+)
;; ⇒ #
(let ((old-foo #'foo))
  (setf (symbol-function 'foo) #'1-)
  (funcall old-foo 42))
;; ⇒ 43 (6 bits, #x2B, #o53, #b101011)
[–] SlowValue@alien.top 1 points 11 months ago

This is for documentation, in case someone else has a similar problem.

I sort of worked around Emacs weird choosing of fonts, since I do not know the real problem. Maybe it is a bug?

I put following in my init.el (I'm not fully satisfied, yet):

  (set-fontset-font "fontset-startup" '(#x2190 . #x21fe) "-misc-fixed-*-*-*--*-*-75-75-c-60-iso10646-1") ;; unicode arrows
  (set-fontset-font "fontset-startup" #x2026 "-misc-fixed-*-*-*--9-90-75-75-c-60-iso10646-1") ;; the …

Docs say it is possible to define a fontset in .Xresources, but I did not try.

You can check your current fontset via M-x describe-fontset.

My configuration uses fontset-startup primarily and fontset-default as fallback. So I modified fontset-startup.

The codepoint for characters (required second parameter for set-fontset-font) can be retrieved via C-u C-x =. All that is documented in the Emacs manual, btw.

Test if those settings work, by opening a org-mode buffer and using bold (*TEST*) and italic (/TEST/) on characters you want to test.

 

Screenshot: https://0x0.st/Hwru.jpg

In this Screenshot you see the frames of two Emacs processes. The left frame has been started by emacs -q, while the right frame has been started by emacs -Q. So no personal configuration (besides .Xresources) is used. The version is Emacs 29.1., X11, Linux.

The left frame shows the font I'd like to use, and used since many years with Emacs already. But the left frame also shows a "distorted" display of example characters. The important character is . It is clearly visible in this screenshot, that Emacs changes the font (glyph?) to display this character if the character needs to be rendered in bold. (similar things happen to other characters or itallic)

Each frame has 3 windows. The top window shows an org buffer with various characters.

The second from top window is the output of what-cursor-position, of the normal rendered character.

The bottom window shows the output of what-cursor-position with a bold character where Emacs changed the font to display this character. (This lines are much wider and taller, even though they contain the same number of monospaced letters.)

Emacs did not had this behavior of changing fonts to display certain characters in versions v28.x and older (at least I never noticed it). I did not change OS installed packages, fonts, setting and stuff, so I'm pretty sure it's an Emacs v28.x to v29.1 related change.

What can I do to make Emacs behave like in older versions, i.e. not changing fonts to display those characters?

I tried various things (i.e. disabling HarfBuzz), but I am clueless what I need to configure.

I know that the problematic setting is a *font: line in my .Xresources file. But finding a suitable font was some time consuming frustrating process, because I didn't like other fonts for various (mostly readability or size) reasons.

TL;DR: Question: how can I make Emacs v29.1 to not change fonts to display certain characters?

[–] SlowValue@alien.top 1 points 1 year ago

Not sure how plain ivy sorts its candidates, but do you have by chance any additional package installed? A package, which re-sorts the candidate list? A Package like prescient, smex, flx, historian, ...?

[–] SlowValue@alien.top 1 points 1 year ago

regarding Elisp:
Consider using and contributing to the packages helpful and/or elisp-demos.

[–] SlowValue@alien.top 1 points 1 year ago

In case a SLY user is reading this. Sly brings sly-switch-to-most-recent, you might have to bind it to C-c C-z yourself in sly-mrepl-mode-map.

 

With every start of Emacs 29, native comp starts compiling the files cl-loaddefs.el and tramp-loaddefs.el, but I can't find corresponding *.eln files in (all) native-lisp directories. (Native compiling other (internal & extra) packages works, it is not an issue with access rights.)

What is the use of that behavior?

I could disable that native jit compiling, by putting following line in my early-init.el

(setq native-comp-jit-compilation-deny-list '(".*-loaddefs.el.gz"))

Would that break some facilities within Emacs, if I do so?

view more: next ›