Communick News

85 readers
3 users here now

Communick is a professional, privacy-focused service provider who supports open source and the indieweb. We support back the fediverse and the developers by pledging 20% of our yearly profits to the main development teams.

All users from this instance are expected to follow the Code of Conduct.

At the moment, only the admins can create communities. We are still figuring out what type of content we would like to provide here, but the general guideline is that we want to build a home of good discussion about culture, sports, and anything that can inspire and elevate our spirits.

Communick also provides managed hosting for Lemmy instances if you want to run your own.

For further questions, try our support.

founded 2 years ago
ADMINS
126
 
 

I'm new to Mastodon code and find it hard to understand exactly how some components are drawing and getting their data - If anyone could lend a hand or just answer a few questions, it would be amazing!

I'm also looking for admins who can install/test a branch or patch that extends the verify system in some nifty ways.

Please if you are familiar or just run your own instance, reach out because your help is greatly appreciated and could make the world a safer place.

127
 
 

As long as you don't test it you are in a quantum state, the same as for the Schrödinger's cat. Your code is either buggy or is not.

Hence, bugs are in fact triggered by users.

I tried to solve some of the last Advent of Code enigmas with LispE, and I discovered a plethora of problems, which I didn't think would erupt after so many years of tests.

128
 
 

I have a setup that sort of gives what I'm looking for, but Emacs complains that I'm not doing it right.

I have a large number of org-mode appointments that depend on the date of Easter. They are currently in the form of diary sexp, but I don't really care what form they're in; what I'm really trying to find is a general solution to "When today is X days before Easter, show arbitrary message 'X' in the org agenda. When today is Y days after Easter, show arbitrary message 'Y' in the org agenda." (In all of my cases, Easter means "the Easter within the current calendar year".)

Emacs elegantly figures out the correct date for Easter, but Emacs also has a hard-coded list of Christian holidays that aren't useful to me. Instead of a new hard-coded list of holidays, I'm looking to make arbitrary and changeable use of the Easter calculation - compared to today - without showing any holidays at all.

129
 
 

I know of sly stickers, but that only works if I have sly (and hence also emacs). What if I dont have access to sly? I tried the step function in sbcl with debug set to 3 and it skips a lot of forms. Is there a lisp only package that would provide step by step evaluation like that of edebug?

130
 
 

TLDR: I really want to learn emacs, getting frustrated with the basics and seeking help. Can't install use-package on my mac installation of emacs.

I've been using neovim for awhile but have been increasingly frustrated with not being able to understand how things work when they break down. Hoping to learn emacs for fun and maybe to even replace/improve my nvim workflows.

Things went well at first. I followed the tutorial and got used to some basic navigation as well as window and buffer navigation. I LOVE being able to `C-h` for functions, keys, and variables.

I decided it was time to start trying to configure things and installing packages. I'm not patient enough to watch 10 hours of system crafters videos and didn't really want to buy Mastering Emacs, so I decided to do some googling and figure things out myself. I came across a guide with some basic starting points and was feeling good about things until I got to this part: https://medium.com/@suvratapte/configuring-emacs-from-scratch-use-package-c30382297877

I am completely unable to install use-package and that feels pretty defeating. I followed the instructions and the package was not found. I tried `package-refresh-contents` and found use-package-hydra use-package-chords and use-package-el-get. Can't seem to find use-package.

After some googling I thought it might be that my mac-homebrew-installed version of emacs was missing TLS support, so I deleted it, pulled the emacs-mac repo, and installed it with no issues. Started up my new install and had to navigate the fact that my alt key was no longer bound and my command key was magically mapped to meta which I don't want. It was really frustrating to run into this and have no idea how to C-h my way out of it. I managed to map alt to meta and map command to super, but not I can't command-c any more which is an annoyance.

On top of this, I still can't install use-package, the exact same thing happens. I deleted the part of my config that sets up melpa and used the instructions from their site. I confirmed using eww that I have TLS support working. I tried a number of commands from reddit and elsewhere and have not made any progress. I feel like I'm back in my vim config hopelessly adding lines to my config until it's not broken.

Primarily I need help passing this hurdle so that I can try and set things up myself. It would also be super nice to understand why these things have been failing and how I can better use resources to fix issues like this in the future.

131
 
 

Hey r/lisp, I'm a CS student who is really interested in common-lisp, up until now I've done a couple cool things with it and really love the REPL workflow, however, diving into the whole lisp rabbit hole I keep hearing about macros and how useful and powerful they are but I don't think I really get how different they may be from something like functions, what am I missing?

I've read a couple of articles about it but I don't feel like I see the usefulness of it, maybe someone can guide me in the right direction? I feel like I'm missing out

132
 
 

Hello Everyone,
This is my first post every on reddit I hope I don't get RTFM ed.
Problem: Until about a week ago I used to use a doom emacs config I got off of the internet with some modifications just for references in latex. this week I finally decided to code my own literate gnu emacs config but there is one feature I am sorely missing. In the image attached in a org-mode document there is syntax highliting for latex code outside of src_code blocks I want that but I don't know how to get it into my new config. Further information can be provided on request.

https://preview.redd.it/lglj2nzsbj3c1.png?width=1902&format=png&auto=webp&s=c4a77a9df21eeb9d4f450348b4717f7bb1fb61a4

133
 
 

Welcoming two new instances to the network:

  • SFW Network for those looking for the "safe for work porn" fix.
  • Foodie Rehab for communities dedicated to talk about food, cooking and cooking celebrities.
134
 
 

I keep getting a "cannot find host" message when I try to post, boost, do anything. I haven't been on mstdn.social for a while, so I don't know if this is a known issue or if I'm doing something wrong. Any pointers would be appreciated.

135
136
 
 

Scheme Request for Implementation 251,
"Mixing groups of definitions with expressions within bodies",
by Sergei Egorov,
is now available for discussion.

Its draft and an archive of the ongoing discussion are available at https://srfi.schemers.org/srfi-251/.

You can join the discussion of the draft by filling out the subscription form on that page.

You can contribute a message to the discussion by sending it to srfi-251@srfi.schemers.org.

Here's the abstract:

Scheme has traditionally required procedure bodies and the bodies of derived constructs such as let to contain definitions followed by commands/expressions. This SRFI proposes to allow mixing commands and groups of definitions in such bodies, so that each command/expression is in the scope of all local definitions preceding it, but not in scope of the local definitions following it. This approach is backwards compatible with R7RS and upholds the intuitive rule that to find the definition of a lexical variable, one has to look up the source code tree.

Regards,

SRFI Editor

137
 
 

Hi there, I'm trying to brush off my emacs and Orgmode since it's been years. I'm hitting a few snags and am also wondering about current standards since there has been many updates.

My goal:

Use Orgmode to customise my emacs and init files while using the Dropbox directory. I would also like to use a custom named init file so it's like eckoinit.el instead of init.el (For easier recognition and modification).

Overall, I'd like to sync and use emacs from different computers using the same configs.

I know one of my current snags is I can't remember how to tell emacs from Orgmode to use a differently named init file. I feel like this should be an obvious answer that I should have found by now and I feel silly.

Thanks for your time!

138
 
 

Hello Emacs Community!,

I'm a long time Emacs user, right now using the Doom framework and, I recently took a look at the power Nix, specifically the devenv.sh project. I wonder if someone is using it in some manner. As it being quite powerful and allowing having separate development environments.

Are there any packages for this?, and if not, how complicated would it to be to for example, once entering a project, Emacs gets all of its PATHs (languages like NodeJS and other niceties) so that little by little, the project can be replicated and used completely with devenv and Emacs without having to installing anything globally.

Thank you, I would love to hear your workflows!, just wanting to be sure I'm getting the best of the best in my environment, I will be coding in Javascript, Angular and so on.

139
1
Rate my setup (alien.top)
submitted 1 year ago by ZeStig2409@alien.top to c/emacs
 
 

Emacs on Hyprland

This Emacs config's built from scratch by this humble Elisp noob. I want it to be minimal and plain. Love some feedback!

140
141
 
 
142
143
 
 

I just found out about mander.xyz and it seems like a solid alternative for a science-focused instance. Can we go through its list of communities and map to the corresponding subreddits?

144
 
 

I have been trying to get dap-mode for c++ to work. Below is my config related to dap-mode

(use-package dap-mode
  :after lsp-mode
  :commands dap-debug
  :hook ((c++-mode python-mode . dap-ui-mode) (python-mode . dap-mode))
  :config
  (dap-auto-configure-mode t)

  (setq dap-python-debugger 'debugpy)
  (require 'dap-python)

  (require 'dap-gdb-lldb)
  (require 'dap-lldb)
  (setq dap-lldb-debug-program "/usr/bin/lldb-vscode")
;;; ask user for executable to debug if not specified explicitly (c++)
  (setq dap-lldb-debugged-program-function (lambda () (read-file-name "Select file to debug.")))

  ;;; default debug template for (c++)
  (dap-register-debug-template
   "C++ LLDB dap"
   (list :type "lldb-vscode"
         :cwd nil
         :args nil
         :request "launch"
         :program nil))
;; (defun dap-python--pyenv-executable-find (command)
;;   (with-venv (executable-find "python")))

(add-hook 'dap-stopped-hook
	  (lambda (arg) (call-interactively #'dap-hydra)))

(defun dap-debug-create-or-edit-json-template ()
    "Edit the C++ debugging configuration or create + edit if none exists yet."
    (interactive)
    (let ((filename (concat (lsp-workspace-root) "/launch.json"))
	  (default "~/.config/emacs/default-launch.json"))
      (unless (file-exists-p filename)
	(copy-file default filename))
      (find-file-existing filename))))

The problem I am facing currently is that every time i run

dap-debug

while the file is open i get prompted for executable and when i select the candidate, I get the error

Wrong type argument: stringp, nil

From what I learned we get the above error when a function get a nil value while expecting a string but I don't understand why the function will get a nil value when i selected the correct executable with appropriate compiler flags.

I would appreciate any help in the matter.

145
 
 

Old school text generation

The method we will present here belongs to the old school, the one before chatGPT and other language models. But sometimes, if you don't have a dozen GPUs at hand and a good terabyte of hard disk, well, the normal configuration of a computer scientist today... Ah, this is not your case... I didn't know... Sorry...

So there are some traditional methods to achieve similar results. Well, it won't write your year-end report...

I want to show you how you can implement one with LispE. (Yeah... I know again)

The grammar

In the case of an old-fashioned generation, you need a generation grammar.

For those in the know, the parser that I will describe next is called a Chart Parser.

For example:

  S : NP VP
  PP : PREP NNP
  NP : DET NOUN
  NP : DET NOUN PP
  NP : DET ADJ NOUN
  NNP : DET NLOC
  NNP : DET ADJ NLOC
  VP : VERB NP
  DET : "the" "a" "this" "that
  NOUN : "cat" "dog" "bat" "man" "woman" "child" "puppy
  NLOC : "house" "barn" "flat" "city" "country
  VERB: "eats" "chases" "dicks" "sees"
  PREP: "of" "from" "in"
  ADJ: "big" "small" "blue" "red" "yellow" "petite"

There is also a grammar for French, but it is admittedly a bit complicated to read, especially because of the agreement rules.

Compile this thing

This grammar is rather simple to read. We start with a sentence node "S", which is composed of a nominal group and a verbal group. The rules that follow give the different forms that each of these groups can take. Thus a nominal group: NNP can be broken down into a determiner followed by an adjective and a noun.

The compilation of this grammar consists in creating a large dictionary indexed on the left parts of these rules:

{
   %ADJ:("big" "small" "blue" "red" "yellow" "petite")
   %DET:("the" "a" "this" "that")
   %NLOC:("house" "barn" "flat" "city" "country")
   %NOUN:("cat" "dog" "bat" "man" "woman" "child" "puppy")
   %PREP:("of" "from" "in")
   %VERB:("eats" "chases" "bites" "sees")
   ADJ:"%ADJ"
   DET:"%DET"
   NLOC:"%NLOC"
   NNP:(("DET" "NLOC") ("DET" "ADJ" "NLOC"))
   NOUN:"%NOUN"
   NP:(
      ("DET" "NOUN")
      ("DET" "NOUN" "PP")
      ("DET" "ADJ" "NOUN")
   )
   PP:(("PREP" "NNP"))
   PREP:"%PREP"
   S:(("NP" "VP"))
   VERB:"%VERB"
   VP:(("VERB" "NP"))
}

Some lines are simple copy/paste of the rules above, except for the lexical rules which are preceded by a "%". The goal is to be able to differentiate between applying a rule and generating words.

Analyze and generate with the same grammar

This is certainly the nice thing about the approach we propose here.

We will use this grammar in both directions, which means that we can feed it a piece of sentence and let it finish.

For example, if we start with: a cat, it can then propose its own continuations.

Note that here, the continuations will draw random words from the word lists. This can result in completely ridiculous sentences... or not.

The first step

The user provides the beginning of a sentence, but also, and this is fundamental, the initial symbol corresponding to what (s)he wants to produce.

This symbol is an entry point in our grammar. We will choose: S.

In other words, we will ask the system to produce a sentence.

In the first step we have two lists in parallel:

   Words   Categories
("a "cat")  ("S")

The replacement

S is an entry point in the grammar whose value is: ("NP" "VP")

So we replace the structure above to reflect this possibility.

  Words     Categories
("a "cat") ("NP" "VP")

The head of the category list is now: NP.

Since there are several possible rules for NP, we'll just loop around to find the one that covers our list of words:

  Words        Categories
("a "cat") ("DET" "Noun" "VP")

Now our head is DET which points to a lexical item. We just have to check that "a" belongs to the list associated with "DET".

This is the case, we can then eliminate elements from both lists:

  Words  Categories
("cat") ("Noun" "VP")

We can do the same operation for "Noun", the word list is then empty.

Words Categories
()     ("VP")

We then switch to the generation mode.

Generation

VP returns a list with only one element: ("Verb" "NP")

     Categories             Words
  ("Verb" "NP")          ("a" "cat")

Note that "Generated" contains as initial value the words coming from our sentence.

Since Verb is a lexical item, we draw a word at random from our list of verbs:

     Categories             Words
      ("NP")         ("a "cat" "chases")

We then draw a rule at random from those associated with NP:

     Categories             Words
("Det" "Adj" "Noun")    ("a "cat" "chases")

The job is now very simple, just draw a determiner, an adjective and a noun at random from their respective list:

     Categories                Words
        ()         ("a "cat" "chases" "a" "big" "dog")

Since the list of categories is now empty we stop there and returns our sentence.

Implementation detail in LispE

If you take a quick look at the code of the parser, you will observe the presence of two functions: match and generate. These functions are based on the extensive use of defpat, the pattern programming functions in LispE.

match

match is used to check if the words in a sentence can be parsed by the grammar. The conditions for match to succeed are twofold:

  • Either the word list and the category list are empty
  • Either the word list is empty and the system continues in generation mode on the remaining categories

; We have used up all our words and categories
; No need to go further
(defpat match ([] [] consume) 
   (nconcn consume "$$") 
)

; We stop and generate, the word list is empty
(defpat match ( current_pos [] consume)   
   (generate current_pos consume)
)

; We check the rule associated to the leading category
; consp checks if an object is a list. If it is not the case, it is a lexical rule.
; If not, we loop over the possible rules. 
(defpat match ( [POS $ current_pos] [w $ sentence] consume)
   (setq rule (key grammar POS))
   (if (consp rule) ; if it is a group of rules, we loop to find the right one
      (loop r rule
         (setq poslst (match (nconcn r current_pos) (cons w sentence) consume)
         (if poslst
            (return poslst) ; we find one we stop
         )
      )
      (if (in (key grammar rule) w) ; otherwise it is a lexical rule and we check if the current word is part of it
         (match current_pos sentence (nconcn consume w))
      )
   )
)

Note that "$" is the tail separator operator. Hence "match((NP Verb NP))" will return "POS = NP" and "current_pos = (Verb NP)".

generate

Generation is the final step. Thanks to pattern programming, this operation is reduced to two functions.

; Generating a word
; We are looking for a rule
; This one is either a normal rule (consp) or a lexical rule
(defpat generate([POS $ current_pos] tree)
   (setq r (key grammar POS))
   (if (consp r)
      ; here places the categories of a randomly drawn rule on top
      (generate (nconcn (random_choice 1 r 30) current_pos) tree) 
      ; here we add a word drawn at random
      (generate current_pos (nconc tree (random_choice 1 (key grammar r) 30)) 
   )
)  

; There are no more categories available, we place an end-of-sequence symbol to indicate that 
; all was generated
(defpat generate ([] tree) (nconc tree "%%") )

Conclusion

For those who have already had the opportunity to work with Prolog, this way of designing a program should seem very familiar. For others, this way of programming may seem rather confusing. The use of a pattern to distinguish different functions with the same name but different arguments is called "polymorphism". This kind of operation is also available in C++:

    Element* provideString(wstring& c);
    Element* provideString(string& c);
    Element* provideString(wchar_t c);
    Element* provideString(u_uchar c);

For example, these lines of code come from the interpreter LispE itself.

What distinguishes defpat here from the example above, however, is the richness and complexity of the patterns that can be dynamically used to parse a list of words and categories. Instead of a static compiled call, we have here a very flexible method that allows us to concentrate on the code specific to the detected pattern.

In particular, this method allows tree or graph traversal without the programmer ever getting lost in the tangle of special cases. If the list of elements evolves, it is often enough to add an additional function to take these new elements into account without redesigning the rest of the program.

146
147
 
 

Hey everyone, quite a while ago I created the Naga theme; it's also on MELPA. I used it for a long time (and I'm still using it in the evenings), but I'm not totally happy with it. I'd like to spend a little more time on it, changing some colors, updating the slightly outdated screenshots in the readme and so on. While I'm at it, I could have a look at packages that don't work well with it as well. I have some other ideas for themes, and an improved naga would also give me a better base to work from for these.

I'd be glad if some of you could maybe test-drive it and give me feedback, especially if it perhaps breaks or looks plain bad with some packages you use.

The main idea of the theme was to get a "more modern retro green" theme, with high contrast, but a non-standard foreground color -- green in this case.

Thanks in advance!

148
 
 

I'm using Emacs Mac from Homebrew on my M1 Macbook Pro with the notch, and when I toggle fullscreen using (toggle-frame-fullscreen) I see that part of the top line of text gets hidden by the notch (like in image). In other applications fullscreen omits the entire top height of the notch, but for some reason Emacs fullscreen isn't like other native fullscreen - the Emacs frame occupies the entire screen but is still in the Desktop space. So I lose words in the middle of the top line. How can I avoid this situation? I don't see a ns-use-native-fullscreen variable (or any variables containing the words "ns", "native", or "fullscreen" that are useful).

https://preview.redd.it/fonw4bxbrf3c1.png?width=2982&format=png&auto=webp&s=fe9699c278f66944d4dcbb0ed6240cd93674fb65

149
 
 

Hello emacs and Lisp enthusiasts,

I remember seeing an article that talked about the superfluity of parenthesis in Lisp code, and how non-Lisp programmers were overwhelmed by them, but Lisp programmers had trained their eyes to look at indentation structure and didn't see the parenthesis, and it showed an image of Lisp code without and with the parenthesis faded. I don't have a link to the article, but even as a slightly seasoned Lisper I thought the fainter parenthesis improved readability.

So I'm wondering if/how it's possible to achieve this effect in emacs. Is there already a minor-mode for it? Would it involve a font-lock/face for parenthesis? I've tried to navigate the syntax highlighting code before and was a bit turned off by the apparent complexity, so any form of introduction would be greatly appreciated.

150
view more: ‹ prev next ›