ffevotte / isend-mode.el

Interactively send parts of an Emacs buffer to an interpreter
77 stars 17 forks source link

'Move to next line' -> Making it optional #5

Closed amelio-vazquez-reina closed 11 years ago

amelio-vazquez-reina commented 11 years ago

It would be great to modify isend-send() so that the last line of the function:

 ;; Move point to the next line
 (isend--next-line))

is optional depending on a boolean variable the user can set. I am trying to learn elisp but I am still unsure how to do this. Any thoughts?

ffevotte commented 11 years ago

Thanks for you feature request!

The idea is to declare a new customization variable, following the model of other existing variables. You can for example adapt the declaration for isend-strip-empty-lines:

(defcustom isend-strip-empty-lines nil
  "If non-nil, `isend-send' strips empty lines (i.e. lines containing only spaces).

Note that this works when sending an entire region. If enabled, all lines containing
whitespace only will be stripped from the region before it is sent."
  :group 'isend
  :type  'boolean)

Then, the call to isend-send-line can be wrapped in a test:

(when your-new-configuration-variable
  (isend--next-line))

If you want to use this as an exercise to practice elisp, please do try writing this feature and open a pull request. Otherwise, I'll do it as soon as I get a round to it.

ffevotte commented 11 years ago

This should be fixed in fb76ca45ef9f0426a6816c345c8c98eacb44bd9c