|
1 | | -;;; csound-eldoc.el --- A major mode for interacting and coding Csound |
| 1 | +;;; csound-manual-lookup.el --- Browse the Csound manual |
2 | 2 | ;; Copyright (C) 2017 - 2023 Hlöðver Sigurðsson |
3 | 3 |
|
4 | 4 | ;; Author: Hlöðver Sigurðsson <hlolli@gmail.com> |
5 | | -;; Version: 0.2.7 |
6 | | -;; Package-Requires: ((emacs "25") (shut-up "0.3.2") (multi "2.0.1") (dash "2.16.0") (highlight "0")) |
| 5 | +;; Version: 0.2.9 |
| 6 | +;; Package-Requires: ((emacs "27.1") (shut-up "0.3.2") (multi "2.0.1") (dash "2.16.0") (highlight "0")) |
7 | 7 | ;; URL: https://github.com/hlolli/csound-mode |
8 | 8 |
|
9 | 9 | ;; This program is free software; you can redistribute it and/or modify |
|
58 | 58 | ;;; installed locally. |
59 | 59 | ;;; RP Wed Sep 20 19:51:22 2023 |
60 | 60 | ;;; Updated by Brandon Hale April 25, 2026 |
| 61 | +(defgroup csound-mode-manual-lookup nil |
| 62 | + "Csound manual lookup." |
| 63 | + :prefix "csound-manual-" |
| 64 | + :group 'csound-mode) |
| 65 | + |
61 | 66 | (defcustom csound-manual-url |
62 | 67 | "https://csound.com/docs/manual/" |
63 | 68 | "The URL to the root directory of the Csound manual." |
64 | 69 | :group 'csound-mode-manual-lookup |
65 | 70 | :type 'string) |
66 | 71 |
|
67 | | -(defun csound-manual-browse (file) |
68 | | - (browse-url (file-name-concat csound-manual-url file))) |
| 72 | +(defun csound-manual--file-name-concat (directory filename) |
| 73 | + "Return FILENAME under DIRECTORY. |
| 74 | +Use `file-name-concat' when available, and fall back to an Emacs 27 |
| 75 | +compatible implementation otherwise." |
| 76 | + (if (fboundp 'file-name-concat) |
| 77 | + (file-name-concat directory filename) |
| 78 | + (concat (file-name-as-directory directory) filename))) |
| 79 | + |
| 80 | +(defun csound-manual--browse (file) |
| 81 | + (browse-url (csound-manual--file-name-concat csound-manual-url file))) |
69 | 82 |
|
70 | 83 | (defun csound-manual-lookup () |
71 | 84 | (interactive) |
|
74 | 87 | csdoc-opcode-database) |
75 | 88 | (downcase lemma) |
76 | 89 | (read-string "Lookup function in Csound manual: ")))) |
77 | | - (csound-manual-browse (concat lookup-lemma ".html")))) |
| 90 | + (csound-manual--browse (concat lookup-lemma ".html")))) |
78 | 91 |
|
79 | 92 | (defun csound-gen-manual-lookup () |
80 | 93 | (interactive) |
|
85 | 98 | (use-input (if (= (length user-input) 1) |
86 | 99 | (concat "0" user-input) |
87 | 100 | user-input))) |
88 | | - (csound-manual-browse (concat "GEN" use-input ".html")))) |
| 101 | + (csound-manual--browse (concat "GEN" use-input ".html")))) |
89 | 102 |
|
90 | 103 | (defun csound-browse-manual () |
91 | 104 | (interactive) |
92 | | - (csound-manual-browse "index.html")) |
| 105 | + (csound-manual--browse "index.html")) |
93 | 106 |
|
94 | 107 | (defun csound-browse-gen-manual () |
95 | 108 | (interactive) |
96 | | - (csound-manual-browse "ScoreGenRef.html")) |
| 109 | + (csound-manual--browse "ScoreGenRef.html")) |
97 | 110 |
|
98 | 111 | ;;; key binding |
99 | 112 |
|
|
0 commit comments