He reproducido el problema ahora también en El Capitán con componentes nuevos (placa base, 3x SSD) en mi Macbook Air 2013-mid. He tenido instalación limpia de OS X (El Capitan, Yosemite) mientras hacía la prueba. El último OS X donde funciona la búsqueda de .tex es el 10.8.5 en Spotlight. De momento no veo ningún documento .tex en mi búsqueda en Spotlight. Pruebas
- Ninguna respuesta actual resuelve el problema de forma permanente. En Yosemite, el problema volvió después de un tiempo con algunas respuestas. No existe una solución estable y se entiende poco cuál es la causa del problema.
La selección de las configuraciones de los ajustes no son relevantes en Spotlight porque podemos utilizar directamente el comando mdfind
en el terminal, que es equivalente a Spotlight. Sin embargo, hemos probado las configuraciones por defecto, mínima y completa en Spotlight. Para las pruebas, utilizamos la configuración por defecto en OS X. Sistema y aplicaciones
- Sistemas OS X Yosemite, OS X El Capitan
- TexShop.app está instalado. (MacTeX 2015, mactex-20150613.pkg).
- Aplicación Tex: TextMate2-beta8
- Spotlight/Finder/cualquier aplicación de búsqueda no funciona con archivos TeX y MacTeX 2015
- Spotlight funciona como se esperaba con algunas configuraciones diferentes y también con MacTeX 2015.
El comando mdfind
(versión del 10 de junio de 2004) es equivalente a la búsqueda en Spotlight por lo que una simple prueba que no devuelve nada sin éxito en mi sistema
mdfind sulfas | grep tex
Creo que el problema es que el sistema no reconoce el formato de archivo .tex`. Lo primero es conseguir que el sistema lo reconozca.
La sugerencia de tjt263 de buscar sólo .tex en Finder/Spotlight
Salida de Spotlight .tex
o el comando de terminal da tex -files correctamente en mi sistema. Sin embargo, al combinarlo con otros términos como .tex diabetes
ya no da ningún archivo tex. Los importadores obtenidos por mdimport -L
:
2015-09-22 15:31:42.352 mdimport[8163:707] Paths: id(502) (
"/Library/Spotlight/iBooksAuthor.mdimporter",
"/Library/Spotlight/iWork.mdimporter",
"/Library/Spotlight/Microsoft Office.mdimporter",
"/System/Library/Spotlight/Application.mdimporter",
"/System/Library/Spotlight/Archives.mdimporter",
"/System/Library/Spotlight/Audio.mdimporter",
"/System/Library/Spotlight/Automator.mdimporter",
"/System/Library/Spotlight/Bookmarks.mdimporter",
"/System/Library/Spotlight/Chat.mdimporter",
"/System/Library/Spotlight/CoreMedia.mdimporter",
"/System/Library/Spotlight/Font.mdimporter",
"/System/Library/Spotlight/iCal.mdimporter",
"/System/Library/Spotlight/Image.mdimporter",
"/System/Library/Spotlight/iPhoto.mdimporter",
"/System/Library/Spotlight/iPhoto8.mdimporter",
"/System/Library/Spotlight/Mail.mdimporter",
"/System/Library/Spotlight/MIDI.mdimporter",
"/System/Library/Spotlight/Notes.mdimporter",
"/System/Library/Spotlight/PDF.mdimporter",
"/System/Library/Spotlight/PS.mdimporter",
"/System/Library/Spotlight/QuartzComposer.mdimporter",
"/System/Library/Spotlight/RichText.mdimporter",
"/System/Library/Spotlight/SystemPrefs.mdimporter",
"/System/Library/Spotlight/vCard.mdimporter",
"/Applications/Microsoft Office 2011/Microsoft Outlook.app/Contents/Library/Spotlight/Microsoft Outlook.mdimporter",
"/Applications/Xcode.app/Contents/Library/Spotlight/uuid.mdimporter",
"/Applications/DjView.app/Contents/Library/Spotlight/DjVu.mdimporter"
)
Pruebas de bmikes
El archivo notes.tex no se puede buscar en el Finder. Lo cambio a notes.txt que ahora puedo buscar en Finder. Esto me propone que no Buscar -problema de programa (Spotlight, md..., lo que sea que utilice, como he descrito muchas veces en los comentarios). Así que tex -problema en el sistema. Salidas del mismo archivo pero con dos terminaciones diferentes. Salida de txt -archivo:
15:42:23:Desktop:masi$ mdls 8.9.2015.txt
kMDItemContentCreationDate = 2015-09-22 13:38:31 +0000
kMDItemContentModificationDate = 2015-09-22 13:38:31 +0000
kMDItemContentType = "public.plain-text"
kMDItemContentTypeTree = (
"public.plain-text",
"public.text",
"public.data",
"public.item",
"public.content"
)
kMDItemDateAdded = 2015-09-22 13:39:22 +0000
kMDItemDisplayName = "8.9.2015.txt"
kMDItemFSContentChangeDate = 2015-09-22 13:38:31 +0000
kMDItemFSCreationDate = 2015-09-22 13:38:31 +0000
kMDItemFSCreatorCode = ""
kMDItemFSFinderFlags = 0
kMDItemFSHasCustomIcon = 0
kMDItemFSInvisible = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery = 0
kMDItemFSLabel = 0
kMDItemFSName = "8.9.2015.txt"
kMDItemFSNodeCount = 62503
kMDItemFSOwnerGroupID = 20
kMDItemFSOwnerUserID = 502
kMDItemFSSize = 62503
kMDItemFSTypeCode = ""
kMDItemKind = "Plain Text Document"
kMDItemLogicalSize = 62503
kMDItemPhysicalSize = 65536
Salida de tex -file:
15:42:27:Desktop:masi$ mdls 8.9.2015.tex
kMDItemContentCreationDate = 2015-09-22 13:38:31 +0000
kMDItemContentModificationDate = 2015-09-22 13:38:31 +0000
kMDItemContentType = "org.tug.tex"
kMDItemContentTypeTree = (
"org.tug.tex",
"public.text",
"public.data",
"public.item",
"public.content"
)
kMDItemDateAdded = 2015-09-22 13:42:37 +0000
kMDItemDisplayName = "8.9.2015.tex"
kMDItemFSContentChangeDate = 2015-09-22 13:38:31 +0000
kMDItemFSCreationDate = 2015-09-22 13:38:31 +0000
kMDItemFSCreatorCode = ""
kMDItemFSFinderFlags = 0
kMDItemFSHasCustomIcon = 0
kMDItemFSInvisible = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery = 0
kMDItemFSLabel = 0
kMDItemFSName = "8.9.2015.tex"
kMDItemFSNodeCount = 62503
kMDItemFSOwnerGroupID = 20
kMDItemFSOwnerUserID = 502
kMDItemFSSize = 62503
kMDItemFSTypeCode = ""
kMDItemKind = "TeX document"
kMDItemLogicalSize = 62503
kMDItemPhysicalSize = 65536
Se buscan comandos:
mkdir /Users/masi/Desktop/masi
18:07:56:~:masii$ cp /tmp/8.9.2015.tex /Users/masi/Desktop/masi/
18:08:09:~:masi$ cd /Users/masi/Desktop/masi/
18:08:16:masi:masi$ echo osteoporosis > test_file.txt
18:08:24:masi:masi$ mdfind osteoporosis |grep /Users/masi/Desktop/masi/
/Users/masi/Desktop/masi/test_file.txt
18:08:47:masi:masi$ mdls -name kMDItemContentType test_file.txt
kdItemContentType = (public.plain-text)
18:09:49:masi:masi$ mv test_file.txt test_file.tex
18:10:14:masi:masi$ mdfind osteoporosis | grep /Users/masi/Desktop/masi/
18:10:20:masi:masi$ mdls -name kMDItemContentType test_file.tex
kMDItemContentType = "org.tug.tex"
Herramientas de diagnóstico actuales que se utilizan y discuten en el chat
Comando bien escondido de ¿Es posible consultar la base de datos de los servicios de lanzamiento para las aplicaciones que abrirán un archivo arbitrario o un tipo de UTI?
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep -n7 org.tug.tex
Encontramos que el TeXShop de MacTeX 2015 no tiene TeX.mdimporter. Instalación de este da en la última línea de mdimport -L
:
"/Applications/TeX/TeXShop.app/Contents/Library/Spotlight/TeX.mdimporter" )
Intento fallido con Patrix
mkdir -p ~/Library/Spotlight; ln -s /Applications/TeX/TeXShop.app/Contents/Library/Spotlight/TeX.mdimporter ~/Library/Spotlight/
tras lo cual rm ~/Library/Spotlight/TeX.mdimporter
y reiniciamos el índice de Spotlight moviendo el HardDisc al panel Prevent y lo quitamos rápidamente, por lo que ahora se tarda en indexar el sistema.
resultados de la respuesta de klanomath que funcionó un día hasta volver al mal estado
Obtengo inestablemente algunos archivos .tex en mdfind. Después de un día de uso desde el init de esta propuesta, la condición volvió al mal estado:
- osteoporosis la búsqueda devuelve los mismos archivos que hace un día, pero me he dado cuenta de que esos archivos, que no han sido visibles en las coincidencias de búsqueda recientemente y bastante tiempo cuando se editaron por última vez, no son visibles en la búsqueda
- sólo se muestran los archivos editados recientemente, y en realidad a veces incluso se muestran archivos de hace 3,5 meses
Corriendo 18:25:06:~:masi$ /usr/bin/mdimport -d3 /Users/masi/Dropbox/Internal\ Diseases/24.9.2015.tex
y conseguir
(Debug) Import: file:/Users/masi/Dropbox/Internal Diseases/24.9.2015.tex plugin:file://localhost/Library/Spotlight/TeX.mdimporter/ /Library/Spotlight/TeX.mdimporter
(Info) Import: edu.uo.texshop.tex
(Debug) Import: Attributes for file /Users/masi/Dropbox/Internal Diseases/24.9.2015.tex: {
":MD:kMDExtendedImportDictionary" = {
};
"_kMDItemFinderLabel" = 0;
"com_apple_metadata_modtime" = 464803819;
kMDItemContentCreationDate = "2015-09-23 19:57:11 +0000";
kMDItemContentModificationDate = "2015-09-24 16:10:19 +0000";
kMDItemContentType = "edu.uo.texshop.tex";
kMDItemContentTypeTree = (
"edu.uo.texshop.tex",
"public.text",
"public.data",
"public.item",
"public.content",
"public.plain-text",
"org.tug.tex"
);
kMDItemDateAdded = "2015-09-23 19:57:11 +0000";
kMDItemDisplayName = {
"" = "24.9.2015.tex";
};
kMDItemKind = {
"" = "TeX File";
en = "TeX File";
pt = "Documento TeX";
};
kMDItemLogicalSize = 18220;
kMDItemPhysicalSize = 20480;
kMDItemTextContent = "\...";
}
2015-09-24 18:25:50.335 mdimport[6875:707] Imported '/Users/masi/Dropbox/Internal Diseases/24.9.2015.tex' of type 'edu.uo.texshop.tex' with plugIn /Library/Spotlight/TeX.mdimporter.
2015-09-24 18:25:50.336 mdimport[6875:707] Attributes: {
":MD:kMDExtendedImportDictionary" = {
};
"_kMDItemFinderLabel" = 0;
"_kMDItemStaticInterestScore" = "0.5";
"com_apple_metadata_modtime" = 464803819;
kMDItemContentCreationDate = "2015-09-23 19:57:11 +0000";
kMDItemContentModificationDate = "2015-09-24 16:10:19 +0000";
kMDItemContentType = "edu.uo.texshop.tex";
kMDItemContentTypeTree = (
"edu.uo.texshop.tex",
"public.text",
"public.data",
"public.item",
"public.content",
"public.plain-text",
"org.tug.tex"
);
kMDItemDateAdded = "2015-09-23 19:57:11 +0000";
kMDItemDisplayName = {
"" = "24.9.2015.tex";
};
kMDItemKind = {
"" = "TeX File";
en = "TeX File";
pt = "Documento TeX";
};
kMDItemLogicalSize = 18220;
kMDItemPhysicalSize = 20480;
kMDItemTextContent = "\...";
}
Adivina el origen del problema: /Volúmenes/Disco/.Spotlight-V100/...
He investigado la dinámica de la memoria en diferentes momentos mediante fdupes -rd /Volumes/Disc2/
, la siguiente muestra es durante la indexación:
[1] /Users/masi/Dropbox/det2/plan.tex
[2] /Volumes/Disc2/.Spotlight-V100/Store-V2/440B4DE1-129F-46AB-9D58-14F473B0282A/Cache/0000/0000/0003/213630.txt
[3] /Volumes/Disc2/.Spotlight-V100/Store-V2/440B4DE1-129F-46AB-9D58-14F473B0282A/Cache/0000/0000/0003/213631.txt
[4] /Volumes/Disc2/.Spotlight-V100/Store-V2/440B4DE1-129F-46AB-9D58-14F473B0282A/Cache/0000/0000/0003/213633.txt
... [10] sometimes much more
---
donde el contenido del archivo son dos líneas vacías. Se ven muchas entradas duplicadas creadas por Spotlight para su índice. El índice de Spotlight tiene muchos duplicados en muchos puntos de su funcionamiento. También he estudiado este comportamiento en diferentes medios. Hay muchos archivos ficticios/duplicados creados durante la indexación y durante el periodo estable en el que se realiza la indexación. Creo que Apple ha hecho un mal trabajo en el diseño del índice que utiliza Spotlight.
¿Cómo se pueden buscar documentos LaTeX con mdfind/Spotlight/Finder?