program "highlight" not working normally

Questions about applications and software
Forum rules
Before you post please read how to get help
catch22
Level 3
Level 3
Posts: 113
Joined: Mon Oct 01, 2012 7:50 am
Location: Belgium
Contact:

program "highlight" not working normally

Postby catch22 » Tue Jan 08, 2013 7:09 pm

In Synaptic it shows the program "highlight" is version 3.8-2 and is not upgradeable by force.

In terminal though

Code: Select all

highlight --version
shows no output and no return to command prompt.
EDIT: Uninstalled via Synaptic, then downloaded 3.12 and in terminal did

Code: Select all

tar -jxvf highlight-3.12.tar.bz2
and then cd into the directory of the untarred did

Code: Select all

./configure
and got

Code: Select all

bash: ./configure: File or directory doesn't exist
Looks like I'm stuck here...
done with distro-hopping!

catch22
Level 3
Level 3
Posts: 113
Joined: Mon Oct 01, 2012 7:50 am
Location: Belgium
Contact:

Re: program "highlight" not working normally

Postby catch22 » Tue Feb 12, 2013 3:50 pm

I mailed the developer at highlight, and he says the following: there indeed is a conflict with a Mint package, see: http://andre-simon.de/dokuwiki/doku.php?id=en:installation_linux

There I could see : "There is a system script called highlight which is located in a preferenced path:
mintsystem provides:

Code: Select all

/usr/local/bin/highlight

highlight provides:

Code: Select all

/usr/bin/highlight

Calling this script with the true highlight command line options will have no effect."

Can anyone tell me if this /usr/local/bin/highlight that is in Mint by default, can be deleted without serious consequence?
I would like the other highlight program to work as intended for previews in the file manager ranger http://ranger.nongnu.org/
done with distro-hopping!

hut
Level 1
Level 1
Posts: 2
Joined: Tue Feb 12, 2013 7:11 pm
Contact:

Re: program "highlight" not working normally

Postby hut » Tue Feb 12, 2013 7:25 pm

To work around this problem, you need to edit the configuration file for previews in ranger, ~/.config/ranger/scope.sh, find the place where "highlight" is called, and change it from "highlight" to "/usr/bin/highlight". For example, in the most recent version of scope.sh, you'd have to change line 43 from

Code: Select all

highlight() { command highlight "$@"; test $? = 0 -o $? = 141; }

to

Code: Select all

highlight() { /usr/bin/highlight "$@"; test $? = 0 -o $? = 141; }

catch22
Level 3
Level 3
Posts: 113
Joined: Mon Oct 01, 2012 7:50 am
Location: Belgium
Contact:

Re: program "highlight" not working normally

Postby catch22 » Thu Feb 14, 2013 4:49 pm

hut wrote:To work around this problem, you need to edit the configuration file for previews in ranger, ~/.config/ranger/scope.sh, find the place where "highlight" is called, and change it from "highlight" to "/usr/bin/highlight". For example, in the most recent version of scope.sh, you'd have to change line 43 from

Code: Select all

highlight() { command highlight "$@"; test $? = 0 -o $? = 141; }

to

Code: Select all

highlight() { /usr/bin/highlight "$@"; test $? = 0 -o $? = 141; }

Thanks for the clear info, only my scope.sh doesn't have anything like what you mention; the only lines with "highlight" in them are these:

Code: Select all

  ;; # fall back to highlight/cat if theres no lynx/elinks
esac
case "$mimetype" in
    # Syntax highlight for text files:
    text/* | */xml)
        highlight --out-format=ansi "$path" | head -n $maxln
done with distro-hopping!

hut
Level 1
Level 1
Posts: 2
Joined: Tue Feb 12, 2013 7:11 pm
Contact:

Re: program "highlight" not working normally

Postby hut » Thu Feb 14, 2013 7:22 pm

catch22 wrote:
hut wrote:To work around this problem, you need to edit the configuration file for previews in ranger, ~/.config/ranger/scope.sh, find the place where "highlight" is called, and change it from "highlight" to "/usr/bin/highlight". For example, in the most recent version of scope.sh, you'd have to change line 43 from

Code: Select all

highlight() { command highlight "$@"; test $? = 0 -o $? = 141; }

to

Code: Select all

highlight() { /usr/bin/highlight "$@"; test $? = 0 -o $? = 141; }

Thanks for the clear info, only my scope.sh doesn't have anything like what you mention; the only lines with "highlight" in them are these:

Code: Select all

  ;; # fall back to highlight/cat if theres no lynx/elinks
esac
case "$mimetype" in
    # Syntax highlight for text files:
    text/* | */xml)
        highlight --out-format=ansi "$path" | head -n $maxln

change

Code: Select all

highlight --out-format=ansi "$path" | head -n $maxln

to

Code: Select all

/usr/bin/highlight --out-format=ansi "$path" | head -n $maxln

catch22
Level 3
Level 3
Posts: 113
Joined: Mon Oct 01, 2012 7:50 am
Location: Belgium
Contact:

Re: program "highlight" not working normally

Postby catch22 » Mon Mar 11, 2013 2:57 pm

hut wrote:change

Code: Select all

highlight --out-format=ansi "$path" | head -n $maxln

to

Code: Select all

/usr/bin/highlight --out-format=ansi "$path" | head -n $maxln
Thanks Hut, and sorry for the late reply; I now see I didn't subscribe to my own topic somehow :oops: and thought you left me in the cold.
I'll check it out tonight 8)
EDIT: checked and working :)
done with distro-hopping!

Jairus
Level 1
Level 1
Posts: 3
Joined: Fri May 03, 2013 1:57 pm

Re: program "highlight" not working normally

Postby Jairus » Tue Mar 22, 2016 2:08 pm

Thanks from me too, hut; your work-around got highlighting functioning normally in my Arch Linux install. :D


Return to “Software & Applications”

Who is online

Users browsing this forum: Neil Edmond, Wade Patton and 19 guests