emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 0cfe3ee: Write a named function


From: Mark Oteiza
Subject: [Emacs-diffs] master 0cfe3ee: Write a named function
Date: Wed, 15 Mar 2017 01:13:59 -0400 (EDT)

branch: master
commit 0cfe3ee457e010816f5f85ee9d4a362f8b9f045c
Author: Mark Oteiza <address@hidden>
Commit: Mark Oteiza <address@hidden>

    Write a named function
    
    * lisp/comint.el (comint-nonblank-p): New function.
    (comint-input-filter): Use it.
---
 lisp/comint.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/comint.el b/lisp/comint.el
index 7bac305..a01ecd3 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -387,8 +387,7 @@ See also `completion-at-point'.
 
 This is a good thing to set in mode hooks.")
 
-(defvar comint-input-filter
-  (function (lambda (str) (not (string-match "\\`\\s *\\'" str))))
+(defvar comint-input-filter #'comint-nonblank-p
   "Predicate for filtering additions to input history.
 Takes one argument, the input.  If non-nil, the input may be saved on the input
 history list.  Default is to save anything that isn't all whitespace.")
@@ -857,6 +856,10 @@ series of processes in the same Comint buffer.  The hook
        (set-process-coding-system proc decoding encoding))
     proc))
 
+(defun comint-nonblank-p (str)
+  "Return non-nil if STR contains non-whitespace syntax."
+  (not (string-match "\\`\\s *\\'" str)))
+
 (defun comint-insert-input (event)
   "In a Comint buffer, set the current input to the previous input at point.
 If there is no previous input at point, run the command specified



reply via email to

[Prev in Thread] Current Thread [Next in Thread]