From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Bug: (org-set-tags t t) gives an error point is not currently on a headline Date: Tue, 13 Apr 2010 09:09:00 +0200 Message-ID: <950E6108-688E-41AC-903C-50E71AE46145@gmail.com> References: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1aFA-0003Ax-64 for emacs-orgmode@gnu.org; Tue, 13 Apr 2010 03:09:08 -0400 Received: from [140.186.70.92] (port=58291 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1aF8-00039k-Kk for emacs-orgmode@gnu.org; Tue, 13 Apr 2010 03:09:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1aF6-0000tG-3u for emacs-orgmode@gnu.org; Tue, 13 Apr 2010 03:09:06 -0400 Received: from mail-ew0-f214.google.com ([209.85.219.214]:63336) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1aF5-0000sl-PE for emacs-orgmode@gnu.org; Tue, 13 Apr 2010 03:09:04 -0400 Received: by ewy6 with SMTP id 6so154895ewy.32 for ; Tue, 13 Apr 2010 00:09:03 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ryan Thompson Cc: Org-Mode List Hi Ryan, thanks for this patch. I ended up to instead provide a special command to align all tags, because org-set-tags should throw an error when called not on a headline, for other reasons. I am assuming that you want to call this from some lisp function - so (org-align-all-tags) should now do the job for you. HTH. and thanks again. - Carsten On Apr 8, 2010, at 8:11 PM, Ryan Thompson wrote: > Hi, > > When I run (org-set-tags t t) to realign all tags in the buffer, it > doesn't work unless the point is currently on a headline, because > org-set-tags calls (org-get-tags-string) early on, and > org-get-tags-string raises an error if not on a headline. This can be > fixed by moving the binding of `current' to `(org-get-tags-string)' > into the else clause of the first if statment. I have attached a patch > > -Ryan > -- > prefix.diff>_______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten