From c10521e97679c35a40926084e049445cc5053254 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Wed, 12 Aug 2015 15:28:55 +0300 Subject: emacs: Add and use 'guix-while-search'. * emacs/guix-utils.el (guix-while-search): New macro. * emacs/guix-pcomplete.el (guix-pcomplete-run-guix-and-search): Use it. * emacs/guix-prettify.el (guix-prettify-decompose-buffer): Likewise. --- emacs/guix-prettify.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'emacs/guix-prettify.el') diff --git a/emacs/guix-prettify.el b/emacs/guix-prettify.el index c74a393adf..24dfbb33e2 100644 --- a/emacs/guix-prettify.el +++ b/emacs/guix-prettify.el @@ -1,6 +1,6 @@ ;;; guix-prettify.el --- Prettify Guix store file names -;; Copyright © 2014 Alex Kost +;; Copyright © 2014, 2015 Alex Kost ;; This file is part of GNU Guix. @@ -47,6 +47,8 @@ ;;; Code: +(require 'guix-utils) + (defgroup guix-prettify nil "Prettify Guix store file names." :prefix "guix-prettify-" @@ -137,13 +139,11 @@ enabling/disabling `guix-prettify-mode'. If nil, do nothing.") (remove-text-properties (point-min) (point-max) '(composition nil)) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward guix-prettify-regexp nil t) - (remove-text-properties - (match-beginning guix-prettify-regexp-group) - (match-end guix-prettify-regexp-group) - '(composition nil)))))))) + (guix-while-search guix-prettify-regexp + (remove-text-properties + (match-beginning guix-prettify-regexp-group) + (match-end guix-prettify-regexp-group) + '(composition nil))))))) ;;;###autoload (define-minor-mode guix-prettify-mode -- cgit v1.2.3