feat(sterni/emacs): function to display texcount for current file
Change-Id: Iae09dd79494d65e4025e1e34ab1d848ef2b9cd47 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5722 Tested-by: BuildkiteCI Autosubmit: sterni <sternenseemann@systemli.org> Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
		
							parent
							
								
									0d694afee4
								
							
						
					
					
						commit
						e86d0101d5
					
				
					 1 changed files with 13 additions and 0 deletions
				
			
		| 
						 | 
					@ -120,6 +120,19 @@
 | 
				
			||||||
                                 "/.config/emacs-custom/pa-jira.el")))
 | 
					                                 "/.config/emacs-custom/pa-jira.el")))
 | 
				
			||||||
        (when (file-exists-p jira-config) (load jira-config))))))
 | 
					        (when (file-exists-p jira-config) (load jira-config))))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;; latex
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(defun latex-word-count ()
 | 
				
			||||||
 | 
					  "Calls texcount on the file the current buffer points to and displays the result."
 | 
				
			||||||
 | 
					  (interactive)
 | 
				
			||||||
 | 
					  (save-buffer)
 | 
				
			||||||
 | 
					  (let* ((file (buffer-file-name)) ; needs to happen outside with-current-buffer
 | 
				
			||||||
 | 
					         (word-count
 | 
				
			||||||
 | 
					             (with-output-to-string
 | 
				
			||||||
 | 
					               (with-current-buffer standard-output
 | 
				
			||||||
 | 
					                 (call-process "texcount" nil t nil "-brief" "-utf8" file)))))
 | 
				
			||||||
 | 
					      (message (string-trim-right word-count))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; ediff
 | 
					;; ediff
 | 
				
			||||||
; doesn't create new window for ediff controls which I always open accidentally
 | 
					; doesn't create new window for ediff controls which I always open accidentally
 | 
				
			||||||
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
 | 
					(setq ediff-window-setup-function 'ediff-setup-windows-plain)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue