From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically Date: Tue, 03 Nov 2015 17:26:01 +0200 Message-ID: <83h9l3w1di.fsf@gnu.org> References: <87r3k7prms.fsf@cersei.i-did-not-set--mail-host-address--so-tickle-me> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1446564388 10296 80.91.229.3 (3 Nov 2015 15:26:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Nov 2015 15:26:28 +0000 (UTC) To: 21818@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 03 16:26:16 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZtdTT-00061u-3o for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Nov 2015 16:26:15 +0100 Original-Received: from localhost ([::1]:49373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtdTS-0000I5-GI for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Nov 2015 10:26:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtdTL-0000HN-41 for bug-gnu-emacs@gnu.org; Tue, 03 Nov 2015 10:26:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtdTH-0006V4-0k for bug-gnu-emacs@gnu.org; Tue, 03 Nov 2015 10:26:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtdTG-0006V0-Q3 for bug-gnu-emacs@gnu.org; Tue, 03 Nov 2015 10:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZtdTG-0001pN-DY for bug-gnu-emacs@gnu.org; Tue, 03 Nov 2015 10:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Nov 2015 15:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21818 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21818-submit@debbugs.gnu.org id=B21818.14465643517008 (code B ref 21818); Tue, 03 Nov 2015 15:26:02 +0000 Original-Received: (at 21818) by debbugs.gnu.org; 3 Nov 2015 15:25:51 +0000 Original-Received: from localhost ([127.0.0.1]:51608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZtdT4-0001ox-HD for submit@debbugs.gnu.org; Tue, 03 Nov 2015 10:25:50 -0500 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:49877) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZtdT1-0001ol-ML for 21818@debbugs.gnu.org; Tue, 03 Nov 2015 10:25:48 -0500 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NX800100VOVAD00@mtaout25.012.net.il> for 21818@debbugs.gnu.org; Tue, 03 Nov 2015 17:23:33 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NX8001S9W39GA10@mtaout25.012.net.il> for 21818@debbugs.gnu.org; Tue, 03 Nov 2015 17:23:33 +0200 (IST) In-reply-to: <87r3k7prms.fsf@cersei.i-did-not-set--mail-host-address--so-tickle-me> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:108349 Archived-At: > From: mail@emanuel.industries > Date: Mon, 02 Nov 2015 21:40:43 -0800 > > > 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. Are you sure this isn't a problem with Org mode? If not, can you tell why you think so? Thanks.