GNU bug report logs - #4313
23.1; save-excursion and goto-char fail

Previous Next

Package: emacs;

Reported by: RSridhar <rsridar50 <at> dataone.in>

Date: Wed, 2 Sep 2009 10:15:09 UTC

Severity: normal

Merged with 4312, 4314

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4313 in the body.
You can then email your comments to 4313 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4313; Package emacs. (Wed, 02 Sep 2009 10:15:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to RSridhar <rsridar50 <at> dataone.in>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 02 Sep 2009 10:15:09 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: RSridhar <rsridar50 <at> dataone.in>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1;  save-excursion and goto-char fail
Date: Wed, 02 Sep 2009 15:33:05 +0530
1. I have a lisp code which saves file buffer and does some manipulation
on the 
file in shell. subsequently it is reverted. However I have tried
save-excursion 
before saving file which did not restore the file position on reverting.
So I tr
ied setq point to some var and after reverting restore point with
goto-char. Thi
s also did not ork in restoring previous position although (point)
function did 
return the correct  value from the goto-char function in lisp. 

2. The file manipulated contains utf-8 chars. Every now and then octal
values di
splay as language text but most of the time only octal utf-8 chars are
displayed
. Also the devanaagari font that is displayed incorrectly when it is
displayed..
. The (itrans) short i is to be to the left of the consonant but gets
associated
 with the right consonant. 

3. re-search-forward function fails regular expression with octal code
   
In GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.5)
 of 2009-08-26 on x86-2.fedora.phx.redhat.com
Windowing system distributor `The X.Org Foundation', version
11.0.10602000
configured using `configure  '--build=i386-redhat-linux-gnu'
'--host=i386-redhat-linux-gnu' '--target=i586-redhat-linux-gnu'
'--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
'--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/var/lib' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg'
'--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm'
'--with-x-toolkit=gtk' 'build_alias=i386-redhat-linux-gnu'
'host_alias=i386-redhat-linux-gnu' 'target_alias=i586-redhat-linux-gnu'
'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32
-march=i586 -mtune=generic -fasynchronous-unwind-tables''

Important settings:
  value of $LC_ALL: C
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  show-paren-mode: t
  cua-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <menu-bar> 
<help-menu> <send-emacs-bug-report>

Recent messages:
Loading /usr/share/emacs/site-lisp/site-start.d/focus-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/nxml-init.el (source)...
Loading /usr/share/emacs/site-lisp/nxml-mode/rng-auto.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/nxml-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/php-mode-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/po-mode-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/rpm-spec-mode-init.el
(source)...done
Loading cua-base...done
Loading paren...done
For information about GNU Emacs and the GNU system, type C-h C-a.

-- 
RSridhar <rsridar50 <at> dataone.in>






Merged 4312 4313 4314. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Wed, 02 Sep 2009 23:50:08 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4313; Package emacs. (Fri, 04 Sep 2009 17:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to RSridhar <rsridar50 <at> dataone.in>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 04 Sep 2009 17:45:04 GMT) Full text and rfc822 format available.

Message #12 received at 4313 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: RSridhar <rsridar50 <at> dataone.in>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 4313 <at> debbugs.gnu.org
Subject: Re: bug#4312: 23.1;  save-excursion and goto-char fail
Date: Fri, 04 Sep 2009 23:08:20 +0530
[Message part 1 (text/plain, inline)]
hi ..
This code I have been using for long and worked well in previous
version.
i.e, Emacs 22..... 
and since I loaded Fedora 11 and from their repository  emacs 23.1 
many of my lisp codes malfunction.

The loaded file contains utf-8 codes of devanagari ( indian root
language).
The simplest code that failed
(defun temay()
   "Temporary script to xltn itrans files and revert buffer"
   (interactive)
   (setq pos (point))
;;or (save excursion) 
   ;;(message "point set %d" pos)
   (save-restriction
     (widen)
     (save-buffer)
     (setq localvar ( concat "xltn -f " (buffer-file-name)))
     (shell-command localvar)
     (revert-buffer nil t nil))
   ;;(message "point set %d" pos)
   ;;(message "point returned %d" (goto-char pos))
   (goto-char pos)
)

-- 
RSridhar <rsridar50 <at> dataone.in>


On Thu, 2009-09-03 at 18:33 +0200, Andreas Schwab wrote:

> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> 
> >> 1. I have a lisp code which saves file buffer and does some
> >> manipulation on the file in shell.  subsequently it is reverted.
> >> However I have tried save-excursion before saving file which did not
> >> restore the file position on reverting.
> >
> > save-excursion uses markers to remember the position.  But markers only
> > keep track of positions by keeping track of insertions/deletions and
> > adjusting the position accordingly.  When the changes happen outside
> > Emacs, this doesn't work too well, because Emacs sees your revert-buffer
> > as just one big delete&insert.
> 
> insert-file-contents tries to keep markers if possible, but that only
> works if the marker points into the unchanged head or tail of the
> replaced contents.
> 
> Andreas.
> 
[Message part 2 (text/html, inline)]

bug closed, send any further explanations to RSridhar <rsridar50 <at> dataone.in> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> emacsbugs.donarmstrong.com. (Sun, 13 Sep 2009 01:55:06 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Wed, 21 Oct 2009 14:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 303 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.