Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!shelby!csli!rustcat From: rustcat@csli.STANFORD.EDU (Vallury Prabhakar) Newsgroups: comp.emacs Subject: Question regarding next-line Keywords: Possibly naive question Message-ID: <8363@csli.STANFORD.EDU> Date: 3 Apr 89 02:56:17 GMT Sender: rustcat@csli.Stanford.EDU (Vallury Prabhakar) Reply-To: rustcat@csli.stanford.edu (Vallury Prabhakar) Distribution: usa Organization: Stanford University Lines: 42 My apologies if this is a silly question. I'm not very thorough on e-lisp. I was playing around with e-lisp to write a line-number indicator in the mode-line and discovered the following documentation for the function next-line. ----------------------------------------------------------------------------- describe-key: C-n next-line: Move cursor vertically down ARG lines. If there is no character in the target line exactly under the current column, the cursor is positioned after the character in that line which spans this column, or at the end of the line if it is not long enough. *** If there is no line in the buffer after this one, *** a newline character is inserted to create a line *** and the cursor moves to that line. [My ***] ----------------------------------------------------------------------------- My questions are: 1) Why is that the above function next-line inserts a newline character if there is no line following it in the buffer? I had some trouble with it but managed to work around the problem. Still I'm still curious to know why next-line is different from say, forward-char (which doesn't insert a space if necessary) in this respect? I would've thought that an "End of buffer" warning would result in trying to move past (point-max). 2) How do I go about loading a function or a file of functions each time the current buffer is changed? That is, I would like these functions to be executed from scratch each time a new file is read into the buffer. GNUemacs V18.50.3 on BSD 4.2 Thank you. -- Vallury Prabhakar -- rustcat@csli.stanford.edu