yatex

diff yatexlib.el @ 52:5d94deabb9f9

Set YaTeX-indent-line to 'indent-line-function. Revise fill features.
author yuuji
date Sun, 22 Jan 1995 14:20:46 +0000
parents b0371b6ed799
children 5f4b18da14b3
line diff
     1.1 --- a/yatexlib.el	Tue Dec 20 21:00:21 1994 +0000
     1.2 +++ b/yatexlib.el	Sun Jan 22 14:20:46 1995 +0000
     1.3 @@ -1,8 +1,8 @@
     1.4  ;;; -*- Emacs-Lisp -*-
     1.5  ;;; YaTeX library of general functions.
     1.6  ;;; yatexlib.el
     1.7 -;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
     1.8 -;;; Last modified Wed Dec 21 05:58:06 1994 on landcruiser
     1.9 +;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    1.10 +;;; Last modified Sun Jan 22 23:15:03 1995 on landcruiser
    1.11  ;;; $Id$
    1.12  
    1.13  ;;;###autoload
    1.14 @@ -46,17 +46,19 @@
    1.15    "Switch to buffer if buffer exists, find file if not.
    1.16  Optional second arg SETBUF t make use set-buffer instead of switch-to-buffer."
    1.17    (interactive "Fswitch to file: ")
    1.18 -  (let (buf)
    1.19 -    (if (setq buf (get-file-buffer file))
    1.20 -	(progn
    1.21 -	  (funcall (if setbuf 'set-buffer 'switch-to-buffer)
    1.22 -		   (get-file-buffer file))
    1.23 -	  buf)
    1.24 -      (if (file-exists-p file)
    1.25 -	  (or ;find-file returns nil but set current-buffer...
    1.26 -	   (funcall (if setbuf 'find-file-noselect 'find-file) file)
    1.27 -	   (current-buffer))
    1.28 -	(message "%s was not found in this directory." file)
    1.29 +  (if (bufferp file) (setq file (buffer-file-name file)))
    1.30 +  (let (buf (hilit-auto-highlight (not setbuf)))
    1.31 +    (cond
    1.32 +     ((setq buf (get-file-buffer file))
    1.33 +      (funcall (if setbuf 'set-buffer 'switch-to-buffer)
    1.34 +	       (get-file-buffer file))
    1.35 +      buf)
    1.36 +     ((or YaTeX-create-file-prefix-g (file-exists-p file))
    1.37 +      (or ;find-file returns nil but set current-buffer...
    1.38 +       (if setbuf (set-buffer (find-file-noselect file))
    1.39 +	 (find-file file))
    1.40 +       (current-buffer)))
    1.41 +     (t (message "%s was not found in this directory." file)
    1.42  	nil)))
    1.43  )
    1.44  
    1.45 @@ -64,11 +66,14 @@
    1.46  (defun YaTeX-switch-to-buffer-other-window (file)
    1.47    "Switch to buffer if buffer exists, find file if not."
    1.48    (interactive "Fswitch to file: ")
    1.49 -  (if (get-file-buffer file)
    1.50 -      (progn (switch-to-buffer-other-window (get-file-buffer file)) t)
    1.51 -    (if (file-exists-p file)
    1.52 -	(progn (find-file-other-window file) t)
    1.53 -      (message "%s was not found in this directory." file)
    1.54 +  (if (bufferp file) (setq file (buffer-file-name file)))
    1.55 +  (cond
    1.56 +   ((get-file-buffer file)
    1.57 +    (switch-to-buffer-other-window (get-file-buffer file))
    1.58 +    t)
    1.59 +   ((or YaTeX-create-file-prefix-g (file-exists-p file))
    1.60 +    (find-file-other-window file) t)
    1.61 +   (t (message "%s was not found in this directory." file)
    1.62        nil))
    1.63  )
    1.64  
    1.65 @@ -293,6 +298,7 @@
    1.66  (defun goto-buffer-window (buffer)
    1.67    "Select window which is bound to BUFFER.
    1.68  If no such window exist, switch to buffer BUFFER."
    1.69 +  (interactive "BGoto buffer: ")
    1.70    (if (stringp buffer)
    1.71        (setq buffer (or (get-file-buffer buffer) (get-buffer buffer))))
    1.72    (if (get-buffer buffer)