all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <moasen@zoho.com>
To: help-gnu-emacs@gnu.org
Subject: Re: replace deprecated function ?
Date: Wed, 14 Feb 2018 04:34:55 +0100	[thread overview]
Message-ID: <86a7wcckgw.fsf@zoho.com> (raw)
In-Reply-To: mailman.9079.1518575794.27995.help-gnu-emacs@gnu.org

Yuri Khan wrote:

> This will ask for all jameses first, and then
> all blishes. The original snippet probably
> intended to do them all in document order.

(defun replace-list-ask-3 (re dict)
  (save-excursion
    (goto-char (point-min))
    (while (re-search-forward re nil t)
      (let*((match-string (match-string-no-properties 0))
            (default (cdr (assoc match-string dict))
            ))
        (when (and default
                   (yes-or-no-p
                    (format "Replace \"%s\" with \"%s\" ? " match-string default)))
          (replace-match default) )))))
;; (replace-list-ask-3 "james\\|blish" '(("james" . "James" ) ("blish" . "Blish")) )

-- 
underground experts united
http://user.it.uu.se/~embe8573


  parent reply	other threads:[~2018-02-14  3:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 18:16 replace deprecated function ? B. T. Raven
2018-02-13 19:27 ` Emanuel Berg
2018-02-13 20:00   ` Emanuel Berg
2018-02-13 22:41     ` B. T. Raven
2018-02-13 23:19       ` Joost Kremers
2018-02-13 23:26       ` Emanuel Berg
2018-02-13 23:33         ` Emanuel Berg
2018-02-14  2:36         ` Yuri Khan
     [not found]         ` <mailman.9079.1518575794.27995.help-gnu-emacs@gnu.org>
2018-02-14  3:34           ` Emanuel Berg [this message]
     [not found]       ` <mailman.9067.1518563981.27995.help-gnu-emacs@gnu.org>
2018-02-14 23:04         ` B. T. Raven
2018-02-16 16:57           ` Emanuel Berg
2018-02-16 20:19             ` B. T. Raven
2018-02-13 21:14 ` Kaushal Modi
     [not found] ` <mailman.9061.1518556487.27995.help-gnu-emacs@gnu.org>
2018-02-14 23:31   ` B. T. Raven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86a7wcckgw.fsf@zoho.com \
    --to=moasen@zoho.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.