all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: RSridhar <rsridar50@dataone.in>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: 4313@emacsbugs.donarmstrong.com
Subject: bug#4313: bug#4312: 23.1;  save-excursion and goto-char fail
Date: Fri, 04 Sep 2009 23:08:20 +0530	[thread overview]
Message-ID: <1252085900.3362.11.camel@www.x-shriman.com> (raw)
In-Reply-To: <m3vdk07zuq.fsf@hase.home>

[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]

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@dataone.in>


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

> Stefan Monnier <monnier@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.
> 

[-- Attachment #2: Type: text/html, Size: 2506 bytes --]

  reply	other threads:[~2009-09-04 17:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87ws43boia.fsf@cyd.mit.edu>
2009-09-02 10:03 ` bug#4312: 23.1; save-excursion and goto-char fail RSridhar
2009-09-03 13:51   ` Stefan Monnier
2009-09-03 16:33     ` Andreas Schwab
2009-09-04 17:38       ` RSridhar [this message]
     [not found]   ` <handler.4314.C.12528066171101.notifdonectrl.2@emacsbugs.donarmstrong.com>
2009-09-22 16:28     ` bug#4314: acknowledged by developer (close 4312) RSridhar
2009-09-22 16:30       ` Chong Yidong
2009-09-13  1:55 ` Processed: close 4312 Emacs bug Tracking System

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=1252085900.3362.11.camel@www.x-shriman.com \
    --to=rsridar50@dataone.in \
    --cc=4313@emacsbugs.donarmstrong.com \
    --cc=schwab@linux-m68k.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.