program "highlight" not working normally

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
catch22
Level 4
Level 4
Posts: 210
Joined: Mon Oct 01, 2012 7:50 am
Location: Belgium
Contact:

program "highlight" not working normally

Post by catch22 »

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...
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
catch22
Level 4
Level 4
Posts: 210
Joined: Mon Oct 01, 2012 7:50 am
Location: Belgium
Contact:

Re: program "highlight" not working normally

Post by catch22 »

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 ... tion_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/
hut

Re: program "highlight" not working normally

Post by hut »

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 4
Level 4
Posts: 210
Joined: Mon Oct 01, 2012 7:50 am
Location: Belgium
Contact:

Re: program "highlight" not working normally

Post by catch22 »

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
hut

Re: program "highlight" not working normally

Post by hut »

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 4
Level 4
Posts: 210
Joined: Mon Oct 01, 2012 7:50 am
Location: Belgium
Contact:

Re: program "highlight" not working normally

Post by catch22 »

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 :)
Jairus
Level 1
Level 1
Posts: 4
Joined: Fri May 03, 2013 1:57 pm

Re: program "highlight" not working normally

Post by Jairus »

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

Return to “Software & Applications”