🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #737

shell mode loses markers

#737
From: Mark J Neale
Date: Thu, 03 Sep 1992 19:11
63 lines
2886 bytes
Bug report for emacs version 18.57, in shell.el. Calling the function
shell when a shell buffer already exists destroys the markers marking
the last command typed. This is because make-shell calls shell-mode
for a buffer which is already in shell mode. I have changed make-shell
(see diffs below) to only call shell-mode on a new shell buffer, not
when switching to an already existing one.

*** /usr/local/lib/emacs/lisp/shell.el	Wed Jan  9 22:04:16 1991
--- shell.el	Thu Sep  3 15:00:53 1992
***************
*** 144,151 ****
  		'("-i")))))))
  
  (defun make-shell (name program &optional startfile &rest switches)
!   (let ((buffer (get-buffer-create (concat "*" name "*")))
! 	proc status size)
      (setq proc (get-buffer-process buffer))
      (if proc (setq status (process-status proc)))
      (save-excursion
--- 144,153 ----
  		'("-i")))))))
  
  (defun make-shell (name program &optional startfile &rest switches)
!   (let* ((bufname (concat "*" name "*"))
! 	 (new-buffer (not (get-buffer bufname)))
! 	 (buffer (get-buffer-create bufname))
! 	 proc status size)
      (setq proc (get-buffer-process buffer))
      (if proc (setq status (process-status proc)))
      (save-excursion
***************
*** 181,187 ****
  	(setq name (process-name proc)))
        (goto-char (point-max))
        (set-marker (process-mark proc) (point))
!       (shell-mode))
      buffer))
  
  (defvar shell-set-directory-error-hook 'ignore
--- 183,189 ----
  	(setq name (process-name proc)))
        (goto-char (point-max))
        (set-marker (process-mark proc) (point))
!       (if new-buffer (shell-mode)))
      buffer))
  
  (defvar shell-set-directory-error-hook 'ignore
--
      #                   Mark Neale (mjn@jet.uk)
      #  ######   #####   Juggling with the parameters of Fusion.
      #  #          #
      #  #####      #     Joint European Torus, Culham Lab. OX14 3EA, UK
#     #  #          #     +44 235 465272
 #####   ######     #     Any opinion expressed above is.
-- 
      #                   Mark Neale (mjn@jet.uk)
      #  ######   #####   Juggling with the parameters of Fusion.
      #  #          #
      #  #####      #     Joint European Torus, Culham Lab. OX14 3EA, UK
#     #  #          #     +44 235 465272
 #####   ######     #     Any opinion expressed above is.
- Disclaimer: Please note that the above is a personal view and should not 
  be construed as an official comment from the JET project.
Technical Details
Message-ID: <MJN.92Sep3151132@srv-dev.jet.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!srv-dev.jet.UK!mjn

Show Full Headers
Complete Article Headers
Newsgroups: gnu.emacs.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!srv-dev.jet.UK!mjn
From: mjn@srv-dev.jet.UK (Mark J Neale)
Subject: shell mode loses markers
Message-ID: <MJN.92Sep3151132@srv-dev.jet.uk>
Sender: gnulists@ai.mit.edu
Organization: Joint European Torus
Distribution: gnu
Date: Thu, 3 Sep 1992 19:11:32 GMT
Approved: bug-gnu-emacs@prep.ai.mit.edu
Lines: 64