• 3 Posts
  • 31 Comments
Joined 2 years ago
cake
Cake day: March 4th, 2024

help-circle



  • As other comments have pointed out, and you already mentioned this as a possibility, this is how I would write it:

    (defun eat-more ()
      "Open a new terminal."
      (interactive)
      (eat nil t))
    

    However, given your goal of understanding commands and the buffer list better, I’ll try to explain a little better.

    The first parameter, the shell, when left nil, will use your default eat-shell, so the funcall in your current implementation is redundant. The eat-shell can be customized separately if necessary.

    The <3> or <5> or whatever suffix in the eat buffer name is actually not generated by eat itself, eat is using generate-new-buffer, which is an Emacs built-in function that relies on the C function generate-new-buffer-name.

    So what you are attempting to do is not just re-implement a feature eat already has, but a core function within Emacs itself. If you don’t rely on built-in functionality, I would argue that you are not familiarizing yourself with elisp development, you are really creating your own language.

    However, re-implementing what eat does can maybe be a good exercise, so to use the built-in function to help us, I would probably write it like something like this:

    (defun eat-more ()
      "Open a new terminal."
      (interactive)
      (require 'eat)
      (eat
       nil
       (let ((name (generate-new-buffer-name eat-buffer-name)))
         (when (string-match "<\\([[:digit:]]+\\)>" name)
           (string-to-number (match-string 1 name))))))
    

    One thing I’d like to draw attention to is the use of the variable eat-buffer-name, which is defined by eat and is customizable, so even though most people are using the default name "*eat*", this could be different for some users. However, using this variable means we need to ‘require’ the eat package first. In the simpler answer, we were relying on the fact that the (eat ...) command is autoloaded, and can be called without requiring the package first. But that isn’t true for the eat-buffer-name variable.










  • Things have materially deteriorated in Gaza directly because of the election. The Christian Republican org GHF, created in February, is engaged in forced relocations and massacres. Bibi would not have cut off all aid to Gaza in March without Republicans blessing and support. Things would be bad, but there are some policy differences regarding Israel between the parties. These were very very clear if you watched or read about the convention speeches. Harris acknowledged the genocide and said her goal was for Palestinians to have self determination. Trump said a bunch of unhinged shit. But his policy has always been pro genocide.







  • I can’t help but wonder if your son is shy about his relationship or maybe he has some fear about talking about it with you. It sounds like things are more serious between them than he’s telling you. It’s not impossible to make new friends as a high school junior, but the way it is described it sounds more likely they are romantically involved, and in that case, expensive gifts aren’t very strange for someone in an upper middle class family.