mirror of
https://codeberg.org/scip/autoscratch.git
synced 2025-12-17 04:20:57 +01:00
better eval support
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||||
;; USA
|
;; USA
|
||||||
|
|
||||||
;; Version: 0.01
|
;; Version: 0.02
|
||||||
;; Author: T.v.Dein <tlinden@cpan.org>
|
;; Author: T.v.Dein <tlinden@cpan.org>
|
||||||
;; Keywords: files
|
;; Keywords: files
|
||||||
;; URL: https://github.com/tlinden/autoscratch
|
;; URL: https://github.com/tlinden/autoscratch
|
||||||
@@ -193,8 +193,15 @@ to $mode-scratch."
|
|||||||
|
|
||||||
(defun autoscratch--eval-trigger (form)
|
(defun autoscratch--eval-trigger (form)
|
||||||
"If FORM is a function execute interactively, otherwise evaluate it.
|
"If FORM is a function execute interactively, otherwise evaluate it.
|
||||||
Executes `autoscratch-trigger-hook' after evaluation."
|
Executes `autoscratch-trigger-hook' after evaluation.
|
||||||
(eval form)
|
|
||||||
|
Supported values for FORM include:
|
||||||
|
'emacs-lisp-mode
|
||||||
|
'(lambda() (emacs-lisp-mode)
|
||||||
|
'(emacs-lisp-mmode)"
|
||||||
|
(if (autoscratch--function-p form)
|
||||||
|
(funcall form)
|
||||||
|
(eval form))
|
||||||
(run-hooks 'autoscratch-post-trigger-hook)
|
(run-hooks 'autoscratch-post-trigger-hook)
|
||||||
(message (format "autoscratch switched to %s" major-mode)))
|
(message (format "autoscratch switched to %s" major-mode)))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user