From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Temporary notes in Emacs buffers? Date: Sun, 12 Jan 2020 08:37:30 -0800 (PST) Message-ID: <7e7f3455-ce74-41df-a5a3-ce510063198d@default> References: <87zhfecbpt.fsf@mbork.pl> <87sgl0osts.fsf@web.de> <65742f83-393a-4df2-9562-7c500b40adcd@default> <87a777ydnh.fsf@web.de> <73dc0d0e-f208-4169-a70d-f2f17994a4f4@default> <87sgkmla13.fsf@web.de> <87lfqdxha4.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="259998"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Help Gnu Emacs mailing list To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 12 17:39:09 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iqgFa-000nQg-Hy for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 12 Jan 2020 17:38:06 +0100 Original-Received: from localhost ([::1]:40012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iqgFY-000794-W2 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 12 Jan 2020 11:38:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45168) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iqgF8-00078u-K0 for help-gnu-emacs@gnu.org; Sun, 12 Jan 2020 11:37:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iqgF7-0004u8-AM for help-gnu-emacs@gnu.org; Sun, 12 Jan 2020 11:37:38 -0500 Original-Received: from userp2120.oracle.com ([156.151.31.85]:48652) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iqgF7-0004oj-13 for help-gnu-emacs@gnu.org; Sun, 12 Jan 2020 11:37:37 -0500 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00CGX7GH050210; Sun, 12 Jan 2020 16:37:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=EFihEQ1V7pBiip/3pejzknbIDYogflSWOZcwVuGU6uY=; b=idk+TCndU39U9od4Zj8rg0LCQ0Dt+KrV/mlXLtO5IYY+4EsMYAxyti5t12oe42K91eJa So4aYRyuha4XzBKRAJk5D9mJ1Meiasp+SG4fg0RU/V/2snAYvECC7WvhM/tIFL4nHZf2 QiuoR2DQBXjAvwVxbw0yxCgqXWFHMtr6u87LYWslXkvB/MrCs3v5YJMWsuTnz8vOK41p kTRnbaHcioHQkZx1KE2X6hlpiQSgzV7N9u/bXzkBwsqWfGoA8dEUfaAPH7OkMhtIiWSw CZhVMDAVU91HZCiayEeQNoEpAWlKa2xRJgHfLUrmPFKU+0O1TJukcp17y/2xSO7j/nGW 2w== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2xf73y3ku6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 12 Jan 2020 16:37:32 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00CGYCKe059280; Sun, 12 Jan 2020 16:37:32 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2xfrgg9sjx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 12 Jan 2020 16:37:32 +0000 Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 00CGbVcB003827; Sun, 12 Jan 2020 16:37:31 GMT In-Reply-To: <87lfqdxha4.fsf@web.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4939.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9498 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=997 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001120157 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9498 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001120157 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.85 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:122210 Archived-At: > I tried to make a file use a separate bookmark file (for only this > file's bookmarks) and specify the location of that bookmark file as a > file local variable, somehow. How would you do that with vanilla > bookmarks? I'm no expert on file-local variables. Looking at the doc for them, and throwing something together quickly, does this help? (defun create-bmk-file-for-file (bookmark-file target-file) "Create a new, empty BOOKMARK-FILE for TARGET-FILE." (interactive "FCreate bookmark file: \nFTarget file: ") (require 'bookmark) (let ((bookmark-alist ())) (let ((baud-rate 0)) (bookmark-write-file bookmark-file)) (with-current-buffer (find-file-noselect target-file) (add-file-local-variable 'local-bookmark-file bookmark-file) (save-buffer)))) (defun switch-to-local-bookmark-file () "Switch to local bookmark file for current file." (interactive) (hack-local-variables) (let ((bfile local-bookmark-file)) (bookmark-load bfile 'SWITCH))) `create-*' creates a new, empty BOOKMARK-FILE, and it adds its name to the file-local variables of the TARGET-FILE. `switch-*' should be used when visiting TARGET-FILE. It switches the current bookmark file to BOOKMARK-FILE.