emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master d6f5c06 04/40: Applied patch by Nathaniel Flath:


From: Alexey Veretennikov
Subject: [elpa] master d6f5c06 04/40: Applied patch by Nathaniel Flath:
Date: Fri, 29 Jan 2016 23:29:27 +0000

branch: master
commit d6f5c063259501ac4fefb5d7b205a0a043779f4e
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>

    Applied patch by Nathaniel Flath:
    "This patch changes
    the prompt so that the default value is not in the edit
    area, but in the prompt.  This makes it easier to change if
    the default value is not what you wanted."
---
 loccur.el |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/loccur.el b/loccur.el
index 3228966..d45cc8f 100644
--- a/loccur.el
+++ b/loccur.el
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Alexey Veretennikov <alexey dot veretennikov at gmail dot com>
 ;; Created: 2009-09-08
-;; Version: 1.1.0
+;; Version: 1.1.1
 ;; Keywords: matching
 ;; URL: http://loccur.sourceforge.net/
 ;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x
@@ -44,6 +44,11 @@
 ;; 
 ;;; Change Log:
 ;;
+;; 2010-03-07 (1.1.1)
+;;    + Default value is taken from prompt instead of an edit area
+;;    (thanks to Nathaniel Flath)
+;;
+;;
 ;; 2009-10-05 (1.1.0)
 ;;    + Added highlighting of the matched strings
 ;;    + Now inserts selected region to the prompt
@@ -118,13 +123,15 @@ containing the regular expression REGEX. A second call of 
the function
 unhides lines again"
   (interactive 
    (if loccur-mode
-          (list nil)
-     (loccur-prompt)))
+       (list nil)
+       (list (read-string (concat "Regexp<" (loccur-prompt)
+                                  ">: ") "" 'loccur-history ))))
+  (if (string-equal "" regex) (setq regex (loccur-prompt)))
   (loccur-mode regex))
 
 
 (defun loccur-prompt ()
-  "Prompts for a regexp to search
+  "Returns the default value of the prompt.
 
 Default value for prompt is a current word or active region(selection),
 if its size is 1 line"
@@ -139,7 +146,7 @@ if its size is 1 line"
                       (line-number-at-pos pos2))
                    (buffer-substring-no-properties pos1 pos2)))
            (current-word))))
-    (list (read-string "Regexp: " prompt 'loccur-history ))))
+    prompt))
 
 
 (defun loccur-1 (regex)



reply via email to

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