From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: mail@emanuel.industries Newsgroups: gmane.emacs.bugs Subject: bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically Date: Mon, 02 Nov 2015 21:40:43 -0800 Message-ID: <87r3k7prms.fsf@cersei.i-did-not-set--mail-host-address--so-tickle-me> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1446533732 2592 80.91.229.3 (3 Nov 2015 06:55:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Nov 2015 06:55:32 +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 07:55:14 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 1ZtVUv-0000aD-2Y for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Nov 2015 07:55:13 +0100 Original-Received: from localhost ([::1]:46045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtVUu-0001aD-9U for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Nov 2015 01:55:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtVUq-0001XY-US for bug-gnu-emacs@gnu.org; Tue, 03 Nov 2015 01:55:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtVUl-0004dQ-TH for bug-gnu-emacs@gnu.org; Tue, 03 Nov 2015 01:55:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtVUl-0004dK-8X for bug-gnu-emacs@gnu.org; Tue, 03 Nov 2015 01:55:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZtVUl-0001yj-1y for bug-gnu-emacs@gnu.org; Tue, 03 Nov 2015 01:55:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: mail@emanuel.industries Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Nov 2015 06:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21818 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14465336977588 (code B ref -1); Tue, 03 Nov 2015 06:55:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Nov 2015 06:54:57 +0000 Original-Received: from localhost ([127.0.0.1]:50347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZtVUe-0001yJ-FX for submit@debbugs.gnu.org; Tue, 03 Nov 2015 01:54:57 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56749) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZtUL1-0008QI-UN for submit@debbugs.gnu.org; Tue, 03 Nov 2015 00:41:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtUL0-0005aw-3s for submit@debbugs.gnu.org; Tue, 03 Nov 2015 00:40:55 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:33441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtUL0-0005as-0Z for submit@debbugs.gnu.org; Tue, 03 Nov 2015 00:40:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtUKy-0005uX-G1 for bug-gnu-emacs@gnu.org; Tue, 03 Nov 2015 00:40:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtUKt-0005XF-Ek for bug-gnu-emacs@gnu.org; Tue, 03 Nov 2015 00:40:52 -0500 Original-Received: from bravos.emanuel.industries ([45.55.16.62]:54816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtUKs-0005X9-RF for bug-gnu-emacs@gnu.org; Tue, 03 Nov 2015 00:40:47 -0500 Original-Received: from localhost (c-73-162-103-83.hsd1.ca.comcast.net [73.162.103.83]) by bravos.emanuel.industries (Postfix) with ESMTPSA id C49D25FF22 for ; Tue, 3 Nov 2015 00:40:43 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=emanuel.industries; s=mail; t=1446529243; bh=t7/n8Gr3SLG8U+Do/tzNCY9+Le9cYk1EfQeyb/4K+VE=; h=From:To:Subject:Date; b=MBdoZN63LouVIpKihxlxc/QjFPORWhqBih/E37IZedvajyJx/b935dXZExMyaX1cp qFmaa00/9OyYOVDaHRAsB/2owMdNlK/d+kGKDmiF94JTeqwB1+y6U25yURO0c0aHmF 7R3DhJV7apzSWzKjSKF+O9d9C4nFrPieRZN0u7Ls= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Tue, 03 Nov 2015 01:54:53 -0500 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:108338 Archived-At: 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. In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) of 2015-09-09 on foutrelis Windowing system distributor `The X.Org Foundation', version 11.0.11704000 System Description: Arch Linux Configured using: `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' Important settings: value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set bad-indent is undefined bad-indent Quit You can run the command `org-insert-link' with C-c C-l Making completion list... [2 times] nil Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils help-mode tabify image-file org-element org-rmail org-mhe org-irc org-info org-gnus gnus-util org-docview doc-view jka-compr image-mode dired cl-loaddefs cl-lib org-bibtex bibtex org-bbdb org-w3m org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint comint ansi-color ring ob-core ob-eval org-compat org-macs org-loaddefs format-spec find-func cal-menu easymenu calendar cal-loaddefs time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 133855 6759) (symbols 48 24865 0) (miscs 40 81 451) (strings 32 33885 4710) (string-bytes 1 1030329) (vectors 16 16015) (vector-slots 8 456618 6166) (floats 8 108 286) (intervals 56 332 0) (buffers 960 13) (heap 1024 52252 997))