From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id qHTOLetk6WYjKAEA62LTzQ:P1 (envelope-from ) for ; Tue, 17 Sep 2024 11:15:55 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id qHTOLetk6WYjKAEA62LTzQ (envelope-from ) for ; Tue, 17 Sep 2024 13:15:55 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Ik2DQDbD; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726571755; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=jE5qkuJGEyhAQG9y2PUGULXFzhEr1jau/LXrvMPU6To=; b=R4/StwMCHF1qSwkjVySgbE8NIYs/CPkz36oghpn6AB1qogRDzmEO1DaJsA1drD3hatnk7c jZ65q7rNCjzQT2lUlDjZmwV1M6hEDdqe9eJ0OvrmdUOpoSDeAup9FCFz/fn18Ufiqoihem T4aun6oTn5D/lsSPXCLw9JYW0uGQ6e43rgL+wjDC4LgH01v+10fHIfHnU4U0oKe/dNlp/w nakRZSmSfFWW/zZ2tfgMmuZC3Ds6T1nYYfjvJgBH76phgvJMcTDIRRB1sxvvjR0dHChSWP 4izGG8I5vrbpwIPLtLrf2acaesV+lhm+aCaVYnlWTfV8D3RY8aKy1urPSkvETw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Ik2DQDbD; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726571755; a=rsa-sha256; cv=none; b=Ne2kND2DFnQ8PIzHkcFaBricbwDgkkpvsRQyesLiNiolYxGMe8ETvX1XBYj1C1dUlcgATO ekKV8+pjddx/+9ZYKL1ZNuzXFemA8w9gd6/05v3gVDuk3EUzhYdd+DGlGBQf8QGDGyl+pD 5HBlxL5C5hktvPJ7ZY6eeoSQgRMZ93kt1bv1vDWb2zozQNVqVbQ6S1tQj15RYtUPbtoLGF vQR5qxI51vZO774f36kqoUrOgoHh8gVCzXOqFYt89wBXvBtJk1MCXwZBgj5zRuZET5MK8N Lg9gB1DJV9O9A4TlRtp7UYZd6PLEu8R+kHMMOyepwvhvgZw1UyLe0k+NfRlrRQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 84DC21019 for ; Tue, 17 Sep 2024 13:15:55 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqWAj-0002RH-6B; Tue, 17 Sep 2024 07:15:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqWAh-0002P5-Eo for emacs-orgmode@gnu.org; Tue, 17 Sep 2024 07:15:03 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sqWAf-00062d-JH for emacs-orgmode@gnu.org; Tue, 17 Sep 2024 07:15:03 -0400 Received: by mail-pg1-x542.google.com with SMTP id 41be03b00d2f7-7c6b4222fe3so3529019a12.3 for ; Tue, 17 Sep 2024 04:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726571699; x=1727176499; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=jE5qkuJGEyhAQG9y2PUGULXFzhEr1jau/LXrvMPU6To=; b=Ik2DQDbDOo6kbSJpbSvDn/s8pfeslekFHvFJbRsvWnGco2cnUff7eRnOlpWRfKgbRZ LC9NTbcYrZRC92Id7yaiehlM0dm1ddtt3JH4A4t4yxXSMUG+9e6nCcL0FAinZLlm+Yw/ 0bdCQ1L598vfeOATZi2VIZkRMJV4XpBQAsFw9iVOyIO1mW0oju5pGRfreBkZdIBCiU5z wPqi22PUt7gShG85Wmo56LFntaygZXKbesX/jvKO2+EH5zEnipEFc9N8pbIwvzMixbhd N7qkJye08a1j5+EBW4/9ES6gHeLe8VObUO6fqmSsrw6lxUbBbmm43ZLNVxoA34sHOFjB Wo0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726571699; x=1727176499; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jE5qkuJGEyhAQG9y2PUGULXFzhEr1jau/LXrvMPU6To=; b=dzgoeHPDEKpA8FCHy+fPelDHt7Ib6BeiY5vDJkrNO3X1GGbywJ/VmaZRAQ2h6Ssz5f uotTlaNZkv1Z6jfnegH3vZnHo6ge/fhcvIEf2PHakyKauxcbJwWZc4PaAnqN6kvTTJWV 7fYIyarVKs1MAVtmBkSINWXAks7FE18cILZ5WhqH1fvpoBi/yKRpeDWiBXH5XtnJQdNn /iGj7p9ZXF0HhVykVw2vS5tdipxBy6LEn4HIf2WhyHDtbEbdg035SrxCOSxklx7KFzP4 NMbbJYVBZvub+s1Xhp/ZgJrldzaGTCisSEX7tNi/hhPgqq4opOCVdq82ORKfCdCIotlM 55wQ== X-Gm-Message-State: AOJu0Yy/FJMl45KJzzWkOzJ860ZTUZUWKyyQtVQadP6NvY33hM4QuV+Z xINoEXC9W7XIA8nfMjlx1Kd1ypJrC/fVJ5fnyYtA1aLfLmrc/NRTWKpYH82d X-Google-Smtp-Source: AGHT+IEs1PEUN9aPrL1VJwZN7cnMOrQoc3/D05rwfIccbBIfyyrO5Iv8aQVCFicNBsPLJPYVJDLcjw== X-Received: by 2002:a17:90a:3ec4:b0:2d8:8509:85d1 with SMTP id 98e67ed59e1d1-2dba00826d9mr18065606a91.38.1726571699398; Tue, 17 Sep 2024 04:14:59 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd50c0ed65sm562884a91.0.2024.09.17.04.14.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 04:14:59 -0700 (PDT) From: Visuwesh To: emacs-orgmode@gnu.org Subject: [BUG] org-id-find might change the major-mode of a buffer [9.8-pre (release_9.7.8-713-g62cbac @ /home/viz/lib/emacs/straight/build/org/)] Date: Tue, 17 Sep 2024 16:44:55 +0530 Message-ID: <87ikuuwmz4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::542; envelope-from=visuweshm@gmail.com; helo=mail-pg1-x542.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 84DC21019 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -9.82 X-Migadu-Spam-Score: -9.82 X-TUID: QjQryijQdiWT Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. ------------------------------------------------------------------------ Hello, I have code in my init that calls org-id-find to get the entry ID refers to. When the ID is non-existent, the function unintentionally changes the major-mode of the current buffer. [ This almost caused me to lose a PDF file, but thankfully I could recover it because of Emacs backup. Admittedly this happened because I was half-panicking and half-confused. ] To reproduce, 1. emacs -Q 2. M-: (require 'org-id) 3. Visit any file (M-x find-library RET org-id RET) 4. M-: (org-id-find "non-existent") 5. Witness the major-mode change This all happens in org-id-find-id-in-file where when VISITING is non-nil, the buffer is (re)used whether or not it was originally in org-mode. The problem is complicated by the use of find-file-noselect when MARKERP argument to org-id-find is non-nil. Perhaps, org-id-find-id-file should check if the current-buffer is derived from org-mode before returning the buffer-file-name. WDYT? Emacs : GNU Emacs 31.0.50 (build 7, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.0, Xaw scroll bars) of 2024-09-09 Package: Org mode version 9.8-pre (release_9.7.8-713-g62cbac @ /home/viz/lib/emacs/straight/build/org/)