From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id APh2HRCokmYTxQAA62LTzQ:P1 (envelope-from ) for ; Sat, 13 Jul 2024 16:15:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id APh2HRCokmYTxQAA62LTzQ (envelope-from ) for ; Sat, 13 Jul 2024 18:15:12 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=GWxWtVjm; 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=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1720887312; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=anKKeViwMtrfJkpfnLqLFQW87G71PDEZ3u0zv3WpQlw=; b=MUJnFjPZHsYuB5KT5qEQ0cfrBXphLicmlrByBfs8FHq1ZJzz7pHOV6X+WgYnbw55UGsPGQ 4G/CTK0iCyVe1r7EYpEpBMFfEMUDjWMvhKQx5k6jEO9jhDIpZ3w9n0xhM0A22v8srZzAO4 qxC9cc99bjlxQZ8q0jJVh5a1HsBe4/nIjdKwn2UB7ghea5/1hWTGq4OkfPFmGEGQeZrqmJ K2omHBnwlKmuKHj6HDUjNlt4IyVWHxQxUbMp7bcpOEdz2gf9pq61ohzU94uMIDnpLyYuEq qTzSDT88ci950lG9LX+Ow/6li5rLCrXt0xPjipf49OllFuejdffbhuce0EMcBA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=GWxWtVjm; 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=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720887312; a=rsa-sha256; cv=none; b=VYOxzv6pXfMz+OP8m8lc7auJTKBaTwuqHmwOI0/Yr6AXlJ/cEmTXhjF7LiIno9gZnKajut d3H5LUsz8+ek8fBDxMW4j+1PRioKvHm5YOMY/ThFc0VoNn95XQGOV6BHBn16Vp1kJ7dqIf iI6eJ3N/o9Taujd0NzY9L0++bjAbl6ucLSHtW+KwZ9w4PJTbUjnstYj9zbOas18FZaA1HH pBX3+pOSfZGcL8GbTl/SswD4b99WMnwJZEBen2fssO+n66s2d06QjJ4FEHmN+yPmW/rZ0J JcVF7dO3P7sbrP4RYJiiInfnxnwGxZieEbcKMqIOQ9kcf/ioJvSi84c8oEayJQ== 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 251CB75109 for ; Sat, 13 Jul 2024 18:15:12 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSfO8-0003hI-D5; Sat, 13 Jul 2024 12:14:20 -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 1sSfO6-0003gl-Au for emacs-orgmode@gnu.org; Sat, 13 Jul 2024 12:14:18 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sSfO3-0007xW-Vg for emacs-orgmode@gnu.org; Sat, 13 Jul 2024 12:14:18 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 828B3240027 for ; Sat, 13 Jul 2024 18:14:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1720887253; bh=+mJhYTK1r0G8x/8OLrJwYYk/4bkIyHpOoJ+VkrV4lpQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=GWxWtVjmjUJThhcLcIFJ9I4tNov+1om/iARYcL/TjXnxsZRl8WPR1xFPpYPk/X0hy Rdf5wLDOt/j3H5QDplBNNcL/xdi4rgKfqYgzKSS0qYXtac9iCqcW68S5Kx6Zl+s7YP 2q0/cPRzwEoHTK5VW1/qpRAd/7lAS+/k1oJUtFcipVN1zQZUd1C2hMLO4Rdu475iua XwocM6vcHm+KDtg/pjnWLrrmdXK6kzX/eqcJzcD3fFFHVK5Q3Hvw+LhKAfMb+XCBcc +hAjsG2Cjmx+KMCx3mz5L1UXbm6W/m6lGFU75rS3YaaURSqJWc0OlcPV5mFloVeiYn nq1jLcyfI8Okw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WLtnc1dPFz9rxB; Sat, 13 Jul 2024 18:14:12 +0200 (CEST) From: Ihor Radchenko To: the_wurfkreuz Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] Incorrect application of 'comment-region' in code blocks In-Reply-To: References: <87cynhqv35.fsf@localhost> Date: Sat, 13 Jul 2024 16:15:44 +0000 Message-ID: <87frsdp8sv.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.63 X-Migadu-Queue-Id: 251CB75109 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.63 X-TUID: abd/Uzvgm7++ the_wurfkreuz writes: > I don't really know for sure what exactly i should do. > I cloned the repo 'git clone https://git.savannah.gnu.org/git/emacs/org-mode.git'. > Created minimal config ~/minimal_config.el: > > (require 'org) > (setq initial-major-mode 'org-mode) > > Created the repro file /tmp/bug.org. > Then from the cloned directory i did this: > > make repro REPRO_ARGS="-l ~/minimal_config.el /tmp/bug.org" > > Then i made the action that produces the bug and i got it. Confirmed. It was important that src block code should be indented. The culprit is that `org-comment-or-uncomment-region' assumes that the region size will remain unchanged when in Org src buffer. It is not true when the code in Org mode is indented. > #+begin_src emacs-lisp > > ;; (with-eval-after-load 'evil > ;; (define-key evil-insert-state-map (kbd "C-S-v") 'yank) > ;; (define-key evil-visual-state-map (kbd "{") 'evil-backward-paragraph) > ;; (define-key evil-visual-state-map (kbd "}") 'evil-forward-paragraph) > ;; (define-key evil-insert-state-map (kbd "M-w") 'evil-forward-word-begin) > ;; (define-key evil-insert-state-map (kbd "M-b") 'evil-backward-word-begin) > ;; (define-key evil-insert-state-map (kbd "M-W") 'evil-forward-WORD-begin) > ;; (define-key evil-insert-state-map (kbd "M-B") 'evil-backward-WORD-begin) > > ;; (define-key e > vil-normal-state-map (kbd "gq") 'FormatToThreshold) > (define-key evil-visual-state-map (kbd "gq") 'FormatToThreshold)) > > (defun my-move-beginning-of-line () > "Move point to the first non-whitespace character of the line and enter insert mode." > (interactive) > (evil-first-non-blank) > (evil-insert-state)) > > #+end_src > > (with-eval-after-load 'evil > (define-key evil-insert-state-map (kbd "C-S-v") 'yank) > (define-key evil-visual-state-map (kbd "{") 'evil-backward-paragraph) > (define-key evil-visual-state-map (kbd "}") 'evil-forward-paragraph) > (define-key evil-insert-state-map (kbd "M-w") 'evil-forward-word-begin) > (define-key evil-insert-state-map (kbd "M-b") 'evil-backward-word-begin) > (define-key evil-insert-state-map (kbd "M-W") 'evil-forward-WORD-begin) > (define-key evil-insert-state-map (kbd "M-B") 'evil-backward-WORD-begin) > > (define-key evil-normal-state-map (kbd "gq") 'FormatToThreshold) > (define-key evil-visual-state-map (kbd "gq") 'FormatToThreshold)) > > (defun my-move-beginning-of-line () > "Move point to the first non-whitespace character of the line and enter insert mode." > (interactive) > (evil-first-non-blank) > (evil-insert-state)) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at