Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site dartvax.UUCP Path: utzoo!linus!decvax!dartvax!karl From: karl@dartvax.UUCP (S. Delage.) Newsgroups: net.emacs Subject: Lining a function up. Message-ID: <1921@dartvax.UUCP> Date: Mon, 25-Jun-84 11:56:03 EDT Article-I.D.: dartvax.1921 Posted: Mon Jun 25 11:56:03 1984 Date-Received: Wed, 27-Jun-84 03:13:45 EDT Organization: Dartmouth College Lines: 40 Recently someone asked about getting line numbers in Emacs. ( I don't recall who. ) Someone else ( ditto ) answered for CCA Emacs, which has a variable. Gosling Emacs doesn't, but at the end of this article is a function that computes the current line. ( Albeit slowly. ) I have two questions, as well. 1. Is it possible to bind-to-key not just a function invocation but a function invocation with argument? For example, (bind-to-key "function-name first-arg" "\^C") 2. Is it possible to input a variable-name from the keyboard ( via get-tty-variable, most likely. ) and then use that variable's value somehow? Something like (setq var (get-tty-variable "Variable name? ") ) gives the string he inputs, so that var = "variable-name". What I want is for var to be the variable variable-name, which has some other value. Thanks for your consideration. karl@dartmouth = {decvax,cornell,astrovax,uvm-gen,colby}!dartvax!colby ; This returns the number indicating what line dot is on in the ; current buffer. (defun (current-line-number line (save-excursion (set-mark) (beginning-of-file) (narrow-region) ; Now we're only looking at the first N lines. (setq line 1) (end-of-line) (while (! (eobp)) (setq line (+ line 1)) (next-line) ) ) (widen-region) ; Put back the rest of the file. line ) )