emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Fill column indicator and org indent mode
@ 2017-08-14 17:58 Galen Menzel
  2017-08-14 21:57 ` Tim Cross
  2017-08-14 22:23 ` Eduardo Mercovich
  0 siblings, 2 replies; 7+ messages in thread
From: Galen Menzel @ 2017-08-14 17:58 UTC (permalink / raw)
  To: Org Mode

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

Hi all,

I use [Semantic 
linefeeds](http://rhodesmill.org/brandon/2012/one-sentence-per-line/) 
for a lot of my org files, for which having a visual indicator of column 
80 is useful. I'm currently using 
[`fill-column-indicator`](https://github.com/alpaker/Fill-Column-Indicator) 
for this, but the column indicator does not adjust for the indention 
level when using `org-indent-mode` — it just draws straight down on 
column 80 of the frame, regardless of the line's indention level. (So in 
a line under a level-3 headline with `org-indent-indentation-per-level` 
set to 2, the fill column indicator will appear on column 80 of the 
frame, which is actually column 76 of the line.)

Is anyone aware of a solution to displaying the fill column in a way 
that takes the indention level into account?

Thanks!

Best,

Galen

[-- Attachment #2: Type: text/html, Size: 1264 bytes --]

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

* Re: Fill column indicator and org indent mode
  2017-08-14 17:58 Fill column indicator and org indent mode Galen Menzel
@ 2017-08-14 21:57 ` Tim Cross
  2017-08-14 22:16   ` Kaushal Modi
  2017-08-14 22:23 ` Eduardo Mercovich
  1 sibling, 1 reply; 7+ messages in thread
From: Tim Cross @ 2017-08-14 21:57 UTC (permalink / raw)
  To: Galen Menzel; +Cc: Org Mode


I was using fci, but found all sorts of problems when it comes to
org-mode. In addition to the issue you mention, you will also find
'spurious' additional characters turning up in things like html exports
of your org files. I also started getting font-lock errors when I tried
to edit special blocks using C-c ' and a number of other bits of weird
behaviour.

Once I dropped fci and configured the whitespace package to show
characters past my fill column in a different colour, all the odd issues
I was seeing just vanished and my exports were working correctly again.

I preferred using fci and even used it for a while before I started
seeing problems. It was only once I stopped using it I realised that
many of the minor issues I was experiencing were due to fci and org
incompatibilities.

I did dig into this and found some others who had experienced similar
issues and even some partial fixes, but in the end, they still didn't
help with some of the more annoying issues and were likely to introduce
other problems.

While whitespace mode can provide similar functionality, I don't think
it will adjust to the org indentation as well. The problem is that these
packages just consider the screen and is not aware of mode level
specifics. Of the two, I suspect you could make whitespace act more
'dynamically' than fci, but we probably really need an org-aware column
indicator package/extension.

tim

Galen Menzel writes:

> Hi all,
>
> I use [Semantic 
> linefeeds](http://rhodesmill.org/brandon/2012/one-sentence-per-line/) 
> for a lot of my org files, for which having a visual indicator of column 
> 80 is useful. I'm currently using 
> [`fill-column-indicator`](https://github.com/alpaker/Fill-Column-Indicator) 
> for this, but the column indicator does not adjust for the indention 
> level when using `org-indent-mode` —it just draws straight down on 
> column 80 of the frame, regardless of the line's indention level. (So in 
> a line under a level-3 headline with `org-indent-indentation-per-level` 
> set to 2, the fill column indicator will appear on column 80 of the 
> frame, which is actually column 76 of the line.)
>
> Is anyone aware of a solution to displaying the fill column in a way 
> that takes the indention level into account?
>
> Thanks!
>
> Best,
>
> Galen


-- 
Tim Cross

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

* Re: Fill column indicator and org indent mode
  2017-08-14 21:57 ` Tim Cross
@ 2017-08-14 22:16   ` Kaushal Modi
  2017-08-16  3:04     ` Galen Menzel
  0 siblings, 1 reply; 7+ messages in thread
From: Kaushal Modi @ 2017-08-14 22:16 UTC (permalink / raw)
  To: Tim Cross, Galen Menzel; +Cc: Org Mode

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

On Mon, Aug 14, 2017 at 5:59 PM Tim Cross <theophilusx@gmail.com> wrote:

>
> I was using fci, but found all sorts of problems when it comes to
> org-mode. In addition to the issue you mention, you will also find

'spurious' additional characters turning up in things like html exports
> of your org files.


I fixed that particular problem using this:

=====
    ;; It is required to disable `fci-mode' when `htmlize-buffer' is called;
    ;; otherwise the invisible fci characters show up as funky looking
    ;; visible characters in the source code blocks in the html file.
    ;; http://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00777.html
    (with-eval-after-load 'fill-column-indicator
      (defvar modi/htmlize-initial-fci-state nil
        "Variable to store the state of `fci-mode' when `htmlize-buffer' is
called.")

      (defun modi/htmlize-before-hook-fci-disable ()
        (setq modi/htmlize-initial-fci-state fci-mode)
        (when fci-mode
          (fci-mode -1)))

      (defun modi/htmlize-after-hook-fci-enable-maybe ()
        (when modi/htmlize-initial-fci-state
          (fci-mode 1)))

      (add-hook 'htmlize-before-hook #'modi/htmlize-before-hook-fci-disable)
      (add-hook 'htmlize-after-hook
#'modi/htmlize-after-hook-fci-enable-maybe))
=====

When the code blocks are exported to HTML, htmlize is used to load the
major mode to get the syntax highlighting. The side effect of that is that
the FCI mode also gets enabled as they would have been added to the major
mode's hook var. Now, FCI shows that column indicator using a special
sequence of characters. The spurious additional characters are those.

Above snippet basically prevents the fci mode from getting enabled when
htmlize is doing its thing.

In general I agree that FCI needs one to put such hacks in their config,
and whitespace mode (ships with Emacs) is much nicer. Though, there is no
package that does the exact same thing as FCI.
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 2974 bytes --]

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

* Re: Fill column indicator and org indent mode
  2017-08-14 17:58 Fill column indicator and org indent mode Galen Menzel
  2017-08-14 21:57 ` Tim Cross
@ 2017-08-14 22:23 ` Eduardo Mercovich
  2017-08-16  3:14   ` Galen Menzel
  2017-08-16  4:24   ` Adam Porter
  1 sibling, 2 replies; 7+ messages in thread
From: Eduardo Mercovich @ 2017-08-14 22:23 UTC (permalink / raw)
  To: Galen Menzel; +Cc: Org Mode

Dear Galen.

> I use Semantic linefeeds for a lot of my org files [...]

Thank you for the reference about Semantic linefeeds.

I didn't knew it, but used it something similar sometimes when 
operating on complex sentences/paragraphs.

I created org list items as in Slf, one semantic nucleus per line, 
and rearranged them to develop the idea clearly seeing the order, 
the cuts (colon, semicolon, etc.), the lengths.

When it's done, I joined the items again.

But, as is usual in the beautiful orgmode world, I don't even have 
to. Org exports the paragraph perfectly even keeping the short 
lines in the source. :)

Thanks again...

-- 
eduardo mercovich

 Donde se cruzan tus talentos 
 con las necesidades del mundo, 
 ahí está tu vocación. 
 (Anónimo)

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

* Re: Fill column indicator and org indent mode
  2017-08-14 22:16   ` Kaushal Modi
@ 2017-08-16  3:04     ` Galen Menzel
  0 siblings, 0 replies; 7+ messages in thread
From: Galen Menzel @ 2017-08-16  3:04 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: Tim Cross, Org Mode

Thanks both Tim and Kaushal for the great information!

Given what appears to be the state of affairs, I'll probably just live 
without it a fill-column indicator for the time being.

Best,

Galen

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

* Re: Fill column indicator and org indent mode
  2017-08-14 22:23 ` Eduardo Mercovich
@ 2017-08-16  3:14   ` Galen Menzel
  2017-08-16  4:24   ` Adam Porter
  1 sibling, 0 replies; 7+ messages in thread
From: Galen Menzel @ 2017-08-16  3:14 UTC (permalink / raw)
  To: Eduardo Mercovich; +Cc: Org Mode

On 14 Aug 2017, at 15:23, Eduardo Mercovich wrote:

> Thank you for the reference about Semantic linefeeds.
>
> I didn't knew it, but used it something similar sometimes when 
> operating on complex sentences/paragraphs.
>
> I created org list items as in Slf, one semantic nucleus per line, and 
> rearranged them to develop the idea clearly seeing the order, the cuts 
> (colon, semicolon, etc.), the lengths.

Yes, it makes things very easy to rearrange things, and it works 
wonderfully with version control, since changes happen line by line, so 
diffs usually show what actually changed, whereas this information is 
lost if you reformat with fill-paragraph or keep all paragraphs on a 
single line.

I'll have to try using lists, since this will make sentence and clause 
rearrangement even quicker. Thanks for the idea!

Best,

Galen

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

* Re: Fill column indicator and org indent mode
  2017-08-14 22:23 ` Eduardo Mercovich
  2017-08-16  3:14   ` Galen Menzel
@ 2017-08-16  4:24   ` Adam Porter
  1 sibling, 0 replies; 7+ messages in thread
From: Adam Porter @ 2017-08-16  4:24 UTC (permalink / raw)
  To: emacs-orgmode

Eduardo Mercovich <eduardo@mercovich.net> writes:

> I created org list items as in Slf, one semantic nucleus per line, and
> rearranged them to develop the idea clearly seeing the order, the cuts
> (colon, semicolon, etc.), the lengths.
>
> When it's done, I joined the items again.
>
> But, as is usual in the beautiful orgmode world, I don't even have
> to. Org exports the paragraph perfectly even keeping the short lines
> in the source. :)

Hi Eduardo,

Sorry, I'm confused: do you mean that the list is exported as a regular
paragraph?  Or do you mean that, after converting it from a list back to
plain lines of text, Org exported the lines as a single paragraph
instead of separate lines?  Could you give a brief example?

Thanks.

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

end of thread, other threads:[~2017-08-16  4:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-14 17:58 Fill column indicator and org indent mode Galen Menzel
2017-08-14 21:57 ` Tim Cross
2017-08-14 22:16   ` Kaushal Modi
2017-08-16  3:04     ` Galen Menzel
2017-08-14 22:23 ` Eduardo Mercovich
2017-08-16  3:14   ` Galen Menzel
2017-08-16  4:24   ` Adam Porter

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