From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: sigurd@12move.de (Karl =?iso-8859-1?Q?Pfl=E4sterer?=) Newsgroups: gmane.emacs.help Subject: Re: title function for boxquote Date: Mon, 31 Jan 2005 10:46:06 +0100 Organization: Lemis World Message-ID: References: Reply-To: Karl =?iso-8859-1?Q?Pfl=E4sterer?= NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1107166609 26629 80.91.229.6 (31 Jan 2005 10:16:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 31 Jan 2005 10:16:49 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 31 11:16:43 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CvYbq-0000Rg-00 for ; Mon, 31 Jan 2005 11:16:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CvYoX-00068k-Ek for geh-help-gnu-emacs@m.gmane.org; Mon, 31 Jan 2005 05:29:49 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news-FFM2.ecrc.net!uio.no!quimby.gnus.org!wintendo.pflaesterer.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 51 Original-NNTP-Posting-Host: b81be.b.pppool.de Original-X-Trace: quimby.gnus.org 1107164955 15746 213.7.129.190 (31 Jan 2005 09:49:15 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: Mon, 31 Jan 2005 09:49:15 +0000 (UTC) User-Agent: Gnus/5.110003 (No Gnus v0.3) Hamster/2.0.6.0 Cancel-Lock: sha1:hgk/dnHfefo4Ac0s95CWlFOu1GE= Original-Xref: shelby.stanford.edu gnu.emacs.help:128262 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:23769 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23769 On 30 Jan 2005, sluque@mun.ca wrote: > This should be simple, but I'm flailing badly here. I'm trying to put a title > to a boxquote that has been yanked from a region killed with > boxquote-kill-ring-save. Something that looks like: > > file name [Lines: such -- such] > > So I came up with this, but it doesn't work: > > (defun my-title-function (from to) > "Provide a phrase for boxquote-kill-ring-save-title." > (interactive "r") > (save-restriction > (widen) > (let ((first-line (count-lines (point-min) (from))) ^^^^^^ > (last-line (count-lines (point-min) (to)))) ^^^^ > (concat buffer-name "[Lines: " first-line " -- " last-line "]")))) ^^^^^^^^^^ `from' and `to' are variables but you used them like functions. Furthermore you write it as an interactive function but that function should get called from `boxquote-kill-ring-save'; on the other hand `buffer-name' is a function not a variable. So it could be like that: (defun my-title-function () (save-restriction (widen) (format "%s [Lines: %s --- %s]" (buffer-name) (line-number-at-pos (region-beginning)) (line-number-at-pos (region-end))))) Or you forget about the name and write: (setq boxquote-kill-ring-save-title (lambda () (save-restriction (widen) (format "%s [Lines: %s --- %s]" (buffer-name) (line-number-at-pos (region-beginning)) (line-number-at-pos (region-end)))))) KP