From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.bugs Subject: bug#15275: 24.3; replace-string function does not respect current region Date: Thu, 05 Sep 2013 21:19:19 +0530 Message-ID: <87hadz5kw0.fsf@gmail.com> References: <52287F44.2090707@poczta.onet.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1378396098 11481 80.91.229.3 (5 Sep 2013 15:48:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Sep 2013 15:48:18 +0000 (UTC) Cc: 15275@debbugs.gnu.org To: Jarek Czekalski Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 05 17:48:18 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VHbn7-0000sA-Qf for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Sep 2013 17:48:18 +0200 Original-Received: from localhost ([::1]:60638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHbn7-0006SY-EB for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Sep 2013 11:48:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHbmy-0006Q2-DV for bug-gnu-emacs@gnu.org; Thu, 05 Sep 2013 11:48:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHbms-0006SH-R9 for bug-gnu-emacs@gnu.org; Thu, 05 Sep 2013 11:48:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHbms-0006SD-NQ for bug-gnu-emacs@gnu.org; Thu, 05 Sep 2013 11:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VHbms-0003cc-ED for bug-gnu-emacs@gnu.org; Thu, 05 Sep 2013 11:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jambunathan K Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Sep 2013 15:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15275 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15275-submit@debbugs.gnu.org id=B15275.137839603313853 (code B ref 15275); Thu, 05 Sep 2013 15:48:02 +0000 Original-Received: (at 15275) by debbugs.gnu.org; 5 Sep 2013 15:47:13 +0000 Original-Received: from localhost ([127.0.0.1]:42044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VHbm4-0003bM-Ir for submit@debbugs.gnu.org; Thu, 05 Sep 2013 11:47:12 -0400 Original-Received: from mail-pd0-f177.google.com ([209.85.192.177]:49797) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VHbm1-0003b9-PW for 15275@debbugs.gnu.org; Thu, 05 Sep 2013 11:47:10 -0400 Original-Received: by mail-pd0-f177.google.com with SMTP id y10so1963791pdj.36 for <15275@debbugs.gnu.org>; Thu, 05 Sep 2013 08:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=qLyowuR3eReO39F9/5UhLW1vrAzvfov7cy3OAfrFrkg=; b=ePBQq+5lBDeal71cefjSIlfjSplgtuI1xdvCg5zjB3hGslgZPaQ8dG6/TZ+lfZYw+Y 7o4Vud5Y/sfZKUrtrqycsSpPwhSGcZbJOp5j4qTd2QCqhMOUnYp5ruDWMTj1V6T03MWk dpAnYpWWmPEbiHpCafonqW3GIyFO7GA0DVV/4yh7TUFafVJ001OHbrgY35Y+Arm4KiQk szJyWMxaAgLi5fZCzlTDBIVBHecC2yYDGcY3Argm1M2ZXa/ynCoBT3kcFacncol9tPce tD8MC6YTDnswBEsa0mzWB79O6bem9YVjcooxZwJhHh2FjOdQvgMct8JjaBmu6MH+IPp5 bxtQ== X-Received: by 10.68.5.228 with SMTP id v4mr9951146pbv.117.1378396023575; Thu, 05 Sep 2013 08:47:03 -0700 (PDT) Original-Received: from porunai ([115.242.162.13]) by mx.google.com with ESMTPSA id oc10sm36447232pbb.3.1969.12.31.16.00.00 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Thu, 05 Sep 2013 08:47:02 -0700 (PDT) In-Reply-To: <52287F44.2090707@poczta.onet.pl> (Jarek Czekalski's message of "Thu, 05 Sep 2013 14:55:32 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78003 Archived-At: Jarek Czekalski writes: > emacs started with -Q. Documentation of function (replace-string) > says: > > In Transient Mark mode, if the mark is active, operate on the contents > of the region. Otherwise, operate from point to the end of the buffer. > > However I can't make it work on a region and it always replaces > from the point up to the end of buffer. For example this call: > > (replace-string "a" "x") > > If I execute it through M-x, it works correctly, working only on the > region. 1. Mark a region 2. Replace string M-x replace-string RET a RET x RET 3. Do M-x list-command-histort RET 4. You will find something like this. (replace-string "a" "x" nil (if (and transient-mark-mode mark-active) (region-beginning)) (if (and transient-mark-mode mark-active) (region-end))) This will probably provide some clue on what you are looking for. > > > In GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) > of 2013-03-17 on MARVIN > Windowing system distributor `Microsoft Corp.', version 6.1.7601 > Configured using: > `configure --with-gcc (4.7) --cflags > -ID:/devel/emacs/libs/libXpm-3.5.8/include > -ID:/devel/emacs/libs/libXpm-3.5.8/src > -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include > -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include > -ID:/devel/emacs/libs/giflib-4.1.4-1/include > -ID:/devel/emacs/libs/jpeg-6b-4/include > -ID:/devel/emacs/libs/tiff-3.8.2-1/include > -ID:/devel/emacs/libs/gnutls-3.0.9/include > -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include > -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2' > > Important settings: > value of $LANG: PLK > locale-coding-system: cp1250 > default enable-multibyte-characters: t > > Major mode: Lisp Interaction > > Minor modes in effect: > tooltip-mode: t > mouse-wheel-mode: t > tool-bar-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > line-number-mode: t > transient-mark-mode: t > > Recent input: > M-: ( r e p l a c e - > s t r i n g SPC " i " SPC " * " ) M-x r e > p o r > > Recent messages: > For information about GNU Emacs and the GNU system, type C-h C-a. > Mark set [2 times] > Replaced 8 occurrences > nil > > Load-path shadows: > None found. > > Features: > (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml > easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 > mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums > mm-util mail-prsvr mail-utils time-date tooltip ediff-hook vc-hooks > lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win > w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list > newcomment lisp-mode register page menu-bar rfn-eshadow timer select > scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham > georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao > korean japanese hebrew greek romanian slovak czech european ethiopic > indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple > abbrev minibuffer loaddefs button faces cus-face macroexp files > text-properties overlay sha1 md5 base64 format env code-pages mule > custom widget hashtable-print-readable backquote make-network-process > w32 multi-tty emacs)