texts: I am using olivetti-mode with org-mode, but the screen does not stay fixed to the same width when my cursor moves from  the org text to code between #+begin_src ... #+end_src. Is there a simple fix for that?


texts: I've gotten the Emacs daemon to work through the command line using the EmacsWiki page, but I'm stuck on how to get the client to run through the Gnome 3 launcher. How can I set up a Gnome desktop file that launches a GUI window that connects to the Emacs daemon?


texts: Run application in cwd on remote host from within eshell

texts:
I often use Eshell to connect to remote systems.  On those remote systems I sometimes want to run scripts in the current working directory.  In a regular terminal I'd type this:

./my-script.sh

Unfortunately, inside of Eshell this won't work:

~ $ cd /remote1:~
/ssh:remote1:/home/rekado $ ./my-script.sh
env: /ssh:remote1:/home/rekado/my-script.sh: No such file or directory
/ssh:remote1:/home/rekado $

It only works if I provide the complete TRAMP path to the script:

/ssh:remote1:/home/rekado $ /ssh:remote1:/home/rekado/my-script.sh
It works!
/ssh:remote1:/home/rekado $

Is there a way to convince Eshell to expand . automatically such that the simpler invocation just works?

As a workaround I currently use a function bound to C-c . that inserts the current full path on the command line.  I'd much prefer to have . just behave as expected.


texts: "Error running timer: (wrong-type-argument listp " when debugging in emacs using dap-mode lsp-java

texts:
I've a gradle project imported into emacs using treemacs.
When I try to debug the project I get error -
LSP :: Please open an issue in lsp-mode for implementing `vscode.java.resolveMainClass'.

(error "Timeout while waiting for response. Method: workspace/executeCommand.")
Error running timer: (wrong-type-argument listp #("LSP :: Please open an issue in lsp-mode for implementing `vscode.java.resolveMainClass'.

(error \"Timeout while waiting for response. Method: workspace/executeCommand.\")" 0 3 (face error)))

My emacs details -
$ emacs -version
GNU Emacs 27.1

My OS details -
$ lsb_release -a
LSB Version:    n/a
Distributor ID: ManjaroLinux
Description:    Manjaro Linux
Release:    20.2
Codename:   Nibia


texts: How do you select under emacs the key you sign/encrypt with when using mml?

texts:
Long time mutt user, I am currently trying to learn how to deal with my mail from within emacs with the help of mu4e.

When it comes to signing mail, I use the following

(add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)

which automatically gets the job done.

As I have to manage several different keys / accounts, I am looking for the way to select the key I'll use for signing the message (epa-list-keys gives me three answers).

How do you select under emacs the key you sign/encrypt with when using mml ?


texts:
I'm wondering what is the key to toggle line comment in python, because M-; is not working, although it's the line toggle command mentioned in the docs, despite that it's working with block comments when text is selected.

Any help would be appreciated.

P.S: well I could use C-a and put a # or remove it but I'd like to find out about comment toggle.


texts:
I am looking for method to use two different config files - init files.
First config: when I am coding in full Emacs windows (open file as emacs namefile this define ~/.emacs_conf2)
Second: when I would fast open file (without all packages, only some shortcuts etc) into terminal (commend- emacs namefile - nw this define ~/.emacs_conf2)?

Thanks for answer and explanation of your methods, regards!


texts:
From the Elisp manual:

If an overlay has a category property, we call it the category of the overlay. It should be a symbol. The properties of the symbol serve as defaults for the properties of the overlay.

How can I set the properties of the overlay category?


texts: How can I make documents 'portable' between Emacsen?

texts:
I put 'portable' in quotes because, as we all know, Emacs works with plain text and this plain text is innately portable. However, the format of this plain text is not.

My particular use-case is with Org documents.  I have various customizations set up for Org, but I would like to use the defaults for one particular document as to use a 'neutral third-party' format.  Normally I would use my defaults, but this document is being shared among peer developers – each likely to have their own customizations.

How can I get a list of variables that have been customized in the buffer and insert either (with a C-u prefix) their default values or their local values?


texts:
I have such a structure in my org note

**** pstree
     * ~ $ pstree -aps 26955
systemd,1 splash
  └─systemd,1947 --user
      └─gnome-terminal-,2710
          └─bash,1775
              └─emacs,25135
                  └─bash,26955
~ $ pstree --arguments --show-pids --show-parents 26955
systemd,1 splash
  └─systemd,1947 --user
      └─gnome-terminal-,2710
          └─bash,1775
              └─emacs,25135
                  └─bash,26955

I want to indent the codes region forwards but get  (mark the region and press tab)

**** pstree
     * ~ $ pstree -aps 26955
     systemd,1 splash
     └─systemd,1947 --user
     └─gnome-terminal-,2710
     └─bash,1775
     └─emacs,25135
     └─bash,26955
     ~ $ pstree --arguments --show-pids --show-parents 26955
     systemd,1 splash
     └─systemd,1947 --user
     └─gnome-terminal-,2710
     └─bash,1775
     └─emacs,25135
     └─bash,26955

but I want the whole block keep its structure.

Is it possible to get it done?


texts: Orgmode checkbox-list progress in column-view

texts:
I would like to have a Progress Column in Column view that shows the Checkbox count for headlines / subtasks .

I can make the count show after the subtask / headline by adding the [/] cookie, but I I can't make them show in the Column view.

I have tried several ways, including  the below columns, but none work:

* Project
    :PROPERTIES:
    :COLUMNS:  %COOKIE_DATA %[/] %boxcount{{/}}
    :COOKIE_DATA: checkbox
    :END:
** Task1
    :PROPERTIES:
    :COOKIE_DATA: checkbox
    :boxcount: [/]
    :END:

Now, I have found I can have a checkbox count across tasks when manually putting checkboxes in their properties, but I would like to know how to automatically propagate the Checkbox-list count that appears behind a headline when putting a [X] or [X] macro into column view


texts: Wait for specific keypress in a function (press enter to continue)

texts:
I have a function to underline Chinese characters with zero width spaces in org-mode.

(defun ctext-uline-begin ()
  "Underscore with invisible space before for underlining Chinese texts."
  (insert "_"))

(defun ctext-uline-end ()
    "Underscore with invisible space after for underlining Chinese texts."
  (insert "_"))

(defun ctext-underline()
  (interactive)
  (if (region-active-p)
      (progn
          (goto-char (region-end))
          (ctext-uline-end)
          (goto-char (region-beginning))
          (ctext-uline-begin)))
  (progn
    (ctext-uline-begin)
    (read-event "Press Enter to Complete.")
    (ctext-uline-end)))

The function wraps "_" with zero width spaces around the Chinese characters when region is active.

When no region is selected, I'd like it to insert uline-begin, wait for user to hit RET, then insert uline-end.

The above function almost did it.

How do we get the user to 'Press Enter to Continue' in Elisp?


texts: How to "copy" Scheme or Lisp code from one window to another window in Emacs?

texts: I saw a teacher in iTunes U doing this: have 2 windows open in Emacs, the top is the Scheme (or Lisp) source code, and the bottom is the Scheme interpreter.  He seems to press something on the keyboard and the whole Scheme statement will be copied down to the buffer below.  How is that done?


texts: Integrate rust-clippy into Emacs Rust development

texts: rust-clippy is a linter for Rust. Is there an existing package or idiom that integrates it into an Emacs Rust workflow, the way emacs-racer integrates racer?


texts: trouble installing some packages from MELPA... premature EOF parsing tar file

texts:
I am running into trouble installing smart-mode-line and ox-hugo. I use M-x list-packages, select package I want with I, and then execute with X.
The error in Messages buffer looks like:
Contacting host: melpa.milkbox.net:80
Parsing tar file...
Warning: premature EOF parsing tar file
package-untar-buffer: Package does not untar cleanly into directory smart-mode-line-20190527.1156/

But, I didn't have a problem updating org package.
I tried this with Emacs 26.3 and 27.1.1 (both from emacsformacosx.com) on macOS.
The problem is similar to one reported here almost a year ago.
Any suggestions please?


texts: Save lock-files to a directory instead of disabling them

texts:
Emacs 24 introduced the ability to disable the creation of the infamous .#file-name lock  files.

Evaluating the following lisp form will completely disable Emacs ability to lock files to prevent concurrent changes.

Is there a way to set Emacs to save lock files in a dedicated directory, similarly to what happens with auto-save and backup files?

(setq create-lockfiles nil)


texts:
Q: how can I disable the "now" line in an org-mode agenda view?

When displaying a time grid in the agenda, org-mode displays, by default (or so I assume), a line with the current time listed as "now":

Day-agenda (W03):
Monday     12 January 2015 W03
               8:00am........ ----------------
              10:00am........ ----------------
              12:00pm........ ----------------
(THIS LINE)   12:34pm........ now - - - - - - - - - - - - - - - - - - - - - - - -
               2:00pm........ ----------------
               4:00pm........ ----------------
               6:00pm........ ----------------
               8:00pm........ ----------------

I want to remove the "now" line.  How does one turn it off?  Unless I missed something, there's no obvious setting in org-agenda-time-grid (or related variables) to disable "now."


texts: How can I edit read-only text after pasting?

texts:
I want to create a buffer where some parts are editable, but others are not. I'm using the read-only string property to do this, e.g.:

(with-current-buffer (get-buffer-create "*scratch-demo*")
  (insert ";; you can edit me\n")
  (insert (propertize
           ";; but you cannot edit me\n"
           'read-only t)))

If I paste the second line into a buffer in fundamental mode, I can edit it.

this buffer is in fundamental mode
;; but you cannot *foo* edit me

However, if I paste the second line into an emacs-lisp-mode buffer, I cannot edit it.

;; this buffer is in emacs-lisp-mode
;; I cannot modify the line below:
;; but you cannot edit me

How can I ensure users can edit text, which has been yanked from read-only portions of my buffer?


texts: execute-kbd-macro apparently not working according to its doc?

texts:
The doc of execute-kbd-macro says:

  (execute-kbd-macro MACRO &optional COUNT LOOPFUNC)
  ...
  If MACRO is a symbol, its function definition is used.

I tried M-: (execute-kbd-macro 'ignore).
That bailed out with the following error message:

  Keyboard macros must be strings or vectors

That happens with
emacs-version GNU Emacs 26.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-04-12.

Is that an Emacs bug, a documentation bug, or do I misunderstand something?

Might it be that the function definition of the symbol must be a keyboard macro?
At least the following code works:

(fset 'a (kbd "myfun"))
(execute-kbd-macro 'a)

Background: I wanted to use apply-macro-to-region-lines on a command in an answer about applying comment-indent on a region.


texts: How do I do live Markdown previewing as I'm writing it?

texts:
How can I do that either in a different buffer or even in the current buffer?

I'm trying to do Github README.md and other Github rendering of Markdown (for notes and such),


texts: org table apply formula from specific row onwards

texts:
| BookmarkLevel | BookmarkPageNumber | ActualPageNumber |
|---------------+--------------------+------------------|
|             1 |                 11 |                  |
|             2 |                 11 |                  |
|             2 |                 34 |                  |
|             1 |                 59 |                  |
|             2 |                 59 |                  |
|             3 |                    |                3 |
|             3 |                    |               10 |
|             2 |                    |               17 |
|             3 |                    |               17 |
|             3 |                    |               29 |
|             3 |                    |               35 |
|             3 |                    |               39 |
|             3 |                    |               43 |
|             4 |                    |               43 |
|             4 |                    |               45 |

#+tblfm: $2=$3+58
Where BookmarkPageNumber is empty, I would like to use ActualPageNumber (from the TOC) to calculate its values (by adding a constant to it). How should tblfm be written for the effect?


texts:
I use AucTeX to edit LaTeX files and a PDF viewer that supports inverse search using SyncTeX. When I click on a location in the PDF, it simply calls emacsclient with the corresponding file and line. Often I want to make a quick change and jump back to where I was before. Unfortunately, point is not pushed to the mark ring, so I have to navigate back manually.

Is there any way to have emacsclient set the mark before jumping in an already opened file?


texts: Shortcut to actual previous line in markdown mode, or end of section

texts:
I use markdown-mode and often fold the tree. I sometimes need to go to the last line of a tree, e.g. if I adjust the tree heading and then want to work at the last leaf. I suppose a shortcut can take me to the last line of a subtree. Alternatively, I could fold the subtree, go to the next heading, and go up one line (C-p or previous-line), but it goes to the previous visible line, not the actual previous line.

How can I go to the last line under a heading at point, or go to the actual previous line of the next heading?


texts: Ipython as run-python binary, no tab complete

texts:
I've been using the standard python repl in emacs for a while and decided to change to use ipython with all of it's autocompletions and other features. Unfortunately, if I try using ipython in multi-term, tab completion breaks. So I tried using ipython as the binary for run-python, but even there, tab completion doesn't work. This is even with emacs -q and configuring run-python to use ipython after emacs has started up.
Anyone encounter this?


texts: How to stop main wrapping when tangling C in org-babel?

texts:
Please consider the following self-contained, minimal example org file:

#+name: zepto-c
#+CAPTION: A tiny C file
#+begin_src C++ :tangle zepto.c
#include "zepto.h"
void foo (void) {}
#+end_src

#+name: zepto-h
#+CAPTION: A tiny header file
#+begin_src C++ :tangle zepto.h
#include <stdio.h>
void foo (void);
#+end_src

On org-babel-tangle, it produces the expected two files, zepto.c and zepto.h, but they contain wrappers with main:

zepto.c:

int main() {
#include "zepto.h"
void foo (void) {}
return 0;
}

zepto.h:

int main() {
#include <stdio.h>
void foo (void);
return 0;
}

I just want org-babel to tangle out exactly what I wrote, with no modifications. I have tried many combinations of headers :eval, :results, :exports, :tangle, and :noweb from the documentation, even trying verbatim values for them in the hopes that some undocumented feature will give me the results I want, but no luck. The space of all possibile values for those headers is combinatorially large, so it could take me a long time to try them all. Perhaps someone knows the correct incantation?

I will be grateful for any advice.


texts: I am obviously not well versed in the world of Emacs so I was watching Casey Muratori's Emacs video and whenever he traversed any file in Emacs, the current line always had a different background color to the rest of the file. I want that because the cursor alone is sometimes difficult to see especially when the screen is filled with code and all that. I want the entire line to be distinguishable. How can I achieve that?


texts: How does one write assertions in Emacs Lisp?  I know that cl-macs.el has cl-assert and cl-check-type, but I'm wondering if there's a native Emacs way to perform something that basic.


texts: Projectile command for debug and release

texts:
My google searches aren't turning up anything useful, but I am trying to figure out how I" can use projectile-project-compilation-cmd to be able to dynamically switch between release and debug with cmake, ie I would like to be able to somehow do a theoretical projectile-project-compilation-cmd-debug, projectile-project-compilation-cmd-release, but I have no idea how to go about doing this.

Thanks for suggestions!


texts: How can I stop an overlay from inheriting the properties of underlying text?

texts:
I'm using an overlay to display additional information next to Dired candidates, because modifying the Dired buffer directly prevents Dired from working properly. I'm displaying the text using a propertized string in the before-string property of the overlay.

I've given the string a face. The problem is, it inherits properties from the underlying text when they are unspecified in the face. For example, let's say Dired is displaying a file with a strikethrough. If the overlay is placed at the start of that file, the overlay will display the before-string with a strikethrough.

Here is the code for creating a dummy overlay:

(let ((current-overlay (make-overlay (point) (point)))
                  (info-string (propertize "[dummy info]"
                                            'face 'my-dired-numbers-face)))
              (overlay-put current-overlay 'before-string info-string))

The whole function is as follows:

(defface my-dired-numbers-face
  '((t :inherit 'font-lock-keyword-face
       :weight bold :background nil :strike-through nil))
  "The face used to display selection numbers to the user.")

(defun my-dired-insert-numbers (&rest _)
  (if my-dired-number-overlays
      (mapc (lambda (overlay)
              (delete-overlay overlay))
            my-dired-number-overlays))
  (setq my-dired-number-overlays '())
  (save-excursion
    (let ((n 1)
          (old-point (point))
          (end-of-buffer 0))
      (goto-char 0)
      (while (= end-of-buffer 0)
        (if (dired-move-to-filename)
            (let ((current-overlay (make-overlay (point) (point)))
                  (number-string (propertize (my-dired-format-string (number-to-string n) 3)
                                             'face 'my-dired-numbers-face)))
              (overlay-put current-overlay 'after-string number-string)
              (setq n (1+ n))
              (push current-overlay my-dired-number-overlays)))
        (setq end-of-buffer (forward-line))))))

Does anyone know how to override this behaviour? Can I get my before-string to display without inheriting any properties?

Edit: I've managed to get around this problem by passing default as the lowest-priority face to propertize. This explicitly sets all undefined properties to those of the default face (overriding the inherited properties). This is the relevant line:

(number-string (propertize (my-dired-format-string "[dummy string]"
                            'face '(my-dired-numbers-face
                                    default)

This seems like a hacky solution though. Is there an intended way to do this?


texts: mac-os-x call-processappears to execute as UID 0, breaks exec-path-from-shell-initialize

texts:
My emacs and shell:

.rc/zshell [master●] » emacs --version                      ▸▸▸▸▸▹▹▹▹▹ 22:17:29
GNU Emacs 26.3
Copyright (C) 2019 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
.rc/zshell [master●] » $SHELL --version                     ▸▸▸▸▸▹▹▹▹▹ 22:18:26
zsh 5.7.1 (x86_64-apple-darwin18.2.0)

I am using exec-path-from-shell v20191229.112 from MELPA, installed via the Emacs package manager.

I invoke (exec-path-from-shell-initialize) in my .emacs file, but it always appears to effectively initialize to "sh -c 'printf $PATH'".
After looking over the code, it looks like exec-path-from-shell-printf() invokes:

(call-process "/usr/local/bin/zsh" nil t nil "-i" "-l" "-c" "/usr/bin/printf '__RESULT\\000%s\\000%s\\000__RESULT' \"${PATH-32a4a9eb7fbd9349eb5afaaa063927ce}\" \"${MANPATH-32a4a9eb7fbd9349eb5afaaa063927ce}\"")
__RESULT�/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_14:/Applications/Emacs.app/Contents/MacOS/libexec-x86_64-10_14�/usr/share/man:/usr/local/share/man:/Library/TeX/Distributions/.DefaultTeX/Contents/Man�__RESULT0

If my actual scripts were invoked, I expect more output and tracing from my zsh init scripts, and a much larger PATH.  A small snippet to illustrate below:

% /usr/local/bin/zsh -i -l -c '/usr/bin/printf "PATH %s\n" "$PATH"'
:         _zshenv_00_timing 0.004531 -- 0.010184    0.005653
:           _zshenv_05_init 0.010355 -- 0.016539    0.006184
...
:       _zshrc_85_utilities 0.427664 -- 0.430055    0.002391
:         _zshrc_90_nethack 0.430167 -- 0.432548    0.002381
:       _zshrc_99_ckupdates 0.432658 -- 0.448017    0.015359
PATH /Users/kvaradhan/bin:/usr/local/bin:/Users/kvaradhan/sbin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/Users/kvaradhan/Sync/src/go-libs/bin:/usr/local/Users/kvaradhan/Sync/src/go-libs/sbin:/usr/local/fungible/bin:/usr/local/fungible/sbin:./bin:./sbin:../bin:../sbin

I am puzzled.  This:

(call-process "/usr/local/bin/zsh" nil t nil "-i" "-l" "-c" "/bin/ps -fx $$")
  UID   PID  PPID   C STIME   TTY           TIME CMD
    0 71582 47588   0 11:35PM ??         0:00.01 /bin/ps -fx 71582
0

is the final bit that leaves me flumoxxed.  How and why is the UID 0 for calls invoked by call-process?  Is that even expected?

Kannan

With questions from @lawlist, removed the .emacs file, so only stock emacs:

(call-process "/bin/sh" nil t nil "-i" "-l" "-c" "/usr/bin/printf '__RESULT\\00\
0%s\\000%s\\000__RESULT' \"${PATH-32a4a9eb7fbd9349eb5afaaa063927ce}\" \"${MANPA\
TH-32a4a9eb7fbd9349eb5afaaa063927ce}\"")
__RESULT/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_14:/Applications/Emacs.app/Contents/MacOS/libexec-x86_64-10_1432a4a9eb7fbd9349eb5afaaa063927ce__RESULT0

(call-process "/usr/local/bin/zsh" nil t nil "-i" "-l" "-c" "/bin/ps -fx $$")
  UID   PID  PPID   C STIME   TTY           TIME CMD
    0 72953 72799   0 11:40PM ??


texts: Export to multiple files according to tags

texts:
I am using org mode to build teaching presentations (through beamer export) and I have a global document containing all the slides I use. Each slide has a tag to indicate the corresponding teaching session. For example (file sample.org) :

* My document
*** Item 1 :s1:
- First slide of session 1
*** Item 2 :s2:
- First slide of session 2
*** Item 3 :s1:
- Second slide of session 1

I want to build per session presentations i.e. to build a specific export file for a given set of tags (in the example, a file s1.pdf for tag s1 and another one s2.pdf for tag s2). I currently use the following code block to to this:

#+BEGIN_SRC emacs-lisp :results none
(let ((org-export-select-tags '("s1")) (async nil) (subtreep nil) (visible-only nil) (body-only nil) (ext-plist '())) (org-beamer-export-to-pdf async subtreep visible-only body-only ext-plist))
(cond ((file-exists-p "s1.pdf") (delete-file "s1.pdf")))
(rename-file "sample.pdf" "s1.pdf")
(let ((org-export-select-tags '("s2")) (async nil) (subtreep nil) (visible-only nil) (body-only nil) (ext-plist '())) (org-beamer-export-to-pdf async subtreep visible-only body-only ext-plist))
(cond ((file-exists-p "s2.pdf") (delete-file "s2.pdf")))
(rename-file "sample.pdf" "s2.pdf")
#+END_SRC

I would like to know if it is possible to launch org-beamer-export-to-pdf directly with a target file name (to avoid the delete/rename instructions) and also if it could be possible to launch the exports in parallel.

EDIT:

As suggested by @Nick in his comment, I wrote a function to simplify the code and make it easier to read/use:

(defun export (tagname)
   "Export to a file named tagname.pdf all the headlines tagged with tagname"
      (let ((org-export-select-tags (list tagname)) (async nil) (subtreep nil) (visible-only nil) (body-only nil) (ext-plist '()))
             (org-beamer-export-to-pdf async subtreep visible-only body-only ext-plist)
    )
      (cond ((file-exists-p (concat tagname ".pdf")) (delete-file (concat tagname ".pdf"))))
      (rename-file "sample.pdf" (concat tagname ".pdf"))
)

(export "s1")
(export "s2")

However the problem for the asynchronous call is that all exports build a single file called sample.pdf and this makes it necessary to make the exports successively. I was wondering if there is a way to give directly a target file name to the exporter to make asynchronous call possible.

EDIT2:

Following the recommendations of Nick, I now do not have to use the intermediate sample.pdf file:

(defun export2 (tagname)
   "Export to a file named tagname.pdf all the headlines tagged with tagname"
      (let ((org-export-select-tags (list tagname)) (async nil) (subtreep nil) (visible-only nil) (body-only nil) (ext-plist '()))
           (org-export-to-file 'beamer (concat tagname ".tex") async subtreep visible-only body-only ext-plist (lambda (file) (org-latex-compile file))))
)

(export2 "s1")
(export2 "s2")


texts:
I have installed visidata and am trying to integrate into my Emacs workflow through term-mode. As a proof of concept, I'm trying to successfully explore the mtcars data set as it would work when started *ansi-term*. That's not good enough for me since I would like to write additional functionality to integrate this into another program in Emacs (ESS).
(term-ansi-make-term "*vd<mtcars>*" "vd" nil "/path/to/mtcars.csv")

When I run this the vd table appears in the vd buffer, but none of the keybindings actually work. What am I missing?
Ideally, when I am done interactively exploring the data in vd, I could press q repeatedly until all "sheets" exit and automatically close the buffer when the process ends. Is there some existing emacs functionality which would make this possible?


texts: I've found myself using the eww web browser more and more for text-based sites (e.g., documentation, news, etc.) This is great because I don't have to load an external GUI browser and leave emacs. Meanwhile, I've created a fairly large set of eww bookmarks over time. The problem is that I have some duplicates as well as some bookmarks that are no longer operational or relevant. How do I go about deleting these? Better yet, how can I organize these? The eww documentation is rather weak and nothing jumped out at me as for what to do. So does anybody have a bookmark solution for eww already?


texts: How to remove individual sources from auto-complete's ac-sources in a specific major-mode

texts:
auto-complete automatically adds a number of sources to ac-sources:

(ac-source-features ac-source-functions ac-source-variables ac-source-symbols)

And I set up auto-complete default ac-sources like this:

(ac-source-yasnippet ac-source-abbrev ac-source-filename ac-source-files-in-current-dir
 ac-source-capf ac-source-gtags ac-source-words-in-same-mode-buffers)

But I found that some sources listed in ac-sources complete the same thing. For example, I get the following completions for (setq):

ac-source-functions shows: setq f
ac-source-symbols shows: setq s
ac-source-capf shows: setq s
ac-source-words-in-same-mode-buffers shows: setq

I want to disable the following sources only in emacs-lisp-mode:
ac-source-symbols, ac-source-capf.

How can I do this?

(If you know of any other way to solve my problem, please leave a comment. Thanks.)


texts: How to debug hanging emacs-async command?

texts:
I'm trying to set up a function running on my timer to refresh my org-gcal files by using the emacs-async library as follows:

(async-get
 (async-start
  `(lambda ()
     ,(async-inject-variables "load-path")
     (require 'org)
     (require 'alert)
     (require 'request-deferred)
     (require 'org-gcal)
     (setq deferred:debug t
           async-debug t)
     ,(async-inject-variables
       "\\`org-gcal-")
     (org-gcal-fetch))
  'ignore))

However, when I actually run this, the async-get command (which waits for the async process to complete) hangs forever. When I run org-gcal-fetch in my normal Emacs process, it completes within a few seconds. Is there any way to set up a debug trace of the functions that are being run in the async process so I can debug where it's getting stuck?


texts: Export to HTML presentation using reveal

texts:
I'm completely new to Emacs (just saw a presentation made with that using export to HTML presentation via reveal). I'm not able to find a way how to setup Emacs to show the option Export to HTML presentation, which was active on my colleagues laptop. I'm using Windows 10. Would you please give me a guide or point me somewhere, where I can find each and every step?

Thank you.


texts: How to determine the initial current directory when emacs is run from command line?

texts: How can I determine (from within Emacs) the current directory as it was when the Shell launched emacs from the command line?


texts: How can I reclaim "nth" for bash in eshell?

texts:
In bash I commonly use an alias 'nth' (hint: it makes sense as a key-combo if you use Dvorak layout). When I type this in eshell, I see:

~ $ nth
usage: nth: (N LIST)

How can I get eshell ignore nth as a lisp command?


texts: Function acts differently when I call it by M-x and when I call it by load-file/library

texts:
I've got this function:

(defun move-pointer ()
  (interactive)
  (let ((enable-recursive-minibuffers t))
    (read-string "Go to the main buffer, Move cursor where you like. Come back in the minibuffer, then RETURN: ")
    ))

If I evaluate and then call it by M-x move-pointer the pointer maintains its last position.

When I save it in a file, this way:

(defun move-pointer ()
      (interactive)
      (let ((enable-recursive-minibuffers t))
        (read-string "Go to the main buffer, Move cursor where you like. Come back in the minibuffer, then RETURN: ")
        ))

(move-pointer)

and I call it by M-x load-file RETURN myfile.el the pointer acts as the function was wrapped with save-excursion. I mean the pointer revert to its initial position.

Why does it happen?
How can I keep the pointer position when I call my script?


texts: Automatically update a date in tangled files of an .org file?

texts:
I'm in the process of writing a LaTeX class using org-babel for the literate programming. In several places of the file .org file, I have to insert the release date of this class, at least in the tangled README.md file like this:
Release
-------
2021-05-10 v1.0.0-alpha

and in the tangled .cls source file of the class, like this:
\ProvidesExplPackage{my-nice-class}
{2021-05-10}
{v1.0.0-alpha}
{
  Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
}

Because I'm likely to forget to update this date before the actual release, I'd like it to be automatically updated each time the .org file is saved (in the same spirit as Inserting and Updating Copyrights).
Is it possible?
Edit
In order to make clearer my question, here is a minimal example of my org-mode file:
#+TITLE:     My Nice Class
#+LANGUAGE:  en
#+OPTIONS:   num:t toc:nil

#+LaTeX_CLASS: article
#+LaTeX_CLASS_OPTIONS: [11pt,english]

#+LaTeX_HEADER: \usepackage{babel}

#+PROPERTY: header-args :padline no :tangle my-nice-class.cls :exports both :noweb yes :eval always

#+begin_src markdown :tangle README.md :exports none
  my-nice-class
  =============================================================

  About
  -------
  This class is mine and nice!

  Release
  -------
  2021-05-10 v1.0.0-alpha
#+end_src

#+begin_src latex
\ProvidesExplClass{my-nice-class}
{2021-05-10}
{v1.0.0-alpha}
{
  A nice class
}
#+end_src


texts:
I often create short articles for myself, which are mostly extracts from other articles on the Web.  For such articles I usually add a source link simply like this:

[[http://example.com/article][Source]]

Is there an “official” way to do this, like a property or #+ keyword?  If it reflects in exported files (I use HTML and rarely Markdown), the better.


texts: How do I work out what the problem is with the emacs package system?

texts:
I am trying to set up emacs (on cygwin / Win10) to handle JSON.

I started with joshwnj/json-mode and was stoked to discover that emacs will now install its own dependencies from online repos. Fab stuff.

I can run M-x package-install but I notice it logs the message:

Contacting host: elpa.gnu.org:80
Failed to download ‘gnu’ archive.

And when I type in json-mode, emacs says there's no match. Is this a connection problem? Should I see an HTTP error somewhere?

joshwnj/json-mode says I need the MELPA repository set up.

According to this documentation for MELPA I need to identify if I'm using package.el (which looks good) and work out if the given lisp code is in place.

Is there a command I can run in emacs to tell me if this code is in place?

Trying to following on and ignoring that issue, I tried M-x package-list-packages and got the following error:

You can run the command ‘package-list-packages’ with M-x pa-l- RET
Waiting for refresh to finish...
Package refresh done
No packages to upgrade.
error in process sentinel: Error retrieving: http://elpa.gnu.org/packages/archive-contents (error connection-failed "failed with code 10060
" :host "elpa.gnu.org" :service 80)
error in process sentinel: Error retrieving: http://elpa.gnu.org/packages/archive-contents (error connection-failed "failed with code 10060
" :host "elpa.gnu.org" :service 80)

Is the sentinel process critical? Did the package refresh work?

What should I try next?


texts: Emacs opens files with wrong line end encoding

texts:
Whenever I open a file encoded with dos end lines, Emacs decides it's encoded in undecided_linux and displays ^M after each line.

I checked, those files all have matching newline characters (no odd ^J without a preceding ^M).

I have set the following:

(setq-default buffer-file-coding-system 'utf-8-dos)
(prefer-coding-system 'utf-8-dos)

When I test buffer-file-coding-system in a file, I get:

buffer-file-coding-system is a variable defined in ‘C source code’.
Its value is ‘undecided-unix’
Local in buffer foo; global value is utf-8-dos

  Automatically becomes permanently buffer-local when set.

I'm using:

GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30
Prelude (commit ID 63c697c2f4ca3cc8b8329f70a3b6ed474db312d5, Jan 1 2019, with some minor personal tweaks of mine).

This started recently, I'm pretty sure I didn't change anything in configuration or versions before it started happening.

Did anyone have such problems? Or should I just update Emacs and Prelude in hopes it's fixed?


texts: Temporarily restrict editing to whitespace only

texts:
Sometimes I make whitespace cleanups to source code.  I'd like to be certain that I do not accidentally introduce real code changes (let us assume that the programming language is one where removing or adding white space never changes the meaning of code).

Is there a minor mode that sets Emacs to only allow whitespace changes in a particular buffer?  So I'd be able to delete white space characters (space, tab, newline etc) and add ones, but not make any other alterations to the buffer content.

(A more advanced mode would allow changes in the length of white space sequences, and allow introducing and deleting it around punctuation characters, but disallow breaking a word token (defined as, say, a sequence of characters in [A-Za-z0-9_]) by adding new spaces in the middle, nor fusing two separate word tokens by deleting the white space that separated them.  But this is not essential.  Most programming languages will make it pretty obvious if you accidentally change 'int x;' to 'intx;'.)


texts:
In c-mode comment-region is adding /* */ style comments.

Is there a way to default to using C++ style // prefix in C source files instead?


texts:
I often paste org-mode tables numbers that are e.g. space-separated. Then I have to delete spaces before things like =$2/2 work correctly. Is there a way to change "number format", e.g. plug in a general function to parse input numbers in org-mode tables?

As an example, I'd like

| 100 000 | 0 |
#+TBLFM: $2=$1/2

to give 50000, not 0, in column two (I don't care that the output is not space-separated).

I know about ;N, but that doesn't work either:

| 100 000 | 50 |
#+TBLFM: $2=$1/2;N

and I'd rather have something that works on the full table because I'm sure to forget to put it on each formula.


texts: ESS - how to disable sublimity mode for R console only?

texts: Is there a way to keep sublimity mode for R source buffers, while disabling it for the R console?


texts:
Trying to make a small example on how to do IPC with Elisp using Python for the server. My source of information is this
Here is the code I have right now.

my-process.el

(let ((process-connection-type nil)
      (arguments (list "./server.py")))
  (apply 'start-process "my-process" "*my-process-buffer*" "python" arguments)
  (set-process-filter (get-process "my-process") 'my-callback))

(defun my-callback (process msg)
  (message msg))

(defun kill-my-process ()
  (interactive)
  (delete-process "my-process"))

(defun send-to-my-process (msg)
  (interactive "sEnter message: ")
  (process-send-string "my-process" (concat msg "\n")))

(provide my-process)

server.py

import sys

sys.stdout.write("STARTING MY PROCESS!")
sys.stdout.flush()
for line in sys.stdin:
    sys.stdout.write(line)
    sys.stdout.flush()

The problem I have is that the process starts ok, but I can only see "STARTING MY PROCESS!" printed nothing when I do send-to-my-process.

My question is, what do I need to change in order for messaging to work in the above example?

Update:
Added suggested fixes.


texts: Word delimiters in standard syntax table

texts:
I'm trying to configure other programs to emulate Emacs.

I know Emacs' word delimiters are:

User configurable
Mode dependent

But I'd still like to know what the default word boundary characters are. Because they are configurable and variable, I haven't found any lists.

I would love a list of the default word separators in emacs-lisp-mode. Of course, a description of how the delimiters vary by mode would be awesome too.


texts: right click for menu with choices (to change font size)?

texts: I am using emacs 26.1 under macos.  when I right-click with the mouse, emacs seems to want to select the region.  alas, I would prefer to see a popup menu where I can select a few choices that I would like to choose---save file, close buffer, increase font size, decrease font size, change fore/background theme.  is this possible?


texts: How to show org-clock (and org-pomodoro) timer in mode-line?

texts:
I tried the following methods in my custom mode-line, but they all failed.

(setq mode-line-format
      (:propertize
       ;; TODO: concatenate the long string.
       ;; global-mode-string
       ;; (t org-mode-line-string org-timer-mode-line-string)
       ;; (t org-timer-mode-line-string) ; org-timer default time 25, (Pomodoro time management technique)
       ;; (:eval org-clock-mode-line-timer)
       ;; face (:foreground "cyan" :weight 'bold)
       ))


texts: Pinboard website (i.e., non-Emacs) bookmark editing in Emacs

texts:
I recently switched over to pinboard.in for organizing website bookmarks. I'm looking for a way to organize my bookmarks in Emacs. I've installed the pinboard-api package but I can't seem to find any of the pinboard commands in the helm autocomplete menu.

I've also looked at using the pinboard-list.el package that's hosted on github. But it doesn't seem to be maintained. Perhaps I'm manually loading the package wrong. I'm loading it with the following in the user-config section of my ~/.emacs file. I know it's kind of crude but it should get the job done:

(load-file "~/elisp/pinboard-list.el" )

Does anyone have experience with these packages? Or is there a different package you'd recommend more? Or some documentation that shows how to load the package and set up good keybindings for the functions?

I'm really just looking to bulk-edit website bookmarks and add multiple tags.


texts: How to avoid export org-mode header title

texts:
I am translating a quite flat document (only has a title as a level 1 heading). I am using org-mode and I am creating a level 2 heading for each page to easily find the content when I am reviewing the translation which makes the process easier.

I wonder if there is a way to export the full document to PDF/HTML and not include the level 2 headings TITLE but indeed include the full content within the level 2 heading. I need to ingore only level 2 heading titles.

Thanks.

Herewith an example:

* The document title

** DONE Pag 1

bla bla...

** TODO Pag 2

...more bla bla...

Desired output:

* The document title

bla bla...

(new page)

...more bla bla...


texts:
I´ve just installed emacs 24.4 and tried to process my files, in this case, an org-File. When it comes to export (as pdf for example), the new emacs behaves completely different, it is not able to process my org-mode files anymore. The error-messages are unclear, like

"replace-regexp-in-string: Invalid use of `\' in replacement text".

Since emacs and org-mode is my main editing tool, if i can´t process my "old" files, i have to go back to the old emacs (24.3).

Example Code:

#+TITLE:     Atmel atmega328p Register
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LaTeX_CLASS_OPTIONS: [captions=tableheading]
#+LaTeX_CLASS_OPTIONS: [article,letterpaper,times,12pt,listings-bw,microtype]
#+LaTeX_CLASS_OPTIONS: [captions=tableheading]
#+LaTeX_CLASS_OPTIONS: \usepackage{hyperref}
#+LaTeX_HEADER:  \headheight=0pt
#+LaTeX_HEADER:  \oddsidemargin=-1cm
#+LaTeX_HEADER:  \topmargin=-1cm
#+LaTeX_HEADER: \usepackage{placeins}
#+STARTUP: showall

* ATMega328P Register

** TCCR0A – Timer/Counter Control Register A

#+CAPTION: TCCR0A – Timer/Counter Control Register A
#+NAME:   tab: TCCR0A
#+attr_latex: align=|l|c|c|c|c|c|c|c|c|
|--------------+--------+--------+--------+--------+----+----+-------+-------|
| Bit          |      7 |      6 |      5 |      4 |  3 |  2 |     1 |     0 |
|--------------+--------+--------+--------+--------+----+----+-------+-------|
| 0x24 (0x44)  | COM0A1 | COM0A0 | COM0B1 | COM0B0 | -- | -- | WGM01 | WGM00 |
| Read/Write   |    R/W |    R/W |    R/W |    R/W |  R |  R |   R/W |   R/W |
| InitialValue |      0 |      0 |      0 |      0 |  0 |  0 |     0 |     0 |
|--------------+--------+--------+--------+--------+----+----+-------+-------|

*** Prescaler at 16 MHz
#+CAPTION: Prescaler 16 MHz
#+NAME:   tab: Prescaler 16 MHz
#+attr_latex: align=|c|c|c|l|c|
#+tblname: delsee
|------+------+--------+---------------------------------+-----|
| CS02 | CS01 |   CS00 |                              16 | MHz |
|------+------+--------+---------------------------------+-----|
|      |      | Clock: |                        16000000 | Hz  |
|------+------+--------+---------------------------------+-----|
|    0 |    0 |      0 |           Timer/Counter stopped |     |
|    0 |    0 |      1 |                   No prescaling |     |
|    0 |    1 |      0 |                         2000000 | Hz  |
|    0 |    1 |      1 |                          250000 | Hz  |
|    1 |    0 |      0 |                           62500 | Hz  |
|    1 |    0 |      1 |                           15625 | Hz  |
|    1 |    1 |      0 | External clock source on T0 pin |     |
|      |      |        |          Clock on falling edge. |     |
|    1 |    1 |      1 | External clock source on T0 pin |     |
|      |      |        |           Clock on rising edge. |     |
|------+------+--------+---------------------------------+-----|
#+TBLFM: @5$4=@2$4/8::@6$4=@2$4/64::@7$4=@2$4/256::@8$4=@2$4/1024

regards

I´ve installed the "old" version, 24.3 and now i face the same problem, so it seems to be a configuration problem, but i can´t remember that i have done something special to process an org-file in emacs.


texts: Navigate to the source code of built-in functions and variables

texts:
Throughout the day I am constantly using C-h f or C-h v (describe-function and describe-variable) to look up documentation for functions and variables. More often than not, if I don't get all the information I need, I will click on the file link at the end of:

some-random-command is an interactive compiled Lisp function in `some-mode.el'.

and navigate to the source code. This works for installed packages, but doesn't seem to work for built-in ones. For example, at the top of the help page for the command describe-function all I get is:

describe-function is an interactive compiled Lisp function.

with no link to the source code. Is there any way to quickly navigate to the source code of a built in package?

I know I can find source code in e.g., /usr/share/emacs/24.5/lisp, and come up with any number of ways to access that directory quickly, but I am curious if there is a quick and easy way to navigate to a built-in function/variable definition in the source code. Thank you!


texts: Configure indentation logic to ignore certain lines?

texts:
I am using outshine to organize my code (verilog/systemverilog language).

Here is an example use:

// * Class definition
class my_class extends my_base_class;
   // code ..

   // ** Task 1 definition
   virtual task my_task1;
         // code ..
   endtask

   // ** Task 2 definition
   virtual task my_task2;
         // code ..
   endtask
endclass

Currently, the // ** Task 1 definition and // ** Task 2 definition headers will not be detected as headers by the outshine/outline-mode code as they are auto-indented by my language major-mode: verilog-mode.

Question

Is it possible to tame the indentation logic to NOT certain lines; in this case, they would be the lines beginning with // *?

I have mentioned verilog-mode in this question but this can be a generic problem too, on how to make the indentation ignore certain lines irrespective of the major mode.

I have posted this question with correct contexts on the verilog-mode Forum as well as the outshine github IM.

Solution

Thanks to @glucas's answer, I now have the complete solution (my verilog setup on github) to this long-time problem!


texts: (orgmode) Coloring the line for the whole heading

texts:
I want the entire line containing a heading in orgmode to be the background color of that heading. So for instance right now I have is what is shown in Heading 1 and 2, but what I want looks like Heading 3 (the black line at the Heading 3 is my cursor, so ignore that).

This seems simple, but after a lot of fiddling around with customize-face, I am still unsure how to do this.

Please let me know if you would like more details about my current setup, but I am interested in being able to do this in general.


texts:
When I type H-z, emacs waits for more input, so I assume
something is bound to H-z plus something else, only in this case
C-h k H-z also just waits for more input.  How can I find out
what is bound to what starting with H-z?


texts: How to have both fixed linum and relative linum?

texts: I installed linum relative with this. But installing this replaced my fixed linum. I want to have both fixed line number and relative line number as well. How can I do this?


texts: describe key for menu-bar items from `menu-bar-open` calls

texts:
Preface: I disabled menu-bar-mode and bound <mouse-3> to menu-bar-open, via (global-set-key [mouse-3] #'menu-bar-open)

With this configuration, how can I get help for menu-bar items?
(My ugly workaround now is to temporary enable menu-bar-mode and call help with that enabled)

Problem is: pressing C-h k and then mouse-3 brings description for menu-bar-open.
What I'd like to get instead, is the same describe-key behaviour as on C-<mouse2> menus.
This should be done in a way, which does not break on emacs updates (i.e: redefining describe-key seems to dangerous).

If there is no way to do above , how could I bind <mouse-3> to open the menu-bar and get the desired help functionality?

Edit: Solution from Tobias is not complete, it does not show local-menu and minor-mode-menus. Function mouse-menu-bar-map, which is called from menu-bar-open collects them all.

Edit2: [C-down-mouse-3] does what I expect, but I can't remap this with:

(global-set-key [mouse-3] (lookup-key (current-global-map) [C-down-mouse-3]))


texts: How to disable line wrapping in Spacemacs?

texts:
I have limited emacs experience. Tried to find a solution to disable line wrapping in Spacemacs but couldn't find any.

The solution to this problem in Vim is to execute set nowrap. But it's not working in Spacemacs.

Any solution to this would be much appreciated.


texts: How can I hide a code block in the latex output?

texts:
I have the following line at the start of an org file to configure it to use listings for code blocks.

#+name: setup-listings
#+begin_src emacs-lisp :results silent :export none
  (setq org-latex-listings 't)
  (require 'ox-latex)
  (add-to-list 'org-latex-packages-alist '("" "listings"))
  (add-to-list 'org-latex-packages-alist '("" "color"))
#+end_src
#+call: setup-listings()

When I export this to a latex document the listings package gets set up correctly. But this block is also put in the latex document. What do I need to do so that this one specific block is not included into the output?


texts:
I have discovered the noweb syntax, and in particular how it can be used in org source blocks, very recently, and I have grown quite fond of it.

But inserting the references (is there a better term?) seems to be unnecessarily painful: it seems that I have to either remember the name of the source block I want to link to.

My current workflow for long references is to insert a space after << and use dabbrev-expand (which requires that I choose unique-enough prefixes).

I could certainly scrap together a completion feature automating this, or add a completion source scanning #+name and #+srcname. However, I do not like duplicating work (yes I am very lazy), and with all the completion features offered by org and 3rd-party packages, it strikes me as odd that nothing seems to provide completion for noweb references.

Are there any way of inserting noweb references with completion? And if not, is there a good reason for that?

MWE.org:

#+srcname: snippet-with-an-annoyingly-long-name
#+begin_src emacs-lisp
(message "Hello")
#+end_src

#+begin_src emacs-lisp
;; I would like to be able to insert the line below with the help of completion
<<snippet-with-an-annoyingly-long-name>>
#+end_src


texts: How to use custom macro indentation in elisp?

texts:
This blog post shows that its possible to indent like this:

(lispy-dotimes arg
  (when (= (point) (point-max))
    (error "Reached end of buffer"))
  (forward-list))

Instead of this:

(lispy-dotimes arg
               (when (= (point) (point-max))
                 (error "Reached end of buffer"))
               (forward-list))

The post has some snippets but not a enough for a beginner to change their emacs configuration.

How would a typical emacs mode hook be modified to indent like this? eg:

(add-hook
 'emacs-lisp-mode-hook
 (lambda ()
   ;; stuff goes here!
   ))


texts: Recalculating entire org-mode table with multiple sections

texts:
How can I recalculate this entire table?

If I type C-u C-c C-c with point at the start of the 'End Nubbin' line, only the formula that computes the total above the line containing 'other' gets recalculated, and not the other formulae.

I can get the result I want by placing point on each TBLFM line in turn and typing C-c C-c.  I would like to get that same result with a single command.

|-------------+---------|
| Other       |         |
|-------------+---------|
| Spam        |     100 |
| Ham         |      75 |
|             |         |
| ^           |   other |
|-------------+---------|
| Widgets     |         |
|-------------+---------|
| End Nubbin  |      10 |
| Side Nubbin |      20 |
|             |         |
| ^           | widgets |
|-------------+---------|
| Total       |         |
|-------------+---------|
|             |         |
| ^           |   total |
|-------------+---------|
#+TBLFM: $other=vsum(@-I..@-1)
#+TBLFM: $widgets=vsum(@-I..@-1)
#+TBLFM: $total=$other+$widgets


texts: In an interactive shell, I have a script I run that changes my directory (via pushd) and then launches an interactive program.  At this point I issue M-x cd and provide Emacs with the new directory that the script placed me in.  What I'd like to do is M-x pushd (or equivalent) so that when I exit the program, my subsequent command-line popd will be recognized by Emacs to adjust my directory accordingly.


texts:
Indentation in ESS is occasionally a little kooky, and I'm trying to figure out if the kookiness is a bug or a feature.  How does one get proper indentation of parentheses after an "=" sign in ESS (say, in R-mode)?

As an example, I'd expect indentation to look like this for the "labels" parameter:

somevar <- factor(x = 1:3,
                  labels = c("a",
                             "b",
                             "c"))

Instead, I get:

somevar <- factor(x = 1:3,
                  labels = c("a",
                    "b",
                    "c"))

This version (note the extra parentheses wrapped around the c(...) expression) seems to work just fine, however:

somevar <- factor(x = 1:3,
                  labels = (c("a",
                              "b",
                              "c")))

This oddity only seems to occur if it's after the "=".  How do I get the desired behavior?  Am I missing some setting somewhere?  (I hope so: wading through the source code for ess-indent-line is not an explosion of joy.)

NOTE: I'd originally asked a version of
this question on Stack Overflow about half a year ago -- it got a little interest but zero answers.


texts: Spacemacs: change prefix key from `SPC-b` to `SPC-v`

texts:
I use buffer (SPC-b) prefix key very often, and would like to move its keymap to a more convenient key (e.g. SPC-v). Is there a way to achieve this without redefining the entire map?

so I would like to move:

SPC-b-b to SPC-v-b
SPC-b-d to SPC-v-d

etc...


texts: Generate graphics from scheme-babel export?

texts:
I'm using a nice package from a Racket user called MetaPict, however, I don't know how to export the image produced. Here's some Racket code calling MetaPict:

#+begin_src scheme :session mainsession :exports both
(require racket/draw metapict metapict/graph)

(set-curve-pict-size 300 300)  ; width and height of image
(ahlength  1.0)                ; size of arrow head

(define (f x) (sin x))

(define p
  (with-window (window -12 12 -12 12)             ; xmin, xmax, ymin, ymax
    (draw (draw-arrow (curve (pt -10   0) -- (pt 10  0)))  ; x-axis
          (draw-arrow (curve (pt   0 -10) -- (pt  0 10)))  ; y-axis
          (label-rt  "x" (pt 10.2 0))                      ; label for x axis
          (label-top "y" (pt 0 10.2))                      ; label for y axis
          (color "blue" (draw (circle (pt 2 1) 3)))        ; center (2,1) radius 3
          (color "red"  (draw (graph f -10 10 #:samples 50))))))

(define (save-pict-as-svg p width height filename [exists 'replace])
  (define dc (new svg-dc%
                  [width width]
                  [height height]
                  [output filename]
                  [exists exists]))
  (send dc start-doc "An SVG Test")  ; a message
  (send dc start-page)
  (draw-pict p dc 0 0)
  (send dc end-page)
  (send dc end-doc))

(save-pict-as-svg p 300 300 "images/outtestmetapict1.svg")
#+end_src

No surprise, but orgmode doesn't know that the image output

(save-pict-as-svg p 300 300 "images/outtestmetapict1.svg")

should be the code block's results and then displaying it as an image. And adding #+RESULTS: over a hand-added [[file:images/outtestmetapict1.svg]] link makes it not display. I'm guessing this means orgmode does things internally with, say, gnuplot to make the generated image be the results, hence, obeying the :exports both . . . Any ideas how I can get this gnuplot-like behavior with Racket MetaPict? I'm guessing there is no trick, just a customization of the underlying babel code being necessary. . . .


texts: How to account for tabs in `hl-line-range-function`?

texts:
To avoid conflicts with highlighting indentation, I made the highlight line begin after the current indentation.

This works well, except when tabs are used as leading white space.

How could the my-hl-line-range-function calculate offsets taking tabs into account?

(global-hl-line-mode 1)

;; don't draw over indentation (annoying/distracting with indent guides)
(defun my-hl-line-range-function ()
  (cons
   ;; (point)  ;; works nice too, cursor instead of indentation
   (+ (line-beginning-position 1) (current-indentation))
   (line-beginning-position 2)))
(setq hl-line-range-function #'my-hl-line-range-function)


texts: Is the Hyper modifier key usable on non-X11 platforms?

texts:
I have a hyper modifier setup, however I was wondering if it's possible to use this on any windowing systems besides X11, for example:

macOS
Wayland
Win32
The terminal.


texts: what does grave accent ` and aposrophe ' do in elisp regular expression?

texts:
I use C-h v to check the doc about this variable org-agenda-file-regexp.

It says it is a variable defined in org.el.
Its value is

"\\`[^.].*\\.org\\'"

What is the meaning of grave accent ` and aposrophe ' here?


texts: How do I use the Evil-mode gg command in info?

texts: Normally, thanks to the power of Evil, I can use the Vim gg command to go to the beginning of a buffer. When browsing info, however, typing g brings up a "Go to node: " prompt. I don't even know what this prompt means. How can I circumvent this and run my gg? Or is there a better way I am supposed to return to the beginning of an info buffer?


texts:
With the cursor set just before B, how would I bring Bar next to Foo? I tried C-0 C-k, no avail.

     Foo

Bar

Desired:

 FooBar


texts: How to fix: [Suspicious state from syntax checker python-mypy: Flycheck checker python-mypy returned 2, but its output contained no errors]

texts:
I keep having following warning message, even I have the recent version of python-mypy not sure why this warning message is generated; is there any way to fix this:
Suspicious state from syntax checker python-mypy: Flycheck checker python-mypy returned 2, but its output contained no errors:
utils.py: error: Source file found twice under different module names: 'Program.utils' and 'utils'
Found 1 error in 1 file (checked 1 source file)

Try installing a more recent version of python-mypy, and please open a bug report if the issue persists in the latest release.
Thanks!

pip-setup:
$ pip freeze | grep mypy
flake8-mypy==17.8.0
mypy==0.790
mypy-extensions==0.4.3

output of elpy-config within the emacs:
Elpy Configuration

Emacs.............: 26.3
Elpy..............: 1.34.0
Virtualenv........: venv (/home/alper/venv)
Interactive Python: python3 3.7.5 (/home/alper/venv/bin/python3)
RPC virtualenv....: rpc-venv (/home/alper/.emacs.d/elpy/rpc-venv)
 Python...........: python 3.7.5 (/home/alper/.emacs.d/elpy/rpc-venv/bin/python)
 Jedi.............: 0.17.2
 Rope.............: 0.16.0
 Autopep8.........: 1.5.4
 Yapf.............: 0.30.0
 Black............: 20.8b1
Syntax checker....: flake8 (/home/alper/venv/bin/flake8)


texts:
Emacs 26.1.
To work with Git I use package magit. It's very nice package.
But I also need package to work with SVN. Has analog of magit but to work with SVN ?


texts: How to disable buffer movement in a particular window in emacs?

texts: I am trying to figure out if we can disable a particular window from switching the buffer it contains. If anyone has achieved that please share.


texts: Defining #+setupfile: *path* programmatically

texts:
I have a project under git which allows this

#+BEGIN_SRC emacs-lisp
(expand-file-name (car (project-roots (project-current))))
#+END_SRC

to find my project root automatically.

Now I want to use this path to automatically define my setup file location at the beginning of my regular org mode files.

The idea is:

#+SETUPFILE: (concat (expand-file-name (car (project-roots (project-current)))) "setup/setup.org")
#+TITLE: example
...

Unfortunately, this does not work as the expression (concat ...) is not interpreted as an emacs-lisp expression...

Is it possible to make it work?

update: to be sure to be able to run the provided example, please add

(require 'project)


texts: stop stripping result of :session for python print statement

texts:
Since default value for :result header is value print statement will only
show with :result output

#+BEGIN_SRC python :results output
  print('  hello')
#+END_SRC

#+RESULTS:
:   hello

but same thing in session is trimming whitespace trailing and preciding like python str.strip() method.

#+BEGIN_SRC python :results output :session test
  print('  hello')
#+END_SRC

#+RESULTS:
: hello

according to manual in Results-of-Evaluation verbatim which should Interpret literally seem only to work with value as stated in manual's usage example: ‘:results value verbatim’ will not show output of print.
How to stop the output being trimmed in session.

#+BEGIN_SRC python :results value verbatim :session test
  print('  hello')
#+END_SRC

#+RESULTS:


texts: Help setting up company mode. Autocompletion of HTML CSS files

texts:
Autocompletion of HTML file by company-mode is not working except when M-x company-web-html is explicitly called.

I'm expecting, for example, type 'di' in an html file, and get suggested 'div' for instance.

Here's my .emacs:

;; web stuff

;; automatically load web-mode when opening web-related files
(add-to-list 'auto-mode-alist '("\\.ts\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.css?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.js\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.scss\\'" . web-mode))

;; company-web configuration
;(add-to-list 'company-backends 'company-web-html)
;(add-to-list 'company-backends 'company-web-jade)
;(add-to-list 'company-backends 'company-web-slim)

;; set indentations
(defun my-web-mode-hook ()
  "Hooks for Web mode."
  (setq web-mode-markup-indent-offset 2)
  (setq web-mode-code-indent-offset 2)
  (setq web-mode-css-indent-offset 2)
)
(add-hook 'web-mode-hook  'my-web-mode-hook)
(setq tab-width 2)

;; highlight of columns
(setq web-mode-enable-current-column-highlight t)
(setq web-mode-enable-current-element-highlight t)

;; set the company completition vocabulary to css and html when in web-mode
(defun my-web-mode-hook ()
  (set (make-local-variable 'company-backends)
       '(company-css company-web-html company-yasnippet company-files))
)

;; emmet settings
;; turn on emmet in web-mode
(add-hook 'web-mode-hook  'emmet-mode)

;; emmet to switch between html and css properly in the same document
(add-hook 'web-mode-before-auto-complete-hooks
          (lambda ()
            (let ((web-mode-cur-language
                   (web-mode-language-at-pos)))
              (if (string= web-mode-cur-language "php")
                  (yas-activate-extra-mode 'php-mode)
                (yas-deactivate-extra-mode 'php-mode))
              (setq emmet-use-css-transform
                    (string= web-mode-cur-language "css")))))

;; use company-mode in all buffers
(add-hook 'after-init-hook 'global-company-mode)

When I do M-x company-web-html it autocompletes.


texts: Is there a way to use strings to name eshells

texts:
I know a numeric prefix will create (or switch to) a new eshell session with that number. Is there a way to assign a string instead of a number?

For example, normally I get the following:

*eshell*<1>
*eshell*<2>
*eshell*<3>
*eshell*<4>

I would like

*eshell*<project1/source>
*eshell*<project1/doc>
*eshell*<project2/source>
*eshell*<project2/doc>

I figure I can use counsel to quickly switch between a large number of eshells.

My ultimate goal is to have a command say eshell-dir. It will parse out the last 2 or 3 directories from default-directory and create the eshell string. Then I can either switch to that eshell session if it exists or I can open a new eshell session with the name eshell.

Even better yet if the name could use uniquify that would be amazing!

I figure if I get this to work, I can do 90% of my shell work in emacs which would be a huge plus for me.


texts:
As expected, the following dialog box expires after five seconds under Linux:

(progn
  (setq last-nonmenu-event nil)
  (y-or-n-p-with-timeout "Proceed? " 5 nil))

However, it lasts forever under Windows 10.
What am I doing wrong?

NOTE: The echo area version of y-or-n-p-with-timeout works in Windows too.


texts:
I often collect several meetings under one heading in my org files, e.g.:
* Interdisciplinary studies
** Paracelsus reading group
*** Meeting <2020-01-07>
    ...
*** Meeting <2020-01-14>
    ...
*** Meeting <2020-01-21>

In my agenda view, each such meeting will show up just with its headline Meeting.  It would be much more informative if the heading of the next higher level (Paracelsus reading group) were also displayed.  Is there any way to achieve this?  Or should I rather structure my org files differently?


texts: Org-mode add a property (e.g. effort) on the same row as my task (similar to priority and tags)

texts:
I'd like to show an additional property (e.g. EFFORT) on the same line as my tasks, so that it is always visible in both org-mode and agenda view. An example is below.

Current display:
TODO [#A] Description of my task <2019-11-18> :tag1:
:PROPERTIES:
:Effort: 15
:END:

I'd like something like this:
TODO [#A] [15] Description of my task <2019-11-18> :tag1:

Is this possible, preferably not using column view? Thanks.


texts: How to find the file-system location of a package?

texts:
Packages on my system are installed to ~/.config/emacs/elpa,although I assume it's possible to configure where packages are located.
How can I programmatically find the file-path for a package name (using a function call for example).
For example find: /home/my_user_name/.config/emacs/elpa/company-lsp-20190612.1553 from the package name company-lsp.


texts: What is the longest known key sequence in Emacs?

texts:
Qt supports Emacs-style keybindings, however for only up to four keys.  To make a point why this limit should be increased it would be useful to show examples of Emacs-style keybindings with even more keys than that.  Are there any known examples for this or maybe even a way to programmatically find long key sequences defined in Emacs keymaps?

edit: I thought this was common knowledge, but a key sequence is a set of keys as read in by read-key-sequence.  Try F1 k for your candidate and see whether it describes your command or an unrelated one preceding it.


texts:
How can I insert text so that the cursor stays in the same position while text I type is shifted to the left, overwriting existing text? For example:

   row_title: some words
   old_title: letters here
            ^

   row_title: some words
 newer_title: letters here
            ^

Where the ^ represents the position of the cursor.


texts:
I have anaconda environments for python2 and python3 as I have code written in the different versions

In spacemacs (with python layer installed), when I open ipython (SPC m s i) it starts with my default environment (python 3)

Is there a way to choose which version of python I run my code with? I've tried opening a shell with activate python2 to activate my other environment, but ipython in emacs still opens with my default

One way I've found is to activate the environment is SPC m V a then navigate to the directory where the venv is, but this is quite tedious as the python script and venv are often on different drives so it takes a fair bit of typing/tabbing to get to the venv directory

Is there a quicker way?


texts:
Windows 10, Emacs 25.1, Dired+, Dired-K

Here my test folder:

If I want to go folder test2 I press M-x and then C-s (I-search).
Here result:

OK. It's work.

But... I think it's slow.
It would be good if I can go to folder/file only by one letter.
E.g. If I press s then I go to file searchview.png. If I quickly press st then go to file step1.png. And so on.

Is it possible in Emacs?


texts: Matching any printable character but whitespace

texts:
I would like to match a word (that can contain any printable characters except space) separated on the left side by whitespace and on the right side by a newline or whitespace.

What is the difference between these two regex's:

[[:space:]]*\\([^[:space:]]+?\\)\\(?:[[:space:]]|$\\)
[[:space:]]*\\([[:graph:]]*\\)

And why does the first one not work?


texts:
Recently I have discovered tabnine, a really good completion backend. I wanted to use it in emacs. So I went through the installation procedure and now I have it. But when I M-x company-diag, it shows me that I am using company-yasnippet in major mode python. I want to use tabnine instead. How do I do that?
Emacs 27.1 (x86_64-pc-linux-gnu) of 2020-08-28 on juergen
Company 0.9.13

company-backends: ((company-anaconda)
 company-capf company-yasnippet company-tabnine)

Used backend: company-yasnippet
Major mode: python-mode

This is company-diag.


texts: org-mode: how can i point to python3.5 in my org-mode doc?

texts:
On:  Aquamacs 3.3  GNU Emacs 25.1.1 (x86_64-apple-darwin14.1.0, NS appkit-1344.72 Version 10.10.2 (Build 14C109))
of 2016-09-19
in mac osx sierra
I changed my ~/Library/Preferences/Aquamacs Emacs/Preferences.el
with the below:
(setq python-version-checked t)
(setq py-python-command "python3.5")

(eval-after-load "org"
  '(org-babel-do-load-languages
    'org-babel-load-languages
    '((sh . t)
      (python . t)
      (emacs-lisp . t)
      (ditaa . t))))

but it still fails to point to python 3.5.
Thanks!


texts: Bind Meta key to Command on Mac Without Altering its System-wide Behaviour

texts:
To switch between tasks on an unaltered MacOS Mojave (OS X 10.14.6), one uses command-tab, which is convenient when done with the thumb finger. Now, in order to turn on the meta key inside Terminal (to allow e.g. skipping words with the cursor inside bash backward and forward emacs-style), I can tick the 'use Option as Meta key' in Terminal.app preferences.
This setup leaves me with option as meta key inside emacs, which is not ergonomic, as the key is physically too much on the left and my thumb finger needs to bend to get there.
I would like to:

leave the command-tab system-wide key unaltered, in order to be able to exit the emacs context into another task
still have the command key to be the meta key in emacs (so that, e.g., meta-f and meta-b hop over words)
all of this while working inside terminal emacs, not emacs with GUI variant

Some things I tried:

swapping the command and option buttons in System Preferences/Keyboard/Modifier keys. This results in a need to press option-tab for the task manager
setting the mac-command-modifier variable, as explained here, however my emacs 26.3, installed via brew install emacs, doesn't seem to know about this variable (ctrl-
h-v doesn't recognize it at all and changing the variable doesn't have any effect)

Can this be done? In other words, is there a way to have the command key be meta in emacs and yet have command-tab still switch between tasks system-wide?


texts: Jump between two frames, code improvement

texts:
I often have got multiple emacs frame in various desktop, but only two of them are visible.
I often need to jump between those two frames, but since other frames are opened I can't use C-x 5 o, because it cycle among all of them.

For this purpose I wrote a code, which allows to jumps between two frames.
If in frame1, then pressing C-c C-, the current line will be highlighted. Then, if in frame2, pressing C-c C-., the current line will be highlighted and the cursor will jump the other frame (removing the highlighting of that line).

A working example is portrayed in the gif.

The code is the following.
Can you help me to extend the behaviour I got also between windows and positions in the same file, not only frame?
Thank you.
Moreover I am not expert with lisp and I am sure that the amount of code can be shortened.

        (defun my-jumping-bookmark-jump(bookmark-name)
          (setq pop-up-frames t)
          (bookmark-jump-other-window bookmark-name)
          (setq pop-up-frames nil))

        (defun my-jumping-bookmark-set() (interactive)
               (defvar my-jumping-bookmark-alternator)
               (setq my-jumping-bookmark-alternator 0)
               (bookmark-delete "my-jumping-bookmark0")
               (bookmark-delete "my-jumping-bookmark1")
               (bm-remove-all-all-buffers)
               (bookmark-set "my-jumping-bookmark0")
               (bm-toggle)
               (message "set"))

        (defun my-jumping-bookmark-switch() (interactive)
               (if (= (mod my-jumping-bookmark-alternator 2) 0)
                   (progn (bookmark-set "my-jumping-bookmark1")
                          (bm-toggle)
;this does not jump between frames or windows, only between positions in the same buffer
                          ;; (bookmark-jump "my-jumping-bookmark0")
;this does not jump between windows or positions in the same buffer, only between frames
                          (my-jumping-bookmark-jump "my-jumping-bookmark0")
;I used this in the beginning, instead of bm-remove-all-current-buffer, so to remove the highlighting only in the current line, but there is a bug in bm so if you go to the last position in a buffer, the current line is not influenced by bm-toggle
                          ;; (bm-toggle)
                          (bm-remove-all-current-buffer)
                          (bookmark-delete "my-jumping-bookmark0")
                          (setq my-jumping-bookmark-alternator 1)
                          (message "switched to 1"))
                 (progn (bookmark-set "my-jumping-bookmark0")
                        (bm-toggle)
                        ;; (bookmark-jump "my-jumping-bookmark1")
                        (my-jumping-bookmark-jump "my-jumping-bookmark1")
                        ;; (bm-toggle)
                        (bm-remove-all-current-buffer)
                        (bookmark-delete "my-jumping-bookmark1")
                        (setq my-jumping-bookmark-alternator 0)
                        (message "switched to 0"))))

        (global-set-key (kbd "C-c C-,") 'my-jumping-bookmark-set)
        (global-set-key (kbd "C-c C-.") 'my-jumping-bookmark-switch)

Finally, I want to thank the user who suggested me to use pop-up-frames, in this question.


texts: d seems to be bound to evil-delete which requires beg and end arguments. I suspect they are somehow obtained from d motion. Let's say I have defun my-delete-line (body). What should go in body to emulate <dd>?


texts: org-capture notes above footnotes header?

texts: Org-capture appends its notes to the bottom of my notes.org file. But this places them below the * Footnotes headline, which is problematic. Is there some way to configure org-capture so new notes are sent above the * Footnotes headline?


texts: Automatic clocking in org-mode when moving into section

texts:
Context When working on a larger document in org-mode I would like to clock the whole work time without gaps. As I usually have a logbook in each section I wonder if it's possible to automatically clock in when moving the cursor into a section and clock out when leaving it.

As far as I know there are only projects that clock out automatically when finishing tasks and that clock in a default clock afterwards. Although I really like the approach I have the feeling that it's not appropriate when writing a longer document whose sections usually get into the finished state very late and where sometimes jumping between section occurs, for example in periods in which only small issues are fixed.

The first time at least I saw such automatic clocking was in Bernt Hansen's org-mode configuration.

Question: How can automatic clocking be implemented, such that there is a clock-in when moving into a section and a clock-out when moving out of a section?


texts: How to allow trailing comma in function param list?

texts:
I have the following valid javascript with trailing comma in function parameters:

const a = (...params) => console.log(params);
a(
  1,
  2,
  3,
);

But in js2-mode I see the error missing ) after argument list. Here is the screenshot of my emacs window - https://i.stack.imgur.com/GFuBM.png

There is issue about that and PR for js2-mode on github:

issue https://github.com/mooz/js2-mode/issues/403
PR https://github.com/mooz/js2-mode/pull/410

As you can see on the screenshot I have the latest js2-mode with code from this PR.

Why do I still get this error? How can I fix or debug it?
Any help is appreciated

Edit 0: How to reproduce this in clean environment?

start clean emacs in docker using docker run --rm -ti jare/emacs emacs -nw
install js2-mode: M-x package-install RET js2-mode
create empty buffer, enable M-x js2-mode, type same text as in example
see the same error - https://i.stack.imgur.com/NYU6s.png


texts: apply-partially lets you create a new function by fixing the first n arguments of an existing function. Is there any way to achieve unrestricted partial function application, i.e., the ability to fix any n arguments of a function without the constraint that they be the first n? An example from another language is Python's functools.partial.


texts: Disable "Autocompletion"/"Abbreviation" in Verilog-Mode

texts:
When I use the Verilog Mode in spacemacs with evil keybindings, every time I type e.g. wire and press ESC, an automatic dialouge pops up and asks me msb:, lsb:  and name (RET to end).
This is super annoying, since pressing ESC in the prompt often leads to three blank lines and an open bracket.

Apparently this is defined in the verilog-define-abbrev-table in the verilog-mode.el, but I don't speak lisp, nor do I have deeper knowledge of emacs packages.

Changing the verilog-mode.el file is not possible, since I'm working on a multi user Server without sudo rights.

How can I disable the whole abbreviation-autocompletion stuff in the verilog mode?


texts: Binding option + arrow keys/backspace on Mac OS while still being able to enter special characters

texts: I want to be able to bind ⌥← to move the cursor to the previous word, ⌥→ to the next word, ⌥↓ to scroll down a page etc. in Emacs on Mac OS, as in native text editing controls, but also still be able to enter special characters using the option key. When I bind mac-option-modifier or ns-alternate-modifier to 'alt, I can bind things like I want, but no longer enter special characters; when I bind it to 'none, I can enter special characters but can’t use it for my key bindings.


texts: Insert entries and link to entries from org-contacts

texts:
I am trying to write functions that insert entries, or link to entries of my contacts org-mode file using org-contacts.

The functions would work as follows:

First prompt for a contact name (maybe using the org-contacts command).
On pressing l, insert a link to the selected contact where point was in the original buffer, then quit the temporary contacts buffer.
On pressing c, insert a copy of the subtree corresponding to the selected contact and exit the temporary buffer.

I think the following commands may come in handy: org-contact, org-store-link,     org-agenda-quit. I am working on it right now but my lisp skills are very limited. Any idea about how to proceed would be very welcome.

Linking could be made more robust by using a setup similare to these:

managing bibliography in org mode 1
managing bibliography in org mode 2

but this is probably even more complex.


texts: how to align python code in a long block?

texts:
In python, indentation level defines (?) a new block.

for a in range(10):
  print(a)
  for c in range(10):
     print(c)
  .......

# I'd like to code here but hard to know if lines are long..

when this goes long, it is hard to know where I should start coding.

Is there a tool in emacs that can aid this problem?


texts:
I would like to display the consistency graph in a new line below the task. This way I can use it for quite a long time without covering task letters or breaking the layout
 Example
 10:00 ...... TODO Workout in the gy||||*||*||**|||*|||||||

 should be displayed as                     ;;     ^
 10:00 ...... TODO Workout in the gym group ;;     |
              ||||*||*||**|||*|||||||       ;; <-- consistency graph

Any ideas on how to make the concistency graph easyer on the eyes (like this)?


texts: How to control image sizes inside of table

texts:
I know that you can write something like:
#+attr_html: :width 250 px
[[./linl/to/image.jpg]]

But what if I have them inside of a table like:
| [[./linl/to/image.jpg]] | [[./linl/to/image2.jpg]] |

Alternatively, is there another way to visualize images side by side in org mode?


texts: regexp-builder - no match with correct regexp. Why?

texts:
In buffer I has text

"ADA-SGD"
"ADT-SGD"
"ADX-SGD"
"AID-SGD"
"AMP-SGD"
"ANT-SGD"
"ARDR-SGD"
"ARK-SGD"

M-x regexp-builder

Input regexp:

"\([A-Z]+\)-\([A-Z]+\)"

But I get message:

No match.

Why?


texts: How can I unbind all symbol definitions with a certain prefix?

texts: I'm changing up the API of my package pretty frequently, but company-mode pulls every defined symbol (as it should) in its completions. I don't want to accidentally use an unbound name, so how can I unbind all variables and functions that start with, say, my-package-?  After this, I'll simply be able to load-file again.


texts: How to autoinstall fonts to system (e.g. for all-the-icon support) on first init run like autoinstalling emacs packages. I need crossplatfom solution (mac and linux). Or what is best practice to avoid it? For example, I don't remember that I installed fonts manually when I tried spacemacs. Thanks!


texts:
Recently I am indulging in Emacs. I tried to use it as my LaTeX tool, so I installed pdf-tools. If I add

(pdf-tools-install)

in my init file, it will take about 2 seconds to start Emacs. So I want to write a function such that "pdf-tools-install" will run after I open a pdf file. But "add-hook" only works when a major mode is recognized, and we can recognize pdf only after pdf-tools is installed. I think it may relate to regex, but I don't know much about it. Could you help me with this function? Thanks!


texts: I maintain information about relationships between research papers in a .org file. I would like to visualize these relationships as a graph, where each node (vertex) of the graph corresponds to a paper and each arc signifies a relationship between two papers. I know that I can do this using GraphViz DOT as described here. However, using that approach, the graph is just a picture. I would like this graph to have clickable nodes, whereby I would be able to open my notes about a paper (a .org file) by clicking on the node corresponding to that paper. Is there a tool I can use for creating such a graph with clickable nodes?


texts: How to use defvar with the symbol name in another variable?

texts:
I am trying to create a global variable which name is contained in another variable, using defvar:

(let ((var-name "my-test-var"))
  ;;(defvar (intern var-name) "some value")
  (defvar (make-symbol var-name) "some value"))

This gives error:

(wrong-type-argument symbolp (make-symbol var-name))

The following seems to work

(let ((var-name "my-test-var"))
  (let ((var-sym (intern var-name)))
    (setf (symbol-value var-sym) "some value")))

but is it equivalent to using defvar, and how can I add the doc string as in defvar?


texts: Emacs doesn't show cyryllic properly over SSH

texts:
I'm using SSH to connect to remote server. On the server, I'm running emacs (emacsclient -c). It servers as my console, text editor and WM. While everything works nice when I'm not dealing with cyryllic, when I'm to work with cyryllic letters, it gets bad.

I have a file, let's call it x, with "Юра" string in it. If I cat the file from console(without using Emacs), I get proper output. However, if I open it in Emacs, or cat it from ansi-term, I get the following output:

  \u042E\u0440\u0430

Now that's obviously not something I want. How can I make Emacs display the cyryllic?

locale is the same both under ansi-term and the terminal Emacs's running in(the one where russina letters are displayed correctly).


texts: How to find previous and next emails in mu4e

texts: Say that I'm looking at an email that's part of a chain in mu4e and I want to find the next and previous emails. Is there an easy way to do that?


texts:
GNU Emacs 26.1 (build 1, x86_64-apple-darwin16.7.0, Carbon Version 157 AppKit 1504.83) of 2019-01-27

I just recently installed the emacs-mac port of GNU Emacs 26, and the OS copy/paste functionality does not seem to work. I am on using the GUI so my understanding is the functionality should work OOB (It does for non-port)

I am not able to copy text from my OS into emacs or vice/versa.

Any help would be appreciated.


texts: How to get UTF-8 displayed properly in Emacs menus?

texts: I use GNU Emacs 23.4.1 that comes with Debian Wheezy and UTF-8 as system character encoding. When I add bookmark it displays properly in minibuffer and in the buffer, however the bookmark name is mangled in Emacs bookmarks menu ("Jump to bookmark" list to be exact). Any ideas?


texts:
I've been playing around with ranger in emacs and I'm really liking it for browsing new codebases. I would like to get syntax highlighting working, as it does when using ranger in a terminal. I'm not seeing much documentation around getting it working in ranger code previews in emacs.

MacOS

$ brew install ranger
$ brew install highlight
$ ranger --copy-config=all
$ ranger

this installs and launches ranger from the terminal and does syntax highlighting when I select most files containing code (.sh, .py, .go, .json, etc) . Also populated ~/.config/ranger with scope.sh, etc

Emacs init.el

(use-package ranger :ensure t)
(use-package highlight :ensure t)

ranger works great in emacs when I launch using M-x ranger, but I have no syntax highlighting when I select any files containing python, bash, go, etc code.


texts: Testing a package before submitting to Melpa

texts:
I'm going through the instructions at https://github.com/melpa/melpa/blob/master/CONTRIBUTING.org to submit a package to Melpa. I would like to test to see if my recipe installs the package properly into a vanilla emacs which does not interfere with my current emacs and its packages.
The Melpa page says this can be done via
EMACS_COMMAND=/path/to/emacs make sandbox INSTALL=<NAME>

I'm befuddled. I get that the first part of this sets a variable in my bash shell and the NAME is the name of the package, but I don't understand the -make sandbox- part or how this would be run. Could anyone please enlighten me?


texts: Hook that fires any time ANY file is opened?

texts: Is there a hook that gets called any time a file is opened, not a buffer but an actual file?


texts: Odd filename parsing error when scripting emacsclient on OSX

texts:
I get the same error as this Stack Overflow asker when trying to use a wrapper script to tell OSX where the emacs server socket is:

I don't think it's a bash issue, as the Emacs PID is correctly identified before the error log appears, and echo $@ returns the appropriate filename:

/ » ec installer.failurerequests
installer.failurerequests
Waiting for Emacs...
-emacs-pid 66202
-error Unknown&_command:&_//installer.failurerequests

For reference, here is the bash code:

#!/bin/bash

socket_file=$(lsof -c Emacs | grep server | tr -s " " | cut -d' ' -f8)

if [[ $socket_file == "" ]]; then

    /Application/Emacs.app/Contents/MacOS/Emacs $@ &

else
    ##### THIS IS THE BRANCH THAT IS RUN
    echo "$@"
    emacsclient --socket-name=$socket_file "$@"
fi

Is there some extra escaping needed on the emacs server side or something?


texts:
As Gnus documentation suggests, pressing B in the Summary Plugged mode deletes an email. So Gnus doesn't display them, but they're still visible in Web-based gmail client. Please note that I did set Auto-Expunge off - Wait for the client to update the server. and Immediately delete the message forever in my gmail account settings.

Is there a way to fix this?
Thanks.


texts: Problem inserting timestamps when the year is far removed from the current date

texts:
I am editing an old text file that has each entry preceded by a date = 11/23/1983. I would like to reformat this date to a org timestamp.  Using the various methods specified in the documentation is very cumbersome when the year is far removed from the current date.

I tried creating a date then editing it using the method described in the documentation pasted below.

‘S-     (org-timestamp-up)’
‘S-     (org-timestamp-down-down)’
     Change the item under the cursor in a timestamp.  The cursor can be
     on a year, month, day, hour or minute. ....

I can not get this method to work. I created a timestamp using the current date and then tried to edit as specified above. I can not put the cursor on the year, it is limited to the month field and will not allow me to put the cursor on any other field.

So what is the best way to enter a timestamp for say 11/23/1983?  There are many edits to be made so I need a simple and quick method.

Oh, I also tried just typing the date like 11/23/1983 and putting brackets around it [12/23/1983] hoping it would accept that as a timestamp but that hack failed.

Any suggestions/guidance appreciated.


texts: running emacs as a daemon does not load custom-set-faces?

texts:
I am starting with emacs --daemon in my session, and it seems to trigger some odd behavior regarding themes and faces. I am using this solarized theme but I have found it to have weird cursor issues. My fix was to customize the cursor face:

(custom-set-faces
 ;; https://github.com/bbatsov/solarized-emacs/issues/290
 '(cursor ((t (:background "#990A1B")))))

The strange thing is that works if I start emacs normally (with the emacs command). But when I start emacs as a daemon and open a frame (emacs --daemon ; emacsclient --create-frame /dev/null), the cursor customization is not present.

I have tried to configure a hook like this to run after the theme is loaded but it doesn't seem to take effect either:

(use-package solarized-theme
  :ensure t
  :config
  (progn
    (defvar after-load-theme-hook nil
      "Hook run after a color theme is loaded using `load-theme'.")
    (defadvice load-theme (after run-after-load-theme-hook activate)
      "Run `after-load-theme-hook'."
      (run-hooks 'after-load-theme-hook))
    (defun anarcat/customize-solarized ()
      "Customize theme"
      (message "custom hook config")
      (when (member 'solarized-dark custom-enabled-themes)
          (custom-theme-set-faces
           'solarized-dark
           '(cursor ((t (:background "#990A1B")))))
          (message "tweaked theme"))
      (message "done"))
    (add-hook 'after-load-theme-hook 'anarcat/customize-solarized)))

I know about this question and those answers but they all relate to the theme: the theme loads fine here, it's only the face that fails to load. But it does provide a workaround that actually works:

(if (daemonp)
    (add-hook 'after-make-frame-functions (lambda (frame)
                        (when (eq (length (frame-list)) 2)
                            (progn
                              (select-frame frame)
                              (custom-set-faces '(cursor ((t (:background "#990A1B"))))))))))

It just feels clunky and weird to run that every time a frame opens. Besides, this feels quite inelegant as it duplicates configuration between my .emacs and my .emacs-custom.

This question is also similar to this one although every settings but the faces load here.

So I'm wondering if that's a bug in Emacs worth reporting, or something I am doing wrong, or that the theme is doing wrong.

Any ideas?


texts: How to deal with duplicate mail in Gnus?

texts:
I've subscribed to the emacs-orgmode list on my Gmail account.  I've also subscribed Gnus to the list too, which means that I'm getting duplicates.  I prefer to read the mail in Gnus, and have it archived in Gmail, so that I have it even when gmane goes down for some time.

I would like to have an email marked as read in Gmail when I read it in the Gnus org-mode group.
I've set nnmail-treat-duplicates to t, but it doesn't seem to have an effect.


texts: On one specific machine, after some time, new emacsclients can no longer connect to running daemon/server

texts:
A strange problem. I run Emacs across a number of machines, with more-or-less a shared configuration.

However, on one specific machine, after some time I am no longer able to launch new emacsclient frames to make a connection to the locally-running emacs daemon.  For many hours I will have no problems connecting new emacsclient to the daemon, but eventually it occurs.  I usually find this after trying open a new emacsclient in the morning.

$ emacsclient -c
/usr/bin/emacsclient: connect: Connection refused
/usr/bin/emacsclient: No socket or alternate editor.  Please use:

    --socket-name
    --server-file      (or environment variable EMACS_SERVER_FILE)
    --alternate-editor (or environment variable ALTERNATE_EDITOR)

Currently open emacsclient frames continue to function normally.

The opening of new emacsclient frames can be re-enabled by running (server-start), which of course kills off all of the currently open emacsclient frames.

Since the system behaves normally for some time after launching emacs --daemon (or emacs --fg-daemon, as appropriate), and since none of my other systems exhibit this behaviour, I'm at a loss of how to debug this.


texts: Prevent menu-bar from expanding too much

texts:
The way I have things configured, some Emacs modes end up adding a lot of entries to the menu-bar. As a result, the Emacs frame increases in width. This results in various annoyances.

For now, I've disabled menu-bar-mode and use menu-bar-open as needed, but is there any way to get Emacs to display something like an "overflow" button in the  menu-bar, which I can click to access the entries that don't fit in the default width?


texts:
I am trying to modify pandoc-template-mode.el to deal with $$ which is an escape sequence for literal $ inside the Pandoc template. I have added the "\\$\\$" at the top but I still get bad font highlighting as if it were hitting last case of the function.

The modified pandoc-template-mode.el:

(defvar pandoc-template-font-lock-keywords
  '(("\\$\\$"
      (0 font-lock-keyword-face))
    ("\\$--.*"
      (0 font-lock-comment-face))
    ("\\(\\$\\)\\(if\\|for\\)(\\([^)]+\\))\\(\\$\\)"
      (1 font-lock-preprocessor-face)
      (2 font-lock-keyword-face)
      (3 font-lock-variable-name-face)
      (4 font-lock-preprocessor-face))
    ("\\(\\$\\)\\(endif\\|endfor\\|else\\)\\(\\$\\)"
      (1 font-lock-preprocessor-face)
      (2 font-lock-keyword-face)
      (3 font-lock-preprocessor-face))
    ("\\(\\$\\)\\(sep\\)\\(\\$\\)"
      (1 font-lock-preprocessor-face)
      (2 font-lock-builtin-face)
      (3 font-lock-preprocessor-face))
    ("\\(\\$\\)\\([^$]+\\)\\(\\$\\)"
      (1 font-lock-preprocessor-face)
      (2 font-lock-variable-name-face)
      (3 font-lock-preprocessor-face))
     )
  "Keyword highlighting specification for `pandoc-template-mode'.")

 ;;;###autoload
(define-derived-mode pandoc-template-mode fundamental-mode "Pandoc-Template"
  "A major mode for editing Pandoc-Template files."
  :syntax-table text-mode-syntax-table
  (setq-local font-lock-defaults
              '(pandoc-template-font-lock-keywords))
  (setq-local comment-start "$--")
  (setq-local comment-start-skip "\\$--[ \t]*")
  (setq-local comment-end "")
  (setq-local comment-end-skip "[ \t]*$"))

(provide 'pandoc-template-mode)

The test file with bad highlighting:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?aid style="50" type="snippet" readerVersion="6.0" featureSet="513" product="8.0(370)" ?>
<?aid SnippetType="InCopyInterchange"?>
<Document DOMVersion="8.0" Self="pandoc_doc">
    <RootCharacterStyleGroup Self="pandoc_character_styles">
      <CharacterStyle Self="$$ID/NormalCharacterStyle" Name="Default" />
      $charStyles$
    </RootCharacterStyleGroup>
    <RootParagraphStyleGroup Self="pandoc_paragraph_styles">
      <ParagraphStyle Self="$$ID/NormalParagraphStyle" Name="$$ID/NormalParagraphStyle"
          SpaceBefore="6" SpaceAfter="6"> <!-- paragraph spacing -->
        <Properties>
          <TabList type="list">
            <ListItem type="record">
              <Alignment type="enumeration">LeftAlign</Alignment>
              <AlignmentCharacter type="string">.</AlignmentCharacter>
              <Leader type="string"></Leader>
              <Position type="unit">10</Position> <!-- first tab stop -->
            </ListItem>
          </TabList>
        </Properties>
      </ParagraphStyle>
      $parStyles$
    </RootParagraphStyleGroup>
    <RootTableStyleGroup Self="pandoc_table_styles">
      <TableStyle Self="TableStyle/Table" Name="Table" />
    </RootTableStyleGroup>
    <RootCellStyleGroup Self="pandoc_cell_styles">
      <CellStyle Self="CellStyle/Cell" AppliedParagraphStyle="ParagraphStyle/$$ID/[No paragraph style]" Name="Cell" />
    </RootCellStyleGroup>
  <Story Self="pandoc_story"
      TrackChanges="false"
      StoryTitle="$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$"
      AppliedTOCStyle="n"
      AppliedNamedGrid="n" >
    <StoryPreference OpticalMarginAlignment="true" OpticalMarginSize="12" />

<!-- body needs to be non-indented, otherwise code blocks are indented too far -->
$body$

  </Story>
  $hyperlinks$
</Document>

The issue is that on the 6th line of the template above (<CharacterStyle Self="$$ID/NormalCharacterStyle" Name="Default" />) the $$ is matched and colored but then the rest of the text should be uncolored. What actually happens is that the rest of the text after $$ is colored as if the last rule of the function matched as well.