emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carlos Pita <carlosjosepita@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Bug: Bad alignment of grouped tags in fast selection dialog [9.2.1 (release_9.2.1-60-gb0379f @ /home/carlos/local/stow/emacs/share/emacs/site-lisp/org/)]
Date: Tue, 12 Feb 2019 18:24:05 -0300	[thread overview]
Message-ID: <CAELgYheiVpd2qTo9SdnLUhNcY6HWepzCrA1sdt2RhUhLTrbNPw@mail.gmail.com> (raw)
In-Reply-To: <CAELgYhdfJM49MD9jikihLRMvdHVv3DbWyuwP8CjbuxUCtwMTsg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

Not a big deal, but here is a slightly better fix that avoids adding
some spaces before the closing }.

The difference wrt to the previous one is just:

-           (unless (memq (caar tbl) '(:endgroup :endgrouptag)) (insert "\n"))
-           (when (or ingroup intaggroup) (insert "  "))
+           (unless (memq (caar tbl) '(:endgroup :endgrouptag))
+             (insert "\n")
+             (when (or ingroup intaggroup) (insert "  ")))

That is, the when clause is inside the unless clause.

[-- Attachment #2: 0001-org-Fix-fast-tag-selection-menu-alignment.patch --]
[-- Type: text/x-patch, Size: 1354 bytes --]

From 49775847f6db729dfb726ac098cc8039fceb9346 Mon Sep 17 00:00:00 2001
From: memeplex <carlosjosepita@gmail.com>
Date: Tue, 12 Feb 2019 17:49:40 -0300
Subject: [PATCH] org: Fix fast tag selection menu alignment

* lisp/org.el (org-fast-tag-selection):
  - Avoid lines with just a closing delimiter.
  - Correctly align grouped and ungrouped tags.
---
 lisp/org.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index e2258749b..003058434 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14502,13 +14502,14 @@ Returns the new tags string, or nil to not change the current settings."
 	  			   ((member tg inherited) i-face))))
 	  (when (equal (caar tbl) :grouptags)
 	    (org-add-props tg nil 'face 'org-tag-group))
-	  (when (and (zerop cnt) (not ingroup) (not intaggroup)) (insert " "))
+	  (when (and (zerop cnt) (not ingroup) (not intaggroup)) (insert "  "))
 	  (insert "[" c "] " tg (make-string
 				 (- fwidth 4 (length tg)) ?\ ))
 	  (push (cons tg c) ntable)
 	  (when (= (cl-incf cnt) ncol)
-	    (insert "\n")
-	    (when (or ingroup intaggroup) (insert " "))
+	    (unless (memq (caar tbl) '(:endgroup :endgrouptag))
+	      (insert "\n")
+	      (when (or ingroup intaggroup) (insert "  ")))
 	    (setq cnt 0)))))
       (setq ntable (nreverse ntable))
       (insert "\n")
-- 
2.20.1


  reply	other threads:[~2019-02-12 21:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12 20:12 Bug: Bad alignment of grouped tags in fast selection dialog [9.2.1 (release_9.2.1-60-gb0379f @ /home/carlos/local/stow/emacs/share/emacs/site-lisp/org/)] Carlos Pita
2019-02-12 21:02 ` Carlos Pita
2019-02-12 21:24   ` Carlos Pita [this message]
2019-02-13 12:06     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAELgYheiVpd2qTo9SdnLUhNcY6HWepzCrA1sdt2RhUhLTrbNPw@mail.gmail.com \
    --to=carlosjosepita@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).