From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QEVuOT7EnmP+VQAAbAwnHQ (envelope-from ) for ; Sun, 18 Dec 2022 08:41:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id IPdtOT7EnmNYzgAA9RJhRA (envelope-from ) for ; Sun, 18 Dec 2022 08:41:50 +0100 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 4AD8D2FF2E for ; Sun, 18 Dec 2022 08:41:50 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6oHq-0005yJ-ET; Sun, 18 Dec 2022 02:40:42 -0500 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 1p6oHo-0005yB-MN for emacs-orgmode@gnu.org; Sun, 18 Dec 2022 02:40:40 -0500 Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6oHm-00051S-FL for emacs-orgmode@gnu.org; Sun, 18 Dec 2022 02:40:40 -0500 Received: from localhost ([::ffff:197.239.7.182]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000055D56.00000000639EC3F4.0000383F; Sun, 18 Dec 2022 00:40:35 -0700 Date: Sun, 18 Dec 2022 10:39:56 +0300 From: Jean Louis To: Tim Cross Cc: emacs-orgmode@gnu.org Subject: Re: Bug: Function org-heading-components is not resilient [9.4.3 (9.4.3-elpa @ /home/data1/protected/.emacs.d/elpa/org-20201216/)] Message-ID: Mail-Followup-To: Tim Cross , emacs-orgmode@gnu.org References: <1d09b04459dbf1a1648d65bd6c372ce7.support1@rcdrun.com> <87iliafj23.fsf@localhost> <86zgbltsgv.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86zgbltsgv.fsf@gmail.com> User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL=0.141, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671349310; a=rsa-sha256; cv=none; b=kW6t8gw7YnDEwqiS8Uy+7RKemD/+5hYdNp6pI8i92Tj29MIsFnf1ov+JBj1D+IBr2DPQwh PaegT8CTzjGMvv1EttWvgXPXxHslJPe9hstpFRXqecB9LXdsOVPEvFMekE1Bl1SX5T+l5j FUhLW8+Phm8lsLhe4WJDJGaQiXSfArvawTEnSaisUrluBfZDlBqOHFFG5dmDT1NJxdVRGf 9lSa4i1hKWBJq0Tz77OW16r889M767tPVIe9Kg35Iedd51o86fpAv83ghMYITjGsMe8go5 +eTAzOI11Z120X8iIVKTR2W1BHK61lQQAsbkw7d/XTX07Mahp8Hrav4baGs9jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671349310; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ykbd/vw7E6wOXVJZqaLLHunyCtBIQZvfXT0A2dYLe1Y=; b=JZ5Yx7/IbEvtOe5ldhzlg3C4474xgnPhcv8z9L6lSq52hjfWRNJ6qFyPz0/Fkq3xQMlfZF BuJojx39SOxkdlVQFYE1jWnGTbzA9A7E4YpA7gABKGz+9EgTitDKlG63PDeKC+SKgCk0DG RIAGw5Cw69jWLn2F2xixkcnYZbziexQqyJK+sJYTBXwOqKcDsD4wuGyC7APK7RQCI4jT0X /VNhFHgtzM3FULEIC59C/+2rNnCDsIOUcNqOziLb1J2SZsKcph8ISjwLmE+nibQE70+s+R DyTegHVD2UJKfXA/fNmi3O02fQQi78+9aW1tiG9ubafSzLkNKcNpu85dHKmQig== Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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" X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: 2.02 X-Spam-Score: 2.02 X-Migadu-Queue-Id: 4AD8D2FF2E X-TUID: Vs58M/T/hkN4 * Tim Cross [2022-12-18 04:26]: > > M-x org-id-get-create > > I think this is an unrealistic expectation. We have sufficient > challenges ensuring org functions work within org buffers without adding > the additional burden of expectation they would work outside these > buffers where there is no guarantee of syntax or formatting > constraints. I understand. Org commands could get slowly or speedy adopted not to be shown in other modes by using the recent development of the command `interactive' interactive is a special form in ‘C source code’. (interactive &optional ARG-DESCRIPTOR &rest MODES) If MODES is present, it should be a list of mode names (symbols) that this command is applicable for. The main effect of this is that ‘M-x TAB’ (by default) won’t list this command if the current buffer’s mode doesn’t match the list. That is, if either the major mode isn’t derived from them, or (when it’s a minor mode) the mode isn’t in effect. > If you find some org functions work outside of org buffers, that is just > happenstance. There is no inconsistency here. Many other modes have > functions which will also work to varying degrees outside the specific > mode for which it was written. That does not mean you should use them > outside the mode they were designed for. If you do use them, it is at > your own risk. > > An expectation that a function will work outside the mode it was > designed for is a user error of expectation not a mode error. That may be said so, though I see that rather as neglect by design and lack of checks. If we speak of functions that are not interactive, your statement applies. If we speak of interactive functions, they are accessible to users, they should not be if the function does not apply. M-x org-agenda-Quit -- it is good example, why have a function that quits and leave it to user to invoke it in any other mode? > This error in understanding is likely due to the lack of real name space > support in Emacs. If we had real name spaces, org functions would not be > visible outside of org modes. Unfortunately, Emacs doesn't have such a > concept, so it is down to users respecting the conventions. One of those > conventions is not to use mode specific functions outside the mode they > were designed for. As you can see the `interactive' function already has that functionality. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/