Re: variable-pitch-mode misaligns org-mode heading tags
Adam Spiers writes: Hrm, no this isn't good enough. For graphical windows we still need to set the display text properties to align all tags when the buffer initially loads. AFAICS there's currently no code to trigger this, so it would need to be added, and for large files this might actually cause problems with file loading time unless it was done in the background (a bit like fontification can be done). A few issues I found: 1. If the headline text exceeds the org-tags-column, the tags are moved so there is no space between the headline and the tag. This is only aesthetic, since in reality there is still a space there. Not sure this needs to be fixed. 2. If you try to insert a space at the end of the headline, it will be gobbled automatically because org-self-insert-command calls org–align-tags-here. With this method of aligning tags I don’t think org-self-insert-command needs to make this call, because the display text property updates automatically on redisplay. So the solution may be take that call out, but I don’t know if that will break anything. Otherwise, maybe the code ensuring there is one space is not really necessary. 3. Org-indent-mode creates a problem. Not sure why yet, or whether it’s org-indent-mode or some setting I have associated with it, but tags of child nodes don’t align properly. Jeff Filipovits Spears & Filipovits, LLC 1126 Ponce de Leon Avenue Atlanta, GA 30306 678.237.9302 (direct) j...@civil-rights.law All emails confidential to the fullest extent of the law.
Re: variable-pitch-mode misaligns org-mode heading tags
Adam Spiers writes: Hrm, no this isn't good enough. For graphical windows we still need to set the display text properties to align all tags when the buffer initially loads. AFAICS there's currently no code to trigger this, so it would need to be added, and for large files this might actually cause problems with file loading time unless it was done in the background (a bit like fontification can be done). Initial test had some problems on my end. I have a couple ideas. Will try to write something tomorrow. Hopefully someone will chime in otherwise. The upside of this is that it enabled me do to some hacking so now I can use a variable pitch font in the mu4e headers view and keep the columns aligned, which makes mu4e much prettier. -- Jeff Filipovits Spears & Filipovits, LLC 1126 Ponce de Leon Avenue Atlanta, GA 30306 678.237.9302 (direct) j...@civil-rights.law All emails confidential to the fullest extent of the law.
Re: variable-pitch-mode misaligns org-mode heading tags
Adam, Thanks. You are right of course and I realized the right-align issue right after I sent my email. Adam Spiers writes: But the whole point of this exercise is to support variable-width fonts. In this case, the correct position for the end of the single space is most likely not even a multiple of the fixed column width, so it would probably need to be measured in pixels rather than columns. And in order to calculate it, it is first necessary to calculate the exact width in pixels of the colon-delimited list of tags. As I mentioned in the comment linked above, I searched for a way of calculating the pixel width of the tag list, and the best I could find was `pos-visible-in-window-p' which has some issues which I mentioned there. If you have thoughts on whether I'm right about those, and if so how to solve them, I'd love to hear! Cheers, Adam It looks like (window-text-pixel-size) could be used to calculate the pixel length of the tags list? I am having trouble deciphering the manual (https://www.gnu.org/software/emacs/manual/html_node/elisp/Pixel-Specification.html#Pixel-Specification) for pixel specification for spaces, though. The right alignment specification for some reason sends the tags to the next line, as do most other solutions that I would expect to align the text to the right side of the window. I can experiment more in a couple days, but in the meantime maybe someone smarter than me give some hints on how to use the pixel specification properties. BTW I tried your code and for some reason it didn't insert any space for me, but I didn't look into that yet. The way it’s written it would only reduce the gap between the headline and tags to a space, and it assumes there are multiple spaces there already. If there’s no space between the two, I don’t think it’ll insert one. Probably not the best way as it was thrown together to test the text property fix. I accepted long ago that the solution to using a variable pitch font for org headings was that the tags would not be aligned to the right and never looked back, so maybe this is not worth the price of fixing it if it is messy. And diving down to calculating the pixel width of text seems like it’s getting pretty messy. -- Jeff Filipovits Spears & Filipovits, LLC 1126 Ponce de Leon Avenue Atlanta, GA 30306 678.237.9302 (direct) jrfilipov...@gmail.com All emails confidential to the fullest extent of the law.
Re: variable-pitch-mode misaligns org-mode heading tags
Following the call for help to fix bugs, and with building guilt, I’ve taken a stab at fixing aligning tags when using a variable-pitch font. I haven’t tested this much because I do not know if it is misguided, but it seems to work. Seems the only way to do it is to use the ‘display text property and expand a single space between the headline and tags. Here is a drop-in replacement of org--align-tags-here which ensures there is one space between the tags and headline, and then expands that space by setting a text property. I’ve removed the point-preserving code because it does not seem to be needed using this method. This would also allow removing org-fix-tags-on-the-fly from org-self-insert-command since there is only a single space between the headline and the tags and it is adjusted automatically. If this looks promising I can throw some more time at it. If not, I will happily abandon it. (defun org--align-tags-here (to-col) "Align tags on the current headline to TO-COL. Assume point is on a headline. Preserve point when aligning tags." (save-excursion (when (org-match-line org-tag-line-re) (let* ((tags-start (match-beginning 1)) (blank-start (progn (goto-char tags-start) (skip-chars-backward " \t") (point ;; If there is more than one space between the headline and tags, ;; delete the extra spaces. Might be better to ;; make the delete region one space smaller rather than inserting ;; a new space? (when (> tags-start (1+ blank-start)) (delete-region blank-start tags-start) (goto-char blank-start) (insert " ")) ;; Don't set the text property unless it is needed. ;; Not sure this check is efficient. Probably not necessary. (unless (equal (get-text-property blank-start 'display) `(space . (:align-to ,to-col))) (put-text-property blank-start (1+ blank-start) 'display `(space . (:align-to ,to-col Bastien writes: Hi Eric, Eric S Fraga writes: Also support for org-indent-mode: having the text align nicely with the heading (as it does with monospace typefaces) would be more visually pleasing. But I have a feeling that the calculations required for this and the above may be significant and arguably not worth it? Indeed. Org, especially with respect to (large) tables, is already quite slow unfortunately. Fortunately, the reasons why tables might be slow are distinct from the reasons why org-indent might be slow. But yes, space-based alignment is a welcome improvement as long as it does not make Org slower. -- Jeff Filipovits Spears & Filipovits, LLC 1126 Ponce de Leon Avenue Atlanta, GA 30306 678.237.9302 (direct) jrfilipov...@gmail.com All emails confidential to the fullest extent of the law.
Re: Reposting Elgantt announcement
Eric S Fraga writes: A quick question, however. My projects tend to be multi-year. Does the graphical presentation provide optional control of the date information along the top? We often use each year as a major divider with Q1..Q4 subdivisions for quarterly views of multi-year projects. Even just years with month labels (JFMA...D) would be good enough but full month/day breakdowns as you currently have in the demo would be unwieldy/ugly. Not currently an option but would not be hard to implement. Some of the code relies on the months to be displayed but they could be hidden in a text property somewhere. The vertical lines between months are important though, so there’s no way to get rid of those. Adding an option to hide the number line for the dates should not be difficult. If you gave me an idea of what you want it to look like I could figure out a way to make the top lines customizable in a way that could accommodate it. -- Jeff Filipovits Spears & Filipovits, LLC 1126 Ponce de Leon Avenue Atlanta, GA 30306 678.237.9302 (direct) jrfilipov...@gmail.com All emails confidential to the fullest extent of the law.
Re: Reposting Elgantt announcement
Thanks for reposting. I am the author. If anyone wants to help get this into shape to go on MELPA that would be great. I am a bit burned out on the project at the moment. Coding is is a hobby and there are a lot of gaps in my knowledge with regard to getting it cleaned up and finalized. Otherwise, I hope it works for anyone who tries it! Russell Adams writes: All, I saw a cool Org related project come up on Reddit, but no announcement here. This is a repost for community interest, I claim no credit. This addon does interactive Gantt charts from Org files. Kudos to "legalnonsense" for a neat way to visualize Org data! See his screencast: https://i.redd.it/t2wt8sytf9c51.gif Original post: https://www.reddit.com/r/emacs/comments/hve0dy/ann_elgantt_gantt_chartcalendar_for_orgmode/ Source: https://github.com/legalnonsense/elgantt/ -- Russell Adams rlad...@adamsinfoserv.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint:1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 -- Jeff Filipovits Spears & Filipovits, LLC 1126 Ponce de Leon Avenue Atlanta, GA 30306 678.237.9302 (direct) j...@civil-rights.law All emails confidential to the fullest extent of the law.
Re: [O] Get the text of a node
Sometimes giving a bad answer inspires someone else to give a better one, so here goes: It seems like the best way to get the contents programatically is using org-dp (https://github.com/tj64/org-dp). I don't see a way in org-element. The data returned will include the property drawer of the heading. It does not include subheadings. I wrote a quick and ugly function to strip out the property drawer (it also has to remove the properties list associated with the section element, hence excluding :begin), and then returns a string. (defun get-contents (data) "DATA is the data returned by (org-dp-contents)" (let ((contents) (exclusions '(property-drawer :begin))) (dolist (element (cdar data)) (unless (memq (car-safe element) exclusions) (push element contents))) (org-element-interpret-data (reverse contents I am skeptical that this is a better way then the alternative you described, but do not know. Hopefully someone else can assist. On Wed, Oct 23, 2019 at 12:10 PM Joost Kremers wrote: > Hi all, > > I was wondering if there's a way to programmatically get the text > of a node in an Org buffer. Basically, I have a buffer that looks > something like this: > > #+BEGIN_SRC org > * Top header > ** Subheader >:PROPERTIES: >:Custom_ID: some_id >:END: > >Text starts here, possibly with additional subheaders > #+END_SRC > > What I would like to extract is the text below "Subheader", but > without the :PROPERTIES: block. > > I've looked at the org-element library, but I haven't been able to > figure out how to use it to extract just the plain text. > > I use the :Custom_ID: property to find the relevant subheading and > I know I can use (org-back-to-heading) to get point to the > Subheader containing the relevant :PROPERTIES: block. Obviously, I > could then narrow the buffer to the subheader, use a text search > to move point past the line containing :END: and then extract the > text from there until (point-max). > > I'm just wondering if this may break in unexpected circumstances > and whether there's a better way. > > TIA > > Joost > > > > -- > Joost Kremers > Life has its moments > >
Re: [O] letterhead and signature in odt export
Would you mind sharing them? This is a problem I am trying to figure out as well. On Tue, Oct 30, 2018, 9:29 AM Eric S Fraga wrote: > Matt, > > I've replied directly to you with some files. > -- > Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4 > >
[O] agenda view help - viewing all time entries for a tag
Say I have a calendar file which is in the following format: * description of deadline:client1: DEADLINE: <2018-10-28 Tue> * a meeting :client1: <2018-11-1 Thu 10:00> I would like to be able to view all headlines and time entries associated with a particular tag, and to have that information visible in an agenda buffer, and for the entries to appear in chronological order along with the associated dates If I do C-c a m [tag], the dates do not appear Seems the best I can do to get dates associated with the headline and appear in chronological order is C-c a a, then filter by tag, then M-x org-agenda-year-view. This is ugly and slow. Say I filter for :client1: and put into year view, it looks something like: Tuesday 30 October 2018 Deadline: description of deadline :client1: Wednesday 31 October 2018 *[unnecessary date with no entry -- why is this here?]* Thursday 1 November 2018 10:00... a meeting :client1: Is there something obvious I am missing? I just want something like the above command, but without all of the dates shown that fall between time entries. This way I can get a view of all deadlines associated with a client, where those deadlines may exist months or even a year+ in advance (i.e., I don't want to be limited to a year view). Hope this makes sense. I am an orgmode newb. Was very excited at first but the learning curve is really starting to hit me lately. It seems like this should be relatively easy to accomplish.