Skip to content

Commit

Permalink
[57_6] Cleaning code of use_locate
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii authored Nov 29, 2023
1 parent 55cb21b commit 53c1f76
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
26 changes: 0 additions & 26 deletions src/Plugins/Freetype/tt_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "tt_tools.hpp"
#include "file.hpp"
#include "tm_file.hpp"
#include "boot.hpp"
#include "preferences.hpp"
#include "analyze.hpp"
#include "hashmap.hpp"
Expand Down Expand Up @@ -119,31 +118,6 @@ tt_locate (string name) {
//cout << "tt_locate: " << name << " -> " << u << "\n";
if (!is_none (u)) return u;
}
else if (use_locate &&
// NOTE: avoiding unnecessary locates can greatly improve timings
!starts (name, "ec") &&
!starts (name, "la") &&
!starts (name, "cm") &&
!starts (name, "msam") &&
!starts (name, "msbm") &&
!starts (name, "bbm") &&
!starts (name, "stmary") &&
!starts (name, "rsfs") &&
!starts (name, "grmn") &&
!starts (name, "mac-")
// FIXME: better caching of missed tt_locates would be better
)
{
string s= eval_system ("locate", "/" * name);
//cout << "locate " << name << " -> " << s << "\n";
int start, i, n= N(s);
for (start=0, i=0; i<n; i++)
if (s[i]=='\n') {
if (ends (s (start, i), name))
return url (s (start, i));
start= i+1;
}
}

url tt_path= tt_font_path ();
//cout << "Resolve " << name << " in " << tt_path << "\n";
Expand Down
1 change: 0 additions & 1 deletion src/System/Boot/boot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
extern tree texmacs_settings;
extern int install_status;
extern bool use_which;
extern bool use_locate;
extern bool headless_mode;

void init_texmacs_path (int& argc, char** argv);
Expand Down
3 changes: 0 additions & 3 deletions src/System/Boot/init_texmacs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

int install_status = 0;
bool use_which = false;
bool use_locate = false;

extern void setup_tex (); // from Plugins/Metafont/tex_init.cpp
extern void init_tex (); // from Plugins/Metafont/tex_init.cpp
Expand Down Expand Up @@ -453,8 +452,6 @@ init_misc () {
#else
use_which = (var_eval_system ("which texmacs 2> /dev/null") != "");
#endif
//string loc= var_eval_system ("locate bin/locate 2> /dev/null");
//use_locate= (search_forwards ("bin/locate", loc) > 0);

// Set extra environment variables for Cygwin
#ifdef OS_CYGWIN
Expand Down

0 comments on commit 53c1f76

Please sign in to comment.