aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2007-11-10 09:52:30 +0000
committerMartin Rudalics2007-11-10 09:52:30 +0000
commit78ddc123db626d7475df907bd87b7f2c3d0c1e84 (patch)
treee873098159c6446051c8c7c07dd4a04a957e842a
parent70f4194508a971101163af3e4dc02438a83b68c9 (diff)
downloademacs-78ddc123db626d7475df907bd87b7f2c3d0c1e84.tar.gz
emacs-78ddc123db626d7475df907bd87b7f2c3d0c1e84.zip
(view-remove-frame-by-deleting): Change default value to t.
Add autoload cookie. (view-exit-action, view-file, view-file-other-window) (view-file-other-frame, view-buffer, view-buffer-other-window) (view-buffer-other-frame): Rewrite doc strings. (view-return-to-alist-update): New function to remove stale entries from view-return-to-alist. (view-mode-enter): Rewrite doc string and simplify code. (view-mode-exit): Handle new case 'keep-frame. Don't reset view-exit-action to nil. Simplify code and rewrite doc string.
-rw-r--r--lisp/view.el347
1 files changed, 204 insertions, 143 deletions
diff --git a/lisp/view.el b/lisp/view.el
index c152383a48b..ad6ca9371b8 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -77,11 +77,15 @@ for all scroll commands in view mode."
77 :type 'boolean 77 :type 'boolean
78 :group 'view) 78 :group 'view)
79 79
80(defcustom view-remove-frame-by-deleting nil 80;;;###autoload
81(defcustom view-remove-frame-by-deleting t
81 "*Determine how View mode removes a frame no longer needed. 82 "*Determine how View mode removes a frame no longer needed.
82If nil, make an icon of the frame. If non-nil, delete the frame." 83If nil, make an icon of the frame. If non-nil, delete the frame."
83 :type 'boolean 84 :type 'boolean
84 :group 'view) 85 :group 'view
86 ;; Changed the default of this to t for Emacs 23. Users consider
87 ;; frame iconification annoying.
88 :version "23.1")
85 89
86(defcustom view-exits-all-viewing-windows nil 90(defcustom view-exits-all-viewing-windows nil
87 "*Non-nil means restore all windows used to view buffer. 91 "*Non-nil means restore all windows used to view buffer.
@@ -146,10 +150,11 @@ See RETURN-TO-ALIST argument of function `view-mode-exit' for the format of
146(put 'view-return-to-alist 'permanent-local t) 150(put 'view-return-to-alist 'permanent-local t)
147 151
148(defvar view-exit-action nil 152(defvar view-exit-action nil
149 "nil or a function with one argument (a buffer) called when finished viewing. 153 "If non-nil, a function with one argument (a buffer) called when finished viewing.
150This is local in each buffer being viewed. 154Commands like \\[view-file] and \\[view-file-other-window] may
151The \\[view-file] and \\[view-file-other-window] commands may set this to 155set this to bury or kill the viewed buffer.
152`kill-buffer'.") 156Observe that the buffer viewed might not appear in any window at
157the time this function is called.")
153(make-variable-buffer-local 'view-exit-action) 158(make-variable-buffer-local 'view-exit-action)
154 159
155(defvar view-no-disable-on-exit nil 160(defvar view-no-disable-on-exit nil
@@ -241,11 +246,11 @@ This is local in each buffer, once it is used.")
241;;;###autoload 246;;;###autoload
242(defun view-file (file) 247(defun view-file (file)
243 "View FILE in View mode, returning to previous buffer when done. 248 "View FILE in View mode, returning to previous buffer when done.
244Emacs commands editing the buffer contents are not available; instead, 249Emacs commands editing the buffer contents are not available; instead, a
245a special set of commands (mostly letters and punctuation) 250special set of commands (mostly letters and punctuation) are defined for
246are defined for moving around in the buffer. 251moving around in the buffer.
247Space scrolls forward, Delete scrolls backward. 252Space scrolls forward, Delete scrolls backward.
248For list of all View commands, type H or h while viewing. 253For a list of all View commands, type H or h while viewing.
249 254
250This command runs the normal hook `view-mode-hook'." 255This command runs the normal hook `view-mode-hook'."
251 (interactive "fView file: ") 256 (interactive "fView file: ")
@@ -263,12 +268,12 @@ This command runs the normal hook `view-mode-hook'."
263;;;###autoload 268;;;###autoload
264(defun view-file-other-window (file) 269(defun view-file-other-window (file)
265 "View FILE in View mode in another window. 270 "View FILE in View mode in another window.
266Return that window to its previous buffer when done. 271Return that window to its previous buffer when done. Emacs commands
267Emacs commands editing the buffer contents are not available; instead, 272editing the buffer contents are not available; instead, a special set of
268a special set of commands (mostly letters and punctuation) 273commands (mostly letters and punctuation) are defined for moving around
269are defined for moving around in the buffer. 274in the buffer.
270Space scrolls forward, Delete scrolls backward. 275Space scrolls forward, Delete scrolls backward.
271For list of all View commands, type H or h while viewing. 276For a list of all View commands, type H or h while viewing.
272 277
273This command runs the normal hook `view-mode-hook'." 278This command runs the normal hook `view-mode-hook'."
274 (interactive "fIn other window view file: ") 279 (interactive "fIn other window view file: ")
@@ -281,11 +286,11 @@ This command runs the normal hook `view-mode-hook'."
281(defun view-file-other-frame (file) 286(defun view-file-other-frame (file)
282 "View FILE in View mode in another frame. 287 "View FILE in View mode in another frame.
283Maybe delete other frame and/or return to previous buffer when done. 288Maybe delete other frame and/or return to previous buffer when done.
284Emacs commands editing the buffer contents are not available; instead, 289Emacs commands editing the buffer contents are not available; instead, a
285a special set of commands (mostly letters and punctuation) 290special set of commands (mostly letters and punctuation) are defined for
286are defined for moving around in the buffer. 291moving around in the buffer.
287Space scrolls forward, Delete scrolls backward. 292Space scrolls forward, Delete scrolls backward.
288For list of all View commands, type H or h while viewing. 293For a list of all View commands, type H or h while viewing.
289 294
290This command runs the normal hook `view-mode-hook'." 295This command runs the normal hook `view-mode-hook'."
291 (interactive "fIn other frame view file: ") 296 (interactive "fIn other frame view file: ")
@@ -298,18 +303,17 @@ This command runs the normal hook `view-mode-hook'."
298;;;###autoload 303;;;###autoload
299(defun view-buffer (buffer &optional exit-action) 304(defun view-buffer (buffer &optional exit-action)
300 "View BUFFER in View mode, returning to previous buffer when done. 305 "View BUFFER in View mode, returning to previous buffer when done.
301Emacs commands editing the buffer contents are not available; instead, 306Emacs commands editing the buffer contents are not available; instead, a
302a special set of commands (mostly letters and punctuation) 307special set of commands (mostly letters and punctuation) are defined for
303are defined for moving around in the buffer. 308moving around in the buffer.
304Space scrolls forward, Delete scrolls backward. 309Space scrolls forward, Delete scrolls backward.
305For list of all View commands, type H or h while viewing. 310For a list of all View commands, type H or h while viewing.
306 311
307This command runs the normal hook `view-mode-hook'. 312This command runs the normal hook `view-mode-hook'.
308 313
309Optional argument EXIT-ACTION is either nil or a function with buffer as 314Optional argument EXIT-ACTION is either nil or a function with buffer as
310argument. This function is called when finished viewing buffer. 315argument. This function is called when finished viewing buffer. Use
311Use this argument instead of explicitly setting `view-exit-action'." 316this argument instead of explicitly setting `view-exit-action'."
312
313 (interactive "bView buffer: ") 317 (interactive "bView buffer: ")
314 (let ((undo-window (list (window-buffer) (window-start) (window-point)))) 318 (let ((undo-window (list (window-buffer) (window-start) (window-point))))
315 (switch-to-buffer buffer) 319 (switch-to-buffer buffer)
@@ -319,18 +323,18 @@ Use this argument instead of explicitly setting `view-exit-action'."
319;;;###autoload 323;;;###autoload
320(defun view-buffer-other-window (buffer &optional not-return exit-action) 324(defun view-buffer-other-window (buffer &optional not-return exit-action)
321 "View BUFFER in View mode in another window. 325 "View BUFFER in View mode in another window.
322Return to previous buffer when done, unless optional NOT-RETURN is non-nil. 326Return to previous buffer when done, unless optional NOT-RETURN is
323Emacs commands editing the buffer contents are not available; instead, 327non-nil. Emacs commands editing the buffer contents are not available;
324a special set of commands (mostly letters and punctuation) 328instead, a special set of commands (mostly letters and punctuation) are
325are defined for moving around in the buffer. 329defined for moving around in the buffer.
326Space scrolls forward, Delete scrolls backward. 330Space scrolls forward, Delete scrolls backward.
327For list of all View commands, type H or h while viewing. 331For a list of all View commands, type H or h while viewing.
328 332
329This command runs the normal hook `view-mode-hook'. 333This command runs the normal hook `view-mode-hook'.
330 334
331Optional argument EXIT-ACTION is either nil or a function with buffer as 335Optional argument EXIT-ACTION is either nil or a function with buffer as
332argument. This function is called when finished viewing buffer. 336argument. This function is called when finished viewing buffer. Use
333Use this argument instead of explicitly setting `view-exit-action'." 337this argument instead of explicitly setting `view-exit-action'."
334 (interactive "bIn other window view buffer:\nP") 338 (interactive "bIn other window view buffer:\nP")
335 (let* ((win ; This window will be selected by 339 (let* ((win ; This window will be selected by
336 (get-lru-window)) ; switch-to-buffer-other-window below. 340 (get-lru-window)) ; switch-to-buffer-other-window below.
@@ -350,18 +354,18 @@ Use this argument instead of explicitly setting `view-exit-action'."
350;;;###autoload 354;;;###autoload
351(defun view-buffer-other-frame (buffer &optional not-return exit-action) 355(defun view-buffer-other-frame (buffer &optional not-return exit-action)
352 "View BUFFER in View mode in another frame. 356 "View BUFFER in View mode in another frame.
353Return to previous buffer when done, unless optional NOT-RETURN is non-nil. 357Return to previous buffer when done, unless optional NOT-RETURN is
354Emacs commands editing the buffer contents are not available; instead, 358non-nil. Emacs commands editing the buffer contents are not available;
355a special set of commands (mostly letters and punctuation) 359instead, a special set of commands (mostly letters and punctuation) are
356are defined for moving around in the buffer. 360defined for moving around in the buffer.
357Space scrolls forward, Delete scrolls backward. 361Space scrolls forward, Delete scrolls backward.
358For list of all View commands, type H or h while viewing. 362For a list of all View commands, type H or h while viewing.
359 363
360This command runs the normal hook `view-mode-hook'. 364This command runs the normal hook `view-mode-hook'.
361 365
362Optional argument EXIT-ACTION is either nil or a function with buffer as 366Optional argument EXIT-ACTION is either nil or a function with buffer as
363argument. This function is called when finished viewing buffer. 367argument. This function is called when finished viewing buffer. Use
364Use this argument instead of explicitly setting `view-exit-action'." 368this argument instead of explicitly setting `view-exit-action'."
365 (interactive "bView buffer in other frame: \nP") 369 (interactive "bView buffer in other frame: \nP")
366 (let ((return-to 370 (let ((return-to
367 (and (not not-return) (cons (selected-window) t)))) ; Old window. 371 (and (not not-return) (cons (selected-window) t)))) ; Old window.
@@ -495,34 +499,73 @@ Entry to view-mode runs the normal hook `view-mode-hook'."
495 (setq buffer-read-only view-old-buffer-read-only))) 499 (setq buffer-read-only view-old-buffer-read-only)))
496 500
497;;;###autoload 501;;;###autoload
498(defun view-mode-enter (&optional return-to exit-action) "\ 502(defun view-return-to-alist-update (buffer &optional item)
499Enter View mode and set up exit from view mode depending on optional arguments. 503 "Update `view-return-to-alist' of buffer BUFFER.
500If RETURN-TO is non-nil it is added as an element to the buffer local alist 504Remove from `view-return-to-alist' all entries referencing dead
501`view-return-to-alist'. 505windows. Optional argument ITEM non-nil means add ITEM to
502Save EXIT-ACTION in buffer local variable `view-exit-action'. 506`view-return-to-alist' after purging. For a decsription of items
503It should be either nil or a function that takes a buffer as argument. 507that can be added see the RETURN-TO-ALIST argument of the
504This function will be called by `view-mode-exit'. 508function `view-mode-exit'. If `view-return-to-alist' contains an
505 509entry for the selected window, purge that entry from
506RETURN-TO is either nil, meaning do nothing when exiting view mode, or 510`view-return-to-alist' before adding ITEM."
507it has the format (WINDOW OLD-WINDOW . OLD-BUF-INFO). 511 (with-current-buffer buffer
508WINDOW is a window used for viewing. 512 (when view-return-to-alist
509OLD-WINDOW is nil or the window to select after viewing. 513 (let* ((list view-return-to-alist)
510OLD-BUF-INFO tells what to do with WINDOW when exiting. It is one of: 514 entry entry-window last)
5111) nil Do nothing. 515 (while list
5122) t Delete WINDOW or, if it is the only window, its frame. 516 (setq entry (car list))
517 (setq entry-window (car entry))
518 (if (and (windowp entry-window)
519 (or (and item (eq entry-window (selected-window)))
520 (not (window-live-p entry-window))))
521 ;; Remove that entry.
522 (if last
523 (setcdr last (cdr list))
524 (setq view-return-to-alist
525 (cdr view-return-to-alist)))
526 ;; Leave entry alone.
527 (setq last entry))
528 (setq list (cdr list)))))
529 ;; Add ITEM.
530 (when item
531 (setq view-return-to-alist
532 (cons item view-return-to-alist)))))
533
534;;;###autoload
535(defun view-mode-enter (&optional return-to exit-action)
536 "Enter View mode and set up exit from view mode depending on optional arguments.
537RETURN-TO non-nil means add RETURN-TO as an element to the buffer
538local alist `view-return-to-alist'. Save EXIT-ACTION in buffer
539local variable `view-exit-action'. It should be either nil or a
540function that takes a buffer as argument. This function will be
541called by `view-mode-exit'.
542
543RETURN-TO is either nil, meaning do nothing when exiting view
544mode, or must have the format (WINDOW OLD-WINDOW . OLD-BUF-INFO).
545WINDOW is the window used for viewing. OLD-WINDOW is nil or the
546window to select after viewing. OLD-BUF-INFO tells what to do
547with WINDOW when exiting. It is one of:
5481) nil Do nothing.
5492) t Delete WINDOW or, if it is the only window and
550 `view-remove-frame-by-deleting' is non-nil, its
551 frame.
5133) (OLD-BUFF START POINT) Display buffer OLD-BUFF with displayed text 5523) (OLD-BUFF START POINT) Display buffer OLD-BUFF with displayed text
514 starting at START and point at POINT in WINDOW. 553 starting at START and point at POINT in WINDOW.
5154) quit-window Do `quit-window' in WINDOW. 5544) quit-window Do `quit-window' in WINDOW.
5555) keep-frame Like case 2) but do not delete the frame.
516 556
517For list of all View commands, type H or h while viewing. 557For a list of all View commands, type H or h while viewing.
518 558
519This function runs the normal hook `view-mode-hook'." 559This function runs the normal hook `view-mode-hook'."
520 (if return-to 560 (when return-to
521 (let ((entry (assq (car return-to) view-return-to-alist))) 561 (let ((entry (assq (car return-to) view-return-to-alist)))
522 (if entry (setcdr entry (cdr return-to)) 562 (if entry
523 (setq view-return-to-alist (cons return-to view-return-to-alist))))) 563 (setcdr entry (cdr return-to))
524 (if exit-action (setq view-exit-action exit-action)) 564 (setq view-return-to-alist (cons return-to view-return-to-alist)))))
525 (unless view-mode ; Do nothing if already in view mode. 565 (when exit-action
566 (setq view-exit-action exit-action))
567
568 (unless view-mode
526 (view-mode-enable) 569 (view-mode-enable)
527 (force-mode-line-update) 570 (force-mode-line-update)
528 (unless view-inhibit-help-message 571 (unless view-inhibit-help-message
@@ -532,88 +575,106 @@ View mode: type \\[help-command] for help, \\[describe-mode] for commands, \\[Vi
532 575
533(defun view-mode-exit (&optional return-to-alist exit-action all-win) 576(defun view-mode-exit (&optional return-to-alist exit-action all-win)
534 "Exit View mode in various ways, depending on optional arguments. 577 "Exit View mode in various ways, depending on optional arguments.
535RETURN-TO-ALIST, EXIT-ACTION and ALL-WIN determine what to do after exit. 578RETURN-TO-ALIST, EXIT-ACTION and ALL-WIN determine what to do
536EXIT-ACTION is nil or a function that is called with current buffer as 579after exit. EXIT-ACTION is nil or a function that is called with
537argument. 580current buffer as argument.
538RETURN-TO-ALIST is an alist that for some of the windows displaying the 581
539current buffer, associate information on what to do with those windows. 582RETURN-TO-ALIST is an alist that, for some of the windows
540If ALL-WIN or the variable `view-exits-all-viewing-windows' is non-nil, 583displaying the current buffer, maintains information on what to
541then all windows on RETURN-TO-ALIST are restored to their old state. 584do when exiting those windows. If ALL-WIN is non-nil or the
542Otherwise only the selected window is affected (if it is on RETURN-TO-ALIST). 585variable `view-exits-all-viewing-windows' is non-nil,
543 586view-mode-exit attempts to restore all windows showing the
544Elements of RETURN-TO-ALIST have the format (WINDOW OLD-WINDOW . OLD-BUF-INFO). 587current buffer to their old state. Otherwise, only the selected
545WINDOW is a window displaying the current buffer. 588window is affected (provided it is on RETURN-TO-ALIST).
546OLD-WINDOW is nil or a window to select after viewing. 589
547OLD-BUF-INFO is information on what to do with WINDOW and is one of: 590Elements of RETURN-TO-ALIST must have the format
5481) nil Do nothing. 591 (WINDOW OLD-WINDOW . OLD-BUF-INFO) where
5492) t Delete WINDOW and, if it is the only window, its frame. 592
593WINDOW is a window displaying the current buffer and OLD-WINDOW
594is either nil or a window to select after viewing. OLD-BUF-INFO
595provides information on what to do with WINDOW and may be one of:
5961) nil Do nothing.
5972) t Delete WINDOW and, if it is the only window and
598 `view-remove-frame-by-deleting' is non-nil, its
599 frame.
5503) (OLD-BUF START POINT) Display buffer OLD-BUF with displayed text 6003) (OLD-BUF START POINT) Display buffer OLD-BUF with displayed text
551 starting at START and point at POINT in WINDOW. 601 starting at START and point at POINT in WINDOW.
5524) quit-window Do `quit-window' in WINDOW. 6024) quit-window Do `quit-window' in WINDOW.
553 6035) keep-frame Like case 2) but do not delete the frame.
554If one of the WINDOW in RETURN-TO-ALIST is the selected window and the 604
555corresponding OLD-WINDOW is a live window, then select OLD-WINDOW." 605If one of the WINDOW in RETURN-TO-ALIST is the selected window
556 (setq all-win 606and the corresponding OLD-WINDOW is a live window, then select
557 (and return-to-alist (or all-win view-exits-all-viewing-windows))) 607OLD-WINDOW."
558 (if view-mode ; Only do something if in view mode. 608 (when view-mode ; Only do something if in view mode.
559 (let* ((buffer (current-buffer)) 609 (setq all-win
560 window notlost 610 (and return-to-alist
561 (sel-old (assq (selected-window) return-to-alist)) 611 (or all-win view-exits-all-viewing-windows)))
562 (alist (cond 612 (let* ((buffer (current-buffer))
563 (all-win ; Try to restore all windows. 613 window notlost
564 (append return-to-alist nil)) ; Copy. 614 (sel-old (assq (selected-window) return-to-alist))
565 (sel-old ; Only selected window. 615 (alist (cond
566 (list sel-old)))) 616 (all-win ; Try to restore all windows.
567 (old-window (if sel-old (car (cdr sel-old))))) 617 (append return-to-alist nil)) ; Copy.
568 (if all-win ; Follow chains of old-windows. 618 (sel-old ; Only selected window.
569 (let ((c (length alist)) a) 619 (list sel-old))))
570 (while (and (> c 0) ; Safety if mutually refering windows. 620 (old-window (if sel-old (car (cdr sel-old)))))
571 (or (not (window-live-p old-window)) 621 (if all-win ; Follow chains of old-windows.
572 (eq buffer (window-buffer old-window))) 622 (let ((c (length alist)) a)
573 (setq a (assq old-window alist))) 623 (while (and (> c 0) ; Safety if mutually refering windows.
574 (setq c (1- c)) 624 (or (not (window-live-p old-window))
575 (setq old-window (car (cdr a)))) 625 (eq buffer (window-buffer old-window)))
576 (if (or (zerop c) (not (window-live-p old-window))) 626 (setq a (assq old-window alist)))
577 (setq old-window (selected-window))))) 627 (setq c (1- c))
578 (or view-no-disable-on-exit 628 (setq old-window (car (cdr a))))
579 (view-mode-disable)) 629 (if (or (zerop c) (not (window-live-p old-window)))
580 (while alist ; Restore windows with info. 630 (setq old-window (selected-window)))))
581 (setq notlost nil) 631 (unless view-no-disable-on-exit
582 (if (and (window-live-p (setq window (car (car alist)))) 632 (view-mode-disable))
633 (while alist ; Restore windows with info.
634 (setq notlost nil)
635 (when (and (window-live-p (setq window (car (car alist))))
583 (eq buffer (window-buffer window))) 636 (eq buffer (window-buffer window)))
584 (let ((frame (window-frame window)) 637 (let ((frame (window-frame window))
585 (old-buf-info (cdr (cdr (car alist))))) 638 (old-buf-info (cdr (cdr (car alist)))))
586 (if all-win (select-window window)) 639 (if all-win (select-window window))
587 (cond 640 (cond
588 ((and (consp old-buf-info) ; Case 3. 641 ((and (consp old-buf-info) ; Case 3.
589 (buffer-live-p (car old-buf-info))) 642 (buffer-live-p (car old-buf-info)))
590 (set-window-buffer window (car old-buf-info)) ; old-buf 643 (set-window-buffer window (car old-buf-info)) ; old-buf
591 (set-window-start window (car (cdr old-buf-info))) 644 (set-window-start window (car (cdr old-buf-info)))
592 (set-window-point window (car (cdr (cdr old-buf-info))))) 645 (set-window-point window (car (cdr (cdr old-buf-info)))))
593 ((eq old-buf-info 'quit-window) 646 ((eq old-buf-info 'quit-window)
594 (quit-window)) ; Case 4. 647 (quit-window)) ; Case 4.
595 ((not (eq old-buf-info t)) nil) ; Not case 2, do nothing. 648 (old-buf-info ; Case 2 or 5.
596 ((not (one-window-p t)) (delete-window)) 649 (cond
597 ((not (eq frame (next-frame))) 650 ((not (one-window-p t)) ; Not only window.
598 ;; Not the only frame, so can safely be removed. 651 (delete-window))
599 (if view-remove-frame-by-deleting 652 ((eq old-buf-info 'keep-frame) ; Case 5.
600 (delete-frame frame) 653 (bury-buffer))
601 (setq notlost t) ; Keep the window. See below. 654 ((not (eq frame (next-frame))) ; Case 2 and only window.
602 (iconify-frame frame)))))) 655 ;; Not the only frame, so can safely be removed.
603 ;; If a frame is removed by iconifying it, then the window is not 656 (if view-remove-frame-by-deleting
604 ;; really lost. In this case we keep the entry in 657 (delete-frame frame)
605 ;; view-return-to-alist so that if the user deiconifies the frame 658 (setq notlost t) ; Keep the window. See below.
606 ;; and then press q, then the frame is iconified again. 659 (iconify-frame frame))))))))
607 (unless notlost 660 ;; If a frame is removed by iconifying it, the window is not
661 ;; really lost. In this case we keep the entry in
662 ;; `view-return-to-alist' so that if the user deiconifies the
663 ;; frame and then hits q, the frame is iconified again.
664 (unless notlost
665 (with-current-buffer buffer
608 (setq view-return-to-alist 666 (setq view-return-to-alist
609 (delete (car alist) view-return-to-alist))) 667 (delete (car alist) view-return-to-alist))))
610 (setq alist (cdr alist))) 668 (setq alist (cdr alist)))
611 (if (window-live-p old-window) ; still existing window 669 (when (window-live-p old-window)
612 (select-window old-window)) 670 ;; old-window is still alive => select it.
613 (when exit-action 671 (select-window old-window))
614 (setq view-exit-action nil) 672 (when exit-action
615 (funcall exit-action buffer)) 673 ;; Don't do that: If the user wants to quit the *Help* buffer a
616 (force-mode-line-update)))) 674 ;; second time it won't have any effect.
675;;; (setq view-exit-action nil)
676 (funcall exit-action buffer))
677 (force-mode-line-update))))
617 678
618(defun View-exit () 679(defun View-exit ()
619 "Exit View mode but stay in current buffer." 680 "Exit View mode but stay in current buffer."