From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emanuel Evans Subject: Bug: org-set-tags-to indentation problems when called programmatically [8.2.10 (release_8.2.10 @ /usr/share/emacs/24.5/lisp/org/)] Date: Tue, 03 Nov 2015 13:37:48 -0800 Message-ID: <874mh2wyqb.fsf@emanuel.industries> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtjHA-0001Ta-Sj for emacs-orgmode@gnu.org; Tue, 03 Nov 2015 16:37:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtjH6-0001Pn-1K for emacs-orgmode@gnu.org; Tue, 03 Nov 2015 16:37:56 -0500 Received: from bravos.emanuel.industries ([45.55.16.62]:56797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtjH5-0001Ox-PE for emacs-orgmode@gnu.org; Tue, 03 Nov 2015 16:37:51 -0500 Received: from localhost (unknown [173.247.206.130]) by bravos.emanuel.industries (Postfix) with ESMTPSA id AFB2C5FAEC for ; Tue, 3 Nov 2015 16:37:49 -0500 (EST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. ------------------------------------------------------------------------ This is cross-filed as https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21818 in Emacs. Steps to reproduce: 1. Start emacs with emacs -Q 2. Evaluate the following: (require 'org-mode) (defun bad-indent () (interactive) (insert "* ") (org-insert-link nil "http://www.example.com/foo/bar/baz/qux/abc123f56789" "something") (org-set-tags-to '("foo"))) 3. Switch to an empty buffer 4. M-x org-mode 5. M-x bad-indent 6. The result looks like the following (except with an actual hyperlink): * something :foo: This indentation is incorrect. If you follow the steps for `bad-indent' interactively (or even using edebug), the indentation looks like: * something :foo: Digging in some more, it looks like the problem is the `current-column' call in `org-set-tags' (where it says 'setq c0 (current-column)', on line 14620 of org.el in my distribution). With some instrumentation, `current-column' seems to be giving different values in interactive mode than programatically; I'm guessing it has something to do with the long link target causing the value to be different. Emacs : GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) of 2015-09-09 on foutrelis Package: Org-mode version 8.2.10 (release_8.2.10 @ /usr/share/emacs/24.5/lisp/org/)