~ubuntu-branches/ubuntu/edgy/ess/edgy

« back to all changes in this revision

Viewing changes to lisp/ess-inf.el

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-11-11 00:51:43 UTC
  • mfrom: (1.1.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20041111005143-wv1cih1h04xyrxrb
Tags: 5.2.3-3
* repair broken replace-regexp-in-string -> ess-replace-regexp-in-string
  patch
* expand autoload functionality in emacsen-startup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;;; ess-inf.el --- Support for running S as an inferior Emacs process
2
2
 
3
3
;; Copyright (C) 1989-1994 Bates, Kademan, Ritter and Smith
4
 
;; Copyright (C) 1997-2001 A.J. Rossini <rossini@u.washington.edu>,
5
 
;; Martin Maechler <maechler@stat.math.ethz.ch>.
 
4
;; Copyright (C) 1997-1999 A.J. Rossini <rossini@u.washington.edu>,
 
5
;;      Martin Maechler <maechler@stat.math.ethz.ch>.
 
6
;; Copyright (C) 2000--2004 A.J. Rossini, Rich M. Heiberger, Martin
 
7
;;      Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen.
6
8
 
7
 
;; Author: David Smith <dsmith@stats.adelaide.edu.au>
8
 
;;         (now: dsmith@insightful.com)
9
 
;; Maintainer: A.J. Rossini <rossini@u.washington.edu>
 
9
;; Original Author: David Smith <dsmith@stats.adelaide.edu.au>
10
10
;; Created: 7 Jan 1994
11
 
;; Modified: $Date: 2002/06/20 21:52:06 $
12
 
;; Version: $Revision: 5.78 $
13
 
;; RCS: $Id: ess-inf.el,v 5.78 2002/06/20 21:52:06 rsparapa Exp $
 
11
;; Maintainers: ESS-core <ESS-core@stat.math.ethz.ch>
14
12
 
15
13
;; This file is part of ESS
16
14
 
115
113
  ;; Couldn't we rather set all the default values or Local values now ?
116
114
  ;;>>> (ess-setq-vars-default ess-customize-alist (current-buffer))
117
115
  ;;>>> (ess-setq-vars-local   ess-customize-alist (current-buffer))
118
 
  ;;; AJR sez: I think we should set them later.  I don't want to nuke if
 
116
  ;;; AJR sez: I think we should set them later; don't want to nuke if
119
117
  ;;; I don't have to.
 
118
  ;;- MM: We shouldn't have to use  ess-setq-vars-default _at all_ ;
 
119
  ;;      only do the buffer local ...-vars-local ones
120
120
  (let ((temp-ess-dialect (eval (cdr (assoc 'ess-dialect
121
121
                                       ess-customize-alist))))
122
122
        (temp-ess-lang (eval (cdr (assoc 'ess-language
124
124
    (save-excursion
125
125
      ;;- Is this needed? (no, but it's useful to see them there [MM])
126
126
      (set-buffer ess-dribble-buffer)
127
 
      (ess-setq-vars-default ess-customize-alist (current-buffer))
 
127
      ;; Hack to work around the following "default" (global) setting of vars:
 
128
      ;; make sure our comint-... hack doesn't affect anything else
 
129
      (make-variable-buffer-local 'comint-use-prompt-regexp-instead-of-fields)
 
130
      ;; now the abomination:
 
131
      (ess-setq-vars-default ess-customize-alist)
 
132
 
 
133
      (setq-default comint-use-prompt-regexp-instead-of-fields nil); re set HACK!
128
134
      ;;>> Doesn't set ess-language,
129
135
      ;;>> => comint-input-sender is not set to 'ess-input-  ==> no input echo!
130
136
      ;;>> => that's why things fail:
131
137
      ;;>> (ess-setq-vars-local ess-customize-alist (current-buffer))
132
138
      ;;                 ======
133
 
      (setq temp-ess-dialect
134
 
            (eval(cdr(assoc 'ess-dialect ess-customize-alist))))
135
 
      (setq temp-ess-lang
136
 
            (eval(cdr(assoc 'ess-language ess-customize-alist)))))
 
139
      ;;MM --- why set them here again when already "(let ..)" above ?
 
140
      ;;   --> trying without (comment the following 4 lines):
 
141
      ;; (setq temp-ess-dialect
 
142
      ;;    (eval(cdr(assoc 'ess-dialect ess-customize-alist))))
 
143
      ;; (setq temp-ess-lang
 
144
      ;;    (eval(cdr(assoc 'ess-language ess-customize-alist))))
 
145
      )
137
146
 
138
147
    ;; run hooks now, to overwrite the above!
139
148
    (run-hooks 'ess-pre-run-hook)
141
150
     (format "(inf-ess 1): lang=%s, dialect=%s, tmp-dialect=%s, buf=%s\n"
142
151
             ess-language ess-dialect temp-ess-dialect (current-buffer)))
143
152
    (let* ((process-environment process-environment)
144
 
           (defdir (or (and ess-directory-function (funcall ess-directory-function))
145
 
                       ess-directory default-directory))
 
153
           (defdir (or (and ess-directory-function (funcall ess-directory-function))
 
154
                       ess-directory default-directory))
146
155
           (temp-dialect temp-ess-dialect)
147
156
           (temp-lang temp-ess-lang)
148
157
           (procname (let ((ntry 0) ;; find a non-existent process
170
179
             (memq major-mode '(inferior-ess-mode)))
171
180
        (setq startdir
172
181
              (if ess-ask-for-ess-directory
173
 
                  (ess-get-directory (directory-file-name defdir))
174
 
                  defdir))
 
182
                  (ess-get-directory (directory-file-name defdir))
 
183
                  defdir))
175
184
        (setq buf (current-buffer))
176
185
        (ess-write-to-dribble-buffer
177
 
         (format "(inferior-ess) Method #1 start=%s buf=%s\n" startdir buf)))
 
186
         (format "(inferior-ess) Method #1 start=%s buf=%s\n" startdir buf)))
178
187
 
179
188
       ;;  Not an ESS buffer yet
180
189
       ((and (not buf)
181
190
             (get-buffer buf-name-str))
182
191
        (setq buf (get-buffer buf-name-str))
183
192
        (ess-write-to-dribble-buffer
184
 
         (format "(inferior-ess) Method #2 buf=%s\n" buf)))
 
193
         (format "(inferior-ess) Method #2 buf=%s\n" buf)))
185
194
 
186
195
       ;; Ask for transcript file and startdir
187
196
       ;; FIXME -- this should be in ess-get-transfile
190
199
       ((not buf)
191
200
        (setq startdir
192
201
              (if ess-ask-for-ess-directory
193
 
                  (ess-get-directory (directory-file-name defdir))
194
 
                  defdir))
 
202
                  (ess-get-directory (directory-file-name defdir))
 
203
                  defdir))
195
204
        (if ess-ask-about-transfile
196
205
            (let ((transfilename (read-file-name
197
206
                                  "Use transcript file (default none):"
202
211
                                               transfilename)))))
203
212
          (setq buf (get-buffer-create buf-name-str)))
204
213
        (ess-write-to-dribble-buffer
205
 
         (format "(inferior-ess) Method #3 start=%s buf=%s\n" startdir buf))))
 
214
         (format "(inferior-ess) Method #3 start=%s buf=%s\n" startdir buf))))
206
215
 
207
216
      (set-buffer buf)
208
217
      ;; Now that we have the buffer, set buffer-local variables.
209
 
      (ess-setq-vars-local ess-customize-alist buf)
 
218
      (ess-setq-vars-local ess-customize-alist); buf)
210
219
      (if ess-start-args (setq inferior-ess-start-args ess-start-args))
211
220
      ;; Was:  if not, set to null.
212
221
      ;;(setq inferior-ess-start-args "")) ;; AJR: Errors with XLS?
237
246
                    (concat "." ess-dialect "history"))
238
247
      ;; initialize.
239
248
      (let ((ess-directory (if startdir default-directory ess-directory)))
240
 
        (ess-multi procname buf inferior-ess-start-args)))))
 
249
        (ess-multi procname buf inferior-ess-start-args)))))
241
250
 
242
251
 
243
252
;;; A note on multiple processes: the following variables
263
272
there is no process NAME)."
264
273
 
265
274
  (let* ((proc-name name)
 
275
         (special-display-regexps nil)
 
276
         (special-display-frame-alist inferior-ess-frame-alist)
266
277
         (proc (get-process proc-name)))
 
278
    (if inferior-ess-own-frame
 
279
        (setq special-display-regexps '(".")))
267
280
    ;; If ESS process NAME is running, switch to it
268
281
    (if (and proc (comint-check-proc (process-buffer proc)))
269
 
        (switch-to-buffer (process-buffer proc))
 
282
        (pop-to-buffer (process-buffer proc))
270
283
      ;; Otherwise, crank up a new process
271
284
      (let* ((symbol-string
272
285
              (concat "inferior-" inferior-ess-program "-args"))
326
339
        ;; Get search list when needed
327
340
        (setq ess-sp-change t)
328
341
        (run-hooks 'ess-post-run-hook))
329
 
      (switch-to-buffer (process-buffer (get-process proc-name))))))
 
342
      (if inferior-ess-same-window
 
343
          (switch-to-buffer (process-buffer (get-process proc-name)))
 
344
        (pop-to-buffer (process-buffer (get-process proc-name)))))))
 
345
 
330
346
 
331
347
(defun ess-process-sentinel (proc message)
332
348
  "Sentinel for use with ESS processes.
399
415
 
400
416
(defun ess-get-directory (default)
401
417
  (ess-prompt-for-directory
402
 
        default
 
418
        default
403
419
        (format "ESS [%s(%s): %s] starting data directory? "
404
420
                ess-language ess-dialect inferior-ess-program)))
405
421
 
408
424
  (let ((the-dir
409
425
         (expand-file-name
410
426
          (file-name-as-directory
411
 
           (read-file-name prompt
412
 
                           (file-name-as-directory default)
413
 
                           (file-name-as-directory default) t nil)))))
 
427
           (if (fboundp 'read-directory-name)
 
428
               ;; use XEmacs' read-directory-name if exists.
 
429
               (read-directory-name prompt
 
430
                                    (file-name-as-directory default)
 
431
                                    (file-name-as-directory default) t nil)
 
432
             (read-file-name prompt
 
433
                             (file-name-as-directory default)
 
434
                             (file-name-as-directory default) t nil))))))
414
435
    (if (file-directory-p the-dir) nil
415
436
      (error "%s is not a valid directory" the-dir))
416
437
    the-dir))
488
509
 
489
510
(defun ess-request-a-process (message &optional noswitch)
490
511
  "Ask for a process, and make it the current ESS process.
491
 
Also switches to the process buffer, if second arg NOSWITCH (prefix)
492
 
is non-nil.  Returns the name of the selected process."
 
512
Also switches to the process buffer unless NOSWITCH is non-nil.  Interactively,
 
513
NOSWITCH can be set by giving a prefix argument.
 
514
Returns the name of the selected process."
493
515
  (interactive
494
516
   (list "Switch to which ESS process? " current-prefix-arg)) ;prefix sets 'noswitch
495
517
  (update-ess-process-name-list)
508
530
    (save-excursion
509
531
      (set-buffer (process-buffer (get-process proc)))
510
532
      (ess-make-buffer-current))
511
 
    (if noswitch nil (switch-to-buffer (process-buffer (get-process proc))))
 
533
    (if noswitch
 
534
        nil
 
535
      (ess-show-buffer (buffer-name (process-buffer (get-process proc))) t))
512
536
    proc))
513
537
 
514
538
(defun ess-force-buffer-current (prompt &optional force)
515
539
  "Make sure the current buffer is attached to an ESS process.
516
 
If not, or  FORCE (prefix argument) is non-nil,
 
540
If not, or FORCE (prefix argument) is non-nil,
517
541
prompt for a process name with PROMPT.
518
542
`ess-local-process-name' is set to the name of the process selected.
519
543
`ess-dialect' is set to the dialect associated with the process selected."
543
567
 
544
568
(defun ess-switch-to-ESS (eob-p)
545
569
  "Switch to the current inferior ESS process buffer.
546
 
With (prefix) EOB-P non-nil, positions cursor at end of buffer."
 
570
With (prefix) EOB-P non-nil, positions cursor at end of buffer.
 
571
This function should follow the description in `ess-show-buffer'
 
572
for showing the iESS buffer, except that the iESS buffer is also
 
573
made current."
547
574
  (interactive "P")
548
575
  (ess-make-buffer-current)
549
576
  (if (and ess-current-process-name (get-process ess-current-process-name))
550
577
      (progn
551
 
        (pop-to-buffer
552
 
         (process-buffer (get-process ess-current-process-name)))
 
578
        ;; Display the buffer, but don't select it yet.
 
579
        (ess-show-buffer
 
580
         (buffer-name (process-buffer (get-process ess-current-process-name)))
 
581
         t)
553
582
        (if eob-p (goto-char (point-max))))
554
583
    (message "No inferior ESS process")
555
584
    (ding)))
579
608
  (if (eq (length ess-process-name-list) 0)
580
609
      (setq ess-current-process-name nil)))
581
610
 
 
611
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
612
;; ess-show-buffer
 
613
;; Something like this almost works, but problems with XEmacs and Emacs
 
614
;; differing implementations of the args to display-buffer make this
 
615
;; too tough to pursue.  The longer version below works.
 
616
;; (defun ess-show-buffer (buf)
 
617
;;   "Display the buffer BUF, a string, but do not select it.
 
618
;; Returns the window corresponding to the buffer."
 
619
;;   ;; On XEmacs, I get an error if third arg to display-buffer is t and
 
620
;;   ;; the BUF is in another frame.  Emacs does not have this problem.
 
621
;;   (if (featurep 'xemacs)
 
622
;;       (display-buffer buf nil (get-frame-for-buffer buf))
 
623
;;     (display-buffer buf nil t)))
 
624
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
625
(defun ess-show-buffer (buf &optional visit)
 
626
  "Ensure the ESS buffer BUF is visible.
 
627
The buffer, specified as a string, is typically an iESS (e.g. *R*) buffer.
 
628
 
 
629
This handles several cases:
 
630
 
 
631
1. If BUF is visible in the current frame, nothing is done.
 
632
2. If BUF is visible in another frame, then we ensure that frame is
 
633
visible (it may have been iconified).
 
634
3. If buffer is not visible in any frame, simply show it in another window
 
635
in the current frame.
 
636
 
 
637
Iff VISIT is non-nil, as well as making BUF visible, we also select it
 
638
as the current buffer."
 
639
  (let ( (frame))
 
640
    (if (ess-buffer-visible-this-frame buf)
 
641
        ;;1. Nothing to do, BUF visible in this frame; just return window
 
642
        ;; where this buffer is.
 
643
        t
 
644
 
 
645
      ;; 2. Maybe BUF visible in another frame.
 
646
      (setq frame (ess-buffer-visible-other-frame buf))
 
647
      (if frame
 
648
          ;; BUF is visible in frame, so just check frame is raised.
 
649
          (if (not (eq (frame-visible-p frame) t))
 
650
              ;; frame is not yet visible, so raise it.
 
651
              (raise-frame frame))
 
652
        ;; 3. else BUF not visible in any frame, so show it (but do
 
653
        ;; not select it) in another window in current frame.
 
654
        (display-buffer buf)))
 
655
    ;; At this stage, the buffer should now be visible on screen,
 
656
    ;; although it won't have been made current.
 
657
    (if visit
 
658
        (progn
 
659
          ;; Need to select the buffer.
 
660
          ;;
 
661
          ;; First of all, check case 2 if buffer is in another frame
 
662
          ;; but that frame may not be selected.
 
663
          (if (and frame (not (featurep 'xemacs)))
 
664
              (progn
 
665
                ;; need to select the frame
 
666
                (select-frame frame)
 
667
                ;; reposition mouse to make frame active.
 
668
                (set-mouse-position (selected-frame) (1- (frame-width)) 0)))
 
669
          (select-window (get-buffer-window buf 0))))))
 
670
 
 
671
 
 
672
;; The next few functions are copied from my (SJE) iswitchb library.
 
673
(defun ess-get-bufname (win)
 
674
  "Used by `ess-get-buffers-in-frames' to walk through all windows."
 
675
  (let ((buf (buffer-name (window-buffer win))))
 
676
    (if (not (member buf ess-bufs-in-frame))
 
677
        ;; Only add buf if it is not already in list.
 
678
        ;; This prevents same buf in two different windows being
 
679
        ;; put into the list twice.
 
680
        (setq ess-bufs-in-frame
 
681
              (cons buf ess-bufs-in-frame)))))
 
682
 
 
683
(defun ess-get-buffers-in-frames (&optional current)
 
684
 "Return the list of buffers that are visible in the current frame.
 
685
If optional argument CURRENT is given, restrict searching to the
 
686
current frame, rather than all frames."
 
687
 (let ((ess-bufs-in-frame nil))
 
688
   (walk-windows 'ess-get-bufname nil (if current nil 0))
 
689
   ess-bufs-in-frame))
 
690
 
 
691
(defun ess-buffer-visible-this-frame (buf)
 
692
 "Return t if BUF is visible in current frame."
 
693
 (member buf (ess-get-buffers-in-frames t)))
 
694
 
 
695
(defun ess-buffer-visible-other-frame (buf)
 
696
 "Return t if BUF is visible in another frame.
 
697
Assumes that buffer has not already been in found in current frame."
 
698
 (if (member buf (ess-get-buffers-in-frames))
 
699
     (window-frame (get-buffer-window buf 0))
 
700
   nil))
 
701
 
 
702
 
582
703
 ; Functions for evaluating code
583
704
 
584
705
(defun ess-ddeclient-p ()
830
951
    (goto-char (marker-position (process-mark sprocess)))
831
952
    (if eob
832
953
        (progn
833
 
          (set-buffer cbuffer)
834
 
          (switch-to-buffer-other-window sbuffer)
835
 
          (goto-char (point-max))
836
 
          (switch-to-buffer-other-window cbuffer))
837
 
      (set-buffer cbuffer))))
 
954
          (ess-show-buffer (buffer-name sbuffer) nil)
 
955
          ;; Once SBUFFER is visible, we can then move the point in that
 
956
          ;; window to the end of the buffer.
 
957
          (set-window-point (get-buffer-window sbuffer t)
 
958
                            (with-current-buffer sbuffer (point-max))))
 
959
      (set-buffer cbuffer))
 
960
    ))
838
961
 
839
962
;;;*;;; Evaluate only
840
963
 
1003
1126
                      (buffer-file-name))
1004
1127
                 (expand-file-name
1005
1128
                  (read-file-name "Load S file: " nil nil t)))))
1006
 
  (require 'ess-inf)
1007
1129
  (ess-make-buffer-current)
1008
1130
  (let ((source-buffer (get-file-buffer filename)))
1009
1131
    (if (ess-check-source filename)
1071
1193
         ;; Code for GNU Emacs
1072
1194
         (setq inferior-ess-mode-map (cons 'keymap comint-mode-map))))
1073
1195
 
1074
 
  ;; Use syntax valid *both* for GNU emacs and Xemacs :
 
1196
  ;; Use syntax valid *both* for GNU emacs and XEmacs :
1075
1197
  (define-key inferior-ess-mode-map "\r"       'inferior-ess-send-input)
 
1198
  (define-key inferior-ess-mode-map "\C-a"     'comint-bol)
1076
1199
  (define-key inferior-ess-mode-map "\M-\r"    'ess-transcript-send-command-and-move)
1077
1200
  (define-key inferior-ess-mode-map "\C-c\C-l" 'ess-load-file)
 
1201
  ;; the above OVERRIDES  comint-dynamic-list-input-ring --> re-assign:
 
1202
  (define-key inferior-ess-mode-map "\C-c\M-l" 'comint-dynamic-list-input-ring)
1078
1203
  (define-key inferior-ess-mode-map "\C-c`"    'ess-parse-errors)
1079
1204
  (define-key inferior-ess-mode-map "\C-c\C-d" 'ess-dump-object-into-edit-buffer)
1080
1205
  (define-key inferior-ess-mode-map "\C-c\C-v" 'ess-display-help-on-object)
1222
1347
 
1223
1348
  (make-local-variable 'comint-process-echoes)
1224
1349
  (make-local-variable 'comint-input-sender)
 
1350
  (make-local-variable 'process-connection-type)
 
1351
  (setq process-connection-type t)
1225
1352
 
1226
1353
  ;; Configuration for SAS/XLispStat input handling
1227
1354
  ;; We set comint-process-echoes to t because inferior-ess-input-sender
1275
1402
  (setq font-lock-defaults
1276
1403
        '(inferior-ess-font-lock-keywords nil nil ((?' . "."))))
1277
1404
 
1278
 
  (ess-setq-vars-local ess-customize-alist (current-buffer))
 
1405
  (ess-setq-vars-local ess-customize-alist); (current-buffer))
1279
1406
 
1280
1407
  (ess-write-to-dribble-buffer
1281
1408
   (format "(i-ess 3): curr-buf=%s, comint..echo=%s, comint..sender=%s,\n"
1335
1462
;;>
1336
1463
;;> As promised, here is a quick hack:
1337
1464
;;  ___hack much improved by MM___ , both help(.) and ?... now work
1338
 
;;
1339
 
;; rmh: catch page() just like we catch help()
 
1465
;; FIXME: Note that  '??' nicely works in *R*, but
 
1466
;;        'type ? topic' doesn't use ess-help {but display in *R*}
1340
1467
(defconst inferior-R-1-input-help (format "help *(%s)" ess-help-arg-regexp))
1341
1468
(defconst inferior-R-2-input-help (format "^ *\\? *%s" ess-help-arg-regexp))
1342
 
(defconst inferior-R-page         (format "page *(%s)" ess-help-arg-regexp))
 
1469
(defconst inferior-R-page         (format "^ *page *(%s)" ess-help-arg-regexp))
1343
1470
 
1344
1471
(defun inferior-R-input-sender (proc string)
1345
1472
  ;; REALLY only for debugging: this S_L_O_W_S D_O_W_N   [here AND below]
1359
1486
                (insert-before-markers string)) ;; emacs 21.0.105 and older
1360
1487
            (delete-backward-char 1))           ;; emacs 21.0.106 and newer
1361
1488
          (if page-string
1362
 
              (progn          
 
1489
              (progn
1363
1490
                (ess-command (concat string2 "\n")
1364
1491
                             (get-buffer-create (concat string2 ".rt")))
1365
1492
                (ess-eval-linewise "\n")
1533
1660
    (if (yes-or-no-p (format "Really quit ESS process %s? " sprocess))
1534
1661
        (progn   ;;;;previouslyl (save-excursion
1535
1662
          (ess-cleanup)
1536
 
          (ess-switch-to-ESS nil)
1537
1663
          (goto-char (marker-position (process-mark sprocess)))
1538
1664
          (insert inferior-ess-exit-command)
1539
1665
          (if (string-equal ess-dialect "R")
1570
1696
          "Delete all buffers associated with process %s? "
1571
1697
          the-procname))
1572
1698
        (progn
1573
 
          (mapcar '(lambda (buf)
1574
 
                     (set-buffer buf)
1575
 
                     ;; Consider buffers for which
1576
 
                     ;; ess-local-process-name is the same as
1577
 
                     ;; the-procname
1578
 
                     (if (and (not (get-buffer-process buf))
1579
 
                              ess-local-process-name
1580
 
                              (equal ess-local-process-name
1581
 
                                     the-procname))
1582
 
                         (kill-buffer buf)))
1583
 
                  (buffer-list))
1584
 
          (ess-switch-to-ESS nil)))))
 
1699
          (save-excursion
 
1700
            (mapcar '(lambda (buf)
 
1701
                       (set-buffer buf)
 
1702
                       ;; Consider buffers for which
 
1703
                       ;; ess-local-process-name is the same as
 
1704
                       ;; the-procname
 
1705
                       (if (and (not (get-buffer-process buf))
 
1706
                                ess-local-process-name
 
1707
                                (equal ess-local-process-name
 
1708
                                       the-procname))
 
1709
                           (kill-buffer buf)))
 
1710
                    (buffer-list)))))
 
1711
    (ess-switch-to-ESS nil)))
1585
1712
 
1586
1713
(defun ess-kill-buffer-function nil
1587
1714
  "Function run just before an ESS process buffer is killed."
1877
2004
            (set-buffer tbuffer)
1878
2005
            ;; guaranteed by the initial space:(buffer-disable-undo)
1879
2006
            ;; dbg:
1880
 
;;-         (ess-write-to-dribble-buffer
1881
 
;;-          (format "(ess-search-list ..): tbuffer %s\n"
1882
 
;;-                  (buffer-name tbuffer)))
 
2007
;;-         (ess-write-to-dribble-buffer
 
2008
;;-          (format "(ess-search-list ..): tbuffer %s\n"
 
2009
;;-                  (buffer-name tbuffer)))
1883
2010
 
1884
2011
            ;;unnecessary; ess-command does (erase-buffer)
1885
2012
            (ess-command inferior-ess-search-list-command tbuffer)
1894
2021
                    (setq elt (concat homedir elt)))
1895
2022
                ;;else
1896
2023
                ;;dbg
1897
 
;;-             (ess-write-to-dribble-buffer "not dir.\n")
 
2024
;;-             (ess-write-to-dribble-buffer "not dir.\n")
1898
2025
                )
1899
2026
              (setq result (append result (list elt))))
1900
2027
            (kill-buffer tbuffer)))