emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Propertized space in Agenda's mode-name [9.5.2 (release_9.5.2-3-geb9f34 @ /usr/local/share/emacs/28.0.91/lisp/org/)]
@ 2022-02-28 13:26 Gustavo Barros
  2022-10-22  7:15 ` Ihor Radchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Gustavo Barros @ 2022-02-28 13:26 UTC (permalink / raw)
  To: emacs-orgmode

Hi All,

I'm trying out the pre-release this week, and in thus doing, I met a 
particularly strange issue related to Org Agenda's `mode-name'.  And one 
space in particular, the one that is added before 
`org-agenda-current-span'.  The `mode-name' for the Agenda is set by 
`org-agenda-set-mode-name', and inside it we find:

#+begin_src emacs-lisp
" "
'(:eval (org-agenda-span-name org-agenda-current-span))
#+end_src

Now, this space somehow gets propertized.

A recipe for it.  Start `emacs -Q'.  Set things up:

#+begin_src emacs-lisp
(setq org-agenda-files '("~/agenda.org"))
(setq eval-expression-print-level nil)
(setq eval-expression-print-length nil)
#+end_src

Let's say =agenda.org= contains:

#+begin_src org
,* TODO Task
SCHEDULED: <2022-02-28 Mon>
#+end_src

Call `M-x org-agenda RET a'.  Now examine `mode-name' with `M-: 
mode-name RET' to get:

#+begin_src emacs-lisp
("Org-Agenda" "" #(" " 0 1 (todo-state #("TODO" 0 4 (fontified nil 
org-category "agenda")) org-habit-p nil priority 1099 warntime nil 
ts-date 738214 date (2 28 2022) type "scheduled" org-hd-marker #<marker 
(moves after insertion) at 1 in agenda.org> org-marker #<marker (moves 
after insertion) at 24 in agenda.org> face org-scheduled-today 
undone-face org-scheduled-today help-echo "mouse-2 or RET jump to Org 
file ~/agenda.org" mouse-face highlight done-face org-agenda-done 
org-complex-heading-regexp "^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: 
+\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\(?:[ 
]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ 	]*$" org-todo-regexp 
"\\(DONE\\|TODO\\)" org-not-done-regexp "\\(TODO\\)" dotime time format 
(((org-prefix-has-time t) (org-prefix-has-tag nil) 
(org-prefix-category-length 12) (org-prefix-has-effort nil) 
(org-prefix-has-breadcrumbs nil)) (format " %s %s%s%s" (format "%s" (if 
(member category-icon '("" nil)) "" (concat category-icon "" 
(get-text-property 0 'extra-space category-icon)))) (format "%-12s" (if 
(member category '("" nil)) "" (concat category ":" (get-text-property 0 
'extra-space category)))) (if (member time '("" nil)) "" (format "%-12s" 
(concat time ""))) (format "%s" (if (member extra '("" nil)) "" (concat 
extra " " (get-text-property 0 'extra-space extra)))))) extra 
"Scheduled: " time "" level " " txt #("TODO Task" 0 9 (fontified nil 
org-category "agenda" org-heading t)) breadcrumbs nil duration nil 
time-of-day nil org-priority-lowest 67 org-priority-highest 65 tags nil 
org-category "agenda")) (:eval (org-agenda-span-name 
org-agenda-current-span)) "" "" "" " Ddl" " Grid" "" "" "" "" "" "" "" 
"" "")
#+end_src

So, it appears that the Org Agenda buffer's properties are somehow 
getting to that particular space in `mode-name'.  It completely beats me 
how it is so but, alas, it is there.

This is a problem because, depending on what the content of your agenda 
is, this might result in this space getting some visually distinctive 
property.  In my case, I get a blank gap in the mode-line at this point. 
I couldn't generate a simple ECM that gets this effect.  But, at this 
point, it should be clear it can happen, given these properties are 
there.

This was all tested with the latest pre-release tarball, and the Org 
built-in there.  (I did not get the mode-line gap with 27.2 and the 
latest Org release for the same agendas).

Btw, since we are talking about this particular space in `mode-name', I 
always had some qualms with the fact that it is unconditionally added 
there, so that we get a double space for Agendas for which `(:eval 
(org-agenda-span-name org-agenda-current-span))' results in an empty 
string (e.g. a simple todo agenda).  Couldn't this space be added there 
conditionally there?  It is likely trivial to handle it directly in 
`org-agenda-span-name' (I know it also used in `org-agenda-list', but an 
optional argument could make the distinction).  WDYT?

Best regards,
Gustavo.



Emacs  : GNU Emacs 28.0.91 (build 2, x86_64-pc-linux-gnu, GTK+ Version 
3.24.20, cairo version 1.16.0)
 of 2022-02-26
Package: Org mode version 9.5.2 (release_9.5.2-3-geb9f34 @ 
/usr/local/share/emacs/28.0.91/lisp/org/)

current state:
==============
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 
 "\n\n(fn ENTRY)"]
 org-agenda-files '("~/agenda.org")
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees 
 org-cycle-hide-drawers org-cycle-show-empty-lines
		  org-optimize-window-after-visibility-change)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook 
 change-major-mode-hook org-show-all append local] 5]
		 #[0 "\300\301\302\303\304$\207"
		   [add-hook change-major-mode-hook 
		   org-babel-show-result-all append local] 5]
		 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-confirm-shell-link-function 'yes-or-no-p
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
 org-src-mode-configure-edit-buffer)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-speed-command-hook '(org-speed-command-activate 
 org-babel-speed-command-activate)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
 org-babel-header-arg-expand)
 org-link-shell-confirm-function 'yes-or-no-p
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("attachment" :follow org-attach-follow :complete 
 org-attach-complete-link)
		       ("id" :follow org-id-open) ("eww" :follow 
		       org-eww-open :store org-eww-store-link)
		       ("rmail" :follow org-rmail-open :store 
		       org-rmail-store-link)
		       ("mhe" :follow org-mhe-open :store 
		       org-mhe-store-link)
		       ("irc" :follow org-irc-visit :store 
		       org-irc-store-link :export org-irc-export)
		       ("info" :follow org-info-open :export 
		       org-info-export :store org-info-store-link)
		       ("gnus" :follow org-gnus-open :store 
		       org-gnus-store-link)
		       ("docview" :follow org-docview-open :export 
		       org-docview-export :store
			org-docview-store-link)
		       ("bibtex" :follow org-bibtex-open :store 
		       org-bibtex-store-link)
		       ("bbdb" :follow org-bbdb-open :export 
		       org-bbdb-export :complete org-bbdb-complete-link
			:store org-bbdb-store-link)
		       ("w3m" :store org-w3m-store-link)
		       ("doi" :follow org-link-doi-open :export 
		       org-link-doi-export) ("file+sys") ("file+emacs")
		       ("shell" :follow org-link--open-shell)
		       ("news" :follow
			#[514 "\301\300\302Q\"\207" ["news" browse-url 
                         ":"] 6 "\n\n(fn URL ARG)"])
		       ("mailto" :follow
			#[514 "\301\300\302Q\"\207" ["mailto" browse-url 
                         ":"] 6 "\n\n(fn URL ARG)"])
		       ("https" :follow
			#[514 "\301\300\302Q\"\207" ["https" browse-url 
                         ":"] 6 "\n\n(fn URL ARG)"])
		       ("http" :follow
			#[514 "\301\300\302Q\"\207" ["http" browse-url 
                         ":"] 6 "\n\n(fn URL ARG)"])
		       ("ftp" :follow
			#[514 "\301\300\302Q\"\207" ["ftp" browse-url 
                         ":"] 6 "\n\n(fn URL ARG)"])
		       ("help" :follow org-link--open-help :store 
		       org-link--store-help)
		       ("file" :complete org-link-complete-file) 
		       ("elisp" :follow org-link--open-elisp))
 org-metaup-hook '(org-babel-load-in-session-maybe)
 )


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-04-14 23:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-28 13:26 [BUG] Propertized space in Agenda's mode-name [9.5.2 (release_9.5.2-3-geb9f34 @ /usr/local/share/emacs/28.0.91/lisp/org/)] Gustavo Barros
2022-10-22  7:15 ` Ihor Radchenko
2022-10-22 10:51   ` Gustavo Barros
2023-04-13 13:03     ` Gustavo Barros
2023-04-13 14:26       ` Ihor Radchenko
2023-04-13 14:30         ` Gustavo Barros
2023-04-13 14:55           ` Ihor Radchenko
2023-04-13 15:07             ` Gustavo Barros
2023-04-13 15:13               ` Ihor Radchenko
2023-04-13 15:22                 ` Gustavo Barros
2023-04-13 15:49                   ` Ihor Radchenko
2023-04-14 23:07                     ` Gustavo Barros

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).