- Questo topic ha 16 risposte, 3 partecipanti ed è stato aggiornato l'ultima volta 9 anni, 2 mesi fa da
matteo.l.
-
CreatoreTopic
-
22 Giugno 2017 alle 7:34 #110835::
Salve. Come detto in un precedente topic, ho installato latex-preview-pane e funziona tutto alla perfezione. Ho scaricato altre versioni più aggiornate di emacs che utilizzano lo stesso .emacs e gli stessi pacchetti installati per la versione più vecchia. Tuttavia, solo in quest’ultima il pane funziona. Come mai?Grazie. Ciao,
davide
-
CreatoreTopic
-
AutoreRisposte
-
-
22 Giugno 2017 alle 9:40 #110836
-
22 Giugno 2017 alle 13:46 #110837
-
22 Giugno 2017 alle 14:10 #110838
-
26 Giugno 2017 alle 7:35 #110839::
Non è possibile avere più installazioni di emacs indipendenti? Ognuna con il proprio .emacs? In questo modo, ogni distribuzione avrebbe i pacchetti necessari al funzionamento di tutto. Tuttavia, ho visto che l’.emacs di tutte e tre le distribuzioni è sempre lo stesso e si trova nello stesso punto. Magari potendo creare un .emacs in un altro punto…Grazie. Ciao,
davide
-
27 Giugno 2017 alle 15:12 #110840::
Non ti serve avere un file .emacs (o init.el) per ogni versione di emacs. Per avere directory distinte per package basta aggiungere qualcosa come
`
(cond
((eq emacs-major-version 25)
(setq package-user-dir “~/.emacs.d/elpa25”))
((eq emacs-major-version 24)
(setq package-user-dir “~/.emacs.d/elpa24”)))
`
prima di
`
(require-package)
`
aggiustando i valori di versione di emacs secondo le tue necessità. Se ti serve puoi anche usare la variabile
`
emacs-minor-version
`
oppure
`
emacs-version
`Ciao
Matteo
-
28 Giugno 2017 alle 13:00 #110841
-
28 Giugno 2017 alle 13:43 #110842
-
28 Giugno 2017 alle 14:41 #110843::
davidebond” post=111167Ti ringrazio, ma mi dà segnale di errore perché non trova la directory. Così, oltre a non funzionare il latex-preview-pane, non funzionano neppure i colori.
Se hai già dei package installati con una versione devi rinominare la cartella ~/.emacs.d/elpa in modo che sia uguale al valore che dai alla variabile package-user-dir, ad esempio’~/.emacs.d/elpa25 se li hai installati con emacs 25. Un’alternativa è reinstallare i package, così finiscono nella cartella giusta.
davidebond” post=111168Ho riprovato in mille modi. Non mi riconosce il numero della versione. Problemi di parsing…
A che variabile fai riferimento per distinguere la versione? Tieni presente che emacs-major-version e emacs-minor-version sono interi, mentre emacs-version è una stringa, per cui non puoi usare eq ma string-equal. Ho provato ad aggiungere il codice che ho scritto nel mio init.el e riavviando emacs i package che installo automaticamente se non sono presenti sono finiti in ~/.emacs.d/elpa25.
Ciao
Matteo
-
29 Giugno 2017 alle 7:01 #110844
-
29 Giugno 2017 alle 7:04 #110845
-
29 Giugno 2017 alle 11:38 #110846
-
29 Giugno 2017 alle 14:54 #110847::
Credo che la variabile`package-user-dir`debba essere impostata prima che il gestore dei package sia caricato, visto che ottengo il tuo stesso errore se provo a impostarla con emacs in esecuzione. Per questo suggerivo di impostarla in .emacs.Fai una prova, aggiungi all’inizio .emacs il codice che ho indicato, riavvia emacs e prova a installare un pacchetto, dovrebbe creare la directory .emacs.d/elpa25. Se funziona chiudi emacs, elimina la directory appena creata e rinomina .emacs.d/elpa come elpa25 e riavvia emacs. A questo punto dovresti trovare emacs con tutti i pacchetti che avevi già installato. Se avvii un’altra versione di emacs dovrai reinstallare i package che andranno a finire in una directory dedicata.
Per curiosità, quali versioni di emacs vorresti usare?
In ogni caso puoi copiare la directory .emacs.d dove vuoi.
Ciao
Matteo
-
30 Giugno 2017 alle 7:11 #110848
-
1 Luglio 2017 alle 4:17 #110849::
Condavidebond” post=111185
Stesso risultato che usare M-x, etc.intendi il messaggio d’errore “Value ‘elpa2’ does not match type directory of package-user-dir”?
Se sì è molto strano, visto che a me quel codice funziona. Forse usare il percorso completo aiuta. Non so come venga gestita l’espansione di ‘~’ su windows, non avendo una macchina windows su cui provare.Ciao
Matteo
-
3 Luglio 2017 alle 6:59 #110850::
Ho provato anche con il percorso completo. Niente.Ecco il mio file .emacs. Magari ci sono errori:
`
;;(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
;; '(send-mail-function (quote smtpmail-send-it))
;; '(smtpmail-smtp-server “smtp.gmail.com”)
;;'(smtpmail-smtp-service 587))
;;(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
;;);;(setq default-directory “C:/Users/utente/”)
;;(load-theme 'abyss t)
;;(load-theme 'hydandata-light t)
;;(load-theme 'mustard t)
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.;;(setq debug-on-error t)
;;(require 'package)
;;(package-initialize)
;;(setq package-user-dir “~/.emacs.d/elpa2”)
(package-initialize)
(load-theme 'blackboard t)
;;(load-theme 'borland-blue t)
;;(load-theme 'blue-mood t)
(custom-theme-set-faces
'blackboard
'(font-latex-italic-face ((t (:slant italic :foreground “dodger blue”))))
'(bold ((t (:weight bold)))))
'(italic ((t (:slant italic :foreground “dodger blue”))))
'(emphasize ((t (:slant italic :foreground “red”))))(cd “C:/Users/utente”)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(doc-view-continuous t)
'(doc-view-ghostscript-program “gswin64c” t)
'(package-archives
(quote
((“melpa” . “http://melpa.org/packages”😉
(“gnu” . “http://elpa.gnu.org/packages/”))))
'(package-selected-packages
(quote
(use-package-chords pdf-tools yapfify use-package latex-preview-pane auctex)))
'(send-mail-function (quote smtpmail-send-it))
'(smtpmail-smtp-server “smtp.gmail.com”)
'(smtpmail-smtp-service 587))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)(setq TeX-PDF-mode t)
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-method 'synctex)
(setq TeX-view-program-list
'((“Sumatra PDF” (“\”C:/Program Files/SumatraPDF/SumatraPDF.exe\” -reuse-instance” (mode-io-correlate ” -forward-search %b %n “) ” %o”))))
(setq TeX-view-program-selection
'(((output-dvi style-pstricks)
“dvips and start”)
(output-dvi “Dviout”)
(output-pdf “Sumatra PDF”)
(output-html “start”)))(setq doc-view-ghostscript-program “gswin64c”)
;;(setq auto-mode-alist (cons '(“\\.latex$” . latex-mode) auto-mode-alist))
(defun my-latex-mode ()
(visual-line-mode +1)1
(assq-delete-all 'output-pdf TeX-view-program-selection)
(add-to-list 'TeX-view-program-selection '(output-pdf “Sumatra PDF”)))(add-hook 'LaTeX-mode-hook 'my-latex-mode)
(set-default 'preview-scale-function 2)
(defun update-org-latex-fragment-scale ()
(let ((text-scale-factor (expt text-scale-mode-step text-scale-mode-amount)))
(plist-put org-format-latex-options :scale (* 2.3 text-scale-factor)))
)
(add-hook 'text-scale-mode-hook 'update-org-latex-fragment-scale)(add-hook 'LaTeX-mode-hook 'latex-preview-pane-mode)
;;(latex-preview-pane-enable)
(setq doc-view-ghostscript-program “C:/Program Files/gs/gs9.21/bin/gswin64.exe”)
(package-initialize)
`Grazie. Ciao,
davide
-
3 Luglio 2017 alle 15:38 #110851::
Sul mio PC, commentando il codice relativo al tema blackboard (che non ho) e sostituendo il percorso nell’istruzione `(cd “C:/Users/utente”)` in modo che faccia riferimento a una directory che esiste sul mio pc, non ho problemi, a parte un errore http 404 che si risolve aggiungendo la barra finale all’url di melpa nella variabile `package-archives`. Non ho motivo di pensare che le modifiche possano avere un’influenza.Riporto qui sotto il codice che ho usato, anche se è praticamente identico a quello che avevi scritto.
`
;;(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
;; '(send-mail-function (quote smtpmail-send-it))
;; '(smtpmail-smtp-server “smtp.gmail.com”)
;;'(smtpmail-smtp-service 587))
;;(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
;;);;(setq default-directory “C:/Users/utente/”)
;;(load-theme 'abyss t)
;;(load-theme 'hydandata-light t)
;;(load-theme 'mustard t)
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.;;(setq debug-on-error t)
;;(require 'package)
;;(package-initialize)
(setq package-user-dir “~/.emacs.d/elpa2”)
(package-initialize)
;; (load-theme 'blackboard t)
;;(load-theme 'borland-blue t)
;;(load-theme 'blue-mood t)
;; (custom-theme-set-faces
;; 'blackboard
;; '(font-latex-italic-face ((t (:slant italic :foreground “dodger blue”))))
;; '(bold ((t (:weight bold)))))
;; '(italic ((t (:slant italic :foreground “dodger blue”))))
;; '(emphasize ((t (:slant italic :foreground “red”))))(cd “/home/matteo/Scrivania/”)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(doc-view-continuous t)
'(doc-view-ghostscript-program “gswin64c” t)
'(package-archives
(quote
((“melpa” . “http://melpa.org/packages/”😉
(“gnu” . “http://elpa.gnu.org/packages/”))))
'(package-selected-packages
(quote
(use-package-chords pdf-tools yapfify use-package latex-preview-pane auctex)))
'(send-mail-function (quote smtpmail-send-it))
'(smtpmail-smtp-server “smtp.gmail.com”)
'(smtpmail-smtp-service 587))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)(setq TeX-PDF-mode t)
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-method 'synctex)
(setq TeX-view-program-list
'((“Sumatra PDF” (“\”C:/Program Files/SumatraPDF/SumatraPDF.exe\” -reuse-instance” (mode-io-correlate ” -forward-search %b %n “) ” %o”))))
(setq TeX-view-program-selection
'(((output-dvi style-pstricks)
“dvips and start”)
(output-dvi “Dviout”)
(output-pdf “Sumatra PDF”)
(output-html “start”)))(setq doc-view-ghostscript-program “gswin64c”)
;;(setq auto-mode-alist (cons '(“\\.latex$” . latex-mode) auto-mode-alist))
(defun my-latex-mode ()
(visual-line-mode +1)1
(assq-delete-all 'output-pdf TeX-view-program-selection)
(add-to-list 'TeX-view-program-selection '(output-pdf “Sumatra PDF”)))(add-hook 'LaTeX-mode-hook 'my-latex-mode)
(set-default 'preview-scale-function 2)
(defun update-org-latex-fragment-scale ()
(let ((text-scale-factor (expt text-scale-mode-step text-scale-mode-amount)))
(plist-put org-format-latex-options :scale (* 2.3 text-scale-factor)))
)
(add-hook 'text-scale-mode-hook 'update-org-latex-fragment-scale)(add-hook 'LaTeX-mode-hook 'latex-preview-pane-mode)
;;(latex-preview-pane-enable)
(setq doc-view-ghostscript-program “C:/Program Files/gs/gs9.21/bin/gswin64.exe”)
(package-initialize)
`Ciao
Matteo
-
-
AutoreRisposte
- Devi essere connesso per rispondere a questo topic.