diff options
| author | Amin Bandali <bandali@kelar.org> | 2024-03-31 21:40:41 -0400 | 
|---|---|---|
| committer | Amin Bandali <bandali@kelar.org> | 2024-03-31 21:51:30 -0400 | 
| commit | 90f051d46a1d9cfbae5d9c2984a96a621ae4a82a (patch) | |
| tree | 30be03a58a2527f25ebb6f195c3c9fee5e1fe91a /.emacs.d/lisp/bandali-po.el | |
| parent | 2fb78b99b55b612fc758397fdd421ae1de8a51ef (diff) | |
| download | configs-90f051d46a1d9cfbae5d9c2984a96a621ae4a82a.tar.gz configs-90f051d46a1d9cfbae5d9c2984a96a621ae4a82a.tar.xz configs-90f051d46a1d9cfbae5d9c2984a96a621ae4a82a.zip | |
Merge .emacs.d/lisp/bandali-*.el into .emacs.d/init.el
Somewhat major overhaul.  Worth mentioning are the b/keymap-* wrappers
added around the newly introduced keymap-* functions in GNU Emacs 29.
Also dropped some mostly unused configs like exwm and org.
Diffstat (limited to '')
| -rw-r--r-- | .emacs.d/lisp/bandali-po.el | 61 | 
1 files changed, 0 insertions, 61 deletions
| diff --git a/.emacs.d/lisp/bandali-po.el b/.emacs.d/lisp/bandali-po.el deleted file mode 100644 index a31fee2..0000000 --- a/.emacs.d/lisp/bandali-po.el +++ /dev/null @@ -1,61 +0,0 @@ -;;; bandali-po.el --- bandali's po-mode setup       -*- lexical-binding: t; -*- - -;; Copyright (C) 2021  Amin Bandali - -;; Author: Amin Bandali <bandali@gnu.org> -;; Keywords: i18n gettext - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program.  If not, see <https://www.gnu.org/licenses/>. - -;;; Commentary: - -;; My po-mode setup for editing PO translation files in GNU Emacs. - -;;; Code: - -(with-eval-after-load 'po-mode -  ;; based on the `po-wrap' function from the GNUN manual: -  ;; https://www.gnu.org/s/trans-coord/manual/gnun/html_node/Wrapping-Long-Lines.html -  (defun b/po-wrap () -    "Run the current `po-mode' buffer through `msgcat' to wrap all -lines." -    (interactive) -    (when (eq major-mode 'po-mode) -      (let ((tmp-file (make-temp-file "po-wrap.")) -            (tmp-buffer (generate-new-buffer "*temp*"))) -        (unwind-protect -            (progn -              (write-region (point-min) (point-max) tmp-file nil 1) -              (if (zerop -                   (call-process "msgcat" nil tmp-buffer t -                                 (shell-quote-argument tmp-file))) -                  (let ((saved (point)) -                        (inhibit-read-only t)) -                    (delete-region (point-min) (point-max)) -                    (insert-buffer-substring tmp-buffer) -                    (goto-char (min saved (point-max)))) -                (with-current-buffer tmp-buffer -                  (error (buffer-string))))) -          (kill-buffer tmp-buffer) -          (delete-file tmp-file))))) - -  (add-hook 'po-mode-hook (lambda nil (run-with-timer 0.1 nil 'View-exit))) -  (define-key po-mode-map (kbd "M-q") #'b/po-wrap)) - -(autoload #'po-mode "po-mode" -  "Major mode for editing PO translation files" t) -(add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode)) - -(provide 'bandali-po) -;;; bandali-po.el ends here | 
