emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell-resync-dirs changes my cursor position


From: Chris Moore
Subject: Re: shell-resync-dirs changes my cursor position
Date: Mon, 10 Sep 2007 14:21:22 +0200

On 9/10/07, Chris Moore <address@hidden> wrote:

> Here's a patch and changelog (and uuencoded patch in case the patch
> gets messed up by my mail client again):

That patch didn't work if the cursor was at the beginning of the
command being edited.

This one does.  There's probably a better way of doing this.

2007-09-10  Chris Moore  <address@hidden>

       * shell.el (shell-resync-dirs): Restore the cursor position to its
       previous location after syncing.

*** shell.el    31 Aug 2007 15:25:36 +0200      1.154
--- shell.el    10 Sep 2007 14:19:02 +0200      
***************
*** 808,813 ****
--- 808,816 ----
  command again."
    (interactive)
    (let* ((proc (get-buffer-process (current-buffer)))
+        (starting-point (if (eq (marker-position (process-mark
(get-buffer-process (current-buffer)))) (point))
+                            'start
+                          (set-marker (make-marker) (point))))
         (pmark (process-mark proc)))
      (goto-char pmark)
      ;; If the process echoes commands, don't insert a fake command in
***************
*** 852,858 ****
                   (setq shell-dirstack (cdr ds)
                         shell-last-dir (car shell-dirstack))
                   (shell-dirstack-message))
!         (error (message "Couldn't cd")))))))

  ;; For your typing convenience:
  (defalias 'dirs 'shell-resync-dirs)
--- 855,864 ----
                   (setq shell-dirstack (cdr ds)
                         shell-last-dir (car shell-dirstack))
                   (shell-dirstack-message))
!         (error (message "Couldn't cd")))))
!     (unless (eq starting-point 'start)
!       (goto-char starting-point)
!       (set-marker starting-point nil))))

  ;; For your typing convenience:
  (defalias 'dirs 'shell-resync-dirs)

begin 644 shell-resync-dirs-patch2.txt.gz
M'XL("$LVY48``W-H96QL+7)E<WEN8RUD:7)S+7!A=&-H,BYT>'0`S5+!CILP
M$#W#5TQSB6'C")*04O945:K4<[_`-0.QEMBL;5;*WW>,P^ZRZJ&''LH)/S^_
M>3/S\CP'=\%AV..0'$OX.O5P*(K/4%;address@hidden)R4^[(ZI9SS-W99P$\<
M[^Q34WYIBL.=G>;K+YRA+NI=71YA!H)2!,Y`_SP%D.9Z%;H%T0NE]QM"`)C2
M'address@hidden,C=9(8#UZ_FOJ.K0\`.@<,#E9BWK!LRQ+'R`!YKRP7NF>
MCX9$2;D#AL_`KL(^A>?&*:^,!G87XN'B+RMD]"JHQEI)$HS"=J[X"C!'2K%8
M*/J$]\/;VRQT2$['6'GE(QPB81Y";[SA\B(LS.0%?WR$'QWX"\+B%>7%H%MF
MZW;0&KWUH+1#ZT%`1T9>)Z_TGQ=7'79U5<?%D<.EF^>8!=XJ2ZU*LBQ;"ZV;
MVR!6O!V$\X%"MV1W_2)V'/56%_Q*YD6/1/A$(Z%-66O"W"(,FV]F&MK0B6PW
M6?Q(*IU'\)V8-S-9\+>1%D[MZ1?4"K7$AABLQ4X,2CC8AG*TI[FT17?3<G:0
MQ7A6U:X^GY9X_I]M$V\.Q*2'.9J4Z`]!CS%<B*OLK)GO*.^B^D%-J^%?S_HW
(AKO0>8,$````
`
end




reply via email to

[Prev in Thread] Current Thread [Next in Thread]