Unable to understand a line of Emacs Lisp

emacs, lisp

Solution

PROGN simply evaluates the expressions in order, returning the return value of the last one.

SETQ is the basic assignment operator.

INFO enters the emacs info browser.

So, what this does is first assign the symbol `'bully` to the variable `Man-notify-method`, then enter the info browser. `'bully` is likely the name of a function, and `Man-notify-method` a place where the info browser looks up a function to call for some notification (Warning: I am just guessing here).

I guess that you will have to define your own function that calls your shell command like this:

(defun my-cmd ()
  (call-process   ; Look up the syntax in the emacs lisp manual
  ))

Then assign its symbol to `Man-notify-method`:

(setq Man-notify-method 'my-cmd)

Problem

The line is ``` function info() { emacs -eval "(progn (setq Man-notify-method 'bully) (info \"$1\"))" } ``` I know from manuals that Progn progn is a special form in `C source code'. Setq setq is a special form in `C source code'. (setq SYM VAL SYM VAL ...) Set each SYM to the value of its VAL. The symbols SYM are variables; they are literal (not evaluated). The values VAL are expressions; they are evaluated. Thus, (setq x (1+ y)) sets `x' to the value of`(1+ y)'. The second VAL is not computed until after the first SYM is set, and so on; each VAL can use the new value of variables set earlier in the `setq'. The return value of the`setq' form is the value of the last VAL. $1 seems to a reference to the first parameter after the command `man` which the user gives. 'bully seems to be a random variable. Man-notify-method seems to be an action function which is run when man command is executed. `-eval` seems to be an evalutian statemant which tells Emacs to run the statement which follows it. However, I am not completely sure about the function. I need to understand the function, since I want to bind a bash code of mine to the action function of man. Man-notify-method seems to be that action function, at least in Emacs. How do you understand the line of Emacs Lisp?

Original source